|
@@ -19,6 +19,9 @@ import org.jeecg.modules.billet.storageBill.entity.BilletHotsendDetails;
|
|
|
import org.jeecg.modules.billet.storageBill.entity.StorageBill;
|
|
|
import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
|
|
|
import org.jeecg.modules.billet.storageBill.service.ITripsManageService;
|
|
|
+import org.jeecg.modules.billet.storageCarLog.entity.StorageCarLog;
|
|
|
+import org.jeecg.modules.billet.storageCarLog.service.IStorageCarLogService;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -54,6 +57,9 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
|
|
|
@Autowired
|
|
|
public RedisTemplate redisTemplate;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IStorageCarLogService storageCarLogService;
|
|
|
+
|
|
|
/**
|
|
|
* 分页列表查询
|
|
|
*
|
|
@@ -161,10 +167,28 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
|
|
|
@ApiOperation(value="钢坯装运单-发车", notes="钢坯装运单-发车")
|
|
|
@PostMapping(value = "/startCar")
|
|
|
public Result<String> startCar(@RequestBody StorageBill storageBill) {
|
|
|
- storageBill.setCreateTime(new Date());
|
|
|
- storageBillService.save(storageBill);
|
|
|
+
|
|
|
+ StorageBill isStorageBill = storageBillService.getById(storageBill);
|
|
|
+ if (oConvertUtils.isNotEmpty(isStorageBill.getOutTime()) && storageBill.getLicensePlate().equals(isStorageBill.getLicensePlate())) {
|
|
|
+ return Result.OK("该车已发车,请勿重复发车!");
|
|
|
+ }
|
|
|
+ storageBill.setCarNum(isStorageBill.getCarNum() + 1);
|
|
|
+ storageBill.setCarAllNum(storageBillService.list().size() + 1);
|
|
|
+ storageBill.setUpdateTime(new Date());
|
|
|
+ storageBillService.updateById(storageBill);
|
|
|
+ // 7 发车后,新增钢坯堆垛储运信息,生成储运单 storage_car_log
|
|
|
+ StorageCarLog storageCarLog = new StorageCarLog();
|
|
|
+ BeanUtils.copyProperties(storageBill, storageCarLog);
|
|
|
+ storageCarLog.setCarNm(storageBill.getLicensePlate());// 车牌号
|
|
|
+// storageCarLog.setTypeConfigId(billetHotsendTypeConfig.getId()); // 钢坯配置类型ID
|
|
|
+// storageCarLog.setHeatNo(billetHotsend.getHeatNo());
|
|
|
+// storageCarLog.setFixedWeight();// 定重
|
|
|
+// storageCarLog.setSize();// 定尺
|
|
|
+ // 查询上垛记录,计算出总支数
|
|
|
+ storageCarLog.setAmount(storageBill.getAmountTotal());// 支数
|
|
|
+ storageCarLogService.save(storageCarLog);
|
|
|
operateLogService.add(storageBill,null,StorageBill.class);
|
|
|
- return Result.OK("添加成功!");
|
|
|
+ return Result.OK("钢坯装运单-发车成功!");
|
|
|
}
|
|
|
|
|
|
/**
|