Commit 44363b21ef718ed4bda2f573d876557c13aa2409

Authored by 陈威
1 parent 89329db5
Exists in dev

基础信息-户数

zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/controller/McBasicCmtyController.java
@@ -45,7 +45,7 @@ public class McBasicCmtyController extends BaseController { @@ -45,7 +45,7 @@ public class McBasicCmtyController extends BaseController {
45 /** 45 /**
46 * 查询基础数据-户数列表 46 * 查询基础数据-户数列表
47 */ 47 */
48 -// @RequirePermission("schsf:mcBasicCmty:list") 48 + @RequirePermission("schsf:mcBasicCmty:list")
49 @GetMapping("/list") 49 @GetMapping("/list")
50 public TableDataInfo list(McBasicCmtyVo mcBasicCmtyVo) { 50 public TableDataInfo list(McBasicCmtyVo mcBasicCmtyVo) {
51 startPage(); 51 startPage();
@@ -54,7 +54,7 @@ public class McBasicCmtyController extends BaseController { @@ -54,7 +54,7 @@ public class McBasicCmtyController extends BaseController {
54 return getDataTable(list); 54 return getDataTable(list);
55 } 55 }
56 56
57 - 57 + @RequirePermission("schsf:mcBasicCmty:importData")
58 @PostMapping("/importData") 58 @PostMapping("/importData")
59 public AjaxResult importData(MultipartFile file) { 59 public AjaxResult importData(MultipartFile file) {
60 if (file.isEmpty()) { 60 if (file.isEmpty()) {
@@ -80,7 +80,7 @@ public class McBasicCmtyController extends BaseController { @@ -80,7 +80,7 @@ public class McBasicCmtyController extends BaseController {
80 80
81 // 检验重复数据 81 // 检验重复数据
82 Map<String, List<McBasicCmty>> collect = list.stream().collect(Collectors.groupingBy(o -> 82 Map<String, List<McBasicCmty>> collect = list.stream().collect(Collectors.groupingBy(o ->
83 - o.getRegionName() + 83 + o.getRegionName() +
84 o.getGroupName() + 84 o.getGroupName() +
85 o.getCompanyName() + 85 o.getCompanyName() +
86 o.getCompanyCode() 86 o.getCompanyCode()
@@ -116,10 +116,40 @@ public class McBasicCmtyController extends BaseController { @@ -116,10 +116,40 @@ public class McBasicCmtyController extends BaseController {
116 } 116 }
117 117
118 118
  119 + @RequirePermission("schsf:mcBasicCmty:exportTemplate")
  120 + @Log(title = "基础数据-户数", businessType = BusinessType.EXPORT)
  121 + @PostMapping("/exportTemplate")
  122 + public void exportTemplate(HttpServletResponse response) throws IOException {
  123 + McBasicCmtyVo mcBasicCmtyVo = new McBasicCmtyVo();
  124 + startPage();
  125 + mcBasicCmtyVo.setDefFlag("0");
  126 + List<McBasicCmty> list = mcBasicCmtyService.selectMcBasicCmtyList(mcBasicCmtyVo);
  127 + try {
  128 + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
  129 + response.setCharacterEncoding("utf-8");
  130 + // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
  131 + String fileName = URLEncoder.encode("基础数据-户数", "UTF-8").replaceAll("\\+", "%20");
  132 + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
  133 + // 这里需要设置不关闭流
  134 + EasyExcel.write(response.getOutputStream(), McBasicCmty.class).autoCloseStream(Boolean.FALSE).sheet("客户信息列表").doWrite(list);
  135 + } catch (Exception e) {
  136 + // 重置response
  137 + e.printStackTrace();
  138 + response.reset();
  139 + response.setContentType("application/json");
  140 + response.setCharacterEncoding("utf-8");
  141 + Map<String, String> map = MapUtils.newHashMap();
  142 + map.put("status", "failure");
  143 + map.put("message", "下载文件失败" + e.getMessage());
  144 + response.getWriter().println(JSON.toJSONString(map));
  145 + }
  146 + }
  147 +
  148 +
119 /** 149 /**
120 * 导出基础数据-户数列表 150 * 导出基础数据-户数列表
121 */ 151 */
122 -// @RequirePermission("schsf:mcBasicCmty:export") 152 + @RequirePermission("schsf:mcBasicCmty:export")
123 @Log(title = "基础数据-户数", businessType = BusinessType.EXPORT) 153 @Log(title = "基础数据-户数", businessType = BusinessType.EXPORT)
124 @PostMapping("/export") 154 @PostMapping("/export")
125 public void export(HttpServletResponse response, McBasicCmtyVo mcBasicCmtyVo) throws IOException { 155 public void export(HttpServletResponse response, McBasicCmtyVo mcBasicCmtyVo) throws IOException {
@@ -131,8 +161,7 @@ public class McBasicCmtyController extends BaseController { @@ -131,8 +161,7 @@ public class McBasicCmtyController extends BaseController {
131 String fileName = URLEncoder.encode("基础数据-户数", "UTF-8").replaceAll("\\+", "%20"); 161 String fileName = URLEncoder.encode("基础数据-户数", "UTF-8").replaceAll("\\+", "%20");
132 response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); 162 response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
133 // 这里需要设置不关闭流 163 // 这里需要设置不关闭流
134 - EasyExcel.write(response.getOutputStream(), McBasicCmty.class).autoCloseStream(Boolean.FALSE).sheet("客户信息列表")  
135 - .doWrite(list); 164 + EasyExcel.write(response.getOutputStream(), McBasicCmty.class).autoCloseStream(Boolean.FALSE).sheet("客户信息列表").doWrite(list);
136 } catch (Exception e) { 165 } catch (Exception e) {
137 // 重置response 166 // 重置response
138 e.printStackTrace(); 167 e.printStackTrace();
zr-cloud/zr-modules/zr-schsf/src/main/java/com/chinagas/modules/schsf/domain/McBasicCmty.java
@@ -25,23 +25,23 @@ public class McBasicCmty extends BaseEntity @@ -25,23 +25,23 @@ public class McBasicCmty extends BaseEntity
25 private Long fiscalYear; 25 private Long fiscalYear;
26 26
27 /** 区域名称 */ 27 /** 区域名称 */
28 - @ExcelProperty(index = 1,value = "区域名称") 28 + @ExcelProperty(index = 1,value = "区域")
29 private String regionName; 29 private String regionName;
30 30
31 /** 集团名称 */ 31 /** 集团名称 */
32 - @ExcelProperty(index = 2,value = "集团名称") 32 + @ExcelProperty(index = 2,value = "经管集团/直管公司")
33 private String groupName; 33 private String groupName;
34 34
35 /** 公司名称 */ 35 /** 公司名称 */
36 - @ExcelProperty(index = 3,value = "公司名称") 36 + @ExcelProperty(index = 3,value = "项目公司")
37 private String companyName; 37 private String companyName;
38 38
39 /** 公司代码 */ 39 /** 公司代码 */
40 - @ExcelProperty(index = 4,value = "公司代码") 40 + @ExcelProperty(index = 4,value = "项目公司代码(组织部门代码)")
41 private String companyCode; 41 private String companyCode;
42 42
43 /** 省 */ 43 /** 省 */
44 - @ExcelProperty(index = 5,value = "省") 44 + @ExcelProperty(index = 5,value = "省")
45 private String province; 45 private String province;
46 46
47 /** 市 */ 47 /** 市 */
@@ -53,11 +53,11 @@ public class McBasicCmty extends BaseEntity @@ -53,11 +53,11 @@ public class McBasicCmty extends BaseEntity
53 private String district; 53 private String district;
54 54
55 /** 街道 */ 55 /** 街道 */
56 - @ExcelProperty(index = 8,value = "街道") 56 + @ExcelProperty(index = 8,value = "乡镇/街道")
57 private String street; 57 private String street;
58 58
59 /** 村(小区) */ 59 /** 村(小区) */
60 - @ExcelProperty(index = 9,value = "村(小区)") 60 + @ExcelProperty(index = 9,value = "村/小区")
61 private String vlgOrCmty; 61 private String vlgOrCmty;
62 62
63 /** 负责人 */ 63 /** 负责人 */
@@ -69,7 +69,7 @@ public class McBasicCmty extends BaseEntity @@ -69,7 +69,7 @@ public class McBasicCmty extends BaseEntity
69 private String urbRurCls; 69 private String urbRurCls;
70 70
71 /** 项目类型名称 */ 71 /** 项目类型名称 */
72 - @ExcelProperty(index = 12,value = "项目类型名称") 72 + @ExcelProperty(index = 12,value = "项目类型")
73 private String projectTypeName; 73 private String projectTypeName;
74 74
75 /** 村/小区总户数 */ 75 /** 村/小区总户数 */
@@ -77,15 +77,15 @@ public class McBasicCmty extends BaseEntity @@ -77,15 +77,15 @@ public class McBasicCmty extends BaseEntity
77 private Long commHh; 77 private Long commHh;
78 78
79 /** 应收账款目标及完成-财年初财务确认应收账款户数 */ 79 /** 应收账款目标及完成-财年初财务确认应收账款户数 */
80 - @ExcelProperty(index = 14,value = "应收账款目标及完成-财年初财务确认应收账款户数") 80 + @ExcelProperty(index = 14,value = {"应收账款目标及完成","财年初财务确认应收账款户数"})
81 private Long acctFyStartConf; 81 private Long acctFyStartConf;
82 82
83 /** 应收账款目标及完成-往年应收在今年已回款户数 */ 83 /** 应收账款目标及完成-往年应收在今年已回款户数 */
84 - @ExcelProperty(index = 15,value = "应收账款目标及完成-往年应收在今年已回款户数") 84 + @ExcelProperty(index = 15,value = {"应收账款目标及完成","往年应收在今年已回款户数"})
85 private Long acctPrevRecov; 85 private Long acctPrevRecov;
86 86
87 /** 应收账款目标及完成-往年已收费户数 */ 87 /** 应收账款目标及完成-往年已收费户数 */
88 - @ExcelProperty(index = 16,value = "应收账款目标及完成-往年已收费户数") 88 + @ExcelProperty(index = 16,value = {"应收账款目标及完成","往年已收费户数"})
89 private Long acctPrevCharged; 89 private Long acctPrevCharged;
90 90
91 /** 本财年新增已回款户 */ 91 /** 本财年新增已回款户 */
@@ -101,71 +101,70 @@ public class McBasicCmty extends BaseEntity @@ -101,71 +101,70 @@ public class McBasicCmty extends BaseEntity
101 private Long qtrTargetCompany; 101 private Long qtrTargetCompany;
102 102
103 /** 纳入政府补贴户数-已收费户数 */ 103 /** 纳入政府补贴户数-已收费户数 */
104 - @ExcelProperty(index = 20,value = "纳入政府补贴户数-已收费户数") 104 + @ExcelProperty(index = 20,value = {"纳入政府补贴户数","已收费户数"})
105 private Long hhGsgCharged; 105 private Long hhGsgCharged;
106 106
107 /** 纳入政府补贴户数-未收费户数 */ 107 /** 纳入政府补贴户数-未收费户数 */
108 - @ExcelProperty(index = 21,value = "纳入政府补贴户数-未收费户数") 108 + @ExcelProperty(index = 21,value = {"纳入政府补贴户数","未收费户数"})
109 private Long hhGsgUncharged; 109 private Long hhGsgUncharged;
110 110
111 /** 纳入政府补贴户数-合计 */ 111 /** 纳入政府补贴户数-合计 */
112 - @ExcelProperty(index = 22,value = "纳入政府补贴户数-合计") 112 + @ExcelProperty(index = 22,value = "合计")
113 private Long hhGsgTotal; 113 private Long hhGsgTotal;
114 114
115 /** 市场化收费户数-新增户数(财务字段)全款户数 */ 115 /** 市场化收费户数-新增户数(财务字段)全款户数 */
116 - @ExcelProperty(index = 23,value = "市场化收费户数-新增户数(财务字段)全款户数") 116 + @ExcelProperty(index = 23,value = {"市场化收费户数","新增户数(财务字段)","全款户数"})
117 private Long hhNewFull; 117 private Long hhNewFull;
118 118
119 /** 市场化收费户数-新增户数(财务字段)分期/定金户数 */ 119 /** 市场化收费户数-新增户数(财务字段)分期/定金户数 */
120 - @ExcelProperty(index = 24,value = "市场化收费户数-新增户数(财务字段)分期/定金户数") 120 + @ExcelProperty(index = 24,value = {"市场化收费户数","新增户数(财务字段)","分期/定金户数"})
121 private Long hhNewInstall; 121 private Long hhNewInstall;
122 122
123 /** 市场化收费户数-往年应收户数(财务字段)全款户数 */ 123 /** 市场化收费户数-往年应收户数(财务字段)全款户数 */
124 - @ExcelProperty(index = 25,value = "市场化收费户数-往年应收户数(财务字段)全款户数") 124 + @ExcelProperty(index = 25,value = {"市场化收费户数","往年应收户数(财务字段)","已收费户数","全款户数"})
125 private Long hhPrevFull; 125 private Long hhPrevFull;
126 126
127 /** 市场化收费户数-往年应收户数(财务字段)分期/定金户数 */ 127 /** 市场化收费户数-往年应收户数(财务字段)分期/定金户数 */
128 - @ExcelProperty(index = 26,value = "市场化收费户数-往年应收户数(财务字段)分期/定金户数") 128 + @ExcelProperty(index = 26,value = {"市场化收费户数","往年应收户数(财务字段)","已收费户数","分期/定金户数"})
129 private Long hhPrevInstDp; 129 private Long hhPrevInstDp;
130 130
131 /** 市场化收费户数-未收费户数 */ 131 /** 市场化收费户数-未收费户数 */
132 - @ExcelProperty(index = 27,value = "市场化收费户数-未收费户数") 132 + @ExcelProperty(index = 27,value = {"市场化收费户数","往年应收户数(财务字段)","未收费户数"})
133 private Long hhUnchg; 133 private Long hhUnchg;
134 134
135 /** 暂不可收费户数-其中:提前确认 */ 135 /** 暂不可收费户数-其中:提前确认 */
136 - @ExcelProperty(index = 28,value = "暂不可收费户数-其中:提前确认") 136 + @ExcelProperty(index = 28,value = {"市场化收费户数","其中:提前确认"})
137 private Long hhUnchgConf; 137 private Long hhUnchgConf;
138 138
139 /** 暂不可收费户数-其中:纳入扫雷 */ 139 /** 暂不可收费户数-其中:纳入扫雷 */
140 - @ExcelProperty(index = 29,value = "暂不可收费户数-其中:纳入扫雷") 140 + @ExcelProperty(index = 29,value = {"市场化收费户数","其中:纳入扫雷"})
141 private Long hhUnchgScan; 141 private Long hhUnchgScan;
142 142
143 /** 评价指标-市场化累计回款户数 */ 143 /** 评价指标-市场化累计回款户数 */
144 - @ExcelProperty(index = 30,value = "评价指标-市场化累计回款户数") 144 + @ExcelProperty(index = 30,value = {"评价指标","市场化累计回款户数"})
145 private Long hhEvCumPaid; 145 private Long hhEvCumPaid;
146 146
147 /** 评价指标-其中:分期/定金户数 */ 147 /** 评价指标-其中:分期/定金户数 */
148 - @ExcelProperty(index = 31,value = "评价指标-其中:分期/定金户数") 148 + @ExcelProperty(index = 31,value = {"评价指标","其中:分期/定金户数"})
149 private Long hhEvInst; 149 private Long hhEvInst;
150 150
151 /** 评价指标-其中:全款户数 */ 151 /** 评价指标-其中:全款户数 */
152 - @ExcelProperty(index = 32,value = "评价指标-其中:全款户数") 152 + @ExcelProperty(index = 32,value = {"评价指标","其中:全款户数"})
153 private Long hhEvFull; 153 private Long hhEvFull;
154 154
155 /** 评价指标-点火户数 */ 155 /** 评价指标-点火户数 */
156 - @ExcelProperty(index = 33,value = "评价指标-点火户数") 156 + @ExcelProperty(index = 33,value = {"评价指标","点火户数"})
157 private Long hhEvIgnite; 157 private Long hhEvIgnite;
158 158
159 /** 评价指标-累计报装率 */ 159 /** 评价指标-累计报装率 */
160 - @ExcelProperty(index = 34,value = "评价指标-累计报装率") 160 + @ExcelProperty(index = 34,value = {"评价指标","累计报装率"})
161 private Long hhEvCumSetup; 161 private Long hhEvCumSetup;
162 162
163 /** 评价指标-累计气化率 */ 163 /** 评价指标-累计气化率 */
164 - @ExcelProperty(index = 35,value = "评价指标-累计气化率") 164 + @ExcelProperty(index = 35,value = {"评价指标","累计气化率"})
165 private Long hhEvCumGas; 165 private Long hhEvCumGas;
166 166
167 /** 删除标志(0:未删除,1:已删除) */ 167 /** 删除标志(0:未删除,1:已删除) */
168 - @ExcelProperty(value = "删除标志")  
169 private String defFlag; 168 private String defFlag;
170 169
171 public void setId(Long id) 170 public void setId(Long id)