whyclxw
2024-07-23 e8c86eafffbcc6ce6c1e506b6b6363a707dd6420
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);
    }
}