qiangxuan 8 місяців тому
батько
коміт
fbb22a5c8a
13 змінених файлів з 410 додано та 12 видалено
  1. 5 12
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/controller/BilletHotsendBaseController.java
  2. 17 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/entity/BilletHotsendDetailsVo.java
  3. 3 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/service/IBilletHotsendBaseService.java
  4. 22 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/service/impl/BilletHotsendBaseServiceImpl.java
  5. 162 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/controller/BilletHotsendChangeShiftController.java
  6. 111 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/entity/BilletHotsendChangeShift.java
  7. 14 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/mapper/BilletHotsendChangeShiftMapper.java
  8. 5 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/mapper/xml/BilletHotsendChangeShiftMapper.xml
  9. 14 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/service/IBilletHotsendChangeShiftService.java
  10. 18 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/service/impl/BilletHotsendChangeShiftServiceImpl.java
  11. 16 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendDetails/controller/BilletHotsendDetailsController.java
  12. 1 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendDetails/service/IBilletHotsendDetailsService.java
  13. 22 0
      zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendDetails/service/impl/BilletHotsendDetailsServiceImpl.java

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

@@ -12,8 +12,8 @@ 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.BilletHotsendDetailsVo;
 import org.jeecg.modules.billet.billetHotsend.entity.RealtimeStats;
-import org.jeecg.modules.billet.billetHotsend.entity.RulerDefaultConfig;
 import org.jeecg.modules.billet.billetHotsend.service.IBilletHotsendBaseService;
 import org.jeecg.modules.billet.billetHotsend.service.IRulerDefaultConfigService;
 import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
@@ -25,7 +25,6 @@ import org.springframework.web.servlet.ModelAndView;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.Arrays;
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -98,16 +97,10 @@ public class BilletHotsendBaseController extends JeecgController<BilletHotsend,
     @AutoLog(value = "钢坯热送基础信息-添加")
     @ApiOperation(value="钢坯热送基础信息-添加", notes="钢坯热送基础信息-添加")
     @PostMapping(value = "/add")
