Explorar el Código

Merge remote-tracking branch 'origin/master'

wangxin hace 1 año
padre
commit
0a2cc64f41

+ 127 - 3
src/main/java/cn/ezhizao/project/business/controller/BizLotController.java

@@ -1,5 +1,6 @@
 package cn.ezhizao.project.business.controller;
 
+import java.util.ArrayList;
 import java.util.List;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
@@ -11,8 +12,11 @@ import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
 import cn.ezhizao.framework.web.controller.BaseController;
 import cn.ezhizao.framework.web.domain.AjaxResult;
 import cn.ezhizao.framework.web.page.TableDataInfo;
-import cn.ezhizao.project.business.domain.BizProductionPlanDetail;
+import cn.ezhizao.project.business.domain.*;
+import cn.ezhizao.project.business.service.*;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
@@ -21,8 +25,6 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
-import cn.ezhizao.project.business.domain.BizLot;
-import cn.ezhizao.project.business.service.IBizLotService;
 
 
 /**
@@ -37,6 +39,21 @@ public class BizLotController extends BaseController
 {
     @Resource
     private IBizLotService bizLotService;
+
+    @Resource
+    private IBizTechnologicalAmendService bizTechnologicalAmendService;
+
+    @Resource
+    private IBizTechnologicalAmendDetailService bizTechnologicalAmendDetailService;
+
+    @Resource
+    private IBizTechnologicalWasteRecyclingService bizTechnologicalWasteRecyclingService;
+
+    @Resource
+    private IBizTechnologicalWasteRecyclingDetailService bizTechnologicalWasteRecyclingDetailService;
+
+    @Resource
+    private IBizTechnologicalProcessDetailService bizTechnologicalProcessDetailService;
     @Resource
     HttpServletRequest request;
 
@@ -78,6 +95,41 @@ public class BizLotController extends BaseController
         BizLot lastLot = bizLotService.getLastLot(bizLot);
         return success(lastLot);
     }
+    /**
+     * 查询批次的工序
+     */
+    @PostMapping("getProcess")
+    public AjaxResult getProcess(@RequestBody BizLot bizLot)
+    {
+        //单批单改或多批单改
+        if(bizLot.getIsAmend()==1) {
+            QueryWrapper<BizTechnologicalAmend> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("is_stop",0);
+            queryWrapper.eq("lot_id",bizLot.getId());
+            BizTechnologicalAmend technologicalAmend = bizTechnologicalAmendService.getOne(queryWrapper);
+            QueryWrapper<BizTechnologicalAmendDetail> wrapper = new QueryWrapper<>();
+            wrapper.eq("technological_amend_id",technologicalAmend.getId());
+            List<BizTechnologicalAmendDetail> list = bizTechnologicalAmendDetailService.list(wrapper);
+            return success(list);
+        }else{
+            //该批是否废品回用
+            if(bizLot.getIsWasteRecycling() == 1) {
+                QueryWrapper<BizTechnologicalWasteRecycling> queryWrapper = new QueryWrapper<>();
+                queryWrapper.eq("lot_id",bizLot.getId());
+                BizTechnologicalWasteRecycling wasteRecycling = bizTechnologicalWasteRecyclingService.getOne(queryWrapper);
+                QueryWrapper<BizTechnologicalWasteRecyclingDetail> wrapper = new QueryWrapper<>();
+                wrapper.eq("technological_waste_recycling_id",wasteRecycling.getId());
+                List<BizTechnologicalWasteRecyclingDetail> list = bizTechnologicalWasteRecyclingDetailService.list(wrapper);
+                return success(list);
+            }
+            //查原始工艺工序表
+            else {
+                QueryWrapper<BizTechnologicalProcessDetail> wrapper = new QueryWrapper<>();
+                wrapper.eq("technological_process_id",bizLot.getTechnologicalProcessId());
+                return success(bizTechnologicalProcessDetailService.list(wrapper));
+            }
+        }
+    }
 
     /**
      * 查询计划单下所有的批次
@@ -91,6 +143,16 @@ public class BizLotController extends BaseController
         List<BizLot> list = bizLotService.getLotInfo(bizProductionPlanDetail);
         return getDataTable(list);
     }
+    /**
+     * 通过批次号查找批次信息
+     */
+    @PostMapping("/getLotInfoByLotCode")
+    public AjaxResult getLotInfoByLotCode(@RequestBody BizLot bizLot) throws NoSuchFieldException, IllegalAccessException
+    {
+        QueryWrapper<BizLot> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("lot_code",bizLot.getLotCode());
+        return success(bizLotService.getOne(queryWrapper));
+    }
     /**
      * 导出计划查询列表
      */
