guoyujia há 10 meses atrás
pai
commit
6ac5f121bc
22 ficheiros alterados com 796 adições e 4 exclusões
  1. 18 1
      src/main/java/cn/ezhizao/project/business/product/controller/BizDayworkController.java
  2. 11 1
      src/main/java/cn/ezhizao/project/business/product/domain/BizDaywork.java
  3. 2 0
      src/main/java/cn/ezhizao/project/business/product/domain/BizDayworkItem.java
  4. 22 1
      src/main/java/cn/ezhizao/project/business/product/domain/BizLot.java
  5. 6 0
      src/main/java/cn/ezhizao/project/business/product/domain/BizProcessInspecion.java
  6. 1 0
      src/main/java/cn/ezhizao/project/business/product/domain/BizProcessInspectionDetail.java
  7. 1 0
      src/main/java/cn/ezhizao/project/business/product/mapper/BizDayworkMapper.java
  8. 1 0
      src/main/java/cn/ezhizao/project/business/product/service/IBizDayworkService.java
  9. 5 0
      src/main/java/cn/ezhizao/project/business/product/service/impl/BizDayworkServiceImpl.java
  10. 106 0
      src/main/java/cn/ezhizao/project/business/takeStockPeriod/controller/BizTakeStockPeriodController.java
  11. 46 0
      src/main/java/cn/ezhizao/project/business/takeStockPeriod/domain/BizTakeStockPeriod.java
  12. 31 0
      src/main/java/cn/ezhizao/project/business/takeStockPeriod/mapper/BizTakeStockPeriodMapper.java
  13. 32 0
      src/main/java/cn/ezhizao/project/business/takeStockPeriod/service/IBizTakeStockPeriodService.java
  14. 45 0
      src/main/java/cn/ezhizao/project/business/takeStockPeriod/service/impl/BizTakeStockPeriodServiceImpl.java
  15. 159 0
      src/main/java/cn/ezhizao/project/business/taksStockLot/controller/BizTaksStockLotController.java
  16. 120 0
      src/main/java/cn/ezhizao/project/business/taksStockLot/domain/BizTaksStockLot.java
  17. 31 0
      src/main/java/cn/ezhizao/project/business/taksStockLot/mapper/BizTaksStockLotMapper.java
  18. 32 0
      src/main/java/cn/ezhizao/project/business/taksStockLot/service/IBizTaksStockLotService.java
  19. 45 0
      src/main/java/cn/ezhizao/project/business/taksStockLot/service/impl/BizTaksStockLotServiceImpl.java
  20. 12 1
      src/main/resources/mybatis/business/product/BizDayworkMapper.xml
  21. 31 0
      src/main/resources/mybatis/business/takeStockPeriod/BizTakeStockPeriodMapper.xml
  22. 39 0
      src/main/resources/mybatis/business/taksStockLot/BizTaksStockLotMapper.xml

+ 18 - 1
src/main/java/cn/ezhizao/project/business/product/controller/BizDayworkController.java

@@ -8,6 +8,7 @@ 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.project.business.deptProcess.domain.BizDeptProcess;
+import cn.ezhizao.project.business.equipment.domain.BizEquipmentDetail;
 import cn.ezhizao.project.business.process.domain.BizProcess;
 import cn.ezhizao.project.business.product.domain.*;
 import cn.ezhizao.project.business.product.service.*;
@@ -798,6 +799,21 @@ public class BizDayworkController extends BaseController {
         ExcelUtil<BizDaywork> util = new ExcelUtil<BizDaywork>(BizDaywork.class);
         util.exportExcel(response, list, "报工数据");
     }
+    @PostMapping("/getDayworkInfoById")
+    public AjaxResult getDayworkInfoById(@RequestBody BizDaywork bizDaywork) throws NoSuchFieldException, IllegalAccessException {
+        List<BizDayworkItem> dayworkItemList = bizDayworkItemService.query().eq("daywork_id", bizDaywork.getId()).orderByDesc("process_step_number").list();
+        List<BizDayworkItem> latestDayworkItem = dayworkItemList.stream().filter(item -> item.getProcessStepNumber().equals(dayworkItemList.get(0).getProcessStepNumber())).collect(Collectors.toList());
+        List<BizEquipmentDetail> equipmentDetailList = new ArrayList<>();
+        latestDayworkItem.forEach(item -> {
+            BizEquipmentDetail equipmentDetail = new BizEquipmentDetail();
+            equipmentDetail.setEquipmentId(item.getEquipmentDetailId());
+            equipmentDetail.setEquipmentCode(item.getEquipmentDetailCode());
+            equipmentDetailList.add(equipmentDetail);
+        });
+        bizDaywork = bizDayworkService.getDayworkInfoById(bizDaywork);
+        bizDaywork.setEquipmentDetails(equipmentDetailList.stream().distinct().collect(Collectors.toList()));
+        return success(bizDaywork);
+    }
 
     /**
      * 获取报工详细信息
@@ -850,7 +866,7 @@ public class BizDayworkController extends BaseController {
                     bizDayworkItem.setProductionPlanDetailId(bizDaywork.getProductionPlanDetailId());
                     bizDayworkItem.setTechnologicalProcessId(bizDaywork.getTechnologicalProcessId());
                     bizDayworkItem.setQualifiedNum(bizDaywork.getProcessQualifiedNum());
-                    bizDayworkItem.setProdNum(bizDaywork.getProcessQualifiedNum());
+                    bizDayworkItem.setProdNum(bizDaywork.getProdNum());
                     bizDayworkItem.setProcessStepNumber(bizDaywork.getProcessStepNumber());
                     /* 20230408修改 */
                     // 如果是修改,则取当前工序的工序详情
