|
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils; |
|
|
|
|
import org.apache.commons.lang3.time.DateUtils; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.desk.dashboard.pojo.entity.DsPartEntity; |
|
|
|
|
@ -19,6 +20,7 @@ import org.springblade.erpdata.pojo.dto.view.*; |
|
|
|
|
import org.springblade.erpdata.service.*; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
|
import java.text.ParseException; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
@ -146,9 +148,13 @@ public class ErpMesRbWoServiceImpl implements IErpMesRbWoService { |
|
|
|
|
//用字典的code查更新日期
|
|
|
|
|
String selectTime = apsOrderClient.getSelectTime("SYCN_MESRBWO_TIME"); |
|
|
|
|
//从ERP视图查询最大日期
|
|
|
|
|
String newlevdateMax = mesRbWoMapper.getNewlevdateMax(selectTime); |
|
|
|
|
apsOrderClient.upByDateMax(newlevdateMax, "SYCN_MESRBWO_TIME"); |
|
|
|
|
List<MesRbWo> mesRbWoList = mesRbWoMapper.getYieldPlanErpList(newlevdateMax); |
|
|
|
|
//String newlevdateMax = mesRbWoMapper.getNewlevdateMax(selectTime);
|
|
|
|
|
|
|
|
|
|
List<MesRbWo> mesRbWoList = mesRbWoMapper.getYieldPlanErpList(selectTime); |
|
|
|
|
if(!CollectionUtils.isEmpty(mesRbWoList)){ |
|
|
|
|
apsOrderClient.upByDateMax(DateFormatUtils.format(mesRbWoList.get(0).getWopordat(),"yyyy-MM-dd HH:mm:ss"), "SYCN_MESRBWO_TIME"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Gson gson = new Gson(); |
|
|
|
|
String jsonString = gson.toJson(mesRbWoList); |
|
|
|
|
log.info("qyl:同步生产计划 data: {}", jsonString); |
|
|
|
|
@ -262,9 +268,12 @@ public class ErpMesRbWoServiceImpl implements IErpMesRbWoService { |
|
|
|
|
//用字典的code查更新日期
|
|
|
|
|
String selectTime=apsOrderClient.getSelectTime("SYCN_TRANSFERCG_TIME1"); |
|
|
|
|
//从ERP视图查询最大日期
|
|
|
|
|
String newlevdateMax=mesRbPurtosoService.getNewlevdateMax(selectTime); |
|
|
|
|
apsOrderClient.upByDateMax(newlevdateMax, "SYCN_TRANSFERCG_TIME1"); |
|
|
|
|
List<MesRbPurtoso> purtosoList=mesRbPurtosoService.getMesRbPurtosoList(newlevdateMax); |
|
|
|
|
// String newlevdateMax=mesRbPurtosoService.getNewlevdateMax(selectTime);
|
|
|
|
|
// apsOrderClient.upByDateMax(newlevdateMax, "SYCN_TRANSFERCG_TIME1");
|
|
|
|
|
List<MesRbPurtoso> purtosoList=mesRbPurtosoService.getMesRbPurtosoList(selectTime); |
|
|
|
|
if(!CollectionUtils.isEmpty(purtosoList)){ |
|
|
|
|
apsOrderClient.upByDateMax(DateFormatUtils.format(purtosoList.get(0).getNewlevdate(),"yyyy-MM-dd HH:mm:ss"), "SYCN_TRANSFERCG_TIME1"); |
|
|
|
|
} |
|
|
|
|
Gson gson = new Gson(); |
|
|
|
|
String jsonString = gson.toJson(purtosoList); |
|
|
|
|
log.info("qyl:同步物资转车间协作加工 data: {}", jsonString); |
|
|
|
|
@ -328,9 +337,12 @@ public class ErpMesRbWoServiceImpl implements IErpMesRbWoService { |
|
|
|
|
//用字典的code查更新日期
|
|
|
|
|
String selectTime=apsOrderClient.getSelectTime("SYCN_PACTURNRECORD_TIME"); |
|
|
|
|
//从ERP视图查询最大日期
|
|
|
|
|
String newlevdateMax=mesRbPacturnrecordService.getNewlevdateMax(selectTime); |
|
|
|
|
apsOrderClient.upByDateMax(newlevdateMax, "SYCN_PACTURNRECORD_TIME"); |
|
|
|
|
List<MesRbPacturnrecord> pacturnrecordList=mesRbPacturnrecordService.getMesRbPacturnrecordList(newlevdateMax); |
|
|
|
|
// String newlevdateMax=mesRbPacturnrecordService.getNewlevdateMax(selectTime);
|
|
|
|
|
// apsOrderClient.upByDateMax(newlevdateMax, "SYCN_PACTURNRECORD_TIME");
|
|
|
|
|
List<MesRbPacturnrecord> pacturnrecordList=mesRbPacturnrecordService.getMesRbPacturnrecordList(selectTime); |
|
|
|
|
if(!CollectionUtils.isEmpty(pacturnrecordList)){ |
|
|
|
|
apsOrderClient.upByDateMax(pacturnrecordList.get(0).getCdate(), "SYCN_PACTURNRECORD_TIME"); |
|
|
|
|
} |
|
|
|
|
Gson gson = new Gson(); |
|
|
|
|
String jsonString = gson.toJson(pacturnrecordList); |
|
|
|
|
log.info("qyl:同步临时工单 data: {}", jsonString); |
|
|
|
|
@ -389,9 +401,12 @@ public class ErpMesRbWoServiceImpl implements IErpMesRbWoService { |
|
|
|
|
//用字典的code查更新日期
|
|
|
|
|
String selectTime=apsOrderClient.getSelectTime("SYCN_TRANSFERSJ_TIME"); |
|
|
|
|
//从ERP视图查询最大日期
|
|
|
|
|
String newlevdateMax=mesRbSjsoService.getNewlevdateMax(selectTime); |
|
|
|
|
apsOrderClient.upByDateMax(newlevdateMax, "SYCN_TRANSFERSJ_TIME"); |
|
|
|
|
List<MesRbSjso> rbtosoList=mesRbSjsoService.getMesRbSjsoList(newlevdateMax); |
|
|
|
|
// String newlevdateMax=mesRbSjsoService.getNewlevdateMax(selectTime);
|
|
|
|
|
// apsOrderClient.upByDateMax(newlevdateMax, "SYCN_TRANSFERSJ_TIME");
|
|
|
|
|
List<MesRbSjso> rbtosoList=mesRbSjsoService.getMesRbSjsoList(selectTime); |
|
|
|
|
if(!CollectionUtils.isEmpty(rbtosoList)){ |
|
|
|
|
apsOrderClient.upByDateMax(DateFormatUtils.format(rbtosoList.get(0).getNewlevdate(),"yyyy-MM-dd HH:mm:ss"), "SYCN_TRANSFERSJ_TIME"); |
|
|
|
|
} |
|
|
|
|
Gson gson = new Gson(); |
|
|
|
|
String jsonString = gson.toJson(rbtosoList); |
|
|
|
|
log.info("qyl:同步烧结数据 data: {}", jsonString); |
|
|
|
|
@ -443,9 +458,12 @@ public class ErpMesRbWoServiceImpl implements IErpMesRbWoService { |
|
|
|
|
//用字典的code查更新日期
|
|
|
|
|
String selectTime=apsOrderClient.getSelectTime("SYCN_BUYTRANSFER_TIME"); |
|
|
|
|
//从ERP视图查询最大日期
|
|
|
|
|
String dateMax=mesRbWxpromotionService.getNewlevdateMax(selectTime); |
|
|
|
|
apsOrderClient.upByDateMax(dateMax,"SYCN_BUYTRANSFER_TIME"); |
|
|
|
|
List<MesRbWxpromotion> wxpromotionList=mesRbWxpromotionService.getMesRbWxpromotionList(dateMax); |
|
|
|
|
// String dateMax=mesRbWxpromotionService.getNewlevdateMax(selectTime);
|
|
|
|
|
// apsOrderClient.upByDateMax(dateMax,"SYCN_BUYTRANSFER_TIME");
|
|
|
|
|
List<MesRbWxpromotion> wxpromotionList=mesRbWxpromotionService.getMesRbWxpromotionList(selectTime); |
|
|
|
|
if(!CollectionUtils.isEmpty(wxpromotionList)){ |
|
|
|
|
apsOrderClient.upByDateMax(DateFormatUtils.format(wxpromotionList.get(0).getNewlevdate(),"yyyy-MM-dd HH:mm:ss"),"SYCN_BUYTRANSFER_TIME"); |
|
|
|
|
} |
|
|
|
|
Gson gson = new Gson(); |
|
|
|
|
String jsonString = gson.toJson(wxpromotionList); |
|
|
|
|
log.info("qyl:同步采购LOTTJ data: {}", jsonString); |
|
|
|
|
@ -507,9 +525,12 @@ public class ErpMesRbWoServiceImpl implements IErpMesRbWoService { |
|
|
|
|
//用字典的code查更新日期
|
|
|
|
|
String selectTime=apsOrderClient.getSelectTime("SYCN_TRANSFERWX_TIME"); |
|
|
|
|
//从ERP视图查询最大日期
|
|
|
|
|
String dateMax=erpMesRbSodelrecwxService.getNewlevdateMax(selectTime); |
|
|
|
|
apsOrderClient.upByDateMax(dateMax,"SYCN_TRANSFERWX_TIME"); |
|
|
|
|
List<MesRbSodelrecwx> mesRbSodelrecwxList=erpMesRbSodelrecwxService.getMesRbSodelrecwxList(dateMax); |
|
|
|
|
// String dateMax=erpMesRbSodelrecwxService.getNewlevdateMax(selectTime);
|
|
|
|
|
// apsOrderClient.upByDateMax(dateMax,"SYCN_TRANSFERWX_TIME");
|
|
|
|
|
List<MesRbSodelrecwx> mesRbSodelrecwxList=erpMesRbSodelrecwxService.getMesRbSodelrecwxList(selectTime); |
|
|
|
|
if(!CollectionUtils.isEmpty(mesRbSodelrecwxList)){ |
|
|
|
|
apsOrderClient.upByDateMax(DateFormatUtils.format(mesRbSodelrecwxList.get(0).getNewlevdate(),"yyyy-MM-dd HH:mm:ss"),"SYCN_TRANSFERWX_TIME"); |
|
|
|
|
} |
|
|
|
|
Gson gson = new Gson(); |
|
|
|
|
String jsonString = gson.toJson(mesRbSodelrecwxList); |
|
|
|
|
log.info("qyl:同步外协工单 data: {}", jsonString); |
|
|
|
|
@ -570,10 +591,13 @@ public class ErpMesRbWoServiceImpl implements IErpMesRbWoService { |
|
|
|
|
//用字典的code查更新日期
|
|
|
|
|
String selectTime=apsOrderClient.getSelectTime("SYCN_TRANSFERZG_TIME1"); |
|
|
|
|
//从ERP视图查询最大日期
|
|
|
|
|
String dateMax=erpMesRbSodelreczgService.getNewlevdateMax(selectTime); |
|
|
|
|
//更新配置表的基准时间
|
|
|
|
|
apsOrderClient.upByDateMax(dateMax,"SYCN_TRANSFERZG_TIME1"); |
|
|
|
|
List<MesRbSodelreczg> mesRbSodelreczgList=erpMesRbSodelreczgService.getMesRbSodelreczgList(dateMax); |
|
|
|
|
// String dateMax=erpMesRbSodelreczgService.getNewlevdateMax(selectTime);
|
|
|
|
|
// //更新配置表的基准时间
|
|
|
|
|
// apsOrderClient.upByDateMax(dateMax,"SYCN_TRANSFERZG_TIME1");
|
|
|
|
|
List<MesRbSodelreczg> mesRbSodelreczgList=erpMesRbSodelreczgService.getMesRbSodelreczgList(selectTime); |
|
|
|
|
if(!CollectionUtils.isEmpty(mesRbSodelreczgList)){ |
|
|
|
|
apsOrderClient.upByDateMax(DateFormatUtils.format(mesRbSodelreczgList.get(0).getNewlevdate(),"yyyy-MM-dd HH:mm:ss"),"SYCN_TRANSFERZG_TIME1"); |
|
|
|
|
} |
|
|
|
|
Gson gson = new Gson(); |
|
|
|
|
String jsonString = gson.toJson(mesRbSodelreczgList); |
|
|
|
|
log.info("qyl:同步工艺工单 data: {}", jsonString); |
|
|
|
|
@ -643,9 +667,12 @@ public class ErpMesRbWoServiceImpl implements IErpMesRbWoService { |
|
|
|
|
//用字典的code查更新日期
|
|
|
|
|
String selectTime=apsOrderClient.getSelectTime("SYCN_TRANSFERPK_TIME"); |
|
|
|
|
//从ERP视图查询最大日期
|
|
|
|
|
String dateMax=erpMesRbPkService.getNewlevdateMax(selectTime); |
|
|
|
|
apsOrderClient.upByDateMax(dateMax,"SYCN_TRANSFERPK_TIME"); |
|
|
|
|
List<MesRbPk> mesRbPkList=erpMesRbPkService.getMesRbPkList(dateMax); |
|
|
|
|
// String dateMax=erpMesRbPkService.getNewlevdateMax(selectTime);
|
|
|
|
|
// apsOrderClient.upByDateMax(dateMax,"SYCN_TRANSFERPK_TIME");
|
|
|
|
|
List<MesRbPk> mesRbPkList=erpMesRbPkService.getMesRbPkList(selectTime); |
|
|
|
|
if(!CollectionUtils.isEmpty(mesRbPkList)){ |
|
|
|
|
apsOrderClient.upByDateMax(DateFormatUtils.format(mesRbPkList.get(0).getNewlevdate(),"yyyy-MM-dd HH:mm:ss"),"SYCN_TRANSFERPK_TIME"); |
|
|
|
|
} |
|
|
|
|
Gson gson = new Gson(); |
|
|
|
|
String jsonString = gson.toJson(mesRbPkList); |
|
|
|
|
log.info("qyl:同步配套工单 data: {}", jsonString); |
|
|
|
|
|