@@ -104,6 +166,68 @@ public class BizLotController extends BaseController
         ExcelUtil<BizLot> util = new ExcelUtil<BizLot>(BizLot.class);
         util.exportExcel(response, list, "计划查询数据");
     }
+    /**
+     * 废品回用
+     */
+    @PostMapping("/addWasteRecycling")
+    @Transactional
+    public AjaxResult addWasteRecycling(@RequestBody BizLot bizLot)
+    {
+        //废品回用保存,首先存废品回用新生成的批次
+        List<BizLot> lotList = new ArrayList<>();
+        for(String item : bizLot.getLotCodeList()) {
+            BizLot bizLot1 = new BizLot();
+            bizLot1.setLotCode(item);
+            bizLot1.setIsWasteRecycling(1L);
+            bizLot1.setProductionPlanDetailId(bizLot.getProductionPlanDetailId());
+            bizLot1.setTechnologicalProcessId(bizLot.getTechnologicalProcessId());
+            bizLot1.setTechnologyVersion(bizLot.getTechnologyVersion());
+            bizLot1.setProductId(bizLot.getProductId());
+            bizLot1.setProductionQuantity(bizLot.getProductionQuantity());
+            bizLot1.setRequisitionDepartmentId(bizLot.getRequisitionDepartmentId());
+            bizLot1.setRequisitionDepartmentName(bizLot.getRequisitionDepartmentName());
+            lotList.add(bizLot1);
+        }
+        bizLotService.saveBatch(lotList);
+        //新增批次存完,存废品回用工艺表
+        List<BizTechnologicalWasteRecycling> technologicalWasteRecyclingList = new ArrayList<>();
+        for (BizLot item : lotList) {
+            BizTechnologicalWasteRecycling bizTechnologicalWasteRecycling = new BizTechnologicalWasteRecycling();
+            bizTechnologicalWasteRecycling.setLotId(item.getId());
+            bizTechnologicalWasteRecycling.setLotCode(item.getLotCode());
+            bizTechnologicalWasteRecycling.setProductionPlanDetailId(bizLot.getProductionPlanDetailId());
+            bizTechnologicalWasteRecycling.setTechnologicalProcessId(bizLot.getTechnologicalProcessId());
+            bizTechnologicalWasteRecycling.setTechnologyVersion(bizLot.getTechnologyVersion());
+            bizTechnologicalWasteRecycling.setProductDescription(bizLot.getProductDescription());
+            bizTechnologicalWasteRecycling.setProductShaftCategory(bizLot.getProcessList().get(0).getProductShaftCategory());
+            bizTechnologicalWasteRecycling.setProductCode(bizLot.getProcessList().get(0).getProductCode());
+            bizTechnologicalWasteRecycling.setProductId(bizLot.getProductId());
+            bizTechnologicalWasteRecycling.setProductShaftCategoryName(bizLot.getProcessList().get(0).getProductShaftCategoryName());
+            technologicalWasteRecyclingList.add(bizTechnologicalWasteRecycling);
+        }
+        bizTechnologicalWasteRecyclingService.saveBatch(technologicalWasteRecyclingList);
+        //废品工艺表存完,存废品工序表
+        List<BizTechnologicalWasteRecyclingDetail> technologicalWasteRecyclingDetailList = new ArrayList<>();
+        for (BizTechnologicalWasteRecycling item : technologicalWasteRecyclingList) {
+            for(BizTechnologicalWasteRecyclingDetail info : bizLot.getProcessList()) {
+                BizTechnologicalWasteRecyclingDetail bizTechnologicalWasteRecyclingDetail = new BizTechnologicalWasteRecyclingDetail();
+                bizTechnologicalWasteRecyclingDetail.setTechnologicalWasteRecyclingId(item.getId());
+                bizTechnologicalWasteRecyclingDetail.setTechnologyVersion(item.getTechnologyVersion());
+                bizTechnologicalWasteRecyclingDetail.setProductId(info.getProductId());
+                bizTechnologicalWasteRecyclingDetail.setProductCode(info.getProductCode());
+                bizTechnologicalWasteRecyclingDetail.setProcessStepNumber(info.getProcessStepNumber());
+                bizTechnologicalWasteRecyclingDetail.setProcessId(info.getProcessId());
+                bizTechnologicalWasteRecyclingDetail.setProcessKey(info.getProcessKey());
+                bizTechnologicalWasteRecyclingDetail.setProcessCode(info.getProcessCode());
+                bizTechnologicalWasteRecyclingDetail.setProcessAlias(info.getProcessAlias());
+                bizTechnologicalWasteRecyclingDetail.setProductShaftCategory(info.getProductShaftCategory());
+                bizTechnologicalWasteRecyclingDetail.setProductShaftCategoryName(info.getProductShaftCategoryName());
+                bizTechnologicalWasteRecyclingDetail.setProductDescription(info.getProductDescription());
+                technologicalWasteRecyclingDetailList.add(bizTechnologicalWasteRecyclingDetail);
+            }
+        }
+        return success(bizTechnologicalWasteRecyclingDetailService.saveBatch(technologicalWasteRecyclingDetailList));
+    }
 
     /**
      * 获取计划查询详细信息

+ 7 - 0
src/main/java/cn/ezhizao/project/business/domain/BizDaywork.java

@@ -197,6 +197,13 @@ public class BizDaywork extends BaseEntity {
     @TableField(exist = false)
     private BizProduct product;
 
+    @TableField(exist = false)
+    private Integer isAmend;
+
+    @TableField(exist = false)
+    private String productShaftCategoryName;
+
+
 
 
 

+ 9 - 0
src/main/java/cn/ezhizao/project/business/domain/BizLot.java

@@ -160,6 +160,15 @@ public class BizLot extends BaseEntity {
     //领料部门名称
     private String requisitionDepartmentName;
 
+    @TableField(exist = false)
+    private String productionPlanNo;
+
+    @TableField(exist = false)
+    private Long  lineNumber;
+
+    @TableField(exist = false)
+    private List<BizTechnologicalWasteRecyclingDetail> processList;
+
 
 
 }

+ 0 - 3
src/main/java/cn/ezhizao/project/business/domain/BizTechnologicalProcessDetail.java

@@ -82,9 +82,6 @@ public class BizTechnologicalProcessDetail extends BaseEntity
     private Long Value;
 
     private String processKey;
-    //排序字段
-    @TableField(exist = false)
-    private Integer uuid;
 
     @TableField(exist = false)
     private String remark;

+ 91 - 0
src/main/java/cn/ezhizao/project/business/domain/BizTechnologicalWasteRecycling.java

@@ -0,0 +1,91 @@
+package cn.ezhizao.project.business.domain;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+
+
+/**
+ * 废品回用工艺对象 biz_technological_waste_recycling
+ *
+ * @author ezhizao
+ * @date 2024-04-17
+ */
+@Data
+@TableName(value = "biz_technological_waste_recycling")
+public class BizTechnologicalWasteRecycling extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 租户id */
+    @ApiModelProperty(value = "${comment}")
+    private Long tenantId;
+
+    /** 批次号id */
+    @ApiModelProperty(value = "${comment}")
+    private Long lotId;
+
+    /** 批次号 */
+    @Excel(name = "批次号")
+    @ApiModelProperty(value = "批次号")
+    private String lotCode;
+
+    /** 计划单id */
+    @ApiModelProperty(value = "批次号")
+    private Long productionPlanId;
+
+    /** 计划单明细id */
+    @ApiModelProperty(value = "批次号")
+    private Long productionPlanDetailId;
+
+    /** 产品编码 */
+    @Excel(name = "产品编码")
+    @ApiModelProperty(value = "产品编码")
+    private String productCode;
+
+    /** 原始工艺id */
+    @ApiModelProperty(value = "产品编码")
+    private Long technologicalProcessId;
+
+    /** 原始工艺版本A,B,C */
+    @Excel(name = "原始工艺版本A,B,C")
+    @ApiModelProperty(value = "原始工艺版本A,B,C")
+    private String technologyVersion;
+
+    /** 产品描述 */
+    @Excel(name = "产品描述")
+    @ApiModelProperty(value = "产品描述")
+    private String productDescription;
+
+    /** 轴类型码 */
+    @Excel(name = "轴类型码")
+    @ApiModelProperty(value = "轴类型码")
+    private String productShaftCategory;
+
+    /** 产品id */
+    @ApiModelProperty(value = "轴类型码")
+    private Long productId;
+
+    /** 轴类型id */
+    @ApiModelProperty(value = "轴类型码")
+    private Long productShaftCategoryId;
+
+    /** 规格 */
+    @Excel(name = "规格")
+    @ApiModelProperty(value = "规格")
+    private String productSpecification;
+
+    /** 轴类型 */
+    @Excel(name = "轴类型")
+    @ApiModelProperty(value = "轴类型")
+    private String productShaftCategoryName;
+
+    /** 图号 */
+    @Excel(name = "图号")
+    @ApiModelProperty(value = "图号")
+    private String productDrawingNumber;
+
+}

