主数据新建类
This commit is contained in:
parent
270d0dc510
commit
64f15e4361
|
@ -0,0 +1,83 @@
|
||||||
|
package com.hzya.frame.mdm.entity;
|
||||||
|
|
||||||
|
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
||||||
|
import com.hzya.frame.web.entity.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DbFiledsDto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1新增 2、修改
|
||||||
|
*/
|
||||||
|
private String dataType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中文名
|
||||||
|
*/
|
||||||
|
private String chName;
|
||||||
|
/**
|
||||||
|
* 英文名
|
||||||
|
*/
|
||||||
|
private String enName;
|
||||||
|
/**
|
||||||
|
* 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME
|
||||||
|
*/
|
||||||
|
private String filedType;
|
||||||
|
/**
|
||||||
|
* 长度
|
||||||
|
*/
|
||||||
|
private String filedLength;
|
||||||
|
|
||||||
|
public DbFiledsDto() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public DbFiledsDto(String dataType,String chName, String enName, String filedType, String filedLength) {
|
||||||
|
this.dataType = dataType;
|
||||||
|
this.chName = chName;
|
||||||
|
this.enName = enName;
|
||||||
|
this.filedType = filedType;
|
||||||
|
this.filedLength = filedLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChName() {
|
||||||
|
return chName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChName(String chName) {
|
||||||
|
this.chName = chName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnName() {
|
||||||
|
return enName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnName(String enName) {
|
||||||
|
this.enName = enName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFiledType() {
|
||||||
|
return filedType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFiledType(String filedType) {
|
||||||
|
this.filedType = filedType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFiledLength() {
|
||||||
|
return filedLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFiledLength(String filedLength) {
|
||||||
|
this.filedLength = filedLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataType() {
|
||||||
|
return dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataType(String dataType) {
|
||||||
|
this.dataType = dataType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.hzya.frame.mdm.entity;
|
||||||
|
|
||||||
|
|
||||||
|
public class MdmDbFiledVo {
|
||||||
|
private String id;
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MdmDbFiledVo() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public MdmDbFiledVo(String id, String name) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,91 @@
|
||||||
|
package com.hzya.frame.mdm.entity;
|
||||||
|
|
||||||
|
import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MdmModuleViewDto {
|
||||||
|
|
||||||
|
private Long mdmCode;
|
||||||
|
//模版
|
||||||
|
private MdmModuleViewEntity mdmModuleViewEntity;
|
||||||
|
//新增
|
||||||
|
private List<MdmDbFiledVo> addFiled;
|
||||||
|
//修改
|
||||||
|
private List<MdmDbFiledVo> editFiled;
|
||||||
|
//查看
|
||||||
|
private List<MdmDbFiledVo> showFiled;
|
||||||
|
//查询
|
||||||
|
private List<MdmDbFiledVo> queryFiled;
|
||||||
|
//列表
|
||||||
|
private List<MdmDbFiledVo> listFiled;
|
||||||
|
//按钮
|
||||||
|
private List<MdmModuleViewButtonEntity> dbButtonFiled;
|
||||||
|
|
||||||
|
public MdmModuleViewEntity getMdmModuleViewEntity() {
|
||||||
|
return mdmModuleViewEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMdmModuleViewEntity(MdmModuleViewEntity mdmModuleViewEntity) {
|
||||||
|
this.mdmModuleViewEntity = mdmModuleViewEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmDbFiledVo> getAddFiled() {
|
||||||
|
return addFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddFiled(List<MdmDbFiledVo> addFiled) {
|
||||||
|
this.addFiled = addFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmDbFiledVo> getEditFiled() {
|
||||||
|
return editFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEditFiled(List<MdmDbFiledVo> editFiled) {
|
||||||
|
this.editFiled = editFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmDbFiledVo> getShowFiled() {
|
||||||
|
return showFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowFiled(List<MdmDbFiledVo> showFiled) {
|
||||||
|
this.showFiled = showFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmDbFiledVo> getQueryFiled() {
|
||||||
|
return queryFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQueryFiled(List<MdmDbFiledVo> queryFiled) {
|
||||||
|
this.queryFiled = queryFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmDbFiledVo> getListFiled() {
|
||||||
|
return listFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setListFiled(List<MdmDbFiledVo> listFiled) {
|
||||||
|
this.listFiled = listFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMdmCode() {
|
||||||
|
return mdmCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMdmCode(Long mdmCode) {
|
||||||
|
this.mdmCode = mdmCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmModuleViewButtonEntity> getDbButtonFiled() {
|
||||||
|
return dbButtonFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDbButtonFiled(List<MdmModuleViewButtonEntity> dbButtonFiled) {
|
||||||
|
this.dbButtonFiled = dbButtonFiled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,136 @@
|
||||||
|
package com.hzya.frame.mdm.entity;
|
||||||
|
|
||||||
|
import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MdmModuleViewVo {
|
||||||
|
|
||||||
|
|
||||||
|
//模版
|
||||||
|
private MdmModuleViewEntity mdmModuleViewEntity;
|
||||||
|
//新增
|
||||||
|
private List<MdmDbFiledVo> addFiled;
|
||||||
|
//修改
|
||||||
|
private List<MdmDbFiledVo> editFiled;
|
||||||
|
//查看
|
||||||
|
private List<MdmDbFiledVo> showFiled;
|
||||||
|
//查询
|
||||||
|
private List<MdmDbFiledVo> queryFiled;
|
||||||
|
//列表
|
||||||
|
private List<MdmDbFiledVo> listFiled;
|
||||||
|
|
||||||
|
//新增
|
||||||
|
private List<MdmModuleViewDetailEntity> dbAddFiled;
|
||||||
|
//修改
|
||||||
|
private List<MdmModuleViewDetailEntity> dbEditFiled;
|
||||||
|
//查看
|
||||||
|
private List<MdmModuleViewDetailEntity> dbShowFiled;
|
||||||
|
//查询
|
||||||
|
private List<MdmModuleViewDetailEntity> dbQueryFiled;
|
||||||
|
//列表
|
||||||
|
private List<MdmModuleViewDetailEntity> dbListFiled;
|
||||||
|
//按钮
|
||||||
|
private List<MdmModuleViewButtonEntity> dbButtonFiled;
|
||||||
|
|
||||||
|
public List<MdmDbFiledVo> getAddFiled() {
|
||||||
|
return addFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddFiled(List<MdmDbFiledVo> addFiled) {
|
||||||
|
this.addFiled = addFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmDbFiledVo> getEditFiled() {
|
||||||
|
return editFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEditFiled(List<MdmDbFiledVo> editFiled) {
|
||||||
|
this.editFiled = editFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmDbFiledVo> getShowFiled() {
|
||||||
|
return showFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowFiled(List<MdmDbFiledVo> showFiled) {
|
||||||
|
this.showFiled = showFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmDbFiledVo> getQueryFiled() {
|
||||||
|
return queryFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQueryFiled(List<MdmDbFiledVo> queryFiled) {
|
||||||
|
this.queryFiled = queryFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmDbFiledVo> getListFiled() {
|
||||||
|
return listFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setListFiled(List<MdmDbFiledVo> listFiled) {
|
||||||
|
this.listFiled = listFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MdmModuleViewEntity getMdmModuleViewEntity() {
|
||||||
|
return mdmModuleViewEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMdmModuleViewEntity(MdmModuleViewEntity mdmModuleViewEntity) {
|
||||||
|
this.mdmModuleViewEntity = mdmModuleViewEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmModuleViewDetailEntity> getDbAddFiled() {
|
||||||
|
return dbAddFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDbAddFiled(List<MdmModuleViewDetailEntity> dbAddFiled) {
|
||||||
|
this.dbAddFiled = dbAddFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmModuleViewDetailEntity> getDbEditFiled() {
|
||||||
|
return dbEditFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDbEditFiled(List<MdmModuleViewDetailEntity> dbEditFiled) {
|
||||||
|
this.dbEditFiled = dbEditFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmModuleViewDetailEntity> getDbShowFiled() {
|
||||||
|
return dbShowFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDbShowFiled(List<MdmModuleViewDetailEntity> dbShowFiled) {
|
||||||
|
this.dbShowFiled = dbShowFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmModuleViewDetailEntity> getDbQueryFiled() {
|
||||||
|
return dbQueryFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDbQueryFiled(List<MdmModuleViewDetailEntity> dbQueryFiled) {
|
||||||
|
this.dbQueryFiled = dbQueryFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmModuleViewDetailEntity> getDbListFiled() {
|
||||||
|
return dbListFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDbListFiled(List<MdmModuleViewDetailEntity> dbListFiled) {
|
||||||
|
this.dbListFiled = dbListFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MdmModuleViewButtonEntity> getDbButtonFiled() {
|
||||||
|
return dbButtonFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDbButtonFiled(List<MdmModuleViewButtonEntity> dbButtonFiled) {
|
||||||
|
this.dbButtonFiled = dbButtonFiled;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@ public interface IMdmModuleDao extends IBaseDao<MdmModuleEntity, String> {
|
||||||
MdmModuleEntity getByMdmCode(Long mdmCode);
|
MdmModuleEntity getByMdmCode(Long mdmCode);
|
||||||
|
|
||||||
Integer checkTable(Map<String, String> maps);
|
Integer checkTable(Map<String, String> maps);
|
||||||
|
Integer createTable(Map<String, Object> maps);
|
||||||
|
Integer alterTable(Map<String, Object> maps);
|
||||||
|
Integer alterTableName(Map<String, String> maps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,5 +35,24 @@ public class MdmModuleDaoImpl extends MybatisGenericDao<MdmModuleEntity, String>
|
||||||
return o;
|
return o;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer createTable(Map<String, Object> maps) {
|
||||||
|
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "createTable", maps);
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Integer alterTable(Map<String, Object> maps) {
|
||||||
|
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "alterTable", maps);
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer alterTableName(Map<String, String> maps) {
|
||||||
|
Integer o = (Integer) super.selectOne(getSqlIdPrifx() + "alterTableName", maps);
|
||||||
|
return o;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -305,5 +305,104 @@ update mdm_module set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #
|
||||||
TABLE_SCHEMA = 'businesscenter'
|
TABLE_SCHEMA = 'businesscenter'
|
||||||
and TABLE_NAME = #{tableName}
|
and TABLE_NAME = #{tableName}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="createTable" resultType="java.lang.Integer">
|
||||||
|
CREATE TABLE ${tableName} (
|
||||||
|
<foreach collection="databaseFields" item="item" index="index">
|
||||||
|
<choose>
|
||||||
|
<when test="item.enName == 'id'.toString()">
|
||||||
|
`id` varchar(50) NOT NULL COMMENT '唯一标识码',
|
||||||
|
</when>
|
||||||
|
<when test="item.enName == 'sorts'.toString()">
|
||||||
|
`sorts` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '排序',
|
||||||
|
</when>
|
||||||
|
<otherwise >
|
||||||
|
<choose>
|
||||||
|
<when test="item.filedType == '1'.toString()">
|
||||||
|
${item.enName} bigint(${item.filedLength}) DEFAULT NULL COMMENT #{item.chName},
|
||||||
|
</when>
|
||||||
|
<when test="item.filedType == '2'.toString()">
|
||||||
|
${item.enName} decimal(${item.filedLength}) DEFAULT NULL COMMENT #{item.chName},
|
||||||
|
</when>
|
||||||
|
<when test="item.filedType == '3'.toString()">
|
||||||
|
${item.enName} varchar(${item.filedLength}) DEFAULT NULL COMMENT #{item.chName},
|
||||||
|
</when>
|
||||||
|
<when test="item.filedType == '4'.toString()">
|
||||||
|
${item.enName} datetime DEFAULT NULL COMMENT #{item.chName},
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
PRIMARY KEY (`sorts`,`id`) USING BTREE
|
||||||
|
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COMMENT = #{tableRemark}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--通过ID获取数据 -->
|
||||||
|
<select id="alterTable" resultType="java.lang.Integer">
|
||||||
|
ALTER TABLE ${tableName}
|
||||||
|
<trim suffix="" suffixOverrides=",">
|
||||||
|
<foreach collection="databaseFields" item="item" index="index">
|
||||||
|
<choose>
|
||||||
|
<when test="item.filedType == '3'.toString()">
|
||||||
|
<choose>
|
||||||
|
<when test="item.dataType == '1'.toString()">
|
||||||
|
MODIFY COLUMN ${item.enName} varchar(${item.filedLength}) DEFAULT NULL
|
||||||
|
COMMENT #{item.chName},
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
add COLUMN ${item.enName} varchar(${item.filedLength}) DEFAULT NULL COMMENT
|
||||||
|
#{item.chName},
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
<when test="item.filedType == '1'.toString()">
|
||||||
|
<choose>
|
||||||
|
<when test="item.dataType == '1'.toString()">
|
||||||
|
MODIFY COLUMN ${item.enName} bigint(${item.filedLength}) DEFAULT NULL COMMENT
|
||||||
|
#{item.chName},
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
add COLUMN ${item.enName} bigint(${item.filedLength}) DEFAULT NULL COMMENT
|
||||||
|
#{item.chName},
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
<when test="item.filedType == '2'.toString()">
|
||||||
|
<choose>
|
||||||
|
<when test="item.dataType == '1'.toString()">
|
||||||
|
MODIFY COLUMN ${item.enName} decimal(${item.filedLength}) DEFAULT NULL COMMENT
|
||||||
|
#{item.chName},
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
add COLUMN ${item.enName} decimal(${item.filedLength}) DEFAULT NULL COMMENT
|
||||||
|
#{item.chName},
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
<when test="item.filedType == '4'.toString()">
|
||||||
|
<choose>
|
||||||
|
<when test="item.dataType == '1'.toString()">
|
||||||
|
MODIFY COLUMN ${item.enName} datetime DEFAULT NULL COMMENT #{item.chName},
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
add COLUMN ${item.enName} datetime DEFAULT NULL COMMENT #{item.chName},
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--通过ID获取数据 -->
|
||||||
|
<select id="alterTableName" resultType="java.lang.Integer">
|
||||||
|
ALTER TABLE ${tableName} COMMENT = #{tableRemark}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@ public class MdmModuleViewEntity extends BaseEntity {
|
||||||
/** 公司id */
|
/** 公司id */
|
||||||
private String companyId;
|
private String companyId;
|
||||||
|
|
||||||
|
/** 数据类型 1、新增 2、修改 */
|
||||||
|
private String dataType;
|
||||||
|
|
||||||
public String getMdmId() {
|
public String getMdmId() {
|
||||||
return mdmId;
|
return mdmId;
|
||||||
|
@ -62,5 +64,12 @@ public class MdmModuleViewEntity extends BaseEntity {
|
||||||
this.companyId = companyId;
|
this.companyId = companyId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDataType() {
|
||||||
|
return dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataType(String dataType) {
|
||||||
|
this.dataType = dataType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,8 @@ public class MdmModuleViewButtonEntity extends BaseEntity {
|
||||||
/** 公司id */
|
/** 公司id */
|
||||||
private String companyId;
|
private String companyId;
|
||||||
|
|
||||||
|
/** 数据类型 1、新增 2、修改 */
|
||||||
|
private String dataType;
|
||||||
public String getMdmId() {
|
public String getMdmId() {
|
||||||
return mdmId;
|
return mdmId;
|
||||||
}
|
}
|
||||||
|
@ -62,5 +63,12 @@ public class MdmModuleViewButtonEntity extends BaseEntity {
|
||||||
this.companyId = companyId;
|
this.companyId = companyId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDataType() {
|
||||||
|
return dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataType(String dataType) {
|
||||||
|
this.dataType = dataType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,8 @@ public class MdmModuleViewDetailEntity extends BaseEntity {
|
||||||
private String viewType;
|
private String viewType;
|
||||||
/** 公司id */
|
/** 公司id */
|
||||||
private String companyId;
|
private String companyId;
|
||||||
|
/** 数据类型 1、新增 2、修改 */
|
||||||
|
private String dataType;
|
||||||
|
|
||||||
public String getMdmId() {
|
public String getMdmId() {
|
||||||
return mdmId;
|
return mdmId;
|
||||||
|
@ -62,5 +63,12 @@ public class MdmModuleViewDetailEntity extends BaseEntity {
|
||||||
this.companyId = companyId;
|
this.companyId = companyId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDataType() {
|
||||||
|
return dataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataType(String dataType) {
|
||||||
|
this.dataType = dataType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,25 +96,25 @@ public interface IMdmService {
|
||||||
* @Date 9:40 上午 2023/10/18
|
* @Date 9:40 上午 2023/10/18
|
||||||
**/
|
**/
|
||||||
JsonResultEntity saveMdmModuleDb(JSONObject jsonObject);
|
JsonResultEntity saveMdmModuleDb(JSONObject jsonObject);
|
||||||
//
|
|
||||||
//
|
|
||||||
///**
|
/**
|
||||||
// * @param jsonObject
|
* @param jsonObject
|
||||||
// * @return com.hzya.frame.web.entity.JsonResultEntity
|
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||||
// * @Author lvleigang
|
* @Author lvleigang
|
||||||
// * @Description 主数据设置查询显示信息
|
* @Description 主数据设置查询显示信息
|
||||||
// * @Date 9:40 上午 2023/10/18
|
* @Date 9:40 上午 2023/10/18
|
||||||
// **/
|
**/
|
||||||
//JsonResultEntity queryMdmModuleView(JSONObject jsonObject);
|
JsonResultEntity queryMdmModuleView(JSONObject jsonObject);
|
||||||
//
|
|
||||||
///**
|
/**
|
||||||
// * @param jsonObject
|
* @param jsonObject
|
||||||
// * @return com.hzya.frame.web.entity.JsonResultEntity
|
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||||
// * @Author lvleigang
|
* @Author lvleigang
|
||||||
// * @Description 主数据设置修改显示信息
|
* @Description 主数据设置修改显示信息
|
||||||
// * @Date 9:40 上午 2023/10/18
|
* @Date 9:40 上午 2023/10/18
|
||||||
// **/
|
**/
|
||||||
//JsonResultEntity doSaveMdmModuleView(JSONObject jsonObject);
|
JsonResultEntity doSaveMdmModuleView(JSONObject jsonObject);
|
||||||
//
|
//
|
||||||
///**
|
///**
|
||||||
// * @param jsonObject
|
// * @param jsonObject
|
||||||
|
|
|
@ -5,6 +5,9 @@ import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity;
|
||||||
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity;
|
||||||
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity;
|
||||||
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity;
|
||||||
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
|
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
|
||||||
|
@ -34,4 +37,24 @@ public interface IMdmServiceCache {
|
||||||
List<MdmModuleDbFiledsEntity> queryMdmModuleDbFileds(MdmModuleDbFiledsEntity queryDbFiled);
|
List<MdmModuleDbFiledsEntity> queryMdmModuleDbFileds(MdmModuleDbFiledsEntity queryDbFiled);
|
||||||
|
|
||||||
List<MdmModuleDbFiledsRuleEntity> queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity queryDbFiledRule);
|
List<MdmModuleDbFiledsRuleEntity> queryMdmModuleDbFiledsRule(MdmModuleDbFiledsRuleEntity queryDbFiledRule);
|
||||||
|
|
||||||
|
void saveMdmTableCodeRule(String mdmid, List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntities);
|
||||||
|
|
||||||
|
void saveMdmModuleDb(String id, List<MdmModuleDbEntity> mdmModuleDbEntities);
|
||||||
|
|
||||||
|
void saveMdmModuleDbFileds(String id, List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities);
|
||||||
|
|
||||||
|
void saveMdmModuleDbFiledsRule(String id, List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities);
|
||||||
|
|
||||||
|
List<MdmModuleViewDetailEntity> queryMdmModuleViewDetail(MdmModuleViewDetailEntity mdmModuleViewDetailEntity);
|
||||||
|
|
||||||
|
List<MdmModuleViewEntity> queryMdmModuleView(MdmModuleViewEntity mdmModuleViewEntity);
|
||||||
|
|
||||||
|
List<MdmModuleViewButtonEntity> queryMdmModuleViewButton(MdmModuleViewButtonEntity mdmModuleViewButtonEntity);
|
||||||
|
|
||||||
|
void saveMdmModuleView(String id, MdmModuleViewEntity mdmModuleViewEntity);
|
||||||
|
|
||||||
|
void saveMdmModuleViewDetail(String id, List<MdmModuleViewDetailEntity> mdmModuleViewDetailEntities);
|
||||||
|
|
||||||
|
void saveMdmModuleViewButton(String id, List<MdmModuleViewButtonEntity> mdmModuleViewButtonEntities);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.hzya.frame.mdm.service.impl;
|
package com.hzya.frame.mdm.service.impl;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
@ -14,8 +15,11 @@ import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEnti
|
||||||
import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao;
|
import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao;
|
||||||
import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao;
|
import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao;
|
||||||
import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao;
|
import com.hzya.frame.mdm.mdmModuleView.dao.IMdmModuleViewDao;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleView.entity.MdmModuleViewEntity;
|
||||||
import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao;
|
import com.hzya.frame.mdm.mdmModuleViewButton.dao.IMdmModuleViewButtonDao;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleViewButton.entity.MdmModuleViewButtonEntity;
|
||||||
import com.hzya.frame.mdm.mdmModuleViewDetail.dao.IMdmModuleViewDetailDao;
|
import com.hzya.frame.mdm.mdmModuleViewDetail.dao.IMdmModuleViewDetailDao;
|
||||||
|
import com.hzya.frame.mdm.mdmModuleViewDetail.entity.MdmModuleViewDetailEntity;
|
||||||
import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao;
|
import com.hzya.frame.mdm.mdmTableCodeRule.dao.IMdmTableCodeRuleDao;
|
||||||
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
|
import com.hzya.frame.mdm.mdmTableCodeRule.entity.MdmTableCodeRuleEntity;
|
||||||
import com.hzya.frame.mdm.service.IMdmService;
|
import com.hzya.frame.mdm.service.IMdmService;
|
||||||
|
@ -30,6 +34,7 @@ import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,6 +85,7 @@ public class MdmServiceCache implements IMdmServiceCache {
|
||||||
return mdmTableCodeRuleEntityList;
|
return mdmTableCodeRuleEntityList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(cacheNames="mdmModuleDb",key = "#mdmId")
|
@Cacheable(cacheNames="mdmModuleDb",key = "#mdmId")
|
||||||
public List<MdmModuleDbEntity> queryMdmModuleDb(MdmModuleDbEntity entity) {
|
public List<MdmModuleDbEntity> queryMdmModuleDb(MdmModuleDbEntity entity) {
|
||||||
|
@ -100,4 +106,128 @@ public class MdmServiceCache implements IMdmServiceCache {
|
||||||
List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(entity);
|
List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(entity);
|
||||||
return mdmModuleDbFiledsRuleEntities;
|
return mdmModuleDbFiledsRuleEntities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@CacheEvict(cacheNames="mdmTableCodeRule",key = "#mdmId")
|
||||||
|
public void saveMdmTableCodeRule(String mdmId, List<MdmTableCodeRuleEntity> mdmTableCodeRuleEntities) {
|
||||||
|
MdmTableCodeRuleEntity mdmTableCodeRuleEntity = new MdmTableCodeRuleEntity();
|
||||||
|
mdmTableCodeRuleEntity.setMdmId(mdmId);
|
||||||
|
mdmTableCodeRuleEntity.setSts("Y");
|
||||||
|
mdmTableCodeRuleEntity.setUpdate();
|
||||||
|
mdmTableCodeRuleDao.logicRemoveMultiCondition(mdmTableCodeRuleEntity);
|
||||||
|
if(mdmTableCodeRuleEntities != null && mdmTableCodeRuleEntities.size() > 0){
|
||||||
|
for (int i = 0; i < mdmTableCodeRuleEntities.size(); i++) {
|
||||||
|
mdmTableCodeRuleDao.save(mdmTableCodeRuleEntities.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@CacheEvict(cacheNames="mdmModuleDb",key = "#mdmId")
|
||||||
|
public void saveMdmModuleDb(String mdmId, List<MdmModuleDbEntity> mdmModuleDbEntities) {
|
||||||
|
if(mdmModuleDbEntities != null && mdmModuleDbEntities.size() > 0){
|
||||||
|
for (int i = 0; i < mdmModuleDbEntities.size(); i++) {
|
||||||
|
if("1".equals(mdmModuleDbEntities.get(i).getDataType())){
|
||||||
|
mdmModuleDbDao.save(mdmModuleDbEntities.get(i));
|
||||||
|
}else {
|
||||||
|
mdmModuleDbDao.update(mdmModuleDbEntities.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
@CacheEvict(cacheNames="mdmModuleDbFileds",key = "#mdmId")
|
||||||
|
public void saveMdmModuleDbFileds(String mdmId, List<MdmModuleDbFiledsEntity> mdmModuleDbFiledsEntities) {
|
||||||
|
if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){
|
||||||
|
for (int i = 0; i < mdmModuleDbFiledsEntities.size(); i++) {
|
||||||
|
if("1".equals(mdmModuleDbFiledsEntities.get(i).getDataType())){
|
||||||
|
mdmModuleDbFiledsDao.save(mdmModuleDbFiledsEntities.get(i));
|
||||||
|
}else {
|
||||||
|
mdmModuleDbFiledsDao.update(mdmModuleDbFiledsEntities.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
@CacheEvict(cacheNames="mdmModuleDbFiledsRule",key = "#mdmId")
|
||||||
|
public void saveMdmModuleDbFiledsRule(String mdmId, List<MdmModuleDbFiledsRuleEntity> mdmModuleDbFiledsRuleEntities) {
|
||||||
|
MdmModuleDbFiledsRuleEntity mdmModuleDbFiledsRuleEntity = new MdmModuleDbFiledsRuleEntity();
|
||||||
|
mdmModuleDbFiledsRuleEntity.setMdmId(mdmId);
|
||||||
|
mdmModuleDbFiledsRuleEntity.setSts("Y");
|
||||||
|
mdmModuleDbFiledsRuleEntity.setUpdate();
|
||||||
|
mdmModuleDbFiledsRuleDao.logicRemoveMultiCondition(mdmModuleDbFiledsRuleEntity);
|
||||||
|
if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){
|
||||||
|
for (int i = 0; i < mdmModuleDbFiledsRuleEntities.size(); i++) {
|
||||||
|
if("1".equals(mdmModuleDbFiledsRuleEntities.get(i).getDataType())){
|
||||||
|
mdmModuleDbFiledsRuleDao.save(mdmModuleDbFiledsRuleEntities.get(i));
|
||||||
|
}else {
|
||||||
|
mdmModuleDbFiledsRuleDao.update(mdmModuleDbFiledsRuleEntities.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Cacheable(cacheNames="mdmModuleViewDetail",key = "#mdmId")
|
||||||
|
public List<MdmModuleViewDetailEntity> queryMdmModuleViewDetail(MdmModuleViewDetailEntity mdmModuleViewDetailEntity) {
|
||||||
|
List<MdmModuleViewDetailEntity> mdmModuleViewDetailEntities = mdmModuleViewDetailDao.queryBase(mdmModuleViewDetailEntity);
|
||||||
|
return mdmModuleViewDetailEntities;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Cacheable(cacheNames="mdmModuleView",key = "#mdmId")
|
||||||
|
public List<MdmModuleViewEntity> queryMdmModuleView(MdmModuleViewEntity mdmModuleViewEntity) {
|
||||||
|
List<MdmModuleViewEntity> moduleViewEntities = mdmModuleViewDao.queryBase(mdmModuleViewEntity);
|
||||||
|
return moduleViewEntities;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Cacheable(cacheNames="mdmModuleViewButton",key = "#mdmId")
|
||||||
|
public List<MdmModuleViewButtonEntity> queryMdmModuleViewButton(MdmModuleViewButtonEntity mdmModuleViewButtonEntity) {
|
||||||
|
List<MdmModuleViewButtonEntity> mdmModuleViewButtonEntities = mdmModuleViewButtonDao.queryBase(mdmModuleViewButtonEntity);
|
||||||
|
return mdmModuleViewButtonEntities;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@CacheEvict(cacheNames="mdmModuleView",key = "#mdmId")
|
||||||
|
public void saveMdmModuleView(String mdmId, MdmModuleViewEntity mdmModuleViewEntity) {
|
||||||
|
mdmModuleViewDao.update(mdmModuleViewEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@CacheEvict(cacheNames="mdmModuleViewDetail",key = "#mdmId")
|
||||||
|
public void saveMdmModuleViewDetail(String mdmId, List<MdmModuleViewDetailEntity> mdmModuleViewDetailEntities) {
|
||||||
|
MdmModuleViewDetailEntity mdmModuleViewDetailEntity = new MdmModuleViewDetailEntity();
|
||||||
|
mdmModuleViewDetailEntity.setMdmId(mdmId);
|
||||||
|
mdmModuleViewDetailEntity.setUpdate();
|
||||||
|
mdmModuleViewDetailDao.logicRemoveMultiCondition(mdmModuleViewDetailEntity);
|
||||||
|
if(mdmModuleViewDetailEntities != null && mdmModuleViewDetailEntities.size() > 0){
|
||||||
|
for (int i = 0; i < mdmModuleViewDetailEntities.size(); i++) {
|
||||||
|
if("1".equals(mdmModuleViewDetailEntities.get(i).getDataType())){
|
||||||
|
mdmModuleViewDetailDao.save(mdmModuleViewDetailEntities.get(i));
|
||||||
|
}else {
|
||||||
|
mdmModuleViewDetailDao.update(mdmModuleViewDetailEntities.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@CacheEvict(cacheNames="mdmModuleViewButton",key = "#mdmId")
|
||||||
|
public void saveMdmModuleViewButton(String mdmId, List<MdmModuleViewButtonEntity> mdmModuleViewButtonEntities) {
|
||||||
|
MdmModuleViewButtonEntity mdmModuleViewButtonEntity = new MdmModuleViewButtonEntity();
|
||||||
|
mdmModuleViewButtonEntity.setMdmId(mdmId);
|
||||||
|
mdmModuleViewButtonEntity.setUpdate();
|
||||||
|
mdmModuleViewButtonDao.logicRemoveMultiCondition(mdmModuleViewButtonEntity);
|
||||||
|
if(mdmModuleViewButtonEntities != null && mdmModuleViewButtonEntities.size() > 0){
|
||||||
|
for (int i = 0; i < mdmModuleViewButtonEntities.size(); i++) {
|
||||||
|
if("1".equals(mdmModuleViewButtonEntities.get(i).getDataType())){
|
||||||
|
mdmModuleViewButtonDao.save(mdmModuleViewButtonEntities.get(i));
|
||||||
|
}else {
|
||||||
|
mdmModuleViewButtonDao.update(mdmModuleViewButtonEntities.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue