Commit 8c8f73ea by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-data-cloud into developer

 Conflicts:
	gic-data-cloud-wxapp/src/main/resources/dubbo-gic-data-cloud-wxapp.xml
parents ce9bf946 2503496b
......@@ -57,7 +57,12 @@ public class IndexDescDTO implements Serializable {
private Integer updateTips;
private Integer indexRemark;
// private Integer indexRemark;
// private Integer showStatus;
private Integer indexDescEnterpriseId;
private int seq;
public Integer getIndexDescId() {
return indexDescId;
......@@ -147,11 +152,19 @@ public class IndexDescDTO implements Serializable {
this.updateTips = updateTips;
}
public Integer getIndexRemark() {
return indexRemark;
public Integer getIndexDescEnterpriseId() {
return indexDescEnterpriseId;
}
public void setIndexDescEnterpriseId(Integer indexDescEnterpriseId) {
this.indexDescEnterpriseId = indexDescEnterpriseId;
}
public void setSeq(int seq) {
this.seq = seq;
}
public void setIndexRemark(Integer indexRemark) {
this.indexRemark = indexRemark;
public int getSeq() {
return seq;
}
}
......@@ -4,7 +4,6 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.IndexDescDTO;
import java.util.List;
import java.util.Map;
/**
* @author zhiwj
......@@ -23,7 +22,7 @@ public interface IndexDescApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Map<String, List<IndexDescDTO>>> listByEnterpriseAndModule(Integer enterpriseId, String moduleId);
ServiceResponse<List<IndexDescDTO>> listByEnterpriseAndModule(Integer enterpriseId, String moduleId, String indexGroupName);
/**
* @Title: listByEnterpriseAndModuleDetail
......@@ -34,7 +33,7 @@ public interface IndexDescApiService {
* @return com.gic.api.base.commons.ServiceResponse<com.gic.cloud.dto.IndexEnterpriseGroupDTO>
* @throws
*/
ServiceResponse<Map<String, List<IndexDescDTO>>> listByEnterpriseAndModuleDetail(Integer enterpriseId, String moduleId, Integer userId);
ServiceResponse<List<IndexDescDTO>> listByEnterpriseAndModuleDetail(Integer enterpriseId, String moduleId, String indexGroupName, Integer userId);
/**
* 回收站中的指标
......@@ -46,7 +45,7 @@ public interface IndexDescApiService {
* @return com.gic.api.base.commons.ServiceResponse<com.gic.cloud.dto.IndexEnterpriseGroupDTO>
* @throws
*/
ServiceResponse<List<IndexDescDTO>> listRecycle(Integer enterpriseId, String moduleId);
ServiceResponse<List<IndexDescDTO>> listRecycle(Integer enterpriseId, String moduleId, String indexGroupName);
/**
* 排序
......@@ -55,23 +54,30 @@ public interface IndexDescApiService {
* @author zhiwj
* @param enterpriseId 商户id
* @param moduleId
* @param indexId 指标id
* @param indexDescEnterpriseId 指标id
* @param seq 排到第几个
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> sortIndex(Integer enterpriseId, String moduleId, Integer indexId, Integer seq);
ServiceResponse<Void> sort(Integer enterpriseId, String moduleId, String indexGroupName, Integer indexDescEnterpriseId, Integer seq);
/**
* 移动到回收站
* @Title: moveToRecycle
* @Description:
* @author zhiwj
* @param enterpriseId
* @param moduleId
* @param indexId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> moveToRecycle(Integer enterpriseId, String moduleId, Integer indexId);
ServiceResponse<Void> moveToRecycle(Integer indexDescEnterpriseId);
/**
* @Title: getIndexDesc
* @Description:
* @author zhiwj
* @return com.gic.api.base.commons.ServiceResponse<com.gic.cloud.dto.IndexDescDTO>
* @throws
*/
ServiceResponse<String> getIndexDesc(Integer enterpriseId, String moduleId, String indexGroupName, String indexCode);
}
package com.gic.cloud.dao.mapper;
import com.gic.cloud.entity.TabIndexDescEnterprise;
import org.apache.ibatis.annotations.Param;
public interface TabIndexDescEnterpriseMapper {
/**
......@@ -50,4 +51,6 @@ public interface TabIndexDescEnterpriseMapper {
* @return 更新条目数
*/
int updateByPrimaryKey(TabIndexDescEnterprise record);
void updateSort(@Param("enterpriseId") Integer enterpriseId, @Param("sort") Integer sort);
}
\ No newline at end of file
......@@ -55,7 +55,9 @@ public interface TabIndexDescMapper {
*/
int updateByPrimaryKey(TabIndexDesc record);
List<IndexDescDTO> listByEnterpriseAndModule(@Param("enterpriseId") Integer enterpriseId, @Param("moduleId") String moduleId);
List<IndexDescDTO> listByEnterpriseAndModule(@Param("enterpriseId") Integer enterpriseId, @Param("moduleId") String moduleId, @Param("indexGroupName") String indexGroupName);
List<IndexDescDTO> listByEnterpriseAndModuleDetail(@Param("enterpriseId") Integer enterpriseId, @Param("moduleId") String moduleId, @Param("userId") Integer userId);
List<IndexDescDTO> listByEnterpriseAndModuleDetail(@Param("enterpriseId") Integer enterpriseId, @Param("moduleId") String moduleId, @Param("indexGroupName") String indexGroupName, @Param("userId") Integer userId);
List<IndexDescDTO> listRecycle(@Param("enterpriseId") Integer enterpriseId, @Param("moduleId") String moduleId, @Param("indexGroupName") String indexGroupName);
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ public class TabIndexDescEnterprise {
/**
*
*/
private String indexCode;
private Integer indexDescId;
/**
* 商户id
......@@ -54,12 +54,12 @@ public class TabIndexDescEnterprise {
this.indexDescEnterpriseId = indexDescEnterpriseId;
}
public String getIndexCode() {
return indexCode;
public Integer getIndexDescId() {
return indexDescId;
}
public void setIndexCode(String indexCode) {
this.indexCode = indexCode;
public void setIndexDescId(Integer indexDescId) {
this.indexDescId = indexDescId;
}
public Integer getEnterpriseId() {
......
......@@ -6,4 +6,7 @@ package com.gic.cloud.service;
* @date 2020-07-23 16:46
*/
public interface IndexDescEnterpriseService {
void updateSort(Integer enterpriseId, Integer indexDescEnterpriseId, Integer sort);
void moveToRecycle(Integer indexDescEnterpriseId);
}
......@@ -2,6 +2,7 @@ package com.gic.cloud.service;
import com.gic.cloud.dto.IndexDescDTO;
import com.gic.cloud.entity.TabIndexDesc;
import java.util.List;
......@@ -12,7 +13,13 @@ import java.util.List;
*/
public interface IndexDescService {
List<IndexDescDTO> listByEnterpriseAndModule(Integer enterpriseId, String moduleId);
List<IndexDescDTO> listByEnterpriseAndModule(Integer enterpriseId, String moduleId, String indexGroupName);
List<IndexDescDTO> listByEnterpriseAndModuleDetail(Integer enterpriseId, String moduleId, Integer userId);
List<IndexDescDTO> listByEnterpriseAndModuleDetail(Integer enterpriseId, String moduleId, String indexGroupName, Integer userId);
List<IndexDescDTO> listRecycle(Integer enterpriseId, String moduleId, String indexGroupName);
void sort(Integer enterpriseId, String moduleId, String indexGroupName, Integer indexDescEnterpriseId, Integer seq);
TabIndexDesc getIndexDesc(Integer enterpriseId, Integer indexDescId);
}
......@@ -29,4 +29,6 @@ public interface IndexService {
List<TabIndex> listAllIndex(IndexQO indexQO);
void deleteById(Integer indexId);
TabIndex getByIndexCode(String moduleId, String indexCode);
}
package com.gic.cloud.service.impl;
import com.gic.cloud.dao.mapper.TabIndexDescEnterpriseMapper;
import com.gic.cloud.entity.TabIndexDescEnterprise;
import com.gic.cloud.service.IndexDescEnterpriseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
......@@ -10,4 +13,28 @@ import org.springframework.stereotype.Service;
*/
@Service
public class IndexDescEnterpriseServiceImpl implements IndexDescEnterpriseService {
@Autowired
private TabIndexDescEnterpriseMapper tabIndexDescEnterpriseMapper;
@Override
public void updateSort(Integer enterpriseId, Integer indexDescEnterpriseId, Integer sort) {
tabIndexDescEnterpriseMapper.updateSort(enterpriseId, sort);
TabIndexDescEnterprise indexDescEnterprise = new TabIndexDescEnterprise();
indexDescEnterprise.setEnterpriseId(enterpriseId);
indexDescEnterprise.setIndexDescEnterpriseId(indexDescEnterpriseId);
indexDescEnterprise.setSort(sort);
tabIndexDescEnterpriseMapper.updateByPrimaryKeySelective(indexDescEnterprise);
}
@Override
public void moveToRecycle(Integer indexDescEnterpriseId) {
TabIndexDescEnterprise indexDescEnterprise = new TabIndexDescEnterprise();
indexDescEnterprise.setIndexDescEnterpriseId(indexDescEnterpriseId);
indexDescEnterprise.setIndexStatus(0);
tabIndexDescEnterpriseMapper.updateByPrimaryKeySelective(indexDescEnterprise);
}
}
......@@ -2,7 +2,10 @@ package com.gic.cloud.service.impl;
import com.gic.cloud.dao.mapper.TabIndexDescMapper;
import com.gic.cloud.dto.IndexDescDTO;
import com.gic.cloud.entity.TabIndexDesc;
import com.gic.cloud.service.IndexDescEnterpriseService;
import com.gic.cloud.service.IndexDescService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -18,14 +21,34 @@ public class IndexDescServiceImpl implements IndexDescService {
@Autowired
private TabIndexDescMapper tabIndexDescMapper;
@Autowired
private IndexDescEnterpriseService indexDescEnterpriseService;
@Override
public List<IndexDescDTO> listByEnterpriseAndModule(Integer enterpriseId, String moduleId, String indexGroupName) {
return tabIndexDescMapper.listByEnterpriseAndModule(enterpriseId, moduleId, indexGroupName);
}
@Override
public List<IndexDescDTO> listByEnterpriseAndModuleDetail(Integer enterpriseId, String moduleId, String indexGroupName, Integer userId) {
return tabIndexDescMapper.listByEnterpriseAndModuleDetail(enterpriseId, moduleId, indexGroupName, userId);
}
@Override
public List<IndexDescDTO> listRecycle(Integer enterpriseId, String moduleId, String indexGroupName) {
return tabIndexDescMapper.listRecycle(enterpriseId, moduleId, indexGroupName);
}
@Override
public List<IndexDescDTO> listByEnterpriseAndModule(Integer enterpriseId, String moduleId) {
return tabIndexDescMapper.listByEnterpriseAndModule(enterpriseId, moduleId);
public void sort(Integer enterpriseId, String moduleId, String indexGroupName, Integer indexDescEnterpriseId, Integer seq) {
PageHelper.offsetPage(seq - 1, 1);
List<IndexDescDTO> dtoList = tabIndexDescMapper.listByEnterpriseAndModuleDetail(enterpriseId, moduleId, indexGroupName, null);
IndexDescDTO indexDescDTO = dtoList.get(0);
indexDescEnterpriseService.updateSort(enterpriseId, indexDescEnterpriseId, indexDescDTO.getSort());
}
@Override
public List<IndexDescDTO> listByEnterpriseAndModuleDetail(Integer enterpriseId, String moduleId, Integer userId) {
return tabIndexDescMapper.listByEnterpriseAndModuleDetail(enterpriseId, moduleId, userId);
public TabIndexDesc getIndexDesc(Integer enterpriseId, Integer indexDescId) {
return tabIndexDescMapper.selectByPrimaryKey(indexDescId);
}
}
......@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
......@@ -96,4 +97,13 @@ public class IndexServiceImpl implements IndexService {
index.setStatus(0);
tabIndexMapper.updateByPrimaryKeySelective(index);
}
@Override
public TabIndex getByIndexCode(String moduleId, String indexCode) {
IndexQO indexQO = new IndexQO();
PageHelper.startPage(1, 1);
List<Integer> indexIdList = indexModuleRelService.listBusinessIdByModuleIds(Collections.singletonList(moduleId));
indexQO.setIndexIdList(indexIdList);
return tabIndexMapper.listIndex(indexQO).get(0);
}
}
package com.gic.cloud.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.IndexDescDTO;
import com.gic.cloud.entity.TabIndex;
import com.gic.cloud.service.IndexDescApiService;
import com.gic.cloud.service.IndexDescEnterpriseService;
import com.gic.cloud.service.IndexDescService;
import com.gic.cloud.service.IndexService;
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-23 15:10
*/
@Service("indexDescApiService")
public class IndexDescApiServiceImpl implements IndexDescApiService {
@Autowired
private IndexDescService indexDescService;
@Autowired
private IndexDescEnterpriseService indexDescEnterpriseService;
@Autowired
private IndexService indexService;
@Override
public ServiceResponse<List<IndexDescDTO>> listByEnterpriseAndModule(Integer enterpriseId, String moduleId, String indexGroupName) {
List<IndexDescDTO> descList = indexDescService.listByEnterpriseAndModule(enterpriseId, moduleId, indexGroupName);
return EnterpriseServiceResponse.success(descList);
}
@Override
public ServiceResponse<List<IndexDescDTO>> listByEnterpriseAndModuleDetail(Integer enterpriseId, String moduleId, String indexGroupName, Integer userId) {
List<IndexDescDTO> descList = indexDescService.listByEnterpriseAndModuleDetail(enterpriseId, moduleId, indexGroupName, userId);
for (int i = 0; i < descList.size(); i++) {
descList.get(i).setSeq(i + 1);
}
return EnterpriseServiceResponse.success(descList);
}
@Override
public ServiceResponse<List<IndexDescDTO>> listRecycle(Integer enterpriseId, String moduleId, String indexGroupName) {
List<IndexDescDTO> list = indexDescService.listRecycle(enterpriseId, moduleId, indexGroupName);
return EnterpriseServiceResponse.success(list);
}
@Override
public ServiceResponse<Void> sort(Integer enterpriseId, String moduleId, String indexGroupName, Integer indexDescEnterpriseId, Integer seq) {
indexDescService.sort(enterpriseId, moduleId, indexGroupName, indexDescEnterpriseId, seq);
return EnterpriseServiceResponse.success();
}
@Override
public ServiceResponse<Void> moveToRecycle(Integer indexDescEnterpriseId) {
indexDescEnterpriseService.moveToRecycle(indexDescEnterpriseId);
return EnterpriseServiceResponse.success();
}
@Override
public ServiceResponse<String> getIndexDesc(Integer enterpriseId, String moduleId, String indexGroupName, String indexCode) {
TabIndex index = indexService.getByIndexCode(moduleId, indexCode);
return EnterpriseServiceResponse.success(index.getIndexRemark());
}
}
package com.gic.cloud.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.IndexDescDTO;
import com.gic.cloud.service.IndexDescApiService;
import com.gic.cloud.service.IndexDescService;
import com.gic.enterprise.response.EnterpriseServiceResponse;
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-23 15:10
*/
@Service("indexEnterpriseApiService")
public class IndexEnterpriseApiServiceImpl implements IndexDescApiService {
@Autowired
private IndexDescService indexDescService;
@Override
public ServiceResponse<Map<String, List<IndexDescDTO>>> listByEnterpriseAndModule(Integer enterpriseId, String moduleId) {
List<IndexDescDTO> descList = indexDescService.listByEnterpriseAndModule(enterpriseId, moduleId);
Map<String, List<IndexDescDTO>> resultMap = descList.stream().collect(Collectors.groupingBy(IndexDescDTO::getIndexGroupName, Collectors.mapping(e -> e, Collectors.toList())));
return EnterpriseServiceResponse.success(resultMap);
}
@Override
public ServiceResponse<Map<String, List<IndexDescDTO>>> listByEnterpriseAndModuleDetail(Integer enterpriseId, String moduleId, Integer userId) {
List<IndexDescDTO> descList = indexDescService.listByEnterpriseAndModuleDetail(enterpriseId, moduleId, userId);
Map<String, List<IndexDescDTO>> resultMap = descList.stream().collect(Collectors.groupingBy(IndexDescDTO::getIndexGroupName, Collectors.mapping(e -> e, Collectors.toList())));
return EnterpriseServiceResponse.success(resultMap);
}
@Override
public ServiceResponse<List<IndexDescDTO>> listRecycle(Integer enterpriseId, String moduleId) {
return null;
}
@Override
public ServiceResponse<Void> sortIndex(Integer enterpriseId, String moduleId, Integer indexId, Integer seq) {
return null;
}
@Override
public ServiceResponse<Void> moveToRecycle(Integer enterpriseId, String moduleId, Integer indexId) {
return null;
}
}
......@@ -26,4 +26,5 @@
<dubbo:service interface="com.gic.cloud.service.TempStoreConditionApiService" ref="tempStoreConditionApiService" timeout="6000" />
<dubbo:service interface="com.gic.cloud.service.IndexGroupApiService" ref="indexGroupApiService" timeout="6000" />
<dubbo:service interface="com.gic.cloud.service.StoreAttentionApiService" ref="storeAttentionApiService" timeout="6000" />
<dubbo:service interface="com.gic.cloud.service.IndexDescApiService" ref="indexDescApiService" timeout="6000" />
</beans>
......@@ -162,6 +162,9 @@
<if test="search != null and search != '' ">
and ( data_name like concat('%', #{search}, '%') or data_classify like concat('%', #{search}, '%') )
</if>
<if test="moduleId != null and moduleId != '' ">
and module_id = #{moduleId}
</if>
order by create_time desc
</select>
</mapper>
\ No newline at end of file
......@@ -3,7 +3,7 @@
<mapper namespace="com.gic.cloud.dao.mapper.TabIndexDescEnterpriseMapper">
<resultMap id="BaseResultMap" type="com.gic.cloud.entity.TabIndexDescEnterprise">
<id column="index_desc_enterprise_id" jdbcType="INTEGER" property="indexDescEnterpriseId" />
<result column="index_code" jdbcType="VARCHAR" property="indexCode" />
<result column="index_desc_id" jdbcType="INTEGER" property="indexDescId" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="index_status" jdbcType="INTEGER" property="indexStatus" />
<result column="sort" jdbcType="INTEGER" property="sort" />
......@@ -12,7 +12,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
index_desc_enterprise_id, index_code, enterprise_id, index_status, sort, status,
index_desc_enterprise_id, index_desc_id, enterprise_id, index_status, sort, status,
create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
......@@ -26,11 +26,11 @@
where index_desc_enterprise_id = #{indexDescEnterpriseId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.cloud.entity.TabIndexDescEnterprise">
insert into tab_index_desc_enterprise (index_desc_enterprise_id, index_code,
insert into tab_index_desc_enterprise (index_desc_enterprise_id, index_desc_id,
enterprise_id, index_status, sort,
status, create_time, update_time
)
values (#{indexDescEnterpriseId,jdbcType=INTEGER}, #{indexCode,jdbcType=VARCHAR},
values (#{indexDescEnterpriseId,jdbcType=INTEGER}, #{indexDescId,jdbcType=INTEGER},
#{enterpriseId,jdbcType=INTEGER}, #{indexStatus,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
......@@ -41,8 +41,8 @@
<if test="indexDescEnterpriseId != null">
index_desc_enterprise_id,
</if>
<if test="indexCode != null">
index_code,
<if test="indexDescId != null">
index_desc_id,
</if>
<if test="enterpriseId != null">
enterprise_id,
......@@ -67,8 +67,8 @@
<if test="indexDescEnterpriseId != null">
#{indexDescEnterpriseId,jdbcType=INTEGER},
</if>
<if test="indexCode != null">
#{indexCode,jdbcType=VARCHAR},
<if test="indexDescId != null">
#{indexDescId,jdbcType=INTEGER},
</if>
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
......@@ -93,8 +93,8 @@
<update id="updateByPrimaryKeySelective" parameterType="com.gic.cloud.entity.TabIndexDescEnterprise">
update tab_index_desc_enterprise
<set>
<if test="indexCode != null">
index_code = #{indexCode,jdbcType=VARCHAR},
<if test="indexDescId != null">
index_desc_id = #{indexDescId,jdbcType=INTEGER},
</if>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
......@@ -119,7 +119,7 @@
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.cloud.entity.TabIndexDescEnterprise">
update tab_index_desc_enterprise
set index_code = #{indexCode,jdbcType=VARCHAR},
set index_desc_id = #{indexDescId,jdbcType=INTEGER},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
index_status = #{indexStatus,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER},
......@@ -128,4 +128,7 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where index_desc_enterprise_id = #{indexDescEnterpriseId,jdbcType=INTEGER}
</update>
<update id="updateSort">
update tab_index_desc_enterprise set sort = sort + 1 where enterprise_id = #{enterpriseId} and sort >= #{sort}
</update>
</mapper>
\ No newline at end of file
......@@ -140,30 +140,57 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where index_desc_id = #{indexDescId,jdbcType=INTEGER}
</update>
<select id="listByEnterpriseAndModule" resultMap="BaseResultMap">
<select id="listByEnterpriseAndModule" resultMap="DTOResultMap">
select
<include refid="DTO_List" >
<property name="alias" value="t1"/>
</include>
from tab_index_desc t1
left join tab_index_desc_enterprise t2 on t1.index_code = t2.index_code
left join tab_index_desc_enterprise t2 on t1.index_desc_id = t2.index_desc_id
where t1.status = 1
and t1.enterprise_id = #{enterpriseId}
and t2.enterprise_id = #{enterpriseId}
and t1.module_id = #{moduleId}
and t1.index_group_name = #{indexGroupName}
and t2.index_status = 1
order by t2.sort
</select>
<!-- List<IndexDescDTO> listByEnterpriseAndModuleDetail(@Param("enterpriseId") Integer enterpriseId, @Param("moduleId") String moduleId, @Param("userId") Integer userId);-->
<select id="listByEnterpriseAndModuleDetail" resultMap="BaseResultMap">
<select id="listByEnterpriseAndModuleDetail" resultMap="DTOResultMap">
select
<include refid="DTO_List" >
<property name="alias" value="t1"/>
</include>
,t2.index_desc_enterprise_id indexDescEnterpriseId
,t2.sort
-- ,t4.show_status
from tab_index_desc t1
left join tab_index_desc_enterprise t2 on t1.index_code = t2.index_code
left join tab_index_desc_enterprise t2 on t1.index_desc_id = t2.index_desc_id
left join tab_index t3 on t1.index_code = t3.code
left join tab_update_tips t4 on t3.index_id = t4.business_id
where t1.status = 1
and t1.enterprise_id = #{enterpriseId}
and t2.enterprise_id = #{enterpriseId}
and t1.module_id = #{moduleId}
and t1.index_group_name = #{indexGroupName}
and t2.index_status = 1
and (t3.status = 1 or t3.status is null)
and (t3.classify_type = 1 or t3.classify_type is null)
AND (t4.business_id = 1 or t4.business_id is null)
AND (t4.type = 1 or t4.type is null)
<if test="userId != null ">
and t4.user_id = #{userId}
</if>
order by t2.sort
</select>
<select id="listRecycle" resultMap="DTOResultMap">
select
<include refid="DTO_List" >
<property name="alias" value="t1"/>
</include>
from tab_index_desc t1
left join tab_index_desc_enterprise t2 on t1.index_desc_id = t2.index_desc_id
where t1.status = 1
and t2.enterprise_id = #{enterpriseId}
and t1.module_id = #{moduleId}
and t1.index_group_name = #{indexGroupName}
and t2.index_status = 0
</select>
</mapper>
\ No newline at end of file
......@@ -346,11 +346,14 @@
<include refid="Base_Column_List" />
from tab_index
where status = 1
<if test="name != null ">
<if test="name != null and name != '' ">
and name = #{name}
</if>
<if test="code != null ">
and code = #{code}
<if test="code != null and code != '' ">
and code = #{code}
</if>
<if test="moduleId != null and moduleId != '' ">
and module_id = #{moduleId}
</if>
<if test="indexId != null ">
and index_id &lt;&gt; #{indexId}
......@@ -369,6 +372,9 @@
<if test="classifyType != null ">
and classify_type = #{classifyType}
</if>
<if test="code != null and code != '' ">
and code = #{code}
</if>
<if test="isAppIndex != null ">
and is_app_index = #{isAppIndex}
</if>
......
package com.gic.cloud.web.controller;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.DataExplainDTO;
import com.gic.cloud.dto.IndexDescDTO;
import com.gic.cloud.service.DataExplainApiService;
import com.gic.cloud.service.IndexDescApiService;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.utils.ResultControllerUtils;
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-27 10:40
*/
@RestController
public class IndexDescController {
@Autowired
private IndexDescApiService indexDescApiService;
@Autowired
private DataExplainApiService dataExplainApiService;
@RequestMapping("/list-index-desc")
public RestResponse listIndexDesc(Integer enterpriseId, String moduleId, String indexGroupName) {
ServiceResponse<List<IndexDescDTO>> serviceResponse = indexDescApiService.listByEnterpriseAndModule(enterpriseId, moduleId, indexGroupName);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/list-index-desc-detail")
public RestResponse listByEnterpriseAndModuleDetail(Integer enterpriseId, String moduleId, String indexGroupName, Integer userId) {
ServiceResponse<List<IndexDescDTO>> serviceResponse = indexDescApiService.listByEnterpriseAndModuleDetail(enterpriseId, moduleId, indexGroupName, userId);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/list-index-desc-recycle")
public RestResponse listRecycle(Integer enterpriseId, String moduleId, String indexGroupName) {
ServiceResponse<List<IndexDescDTO>> serviceResponse = indexDescApiService.listRecycle(enterpriseId, moduleId, indexGroupName);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/sort-index-desc")
public RestResponse sort(Integer enterpriseId, String moduleId, String indexGroupName, Integer indexDescEnterpriseId, Integer seq) {
ServiceResponse<Void> serviceResponse = indexDescApiService.sort(enterpriseId, moduleId, indexGroupName, indexDescEnterpriseId, seq);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/recycle-index-desc")
public RestResponse recycle(Integer indexDescEnterpriseId) {
ServiceResponse<Void> serviceResponse = indexDescApiService.moveToRecycle(indexDescEnterpriseId);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/get-index-desc")
public RestResponse getIndexDesc(Integer enterpriseId, String moduleId, String indexGroupName, String indexCode) {
ServiceResponse<String> serviceResponse = indexDescApiService.getIndexDesc(enterpriseId, moduleId, indexGroupName, indexCode);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/get-data-explain")
public RestResponse getDataExplain(String moduleId) {
ServiceResponse<List<DataExplainDTO>> serviceResponse = dataExplainApiService.listByModule(moduleId);
return ResultControllerUtils.commonResult(serviceResponse);
}
}
\ No newline at end of file
......@@ -143,5 +143,7 @@
<dubbo:reference interface="com.gic.store.service.StoreTagApiService" id="storeTagApiService" timeout="6000" retries="0"/>
<dubbo:reference interface="com.gic.cloud.service.StoreAttentionApiService" id="storeAttentionApiService" timeout="6000" retries="0"/>
<dubbo:reference interface="com.gic.cloud.service.TempStoreConditionApiService" id="tempStoreConditionApiService" timeout="6000" retries="0"/>
<dubbo:reference interface="com.gic.cloud.service.IndexDescApiService" id="indexDescApiService" timeout="6000" retries="0"/>
<dubbo:reference interface="com.gic.cloud.service.DataExplainApiService" id="dataExplainApiService" timeout="6000" retries="0"/>
<dubbo:reference interface="com.gic.data.api.service.IndexSalesApiService" id="indexSalesApiService" timeout="6000" retries="0"/>
</beans>
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