diff --git a/zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/mapper/McBasicCmtyMapper.java b/zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/mapper/McBasicCmtyMapper.java index e2a8d2f..a09f042 100644 --- a/zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/mapper/McBasicCmtyMapper.java +++ b/zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/mapper/McBasicCmtyMapper.java @@ -68,6 +68,11 @@ public interface McBasicCmtyMapper List getDistinctCompanyList(McBasicCmtyVo mcBasicCmtyVo); + /** + * 查询小区 + * @param mcBasicCmtyVo + * @return + */ List selectVlgOrCmtyList(McBasicCmtyVo mcBasicCmtyVo); List selectMcBasicCmtyByData(McBasicCmty mcBasicCmty); diff --git a/zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McBasicCmtyServiceImpl.java b/zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McBasicCmtyServiceImpl.java index ccdf072..66adc87 100644 --- a/zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McBasicCmtyServiceImpl.java +++ b/zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McBasicCmtyServiceImpl.java @@ -164,6 +164,6 @@ public class McBasicCmtyServiceImpl implements IMcBasicCmtyService { data.put("label", mcBasicCmty.getCompanyName()); lists.add(data); } - return lists; + return distinctCompanyList; } } diff --git a/zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McVisitServiceImpl.java b/zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McVisitServiceImpl.java index 9ece008..b557595 100644 --- a/zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McVisitServiceImpl.java +++ b/zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McVisitServiceImpl.java @@ -158,9 +158,6 @@ public class McVisitServiceImpl implements IMcVisitService { isChargedValidate(mcVisit); int i = mcVisitMapper.insertMcVisit(mcVisit); if (i > 0) { - //添加文件使用次数 -// fieldPhotoFile -// attachmentFile if (StringUtils.isNotEmpty(mcVisit.getFieldPhotoFile())) { String fieldPhotoFile = mcVisit.getFieldPhotoFile(); mcFileMapper.updateMcFileAddCount(Arrays.asList(fieldPhotoFile.split(","))); @@ -261,6 +258,19 @@ public class McVisitServiceImpl implements IMcVisitService { @Transactional @Override public int updateMcVisit(McVisit mcVisit_old) throws CloneNotSupportedException { + //判断修改前数据是否有文件 + McVisit mcVisit = mcVisitMapper.selectMcVisitById(mcVisit_old.getId()); + if (mcVisit==null){ + throw new RuntimeException("工单不存在"); + } + if (StringUtils.isNotEmpty(mcVisit.getFieldPhotoFile())) { + String fieldPhotoFile = mcVisit.getFieldPhotoFile(); + mcFileMapper.updateMcFileReduceCount(Arrays.asList(fieldPhotoFile.split(","))); + } + if (StringUtils.isNotEmpty(mcVisit.getAttachmentFile())) { + mcFileMapper.updateMcFileReduceCount(Arrays.asList(mcVisit.getAttachmentFile())); + } + LocalDateTime updateTime = DateUtils.getNowLocal(); String userId = SecurityUtils.getUserId().toString(); String userAccount = SecurityUtils.getUsername(); @@ -276,6 +286,15 @@ public class McVisitServiceImpl implements IMcVisitService { //收费验证 isChargedValidate(mcVisit_new); int i = mcVisitMapper.updateMcVisit(mcVisit_new); + if (i > 0) { + if (StringUtils.isNotEmpty(mcVisit_new.getFieldPhotoFile())) { + String fieldPhotoFile = mcVisit_new.getFieldPhotoFile(); + mcFileMapper.updateMcFileAddCount(Arrays.asList(fieldPhotoFile.split(","))); + } + if (StringUtils.isNotEmpty(mcVisit_new.getAttachmentFile())) { + mcFileMapper.updateMcFileAddCount(Arrays.asList(mcVisit_new.getAttachmentFile())); + } + } //1:添加记录 iMcOperationLogService.insertMcOperationLog("mc_visit", mcVisit_new.getId(), "schsf:mcVisit:edit", "重新发起", "1", null, null, JSON.toJSONString(mcVisit_new)); @@ -413,7 +432,6 @@ public class McVisitServiceImpl implements IMcVisitService { @Transactional @Override public int updateMcVisitModification(McVisitModificationVo mcVisitModificationVo) throws CloneNotSupportedException { - System.out.println("=====================>cccccccccmcVisitModificationVo:{}" + mcVisitModificationVo.toString()); McVisit mcVisit_old = mcVisitMapper.selectMcVisitById(mcVisitModificationVo.getId()); if (BeanUtil.isEmpty(mcVisit_old)) { throw new RuntimeException("未查询到记录"); @@ -421,6 +439,13 @@ public class McVisitServiceImpl implements IMcVisitService { if (!mcVisit_old.getPublishStatus().equals(VisitPublishStatusEnums.APPROVED.getCode())) { throw new RuntimeException("状态异常"); } + if (StringUtils.isNotEmpty(mcVisit_old.getFieldPhotoFile())) { + String fieldPhotoFile = mcVisit_old.getFieldPhotoFile(); + mcFileMapper.updateMcFileReduceCount(Arrays.asList(fieldPhotoFile.split(","))); + } + if (StringUtils.isNotEmpty(mcVisit_old.getAttachmentFile())) { + mcFileMapper.updateMcFileReduceCount(Arrays.asList(mcVisit_old.getAttachmentFile())); + } LocalDateTime updateTime = DateUtils.getNowLocal(); String userId = SecurityUtils.getUserId().toString(); String userAccount = SecurityUtils.getUsername(); @@ -439,6 +464,15 @@ public class McVisitServiceImpl implements IMcVisitService { //收费验证 isChargedValidate(mcVisit_new); int i = mcVisitMapper.updateMcVisit(mcVisit_new); + if (i > 0) { + if (StringUtils.isNotEmpty(mcVisit_new.getFieldPhotoFile())) { + String fieldPhotoFile = mcVisit_new.getFieldPhotoFile(); + mcFileMapper.updateMcFileAddCount(Arrays.asList(fieldPhotoFile.split(","))); + } + if (StringUtils.isNotEmpty(mcVisit_new.getAttachmentFile())) { + mcFileMapper.updateMcFileAddCount(Arrays.asList(mcVisit_new.getAttachmentFile())); + } + } //1:添加记录 iMcOperationLogService.insertMcOperationLog("mc_visit", mcVisit_new.getId(), "schsf:mcVisit:modification", "发起异动", "2", mcVisitModificationVo.getRemark(), JSON.toJSONString(mcVisit_old), JSON.toJSONString(mcVisit_new)); diff --git a/zr-cloud/zr-modules/zr-schsf/src/main/resources/mapper/McBasicCmtyMapper.xml b/zr-cloud/zr-modules/zr-schsf/src/main/resources/mapper/McBasicCmtyMapper.xml index 7432b42..9150fae 100644 --- a/zr-cloud/zr-modules/zr-schsf/src/main/resources/mapper/McBasicCmtyMapper.xml +++ b/zr-cloud/zr-modules/zr-schsf/src/main/resources/mapper/McBasicCmtyMapper.xml @@ -296,8 +296,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" parameterType="com.chinagas.modules.schsf.domain.vo.McBasicCmtyVo"> SELECT DISTINCT t.company_code as 'companyCode', - t.company_name as 'companyName', - t.urb_rur_cls as 'urbRurCls' + t.company_name as 'companyName' FROM mc_basic_cmty t left join sys_user u on u.user_id = t.create_by left join sys_dept d on d.dept_id = t.company_code @@ -319,7 +318,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"