whycxzp
2024-12-06 e418d8f19083a32f8ecf0873ba8d87d8919b43dd
src/main/java/com/whyc/service/DefectiveProductsService.java
@@ -1,6 +1,5 @@
package com.whyc.service;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.github.pagehelper.PageHelper;
@@ -24,7 +23,6 @@
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
@@ -117,7 +115,8 @@
        }
        String subject = "【不良品记录】-"+senderName;
        String content = defective.getContent();
        String content = senderName+"上传了不良品记录,信息如下:\n厂商:"+defective.getProvideName()+"\n产品:"+defective.getProductName()+"\n型号:"+defective.getType()
                +"\n不良品数量:"+defective.getBadProduct()+"\n具体不良信息:"+defective.getContent();
        MailDTO mailDTO = new MailDTO();
        mailDTO.setTitle(subject);
@@ -185,6 +184,7 @@
        wrapper.set("receiver_ids",defectiveHis.getReceiverIds());
        wrapper.set("receiver_names",defectiveHis.getReceiverNames());
        int resProduct=defective.getRestProduct()-defectiveHis.getDelProduct();
        defectiveHis.setRestProduct(resProduct);
        wrapper.set("rest_product",resProduct);
        if(resProduct==0){
            defectiveHis.setConfirmStatus(2);//不良品数量为0结束
@@ -196,6 +196,7 @@
        wrapper.eq("id",defectiveHis.getDeftId());
        mapper.update(null,wrapper);
        //记录处理记录
        defectiveHisService.updateDefective(defective,defectiveHis,multipartFileList);
        //发送邮件
@@ -216,7 +217,9 @@
        }
        String subject = "【不良品处理记录】-"+senderName;
        String content = defective.getContent();
        String content = defectiveHis.getDelName()+"修复了厂商:"+defective.getProvideName()+",产品:"+defective.getProductName()+",型号:"+defective.getType()+"的不良品记录;\n"+
                "不良品数量为:"+defective.getBadProduct()+"修复不良品个数:"+defectiveHis.getDelProduct()+",剩余不良品个数:"+defectiveHis.getRestProduct()+"\n"
                +"修复方式:"+defectiveHis.getNote();
        MailDTO mailDTO = new MailDTO();
        mailDTO.setTitle(subject);
@@ -246,6 +249,7 @@
        defectiveHis.setConfirmStatus(3);
        defectiveHis.setDelProduct(0);
        defectiveHis.setDelName(ActionUtil.getUser().getName());
        defectiveHis.setRestProduct(0);
        defectiveHisService.stopDefective(defectiveHis);
        return new Response().set(1,true);
    }