继续操作前请注册或者登录。
提交 bc424e97 authored 作者: 李炎's avatar 李炎

改bug

上级 f22ee536
......@@ -20,7 +20,7 @@ public class ProductionSchedulingTimed implements Job {
@Autowired
IProductionSchedulingService productionSchedulingService;
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
@Scheduled(fixedDelay = 1000*60*10)
// @Scheduled(fixedDelay = 1000*60*10)
public void job() throws ParseException {
productionSchedulingService.synchronization(null);
// System.out.println("执行了");
......
package org.jeecg.modules.iost.API.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringEscapeUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.iost.API.entity.Purchaseorder;
import org.jeecg.modules.iost.API.entity.Purchaseordererror;
import org.jeecg.modules.iost.API.lanjieqi.Lanjieqi_API;
import org.jeecg.modules.iost.API.service.PurchaseordererrorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
/**
* 实物ID信息
*/
@Api(tags="同步金蝶国网返回日志")
@RestController
@RequestMapping("/API/purchase-order-journal")
@Slf4j
public class PurchaseordererrorController {
@Autowired
private PurchaseordererrorService purchaseordererrorService;
/**
* 分页列表查询
*
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "金蝶销售订单接口-分页列表查询")
@ApiOperation(value = "金蝶销售订单接口-分页列表查询", notes = "金蝶销售订单接口-分页列表查询")
@GetMapping(value = "list")
public Result<?> queryPageList(Purchaseordererror purchaseordererror,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<Purchaseordererror> purchaseordererrorQueryWrapper = QueryGenerator.initQueryWrapper(purchaseordererror, req.getParameterMap());
Page<Purchaseordererror> purchaseorderPage = new Page<>(pageNo, pageSize);
IPage<Purchaseordererror> page = purchaseordererrorService.page(purchaseorderPage, purchaseordererrorQueryWrapper);
return Result.OK(page);
}
@GetMapping(value = "select")
public Result<?> select() {
Map<String, Object> id = purchaseordererrorService.getMap(new QueryWrapper<Purchaseordererror>().eq("id", "1426426456518492162"));
return Result.OK(id);
}
}
......@@ -106,7 +106,7 @@ public class Physicalid implements Serializable {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
@ApiModelProperty(value = "审核日期记录")
private Date fapprovedate;
//*实体主键*//
//*实物ID编码*//
private String fbillno;
/**单据编号**/
private String fid;
......
......@@ -109,10 +109,10 @@ public class Purchaseorder implements Serializable {
* 采购技术固化ID
*/
private String fixedTechId;
/**
* 合同包号/
* private String pkgNo;
* /**招标批次号
// 合同包号
private String pkgNo;
/**招标批次号
*/
private String bidBatCode;
/**
......
......@@ -16,94 +16,142 @@ import org.springframework.format.annotation.DateTimeFormat;
@TableName("salesorder")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="salesorder对象", description="销售订单API")
@ApiModel(value = "salesorder对象", description = "销售订单API")
public class Salesorder {
private static final long serialVersionUID = 1L;
/**主键*/
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**采购方总部编码*/
/**
* 采购方总部编码
*/
@Excel(name = "采购方总部编码", width = 15)
@ApiModelProperty(value = "采购方总部编码")
private String purchaserhqcode;
/**销售订单号*/
/**
* 销售订单号
*/
@Excel(name = "销售订单号", width = 15)
@ApiModelProperty(value = "销售订单号")
private String sono;
/**供应商编码*/
/**
* 供应商编码
*/
@Excel(name = "供应商编码", width = 15)
@ApiModelProperty(value = "供应商编码")
private String suppliercode;
/**采购方公司编码*/
/**
* 采购方公司编码
*/
@Excel(name = "采购方公司编码", width = 15)
@ApiModelProperty(value = "采购方公司编码")
private String buyercode;
/**采购方公司名称*/
/**
* 采购方公司名称
*/
@Excel(name = "采购方公司名称", width = 15)
@ApiModelProperty(value = "采购方公司名称")
private String buyername;
/**采购方公司省份*/
/**
* 采购方公司省份
*/
@Excel(name = "采购方公司省份", width = 15)
@ApiModelProperty(value = "采购方公司省份")
private String buyerprovince;
/**品类编码*/
/**
* 品类编码
*/
@Excel(name = "品类编码", width = 15)
@ApiModelProperty(value = "品类编码")
private String categorycode;
/**种类编码*/
/**
* 种类编码
*/
@Excel(name = "种类编码", width = 15)
@ApiModelProperty(value = "种类编码")
private String subclasscode;
/**销售订单状态*/
/**
* 销售订单状态
*/
@Excel(name = "销售订单状态", width = 15)
@ApiModelProperty(value = "销售订单状态")
private String sostatus;
/**销售订单行项目号*/
/**
* 销售订单行项目号
*/
@Excel(name = "销售订单行项目号", width = 15)
@ApiModelProperty(value = "销售订单行项目号")
private String soitemno;
/**采购订单行项目ID*/
/**
* 采购订单行项目ID
*/
@Excel(name = "采购订单行项目ID", width = 15)
@ApiModelProperty(value = "采购订单行项目ID")
private String poitemid;
/**物资编码*/
/**
* 物资编码
*/
@Excel(name = "物资编码", width = 15)
@ApiModelProperty(value = "物资编码")
private String productcode;
/**物资名称*/
/**
* 物资名称
*/
@Excel(name = "物资名称", width = 15)
@ApiModelProperty(value = "物资名称")
private String productname;
/**物资单位*/
/**
* 物资单位
*/
@Excel(name = "物资单位", width = 15)
@ApiModelProperty(value = "物资单位")
private String productunit;
/**物资数量*/
/**
* 物资数量
*/
@Excel(name = "物资数量", width = 15)
@ApiModelProperty(value = "物资数量")
private String productamount;
/**数据拥有方*/
/**
* 数据拥有方
*/
@Excel(name = "数据拥有方", width = 15)
@ApiModelProperty(value = "数据拥有方")
private String ownerid;
/**数据可见方*/
/**
* 数据可见方
*/
@Excel(name = "数据可见方", width = 15)
@ApiModelProperty(value = "数据可见方")
private String openid;
/**数据来源 0:供应商, 1:网关, 2:代理*/
/**
* 数据来源 0:供应商, 1:网关, 2:代理
*/
@Excel(name = "数据来源 0:供应商, 1:网关, 2:代理", width = 15)
@ApiModelProperty(value = "数据来源 0:供应商, 1:网关, 2:代理")
private String datasource;
/**来源数据创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
/**
* 来源数据创建时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "来源数据创建时间", width = 15)
@ApiModelProperty(value = "来源数据创建时间")
private String datasourcecreatetime;
/**实体主键*/
/**
* 实体主键
*/
@Excel(name = "实体主键", width = 15)
@ApiModelProperty(value = "实体主键")
private String fid;
/**
* 销售订单编码
*/
@Excel(name = "销售订单编码", width = 15)
@ApiModelProperty(value = "销售订单编码")
private String fbillno;
}
......@@ -37,9 +37,9 @@ public class Supplylist implements Serializable {
@Excel(name = "实体主键", width = 15)
@ApiModelProperty(value = "实体主键")
private String fid;
/**单据编号*/
@Excel(name = "单据编号", width = 15)
@ApiModelProperty(value = "单据编号")
/**供货单编码*/
@Excel(name = "供货单编码", width = 15)
@ApiModelProperty(value = "供货单编码")
private String fbillno;
/**采购方总部编码*/
@Excel(name = "采购方总部编码", width = 15)
......
......@@ -221,11 +221,15 @@ public class PhysicalIDerrorServiceImpl extends ServiceImpl<PhysicaliderrorMappe
}
public String timeSSS(String selectedTimeStamp) {
int x = selectedTimeStamp.length() - selectedTimeStamp.lastIndexOf('.');
if (x == 2)
selectedTimeStamp += "00";
if (x == 3)
selectedTimeStamp += '0';
if (selectedTimeStamp.indexOf(".")>0) {
int x = selectedTimeStamp.length() - selectedTimeStamp.lastIndexOf('.');
if (x == 2)
selectedTimeStamp += "00";
if (x == 3)
selectedTimeStamp += '0';
}else {
selectedTimeStamp += ".000";
}
return selectedTimeStamp;
}
......
......@@ -53,19 +53,12 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
@Override
public JSONObject select(Map<String, String> map) {
JSONObject jsonObject = JSONObject.fromObject(purchaseorderApi.select());
String webreq = salesOrderWebapi.add(jsonObject);
JSONObject js = JSONObject.fromObject(webreq);//JSON.parseObject(json,Map.class);
JSONObject js2 = JSONObject.fromObject(js.get("Result"));
Purchaseorder purchaseorder = (Purchaseorder) JSONObject.toBean(jsonObject, Purchaseorder.class);
purchaseorder.setId(js2.get("id").toString());
purchaseorder.setId(js2.get("Number").toString());
this.save(purchaseorder);
return jsonObject;
return null;
}
//从国网同步采购订单数据至金蝶销售订单
public Boolean synchronizationList(Map object) throws IOException, ParseException {
public synchronized Boolean synchronizationList(Map object) throws IOException, ParseException {
Boolean success = true;
/**
* 获取记录的最大时间访问国网
......@@ -82,7 +75,6 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
}
JSONObject jsonObject = JSONObject.fromObject(purchaseorderApi.selectList(map));
System.out.println("jsonObject "+jsonObject);
if (jsonObject.get("success") == null) {
//请求国网的返回信息
JSONObject resultValue = JSONObject.fromObject(jsonObject.get("resultValue"));
......@@ -163,6 +155,7 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
if (map.get("prjname") == null ||
map.get("materialcode") == null ||
map.get("amount") == null || Integer.parseInt(map.get("amount").toString()) <= 0) {
System.out.println("saveBatch"+map);
} else {
JSONObject model = JSONObject.fromObject(map);//转换数据格式
Map<String, Object> SAL_SaleOrder = FieldConversion.nameAPI(model);//拼接需要的数据 字段转换
......@@ -185,6 +178,7 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
}
}
}
boolean save = this.saveBatch(purchaseordersAdd);//记录明细
return save;
}
......
......@@ -202,6 +202,7 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, Salesor
s.setDatasource(stringStringMap.get("datasource"));
s.setDatasourcecreatetime(stringStringMap.get("datasourcecreatetime"));
s.setFid(stringStringMap.get("fid"));
s.setFbillno(stringStringMap.get("fbillno"));
salesorders.add(s);
}
}
......@@ -40,6 +40,7 @@ public class SalesOrderWebapi implements web_api {
key.put("FUnitID", "FUnitID");// 物料单位5
key.put("FQTY", "FQTY");//物料数量6
key.put("FID", "FID");//主键7
key.put("FBillNo","FBillNo ");//单据编号8
}
@Autowired
......@@ -110,6 +111,7 @@ public class SalesOrderWebapi implements web_api {
salesordermap.put("productunit", list1.get(5).toString());// 物料单位
salesordermap.put("productamount", list1.get(6).toString());//物料数量
salesordermap.put("fid", list1.get(7).toString());//实体主键 ,设置了后不能重复插入
salesordermap.put("fbillno",list1.get(8).toString());//销售订单编码
salesorderlist.add(salesordermap);
}
}
......
spring:
profiles:
active: docker
active: test
swagger:
production: false
basic:
......
......@@ -2,6 +2,7 @@ package org.jeecg;
import com.alibaba.fastjson.JSON;
import kingdee.bos.webapi.client.K3CloudApiClient;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
......@@ -10,10 +11,12 @@ import org.jeecg.common.util.security.entity.*;
import org.jeecg.modules.iost.API.Dao.CategoryDao;
import org.jeecg.modules.iost.API.Util.HttpUtils;
import org.jeecg.modules.iost.API.dto.EIP;
import org.jeecg.modules.iost.API.entity.Physicalid;
import org.junit.Test;
import org.springframework.scheduling.annotation.EnableScheduling;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -87,18 +90,33 @@ public class SecurityToolsTest {
return jsonObject;
}
@Test
public void S() {
Random r = new Random();
public void S() throws ParseException {
//map转实体类
// 第一种方法
// int num = (int) (Math.random() * 5 + 1);
// System.out.println("num:" + num);
// 第二种方法
int a = r.nextInt(5) + 1;
System.out.println("a:" + a);
String fApproveDate ="2021-10-06T15:59:20.90";
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
Date parse = null;
parse = simpleDateFormat.parse(timeSSS(fApproveDate));//时间转换毫秒补丁
SimpleDateFormat fs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
String format = fs.format(parse);
System.out.println(parse);
System.out.println(format);
}
public String timeSSS(String selectedTimeStamp) {
if (selectedTimeStamp.indexOf(".")>0) {
int x = selectedTimeStamp.length() - selectedTimeStamp.lastIndexOf('.');
if (x == 2)
selectedTimeStamp += "00";
if (x == 3)
selectedTimeStamp += '0';
}else {
selectedTimeStamp += ".000";
}
return selectedTimeStamp;
}
/**
* 测试定时
*/
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论