@@ -1240,6 +1256,7 @@ public class BizDayworkController extends BaseController {
             bizDayworkItem.setProcessId(l.getDaywork().getProcessId());
             bizDayworkItem.setTechnologicalProcessDetailId(l.getDaywork().getTechnologicalProcessDetailId());
             bizDayworkItem.setDeptId(l.getDeptId());
+            bizDayworkItem.setIsSort(l.getIsSort());
             bizDayworkItem.setDeptName(l.getDeptName());
             bizDayworkItem.setLotId(l.getDaywork().getLotId());
             adds.add(bizDayworkItem);

+ 11 - 1
src/main/java/cn/ezhizao/project/business/product/domain/BizDaywork.java

@@ -5,6 +5,7 @@ import java.util.List;
 
 import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
 import cn.ezhizao.framework.web.domain.BaseEntity;
+import cn.ezhizao.project.business.equipment.domain.BizEquipmentDetail;
 import cn.ezhizao.project.business.process.domain.BizProcess;
 import cn.ezhizao.project.business.resourceGroup.domain.BizProductionResourceGroupDetail;
 import cn.ezhizao.project.business.technologicalProcessDetail.domain.BizTechnologicalProcessDetail;
@@ -197,6 +198,10 @@ public class BizDaywork extends BaseEntity
     @TableField(exist = false)
     private String productDescription;
     @TableField(exist = false)
+    private String drawingNumber;
+    @TableField(exist = false)
+    private String technologyVersion;
+    @TableField(exist = false)
     private String currentNickName;
     @TableField(exist = false)
     private String currentEquipmentCode;
@@ -206,6 +211,11 @@ public class BizDaywork extends BaseEntity
     private String creatorName;
     @TableField(exist = false)
     private String protemProcessStepNumber;
-
+    @TableField(exist = false)
+    private List<BizEquipmentDetail> equipmentDetails;
+    @TableField(exist = false)
+    private List<BizInspectionChamber> inspectionChambers;
+    @TableField(exist = false)
+    private Integer prodNum;
 
 }

+ 2 - 0
src/main/java/cn/ezhizao/project/business/product/domain/BizDayworkItem.java

@@ -281,5 +281,7 @@ public class BizDayworkItem extends BaseEntity
     private Integer isInnerTurnover;
     @TableField(exist = false)
     private String protemProcessStepNumber;
+    @TableField(exist = false)
+    private Boolean isNextPacking;
 
 }

+ 22 - 1
src/main/java/cn/ezhizao/project/business/product/domain/BizLot.java

@@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.util.List;
+
 /**
  * 企业租户对象 biz_lot
  *
@@ -130,6 +132,25 @@ public class BizLot extends BaseEntity
     @ApiModelProperty("外协单id")
     @TableField(exist = false)
     private Long outsourceOrderDetailId;
-
+    @TableField(exist = false)
+    private String deptName;
+    @TableField(exist = false)
+    private List<BizDayworkItem> dayworkItemList;
+    @TableField(exist = false)
+    private String equipmentDetailCode;
+    @TableField(exist = false)
+    private Long equipmentDetailId;
+    @TableField(exist = false)
+    private String nickName;
+    @TableField(exist = false)
+    private Long userId;
+    @TableField(exist = false)
+    private Long processId;
+    @TableField(exist = false)
+    private String processCode;
+    @TableField(exist = false)
+    private String inspectionCarrierCode;
+    @TableField(exist = false)
+    private Long inspectionCarrierId;
 
 }

+ 6 - 0
src/main/java/cn/ezhizao/project/business/product/domain/BizProcessInspecion.java

@@ -180,6 +180,7 @@ public class BizProcessInspecion extends BaseEntity
 
     @ApiModelProperty("外协序检工序")
     private String processNames;
+    private Long reviewerId;
 
     @ApiModelProperty("外协单id")
     private Long outsourceOrderDetailId;
@@ -198,6 +199,11 @@ public class BizProcessInspecion extends BaseEntity
     private Integer auditStatus;
     @ApiModelProperty("是否为外协序检")
     private Integer isOutsourcedInspection;
+    private String type;
+    private String equipmentDetailCode;
+    private Long equipmentDetailId;
+    @TableField(exist = false)
+    private String technicianName;
 
     public BizProcessInspecion() {
     }

+ 1 - 0
src/main/java/cn/ezhizao/project/business/product/domain/BizProcessInspectionDetail.java

@@ -124,5 +124,6 @@ public class BizProcessInspectionDetail extends BaseEntity
     private Integer status;
     @TableField(exist = false)
     private String inspectionName;
+    private Long inspectionStandardsId;
 
 }

+ 1 - 0
src/main/java/cn/ezhizao/project/business/product/mapper/BizDayworkMapper.java

@@ -21,6 +21,7 @@ public interface BizDayworkMapper extends BaseMapper<BizDaywork> {
      * @return 报工集合
      */
     public List<BizDaywork> getList(BizDaywork bizDaywork);
