Commit 967c5c8f515913dcd673d94c27e414eec01dd4f6

Authored by 陈威
1 parent abdb3f17
Exists in dev

施工维护

zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/controller/McConstructionController.java
1 1 package com.chinagas.modules.schsf.controller;
2   -import java.net.URLEncoder;
3   -import java.util.List;
4   -import java.io.IOException;
5   -import java.util.Map;
6   -import javax.servlet.http.HttpServletResponse;
7 2  
8   -import com.alibaba.excel.EasyExcel;
9   -import com.alibaba.excel.util.MapUtils;
10   -import com.alibaba.fastjson2.JSON;
11 3 import com.chinagas.common.core.domain.AjaxResult;
12   -import org.springframework.beans.factory.annotation.Autowired;
13   -import org.springframework.web.bind.annotation.GetMapping;
14   -import org.springframework.web.bind.annotation.PostMapping;
15   -import org.springframework.web.bind.annotation.PutMapping;
16   -import org.springframework.web.bind.annotation.DeleteMapping;
17   -import org.springframework.web.bind.annotation.PathVariable;
18   -import org.springframework.web.bind.annotation.RequestBody;
19   -import org.springframework.web.bind.annotation.RequestMapping;
20   -import org.springframework.web.bind.annotation.RestController;
  4 +import com.chinagas.common.core.web.controller.BaseController;
  5 +import com.chinagas.common.core.web.page.TableDataInfo;
21 6 import com.chinagas.common.log.annotation.Log;
22 7 import com.chinagas.common.log.enums.BusinessType;
23 8 import com.chinagas.common.security.annotation.RequirePermission;
24 9 import com.chinagas.modules.schsf.domain.McConstruction;
25 10 import com.chinagas.modules.schsf.service.IMcConstructionService;
26   -import com.chinagas.common.core.web.controller.BaseController;
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.web.bind.annotation.*;
27 13  
28   -import com.chinagas.common.core.web.page.TableDataInfo;
  14 +import java.util.List;
