Browse Source

update006

qiangxuan 6 months ago
parent
commit
cbee60be6a

+ 12 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/actualControl/billetActual/billetActual/entity/BilletBasicInfo.java

@@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecg.common.aspect.annotation.Dict;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -143,4 +144,15 @@ public class BilletBasicInfo implements Serializable {
     @Excel(name = "目的地", width = 15)
     @ApiModelProperty(value = "目的地",required = true)
     private String bhtcId;
+
+    /**班组*/
+    @Excel(name = "班组", width = 15)
+    @ApiModelProperty(value = "班组")
+    @Dict(dicCode = "lg_bz")
+    private String shiftGroup;
+    /**班别*/
+    @Excel(name = "班别", width = 15)
+    @Dict(dicCode = "lg_bb")
+    @ApiModelProperty(value = "班别")
+    private String shift;
 }

+ 5 - 2
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/controller/BilletHotsendBaseController.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.billet.billetHotsend.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -96,8 +97,10 @@ public class BilletHotsendBaseController extends JeecgController<BilletHotsend,
     @ApiOperation(value="钢坯热送基础信息-添加", notes="钢坯热送基础信息-添加")
     @PostMapping(value = "/add")
     public Result<?> add(@RequestBody BilletHotsendDetailsVo billetHotsendDetailsVo) {
-        billetHotsendBaseService.saveBilletHotsendDetails(billetHotsendDetailsVo);
-//        operateLogService.add(billetHotsend,null,BilletHotsend.class);
+        JSONObject jsonObject = billetHotsendBaseService.saveBilletHotsendDetails(billetHotsendDetailsVo);
+        if (jsonObject.containsKey("fail")){
+            return Result.OK("该炉次信息已存在!");
+        }
         return Result.OK("棒线新增成功!");
     }
 

+ 2 - 1
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/service/IBilletHotsendBaseService.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.billet.billetHotsend.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsend;
 import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsendDetailsVo;
@@ -22,7 +23,7 @@ public interface IBilletHotsendBaseService extends IService<BilletHotsend> {
 
     List<BilletHotsend> queryByCastMachineAndFurnaceNum(String castMachine, String furnaceNum);
 
-    void saveBilletHotsendDetails(BilletHotsendDetailsVo billetHotsendDetailsVo);
+    JSONObject saveBilletHotsendDetails(BilletHotsendDetailsVo billetHotsendDetailsVo);
 
     Integer queryEndNumByCcmNo(String ccmNo, String heatNo, String belongTable);
 

+ 11 - 5
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/service/impl/BilletHotsendBaseServiceImpl.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.billet.billetHotsend.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@@ -309,16 +310,16 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 	}
 
 	@Override
-	public void saveBilletHotsendDetails(BilletHotsendDetailsVo billetHotsendDetailsVo) {
+	public JSONObject saveBilletHotsendDetails(BilletHotsendDetailsVo billetHotsendDetailsVo) {
+		JSONObject result = new JSONObject();
 		// 根据billetHotsendTypeConfigId 查询基础垛位信息
 		BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
 		List<RollClubCommon> rollClubCommonList = billetHotsendDetailsVo.getRollClubCommonList();
 		BilletHotsend billetHotsend = new BilletHotsend();
 		// 新保存 钢坯热送基础信息
 		BeanUtils.copyProperties(billetHotsendDetailsVo.getBilletHotsend(), billetHotsend);
-		billetHotsend.setCreateDate(new Date());
 //		billetHotsend.setAmountTotal(rollClubCommonList.size()); //总支数
-		LambdaQueryWrapper<HeatsActuals> queryWrapperHA = new LambdaQueryWrapper();
+		LambdaQueryWrapper<HeatsActuals> queryWrapperHA = new LambdaQueryWrapper<>();
 		queryWrapperHA.eq(HeatsActuals::getCasterCode, billetHotsend.getCcmNo()).eq(HeatsActuals::getHeatsCode, billetHotsend.getHeatNo());
 		HeatsActuals heatsActuals = heatsActualsService.getOne(queryWrapperHA);
 		LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
@@ -337,7 +338,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		}
 		BilletHotsend check = baseMapper.selectOne(queryWrapper);
 		if (oConvertUtils.isNotEmpty(check) && oConvertUtils.listIsEmpty(rollClubCommonList)){
-			return;
+			result.put("fail", "该炉次信息已存在!");
+			return result;
 		}
 		if (oConvertUtils.isEmpty(check) && oConvertUtils.listIsEmpty(rollClubCommonList)){
 			billetHotsend.setRollclubtwoNum(0);
@@ -350,7 +352,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			baseMapper.insert(billetHotsend);
 			billetHotsend.setId(billetHotsend.getId());
 			operateLogService.add(billetHotsend,null,BilletHotsend.class);
-			return;
+			result.put("success", "新增钢坯热送成功!");
+			return result;
 		}else {
 			if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
 				if (oConvertUtils.isEmpty(check) || oConvertUtils.isEmpty(check.getRollcluboneNum())){
@@ -613,6 +616,9 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 			x.setUpdateTime(new Date());
 		});
 		billetBasicInfoService.saveOrUpdateBatch(billetBasicInfoList);
+
+		result.put("success", "新增钢坯热送成功!");
+		return result;
 	}
 
 	@Override