+ 85 - 0
src/main/java/cn/ezhizao/project/business/domain/BizTechnologicalWasteRecyclingDetail.java

@@ -0,0 +1,85 @@
+package cn.ezhizao.project.business.domain;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 废品回用工序详情对象 biz_technological_waste_recycling_detail
+ *
+ * @author ezhizao
+ * @date 2024-04-17
+ */
+@Data
+@TableName(value = "biz_technological_waste_recycling_detail")
+public class BizTechnologicalWasteRecyclingDetail extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 租户id */
+    @ApiModelProperty(value = "${comment}")
+    private Long tenantId;
+
+    /** 工艺id */
+    @ApiModelProperty(value = "${comment}")
+    private Long technologicalWasteRecyclingId;
+
+    /** 工艺编码 */
+    @Excel(name = "工艺编码")
+    @ApiModelProperty(value = "工艺编码")
+    private String technologyVersion;
+
+    /** 产品id */
+    @ApiModelProperty(value = "工艺编码")
+    private Long productId;
+
+    /** 产品编码 */
+    @Excel(name = "产品编码")
+    @ApiModelProperty(value = "产品编码")
+    private String productCode;
+
+    /** 工序排序
+ */
+    private String processStepNumber;
+
+    /** 工序id */
+    private Long processId;
+
+    /** 工序key值 */
+    @Excel(name = "工序key值")
+    @ApiModelProperty(value = "工序key值")
+    private String processKey;
+
+    /** 工序编码 */
+    @Excel(name = "工序编码")
+    @ApiModelProperty(value = "工序编码")
+    private String processCode;
+
+    /** 工序简称 */
+    @Excel(name = "工序简称")
+    @ApiModelProperty(value = "工序简称")
+    private String processAlias;
+
+    /** 轴类型码 */
+    @Excel(name = "轴类型码")
+    @ApiModelProperty(value = "轴类型码")
+    private String productShaftCategory;
+
+    /** 轴类型助记码EPS */
+    @Excel(name = "轴类型助记码EPS")
+    @ApiModelProperty(value = "轴类型助记码EPS")
+    private String productShaftCategoryName;
+
+    /** 产品描述 */
+    @Excel(name = "产品描述")
+    @ApiModelProperty(value = "产品描述")
+    private String productDescription;
+    //排序字段
+    @TableField(exist = false)
+    private Integer uuid;
+
+}