29 15  
30 16  
31 17 /**
... ... @@ -54,75 +40,101 @@ public class McConstructionController extends BaseController
54 40 }
55 41  
56 42  
57   - /**
58   - * 导出施工维护列表
59   - */
60   - @RequirePermission("schsf:mcConstruction:export")
61   - @Log(title = "施工维护",businessType = BusinessType.EXPORT)
62   - @PostMapping("/export")
63   - public void export(HttpServletResponse response,McConstruction mcConstruction) throws IOException {
64   - List<McConstruction> list = mcConstructionService.selectMcConstructionList(mcConstruction);
65   - try {
66   - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
67   - response.setCharacterEncoding("utf-8");
68   - // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
69   - String fileName = URLEncoder.encode("施工维护", "UTF-8").replaceAll("\\+", "%20");
70   - response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
71   - // 这里需要设置不关闭流
72   - EasyExcel.write(response.getOutputStream(), McConstruction.class).autoCloseStream(Boolean.FALSE).sheet("客户信息列表")
73   - .doWrite(list);
74   - } catch (Exception e) {
75   - // 重置response
76   - e.printStackTrace();
77   - response.reset();
78   - response.setContentType("application/json");
79   - response.setCharacterEncoding("utf-8");
80   - Map<String, String> map = MapUtils.newHashMap();
81   - map.put("status", "failure");
82   - map.put("message", "下载文件失败" + e.getMessage());
83   - response.getWriter().println(JSON.toJSONString(map));
84   - }
85   - }
86   - /**
87   - * 获取施工维护详细信息
88   - */
89   - @RequirePermission("schsf:mcConstruction:query")
90   - @GetMapping(value = "/{id}")
91   - public AjaxResult getInfo(@PathVariable("id") Long id)
92   - {
93   - return AjaxResult.success(mcConstructionService.selectMcConstructionById(id));
94   - }
95 43  
96 44 /**
97   - * 新增施工维护
  45 + * 新增点火维护
98 46 */
99   - @RequirePermission("schsf:mcConstruction:add")
100   - @Log(title = "施工维护", businessType = BusinessType.INSERT)
101   - @PostMapping
102   - public AjaxResult add(@RequestBody McConstruction mcConstruction)
103   - {
104   - return toAjax(mcConstructionService.insertMcConstruction(mcConstruction));
  47 + @RequirePermission("schsf:mcConstruction:engineering")
  48 + @Log(title = "施工维护", businessType = BusinessType.UPDATE)
  49 + @PostMapping("/engineering")
  50 + public AjaxResult engineering(@RequestBody McConstruction mcConstruction) throws CloneNotSupportedException {
  51 +
  52 + return toAjax(mcConstructionService.updateMcConstructionByEngineering(mcConstruction));
105 53 }
106 54  
107 55 /**
108   - * 修改施工维护
  56 + * 新增点火维护
109 57 */
110   - @RequirePermission("schsf:mcConstruction:edit")
  58 + @RequirePermission("schsf:mcConstruction:operations")
111 59 @Log(title = "施工维护", businessType = BusinessType.UPDATE)
112   - @PutMapping
113   - public AjaxResult edit(@RequestBody McConstruction mcConstruction)
114   - {
115   - return toAjax(mcConstructionService.updateMcConstruction(mcConstruction));
  60 + @PostMapping("/operations")
  61 + public AjaxResult operations(@RequestBody McConstruction mcConstruction) throws CloneNotSupportedException {
  62 + return toAjax(mcConstructionService.updateMcConstructionByOperations(mcConstruction));
116 63 }
117 64  
118   - /**
119   - * 删除施工维护
120   - */
121   - @RequirePermission("schsf:mcConstruction:remove")
122   - @Log(title = "施工维护", businessType = BusinessType.DELETE)
123   - @DeleteMapping("/{ids}")
124   - public AjaxResult remove(@PathVariable Long[] ids)
125   - {
126   - return toAjax(mcConstructionService.deleteMcConstructionByIds(ids));
127   - }
  65 +
  66 +
  67 +
  68 +//
  69 +// /**
  70 +// * 导出施工维护列表
  71 +// */
  72 +// @RequirePermission("schsf:mcConstruction:export")
  73 +// @Log(title = "施工维护",businessType = BusinessType.EXPORT)
  74 +// @PostMapping("/export")
  75 +// public void export(HttpServletResponse response,McConstruction mcConstruction) throws IOException {
  76 +// List<McConstruction> list = mcConstructionService.selectMcConstructionList(mcConstruction);
  77 +// try {
  78 +// response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
  79 +// response.setCharacterEncoding("utf-8");
  80 +// // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
  81 +// String fileName = URLEncoder.encode("施工维护", "UTF-8").replaceAll("\\+", "%20");
  82 +// response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
  83 +// // 这里需要设置不关闭流
  84 +// EasyExcel.write(response.getOutputStream(), McConstruction.class).autoCloseStream(Boolean.FALSE).sheet("客户信息列表")
  85 +// .doWrite(list);
  86 +// } catch (Exception e) {
  87 +// // 重置response
  88 +// e.printStackTrace();
  89 +// response.reset();
  90 +// response.setContentType("application/json");
  91 +// response.setCharacterEncoding("utf-8");
  92 +// Map<String, String> map = MapUtils.newHashMap();
  93 +// map.put("status", "failure");
  94 +// map.put("message", "下载文件失败" + e.getMessage());
  95 +// response.getWriter().println(JSON.toJSONString(map));
  96 +// }
  97 +// }
  98 +// /**
  99 +// * 获取施工维护详细信息
  100 +// */
  101 +// @RequirePermission("schsf:mcConstruction:query")
  102 +// @GetMapping(value = "/{id}")
  103 +// public AjaxResult getInfo(@PathVariable("id") Long id)
  104 +// {
  105 +// return AjaxResult.success(mcConstructionService.selectMcConstructionById(id));
  106 +// }
  107 +//
  108 +// /**
  109 +// * 新增施工维护
  110 +// */
  111 +// @RequirePermission("schsf:mcConstruction:add")
  112 +// @Log(title = "施工维护", businessType = BusinessType.INSERT)
  113 +// @PostMapping
  114 +// public AjaxResult add(@RequestBody McConstruction mcConstruction)
  115 +// {
  116 +// return toAjax(mcConstructionService.insertMcConstruction(mcConstruction));
  117 +// }
  118 +//
  119 +// /**
  120 +// * 修改施工维护
  121 +// */
  122 +// @RequirePermission("schsf:mcConstruction:edit")
  123 +// @Log(title = "施工维护", businessType = BusinessType.UPDATE)
  124 +// @PutMapping
  125 +// public AjaxResult edit(@RequestBody McConstruction mcConstruction)
  126 +// {
  127 +// return toAjax(mcConstructionService.updateMcConstruction(mcConstruction));
  128 +// }
  129 +//
  130 +// /**
  131 +// * 删除施工维护
  132 +// */
  133 +// @RequirePermission("schsf:mcConstruction:remove")
  134 +// @Log(title = "施工维护", businessType = BusinessType.DELETE)
  135 +// @DeleteMapping("/{ids}")
  136 +// public AjaxResult remove(@PathVariable Long[] ids)
  137 +// {
  138 +// return toAjax(mcConstructionService.deleteMcConstructionByIds(ids));
  139 +// }
128 140 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/controller/test.java
... ... @@ -6,11 +6,6 @@ import org.springframework.web.bind.annotation.GetMapping;
6 6 import org.springframework.web.bind.annotation.RequestMapping;
7 7 import org.springframework.web.bind.annotation.RestController;
8 8  
9   -import java.time.LocalDateTime;
10   -import java.time.format.DateTimeFormatter;
11   -import java.util.concurrent.ThreadLocalRandom;
12   -import java.util.concurrent.atomic.AtomicInteger;
13   -
14 9 @RestController
15 10 @RequestMapping("/test")
16 11 public class test {
... ... @@ -26,19 +21,18 @@ public class test {
26 21 return AjaxResult.success("成功2");
27 22 }
28 23 public static void main(String[] args) {
29   - for (int i = 0; i < 10; i++) {
30   - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS");
31   - AtomicInteger sequenceCounter = new AtomicInteger(0);
32   - // 获取当前的日期和时间,并格式化为字符串
33   - String timestamp = LocalDateTime.now().format(formatter);
34   - // 生成并格式化六位自增序列号
35   - int randomNum = ThreadLocalRandom.current().nextInt(1000000);
36   - String sequencePart = String.format("%06d", randomNum);
37   - // 合并时间戳和序列号以生成工单编号
38   - String s = timestamp + sequencePart;
39   - System.out.println(sequencePart);
40   - }
41   -
  24 +// for (int i = 0; i < 10; i++) {
  25 +// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS");
  26 +// AtomicInteger sequenceCounter = new AtomicInteger(0);
  27 +// // 获取当前的日期和时间,并格式化为字符串
  28 +// String timestamp = LocalDateTime.now().format(formatter);
  29 +// // 生成并格式化六位自增序列号
  30 +// int randomNum = ThreadLocalRandom.current().nextInt(1000000);
  31 +// String sequencePart = String.format("%06d", randomNum);
  32 +// // 合并时间戳和序列号以生成工单编号
  33 +// String s = timestamp + sequencePart;
  34 +// System.out.println(sequencePart);
  35 +// }
42 36 }
43 37  
44 38  
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/domain/McConstruction.java
1 1 package com.chinagas.modules.schsf.domain;
2 2  
3   -import java.util.Date;
4   -import com.fasterxml.jackson.annotation.JsonFormat;
5 3 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
6   -import org.apache.commons.lang3.builder.ToStringBuilder;
7   -import org.apache.commons.lang3.builder.ToStringStyle;
8 4 import com.alibaba.excel.annotation.ExcelProperty;
9 5 import com.chinagas.common.core.web.domain.BaseEntity;
  6 +import org.apache.commons.lang3.builder.ToStringBuilder;
  7 +import org.apache.commons.lang3.builder.ToStringStyle;
  8 +
  9 +import java.time.LocalDateTime;
10 10  
11 11 /**
12 12 * 施工维护对象 mc_construction
... ... @@ -15,7 +15,7 @@ import com.chinagas.common.core.web.domain.BaseEntity;
15 15 * @date 2024-05-30
16 16 */
17 17 @ExcelIgnoreUnannotated
18   -public class McConstruction extends BaseEntity
  18 +public class McConstruction extends BaseEntity implements Cloneable
19 19 {
20 20 private static final long serialVersionUID = 1L;
21 21  
... ... @@ -76,7 +76,7 @@ public class McConstruction extends BaseEntity
76 76  
77 77 /** 市场派单时间 */
78 78 @ExcelProperty(value = "市场派单时间")
79   - private Date assignmentTime;
  79 + private LocalDateTime assignmentTime;
80 80  
81 81 /** 是否竣工 */
82 82 @ExcelProperty(value = "是否竣工")
... ... @@ -84,7 +84,7 @@ public class McConstruction extends BaseEntity
84 84  
85 85 /** 竣工时间 */
86 86 @ExcelProperty(value = "竣工时间")
87   - private Date completionTime;
  87 + private LocalDateTime completionTime;
88 88  
89 89 /** 未竣工原因 */
90 90 @ExcelProperty(value = "未竣工原因")
... ... @@ -108,7 +108,7 @@ public class McConstruction extends BaseEntity
108 108  
109 109 /** 通气到表前/立管时间 */
110 110 @ExcelProperty(value = "通气到表前/立管时间")
111   - private Date gctMtrrisTime;
  111 + private LocalDateTime gctMtrrisTime;
112 112  
113 113 /** 未完成原因 */
114 114 @ExcelProperty(value = "未完成原因")
... ... @@ -256,12 +256,12 @@ public class McConstruction extends BaseEntity
256 256 {
257 257 return projectTypeCode;
258 258 }
259   - public void setAssignmentTime(Date assignmentTime)
  259 + public void setAssignmentTime(LocalDateTime assignmentTime)
260 260 {
261 261 this.assignmentTime = assignmentTime;
262 262 }
263 263  
264   - public Date getAssignmentTime()
  264 + public LocalDateTime getAssignmentTime()
265 265 {
266 266 return assignmentTime;
267 267 }
... ... @@ -274,12 +274,12 @@ public class McConstruction extends BaseEntity
274 274 {
275 275 return isCompleted;
276 276 }
277   - public void setCompletionTime(Date completionTime)
  277 + public void setCompletionTime(LocalDateTime completionTime)
278 278 {
279 279 this.completionTime = completionTime;
280 280 }
281 281  
282   - public Date getCompletionTime()
  282 + public LocalDateTime getCompletionTime()
283 283 {
284 284 return completionTime;
285 285 }
... ... @@ -328,12 +328,12 @@ public class McConstruction extends BaseEntity
328 328 {
329 329 return gasConnMtrRis;
330 330 }
331   - public void setGctMtrrisTime(Date gctMtrrisTime)
  331 + public void setGctMtrrisTime(LocalDateTime gctMtrrisTime)
332 332 {
333 333 this.gctMtrrisTime = gctMtrrisTime;
334 334 }
335 335  
336   - public Date getGctMtrrisTime()
  336 + public LocalDateTime getGctMtrrisTime()
337 337 {
338 338 return gctMtrrisTime;
339 339 }
... ... @@ -421,4 +421,10 @@ public class McConstruction extends BaseEntity
421 421 .append("defFlag", getDefFlag())
422 422 .toString();
423 423 }
  424 +
  425 +
  426 + @Override
  427 + public McConstruction clone() throws CloneNotSupportedException {
  428 + return (McConstruction) super.clone();
  429 + }
424 430 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/IMcConstructionService.java
1 1 package com.chinagas.modules.schsf.service;
2 2  
3   -import java.util.List;
  3 +import com.chinagas.modules.schsf.domain.McBasicCmty;
4 4 import com.chinagas.modules.schsf.domain.McConstruction;
5 5  
  6 +import java.util.List;
  7 +
6 8 /**
7 9 * 施工维护Service接口
8   - *
  10 + *
9 11 * @author cw
10 12 * @date 2024-05-30
11 13 */
12   -public interface IMcConstructionService
  14 +public interface IMcConstructionService
13 15 {
14 16 /**
15 17 * 查询施工维护
16   - *
  18 + *
17 19 * @param id 施工维护主键
18 20 * @return 施工维护
19 21 */
... ... @@ -21,7 +23,7 @@ public interface IMcConstructionService
21 23  
22 24 /**
23 25 * 查询施工维护列表
24   - *
  26 + *
25 27 * @param mcConstruction 施工维护
26 28 * @return 施工维护集合
27 29 */
... ... @@ -29,7 +31,7 @@ public interface IMcConstructionService
29 31  
30 32 /**
31 33 * 新增施工维护
32   - *
  34 + *
33 35 * @param mcConstruction 施工维护
34 36 * @return 结果
35 37 */
... ... @@ -37,7 +39,7 @@ public interface IMcConstructionService
37 39  
38 40 /**
39 41 * 修改施工维护
40   - *
  42 + *
41 43 * @param mcConstruction 施工维护
42 44 * @return 结果
43 45 */
... ... @@ -45,7 +47,7 @@ public interface IMcConstructionService
45 47  
46 48 /**
47 49 * 批量删除施工维护
48   - *
  50 + *
49 51 * @param ids 需要删除的施工维护主键集合
50 52 * @return 结果
51 53 */
... ... @@ -53,9 +55,34 @@ public interface IMcConstructionService
53 55  
54 56 /**
55 57 * 删除施工维护信息
56   - *
  58 + *
57 59 * @param id 施工维护主键
58 60 * @return 结果
59 61 */
60 62 public int deleteMcConstructionById(Long id);
  63 +
  64 +
  65 + /**
  66 + * 根据基础数据-户数 添加数据
  67 + * @param mcBasicCmty
  68 + * @return
  69 + */
  70 + public int insertMcConstructionByMcBasicCmty(McBasicCmty mcBasicCmty);
  71 +
  72 + /**
  73 + * 工程
  74 + * @param mcConstruction
  75 + * @return
  76 + * @throws CloneNotSupportedException
  77 + */
  78 + int updateMcConstructionByEngineering(McConstruction mcConstruction) throws CloneNotSupportedException;
  79 +
  80 +
  81 + /**
  82 + * 运营
  83 + * @param mcConstruction
  84 + * @return
  85 + * @throws CloneNotSupportedException
  86 + */
  87 + int updateMcConstructionByOperations(McConstruction mcConstruction) throws CloneNotSupportedException;
61 88 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McBasicCmtyServiceImpl.java
... ... @@ -8,6 +8,7 @@ import com.chinagas.modules.schsf.domain.dto.CompanyDto;
8 8 import com.chinagas.modules.schsf.domain.vo.McBasicCmtyVo;
9 9 import com.chinagas.modules.schsf.mapper.McBasicCmtyMapper;
10 10 import com.chinagas.modules.schsf.service.IMcBasicCmtyService;
  11 +import com.chinagas.modules.schsf.service.IMcConstructionService;
11 12 import org.springframework.beans.factory.annotation.Autowired;
12 13 import org.springframework.stereotype.Service;
13 14  
... ... @@ -24,6 +25,8 @@ public class McBasicCmtyServiceImpl implements IMcBasicCmtyService
24 25 {
25 26 @Autowired
26 27 private McBasicCmtyMapper mcBasicCmtyMapper;
  28 + @Autowired
  29 + private IMcConstructionService iMcConstructionService;
27 30  
28 31 /**
29 32 * 查询基础数据-户数
... ... @@ -63,7 +66,11 @@ public class McBasicCmtyServiceImpl implements IMcBasicCmtyService
63 66 mcBasicCmty.setCreateBy(SecurityUtils.getUserId().toString());
64 67 mcBasicCmty.setUpdateTime(DateUtils.getNowLocal());
65 68 mcBasicCmty.setUpdateBy(SecurityUtils.getUserId().toString());
66   - return mcBasicCmtyMapper.insertMcBasicCmty(mcBasicCmty);
  69 + int i = mcBasicCmtyMapper.insertMcBasicCmty(mcBasicCmty);
  70 + if (i>0){
  71 + iMcConstructionService.insertMcConstructionByMcBasicCmty(mcBasicCmty);
  72 + }
  73 + return i;
67 74 }
68 75  
69 76 /**
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McConstructionServiceImpl.java
1 1 package com.chinagas.modules.schsf.service.impl;
2 2  
3   -import java.util.List;
  3 +import com.alibaba.fastjson2.JSON;
4 4 import com.chinagas.common.core.utils.DateUtils;
5   -import org.springframework.beans.factory.annotation.Autowired;
6   -import org.springframework.stereotype.Service;
7   -import com.chinagas.modules.schsf.mapper.McConstructionMapper;
  5 +import com.chinagas.common.security.utils.SecurityUtils;
  6 +import com.chinagas.modules.schsf.domain.McBasicCmty;
8 7 import com.chinagas.modules.schsf.domain.McConstruction;
  8 +import com.chinagas.modules.schsf.mapper.McConstructionMapper;
9 9 import com.chinagas.modules.schsf.service.IMcConstructionService;
  10 +import com.chinagas.modules.schsf.service.IMcOperationLogService;
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.stereotype.Service;
  13 +import org.springframework.transaction.annotation.Transactional;
  14 +
  15 +import java.time.LocalDateTime;
  16 +import java.util.List;
10 17  
11 18 /**
12 19 * 施工维护Service业务层处理
13   - *
  20 + *
14 21 * @author cw
15 22 * @date 2024-05-30
16 23 */
  24 +@Transactional
17 25 @Service
18   -public class McConstructionServiceImpl implements IMcConstructionService
19   -{
  26 +public class McConstructionServiceImpl implements IMcConstructionService {
20 27 @Autowired
21 28 private McConstructionMapper mcConstructionMapper;
  29 + @Autowired
  30 + private IMcOperationLogService iMcOperationLogService;
22 31  
23 32 /**
24 33 * 查询施工维护
25   - *
  34 + *
26 35 * @param id 施工维护主键
27 36 * @return 施工维护
28 37 */
29 38 @Override
30   - public McConstruction selectMcConstructionById(Long id)
31   - {
  39 + public McConstruction selectMcConstructionById(Long id) {
32 40 return mcConstructionMapper.selectMcConstructionById(id);
33 41 }
34 42  
35 43 /**
36 44 * 查询施工维护列表
37   - *
  45 + *
38 46 * @param mcConstruction 施工维护
39 47 * @return 施工维护
40 48 */
41 49 @Override
42   - public List<McConstruction> selectMcConstructionList(McConstruction mcConstruction)
43   - {
  50 + public List<McConstruction> selectMcConstructionList(McConstruction mcConstruction) {
44 51 return mcConstructionMapper.selectMcConstructionList(mcConstruction);
45 52 }
46 53  
47 54 /**
48 55 * 新增施工维护
49   - *
  56 + *
50 57 * @param mcConstruction 施工维护
51 58 * @return 结果
52 59 */
53 60 @Override
54   - public int insertMcConstruction(McConstruction mcConstruction)
55   - {
  61 + public int insertMcConstruction(McConstruction mcConstruction) {
56 62 mcConstruction.setCreateTime(DateUtils.getNowLocal());
57 63 return mcConstructionMapper.insertMcConstruction(mcConstruction);
58 64 }
59 65  
60 66 /**
61 67 * 修改施工维护
62   - *
  68 + *
63 69 * @param mcConstruction 施工维护
64 70 * @return 结果
65 71 */
66 72 @Override
67   - public int updateMcConstruction(McConstruction mcConstruction)
68   - {
  73 + public int updateMcConstruction(McConstruction mcConstruction) {
69 74 mcConstruction.setUpdateTime(DateUtils.getNowLocal());
70 75 return mcConstructionMapper.updateMcConstruction(mcConstruction);
71 76 }
72 77  
73 78 /**
74 79 * 批量删除施工维护
75   - *
  80 + *
76 81 * @param ids 需要删除的施工维护主键
77 82 * @return 结果
78 83 */
79 84 @Override
80   - public int deleteMcConstructionByIds(Long[] ids)
81   - {
  85 + public int deleteMcConstructionByIds(Long[] ids) {
82 86 return mcConstructionMapper.deleteMcConstructionByIds(ids);
83 87 }
84 88  
85 89 /**
86 90 * 删除施工维护信息
87   - *
  91 + *
88 92 * @param id 施工维护主键
89 93 * @return 结果
90 94 */
91 95 @Override
92   - public int deleteMcConstructionById(Long id)
93   - {
  96 + public int deleteMcConstructionById(Long id) {
94 97 return mcConstructionMapper.deleteMcConstructionById(id);
95 98 }
  99 +
  100 + /**
  101 + * 根据小区信息新增施工维护
  102 + *
  103 + * @param mcBasicCmty
  104 + * @return
  105 + */
  106 + @Override
  107 + public int insertMcConstructionByMcBasicCmty(McBasicCmty mcBasicCmty) {
  108 + LocalDateTime time = DateUtils.getNowLocal();
  109 + String userId = SecurityUtils.getUserId().toString();
  110 + String userAccount = SecurityUtils.getUsername();
  111 + String userName = SecurityUtils.getLoginUser().getSysUser().getNickName();
  112 +
  113 + McConstruction mcConstruction = new McConstruction();
  114 + mcConstruction.setRegionName(mcBasicCmty.getRegionName());
  115 + mcConstruction.setGroupName(mcBasicCmty.getGroupName());
  116 + mcConstruction.setCompanyCode(mcBasicCmty.getCompanyCode());
  117 + mcConstruction.setCompanyName(mcBasicCmty.getCompanyName());
  118 + mcConstruction.setProvince(mcBasicCmty.getProvince());
  119 + mcConstruction.setCity(mcBasicCmty.getCity());
  120 + mcConstruction.setDistrict(mcBasicCmty.getDistrict());
  121 + mcConstruction.setStreet(mcBasicCmty.getStreet());
  122 + mcConstruction.setVlgOrCmty(mcBasicCmty.getVlgOrCmty());
  123 + List<McConstruction> mcConstructions = mcConstructionMapper.selectMcConstructionList(mcConstruction);
  124 + if (mcConstructions != null && !mcConstructions.isEmpty()) {
  125 + return 0;
  126 + }
  127 + mcConstruction.setUrbRurCls(mcBasicCmty.getUrbRurCls());
  128 + mcConstruction.setProjectTypeName(mcBasicCmty.getProjectTypeName());
  129 + mcConstruction.setProjectTypeCode(mcBasicCmty.getProjectTypeName().contains("已通气项目零散开发") ? "1" : "0");
  130 + mcConstruction.setIsCompleted("W");
  131 + mcConstruction.setGasConnMtrRis("W");
  132 +
  133 + mcConstruction.setCreateTime(time);
  134 + mcConstruction.setCreateBy(userId);
  135 + mcConstruction.setUpdateTime(time);
  136 + mcConstruction.setUpdateBy(userId);
  137 + mcConstruction.setCmtyId(mcBasicCmty.getId());
  138 +
  139 + int i = mcConstructionMapper.insertMcConstruction(mcConstruction);
  140 + //1:添加记录
  141 + iMcOperationLogService.insertMcOperationLog("mc_construction", mcConstruction.getId(), "施工维护",
  142 + userName, userAccount, userId, time,
  143 + "发起", "1", "导入基础数据-户数", null, JSON.toJSONString(mcConstruction));
  144 + return i;
  145 + }
  146 +
  147 + /**
  148 + * 施工维护-工程
  149 + *
  150 + * @param mcConstruction_param
  151 + * @return
  152 + * @throws CloneNotSupportedException
  153 + */
  154 + @Override
  155 + public int updateMcConstructionByEngineering(McConstruction mcConstruction_param) throws CloneNotSupportedException {
  156 + LocalDateTime time = DateUtils.getNowLocal();
  157 + Long userId = SecurityUtils.getUserId();
  158 + String userAccount = SecurityUtils.getUsername();
  159 + String userName = SecurityUtils.getLoginUser().getSysUser().getNickName();
  160 +
  161 + McConstruction mcConstruction_old = mcConstructionMapper.selectMcConstructionById(mcConstruction_param.getId());
  162 + McConstruction mcConstruction_new = mcConstruction_old.clone();
  163 + //是否已竣工
  164 + mcConstruction_new.setIsCompleted(mcConstruction_param.getIsCompleted());
  165 + //竣工时间
  166 + mcConstruction_new.setCompletionTime(mcConstruction_param.getCompletionTime());
  167 + //未竣工原因
  168 + mcConstruction_new.setNonNcmpRsn(mcConstruction_param.getNonNcmpRsn());
  169 + //市场派单时间
  170 + mcConstruction_new.setAssignmentTime(mcConstruction_param.getAssignmentTime());
  171 +
  172 + mcConstruction_new.setProjectPersonId(userId);
  173 + mcConstruction_new.setProjectPersonName(userName);
  174 + mcConstruction_new.setProjectPersonAccount(userAccount);
  175 + mcConstruction_new.setUpdateBy(userId.toString());
  176 + mcConstruction_new.setUpdateTime(time);
  177 + int i = mcConstructionMapper.updateMcConstruction(mcConstruction_new);
  178 +
  179 + iMcOperationLogService.insertMcOperationLog("mc_construction", mcConstruction_param.getId(), "施工维护-工程维护",
  180 + userName, userAccount, userId.toString(), time,
  181 + "工程维护", "1", null, JSON.toJSONString(mcConstruction_old), JSON.toJSONString(mcConstruction_new));
  182 + return i;
  183 + }
  184 +
  185 + /**
  186 + * 施工维护-运营
  187 + *
  188 + * @param mcConstruction_param
  189 + * @return
  190 + * @throws CloneNotSupportedException
  191 + */
  192 + @Override
  193 + public int updateMcConstructionByOperations(McConstruction mcConstruction_param) throws CloneNotSupportedException {
  194 + LocalDateTime time = DateUtils.getNowLocal();
  195 + Long userId = SecurityUtils.getUserId();
  196 + String userAccount = SecurityUtils.getUsername();
  197 + String userName = SecurityUtils.getLoginUser().getSysUser().getNickName();
  198 +
  199 + McConstruction mcConstruction_old = mcConstructionMapper.selectMcConstructionById(mcConstruction_param.getId());
  200 + McConstruction mcConstruction_new = mcConstruction_old.clone();
  201 + //是否通气到表前
  202 + mcConstruction_new.setGasConnMtrRis(mcConstruction_param.getGasConnMtrRis());
  203 + //市场派单时间
  204 + mcConstruction_new.setAssignmentTime(mcConstruction_param.getAssignmentTime());
  205 + //通气到表前
  206 + mcConstruction_new.setGctMtrrisTime(mcConstruction_param.getGctMtrrisTime());
  207 + //未完成原因
  208 + mcConstruction_new.setGctNcmpRsn(mcConstruction_param.getGctNcmpRsn());
  209 +
  210 + mcConstruction_new.setProjectPersonId(userId);
  211 + mcConstruction_new.setProjectPersonName(userName);
  212 + mcConstruction_new.setProjectPersonAccount(userAccount);
  213 + mcConstruction_new.setUpdateBy(userId.toString());
  214 + mcConstruction_new.setUpdateTime(time);
  215 + int i = mcConstructionMapper.updateMcConstruction(mcConstruction_new);
  216 + iMcOperationLogService.insertMcOperationLog("mc_construction", mcConstruction_param.getId(), "施工维护-运营维护",
  217 + userName, userAccount, userId.toString(), time,
  218 + "运营维护", "1", null, JSON.toJSONString(mcConstruction_old), JSON.toJSONString(mcConstruction_new));
  219 + return i;
  220 + }
96 221 }
... ...
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/service/impl/McIgnitionServiceImpl.java
... ... @@ -74,7 +74,7 @@ public class McIgnitionServiceImpl implements IMcIgnitionService {
74 74 mcIgnition.setUserCode(mcVisit.getUserCode());
75 75 mcIgnition.setUserName(mcVisit.getUserName());
76 76 mcIgnition.setUserPhone(mcVisit.getUserPhone());
77   - mcIgnition.setIgnCnfStatusCode("0");
  77 + mcIgnition.setIgnCnfStatusCode("W");
78 78  
79 79 mcIgnition.setCreateTime(time);
80 80 mcIgnition.setCreateBy(userId);
... ... @@ -87,7 +87,7 @@ public class McIgnitionServiceImpl implements IMcIgnitionService {
87 87 //1:添加记录
88 88 iMcOperationLogService.insertMcOperationLog("mc_ignition", mcIgnition.getId(), "点火维护",
89 89 userName,userAccount,userId, mcIgnition.getCreateTime(),
90   - "发起", "1", null, null, JSON.toJSONString(mcIgnition));
  90 + "发起", "1", "导入基础数据-户数", null, JSON.toJSONString(mcIgnition));
91 91 return i;
92 92 }
93 93  
... ...
zr-cloud/zr-modules/zr-schsf/src/main/resources/mapper/McBasicCmtyMapper.xml
... ... @@ -109,7 +109,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
109 109 where id = #{id}
110 110 </select>
111 111  
112   - <insert id="insertMcBasicCmty" parameterType="com.chinagas.modules.schsf.domain.McBasicCmty">
  112 + <insert id="insertMcBasicCmty" parameterType="com.chinagas.modules.schsf.domain.McBasicCmty" useGeneratedKeys="true" keyProperty="id">
113 113 insert into mc_basic_cmty
114 114 <trim prefix="(" suffix=")" suffixOverrides=",">
115 115 <if test="id != null">id,</if>
... ...
zr-cloud/zr-modules/zr-schsf/src/main/resources/mapper/McConstructionMapper.xml
... ... @@ -82,7 +82,7 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
82 82 where id = #{id}
83 83 </select>
84 84  
85   - <insert id="insertMcConstruction" parameterType="com.chinagas.modules.schsf.domain.McConstruction">
  85 + <insert id="insertMcConstruction" parameterType="com.chinagas.modules.schsf.domain.McConstruction" useGeneratedKeys="true" keyProperty="id">
86 86 insert into mc_construction
87 87 <trim prefix="(" suffix=")" suffixOverrides=",">
88 88 <if test="id != null">id,</if>
... ...