Explorar el Código

钢坯装运单新增编辑日志维护

qiangxuan hace 5 meses
padre
commit
13d0a82f50

+ 3 - 8
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/controller/StorageBillController.java

@@ -124,14 +124,15 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 	@ApiOperation(value="钢坯装运单-发车", notes="钢坯装运单-发车")
 	@PostMapping(value = "/startCar")
 	public Result<String> startCar(@RequestBody StorageBill storageBill) {
-
-		StorageBill isStorageBill = storageBillService.getById(storageBill);
+		StorageBill isStorageBill = storageBillService.getById(storageBill.getId());
 		if (oConvertUtils.isNotEmpty(isStorageBill.getOutTime()) && storageBill.getLicensePlate().equals(isStorageBill.getLicensePlate())) {
 			return Result.OK("该车已发车,请勿重复发车!");
 		}
 		storageBill.setOutTime(new Date());
 		storageBill.setUpdateTime(new Date());
 		storageBillService.updateById(storageBill);
+		// 添加编辑日志
+		operateLogService.add(isStorageBill,storageBill,StorageBill.class);
 		// 7 发车后,新增钢坯堆垛储运信息,生成储运单 storage_car_log
 		StorageCarLog storageCarLog = new StorageCarLog();
 		BeanUtils.copyProperties(storageBill, storageCarLog);
@@ -144,7 +145,6 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 		storageCarLog.setDataTime(new Date());
 		storageCarLog.setAmount(storageBill.getAmountTotal());// 支数
 		storageCarLogService.save(storageCarLog);
-		operateLogService.add(storageBill,null,StorageBill.class);
 		return Result.OK("钢坯装运单-发车成功!");
 	}
 	
@@ -159,11 +159,6 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
 	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
 	public Result<String> edit(@RequestBody StorageBill storageBill) {
 		StorageBill old = storageBillService.getById(storageBill.getId());
-
-		boolean isNull = false;
-		if(storageBill.getAmountTotal()==null||storageBill.getAmountTotal()==0){
-			isNull = true;
-		}
 		storageBillService.updateById(storageBill);
 		operateLogService.add(old,storageBill,StorageBill.class);
 		return Result.OK("编辑成功!");

+ 5 - 2
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/storageBill/service/impl/StorageBillServiceImpl.java

@@ -104,14 +104,17 @@ public class StorageBillServiceImpl extends ServiceImpl<StorageBillMapper, Stora
     @Override
     public void departHandle(BilletHotsendDetailsVo billetHotsendDetailsVo) {
         StorageBill storageBill = billetHotsendDetailsVo.getStorageBill();
-        // 查询目的地名称,并更新装运单
+        StorageBill oldStorageBill = storageBillMapper.selectById(storageBill.getId());
+                // 查询目的地名称,并更新装运单
         BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
         storageBill.setDestination(billetHotsendTypeConfig.getTypeName());
         storageBill.setOutTime(new Date());
         storageBill.setUpdateTime(new Date());
         storageBill.setTypeConfigId(billetHotsendTypeConfig.getId());
         storageBillMapper.updateById(storageBill);
-
+        if (oConvertUtils.isNotEmpty(oldStorageBill)){
+            operateLogService.add(oldStorageBill,storageBill,StorageBill.class);
+        }
         //查询并批量更新钢坯基础信息 belongTable
         List<RollClubCommon> rollClubCommonLists = billetHotsendDetailsVo.getRollClubCommonList();
         if (oConvertUtils.listIsEmpty(rollClubCommonLists)){