@epoint-testtech/ep-stage-skill 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/codex-skill/ep-stage/code-list-generate/SKILL.md +168 -0
- package/codex-skill/ep-stage/code-list-generate/assets/code_list.template.json5 +325 -0
- package/codex-skill/ep-stage/code-list-generate/assets/example-zwplace.json5 +588 -0
- package/codex-skill/ep-stage/code-list-generate/evals/evals.json +47 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/action/SchemeResourceAddAction.java +119 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/action/SchemeResourceDetailAction.java +70 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/action/SchemeResourceEditAction.java +107 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/action/SchemeResourceListAction.java +167 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/api/ISchemeResourceService.java +84 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/api/entity/SchemeResource.java +218 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/impl/SchemeResourceService.java +146 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/java/com/epoint/schemeresource/impl/SchemeResourceServiceImpl.java +110 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/webapp/perpage/schemeresource/schemeresourceadd.html +158 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/webapp/perpage/schemeresource/schemeresourcedetail.html +89 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/webapp/perpage/schemeresource/schemeresourceedit.html +125 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/schemeresource-req/src/main/webapp/perpage/schemeresource/schemeresourcelist.html +224 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/docs//345/234/272/346/211/200/347/252/227/345/217/243/344/277/241/346/201/257/347/256/241/347/220/206/345/217/212/345/220/204/347/253/257/347/273/237/350/256/241/346/243/200/347/264/242/346/237/245/347/234/213_prd.md +602 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/action/GxhZwPlaceAddAction.java +210 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/action/GxhZwPlaceDetailAction.java +69 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/action/GxhZwPlaceEditAction.java +235 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/action/GxhZwPlaceListAction.java +145 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/api/IGxhZwPlaceService.java +87 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/api/entity/GxhZwPlace.java +306 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/api/entity/GxhZwPlaceHistory.java +205 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/api/entity/GxhZwWindow.java +184 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/impl/GxhZwPlaceService.java +151 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/java/com/epoint/zwplace/impl/GxhZwPlaceServiceImpl.java +96 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/webapp/perpage/zwplace/gxhzwplaceadd.html +253 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/webapp/perpage/zwplace/gxhzwplacedetail.html +146 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/webapp/perpage/zwplace/gxhzwplaceedit.html +275 -0
- package/codex-skill/ep-stage/code-list-generate/evals/fixtures/zwplace-req/src/main/webapp/perpage/zwplace/gxhzwplacelist.html +168 -0
- package/codex-skill/ep-stage/code-list-generate/evals/grade-code-list.mjs +184 -0
- package/codex-skill/ep-stage/code-list-generate/references/epoint-extraction.md +106 -0
- package/codex-skill/ep-stage/code-list-generate/references/field-contract.md +122 -0
- package/codex-skill/ep-stage/code-list-generate/scripts/validate-code-list.mjs +202 -0
- package/codex-skill/ep-stage/glue-create-project/SKILL.md +227 -223
- package/dist/src/cli/index.js +0 -0
- package/dist/src/extractors/code-list-json5.d.ts +5 -0
- package/dist/src/extractors/code-list-json5.d.ts.map +1 -1
- package/dist/src/generators/stage-skeleton-script.d.ts +4 -0
- package/dist/src/generators/stage-skeleton-script.d.ts.map +1 -1
- package/dist/src/generators/stage-skeleton-script.js +389 -362
- package/dist/src/testcase/contract-testcase-assembler.d.ts +10 -1
- package/dist/src/testcase/contract-testcase-assembler.d.ts.map +1 -1
- package/dist/src/testcase/contract-testcase-assembler.js +80 -21
- package/package.json +14 -12
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 场所信息管理新增页面对应的后台
|
|
3
|
+
*
|
|
4
|
+
* @generated by zw-crud-gen (F9)
|
|
5
|
+
*/
|
|
6
|
+
package com.epoint.zwplace.action;
|
|
7
|
+
|
|
8
|
+
import java.util.ArrayList;
|
|
9
|
+
import java.util.Date;
|
|
10
|
+
import java.util.HashMap;
|
|
11
|
+
import java.util.List;
|
|
12
|
+
import java.util.Map;
|
|
13
|
+
import java.util.UUID;
|
|
14
|
+
|
|
15
|
+
import org.springframework.beans.factory.annotation.Autowired;
|
|
16
|
+
import org.springframework.context.annotation.Scope;
|
|
17
|
+
import org.springframework.web.bind.annotation.RestController;
|
|
18
|
+
|
|
19
|
+
import com.alibaba.fastjson.JSON;
|
|
20
|
+
import com.alibaba.fastjson.JSONArray;
|
|
21
|
+
import com.alibaba.fastjson.JSONObject;
|
|
22
|
+
import com.epoint.zwplace.api.IGxhZwPlaceService;
|
|
23
|
+
import com.epoint.zwplace.api.entity.GxhZwPlace;
|
|
24
|
+
import com.epoint.zwplace.api.entity.GxhZwWindow;
|
|
25
|
+
import com.epoint.basic.controller.BaseController;
|
|
26
|
+
import com.epoint.basic.faces.util.DataUtil;
|
|
27
|
+
import com.epoint.core.dto.model.SelectItem;
|
|
28
|
+
import com.epoint.core.utils.sql.SqlConditionUtil;
|
|
29
|
+
import com.epoint.frame.service.metadata.mis.util.CodeModalFactory;
|
|
30
|
+
|
|
31
|
+
@RestController("gxhzwplaceaddaction")
|
|
32
|
+
@Scope("request")
|
|
33
|
+
public class GxhZwPlaceAddAction extends BaseController {
|
|
34
|
+
|
|
35
|
+
@Autowired
|
|
36
|
+
private IGxhZwPlaceService service;
|
|
37
|
+
|
|
38
|
+
private GxhZwPlace dataBean = null;
|
|
39
|
+
|
|
40
|
+
private List<SelectItem> placecategoryModel = null;
|
|
41
|
+
private List<SelectItem> districtModel = null;
|
|
42
|
+
private List<SelectItem> iscommunityModel = null;
|
|
43
|
+
private List<SelectItem> windowtypeModel = null;
|
|
44
|
+
|
|
45
|
+
public void pageLoad() {
|
|
46
|
+
dataBean = new GxhZwPlace();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 保存草稿
|
|
51
|
+
*/
|
|
52
|
+
public void saveDraft(String windows) {
|
|
53
|
+
if (!checkPlacenameUnique(null)) {
|
|
54
|
+
addCallbackParam("error", "场所名称已存在!");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
dataBean.setRowguid(UUID.randomUUID().toString());
|
|
58
|
+
dataBean.setOperatedate(new Date());
|
|
59
|
+
dataBean.setOperateusername(userSession.getDisplayName());
|
|
60
|
+
dataBean.setOperateuserguid(userSession.getUserGuid());
|
|
61
|
+
dataBean.setStatus("DRAFT");
|
|
62
|
+
dataBean.setDatasource("MANUAL");
|
|
63
|
+
service.insert(dataBean);
|
|
64
|
+
saveWindows(windows, dataBean.getRowguid());
|
|
65
|
+
addCallbackParam("msg", "保存成功!");
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 保存并关闭(状态为在用,版本为V1)
|
|
70
|
+
*/
|
|
71
|
+
public void add(String windows) {
|
|
72
|
+
if (!checkPlacenameUnique(null)) {
|
|
73
|
+
addCallbackParam("error", "场所名称已存在!");
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
dataBean.setRowguid(UUID.randomUUID().toString());
|
|
77
|
+
dataBean.setOperatedate(new Date());
|
|
78
|
+
dataBean.setOperateusername(userSession.getDisplayName());
|
|
79
|
+
dataBean.setOperateuserguid(userSession.getUserGuid());
|
|
80
|
+
dataBean.setStatus("ACTIVE");
|
|
81
|
+
dataBean.setVersion("V1");
|
|
82
|
+
dataBean.setDatasource("MANUAL");
|
|
83
|
+
service.insert(dataBean);
|
|
84
|
+
saveWindows(windows, dataBean.getRowguid());
|
|
85
|
+
addCallbackParam("msg", "保存成功!");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* 检查场所名称唯一性
|
|
90
|
+
*/
|
|
91
|
+
private boolean checkPlacenameUnique(String excludeGuid) {
|
|
92
|
+
SqlConditionUtil sUtil = new SqlConditionUtil();
|
|
93
|
+
sUtil.eq("placename", dataBean.getPlacename());
|
|
94
|
+
int count = service.countGxhZwPlace(sUtil.getMap());
|
|
95
|
+
if (count == 0) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
if (excludeGuid != null && count == 1) {
|
|
99
|
+
GxhZwPlace existPlace = service.find(sUtil.getMap());
|
|
100
|
+
if (existPlace != null && excludeGuid.equals(existPlace.getRowguid())) {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 保存窗口信息
|
|
109
|
+
*/
|
|
110
|
+
private void saveWindows(String windows, String placeguid) {
|
|
111
|
+
if (windows == null || windows.isEmpty()) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
JSONArray jsonArray = JSON.parseArray(windows);
|
|
115
|
+
for (int i = 0; i < jsonArray.size(); i++) {
|
|
116
|
+
JSONObject obj = jsonArray.getJSONObject(i);
|
|
117
|
+
GxhZwWindow window = new GxhZwWindow();
|
|
118
|
+
window.setRowguid(UUID.randomUUID().toString());
|
|
119
|
+
window.setPlaceguid(placeguid);
|
|
120
|
+
window.setWindowname(obj.getString("windowname"));
|
|
121
|
+
window.setWindowtype(obj.getString("windowtype"));
|
|
122
|
+
window.setWindowaddress(obj.getString("windowaddress"));
|
|
123
|
+
window.setOperatedate(new Date());
|
|
124
|
+
window.setOperateusername(userSession.getDisplayName());
|
|
125
|
+
window.setOperateuserguid(userSession.getUserGuid());
|
|
126
|
+
service.insertWindow(window);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 获取街道列表
|
|
132
|
+
*/
|
|
133
|
+
public void getStreetList(String districtname) {
|
|
134
|
+
List<SelectItem> list = new ArrayList<SelectItem>();
|
|
135
|
+
SqlConditionUtil sUtil = new SqlConditionUtil();
|
|
136
|
+
sUtil.eq("districtname", districtname);
|
|
137
|
+
sUtil.setOrderAsc("streetname");
|
|
138
|
+
List<HashMap<String, Object>> streets = service.findStreetList(sUtil.getMap());
|
|
139
|
+
for (Map<String, Object> street : streets) {
|
|
140
|
+
SelectItem item = new SelectItem();
|
|
141
|
+
item.setValue((String) street.get("streetname"));
|
|
142
|
+
item.setText((String) street.get("streetname"));
|
|
143
|
+
list.add(item);
|
|
144
|
+
}
|
|
145
|
+
addCallbackParam("list", list);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
public GxhZwPlace getDataBean() {
|
|
149
|
+
if (dataBean == null) {
|
|
150
|
+
dataBean = new GxhZwPlace();
|
|
151
|
+
}
|
|
152
|
+
return dataBean;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
public void setDataBean(GxhZwPlace dataBean) {
|
|
156
|
+
this.dataBean = dataBean;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@SuppressWarnings("unchecked")
|
|
160
|
+
public List<SelectItem> getPlacecategoryModel() {
|
|
161
|
+
if (placecategoryModel == null) {
|
|
162
|
+
placecategoryModel = DataUtil.convertMap2ComboBox(
|
|
163
|
+
(List<Map<String, String>>) CodeModalFactory.factory("下拉列表", "场所分类", null, true));
|
|
164
|
+
}
|
|
165
|
+
return placecategoryModel;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
public List<SelectItem> getDistrictModel() {
|
|
169
|
+
if (districtModel == null) {
|
|
170
|
+
districtModel = new ArrayList<SelectItem>();
|
|
171
|
+
String[] districts = {"黄浦区", "徐汇区", "长宁区", "静安区", "普陀区", "虹口区", "杨浦区", "闵行区", "宝山区", "嘉定区", "浦东新区", "金山区", "松江区", "青浦区", "奉贤区", "崇明区"};
|
|
172
|
+
for (String district : districts) {
|
|
173
|
+
SelectItem item = new SelectItem();
|
|
174
|
+
item.setValue(district);
|
|
175
|
+
item.setText(district);
|
|
176
|
+
districtModel.add(item);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return districtModel;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
public List<SelectItem> getIscommunityModel() {
|
|
183
|
+
if (iscommunityModel == null) {
|
|
184
|
+
iscommunityModel = new ArrayList<SelectItem>();
|
|
185
|
+
SelectItem item1 = new SelectItem();
|
|
186
|
+
item1.setValue("是");
|
|
187
|
+
item1.setText("是");
|
|
188
|
+
iscommunityModel.add(item1);
|
|
189
|
+
SelectItem item2 = new SelectItem();
|
|
190
|
+
item2.setValue("否");
|
|
191
|
+
item2.setText("否");
|
|
192
|
+
iscommunityModel.add(item2);
|
|
193
|
+
}
|
|
194
|
+
return iscommunityModel;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@SuppressWarnings("unchecked")
|
|
198
|
+
public List<SelectItem> getWindowtypeModel() {
|
|
199
|
+
if (windowtypeModel == null) {
|
|
200
|
+
windowtypeModel = DataUtil.convertMap2ComboBox(
|
|
201
|
+
(List<Map<String, String>>) CodeModalFactory.factory("下拉列表", "窗口类型", null, true));
|
|
202
|
+
}
|
|
203
|
+
return windowtypeModel;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
public void getWindowtypeData() {
|
|
207
|
+
List<SelectItem> list = getWindowtypeModel();
|
|
208
|
+
addCallbackParam("list", list);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 场所信息管理详情页面对应的后台
|
|
3
|
+
*
|
|
4
|
+
* @generated by zw-crud-gen (F9)
|
|
5
|
+
*/
|
|
6
|
+
package com.epoint.zwplace.action;
|
|
7
|
+
|
|
8
|
+
import java.util.ArrayList;
|
|
9
|
+
import java.util.List;
|
|
10
|
+
import java.util.Map;
|
|
11
|
+
|
|
12
|
+
import org.springframework.beans.factory.annotation.Autowired;
|
|
13
|
+
import org.springframework.context.annotation.Scope;
|
|
14
|
+
import org.springframework.web.bind.annotation.RestController;
|
|
15
|
+
|
|
16
|
+
import com.epoint.zwplace.api.IGxhZwPlaceService;
|
|
17
|
+
import com.epoint.zwplace.api.entity.GxhZwPlace;
|
|
18
|
+
import com.epoint.zwplace.api.entity.GxhZwWindow;
|
|
19
|
+
import com.epoint.basic.controller.BaseController;
|
|
20
|
+
import com.epoint.basic.faces.util.DataUtil;
|
|
21
|
+
import com.epoint.core.dto.model.SelectItem;
|
|
22
|
+
import com.epoint.frame.service.metadata.mis.util.CodeModalFactory;
|
|
23
|
+
|
|
24
|
+
@RestController("gxhzwplacedetailaction")
|
|
25
|
+
@Scope("request")
|
|
26
|
+
public class GxhZwPlaceDetailAction extends BaseController {
|
|
27
|
+
|
|
28
|
+
@Autowired
|
|
29
|
+
private IGxhZwPlaceService service;
|
|
30
|
+
|
|
31
|
+
private GxhZwPlace dataBean = null;
|
|
32
|
+
private List<GxhZwWindow> windowList = null;
|
|
33
|
+
private List<SelectItem> windowtypeModel = null;
|
|
34
|
+
|
|
35
|
+
public void pageLoad() {
|
|
36
|
+
String guid = getRequestParameter("guid");
|
|
37
|
+
dataBean = service.find(guid);
|
|
38
|
+
if (dataBean == null) {
|
|
39
|
+
dataBean = new GxhZwPlace();
|
|
40
|
+
}
|
|
41
|
+
windowList = service.findWindowList(guid);
|
|
42
|
+
addCallbackParam("windowList", windowList);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public GxhZwPlace getDataBean() {
|
|
46
|
+
if (dataBean == null) {
|
|
47
|
+
dataBean = new GxhZwPlace();
|
|
48
|
+
}
|
|
49
|
+
return dataBean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public void setDataBean(GxhZwPlace dataBean) {
|
|
53
|
+
this.dataBean = dataBean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@SuppressWarnings("unchecked")
|
|
57
|
+
public List<SelectItem> getWindowtypeModel() {
|
|
58
|
+
if (windowtypeModel == null) {
|
|
59
|
+
windowtypeModel = DataUtil.convertMap2ComboBox(
|
|
60
|
+
(List<Map<String, String>>) CodeModalFactory.factory("下拉列表", "窗口类型", null, true));
|
|
61
|
+
}
|
|
62
|
+
return windowtypeModel;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public void getWindowtypeData() {
|
|
66
|
+
List<SelectItem> list = getWindowtypeModel();
|
|
67
|
+
addCallbackParam("list", list);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 场所信息管理修改页面对应的后台
|
|
3
|
+
*
|
|
4
|
+
* @generated by zw-crud-gen (F9)
|
|
5
|
+
*/
|
|
6
|
+
package com.epoint.zwplace.action;
|
|
7
|
+
|
|
8
|
+
import java.util.ArrayList;
|
|
9
|
+
import java.util.Date;
|
|
10
|
+
import java.util.HashMap;
|
|
11
|
+
import java.util.List;
|
|
12
|
+
import java.util.Map;
|
|
13
|
+
import java.util.UUID;
|
|
14
|
+
|
|
15
|
+
import org.springframework.beans.factory.annotation.Autowired;
|
|
16
|
+
import org.springframework.context.annotation.Scope;
|
|
17
|
+
import org.springframework.web.bind.annotation.RestController;
|
|
18
|
+
|
|
19
|
+
import com.alibaba.fastjson.JSON;
|
|
20
|
+
import com.alibaba.fastjson.JSONArray;
|
|
21
|
+
import com.alibaba.fastjson.JSONObject;
|
|
22
|
+
import com.epoint.zwplace.api.IGxhZwPlaceService;
|
|
23
|
+
import com.epoint.zwplace.api.entity.GxhZwPlace;
|
|
24
|
+
import com.epoint.zwplace.api.entity.GxhZwWindow;
|
|
25
|
+
import com.epoint.basic.controller.BaseController;
|
|
26
|
+
import com.epoint.basic.faces.util.DataUtil;
|
|
27
|
+
import com.epoint.core.dto.model.SelectItem;
|
|
28
|
+
import com.epoint.core.utils.sql.SqlConditionUtil;
|
|
29
|
+
import com.epoint.frame.service.metadata.mis.util.CodeModalFactory;
|
|
30
|
+
|
|
31
|
+
@RestController("gxhzwplaceeditaction")
|
|
32
|
+
@Scope("request")
|
|
33
|
+
public class GxhZwPlaceEditAction extends BaseController {
|
|
34
|
+
|
|
35
|
+
@Autowired
|
|
36
|
+
private IGxhZwPlaceService service;
|
|
37
|
+
|
|
38
|
+
private GxhZwPlace dataBean = null;
|
|
39
|
+
private List<GxhZwWindow> windowList = null;
|
|
40
|
+
|
|
41
|
+
private List<SelectItem> placecategoryModel = null;
|
|
42
|
+
private List<SelectItem> districtModel = null;
|
|
43
|
+
private List<SelectItem> iscommunityModel = null;
|
|
44
|
+
private List<SelectItem> windowtypeModel = null;
|
|
45
|
+
|
|
46
|
+
public void pageLoad() {
|
|
47
|
+
String guid = getRequestParameter("guid");
|
|
48
|
+
dataBean = service.find(guid);
|
|
49
|
+
if (dataBean == null) {
|
|
50
|
+
dataBean = new GxhZwPlace();
|
|
51
|
+
}
|
|
52
|
+
windowList = service.findWindowList(guid);
|
|
53
|
+
addCallbackParam("windowList", windowList);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 保存草稿(版本号不变,状态不变)
|
|
58
|
+
*/
|
|
59
|
+
public void saveDraft(String windows) {
|
|
60
|
+
if (dataBean == null || dataBean.getRowguid() == null) {
|
|
61
|
+
addCallbackParam("error", "数据加载失败,请刷新页面重试!");
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (!checkPlacenameUnique(dataBean.getRowguid())) {
|
|
65
|
+
addCallbackParam("error", "场所名称已存在!");
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
dataBean.setOperatedate(new Date());
|
|
69
|
+
service.update(dataBean);
|
|
70
|
+
updateWindows(windows, dataBean.getRowguid());
|
|
71
|
+
addCallbackParam("msg", "保存成功!");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 保存并关闭(版本号+1,历史数据归档,草稿状态改为在用)
|
|
76
|
+
*/
|
|
77
|
+
public void save(String windows) {
|
|
78
|
+
if (dataBean == null || dataBean.getRowguid() == null) {
|
|
79
|
+
addCallbackParam("error", "数据加载失败,请刷新页面重试!");
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (!checkPlacenameUnique(dataBean.getRowguid())) {
|
|
83
|
+
addCallbackParam("error", "场所名称已存在!");
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
service.archivePlace(dataBean.getRowguid());
|
|
87
|
+
String version = dataBean.getVersion();
|
|
88
|
+
if (version == null || version.isEmpty()) {
|
|
89
|
+
version = "V0";
|
|
90
|
+
}
|
|
91
|
+
int versionNum = 0;
|
|
92
|
+
try {
|
|
93
|
+
if (version.startsWith("V")) {
|
|
94
|
+
versionNum = Integer.parseInt(version.substring(1));
|
|
95
|
+
} else {
|
|
96
|
+
versionNum = Integer.parseInt(version);
|
|
97
|
+
}
|
|
98
|
+
} catch (NumberFormatException e) {
|
|
99
|
+
versionNum = 0;
|
|
100
|
+
}
|
|
101
|
+
dataBean.setVersion("V" + (versionNum + 1));
|
|
102
|
+
// 如果是草稿状态,则改为在用状态
|
|
103
|
+
if ("DRAFT".equals(dataBean.getStatus()) || "草稿".equals(dataBean.getStatus())) {
|
|
104
|
+
dataBean.setStatus("ACTIVE");
|
|
105
|
+
}
|
|
106
|
+
dataBean.setOperatedate(new Date());
|
|
107
|
+
service.update(dataBean);
|
|
108
|
+
updateWindows(windows, dataBean.getRowguid());
|
|
109
|
+
addCallbackParam("msg", "保存成功!");
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 检查场所名称唯一性
|
|
114
|
+
*/
|
|
115
|
+
private boolean checkPlacenameUnique(String excludeGuid) {
|
|
116
|
+
SqlConditionUtil sUtil = new SqlConditionUtil();
|
|
117
|
+
sUtil.eq("placename", dataBean.getPlacename());
|
|
118
|
+
int count = service.countGxhZwPlace(sUtil.getMap());
|
|
119
|
+
if (count == 0) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
if (excludeGuid != null && count == 1) {
|
|
123
|
+
GxhZwPlace existPlace = service.find(sUtil.getMap());
|
|
124
|
+
if (existPlace != null && excludeGuid.equals(existPlace.getRowguid())) {
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* 更新窗口信息
|
|
133
|
+
*/
|
|
134
|
+
private void updateWindows(String windows, String placeguid) {
|
|
135
|
+
service.deleteWindows(placeguid);
|
|
136
|
+
if (windows == null || windows.isEmpty()) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
JSONArray jsonArray = JSON.parseArray(windows);
|
|
140
|
+
for (int i = 0; i < jsonArray.size(); i++) {
|
|
141
|
+
JSONObject obj = jsonArray.getJSONObject(i);
|
|
142
|
+
GxhZwWindow window = new GxhZwWindow();
|
|
143
|
+
window.setRowguid(UUID.randomUUID().toString());
|
|
144
|
+
window.setPlaceguid(placeguid);
|
|
145
|
+
window.setWindowname(obj.getString("windowname"));
|
|
146
|
+
window.setWindowtype(obj.getString("windowtype"));
|
|
147
|
+
window.setWindowaddress(obj.getString("windowaddress"));
|
|
148
|
+
window.setOperatedate(new Date());
|
|
149
|
+
window.setOperateusername(userSession.getDisplayName());
|
|
150
|
+
window.setOperateuserguid(userSession.getUserGuid());
|
|
151
|
+
service.insertWindow(window);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* 获取街道列表
|
|
157
|
+
*/
|
|
158
|
+
public void getStreetList(String districtname) {
|
|
159
|
+
List<SelectItem> list = new ArrayList<SelectItem>();
|
|
160
|
+
SqlConditionUtil sUtil = new SqlConditionUtil();
|
|
161
|
+
sUtil.eq("districtname", districtname);
|
|
162
|
+
sUtil.setOrderAsc("streetname");
|
|
163
|
+
List<HashMap<String, Object>> streets = service.findStreetList(sUtil.getMap());
|
|
164
|
+
for (Map<String, Object> street : streets) {
|
|
165
|
+
SelectItem item = new SelectItem();
|
|
166
|
+
item.setValue((String) street.get("streetname"));
|
|
167
|
+
item.setText((String) street.get("streetname"));
|
|
168
|
+
list.add(item);
|
|
169
|
+
}
|
|
170
|
+
addCallbackParam("list", list);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
public GxhZwPlace getDataBean() {
|
|
174
|
+
if (dataBean == null) {
|
|
175
|
+
dataBean = new GxhZwPlace();
|
|
176
|
+
}
|
|
177
|
+
return dataBean;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
public void setDataBean(GxhZwPlace dataBean) {
|
|
181
|
+
this.dataBean = dataBean;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@SuppressWarnings("unchecked")
|
|
185
|
+
public List<SelectItem> getPlacecategoryModel() {
|
|
186
|
+
if (placecategoryModel == null) {
|
|
187
|
+
placecategoryModel = DataUtil.convertMap2ComboBox(
|
|
188
|
+
(List<Map<String, String>>) CodeModalFactory.factory("下拉列表", "场所分类", null, true));
|
|
189
|
+
}
|
|
190
|
+
return placecategoryModel;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
public List<SelectItem> getDistrictModel() {
|
|
194
|
+
if (districtModel == null) {
|
|
195
|
+
districtModel = new ArrayList<SelectItem>();
|
|
196
|
+
String[] districts = {"黄浦区", "徐汇区", "长宁区", "静安区", "普陀区", "虹口区", "杨浦区", "闵行区", "宝山区", "嘉定区", "浦东新区", "金山区", "松江区", "青浦区", "奉贤区", "崇明区"};
|
|
197
|
+
for (String district : districts) {
|
|
198
|
+
SelectItem item = new SelectItem();
|
|
199
|
+
item.setValue(district);
|
|
200
|
+
item.setText(district);
|
|
201
|
+
districtModel.add(item);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return districtModel;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
public List<SelectItem> getIscommunityModel() {
|
|
208
|
+
if (iscommunityModel == null) {
|
|
209
|
+
iscommunityModel = new ArrayList<SelectItem>();
|
|
210
|
+
SelectItem item1 = new SelectItem();
|
|
211
|
+
item1.setValue("是");
|
|
212
|
+
item1.setText("是");
|
|
213
|
+
iscommunityModel.add(item1);
|
|
214
|
+
SelectItem item2 = new SelectItem();
|
|
215
|
+
item2.setValue("否");
|
|
216
|
+
item2.setText("否");
|
|
217
|
+
iscommunityModel.add(item2);
|
|
218
|
+
}
|
|
219
|
+
return iscommunityModel;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
@SuppressWarnings("unchecked")
|
|
223
|
+
public List<SelectItem> getWindowtypeModel() {
|
|
224
|
+
if (windowtypeModel == null) {
|
|
225
|
+
windowtypeModel = DataUtil.convertMap2ComboBox(
|
|
226
|
+
(List<Map<String, String>>) CodeModalFactory.factory("下拉列表", "窗口类型", null, true));
|
|
227
|
+
}
|
|
228
|
+
return windowtypeModel;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
public void getWindowtypeData() {
|
|
232
|
+
List<SelectItem> list = getWindowtypeModel();
|
|
233
|
+
addCallbackParam("list", list);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 场所信息管理list页面对应的后台
|
|
3
|
+
*
|
|
4
|
+
* @generated by zw-crud-gen (F9)
|
|
5
|
+
*/
|
|
6
|
+
package com.epoint.zwplace.action;
|
|
7
|
+
|
|
8
|
+
import java.util.List;
|
|
9
|
+
import java.util.Map;
|
|
10
|
+
|
|
11
|
+
import org.springframework.beans.factory.annotation.Autowired;
|
|
12
|
+
import org.springframework.context.annotation.Scope;
|
|
13
|
+
import org.springframework.web.bind.annotation.RestController;
|
|
14
|
+
|
|
15
|
+
import com.epoint.zwplace.api.IGxhZwPlaceService;
|
|
16
|
+
import com.epoint.zwplace.api.entity.GxhZwPlace;
|
|
17
|
+
import com.epoint.basic.controller.BaseController;
|
|
18
|
+
import com.epoint.basic.faces.export.ExportModel;
|
|
19
|
+
import com.epoint.basic.faces.util.DataUtil;
|
|
20
|
+
import com.epoint.core.dto.model.DataGridModel;
|
|
21
|
+
import com.epoint.core.dto.model.SelectItem;
|
|
22
|
+
import com.epoint.core.utils.sql.SqlConditionUtil;
|
|
23
|
+
import com.epoint.core.utils.string.StringUtil;
|
|
24
|
+
import com.epoint.database.peisistence.crud.impl.model.PageData;
|
|
25
|
+
import com.epoint.frame.service.metadata.mis.util.CodeModalFactory;
|
|
26
|
+
|
|
27
|
+
@RestController("gxhzwplacelistaction")
|
|
28
|
+
@Scope("request")
|
|
29
|
+
public class GxhZwPlaceListAction extends BaseController {
|
|
30
|
+
|
|
31
|
+
@Autowired
|
|
32
|
+
private IGxhZwPlaceService service;
|
|
33
|
+
|
|
34
|
+
private GxhZwPlace dataBean;
|
|
35
|
+
private DataGridModel<GxhZwPlace> model;
|
|
36
|
+
private ExportModel exportModel;
|
|
37
|
+
|
|
38
|
+
private List<SelectItem> placecategoryModel = null;
|
|
39
|
+
private List<SelectItem> statusModel = null;
|
|
40
|
+
|
|
41
|
+
public void pageLoad() {
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public void deleteSelect() {
|
|
45
|
+
String msg = "成功删除!";
|
|
46
|
+
try {
|
|
47
|
+
List<String> select = getDataGridData().getSelectKeys();
|
|
48
|
+
for (String sel : select) {
|
|
49
|
+
GxhZwPlace place = service.find(sel);
|
|
50
|
+
if (place != null && !"DRAFT".equals(place.getStatus())) {
|
|
51
|
+
msg = "在用数据不可删除!";
|
|
52
|
+
addCallbackParam("error", msg);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
service.deleteByGuid(sel);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch (Exception e) {
|
|
59
|
+
log.error(e.getMessage(), e);
|
|
60
|
+
msg = "删除失败!";
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
addCallbackParam("msg", msg);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public DataGridModel<GxhZwPlace> getDataGridData() {
|
|
68
|
+
if (model == null) {
|
|
69
|
+
model = new DataGridModel<GxhZwPlace>() {
|
|
70
|
+
@Override
|
|
71
|
+
public List<GxhZwPlace> fetchData(int first, int pageSize, String sortField, String sortOrder) {
|
|
72
|
+
SqlConditionUtil sUtil = new SqlConditionUtil();
|
|
73
|
+
|
|
74
|
+
if (StringUtil.isNotBlank(dataBean.getPlacename())) {
|
|
75
|
+
sUtil.like("placename", dataBean.getPlacename());
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (StringUtil.isNotBlank(dataBean.getPlacecategory())) {
|
|
79
|
+
sUtil.eq("placecategory", dataBean.getPlacecategory());
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (StringUtil.isNotBlank(dataBean.getStatus())) {
|
|
83
|
+
sUtil.eq("status", dataBean.getStatus());
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
sUtil.setOrderDesc("operatedate");
|
|
87
|
+
PageData<GxhZwPlace> pageData = service.paginatorList(sUtil.getMap(), first, pageSize);
|
|
88
|
+
this.setRowCount(pageData.getRowCount());
|
|
89
|
+
return pageData.getList();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return model;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
public void syncWindowSystem() {
|
|
97
|
+
try {
|
|
98
|
+
String result = service.syncWindowSystem();
|
|
99
|
+
addCallbackParam("msg", result);
|
|
100
|
+
}
|
|
101
|
+
catch (Exception e) {
|
|
102
|
+
log.error(e.getMessage(), e);
|
|
103
|
+
addCallbackParam("error", "同步失败:" + e.getMessage());
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public GxhZwPlace getDataBean() {
|
|
108
|
+
if (dataBean == null) {
|
|
109
|
+
dataBean = new GxhZwPlace();
|
|
110
|
+
}
|
|
111
|
+
return dataBean;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public void setDataBean(GxhZwPlace dataBean) {
|
|
115
|
+
this.dataBean = dataBean;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
public ExportModel getExportModel() {
|
|
119
|
+
if (exportModel == null) {
|
|
120
|
+
exportModel = new ExportModel(
|
|
121
|
+
"placename,placecategory,districtname,streetname,address,servicetime,consultphone,complaintphone,status,version",
|
|
122
|
+
"场所名称,场所分类,区划名称,街道名称,路/弄/号,统一对外服务时间,咨询电话,投诉电话,状态,版本号");
|
|
123
|
+
}
|
|
124
|
+
return exportModel;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@SuppressWarnings("unchecked")
|
|
128
|
+
public List<SelectItem> getPlacecategoryModel() {
|
|
129
|
+
if (placecategoryModel == null) {
|
|
130
|
+
placecategoryModel = DataUtil.convertMap2ComboBox(
|
|
131
|
+
(List<Map<String, String>>) CodeModalFactory.factory("下拉列表", "场所分类", null, true));
|
|
132
|
+
}
|
|
133
|
+
return placecategoryModel;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@SuppressWarnings("unchecked")
|
|
137
|
+
public List<SelectItem> getStatusModel() {
|
|
138
|
+
if (statusModel == null) {
|
|
139
|
+
statusModel = DataUtil.convertMap2ComboBox(
|
|
140
|
+
(List<Map<String, String>>) CodeModalFactory.factory("下拉列表", "数据状态", null, true));
|
|
141
|
+
}
|
|
142
|
+
return statusModel;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
}
|