Commit 9c04ceaa by zhiwj

数据字典

parent c72d8505
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 indexId;
/**
* 操作时间
*/
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 getIndexId() {
return indexId;
}
public void setIndexId(Integer indexId) {
this.indexId = indexId;
}
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.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.dao.mapper;
import com.gic.cloud.entity.TabIndexLog;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TabIndexLogMapper {
/**
......@@ -50,4 +53,6 @@ public interface TabIndexLogMapper {
* @return 更新条目数
*/
int updateByPrimaryKey(TabIndexLog record);
List<TabIndexLog> listIndexLog(@Param("indexId") Integer indexId, @Param("type") Integer type);
}
\ No newline at end of file
......@@ -2,6 +2,9 @@ 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
......@@ -16,4 +19,8 @@ public interface IndexLogService {
void saveDataExplainInsertLog(DataExplainDTO dataExplainDTO);
void saveDataExplainUpdateLog(DataExplainDTO dataExplainDTO, String reason);
List<TabIndexLog> listIndexLog(Integer indexId);
List<TabIndexLog> listDataExplainLog(Integer dataExplainId);
}
......@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* @author zhiwj
......@@ -56,6 +57,16 @@ public class IndexLogServiceImpl implements IndexLogService {
saveLog(dataExplainDTO, reason);
}
@Override
public List<TabIndexLog> listIndexLog(Integer indexId) {
return tabIndexLogMapper.listIndexLog(indexId, LogAndUpdateTipsTypeEnum.INDEX.getCode());
}
@Override
public List<TabIndexLog> listDataExplainLog(Integer dataExplainId) {
return tabIndexLogMapper.listIndexLog(dataExplainId, LogAndUpdateTipsTypeEnum.DATA_EXPLAIN.getCode());
}
private void saveLog(DataExplainDTO dataExplainDTO, String reason) {
TabIndexLog indexLog = new TabIndexLog();
indexLog.setIndexId(dataExplainDTO.getDataExplainId());
......
......@@ -22,7 +22,7 @@ import java.util.List;
* @Description:
* @date 2020-07-08 10:19
*/
@Service("indexService")
@Service("indexApiService")
public class IndexApiServiceImpl implements IndexApiService {
@Autowired
......
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));
}
}
......@@ -20,5 +20,7 @@
<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="functionApiService" timeout="6000" />
<dubbo:service interface="com.gic.cloud.service.IndexApiService" ref="indexApiService" timeout="6000" />
<dubbo:service interface="com.gic.cloud.service.TempStoreConditionApiService" ref="tempStoreConditionApiService" timeout="6000" />
</beans>
......@@ -150,4 +150,16 @@
type = #{type,jdbcType=INTEGER}
where cloud_index_log_id = #{cloudIndexLogId,jdbcType=INTEGER}
</update>
<select id="listIndexLog" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_index_log
where status = 1
<if test="indexId != null ">
and index_id = #{indexId}
</if>
<if test="type != null ">
and type = #{type}
</if>
</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