-    public Result<?> add(@RequestBody BilletHotsend billetHotsendVo) {
-        BilletHotsend billetHotsend = getNew(billetHotsendVo.getCastMachine());
-        RulerDefaultConfig last = rulerDefaultConfigService.getLast(billetHotsend.getCastMachine());
-        billetHotsend.setShiftGroup(last.getShiftGroup());
-        billetHotsend.setShift(last.getShift());
-        billetHotsend.setFurnaceNum(last.getPourHeats());
-        billetHotsend.setCreateDate(new Date());
-        billetHotsendBaseService.save(billetHotsend);
-        operateLogService.add(billetHotsend,null,BilletHotsend.class);
-        return Result.OK(billetHotsend);
+    public Result<?> add(@RequestBody BilletHotsendDetailsVo billetHotsendDetailsVo) {
+        billetHotsendBaseService.saveBilletHotsendDetails(billetHotsendDetailsVo);
+        operateLogService.add(billetHotsendDetailsVo.getBilletHotsend(),null,BilletHotsend.class);
+        return Result.OK(billetHotsendDetailsVo.getBilletHotsend());
     }
 
 

+ 17 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsend/entity/BilletHotsendDetailsVo.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.billet.billetHotsend.entity;
+
+import lombok.Data;
+import org.jeecg.modules.billet.billetHotsendDetails.entity.BilletHotsendDetails;
+
+import java.util.List;
+
+/**
+ *  钢坯热送单炉传递单和明细信息
+ */
+@Data
+public class BilletHotsendDetailsVo {
+
+    private BilletHotsend billetHotsend;
+
+    private List<BilletHotsendDetails> billetHotsendDetailsList;
+}

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

@@ -2,6 +2,7 @@ package org.jeecg.modules.billet.billetHotsend.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsend;
+import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsendDetailsVo;
 
 import java.util.List;
 
@@ -20,4 +21,6 @@ public interface IBilletHotsendBaseService extends IService<BilletHotsend> {
     void addHeight(BilletHotsend billetHotsend);
 
     List<BilletHotsend> queryByCastMachineAndFurnaceNum(String castMachine, String furnaceNum);
+
+    void saveBilletHotsendDetails(BilletHotsendDetailsVo billetHotsendDetailsVo);
 }

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

@@ -2,11 +2,15 @@ package org.jeecg.modules.billet.billetHotsend.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsend;
+import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsendDetailsVo;
 import org.jeecg.modules.billet.billetHotsend.entity.RulerDefaultConfig;
 import org.jeecg.modules.billet.billetHotsend.mapper.BilletHotsendBaseMapper;
 import org.jeecg.modules.billet.billetHotsend.service.IBilletHotsendBaseService;
 import org.jeecg.modules.billet.billetHotsend.service.IRulerDefaultConfigService;
+import org.jeecg.modules.billet.billetHotsendDetails.entity.BilletHotsendDetails;
+import org.jeecg.modules.billet.billetHotsendDetails.service.IBilletHotsendDetailsService;
 import org.jeecg.modules.billet.rollClubOne.entity.RollClubOne;
 import org.jeecg.modules.billet.rollClubOne.service.IRollClubOneService;
 import org.jeecg.modules.billet.rollHeight.entity.RollHeight;
@@ -16,6 +20,7 @@ import org.jeecg.modules.billet.storageBill.entity.StorageBillModel;
 import org.jeecg.modules.billet.storageBill.service.IStorageBillModelService;
 import org.jeecg.modules.billet.storageBill.service.IStorageBillService;
 import org.jeecg.modules.billet.storageCarLog.service.IStorageCarLogService;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -45,6 +50,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 	private IRollClubOneService rollClubOneService;
 	@Autowired
 	private IRollHeightService rollHeightService;
+	@Autowired
+	private IBilletHotsendDetailsService billetHotsendDetailsService;
 
 	@Override
 	public void updateDesc(BilletHotsend billetHotsend) {
@@ -250,4 +257,19 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
 	public List<BilletHotsend> queryByCastMachineAndFurnaceNum(String castMachine, String furnaceNum) {
 		return billetHotsendBaseMapper.selectList(new LambdaQueryWrapper<BilletHotsend>().eq(BilletHotsend::getCastMachine, castMachine).eq(BilletHotsend::getFurnaceNum, furnaceNum));
 	}
+
+	@Override
+	public void saveBilletHotsendDetails(BilletHotsendDetailsVo billetHotsendDetailsVo) {
+		BilletHotsend billetHotsend = new BilletHotsend();
+		// 新保存 钢坯热送基础信息
+        BeanUtils.copyProperties(billetHotsendDetailsVo.getBilletHotsend(), billetHotsend);
+        billetHotsend.setCreateDate(new Date());
+        billetHotsendBaseMapper.insert(billetHotsend);
+		// 保存 钢坯热送单炉支数传递单明细
+		if (oConvertUtils.listIsNotEmpty(billetHotsendDetailsVo.getBilletHotsendDetailsList())){
+			List<BilletHotsendDetails> billetHotsendDetailsList = billetHotsendDetailsVo.getBilletHotsendDetailsList();
+			billetHotsendDetailsList.stream().peek(billetHotsendDetails -> billetHotsendDetails.setCreateTime(new Date())).count();
+			billetHotsendDetailsService.saveBatch(billetHotsendDetailsList);
+		}
+	}
 }

+ 162 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/controller/BilletHotsendChangeShiftController.java

@@ -0,0 +1,162 @@
+package org.jeecg.modules.billet.billetHotsendChangeShift.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+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.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
+import org.jeecg.modules.billet.billetHotsendChangeShift.service.IBilletHotsendChangeShiftService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+
+ /**
+ * @Description: 钢坯交班记录
+ * @Author: jeecg-boot
+ * @Date:   2024-11-19
+ * @Version: V1.0
+ */
+@Api(tags="钢坯交班记录")
+@RestController
+@RequestMapping("/billetHotsend/billetHotsendChangeShift")
+@Slf4j
+public class BilletHotsendChangeShiftController extends JeecgController<BilletHotsendChangeShift, IBilletHotsendChangeShiftService> {
+	@Autowired
+	private IBilletHotsendChangeShiftService billetHotsendChangeShiftService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param billetHotsendChangeShift
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "钢坯交班记录-分页列表查询")
+	@ApiOperation(value="钢坯交班记录-分页列表查询", notes="钢坯交班记录-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<BilletHotsendChangeShift>> queryPageList(BilletHotsendChangeShift billetHotsendChangeShift,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<BilletHotsendChangeShift> queryWrapper = QueryGenerator.initQueryWrapper(billetHotsendChangeShift, req.getParameterMap());
+		Page<BilletHotsendChangeShift> page = new Page<BilletHotsendChangeShift>(pageNo, pageSize);
+		IPage<BilletHotsendChangeShift> pageList = billetHotsendChangeShiftService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param billetHotsendChangeShift
+	 * @return
+	 */
+	@AutoLog(value = "钢坯交班记录-添加")
+	@ApiOperation(value="钢坯交班记录-添加", notes="钢坯交班记录-添加")
+	@RequiresPermissions("billetHotsendChangeShift:billet_hotsend_change_shift:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody BilletHotsendChangeShift billetHotsendChangeShift) {
+		billetHotsendChangeShiftService.save(billetHotsendChangeShift);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param billetHotsendChangeShift
+	 * @return
+	 */
+	@AutoLog(value = "钢坯交班记录-编辑")
+	@ApiOperation(value="钢坯交班记录-编辑", notes="钢坯交班记录-编辑")
+	@RequiresPermissions("billetHotsendChangeShift:billet_hotsend_change_shift:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody BilletHotsendChangeShift billetHotsendChangeShift) {
+		billetHotsendChangeShiftService.updateById(billetHotsendChangeShift);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "钢坯交班记录-通过id删除")
+	@ApiOperation(value="钢坯交班记录-通过id删除", notes="钢坯交班记录-通过id删除")
+	@RequiresPermissions("billetHotsendChangeShift:billet_hotsend_change_shift:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		billetHotsendChangeShiftService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "钢坯交班记录-批量删除")
+	@ApiOperation(value="钢坯交班记录-批量删除", notes="钢坯交班记录-批量删除")
+	@RequiresPermissions("billetHotsendChangeShift:billet_hotsend_change_shift:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.billetHotsendChangeShiftService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "钢坯交班记录-通过id查询")
+	@ApiOperation(value="钢坯交班记录-通过id查询", notes="钢坯交班记录-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<BilletHotsendChangeShift> queryById(@RequestParam(name="id",required=true) String id) {
+		BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getById(id);
+		if(billetHotsendChangeShift==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(billetHotsendChangeShift);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param billetHotsendChangeShift
+    */
+    @RequiresPermissions("billetHotsendChangeShift:billet_hotsend_change_shift:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, BilletHotsendChangeShift billetHotsendChangeShift) {
+        return super.exportXls(request, billetHotsendChangeShift, BilletHotsendChangeShift.class, "钢坯交班记录");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    @RequiresPermissions("billetHotsendChangeShift:billet_hotsend_change_shift:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, BilletHotsendChangeShift.class);
+    }
+
+}

+ 111 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/entity/BilletHotsendChangeShift.java

@@ -0,0 +1,111 @@
+package org.jeecg.modules.billet.billetHotsendChangeShift.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 钢坯交班记录
+ * @Author: jeecg-boot
+ * @Date:   2024-11-19
+ * @Version: V1.0
+ */
+@Data
+@TableName("billet_hotsend_change_shift")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="billet_hotsend_change_shift对象", description="钢坯交班记录")
+public class BilletHotsendChangeShift implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/**创建人*/
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+	/**创建日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private Date createTime;
+	/**更新人*/
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+	/**更新日期*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private Date updateTime;
+	/**所属部门*/
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+	/**铸机*/
+	@Excel(name = "铸机", width = 15)
+    @ApiModelProperty(value = "铸机")
+    private String castMachine;
+	/**当前浇铸炉号*/
+	@Excel(name = "当前浇铸炉号", width = 15)
+    @ApiModelProperty(value = "当前浇铸炉号")
+    private String pourHeats;
+	/**班组*/
+	@Excel(name = "班组", width = 15)
+    @ApiModelProperty(value = "班组")
+    private String shiftGroup;
+	/**班别*/
+	@Excel(name = "班别", width = 15)
+    @ApiModelProperty(value = "班别")
+    private String shift;
+	/**当前生产支数*/
+	@Excel(name = "当前生产支数", width = 15)
+    @ApiModelProperty(value = "当前生产支数")
+    private Integer productAmount;
+	/**当前废品支数*/
+	@Excel(name = "当前废品支数", width = 15)
+    @ApiModelProperty(value = "当前废品支数")
+    private Integer wasteAmount;
+	/**当前热送支数*/
+	@Excel(name = "当前热送支数", width = 15)
+    @ApiModelProperty(value = "当前热送支数")
+    private Integer hotsendAmount;
+	/**当前热装支数*/
+	@Excel(name = "当前热装支数", width = 15)
+    @ApiModelProperty(value = "当前热装支数")
+    private Integer hotfeignAmount;
+	/**当前起垛支数*/
+	@Excel(name = "当前起垛支数", width = 15)
+    @ApiModelProperty(value = "当前起垛支数")
+    private Integer stackAmount;
+	/**当班总重*/
+	@Excel(name = "当班总重", width = 15)
+    @ApiModelProperty(value = "当班总重")
+    private Integer shiftProduct;
+	/**当班总数*/
+	@Excel(name = "当班总数", width = 15)
+    @ApiModelProperty(value = "当班总数")
+    private Integer shiftSum;
+	/**车牌号*/
+	@Excel(name = "车牌号", width = 15)
+    @ApiModelProperty(value = "车牌号")
+    private String carNumber;
+	/**出车号*/
+	@Excel(name = "出车号", width = 15)
+    @ApiModelProperty(value = "出车号")
+    private String outCarNum;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+    private String remark;
+}

+ 14 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/mapper/BilletHotsendChangeShiftMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.billet.billetHotsendChangeShift.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
+
+/**
+ * @Description: 钢坯交班记录
+ * @Author: jeecg-boot
+ * @Date:   2024-11-19
+ * @Version: V1.0
+ */
+public interface BilletHotsendChangeShiftMapper extends BaseMapper<BilletHotsendChangeShift> {
+
+}

+ 5 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/mapper/xml/BilletHotsendChangeShiftMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.billet.billetHotsendChangeShift.mapper.BilletHotsendChangeShiftMapper">
+
+</mapper>

+ 14 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/service/IBilletHotsendChangeShiftService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.billet.billetHotsendChangeShift.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
+
+/**
+ * @Description: 钢坯交班记录
+ * @Author: jeecg-boot
+ * @Date:   2024-11-19
+ * @Version: V1.0
+ */
+public interface IBilletHotsendChangeShiftService extends IService<BilletHotsendChangeShift> {
+
+}

+ 18 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendChangeShift/service/impl/BilletHotsendChangeShiftServiceImpl.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.billet.billetHotsendChangeShift.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
+import org.jeecg.modules.billet.billetHotsendChangeShift.mapper.BilletHotsendChangeShiftMapper;
+import org.jeecg.modules.billet.billetHotsendChangeShift.service.IBilletHotsendChangeShiftService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @Description: 钢坯交班记录
+ * @Author: jeecg-boot
+ * @Date:   2024-11-19
+ * @Version: V1.0
+ */
+@Service
+public class BilletHotsendChangeShiftServiceImpl extends ServiceImpl<BilletHotsendChangeShiftMapper, BilletHotsendChangeShift> implements IBilletHotsendChangeShiftService {
+
+}

+ 16 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendDetails/controller/BilletHotsendDetailsController.java

@@ -159,4 +159,20 @@ public class BilletHotsendDetailsController extends JeecgController<BilletHotsen
         return super.importExcel(request, response, BilletHotsendDetails.class);
     }
 
+	 /**
+	  * 通过铸机、炉号查询结束位
+	  *
+	  * @param id
+	  * @return
+	  */
+	 @ApiOperation(value="钢坯热送单炉支数结束根数-通过id查询", notes="钢坯热送单炉支数结束根数-通过id查询")
+	 @GetMapping(value = "/queryEndNumByCcmNo")
+	 public Result<BilletHotsendDetails> queryEndNumById(@RequestParam(name="ccmNo",required=false) Integer ccmNo, @RequestParam(name="heatNo",required=false) String heatNo, @RequestParam(name="billetNo",required=false) String billetNo) {
+		 BilletHotsendDetails billetHotsendDetails = billetHotsendDetailsService.queryEndNumByCcmNo(ccmNo, heatNo, billetNo);
+		 if(billetHotsendDetails==null) {
+			 return Result.error("未找到对应数据");
+		 }
+		 return Result.OK(billetHotsendDetails);
+	 }
+
 }

+ 1 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendDetails/service/IBilletHotsendDetailsService.java

@@ -11,4 +11,5 @@ import org.jeecg.modules.billet.billetHotsendDetails.entity.BilletHotsendDetails
  */
 public interface IBilletHotsendDetailsService extends IService<BilletHotsendDetails> {
 
+    BilletHotsendDetails queryEndNumByCcmNo(Integer ccmNo, String heatNo, String billetNo);
 }

+ 22 - 0
zgztBus/jeecg-module-sbm/src/main/java/org/jeecg/modules/billet/billetHotsendDetails/service/impl/BilletHotsendDetailsServiceImpl.java

@@ -1,11 +1,16 @@
 package org.jeecg.modules.billet.billetHotsendDetails.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.billet.billetHotsendDetails.entity.BilletHotsendDetails;
 import org.jeecg.modules.billet.billetHotsendDetails.mapper.BilletHotsendDetailsMapper;
 import org.jeecg.modules.billet.billetHotsendDetails.service.IBilletHotsendDetailsService;
 import org.springframework.stereotype.Service;
 
+import java.util.Comparator;
+import java.util.List;
+
 /**
  * @Description: 钢坯热送单炉支数传递单明细
  * @Author: jeecg-boot
@@ -15,4 +20,21 @@ import org.springframework.stereotype.Service;
 @Service
 public class BilletHotsendDetailsServiceImpl extends ServiceImpl<BilletHotsendDetailsMapper, BilletHotsendDetails> implements IBilletHotsendDetailsService {
 
+    @Override
+    public BilletHotsendDetails queryEndNumByCcmNo(Integer ccmNo, String heatNo, String billetNo) {
+        LambdaQueryWrapper<BilletHotsendDetails> queryWrapper = new LambdaQueryWrapper<>();
+        if (oConvertUtils.isNotEmpty(ccmNo) && oConvertUtils.isNotEmpty(heatNo)){
+            if (oConvertUtils.isNotEmpty(billetNo)){
+                queryWrapper.eq(BilletHotsendDetails::getCcmNo, ccmNo).eq(BilletHotsendDetails::getHeatNo, heatNo).eq(BilletHotsendDetails::getBilletNo, billetNo);
+            }else {
+                queryWrapper.eq(BilletHotsendDetails::getCcmNo, ccmNo).eq(BilletHotsendDetails::getHeatNo, heatNo);
+            }
+        }
+        List<BilletHotsendDetails> billetHotsendDetailsList = baseMapper.selectList(queryWrapper);
+        if (oConvertUtils.listIsEmpty(billetHotsendDetailsList)){
+            return null;
+        }
+        BilletHotsendDetails billetHotsendDetails = billetHotsendDetailsList.stream().max(Comparator.comparing(BilletHotsendDetails::getEndNum)).orElse(null);
+        return billetHotsendDetails;
+    }
 }