Commit 25c552de by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-data-cloud into developer
parents 5bf5fed5 4070391c
......@@ -62,6 +62,8 @@ public class IndexDescDTO implements Serializable {
// private Integer showStatus;
private Integer indexDescEnterpriseId;
private Integer updateTipsId;
private int seq;
public Integer getIndexDescId() {
......@@ -167,4 +169,12 @@ public class IndexDescDTO implements Serializable {
public int getSeq() {
return seq;
}
public Integer getUpdateTipsId() {
return updateTipsId;
}
public void setUpdateTipsId(Integer updateTipsId) {
this.updateTipsId = updateTipsId;
}
}
package com.gic.cloud.service;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.IndexDTO;
import com.gic.cloud.dto.IndexDescDTO;
import java.util.List;
......@@ -42,10 +43,11 @@ public interface IndexDescApiService {
* @author zhiwj
* @param enterpriseId
* @param moduleId
* @param userId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.cloud.dto.IndexEnterpriseGroupDTO>
* @throws
*/
ServiceResponse<List<IndexDescDTO>> listRecycle(Integer enterpriseId, String moduleId, String indexGroupName);
ServiceResponse<List<IndexDescDTO>> listRecycle(Integer enterpriseId, String moduleId, String indexGroupName, Integer userId);
/**
* 排序
......@@ -79,5 +81,37 @@ public interface IndexDescApiService {
* @return com.gic.api.base.commons.ServiceResponse<com.gic.cloud.dto.IndexDescDTO>
* @throws
*/
ServiceResponse<String> getIndexDesc(Integer enterpriseId, String moduleId, String indexGroupName, String indexCode);
ServiceResponse<IndexDTO> getIndexDesc(Integer enterpriseId, String moduleId, String indexGroupName, String indexCode);
/**
* 批量更新
* @Title: batchUpdate
* @Description:
* @author zhiwj
* @param descList
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> batchUpdate(List<IndexDescDTO> descList);
/**
* @Title: batchUpdate
* @Description:
* @author zhiwj
* @param enterpriseId
* @param moduleId
* @param ids
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> batchUpdate(Integer enterpriseId, String moduleId, String ids);
/**
* @Title: eraseUpdateTips
* @Description:
* @author zhiwj
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> eraseUpdateTips(Integer userId, Integer updateTipsId);
}
......@@ -3,6 +3,8 @@ package com.gic.cloud.dao.mapper;
import com.gic.cloud.entity.TabIndexDescEnterprise;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TabIndexDescEnterpriseMapper {
/**
* 根据主键删除
......@@ -53,4 +55,6 @@ public interface TabIndexDescEnterpriseMapper {
int updateByPrimaryKey(TabIndexDescEnterprise record);
void updateSort(@Param("enterpriseId") Integer enterpriseId, @Param("sort") Integer sort);
void deleteList(@Param("ids") List<Integer> deleteList);
}
\ No newline at end of file
......@@ -57,7 +57,9 @@ public interface TabIndexDescMapper {
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("indexGroupName") String indexGroupName, @Param("userId") Integer userId);
List<IndexDescDTO> listByEnterpriseAndModuleDetail(@Param("enterpriseId") Integer enterpriseId, @Param("moduleId") String moduleId, @Param("indexGroupName") String indexGroupName, @Param("userId") Integer userId, @Param("indexStatus") Integer indexStatus);
List<IndexDescDTO> listRecycle(@Param("enterpriseId") Integer enterpriseId, @Param("moduleId") String moduleId, @Param("indexGroupName") String indexGroupName);
// List<IndexDescDTO> listRecycle(@Param("enterpriseId") Integer enterpriseId, @Param("moduleId") String moduleId, @Param("indexGroupName") String indexGroupName, @Param("userId") Integer userId);
List<TabIndexDesc> listAll();
}
\ No newline at end of file
package com.gic.cloud.service;
import com.gic.cloud.dto.IndexDescDTO;
import java.util.List;
/**
* @author zhiwj
* @Description:
......@@ -9,4 +13,10 @@ public interface IndexDescEnterpriseService {
void updateSort(Integer enterpriseId, Integer indexDescEnterpriseId, Integer sort);
void moveToRecycle(Integer indexDescEnterpriseId);
void batchUpdate(List<IndexDescDTO> descList);
void batchUpdate(String[] idsArr);
void deleteList(List<Integer> deleteList);
}
......@@ -17,7 +17,7 @@ public interface IndexDescService {
List<IndexDescDTO> listByEnterpriseAndModuleDetail(Integer enterpriseId, String moduleId, String indexGroupName, Integer userId);
List<IndexDescDTO> listRecycle(Integer enterpriseId, String moduleId, String indexGroupName);
List<IndexDescDTO> listRecycle(Integer enterpriseId, String moduleId, String indexGroupName, Integer userId);
void sort(Integer enterpriseId, String moduleId, String indexGroupName, Integer indexDescEnterpriseId, Integer seq);
......
......@@ -17,5 +17,5 @@ public interface UpdateTipService {
void publish(Integer businessId, Integer type);
void erase(Integer userId);
void erase(Integer userId, Integer businessId, Integer type);
}
package com.gic.cloud.service.impl;
import com.gic.cloud.dao.mapper.TabIndexDescEnterpriseMapper;
import com.gic.cloud.dto.IndexDescDTO;
import com.gic.cloud.entity.TabIndexDescEnterprise;
import com.gic.cloud.service.IndexDescEnterpriseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author zhiwj
* @Description:
......@@ -37,4 +40,30 @@ public class IndexDescEnterpriseServiceImpl implements IndexDescEnterpriseServic
indexDescEnterprise.setIndexStatus(0);
tabIndexDescEnterpriseMapper.updateByPrimaryKeySelective(indexDescEnterprise);
}
@Override
public void batchUpdate(List<IndexDescDTO> descList) {
for (IndexDescDTO indexDescDTO : descList) {
TabIndexDescEnterprise indexDescEnterprise = new TabIndexDescEnterprise();
indexDescEnterprise.setIndexDescEnterpriseId(indexDescDTO.getIndexDescEnterpriseId());
indexDescEnterprise.setSort(indexDescDTO.getSort());
tabIndexDescEnterpriseMapper.updateByPrimaryKeySelective(indexDescEnterprise);
}
}
@Override
public void batchUpdate(String[] idsArr) {
for (int i = 0; i < idsArr.length; i++) {
String s = idsArr[i];
TabIndexDescEnterprise indexDescEnterprise = new TabIndexDescEnterprise();
indexDescEnterprise.setIndexDescEnterpriseId(Integer.valueOf(s));
indexDescEnterprise.setSort(i);
tabIndexDescEnterpriseMapper.updateByPrimaryKeySelective(indexDescEnterprise);
}
}
@Override
public void deleteList(List<Integer> deleteList) {
tabIndexDescEnterpriseMapper.deleteList(deleteList);
}
}
......@@ -31,18 +31,18 @@ public class IndexDescServiceImpl implements IndexDescService {
@Override
public List<IndexDescDTO> listByEnterpriseAndModuleDetail(Integer enterpriseId, String moduleId, String indexGroupName, Integer userId) {
return tabIndexDescMapper.listByEnterpriseAndModuleDetail(enterpriseId, moduleId, indexGroupName, userId);
return tabIndexDescMapper.listByEnterpriseAndModuleDetail(enterpriseId, moduleId, indexGroupName, userId, 1);
}
@Override
public List<IndexDescDTO> listRecycle(Integer enterpriseId, String moduleId, String indexGroupName) {
return tabIndexDescMapper.listRecycle(enterpriseId, moduleId, indexGroupName);
public List<IndexDescDTO> listRecycle(Integer enterpriseId, String moduleId, String indexGroupName, Integer userId) {
return tabIndexDescMapper.listByEnterpriseAndModuleDetail(enterpriseId, moduleId, indexGroupName, userId, 0);
}
@Override
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);
List<IndexDescDTO> dtoList = tabIndexDescMapper.listByEnterpriseAndModuleDetail(enterpriseId, moduleId, indexGroupName, null, 1);
IndexDescDTO indexDescDTO = dtoList.get(0);
indexDescEnterpriseService.updateSort(enterpriseId, indexDescEnterpriseId, indexDescDTO.getSort());
}
......
......@@ -76,7 +76,8 @@ public class UpdateTipServiceImpl implements UpdateTipService {
}
@Override
public void erase(Integer userId) {
tabUpdateTipsMapper.updateStatus(null, null, userId, 0);
public void erase(Integer userId, Integer businessId, Integer type) {
tabUpdateTipsMapper.updateStatus(businessId, type, userId, 0);
}
}
package com.gic.cloud.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.IndexDTO;
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.cloud.service.*;
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.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zhiwj
......@@ -27,6 +28,8 @@ public class IndexDescApiServiceImpl implements IndexDescApiService {
private IndexDescEnterpriseService indexDescEnterpriseService;
@Autowired
private IndexService indexService;
@Autowired
private UpdateTipService updateTipService;
@Override
public ServiceResponse<List<IndexDescDTO>> listByEnterpriseAndModule(Integer enterpriseId, String moduleId, String indexGroupName) {
......@@ -44,8 +47,8 @@ public class IndexDescApiServiceImpl implements IndexDescApiService {
}
@Override
public ServiceResponse<List<IndexDescDTO>> listRecycle(Integer enterpriseId, String moduleId, String indexGroupName) {
List<IndexDescDTO> list = indexDescService.listRecycle(enterpriseId, moduleId, indexGroupName);
public ServiceResponse<List<IndexDescDTO>> listRecycle(Integer enterpriseId, String moduleId, String indexGroupName, Integer userId) {
List<IndexDescDTO> list = indexDescService.listRecycle(enterpriseId, moduleId, indexGroupName, userId);
return EnterpriseServiceResponse.success(list);
}
......@@ -62,8 +65,33 @@ public class IndexDescApiServiceImpl implements IndexDescApiService {
}
@Override
public ServiceResponse<String> getIndexDesc(Integer enterpriseId, String moduleId, String indexGroupName, String indexCode) {
public ServiceResponse<IndexDTO> getIndexDesc(Integer enterpriseId, String moduleId, String indexGroupName, String indexCode) {
TabIndex index = indexService.getByIndexCode(moduleId, indexCode);
return EnterpriseServiceResponse.success(index.getIndexRemark());
return EnterpriseServiceResponse.success(EntityUtil.changeEntityByJSON(IndexDTO.class, index));
}
@Override
public ServiceResponse<Void> batchUpdate(List<IndexDescDTO> descList) {
indexDescEnterpriseService.batchUpdate(descList);
return EnterpriseServiceResponse.success();
}
@Override
public ServiceResponse<Void> batchUpdate(Integer enterpriseId, String moduleId, String ids) {
List<IndexDescDTO> indexDescDTOList = indexDescService.listByEnterpriseAndModuleDetail(enterpriseId, moduleId, null, null);
String[] idsArr = ids.split(",");
indexDescEnterpriseService.batchUpdate(idsArr);
List<String> existList = Arrays.asList(idsArr);
if (existList.size() < indexDescDTOList.size()) {
List<Integer> deleteList = indexDescDTOList.stream().map(IndexDescDTO::getIndexDescEnterpriseId).filter(e -> !existList.contains(e.toString())).collect(Collectors.toList());
indexDescEnterpriseService.deleteList(deleteList);
}
return EnterpriseServiceResponse.success();
}
@Override
public ServiceResponse<Void> eraseUpdateTips(Integer userId, Integer updateTipsId) {
updateTipService.erase(userId, updateTipsId, 1);
return EnterpriseServiceResponse.success();
}
}
......@@ -131,4 +131,12 @@
<update id="updateSort">
update tab_index_desc_enterprise set sort = sort + 1 where enterprise_id = #{enterpriseId} and sort >= #{sort}
</update>
<!-- deleteList-->
<update id="deleteList">
update tab_index_desc_enterprise set index_status = 0 where
index_desc_enterprise_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</mapper>
\ No newline at end of file
......@@ -163,7 +163,8 @@
</include>
,t2.index_desc_enterprise_id indexDescEnterpriseId
,t2.sort
-- ,t4.show_status
,ifnull(t4.show_status, 2) updateTips
,t4.update_tips_id updateTipsId
from tab_index_desc t1
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
......@@ -174,17 +175,17 @@
<if test="indexGroupName != null and indexGroupName != '' ">
and t1.index_group_name = #{indexGroupName}
</if>
and t2.index_status = 1
and t2.index_status = #{indexStatus}
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}
AND (t4.user_id = #{userId} or t4.user_id is null )
</if>
order by t2.sort
</select>
<select id="listRecycle" resultMap="DTOResultMap">
<!-- <select id="listRecycle" resultMap="DTOResultMap">
select
<include refid="DTO_List" >
<property name="alias" value="t1"/>
......@@ -198,5 +199,11 @@
and t1.index_group_name = #{indexGroupName}
</if>
and t2.index_status = 0
</select>-->
<!-- List<IndexDescDTO> listAll();-->
<select id="listAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_index_desc
</select>
</mapper>
\ No newline at end of file
......@@ -2,10 +2,12 @@ package com.gic.cloud.web.controller;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.cloud.dto.DataExplainDTO;
import com.gic.cloud.dto.IndexDTO;
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.ano.IgnoreLogin;
import com.gic.enterprise.utils.ResultControllerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -39,14 +41,14 @@ public class IndexDescController {
}
@RequestMapping("/list-index-desc-recycle")
public RestResponse listRecycle(Integer enterpriseId, String moduleId, String indexGroupName) {
ServiceResponse<List<IndexDescDTO>> serviceResponse = indexDescApiService.listRecycle(enterpriseId, moduleId, indexGroupName);
public RestResponse listRecycle(Integer enterpriseId, String moduleId, String indexGroupName, Integer userId) {
ServiceResponse<List<IndexDescDTO>> serviceResponse = indexDescApiService.listRecycle(enterpriseId, moduleId, indexGroupName, userId);
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);
public RestResponse sort(Integer enterpriseId, String moduleId, String ids) {
ServiceResponse<Void> serviceResponse = indexDescApiService.batchUpdate(enterpriseId, moduleId, ids);
return ResultControllerUtils.commonResult(serviceResponse);
}
......@@ -58,8 +60,16 @@ public class IndexDescController {
@RequestMapping("/get-index-desc")
public RestResponse getIndexDesc(Integer enterpriseId, String moduleId, String indexGroupName, String indexCode) {
ServiceResponse<String> serviceResponse = indexDescApiService.getIndexDesc(enterpriseId, moduleId, indexGroupName, indexCode);
@IgnoreLogin
public RestResponse getIndexDesc(Integer enterpriseId, String moduleId, String indexGroupName, String indexCode, Integer userId, Integer updateTipsId) {
ServiceResponse<IndexDTO> serviceResponse = indexDescApiService.getIndexDesc(enterpriseId, moduleId, indexGroupName, indexCode);
indexDescApiService.eraseUpdateTips(userId, updateTipsId);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/erase-index-desc")
public RestResponse eraseIndexDesc(Integer userId, Integer updateTipsId) {
ServiceResponse<Void> serviceResponse = indexDescApiService.eraseUpdateTips(userId, updateTipsId);
return ResultControllerUtils.commonResult(serviceResponse);
}
......@@ -68,5 +78,4 @@ public class IndexDescController {
ServiceResponse<List<DataExplainDTO>> serviceResponse = dataExplainApiService.listByModule(moduleId);
return ResultControllerUtils.commonResult(serviceResponse);
}
}
\ No newline at end of file
package com.gic.cloud.web.qo;
import java.io.Serializable;
/**
* @author zhiwj
* @Description:
* @date 2020-07-30 16:25
*/
public class IndexDescQo implements Serializable {
private static final long serialVersionUID = 4047216253045894934L;
private Integer indexDescEnterpriseId;
private Integer sort;
public Integer getIndexDescEnterpriseId() {
return indexDescEnterpriseId;
}
public void setIndexDescEnterpriseId(Integer indexDescEnterpriseId) {
this.indexDescEnterpriseId = indexDescEnterpriseId;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
}
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