whyclxw
2024-07-23 e8c86eafffbcc6ce6c1e506b6b6363a707dd6420
不良品处理和归档
3个文件已修改
31 ■■■■■ 已修改文件
src/main/java/com/whyc/controller/DefectiveProductsController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/DefectiveProducts.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/DefectiveProductsService.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/DefectiveProductsController.java
@@ -37,4 +37,10 @@
    public Response updateDefective(@RequestBody DefectiveProductsHistory defectiveHis) {
        return service.updateDefective(defectiveHis);
    }
    @ApiOperation("归档不良品")
    @PostMapping("stopDefective")
    public Response stopDefective(@RequestParam int  deftId) {
        return service.stopDefective(deftId);
    }
}
src/main/java/com/whyc/pojo/DefectiveProducts.java
@@ -60,7 +60,7 @@
    private String receiverNames;
    @ApiModelProperty(value = "状态0,1,2,3")
    @ApiModelProperty(value = "状态0,1,2,3-0:录入 1:处理中不良品数量不为0,2:处理中不良品数量不为0,3:归档")
    private Integer confirmStatus;
    @ApiModelProperty(value = "总数")
src/main/java/com/whyc/service/DefectiveProductsService.java
@@ -145,8 +145,13 @@
        UpdateWrapper wrapper=new UpdateWrapper();
        wrapper.set("receiver_ids",defectiveHis.getReceiverIds());
        wrapper.set("receiver_names",defectiveHis.getReceiverNames());
        wrapper.set("confirm_status",defectiveHis.getConfirmStatus());
        wrapper.set("bad_product",defectiveHis.getBadProduct());
        if(defectiveHis.getBadProduct()==0){
            defectiveHis.setConfirmStatus(2);//不良品数量为0结束
        }else {
            defectiveHis.setConfirmStatus(1);
        }
        wrapper.set("confirm_status",defectiveHis.getConfirmStatus());
        wrapper.set("note",defectiveHis.getNote());
        wrapper.eq("id",defectiveHis.getDeftId());
        mapper.update(null,wrapper);
@@ -194,4 +199,20 @@
        return new Response().set(1,true);
    }
    //归档不良品
    public Response stopDefective(int deftId) {
        //修改当前表记录
        UpdateWrapper wrapper=new UpdateWrapper();
        wrapper.set("confirm_status",3);//归档
        wrapper.eq("id",deftId);
        mapper.update(null,wrapper);
        //记录处理记录
        DefectiveProductsHistory defectiveHis=new DefectiveProductsHistory();
        defectiveHis.setDeftId(deftId);
        defectiveHis.setConfirmStatus(3);
        defectiveHis.setBadProduct(0);
        defectiveHisService.updateDefective(defectiveHis);
        return new Response().set(1,true);
    }
}