Commit 13c92001 authored by hezhen's avatar hezhen

Merge branch 'dev-chw' of http://113.105.137.151:22280/youjj/cloud-platform into dev-chw

parents 72e731d9 7145bed3
...@@ -3,7 +3,6 @@ package com.xxfc.platform.order.rest; ...@@ -3,7 +3,6 @@ package com.xxfc.platform.order.rest;
import com.github.wxiaoqi.security.admin.feign.UserFeign; import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken; import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController; import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
...@@ -74,17 +73,12 @@ public class OrderViolationController extends BaseController<OrderViolationBiz, ...@@ -74,17 +73,12 @@ public class OrderViolationController extends BaseController<OrderViolationBiz,
* @return * @return
*/ */
@GetMapping("/getOne/{detailId}") @GetMapping("/getOne/{detailId}")
public ObjectRestResponse<OrderViolation> getOne(@PathVariable Integer detailId) { public ObjectRestResponse<List<OrderViolation>> getOne(@PathVariable Integer detailId) {
Example exa = Example.builder(OrderViolation.class) Example exa = Example.builder(OrderViolation.class)
.where(WeekendSqls.<OrderViolation>custom().andEqualTo(OrderViolation::getDetailId, detailId) .where(WeekendSqls.<OrderViolation>custom().andEqualTo(OrderViolation::getDetailId, detailId)
.andEqualTo(OrderViolation::getIsDel, 0)).build(); .andEqualTo(OrderViolation::getIsDel, 0)).build();
List<OrderViolation> orderViolations = getBaseBiz().selectByExample(exa); List<OrderViolation> orderViolations = getBaseBiz().selectByExample(exa);
if (orderViolations.size() > 1) { return ObjectRestResponse.succ(orderViolations);
throw new BaseException("The database has multiple records");
}
OrderViolation orderViolation = new OrderViolation();
orderViolation = (orderViolations.size() == 0) ? null : orderViolations.get(0);
return ObjectRestResponse.succ(orderViolation);
} }
......
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