jinlin
2023-12-28 63447fec93e8e562833db30bc848884001b808c4
modules/mainPart/src/main/java/com/zt/life/modules/itemCirculatOrder/service/ItemCirculatOrderService.java
@@ -79,12 +79,15 @@
     * @return
     */
    public List<ItemCirculatOrder> page(QueryFilter queryFilter) {
        List<ItemCirculatOrder> list= baseDao.getList(queryFilter.getQueryParams());
        workflowService.getRunFlow(list,"pzxrk");
        List<ItemCirculatOrder> list = baseDao.getList(queryFilter.getQueryParams());
        if (list.size() > 0) {
            workflowService.getRunFlow(list, "wplz");
        }
        return list;
    }
    /**
     * yi
     * 删除
     *
     * @param ids
@@ -94,8 +97,8 @@
    }
    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<>();
@@ -104,22 +107,24 @@
            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);
            if (circulatOrderTechnical.getId() != null) {
                technicalService.update(circulatOrderTechnical);
            } else {
                circulatOrderTechnical.setCirculatOrderId(circulatOrderid);
                technicalService.insert(circulatOrderTechnical);
            if (circulatOrderTechnical.getName() != null) {
                circulatOrderTechnical.setCirculatOrderId(circulatOrderId);
                if (circulatOrderTechnical.getId() != null) {
                    technicalService.update(circulatOrderTechnical);
                } else {
                    circulatOrderTechnical.setCirculatOrderId(circulatOrderId);
                    technicalService.insert(circulatOrderTechnical);
                }
                sysOssConfigService.updateOss(circulatOrderTechnical.getId(), circulatOrderTechnical.getFiles());// 保存附件
            }
            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());
@@ -137,19 +142,19 @@
        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 {
@@ -174,7 +179,7 @@
        }
        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");
@@ -190,11 +195,11 @@
        try {
            ItemCirculatOrderDto dataObj = this.getDto(null, id);
            String acceptorPath = "文件图片:"+ getFilesPath.getSignPath(Convert.toLong(dataObj.getCirculatOrder().getItemAcceptorId()));
            String acceptorPath = "文件图片:" + getFilesPath.getSignPath(Convert.toLong(dataObj.getCirculatOrder().getItemAcceptorId()));
            dataObj.getCirculatOrder().setItemAcceptor(acceptorPath);
            String detectorPath = "文件图片:"+getFilesPath.getSignPath(Convert.toLong(dataObj.getCirculatOrder().getCalibratDetectorId()));
            String detectorPath = "文件图片:" + getFilesPath.getSignPath(Convert.toLong(dataObj.getCirculatOrder().getCalibratDetectorId()));
            dataObj.getCirculatOrder().setCalibratDetector(detectorPath);
            String issuerPath = "文件图片:"+getFilesPath.getSignPath(Convert.toLong(dataObj.getCirculatOrder().getItemIssuerId()));
            String issuerPath = "文件图片:" + getFilesPath.getSignPath(Convert.toLong(dataObj.getCirculatOrder().getItemIssuerId()));
            dataObj.getCirculatOrder().setItemIssuer(issuerPath);
            //通用字典列表字符串生成
            String itemRequireStr = getShowDictList.getShowDictList(dataObj.getCirculatOrder().getItemRequire(), "is_or_not", false);