whyclxw
2024-07-24 5c33c1b05565112c72146c60961dd8cbc19af570
不良品推送修改
5个文件已修改
22 ■■■■■ 已修改文件
src/main/java/com/whyc/pojo/DefectiveProducts.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/DefectiveProductsHistory.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/DefectiveProductsHistoryService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/DefectiveProductsService.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/DefectiveProductsMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/DefectiveProducts.java
@@ -78,6 +78,9 @@
    @ApiModelProperty(value = "不良产品数")
    private Integer badProduct;
    @ApiModelProperty(value = "剩余未处理不良品数")
    private Integer restProduct;
    @ApiModelProperty(value = "备注")
    private String note;
src/main/java/com/whyc/pojo/DefectiveProductsHistory.java
@@ -48,8 +48,6 @@
    @ApiModelProperty(value = "状态0,1,2,3")
    private Integer confirmStatus;
    @ApiModelProperty(value = "不良产品数")
    private Integer badProduct;
    @ApiModelProperty(value = "备注")
    private String note;
@@ -70,5 +68,8 @@
    @TableField(exist = false)
    private List hisNameList;
    @ApiModelProperty(value = "处理不良品数")
    private Integer delProduct;
}
src/main/java/com/whyc/service/DefectiveProductsHistoryService.java
@@ -27,11 +27,11 @@
        DefectiveProductsHistory his=new DefectiveProductsHistory();
        his.setDeftId(defective.getId());
        his.setRecordTime(defective.getStartTime());
        his.setBadProduct(defective.getBadProduct());
        his.setConfirmStatus(defective.getConfirmStatus());
        his.setNote(defective.getNote());
        his.setReceiverIds(defective.getReceiverIds());
        his.setReceiverNames(defective.getReceiverNames());
        his.setDelProduct(0);
        mapper.insert(his);
    }
    //记录处理记录
src/main/java/com/whyc/service/DefectiveProductsService.java
@@ -58,6 +58,7 @@
        defective.setSenderName(senderName);
        Date date=new Date();
        defective.setRecordTime(date);
        defective.setRestProduct(defective.getBadProduct());
        if(defective.getStartTime()==null){
            //保存
            defective.setStartTime(date);
@@ -180,8 +181,9 @@
        UpdateWrapper wrapper=new UpdateWrapper();
        wrapper.set("receiver_ids",defectiveHis.getReceiverIds());
        wrapper.set("receiver_names",defectiveHis.getReceiverNames());
        wrapper.set("bad_product",defectiveHis.getBadProduct());
        if(defectiveHis.getBadProduct()==0){
        int resProduct=defective.getRestProduct()-defectiveHis.getDelProduct();
        wrapper.set("rest_product",resProduct);
        if(resProduct==0){
            defectiveHis.setConfirmStatus(2);//不良品数量为0结束
        }else {
            defectiveHis.setConfirmStatus(1);
@@ -190,7 +192,6 @@
        wrapper.set("note",defectiveHis.getNote());
        wrapper.eq("id",defectiveHis.getDeftId());
        mapper.update(null,wrapper);
        //记录处理记录
        defectiveHisService.updateDefective(defective,defectiveHis,multipartFileList);
@@ -231,7 +232,7 @@
        wrapper.set("confirm_status",3);//归档
        wrapper.set("receiver_ids","");
        wrapper.set("receiver_names","");
        wrapper.set("bad_product",0);
        wrapper.set("rest_product",0);
        wrapper.set("note","");
        wrapper.eq("id",deftId);
        mapper.update(null,wrapper);
@@ -240,7 +241,7 @@
        defectiveHis.setDeftId(deftId);
        defectiveHis.setDelId(ActionUtil.getUser().getId().intValue());
        defectiveHis.setConfirmStatus(3);
        defectiveHis.setBadProduct(0);
        defectiveHis.setDelProduct(0);
        defectiveHis.setDelId(ActionUtil.getUser().getId().intValue());
        defectiveHisService.stopDefective(defectiveHis);
        return new Response().set(1,true);
src/main/resources/mapper/DefectiveProductsMapper.xml
@@ -17,6 +17,7 @@
        <result property="confirmStatus" column="confirm_status"></result>
        <result property="sumProduct" column="sum_product"></result>
        <result property="badProduct" column="bad_product"></result>
        <result property="restProduct" column="rest_product"></result>
        <result property="note" column="note"></result>
        <collection property="hisList" javaType="java.util.ArrayList" ofType="com.whyc.pojo.DefectiveProductsHistory" column="{deftId=id}" select="selectDefectiveHis">
        </collection>