@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,119 @@
|
|
|
1
|
+
package com.epoint.schemeresource.action;
|
|
2
|
+
|
|
3
|
+
import com.epoint.basic.controller.BaseController;
|
|
4
|
+
import com.epoint.basic.controller.RightRelation;
|
|
5
|
+
import com.epoint.basic.faces.fileupload.FileUploadModel9;
|
|
6
|
+
import com.epoint.basic.faces.tree.DefaultFileUploadHandlerImpl9;
|
|
7
|
+
import com.epoint.basic.faces.util.DataUtil;
|
|
8
|
+
import com.epoint.core.dto.model.SelectItem;
|
|
9
|
+
import com.epoint.frame.service.attach.api.IAttachService;
|
|
10
|
+
import com.epoint.frame.service.attach.entity.FrameAttachInfo;
|
|
11
|
+
import com.epoint.frame.service.metadata.mis.util.CodeModalFactory;
|
|
12
|
+
import com.epoint.schemeresource.api.ISchemeResourceService;
|
|
13
|
+
import com.epoint.schemeresource.api.entity.SchemeResource;
|
|
14
|
+
import org.springframework.beans.factory.annotation.Autowired;
|
|
15
|
+
import org.springframework.context.annotation.Scope;
|
|
16
|
+
import org.springframework.web.bind.annotation.RestController;
|
|
17
|
+
|
|
18
|
+
import java.util.Date;
|
|
19
|
+
import java.util.List;
|
|
20
|
+
import java.util.UUID;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 方案资源文档新增页面对应的后台
|
|
24
|
+
*
|
|
25
|
+
* @author LEE-H
|
|
26
|
+
* @version [版本号, 2023-04-13 15:00:20]
|
|
27
|
+
*/
|
|
28
|
+
@RightRelation(SchemeResourceListAction.class)
|
|
29
|
+
@RestController("schemeresourceaddaction")
|
|
30
|
+
@Scope("request")
|
|
31
|
+
public class SchemeResourceAddAction extends BaseController {
|
|
32
|
+
|
|
33
|
+
@Autowired
|
|
34
|
+
private ISchemeResourceService service;
|
|
35
|
+
|
|
36
|
+
@Autowired
|
|
37
|
+
private IAttachService attachService;
|
|
38
|
+
|
|
39
|
+
private FileUploadModel9 fileUploadModel;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 方案资源文档实体对象
|
|
43
|
+
*/
|
|
44
|
+
private SchemeResource dataBean = null;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 类型下拉列表model
|
|
48
|
+
*/
|
|
49
|
+
private List<SelectItem> scheme_typeModel = null;
|
|
50
|
+
|
|
51
|
+
public void pageLoad() {
|
|
52
|
+
dataBean = new SchemeResource();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 保存并关闭
|
|
57
|
+
*/
|
|
58
|
+
public void add() {
|
|
59
|
+
dataBean.setRowguid(UUID.randomUUID().toString());
|
|
60
|
+
dataBean.setOperatedate(new Date());
|
|
61
|
+
dataBean.setOperateusername(userSession.getDisplayName());
|
|
62
|
+
dataBean.setOperateuserguid(userSession.getUserGuid());
|
|
63
|
+
dataBean.setOperateuserouguid(userSession.getOuGuid());
|
|
64
|
+
service.insert(dataBean);
|
|
65
|
+
addCallbackParam("msg", "保存成功!");
|
|
66
|
+
dataBean = null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 保存并新建
|
|
71
|
+
*/
|
|
72
|
+
public void addNew() {
|
|
73
|
+
add();
|
|
74
|
+
dataBean = new SchemeResource();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public FileUploadModel9 getFileUploadModel() {
|
|
78
|
+
if (this.fileUploadModel == null) {
|
|
79
|
+
this.fileUploadModel = new FileUploadModel9(new DefaultFileUploadHandlerImpl9(UUID.randomUUID().toString(), null, "方案资源"
|
|
80
|
+
, null, this.userSession.getUserGuid(), this.userSession.getDisplayName()));
|
|
81
|
+
}
|
|
82
|
+
return this.fileUploadModel;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public void uploadSuccess(String attachGuid) {
|
|
86
|
+
FrameAttachInfo attachInfoDetail = attachService.getAttachInfoDetail(attachGuid);
|
|
87
|
+
String attachFileName = attachInfoDetail.getAttachFileName();
|
|
88
|
+
if (attachFileName.contains(".")) {
|
|
89
|
+
attachFileName = attachFileName.substring(0, attachFileName.lastIndexOf("."));
|
|
90
|
+
}
|
|
91
|
+
addCallbackParam("scheme_name", attachFileName);
|
|
92
|
+
addCallbackParam("client_type", attachInfoDetail.getContentType());
|
|
93
|
+
addCallbackParam("client_size", attachInfoDetail.getAttachLength());
|
|
94
|
+
addCallbackParam("client_guid", attachInfoDetail.getCliengGuid());
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
public void delAttach(String attachGuid) {
|
|
98
|
+
attachService.deleteAttachByAttachGuid(attachGuid);// 删除原附件
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public SchemeResource getDataBean() {
|
|
102
|
+
if (dataBean == null) {
|
|
103
|
+
dataBean = new SchemeResource();
|
|
104
|
+
}
|
|
105
|
+
return dataBean;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
public void setDataBean(SchemeResource dataBean) {
|
|
109
|
+
this.dataBean = dataBean;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
public List<SelectItem> getScheme_typeModel() {
|
|
113
|
+
if (scheme_typeModel == null) {
|
|
114
|
+
scheme_typeModel = DataUtil.convertMap2ComboBox(CodeModalFactory.factory("下拉列表", "方案资源类型", null, false));
|
|
115
|
+
}
|
|
116
|
+
return this.scheme_typeModel;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
package com.epoint.schemeresource.action;
|
|
2
|
+
|
|
3
|
+
import com.epoint.basic.controller.BaseController;
|
|
4
|
+
import com.epoint.basic.controller.RightRelation;
|
|
5
|
+
import com.epoint.basic.faces.fileupload.FileUploadModel9;
|
|
6
|
+
import com.epoint.basic.faces.tree.DefaultFileUploadHandlerImpl9;
|
|
7
|
+
import com.epoint.basic.faces.util.DataUtil;
|
|
8
|
+
import com.epoint.core.dto.model.SelectItem;
|
|
9
|
+
import com.epoint.frame.service.metadata.mis.util.CodeModalFactory;
|
|
10
|
+
import com.epoint.schemeresource.api.ISchemeResourceService;
|
|
11
|
+
import com.epoint.schemeresource.api.entity.SchemeResource;
|
|
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 java.util.List;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 方案资源文档详情页面对应的后台
|
|
20
|
+
*
|
|
21
|
+
* @author LEE-H
|
|
22
|
+
* @version [版本号, 2023-04-13 15:00:20]
|
|
23
|
+
*/
|
|
24
|
+
@RightRelation(SchemeResourceListAction.class)
|
|
25
|
+
@RestController("schemeresourcedetailaction")
|
|
26
|
+
@Scope("request")
|
|
27
|
+
public class SchemeResourceDetailAction extends BaseController {
|
|
28
|
+
|
|
29
|
+
@Autowired
|
|
30
|
+
private ISchemeResourceService service;
|
|
31
|
+
|
|
32
|
+
private FileUploadModel9 fileUploadModel;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 方案资源文档实体对象
|
|
36
|
+
*/
|
|
37
|
+
private SchemeResource dataBean = null;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 类型下拉列表model
|
|
41
|
+
*/
|
|
42
|
+
private List<SelectItem> scheme_typeModel = null;
|
|
43
|
+
|
|
44
|
+
public void pageLoad() {
|
|
45
|
+
String guid = getRequestParameter("guid");
|
|
46
|
+
dataBean = service.find(guid);
|
|
47
|
+
if (dataBean == null) {
|
|
48
|
+
dataBean = new SchemeResource();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public FileUploadModel9 getFileUploadModel() {
|
|
53
|
+
if (this.fileUploadModel == null) {
|
|
54
|
+
this.fileUploadModel = new FileUploadModel9(new DefaultFileUploadHandlerImpl9(dataBean.getClient_guid(), null, "方案资源"
|
|
55
|
+
, null, this.userSession.getUserGuid(), this.userSession.getDisplayName()));
|
|
56
|
+
}
|
|
57
|
+
return this.fileUploadModel;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public List<SelectItem> getScheme_typeModel() {
|
|
61
|
+
if (scheme_typeModel == null) {
|
|
62
|
+
scheme_typeModel = DataUtil.convertMap2ComboBox(CodeModalFactory.factory("下拉列表", "方案资源类型", null, false));
|
|
63
|
+
}
|
|
64
|
+
return this.scheme_typeModel;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public SchemeResource getDataBean() {
|
|
68
|
+
return dataBean;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
package com.epoint.schemeresource.action;
|
|
2
|
+
|
|
3
|
+
import com.epoint.basic.controller.BaseController;
|
|
4
|
+
import com.epoint.basic.controller.RightRelation;
|
|
5
|
+
import com.epoint.basic.faces.fileupload.FileUploadModel9;
|
|
6
|
+
import com.epoint.basic.faces.tree.DefaultFileUploadHandlerImpl9;
|
|
7
|
+
import com.epoint.basic.faces.util.DataUtil;
|
|
8
|
+
import com.epoint.core.dto.model.SelectItem;
|
|
9
|
+
import com.epoint.frame.service.attach.api.IAttachService;
|
|
10
|
+
import com.epoint.frame.service.attach.entity.FrameAttachInfo;
|
|
11
|
+
import com.epoint.frame.service.metadata.mis.util.CodeModalFactory;
|
|
12
|
+
import com.epoint.schemeresource.api.ISchemeResourceService;
|
|
13
|
+
import com.epoint.schemeresource.api.entity.SchemeResource;
|
|
14
|
+
import org.springframework.beans.factory.annotation.Autowired;
|
|
15
|
+
import org.springframework.context.annotation.Scope;
|
|
16
|
+
import org.springframework.web.bind.annotation.RestController;
|
|
17
|
+
|
|
18
|
+
import java.util.Date;
|
|
19
|
+
import java.util.List;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 方案资源文档修改页面对应的后台
|
|
23
|
+
*
|
|
24
|
+
* @author LEE-H
|
|
25
|
+
* @version [版本号, 2023-04-13 15:00:20]
|
|
26
|
+
*/
|
|
27
|
+
@RightRelation(SchemeResourceListAction.class)
|
|
28
|
+
@RestController("schemeresourceeditaction")
|
|
29
|
+
@Scope("request")
|
|
30
|
+
public class SchemeResourceEditAction extends BaseController {
|
|
31
|
+
|
|
32
|
+
@Autowired
|
|
33
|
+
private ISchemeResourceService service;
|
|
34
|
+
|
|
35
|
+
@Autowired
|
|
36
|
+
private IAttachService attachService;
|
|
37
|
+
|
|
38
|
+
private FileUploadModel9 fileUploadModel;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 方案资源文档实体对象
|
|
42
|
+
*/
|
|
43
|
+
private SchemeResource dataBean = null;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 类型下拉列表model
|
|
47
|
+
*/
|
|
48
|
+
private List<SelectItem> scheme_typeModel = null;
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
public void pageLoad() {
|
|
52
|
+
String guid = getRequestParameter("guid");
|
|
53
|
+
dataBean = service.find(guid);
|
|
54
|
+
if (dataBean == null) {
|
|
55
|
+
dataBean = new SchemeResource();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 保存修改
|
|
61
|
+
*/
|
|
62
|
+
public void save() {
|
|
63
|
+
dataBean.setOperatedate(new Date());
|
|
64
|
+
service.update(dataBean);
|
|
65
|
+
addCallbackParam("msg", "修改成功!");
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public FileUploadModel9 getFileUploadModel() {
|
|
69
|
+
if (this.fileUploadModel == null) {
|
|
70
|
+
this.fileUploadModel = new FileUploadModel9(new DefaultFileUploadHandlerImpl9(dataBean.getClient_guid(), null, "方案资源"
|
|
71
|
+
, null, this.userSession.getUserGuid(), this.userSession.getDisplayName()));
|
|
72
|
+
}
|
|
73
|
+
return this.fileUploadModel;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public void uploadSuccess(String attachGuid) {
|
|
77
|
+
FrameAttachInfo attachInfoDetail = attachService.getAttachInfoDetail(attachGuid);
|
|
78
|
+
String attachFileName = attachInfoDetail.getAttachFileName();
|
|
79
|
+
if (attachFileName.contains(".")) {
|
|
80
|
+
attachFileName = attachFileName.substring(0, attachFileName.lastIndexOf("."));
|
|
81
|
+
}
|
|
82
|
+
addCallbackParam("scheme_name", attachFileName);
|
|
83
|
+
addCallbackParam("client_type", attachInfoDetail.getContentType());
|
|
84
|
+
addCallbackParam("client_size", attachInfoDetail.getAttachLength());
|
|
85
|
+
addCallbackParam("client_guid", attachInfoDetail.getCliengGuid());
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public void delAttach(String attachGuid) {
|
|
89
|
+
attachService.deleteAttachByAttachGuid(attachGuid);// 删除原附件
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public SchemeResource getDataBean() {
|
|
93
|
+
return dataBean;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
public void setDataBean(SchemeResource dataBean) {
|
|
97
|
+
this.dataBean = dataBean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
public List<SelectItem> getScheme_typeModel() {
|
|
101
|
+
if (scheme_typeModel == null) {
|
|
102
|
+
scheme_typeModel = DataUtil.convertMap2ComboBox(CodeModalFactory.factory("下拉列表", "方案资源类型", null, false));
|
|
103
|
+
}
|
|
104
|
+
return this.scheme_typeModel;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
package com.epoint.schemeresource.action;
|
|
2
|
+
|
|
3
|
+
import com.epoint.basic.controller.BaseController;
|
|
4
|
+
import com.epoint.basic.faces.export.ExportModel;
|
|
5
|
+
import com.epoint.basic.faces.util.DataUtil;
|
|
6
|
+
import com.epoint.core.dto.model.DataGridModel;
|
|
7
|
+
import com.epoint.core.dto.model.SelectItem;
|
|
8
|
+
import com.epoint.database.peisistence.crud.impl.model.PageData;
|
|
9
|
+
import com.epoint.frame.service.attach.api.IAttachService;
|
|
10
|
+
import com.epoint.frame.service.attach.entity.FrameAttachInfo;
|
|
11
|
+
import com.epoint.frame.service.metadata.mis.util.CodeModalFactory;
|
|
12
|
+
import com.epoint.frame.service.metadata.mis.util.ListGenerator;
|
|
13
|
+
import com.epoint.schemeresource.api.ISchemeResourceService;
|
|
14
|
+
import com.epoint.schemeresource.api.entity.SchemeResource;
|
|
15
|
+
import org.apache.commons.lang3.StringUtils;
|
|
16
|
+
import org.springframework.beans.factory.annotation.Autowired;
|
|
17
|
+
import org.springframework.context.annotation.Scope;
|
|
18
|
+
import org.springframework.web.bind.annotation.RestController;
|
|
19
|
+
|
|
20
|
+
import java.util.List;
|
|
21
|
+
import java.util.Map;
|
|
22
|
+
import java.util.Objects;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 方案资源文档list页面对应的后台
|
|
26
|
+
*
|
|
27
|
+
* @author LEE-H
|
|
28
|
+
* @version [版本号, 2023-04-13 15:00:20]
|
|
29
|
+
*/
|
|
30
|
+
@RestController("schemeresourcelistaction")
|
|
31
|
+
@Scope("request")
|
|
32
|
+
public class SchemeResourceListAction extends BaseController {
|
|
33
|
+
|
|
34
|
+
@Autowired
|
|
35
|
+
private ISchemeResourceService service;
|
|
36
|
+
|
|
37
|
+
@Autowired
|
|
38
|
+
private IAttachService attachService;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 方案资源文档实体对象
|
|
42
|
+
*/
|
|
43
|
+
private SchemeResource dataBean;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 表格控件model
|
|
47
|
+
*/
|
|
48
|
+
private DataGridModel<SchemeResource> model;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 导出模型
|
|
52
|
+
*/
|
|
53
|
+
private ExportModel exportModel;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 类型下拉列表model
|
|
57
|
+
*/
|
|
58
|
+
private List<SelectItem> scheme_typeModel = null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 字节 转换为B MB GB
|
|
62
|
+
*
|
|
63
|
+
* @param size 字节大小
|
|
64
|
+
*/
|
|
65
|
+
public static String getPrintSize(long size) {
|
|
66
|
+
long rest;
|
|
67
|
+
if (size < 1024) {
|
|
68
|
+
return size + "B";
|
|
69
|
+
} else {
|
|
70
|
+
size /= 1024;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (size < 1024) {
|
|
74
|
+
return size + "KB";
|
|
75
|
+
} else {
|
|
76
|
+
rest = size % 1024;
|
|
77
|
+
size /= 1024;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (size < 1024) {
|
|
81
|
+
size = size * 100;
|
|
82
|
+
return size / 100 + "." + rest * 100 / 1024 % 100 + "MB";
|
|
83
|
+
} else {
|
|
84
|
+
size = size * 100 / 1024;
|
|
85
|
+
return size / 100 + "." + size % 100 + "GB";
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public void pageLoad() {
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* 删除选定
|
|
94
|
+
*/
|
|
95
|
+
public void deleteSelect() {
|
|
96
|
+
List<String> select = getDataGridData().getSelectKeys();
|
|
97
|
+
for (String sel : select) {
|
|
98
|
+
service.deleteByGuid(sel);
|
|
99
|
+
}
|
|
100
|
+
addCallbackParam("msg", "成功删除!");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public DataGridModel<SchemeResource> getDataGridData() {
|
|
104
|
+
// 获得表格对象
|
|
105
|
+
if (model == null) {
|
|
106
|
+
model = new DataGridModel<SchemeResource>() {
|
|
107
|
+
|
|
108
|
+
@Override
|
|
109
|
+
public List<SchemeResource> fetchData(int first, int pageSize, String sortField, String sortOrder) {
|
|
110
|
+
// 获取where条件Map集合
|
|
111
|
+
Map<String, Object> conditionMap = ListGenerator.getSearchMap(getRequestContext().getComponents(),
|
|
112
|
+
sortField, sortOrder);
|
|
113
|
+
PageData<SchemeResource> pageData = service.paginatorList(conditionMap, first, pageSize);
|
|
114
|
+
this.setRowCount(pageData.getRowCount());
|
|
115
|
+
List<SchemeResource> list = pageData.getList();
|
|
116
|
+
for (SchemeResource schemeResource : list) {
|
|
117
|
+
Integer client_size = schemeResource.getClient_size();
|
|
118
|
+
if (client_size != null) {
|
|
119
|
+
schemeResource.set("client_size", getPrintSize(client_size));
|
|
120
|
+
}
|
|
121
|
+
schemeResource.set("is_edit", 0);
|
|
122
|
+
if (Objects.equals(userSession.getUserGuid(), schemeResource.getOperateuserguid())) {
|
|
123
|
+
schemeResource.set("is_edit", 1);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return pageData.getList();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
return model;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
public void getAttach(String clientGuid) {
|
|
135
|
+
if (StringUtils.isNotBlank(clientGuid)) {
|
|
136
|
+
List<FrameAttachInfo> attachInfos = attachService.getAttachInfoListByGuid(clientGuid);
|
|
137
|
+
if (attachInfos != null && !attachInfos.isEmpty()) {
|
|
138
|
+
addCallbackParam("attachGuid", attachInfos.get(0).getAttachGuid());
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
public SchemeResource getDataBean() {
|
|
144
|
+
if (dataBean == null) {
|
|
145
|
+
dataBean = new SchemeResource();
|
|
146
|
+
}
|
|
147
|
+
return dataBean;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
public void setDataBean(SchemeResource dataBean) {
|
|
151
|
+
this.dataBean = dataBean;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
public ExportModel getExportModel() {
|
|
155
|
+
if (exportModel == null) {
|
|
156
|
+
exportModel = new ExportModel("", "");
|
|
157
|
+
}
|
|
158
|
+
return exportModel;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
public List<SelectItem> getScheme_typeModel() {
|
|
162
|
+
if (scheme_typeModel == null) {
|
|
163
|
+
scheme_typeModel = DataUtil.convertMap2ComboBox(CodeModalFactory.factory("下拉列表", "方案资源类型", null, true));
|
|
164
|
+
}
|
|
165
|
+
return this.scheme_typeModel;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
package com.epoint.schemeresource.api;
|
|
2
|
+
|
|
3
|
+
import com.epoint.database.peisistence.crud.impl.model.PageData;
|
|
4
|
+
import com.epoint.schemeresource.api.entity.SchemeResource;
|
|
5
|
+
|
|
6
|
+
import java.util.List;
|
|
7
|
+
import java.util.Map;
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 方案资源文档对应的后台service接口
|
|
12
|
+
*
|
|
13
|
+
* @author LEE-H
|
|
14
|
+
* @version [版本号, 2023-04-13 15:00:20]
|
|
15
|
+
*/
|
|
16
|
+
public interface ISchemeResourceService {
|
|
17
|
+
/**
|
|
18
|
+
* 插入数据
|
|
19
|
+
*
|
|
20
|
+
* @param record BaseEntity或Record对象 <必须继承Record>
|
|
21
|
+
* @return int
|
|
22
|
+
*/
|
|
23
|
+
int insert(SchemeResource record);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 删除数据
|
|
27
|
+
*
|
|
28
|
+
* @param guid 主键guid
|
|
29
|
+
* @return int
|
|
30
|
+
*/
|
|
31
|
+
int deleteByGuid(String guid);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 更新数据
|
|
35
|
+
*
|
|
36
|
+
* @param record BaseEntity或Record对象 <必须继承Record>
|
|
37
|
+
* @return int
|
|
38
|
+
*/
|
|
39
|
+
int update(SchemeResource record);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 查询数量
|
|
43
|
+
*
|
|
44
|
+
* @param conditionMap 查询条件集合
|
|
45
|
+
* @return Integer
|
|
46
|
+
*/
|
|
47
|
+
Integer countSchemeResource(Map<String, Object> conditionMap);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 根据ID查找单个实体
|
|
51
|
+
*
|
|
52
|
+
* @param primaryKey 主键
|
|
53
|
+
* @return T extends BaseEntity
|
|
54
|
+
*/
|
|
55
|
+
SchemeResource find(Object primaryKey);
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 查找单条记录
|
|
60
|
+
*
|
|
61
|
+
* @param conditionMap 查询条件集合
|
|
62
|
+
* @return T {String、Integer、Long、Record、FrameOu、Object[]等}
|
|
63
|
+
*/
|
|
64
|
+
SchemeResource find(Map<String, Object> conditionMap);
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 查找一个list
|
|
68
|
+
*
|
|
69
|
+
* @param conditionMap 查询条件集合
|
|
70
|
+
* @return T extends BaseEntity
|
|
71
|
+
*/
|
|
72
|
+
List<SchemeResource> findList(Map<String, Object> conditionMap);
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 分页查找一个list
|
|
76
|
+
*
|
|
77
|
+
* @param conditionMap 查询条件集合
|
|
78
|
+
* @param pageNumber 记录行的偏移量
|
|
79
|
+
* @param pageSize 记录行的最大数目
|
|
80
|
+
* @return T extends BaseEntity
|
|
81
|
+
*/
|
|
82
|
+
PageData<SchemeResource> paginatorList(Map<String, Object> conditionMap, int pageNumber, int pageSize);
|
|
83
|
+
|
|
84
|
+
}
|