Commit 87ea74bf673d17723fdc33c8fee0952730eca601

Authored by 陈威
1 parent 91e75ed3
Exists in dev

1:修改项目功能,城乡分类

zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/mapper/McBasicCmtyMapper.java
... ... @@ -68,6 +68,11 @@ public interface McBasicCmtyMapper
68 68  
69 69 List<McBasicCmty> getDistinctCompanyList(McBasicCmtyVo mcBasicCmtyVo);
70 70  
  71 + /**
  72 + * 查询小区
  73 + * @param mcBasicCmtyVo
  74 + * @return
  75 + */
71 76 List<McBasicCmty> selectVlgOrCmtyList(McBasicCmtyVo mcBasicCmtyVo);
72 77  
73 78 List<McBasicCmty> selectMcBasicCmtyByData(McBasicCmty mcBasicCmty);
... ...
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 {
164 164 data.put("label", mcBasicCmty.getCompanyName());
165 165 lists.add(data);
166 166 }
167   - return lists;
  167 + return distinctCompanyList;
168 168 }
169 169 }
... ...
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 {
158 158 isChargedValidate(mcVisit);
159 159 int i = mcVisitMapper.insertMcVisit(mcVisit);
160 160 if (i > 0) {
161   - //添加文件使用次数
162   -// fieldPhotoFile
163   -// attachmentFile
164 161 if (StringUtils.isNotEmpty(mcVisit.getFieldPhotoFile())) {
165 162 String fieldPhotoFile = mcVisit.getFieldPhotoFile();
166 163 mcFileMapper.updateMcFileAddCount(Arrays.asList(fieldPhotoFile.split(",")));
... ... @@ -261,6 +258,19 @@ public class McVisitServiceImpl implements IMcVisitService {
261 258 @Transactional
262 259 @Override
263 260 public int updateMcVisit(McVisit mcVisit_old) throws CloneNotSupportedException {
  261 + //判断修改前数据是否有文件
  262 + McVisit mcVisit = mcVisitMapper.selectMcVisitById(mcVisit_old.getId());
  263 + if (mcVisit==null){
  264 + throw new RuntimeException("工单不存在");
  265 + }
  266 + if (StringUtils.isNotEmpty(mcVisit.getFieldPhotoFile())) {
  267 + String fieldPhotoFile = mcVisit.getFieldPhotoFile();
  268 + mcFileMapper.updateMcFileReduceCount(Arrays.asList(fieldPhotoFile.split(",")));
  269 + }
  270 + if (StringUtils.isNotEmpty(mcVisit.getAttachmentFile())) {
  271 + mcFileMapper.updateMcFileReduceCount(Arrays.asList(mcVisit.getAttachmentFile()));
  272 + }
  273 +
264 274 LocalDateTime updateTime = DateUtils.getNowLocal();
265 275 String userId = SecurityUtils.getUserId().toString();
266 276 String userAccount = SecurityUtils.getUsername();
... ... @@ -276,6 +286,15 @@ public class McVisitServiceImpl implements IMcVisitService {
276 286 //收费验证
277 287 isChargedValidate(mcVisit_new);
278 288 int i = mcVisitMapper.updateMcVisit(mcVisit_new);
  289 + if (i > 0) {
  290 + if (StringUtils.isNotEmpty(mcVisit_new.getFieldPhotoFile())) {
  291 + String fieldPhotoFile = mcVisit_new.getFieldPhotoFile();
  292 + mcFileMapper.updateMcFileAddCount(Arrays.asList(fieldPhotoFile.split(",")));
  293 + }
  294 + if (StringUtils.isNotEmpty(mcVisit_new.getAttachmentFile())) {
  295 + mcFileMapper.updateMcFileAddCount(Arrays.asList(mcVisit_new.getAttachmentFile()));
  296 + }
  297 + }
279 298 //1:添加记录
280 299 iMcOperationLogService.insertMcOperationLog("mc_visit", mcVisit_new.getId(), "schsf:mcVisit:edit",
281 300 "重新发起", "1", null, null, JSON.toJSONString(mcVisit_new));
... ... @@ -413,7 +432,6 @@ public class McVisitServiceImpl implements IMcVisitService {
413 432 @Transactional
414 433 @Override
415 434 public int updateMcVisitModification(McVisitModificationVo mcVisitModificationVo) throws CloneNotSupportedException {
416   - System.out.println("=====================>cccccccccmcVisitModificationVo:{}" + mcVisitModificationVo.toString());
417 435 McVisit mcVisit_old = mcVisitMapper.selectMcVisitById(mcVisitModificationVo.getId());
418 436 if (BeanUtil.isEmpty(mcVisit_old)) {
419 437 throw new RuntimeException("未查询到记录");
... ... @@ -421,6 +439,13 @@ public class McVisitServiceImpl implements IMcVisitService {
421 439 if (!mcVisit_old.getPublishStatus().equals(VisitPublishStatusEnums.APPROVED.getCode())) {
422 440 throw new RuntimeException("状态异常");
423 441 }
  442 + if (StringUtils.isNotEmpty(mcVisit_old.getFieldPhotoFile())) {
  443 + String fieldPhotoFile = mcVisit_old.getFieldPhotoFile();
  444 + mcFileMapper.updateMcFileReduceCount(Arrays.asList(fieldPhotoFile.split(",")));
  445 + }
  446 + if (StringUtils.isNotEmpty(mcVisit_old.getAttachmentFile())) {
  447 + mcFileMapper.updateMcFileReduceCount(Arrays.asList(mcVisit_old.getAttachmentFile()));
  448 + }
424 449 LocalDateTime updateTime = DateUtils.getNowLocal();
425 450 String userId = SecurityUtils.getUserId().toString();
426 451 String userAccount = SecurityUtils.getUsername();
... ... @@ -439,6 +464,15 @@ public class McVisitServiceImpl implements IMcVisitService {
439 464 //收费验证
440 465 isChargedValidate(mcVisit_new);
441 466 int i = mcVisitMapper.updateMcVisit(mcVisit_new);
  467 + if (i > 0) {
  468 + if (StringUtils.isNotEmpty(mcVisit_new.getFieldPhotoFile())) {
  469 + String fieldPhotoFile = mcVisit_new.getFieldPhotoFile();
  470 + mcFileMapper.updateMcFileAddCount(Arrays.asList(fieldPhotoFile.split(",")));
  471 + }
  472 + if (StringUtils.isNotEmpty(mcVisit_new.getAttachmentFile())) {
  473 + mcFileMapper.updateMcFileAddCount(Arrays.asList(mcVisit_new.getAttachmentFile()));
  474 + }
  475 + }
442 476 //1:添加记录
443 477 iMcOperationLogService.insertMcOperationLog("mc_visit", mcVisit_new.getId(), "schsf:mcVisit:modification",
444 478 "发起异动", "2", mcVisitModificationVo.getRemark(), JSON.toJSONString(mcVisit_old), JSON.toJSONString(mcVisit_new));
... ...
zr-cloud/zr-modules/zr-schsf/src/main/resources/mapper/McBasicCmtyMapper.xml
... ... @@ -296,8 +296,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
296 296 parameterType="com.chinagas.modules.schsf.domain.vo.McBasicCmtyVo">
297 297 SELECT DISTINCT
298 298 t.company_code as 'companyCode',
299   - t.company_name as 'companyName',
300   - t.urb_rur_cls as 'urbRurCls'
  299 + t.company_name as 'companyName'
301 300 FROM mc_basic_cmty t
302 301 left join sys_user u on u.user_id = t.create_by
303 302 left join sys_dept d on d.dept_id = t.company_code
... ... @@ -319,7 +318,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
319 318 </select>
320 319  
321 320 <select id="selectVlgOrCmtyList" resultMap="McBasicCmtyResult" parameterType="com.chinagas.modules.schsf.domain.vo.McBasicCmtyVo">
322   - SELECT DISTINCT t.vlg_or_cmty
  321 + SELECT DISTINCT t.vlg_or_cmty,t.urb_rur_cls
323 322 FROM mc_basic_cmty t
324 323 left join sys_user u on u.user_id = t.create_by
325 324 left join sys_dept d on d.dept_id = t.company_code
... ...