Parcourir la source

钢坯查询接口开发01

qiangxuan il y a 8 mois
Parent
commit
87d53b5c4a

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

@@ -10,6 +10,7 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsend;
 import org.jeecg.modules.billet.billetHotsend.entity.RealtimeStats;
 import org.jeecg.modules.billet.billetHotsend.entity.RulerDefaultConfig;
@@ -25,6 +26,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.Arrays;
 import java.util.Date;
+import java.util.List;
 
 /**
 * @Description: 钢坯热送基础信息
@@ -171,6 +173,18 @@ public class BilletHotsendBaseController extends JeecgController<BilletHotsend,
 
    }
 
+    @AutoLog(value = "钢坯热送基础信息-通过铸机和炉号查询")
+    @ApiOperation(value="钢坯热送基础信息-通过铸机和炉号查询", notes="钢坯热送基础信息-通过铸机和炉号查询")
+    @GetMapping(value = "/queryByCastMachineAndFurnaceNum")
+    public Result<?> queryByCastMachineAndFurnaceNum(@RequestParam(name="castMachine") String castMachine,
+                                                     @RequestParam(name="furnaceNum") String furnaceNum) {
+        List<BilletHotsend> billetHotsendList = billetHotsendBaseService.queryByCastMachineAndFurnaceNum(castMachine, furnaceNum);
+        if(oConvertUtils.listIsNotEmpty(billetHotsendList)) {
+            return Result.error("该炉号已存在!");
+        }
+        return Result.OK(billetHotsendList);
+    }
+
     @AutoLog(value = "棒一新增")
     @ApiOperation(value="棒一新增", notes="棒一新增")
     @PostMapping(value = "/addOne")

+ 1 - 1
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/entity/BilletHotsend.java

@@ -132,7 +132,7 @@ public class BilletHotsend implements Serializable {
     @ApiModelProperty(value = "是否已编辑")
     private Boolean isUpd;
     /**castMachine*/
-    @Excel(name = "castMachine", width = 15)
+    @Excel(name = "铸机", width = 15)
     @ApiModelProperty(value = "castMachine")
     private String castMachine;
     /**棒一支数*/

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

@@ -3,8 +3,6 @@ package org.jeecg.modules.billet.billetHotsend.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsend;
 
-import java.io.Serializable;
-import java.util.Collection;
 import java.util.List;
 
 /**
@@ -20,4 +18,6 @@ public interface IBilletHotsendBaseService extends IService<BilletHotsend> {
     void addOne(BilletHotsend billetHotsend);
 
     void addHeight(BilletHotsend billetHotsend);
+
+    List<BilletHotsend> queryByCastMachineAndFurnaceNum(String castMachine, String furnaceNum);
 }

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

@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * @Description: 钢坯热送基础信息
@@ -242,5 +243,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 		rollHeightService.save(rollHeight);
 	}
 
-
+	@Override
+	public List<BilletHotsend> queryByCastMachineAndFurnaceNum(String castMachine, String furnaceNum) {
+		return billetHotsendBaseMapper.selectList(new LambdaQueryWrapper<BilletHotsend>().eq(BilletHotsend::getCastMachine, castMachine).eq(BilletHotsend::getFurnaceNum, furnaceNum));
+	}
 }