Commit b33d8aed by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-data-cloud into developer
parents e3a03f7e d830f1ad
......@@ -19,6 +19,113 @@ public class IndexQO extends PageQO implements Serializable {
private Integer indexGroupId;
private List<Integer> indexIdList;
/**
* 指标id
*/
private Integer indexId;
/**
* 分类名
*/
private String classifyName;
/**
* 关联应用指标
*/
private String relAppIndex;
/**
*
*/
private String code;
/**
*
*/
private String name;
/**
* 指标级别
*/
private String indexLevelName;
/**
* 关联一级指标 ‘,’ 隔开
*/
private String relTopLevel;
/**
* 单位
*/
private Integer unitCode;
/**
* 单位
*/
private String unitName;
/**
* 小数位数
*/
private Integer decimalSize;
/**
* 数据类型 1流量 2存量
*/
private Integer dataType;
/**
* 指标类型 1基础 2计算
*/
private Integer indexType;
/**
* 基础组织维度
*/
private String baseOrganized;
/**
* 基础时间维度
*/
private String baseTime;
/**
* 更新频率 高/中/低
*/
private String updateRate;
/**
* 更新频率 补充说明
*/
private String updateRateRemark;
/**
* 口径/文案编辑
*/
private String indexRemark;
/**
* 补充说明
*/
private String complement;
private Integer showStatus;
private List<String> relModuleIdList;
/**
* 操作人id
*/
private Integer optUserId;
/**
* 操作人name
*/
private String optUserName;
private String indexGroupName;
private List<Integer> indexGroupIdList;
public Integer getClassifyType() {
return classifyType;
}
......@@ -74,4 +181,196 @@ public class IndexQO extends PageQO implements Serializable {
public void setIndexLevel(Integer indexLevel) {
this.indexLevel = indexLevel;
}
public Integer getIndexId() {
return indexId;
}
public void setIndexId(Integer indexId) {
this.indexId = indexId;
}
public String getClassifyName() {
return classifyName;
}
public void setClassifyName(String classifyName) {
this.classifyName = classifyName;
}
public String getRelAppIndex() {
return relAppIndex;
}
public void setRelAppIndex(String relAppIndex) {
this.relAppIndex = relAppIndex;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIndexLevelName() {
return indexLevelName;
}
public void setIndexLevelName(String indexLevelName) {
this.indexLevelName = indexLevelName;
}
public String getRelTopLevel() {
return relTopLevel;
}
public void setRelTopLevel(String relTopLevel) {
this.relTopLevel = relTopLevel;
}
public Integer getUnitCode() {
return unitCode;
}
public void setUnitCode(Integer unitCode) {
this.unitCode = unitCode;
}
public String getUnitName() {
return unitName;
}
public void setUnitName(String unitName) {
this.unitName = unitName;
}
public Integer getDecimalSize() {
return decimalSize;
}
public void setDecimalSize(Integer decimalSize) {
this.decimalSize = decimalSize;
}
public Integer getDataType() {
return dataType;
}
public void setDataType(Integer dataType) {
this.dataType = dataType;
}
public Integer getIndexType() {
return indexType;
}
public void setIndexType(Integer indexType) {
this.indexType = indexType;
}
public String getBaseOrganized() {
return baseOrganized;
}
public void setBaseOrganized(String baseOrganized) {
this.baseOrganized = baseOrganized;
}
public String getBaseTime() {
return baseTime;
}
public void setBaseTime(String baseTime) {
this.baseTime = baseTime;
}
public String getUpdateRate() {
return updateRate;
}
public void setUpdateRate(String updateRate) {
this.updateRate = updateRate;
}
public String getUpdateRateRemark() {
return updateRateRemark;
}
public void setUpdateRateRemark(String updateRateRemark) {
this.updateRateRemark = updateRateRemark;
}
public String getIndexRemark() {
return indexRemark;
}
public void setIndexRemark(String indexRemark) {
this.indexRemark = indexRemark;
}
public String getComplement() {
return complement;
}
public void setComplement(String complement) {
this.complement = complement;
}
public Integer getShowStatus() {
return showStatus;
}
public void setShowStatus(Integer showStatus) {
this.showStatus = showStatus;
}
public List<String> getRelModuleIdList() {
return relModuleIdList;
}
public void setRelModuleIdList(List<String> relModuleIdList) {
this.relModuleIdList = relModuleIdList;
}
public Integer getOptUserId() {
return optUserId;
}
public void setOptUserId(Integer optUserId) {
this.optUserId = optUserId;
}
public String getOptUserName() {
return optUserName;
}
public void setOptUserName(String optUserName) {
this.optUserName = optUserName;
}
public String getIndexGroupName() {
return indexGroupName;
}
public void setIndexGroupName(String indexGroupName) {
this.indexGroupName = indexGroupName;
}
public void setIndexGroupIdList(List<Integer> indexGroupIdList) {
this.indexGroupIdList = indexGroupIdList;
}
public List<Integer> getIndexGroupIdList() {
return indexGroupIdList;
}
}
......@@ -8,9 +8,11 @@ import com.gic.authcenter.security.core.util.UserUtils;
import com.gic.cloud.constants.IndexTypeEnum;
import com.gic.cloud.dto.IndexDTO;
import com.gic.cloud.dto.IndexLogDTO;
import com.gic.cloud.operation.web.vo.IndexVO;
import com.gic.cloud.qo.IndexQO;
import com.gic.cloud.service.IndexApiService;
import com.gic.cloud.service.IndexLogApiService;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.utils.ResultControllerUtils;
......@@ -40,7 +42,8 @@ public class IndexController {
@RequestMapping("/save-index")
public RestResponse saveIndex(IndexDTO indexDTO, String relModuleIds) {
public RestResponse saveIndex(IndexQO indexQO, String relModuleIds) {
IndexDTO indexDTO = EntityUtil.changeEntityByJSON(IndexDTO.class, indexQO);
if (indexDTO.getClassifyType() == null ||
StringUtils.isBlank(indexDTO.getCode()) ||
StringUtils.isBlank(indexDTO.getName()) ||
......@@ -74,7 +77,7 @@ public class IndexController {
@RequestMapping("/get-by-index-id")
public RestResponse getByIndexId(Integer indexId) {
ServiceResponse<IndexDTO> serviceResponse = indexApiService.getByIndexId(indexId);
return ResultControllerUtils.commonResult(serviceResponse);
return ResultControllerUtils.commonResultOne(serviceResponse, IndexVO.class);
}
@RequestMapping("/list-index")
......
package com.gic.cloud.operation.web.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @author zhiwj
* @Description:
* @date 2020-07-20 10:56
*/
public class IndexVO implements Serializable {
private static final long serialVersionUID = 5687670215343610800L;
/**
* 指标id
*/
private Integer indexId;
/**
* 分类类型 1指标 2维度 3说明
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Integer classifyType;
/**
* 分类名
*/
private String classifyName;
/**
* 是否应用指标 1是 0否
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Integer isAppIndex;
/**
* 关联应用指标
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private String relAppIndex;
/**
*
*/
private String code;
/**
*
*/
private String name;
/**
* 指标级别
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Integer indexLevel;
/**
* 指标级别
*/
private String indexLevelName;
/**
* 关联一级指标 ‘,’ 隔开
*/
private String relTopLevel;
/**
* 单位
*/
private Integer unitCode;
/**
* 单位
*/
private String unitName;
/**
* 小数位数
*/
private Integer decimalSize;
/**
* 数据类型 1流量 2存量
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Integer dataType;
/**
* 指标类型 1基础 2计算
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Integer indexType;
/**
* 基础组织维度
*/
private String baseOrganized;
/**
* 基础时间维度
*/
private String baseTime;
/**
* 更新频率 高/中/低
*/
private String updateRate;
/**
* 更新频率 补充说明
*/
private String updateRateRemark;
/**
* 口径/文案编辑
*/
private String indexRemark;
/**
* 补充说明
*/
private String complement;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Integer showStatus;
private List<String> relModuleIdList;
/**
* 操作人id
*/
private Integer optUserId;
/**
* 操作人name
*/
private String optUserName;
private Integer indexGroupId;
private String indexGroupName;
public Integer getIndexId() {
return indexId;
}
public void setIndexId(Integer indexId) {
this.indexId = indexId;
}
public Integer getClassifyType() {
return classifyType;
}
public void setClassifyType(Integer classifyType) {
this.classifyType = classifyType;
}
public String getClassifyName() {
return classifyName;
}
public void setClassifyName(String classifyName) {
this.classifyName = classifyName;
}
public Integer getIsAppIndex() {
return isAppIndex;
}
public void setIsAppIndex(Integer isAppIndex) {
this.isAppIndex = isAppIndex;
}
public String getRelAppIndex() {
return relAppIndex;
}
public void setRelAppIndex(String relAppIndex) {
this.relAppIndex = relAppIndex;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getIndexLevel() {
return indexLevel;
}
public void setIndexLevel(Integer indexLevel) {
this.indexLevel = indexLevel;
}
public String getIndexLevelName() {
return indexLevelName;
}
public void setIndexLevelName(String indexLevelName) {
this.indexLevelName = indexLevelName;
}
public String getRelTopLevel() {
return relTopLevel;
}
public void setRelTopLevel(String relTopLevel) {
this.relTopLevel = relTopLevel;
}
public Integer getUnitCode() {
return unitCode;
}
public void setUnitCode(Integer unitCode) {
this.unitCode = unitCode;
}
public String getUnitName() {
return unitName;
}
public void setUnitName(String unitName) {
this.unitName = unitName;
}
public Integer getDecimalSize() {
return decimalSize;
}
public void setDecimalSize(Integer decimalSize) {
this.decimalSize = decimalSize;
}
public Integer getDataType() {
return dataType;
}
public void setDataType(Integer dataType) {
this.dataType = dataType;
}
public Integer getIndexType() {
return indexType;
}
public void setIndexType(Integer indexType) {
this.indexType = indexType;
}
public String getBaseOrganized() {
return baseOrganized;
}
public void setBaseOrganized(String baseOrganized) {
this.baseOrganized = baseOrganized;
}
public String getBaseTime() {
return baseTime;
}
public void setBaseTime(String baseTime) {
this.baseTime = baseTime;
}
public String getUpdateRate() {
return updateRate;
}
public void setUpdateRate(String updateRate) {
this.updateRate = updateRate;
}
public String getUpdateRateRemark() {
return updateRateRemark;
}
public void setUpdateRateRemark(String updateRateRemark) {
this.updateRateRemark = updateRateRemark;
}
public String getIndexRemark() {
return indexRemark;
}
public void setIndexRemark(String indexRemark) {
this.indexRemark = indexRemark;
}
public String getComplement() {
return complement;
}
public void setComplement(String complement) {
this.complement = complement;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public List<String> getRelModuleIdList() {
return relModuleIdList;
}
public void setRelModuleIdList(List<String> relModuleIdList) {
this.relModuleIdList = relModuleIdList;
}
public Integer getOptUserId() {
return optUserId;
}
public void setOptUserId(Integer optUserId) {
this.optUserId = optUserId;
}
public String getOptUserName() {
return optUserName;
}
public void setOptUserName(String optUserName) {
this.optUserName = optUserName;
}
public Integer getShowStatus() {
return showStatus;
}
public void setShowStatus(Integer showStatus) {
this.showStatus = showStatus;
}
public Integer getIndexGroupId() {
return indexGroupId;
}
public void setIndexGroupId(Integer indexGroupId) {
this.indexGroupId = indexGroupId;
}
public String getIndexGroupName() {
return indexGroupName;
}
public void setIndexGroupName(String indexGroupName) {
this.indexGroupName = indexGroupName;
}
}
......@@ -57,4 +57,6 @@ public interface TabIndexGroupMapper {
TabIndexGroup getBySelective(TabIndexGroup indexGroup);
List<TabIndexGroup> listIndexGroup(@Param("ids") List<Integer> indexGroupIdList);
List<Integer> listChildIndexGroup(@Param("indexGroupId") Integer indexGroupId);
}
\ No newline at end of file
......@@ -24,4 +24,6 @@ public interface IndexGroupService {
List<TabIndexGroup> listIndexGroup();
String getNameByIds(List<Integer> indexGroupIdList);
List<Integer> listChildIndexGroup(Integer indexGroupId);
}
......@@ -71,4 +71,9 @@ public class IndexGroupServiceImpl implements IndexGroupService {
return Optional.ofNullable(indexGroupList).orElse(Collections.emptyList())
.stream().map(TabIndexGroup::getIndexGroupName).collect(Collectors.joining("\\"));
}
@Override
public List<Integer> listChildIndexGroup(Integer indexGroupId) {
return tabIndexGroupMapper.listChildIndexGroup(indexGroupId);
}
}
......@@ -4,6 +4,7 @@ import com.gic.cloud.dao.mapper.TabIndexMapper;
import com.gic.cloud.dto.IndexDTO;
import com.gic.cloud.entity.TabIndex;
import com.gic.cloud.qo.IndexQO;
import com.gic.cloud.service.IndexGroupService;
import com.gic.cloud.service.IndexModuleRelService;
import com.gic.cloud.service.IndexService;
import com.gic.commons.util.EntityUtil;
......@@ -29,6 +30,8 @@ public class IndexServiceImpl implements IndexService {
private TabIndexMapper tabIndexMapper;
@Autowired
private IndexModuleRelService indexModuleRelService;
@Autowired
private IndexGroupService indexGroupService;
@Override
public boolean isNameRepeat(String name, Integer indexId) {
......@@ -74,6 +77,10 @@ public class IndexServiceImpl implements IndexService {
List<Integer> indexIdList = indexModuleRelService.listBusinessIdByModuleIds(Arrays.asList(indexQO.getModuleId().split(",")));
indexQO.setIndexIdList(indexIdList);
}
if (indexQO.getIndexGroupId() != null) {
List<Integer> indexGroupIdList = indexGroupService.listChildIndexGroup(indexQO.getIndexGroupId());
indexQO.setIndexGroupIdList(indexGroupIdList);
}
return tabIndexMapper.listIndex(indexQO);
}
......
......@@ -97,6 +97,12 @@ public class IndexApiServiceImpl implements IndexApiService {
IndexDTO indexDTO = EntityUtil.changeEntityByJSON(IndexDTO.class, index);
List<String> moduleIdList = this.indexModuleRelService.listModuleIdByBusinessId(indexDTO.getIndexId(), LogAndUpdateTipsTypeEnum.INDEX.getCode());
indexDTO.setRelModuleIdList(moduleIdList);
if (indexDTO.getIndexGroupId() != null) {
TabIndexGroup indexGroup = this.indexGroupService.getById(indexDTO.getIndexGroupId());
if (indexGroup != null) {
indexDTO.setIndexGroupName(indexGroup.getIndexGroupName());
}
}
return EnterpriseServiceResponse.success(indexDTO);
}
......@@ -126,7 +132,7 @@ public class IndexApiServiceImpl implements IndexApiService {
return indexGroupName;
}
TabIndexGroup indexGroup = indexGroupService.getById(indexGroupId);
List<Integer> indexGroupIdList = Stream.of(indexGroup.getGroupChain().split("_")).map(Integer::valueOf).collect(Collectors.toList());
List<Integer> indexGroupIdList = Stream.of(indexGroup.getGroupChain().split("_")).filter(StringUtils::isNotBlank).map(Integer::valueOf).collect(Collectors.toList());
String groupName = indexGroupService.getNameByIds(indexGroupIdList);
cache.put(indexGroupId, groupName);
return groupName;
......
......@@ -140,7 +140,7 @@ public class UserApiServiceImpl implements UserApiService{
}
private static boolean isPhone(String phone) {
String regex = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$";
String regex = "^((13[0-9])|(14[0|5|6|7|9])|(15[0-3])|(15[5-9])|(16[6|7])|(17[2|3|5|6|7|8])|(18[0-9])|(19[1|8|9]))\\d{8}$";
if (StringUtils.isBlank(phone) || phone.length() != 11) {
return false;
} else {
......
......@@ -162,5 +162,6 @@
<if test="search != null and search != '' ">
and ( data_name like concat('%', #{search}, '%') or data_classify like concat('%', #{search}, '%') )
</if>
order by create_time desc
</select>
</mapper>
\ No newline at end of file
......@@ -142,4 +142,12 @@
</foreach>
</if>
</select>
<!-- List<Integer> listChildIndexGroup(@Param("indexGroupId") Integer indexGroupId);-->
<select id="listChildIndexGroup" resultType="int">
select
index_group_id
from tab_index_group
where status = 1
and group_chain like concat('%_', #{indexGroupId}, '_%')
</select>
</mapper>
\ No newline at end of file
......@@ -375,8 +375,14 @@
<if test="search != null and search != '' ">
and name like concat('%', #{search}, '%')
</if>
<if test="indexGroupId != null ">
and (index_group_id = #{indexGroupId} or index_group_id is null)
<!-- <if test="indexGroupId != null ">-->
<!-- and (index_group_id = #{indexGroupId} or index_group_id is null)-->
<!-- </if>-->
<if test="null != indexGroupIdList and indexGroupIdList.size > 0">
and index_group_id in
<foreach collection="indexGroupIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="indexLevel != null ">
and index_level = #{indexLevel}
......
......@@ -164,13 +164,13 @@
</select>
<select id="listBusinessIdByModuleId" resultType="int">
select
module_id
business_id
from tab_index_module_rel
where status = 1 and module_id = #{moduleId}
</select>
<select id="listBusinessIdByModuleIds" resultType="int">
select
module_id
business_id
from tab_index_module_rel
where status = 1
<if test="null != ids and ids.size > 0">
......
......@@ -156,7 +156,8 @@
from tab_sys_function_module
where status = 1
<if test="search != null and search != ''">
and (function_module_name like concat('%', #{search}, '%') or function_module_code like concat('%', #{search}, '%'))
and (function_module_name like concat('%', #{search}, '%') or function_module_code like concat('%', #{search}, '%')
or operation_name like concat('%', #{search}, '%'))
</if>
order by update_time desc
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment