Commit 015ea9ab authored by jiaorz's avatar jiaorz

添加押金记录客服电话,出行记录查询筛选

parent 5ddc3146
......@@ -7,6 +7,7 @@ import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.admin.vo.ImiVo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.im.dto.CommentVo;
import com.xxfc.platform.im.dto.PraiseVo;
import com.xxfc.platform.im.model.Comment;
......@@ -122,6 +123,36 @@ public class MsgBiz {
return ObjectRestResponse.succ();
}
public ObjectRestResponse getMsgListByUserId(Integer page, Integer limit) {
//获取所有朋友圈
page = page == null ? 1 : page;
limit = limit == null ? 10 : limit;
AppUserDTO appUserDTO = userBiz.getUserInfo();
Integer userId = null;
if(appUserDTO != null) {
userId = appUserDTO.getImUserid();
} else {
return ObjectRestResponse.createFailedResult(ResultCode.RSTOKEN_EXPIRED_CODE, "token失效");
}
Pageable pageable = PageRequest.of(--page, limit);
List<Integer> ids = new ArrayList<>();
ids.add(2);
ids.add(4);
Query query = new Query(Criteria.where("body.type").in(ids));
query.addCriteria(Criteria.where("userId").is(userId));
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
query.with(pageable);
query.with(new Sort(Sort.Direction.DESC, "time"));
List<Msg> msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
PageInfo<Msg> goodPageInfo = new PageInfo<>(msgList);
goodPageInfo.setPageSize(totalSize%limit == 0 ?totalSize/limit : totalSize/limit + 1);
return ObjectRestResponse.succ(goodPageInfo);
}
/**
* 添加评论和点赞
*
......
......@@ -31,4 +31,8 @@ public class MsgController {
return msgBiz.get(id);
}
@GetMapping(value = "/getByUserId")
public ObjectRestResponse getByUserId(Integer page, Integer limit) {
return msgBiz.getMsgListByUserId(page, limit);
}
}
......@@ -33,7 +33,7 @@ public class VehicleBookRecordVo extends VehicleBookRecord {
private Integer liftStatus;
private Integer retStatus;
private Integer state;
List<VehicleUpkeepItem> vehicleUpkeepItems;
}
......@@ -442,7 +442,7 @@
<select id="getBookRecordInfo" resultMap="searchBookRecord" parameterType="java.util.Map">
select (CASE v1.lift_company WHEN #{userCompany} THEN 1 ELSE 0 end) liftStatus,(CASE v1.ret_company WHEN
select (CASE v1.lift_company WHEN #{userCompany} THEN 1 ELSE 0 end) liftStatus,(CASE v1.ret_company WHEN
#{userCompany} THEN 1 ELSE 0 end) retStatus,bc4.name subordinateBranchName, bc1.`name` lift_company_name,
bc2.`name` ret_company_name, v3.number_plate,v1.*
from vehicle_book_record v1
......@@ -473,11 +473,14 @@
#{id}
</foreach>)
</if>
<if test="status != null and status != 0 and status != -1">
<if test="status != null and status != 0 and status != -1 and status != -2">
and v1.status = #{status}
</if>
<if test="status != null and (status == 0 or status == -1)">
and v4.state = #{status}
<if test="status != null and status == 0 ">
and v4.state = 0
</if>
<if test="status != null and status == -1 ">
and v4.state = 1
</if>
and v1.book_user != -2
</where>
......
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