whycxzp
2025-03-05 8bf7228d68776bf39a8f7fa0f3e16e84631d7188
src/main/java/com/whyc/service/BOMFeedbakService.java
@@ -8,15 +8,16 @@
import com.whyc.dto.FileDirPath;
import com.whyc.dto.MailDTO;
import com.whyc.dto.Response;
import com.whyc.dto.*;
import com.whyc.mapper.BOMFeedbakMapper;
import com.whyc.mapper.DocUserMapper;
import com.whyc.mapper.ProductHistoryMapper;
import com.whyc.pojo.BOMFeedback;
import com.whyc.pojo.DocUser;
import com.whyc.pojo.Product;
import com.whyc.pojo.ProductHistory;
import com.whyc.util.ActionUtil;
import com.whyc.util.CommonUtil;
import com.whyc.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -47,6 +48,10 @@
    @Resource
    private ProductHistoryMapper phisMapper;
    @Autowired
    private ProductService productService;
    //统计
    public Map<String, Integer> getFkStatistic(DocUser user,Map<String, Integer> map) {
        int sendFk=0;
@@ -90,8 +95,8 @@
        if(list!=null&&list.size()>0){
            for (int i=0;i<list.size();i++) {
                BOMFeedback feedback=list.get(i);
                fileDirName=fileDirName+File.separator+feedback.getFile();
                File start = new File(fileDirName);
                String attachFilePath=fileDirName+File.separator+feedback.getFile();
                File start = new File(attachFilePath);
                String[] files =new String[]{};
                List attachList=new ArrayList();
                if(start.exists()) {
@@ -125,8 +130,8 @@
        if(list!=null&&list.size()>0){
            for (int i=0;i<list.size();i++) {
                BOMFeedback feedback=list.get(i);
                fileDirName=fileDirName+File.separator+feedback.getFile();
                File start = new File(fileDirName);
                String attachFilePath=fileDirName+File.separator+feedback.getFile();
                File start = new File(attachFilePath);
                String[] files =new String[]{};
                List attachList=new ArrayList();
                if(start.exists()) {
@@ -301,7 +306,10 @@
        }
        String subject = "【Bom问题反馈】-"+senderName;
        String content = feedback.getContent();
        //邮件内容,添加产品的相关信息
        Product product = productService.getById(feedback.getProductId());
        String content ="产品料号:"+product.getParentCode() + "\n产品名称:"+product.getParentName() + "\n产品型号:"+product.getParentModel() + "\n版本时间:"+ DateUtil.YYYY_MM_DD_HH_MM_SS.format(product.getVersionTime()) + "\n定制单号:"+product.getCustomCode() + "\n产品反馈内容:"+ feedback.getContent();
        MailDTO mailDTO = new MailDTO();
        mailDTO.setTitle(subject);
@@ -400,8 +408,8 @@
        if(list!=null&&list.size()>0){
            for (int i=0;i<list.size();i++) {
                BOMFeedback fb=list.get(i);
                fileDirName=fileDirName+File.separator+fb.getFile();
                File start = new File(fileDirName);
                String attachFilePath=fileDirName+File.separator+fb.getFile();
                File start = new File(attachFilePath);
                String[] files =new String[]{};
                List attachList=new ArrayList();
                if(start.exists()) {