主数据修改
This commit is contained in:
parent
772a2e86f5
commit
4e94526a30
|
@ -2,7 +2,6 @@ package com.hzya.frame.plugin.mdmDistribute.plugin;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hzya.frame.base.PluginBaseEntity;
|
import com.hzya.frame.base.PluginBaseEntity;
|
||||||
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
|
import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao;
|
||||||
|
@ -15,6 +14,8 @@ import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao;
|
||||||
import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity;
|
import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity;
|
||||||
import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao;
|
import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao;
|
||||||
import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity;
|
import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity;
|
||||||
import com.hzya.frame.mdm.service.IMdmServiceCache;
|
import com.hzya.frame.mdm.service.IMdmServiceCache;
|
||||||
import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao;
|
import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao;
|
||||||
import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity;
|
import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity;
|
||||||
|
@ -24,10 +25,9 @@ import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
|
||||||
import com.hzya.frame.sysnew.application.script.dao.ISysApplicationScriptDao;
|
import com.hzya.frame.sysnew.application.script.dao.ISysApplicationScriptDao;
|
||||||
import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity;
|
import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity;
|
||||||
import com.hzya.frame.sysnew.grovy.service.IGroovyIntegrationService;
|
import com.hzya.frame.sysnew.grovy.service.IGroovyIntegrationService;
|
||||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao;
|
|
||||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity;
|
||||||
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
|
import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService;
|
||||||
import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity;
|
import com.hzya.frame.uuid.UUIDUtils;
|
||||||
import com.hzya.frame.web.entity.BaseResult;
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
import org.apache.http.HttpEntity;
|
import org.apache.http.HttpEntity;
|
||||||
|
@ -40,12 +40,12 @@ import org.apache.http.impl.client.HttpClientBuilder;
|
||||||
import org.apache.http.util.EntityUtils;
|
import org.apache.http.util.EntityUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Method;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -78,6 +78,8 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
||||||
private IMdmModuleDao mdmModuleDao;
|
private IMdmModuleDao mdmModuleDao;
|
||||||
@Resource
|
@Resource
|
||||||
private IMdmServiceCache mdmServiceCache;
|
private IMdmServiceCache mdmServiceCache;
|
||||||
|
@Resource
|
||||||
|
private IMdmModuleSendLogDao mdmModuleSendLogDao;
|
||||||
|
|
||||||
@Value("${ax.url}")
|
@Value("${ax.url}")
|
||||||
private String url ;
|
private String url ;
|
||||||
|
@ -387,7 +389,6 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
||||||
if(mdmModuleDistributeEntities == null || mdmModuleDistributeEntities.size() == 0){
|
if(mdmModuleDistributeEntities == null || mdmModuleDistributeEntities.size() == 0){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) {
|
|
||||||
//查询主数据db
|
//查询主数据db
|
||||||
MdmModuleDbEntity queryMdmModuleDbEntity = new MdmModuleDbEntity();
|
MdmModuleDbEntity queryMdmModuleDbEntity = new MdmModuleDbEntity();
|
||||||
queryMdmModuleDbEntity.setMdmId(mdmModuleEntities.get(i).getId());
|
queryMdmModuleDbEntity.setMdmId(mdmModuleEntities.get(i).getId());
|
||||||
|
@ -402,29 +403,20 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
||||||
if(mdmModuleDbFiledsEntities == null || mdmModuleDbFiledsEntities.size() == 0){
|
if(mdmModuleDbFiledsEntities == null || mdmModuleDbFiledsEntities.size() == 0){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//查询下发的配置
|
//字段的规则
|
||||||
MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ;
|
MdmModuleDbFiledsRuleEntity queryFildRule = new MdmModuleDbFiledsRuleEntity();
|
||||||
mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId());
|
queryFildRule.setMdmId(mdmModuleEntities.get(i).getId());
|
||||||
mdmModuleDistributeDetailEntity.setSts("Y");
|
queryFildRule.setRuleCode("service");
|
||||||
List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity);
|
List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//新增
|
||||||
|
doAdd(mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities);
|
||||||
|
//修改
|
||||||
|
doUpdate(mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities);
|
||||||
|
//删除
|
||||||
|
doDelete(mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//查询一千条数据
|
|
||||||
|
|
||||||
//查询这一千条数据是否符合规则
|
|
||||||
|
|
||||||
//查询是否已经手动发送过。只有新增校验,查询发送日志是否已经有这条数据
|
|
||||||
|
|
||||||
//组装数据发送
|
|
||||||
|
|
||||||
//保存日志
|
|
||||||
|
|
||||||
//所有下发发送完成,修改数据状态
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -436,6 +428,512 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
|
||||||
return BaseResult.getSuccessMessageEntity("执行成功");
|
return BaseResult.getSuccessMessageEntity("执行成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void doDelete(List<MdmModuleDbEntity> mdmModuleDbEntities, List<MdmModuleDistributeEntity> mdmModuleDistributeEntities, List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities, List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities) {
|
||||||
|
//查询一千条数据
|
||||||
|
String mainDb = null;
|
||||||
|
List<JSONObject> objects = new ArrayList<>();
|
||||||
|
for (int i2 = 0; i2 < mdmModuleDbEntities.size(); i2++) {
|
||||||
|
if("1".equals(mdmModuleDbEntities.get(i2).getDbType())) {
|
||||||
|
mainDb = mdmModuleDbEntities.get(i2).getDbName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mainDb == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Map<String, Object> map1 = new HashMap<>();
|
||||||
|
map1.put("tableName",mainDb);
|
||||||
|
map1.put("dataStatus", "N");
|
||||||
|
map1.put("deleteStatus", "0");
|
||||||
|
map1.put("size", 1000);
|
||||||
|
objects = mdmModuleDao.queryMdmSTs(map1);
|
||||||
|
|
||||||
|
if(objects == null || objects.size() == 0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) {
|
||||||
|
//查询下发的配置
|
||||||
|
MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ;
|
||||||
|
mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId());
|
||||||
|
mdmModuleDistributeDetailEntity.setSts("Y");
|
||||||
|
List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity);
|
||||||
|
//查询这一千条数据是否符合规则
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("tableName", mainDb);
|
||||||
|
map.put("dataStatus", "N");
|
||||||
|
map.put("deleteStatus", "0");
|
||||||
|
map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities);
|
||||||
|
map.put("ids", objects);
|
||||||
|
List<JSONObject> doObjects = mdmModuleDao.queryMdmSTs(map);
|
||||||
|
if(doObjects == null || doObjects.size() == 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(mdmModuleDistributeEntities.get(i1).getDeleteApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getDeleteApi())){
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"3");
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getDeleteApi());
|
||||||
|
if(apiEntity == null || apiEntity.getId() == null ){
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"3");
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId());
|
||||||
|
if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3");
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
SysApplicationScriptEntity scriptEntity = null;
|
||||||
|
if(mdmModuleDistributeEntities.get(i1).getDeleteScript() != null && !"".equals(mdmModuleDistributeEntities.get(i1).getDeleteScript())){
|
||||||
|
scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getDeleteScript());
|
||||||
|
if(scriptEntity == null || scriptEntity.getId() == null ){
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3");
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
//查询发送日志是否已经有这条数据
|
||||||
|
MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity();
|
||||||
|
mdmModuleSendLogEntity.setTableName(mainDb+"_send_log");
|
||||||
|
mdmModuleSendLogEntity.setFormmainId(doObjects.get(i).getString("id"));
|
||||||
|
mdmModuleSendLogEntity.setSts("Y");
|
||||||
|
mdmModuleSendLogEntity.setOptionType("3");
|
||||||
|
Integer num = mdmModuleSendLogDao.getCount(mdmModuleSendLogEntity);
|
||||||
|
if(num > 0){//已经过不发送
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities);
|
||||||
|
|
||||||
|
//执行脚本
|
||||||
|
JSONObject groovy = new JSONObject();
|
||||||
|
JSONObject parameterJson = new JSONObject();
|
||||||
|
parameterJson.put("header",apiEntity.getHeaderIn());
|
||||||
|
parameterJson.put("body",apiEntity.getBodyIn());
|
||||||
|
parameterJson.put("query",apiEntity.getQueryIn());
|
||||||
|
parameterJson.put("data",doObjects.get(i));
|
||||||
|
/** head */
|
||||||
|
Map<String, String> header = null;
|
||||||
|
/** query */
|
||||||
|
String querys = null;
|
||||||
|
/** body */
|
||||||
|
String bodys = doObjects.get(i).toJSONString();
|
||||||
|
if(scriptEntity != null && scriptEntity.getId() != null ){
|
||||||
|
groovy.put("code",scriptEntity.getScriptCode());
|
||||||
|
groovy.put("className",scriptEntity.getClassName());
|
||||||
|
groovy.put("name",scriptEntity.getScriptName());
|
||||||
|
groovy.put("methodStr",scriptEntity.getScriptData());
|
||||||
|
groovy.put("parameterJson",parameterJson);
|
||||||
|
JSONObject groovyStr = new JSONObject();
|
||||||
|
groovyStr.put("jsonStr",groovy);
|
||||||
|
try {
|
||||||
|
SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy);
|
||||||
|
header = jsonResultEntity.getHeaders();
|
||||||
|
querys = jsonResultEntity.getQuerys();
|
||||||
|
bodys = jsonResultEntity.getBodys();
|
||||||
|
}catch (Exception e){
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Map<String, String> headers = new HashMap<>();
|
||||||
|
headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj");
|
||||||
|
headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=");
|
||||||
|
headers.put("appId",sysApplicationEntity.getAppId().toString());
|
||||||
|
headers.put("apiCode",apiEntity.getApiCode().toString());
|
||||||
|
if(header != null){
|
||||||
|
headers.putAll(header);
|
||||||
|
}
|
||||||
|
//组装数据发送
|
||||||
|
JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys);
|
||||||
|
if(jsonResultEntity.isFlag()){
|
||||||
|
//保存日志
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3");
|
||||||
|
continue;
|
||||||
|
}else {
|
||||||
|
//保存日志
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"3");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//所有下发发送完成,修改数据状态
|
||||||
|
for (int i = 0; i < objects.size(); i++) {
|
||||||
|
Map<String, Object> updateMap = new HashMap<>();
|
||||||
|
updateMap.put("tableName",mainDb);
|
||||||
|
updateMap.put("dataStatus", "N");
|
||||||
|
updateMap.put("deleteStatus", "1");
|
||||||
|
updateMap.put("id", objects.get(i).getString("id"));
|
||||||
|
mdmModuleDao.updateMdmSTs(updateMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doUpdate(List<MdmModuleDbEntity> mdmModuleDbEntities, List<MdmModuleDistributeEntity> mdmModuleDistributeEntities, List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities, List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities) {
|
||||||
|
//查询一千条数据
|
||||||
|
String mainDb = null;
|
||||||
|
List<JSONObject> objects = new ArrayList<>();
|
||||||
|
for (int i2 = 0; i2 < mdmModuleDbEntities.size(); i2++) {
|
||||||
|
if("1".equals(mdmModuleDbEntities.get(i2).getDbType())) {
|
||||||
|
mainDb = mdmModuleDbEntities.get(i2).getDbName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mainDb == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Map<String, Object> map1 = new HashMap<>();
|
||||||
|
map1.put("tableName",mainDb);
|
||||||
|
map1.put("dataStatus", "F");
|
||||||
|
map1.put("updateStatus", "0");
|
||||||
|
map1.put("size", 1000);
|
||||||
|
objects = mdmModuleDao.queryMdmSTs(map1);
|
||||||
|
|
||||||
|
if(objects == null || objects.size() == 0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) {
|
||||||
|
//查询下发的配置
|
||||||
|
MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ;
|
||||||
|
mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId());
|
||||||
|
mdmModuleDistributeDetailEntity.setSts("Y");
|
||||||
|
List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity);
|
||||||
|
//查询这一千条数据是否符合规则
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("tableName", mainDb);
|
||||||
|
map.put("dataStatus", "F");
|
||||||
|
map.put("updateStatus", "0");
|
||||||
|
map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities);
|
||||||
|
map.put("ids", objects);
|
||||||
|
List<JSONObject> doObjects = mdmModuleDao.queryMdmSTs(map);
|
||||||
|
if(doObjects == null || doObjects.size() == 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(mdmModuleDistributeEntities.get(i1).getUpdateApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getUpdateApi())){
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"2");
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getUpdateApi());
|
||||||
|
if(apiEntity == null || apiEntity.getId() == null ){
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"2");
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId());
|
||||||
|
if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2");
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
SysApplicationScriptEntity scriptEntity = null;
|
||||||
|
if(mdmModuleDistributeEntities.get(i1).getUpdateScript() != null && !"".equals(mdmModuleDistributeEntities.get(i1).getUpdateScript())){
|
||||||
|
scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getUpdateScript());
|
||||||
|
if(scriptEntity == null || scriptEntity.getId() == null ){
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2");
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
|
||||||
|
getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities);
|
||||||
|
|
||||||
|
//执行脚本
|
||||||
|
JSONObject groovy = new JSONObject();
|
||||||
|
JSONObject parameterJson = new JSONObject();
|
||||||
|
parameterJson.put("header",apiEntity.getHeaderIn());
|
||||||
|
parameterJson.put("body",apiEntity.getBodyIn());
|
||||||
|
parameterJson.put("query",apiEntity.getQueryIn());
|
||||||
|
parameterJson.put("data",doObjects.get(i));
|
||||||
|
/** head */
|
||||||
|
Map<String, String> header = null;
|
||||||
|
/** query */
|
||||||
|
String querys = null;
|
||||||
|
/** body */
|
||||||
|
String bodys = doObjects.get(i).toJSONString();
|
||||||
|
if(scriptEntity != null && scriptEntity.getId() != null ){
|
||||||
|
groovy.put("code",scriptEntity.getScriptCode());
|
||||||
|
groovy.put("className",scriptEntity.getClassName());
|
||||||
|
groovy.put("name",scriptEntity.getScriptName());
|
||||||
|
groovy.put("methodStr",scriptEntity.getScriptData());
|
||||||
|
groovy.put("parameterJson",parameterJson);
|
||||||
|
JSONObject groovyStr = new JSONObject();
|
||||||
|
groovyStr.put("jsonStr",groovy);
|
||||||
|
try {
|
||||||
|
SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy);
|
||||||
|
header = jsonResultEntity.getHeaders();
|
||||||
|
querys = jsonResultEntity.getQuerys();
|
||||||
|
bodys = jsonResultEntity.getBodys();
|
||||||
|
}catch (Exception e){
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Map<String, String> headers = new HashMap<>();
|
||||||
|
headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj");
|
||||||
|
headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=");
|
||||||
|
headers.put("appId",sysApplicationEntity.getAppId().toString());
|
||||||
|
headers.put("apiCode",apiEntity.getApiCode().toString());
|
||||||
|
if(header != null){
|
||||||
|
headers.putAll(header);
|
||||||
|
}
|
||||||
|
//组装数据发送
|
||||||
|
JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys);
|
||||||
|
if(jsonResultEntity.isFlag()){
|
||||||
|
//保存日志
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2");
|
||||||
|
continue;
|
||||||
|
}else {
|
||||||
|
//保存日志
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"2");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//所有下发发送完成,修改数据状态
|
||||||
|
for (int i = 0; i < objects.size(); i++) {
|
||||||
|
Map<String, Object> updateMap = new HashMap<>();
|
||||||
|
updateMap.put("tableName",mainDb);
|
||||||
|
updateMap.put("dataStatus", "F");
|
||||||
|
updateMap.put("updateStatus", "1");
|
||||||
|
updateMap.put("id", objects.get(i).getString("id"));
|
||||||
|
mdmModuleDao.updateMdmSTs(updateMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author lvleigang
|
||||||
|
* @Description 处理新增数据
|
||||||
|
* @Date 1:55 下午 2024/6/19
|
||||||
|
* @param mdmModuleDbEntities
|
||||||
|
* @param mdmModuleDistributeEntities
|
||||||
|
* @return void
|
||||||
|
**/
|
||||||
|
private void doAdd(List<MdmModuleDbEntity> mdmModuleDbEntities, List<MdmModuleDistributeEntity> mdmModuleDistributeEntities,List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities,List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities ) {
|
||||||
|
//查询一千条数据
|
||||||
|
String mainDb = null;
|
||||||
|
List<JSONObject> objects = new ArrayList<>();
|
||||||
|
for (int i2 = 0; i2 < mdmModuleDbEntities.size(); i2++) {
|
||||||
|
if("1".equals(mdmModuleDbEntities.get(i2).getDbType())) {
|
||||||
|
mainDb = mdmModuleDbEntities.get(i2).getDbName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mainDb == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Map<String, Object> map1 = new HashMap<>();
|
||||||
|
map1.put("tableName",mainDb);
|
||||||
|
map1.put("dataStatus", "Y");
|
||||||
|
map1.put("addStatus", "0");
|
||||||
|
map1.put("size", 1000);
|
||||||
|
objects = mdmModuleDao.queryMdmSTs(map1);
|
||||||
|
|
||||||
|
if(objects == null || objects.size() == 0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) {
|
||||||
|
//查询下发的配置
|
||||||
|
MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ;
|
||||||
|
mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId());
|
||||||
|
mdmModuleDistributeDetailEntity.setSts("Y");
|
||||||
|
List<MdmModuleDistributeDetailEntity> mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity);
|
||||||
|
//查询这一千条数据是否符合规则
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("tableName", mainDb);
|
||||||
|
map.put("dataStatus", "Y");
|
||||||
|
map.put("addStatus", "0");
|
||||||
|
map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities);
|
||||||
|
map.put("ids", objects);
|
||||||
|
List<JSONObject> doObjects = mdmModuleDao.queryMdmSTs(map);
|
||||||
|
if(doObjects == null || doObjects.size() == 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(mdmModuleDistributeEntities.get(i1).getAddApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getAddApi())){
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"1");
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getAddApi());
|
||||||
|
if(apiEntity == null || apiEntity.getId() == null ){
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,null,doObjects.get(i).toJSONString(),"1");
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId());
|
||||||
|
if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),null,apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1");
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
SysApplicationScriptEntity scriptEntity = null;
|
||||||
|
if(mdmModuleDistributeEntities.get(i1).getAddScript() != null && !"".equals(mdmModuleDistributeEntities.get(i1).getAddScript())){
|
||||||
|
scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getAddScript());
|
||||||
|
if(scriptEntity == null || scriptEntity.getId() == null ){
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1");
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < doObjects.size(); i++) {
|
||||||
|
//查询是否已经手动发送过。只有新增校验,查询发送日志是否已经有这条数据
|
||||||
|
MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity();
|
||||||
|
mdmModuleSendLogEntity.setTableName(mainDb+"_send_log");
|
||||||
|
mdmModuleSendLogEntity.setFormmainId(doObjects.get(i).getString("id"));
|
||||||
|
mdmModuleSendLogEntity.setSts("Y");
|
||||||
|
mdmModuleSendLogEntity.setOptionType("1");
|
||||||
|
Integer num = mdmModuleSendLogDao.getCount(mdmModuleSendLogEntity);
|
||||||
|
if(num > 0){//已经新增过不发送
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities);
|
||||||
|
|
||||||
|
//执行脚本
|
||||||
|
JSONObject groovy = new JSONObject();
|
||||||
|
JSONObject parameterJson = new JSONObject();
|
||||||
|
parameterJson.put("header",apiEntity.getHeaderIn());
|
||||||
|
parameterJson.put("body",apiEntity.getBodyIn());
|
||||||
|
parameterJson.put("query",apiEntity.getQueryIn());
|
||||||
|
parameterJson.put("data",doObjects.get(i));
|
||||||
|
/** head */
|
||||||
|
Map<String, String> header = null;
|
||||||
|
/** query */
|
||||||
|
String querys = null;
|
||||||
|
/** body */
|
||||||
|
String bodys = doObjects.get(i).toJSONString();
|
||||||
|
if(scriptEntity != null && scriptEntity.getId() != null ){
|
||||||
|
groovy.put("code",scriptEntity.getScriptCode());
|
||||||
|
groovy.put("className",scriptEntity.getClassName());
|
||||||
|
groovy.put("name",scriptEntity.getScriptName());
|
||||||
|
groovy.put("methodStr",scriptEntity.getScriptData());
|
||||||
|
groovy.put("parameterJson",parameterJson);
|
||||||
|
JSONObject groovyStr = new JSONObject();
|
||||||
|
groovyStr.put("jsonStr",groovy);
|
||||||
|
try {
|
||||||
|
SysExtensionApiEntity jsonResultEntity = groovyIntegrationService.groovyScriptExecution(groovy);
|
||||||
|
header = jsonResultEntity.getHeaders();
|
||||||
|
querys = jsonResultEntity.getQuerys();
|
||||||
|
bodys = jsonResultEntity.getBodys();
|
||||||
|
}catch (Exception e){
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Map<String, String> headers = new HashMap<>();
|
||||||
|
headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj");
|
||||||
|
headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=");
|
||||||
|
headers.put("appId",sysApplicationEntity.getAppId().toString());
|
||||||
|
headers.put("apiCode",apiEntity.getApiCode().toString());
|
||||||
|
if(header != null){
|
||||||
|
headers.putAll(header);
|
||||||
|
}
|
||||||
|
//组装数据发送
|
||||||
|
JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys);
|
||||||
|
if(jsonResultEntity.isFlag()){
|
||||||
|
//保存日志
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1");
|
||||||
|
continue;
|
||||||
|
}else {
|
||||||
|
//保存日志
|
||||||
|
saveMdmModuleSendLogEntity(objects.get(i).getString("id"),sysApplicationEntity.getName(),apiEntity.getApiName(),doObjects.get(i).toJSONString(),"1");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//所有下发发送完成,修改数据状态
|
||||||
|
for (int i = 0; i < objects.size(); i++) {
|
||||||
|
Map<String, Object> updateMap = new HashMap<>();
|
||||||
|
updateMap.put("tableName",mainDb);
|
||||||
|
updateMap.put("dataStatus", "Y");
|
||||||
|
updateMap.put("addStatus", "1");
|
||||||
|
updateMap.put("id", objects.get(i).getString("id"));
|
||||||
|
mdmModuleDao.updateMdmSTs(updateMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void saveMdmModuleSendLogEntity(String formmain_id,String target_app,String target_api,String source_data, String option_type) {
|
||||||
|
MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity();
|
||||||
|
mdmModuleSendLogEntity.setCreate();
|
||||||
|
mdmModuleSendLogEntity.setId(UUIDUtils.getUUID());
|
||||||
|
mdmModuleSendLogEntity.setSts("Y");
|
||||||
|
mdmModuleSendLogEntity.setCreate_user_id("1");
|
||||||
|
mdmModuleSendLogEntity.setModify_user_id("1");
|
||||||
|
mdmModuleSendLogEntity.setCreate_time(new Date());
|
||||||
|
mdmModuleSendLogEntity.setModify_time(new Date());
|
||||||
|
mdmModuleSendLogEntity.setOrg_id("0");
|
||||||
|
mdmModuleSendLogEntity.setCompanyId("0");
|
||||||
|
mdmModuleSendLogEntity.setFormmainId(formmain_id);
|
||||||
|
mdmModuleSendLogEntity.setTargetApp(target_app);
|
||||||
|
mdmModuleSendLogEntity.setTargetApi(target_api);
|
||||||
|
mdmModuleSendLogEntity.setSourceData(source_data);
|
||||||
|
mdmModuleSendLogEntity.setOptionType(option_type);
|
||||||
|
mdmModuleSendLogDao.save(mdmModuleSendLogEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
private JSONObject getDetailData(List<MdmModuleDbEntity> mdmModuleDbEntities, JSONObject object, List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities,List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities) {
|
||||||
|
|
||||||
|
for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
|
||||||
|
if("2".equals(mdmModuleDbEntities.get(i).getDbType())){
|
||||||
|
Map<String,String> map = new HashMap<>();
|
||||||
|
map.put("tableName",mdmModuleDbEntities.get(i).getDbName());
|
||||||
|
map.put("formmainId",object.getString("id"));
|
||||||
|
List<JSONObject> detail = mdmModuleDao.queryMdmSTDetail(map);
|
||||||
|
//查看主表是否有字段是关联的
|
||||||
|
if(detail != null && detail.size() > 0){
|
||||||
|
if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){
|
||||||
|
for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) {
|
||||||
|
if(mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i).getId())){
|
||||||
|
if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
|
||||||
|
for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) {
|
||||||
|
if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){
|
||||||
|
for (int i3 = 0; i3 < detail.size(); i3++) {
|
||||||
|
Map<String,Object> mapDetail = new HashMap<>();
|
||||||
|
mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue());
|
||||||
|
mapDetail.put("id",detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()));
|
||||||
|
JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail);
|
||||||
|
detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
object.put(mdmModuleDbEntities.get(i).getDbName(),detail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private JsonResultEntity sendData(SysApplicationApiEntity applicationApiEntity, Map<String, String> headers ,String bodys ,String querys) {
|
private JsonResultEntity sendData(SysApplicationApiEntity applicationApiEntity, Map<String, String> headers ,String bodys ,String querys) {
|
||||||
StringBuffer urls = new StringBuffer(url);
|
StringBuffer urls = new StringBuffer(url);
|
||||||
if (querys != null) {
|
if (querys != null) {
|
||||||
|
|
|
@ -9,6 +9,8 @@ public class MdmQuery {
|
||||||
|
|
||||||
//分页
|
//分页
|
||||||
private Integer pageNum;
|
private Integer pageNum;
|
||||||
|
//分页
|
||||||
|
private Long mdmCode;
|
||||||
private Integer pageSize;
|
private Integer pageSize;
|
||||||
//表名
|
//表名
|
||||||
private String tableName;
|
private String tableName;
|
||||||
|
@ -66,4 +68,12 @@ public class MdmQuery {
|
||||||
public void setDetailQueryCondition(List<MdmQuery> detailQueryCondition) {
|
public void setDetailQueryCondition(List<MdmQuery> detailQueryCondition) {
|
||||||
this.detailQueryCondition = detailQueryCondition;
|
this.detailQueryCondition = detailQueryCondition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getMdmCode() {
|
||||||
|
return mdmCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMdmCode(Long mdmCode) {
|
||||||
|
this.mdmCode = mdmCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,5 +52,8 @@ public interface IMdmModuleDao extends IBaseDao<MdmModuleEntity, String> {
|
||||||
JSONObject queryMdmST(Map<String, Object> maps);
|
JSONObject queryMdmST(Map<String, Object> maps);
|
||||||
List<JSONObject> queryMdmSTDetail(Map<String, String> maps);
|
List<JSONObject> queryMdmSTDetail(Map<String, String> maps);
|
||||||
|
|
||||||
|
List<JSONObject> queryMdmSTs(Map<String, Object> map);
|
||||||
|
|
||||||
|
void updateMdmSTs(Map<String, Object> updateMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,6 +152,16 @@ public class MdmModuleDaoImpl extends MybatisGenericDao<MdmModuleEntity, String>
|
||||||
JSONObject o = (JSONObject) super.selectOne(getSqlIdPrifx() + "queryMdmST", maps);
|
JSONObject o = (JSONObject) super.selectOne(getSqlIdPrifx() + "queryMdmST", maps);
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public List<JSONObject> queryMdmSTs(Map<String, Object> maps) {
|
||||||
|
List<JSONObject> o = (List<JSONObject>) super.selectList(getSqlIdPrifx() + "queryMdmST", maps);
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateMdmSTs(Map<String, Object> maps) {
|
||||||
|
super.update(getSqlIdPrifx() + "updateMdmSTs", maps);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<JSONObject> queryMdmSTDetail(Map<String, String> maps) {
|
public List<JSONObject> queryMdmSTDetail(Map<String, String> maps) {
|
||||||
|
|
|
@ -751,7 +751,8 @@ where id = #{id}
|
||||||
</insert>
|
</insert>
|
||||||
<update id="deleteTemplateById" parameterType="com.hzya.frame.sys.entity.FormmainDeleteDto">
|
<update id="deleteTemplateById" parameterType="com.hzya.frame.sys.entity.FormmainDeleteDto">
|
||||||
update ${tableName} set
|
update ${tableName} set
|
||||||
sts='N',modify_time = now(),modify_user_id = #{loginId}
|
data_status ='N',modify_time = now(),modify_user_id = #{loginId}
|
||||||
|
<if test="formmain_id == null ">,delete_status = '0' </if>
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id !='' ">and id = #{id}</if>
|
<if test="id != null and id !='' ">and id = #{id}</if>
|
||||||
<if test="formmain_id != null and formmain_id !='' ">and formmain_id = #{formmain_id}</if>
|
<if test="formmain_id != null and formmain_id !='' ">and formmain_id = #{formmain_id}</if>
|
||||||
|
@ -761,7 +762,7 @@ where id = #{id}
|
||||||
|
|
||||||
<update id="deleteChilder" parameterType="com.hzya.frame.sys.entity.FormmainDeleteDto">
|
<update id="deleteChilder" parameterType="com.hzya.frame.sys.entity.FormmainDeleteDto">
|
||||||
update ${tableName} set
|
update ${tableName} set
|
||||||
sts='N',modify_time = now(),modify_user_id = #{loginId}
|
data_status='N',modify_time = now(),modify_user_id = #{loginId},delete_status = '0'
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="upIdFiled != null and upIdFiled !='' and upIdFiledValue != null and upIdFiledValue !=''">
|
<if test="upIdFiled != null and upIdFiled !='' and upIdFiledValue != null and upIdFiledValue !=''">
|
||||||
and ${upIdFiled} like concat(#{upIdFiledValue},'%')
|
and ${upIdFiled} like concat(#{upIdFiledValue},'%')
|
||||||
|
@ -803,6 +804,10 @@ where id = #{id}
|
||||||
select * from ${tableName}
|
select * from ${tableName}
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="documentRule != null and documentRule !='' ">and document_rule = #{documentRule}</if>
|
<if test="documentRule != null and documentRule !='' ">and document_rule = #{documentRule}</if>
|
||||||
|
<if test="dataStatus != null and dataStatus !='' ">and data_status = #{dataStatus}</if>
|
||||||
|
<if test="addStatus != null and addStatus !='' ">and add_status = #{addStatus}</if>
|
||||||
|
<if test="updateStatus != null and updateStatus !='' ">and update_status = #{updateStatus}</if>
|
||||||
|
<if test="deleteStatus != null and deleteStatus !='' ">and delete_status = #{deleteStatus}</if>
|
||||||
<if test="id != null and id !='' ">and id = #{id}</if>
|
<if test="id != null and id !='' ">and id = #{id}</if>
|
||||||
<if test="mdmModuleDistributeDetailEntities != null and mdmModuleDistributeDetailEntities.size>0">
|
<if test="mdmModuleDistributeDetailEntities != null and mdmModuleDistributeDetailEntities.size>0">
|
||||||
AND
|
AND
|
||||||
|
@ -825,16 +830,39 @@ where id = #{id}
|
||||||
#{item.filedVaule}
|
#{item.filedVaule}
|
||||||
<choose>
|
<choose>
|
||||||
<when test="item.connectionSymbol == '1'.toString() ">
|
<when test="item.connectionSymbol == '1'.toString() ">
|
||||||
and
|
<choose>
|
||||||
|
<when test="item.rightParenthesis == ')'.toString() ">
|
||||||
|
${item.rightParenthesis} and
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
${item.rightParenthesis}
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
</when>
|
</when>
|
||||||
<when test="item.connectionSymbol == '2'.toString() ">
|
<when test="item.connectionSymbol == '2'.toString() ">
|
||||||
or
|
<choose>
|
||||||
|
<when test="item.rightParenthesis == ')'.toString() ">
|
||||||
|
${item.rightParenthesis} or
|
||||||
</when>
|
</when>
|
||||||
</choose>
|
<otherwise>
|
||||||
${item.rightParenthesis}
|
${item.rightParenthesis}
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
${item.rightParenthesis}
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="ids != null and ids.size>0">
|
||||||
|
AND id in
|
||||||
|
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
|
||||||
|
#{item.id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
and sts = 'Y'
|
and sts = 'Y'
|
||||||
|
<if test="size != null and size !='' ">limit #{size}</if>
|
||||||
</trim>
|
</trim>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -843,5 +871,17 @@ where id = #{id}
|
||||||
parameterType="java.util.HashMap">
|
parameterType="java.util.HashMap">
|
||||||
select * from ${tableName} where sts='Y' and formmain_id = #{formmainId}
|
select * from ${tableName} where sts='Y' and formmain_id = #{formmainId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateMdmSTs" parameterType="java.util.HashMap">
|
||||||
|
update ${tableName} set
|
||||||
|
<trim prefixOverrides=",">
|
||||||
|
<if test="addStatus != null and addStatus !='' ">, add_status = #{addStatus}</if>
|
||||||
|
,modify_time = now()
|
||||||
|
</trim>
|
||||||
|
<trim prefix="where" prefixOverrides="and">
|
||||||
|
<if test="id != null and id !='' ">and id = #{id}</if>
|
||||||
|
<if test="dataStatus != null and dataStatus !='' ">and data_status = #{dataStatus}</if>
|
||||||
|
</trim>
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
@ -558,7 +558,7 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
||||||
documentRule.setShowType("1");
|
documentRule.setShowType("1");
|
||||||
documentRule.setQueryType("1");
|
documentRule.setQueryType("1");
|
||||||
documentRule.setListType("1");
|
documentRule.setListType("1");
|
||||||
documentRule.setViewType("2");
|
documentRule.setViewType("1");
|
||||||
documentRule.setFiledLength("50");
|
documentRule.setFiledLength("50");
|
||||||
documentRule.setCreate();
|
documentRule.setCreate();
|
||||||
documentRule.setDataType("1");
|
documentRule.setDataType("1");
|
||||||
|
@ -780,14 +780,14 @@ public class MdmModuleServiceImpl extends BaseService<MdmModuleEntity, String> i
|
||||||
data_status.setMdmId(entity.getMdmId());
|
data_status.setMdmId(entity.getMdmId());
|
||||||
data_status.setDbId(entity.getId());
|
data_status.setDbId(entity.getId());
|
||||||
data_status.setEnName("data_status");
|
data_status.setEnName("data_status");
|
||||||
data_status.setChName("数据状态 Y正常 N删除 F修改");
|
data_status.setChName("数据状态");
|
||||||
data_status.setFiledType("3");
|
data_status.setFiledType("3");
|
||||||
data_status.setAddType("2");
|
data_status.setAddType("2");
|
||||||
data_status.setUpdateType("2");
|
data_status.setUpdateType("2");
|
||||||
data_status.setShowType("2");
|
data_status.setShowType("2");
|
||||||
data_status.setQueryType("2");
|
data_status.setQueryType("2");
|
||||||
data_status.setListType("2");
|
data_status.setListType("1");
|
||||||
data_status.setViewType("2");
|
data_status.setViewType("1");
|
||||||
data_status.setFiledLength("1");
|
data_status.setFiledLength("1");
|
||||||
data_status.setCreate();
|
data_status.setCreate();
|
||||||
data_status.setDataType("1");
|
data_status.setDataType("1");
|
||||||
|
|
|
@ -76,6 +76,14 @@
|
||||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||||
|
<if test="roletype != null and roletype != ''">
|
||||||
|
and id in (
|
||||||
|
select
|
||||||
|
filed_id
|
||||||
|
from mdm_module_db_fileds_rule
|
||||||
|
where sts='Y' and rule_code = #{roletype} and rule_value = #{roleValue}
|
||||||
|
)
|
||||||
|
</if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.impl.MdmModuleDistributeDetailDaoImpl">
|
<mapper namespace="com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.impl.MdmModuleDistributeDetailDaoImpl">
|
||||||
|
|
||||||
<resultMap id="get-MdmModuleDistributeDetailEntity-result" type="com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity" >
|
<resultMap id="get-MdmModuleDistributeDetailEntity-result"
|
||||||
|
type="com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
||||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||||
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
||||||
<result property="distributeId" column="distribute_id" jdbcType="VARCHAR"/>
|
<result property="distributeId" column="distribute_id" jdbcType="VARCHAR"/>
|
||||||
|
@ -25,7 +26,7 @@
|
||||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<!-- 查询的字段-->
|
<!-- 查询的字段-->
|
||||||
<sql id = "MdmModuleDistributeDetailEntity_Base_Column_List">
|
<sql id="MdmModuleDistributeDetailEntity_Base_Column_List">
|
||||||
id
|
id
|
||||||
,mdm_id
|
,mdm_id
|
||||||
,distribute_id
|
,distribute_id
|
||||||
|
@ -48,196 +49,226 @@
|
||||||
,company_id
|
,company_id
|
||||||
</sql>
|
</sql>
|
||||||
<!-- 查询 采用==查询 -->
|
<!-- 查询 采用==查询 -->
|
||||||
<select id="entity_list_base" resultMap="get-MdmModuleDistributeDetailEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
<select id="entity_list_base" resultMap="get-MdmModuleDistributeDetailEntity-result"
|
||||||
|
parameterType="com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
||||||
select
|
select
|
||||||
<include refid="MdmModuleDistributeDetailEntity_Base_Column_List" />
|
<include refid="MdmModuleDistributeDetailEntity_Base_Column_List"/>
|
||||||
from mdm_module_distribute_detail
|
from mdm_module_distribute_detail
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||||
<if test="distributeId != null and distributeId != ''"> and distribute_id = #{distributeId} </if>
|
<if test="distributeId != null and distributeId != ''">and distribute_id = #{distributeId}</if>
|
||||||
<if test="apiId != null and apiId != ''"> and api_id = #{apiId} </if>
|
<if test="apiId != null and apiId != ''">and api_id = #{apiId}</if>
|
||||||
<if test="dataType != null and dataType != ''"> and data_type = #{dataType} </if>
|
<if test="dataType != null and dataType != ''">and data_type = #{dataType}</if>
|
||||||
<if test="leftBracket != null and leftBracket != ''"> and left_bracket = #{leftBracket} </if>
|
<if test="leftBracket != null and leftBracket != ''">and left_bracket = #{leftBracket}</if>
|
||||||
<if test="filedId != null and filedId != ''"> and filed_id = #{filedId} </if>
|
<if test="filedId != null and filedId != ''">and filed_id = #{filedId}</if>
|
||||||
<if test="filedName != null and filedName != ''"> and filed_name = #{filedName} </if>
|
<if test="filedName != null and filedName != ''">and filed_name = #{filedName}</if>
|
||||||
<if test="compareType != null and compareType != ''"> and compare_type = #{compareType} </if>
|
<if test="compareType != null and compareType != ''">and compare_type = #{compareType}</if>
|
||||||
<if test="filedVaule != null and filedVaule != ''"> and filed_vaule = #{filedVaule} </if>
|
<if test="filedVaule != null and filedVaule != ''">and filed_vaule = #{filedVaule}</if>
|
||||||
<if test="connectionSymbol != null and connectionSymbol != ''"> and connection_symbol = #{connectionSymbol} </if>
|
<if test="connectionSymbol != null and connectionSymbol != ''">and connection_symbol = #{connectionSymbol}
|
||||||
<if test="rightParenthesis != null and rightParenthesis != ''"> and right_parenthesis = #{rightParenthesis} </if>
|
</if>
|
||||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
<if test="rightParenthesis != null and rightParenthesis != ''">and right_parenthesis = #{rightParenthesis}
|
||||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
</if>
|
||||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||||
|
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||||
|
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询符合条件的数量 -->
|
<!-- 查询符合条件的数量 -->
|
||||||
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
<select id="entity_count" resultType="Integer"
|
||||||
|
parameterType="com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
||||||
select count(1) from mdm_module_distribute_detail
|
select count(1) from mdm_module_distribute_detail
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||||
<if test="distributeId != null and distributeId != ''"> and distribute_id = #{distributeId} </if>
|
<if test="distributeId != null and distributeId != ''">and distribute_id = #{distributeId}</if>
|
||||||
<if test="apiId != null and apiId != ''"> and api_id = #{apiId} </if>
|
<if test="apiId != null and apiId != ''">and api_id = #{apiId}</if>
|
||||||
<if test="dataType != null and dataType != ''"> and data_type = #{dataType} </if>
|
<if test="dataType != null and dataType != ''">and data_type = #{dataType}</if>
|
||||||
<if test="leftBracket != null and leftBracket != ''"> and left_bracket = #{leftBracket} </if>
|
<if test="leftBracket != null and leftBracket != ''">and left_bracket = #{leftBracket}</if>
|
||||||
<if test="filedId != null and filedId != ''"> and filed_id = #{filedId} </if>
|
<if test="filedId != null and filedId != ''">and filed_id = #{filedId}</if>
|
||||||
<if test="filedName != null and filedName != ''"> and filed_name = #{filedName} </if>
|
<if test="filedName != null and filedName != ''">and filed_name = #{filedName}</if>
|
||||||
<if test="compareType != null and compareType != ''"> and compare_type = #{compareType} </if>
|
<if test="compareType != null and compareType != ''">and compare_type = #{compareType}</if>
|
||||||
<if test="filedVaule != null and filedVaule != ''"> and filed_vaule = #{filedVaule} </if>
|
<if test="filedVaule != null and filedVaule != ''">and filed_vaule = #{filedVaule}</if>
|
||||||
<if test="connectionSymbol != null and connectionSymbol != ''"> and connection_symbol = #{connectionSymbol} </if>
|
<if test="connectionSymbol != null and connectionSymbol != ''">and connection_symbol = #{connectionSymbol}
|
||||||
<if test="rightParenthesis != null and rightParenthesis != ''"> and right_parenthesis = #{rightParenthesis} </if>
|
</if>
|
||||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
<if test="rightParenthesis != null and rightParenthesis != ''">and right_parenthesis = #{rightParenthesis}
|
||||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
</if>
|
||||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||||
|
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||||
|
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 分页查询列表 采用like格式 -->
|
<!-- 分页查询列表 采用like格式 -->
|
||||||
<select id="entity_list_like" resultMap="get-MdmModuleDistributeDetailEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
<select id="entity_list_like" resultMap="get-MdmModuleDistributeDetailEntity-result"
|
||||||
|
parameterType="com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
||||||
select
|
select
|
||||||
<include refid="MdmModuleDistributeDetailEntity_Base_Column_List" />
|
<include refid="MdmModuleDistributeDetailEntity_Base_Column_List"/>
|
||||||
from mdm_module_distribute_detail
|
from mdm_module_distribute_detail
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||||
<if test="mdmId != null and mdmId != ''"> and mdm_id like concat('%',#{mdmId},'%') </if>
|
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
|
||||||
<if test="distributeId != null and distributeId != ''"> and distribute_id like concat('%',#{distributeId},'%') </if>
|
<if test="distributeId != null and distributeId != ''">and distribute_id like
|
||||||
<if test="apiId != null and apiId != ''"> and api_id like concat('%',#{apiId},'%') </if>
|
concat('%',#{distributeId},'%')
|
||||||
<if test="dataType != null and dataType != ''"> and data_type like concat('%',#{dataType},'%') </if>
|
</if>
|
||||||
<if test="leftBracket != null and leftBracket != ''"> and left_bracket like concat('%',#{leftBracket},'%') </if>
|
<if test="apiId != null and apiId != ''">and api_id like concat('%',#{apiId},'%')</if>
|
||||||
<if test="filedId != null and filedId != ''"> and filed_id like concat('%',#{filedId},'%') </if>
|
<if test="dataType != null and dataType != ''">and data_type like concat('%',#{dataType},'%')</if>
|
||||||
<if test="filedName != null and filedName != ''"> and filed_name like concat('%',#{filedName},'%') </if>
|
<if test="leftBracket != null and leftBracket != ''">and left_bracket like concat('%',#{leftBracket},'%')
|
||||||
<if test="compareType != null and compareType != ''"> and compare_type like concat('%',#{compareType},'%') </if>
|
</if>
|
||||||
<if test="filedVaule != null and filedVaule != ''"> and filed_vaule like concat('%',#{filedVaule},'%') </if>
|
<if test="filedId != null and filedId != ''">and filed_id like concat('%',#{filedId},'%')</if>
|
||||||
<if test="connectionSymbol != null and connectionSymbol != ''"> and connection_symbol like concat('%',#{connectionSymbol},'%') </if>
|
<if test="filedName != null and filedName != ''">and filed_name like concat('%',#{filedName},'%')</if>
|
||||||
<if test="rightParenthesis != null and rightParenthesis != ''"> and right_parenthesis like concat('%',#{rightParenthesis},'%') </if>
|
<if test="compareType != null and compareType != ''">and compare_type like concat('%',#{compareType},'%')
|
||||||
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
</if>
|
||||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
<if test="filedVaule != null and filedVaule != ''">and filed_vaule like concat('%',#{filedVaule},'%')</if>
|
||||||
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
|
<if test="connectionSymbol != null and connectionSymbol != ''">and connection_symbol like
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
concat('%',#{connectionSymbol},'%')
|
||||||
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
|
</if>
|
||||||
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
|
<if test="rightParenthesis != null and rightParenthesis != ''">and right_parenthesis like
|
||||||
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
|
concat('%',#{rightParenthesis},'%')
|
||||||
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
|
</if>
|
||||||
|
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
|
||||||
|
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
|
||||||
|
concat('%',#{create_user_id},'%')
|
||||||
|
</if>
|
||||||
|
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
|
||||||
|
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
|
||||||
|
concat('%',#{modify_user_id},'%')
|
||||||
|
</if>
|
||||||
|
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
|
||||||
|
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
||||||
|
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
||||||
|
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询列表 字段采用or格式 -->
|
<!-- 查询列表 字段采用or格式 -->
|
||||||
<select id="MdmModuleDistributeDetailentity_list_or" resultMap="get-MdmModuleDistributeDetailEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
<select id="MdmModuleDistributeDetailentity_list_or" resultMap="get-MdmModuleDistributeDetailEntity-result"
|
||||||
|
parameterType="com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
||||||
select
|
select
|
||||||
<include refid="MdmModuleDistributeDetailEntity_Base_Column_List" />
|
<include refid="MdmModuleDistributeDetailEntity_Base_Column_List"/>
|
||||||
from mdm_module_distribute_detail
|
from mdm_module_distribute_detail
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
<if test="id != null and id != ''">or id = #{id}</if>
|
||||||
<if test="mdmId != null and mdmId != ''"> or mdm_id = #{mdmId} </if>
|
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
|
||||||
<if test="distributeId != null and distributeId != ''"> or distribute_id = #{distributeId} </if>
|
<if test="distributeId != null and distributeId != ''">or distribute_id = #{distributeId}</if>
|
||||||
<if test="apiId != null and apiId != ''"> or api_id = #{apiId} </if>
|
<if test="apiId != null and apiId != ''">or api_id = #{apiId}</if>
|
||||||
<if test="dataType != null and dataType != ''"> or data_type = #{dataType} </if>
|
<if test="dataType != null and dataType != ''">or data_type = #{dataType}</if>
|
||||||
<if test="leftBracket != null and leftBracket != ''"> or left_bracket = #{leftBracket} </if>
|
<if test="leftBracket != null and leftBracket != ''">or left_bracket = #{leftBracket}</if>
|
||||||
<if test="filedId != null and filedId != ''"> or filed_id = #{filedId} </if>
|
<if test="filedId != null and filedId != ''">or filed_id = #{filedId}</if>
|
||||||
<if test="filedName != null and filedName != ''"> or filed_name = #{filedName} </if>
|
<if test="filedName != null and filedName != ''">or filed_name = #{filedName}</if>
|
||||||
<if test="compareType != null and compareType != ''"> or compare_type = #{compareType} </if>
|
<if test="compareType != null and compareType != ''">or compare_type = #{compareType}</if>
|
||||||
<if test="filedVaule != null and filedVaule != ''"> or filed_vaule = #{filedVaule} </if>
|
<if test="filedVaule != null and filedVaule != ''">or filed_vaule = #{filedVaule}</if>
|
||||||
<if test="connectionSymbol != null and connectionSymbol != ''"> or connection_symbol = #{connectionSymbol} </if>
|
<if test="connectionSymbol != null and connectionSymbol != ''">or connection_symbol = #{connectionSymbol}
|
||||||
<if test="rightParenthesis != null and rightParenthesis != ''"> or right_parenthesis = #{rightParenthesis} </if>
|
</if>
|
||||||
<if test="sorts != null"> or sorts = #{sorts} </if>
|
<if test="rightParenthesis != null and rightParenthesis != ''">or right_parenthesis = #{rightParenthesis}
|
||||||
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
|
</if>
|
||||||
<if test="create_time != null"> or create_time = #{create_time} </if>
|
<if test="sorts != null">or sorts = #{sorts}</if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
|
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
|
||||||
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
|
<if test="create_time != null">or create_time = #{create_time}</if>
|
||||||
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
|
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
|
||||||
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
|
<if test="modify_time != null">or modify_time = #{modify_time}</if>
|
||||||
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
|
<if test="sts != null and sts != ''">or sts = #{sts}</if>
|
||||||
|
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
|
||||||
|
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--新增所有列-->
|
<!--新增所有列-->
|
||||||
<insert id="entity_insert" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity" >
|
<insert id="entity_insert"
|
||||||
|
parameterType="com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
||||||
insert into mdm_module_distribute_detail(
|
insert into mdm_module_distribute_detail(
|
||||||
<trim suffix="" suffixOverrides=",">
|
<trim suffix="" suffixOverrides=",">
|
||||||
<if test="id != null and id != ''"> id , </if>
|
<if test="id != null and id != ''">id ,</if>
|
||||||
<if test="mdmId != null and mdmId != ''"> mdm_id , </if>
|
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
|
||||||
<if test="distributeId != null and distributeId != ''"> distribute_id , </if>
|
<if test="distributeId != null and distributeId != ''">distribute_id ,</if>
|
||||||
<if test="apiId != null and apiId != ''"> api_id , </if>
|
<if test="apiId != null and apiId != ''">api_id ,</if>
|
||||||
<if test="dataType != null and dataType != ''"> data_type , </if>
|
<if test="dataType != null and dataType != ''">data_type ,</if>
|
||||||
<if test="leftBracket != null and leftBracket != ''"> left_bracket , </if>
|
<if test="leftBracket != null and leftBracket != ''">left_bracket ,</if>
|
||||||
<if test="filedId != null and filedId != ''"> filed_id , </if>
|
<if test="filedId != null and filedId != ''">filed_id ,</if>
|
||||||
<if test="filedName != null and filedName != ''"> filed_name , </if>
|
<if test="filedName != null and filedName != ''">filed_name ,</if>
|
||||||
<if test="compareType != null and compareType != ''"> compare_type , </if>
|
<if test="compareType != null and compareType != ''">compare_type ,</if>
|
||||||
<if test="filedVaule != null and filedVaule != ''"> filed_vaule , </if>
|
<if test="filedVaule != null and filedVaule != ''">filed_vaule ,</if>
|
||||||
<if test="connectionSymbol != null and connectionSymbol != ''"> connection_symbol , </if>
|
<if test="connectionSymbol != null and connectionSymbol != ''">connection_symbol ,</if>
|
||||||
<if test="rightParenthesis != null and rightParenthesis != ''"> right_parenthesis , </if>
|
<if test="rightParenthesis != null and rightParenthesis != ''">right_parenthesis ,</if>
|
||||||
<if test="sorts != null"> sorts , </if>
|
<if test="sorts != null">sorts ,</if>
|
||||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
|
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
|
||||||
<if test="create_time != null"> create_time , </if>
|
<if test="create_time != null">create_time ,</if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
|
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
|
||||||
<if test="modify_time != null"> modify_time , </if>
|
<if test="modify_time != null">modify_time ,</if>
|
||||||
<if test="sts != null and sts != ''"> sts , </if>
|
<if test="sts != null and sts != ''">sts ,</if>
|
||||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||||
<if test="companyId != null and companyId != ''"> company_id , </if>
|
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||||
<if test="sorts == null ">sorts,</if>
|
<if test="sorts == null ">sorts,</if>
|
||||||
<if test="sts == null ">sts,</if>
|
<if test="sts == null ">sts,</if>
|
||||||
</trim>
|
</trim>
|
||||||
)values(
|
)values(
|
||||||
<trim suffix="" suffixOverrides=",">
|
<trim suffix="" suffixOverrides=",">
|
||||||
<if test="id != null and id != ''"> #{id} ,</if>
|
<if test="id != null and id != ''">#{id} ,</if>
|
||||||
<if test="mdmId != null and mdmId != ''"> #{mdmId} ,</if>
|
<if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>
|
||||||
<if test="distributeId != null and distributeId != ''"> #{distributeId} ,</if>
|
<if test="distributeId != null and distributeId != ''">#{distributeId} ,</if>
|
||||||
<if test="apiId != null and apiId != ''"> #{apiId} ,</if>
|
<if test="apiId != null and apiId != ''">#{apiId} ,</if>
|
||||||
<if test="dataType != null and dataType != ''"> #{dataType} ,</if>
|
<if test="dataType != null and dataType != ''">#{dataType} ,</if>
|
||||||
<if test="leftBracket != null and leftBracket != ''"> #{leftBracket} ,</if>
|
<if test="leftBracket != null and leftBracket != ''">#{leftBracket} ,</if>
|
||||||
<if test="filedId != null and filedId != ''"> #{filedId} ,</if>
|
<if test="filedId != null and filedId != ''">#{filedId} ,</if>
|
||||||
<if test="filedName != null and filedName != ''"> #{filedName} ,</if>
|
<if test="filedName != null and filedName != ''">#{filedName} ,</if>
|
||||||
<if test="compareType != null and compareType != ''"> #{compareType} ,</if>
|
<if test="compareType != null and compareType != ''">#{compareType} ,</if>
|
||||||
<if test="filedVaule != null and filedVaule != ''"> #{filedVaule} ,</if>
|
<if test="filedVaule != null and filedVaule != ''">#{filedVaule} ,</if>
|
||||||
<if test="connectionSymbol != null and connectionSymbol != ''"> #{connectionSymbol} ,</if>
|
<if test="connectionSymbol != null and connectionSymbol != ''">#{connectionSymbol} ,</if>
|
||||||
<if test="rightParenthesis != null and rightParenthesis != ''"> #{rightParenthesis} ,</if>
|
<if test="rightParenthesis != null and rightParenthesis != ''">#{rightParenthesis} ,</if>
|
||||||
<if test="sorts != null"> #{sorts} ,</if>
|
<if test="sorts != null">#{sorts} ,</if>
|
||||||
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
|
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
|
||||||
<if test="create_time != null"> #{create_time} ,</if>
|
<if test="create_time != null">#{create_time} ,</if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
|
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
|
||||||
<if test="modify_time != null"> #{modify_time} ,</if>
|
<if test="modify_time != null">#{modify_time} ,</if>
|
||||||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||||
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
|
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute_detail a WHERE a.sts = 'Y' ),</if>
|
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_module_distribute_detail
|
||||||
|
a WHERE a.sts = 'Y' ),
|
||||||
|
</if>
|
||||||
<if test="sts == null ">'Y',</if>
|
<if test="sts == null ">'Y',</if>
|
||||||
</trim>
|
</trim>
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<!-- 批量新增 -->
|
<!-- 批量新增 -->
|
||||||
<insert id="entityInsertBatch" >
|
<insert id="entityInsertBatch">
|
||||||
insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, left_bracket, filed_id, filed_name, compare_type, filed_vaule, connection_symbol, right_parenthesis, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, left_bracket, filed_id,
|
||||||
|
filed_name, compare_type, filed_vaule, connection_symbol, right_parenthesis, create_user_id, create_time,
|
||||||
|
modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||||
values
|
values
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
<foreach collection="entities" item="entity" separator=",">
|
||||||
(#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.leftBracket},#{entity.filedId},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.connectionSymbol},#{entity.rightParenthesis},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
|
(#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.leftBracket},#{entity.filedId},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.connectionSymbol},#{entity.rightParenthesis},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
||||||
|
'Y')
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
<!-- 批量新增或者修改-->
|
<!-- 批量新增或者修改-->
|
||||||
<insert id="entityInsertOrUpdateBatch" >
|
<insert id="entityInsertOrUpdateBatch">
|
||||||
insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, left_bracket, filed_id, filed_name, compare_type, filed_vaule, connection_symbol, right_parenthesis, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
insert into mdm_module_distribute_detail(mdm_id, distribute_id, api_id, data_type, left_bracket, filed_id,
|
||||||
|
filed_name, compare_type, filed_vaule, connection_symbol, right_parenthesis, create_user_id, create_time,
|
||||||
|
modify_user_id, modify_time, sts, org_id, company_id)
|
||||||
values
|
values
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
<foreach collection="entities" item="entity" separator=",">
|
||||||
(#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.leftBracket},#{entity.filedId},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.connectionSymbol},#{entity.rightParenthesis},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
(#{entity.mdmId},#{entity.distributeId},#{entity.apiId},#{entity.dataType},#{entity.leftBracket},#{entity.filedId},#{entity.filedName},#{entity.compareType},#{entity.filedVaule},#{entity.connectionSymbol},#{entity.rightParenthesis},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||||
|
@ -260,61 +291,68 @@
|
||||||
modify_time = values(modify_time),
|
modify_time = values(modify_time),
|
||||||
sts = values(sts),
|
sts = values(sts),
|
||||||
org_id = values(org_id),
|
org_id = values(org_id),
|
||||||
company_id = values(company_id)</insert>
|
company_id = values(company_id)
|
||||||
<!--通过主键修改方法-->
|
</insert>
|
||||||
<update id="entity_update" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity" >
|
<!--通过主键修改方法-->
|
||||||
update mdm_module_distribute_detail set
|
<update id="entity_update"
|
||||||
<trim suffix="" suffixOverrides=",">
|
parameterType="com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
||||||
<if test="mdmId != null and mdmId != ''"> mdm_id = #{mdmId},</if>
|
update mdm_module_distribute_detail set
|
||||||
<if test="distributeId != null and distributeId != ''"> distribute_id = #{distributeId},</if>
|
<trim suffix="" suffixOverrides=",">
|
||||||
<if test="apiId != null and apiId != ''"> api_id = #{apiId},</if>
|
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
|
||||||
<if test="dataType != null and dataType != ''"> data_type = #{dataType},</if>
|
<if test="distributeId != null and distributeId != ''">distribute_id = #{distributeId},</if>
|
||||||
<if test="leftBracket != null and leftBracket != ''"> left_bracket = #{leftBracket},</if>
|
<if test="apiId != null and apiId != ''">api_id = #{apiId},</if>
|
||||||
<if test="filedId != null and filedId != ''"> filed_id = #{filedId},</if>
|
<if test="dataType != null and dataType != ''">data_type = #{dataType},</if>
|
||||||
<if test="filedName != null and filedName != ''"> filed_name = #{filedName},</if>
|
left_bracket = #{leftBracket},
|
||||||
<if test="compareType != null and compareType != ''"> compare_type = #{compareType},</if>
|
filed_id = #{filedId},
|
||||||
<if test="filedVaule != null and filedVaule != ''"> filed_vaule = #{filedVaule},</if>
|
filed_name = #{filedName},
|
||||||
<if test="connectionSymbol != null and connectionSymbol != ''"> connection_symbol = #{connectionSymbol},</if>
|
compare_type = #{compareType},
|
||||||
<if test="rightParenthesis != null and rightParenthesis != ''"> right_parenthesis = #{rightParenthesis},</if>
|
filed_vaule = #{filedVaule},
|
||||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
|
connection_symbol = #{connectionSymbol},
|
||||||
<if test="create_time != null"> create_time = #{create_time},</if>
|
right_parenthesis = #{rightParenthesis},
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
|
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
|
||||||
<if test="modify_time != null"> modify_time = #{modify_time},</if>
|
<if test="create_time != null">create_time = #{create_time},</if>
|
||||||
<if test="sts != null and sts != ''"> sts = #{sts},</if>
|
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
|
||||||
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
|
<if test="modify_time != null">modify_time = #{modify_time},</if>
|
||||||
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
|
<if test="sts != null and sts != ''">sts = #{sts},</if>
|
||||||
</trim>
|
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
|
||||||
where id = #{id}
|
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||||
</update>
|
</trim>
|
||||||
<!-- 逻辑删除 -->
|
where id = #{id}
|
||||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity" >
|
</update>
|
||||||
|
<!-- 逻辑删除 -->
|
||||||
|
<update id="entity_logicDelete"
|
||||||
|
parameterType="com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
||||||
update mdm_module_distribute_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
update mdm_module_distribute_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
<!-- 多条件逻辑删除 -->
|
<!-- 多条件逻辑删除 -->
|
||||||
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity" >
|
<update id="entity_logicDelete_Multi_Condition"
|
||||||
update mdm_module_distribute_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
parameterType="com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity">
|
||||||
|
update mdm_module_distribute_detail set sts= 'N' ,modify_time = #{modify_time},modify_user_id =
|
||||||
|
#{modify_user_id}
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
<if test="mdmId != null and mdmId != ''"> and mdm_id = #{mdmId} </if>
|
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||||
<if test="distributeId != null and distributeId != ''"> and distribute_id = #{distributeId} </if>
|
<if test="distributeId != null and distributeId != ''">and distribute_id = #{distributeId}</if>
|
||||||
<if test="apiId != null and apiId != ''"> and api_id = #{apiId} </if>
|
<if test="apiId != null and apiId != ''">and api_id = #{apiId}</if>
|
||||||
<if test="dataType != null and dataType != ''"> and data_type = #{dataType} </if>
|
<if test="dataType != null and dataType != ''">and data_type = #{dataType}</if>
|
||||||
<if test="leftBracket != null and leftBracket != ''"> and left_bracket = #{leftBracket} </if>
|
<if test="leftBracket != null and leftBracket != ''">and left_bracket = #{leftBracket}</if>
|
||||||
<if test="filedId != null and filedId != ''"> and filed_id = #{filedId} </if>
|
<if test="filedId != null and filedId != ''">and filed_id = #{filedId}</if>
|
||||||
<if test="filedName != null and filedName != ''"> and filed_name = #{filedName} </if>
|
<if test="filedName != null and filedName != ''">and filed_name = #{filedName}</if>
|
||||||
<if test="compareType != null and compareType != ''"> and compare_type = #{compareType} </if>
|
<if test="compareType != null and compareType != ''">and compare_type = #{compareType}</if>
|
||||||
<if test="filedVaule != null and filedVaule != ''"> and filed_vaule = #{filedVaule} </if>
|
<if test="filedVaule != null and filedVaule != ''">and filed_vaule = #{filedVaule}</if>
|
||||||
<if test="connectionSymbol != null and connectionSymbol != ''"> and connection_symbol = #{connectionSymbol} </if>
|
<if test="connectionSymbol != null and connectionSymbol != ''">and connection_symbol = #{connectionSymbol}
|
||||||
<if test="rightParenthesis != null and rightParenthesis != ''"> and right_parenthesis = #{rightParenthesis} </if>
|
</if>
|
||||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
<if test="rightParenthesis != null and rightParenthesis != ''">and right_parenthesis = #{rightParenthesis}
|
||||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
</if>
|
||||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||||
|
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||||
|
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
</update>
|
</update>
|
||||||
<!--通过主键删除-->
|
<!--通过主键删除-->
|
||||||
<delete id="entity_delete">
|
<delete id="entity_delete">
|
||||||
delete from mdm_module_distribute_detail where id = #{id}
|
delete from mdm_module_distribute_detail where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class MdmModuleSendLogEntity extends BaseEntity {
|
||||||
private String targetApi;
|
private String targetApi;
|
||||||
/** 源数据 */
|
/** 源数据 */
|
||||||
private String sourceData;
|
private String sourceData;
|
||||||
/** 操作类型 */
|
/** 操作类型 1新增2、修改3、删除*/
|
||||||
private String optionType;
|
private String optionType;
|
||||||
/** 公司id */
|
/** 公司id */
|
||||||
private String companyId;
|
private String companyId;
|
||||||
|
|
|
@ -44,6 +44,12 @@
|
||||||
,company_id
|
,company_id
|
||||||
</sql>
|
</sql>
|
||||||
<!-- 查询 采用==查询 -->
|
<!-- 查询 采用==查询 -->
|
||||||
|
<!--通过ID获取数据 -->
|
||||||
|
<select id="entity_get" resultMap="get-MdmModuleSourceEntity-result">
|
||||||
|
select
|
||||||
|
<include refid="MdmModuleSourceEntity_Base_Column_List" />
|
||||||
|
from mdm_module_source where id = #{ id } and sts='Y'
|
||||||
|
</select>
|
||||||
<select id="entity_list_base" resultMap="get-MdmModuleSourceEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity">
|
<select id="entity_list_base" resultMap="get-MdmModuleSourceEntity-result" parameterType = "com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity">
|
||||||
select
|
select
|
||||||
<include refid="MdmModuleSourceEntity_Base_Column_List" />
|
<include refid="MdmModuleSourceEntity_Base_Column_List" />
|
||||||
|
|
|
@ -67,6 +67,7 @@ import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -203,6 +204,54 @@ public class MdmServiceImpl implements IMdmService {
|
||||||
**/
|
**/
|
||||||
private List<MdmViewFiledVo> getFiledByType(String viewType, List<MdmModuleViewDetailEntity> mdmModuleViewDetailEntities, List<MdmModuleDbEntity> mdmModuleDbEntityList, List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList, List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntityList) {
|
private List<MdmViewFiledVo> getFiledByType(String viewType, List<MdmModuleViewDetailEntity> mdmModuleViewDetailEntities, List<MdmModuleDbEntity> mdmModuleDbEntityList, List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntityList, List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntityList) {
|
||||||
List<MdmViewFiledVo> mdmViewFiledVos = new ArrayList<>();
|
List<MdmViewFiledVo> mdmViewFiledVos = new ArrayList<>();
|
||||||
|
for (int i = 0; i < mdmModuleDbEntityList.size(); i++) {
|
||||||
|
if("1".equals(mdmModuleDbEntityList.get(i).getDbType())){
|
||||||
|
MdmViewFiledVo rule = new MdmViewFiledVo();
|
||||||
|
rule.setDbName(mdmModuleDbEntityList.get(i).getDbName());
|
||||||
|
rule.setDbType("1");
|
||||||
|
rule.setMdmId(mdmModuleDbEntityList.get(i).getMdmId());
|
||||||
|
rule.setDbId(mdmModuleDbEntityList.get(i).getId());
|
||||||
|
rule.setChName("单据规则");
|
||||||
|
rule.setEnName("document_rule");
|
||||||
|
mdmViewFiledVos.add(rule);
|
||||||
|
List<MdmModuleDbFiledsRuleEntity> msgRule = new ArrayList<>();
|
||||||
|
MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity();
|
||||||
|
msgRuleTitie.setFormName("optionRuleForm");
|
||||||
|
msgRuleTitie.setRuleCode("title");
|
||||||
|
msgRuleTitie.setRuleName("显示名");
|
||||||
|
msgRuleTitie.setRuleType("2");
|
||||||
|
msgRuleTitie.setRuleValue("单据编码");
|
||||||
|
MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity();
|
||||||
|
msgRulerow.setFormName("optionRuleForm");
|
||||||
|
msgRulerow.setRuleCode("row");
|
||||||
|
msgRulerow.setRuleName("宽度");
|
||||||
|
msgRulerow.setRuleType("2");
|
||||||
|
msgRulerow.setRuleValue("12");
|
||||||
|
MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity();
|
||||||
|
msgRuletype.setFormName("optionRuleForm");
|
||||||
|
msgRuletype.setRuleCode("type");
|
||||||
|
msgRuletype.setRuleName("数据类型");
|
||||||
|
msgRuletype.setRuleType("2");
|
||||||
|
msgRuletype.setRuleValue("input");
|
||||||
|
MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity();
|
||||||
|
msgRulerequired.setFormName("optionRuleForm");
|
||||||
|
msgRulerequired.setRuleCode("required");
|
||||||
|
msgRulerequired.setRuleName("必填");
|
||||||
|
msgRulerequired.setRuleType("2");
|
||||||
|
MdmModuleDbFiledsRuleEntity withs = new MdmModuleDbFiledsRuleEntity();
|
||||||
|
withs.setFormName("optionRuleForm");
|
||||||
|
withs.setRuleCode("width");
|
||||||
|
withs.setRuleName("宽度");
|
||||||
|
withs.setRuleType("2");
|
||||||
|
withs.setRuleValue("200");
|
||||||
|
msgRule.add(withs);
|
||||||
|
msgRule.add(msgRulerequired);
|
||||||
|
msgRule.add(msgRuletype);
|
||||||
|
msgRule.add(msgRulerow);
|
||||||
|
msgRule.add(msgRuleTitie);
|
||||||
|
rule.setRuleList(msgRule);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){
|
if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){
|
||||||
for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) {
|
for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) {
|
||||||
if(viewType.equals(mdmModuleViewDetailEntities.get(i).getViewType())){
|
if(viewType.equals(mdmModuleViewDetailEntities.get(i).getViewType())){
|
||||||
|
@ -223,6 +272,7 @@ public class MdmServiceImpl implements IMdmService {
|
||||||
}
|
}
|
||||||
mdmViewFiledVo.setChName(mdmModuleDbFiledsEntityList.get(i1).getChName());
|
mdmViewFiledVo.setChName(mdmModuleDbFiledsEntityList.get(i1).getChName());
|
||||||
mdmViewFiledVo.setEnName(mdmModuleDbFiledsEntityList.get(i1).getEnName());
|
mdmViewFiledVo.setEnName(mdmModuleDbFiledsEntityList.get(i1).getEnName());
|
||||||
|
|
||||||
mdmViewFiledVo.setFiledType(mdmModuleDbFiledsEntityList.get(i1).getFiledType());
|
mdmViewFiledVo.setFiledType(mdmModuleDbFiledsEntityList.get(i1).getFiledType());
|
||||||
//字段规则
|
//字段规则
|
||||||
if(mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0){
|
if(mdmModuleDbFiledsRuleEntityList != null && mdmModuleDbFiledsRuleEntityList.size() > 0){
|
||||||
|
@ -233,10 +283,50 @@ public class MdmServiceImpl implements IMdmService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mdmViewFiledVo.setRuleList(ruleList);
|
mdmViewFiledVo.setRuleList(ruleList);
|
||||||
|
if("data_status".equals(mdmModuleDbFiledsEntityList.get(i1).getEnName())){
|
||||||
|
List<MdmModuleDbFiledsRuleEntity> a = new ArrayList<>();
|
||||||
|
|
||||||
|
MdmModuleDbFiledsRuleEntity msgRuleTitie = new MdmModuleDbFiledsRuleEntity();
|
||||||
|
msgRuleTitie.setFormName("optionRuleForm");
|
||||||
|
msgRuleTitie.setRuleCode("title");
|
||||||
|
msgRuleTitie.setRuleName("显示名");
|
||||||
|
msgRuleTitie.setRuleType("2");
|
||||||
|
msgRuleTitie.setRuleValue("数据状态");
|
||||||
|
MdmModuleDbFiledsRuleEntity msgRulerow = new MdmModuleDbFiledsRuleEntity();
|
||||||
|
msgRulerow.setFormName("optionRuleForm");
|
||||||
|
msgRulerow.setRuleCode("row");
|
||||||
|
msgRulerow.setRuleName("宽度");
|
||||||
|
msgRulerow.setRuleType("2");
|
||||||
|
msgRulerow.setRuleValue("12");
|
||||||
|
MdmModuleDbFiledsRuleEntity msgRuletype = new MdmModuleDbFiledsRuleEntity();
|
||||||
|
msgRuletype.setFormName("optionRuleForm");
|
||||||
|
msgRuletype.setRuleCode("type");
|
||||||
|
msgRuletype.setRuleName("数据类型");
|
||||||
|
msgRuletype.setRuleType("2");
|
||||||
|
msgRuletype.setRuleValue("input");
|
||||||
|
MdmModuleDbFiledsRuleEntity msgRulerequired = new MdmModuleDbFiledsRuleEntity();
|
||||||
|
msgRulerequired.setFormName("optionRuleForm");
|
||||||
|
msgRulerequired.setRuleCode("required");
|
||||||
|
msgRulerequired.setRuleName("必填");
|
||||||
|
msgRulerequired.setRuleType("2");
|
||||||
|
MdmModuleDbFiledsRuleEntity withs = new MdmModuleDbFiledsRuleEntity();
|
||||||
|
withs.setFormName("optionRuleForm");
|
||||||
|
withs.setRuleCode("width");
|
||||||
|
withs.setRuleName("宽度");
|
||||||
|
withs.setRuleType("2");
|
||||||
|
withs.setRuleValue("200");
|
||||||
|
a.add(withs);
|
||||||
|
a.add(msgRulerequired);
|
||||||
|
a.add(msgRuletype);
|
||||||
|
a.add(msgRulerow);
|
||||||
|
a.add(msgRuleTitie);
|
||||||
|
mdmViewFiledVo.setRuleList(a);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mdmViewFiledVos.add(mdmViewFiledVo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -509,6 +599,24 @@ public class MdmServiceImpl implements IMdmService {
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||||
}
|
}
|
||||||
|
entity.setMdmCode(10007L);
|
||||||
|
MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(entity.getMdmCode());
|
||||||
|
if(mdmModuleEntity == null || mdmModuleEntity.getId() == null ){
|
||||||
|
return BaseResult.getFailureMessageEntity("主数据设置错误");
|
||||||
|
}
|
||||||
|
MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity();
|
||||||
|
mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId());
|
||||||
|
mdmModuleDbEntity.setSts("Y");
|
||||||
|
List<MdmModuleDbEntity> mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity);
|
||||||
|
if(mdmModuleDbEntities == null || mdmModuleDbEntities.size() == 0){
|
||||||
|
return BaseResult.getFailureMessageEntity("主数据设置错误");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
|
||||||
|
if("1".equals(mdmModuleDbEntities.get(i).getDbType())){
|
||||||
|
entity.setTableName(mdmModuleDbEntities.get(i).getDbName());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
//判断分页
|
//判断分页
|
||||||
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
|
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
|
||||||
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
|
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
|
||||||
|
@ -1175,7 +1283,7 @@ public class MdmServiceImpl implements IMdmService {
|
||||||
if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) {
|
if (mdmModuleDbEntityList == null || mdmModuleDbEntityList.size() == 0) {
|
||||||
return BaseResult.getFailureMessageEntity("系统错误");
|
return BaseResult.getFailureMessageEntity("系统错误");
|
||||||
}
|
}
|
||||||
String tablename = null;
|
//String tablename = null;
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
for (int i = 0; i < mdmModuleDbEntityList.size(); i++) {
|
for (int i = 0; i < mdmModuleDbEntityList.size(); i++) {
|
||||||
//查询数据
|
//查询数据
|
||||||
|
@ -1186,7 +1294,7 @@ public class MdmServiceImpl implements IMdmService {
|
||||||
queryData.put("id", entity.getId());//字段
|
queryData.put("id", entity.getId());//字段
|
||||||
HashMap<String, Object> datas = mdmModuleDbDao.getServiceDataById(queryData);
|
HashMap<String, Object> datas = mdmModuleDbDao.getServiceDataById(queryData);
|
||||||
jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas);
|
jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas);
|
||||||
tablename = mdmModuleDbEntityList.get(i).getDbName() + "_distribute";
|
//tablename = mdmModuleDbEntityList.get(i).getDbName() + "_distribute";
|
||||||
} else {
|
} else {
|
||||||
queryData.put("detailFlag", true);//是否明细
|
queryData.put("detailFlag", true);//是否明细
|
||||||
queryData.put("id", entity.getId());//字段
|
queryData.put("id", entity.getId());//字段
|
||||||
|
@ -1194,13 +1302,13 @@ public class MdmServiceImpl implements IMdmService {
|
||||||
jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas);
|
jsonObject.put(mdmModuleDbEntityList.get(i).getDbName(), datas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tablename != null && !"".equals(tablename)) {
|
//if (tablename != null && !"".equals(tablename)) {
|
||||||
Map<String, Object> queryData = new HashMap<>();
|
// Map<String, Object> queryData = new HashMap<>();
|
||||||
queryData.put("tableName", tablename);//表名
|
// queryData.put("tableName", tablename);//表名
|
||||||
queryData.put("id", entity.getId());//字段
|
// queryData.put("id", entity.getId());//字段
|
||||||
List<HashMap<String, Object>> datas = mdmModuleDbDao.getServiceByDistributeId(queryData);
|
// List<HashMap<String, Object>> datas = mdmModuleDbDao.getServiceByDistributeId(queryData);
|
||||||
jsonObject.put(tablename, datas);
|
// jsonObject.put(tablename, datas);
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject);
|
return BaseResult.getSuccessMessageEntity("获取数据成功", jsonObject);
|
||||||
|
@ -1364,7 +1472,7 @@ public class MdmServiceImpl implements IMdmService {
|
||||||
}
|
}
|
||||||
mdmModuleDao.deleteTemplateById(formmainDeleteDto);
|
mdmModuleDao.deleteTemplateById(formmainDeleteDto);
|
||||||
|
|
||||||
} else {
|
}else if ("2".equals(mdmModuleDbEntityList.get(i).getDbType())) {
|
||||||
//删除明细
|
//删除明细
|
||||||
FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto();
|
FormmainDeleteDto formmainDeleteDto = new FormmainDeleteDto();
|
||||||
formmainDeleteDto.setFormmain_id(jsonObject.getString("id"));
|
formmainDeleteDto.setFormmain_id(jsonObject.getString("id"));
|
||||||
|
@ -1677,16 +1785,17 @@ public class MdmServiceImpl implements IMdmService {
|
||||||
//查询单据规则
|
//查询单据规则
|
||||||
MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity();
|
MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity();
|
||||||
mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId());
|
mdmTableCodeRuleEntity.setMdmId(mdmModuleEntity.getId());
|
||||||
mdmTableCodeRuleEntity.setDbId(mdmModuleDbEntityList.get(i).getId());
|
//mdmTableCodeRuleEntity.setDbId(mdmModuleDbEntityList.get(i).getId());
|
||||||
mdmTableCodeRuleEntity.setSts("Y");
|
mdmTableCodeRuleEntity.setSts("Y");
|
||||||
List<MdmTableCodeRuleEntity> allMdmTableCodeRuleEntities = mdmTableCodeRuleDao.queryBase(mdmTableCodeRuleEntity);
|
List<MdmTableCodeRuleEntity> allMdmTableCodeRuleEntities = mdmTableCodeRuleDao.queryBase(mdmTableCodeRuleEntity);
|
||||||
List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntities = new ArrayList<>();
|
List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntities = new ArrayList<>();
|
||||||
if(allMdmTableCodeRuleEntities != null && allMdmTableCodeRuleEntities.size() > 0){
|
if(allMdmTableCodeRuleEntities != null && allMdmTableCodeRuleEntities.size() > 0){
|
||||||
for (int i1 = 0; i1 < allMdmTableCodeRuleEntities.size(); i1++) {
|
mdmTableCodeRuleEntities = allMdmTableCodeRuleEntities;
|
||||||
if(mdmModuleDbEntityList.get(i).getId().equals(allMdmTableCodeRuleEntities.get(i1).getDbId())){
|
//for (int i1 = 0; i1 < allMdmTableCodeRuleEntities.size(); i1++) {
|
||||||
mdmTableCodeRuleEntities.add(allMdmTableCodeRuleEntities.get(i1));
|
// if(mdmModuleDbEntityList.get(i).getId().equals(allMdmTableCodeRuleEntities.get(i1).getDbId())){
|
||||||
}
|
// mdmTableCodeRuleEntities.add(allMdmTableCodeRuleEntities.get(i1));
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
StringBuffer document_rule = new StringBuffer();
|
StringBuffer document_rule = new StringBuffer();
|
||||||
Integer document_rule_num = 0;
|
Integer document_rule_num = 0;
|
||||||
|
@ -1723,6 +1832,14 @@ public class MdmServiceImpl implements IMdmService {
|
||||||
if (flag) {
|
if (flag) {
|
||||||
mdmDataDto.setId(jsonObject.getString("id"));
|
mdmDataDto.setId(jsonObject.getString("id"));
|
||||||
id = jsonObject.getString("id");
|
id = jsonObject.getString("id");
|
||||||
|
MdmDataFiledDto update_status = new MdmDataFiledDto();
|
||||||
|
update_status.setFiledsName("update_status");
|
||||||
|
update_status.setFiledsValue("0");
|
||||||
|
mdmDataFiledDtos.add(update_status);
|
||||||
|
MdmDataFiledDto data_status = new MdmDataFiledDto();
|
||||||
|
data_status.setFiledsName("data_status");
|
||||||
|
data_status.setFiledsValue("F");;
|
||||||
|
mdmDataFiledDtos.add(data_status);
|
||||||
int a = mdmModuleDao.updateForm(mdmDataDto);
|
int a = mdmModuleDao.updateForm(mdmDataDto);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -1733,6 +1850,31 @@ public class MdmServiceImpl implements IMdmService {
|
||||||
ids.setFiledsName("id");
|
ids.setFiledsName("id");
|
||||||
ids.setFiledsValue(id);
|
ids.setFiledsValue(id);
|
||||||
mdmDataFiledDtos.add(ids);
|
mdmDataFiledDtos.add(ids);
|
||||||
|
MdmDataFiledDto data_status = new MdmDataFiledDto();
|
||||||
|
data_status.setFiledsName("data_status");
|
||||||
|
data_status.setFiledsValue("Y");;
|
||||||
|
mdmDataFiledDtos.add(data_status);
|
||||||
|
MdmDataFiledDto org_id = new MdmDataFiledDto();
|
||||||
|
org_id.setFiledsName("org_id");
|
||||||
|
org_id.setFiledsValue("Y");;
|
||||||
|
mdmDataFiledDtos.add(org_id);
|
||||||
|
MdmDataFiledDto company_id = new MdmDataFiledDto();
|
||||||
|
company_id.setFiledsName("company_id");
|
||||||
|
company_id.setFiledsValue("Y");;
|
||||||
|
mdmDataFiledDtos.add(company_id);
|
||||||
|
|
||||||
|
MdmDataFiledDto add_status = new MdmDataFiledDto();
|
||||||
|
add_status.setFiledsName("add_status");
|
||||||
|
add_status.setFiledsValue("0");
|
||||||
|
mdmDataFiledDtos.add(add_status);
|
||||||
|
MdmDataFiledDto update_status = new MdmDataFiledDto();
|
||||||
|
update_status.setFiledsName("update_status");
|
||||||
|
update_status.setFiledsValue("1");
|
||||||
|
mdmDataFiledDtos.add(update_status);
|
||||||
|
MdmDataFiledDto delete_status = new MdmDataFiledDto();
|
||||||
|
delete_status.setFiledsName("delete_status");
|
||||||
|
delete_status.setFiledsValue("1");
|
||||||
|
mdmDataFiledDtos.add(delete_status);
|
||||||
mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos);
|
mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos);
|
||||||
int a = mdmModuleDao.saveForm(mdmDataDto);
|
int a = mdmModuleDao.saveForm(mdmDataDto);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue