Merge branch 'dev' of http://hzya.ufyct.com:9015/root/kangarooDataCenterV3 into dev
This commit is contained in:
commit
467b162b0d
|
@ -0,0 +1,74 @@
|
||||||
|
package com.hzya.frame.seeyon.cap4.form.dto;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 无流程表单批量保存请求参数
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/1/8 11:18
|
||||||
|
**/
|
||||||
|
public class FormDTO {
|
||||||
|
@JSONField(ordinal = 4)
|
||||||
|
private String formCode;//模版编号
|
||||||
|
@JSONField(ordinal = 5)
|
||||||
|
private String loginName;//模版编号
|
||||||
|
@JSONField(ordinal = 2)
|
||||||
|
private String rightId;//权限id,找到无流程表单,点新增,弹出的窗口上会有这个参数
|
||||||
|
@JSONField(ordinal = 3)
|
||||||
|
private List<FormDataDTO> dataList;//导入的数据
|
||||||
|
@JSONField(ordinal = 1)
|
||||||
|
private String[] uniqueFiled;//更新用的唯一标识
|
||||||
|
@JSONField(ordinal = 6)
|
||||||
|
private Boolean doTrigger;//是否执行触发(Since V8.0sp2),测试中发现传了这个参数会报错
|
||||||
|
|
||||||
|
public String getFormCode() {
|
||||||
|
return formCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFormCode(String formCode) {
|
||||||
|
this.formCode = formCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLoginName() {
|
||||||
|
return loginName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoginName(String loginName) {
|
||||||
|
this.loginName = loginName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRightId() {
|
||||||
|
return rightId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRightId(String rightId) {
|
||||||
|
this.rightId = rightId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<FormDataDTO> getDataList() {
|
||||||
|
return dataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataList(List<FormDataDTO> dataList) {
|
||||||
|
this.dataList = dataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getUniqueFiled() {
|
||||||
|
return uniqueFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUniqueFiled(String[] uniqueFiled) {
|
||||||
|
this.uniqueFiled = uniqueFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getDoTrigger() {
|
||||||
|
return doTrigger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDoTrigger(Boolean doTrigger) {
|
||||||
|
this.doTrigger = doTrigger;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.hzya.frame.seeyon.cap4.form.dto;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description dataList节点
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/1/8 11:26
|
||||||
|
**/
|
||||||
|
public class FormDataDTO {
|
||||||
|
@JSONField(ordinal = 1)
|
||||||
|
private MasterTableDTO masterTable;//主表数据
|
||||||
|
@JSONField(ordinal = 2)
|
||||||
|
private List<SubTableDTO> subTables;//子表数据
|
||||||
|
|
||||||
|
//private List<> attachmentInfos;//附件列表
|
||||||
|
|
||||||
|
public MasterTableDTO getMasterTable() {
|
||||||
|
return masterTable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMasterTable(MasterTableDTO masterTable) {
|
||||||
|
this.masterTable = masterTable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SubTableDTO> getSubTables() {
|
||||||
|
return subTables;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubTables(List<SubTableDTO> subTables) {
|
||||||
|
this.subTables = subTables;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.hzya.frame.seeyon.cap4.form.dto;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 主表数据
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/1/8 11:29
|
||||||
|
**/
|
||||||
|
|
||||||
|
public class MasterTableDTO {
|
||||||
|
@JSONField(ordinal = 1)
|
||||||
|
private String name;//表名
|
||||||
|
@JSONField(ordinal = 2)
|
||||||
|
private RecordDTO record;//数据
|
||||||
|
@JSONField(ordinal = 3)
|
||||||
|
private List<String> changedFields;//需要计算的字段
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecordDTO getRecord() {
|
||||||
|
return record;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecord(RecordDTO record) {
|
||||||
|
this.record = record;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getChangedFields() {
|
||||||
|
return changedFields;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChangedFields(List<String> changedFields) {
|
||||||
|
this.changedFields = changedFields;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.hzya.frame.seeyon.cap4.form.dto;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description record节点
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/1/8 11:31
|
||||||
|
**/
|
||||||
|
public class RecordDTO {
|
||||||
|
@JSONField(ordinal = 1)
|
||||||
|
private long id;//数据id,测试中发现新增时这个参数随便填写 不影响导入
|
||||||
|
@JSONField(ordinal = 2)
|
||||||
|
private List<RecordFieldDTO> fields;//字段列表
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RecordFieldDTO> getFields() {
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFields(List<RecordFieldDTO> fields) {
|
||||||
|
this.fields = fields;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.hzya.frame.seeyon.cap4.form.dto;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description masterTable—record—fields的结构
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/1/8 11:32
|
||||||
|
**/
|
||||||
|
public class RecordFieldDTO {
|
||||||
|
@JSONField(ordinal = 1)
|
||||||
|
private String name;//数据域名称 ,fieldxxxx
|
||||||
|
@JSONField(ordinal = 2)
|
||||||
|
private String value;//数据值(优先)
|
||||||
|
@JSONField(ordinal = 3)
|
||||||
|
private String showValue;//显示值
|
||||||
|
|
||||||
|
public RecordFieldDTO() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecordFieldDTO(String name, String value, String showValue) {
|
||||||
|
this.name = name;
|
||||||
|
this.value = value;
|
||||||
|
this.showValue = showValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShowValue() {
|
||||||
|
return showValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowValue(String showValue) {
|
||||||
|
this.showValue = showValue;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.hzya.frame.seeyon.cap4.form.dto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 子表数据
|
||||||
|
* @Author xiangerlin
|
||||||
|
* @Date 2024/1/8 11:29
|
||||||
|
**/
|
||||||
|
public class SubTableDTO {
|
||||||
|
}
|
|
@ -48,7 +48,7 @@
|
||||||
${key} =#{value}
|
${key} =#{value}
|
||||||
</foreach>
|
</foreach>
|
||||||
</set>
|
</set>
|
||||||
where formmain_id=#{formmainId} and sts='Y'
|
where id=#{id} and sts='Y'
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<!-- 多条件逻辑删除 -->
|
<!-- 多条件逻辑删除 -->
|
||||||
|
|
|
@ -135,9 +135,6 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
if (!checkStr(jsonObject.getString("optionName"))) {
|
if (!checkStr(jsonObject.getString("optionName"))) {
|
||||||
return BaseResult.getFailureMessageEntity("操作人为空");
|
return BaseResult.getFailureMessageEntity("操作人为空");
|
||||||
}
|
}
|
||||||
/*if (!checkStr(jsonObject.getString("rulePrefix"))) {
|
|
||||||
return BaseResult.getFailureMessageEntity("规则为空");
|
|
||||||
}*/
|
|
||||||
ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class);
|
ComparisonEntity comparisonEntity = jsonObject.toJavaObject(ComparisonEntity.class);
|
||||||
ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity();
|
ComparisonDetailsEntity comparisonDetailsEntity=new ComparisonDetailsEntity();
|
||||||
List<ComparisonEntity> comparisonEntities=new ArrayList<>();
|
List<ComparisonEntity> comparisonEntities=new ArrayList<>();
|
||||||
|
@ -156,10 +153,9 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
JSONObject jsonObjectMain = JSONObject.parseObject(main);
|
JSONObject jsonObjectMain = JSONObject.parseObject(main);
|
||||||
if(jsonObjectMain != null ) {
|
if(jsonObjectMain != null ) {
|
||||||
Map<String, Object> map = new HashMap<>();//将主表数据存到map中
|
Map<String, Object> map = new HashMap<>();//将主表数据存到map中
|
||||||
Map<String, Object> mapDetails = new HashMap<>();//将子表数据存到map中
|
List<Map<String, Object>> mapDetails = new ArrayList<>();//将子表数据存到map中
|
||||||
if (comparisonEntities != null && comparisonEntities.size() > 0) {
|
if (comparisonEntities != null && comparisonEntities.size() > 0) {
|
||||||
map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity);
|
map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity,comparisonDetailsEntity);
|
||||||
mapDetails = spliceDetailMap(comparisonEntities, mapDetails, comparisonDetailsEntity, jsonArray);
|
|
||||||
String uuid = null;
|
String uuid = null;
|
||||||
if (jsonObjectMain.getString("id") == null) {
|
if (jsonObjectMain.getString("id") == null) {
|
||||||
uuid = UUIDUtils.getUUID();
|
uuid = UUIDUtils.getUUID();
|
||||||
|
@ -182,8 +178,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
//查询单据规则 只查询主表得,明细表不用
|
//查询单据规则 只查询主表得,明细表不用
|
||||||
try {
|
try {
|
||||||
ComparisonEntity comparisonEntityRules = comparisonDao.queryComparisonById(comparisonEntityRule);
|
ComparisonEntity comparisonEntityRules = comparisonDao.queryComparisonById(comparisonEntityRule);
|
||||||
String documentRule = comparisonEntityRules.getDocumentRule();
|
String documentRule = comparisonEntityRules.getDocumentRule();//"KH-2024-05-30-1";
|
||||||
; //"KH-2024-05-30-1";
|
|
||||||
logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}", documentRule);
|
logger.info("通用数据保存接口中根据mId查询出来的单据规则为:{}", documentRule);
|
||||||
if (documentRule != null) {
|
if (documentRule != null) {
|
||||||
//获取规则前缀 CK
|
//获取规则前缀 CK
|
||||||
|
@ -214,30 +209,41 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
return BaseResult.getFailureMessageEntity("保存失败");
|
return BaseResult.getFailureMessageEntity("保存失败");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
List<JSONObject> list=new ArrayList<>();
|
||||||
|
JSONObject jsonObjectList=new JSONObject();
|
||||||
//保存主表数据
|
//保存主表数据
|
||||||
ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule);
|
ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule);
|
||||||
|
jsonObjectList.put(comparisonEntityOne.getDbName(),map);
|
||||||
//保存子表数据
|
//保存子表数据
|
||||||
if (mapDetails != null && mapDetails.size() > 0) {
|
if (jsonArray != null && jsonArray.size() > 0) {
|
||||||
|
mapDetails = spliceDetailMap(comparisonEntities, mapDetails, jsonArray);
|
||||||
|
if(mapDetails.size()>0 && mapDetails!=null){
|
||||||
|
for (Map<String, Object> mapDetail : mapDetails) {
|
||||||
String uuidDetail = UUIDUtils.getUUID();
|
String uuidDetail = UUIDUtils.getUUID();
|
||||||
mapDetails.put("id", uuidDetail);
|
mapDetail.put("id", uuidDetail);
|
||||||
mapDetails.put("formmain_id", uuid);
|
mapDetail.put("formmain_id", uuid);
|
||||||
mapDetails.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
mapDetail.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||||
mapDetails.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
mapDetail.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||||
mapDetails.put("org_id", "0");
|
mapDetail.put("org_id", "0");
|
||||||
mapDetails.put("create_time", new Date());
|
mapDetail.put("create_time", new Date());
|
||||||
mapDetails.put("modify_time", new Date());
|
mapDetail.put("modify_time", new Date());
|
||||||
mapDetails.put("sts", "Y");
|
mapDetail.put("sts", "Y");
|
||||||
mapDetails.put("data_status","Y");//新增状态
|
mapDetail.put("data_status","Y");//新增状态
|
||||||
comparisonDetailsEntity.setMapDetails(mapDetails);
|
comparisonDetailsEntity.setMapDetails(mapDetail);
|
||||||
ComparisonDetailsEntity comparisonDetailsEntityOne = comparisonDetailsDao.saveComparisonDetails(comparisonDetailsEntity);
|
ComparisonDetailsEntity comparisonDetailsEntityOne = comparisonDetailsDao.saveComparisonDetails(comparisonDetailsEntity);
|
||||||
//comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne);
|
//comparisonEntityOne.setComparisonDetailsEntity(comparisonDetailsEntityOne);
|
||||||
map.put("details",mapDetails);
|
|
||||||
//保存操作日志
|
//保存操作日志
|
||||||
//controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log");
|
//controlsLogDaoimpl.saveControlsLog(uuidDetail,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log");
|
||||||
}
|
}
|
||||||
|
jsonObjectList.put(comparisonDetailsEntity.getDbName(),mapDetails);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
jsonObjectList.put(comparisonDetailsEntity.getDbName(),new ArrayList<>());
|
||||||
|
}
|
||||||
|
list.add(jsonObjectList);
|
||||||
//保存操作日志
|
//保存操作日志
|
||||||
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log");
|
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log");
|
||||||
return BaseResult.getSuccessMessageEntity("保存成功", map);
|
return BaseResult.getSuccessMessageEntity("保存成功", list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.info("保存通用数据时候错误:{}", e.getMessage());
|
logger.info("保存通用数据时候错误:{}", e.getMessage());
|
||||||
return BaseResult.getFailureMessageEntity("保存失败");
|
return BaseResult.getFailureMessageEntity("保存失败");
|
||||||
|
@ -279,10 +285,9 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
return BaseResult.getFailureMessageEntity("更新失败");
|
return BaseResult.getFailureMessageEntity("更新失败");
|
||||||
}
|
}
|
||||||
Map<String,Object> map=new HashMap<>();//将主表数据存到map中
|
Map<String,Object> map=new HashMap<>();//将主表数据存到map中
|
||||||
Map<String,Object> mapDetails=new HashMap<>();//将子表数据存到map中
|
List<Map<String,Object>> mapDetails=new ArrayList<>();//将子表数据存到map中
|
||||||
if(comparisonEntities !=null && comparisonEntities.size()>0) {
|
if(comparisonEntities !=null && comparisonEntities.size()>0) {
|
||||||
map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity);
|
map=spliceMainMap(comparisonEntities,jsonObjectMain,map,comparisonEntity,comparisonDetailsEntity);
|
||||||
mapDetails=spliceDetailMap(comparisonEntities,mapDetails,comparisonDetailsEntity,jsonArray);
|
|
||||||
map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||||
map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||||
map.put("org_id", "0");
|
map.put("org_id", "0");
|
||||||
|
@ -303,26 +308,37 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
return BaseResult.getFailureMessageEntity("更新失败",e.getMessage());
|
return BaseResult.getFailureMessageEntity("更新失败",e.getMessage());
|
||||||
}*/
|
}*/
|
||||||
try {
|
try {
|
||||||
|
List<JSONObject> jsonObjects=new ArrayList<>();
|
||||||
|
JSONObject jsonObjectList=new JSONObject();
|
||||||
//保存主表数据
|
//保存主表数据
|
||||||
Integer integer = comparisonDao.updateComparisonByType(comparisonEntity);
|
Integer integer = comparisonDao.updateComparisonByType(comparisonEntity);
|
||||||
if (integer > 0) {
|
jsonObjectList.put(comparisonEntity.getDbName(),map);
|
||||||
|
if (integer>0) {
|
||||||
//保存子表数据
|
//保存子表数据
|
||||||
if (mapDetails != null && mapDetails.size() > 0) {
|
if (jsonArray != null && jsonArray.size() > 0) {
|
||||||
mapDetails.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
mapDetails=spliceDetailMap(comparisonEntities,mapDetails,jsonArray);
|
||||||
mapDetails.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
for (Map<String, Object> mapDetail : mapDetails) {
|
||||||
mapDetails.put("org_id", "0");
|
mapDetail.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||||
mapDetails.put("modify_time", new Date());
|
mapDetail.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||||
mapDetails.put("sts", "Y");
|
mapDetail.put("org_id", "0");
|
||||||
mapDetails.put("data_status","F");//数据状态
|
mapDetail.put("modify_time", new Date());
|
||||||
comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id"));
|
mapDetail.put("sts", "Y");
|
||||||
comparisonDetailsEntity.setMapDetails(mapDetails);
|
mapDetail.put("data_status","F");//数据状态
|
||||||
|
//comparisonDetailsEntity.setFormmainId(jsonObjectMain.getString("id"));
|
||||||
|
comparisonDetailsEntity.setId(String.valueOf(mapDetail.get("id")));
|
||||||
|
comparisonDetailsEntity.setMapDetails(mapDetail);
|
||||||
comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity);
|
comparisonDetailsDao.updateComparisonDetailsByType(comparisonDetailsEntity);
|
||||||
//保存操作日志
|
//保存操作日志
|
||||||
// controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log");
|
// controlsLogDaoimpl.saveControlsLog(comparisonDetailsEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonDetailsEntity.getDbName()+"_option_log");
|
||||||
}
|
}
|
||||||
|
jsonObjectList.put(comparisonDetailsEntity.getDbName(),mapDetails);
|
||||||
|
}else{
|
||||||
|
jsonObjectList.put(comparisonDetailsEntity.getDbName(),new ArrayList<>());
|
||||||
|
}
|
||||||
|
jsonObjects.add(jsonObjectList);
|
||||||
//保存操作日志
|
//保存操作日志
|
||||||
controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log");
|
controlsLogDaoimpl.saveControlsLog(comparisonEntity.getId(),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口更新",jsonObject.getString("optionName"),comparisonEntity.getDbName()+"_option_log");
|
||||||
return BaseResult.getSuccessMessageEntity("更新成功", integer);
|
return BaseResult.getSuccessMessageEntity("更新成功", jsonObjects);
|
||||||
}else{
|
}else{
|
||||||
return BaseResult.getFailureMessageEntity("更新失败");
|
return BaseResult.getFailureMessageEntity("更新失败");
|
||||||
}
|
}
|
||||||
|
@ -436,7 +452,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
}
|
}
|
||||||
|
|
||||||
//得到主表数据
|
//得到主表数据
|
||||||
private Map<String,Object> spliceMainMap(List<ComparisonEntity> comparisonEntities,JSONObject jsonObjectMain,Map<String, Object> map,ComparisonEntity comparisonEntity){
|
private Map<String,Object> spliceMainMap(List<ComparisonEntity> comparisonEntities,JSONObject jsonObjectMain,Map<String, Object> map,ComparisonEntity comparisonEntity,ComparisonDetailsEntity comparisonDetailsEntity){
|
||||||
for (ComparisonEntity entity : comparisonEntities) {
|
for (ComparisonEntity entity : comparisonEntities) {
|
||||||
//遍历主表下面的所有key,字段名
|
//遍历主表下面的所有key,字段名
|
||||||
for (String key : jsonObjectMain.keySet()) {
|
for (String key : jsonObjectMain.keySet()) {
|
||||||
|
@ -447,27 +463,29 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
map.put(key, jsonObjectMain.getString(key));
|
map.put(key, jsonObjectMain.getString(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(entity.getDbType().equals("2")){
|
||||||
|
comparisonDetailsEntity.setDbName(entity.getDbName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
//得到明细表数据
|
//得到明细表数据
|
||||||
private Map<String,Object> spliceDetailMap(List<ComparisonEntity> comparisonEntities,Map<String, Object> mapDetails,ComparisonDetailsEntity comparisonDetailsEntity,JSONArray jsonArray){
|
private List<Map<String, Object>> spliceDetailMap(List<ComparisonEntity> comparisonEntities,List<Map<String, Object>> mapDetails,JSONArray jsonArray){
|
||||||
if (jsonArray != null && jsonArray.size() > 0) {
|
if (jsonArray != null && jsonArray.size() > 0) {
|
||||||
for (Object object : jsonArray) {
|
for (Object object : jsonArray) {
|
||||||
JSONObject jsonObjectDetails = (JSONObject) JSON.toJSON(object);
|
JSONObject jsonObjectDetails = (JSONObject) JSON.toJSON(object);
|
||||||
for (ComparisonEntity entity : comparisonEntities) {
|
JSONObject jsonObject=new JSONObject();
|
||||||
//遍历主表下面的所有key,字段名
|
//遍历主表下面的所有key,字段名
|
||||||
for (String key : jsonObjectDetails.keySet()) {
|
for (String key : jsonObjectDetails.keySet()) {
|
||||||
if (entity.getDbType().equals("2")) {
|
for (ComparisonEntity entity : comparisonEntities) {
|
||||||
comparisonDetailsEntity.setDbName(entity.getDbName());
|
if (entity.getDbType().equals("2") && entity.getEnName().equals(key)) {
|
||||||
if(entity.getEnName().equals(key)){
|
jsonObject.put(key,jsonObjectDetails.getString(key));
|
||||||
mapDetails.put(key, jsonObjectDetails.getString(key));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mapDetails.add(jsonObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mapDetails;
|
return mapDetails;
|
||||||
|
@ -518,7 +536,6 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "option":
|
case "option":
|
||||||
//获取主表和明细表的字段信息
|
|
||||||
if(moduleDbEntity.getDbType().equals("3")){
|
if(moduleDbEntity.getDbType().equals("3")){
|
||||||
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity=new MdmModuleDbFiledsEntity();
|
MdmModuleDbFiledsEntity mdmModuleDbFiledsEntity=new MdmModuleDbFiledsEntity();
|
||||||
mdmModuleDbFiledsEntity.setDbId(moduleDbEntity.getId());
|
mdmModuleDbFiledsEntity.setDbId(moduleDbEntity.getId());
|
||||||
|
|
Loading…
Reference in New Issue