| | |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.project.system.service.ISysNoticeService; |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | | import com.ruoyi.sales.mapper.SalesQuotationMapper; |
| | | import com.ruoyi.sales.mapper.SalesQuotationProductMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.SalesQuotation; |
| | | import com.ruoyi.sales.service.impl.CommonFileServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private DeviceRepairMapper deviceRepairMapper; |
| | | |
| | | @Autowired |
| | | private SalesQuotationMapper salesQuotationMapper; |
| | | |
| | | |
| | | |
| | | public ApproveProcess getApproveById(String id) { |
| | |
| | | @Override |
| | | public void initApproveNodes(String approveUserIds,String approveID,Long tenantId) { |
| | | Long userId = SecurityUtils.getLoginUser().getUser().getUserId(); |
| | | ApproveProcess approve = getApproveById(approveID); |
| | | String[] names = approveUserIds.split(","); |
| | | String approveId = approve.getApproveId(); |
| | | for (int i = 0; i < names.length; i++) { |
| | | SysUser sysUser = sysUserMapper.selectUserById(Long.parseLong(names[i])); |
| | | if (sysUser == null) continue; |
| | | ApproveNode approveNode = new ApproveNode(); |
| | | approveNode.setApproveProcessId(approveId); |
| | | approveNode.setApproveProcessId(approveID); |
| | | approveNode.setApproveNodeOrder(i +1); |
| | | approveNode.setApproveNodeUser(sysUser.getNickName()); |
| | | approveNode.setApproveNodeUserId(sysUser.getUserId()); |
| | |
| | | } |
| | | deviceRepairMapper.updateById(deviceRepair); |
| | | } |
| | | // 销售报价状态修改 |
| | | if(approveProcess.getApproveType().equals(6)){ |
| | | SalesQuotation salesQuote = salesQuotationMapper.selectOne(new LambdaQueryWrapper<SalesQuotation>() |
| | | .eq(SalesQuotation::getQuotationNo, approveProcess.getApproveReason()) |
| | | .last("limit 1")); |
| | | // 同意 |
| | | if(status.equals(2) && salesQuote != null){ |
| | | salesQuote.setStatus("通过"); |
| | | }else if(status.equals(3) && salesQuote != null){ |
| | | salesQuote.setStatus("拒绝"); |
| | | }else if(status.equals(1) && salesQuote != null){ |
| | | salesQuote.setStatus("审核中"); |
| | | } |
| | | |
| | | salesQuotationMapper.updateById(salesQuote); |
| | | } |
| | | // 绑定附件 |
| | | if(!CollectionUtils.isEmpty(approveNode.getTempFileIds()) && approveNode.getApproveNodeStatus() == 1){ |
| | | tempFileService.migrateTempFilesToFormal(approveNode.getId(), approveNode.getTempFileIds(), FileNameType.ApproveNode.getValue()); |