+    public BizDaywork getDayworkInfoById(BizDaywork bizDaywork);
 
     /**
      * 物理删除

+ 1 - 0
src/main/java/cn/ezhizao/project/business/product/service/IBizDayworkService.java

@@ -22,6 +22,7 @@ public interface IBizDayworkService extends IService<BizDaywork>
      * @return 报工集合
      */
     public List<BizDaywork> getList(BizDaywork bizDaywork);
+    public BizDaywork getDayworkInfoById(BizDaywork bizDaywork);
 
     /**
      * 物理删除

+ 5 - 0
src/main/java/cn/ezhizao/project/business/product/service/impl/BizDayworkServiceImpl.java

@@ -36,6 +36,11 @@ public class BizDayworkServiceImpl extends ServiceImpl<BizDayworkMapper, BizDayw
         return bizDayworkMapper.getList(bizDaywork);
     }
 
+    @Override
+    public BizDaywork getDayworkInfoById(BizDaywork bizDaywork) {
+        return bizDayworkMapper.getDayworkInfoById(bizDaywork);
+    }
+
     /**
      * 物理删除
      * @param bizDaywork

+ 106 - 0
src/main/java/cn/ezhizao/project/business/takeStockPeriod/controller/BizTakeStockPeriodController.java

@@ -0,0 +1,106 @@
+package cn.ezhizao.project.business.takeStockPeriod.controller;
+
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.ezhizao.common.utils.poi.ExcelUtil;
+import cn.ezhizao.framework.aspectj.lang.annotation.Log;
+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.takeStockPeriod.domain.BizTakeStockPeriod;
+import cn.ezhizao.project.business.takeStockPeriod.service.IBizTakeStockPeriodService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+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;
+
+
+/**
+ * 盘点时间Controller
+ *
+ * @author ezhizao
+ * @date 2024-08-15
+ */
+@RestController
+@RequestMapping("/business/takeStockPeriod")
+public class BizTakeStockPeriodController extends BaseController
+{
+    @Resource
+    private IBizTakeStockPeriodService bizTakeStockPeriodService;
+
+    /**
+     * 查询盘点时间列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:takeStockPeriod:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(BizTakeStockPeriod bizTakeStockPeriod) throws NoSuchFieldException, IllegalAccessException
+    {
+        startPage();
+        List<BizTakeStockPeriod> list = bizTakeStockPeriodService.getList(bizTakeStockPeriod);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出盘点时间列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:takeStockPeriod:export')")
+    @Log(title = "盘点时间", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BizTakeStockPeriod bizTakeStockPeriod) throws NoSuchFieldException, IllegalAccessException
+    {
+        List<BizTakeStockPeriod> list = bizTakeStockPeriodService.getList(bizTakeStockPeriod);
+        ExcelUtil<BizTakeStockPeriod> util = new ExcelUtil<BizTakeStockPeriod>(BizTakeStockPeriod.class);
+        util.exportExcel(response, list, "盘点时间数据");
+    }
+
+    /**
+     * 获取盘点时间详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:takeStockPeriod:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(bizTakeStockPeriodService.getById(id));
+    }
+
+    /**
+     * 新增盘点时间
+     */
+    @PreAuthorize("@ss.hasPermi('business:takeStockPeriod:add')")
+    @Log(title = "盘点时间", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BizTakeStockPeriod bizTakeStockPeriod) throws NoSuchFieldException, IllegalAccessException
+    {
+        return toAjax(bizTakeStockPeriodService.save(bizTakeStockPeriod));
+    }
+
+    /**
+     * 修改盘点时间
+     */
+    @PreAuthorize("@ss.hasPermi('business:takeStockPeriod:edit')")
+    @Log(title = "盘点时间", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BizTakeStockPeriod bizTakeStockPeriod) throws NoSuchFieldException, IllegalAccessException
+    {
+        return toAjax(bizTakeStockPeriodService.updateById(bizTakeStockPeriod));
+    }
+
+    /**
+     * 删除盘点时间
+     */
+    @PreAuthorize("@ss.hasPermi('business:takeStockPeriod:remove')")
+    @Log(title = "盘点时间", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable List<Long> ids)
+    {
+        return toAjax(bizTakeStockPeriodService.removeBatchByIds(ids));
+    }
+}

