| | |
| | | } |
| | | |
| | | public Boolean save(ItemCirculatOrderDto itemCirculatOrderDto) { |
| | | Long circulatOrderid = itemCirculatOrderDto.getCirculatOrder().getId(); |
| | | if (circulatOrderid != null) |
| | | Long circulatOrderId = itemCirculatOrderDto.getCirculatOrder().getId(); |
| | | if (circulatOrderId != null) |
| | | baseDao.updateById(itemCirculatOrderDto.getCirculatOrder()); |
| | | else { |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | itemCirculatOrderDto.getCirculatOrder().setProjectId(itemCirculatOrderDto.getProjectId()); |
| | | itemCirculatOrderDto.getCirculatOrder().setCode(sysCodeRuleService.getNewCode(map)); |
| | | baseDao.insert(itemCirculatOrderDto.getCirculatOrder()); |
| | | circulatOrderid = itemCirculatOrderDto.getCirculatOrder().getId(); |
| | | circulatOrderId = itemCirculatOrderDto.getCirculatOrder().getId(); |
| | | } |
| | | |
| | | for (ItemCirculatOrderTechnical circulatOrderTechnical : itemCirculatOrderDto.getTechnicalList()) { |
| | | circulatOrderTechnical.setCirculatOrderId(circulatOrderid); |
| | | circulatOrderTechnical.setCirculatOrderId(circulatOrderId); |
| | | if (circulatOrderTechnical.getId() != null) { |
| | | technicalService.update(circulatOrderTechnical); |
| | | } else { |
| | | circulatOrderTechnical.setCirculatOrderId(circulatOrderid); |
| | | circulatOrderTechnical.setCirculatOrderId(circulatOrderId); |
| | | technicalService.insert(circulatOrderTechnical); |
| | | } |
| | | sysOssConfigService.updateOss(circulatOrderTechnical.getId(), circulatOrderTechnical.getFiles());// 保存附件 |
| | | } |
| | | |
| | | if (itemCirculatOrderDto.getTestAgencyInfo().getId() == 10000) { |
| | | itemCirculatOrderDto.getTestAgencyInfo().setId(circulatOrderid); |
| | | itemCirculatOrderDto.getTestAgencyInfo().setId(circulatOrderId); |
| | | testAgencyInfoService.insert(itemCirculatOrderDto.getTestAgencyInfo()); |
| | | } else { |
| | | testAgencyInfoService.update(itemCirculatOrderDto.getTestAgencyInfo()); |
| | |
| | | return true; |
| | | } |
| | | |
| | | public ItemCirculatOrderDto getDto(Long projectId, Long circulatOrderid) { |
| | | public ItemCirculatOrderDto getDto(Long projectId, Long circulatOrderId) { |
| | | ItemCirculatOrderDto data = new ItemCirculatOrderDto(); |
| | | if (circulatOrderid != null) { |
| | | data.setId(circulatOrderid); |
| | | ItemCirculatOrder itemCirculatOrder = this.get(circulatOrderid); |
| | | if (circulatOrderId != null) { |
| | | data.setId(circulatOrderId); |
| | | ItemCirculatOrder itemCirculatOrder = this.get(circulatOrderId); |
| | | data.setCirculatOrder(itemCirculatOrder); |
| | | if (projectId == null) { |
| | | projectId = itemCirculatOrder.getProjectId(); |
| | | } |
| | | |
| | | data.setTestAgencyInfo(testAgencyInfoService.get(circulatOrderid)); |
| | | data.setTestAgencyInfo(testAgencyInfoService.get(circulatOrderId)); |
| | | |
| | | List<ItemCirculatOrderTechnical> technicalList = technicalService.getList(circulatOrderid); |
| | | List<ItemCirculatOrderTechnical> technicalList = technicalService.getList(circulatOrderId); |
| | | data.setTechnicalList(technicalList); |
| | | |
| | | } else { |
| | |
| | | } |
| | | if (data.getTestAgencyInfo() == null) |
| | | data.setTestAgencyInfo(testAgencyInfoService.get(10000L)); |
| | | if (circulatOrderid != null) { |
| | | if (circulatOrderId != null) { |
| | | for (ItemCirculatOrderTechnical technical : data.getTechnicalList()) { |
| | | Long technicalId = technical.getId(); |
| | | OssDto ossDto = sysOssConfigService.getOssByBusiType(technicalId, "circulat_order"); |