| | |
| | | import com.zy.asrs.entity.InOut; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.MatBarcode; |
| | | import com.zy.asrs.service.InOutService; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.MatBarcodeService; |
| | | import com.zy.asrs.service.MatService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private InOutService inOutService; |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private MatBarcodeService matBarcodeService; |
| | | |
| | | // @Scheduled(cron = "0/30 * * * * ? ") |
| | | private void syncInOut(){ |
| | |
| | | } |
| | | log.info("更新" + locDetlList.size() + "条商品信息成功"); |
| | | } |
| | | |
| | | |
| | | // @Scheduled(cron = "0/30 * * * * ? ") |
| | | private void syncBarcodeMat(){ |
| | | List<MatBarcode> matBarcodeList = matBarcodeService.select100(); |
| | | if (matBarcodeList.size() == 0){ |
| | | log.info("托盘物料绑定关系更新完毕"); |
| | | return; |
| | | } |
| | | for (MatBarcode matBarcode : matBarcodeList) { |
| | | String matnr = matBarcode.getMatnr(); |
| | | String[] split = matnr.split("__"); |
| | | if (split.length > 1){ |
| | | matBarcode.setModel(split[1]); // 套号 |
| | | matBarcode.setColor("1"); // 标记 |
| | | if (!matBarcodeService.update(matBarcode,new EntityWrapper<MatBarcode>().eq("matnr",matBarcode.getMatnr()))){ |
| | | log.error("更新托盘物料绑定关系失败"); |
| | | } |
| | | }else { |
| | | continue; |
| | | } |
| | | } |
| | | log.info("更新" + matBarcodeList.size() + "条托盘物料绑定关系成功"); |
| | | } |
| | | } |