+ 46 - 0
src/main/java/cn/ezhizao/project/business/takeStockPeriod/domain/BizTakeStockPeriod.java

@@ -0,0 +1,46 @@
+package cn.ezhizao.project.business.takeStockPeriod.domain;
+
+import java.util.Date;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+
+
+/**
+ * 盘点时间对象 biz_take_stock_period
+ *
+ * @author ezhizao
+ * @date 2024-08-15
+ */
+@Data
+@TableName(value = "biz_take_stock_period")
+public class BizTakeStockPeriod extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 盘点状态(1:开始盘点,2:结束盘点) */
+    @Excel(name = "盘点状态", readConverterExp = "1=:开始盘点,2:结束盘点")
+    @ApiModelProperty(value = "盘点状态")
+    private Integer status;
+
+    /** 盘点开始时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "盘点开始时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "盘点开始时间")
+    private Date startTime;
+
+    /** 盘点结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "盘点结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "盘点结束时间")
+    private Date endTime;
+    @TableField(exist = false)
+    private Long tenantId;
+
+}

+ 31 - 0
src/main/java/cn/ezhizao/project/business/takeStockPeriod/mapper/BizTakeStockPeriodMapper.java

@@ -0,0 +1,31 @@
+package cn.ezhizao.project.business.takeStockPeriod.mapper;
+
+import java.util.List;
+
+import cn.ezhizao.project.business.takeStockPeriod.domain.BizTakeStockPeriod;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+
+/**
+ * 盘点时间Mapper接口
+ *
+ * @author ezhizao
+ * @date 2024-08-15
+ */
+public interface BizTakeStockPeriodMapper extends BaseMapper<BizTakeStockPeriod>
+{
+    /**
+     * 查询盘点时间列表
+     *
+     * @param bizTakeStockPeriod 盘点时间
+     * @return 盘点时间集合
+     */
+    public List<BizTakeStockPeriod> getList(BizTakeStockPeriod bizTakeStockPeriod);
+
+    /**
+     * 物理删除
+     * @param bizTakeStockPeriod
+     * @return 删除结果
+    */
+    public int physicalDelete(BizTakeStockPeriod bizTakeStockPeriod);
+}

+ 32 - 0
src/main/java/cn/ezhizao/project/business/takeStockPeriod/service/IBizTakeStockPeriodService.java

@@ -0,0 +1,32 @@
+package cn.ezhizao.project.business.takeStockPeriod.service;
+
+import java.util.List;
+
+import cn.ezhizao.project.business.takeStockPeriod.domain.BizTakeStockPeriod;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+
+/**
+ * 盘点时间Service接口
+ *
+ * @author ezhizao
+ * @date 2024-08-15
+ */
+public interface IBizTakeStockPeriodService extends IService<BizTakeStockPeriod>
+{
+    /**
+     * 查询盘点时间列表
+     *
+     * @param bizTakeStockPeriod 盘点时间
+     * @return 盘点时间集合
+     */
+    public List<BizTakeStockPeriod> getList(BizTakeStockPeriod bizTakeStockPeriod);
+
+    /**
+     * 物理删除
+     * @param bizTakeStockPeriod
+     * @return 删除结果
+     */
+    public int physicalDelete(BizTakeStockPeriod bizTakeStockPeriod);
+
+}

+ 45 - 0
src/main/java/cn/ezhizao/project/business/takeStockPeriod/service/impl/BizTakeStockPeriodServiceImpl.java

