| | |
| | | /** |
| | | * 成品 |
| | | */ |
| | | // @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | // @PostConstruct |
| | | public void inCPICMOExecute(){ |
| | | // List<M_item> item = erpService.getItem(); |
| | |
| | | } |
| | | } |
| | | |
| | | // @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | public void syncMat(){ |
| | | List<M_item> items = erpService.getItem(); |
| | | for (M_item item : items) { |
| | |
| | | VersionUtils.setMatCode(matCode, item); |
| | | matCode.setAppeTime(new Date()); |
| | | matCode.setModiTime(new Date()); |
| | | matCodeService.insert(matCode); |
| | | boolean insert = matCodeService.insert(matCode); |
| | | if (insert) { |
| | | log.info("=====>> 新增物料成功 : {}", JSON.toJSONString(item)); |
| | | } else { |
| | | log.error("=====>> 新增物料失败!!! : {}", JSON.toJSONString(item)); |
| | | } |
| | | } else { |
| | | VersionUtils.setMatCode(matCode, item); |
| | | matCode.setModiTime(new Date()); |
| | | matCodeService.updateById(matCode); |
| | | boolean b = matCodeService.updateById(matCode); |
| | | if (b) { |
| | | log.info("=====>> 更新物料成功 : {}", JSON.toJSONString(item)); |
| | | } else { |
| | | log.error("=====>> 更新物料失败!!! : {}", JSON.toJSONString(item)); |
| | | } |
| | | } |
| | | // 更新完之后删除 |
| | | erpService.deleteItem(item.getMnumber()); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 原材料出库 |
| | | */ |