| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | |
| | | @Value("${file.path}") |
| | | private String imgUrl; |
| | | |
| | | @Resource |
| | | private InsOrderMapper insOrderMapper; |
| | | |
| | | @Override |
| | | public Map<String, Object> pageInsReport(Page page, ReportPageDto reportPageDto) { |
| | |
| | | if (isExamine==0){ |
| | | //如果审核不通过 |
| | | insReport.setState(0);//提交状态改为待提交 |
| | | return insReportMapper.updateById(insReport); |
| | | } |
| | | //获取审核人的签名地址 |
| | | String signatureUrl = userMapper.selectById(insReport.getExamineUserId()).getSignatureUrl(); |
| | |
| | | |
| | | //批准 |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int ratifyReport(Integer id, Integer isRatify, String ratifyTell) { |
| | | InsReport insReport = insReportMapper.selectById(id); |
| | | insReport.setIsRatify(isRatify); |
| | |
| | | if (isRatify==0){ |
| | | //如果批准不通过 |
| | | insReport.setState(0);//提交状态改为待提交 |
| | | return insReportMapper.updateById(insReport); |
| | | } |
| | | //获取审核人的签名地址 |
| | | String signatureUrl = userMapper.selectById(insReport.getRatifyUserId()).getSignatureUrl(); |
| | |
| | | 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); |
| | | } |
| | | |