提交 f22ee536 authored 作者: 李炎's avatar 李炎

修改bug

上级 597d180c
...@@ -28,7 +28,7 @@ public class PhysicalIDTimed implements Job { ...@@ -28,7 +28,7 @@ public class PhysicalIDTimed implements Job {
public void Materialinventory() throws IOException, ParseException { public void Materialinventory() throws IOException, ParseException {
physicalIDService.synchronization(null); physicalIDService.synchronization(null);
System.out.println("执行了"); // System.out.println("执行了");
} }
@Override @Override
......
...@@ -20,9 +20,10 @@ public class ProductionOrderTimed implements Job { ...@@ -20,9 +20,10 @@ public class ProductionOrderTimed implements Job {
@Autowired @Autowired
IProductionOrderService productionOrderService; IProductionOrderService productionOrderService;
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点 @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
// @Scheduled(fixedDelay = 1000*60) // @Scheduled(fixedDelay = 1000*60*10)
public void job() throws ParseException { public void job() throws ParseException {
productionOrderService.synchronization(null); productionOrderService.synchronization(null);
} }
@SneakyThrows @SneakyThrows
......
...@@ -20,9 +20,10 @@ public class ProductionSchedulingTimed implements Job { ...@@ -20,9 +20,10 @@ public class ProductionSchedulingTimed implements Job {
@Autowired @Autowired
IProductionSchedulingService productionSchedulingService; IProductionSchedulingService productionSchedulingService;
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点 @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
// @Scheduled(fixedDelay = 1000*60) @Scheduled(fixedDelay = 1000*60*10)
public void job() throws ParseException { public void job() throws ParseException {
productionSchedulingService.synchronization(null); productionSchedulingService.synchronization(null);
// System.out.println("执行了");
} }
@SneakyThrows @SneakyThrows
......
...@@ -26,7 +26,7 @@ public class PurchaseorderTimed implements Job { ...@@ -26,7 +26,7 @@ public class PurchaseorderTimed implements Job {
* 测试定时 * 测试定时
*/ */
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点 @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
// @Scheduled(fixedDelay = 1000 * 60) // @Scheduled(fixedDelay = 1000 * 60 * 10)
public void Materialinventory() throws IOException, ParseException { public void Materialinventory() throws IOException, ParseException {
iPurchaseorderService.synchronizationList(null); iPurchaseorderService.synchronizationList(null);
......
...@@ -25,9 +25,10 @@ public class SalesOrderTimed implements Job { ...@@ -25,9 +25,10 @@ public class SalesOrderTimed implements Job {
@Autowired @Autowired
ISalesOrderService salesOrderService; ISalesOrderService salesOrderService;
@Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点 @Scheduled(cron = "0 0 1 * * ?")//cron表达式每天凌晨一点
// @Scheduled(fixedDelay = 1000*60) // @Scheduled(fixedDelay = 1000*60*10)
public void job() throws ParseException { public void job() throws ParseException {
salesOrderService.synchronization(null); salesOrderService.synchronization(null);
// System.out.println("执行完成");
} }
@SneakyThrows @SneakyThrows
......
...@@ -72,6 +72,7 @@ public class ProductionOrderServiceImpl extends ServiceImpl<ProductionOrderMappe ...@@ -72,6 +72,7 @@ public class ProductionOrderServiceImpl extends ServiceImpl<ProductionOrderMappe
} }
//保存金蝶云操作的日志记录 //保存金蝶云操作的日志记录
list = addKingdeeJournalProductionOrder(synchronization); list = addKingdeeJournalProductionOrder(synchronization);
if (list == null || list.size() < 1) return false; if (list == null || list.size() < 1) return false;
//从金蝶云查询数据(传给国网用) //从金蝶云查询数据(传给国网用)
...@@ -87,6 +88,7 @@ public class ProductionOrderServiceImpl extends ServiceImpl<ProductionOrderMappe ...@@ -87,6 +88,7 @@ public class ProductionOrderServiceImpl extends ServiceImpl<ProductionOrderMappe
//创建list对象 //创建list对象
// ArrayList<Productionordererror> Productionordererrors = new ArrayList<>(); // ArrayList<Productionordererror> Productionordererrors = new ArrayList<>();
ArrayList<ProductionOrder> productionOrders = new ArrayList<>(); ArrayList<ProductionOrder> productionOrders = new ArrayList<>();
for (Map<String, String> stringStringMap : list) { for (Map<String, String> stringStringMap : list) {
// 向国网添加数据 // 向国网添加数据
String rs = productionOrderApi.add(stringStringMap); String rs = productionOrderApi.add(stringStringMap);
...@@ -163,6 +165,7 @@ public class ProductionOrderServiceImpl extends ServiceImpl<ProductionOrderMappe ...@@ -163,6 +165,7 @@ public class ProductionOrderServiceImpl extends ServiceImpl<ProductionOrderMappe
Boolean ny = webApiLog.setKingdeeJournal(key, name,BusinessNo, selectInList); Boolean ny = webApiLog.setKingdeeJournal(key, name,BusinessNo, selectInList);
if (ny) {//记录金蝶日志并判断是否转换国网字段 if (ny) {//记录金蝶日志并判断是否转换国网字段
list = productionOrderWebapi.ProductionOrder(selectInList); list = productionOrderWebapi.ProductionOrder(selectInList);
} }
break; break;
} }
......
...@@ -82,6 +82,7 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P ...@@ -82,6 +82,7 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
} }
JSONObject jsonObject = JSONObject.fromObject(purchaseorderApi.selectList(map)); JSONObject jsonObject = JSONObject.fromObject(purchaseorderApi.selectList(map));
System.out.println("jsonObject "+jsonObject);
if (jsonObject.get("success") == null) { if (jsonObject.get("success") == null) {
//请求国网的返回信息 //请求国网的返回信息
JSONObject resultValue = JSONObject.fromObject(jsonObject.get("resultValue")); JSONObject resultValue = JSONObject.fromObject(jsonObject.get("resultValue"));
...@@ -90,7 +91,7 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P ...@@ -90,7 +91,7 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
if (null == list && 0 == list.size()) return false; if (null == list && 0 == list.size()) return false;
//记录请求国网的返回信息 //记录请求国网的返回信息
Map<Boolean, String> booleanStringMap = gridErrorService.setGridError(jsonObject, JsonUtil.Mapjson(map), BusinessNo); Map<Boolean, String> booleanStringMap = gridErrorService.setGridError(jsonObject, JsonUtil.Mapjson(map), BusinessNo);
String ReturnProcessId = null; String ReturnProcessId = null;//请求国网日志id
if (booleanStringMap.containsKey(true)) { if (booleanStringMap.containsKey(true)) {
ReturnProcessId = booleanStringMap.get(true); ReturnProcessId = booleanStringMap.get(true);
} }
...@@ -166,15 +167,17 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P ...@@ -166,15 +167,17 @@ public class PurchaseorderServiceImpl extends ServiceImpl<PurchaseorderMapper, P
JSONObject model = JSONObject.fromObject(map);//转换数据格式 JSONObject model = JSONObject.fromObject(map);//转换数据格式
Map<String, Object> SAL_SaleOrder = FieldConversion.nameAPI(model);//拼接需要的数据 字段转换 Map<String, Object> SAL_SaleOrder = FieldConversion.nameAPI(model);//拼接需要的数据 字段转换
String rswebapi = salesOrderWebapi.add(SAL_SaleOrder);//同步到金蝶 String rswebapi = salesOrderWebapi.add(SAL_SaleOrder);//同步到金蝶
System.out.println(rswebapi);
JSONObject Result = JSONObject.fromObject(rswebapi);// JSONObject Result = JSONObject.fromObject(rswebapi);//
JSONObject ResponseStatus = JSONObject.fromObject(JSONObject.fromObject(Result.get("Result")).get("ResponseStatus")); JSONObject ResponseStatus = JSONObject.fromObject(JSONObject.fromObject(Result.get("Result")).get("ResponseStatus"));
//记录金蝶日志 //记录金蝶日志
setKingdeeJournalReturnProcess(JsonUtil.Objectjson(SAL_SaleOrder), ReturnProcessId, rswebapi, JsonUtil.Objectjson(map)); setKingdeeJournalReturnProcess(JsonUtil.Objectjson(SAL_SaleOrder), ReturnProcessId, rswebapi, JsonUtil.Objectjson(map));
List<Map<String, String>> SuccessEntitys = (List<Map<String, String>>) ResponseStatus.get("SuccessEntitys");//金蝶云返回值SuccessEntitys List<Map<String, String>> SuccessEntitys = (List<Map<String, String>>) ResponseStatus.get("SuccessEntitys");//金蝶云返回值SuccessEntitys
Map<String, String> stringStringMap = SuccessEntitys.get(0);
if (stringStringMap.get("Id") != null && stringStringMap.get("Number") != null) { Map<String, String> stringStringMap = 0==SuccessEntitys.size()?null:SuccessEntitys.get(0);
if (null!=stringStringMap)
if (null != stringStringMap.get("Id") && null != stringStringMap.get("Number")) {
map.put("FId", stringStringMap.get("Id")); map.put("FId", stringStringMap.get("Id"));
map.put("FNumber", stringStringMap.get("Number")); map.put("FNumber", stringStringMap.get("Number"));
//获取返回数据记录到记录明细 //获取返回数据记录到记录明细
......
...@@ -36,6 +36,7 @@ public class PhysicalIDWebapi implements web_api { ...@@ -36,6 +36,7 @@ public class PhysicalIDWebapi implements web_api {
private ProductionOrderWebapi productionOrderWebapi; private ProductionOrderWebapi productionOrderWebapi;
@Autowired @Autowired
private IPurchaseorderService purchaseorderService; private IPurchaseorderService purchaseorderService;
public PhysicalIDWebapi() { public PhysicalIDWebapi() {
/*查询字段*/ /*查询字段*/
keyList.add("FBILLNO");//单据编码0 keyList.add("FBILLNO");//单据编码0
...@@ -87,26 +88,40 @@ public class PhysicalIDWebapi implements web_api { ...@@ -87,26 +88,40 @@ public class PhysicalIDWebapi implements web_api {
* @return * @return
*/ */
public List<Map<String, String>> PhysicalID(List<List<Object>> list) throws ParseException { public List<Map<String, String>> PhysicalID(List<List<Object>> list) throws ParseException {
System.out.println(list.size() + "list" + list);
List<Map<String, String>> salesorderlist = new ArrayList<>(); List<Map<String, String>> salesorderlist = new ArrayList<>();
Map<String, String> fid = new IdentityHashMap<String, String>(); Map<String, String> fid = new IdentityHashMap<String, String>();
for (List<Object> list1 : list) {//获取生产订单id 拼接查询条件 for (List<Object> list1 : list) {//获取生产订单id 拼接查询条件
fid.put(new String("fid = "), list1.get(7).toString()); fid.put(new String("fid = "), list1.get(7).toString());
} }
List<List<Object>> FSaleOrderIds = productionOrderWebapi.selectOr(fid);//查询关联生产订单 List<List<Object>> FSaleOrderIds = productionOrderWebapi.selectOr(fid);//查询关联生产订单
int i=0;
for (List<Object> list1 : list) { List<List<Object>> f=new ArrayList<>();
List<List<Object>> l=new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
String s = list.get(i).get(7).toString();
label:for (int j = 0; j < FSaleOrderIds.size(); j++) {
if (s.equals(FSaleOrderIds.get(j).get(1).toString())) {
f.add(list.get(i));
l.add(FSaleOrderIds.get(j));
FSaleOrderIds.remove(j);
break label;
}
}
}
int i = 0;
for (List<Object> list1 : f) {
Map<String, String> salesordermap = new HashMap<>(); Map<String, String> salesordermap = new HashMap<>();
QueryWrapper<Purchaseorder> queryWrapper = new QueryWrapper<>(); QueryWrapper<Purchaseorder> queryWrapper = new QueryWrapper<>();
queryWrapper.select("F_Id"); queryWrapper.select("F_Id");
Object SaleOrderId = FSaleOrderIds.get(i++).get(0);//销售订单id,可匹配过滤是否平台生成订单获取采购订单行项目号 Object SaleOrderId = l.get(i++).get(0);//销售订单id,可匹配过滤是否平台生成订单获取采购订单行项目号
queryWrapper.eq("F_Id", SaleOrderId.toString()); queryWrapper.eq("F_Id", SaleOrderId.toString());
//查询是否为集成平台生成的订单,并过滤 //查询是否为集成平台生成的订单,并过滤
Purchaseorder purchaseorders1 = purchaseorderService.getBaseMapper().selectOne(queryWrapper); Purchaseorder purchaseorders1 = purchaseorderService.getBaseMapper().selectOne(queryWrapper);
if (purchaseorders1==null) continue; if (purchaseorders1 == null) continue;
System.out.println("getFId"+purchaseorders1.getFId()); System.out.println("getFId" + purchaseorders1.getFId());
System.out.println("getPoItemId"+purchaseorders1.getPoItemId()); System.out.println("getPoItemId" + purchaseorders1.getPoItemId());
salesordermap.put("poItemId",purchaseorders1.getPoItemId());//采购订单行项目id salesordermap.put("poItemId", purchaseorders1.getPoItemId());//采购订单行项目id
String id = list1.get(0).toString(); String id = list1.get(0).toString();
salesordermap.put("suppliercode", "linqin");//供应商编码 salesordermap.put("suppliercode", "linqin");//供应商编码
salesordermap.put("purchaserhqcode", "SGCC");//采购方总部编码 salesordermap.put("purchaserhqcode", "SGCC");//采购方总部编码
......
...@@ -58,6 +58,7 @@ public class ProductionOrderWebapi implements web_api { ...@@ -58,6 +58,7 @@ public class ProductionOrderWebapi implements web_api {
public List<List<Object>> selectOr(Map<String, String> or) { public List<List<Object>> selectOr(Map<String, String> or) {
LinkedHashMap<String, String> orkey = new LinkedHashMap<String, String>() {{ LinkedHashMap<String, String> orkey = new LinkedHashMap<String, String>() {{
put("FSaleOrderId", "FSaleOrderId "); put("FSaleOrderId", "FSaleOrderId ");
put("FID","FID");
}}; }};
List<List<Object>> lists = categoryDao.selectWhereOr(sFormId, orkey, or); List<List<Object>> lists = categoryDao.selectWhereOr(sFormId, orkey, or);
return lists; return lists;
...@@ -88,8 +89,7 @@ public class ProductionOrderWebapi implements web_api { ...@@ -88,8 +89,7 @@ public class ProductionOrderWebapi implements web_api {
*/ */
public List<Map<String,String>> ProductionOrder(List<List<Object>> list){ public List<Map<String,String>> ProductionOrder(List<List<Object>> list){
List<Map<String,String>> ProductionOrderlist = new ArrayList<>(); List<Map<String,String>> ProductionOrderlist = new ArrayList<>();
if(!list.isEmpty()) if(!list.isEmpty()) {
{
for (List<Object> list1 : list) { for (List<Object> list1 : list) {
Map<String, String> ProductionOrdermap = new HashMap<>(); Map<String, String> ProductionOrdermap = new HashMap<>();
QueryWrapper<Purchaseorder> queryWrapper = new QueryWrapper<>(); QueryWrapper<Purchaseorder> queryWrapper = new QueryWrapper<>();
......
...@@ -89,12 +89,25 @@ public class ProductionSchedulingWebapi implements web_api { ...@@ -89,12 +89,25 @@ public class ProductionSchedulingWebapi implements web_api {
fid.put(new String("fid = "), list1.get(2).toString()); fid.put(new String("fid = "), list1.get(2).toString());
} }
List<List<Object>> FSaleOrderIds = productionOrderWebapi.selectOr(fid);//查询关联生产订单 List<List<Object>> FSaleOrderIds = productionOrderWebapi.selectOr(fid);//查询关联生产订单
List<List<Object>> f=new ArrayList<>();
List<List<Object>> l=new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
String s = list.get(i).get(2).toString();
label:for (int j = 0; j < FSaleOrderIds.size(); j++) {
if (s.equals(FSaleOrderIds.get(j).get(1).toString())) {
f.add(list.get(i));
l.add(FSaleOrderIds.get(j));
FSaleOrderIds.remove(j);
break label;
}
}
}
int i=0; int i=0;
for (List<Object> list1 : list) { for (List<Object> list1 : f) {
Map<String, String> ProductionSchedulingmap = new HashMap<>(); Map<String, String> ProductionSchedulingmap = new HashMap<>();
QueryWrapper<Purchaseorder> queryWrapper = new QueryWrapper<>(); QueryWrapper<Purchaseorder> queryWrapper = new QueryWrapper<>();
queryWrapper.select("F_Id"); queryWrapper.select("F_Id");
Object SaleOrderId = FSaleOrderIds.get(i++).get(0);//销售订单id,可匹配过滤是否平台生成订单获取采购订单行项目号 Object SaleOrderId = l.get(i++).get(0);//销售订单id,可匹配过滤是否平台生成订单获取采购订单行项目号
queryWrapper.eq("F_Id", SaleOrderId.toString()); queryWrapper.eq("F_Id", SaleOrderId.toString());
//查询是否为集成平台生成的订单,并过滤 //查询是否为集成平台生成的订单,并过滤
Purchaseorder purchaseorders1 = purchaseorderService.getBaseMapper().selectOne(queryWrapper); Purchaseorder purchaseorders1 = purchaseorderService.getBaseMapper().selectOne(queryWrapper);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论