ezhizao_zx 11 місяців тому
батько
коміт
6b0648b678

+ 1 - 1
.drone.yml

@@ -18,7 +18,7 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行
       - cp run.sh /home/build/ezhizao_dms_production/run.sh
 
   - name: build-start
-    image: appleboy/drone-ssh # SSH工具镜像
+    image: appleboy/drone-ssh:1.0.0 # SSH工具镜像
     settings:
       host: 120.46.159.163 # 远程连接地址
       username:

+ 1 - 0
src/main/java/cn/ezhizao/project/business/controller/BizOutsourcedOrderController.java

@@ -1230,6 +1230,7 @@ public class BizOutsourcedOrderController extends BaseController {
         SysDept dept = deptService.getDeptList(condition).stream().findFirst().orElse(null);
         bizProductionPlanDetail.setDeptId(dept != null ? dept.getValue() : null);
         startPage();
+        bizProductionPlanDetail.setRemainLot(true);
         List<BizProductionPlanDetail> list = bizProductionPlanDetailService.getListForOutsource(bizProductionPlanDetail);
         return getDataTable(list);
     }

+ 192 - 76
src/main/java/cn/ezhizao/project/business/domain/BizProductionPlanDetail.java

@@ -20,71 +20,98 @@ import io.swagger.annotations.ApiModelProperty;
  */
 @Data
 @TableName(value = "biz_production_plan_detail")
