Commit 5d273748 authored by 赵啸非's avatar 赵啸非

添加更新基础区域

parent 0349acca
...@@ -52,5 +52,10 @@ public class DeclareVo extends BaseEntityLong { ...@@ -52,5 +52,10 @@ public class DeclareVo extends BaseEntityLong {
*/ */
private transient List <Long> agentUserIdList; private transient List <Long> agentUserIdList;
/**
* 评分,一般 1~5 星
*/
private Integer score;
} }
\ No newline at end of file
...@@ -17,6 +17,7 @@ import com.mortals.xhx.module.evaluation.model.EvaluationInfoEntity; ...@@ -17,6 +17,7 @@ import com.mortals.xhx.module.evaluation.model.EvaluationInfoEntity;
import com.mortals.xhx.module.evaluation.model.EvaluationInfoQuery; import com.mortals.xhx.module.evaluation.model.EvaluationInfoQuery;
import com.mortals.xhx.module.evaluation.service.EvaluationInfoService; import com.mortals.xhx.module.evaluation.service.EvaluationInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 企业代办申报 * 企业代办申报
...@@ -59,9 +61,20 @@ public class DeclareController extends BaseCRUDJsonBodyMappingController<Declare ...@@ -59,9 +61,20 @@ public class DeclareController extends BaseCRUDJsonBodyMappingController<Declare
@Override @Override
protected void doListBefore(DeclareEntity query, Map<String, Object> model, Context context) throws AppException { protected void doListBefore(DeclareEntity query, Map<String, Object> model, Context context) throws AppException {
//如果登录用户是代办人 添加查询参数 //如果登录用户是代办人 添加查询参数
if (context.getUser() != null && context.getUser().getCustomerId()!=null) { if (context.getUser() != null && context.getUser().getCustomerId() != null) {
query.setAgentUserId(this.getContextUserId(context)); query.setAgentUserId(this.getContextUserId(context));
} }
if (!ObjectUtils.isEmpty(query.getScore())) {
List<Long> idList = evaluationInfoService.find(new EvaluationInfoQuery().score(query.getScore())).stream().map(i -> i.getDeclareId()).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(idList)) {
if (!ObjectUtils.isEmpty(query.getIdList())) {
query.getIdList().addAll(idList);
} else {
query.setIdList(idList);
}
}
}
super.doListBefore(query, model, context); super.doListBefore(query, model, context);
} }
......
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