Browse Source

"mydemand"接口查询的是PC录入的需求+居民端小程序用户自己上报的需求

master
yinzuomei 4 years ago
parent
commit
7130b6cfbd
  1. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcResiUserDemandFromDTO.java
  2. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  3. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcResiUserDemandFromDTO.java

@ -30,4 +30,9 @@ public class IcResiUserDemandFromDTO implements Serializable {
@NotBlank(message = "tokenDto获取客户id不能为空", groups = AddUserInternalGroup.class)
private String customerId;
/**
* 代码内自己查询的参数赋值到此属性
*/
private String epmetUserId;
}

12
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -40,8 +40,10 @@ import com.epmet.dao.IcUserDemandServiceDao;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.ResiUserFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.AllGridsByUserIdResultDTO;
import com.epmet.dto.result.ResiUserResDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.IcResiUserReportDemandRes;
@ -465,6 +467,16 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
*/
@Override
public PageData<IcResiUserReportDemandRes> queryMyDemand(IcResiUserDemandFromDTO formDTO) {
//1、查询当前居民在小程序里是否有用户id
ResiUserFormDTO resiUserFormDTO=new ResiUserFormDTO();
resiUserFormDTO.setCustomerId(formDTO.getCustomerId());
resiUserFormDTO.setIcResiUserId(formDTO.getUserId());
Result<ResiUserResDTO> userRes=epmetUserOpenFeignClient.findUser(resiUserFormDTO);
if(!userRes.success()){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"/epmetuser/user/finduser接口异常","查找居民端小程序用户信息异常");
}
formDTO.setEpmetUserId(userRes.getData().getEpmetUserId());
//2、小程序内自己上报+赋能平台待录入的
PageInfo<IcResiUserReportDemandRes> pageInfo = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectUserDemand(formDTO));
List<IcResiUserReportDemandRes> list = pageInfo.getList();

10
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -134,7 +134,15 @@
ic_user_demand_rec r
WHERE
r.DEL_FLAG = '0'
AND r.DEMAND_USER_ID = #{userId}
<choose>
<when test="null!=epmetUserId and epmetUserId!='' ">
AND (r.DEMAND_USER_ID = #{userId} or r.DEMAND_USER_ID=#{epmetUserId})
</when>
<otherwise>
AND r.DEMAND_USER_ID = #{userId}
</otherwise>
</choose>
<if test="null !=firstCategoryCode and firstCategoryCode!=''">
and r.CATEGORY_CODE like concat(#{firstCategoryCode},'%')
</if>

Loading…
Cancel
Save