qiangxuan 1 mês atrás
pai
commit
cb58b23146

+ 22 - 3
zgzt-sys-java/jeecg-module-conn/src/main/java/org/jeecg/modules/storageBill/service/impl/StorageBillServiceImpl.java

@@ -14,6 +14,8 @@ import org.jeecg.modules.billetAutoException.service.IBilletAutoExceptionService
 import org.jeecg.modules.billetHotsendConfig.service.IBilletHotsendTypeConfigService;
 import org.jeecg.modules.operateLog.entity.OperateLog;
 import org.jeecg.modules.operateLog.service.IOperateLogService;
+import org.jeecg.modules.shiftConfiguration.entity.ShiftConfiguration;
+import org.jeecg.modules.shiftConfiguration.service.IShiftConfigurationService;
 import org.jeecg.modules.storageBill.entity.ShiftEnum;
 import org.jeecg.modules.storageBill.entity.ShiftGroupEnum;
 import org.jeecg.modules.storageBill.entity.StorageBill;
@@ -57,6 +59,9 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
     @Autowired
     private ISysDictService sysDictService;
 
+    @Autowired
+    private IShiftConfigurationService shiftConfigurationService;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void autoAddStorageBill(JSONObject jsonObject) {
@@ -104,7 +109,6 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
             log.info("{}{}", "C端自动化创建装运单主键ID", storageBill.getId());
             // 本车车次序号
             if (oConvertUtils.isNotEmpty(licensePlate)){
-                log.info("{}{}", "C端自动化新增钢坯装运单,传了车牌号:", licensePlate);
                 List<DictModel> ls = sysDictService.getDictItems("lg_car");
                 if (oConvertUtils.listIsNotEmpty(ls)){
                     // 判断licensePlate是否在ls中存在
@@ -133,9 +137,24 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
             storageBill.setCarAllNum(carAllNum + 1);
             // 保存钢坯基础信息
             storageBill.setCcmNo(ccmNo);
+            // 根据铸机号、班组、班别,创建时间倒序 只返回一条,查询储运配置信息
+            LambdaQueryWrapper<ShiftConfiguration> queryWrapper1 = new LambdaQueryWrapper<ShiftConfiguration>();
+            queryWrapper1.eq(ShiftConfiguration::getCcmNo, ccmNo)
+                    .eq(ShiftConfiguration::getShiftGroup, shiftGroup)
+                    .eq(ShiftConfiguration::getShift, shift)
+                    .orderByDesc(ShiftConfiguration::getCreateTime)
+                    .last("limit 1");
+            ShiftConfiguration shiftConfiguration = shiftConfigurationService.getOne(queryWrapper1);
+            if (shiftConfiguration != null && oConvertUtils.isNotEmpty(shiftConfiguration.getDestination())){
+                storageBill.setTypeConfigId(shiftConfiguration.getDestination());
+                storageBill.setBrandNum(shiftConfiguration.getSteelGrade());//牌号
+                storageBill.setNewOldPlatform(shiftConfiguration.getNewOldPlatform());
+                storageBill.setSize(shiftConfiguration.getSpec());
+            }else {
+                // C端自动化创建装运单时,默认未知目的地
+                storageBill.setTypeConfigId("1024");
+            }
 
-            // C端自动化创建装运单时,默认未知目的地
-            storageBill.setTypeConfigId("1024");
             storageBill.setAmountTotal(0);
             storageBill.setArrivalTime(new Date());// 到达时间
             storageBill.setPositionNum(Integer.valueOf(positionNum));