+ 29 - 0
src/main/java/cn/ezhizao/project/business/mapper/BizTechnologicalWasteRecyclingDetailMapper.java

@@ -0,0 +1,29 @@
+package cn.ezhizao.project.business.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import cn.ezhizao.project.business.domain.BizTechnologicalWasteRecyclingDetail;
+
+/**
+ * 废品回用工序详情Mapper接口
+ *
+ * @author ezhizao
+ * @date 2024-04-17
+ */
+public interface BizTechnologicalWasteRecyclingDetailMapper extends BaseMapper<BizTechnologicalWasteRecyclingDetail>
+{
+    /**
+     * 查询废品回用工序详情列表
+     *
+     * @param bizTechnologicalWasteRecyclingDetail 废品回用工序详情
+     * @return 废品回用工序详情集合
+     */
+    public List<BizTechnologicalWasteRecyclingDetail> getList(BizTechnologicalWasteRecyclingDetail bizTechnologicalWasteRecyclingDetail);
+
+    /**
+     * 物理删除
+     * @param bizTechnologicalWasteRecyclingDetail
+     * @return 删除结果
+    */
+    public int physicalDelete(BizTechnologicalWasteRecyclingDetail bizTechnologicalWasteRecyclingDetail);
+}

+ 29 - 0
src/main/java/cn/ezhizao/project/business/mapper/BizTechnologicalWasteRecyclingMapper.java

