value
2024-04-25 c623c05868d94854e31652181570537a6493a7eb
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsReportServiceImpl.java
@@ -15,7 +15,9 @@
import com.yuanchu.mom.dto.ReportPageDto;
import com.yuanchu.mom.dto.SampleOrderDto;
import com.yuanchu.mom.exception.ErrorException;
import com.yuanchu.mom.mapper.InsOrderMapper;
import com.yuanchu.mom.mapper.UserMapper;
import com.yuanchu.mom.pojo.InsOrder;
import com.yuanchu.mom.pojo.InsReport;
import com.yuanchu.mom.service.InsReportService;
import com.yuanchu.mom.mapper.InsReportMapper;
@@ -23,6 +25,7 @@
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.ByteArrayOutputStream;
@@ -58,6 +61,9 @@
    @Value("${file.path}")
    private String imgUrl;
    @Resource
    private InsOrderMapper insOrderMapper;
    @Override
    public Map<String, Object> pageInsReport(Page page, ReportPageDto reportPageDto) {
@@ -127,6 +133,7 @@
        if (isExamine==0){
            //如果审核不通过
            insReport.setState(0);//提交状态改为待提交
            return insReportMapper.updateById(insReport);
        }
        //获取审核人的签名地址
        String signatureUrl = userMapper.selectById(insReport.getExamineUserId()).getSignatureUrl();
@@ -142,6 +149,7 @@
    //批准
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int ratifyReport(Integer id, Integer isRatify, String ratifyTell) {
        InsReport insReport = insReportMapper.selectById(id);
        insReport.setIsRatify(isRatify);
@@ -153,6 +161,7 @@
        if (isRatify==0){
            //如果批准不通过
            insReport.setState(0);//提交状态改为待提交
            return insReportMapper.updateById(insReport);
        }
        //获取审核人的签名地址
        String signatureUrl = userMapper.selectById(insReport.getRatifyUserId()).getSignatureUrl();
@@ -163,6 +172,10 @@
        wordInsertUrl(new HashMap<String, Object>(){{
            put("ratifyUrl", Pictures.ofLocal(imgUrl+"/"+signatureUrl).create());
        }}, (urlS==null?url:urlS).replace("/word", wordUrl));
        InsOrder insOrder = new InsOrder();
        insOrder.setId(insReportMapper.selectById(id).getInsOrderId());
        insOrder.setState(4);
        insOrderMapper.updateById(insOrder);
        return insReportMapper.updateById(insReport);
    }