-public class BizProductionPlanDetail extends BaseEntity
-{
+public class BizProductionPlanDetail extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 租户(厂别)id */
+    /**
+     * 租户(厂别)id
+     */
     @ApiModelProperty(value = "${comment}")
     private Long tenantId;
 
-    /** 交易代码 */
+    /**
+     * 交易代码
+     */
     @ApiModelProperty(value = "交易代码")
     private String transactionCode;
 
-    /** 计划单id */
+    /**
+     * 计划单id
+     */
     @ApiModelProperty(value = "计划单id")
     private Long productionPlanId;
 
-    /** 投料/计划单号 */
-    @Excel(name = "生产计划单号",sort = 1)
+    /**
+     * 投料/计划单号
+     */
+    @Excel(name = "生产计划单号", sort = 1)
     @ApiModelProperty(value = "投料/计划单号")
     private String productionPlanNo;
 
-    /** 序号 */
-    @Excel(name = "序号",sort = 2)
+    /**
+     * 序号
+     */
+    @Excel(name = "序号", sort = 2)
     @ApiModelProperty(value = "序号")
     private Integer lineNumber;
 
-    /** 领料部门id */
+    /**
+     * 领料部门id
+     */
     @ApiModelProperty(value = "领料部门id")
     private Long requisitionDepartmentId;
 
-    /** 领料部门编码 */
+    /**
+     * 领料部门编码
+     */
 
     @ApiModelProperty(value = "领料部门编码")
     private String requisitionDepartmentCode;
 
-    /** 客户id */
+    /**
+     * 客户id
+     */
     @ApiModelProperty(value = "领料部门编码")
     private Long companyId;
 
-    /** 客户编码 */
+    /**
+     * 客户编码
+     */
 
     @ApiModelProperty(value = "客户编码")
     private String companyCode;
 
-    /** 客户简称 */
+    /**
+     * 客户简称
+     */
 
     @ApiModelProperty(value = "客户简称")
-    @Excel(name = "客户简称",sort = 0)
+    @Excel(name = "客户简称", sort = 0)
     private String companyAlias;
 
-    /** 产品id */
+    /**
+     * 产品id
+     */
     @ApiModelProperty(value = "客户编码")
     private Long productId;
 
-    /** 产品编码 */
+    /**
+     * 产品编码
+     */
 
     @ApiModelProperty(value = "产品编码")
     private String productCode;
 
-    /** 产品规格 */
+    /**
+     * 产品规格
+     */
 
     @ApiModelProperty(value = "产品规格")
     private String specification;
 
-    /** 产品图号 */
+    /**
+     * 产品图号
+     */
 
     @ApiModelProperty(value = "产品图号")
     private String drawingNumber;
@@ -102,176 +129,249 @@ public class BizProductionPlanDetail extends BaseEntity
     /**
      * 工艺版本
      */
-    @Excel(name = "图纸版本",sort = 5)
+    @Excel(name = "图纸版本", sort = 5)
     @ApiModelProperty(value = "${comment}")
     private String technologyVersion;
 
 
-
-    /** 库位 */
+    /**
+     * 库位
+     */
 
     @ApiModelProperty(value = "库位")
     private String storageLocation;
 
-    /** 生产数量 */
+    /**
+     * 生产数量
+     */
 
     @ApiModelProperty(value = "生产数量")
     private BigDecimal productionQuantity;
 
-    /** 限额领料量/投料数量 */
+    /**
+     * 限额领料量/投料数量
+     */
 
     @ApiModelProperty(value = "限额领料量/投料数量")
     private BigDecimal materialPickUpQuantity;
 
-    /** 状态id(对应数据字典id) */
+    /**
+     * 状态id(对应数据字典id)
+     */
     @ApiModelProperty(value = "限额领料量/投料数量")
     private Long statusId;
 
-    /** NA:经营初始,FM:经营申请,JH:计划审核,OP:调度下单,YA:领料锁定,CL:全部领完,IN:部分领料 */
+    /**
+     * NA:经营初始,FM:经营申请,JH:计划审核,OP:调度下单,YA:领料锁定,CL:全部领完,IN:部分领料
+     */
 
     @ApiModelProperty(value = "NA:经营初始,FM:经营申请,JH:计划审核,OP:调度下单,YA:领料锁定,CL:全部领完,IN:部分领料")
     private String statusCode;
 
-    /** 批号状态id(对应数据字典id) */
+    /**
+     * 批号状态id(对应数据字典id)
+     */
     @ApiModelProperty(value = "NA:经营初始,FM:经营申请,JH:计划审核,OP:调度下单,YA:领料锁定,CL:全部领完,IN:部分领料")
     private Long lotCodeStatusId;
 
-    /** 批号状态:NA:未生成批号,OK:已生成批号,CL:批号已完工 */
+    /**
+     * 批号状态:NA:未生成批号,OK:已生成批号,CL:批号已完工
+     */
 
     @ApiModelProperty(value = "批号状态:NA:未生成批号,OK:已生成批号,CL:批号已完工")
     private String lotCodeStatusCode;
 
-    /** 批次类型id(对应数据字典id) */
+    /**
+     * 批次类型id(对应数据字典id)
+     */
     @ApiModelProperty(value = "批号状态:NA:未生成批号,OK:已生成批号,CL:批号已完工")
     private Long lotTypeId;
 
-    /** 批次类型:Y:正常,新增批次;G:改料,不增批次;B:补料 */
+    /**
+     * 批次类型:Y:正常,新增批次;G:改料,不增批次;B:补料
+     */
 
     @ApiModelProperty(value = "批次类型:Y:正常,新增批次;G:改料,不增批次;B:补料")
     private String lotTypeCode;
 
-    /** 生产类型id */
+    /**
+     * 生产类型id
+     */
     @ApiModelProperty(value = "批次类型:Y:正常,新增批次;G:改料,不增批次;B:补料")
     private Long productionTypeId;
 
-    /** 生产类型(Y:量产、X:样品、试制S) */
+    /**
+     * 生产类型(Y:量产、X:样品、试制S)
+     */
 
     @ApiModelProperty(value = "生产类型")
     private String productionTypeCode;
 
-    /** 领料人id(对应的是sys_user的id) */
+    /**
+     * 领料人id(对应的是sys_user的id)
+     */
     @ApiModelProperty(value = "生产类型")
     private Long materialPickUpPersonId;
 
-    /** 领料人编码 */
+    /**
+     * 领料人编码
+     */
     @ApiModelProperty(value = "领料人编码")
     private String materialPickUpPersonCode;
 
-    /** BOM用量 */
+    /**
+     * BOM用量
+     */
 
     @ApiModelProperty(value = "BOM用量")
     private BigDecimal bomQuantity;
 
-    /** 调度员id(对应员工id) */
+    /**
+     * 调度员id(对应员工id)
+     */
     @ApiModelProperty(value = "BOM用量")
     private Long dispatcherId;
 
-    /** 调度员编号(对应员工编码) */
+    /**
+     * 调度员编号(对应员工编码)
+     */
 
     @ApiModelProperty(value = "调度员编号")
     private String dispatcherCode;
 
-    /** 炉号 */
+    /**
+     * 炉号
+     */
 
     @ApiModelProperty(value = "炉号")
     private String furnaceNumber;
 
-    /** 销售员id */
+    /**
+     * 销售员id
+     */
     @ApiModelProperty(value = "炉号")
     private Long salesmanId;
 
-    /** 销售员编码 */
+    /**
+     * 销售员编码
+     */
 
     @ApiModelProperty(value = "销售员编码")
     private String salesmanCode;
 
-    /** 产品描述 */
-    @Excel(name = "产品描述",sort = 4)
+    /**
+     * 产品描述
+     */
+    @Excel(name = "产品描述", sort = 4)
     @ApiModelProperty(value = "产品描述")
     private String productDescription;
 
-    /** 轴类型id */
+    /**
+     * 轴类型id
+     */
     @ApiModelProperty(value = "轴类型id")
     private Long shaftCategoryId;
 
-    /** 轴类型=基本上=SCLASS */
+    /**
+     * 轴类型=基本上=SCLASS
+     */
 
     @ApiModelProperty(value = "轴类型=基本上=SCLASS")
     private String shaftCategoryCode;
 
-    /** 轴类型(名称) */
+    /**
+     * 轴类型(名称)
+     */
 
     @ApiModelProperty(value = "轴类型")
     private String shaftCategoryName;
 
-    /** 预完工日 */
+    /**
+     * 预完工日
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
 
     @ApiModelProperty(value = "预完工日")
     private Date expectedCompletionDate;
 
-    /** 保管员id(对应sys_user的id) */
+    /**
+     * 保管员id(对应sys_user的id)
+     */
     @ApiModelProperty(value = "预完工日")
     private Long stockKeeperId;
 
-    /** 保管员编码 */
+    /**
+     * 保管员编码
+     */
 
     @ApiModelProperty(value = "保管员编码")
     private String stockKeeperCode;
 
-    /** 投料日期 */
+    /**
+     * 投料日期
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty(value = "投料日期")
     private Date feedDate;
 
-    /** 领料日期 */
+    /**
+     * 领料日期
+     */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty(value = "领料日期")
     private Date materialPickUpDate;
 
-    /** 总批数 */
+    /**
+     * 总批数
+     */
     @ApiModelProperty(value = "总批数")
     private Integer totalLotNumber;
 
-    /** 单批量 */
+    /**
+     * 单批量
+     */
     @ApiModelProperty(value = "单批量")
     private Integer oneLotQuantity;
 
-    /** 尾批量 */
+    /**
+     * 尾批量
+     */
     @ApiModelProperty(value = "尾批量")
     private Integer lastLotQuantity;
 
-    /** 主批号/投料单号/计划单号 */
+    /**
+     * 主批号/投料单号/计划单号
+     */
     @ApiModelProperty(value = "主批号/投料单号/计划单号")
     private String lotCode;
 
-    /** 订单编码 */
+    /**
+     * 订单编码
+     */
     @ApiModelProperty(value = "订单编码")
     private String saleOrderCode;
 
-    /** 是否外购生产 */
+    /**
+     * 是否外购生产
+     */
     @ApiModelProperty(value = "是否外购生产")
     private String isPurchasedProduction;
 
-    /** 尾批批号流水号 */
+    /**
+     * 尾批批号流水号
+     */
     @ApiModelProperty(value = "尾批批号流水号")
     private String lastLotSerialNumber;
 
-    /** 领料否? */
+    /**
+     * 领料否?
+     */
     @ApiModelProperty(value = "领料否?")
     private String isPeekedUp;
 
-    /** 有批号否? */
+    /**
+     * 有批号否?
+     */
     @ApiModelProperty(value = "有批号否?")
     private String hadLotCode;
     /**
@@ -288,40 +388,58 @@ public class BizProductionPlanDetail extends BaseEntity
     @TableField(exist = false)
     private String keywords;
 
-    /** 累计投产量 */
+    /**
+     * 累计投产量
+     */
     @TableField(exist = false)
     private Double pickUpQuantity;
 
-    /** 累计投产批数 */
+    /**
+     * 累计投产批数
+     */
     @TableField(exist = false)
     private Double lotTotalNumber;
 
-    /** 工段id */
+    /**
+     * 工段id
+     */
     @TableField(exist = false)
     private Long deptId;
-    /** 已完成批数 */
-    @Excel(name = "已完成批数",sort = 7)
+    /**
+     * 已完成批数
+     */
+    @Excel(name = "已完成批数", sort = 7)
     @TableField(exist = false)
     private Integer afterProduction;
-    @Excel(name = "未投产批数",sort = 8)
+    @Excel(name = "未投产批数", sort = 8)
     @TableField(exist = false)
     private Integer notProduction;
-    /** 在产批数 */
-    @Excel(name = "在产批数",sort = 6)
+    /**
+     * 在产批数
+     */
+    @Excel(name = "在产批数", sort = 6)
     @TableField(exist = false)
     private Integer inProduction;
-    /** dayWorkList */
+    /**
+     * dayWorkList
+     */
     @TableField(exist = false)
     private List<BizDaywork> dayWorkList;
 
-    /** 当前部门 */
+    /**
+     * 当前部门
+     */
     @TableField(exist = false)
-    @Excel(name = "工段",sort = 9)
+    @Excel(name = "工段", sort = 9)
     private String currentDepartment;
-    /** 待投产批数 */
+    /**
+     * 待投产批数
+     */
     @TableField(exist = false)
     private Integer dayWorkLot;
-    /** 投产部门名称 */
+    /**
+     * 投产部门名称
+     */
     @TableField(exist = false)
     private String requisitionDepartmentName;
     @JsonFormat(pattern = "yyyy-MM-dd")
@@ -348,8 +466,6 @@ public class BizProductionPlanDetail extends BaseEntity
     @TableField(exist = false)
     @ApiModelProperty("外协投产剩余批次数量")
     private Integer firstRemain;
-
-
-
-
+    @TableField(exist = false)
+    private Boolean remainLot;
 }

+ 4 - 0
src/main/resources/mybatis/business/BizProductionPlanDetailMapper.xml

@@ -253,6 +253,10 @@
                 AND exists (select 1 from biz_supplier_product sp where sp.deleted = 0 and sp.supplier_id =
                 #{supplierId} and sp.product_id = t.product_id)
             </if>
+            <if test="remainLot == true">
+                AND (ifnull((SELECT sum(lot_number) as lotTotalNumber from biz_production_plan_detail_sub_detail where
+                production_plan_detail_id = t.id and deleted = 0), 0) - ifnull((select count(1) from biz_outsourced_order_detail where deleted = 0 and production_plan_detail_id = t.id), 0)) > 0
+            </if>
         </trim>
     </select>
 </mapper>