Browse Source

居民端建议

dev_shibei_match
liushaowen 5 years ago
parent
commit
31ea4f4f41
  1. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java
  2. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java
  3. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java
  4. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java
  5. 21
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java
  6. 21
      epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java

@ -20,11 +20,11 @@ public class MyAdviceListResultDTO implements Serializable {
private List<String> imgList;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JsonFormat(pattern = "yyyy/MM/dd", timezone = "GMT+8")
private Date adviceTime;
private String replyContent;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JsonFormat(pattern = "yyyy/MM/dd", timezone = "GMT+8")
private Date replyTime;
}

13
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java

@ -129,8 +129,17 @@ public class UserAdviceController {
return new Result<PageData<AdviceListResultDTO>>().ok(page);
}
/**
* @Description 居民端-我的建议列表
* @param map ->pageSize,pageNo
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.MyAdviceListResultDTO>>
* @Author liushaowen
* @Date 2020/11/9 17:35
*/
@PostMapping("myadvicelist")
public Result<List<MyAdviceListResultDTO>> myAdviceList(String pageSize, String pageNo) {
return null;
public Result<List<MyAdviceListResultDTO>> myAdviceList(@RequestBody Map<String,Integer> map) {
int pageSize = map.get("pageSize");
int pageNo = map.get("pageNo");
return new Result<List<MyAdviceListResultDTO>>().ok(userAdviceService.myAdviceList(pageSize,pageNo,loginUserUtil.getLoginUserId()));
}
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java

@ -18,10 +18,13 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.MyAdviceListResultDTO;
import com.epmet.entity.UserAdviceEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* user_advice
*
@ -34,4 +37,8 @@ public interface UserAdviceDao extends BaseDao<UserAdviceEntity> {
@Param("replyContent") String replyContent,
@Param("govContent") String govContent,
@Param("replyUserId") String loginUserId);
List<MyAdviceListResultDTO> myAdviceList(@Param("pageSize") int pageSize,
@Param("pageNo") int pageNo,
@Param("userId") String loginUserId);
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java

@ -24,6 +24,7 @@ import com.epmet.dto.form.AdviceListFormDTO;
import com.epmet.dto.form.ReplyAdviceFormDTO;
import com.epmet.dto.result.AdviceDetailResultDTO;
import com.epmet.dto.result.AdviceListResultDTO;
import com.epmet.dto.result.MyAdviceListResultDTO;
import com.epmet.entity.UserAdviceEntity;
import java.util.List;
@ -124,4 +125,15 @@ public interface UserAdviceService extends BaseService<UserAdviceEntity> {
* @Date 2020/11/9 10:41
*/
PageData<AdviceListResultDTO> adviceList(AdviceListFormDTO dto);
/**
* @Description 居民端-我的建议列表
* @param pageSize
* @param pageNo
* @param loginUserId
* @return java.util.List<com.epmet.dto.result.MyAdviceListResultDTO>
* @Author liushaowen
* @Date 2020/11/9 17:39
*/
List<MyAdviceListResultDTO> myAdviceList(int pageSize, int pageNo, String loginUserId);
}

21
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java

@ -42,6 +42,7 @@ import com.epmet.dto.form.AdviceListFormDTO;
import com.epmet.dto.form.ReplyAdviceFormDTO;
import com.epmet.dto.result.AdviceDetailResultDTO;
import com.epmet.dto.result.AdviceListResultDTO;
import com.epmet.dto.result.MyAdviceListResultDTO;
import com.epmet.entity.UserAdviceEntity;
import com.epmet.entity.UserAdviceImgEntity;
import com.epmet.redis.UserAdviceRedis;
@ -278,6 +279,20 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd
return getPageData(result, AdviceListResultDTO.class);
}
/**
* @param pageSize
* @param pageNo
* @param loginUserId
* @return java.util.List<com.epmet.dto.result.MyAdviceListResultDTO>
* @Description 居民端-我的建议列表
* @Author liushaowen
* @Date 2020/11/9 17:39
*/
@Override
public List<MyAdviceListResultDTO> myAdviceList(int pageSize, int pageNo, String loginUserId) {
return baseDao.myAdviceList(pageSize, pageNo, loginUserId);
}
private void auditText(String text) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
@ -285,14 +300,14 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
logger.info("用户建议文字审核入参:"+JSON.toJSONString(textScanParamDTO));
logger.info("用户建议文字审核返参:"+JSON.toJSONString(textSyncScanResult));
logger.info("用户建议文字审核入参:" + JSON.toJSONString(textScanParamDTO));
logger.info("用户建议文字审核返参:" + JSON.toJSONString(textSyncScanResult));
if (!textSyncScanResult.success()) {
logger.warn("用户建议文字审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
logger.warn("用户建议文字审核失败,文字:",text);
logger.warn("用户建议文字审核失败,文字:", text);
throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode());
}
}

21
epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml

@ -43,4 +43,25 @@
where id = #{adviceId} and del_flag = 0
</update>
<resultMap id="myAdviceListResultMap" type="com.epmet.dto.result.MyAdviceListResultDTO">
<id column="id"></id>
<result property="adviceContent" column="ADVICE_CONTENT"/>
<result property="adviceTime" column="ADVICE_TIME"/>
<result property="replyContent" column="REPLY_CONTENT"/>
<result property="replyTime" column="REPLY_TIME"/>
<collection property="imgList" select="getResiImgByAdviceId" column="id"></collection>
</resultMap>
<select id="myAdviceList" resultMap="myAdviceListResultMap">
select id,advice_content,advice_time,reply_content,reply_time
from user_advice
where del_flag = 0 and user_id = #{userId}
order by created_time desc
limit ${(pageNo-1)*pageSize},${pageSize};
</select>
<select id="getResiImgByAdviceId">
select img_url
from user_advice_img
where del_flag = 0 and advice_Id = #{id} and type = 'resi'
</select>
</mapper>

Loading…
Cancel
Save