| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | multipartFile.transferTo(file); |
| | | } |
| | | //ZipUtils.toZip(fileList,new FileOutputStream(new File(rootFile+feedbackZipPath))); |
| | | defective.setFileUrl( File.separator + defectiveDirSuffix); |
| | | defective.setFileUrl(defectiveDirSuffix); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | 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); |
| | |
| | | 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结束 |
| | |
| | | wrapper.eq("id",defectiveHis.getDeftId()); |
| | | mapper.update(null,wrapper); |
| | | //记录处理记录 |
| | | |
| | | defectiveHisService.updateDefective(defective,defectiveHis,multipartFileList); |
| | | |
| | | //发送邮件 |
| | |
| | | } |
| | | |
| | | String subject = "【不良品处理记录】-"+senderName; |
| | | String content = defective.getContent(); |
| | | String content = defectiveHis.getDelName()+"修复了不良品,记录信息如下:\n厂商:"+defective.getProvideName()+"\n产品:"+defective.getProductName()+"\n型号:"+defective.getType()+ |
| | | "\n不良品数量:"+defective.getBadProduct()+"\n修复不良品个数:"+defectiveHis.getDelProduct()+"\n剩余不良品个数:"+defectiveHis.getRestProduct()+"\n" |
| | | +"修复方式:"+defectiveHis.getNote(); |
| | | |
| | | MailDTO mailDTO = new MailDTO(); |
| | | mailDTO.setTitle(subject); |
| | |
| | | defectiveHis.setDelId(ActionUtil.getUser().getId().intValue()); |
| | | defectiveHis.setConfirmStatus(3); |
| | | defectiveHis.setDelProduct(0); |
| | | defectiveHis.setDelId(ActionUtil.getUser().getId().intValue()); |
| | | defectiveHis.setDelName(ActionUtil.getUser().getName()); |
| | | defectiveHis.setRestProduct(0); |
| | | defectiveHisService.stopDefective(defectiveHis); |
| | | return new Response().set(1,true); |
| | | } |