Browse Source

我要提建议,接口开发

origin/epidemic_user
zhangyongzhangyong 4 years ago
parent
commit
1cf4eba73b
  1. 9
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionMakeServiceImpl.java
  2. 4
      epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionTypeServiceImpl.java
  3. 12
      epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionMakeDao.xml

9
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionMakeServiceImpl.java

@ -24,6 +24,8 @@ import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.constant.StrConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.constant.ImageConstant;
@ -69,6 +71,7 @@ public class SuggestionMakeServiceImpl extends BaseServiceImpl<SuggestionMakeDao
@Override
public PageData<SuggestionMakeDTO> page(Map<String, Object> params) {
params.put("deptIdList", SecurityUser.getUser().getDeptIdList());
IPage<SuggestionMakeDTO> page = getPage(params);
List<SuggestionMakeDTO> list = baseDao.selectListPage(params);
return new PageData<>(list, page.getTotal());
@ -95,12 +98,10 @@ public class SuggestionMakeServiceImpl extends BaseServiceImpl<SuggestionMakeDao
SuggestionMakeDTO result = baseDao.selectDetailById(id);
// 查询建议图片URL
String[] urls = customImgDao.selectListImgUrlsByIds(result.getId());
List<Map<String, String>> suggestionPicList = new ArrayList<>();
List<String> suggestionPicList = new ArrayList<>();
for (int i = 0; i < urls.length; i++) {
Map<String, String> map = new HashMap<>();
map.put("name", i + "");
map.put("url", urls[i]);
suggestionPicList.add(map);
suggestionPicList.add(urls[i]);
}
result.setSuggestionPicList(suggestionPicList);
return result;

4
epdc-cloud-custom/src/main/java/com/elink/esua/epdc/modules/suggestion/service/impl/SuggestionTypeServiceImpl.java

@ -113,10 +113,10 @@ public class SuggestionTypeServiceImpl extends BaseServiceImpl<SuggestionTypeDao
@Override
public Result<List<TypeNode>> getSuggestionTypeTree() {
List<TypeNode> nodes = baseDao.selectListSuggestionTypeTree();
Map<String, List<TypeNode>> children = nodes.stream().filter(node -> !(node.getPid().equals(NumConstant.ZERO)))
Map<Long, List<TypeNode>> children = nodes.stream().filter(node -> !(node.getPid().equals(NumConstant.ZERO_L)))
.collect(Collectors.groupingBy(node -> node.getPid()));
nodes.forEach(node -> node.setChildren(children.get(node.getValue())));
List<TypeNode> result = nodes.stream().filter(node -> node.getPid().equals(NumConstant.ZERO_STR)).collect(Collectors.toList());
List<TypeNode> result = nodes.stream().filter(node -> node.getPid().equals(NumConstant.ZERO_L)).collect(Collectors.toList());
return new Result<List<TypeNode>>().ok(result);
}

12
epdc-cloud-custom/src/main/resources/mapper/suggestion/SuggestionMakeDao.xml

@ -43,7 +43,7 @@
m.PARTY_FLAG,
m.IS_FEEDBACK,
t.SUGGESTION_NAME suggestionTypeName,
DATE_FORMAT(m.CREATED_TIME, '%Y.%m.%d') createdTime
DATE_FORMAT(m.CREATED_TIME, '%Y-%m-%d %H:%i:%s') createdTime
FROM epdc_suggestion_make m
LEFT JOIN epdc_suggestion_type t ON m.SUGGESTION_TYPE_ID = t.ID AND t.DEL_FLAG = '0'
WHERE m.DEL_FLAG = '0'
@ -72,7 +72,7 @@
auth.ALL_DEPT_IDS,
auth.ALL_DEPT_NAMES,
auth.IS_FEEDBACK,
DATE_FORMAT(auth.CREATED_TIME, '%Y.%m.%d') createdTimeStr
DATE_FORMAT(auth.CREATED_TIME, '%Y-%m-%d %H:%i:%s') createdTimeStr
FROM (
SELECT
m.ID,
@ -108,6 +108,12 @@
AND m.ALL_DEPT_IDS LIKE CONCAT('%', #{allDeptIds}, '%')
</if>
) auth
<if test="deptIdList!=null and deptIdList.size()>0">
where auth.DEPT_ID in
<foreach collection="deptIdList" index="index" item="deptId" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
</select>
<select id="selectDetailById" resultType="com.elink.esua.epdc.dto.suggestion.SuggestionMakeDTO">
@ -128,7 +134,7 @@
m.ALL_DEPT_IDS,
m.ALL_DEPT_NAMES,
m.IS_FEEDBACK,
DATE_FORMAT(m.CREATED_TIME, '%Y.%m.%d') createdTimeStr
DATE_FORMAT(m.CREATED_TIME, '%Y-%m-%d %H:%i:%s') createdTimeStr
FROM epdc_suggestion_make m
LEFT JOIN epdc_suggestion_type t ON m.SUGGESTION_TYPE_ID = t.ID AND t.DEL_FLAG = '0'
WHERE m.DEL_FLAG = '0'

Loading…
Cancel
Save