Commit 4a430df2 by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-data-cloud into developer
parents 74927647 0677fb6c
package com.gic.cloud.constants;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 16:22
*/
public enum LogAndUpdateTipsTypeEnum {
// 指标字典
INDEX(1),
// 数据解读
DATA_EXPLAIN(2),
;
private Integer code;
LogAndUpdateTipsTypeEnum(Integer code) {
this.code = code;
}
public Integer getCode() {
return code;
}
}
package com.gic.cloud.constants;
/**
* @author zhiwj
* @Description:
* @date 2020-07-09 14:06
*/
public enum UpdateTypeEnum {
// 指标字典
ONLY_DETAIL(1),
// 数据解读
UPDATE_PUBLISH(2),
;
private Integer code;
UpdateTypeEnum(Integer code) {
this.code = code;
}
public Integer getCode() {
return code;
}
}
package com.gic.cloud.dto;
import java.io.Serializable;
import java.util.Date;
public class DataAuthDTO implements Serializable{
private static final long serialVersionUID = -2015311334509633014L;
/**
* ID
*/
private Integer dataAuthId;
/**
* 名称
*/
private String dataAuthName;
/**
*
*/
private Integer enterpriseId;
/**
* 线上业绩权限,json数组,[{"channel":1,"storeContent":[1]}]
*/
private String onlinePerformance;
/**
* 门店资源,门店选择器ID
*/
private Integer storeWidgetId;
/**
* 会员卡权限,_23232_23232_,可以多选,下划线隔开
*/
private String memberCardAuth;
/**
* 商品域权限,_23232_23232_,可以多选,下划线隔开
*/
private String goodsAreaAuth;
/**
* 1:有效 0:无效
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 授权人数
*/
private Integer memberCount;
public Integer getDataAuthId() {
return dataAuthId;
}
public DataAuthDTO setDataAuthId(Integer dataAuthId) {
this.dataAuthId = dataAuthId;
return this;
}
public String getDataAuthName() {
return dataAuthName;
}
public DataAuthDTO setDataAuthName(String dataAuthName) {
this.dataAuthName = dataAuthName;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public DataAuthDTO setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public String getOnlinePerformance() {
return onlinePerformance;
}
public DataAuthDTO setOnlinePerformance(String onlinePerformance) {
this.onlinePerformance = onlinePerformance;
return this;
}
public Integer getStoreWidgetId() {
return storeWidgetId;
}
public DataAuthDTO setStoreWidgetId(Integer storeWidgetId) {
this.storeWidgetId = storeWidgetId;
return this;
}
public String getMemberCardAuth() {
return memberCardAuth;
}
public DataAuthDTO setMemberCardAuth(String memberCardAuth) {
this.memberCardAuth = memberCardAuth;
return this;
}
public String getGoodsAreaAuth() {
return goodsAreaAuth;
}
public DataAuthDTO setGoodsAreaAuth(String goodsAreaAuth) {
this.goodsAreaAuth = goodsAreaAuth;
return this;
}
public Integer getStatus() {
return status;
}
public DataAuthDTO setStatus(Integer status) {
this.status = status;
return this;
}
public Date getCreateTime() {
return createTime;
}
public DataAuthDTO setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public DataAuthDTO setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
public Integer getMemberCount() {
return memberCount;
}
public DataAuthDTO setMemberCount(Integer memberCount) {
this.memberCount = memberCount;
return this;
}
}
package com.gic.cloud.dto;
import java.io.Serializable;
import java.util.Date;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 16:10
*/
public class DataExplainDTO implements Serializable {
private static final long serialVersionUID = -6587550517516153357L;
/**
*
*/
private Integer dataExplainId;
/**
* 数据模块名称
*/
private String dataName;
/**
* 模块分类
*/
private String dataClassify;
/**
* 口径/文案编辑
*/
private String indexRemark;
/**
* 补充说明
*/
private String complement;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private Integer status;
/**
* 模块id
*/
private Integer moduleId;
private Integer optUserId;
private String optUserName;
public Integer getDataExplainId() {
return dataExplainId;
}
public void setDataExplainId(Integer dataExplainId) {
this.dataExplainId = dataExplainId;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getDataClassify() {
return dataClassify;
}
public void setDataClassify(String dataClassify) {
this.dataClassify = dataClassify;
}
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 Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getModuleId() {
return moduleId;
}
public void setModuleId(Integer moduleId) {
this.moduleId = moduleId;
}
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;
}
}
package com.gic.cloud.dto;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 10:13
*/
public class IndexDTO implements Serializable {
private static final long serialVersionUID = 5687670215343610800L;
/**
* 指标id
*/
private Integer indexId;
/**
* 分类类型
*/
private Integer classifyType;
/**
* 分类名
*/
private String classifyName;
/**
* 是否应用指标 1是 0否
*/
private Integer isAppIndex;
/**
* 关联应用指标
*/
private String relAppIndex;
/**
*
*/
private String code;
/**
*
*/
private String name;
/**
* 指标级别
*/
private Integer indexLevel;
/**
* 指标级别
*/
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 Date createTime;
/**
*
*/
private Date updateTime;
private List<Integer> relModuleIdList;
/**
* 操作人id
*/
private Integer optUserId;
/**
* 操作人name
*/
private String optUserName;
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<Integer> getRelModuleIdList() {
return relModuleIdList;
}
public void setRelModuleIdList(List<Integer> 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;
}
}
package com.gic.cloud.dto;
import java.io.Serializable;
import java.util.Date;
/**
* @author zhiwj
* @Description:
* @date 2020-07-09 15:29
*/
public class IndexLogDTO implements Serializable {
private static final long serialVersionUID = -143993917383034476L;
/**
*
*/
private Integer cloudIndexLogId;
/**
* 被操作的指标数据字典
*/
private Integer businessId;
/**
* 操作时间
*/
private Date optTime;
/**
* 操作人id
*/
private Integer optUserId;
/**
* 操作人名
*/
private String optUserName;
/**
* 调整原因
*/
private String reason;
/**
*
*/
private Integer status;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
* 1指标字典 2数据解读
*/
private Integer type;
public Integer getCloudIndexLogId() {
return cloudIndexLogId;
}
public void setCloudIndexLogId(Integer cloudIndexLogId) {
this.cloudIndexLogId = cloudIndexLogId;
}
public Integer getBusinessId() {
return businessId;
}
public void setBusinessId(Integer businessId) {
this.businessId = businessId;
}
public Date getOptTime() {
return optTime;
}
public void setOptTime(Date optTime) {
this.optTime = optTime;
}
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 getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
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 Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
}
package com.gic.cloud.dto;
import java.io.Serializable;
import java.util.Date;
/**
* 暂存区
* @ClassName: TempStoreConditionDTO

* @Description: 

* @author guojuxing

* @date 2020/7/9 11:40 AM

*/
public class TempStoreConditionDTO implements Serializable{
private static final long serialVersionUID = -946079849874069372L;
/**
* ID
*/
private Integer tempStoreConditionId;
/**
* storeWidgetId
*/
private Integer storeWidgetId;
/**
*
*/
private Integer enterpriseId;
/**
* 1:有效 0:无效
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
public Integer getTempStoreConditionId() {
return tempStoreConditionId;
}
public TempStoreConditionDTO setTempStoreConditionId(Integer tempStoreConditionId) {
this.tempStoreConditionId = tempStoreConditionId;
return this;
}
public Integer getStoreWidgetId() {
return storeWidgetId;
}
public TempStoreConditionDTO setStoreWidgetId(Integer storeWidgetId) {
this.storeWidgetId = storeWidgetId;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public TempStoreConditionDTO setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public Integer getStatus() {
return status;
}
public TempStoreConditionDTO setStatus(Integer status) {
this.status = status;
return this;
}
public Date getCreateTime() {
return createTime;
}
public TempStoreConditionDTO setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public TempStoreConditionDTO setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
}
package com.gic.cloud.qo;
import java.io.Serializable;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 10:13
*/
public class DataExplainQO extends PageQO implements Serializable {
private static final long serialVersionUID = 5687670215343610800L;
private String search;
public String getSearch() {
return search;
}
public void setSearch(String search) {
this.search = search;
}
}
package com.gic.cloud.qo;
import java.io.Serializable;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 10:13
*/
public class IndexQO extends PageQO implements Serializable {
private static final long serialVersionUID = 5687670215343610800L;
private Integer classifyType;
private Integer moduleId;
private Integer isAppIndex;
private String search;
public Integer getClassifyType() {
return classifyType;
}
public void setClassifyType(Integer classifyType) {
this.classifyType = classifyType;
}
public Integer getModuleId() {
return moduleId;
}
public void setModuleId(Integer moduleId) {
this.moduleId = moduleId;
}
public Integer getIsAppIndex() {
return isAppIndex;
}
public void setIsAppIndex(Integer isAppIndex) {
this.isAppIndex = isAppIndex;
}
public String getSearch() {
return search;
}
public void setSearch(String search) {
this.search = search;
}
}
package com.gic.cloud.service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.DataAuthDTO;
import java.util.List;
public interface DataAuthApiService {
ServiceResponse<Integer> saveDataAuth(DataAuthDTO dto);
ServiceResponse<Void> editDataAuth(DataAuthDTO dto);
ServiceResponse<DataAuthDTO> getDataAuth(Integer dataAuthId);
ServiceResponse<Void> deleteDataAuth(Integer dataAuthId);
ServiceResponse<Page<DataAuthDTO>> pageDataAuth(Integer enterpriseId, String dataAuthName, Integer currentPage, Integer pageSize);
ServiceResponse<List<DataAuthDTO>> listDataAuth(Integer enterpriseId, String dataAuthName);
}
package com.gic.cloud.service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.DataExplainDTO;
import com.gic.cloud.qo.DataExplainQO;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 16:05
*/
public interface DataExplainApiService {
/**
* @Title: saveDataExplain
* @Description:
* @author zhiwj
* @param dataExplainDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> saveDataExplain(DataExplainDTO dataExplainDTO);
/**
* @Title: updateDataExplain
* @Description:
* @author zhiwj
* @param dataExplainDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> updateDataExplain(DataExplainDTO dataExplainDTO, Integer updateType, String reason);
/**
* @Title: getByDataExplainId
* @Description:
* @author zhiwj
* @return com.gic.api.base.commons.ServiceResponse<com.gic.cloud.dto.DataExplainDTO>
* @throws
*/
ServiceResponse<DataExplainDTO> getByDataExplainId(Integer dataExplainId);
/**
* @Title: listDataExplain
* @Description:
* @author zhiwj
* @param dataExplainQO
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.cloud.dto.DataExplainDTO>>
* @throws
*/
ServiceResponse<Page<DataExplainDTO>> listDataExplain(DataExplainQO dataExplainQO);
/**
* @Title: delete
* @Description:
* @author zhiwj
* @param dataExplainId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> delete(Integer dataExplainId);
/**
* @Title: publish
* @Description:
* @author zhiwj
* @param dataExplainId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> publish(Integer dataExplainId);
}
package com.gic.cloud.service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.IndexDTO;
import com.gic.cloud.qo.IndexQO;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 10:13
*/
public interface IndexApiService {
/**
* @Title: saveIndex
* @Description:
* @author zhiwj
* @param indexDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> saveIndex(IndexDTO indexDTO);
/**
* @Title: editIndex
* @Description:
* @author zhiwj
* @param indexDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> updateIndex(IndexDTO indexDTO, Integer updateType, String reason);
/**
* @Title: getById
* @Description:
* @author zhiwj
* @param indexId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.cloud.dto.IndexDTO>
* @throws
*/
ServiceResponse<IndexDTO> getByIndexId(Integer indexId);
/**
* @Title: listIndex
* @Description:
* @author zhiwj
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.cloud.dto.IndexDTO>>
* @throws
*/
ServiceResponse<Page<IndexDTO>> listIndex(IndexQO indexQO);
/**
* @Title: delete
* @Description:
* @author zhiwj
* @param indexId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> delete(Integer indexId);
/**
* 发布指标
* @Title: publish
* @Description:
* @author zhiwj
* @param indexId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> publish(Integer indexId);
}
package com.gic.cloud.service;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.IndexLogDTO;
import java.util.List;
/**
* @author zhiwj
* @Description:
* @date 2020-07-09 15:25
*/
public interface IndexLogApiService {
/**
* @Title: listIndexLog
* @Description:
* @author zhiwj
* @param indexId
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.cloud.dto.IndexLogDTO>>
* @throws
*/
ServiceResponse<List<IndexLogDTO>> listIndexLog(Integer indexId);
/**
* @Title: listIndexLog
* @Description:
* @author zhiwj
* @param dataExplainId
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.cloud.dto.IndexLogDTO>>
* @throws
*/
ServiceResponse<List<IndexLogDTO>> listDataExplainLog(Integer dataExplainId);
}
package com.gic.cloud.service;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.TempStoreConditionDTO;
public interface TempStoreConditionApiService {
ServiceResponse<Integer> saveOrUpdateTempStoreCondition(TempStoreConditionDTO dto);
ServiceResponse<TempStoreConditionDTO> getTempStoreCondition(Integer enterpriseId);
}
......@@ -51,6 +51,8 @@ public interface UserApiService {

*/
ServiceResponse<Page<UserDTO>> pageUser(UserQO userQO);
ServiceResponse<List<UserDTO>> listUser(UserQO userQO);
/**
* 批量转移分组
* @Title: bulkTransferAccountGroup

......
......@@ -19,8 +19,9 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<libraryVersion>4.0-SNAPSHOT</libraryVersion>
<gic-data-cloud-api>4.0-SNAPSHOT</gic-data-cloud-api>
<!-- api依赖,正式版会在 gic-pom-base 里生成 -->
<gic-data-cloud-api>4.0-SNAPSHOT</gic-data-cloud-api>
</properties>
<dependencies>
......@@ -88,6 +89,11 @@
<artifactId>gic-platform-enterprise-api</artifactId>
<version>${gic-platform-enterprise-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-data-cloud-api</artifactId>
<version>${gic-data-cloud-api}</version>
</dependency>
<!--<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
......
......@@ -25,7 +25,7 @@ import com.gic.dubbo.util.DubboContextUtil;
@ImportResource(value = {
"classpath*:applicationContext-init.xml",
"classpath*:dubbo-setting.xml",
"classpath*:dubbo-gic-platform-operation-web.xml",
"classpath*:dubbo-gic-data-cloud-operation-web.xml",
"classpath*:spring-interceptor.xml",
"classpath*:redis-init.xml"
})
......
package com.gic.cloud.operation.web.controller;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.DataExplainDTO;
import com.gic.cloud.dto.IndexLogDTO;
import com.gic.cloud.qo.DataExplainQO;
import com.gic.cloud.service.DataExplainApiService;
import com.gic.cloud.service.IndexLogApiService;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.utils.ResultControllerUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author zhiwj
* @Description:
* @date 2020-07-09 17:20
*/
@RestController
public class DataExplainController {
@Autowired
private DataExplainApiService dataExplainApiService;
@Autowired
private IndexLogApiService indexLogApiService;
@RequestMapping("/saveDataExplain")
public RestResponse saveDataExplain(DataExplainDTO dataExplainDTO) {
if (StringUtils.isBlank(dataExplainDTO.getDataName()) || StringUtils.isBlank(dataExplainDTO.getIndexRemark())) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg());
}
ServiceResponse<Void> serviceResponse = dataExplainApiService.saveDataExplain(dataExplainDTO);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/updateDataExplain")
public RestResponse updateDataExplain(DataExplainDTO dataExplainDTO, Integer updateType, String reason) {
ServiceResponse<Void> serviceResponse = dataExplainApiService.updateDataExplain(dataExplainDTO, updateType, reason);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/getByDataExplainId")
public RestResponse getByDataExplainId(Integer dataExplainId) {
ServiceResponse<DataExplainDTO> serviceResponse = dataExplainApiService.getByDataExplainId(dataExplainId);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/listDataExplain")
public RestResponse listDataExplain(DataExplainQO dataExplainQO) {
ServiceResponse<Page<DataExplainDTO>> serviceResponse = dataExplainApiService.listDataExplain(dataExplainQO);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/dataExplainLog")
public RestResponse dataExplainLog(Integer dataExplainId) {
ServiceResponse<List<IndexLogDTO>> serviceResponse = indexLogApiService.listDataExplainLog(dataExplainId);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/deleteDataExplain")
public RestResponse delete(Integer dataExplainId) {
ServiceResponse<Void> serviceResponse = dataExplainApiService.delete(dataExplainId);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/publishDataExplain")
public RestResponse publishIndex(Integer dataExplainId) {
ServiceResponse<Void> serviceResponse = dataExplainApiService.publish(dataExplainId);
return ResultControllerUtils.commonResult(serviceResponse);
}
}
\ No newline at end of file
package com.gic.cloud.operation.web.controller;
import com.gic.authcenter.security.core.util.UserUtils;
import com.gic.cloud.dto.FunctionModuleDTO;
import com.gic.cloud.operation.web.vo.FunctionModuleVO;
import com.gic.cloud.service.FunctionModuleApiService;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetail;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("function-module")
public class FunctionModuleController {
private static Logger LOGGER = LogManager.getLogger(FunctionModuleController.class);
@Autowired
private FunctionModuleApiService functionModuleApiService;
@RequestMapping("/list-function-component")
public RestResponse listFunctionComponent(String search) {
return ResultControllerUtils.commonResult(functionModuleApiService.listFunctionModule(search), FunctionModuleVO.class);
}
/**
* 添加说明
* @param dto
* @return
*/
@RequestMapping("/edit-function-component")
public RestResponse editFunctionComponent(FunctionModuleDTO dto) {
dto.setOperationId(UserUtils.getUser().getId().toString());
dto.setOperationName(UserUtils.getUser().getRealName());
return ResultControllerUtils.commonResult(functionModuleApiService.editFunctionModule(dto));
}
}
package com.gic.cloud.operation.web.controller;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.authcenter.security.core.dto.UserDetailsVO;
import com.gic.authcenter.security.core.util.UserUtils;
import com.gic.cloud.dto.IndexDTO;
import com.gic.cloud.dto.IndexLogDTO;
import com.gic.cloud.qo.IndexQO;
import com.gic.cloud.service.IndexApiService;
import com.gic.cloud.service.IndexLogApiService;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.utils.ResultControllerUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author zhiwj
* @Description:
* @date 2020-07-09 14:22
*/
@RestController
public class IndexController {
@Autowired
private IndexApiService indexApiService;
@Autowired
private IndexLogApiService indexLogApiService;
@RequestMapping("/saveIndex")
public RestResponse saveIndex(IndexDTO indexDTO) {
if (indexDTO.getIsAppIndex() == null ||
StringUtils.isBlank(indexDTO.getCode()) ||
StringUtils.isBlank(indexDTO.getName()) ||
StringUtils.isBlank(indexDTO.getIndexRemark())) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg());
}
UserDetailsVO user = UserUtils.getUser();
indexDTO.setOptUserId(user.getId());
indexDTO.setOptUserName(user.getRealName());
ServiceResponse<Void> serviceResponse = indexApiService.saveIndex(indexDTO);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/updateIndex")
public RestResponse updateIndex(IndexDTO indexDTO, Integer updateType, String reason) {
if (indexDTO.getIndexId() == null || updateType == null) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg());
}
ServiceResponse<Void> serviceResponse = indexApiService.updateIndex(indexDTO, updateType, reason);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/getByIndexId")
public RestResponse getByIndexId(Integer indexId) {
ServiceResponse<IndexDTO> serviceResponse = indexApiService.getByIndexId(indexId);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/listIndex")
public RestResponse listIndex(IndexQO indexQO) {
ServiceResponse<Page<IndexDTO>> serviceResponse = indexApiService.listIndex(indexQO);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/indexLog")
public RestResponse indexLog(Integer indexId) {
ServiceResponse<List<IndexLogDTO>> serviceResponse = indexLogApiService.listIndexLog(indexId);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/deleteIndex")
public RestResponse delete(Integer indexId) {
ServiceResponse<Void> serviceResponse = indexApiService.delete(indexId);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/publishIndex")
public RestResponse publishIndex(Integer indexId) {
ServiceResponse<Void> serviceResponse = indexApiService.publish(indexId);
return ResultControllerUtils.commonResult(serviceResponse);
}
}
\ No newline at end of file
package com.gic.cloud.operation.web.vo;
import java.io.Serializable;
import java.util.Date;
public class FunctionModuleVO implements Serializable{
private static final long serialVersionUID = 6083023157590374256L;
/**
* ID
*/
private Integer functionModuleId;
/**
* 名称
*/
private String functionModuleName;
/**
* 功能编码
*/
private String functionModuleCode;
/**
* 功能模块说明
*/
private String functionModuleDesc;
/**
* 运维操作人ID
*/
private String operationId;
/**
* 运维操作人name
*/
private String operationName;
/**
* 1:有效 0:无效
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
public Integer getFunctionModuleId() {
return functionModuleId;
}
public FunctionModuleVO setFunctionModuleId(Integer functionModuleId) {
this.functionModuleId = functionModuleId;
return this;
}
public String getFunctionModuleName() {
return functionModuleName;
}
public FunctionModuleVO setFunctionModuleName(String functionModuleName) {
this.functionModuleName = functionModuleName;
return this;
}
public String getFunctionModuleCode() {
return functionModuleCode;
}
public FunctionModuleVO setFunctionModuleCode(String functionModuleCode) {
this.functionModuleCode = functionModuleCode;
return this;
}
public String getFunctionModuleDesc() {
return functionModuleDesc;
}
public FunctionModuleVO setFunctionModuleDesc(String functionModuleDesc) {
this.functionModuleDesc = functionModuleDesc;
return this;
}
public String getOperationId() {
return operationId;
}
public FunctionModuleVO setOperationId(String operationId) {
this.operationId = operationId;
return this;
}
public String getOperationName() {
return operationName;
}
public FunctionModuleVO setOperationName(String operationName) {
this.operationName = operationName;
return this;
}
public Integer getStatus() {
return status;
}
public FunctionModuleVO setStatus(Integer status) {
this.status = status;
return this;
}
public Date getCreateTime() {
return createTime;
}
public FunctionModuleVO setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public FunctionModuleVO setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
}
......@@ -92,4 +92,11 @@
<dubbo:reference interface="com.gic.authcenter.api.service.GicDepartmentService" id="gicDepartmentService" timeout="6000" />
<dubbo:reference interface="com.gic.member.config.api.service.MemberCardApiService" id="memberCardApiService" timeout="6000" />
<dubbo:reference interface="com.gic.cloud.service.IndexApiService" id="indexApiService" timeout="6000" retries="0"/>
<dubbo:reference interface="com.gic.cloud.service.IndexLogApiService" id="indexLogApiService" timeout="6000" retries="0"/>
<dubbo:reference interface="com.gic.cloud.service.DataExplainApiService" id="dataExplainApiService" timeout="6000" retries="0"/>
<dubbo:reference interface="com.gic.cloud.service.FunctionModuleApiService" id="functionModuleApiService" timeout="6000" retries="0"/>
</beans>
\ No newline at end of file
package com.gic.cloud.dao.mapper;
import com.gic.cloud.entity.TabDataExplain;
import com.gic.cloud.qo.DataExplainQO;
import com.github.pagehelper.Page;
public interface TabDataExplainMapper {
/**
* 根据主键删除
*
* @param dataExplainId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer dataExplainId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabDataExplain record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabDataExplain record);
/**
* 根据主键查询
*
* @param dataExplainId 主键
* @return 实体对象
*/
TabDataExplain selectByPrimaryKey(Integer dataExplainId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabDataExplain record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabDataExplain record);
TabDataExplain getBySelective(TabDataExplain tabDataExplain);
Page<TabDataExplain> listDataExplain(DataExplainQO dataExplainQO);
}
\ No newline at end of file
package com.gic.cloud.dao.mapper;
import com.gic.cloud.entity.TabIndexLog;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TabIndexLogMapper {
/**
* 根据主键删除
*
* @param cloudIndexLogId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer cloudIndexLogId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabIndexLog record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabIndexLog record);
/**
* 根据主键查询
*
* @param cloudIndexLogId 主键
* @return 实体对象
*/
TabIndexLog selectByPrimaryKey(Integer cloudIndexLogId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabIndexLog record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabIndexLog record);
List<TabIndexLog> listBusinessLog(@Param("businessId") Integer businessId, @Param("type") Integer type);
}
\ No newline at end of file
package com.gic.cloud.dao.mapper;
import com.gic.cloud.entity.TabIndex;
import com.gic.cloud.qo.IndexQO;
import com.github.pagehelper.Page;
public interface TabIndexMapper {
/**
* 根据主键删除
*
* @param indexId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer indexId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabIndex record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabIndex record);
/**
* 根据主键查询
*
* @param indexId 主键
* @return 实体对象
*/
TabIndex selectByPrimaryKey(Integer indexId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabIndex record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabIndex record);
TabIndex getBySelective(TabIndex tabIndex);
Page<TabIndex> listIndex(IndexQO indexQO);
}
\ No newline at end of file
package com.gic.cloud.dao.mapper;
import com.gic.cloud.entity.TabIndexModuleRel;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TabIndexModuleRelMapper {
/**
* 根据主键删除
*
* @param indexModuleRelId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer indexModuleRelId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabIndexModuleRel record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabIndexModuleRel record);
/**
* 根据主键查询
*
* @param indexModuleRelId 主键
* @return 实体对象
*/
TabIndexModuleRel selectByPrimaryKey(Integer indexModuleRelId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabIndexModuleRel record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabIndexModuleRel record);
void delByBusinessId(@Param("businessId") Integer businessId, @Param("type") Integer type);
void insertSelectiveByNotExist(TabIndexModuleRel rel);
void updateStatusByBusinessIds(@Param("businessId") Integer businessId, @Param("ids") List<Integer> moduleIdList, @Param("type") Integer type);
List<Integer> listModuleIdByBusinessId(@Param("businessId") Integer businessId, @Param("type") Integer type);
List<Integer> listBusinessIdByModuleId(@Param("moduleId") Integer moduleId);
List<TabIndexModuleRel> listModuleIdByBusinessIds(@Param("ids") List<Integer> businessIdList, @Param("type") Integer type);
}
\ No newline at end of file
package com.gic.cloud.dao.mapper;
import com.gic.cloud.entity.TabSysDataAuth;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TabSysDataAuthMapper {
/**
* 根据主键删除
*
* @param dataAuthId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer dataAuthId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabSysDataAuth record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabSysDataAuth record);
/**
* 根据主键查询
*
* @param dataAuthId 主键
* @return 实体对象
*/
TabSysDataAuth selectByPrimaryKey(Integer dataAuthId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabSysDataAuth record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabSysDataAuth record);
int countByDataAuthName(@Param("enterpriseId") Integer enterpriseId,
@Param("dataAuthId") Integer dataAuthId,
@Param("dataAuthName") String dataAuthName);
int deleteDataAuth(@Param("dataAuthId") Integer dataAuthId);
List<TabSysDataAuth> listDataAuth(@Param("enterpriseId")Integer enterpriseId,
@Param("dataAuthName")String dataAuthName);
}
\ No newline at end of file
package com.gic.cloud.dao.mapper;
import com.gic.cloud.entity.TabSysTempStoreCondition;
import org.apache.ibatis.annotations.Param;
public interface TabSysTempStoreConditionMapper {
/**
* 根据主键删除
*
* @param tempStoreConditionId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer tempStoreConditionId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabSysTempStoreCondition record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabSysTempStoreCondition record);
/**
* 根据主键查询
*
* @param tempStoreConditionId 主键
* @return 实体对象
*/
TabSysTempStoreCondition selectByPrimaryKey(Integer tempStoreConditionId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabSysTempStoreCondition record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabSysTempStoreCondition record);
TabSysTempStoreCondition getTempStoreCondition(@Param("enterpriseId") Integer enterpriseId);
}
\ No newline at end of file
......@@ -73,6 +73,9 @@ public interface TabSysUserMapper {
List<TabSysUser> listUserByPhone(@Param("nationCode") String nationCode, @Param("phone") String phone);
List<UserDTO> countGroupByFunctionAuthId(@Param("enterpriseId")Integer enterpriseId,
List<UserDTO> countGroupByFunctionAuthId(@Param("enterpriseId") Integer enterpriseId,
@Param("functionIdList") List<Integer> functionIdList);
List<UserDTO> countGroupByDataAuthId(@Param("enterpriseId") Integer enterpriseId,
@Param("dataAuthIdList") List<Integer> dataAuthIdList);
}
\ No newline at end of file
package com.gic.cloud.dao.mapper;
import com.gic.cloud.entity.TabUpdateTips;
import org.apache.ibatis.annotations.Param;
public interface TabUpdateTipsMapper {
/**
* 根据主键删除
*
* @param updateTipsId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer updateTipsId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabUpdateTips record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabUpdateTips record);
/**
* 根据主键查询
*
* @param updateTipsId 主键
* @return 实体对象
*/
TabUpdateTips selectByPrimaryKey(Integer updateTipsId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabUpdateTips record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabUpdateTips record);
void updateStatus(@Param("businessId") Integer businessId, @Param("type") Integer type, @Param("userId") Integer userId, @Param("showStatus") Integer showStatus);
}
\ No newline at end of file
package com.gic.cloud.entity;
import java.util.Date;
/**
* tab_data_explain
*/
public class TabDataExplain {
/**
*
*/
private Integer dataExplainId;
/**
* 数据模块名称
*/
private String dataName;
/**
* 模块分类
*/
private String dataClassify;
/**
* 口径/文案编辑
*/
private String indexRemark;
/**
* 补充说明
*/
private String complement;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private Integer status;
/**
* 模块id
*/
private Integer moduleId;
public Integer getDataExplainId() {
return dataExplainId;
}
public void setDataExplainId(Integer dataExplainId) {
this.dataExplainId = dataExplainId;
}
public String getDataName() {
return dataName;
}
public void setDataName(String dataName) {
this.dataName = dataName;
}
public String getDataClassify() {
return dataClassify;
}
public void setDataClassify(String dataClassify) {
this.dataClassify = dataClassify;
}
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 Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getModuleId() {
return moduleId;
}
public void setModuleId(Integer moduleId) {
this.moduleId = moduleId;
}
}
\ No newline at end of file
package com.gic.cloud.entity;
import java.util.Date;
/**
* tab_index
*/
public class TabIndex {
/**
* 指标id
*/
private Integer indexId;
/**
* 分类类型
*/
private Integer classifyType;
/**
* 分类名
*/
private String classifyName;
/**
* 是否应用指标 1是 0否
*/
private Integer isAppIndex;
/**
* 关联应用指标
*/
private String relAppIndex;
/**
*
*/
private String code;
/**
*
*/
private String name;
/**
* 指标级别
*/
private Integer indexLevel;
/**
* 指标级别
*/
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;
/**
* 是否展示 1展示 0不展示
*/
private Integer show;
/**
* 补充说明
*/
private String complement;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private Integer status;
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 Integer getShow() {
return show;
}
public void setShow(Integer show) {
this.show = show;
}
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 Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
\ No newline at end of file
package com.gic.cloud.entity;
import java.util.Date;
/**
* tab_index_log
*/
public class TabIndexLog {
/**
*
*/
private Integer cloudIndexLogId;
/**
* 被操作的指标数据字典
*/
private Integer businessId;
/**
* 操作时间
*/
private Date optTime;
/**
* 操作人id
*/
private Integer optUserId;
/**
* 操作人名
*/
private String optUserName;
/**
* 调整原因
*/
private String reason;
/**
*
*/
private Integer status;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
* 1指标字典 2数据解读
*/
private Integer type;
public Integer getCloudIndexLogId() {
return cloudIndexLogId;
}
public void setCloudIndexLogId(Integer cloudIndexLogId) {
this.cloudIndexLogId = cloudIndexLogId;
}
public Integer getBusinessId() {
return businessId;
}
public void setBusinessId(Integer businessId) {
this.businessId = businessId;
}
public Date getOptTime() {
return optTime;
}
public void setOptTime(Date optTime) {
this.optTime = optTime;
}
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 getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
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 Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
}
\ No newline at end of file
package com.gic.cloud.entity;
import java.util.Date;
/**
* tab_index_module_rel
*/
public class TabIndexModuleRel {
/**
* 关联表id
*/
private Integer indexModuleRelId;
/**
* 关联类型 1指标字典关联编号 2指标字典是否展示 3数据解读关联模块编号
*/
private Integer type;
/**
* 指标字典或数据解读的id
*/
private Integer businessId;
/**
* 模块的id
*/
private Integer moduleId;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private Integer status;
public Integer getIndexModuleRelId() {
return indexModuleRelId;
}
public void setIndexModuleRelId(Integer indexModuleRelId) {
this.indexModuleRelId = indexModuleRelId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getBusinessId() {
return businessId;
}
public void setBusinessId(Integer businessId) {
this.businessId = businessId;
}
public Integer getModuleId() {
return moduleId;
}
public void setModuleId(Integer moduleId) {
this.moduleId = moduleId;
}
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 Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
\ No newline at end of file
package com.gic.cloud.entity;
import java.util.Date;
/**
* tab_sys_data_auth
*/
public class TabSysDataAuth {
/**
* ID
*/
private Integer dataAuthId;
/**
* 名称
*/
private String dataAuthName;
/**
*
*/
private Integer enterpriseId;
/**
* 线上业绩权限,json数组,[{"channel":1,"storeContent":[1]}]
*/
private String onlinePerformance;
/**
* 门店资源,门店选择器ID
*/
private Integer storeWidgetId;
/**
* 会员卡权限,_23232_23232_,可以多选,下划线隔开
*/
private String memberCardAuth;
/**
* 商品域权限,_23232_23232_,可以多选,下划线隔开
*/
private String goodsAreaAuth;
/**
* 1:有效 0:无效
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
public Integer getDataAuthId() {
return dataAuthId;
}
public TabSysDataAuth setDataAuthId(Integer dataAuthId) {
this.dataAuthId = dataAuthId;
return this;
}
public String getDataAuthName() {
return dataAuthName;
}
public TabSysDataAuth setDataAuthName(String dataAuthName) {
this.dataAuthName = dataAuthName;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public TabSysDataAuth setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public String getOnlinePerformance() {
return onlinePerformance;
}
public TabSysDataAuth setOnlinePerformance(String onlinePerformance) {
this.onlinePerformance = onlinePerformance;
return this;
}
public Integer getStoreWidgetId() {
return storeWidgetId;
}
public TabSysDataAuth setStoreWidgetId(Integer storeWidgetId) {
this.storeWidgetId = storeWidgetId;
return this;
}
public String getMemberCardAuth() {
return memberCardAuth;
}
public TabSysDataAuth setMemberCardAuth(String memberCardAuth) {
this.memberCardAuth = memberCardAuth;
return this;
}
public String getGoodsAreaAuth() {
return goodsAreaAuth;
}
public TabSysDataAuth setGoodsAreaAuth(String goodsAreaAuth) {
this.goodsAreaAuth = goodsAreaAuth;
return this;
}
public Integer getStatus() {
return status;
}
public TabSysDataAuth setStatus(Integer status) {
this.status = status;
return this;
}
public Date getCreateTime() {
return createTime;
}
public TabSysDataAuth setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public TabSysDataAuth setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
}
\ No newline at end of file
package com.gic.cloud.entity;
import java.util.Date;
/**
* tab_sys_temp_store_condition
*/
public class TabSysTempStoreCondition {
/**
* ID
*/
private Integer tempStoreConditionId;
/**
* storeWidgetId
*/
private Integer storeWidgetId;
/**
*
*/
private Integer enterpriseId;
/**
* 1:有效 0:无效
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
public Integer getTempStoreConditionId() {
return tempStoreConditionId;
}
public TabSysTempStoreCondition setTempStoreConditionId(Integer tempStoreConditionId) {
this.tempStoreConditionId = tempStoreConditionId;
return this;
}
public Integer getStoreWidgetId() {
return storeWidgetId;
}
public TabSysTempStoreCondition setStoreWidgetId(Integer storeWidgetId) {
this.storeWidgetId = storeWidgetId;
return this;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public TabSysTempStoreCondition setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
return this;
}
public Integer getStatus() {
return status;
}
public TabSysTempStoreCondition setStatus(Integer status) {
this.status = status;
return this;
}
public Date getCreateTime() {
return createTime;
}
public TabSysTempStoreCondition setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public TabSysTempStoreCondition setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
}
\ No newline at end of file
package com.gic.cloud.entity;
/**
* tab_update_tips
*/
public class TabUpdateTips {
/**
*
*/
private Integer updateTipsId;
/**
*
*/
private Integer userId;
/**
*
*/
private Integer businessId;
/**
* 展示状态 1展示红的 0展示灰色已读
*/
private Integer showStatus;
/**
* 1指标字典 2数据解读
*/
private Integer type;
public Integer getUpdateTipsId() {
return updateTipsId;
}
public void setUpdateTipsId(Integer updateTipsId) {
this.updateTipsId = updateTipsId;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getBusinessId() {
return businessId;
}
public void setBusinessId(Integer businessId) {
this.businessId = businessId;
}
public Integer getShowStatus() {
return showStatus;
}
public void setShowStatus(Integer showStatus) {
this.showStatus = showStatus;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
}
\ No newline at end of file
package com.gic.cloud.service;
import com.gic.cloud.dto.DataAuthDTO;
import com.gic.cloud.entity.TabSysDataAuth;
import com.github.pagehelper.Page;
import java.util.List;
public interface DataAuthService {
Integer saveDataAuth(DataAuthDTO dto);
void editDataAuth(DataAuthDTO dto);
TabSysDataAuth getDataAuth(Integer dataAuthId);
boolean isRepeatDataAuthName(Integer enterpriseId, Integer dataAuthId, String dataAuthName);
int deleteDataAuth(Integer dataAuthId);
Page<TabSysDataAuth> pageDataAuth(Integer enterpriseId, String dataAuthName, Integer currentPage, Integer pageSize);
List<TabSysDataAuth> listDataAuth(Integer enterpriseId, String dataAuthName);
}
package com.gic.cloud.service;
import com.gic.cloud.dto.DataExplainDTO;
import com.gic.cloud.entity.TabDataExplain;
import com.gic.cloud.qo.DataExplainQO;
import com.github.pagehelper.Page;
import java.util.List;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 10:22
*/
public interface DataExplainService {
boolean isNameRepeat(String dataName, Integer dataExplainId);
Integer save(DataExplainDTO dataExplainDTO);
void update(DataExplainDTO dataExplainDTO);
TabDataExplain getByDataExplainId(Integer dataExplainId);
Page<TabDataExplain> listDataExplain(DataExplainQO dataExplainQO);
List<TabDataExplain> listAllDataExplain();
void deleteById(Integer dataExplainId);
}
package com.gic.cloud.service;
import com.gic.cloud.dto.DataExplainDTO;
import com.gic.cloud.dto.IndexDTO;
import com.gic.cloud.entity.TabIndexLog;
import java.util.List;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 10:22
*/
public interface IndexLogService {
void saveIndexInsertLog(IndexDTO indexDTO);
void saveIndexUpdateLog(IndexDTO indexDTO, String reason);
void saveDataExplainInsertLog(DataExplainDTO dataExplainDTO);
void saveDataExplainUpdateLog(DataExplainDTO dataExplainDTO, String reason);
List<TabIndexLog> listIndexLog(Integer indexId);
List<TabIndexLog> listDataExplainLog(Integer dataExplainId);
}
package com.gic.cloud.service;
import java.util.List;
import java.util.Map;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 10:22
*/
public interface IndexModuleRelService {
void save(Integer indexId, List<Integer> moduleId, Integer type);
List<Integer> listModuleIdByBusinessId(Integer indexId, Integer type);
List<Integer> listBusinessIdByModuleId(Integer moduleId);
void deleteByBusinessId(Integer businessId, Integer type);
Map<Integer, List<Integer>> groupModuleIdByBusinessIds(List<Integer> indexIdList, Integer type);
}
package com.gic.cloud.service;
import com.gic.cloud.dto.IndexDTO;
import com.gic.cloud.entity.TabIndex;
import com.gic.cloud.qo.IndexQO;
import com.github.pagehelper.Page;
import java.util.List;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 10:20
*/
public interface IndexService {
boolean isNameRepeat(String name, Integer indexId);
boolean isCodeRepeat(String code, Integer indexId);
Integer save(IndexDTO indexDTO);
void update(IndexDTO indexDTO);
TabIndex getByIndexId(Integer indexId);
Page<TabIndex> listIndex(IndexQO indexQO);
List<TabIndex> listAllIndex();
void deleteById(Integer indexId);
}
package com.gic.cloud.service;
import com.gic.cloud.dto.TempStoreConditionDTO;
import com.gic.cloud.entity.TabSysTempStoreCondition;
public interface TempStoreConditionService {
Integer saveTempStoreCondition(TempStoreConditionDTO dto);
void editTempStoreCondition(TempStoreConditionDTO dto);
TabSysTempStoreCondition getTempStoreCondition(Integer enterpriseId);
}
package com.gic.cloud.service;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 14:28
*/
public interface UpdateTipService {
void insertBySaveUser(Integer userId);
void insertBySaveBusiness(Integer businessId, Integer type);
/**
* 发布 要更新小红点
*/
void publish(Integer businessId, Integer type);
void erase(Integer userId);
}
......@@ -31,6 +31,8 @@ public interface UserService {
Page<TabSysUser> pageUser(UserQO userQO);
List<TabSysUser> listUser(UserQO userQO);
void bulkTransferAccountGroup(List<Integer> userIdList, Integer targetAccountGroupId);
List<UserDTO> countGroupByAccountGroupId(Integer enterpriseId);
......@@ -38,4 +40,6 @@ public interface UserService {
List<TabSysUser> listUserByPhone(String nationCode, String phone);
List<UserDTO> countGroupByFunctionAuthId(Integer enterpriseId, List<Integer> functionIdList);
List<UserDTO> countGroupByDataAuthId(Integer enterpriseId, List<Integer> dataAuthIdList);
}
package com.gic.cloud.service.impl;
import com.gic.cloud.dao.mapper.TabSysDataAuthMapper;
import com.gic.cloud.dto.DataAuthDTO;
import com.gic.cloud.entity.TabSysDataAuth;
import com.gic.cloud.service.DataAuthService;
import com.gic.commons.util.EntityUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service("dataAuthService")
public class DataAuthServiceImpl implements DataAuthService{
@Autowired
private TabSysDataAuthMapper tabSysDataAuthMapper;
@Override
public Integer saveDataAuth(DataAuthDTO dto) {
TabSysDataAuth record = EntityUtil.changeEntityNew(TabSysDataAuth.class, dto);
Date now = new Date();
record.setUpdateTime(now);
record.setCreateTime(now);
record.setStatus(1);
tabSysDataAuthMapper.insert(record);
return record.getDataAuthId();
}
@Override
public void editDataAuth(DataAuthDTO dto) {
TabSysDataAuth record = EntityUtil.changeEntityNew(TabSysDataAuth.class, dto);
record.setUpdateTime(new Date());
tabSysDataAuthMapper.updateByPrimaryKeySelective(record);
}
@Override
public TabSysDataAuth getDataAuth(Integer dataAuthId) {
return tabSysDataAuthMapper.selectByPrimaryKey(dataAuthId);
}
@Override
public boolean isRepeatDataAuthName(Integer enterpriseId, Integer dataAuthId, String dataAuthName) {
if (tabSysDataAuthMapper.countByDataAuthName(enterpriseId, dataAuthId, dataAuthName) > 0) {
return true;
}
return false;
}
@Override
public int deleteDataAuth(Integer dataAuthId) {
return tabSysDataAuthMapper.deleteDataAuth(dataAuthId);
}
@Override
public Page<TabSysDataAuth> pageDataAuth(Integer enterpriseId, String dataAuthName, Integer currentPage, Integer pageSize) {
if (currentPage == null) {
currentPage = 1;
}
if (pageSize == null) {
pageSize = 20;
}
PageHelper.startPage(currentPage, pageSize);
return (Page<TabSysDataAuth>) tabSysDataAuthMapper.listDataAuth(enterpriseId, dataAuthName);
}
@Override
public List<TabSysDataAuth> listDataAuth(Integer enterpriseId, String dataAuthName) {
return tabSysDataAuthMapper.listDataAuth(enterpriseId, dataAuthName);
}
}
package com.gic.cloud.service.impl;
import com.gic.cloud.dao.mapper.TabDataExplainMapper;
import com.gic.cloud.dto.DataExplainDTO;
import com.gic.cloud.entity.TabDataExplain;
import com.gic.cloud.qo.DataExplainQO;
import com.gic.cloud.service.DataExplainService;
import com.gic.commons.util.EntityUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 16:51
*/
@Service
public class DataExplainServiceImpl implements DataExplainService {
@Autowired
private TabDataExplainMapper tabDataExplainMapper;
@Override
public boolean isNameRepeat(String dataName, Integer dataExplainId) {
TabDataExplain tabDataExplain = new TabDataExplain();
tabDataExplain.setDataExplainId(dataExplainId);
tabDataExplain.setDataName(dataName);
return tabDataExplainMapper.getBySelective(tabDataExplain) != null;
}
@Override
public Integer save(DataExplainDTO dataExplainDTO) {
TabDataExplain tabDataExplain = EntityUtil.changeEntityByJSON(TabDataExplain.class, dataExplainDTO);
tabDataExplain.setCreateTime(new Date());
tabDataExplain.setStatus(1);
tabDataExplainMapper.insertSelective(tabDataExplain);
return tabDataExplain.getDataExplainId();
}
@Override
public void update(DataExplainDTO dataExplainDTO) {
TabDataExplain tabDataExplain = EntityUtil.changeEntityByJSON(TabDataExplain.class, dataExplainDTO);
tabDataExplainMapper.updateByPrimaryKeySelective(tabDataExplain);
}
@Override
public TabDataExplain getByDataExplainId(Integer dataExplainId) {
return tabDataExplainMapper.selectByPrimaryKey(dataExplainId);
}
@Override
public Page<TabDataExplain> listDataExplain(DataExplainQO dataExplainQO) {
PageHelper.startPage(dataExplainQO.getCurrentPage(), dataExplainQO.getPageSize());
return tabDataExplainMapper.listDataExplain(dataExplainQO);
}
@Override
public List<TabDataExplain> listAllDataExplain() {
return tabDataExplainMapper.listDataExplain(new DataExplainQO());
}
@Override
public void deleteById(Integer dataExplainId) {
TabDataExplain dataExplain = new TabDataExplain();
dataExplain.setDataExplainId(dataExplainId);
dataExplain.setStatus(0);
tabDataExplainMapper.updateByPrimaryKeySelective(dataExplain);
}
}
package com.gic.cloud.service.impl;
import com.gic.cloud.constants.LogAndUpdateTipsTypeEnum;
import com.gic.cloud.dao.mapper.TabIndexLogMapper;
import com.gic.cloud.dto.DataExplainDTO;
import com.gic.cloud.dto.IndexDTO;
import com.gic.cloud.entity.TabIndexLog;
import com.gic.cloud.service.IndexLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 10:26
*/
@Service
public class IndexLogServiceImpl implements IndexLogService {
@Autowired
private TabIndexLogMapper tabIndexLogMapper;
@Override
public void saveIndexInsertLog(IndexDTO indexDTO) {
saveLog(indexDTO, "新增");
}
@Override
public void saveIndexUpdateLog(IndexDTO indexDTO, String reason) {
saveLog(indexDTO, reason);
}
private void saveLog(IndexDTO indexDTO, String reason) {
TabIndexLog indexLog = new TabIndexLog();
indexLog.setBusinessId(indexDTO.getIndexId());
indexLog.setOptTime(new Date());
indexLog.setOptUserId(indexDTO.getOptUserId());
indexLog.setOptUserName(indexDTO.getOptUserName());
indexLog.setReason(reason);
indexLog.setStatus(1);
indexLog.setCreateTime(new Date());
indexLog.setUpdateTime(new Date());
indexLog.setType(LogAndUpdateTipsTypeEnum.INDEX.getCode());
tabIndexLogMapper.insert(indexLog);
}
@Override
public void saveDataExplainInsertLog(DataExplainDTO dataExplainDTO) {
saveLog(dataExplainDTO, "新增");
}
@Override
public void saveDataExplainUpdateLog(DataExplainDTO dataExplainDTO, String reason) {
saveLog(dataExplainDTO, reason);
}
@Override
public List<TabIndexLog> listIndexLog(Integer indexId) {
return tabIndexLogMapper.listBusinessLog(indexId, LogAndUpdateTipsTypeEnum.INDEX.getCode());
}
@Override
public List<TabIndexLog> listDataExplainLog(Integer dataExplainId) {
return tabIndexLogMapper.listBusinessLog(dataExplainId, LogAndUpdateTipsTypeEnum.DATA_EXPLAIN.getCode());
}
private void saveLog(DataExplainDTO dataExplainDTO, String reason) {
TabIndexLog indexLog = new TabIndexLog();
indexLog.setBusinessId(dataExplainDTO.getDataExplainId());
indexLog.setOptTime(new Date());
indexLog.setOptUserId(dataExplainDTO.getOptUserId());
indexLog.setOptUserName(dataExplainDTO.getOptUserName());
indexLog.setReason(reason);
indexLog.setStatus(1);
indexLog.setCreateTime(new Date());
indexLog.setUpdateTime(new Date());
indexLog.setType(LogAndUpdateTipsTypeEnum.INDEX.getCode());
tabIndexLogMapper.insert(indexLog);
}
}
package com.gic.cloud.service.impl;
import com.gic.cloud.dao.mapper.TabIndexModuleRelMapper;
import com.gic.cloud.entity.TabIndexModuleRel;
import com.gic.cloud.service.IndexModuleRelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 10:26
*/
@Service
public class IndexModuleRelServiceImpl implements IndexModuleRelService {
@Autowired
private TabIndexModuleRelMapper tabIndexModuleRelMapper;
@Override
public void save(Integer businessId, List<Integer> moduleIdList, Integer type) {
// 把所有关联status设置为0
tabIndexModuleRelMapper.delByBusinessId(businessId, type);
// 插入不存在的关联
for (Integer moduleId : moduleIdList) {
TabIndexModuleRel rel = new TabIndexModuleRel();
rel.setType(type);
rel.setBusinessId(businessId);
rel.setModuleId(moduleId);
rel.setCreateTime(new Date());
rel.setStatus(1);
tabIndexModuleRelMapper.insertSelectiveByNotExist(rel);
}
// 把所有userId关联status都设置为1
tabIndexModuleRelMapper.updateStatusByBusinessIds(businessId, moduleIdList, type);
}
@Override
public List<Integer> listModuleIdByBusinessId(Integer businessId, Integer type) {
return tabIndexModuleRelMapper.listModuleIdByBusinessId(businessId, type);
}
@Override
public List<Integer> listBusinessIdByModuleId(Integer moduleId) {
return tabIndexModuleRelMapper.listBusinessIdByModuleId(moduleId);
}
@Override
public void deleteByBusinessId(Integer businessId, Integer type) {
tabIndexModuleRelMapper.delByBusinessId(businessId, type);
}
@Override
public Map<Integer, List<Integer>> groupModuleIdByBusinessIds(List<Integer> businessIdList, Integer type) {
List<TabIndexModuleRel> relList = tabIndexModuleRelMapper.listModuleIdByBusinessIds(businessIdList, type);
return Optional.ofNullable(relList).orElse(Collections.emptyList()).stream()
.collect(Collectors.groupingBy(TabIndexModuleRel::getBusinessId,
Collectors.mapping(TabIndexModuleRel::getIndexModuleRelId, Collectors.toList())));
}
}
package com.gic.cloud.service.impl;
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.IndexService;
import com.gic.commons.util.EntityUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 10:20
*/
@Service
public class IndexServiceImpl implements IndexService {
@Autowired
private TabIndexMapper tabIndexMapper;
@Override
public boolean isNameRepeat(String name, Integer indexId) {
TabIndex tabIndex = new TabIndex();
tabIndex.setName(name);
tabIndex.setIndexId(indexId);
return tabIndexMapper.getBySelective(tabIndex) != null;
}
@Override
public boolean isCodeRepeat(String code, Integer indexId) {
TabIndex tabIndex = new TabIndex();
tabIndex.setCode(code);
tabIndex.setIndexId(indexId);
return tabIndexMapper.getBySelective(tabIndex) != null;
}
@Override
public Integer save(IndexDTO indexDTO) {
TabIndex tabIndex = EntityUtil.changeEntityByJSON(TabIndex.class, indexDTO);
tabIndexMapper.insertSelective(tabIndex);
return tabIndex.getIndexId();
}
@Override
public void update(IndexDTO indexDTO) {
TabIndex tabIndex = EntityUtil.changeEntityByJSON(TabIndex.class, indexDTO);
tabIndexMapper.updateByPrimaryKeySelective(tabIndex);
}
@Override
public TabIndex getByIndexId(Integer indexId) {
return tabIndexMapper.selectByPrimaryKey(indexId);
}
@Override
public Page<TabIndex> listIndex(IndexQO indexQO) {
PageHelper.startPage(indexQO.getCurrentPage(), indexQO.getPageSize());
return tabIndexMapper.listIndex(indexQO);
}
@Override
public List<TabIndex> listAllIndex() {
return tabIndexMapper.listIndex(new IndexQO());
}
@Override
public void deleteById(Integer indexId) {
TabIndex index = new TabIndex();
index.setIndexId(indexId);
index.setStatus(0);
tabIndexMapper.updateByPrimaryKeySelective(index);
}
}
package com.gic.cloud.service.impl;
import com.gic.cloud.dao.mapper.TabSysTempStoreConditionMapper;
import com.gic.cloud.dto.TempStoreConditionDTO;
import com.gic.cloud.entity.TabSysTempStoreCondition;
import com.gic.cloud.service.TempStoreConditionService;
import com.gic.commons.util.EntityUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
@Service("tempStoreConditionService")
public class TempStoreConditionServiceImpl implements TempStoreConditionService{
@Autowired
private TabSysTempStoreConditionMapper tabSysTempStoreConditionMapper;
@Override
public Integer saveTempStoreCondition(TempStoreConditionDTO dto) {
TabSysTempStoreCondition record = EntityUtil.changeEntityNew(TabSysTempStoreCondition.class, dto);
Date now = new Date();
record.setCreateTime(now);
record.setUpdateTime(now);
record.setStatus(1);
tabSysTempStoreConditionMapper.insert(record);
return record.getTempStoreConditionId();
}
@Override
public void editTempStoreCondition(TempStoreConditionDTO dto) {
TabSysTempStoreCondition record = EntityUtil.changeEntityNew(TabSysTempStoreCondition.class, dto);
record.setUpdateTime(new Date());
tabSysTempStoreConditionMapper.updateByPrimaryKeySelective(record);
}
@Override
public TabSysTempStoreCondition getTempStoreCondition(Integer enterpriseId) {
return tabSysTempStoreConditionMapper.getTempStoreCondition(enterpriseId);
}
}
package com.gic.cloud.service.impl;
import com.gic.cloud.constants.LogAndUpdateTipsTypeEnum;
import com.gic.cloud.dao.mapper.TabUpdateTipsMapper;
import com.gic.cloud.entity.TabDataExplain;
import com.gic.cloud.entity.TabIndex;
import com.gic.cloud.entity.TabSysUser;
import com.gic.cloud.entity.TabUpdateTips;
import com.gic.cloud.qo.UserQO;
import com.gic.cloud.service.DataExplainService;
import com.gic.cloud.service.IndexService;
import com.gic.cloud.service.UpdateTipService;
import com.gic.cloud.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 14:28
*/
@Service
public class UpdateTipServiceImpl implements UpdateTipService {
@Autowired
private TabUpdateTipsMapper tabUpdateTipsMapper;
@Autowired
private UserService userService;
@Autowired
private IndexService indexService;
@Autowired
private DataExplainService dataExplainService;
@Override
public void insertBySaveUser(Integer userId) {
List<TabIndex> indexList = indexService.listAllIndex();
for (TabIndex index : indexList) {
TabUpdateTips tabUpdateTips = new TabUpdateTips();
tabUpdateTips.setUserId(userId);
tabUpdateTips.setBusinessId(index.getIndexId());
tabUpdateTips.setShowStatus(1);
tabUpdateTips.setType(LogAndUpdateTipsTypeEnum.INDEX.getCode());
tabUpdateTipsMapper.insertSelective(tabUpdateTips);
}
List<TabDataExplain> dataExplainList = dataExplainService.listAllDataExplain();
for (TabDataExplain dataExplain : dataExplainList) {
TabUpdateTips tabUpdateTips = new TabUpdateTips();
tabUpdateTips.setUserId(userId);
tabUpdateTips.setBusinessId(dataExplain.getDataExplainId());
tabUpdateTips.setShowStatus(1);
tabUpdateTips.setType(LogAndUpdateTipsTypeEnum.DATA_EXPLAIN.getCode());
tabUpdateTipsMapper.insertSelective(tabUpdateTips);
}
}
@Override
public void insertBySaveBusiness(Integer businessId, Integer type) {
List<TabSysUser> users = userService.listUser(new UserQO());
for (TabSysUser user : users) {
TabUpdateTips tabUpdateTips = new TabUpdateTips();
tabUpdateTips.setUserId(user.getUserId());
tabUpdateTips.setBusinessId(businessId);
tabUpdateTips.setShowStatus(1);
tabUpdateTips.setType(type);
tabUpdateTipsMapper.insertSelective(tabUpdateTips);
}
}
@Override
public void publish(Integer businessId, Integer type) {
tabUpdateTipsMapper.updateStatus(businessId, type, null, 1);
}
@Override
public void erase(Integer userId) {
tabUpdateTipsMapper.updateStatus(null, null, userId, 0);
}
}
......@@ -68,6 +68,11 @@ public class UserServiceImpl implements UserService{
}
@Override
public List<TabSysUser> listUser(UserQO userQO) {
return tabSysUserMapper.pageUser(userQO);
}
@Override
public void bulkTransferAccountGroup(List<Integer> userIdList, Integer targetAccountGroupId) {
if (CollectionUtils.isEmpty(userIdList)) {
return ;
......@@ -89,4 +94,9 @@ public class UserServiceImpl implements UserService{
public List<UserDTO> countGroupByFunctionAuthId(Integer enterpriseId, List<Integer> functionIdList) {
return tabSysUserMapper.countGroupByFunctionAuthId(enterpriseId, functionIdList);
}
@Override
public List<UserDTO> countGroupByDataAuthId(Integer enterpriseId, List<Integer> dataAuthIdList) {
return tabSysUserMapper.countGroupByDataAuthId(enterpriseId, dataAuthIdList);
}
}
package com.gic.cloud.service.outer.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.DataAuthDTO;
import com.gic.cloud.dto.UserDTO;
import com.gic.cloud.entity.TabSysDataAuth;
import com.gic.cloud.service.DataAuthApiService;
import com.gic.cloud.service.DataAuthService;
import com.gic.cloud.service.UserService;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.error.ErrorCode;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
@Service("dataAuthApiService")
public class DataAuthApiServiceImpl implements DataAuthApiService{
private static Logger LOGGER = LogManager.getLogger(DataAuthApiServiceImpl.class);
@Autowired
private DataAuthService dataAuthService;
@Autowired
private UserService userService;
@Override
public ServiceResponse<Integer> saveDataAuth(DataAuthDTO dto) {
ServiceResponse validParamResult = validParam(dto);
if (!validParamResult.isSuccess()) {
return ServiceResponse.failure(validParamResult.getCode(), validParamResult.getMessage());
}
return ServiceResponse.success(dataAuthService.saveDataAuth(dto));
}
@Override
public ServiceResponse<Void> editDataAuth(DataAuthDTO dto) {
ServiceResponse validParamResult = validParam(dto);
if (!validParamResult.isSuccess()) {
return ServiceResponse.failure(validParamResult.getCode(), validParamResult.getMessage());
}
dataAuthService.editDataAuth(dto);
return ServiceResponse.success();
}
@Override
public ServiceResponse<DataAuthDTO> getDataAuth(Integer dataAuthId) {
return ServiceResponse.success(EntityUtil.changeEntityNew(DataAuthDTO.class, dataAuthService.getDataAuth(dataAuthId)));
}
@Override
public ServiceResponse<Void> deleteDataAuth(Integer dataAuthId) {
dataAuthService.deleteDataAuth(dataAuthId);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Page<DataAuthDTO>> pageDataAuth(Integer enterpriseId, String dataAuthName,
Integer currentPage, Integer pageSize) {
com.github.pagehelper.Page page = dataAuthService.pageDataAuth(enterpriseId, dataAuthName, currentPage, pageSize);
Page<DataAuthDTO> resultPage = PageHelperUtils.changePageHelperToCurrentPage(page, DataAuthDTO.class);
if (resultPage != null) {
List<DataAuthDTO> dataAuthList = resultPage.getResult();
//查询授权人数
if (CollectionUtils.isNotEmpty(dataAuthList)) {
List<UserDTO> userList = userService.countGroupByDataAuthId(enterpriseId,
dataAuthList.stream().map(e -> e.getDataAuthId()).collect(Collectors.toList()));
if (CollectionUtils.isNotEmpty(userList)) {
Map<String, Integer> map = userList.stream()
.collect(Collectors.toMap(e -> e.getDataAuthId().toString(), e -> e.getMemberCount()));
dataAuthList.forEach(e -> e.setMemberCount(map.get(e.getDataAuthId().toString())));
}
}
}
return ServiceResponse.success(resultPage);
}
@Override
public ServiceResponse<List<DataAuthDTO>> listDataAuth(Integer enterpriseId, String dataAuthName) {
return ServiceResponse.success(Optional.ofNullable(EntityUtil.changeEntityListNew(DataAuthDTO.class,
dataAuthService.listDataAuth(enterpriseId, dataAuthName))).orElse(Collections.EMPTY_LIST));
}
private ServiceResponse validParam(DataAuthDTO dto) {
if (dto.getDataAuthId() != null) {
TabSysDataAuth record = dataAuthService.getDataAuth(dto.getDataAuthId());
if (record == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "数据权限集id错误,查无数据");
}
dto.setEnterpriseId(record.getEnterpriseId());
}
Integer enterpriseId = dto.getEnterpriseId();
String dataAuthName = dto.getDataAuthName();
if (StringUtils.isBlank(dataAuthName)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "数据权限集名称不能为空");
}
if (dataAuthService.isRepeatDataAuthName(enterpriseId, dto.getDataAuthId(), dataAuthName)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "数据权限集名称重复");
}
String memberCardAuth = dto.getMemberCardAuth();
if (StringUtils.isNotBlank(memberCardAuth)) {
dto.setMemberCardAuth("_" + memberCardAuth.replaceAll(",", "_") + "_");
}
String goodsAreaAuth = dto.getGoodsAreaAuth();
if (StringUtils.isNotBlank(goodsAreaAuth)) {
dto.setGoodsAreaAuth("_" + goodsAreaAuth.replaceAll(",", "_") + "_");
}
return ServiceResponse.success();
}
}
package com.gic.cloud.service.outer.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.constants.LogAndUpdateTipsTypeEnum;
import com.gic.cloud.constants.UpdateTypeEnum;
import com.gic.cloud.dto.DataExplainDTO;
import com.gic.cloud.entity.TabDataExplain;
import com.gic.cloud.qo.DataExplainQO;
import com.gic.cloud.service.DataExplainApiService;
import com.gic.cloud.service.DataExplainService;
import com.gic.cloud.service.IndexLogService;
import com.gic.cloud.service.UpdateTipService;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 16:05
*/
@Service("dataExplainApiService")
public class DataExplainApiServiceImpl implements DataExplainApiService {
@Autowired
private DataExplainService dataExplainService;
@Autowired
private IndexLogService indexLogService;
@Autowired
private UpdateTipService updateTipService;
@Override
public ServiceResponse<Void> saveDataExplain(DataExplainDTO dataExplainDTO) {
// 校验参数
if (dataExplainService.isNameRepeat(dataExplainDTO.getDataName(), null)) {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "数据模块名称不能重复");
}
// 保存
Integer dataExplainId = dataExplainService.save(dataExplainDTO);
dataExplainDTO.setDataExplainId(dataExplainId);
// 日志
indexLogService.saveDataExplainInsertLog(dataExplainDTO);
// 红点提示
updateTipService.insertBySaveBusiness(dataExplainId, LogAndUpdateTipsTypeEnum.DATA_EXPLAIN.getCode());
return EnterpriseServiceResponse.success();
}
@Override
public ServiceResponse<Void> updateDataExplain(DataExplainDTO dataExplainDTO, Integer updateType, String reason) {
// 校验参数
if (dataExplainService.isNameRepeat(dataExplainDTO.getDataName(), dataExplainDTO.getDataExplainId())) {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "数据模块名称不能重复");
}
// 保存
dataExplainService.update(dataExplainDTO);
// 日志
if (UpdateTypeEnum.UPDATE_PUBLISH.getCode().equals(updateType)) {
indexLogService.saveDataExplainUpdateLog(dataExplainDTO, reason);
updateTipService.publish(dataExplainDTO.getDataExplainId(), LogAndUpdateTipsTypeEnum.DATA_EXPLAIN.getCode());
}
return EnterpriseServiceResponse.success();
}
@Override
public ServiceResponse<DataExplainDTO> getByDataExplainId(Integer dataExplainId) {
TabDataExplain dataExplain = this.dataExplainService.getByDataExplainId(dataExplainId);
DataExplainDTO dataExplainDTO = EntityUtil.changeEntityByJSON(DataExplainDTO.class, dataExplain);
return EnterpriseServiceResponse.success(dataExplainDTO);
}
@Override
public ServiceResponse<Page<DataExplainDTO>> listDataExplain(DataExplainQO dataExplainQO) {
com.github.pagehelper.Page<TabDataExplain> listDataExplain = this.dataExplainService.listDataExplain(dataExplainQO);
Page<DataExplainDTO> dtoPage = PageHelperUtils.changePageHelperToCurrentPage(listDataExplain, DataExplainDTO.class);
return EnterpriseServiceResponse.success(dtoPage);
}
@Override
public ServiceResponse<Void> delete(Integer dataExplainId) {
TabDataExplain dataExplain = this.dataExplainService.getByDataExplainId(dataExplainId);
if (dataExplain == null) {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "数据解读不存在或已删除");
}
if (dataExplain.getModuleId() == null) {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "不能删除被引用的指标");
}
this.dataExplainService.deleteById(dataExplainId);
return EnterpriseServiceResponse.success();
}
@Override
public ServiceResponse<Void> publish(Integer dataExplainId) {
this.updateTipService.publish(dataExplainId, LogAndUpdateTipsTypeEnum.DATA_EXPLAIN.getCode());
return EnterpriseServiceResponse.success();
}
}
package com.gic.cloud.service.outer.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.constants.LogAndUpdateTipsTypeEnum;
import com.gic.cloud.constants.UpdateTypeEnum;
import com.gic.cloud.dto.IndexDTO;
import com.gic.cloud.entity.TabIndex;
import com.gic.cloud.qo.IndexQO;
import com.gic.cloud.service.*;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author zhiwj
* @Description:
* @date 2020-07-08 10:19
*/
@Service("indexApiService")
public class IndexApiServiceImpl implements IndexApiService {
@Autowired
private IndexService indexService;
@Autowired
private IndexLogService indexLogService;
@Autowired
private IndexModuleRelService indexModuleRelService;
@Autowired
private UpdateTipService updateTipService;
@Override
public ServiceResponse<Void> saveIndex(IndexDTO indexDTO) {
// 校验参数
if (indexService.isNameRepeat(indexDTO.getName(), null)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "名称重复");
}
if (indexService.isCodeRepeat(indexDTO.getCode(), null)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "编码重复");
}
// 保存实体
Integer indexId = indexService.save(indexDTO);
indexDTO.setIndexId(indexId);
// 保存关联表
indexModuleRelService.save(indexDTO.getIndexId(), indexDTO.getRelModuleIdList(), 1);
// 写日志
indexLogService.saveIndexInsertLog(indexDTO);
// 红点提示
updateTipService.insertBySaveBusiness(indexId, LogAndUpdateTipsTypeEnum.INDEX.getCode());
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> updateIndex(IndexDTO indexDTO, Integer updateType, String reason) {
// 校验参数
if (indexService.isNameRepeat(indexDTO.getName(), indexDTO.getIndexId())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "名称重复");
}
if (indexService.isCodeRepeat(indexDTO.getCode(), indexDTO.getIndexId())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "编码重复");
}
// 保存实体
indexService.update(indexDTO);
// 保存关联表
indexModuleRelService.save(indexDTO.getIndexId(), indexDTO.getRelModuleIdList(), 1);
if (UpdateTypeEnum.UPDATE_PUBLISH.getCode().equals(updateType)) {
// 写日志
indexLogService.saveIndexUpdateLog(indexDTO, reason);
// 红点提示
updateTipService.publish(indexDTO.getIndexId(), LogAndUpdateTipsTypeEnum.INDEX.getCode());
}
return ServiceResponse.success();
}
@Override
public ServiceResponse<IndexDTO> getByIndexId(Integer indexId) {
TabIndex index = this.indexService.getByIndexId(indexId);
IndexDTO indexDTO = EntityUtil.changeEntityByJSON(IndexDTO.class, index);
List<Integer> moduleIdList = this.indexModuleRelService.listModuleIdByBusinessId(indexDTO.getIndexId(), LogAndUpdateTipsTypeEnum.INDEX.getCode());
indexDTO.setRelModuleIdList(moduleIdList);
return EnterpriseServiceResponse.success(indexDTO);
}
@Override
public ServiceResponse<Page<IndexDTO>> listIndex(IndexQO indexQO) {
com.github.pagehelper.Page<TabIndex> indexList = indexService.listIndex(indexQO);
Page<IndexDTO> indexDTOPage = PageHelperUtils.changePageHelperToCurrentPage(indexList, IndexDTO.class);
if (CollectionUtils.isNotEmpty(indexList)) {
List<Integer> indexIdList = indexList.stream().map(TabIndex::getIndexId).collect(Collectors.toList());
Map<Integer, List<Integer>> moduleIdByBusinessIdMap = indexModuleRelService.groupModuleIdByBusinessIds(indexIdList, LogAndUpdateTipsTypeEnum.INDEX.getCode());
List<IndexDTO> indexDTOList = indexDTOPage.getResult();
for (IndexDTO indexDTO : indexDTOList) {
indexDTO.setRelModuleIdList(moduleIdByBusinessIdMap.get(indexDTO.getIndexId()));
}
}
return EnterpriseServiceResponse.success(indexDTOPage);
}
@Override
public ServiceResponse<Void> delete(Integer indexId) {
TabIndex index = this.indexService.getByIndexId(indexId);
if (index == null) {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "指标不存在或已删除");
}
List<Integer> moduleIdList = indexModuleRelService.listModuleIdByBusinessId(indexId, LogAndUpdateTipsTypeEnum.INDEX.getCode());
if (CollectionUtils.isNotEmpty(moduleIdList)) {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "不能删除被引用的指标");
}
this.indexService.deleteById(indexId);
this.indexModuleRelService.deleteByBusinessId(indexId, LogAndUpdateTipsTypeEnum.INDEX.getCode());
return EnterpriseServiceResponse.success();
}
@Override
public ServiceResponse<Void> publish(Integer indexId) {
this.updateTipService.publish(indexId, LogAndUpdateTipsTypeEnum.INDEX.getCode());
return EnterpriseServiceResponse.success();
}
}
package com.gic.cloud.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.IndexLogDTO;
import com.gic.cloud.entity.TabIndexLog;
import com.gic.cloud.service.IndexLogApiService;
import com.gic.cloud.service.IndexLogService;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author zhiwj
* @Description:
* @date 2020-07-09 15:30
*/
@Service("indexLogApiService")
public class IndexLogApiServiceImpl implements IndexLogApiService {
@Autowired
private IndexLogService indexLogService;
@Override
public ServiceResponse<List<IndexLogDTO>> listIndexLog(Integer indexId) {
List<TabIndexLog> logList = indexLogService.listIndexLog(indexId);
return EnterpriseServiceResponse.success(EntityUtil.changeEntityListByJSON(IndexLogDTO.class, logList));
}
@Override
public ServiceResponse<List<IndexLogDTO>> listDataExplainLog(Integer dataExplainId) {
List<TabIndexLog> logList = indexLogService.listDataExplainLog(dataExplainId);
return EnterpriseServiceResponse.success(EntityUtil.changeEntityListByJSON(IndexLogDTO.class, logList));
}
}
package com.gic.cloud.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.TempStoreConditionDTO;
import com.gic.cloud.entity.TabSysTempStoreCondition;
import com.gic.cloud.service.TempStoreConditionApiService;
import com.gic.cloud.service.TempStoreConditionService;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.error.ErrorCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("tempStoreConditionApiService")
public class TempStoreConditionApiServiceImpl implements TempStoreConditionApiService{
@Autowired
private TempStoreConditionService tempStoreConditionService;
@Override
public ServiceResponse<Integer> saveOrUpdateTempStoreCondition(TempStoreConditionDTO dto) {
if (dto.getStoreWidgetId() == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "门店设置不能为空");
}
TabSysTempStoreCondition record = tempStoreConditionService.getTempStoreCondition(dto.getEnterpriseId());
Integer id;
if (record == null) {
if (dto.getEnterpriseId() == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "商户ID不能为空");
}
id = tempStoreConditionService.saveTempStoreCondition(dto);
} else {
dto.setEnterpriseId(record.getEnterpriseId());
dto.setTempStoreConditionId(record.getTempStoreConditionId());
tempStoreConditionService.editTempStoreCondition(dto);
id = record.getTempStoreConditionId();
}
return ServiceResponse.success(id);
}
@Override
public ServiceResponse<TempStoreConditionDTO> getTempStoreCondition(Integer enterpriseId) {
return ServiceResponse.success(EntityUtil.changeEntityNew(TempStoreConditionDTO.class,
tempStoreConditionService.getTempStoreCondition(enterpriseId)));
}
}
......@@ -20,6 +20,7 @@ import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -70,6 +71,12 @@ public class UserApiServiceImpl implements UserApiService{
}
@Override
public ServiceResponse<List<UserDTO>> listUser(UserQO userQO) {
return ServiceResponse.success(Optional.ofNullable(EntityUtil.changeEntityListNew(UserDTO.class,
userService.listUser(userQO))).orElse(Collections.EMPTY_LIST));
}
@Override
public ServiceResponse<Void> bulkTransferAccountGroup(List<Integer> userIdList, Integer targetAccountGroupId) {
TabSysAccountGroup accountGroup = accountGroupService.getAccountGroupById(targetAccountGroupId);
if (accountGroup == null) {
......
......@@ -19,4 +19,9 @@
<dubbo:service interface="com.gic.cloud.service.UserApiService" ref="userApiService" timeout="6000" />
<dubbo:service interface="com.gic.cloud.service.FunctionApiService" ref="functionApiService" timeout="6000" />
<dubbo:service interface="com.gic.cloud.service.FunctionModuleApiService" ref="functionModuleApiService" timeout="6000" />
<dubbo:service interface="com.gic.cloud.service.DataAuthApiService" ref="dataAuthApiService" timeout="6000" />
<dubbo:service interface="com.gic.cloud.service.DataExplainApiService" ref="dataExplainApiService" timeout="6000" />
<dubbo:service interface="com.gic.cloud.service.IndexApiService" ref="indexApiService" timeout="6000" />
<dubbo:service interface="com.gic.cloud.service.IndexLogApiService" ref="indexLogApiService" timeout="6000" />
<dubbo:service interface="com.gic.cloud.service.TempStoreConditionApiService" ref="tempStoreConditionApiService" timeout="6000" />
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.cloud.dao.mapper.TabDataExplainMapper">
<resultMap id="BaseResultMap" type="com.gic.cloud.entity.TabDataExplain">
<id column="data_explain_id" jdbcType="INTEGER" property="dataExplainId" />
<result column="data_name" jdbcType="VARCHAR" property="dataName" />
<result column="data_classify" jdbcType="VARCHAR" property="dataClassify" />
<result column="index_remark" jdbcType="VARCHAR" property="indexRemark" />
<result column="complement" jdbcType="VARCHAR" property="complement" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="module_id" jdbcType="INTEGER" property="moduleId" />
</resultMap>
<sql id="Base_Column_List">
data_explain_id, data_name, data_classify, index_remark, complement, create_time,
update_time, status, module_id
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_data_explain
where data_explain_id = #{dataExplainId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_data_explain
where data_explain_id = #{dataExplainId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.cloud.entity.TabDataExplain">
insert into tab_data_explain (data_explain_id, data_name, data_classify,
index_remark, complement, create_time,
update_time, status, module_id
)
values (#{dataExplainId,jdbcType=INTEGER}, #{dataName,jdbcType=VARCHAR}, #{dataClassify,jdbcType=VARCHAR},
#{indexRemark,jdbcType=VARCHAR}, #{complement,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, #{moduleId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.cloud.entity.TabDataExplain">
<selectKey keyProperty="dataExplainId" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into tab_data_explain
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dataExplainId != null">
data_explain_id,
</if>
<if test="dataName != null">
data_name,
</if>
<if test="dataClassify != null">
data_classify,
</if>
<if test="indexRemark != null">
index_remark,
</if>
<if test="complement != null">
complement,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="status != null">
status,
</if>
<if test="moduleId != null">
module_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dataExplainId != null">
#{dataExplainId,jdbcType=INTEGER},
</if>
<if test="dataName != null">
#{dataName,jdbcType=VARCHAR},
</if>
<if test="dataClassify != null">
#{dataClassify,jdbcType=VARCHAR},
</if>
<if test="indexRemark != null">
#{indexRemark,jdbcType=VARCHAR},
</if>
<if test="complement != null">
#{complement,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="moduleId != null">
#{moduleId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.cloud.entity.TabDataExplain">
update tab_data_explain
<set>
<if test="dataName != null">
data_name = #{dataName,jdbcType=VARCHAR},
</if>
<if test="dataClassify != null">
data_classify = #{dataClassify,jdbcType=VARCHAR},
</if>
<if test="indexRemark != null">
index_remark = #{indexRemark,jdbcType=VARCHAR},
</if>
<if test="complement != null">
complement = #{complement,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="moduleId != null">
module_id = #{moduleId,jdbcType=INTEGER},
</if>
</set>
where data_explain_id = #{dataExplainId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.cloud.entity.TabDataExplain">
update tab_data_explain
set data_name = #{dataName,jdbcType=VARCHAR},
data_classify = #{dataClassify,jdbcType=VARCHAR},
index_remark = #{indexRemark,jdbcType=VARCHAR},
complement = #{complement,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER},
module_id = #{moduleId,jdbcType=INTEGER}
where data_explain_id = #{dataExplainId,jdbcType=INTEGER}
</update>
<!-- getBySelective-->
<select id="getBySelective" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_data_explain where status = 1
<if test="data_name != null ">
and data_name = #{data_name}
</if>
<if test="null != ids and ids.size > 0">
and data_explain_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="listDataExplain" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_data_explain
where status = 1
<if test="search != null and search != '' ">
and ( data_name like concat('%', #{search}, '%') or data_classify like concat('%', #{search}, '%') )
</if>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.cloud.dao.mapper.TabIndexLogMapper">
<resultMap id="BaseResultMap" type="com.gic.cloud.entity.TabIndexLog">
<id column="cloud_index_log_id" jdbcType="INTEGER" property="cloudIndexLogId" />
<result column="business_id" jdbcType="INTEGER" property="businessId" />
<result column="opt_time" jdbcType="TIMESTAMP" property="optTime" />
<result column="opt_user_id" jdbcType="INTEGER" property="optUserId" />
<result column="opt_user_name" jdbcType="VARCHAR" property="optUserName" />
<result column="reason" jdbcType="VARCHAR" property="reason" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="type" jdbcType="INTEGER" property="type" />
</resultMap>
<sql id="Base_Column_List">
cloud_index_log_id, business_id, opt_time, opt_user_id, opt_user_name, reason, status,
create_time, update_time, type
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_index_log
where cloud_index_log_id = #{cloudIndexLogId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_index_log
where cloud_index_log_id = #{cloudIndexLogId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.cloud.entity.TabIndexLog">
insert into tab_index_log (cloud_index_log_id, business_id, opt_time,
opt_user_id, opt_user_name, reason,
status, create_time, update_time,
type)
values (#{cloudIndexLogId,jdbcType=INTEGER}, #{businessId,jdbcType=INTEGER}, #{optTime,jdbcType=TIMESTAMP},
#{optUserId,jdbcType=INTEGER}, #{optUserName,jdbcType=VARCHAR}, #{reason,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{type,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.cloud.entity.TabIndexLog">
insert into tab_index_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cloudIndexLogId != null">
cloud_index_log_id,
</if>
<if test="businessId != null">
business_id,
</if>
<if test="optTime != null">
opt_time,
</if>
<if test="optUserId != null">
opt_user_id,
</if>
<if test="optUserName != null">
opt_user_name,
</if>
<if test="reason != null">
reason,
</if>
<if test="status != null">
status,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="type != null">
type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cloudIndexLogId != null">
#{cloudIndexLogId,jdbcType=INTEGER},
</if>
<if test="businessId != null">
#{businessId,jdbcType=INTEGER},
</if>
<if test="optTime != null">
#{optTime,jdbcType=TIMESTAMP},
</if>
<if test="optUserId != null">
#{optUserId,jdbcType=INTEGER},
</if>
<if test="optUserName != null">
#{optUserName,jdbcType=VARCHAR},
</if>
<if test="reason != null">
#{reason,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.cloud.entity.TabIndexLog">
update tab_index_log
<set>
<if test="businessId != null">
business_id = #{businessId,jdbcType=INTEGER},
</if>
<if test="optTime != null">
opt_time = #{optTime,jdbcType=TIMESTAMP},
</if>
<if test="optUserId != null">
opt_user_id = #{optUserId,jdbcType=INTEGER},
</if>
<if test="optUserName != null">
opt_user_name = #{optUserName,jdbcType=VARCHAR},
</if>
<if test="reason != null">
reason = #{reason,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
</set>
where cloud_index_log_id = #{cloudIndexLogId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.cloud.entity.TabIndexLog">
update tab_index_log
set business_id = #{businessId,jdbcType=INTEGER},
opt_time = #{optTime,jdbcType=TIMESTAMP},
opt_user_id = #{optUserId,jdbcType=INTEGER},
opt_user_name = #{optUserName,jdbcType=VARCHAR},
reason = #{reason,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
type = #{type,jdbcType=INTEGER}
where cloud_index_log_id = #{cloudIndexLogId,jdbcType=INTEGER}
</update>
<select id="listBusinessLog" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_index_log
where status = 1
<if test="businessId != null ">
and business_id = #{businessId}
</if>
<if test="type != null ">
and type = #{type}
</if>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.cloud.dao.mapper.TabIndexModuleRelMapper">
<resultMap id="BaseResultMap" type="com.gic.cloud.entity.TabIndexModuleRel">
<id column="index_module_rel_id" jdbcType="INTEGER" property="indexModuleRelId" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="business_id" jdbcType="INTEGER" property="businessId" />
<result column="module_id" jdbcType="INTEGER" property="moduleId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<sql id="Base_Column_List">
index_module_rel_id, type, business_id, module_id, create_time, update_time, status
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_index_module_rel
where index_module_rel_id = #{indexModuleRelId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_index_module_rel
where index_module_rel_id = #{indexModuleRelId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.cloud.entity.TabIndexModuleRel">
insert into tab_index_module_rel (index_module_rel_id, type, business_id,
module_id, create_time, update_time,
status)
values (#{indexModuleRelId,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{businessId,jdbcType=INTEGER},
#{moduleId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{status,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.cloud.entity.TabIndexModuleRel">
insert into tab_index_module_rel
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="indexModuleRelId != null">
index_module_rel_id,
</if>
<if test="type != null">
type,
</if>
<if test="businessId != null">
business_id,
</if>
<if test="moduleId != null">
module_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="status != null">
status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="indexModuleRelId != null">
#{indexModuleRelId,jdbcType=INTEGER},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="businessId != null">
#{businessId,jdbcType=INTEGER},
</if>
<if test="moduleId != null">
#{moduleId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.cloud.entity.TabIndexModuleRel">
update tab_index_module_rel
<set>
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
<if test="businessId != null">
business_id = #{businessId,jdbcType=INTEGER},
</if>
<if test="moduleId != null">
module_id = #{moduleId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
</set>
where index_module_rel_id = #{indexModuleRelId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.cloud.entity.TabIndexModuleRel">
update tab_index_module_rel
set type = #{type,jdbcType=INTEGER},
business_id = #{businessId,jdbcType=INTEGER},
module_id = #{moduleId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
where index_module_rel_id = #{indexModuleRelId,jdbcType=INTEGER}
</update>
<update id="delByBusinessId">
update tab_index_module_rel set status = 0 where business_id = #{businessId} and type = #{type} and status = 1
</update>
<insert id="insertSelectiveByNotExist">
INSERT INTO tab_index_module_rel (
`type`,
business_id,
module_id,
create_time,
update_time,
status
) SELECT
#{type},
#{busisessId},
#{moduleId},
#{createTime},
#{updateTime},
#{status}
FROM
DUAL
WHERE
NOT EXISTS (
SELECT
1
FROM
tab_index_module_rel tb
WHERE
tb.type = #{type}
AND tb.business_id = #{businessId}
AND tb.module_id = #{moduleId}
)
</insert>
<!-- void updateStatusByBusinessIds(@Param("businessId") Integer businessId, @Param("ids") List<Integer> moduleIdList, @Param("type") Integer type);-->
<update id="updateStatusByBusinessIds">
update tab_index_module_rel set status = 1 where business_id = #{businessId} and `type` = #{type}
<if test="null != ids and ids.size > 0">
and business_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</update>
<select id="listModuleIdByBusinessId" resultType="int">
select
module_id
from tab_index_module_rel
where status = 1 and index_id = #{businessId} and type = #{type}
</select>
<select id="listBusinessIdByModuleId" resultType="int">
select
module_id
from tab_index_module_rel
where status = 1 and module_id = #{moduleId}
</select>
<select id="listModuleIdByBusinessIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_index_module_rel where status = 1 and type = #{type}
<if test="null != ids and ids.size > 0">
and business_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.cloud.dao.mapper.TabSysDataAuthMapper">
<resultMap id="BaseResultMap" type="com.gic.cloud.entity.TabSysDataAuth">
<id column="data_auth_id" jdbcType="INTEGER" property="dataAuthId" />
<result column="data_auth_name" jdbcType="VARCHAR" property="dataAuthName" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="online_performance" jdbcType="VARCHAR" property="onlinePerformance" />
<result column="store_widget_id" jdbcType="INTEGER" property="storeWidgetId" />
<result column="member_card_auth" jdbcType="VARCHAR" property="memberCardAuth" />
<result column="goods_area_auth" jdbcType="VARCHAR" property="goodsAreaAuth" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
data_auth_id, data_auth_name, enterprise_id, online_performance, store_widget_id,
member_card_auth, goods_area_auth, status, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_data_auth
where data_auth_id = #{dataAuthId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_data_auth
where data_auth_id = #{dataAuthId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.cloud.entity.TabSysDataAuth" useGeneratedKeys="true" keyProperty="dataAuthId">
insert into tab_sys_data_auth (data_auth_id, data_auth_name, enterprise_id,
online_performance, store_widget_id, member_card_auth,
goods_area_auth, status, create_time,
update_time)
values (#{dataAuthId,jdbcType=INTEGER}, #{dataAuthName,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=INTEGER},
#{onlinePerformance,jdbcType=VARCHAR}, #{storeWidgetId,jdbcType=INTEGER}, #{memberCardAuth,jdbcType=VARCHAR},
#{goodsAreaAuth,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.cloud.entity.TabSysDataAuth">
insert into tab_sys_data_auth
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dataAuthId != null">
data_auth_id,
</if>
<if test="dataAuthName != null">
data_auth_name,
</if>
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="onlinePerformance != null">
online_performance,
</if>
<if test="storeWidgetId != null">
store_widget_id,
</if>
<if test="memberCardAuth != null">
member_card_auth,
</if>
<if test="goodsAreaAuth != null">
goods_area_auth,
</if>
<if test="status != null">
status,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dataAuthId != null">
#{dataAuthId,jdbcType=INTEGER},
</if>
<if test="dataAuthName != null">
#{dataAuthName,jdbcType=VARCHAR},
</if>
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="onlinePerformance != null">
#{onlinePerformance,jdbcType=VARCHAR},
</if>
<if test="storeWidgetId != null">
#{storeWidgetId,jdbcType=INTEGER},
</if>
<if test="memberCardAuth != null">
#{memberCardAuth,jdbcType=VARCHAR},
</if>
<if test="goodsAreaAuth != null">
#{goodsAreaAuth,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.cloud.entity.TabSysDataAuth">
update tab_sys_data_auth
<set>
<if test="dataAuthName != null">
data_auth_name = #{dataAuthName,jdbcType=VARCHAR},
</if>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="onlinePerformance != null">
online_performance = #{onlinePerformance,jdbcType=VARCHAR},
</if>
<if test="storeWidgetId != null">
store_widget_id = #{storeWidgetId,jdbcType=INTEGER},
</if>
<if test="memberCardAuth != null">
member_card_auth = #{memberCardAuth,jdbcType=VARCHAR},
</if>
<if test="goodsAreaAuth != null">
goods_area_auth = #{goodsAreaAuth,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where data_auth_id = #{dataAuthId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.cloud.entity.TabSysDataAuth">
update tab_sys_data_auth
set data_auth_name = #{dataAuthName,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
online_performance = #{onlinePerformance,jdbcType=VARCHAR},
store_widget_id = #{storeWidgetId,jdbcType=INTEGER},
member_card_auth = #{memberCardAuth,jdbcType=VARCHAR},
goods_area_auth = #{goodsAreaAuth,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where data_auth_id = #{dataAuthId,jdbcType=INTEGER}
</update>
<select id="countByDataAuthName" resultType="int">
select count(1) from tab_sys_data_auth
where enterprise_id = #{enterpriseId}
and data_auth_name = #{dataAuthName}
<if test="dataAuthId != null">
and data_auth_id &lt;&gt; #{dataAuthId}
</if>
and status = 1
</select>
<update id="deleteDataAuth">
update tab_sys_data_auth set status = 0
where data_auth_id = #{dataAuthId}
and status = 1
</update>
<select id="listDataAuth" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_data_auth
where enterprise_id = #{enterpriseId}
<if test="dataAuthName != null and dataAuthName != ''">
and data_auth_name like concat('%', #{dataAuthName}, '%')
</if>
and status = 1
order by create_time desc
</select>
</mapper>
\ No newline at end of file
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