|
@@ -152,25 +152,25 @@ public class JdProductionOrderServiceImpl implements JdProductionOrderService
|
|
|
public AjaxResult jdProductionOrderPull() {
|
|
|
Boolean aTrue = stringRedisTemplate.opsForValue().setIfAbsent("fjqy:ptd:pulled", "true");
|
|
|
if (aTrue) {
|
|
|
- AjaxResult ajaxResult = jdMaterialInfoService.pullMaterialBaseInfo();
|
|
|
- //金蝶工具key
|
|
|
- K3CloudApi api = new K3CloudApi();
|
|
|
- //定义查询条件
|
|
|
- String query = "{\n" +
|
|
|
- " \"FormId\": \"PRD_MO\",\n" +
|
|
|
- " \"FieldKeys\": \"FDescription,F_PONP_teshuyaoqiu,FBillNo,FBillType,FDate,FDocumentStatus," +
|
|
|
- "FProductType,FMaterialId,FWorkShopID0,FQty,FStatus,FSaleOrderNo,FPickMtrlStatus," +
|
|
|
- "FMaterialId.FNumber,FMaterialName,F_PONP_BaseProperty,FSpecification,FUnitId.FName,F_PONP_yanse,F_PONP_mingpai,F_PONP_hegezheng.FDataValue," +
|
|
|
- "F_PONP_shuomingshu.FDataValue,F_PONP_KaiGuanXiang,F_PONP_baozhuangxiang,F_PONP_GongLv,FPlanFinishDate,FPlanStartDate,F_PONP_XQRQ,FPlanStartDate,FPlanFinishDate\",\n" +
|
|
|
- " \"FilterString\": [{\"Left\":\"\",\"FieldName\":\"FMaterialId.FNumber\",\"Compare\":\"34\",\"Value\":\"焊\",\"Right\":\"\",\"Logic\":0},{\"Left\":\"\",\"FieldName\":\"FStatus\",\"Compare\":\"105\",\"Value\":\"4\",\"Right\":\"\",\"Logic\":0}],\n" +
|
|
|
- " \"OrderString\": \"\",\n" +
|
|
|
- " \"TopRowCount\": 0,\n" +
|
|
|
- " \"StartRow\": 0,\n" +
|
|
|
- " \"Limit\": 5000,\n" +
|
|
|
- " \"SubSystemId\": \"\"\n" +
|
|
|
- "}";
|
|
|
- //
|
|
|
try {
|
|
|
+ AjaxResult ajaxResult = jdMaterialInfoService.pullMaterialBaseInfo();
|
|
|
+ //金蝶工具key
|
|
|
+ K3CloudApi api = new K3CloudApi();
|
|
|
+ //定义查询条件
|
|
|
+ String query = "{\n" +
|
|
|
+ " \"FormId\": \"PRD_MO\",\n" +
|
|
|
+ " \"FieldKeys\": \"fid,FSrcBillNo,FTreeEntity_FEntryId,FDescription,F_PONP_teshuyaoqiu,FBillNo,FBillType,FDate,FDocumentStatus," +
|
|
|
+ "FProductType,FMaterialId,FWorkShopID0,FQty,FStatus,FSaleOrderNo,FPickMtrlStatus," +
|
|
|
+ "FMaterialId.FNumber,FMaterialName,F_PONP_BaseProperty,FSpecification,FUnitId.FName,F_PONP_yanse,F_PONP_mingpai,F_PONP_hegezheng.FDataValue," +
|
|
|
+ "F_PONP_shuomingshu.FDataValue,F_PONP_KaiGuanXiang,F_PONP_baozhuangxiang,F_PONP_GongLv,FPlanFinishDate,FPlanStartDate,F_PONP_XQRQ,FPlanStartDate,FPlanFinishDate\",\n" +
|
|
|
+ " \"FilterString\": [{\"Left\":\"\",\"FieldName\":\"FMaterialId.FNumber\",\"Compare\":\"34\",\"Value\":\"焊\",\"Right\":\"\",\"Logic\":0},{\"Left\":\"\",\"FieldName\":\"FStatus\",\"Compare\":\"105\",\"Value\":\"4\",\"Right\":\"\",\"Logic\":0}],\n" +
|
|
|
+ " \"OrderString\": \"\",\n" +
|
|
|
+ " \"TopRowCount\": 0,\n" +
|
|
|
+ " \"StartRow\": 0,\n" +
|
|
|
+ " \"Limit\": 5000,\n" +
|
|
|
+ " \"SubSystemId\": \"\"\n" +
|
|
|
+ "}";
|
|
|
+ //
|
|
|
//查询结果
|
|
|
String resultJson = api.billQuery(query);
|
|
|
//生产信息
|
|
@@ -289,10 +289,10 @@ public class JdProductionOrderServiceImpl implements JdProductionOrderService
|
|
|
});
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- stringRedisTemplate.delete("fjqy:ptd:pulled");
|
|
|
throw new RuntimeException(e);
|
|
|
+ }finally {
|
|
|
+ stringRedisTemplate.delete("fjqy:ptd:pulled");
|
|
|
}
|
|
|
- stringRedisTemplate.delete("fjqy:ptd:pulled");
|
|
|
return AjaxResult.success("拉取成功");
|
|
|
} else {
|
|
|
return AjaxResult.success("定时任务正在执行请稍后在拉去");
|
|
@@ -439,7 +439,7 @@ public class JdProductionOrderServiceImpl implements JdProductionOrderService
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
System.out.println("当前时间: " + now);
|
|
|
// 减去三个月
|
|
|
- LocalDateTime threeMonthsAgo = now.minusMonths(3);
|
|
|
+ LocalDateTime threeMonthsAgo = now.minusMonths(6);
|
|
|
System.out.println("三个月前的时间: " + threeMonthsAgo);
|
|
|
LocalDateTime localDateTime1 = threeMonthsAgo.withMinute(0).withSecond(0).withNano(0);
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
@@ -447,7 +447,7 @@ public class JdProductionOrderServiceImpl implements JdProductionOrderService
|
|
|
//定义查询条件
|
|
|
String query="{\n" +
|
|
|
" \"FormId\": \"PRD_MO\",\n" +
|
|
|
- " \"FieldKeys\": \"FDescription,F_PONP_teshuyaoqiu,FBillNo,FBillType,FDate,FDocumentStatus," +
|
|
|
+ " \"FieldKeys\": \"fid,FSrcBillNo,FTreeEntity_FEntryId,FDescription,F_PONP_teshuyaoqiu,FBillNo,FBillType,FDate,FDocumentStatus," +
|
|
|
"FProductType,FMaterialId,FWorkShopID0,FQty,FStatus,,FSaleOrderNo,FPickMtrlStatus," +
|
|
|
"FMaterialId.FNumber,FMaterialName,F_PONP_BaseProperty,FSpecification,FUnitId.FName,F_PONP_yanse,F_PONP_mingpai,F_PONP_hegezheng.FDataValue," +
|
|
|
"F_PONP_shuomingshu.FDataValue,F_PONP_KaiGuanXiang,F_PONP_baozhuangxiang,F_PONP_GongLv,F_PONP_XQRQ,FDate,FPlanStartDate,FPlanFinishDate\",\n" +
|
|
@@ -574,10 +574,10 @@ public class JdProductionOrderServiceImpl implements JdProductionOrderService
|
|
|
}
|
|
|
} while (flag);
|
|
|
} catch (Exception e) {
|
|
|
- stringRedisTemplate.delete("fjqy:hjd:pulled");
|
|
|
throw new RuntimeException(e);
|
|
|
+ }finally {
|
|
|
+ stringRedisTemplate.delete("fjqy:ptd:pulled");
|
|
|
}
|
|
|
- stringRedisTemplate.delete("fjqy:hjd:pulled");
|
|
|
return AjaxResult.success("焊接单拉取成功");
|
|
|
}else {
|
|
|
System.out.println("定时任务正在执行请稍后在拉去");
|