@@ -0,0 +1,29 @@
+package cn.ezhizao.project.business.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import cn.ezhizao.project.business.domain.BizTechnologicalWasteRecycling;
+
+/**
+ * 废品回用工艺Mapper接口
+ *
+ * @author ezhizao
+ * @date 2024-04-17
+ */
+public interface BizTechnologicalWasteRecyclingMapper extends BaseMapper<BizTechnologicalWasteRecycling>
+{
+    /**
+     * 查询废品回用工艺列表
+     *
+     * @param bizTechnologicalWasteRecycling 废品回用工艺
+     * @return 废品回用工艺集合
+     */
+    public List<BizTechnologicalWasteRecycling> getList(BizTechnologicalWasteRecycling bizTechnologicalWasteRecycling);
+
+    /**
+     * 物理删除
+     * @param bizTechnologicalWasteRecycling
+     * @return 删除结果
+    */
+    public int physicalDelete(BizTechnologicalWasteRecycling bizTechnologicalWasteRecycling);
+}

+ 30 - 0
src/main/java/cn/ezhizao/project/business/service/IBizTechnologicalWasteRecyclingDetailService.java

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import cn.ezhizao.project.business.domain.BizTechnologicalWasteRecyclingDetail;
+
+/**
+ * 废品回用工序详情Service接口
+ *
+ * @author ezhizao
+ * @date 2024-04-17
+ */
+public interface IBizTechnologicalWasteRecyclingDetailService extends IService<BizTechnologicalWasteRecyclingDetail>
+{
+    /**
+     * 查询废品回用工序详情列表
+     *
+     * @param bizTechnologicalWasteRecyclingDetail 废品回用工序详情
+     * @return 废品回用工序详情集合
+     */
+    public List<BizTechnologicalWasteRecyclingDetail> getList(BizTechnologicalWasteRecyclingDetail bizTechnologicalWasteRecyclingDetail);
+
+    /**
+     * 物理删除
+     * @param bizTechnologicalWasteRecyclingDetail
+     * @return 删除结果
+     */
+    public int physicalDelete(BizTechnologicalWasteRecyclingDetail bizTechnologicalWasteRecyclingDetail);
+
+}