@@ -0,0 +1,45 @@
+package cn.ezhizao.project.business.takeStockPeriod.service.impl;
+
+import java.util.List;
+import javax.annotation.Resource;
+
+import cn.ezhizao.project.business.takeStockPeriod.domain.BizTakeStockPeriod;
+import cn.ezhizao.project.business.takeStockPeriod.mapper.BizTakeStockPeriodMapper;
+import cn.ezhizao.project.business.takeStockPeriod.service.IBizTakeStockPeriodService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * 盘点时间Service业务层处理
+ *
+ * @author ezhizao
+ * @date 2024-08-15
+ */
+@Service
+public class BizTakeStockPeriodServiceImpl  extends ServiceImpl<BizTakeStockPeriodMapper, BizTakeStockPeriod> implements IBizTakeStockPeriodService
+{
+    @Resource
+    private BizTakeStockPeriodMapper bizTakeStockPeriodMapper;
+
+    /**
+     * 查询盘点时间列表
+     *
+     * @param bizTakeStockPeriod 盘点时间
+     * @return 盘点时间
+     */
+    @Override
+    public List<BizTakeStockPeriod> getList(BizTakeStockPeriod bizTakeStockPeriod)
+    {
+        return bizTakeStockPeriodMapper.getList(bizTakeStockPeriod);
+    }
+
+    /**
+     * 物理删除
+     * @param bizTakeStockPeriod
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizTakeStockPeriod bizTakeStockPeriod){ return bizTakeStockPeriodMapper.physicalDelete(bizTakeStockPeriod); };
+
+}

+ 159 - 0
src/main/java/cn/ezhizao/project/business/taksStockLot/controller/BizTaksStockLotController.java

@@ -0,0 +1,159 @@
+package cn.ezhizao.project.business.taksStockLot.controller;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.ezhizao.common.utils.poi.ExcelUtil;
+import cn.ezhizao.framework.aspectj.lang.annotation.Log;
+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.product.domain.BizCarrier;
+import cn.ezhizao.project.business.product.domain.BizDayworkCarrier;
+import cn.ezhizao.project.business.product.service.IBizCarrierService;
+import cn.ezhizao.project.business.product.service.IBizDayworkCarrierService;
+import cn.ezhizao.project.business.takeStockPeriod.domain.BizTakeStockPeriod;
+import cn.ezhizao.project.business.takeStockPeriod.service.IBizTakeStockPeriodService;
+import cn.ezhizao.project.business.taksStockLot.domain.BizTaksStockLot;
+import cn.ezhizao.project.business.taksStockLot.service.IBizTaksStockLotService;
+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;
+import org.springframework.web.bind.annotation.DeleteMapping;
+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;
+
+
+/**
+ * 盘点批次信息Controller
+ *
+ * @author ezhizao
+ * @date 2024-08-15
+ */
+@RestController
+@RequestMapping("/business/taksStockLot")
+public class BizTaksStockLotController extends BaseController
+{
+    @Resource
+    private IBizTaksStockLotService bizTaksStockLotService;
+    @Resource
+    private IBizTakeStockPeriodService bizTakeStockPeriodService;
+    @Resource
+    private IBizCarrierService bizCarrierService;
+    @Resource
+    private IBizDayworkCarrierService bizDayworkCarrierService;
+
+    /**
+     * 查询盘点批次信息列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(BizTaksStockLot bizTaksStockLot) throws NoSuchFieldException, IllegalAccessException
+    {
+        BizTakeStockPeriod takeStockPeriod = bizTakeStockPeriodService.query().eq("status", 1).one();
+        if(takeStockPeriod == null) {
+            return getDataTable(new ArrayList<>());
+        }
+        bizTaksStockLot.setTakeStockPeriodId(takeStockPeriod.getId());
+        List<BizTaksStockLot> list = bizTaksStockLotService.getList(bizTaksStockLot);
+        return getDataTable(list);
+    }
+    @PostMapping("/getTakesStockByCarrierCode")
+    @Transactional
+    public AjaxResult getTakesStockByCarrierCode(@RequestBody BizTaksStockLot bizTaksStockLot)
+    {
+        BizCarrier bizCarrier = bizCarrierService.query().eq("code", bizTaksStockLot.getCarrierCode()).one();
+        if (bizCarrier == null) {
+            return error("该箱号不存在");
+        }
+        List<BizDayworkCarrier> bizDayworkCarriers = bizDayworkCarrierService.query().eq("process_inspection_id", 0L).eq("carrier_id", bizCarrier.getId()).eq("is_changed", 0).list();
+        if (bizDayworkCarriers.isEmpty()) {
+            return error("该载具未绑定任何批次!");
+        }
+        //查询
+        List<Long> dayworkIds = bizDayworkCarriers.stream().map(BizDayworkCarrier::getDayworkId).collect(Collectors.toList());
+        BizTakeStockPeriod takeStockPeriod = bizTakeStockPeriodService.query().eq("status", 1).one();
+        List<BizTaksStockLot> taksStockLotsList = bizTaksStockLotService.query().eq("take_stock_period_id", takeStockPeriod.getId()).list();
+        List<Long> taksStockDayworkIds = taksStockLotsList.stream().map(BizTaksStockLot::getDayworkId).collect(Collectors.toList());
+        List<Long> needQueryDayworkIds = new ArrayList<>();
+        dayworkIds.forEach(item ->{
+            if(taksStockDayworkIds.contains(item)) {
+                needQueryDayworkIds.add(item);
+            }
+        });
+        if(needQueryDayworkIds.isEmpty()) {
+            return error("该载具绑定的批次未在此次盘点内!");
+        }
+        List<BizTaksStockLot> list = taksStockLotsList.stream()
+                .filter(item -> needQueryDayworkIds.contains(item.getDayworkId()))
+                .collect(Collectors.toList());
+        return success(list);
+    }
+
+    /**
+     * 导出盘点批次信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:taksStockLot:export')")
+    @Log(title = "盘点批次信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BizTaksStockLot bizTaksStockLot) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizTaksStockLot);
+        List<BizTaksStockLot> list = bizTaksStockLotService.getList(bizTaksStockLot);
+        ExcelUtil<BizTaksStockLot> util = new ExcelUtil<BizTaksStockLot>(BizTaksStockLot.class);
+        util.exportExcel(response, list, "盘点批次信息数据");
+    }
+
+    /**
+     * 获取盘点批次信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:taksStockLot:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(bizTaksStockLotService.getById(id));
+    }
+
+    /**
+     * 新增盘点批次信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:taksStockLot:add')")
+    @Log(title = "盘点批次信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BizTaksStockLot bizTaksStockLot) throws NoSuchFieldException, IllegalAccessException
+    {
+        setTenantId(bizTaksStockLot);
+        return toAjax(bizTaksStockLotService.save(bizTaksStockLot));
+    }
+
+    /**
+     * 修改盘点批次信息
+     */
+    @Log(title = "盘点批次信息", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody List<BizTaksStockLot> bizTaksStockLot) throws NoSuchFieldException, IllegalAccessException
+    {
+        bizTaksStockLot.forEach(item -> {
+            item.setIsTaksStock(1);
+        });
+        return toAjax(bizTaksStockLotService.updateBatchById(bizTaksStockLot));
+    }
+
+    /**
+     * 删除盘点批次信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:taksStockLot:remove')")
+    @Log(title = "盘点批次信息", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable List<Long> ids)
+    {
+        return toAjax(bizTaksStockLotService.removeBatchByIds(ids));
+    }
+}

+ 120 - 0
src/main/java/cn/ezhizao/project/business/taksStockLot/domain/BizTaksStockLot.java

@@ -0,0 +1,120 @@
+package cn.ezhizao.project.business.taksStockLot.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_taks_stock_lot
+ *
+ * @author ezhizao
+ * @date 2024-08-15
+ */
+@Data
+@TableName(value = "biz_taks_stock_lot")
+public class BizTaksStockLot extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 租户(厂别)id */
+    @ApiModelProperty(value = "${comment}")
+    private Long tenantId;
+
+    /** 计划单id */
+    @ApiModelProperty(value = "${comment}")
+    private Long productionPlanId;
+
+    /** 计划单明细id */
+    @ApiModelProperty(value = "${comment}")
+    private Long productionPlanDetailId;
+
+    /** 产品描述 */
+    @Excel(name = "产品描述")
+    @ApiModelProperty(value = "产品描述")
+    private String productDescription;
+
+    /** 子计划id */
+    @ApiModelProperty(value = "产品描述")
+    private Long productionPlanDetailSubDetailId;
+
+    /** daywork_id */
+    @ApiModelProperty(value = "产品描述")
+    private Long dayworkId;
+
+    /** 批次id */
+    @ApiModelProperty(value = "产品描述")
+    private Long lotId;
+
+    /** 批次号 */
+    @Excel(name = "批次号")
+    @ApiModelProperty(value = "批次号")
+    private String lotCode;
+
+    /** 工段id(当前工段的id) */
+    @ApiModelProperty(value = "批次号")
+    private Long deptId;
+
+    /** 产品id */
+    @ApiModelProperty(value = "批次号")
+    private Long productId;
+
+    /** 是否盘点(0:未盘点,1:已盘点) */
+    @Excel(name = "是否盘点(0:未盘点,1:已盘点)")
+    @ApiModelProperty(value = "是否盘点(0:未盘点,1:已盘点)")
+    private Integer isTaksStock;
+
+    /** 盘点数量 */
+    @Excel(name = "盘点数量")
+    @ApiModelProperty(value = "盘点数量")
+    private Long taksStockNum;
+
+    /** 工艺id(通过工艺id,获取版本号) */
+    @ApiModelProperty(value = "盘点数量")
+    private Long technologicalProcessId;
+
+    /** 投产数 */
+    @Excel(name = "投产数")
+    @ApiModelProperty(value = "投产数")
+    private Long prodNum;
+
+    /** 是否尾批(0:默认,1: 是尾批) */
+    @Excel(name = "是否尾批", readConverterExp = "0=:默认,1:,是=尾批")
+    @ApiModelProperty(value = "是否尾批")
+    private Integer isLast;
+
+    /** 是否是废品回用(0:否;1:是) */
+    @Excel(name = "是否是废品回用(0:否;1:是)")
+    @ApiModelProperty(value = "是否是废品回用(0:否;1:是)")
+    private Integer isWasteRecycling;
+
+    /** 是否修改(0 否 ,1 是)单批单改;多批单改;回退 */
+    @Excel(name = "是否修改(0 否 ,1 是)单批单改;多批单改;回退")
+    @ApiModelProperty(value = "是否修改(0 否 ,1 是)单批单改;多批单改;回退")
+    private Integer isAmend;
+
+    /** 工序合格数 */
+    @Excel(name = "工序合格数")
+    @ApiModelProperty(value = "工序合格数")
+    private Long temporaryProcessQualifiedNum;
+
+    /** 批次生产状态(0:未开始,1:进行中,2:已完成) */
+    @Excel(name = "批次生产状态", readConverterExp = "0=:未开始,1:进行中,2:已完成")
+    @ApiModelProperty(value = "批次生产状态")
+    private Integer status;
+
+    /** 是否经过特殊报工(0:否,1:是) */
+    @Excel(name = "是否经过特殊报工", readConverterExp = "0=:否,1:是")
+    @ApiModelProperty(value = "是否经过特殊报工")
+    private Integer hasSpecial;
+    private Long takeStockPeriodId;
+    @TableField(exist = false)
+    private String keywords;
+    @TableField(exist = false)
+    private String carrierNames;
+    @TableField(exist = false)
+    private String carrierCode;
+
+}

+ 31 - 0
src/main/java/cn/ezhizao/project/business/taksStockLot/mapper/BizTaksStockLotMapper.java

@@ -0,0 +1,31 @@
+package cn.ezhizao.project.business.taksStockLot.mapper;
+
+import java.util.List;
+
+import cn.ezhizao.project.business.taksStockLot.domain.BizTaksStockLot;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+
+/**
+ * 盘点批次信息Mapper接口
+ *
+ * @author ezhizao
+ * @date 2024-08-15
+ */
+public interface BizTaksStockLotMapper extends BaseMapper<BizTaksStockLot>
+{
+    /**
+     * 查询盘点批次信息列表
+     *
+     * @param bizTaksStockLot 盘点批次信息
+     * @return 盘点批次信息集合
+     */
+    public List<BizTaksStockLot> getList(BizTaksStockLot bizTaksStockLot);
+
+    /**
+     * 物理删除
+     * @param bizTaksStockLot
+     * @return 删除结果
+    */
+    public int physicalDelete(BizTaksStockLot bizTaksStockLot);
+}

+ 32 - 0
src/main/java/cn/ezhizao/project/business/taksStockLot/service/IBizTaksStockLotService.java

@@ -0,0 +1,32 @@
+package cn.ezhizao.project.business.taksStockLot.service;
+
+import java.util.List;
+
+import cn.ezhizao.project.business.taksStockLot.domain.BizTaksStockLot;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+
+/**
+ * 盘点批次信息Service接口
+ *
+ * @author ezhizao
+ * @date 2024-08-15
+ */
+public interface IBizTaksStockLotService extends IService<BizTaksStockLot>
+{
+    /**
+     * 查询盘点批次信息列表
+     *
+     * @param bizTaksStockLot 盘点批次信息
+     * @return 盘点批次信息集合
+     */
+    public List<BizTaksStockLot> getList(BizTaksStockLot bizTaksStockLot);
+
+    /**
+     * 物理删除
+     * @param bizTaksStockLot
+     * @return 删除结果
+     */
+    public int physicalDelete(BizTaksStockLot bizTaksStockLot);
+
+}

+ 45 - 0
src/main/java/cn/ezhizao/project/business/taksStockLot/service/impl/BizTaksStockLotServiceImpl.java

@@ -0,0 +1,45 @@
+package cn.ezhizao.project.business.taksStockLot.service.impl;
+
+import java.util.List;
+import javax.annotation.Resource;
+
+import cn.ezhizao.project.business.taksStockLot.domain.BizTaksStockLot;
+import cn.ezhizao.project.business.taksStockLot.mapper.BizTaksStockLotMapper;
+import cn.ezhizao.project.business.taksStockLot.service.IBizTaksStockLotService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * 盘点批次信息Service业务层处理
+ *
+ * @author ezhizao
+ * @date 2024-08-15
+ */
+@Service
+public class BizTaksStockLotServiceImpl  extends ServiceImpl<BizTaksStockLotMapper, BizTaksStockLot> implements IBizTaksStockLotService
+{
+    @Resource
+    private BizTaksStockLotMapper bizTaksStockLotMapper;
+
+    /**
+     * 查询盘点批次信息列表
+     *
+     * @param bizTaksStockLot 盘点批次信息
+     * @return 盘点批次信息
+     */
+    @Override
+    public List<BizTaksStockLot> getList(BizTaksStockLot bizTaksStockLot)
+    {
+        return bizTaksStockLotMapper.getList(bizTaksStockLot);
+    }
+
+    /**
+     * 物理删除
+     * @param bizTaksStockLot
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizTaksStockLot bizTaksStockLot){ return bizTaksStockLotMapper.physicalDelete(bizTaksStockLot); };
+
+}

+ 12 - 1
src/main/resources/mybatis/business/product/BizDayworkMapper.xml

@@ -44,15 +44,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap id="BizFurnaceNoInfoResult" type="cn.ezhizao.project.business.product.domain.BizFurnaceNoInfo">
         <id column="id" property="id"/>
     </resultMap>
+    <resultMap id="BizDayworkInfoResult" type="cn.ezhizao.project.business.product.domain.BizDaywork">
+        <id column="id" property="id"/>
+        <result column="dept_id" property="deptId"/>
+    </resultMap>
     <select id="getFurnaceNoInfo" resultMap="BizFurnaceNoInfoResult">
         select * from biz_furnace_no_info where deleted = 0 and daywork_id = #{id}
     </select>
     <select id="getDeptProcess" resultType="cn.ezhizao.project.business.deptProcess.domain.BizDeptProcess">
         select * from biz_dept_process where deleted = 0 and process_id = #{id}
     </select>
+    <select id="getProcessStepNumber" resultType="String">
+        select process_step_number from biz_daywork_item where deleted = 0 and daywork_id = #{id} order by create_time desc limit 1
+    </select>
     <select id="getDeptName" resultType="java.lang.String" >
         select dept_name from sys_dept where del_flag = 0 and dept_id = #{deptId}
     </select>
+    <select id="getDayworkInfoById" resultMap="BizDayworkInfoResult">
+        select t1.*,t2.dept_name from biz_daywork t1 left join sys_dept t2 on t1.dept_id = t2.dept_id where deleted = 0 and t1.id = #{id}
+    </select>
+
 
     <select id="getItemList" resultMap="BizDayworkItemResult">
         select * from biz_daywork_item where deleted = 0 and daywork_id = #{id} ORDER BY create_time DESC
@@ -118,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     </delete>
     <select id="getLotInfo" resultMap="BizLotInfo">
-        select t1.*,t2.product_description,t3.production_quantity from biz_daywork t1 left join biz_production_plan_detail t2 on t1.production_plan_detail_id = t2.id left join biz_lot t3 on t1.lot_id = t3.id
+        select t1.*,t2.product_description,t2.drawing_number,t3.production_quantity,t3.technology_version from biz_daywork t1 left join biz_production_plan_detail t2 on t1.production_plan_detail_id = t2.id left join biz_lot t3 on t1.lot_id = t3.id
         where t1.deleted = 0 and t2.deleted = 0 and t3.deleted = 0 and t1.id =#{id}
     </select>
 <!--    周转区查看-->

+ 31 - 0
src/main/resources/mybatis/business/takeStockPeriod/BizTakeStockPeriodMapper.xml

@@ -0,0 +1,31 @@
+<?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.takeStockPeriod.mapper.BizTakeStockPeriodMapper">
+
+    <resultMap type="cn.ezhizao.project.business.takeStockPeriod.domain.BizTakeStockPeriod" id="BizTakeStockPeriodResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizTakeStockPeriod" resultMap="BizTakeStockPeriodResult">
+        SELECT * FROM biz_take_stock_period
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="status != null "> AND status = #{status}</if>
+            <if test="startTime != null "> AND start_time = #{startTime}</if>
+            <if test="endTime != null "> AND end_time = #{endTime}</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_take_stock_period
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>

+ 39 - 0
src/main/resources/mybatis/business/taksStockLot/BizTaksStockLotMapper.xml

@@ -0,0 +1,39 @@
+<?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.taksStockLot.mapper.BizTaksStockLotMapper">
+
+    <resultMap type="cn.ezhizao.project.business.taksStockLot.domain.BizTaksStockLot" id="BizTaksStockLotResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizTaksStockLot" resultMap="BizTaksStockLotResult">
+        SELECT distinct t1.*, (
+        SELECT
+        GROUP_CONCAT(t2.carrier_code ORDER BY t2.carrier_code SEPARATOR ',')
+        FROM biz_daywork_carrier t2
+        WHERE t2.daywork_id = t1.daywork_id
+        AND t2.is_changed=0
+        AND t2.deleted = 0
+        ) AS carrierNames from biz_taks_stock_lot t1
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            t1.deleted = 0 and t1.dept_id = #{deptId} and t1.take_stock_period_id = #{takeStockPeriodId} and t1.daywork_id != 0
+            <if test="keywords != null  and keywords != ''"> AND (t1.lot_code LIKE CONCAT('%',#{keywords},'%') OR
+                t1.daywork_id in (select daywork_id from
+                biz_daywork_carrier where deleted = 0 AND is_changed=0 and carrier_code LIKE CONCAT('%',
+                #{originalCarrier}, '%'))</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_taks_stock_lot
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>