Commit 25d39c81 authored by 赵啸非's avatar 赵啸非

添加自主终端应用实现

parent 1440d361
This diff is collapsed.
package com.mortals.xhx.module.app.model; package com.mortals.xhx.module.app.model;
import java.util.List;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.app.model.vo.AppDatasetVo; import com.mortals.xhx.module.app.model.vo.AppDatasetVo;
import com.mortals.xhx.module.app.model.AppInfoFieldEntity;
import java.util.ArrayList;
import java.util.List;
/** /**
* 自助终端应用数据集实体对象 * 自助终端应用数据集实体对象
* *
......
...@@ -36,34 +36,60 @@ public class AppDatasetServiceImpl extends AbstractCRUDServiceImpl<AppDatasetDao ...@@ -36,34 +36,60 @@ public class AppDatasetServiceImpl extends AbstractCRUDServiceImpl<AppDatasetDao
private AppService appService; private AppService appService;
@Autowired @Autowired
private AppVersionService appVersionService; private AppVersionService appVersionService;
@Override @Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException { protected void saveAfter(AppDatasetEntity entity, Context context) throws AppException {
List<AppInfoFieldEntity> appInfoFieldlist = appInfoFieldService.find(new AppInfoFieldQuery().datasetIdList(Arrays.asList(ids))); if (!ObjectUtils.isEmpty(entity.getAppInfoFieldList())) {
if(!ObjectUtils.isEmpty(appInfoFieldlist)){ entity.getAppInfoFieldList().stream().peek(item -> {
appInfoFieldService.removeList(appInfoFieldlist, context); item.setDatasetId(entity.getId());
} item.setCreateUser(context.getUser().getLoginName());
super.removeAfter(ids, context, result); item.setCreateUserId(context.getUser().getId());
item.setCreateTime(new Date());
}).count();
appInfoFieldService.save(entity.getAppInfoFieldList());
}
//更新版本号
AppEntity appEntity = appService.get(entity.getAppId(), context);
saveOrUpdateAppVersion(appEntity, context);
super.saveAfter(entity, context);
} }
@Override @Override
protected void updateAfter(AppDatasetEntity entity, Context context) throws AppException { protected void updateAfter(AppDatasetEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getAppInfoFieldList())) {
Long[] appInfoFieldIds = appInfoFieldService.find(new AppInfoFieldQuery().datasetId(entity.getId())).stream().map(AppInfoFieldEntity::getId).toArray(Long[]::new);
appInfoFieldService.remove(appInfoFieldIds, context);
entity.getAppInfoFieldList().stream().peek(item -> {
item.setDatasetId(entity.getId());
item.setCreateUser(context.getUser().getLoginName());
item.setCreateUserId(context.getUser().getId());
item.setCreateTime(new Date());
item.setUpdateUser(context.getUser().getLoginName());
item.setUpdateUserId(context.getUser().getId());
item.setUpdateTime(new Date());
}).count();
appInfoFieldService.save(entity.getAppInfoFieldList());
}
//更新版本号
AppEntity appEntity = appService.get(entity.getAppId(), context); AppEntity appEntity = appService.get(entity.getAppId(), context);
saveOrUpdateAppVersion(appEntity, context); saveOrUpdateAppVersion(appEntity, context);
super.updateAfter(entity, context); super.updateAfter(entity, context);
} }
@Override @Override
protected void saveAfter(AppDatasetEntity entity, Context context) throws AppException { protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
//更新版本号 List<AppInfoFieldEntity> appInfoFieldlist = appInfoFieldService.find(new AppInfoFieldQuery().datasetIdList(Arrays.asList(ids)));
AppEntity appEntity = appService.get(entity.getAppId(), context); if (!ObjectUtils.isEmpty(appInfoFieldlist)) {
saveOrUpdateAppVersion(appEntity, context); appInfoFieldService.removeList(appInfoFieldlist, context);
super.saveAfter(entity, context); }
super.removeAfter(ids, context, result);
} }
private void saveOrUpdateAppVersion( AppEntity appEntity, Context context) { private void saveOrUpdateAppVersion(AppEntity appEntity, Context context) {
if(!ObjectUtils.isEmpty(appEntity)){ if (!ObjectUtils.isEmpty(appEntity)) {
String version = appEntity.getVersion(); String version = appEntity.getVersion();
String versionNum = StrUtil.subAfter(version, Constant.VERSION_PREFIX, false); String versionNum = StrUtil.subAfter(version, Constant.VERSION_PREFIX, false);
String newVersionNum = NumberUtil.add(versionNum, "0.1").setScale(1).toString(); String newVersionNum = NumberUtil.add(versionNum, "0.1").setScale(1).toString();
...@@ -71,7 +97,7 @@ public class AppDatasetServiceImpl extends AbstractCRUDServiceImpl<AppDatasetDao ...@@ -71,7 +97,7 @@ public class AppDatasetServiceImpl extends AbstractCRUDServiceImpl<AppDatasetDao
appVersionEntity.initAttrValue(); appVersionEntity.initAttrValue();
AppVersionEntity versionEntity = new AppVersionEntity(); AppVersionEntity versionEntity = new AppVersionEntity();
versionEntity.initAttrValue(); versionEntity.initAttrValue();
versionEntity.setVersion(Constant.VERSION_PREFIX+newVersionNum); versionEntity.setVersion(Constant.VERSION_PREFIX + newVersionNum);
versionEntity.setNotes("应用数据更新!"); versionEntity.setNotes("应用数据更新!");
versionEntity.setCreateTime(new Date()); versionEntity.setCreateTime(new Date());
versionEntity.setCreateUserId(this.getContextUserId(context)); versionEntity.setCreateUserId(this.getContextUserId(context));
......
...@@ -4,7 +4,7 @@ Content-Type: application/json ...@@ -4,7 +4,7 @@ Content-Type: application/json
{ {
"loginName":"admin", "loginName":"admin",
"password":"admin", "password":"adsmile",
"securityCode":"8888" "securityCode":"8888"
} }
...@@ -36,13 +36,12 @@ Content-Type: application/json ...@@ -36,13 +36,12 @@ Content-Type: application/json
"siteName":"汇东县", "siteName":"汇东县",
"appCode":"cheshi", "appCode":"cheshi",
"appName":"测试应用", "appName":"测试应用",
"appIconPath":"/xxx/xx.jpg", "appIconPath":"/file/preview/196089969797.jpg",
"appThemeName":"应用程序", "appThemeName":"应用程序",
"type":1, "type":1,
"downDevCount":0, "downDevCount":0,
"shelves":0, "shelves":0,
"filePath":"njmfzd", "filePath":"file/uploadfile/1661928678354.zip",
"distributeFilePath":"ie8ice",
"version":"1.0", "version":"1.0",
"summary":"vyk2sq", "summary":"vyk2sq",
"distribute":0 "distribute":0
......
...@@ -19,7 +19,7 @@ Authorization: {{authToken}} ...@@ -19,7 +19,7 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"appId":867, "appId":1,
"page":1, "page":1,
"size":10 "size":10
} }
...@@ -31,7 +31,7 @@ Authorization: {{authToken}} ...@@ -31,7 +31,7 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"appId":526, "appId":1
} }
> {% > {%
......
...@@ -3,9 +3,9 @@ POST {{baseUrl}}/login/login ...@@ -3,9 +3,9 @@ POST {{baseUrl}}/login/login
Content-Type: application/json Content-Type: application/json
{ {
"loginName":"admin", "loginName": "admin",
"password":"admin", "password": "admin",
"securityCode":"8888" "securityCode": "8888"
} }
> {% > {%
...@@ -19,18 +19,9 @@ Authorization: {{authToken}} ...@@ -19,18 +19,9 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"datasetId":623, "datasetId": 1,
"fieldCode":"3cl109", "page": 1,
"fieldName":"ga3dpd", "size": 10
"fieldType":"zhuwrm",
"dataType":"mg4k5i",
"fieldValue":"zac65i",
"fieldLen":757,
"fieldNull":1,
"isList":848,
"fieldOrderNo":"s5ae8g",
"page":1,
"size":10
} }
...@@ -40,23 +31,62 @@ Authorization: {{authToken}} ...@@ -40,23 +31,62 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"datasetId":628, "datasetId": 1,
"fieldCode":"3jr5wy", "fieldCode": "title2",
"fieldName":"rlv0d9", "fieldName": "标题2",
"fieldType":"y77qd4", "fieldType": "input",
"dataType":"k9iyeb", "dataType": "number",
"fieldValue":"i1zx0e", "fieldValue": "zo0",
"fieldLen":939, "fieldLen": 255,
"fieldNull":1, "fieldNull": 1,
"isList":530, "isList": 1,
"fieldOrderNo":"23fcqf", "fieldOrderNo": "1",
"remark":"u72ofy", "remark": "xxxxxxxxxxxxxxxx"
} }
> {% > {%
client.global.set("AppInfoField_id", JSON.parse(response.body).data.id); client.global.set("AppInfoField_id", JSON.parse(response.body).data.id);
%} %}
###自助终端应用信息字段批量新增
POST {{baseUrl}}/app/info/field/batchSave
Authorization: {{authToken}}
Content-Type: application/json
[
{
"datasetId": 1,
"fieldCode": "title1",
"fieldName": "标题1",
"fieldType": "input",
"dataType": "number",
"fieldValue": "zo0",
"fieldLen": 255,
"fieldNull": 1,
"isList": 1,
"fieldOrderNo": "1",
"remark": "1111111111"
},
{
"datasetId": 1,
"fieldCode": "title2",
"fieldName": "标题2",
"fieldType": "input",
"dataType": "number",
"fieldValue": "zo0",
"fieldLen": 255,
"fieldNull": 1,
"isList": 1,
"fieldOrderNo": "1",
"remark": "22222222222222"
}
]
> {%
client.global.set("AppInfoField_id", JSON.parse(response.body).data.id);
%}
###自助终端应用信息字段查看 ###自助终端应用信息字段查看
GET {{baseUrl}}/app/info/field/info?id={{AppInfoField_id}} GET {{baseUrl}}/app/info/field/info?id={{AppInfoField_id}}
Authorization: {{authToken}} Authorization: {{authToken}}
......
...@@ -19,16 +19,7 @@ Authorization: {{authToken}} ...@@ -19,16 +19,7 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"appId":697, "appId":1,
"fieldCode":"ms6x38",
"fieldName":"pkzida",
"fieldType":"y35tzv",
"dataType":"l0udnu",
"fieldValue":"9axwsc",
"fieldLen":323,
"fieldNull":1,
"isList":957,
"fieldOrderNo":"fdqlh1",
"page":1, "page":1,
"size":10 "size":10
} }
...@@ -40,17 +31,17 @@ Authorization: {{authToken}} ...@@ -40,17 +31,17 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"appId":292, "appId":1,
"fieldCode":"eg5fas", "fieldCode":"title2",
"fieldName":"4c7y60", "fieldName":"标题2",
"fieldType":"7z4rum", "fieldType":"input",
"dataType":"6tibr9", "dataType":"number",
"fieldValue":"zo04rh", "fieldValue":"zo0",
"fieldLen":839, "fieldLen":255,
"fieldNull":1, "fieldNull":1,
"isList":755, "isList":1,
"fieldOrderNo":"qf8e1e", "fieldOrderNo":"1",
"remark":"iwlj8b", "remark":"xxxxxxxxxxxxxxxx"
} }
> {% > {%
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment