|
|
@@ -106,6 +106,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
|
|
|
.formInstanceIdList(formInstanceIdList)
|
|
|
.build(), YDConf.FORM_OPERATION.delete_batch);
|
|
|
}
|
|
|
+ Thread.sleep(1000);
|
|
|
}
|
|
|
log.info("删除序列号主档数据完成:{}年,{}月,{}周",year,month,weekOfMonth);
|
|
|
|
|
|
@@ -277,7 +278,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
|
|
|
.build(), YDConf.FORM_OPERATION.create);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
- fail(e.getMessage());
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -321,6 +322,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
|
|
|
.formInstanceIdList(formInstanceIdList)
|
|
|
.build(), YDConf.FORM_OPERATION.delete_batch);
|
|
|
}
|
|
|
+ Thread.sleep(1000);
|
|
|
}
|
|
|
log.info("删除即时库存数据完成:{}年,{}月,{}周",year,month,weekOfMonth);
|
|
|
|
|
|
@@ -476,7 +478,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
|
|
|
}
|
|
|
|
|
|
}catch (Exception e){
|
|
|
- fail(e.getMessage());
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -513,7 +515,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
|
|
|
try {
|
|
|
result = (List<Map>)JSONObject.parse(client.billQuery(JSONObject.toJSONString(billQuery)));
|
|
|
} catch (Exception e) {
|
|
|
- fail(e.getMessage());
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
|
|
|
list.addAll(result);
|
|
|
@@ -565,6 +567,14 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
|
|
|
@Async
|
|
|
@Override
|
|
|
public void syncReport(String type,String userId) {
|
|
|
+ MDC.put("MDC_KEY_PID","1002");
|
|
|
+
|
|
|
+ //创建看板更新记录
|
|
|
+ String formInstId = ydClient.operateData(YDParam.builder()
|
|
|
+ .formUuid("FORM-0BEA655A36724D509A2CF21C4BA38D367YF7")
|
|
|
+ .formDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mfmhvkey, selectField_mhsjnn2r, dateField_mhsjnn2s, employeeField_mhswy0xy", type, "更新中", System.currentTimeMillis(),Arrays.asList(userId))))
|
|
|
+ .build(), YDConf.FORM_OPERATION.create).toString();
|
|
|
+
|
|
|
try {
|
|
|
switch (type){
|
|
|
case "成品库存天数看板": syncBDSerialMainFile();break;
|
|
|
@@ -573,16 +583,28 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
|
|
|
case "成品/样机出库看板": syncDLVNotice();break;
|
|
|
default:break;
|
|
|
}
|
|
|
+
|
|
|
//发送工作通知
|
|
|
if (Objects.nonNull(userId)){
|
|
|
sendDdMsg(ddClient.getAccessToken(),ddConf.getAgentId(),userId,"更新" + type + "完成 时间:" + DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
}
|
|
|
|
|
|
+ //更新看板更新记录
|
|
|
+ ydClient.operateData(YDParam.builder()
|
|
|
+ .formInstId(formInstId)
|
|
|
+ .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mhsjnn2r, dateField_mhsjnn2t", "已完成", System.currentTimeMillis())))
|
|
|
+ .build(), YDConf.FORM_OPERATION.update);
|
|
|
}catch (Exception e){
|
|
|
//发送工作通知
|
|
|
if (Objects.nonNull(userId)){
|
|
|
sendDdMsg(ddClient.getAccessToken(),ddConf.getAgentId(),userId,"更新" + type + "异常:" + e.getMessage() + " 时间:" + DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
}
|
|
|
+
|
|
|
+ //更新看板更新记录
|
|
|
+ ydClient.operateData(YDParam.builder()
|
|
|
+ .formInstId(formInstId)
|
|
|
+ .updateFormDataJson(JSONObject.toJSONString(UtilMap.map("selectField_mhsjnn2r, dateField_mhsjnn2t", "异常", System.currentTimeMillis())))
|
|
|
+ .build(), YDConf.FORM_OPERATION.update);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -729,7 +751,7 @@ public class KdHuaGaoServiceImpl implements KdHuaGaoService {
|
|
|
try {
|
|
|
result = (List<Map>)JSONObject.parse(client.billQuery(JSONObject.toJSONString(billQuery)));
|
|
|
} catch (Exception e) {
|
|
|
- fail(e.getMessage());
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
|
|
|
list.addAll(result);
|