+ 30 - 0
src/main/java/cn/ezhizao/project/business/service/IBizTechnologicalWasteRecyclingService.java

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import cn.ezhizao.project.business.domain.BizTechnologicalWasteRecycling;
+
+/**
+ * 废品回用工艺Service接口
+ *
+ * @author ezhizao
+ * @date 2024-04-17
+ */
+public interface IBizTechnologicalWasteRecyclingService extends IService<BizTechnologicalWasteRecycling>
+{
+    /**
+     * 查询废品回用工艺列表
+     *
+     * @param bizTechnologicalWasteRecycling 废品回用工艺
+     * @return 废品回用工艺集合
+     */
+    public List<BizTechnologicalWasteRecycling> getList(BizTechnologicalWasteRecycling bizTechnologicalWasteRecycling);
+
+    /**
+     * 物理删除
+     * @param bizTechnologicalWasteRecycling
+     * @return 删除结果
+     */
+    public int physicalDelete(BizTechnologicalWasteRecycling bizTechnologicalWasteRecycling);
+
+}

+ 43 - 0
src/main/java/cn/ezhizao/project/business/service/impl/BizTechnologicalWasteRecyclingDetailServiceImpl.java

@@ -0,0 +1,43 @@
+package cn.ezhizao.project.business.service.impl;
+
+import java.util.List;
+import javax.annotation.Resource;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import cn.ezhizao.project.business.mapper.BizTechnologicalWasteRecyclingDetailMapper;
+import cn.ezhizao.project.business.domain.BizTechnologicalWasteRecyclingDetail;
+import cn.ezhizao.project.business.service.IBizTechnologicalWasteRecyclingDetailService;
+
+/**
+ * 废品回用工序详情Service业务层处理
+ *
+ * @author ezhizao
+ * @date 2024-04-17
+ */
+@Service
+public class BizTechnologicalWasteRecyclingDetailServiceImpl  extends ServiceImpl<BizTechnologicalWasteRecyclingDetailMapper, BizTechnologicalWasteRecyclingDetail> implements IBizTechnologicalWasteRecyclingDetailService
+{
+    @Resource
+    private BizTechnologicalWasteRecyclingDetailMapper bizTechnologicalWasteRecyclingDetailMapper;
+
+    /**
+     * 查询废品回用工序详情列表
+     *
+     * @param bizTechnologicalWasteRecyclingDetail 废品回用工序详情
+     * @return 废品回用工序详情
+     */
+    @Override
+    public List<BizTechnologicalWasteRecyclingDetail> getList(BizTechnologicalWasteRecyclingDetail bizTechnologicalWasteRecyclingDetail)
+    {
+        return bizTechnologicalWasteRecyclingDetailMapper.getList(bizTechnologicalWasteRecyclingDetail);
+    }
+
+    /**
+     * 物理删除
+     * @param bizTechnologicalWasteRecyclingDetail
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizTechnologicalWasteRecyclingDetail bizTechnologicalWasteRecyclingDetail){ return bizTechnologicalWasteRecyclingDetailMapper.physicalDelete(bizTechnologicalWasteRecyclingDetail); };
+
+}

+ 43 - 0
src/main/java/cn/ezhizao/project/business/service/impl/BizTechnologicalWasteRecyclingServiceImpl.java

@@ -0,0 +1,43 @@
+package cn.ezhizao.project.business.service.impl;
+
+import java.util.List;
+import javax.annotation.Resource;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import cn.ezhizao.project.business.mapper.BizTechnologicalWasteRecyclingMapper;
+import cn.ezhizao.project.business.domain.BizTechnologicalWasteRecycling;
+import cn.ezhizao.project.business.service.IBizTechnologicalWasteRecyclingService;
+
+/**
+ * 废品回用工艺Service业务层处理
+ *
+ * @author ezhizao
+ * @date 2024-04-17
+ */
+@Service
+public class BizTechnologicalWasteRecyclingServiceImpl  extends ServiceImpl<BizTechnologicalWasteRecyclingMapper, BizTechnologicalWasteRecycling> implements IBizTechnologicalWasteRecyclingService
+{
+    @Resource
+    private BizTechnologicalWasteRecyclingMapper bizTechnologicalWasteRecyclingMapper;
+
+    /**
+     * 查询废品回用工艺列表
+     *
+     * @param bizTechnologicalWasteRecycling 废品回用工艺
+     * @return 废品回用工艺
+     */
+    @Override
+    public List<BizTechnologicalWasteRecycling> getList(BizTechnologicalWasteRecycling bizTechnologicalWasteRecycling)
+    {
+        return bizTechnologicalWasteRecyclingMapper.getList(bizTechnologicalWasteRecycling);
+    }
+
+    /**
+     * 物理删除
+     * @param bizTechnologicalWasteRecycling
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizTechnologicalWasteRecycling bizTechnologicalWasteRecycling){ return bizTechnologicalWasteRecyclingMapper.physicalDelete(bizTechnologicalWasteRecycling); };
+
+}

+ 9 - 3
src/main/resources/mybatis/business/BizLotMapper.xml

@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result column="dept_id" property="deptId"/>
         <association property="lotWaste" column="lot_id" select="getLotWaste"/>
         <association property="processAlias" column="id" select="getProcessAlias"/>
+        <association property="productShaftCategoryName" column="technological_process_id" select="getProductShaftCategoryName"/>
         <association property="product" column="product_id" select="getProduct"/>
     </resultMap>
     <resultMap id="BizTechnologyProcessResult" type="cn.ezhizao.project.business.domain.BizTechnologicalProcessDetail">
@@ -46,6 +47,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             deleted = 0
             AND id NOT IN(select lot_id from biz_daywork t1 ) and production_plan_detail_id = #{id}
     </select>
+    <select id="getProductShaftCategoryName" resultType="String">
+        select product_shaft_category_name from biz_technological_process t1 where t1.id = #{technological_process_id}
+    </select>
     <select id="getList" parameterType="BizLot" resultMap="BizLotResult">
         SELECT * FROM biz_lot
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
@@ -75,10 +79,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select lot_code from biz_lot t1  where t1.deleted = 0 and t1.from_id = 0 and t1.production_plan_detail_id = #{productionPlanDetailId} order by t1.lot_code desc limit 1
     </select>
     <select id="getLotList" resultMap="BizDayworkResult" >
-        select t1.id as lot_id,t1.lot_code,t1.product_id,t1.technology_version,t1.production_quantity,(select lot_code from biz_lot
+        select t1.id as lot_id,t1.lot_code,t1.product_id,t1.technology_version,t1.technological_process_id,t1.production_quantity,(select lot_code from biz_lot
         where from_id = id) as
-        fromName,t1.is_waste_recycling,t1.is_fallback,t1.is_waste,t1.production_plan_detail_id,t2.company_alias,t2.production_plan_no,t2.product_description
-        as description,t3.id,t3.create_time,t4.dept_name,t4.dept_id from biz_lot t1
+        fromName,t1.is_waste_recycling,t1.is_fallback,t1.is_waste,t1.is_amend,t1.production_plan_detail_id,t2.company_alias,t2.production_plan_no,t2.product_description
+        as description,t2.line_number,t3.id,t3.create_time,t4.dept_name,t4.dept_id from biz_lot t1
         left join biz_production_plan_detail t2 on t1.production_plan_detail_id = t2.id
         left join biz_daywork t3 on t1.id = t3.lot_id
         left join sys_dept t4 on t3.dept_id = t4.dept_id
@@ -88,6 +92,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="productDescription != null  and productDescription != ''">AND t2.product_description like concat('%', #{productDescription}, '%')
             </if>
             <if test="lotCode != null  and lotCode != ''">AND t1.lot_code like concat('%', #{lotCode},'%')</if>
+            <if test="productionPlanNo != null  and productionPlanNo != ''">AND t2.production_plan_no like concat('%', #{productionPlanNo},'%')</if>
+            <if test="lineNumber != null ">AND t2.line_number = #{lineNumber}</if>
             <if test="isWasteRecycling != null ">AND t1.is_waste_recycling = #{isWasteRecycling}</if>
             <if test="isFallback != null ">AND t1.is_fallback = #{isFallback}</if>
         </trim>

+ 37 - 0
src/main/resources/mybatis/business/BizTechnologicalWasteRecyclingDetailMapper.xml

@@ -0,0 +1,37 @@
+<?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="cn.ezhizao.project.business.mapper.BizTechnologicalWasteRecyclingDetailMapper">
+
+    <resultMap type="cn.ezhizao.project.business.domain.BizTechnologicalWasteRecyclingDetail" id="BizTechnologicalWasteRecyclingDetailResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizTechnologicalWasteRecyclingDetail" resultMap="BizTechnologicalWasteRecyclingDetailResult">
+        SELECT * FROM biz_technological_waste_recycling_detail
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="technologyVersion != null  and technologyVersion != ''"> AND technology_version = #{technologyVersion}</if>
+            <if test="productCode != null  and productCode != ''"> AND product_code = #{productCode}</if>
+            <if test="processStepNumber != null  and processStepNumber != ''"> AND process_step_number = #{processStepNumber}</if>
+            <if test="processKey != null  and processKey != ''"> AND process_key = #{processKey}</if>
+            <if test="processCode != null  and processCode != ''"> AND process_code = #{processCode}</if>
+            <if test="processAlias != null  and processAlias != ''"> AND process_alias = #{processAlias}</if>
+            <if test="productShaftCategory != null  and productShaftCategory != ''"> AND product_shaft_category = #{productShaftCategory}</if>
+            <if test="productShaftCategoryName != null  and productShaftCategoryName != ''"> AND product_shaft_category_name like concat('%', #{productShaftCategoryName}, '%')</if>
+            <if test="productDescription != null  and productDescription != ''"> AND product_description = #{productDescription}</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_technological_waste_recycling_detail
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>

+ 36 - 0
src/main/resources/mybatis/business/BizTechnologicalWasteRecyclingMapper.xml

@@ -0,0 +1,36 @@
+<?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="cn.ezhizao.project.business.mapper.BizTechnologicalWasteRecyclingMapper">
+
+    <resultMap type="cn.ezhizao.project.business.domain.BizTechnologicalWasteRecycling" id="BizTechnologicalWasteRecyclingResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizTechnologicalWasteRecycling" resultMap="BizTechnologicalWasteRecyclingResult">
+        SELECT * FROM biz_technological_waste_recycling
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="lotCode != null  and lotCode != ''"> AND lot_code = #{lotCode}</if>
+            <if test="productCode != null  and productCode != ''"> AND product_code = #{productCode}</if>
+            <if test="technologyVersion != null  and technologyVersion != ''"> AND technology_version = #{technologyVersion}</if>
+            <if test="productDescription != null  and productDescription != ''"> AND product_description = #{productDescription}</if>
+            <if test="productShaftCategory != null  and productShaftCategory != ''"> AND product_shaft_category = #{productShaftCategory}</if>
+            <if test="productSpecification != null  and productSpecification != ''"> AND product_specification = #{productSpecification}</if>
+            <if test="productShaftCategoryName != null  and productShaftCategoryName != ''"> AND product_shaft_category_name like concat('%', #{productShaftCategoryName}, '%')</if>
+            <if test="productDrawingNumber != null  and productDrawingNumber != ''"> AND product_drawing_number = #{productDrawingNumber}</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_technological_waste_recycling
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>