Commit ec5d98ce by wubh

包活干V2.0.0-修改:快递单、车务单相关功能

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@28247 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 5415292f
Showing 28 changed files with 534 additions and 217 deletions
package com.glsx.ordercenter.controller; package com.glsx.ordercenter.controller;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import com.glsx.common.annotation.AuthCheck; import com.glsx.common.annotation.AuthCheck;
import com.glsx.common.constants.Constants;
import com.glsx.common.pojo.PagedResp; import com.glsx.common.pojo.PagedResp;
import com.glsx.common.utils.UserUtils; import com.glsx.common.utils.UserUtils;
import com.glsx.ordercenter.constants.ResultCodeEnum; import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.dto.OrderDeviceReq; import com.glsx.ordercenter.dto.OrderDeviceReq;
import com.glsx.ordercenter.dto.req.CarOrderQueryReq; import com.glsx.ordercenter.dto.req.CarOrderQueryReq;
import com.glsx.ordercenter.dto.req.SubOrderQueryReq; import com.glsx.ordercenter.dto.req.SubOrderQueryReq;
import com.glsx.ordercenter.exception.BusinessException;
import com.glsx.ordercenter.pojo.GroupC; import com.glsx.ordercenter.pojo.GroupC;
import com.glsx.ordercenter.pojo.SysOrder; import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysSubOrder; import com.glsx.ordercenter.pojo.SysSubOrder;
...@@ -19,8 +24,6 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -19,8 +24,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/** /**
* <p>Description: 车务单业务 * <p>Description: 车务单业务
* <p>Project: car-service * <p>Project: car-service
...@@ -32,7 +35,6 @@ import java.util.Map; ...@@ -32,7 +35,6 @@ import java.util.Map;
@RestController @RestController
@RequestMapping("/carOrder") @RequestMapping("/carOrder")
public class CarOrderController extends BaseController { public class CarOrderController extends BaseController {
@Autowired @Autowired
private CarOrderService carOrderService; private CarOrderService carOrderService;
...@@ -43,7 +45,7 @@ public class CarOrderController extends BaseController { ...@@ -43,7 +45,7 @@ public class CarOrderController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/countByStatus", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/countByStatus", method = {RequestMethod.POST, RequestMethod.GET})
R countByStatus(CarOrderQueryReq req) { public R countByStatus(CarOrderQueryReq req) {
super.logInfo("==== /carOrder/countByStatus param", req); super.logInfo("==== /carOrder/countByStatus param", req);
req.setUserId(UserUtils.getCurrentUserId()); req.setUserId(UserUtils.getCurrentUserId());
...@@ -62,13 +64,13 @@ public class CarOrderController extends BaseController { ...@@ -62,13 +64,13 @@ public class CarOrderController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/countByServiceItem", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/countByServiceItem", method = {RequestMethod.POST, RequestMethod.GET})
R countByServiceItem(CarOrderQueryReq req) { public R countByServiceItem(CarOrderQueryReq req) {
super.logInfo("==== /carOrder/countByServiceItem param", req); super.logInfo("==== /carOrder/countByServiceItem param", req);
req.setUserId(UserUtils.getCurrentUserId()); req.setUserId(UserUtils.getCurrentUserId());
req.setUserType(UserUtils.getCurrentUserType()); req.setUserType(UserUtils.getCurrentUserType());
Map<String, Integer> statusCountMap = this.carOrderService.countByServiceItem(req); List<Map<String, Object>> statusCountList = this.carOrderService.countByServiceItem(req);
R result = R.ok().data(statusCountMap); R result = R.ok().data(statusCountList);
super.logInfo("==== /carOrder/countByServiceItem result", result); super.logInfo("==== /carOrder/countByServiceItem result", result);
return result; return result;
...@@ -81,7 +83,7 @@ public class CarOrderController extends BaseController { ...@@ -81,7 +83,7 @@ public class CarOrderController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/getList", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/getList", method = {RequestMethod.POST, RequestMethod.GET})
R getList(CarOrderQueryReq req) { public R getList(CarOrderQueryReq req) {
super.logInfo("==== /carOrder/getList param", req); super.logInfo("==== /carOrder/getList param", req);
req.setUserId(UserUtils.getCurrentUserId()); req.setUserId(UserUtils.getCurrentUserId());
...@@ -99,9 +101,14 @@ public class CarOrderController extends BaseController { ...@@ -99,9 +101,14 @@ public class CarOrderController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/getDetail", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/getDetail", method = {RequestMethod.POST, RequestMethod.GET})
R getDetail(CarOrderQueryReq req) { public R getDetail(CarOrderQueryReq req) {
super.logInfo("==== /carOrder/getDetail param", req); super.logInfo("==== /carOrder/getDetail param", req);
if (req.getId() == null) {
throw BusinessException.create(ResultCodeEnum.PARAM_ERROR.getCode(),
ResultCodeEnum.PARAM_ERROR.getMsg());
}
req.setUserId(UserUtils.getCurrentUserId()); req.setUserId(UserUtils.getCurrentUserId());
req.setUserType(UserUtils.getCurrentUserType()); req.setUserType(UserUtils.getCurrentUserType());
SysOrder order = this.carOrderService.getDetail(req); SysOrder order = this.carOrderService.getDetail(req);
...@@ -118,8 +125,21 @@ public class CarOrderController extends BaseController { ...@@ -118,8 +125,21 @@ public class CarOrderController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/save", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/save", method = {RequestMethod.POST, RequestMethod.GET})
R save(SysOrder order) { public R save(SysOrder order) {
return this.carOrderService.save(order); super.logInfo("==== /carOrder/save param", order);
JSONObject currentUser = UserUtils.getCurrentUser();
if (!Constants.SYS_USER_STATUS_NORMAL.equals(currentUser.get("userStatus"))) {
throw BusinessException.create(ResultCodeEnum.USER_IS_DISABLE_OR_LOGOUT.getCode(),
ResultCodeEnum.USER_IS_DISABLE_OR_LOGOUT.getMsg());
}
order.setUserId(UserUtils.getCurrentUserId());
order.setUserType(UserUtils.getCurrentUserType());
R result = this.carOrderService.save(order);
super.logInfo("==== /carOrder/save result", result);
return result;
} }
/** /**
...@@ -129,8 +149,20 @@ public class CarOrderController extends BaseController { ...@@ -129,8 +149,20 @@ public class CarOrderController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/cancel", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/cancel", method = {RequestMethod.POST, RequestMethod.GET})
R cancel(SysOrder order) { public R cancel(SysOrder order) {
return this.carOrderService.cancel(order); super.logInfo("==== /carOrder/cancel param", order);
if (order.getId() == null) {
throw BusinessException.create(ResultCodeEnum.PARAM_ERROR.getCode(),
ResultCodeEnum.PARAM_ERROR.getMsg());
}
order.setUserId(UserUtils.getCurrentUserId());
order.setUserType(UserUtils.getCurrentUserType());
R result = this.carOrderService.cancel(order);
super.logInfo("==== /carOrder/cancel result", result);
return result;
} }
/** /**
...@@ -140,10 +172,16 @@ public class CarOrderController extends BaseController { ...@@ -140,10 +172,16 @@ public class CarOrderController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/countSubOrderByStatus", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/countSubOrderByStatus", method = {RequestMethod.POST, RequestMethod.GET})
R countSubOrderByStatus(SubOrderQueryReq req) { public R countSubOrderByStatus(SubOrderQueryReq req) {
super.logInfo("==== /carOrder/countSubOrderByStatus param", req); super.logInfo("==== /carOrder/countSubOrderByStatus param", req);
if (req.getOrderId() == null) {
throw BusinessException.create(ResultCodeEnum.PARAM_ERROR.getCode(),
ResultCodeEnum.PARAM_ERROR.getMsg());
}
req.setUserId(UserUtils.getCurrentUserId()); req.setUserId(UserUtils.getCurrentUserId());
req.setUserType(UserUtils.getCurrentUserType());
Map<String, Integer> statusCountMap = this.carOrderService.countSubOrderByStatus(req); Map<String, Integer> statusCountMap = this.carOrderService.countSubOrderByStatus(req);
R result = R.ok().data(statusCountMap); R result = R.ok().data(statusCountMap);
...@@ -158,10 +196,16 @@ public class CarOrderController extends BaseController { ...@@ -158,10 +196,16 @@ public class CarOrderController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/getSubOrderList", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/getSubOrderList", method = {RequestMethod.POST, RequestMethod.GET})
R getSubOrderList(SubOrderQueryReq req) { public R getSubOrderList(SubOrderQueryReq req) {
super.logInfo("==== /carOrder/getSubOrderList param", req); super.logInfo("==== /carOrder/getSubOrderList param", req);
if (req.getOrderId() == null) {
throw BusinessException.create(ResultCodeEnum.PARAM_ERROR.getCode(),
ResultCodeEnum.PARAM_ERROR.getMsg());
}
req.setUserId(UserUtils.getCurrentUserId()); req.setUserId(UserUtils.getCurrentUserId());
req.setUserType(UserUtils.getCurrentUserType());
PagedResp<SysSubOrder> pagedResp = this.carOrderService.getSubOrderList(req); PagedResp<SysSubOrder> pagedResp = this.carOrderService.getSubOrderList(req);
R result = R.ok().data(pagedResp); R result = R.ok().data(pagedResp);
...@@ -176,10 +220,16 @@ public class CarOrderController extends BaseController { ...@@ -176,10 +220,16 @@ public class CarOrderController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/getSubOrderDetail", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/getSubOrderDetail", method = {RequestMethod.POST, RequestMethod.GET})
R getSubOrderDetail(SubOrderQueryReq req) { public R getSubOrderDetail(SubOrderQueryReq req) {
super.logInfo("==== /carOrder/getSubOrderDetail param", req); super.logInfo("==== /carOrder/getSubOrderDetail param", req);
if (req.getOrderId() == null || req.getId() == null) {
throw BusinessException.create(ResultCodeEnum.PARAM_ERROR.getCode(),
ResultCodeEnum.PARAM_ERROR.getMsg());
}
req.setUserId(UserUtils.getCurrentUserId()); req.setUserId(UserUtils.getCurrentUserId());
req.setUserType(UserUtils.getCurrentUserType());
SysSubOrder subOrder = this.carOrderService.getSubOrderDetail(req); SysSubOrder subOrder = this.carOrderService.getSubOrderDetail(req);
R result = R.ok().data(subOrder); R result = R.ok().data(subOrder);
...@@ -188,14 +238,37 @@ public class CarOrderController extends BaseController { ...@@ -188,14 +238,37 @@ public class CarOrderController extends BaseController {
} }
/** /**
* 获取子单凭证(文件)
*
* @param req 请求体
* @return 结果
*/
@RequestMapping(value = "/getSubOrderFile", method = {RequestMethod.POST, RequestMethod.GET})
public R getSubOrderFile(SubOrderQueryReq req) {
SysSubOrder subOrder = (SysSubOrder) this.getSubOrderDetail(req).get("data");
R result = R.ok().data(subOrder.getOrderFileList());
return result;
}
/**
* 根据子车务单ID取消 * 根据子车务单ID取消
* *
* @param subOrder 子车务单 * @param subOrder 子车务单
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/cancelSubOrder", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/cancelSubOrder", method = {RequestMethod.POST, RequestMethod.GET})
R cancelSubOrder(SysSubOrder subOrder) { public R cancelSubOrder(SysSubOrder subOrder) {
return this.carOrderService.cancelSubOrder(subOrder); super.logInfo("==== /carOrder/cancelSubOrder param", subOrder);
if (subOrder.getOrderId() == null || subOrder.getId() == null) {
throw BusinessException.create(ResultCodeEnum.PARAM_ERROR.getCode(),
ResultCodeEnum.PARAM_ERROR.getMsg());
}
R result = this.carOrderService.cancelSubOrder(subOrder);
super.logInfo("==== /carOrder/cancelSubOrder result", result);
return result;
} }
/** /**
...@@ -214,5 +287,4 @@ public class CarOrderController extends BaseController { ...@@ -214,5 +287,4 @@ public class CarOrderController extends BaseController {
} }
return carOrderService.subOrderHandle(orderDeviceReq, UserUtils.getCurrentUserId()); return carOrderService.subOrderHandle(orderDeviceReq, UserUtils.getCurrentUserId());
} }
} }
...@@ -13,9 +13,9 @@ import com.glsx.ordercenter.pojo.SysDelivery; ...@@ -13,9 +13,9 @@ import com.glsx.ordercenter.pojo.SysDelivery;
import com.glsx.ordercenter.service.DeliveryService; import com.glsx.ordercenter.service.DeliveryService;
import com.glsx.plat.core.web.R; import com.glsx.plat.core.web.R;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/** /**
* <p>Description: 快递单业务 * <p>Description: 快递单业务
...@@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
* @date 2020-08-28 * @date 2020-08-28
*/ */
@AuthCheck @AuthCheck
@Controller @RestController
@RequestMapping("/delivery") @RequestMapping("/delivery")
public class DeliveryController extends BaseController { public class DeliveryController extends BaseController {
@Autowired @Autowired
...@@ -39,7 +39,7 @@ public class DeliveryController extends BaseController { ...@@ -39,7 +39,7 @@ public class DeliveryController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/countByStatus", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/countByStatus", method = {RequestMethod.POST, RequestMethod.GET})
R countByStatus(DeliveryQueryReq req) { public R countByStatus(DeliveryQueryReq req) {
super.logInfo("==== /delivery/countByStatus param", req); super.logInfo("==== /delivery/countByStatus param", req);
req.setUserId(UserUtils.getCurrentUserId()); req.setUserId(UserUtils.getCurrentUserId());
...@@ -57,7 +57,7 @@ public class DeliveryController extends BaseController { ...@@ -57,7 +57,7 @@ public class DeliveryController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/getList", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/getList", method = {RequestMethod.POST, RequestMethod.GET})
R getList(DeliveryQueryReq req) { public R getList(DeliveryQueryReq req) {
super.logInfo("==== /delivery/getList param", req); super.logInfo("==== /delivery/getList param", req);
req.setUserId(UserUtils.getCurrentUserId()); req.setUserId(UserUtils.getCurrentUserId());
...@@ -74,7 +74,7 @@ public class DeliveryController extends BaseController { ...@@ -74,7 +74,7 @@ public class DeliveryController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/getDetail", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/getDetail", method = {RequestMethod.POST, RequestMethod.GET})
R getDetail(DeliveryQueryReq req) { public R getDetail(DeliveryQueryReq req) {
super.logInfo("==== /delivery/getDetail param", req); super.logInfo("==== /delivery/getDetail param", req);
req.setUserId(UserUtils.getCurrentUserId()); req.setUserId(UserUtils.getCurrentUserId());
...@@ -92,7 +92,7 @@ public class DeliveryController extends BaseController { ...@@ -92,7 +92,7 @@ public class DeliveryController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/save", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/save", method = {RequestMethod.POST, RequestMethod.GET})
R save(SysDelivery delivery) { public R save(SysDelivery delivery) {
super.logInfo("==== /delivery/save param", delivery); super.logInfo("==== /delivery/save param", delivery);
Byte currentUserType = UserUtils.getCurrentUserType(); Byte currentUserType = UserUtils.getCurrentUserType();
...@@ -116,7 +116,7 @@ public class DeliveryController extends BaseController { ...@@ -116,7 +116,7 @@ public class DeliveryController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/send", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/send", method = {RequestMethod.POST, RequestMethod.GET})
R send(SysDelivery delivery) { public R send(SysDelivery delivery) {
super.logInfo("==== /delivery/send param", delivery); super.logInfo("==== /delivery/send param", delivery);
delivery.setUserId(UserUtils.getCurrentUserId()); delivery.setUserId(UserUtils.getCurrentUserId());
...@@ -133,7 +133,7 @@ public class DeliveryController extends BaseController { ...@@ -133,7 +133,7 @@ public class DeliveryController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/receive", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/receive", method = {RequestMethod.POST, RequestMethod.GET})
R receive(SysDelivery delivery) { public R receive(SysDelivery delivery) {
super.logInfo("==== /delivery/receive param", delivery); super.logInfo("==== /delivery/receive param", delivery);
delivery.setUserId(UserUtils.getCurrentUserId()); delivery.setUserId(UserUtils.getCurrentUserId());
...@@ -150,7 +150,7 @@ public class DeliveryController extends BaseController { ...@@ -150,7 +150,7 @@ public class DeliveryController extends BaseController {
* @return 结果 * @return 结果
*/ */
@RequestMapping(value = "/cancel", method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = "/cancel", method = {RequestMethod.POST, RequestMethod.GET})
R cancel(SysDelivery delivery) { public R cancel(SysDelivery delivery) {
super.logInfo("==== /delivery/cancel param", delivery); super.logInfo("==== /delivery/cancel param", delivery);
delivery.setUserId(UserUtils.getCurrentUserId()); delivery.setUserId(UserUtils.getCurrentUserId());
......
...@@ -24,13 +24,13 @@ public class CarOrderQueryReq extends PagedReq { ...@@ -24,13 +24,13 @@ public class CarOrderQueryReq extends PagedReq {
*/ */
private Byte userType; private Byte userType;
/** /**
* 是否需要详情
*/
private Boolean needDetail;
/**
* 状态列表,用于不同角色 * 状态列表,用于不同角色
*/ */
private List<Byte> statusList; private List<Byte> statusList;
/**
* 是否需要详情
*/
private Boolean needDetail;
...@@ -53,7 +53,6 @@ public class CarOrderQueryReq extends PagedReq { ...@@ -53,7 +53,6 @@ public class CarOrderQueryReq extends PagedReq {
private Integer orderChannel; private Integer orderChannel;
private String serviceType; private String serviceType;
private String serviceCode; private String serviceCode;
private Boolean detail;
private String vinNo; private String vinNo;
/** /**
* 车主姓名,用于模糊搜索 * 车主姓名,用于模糊搜索
...@@ -73,15 +72,8 @@ public class CarOrderQueryReq extends PagedReq { ...@@ -73,15 +72,8 @@ public class CarOrderQueryReq extends PagedReq {
private String mechanicInfo; private String mechanicInfo;
/**
* v1.4新增 竞价列表
* 订单编号/商户名称 模糊查询
*/
private String conditions;
private Integer subsidy; private Integer subsidy;
private List<Integer> ids;
/** /**
* 车品牌 * 车品牌
*/ */
...@@ -119,14 +111,6 @@ public class CarOrderQueryReq extends PagedReq { ...@@ -119,14 +111,6 @@ public class CarOrderQueryReq extends PagedReq {
this.userType = userType; this.userType = userType;
} }
public Boolean getNeedDetail() {
return needDetail;
}
public void setNeedDetail(Boolean needDetail) {
this.needDetail = needDetail;
}
public List<Byte> getStatusList() { public List<Byte> getStatusList() {
return statusList; return statusList;
} }
...@@ -135,6 +119,14 @@ public class CarOrderQueryReq extends PagedReq { ...@@ -135,6 +119,14 @@ public class CarOrderQueryReq extends PagedReq {
this.statusList = statusList; this.statusList = statusList;
} }
public Boolean getNeedDetail() {
return needDetail;
}
public void setNeedDetail(Boolean needDetail) {
this.needDetail = needDetail;
}
public Integer getId() { public Integer getId() {
return id; return id;
} }
...@@ -191,14 +183,6 @@ public class CarOrderQueryReq extends PagedReq { ...@@ -191,14 +183,6 @@ public class CarOrderQueryReq extends PagedReq {
this.serviceCode = serviceCode; this.serviceCode = serviceCode;
} }
public Boolean getDetail() {
return detail;
}
public void setDetail(Boolean detail) {
this.detail = detail;
}
public String getVinNo() { public String getVinNo() {
return vinNo; return vinNo;
} }
...@@ -287,14 +271,6 @@ public class CarOrderQueryReq extends PagedReq { ...@@ -287,14 +271,6 @@ public class CarOrderQueryReq extends PagedReq {
this.mechanicInfo = mechanicInfo; this.mechanicInfo = mechanicInfo;
} }
public String getConditions() {
return conditions;
}
public void setConditions(String conditions) {
this.conditions = conditions;
}
public Integer getSubsidy() { public Integer getSubsidy() {
return subsidy; return subsidy;
} }
...@@ -303,14 +279,6 @@ public class CarOrderQueryReq extends PagedReq { ...@@ -303,14 +279,6 @@ public class CarOrderQueryReq extends PagedReq {
this.subsidy = subsidy; this.subsidy = subsidy;
} }
public List<Integer> getIds() {
return ids;
}
public void setIds(List<Integer> ids) {
this.ids = ids;
}
public Integer getCarBrand() { public Integer getCarBrand() {
return carBrand; return carBrand;
} }
...@@ -341,8 +309,8 @@ public class CarOrderQueryReq extends PagedReq { ...@@ -341,8 +309,8 @@ public class CarOrderQueryReq extends PagedReq {
"keyword='" + keyword + '\'' + "keyword='" + keyword + '\'' +
", userId=" + userId + ", userId=" + userId +
", userType=" + userType + ", userType=" + userType +
", needDetail=" + needDetail +
", statusList=" + statusList + ", statusList=" + statusList +
", needDetail=" + needDetail +
", id=" + id + ", id=" + id +
", orderSn='" + orderSn + '\'' + ", orderSn='" + orderSn + '\'' +
", status=" + status + ", status=" + status +
...@@ -350,7 +318,6 @@ public class CarOrderQueryReq extends PagedReq { ...@@ -350,7 +318,6 @@ public class CarOrderQueryReq extends PagedReq {
", orderChannel=" + orderChannel + ", orderChannel=" + orderChannel +
", serviceType='" + serviceType + '\'' + ", serviceType='" + serviceType + '\'' +
", serviceCode='" + serviceCode + '\'' + ", serviceCode='" + serviceCode + '\'' +
", detail=" + detail +
", vinNo='" + vinNo + '\'' + ", vinNo='" + vinNo + '\'' +
", carOwner='" + carOwner + '\'' + ", carOwner='" + carOwner + '\'' +
", carOwnerPhone='" + carOwnerPhone + '\'' + ", carOwnerPhone='" + carOwnerPhone + '\'' +
...@@ -362,9 +329,7 @@ public class CarOrderQueryReq extends PagedReq { ...@@ -362,9 +329,7 @@ public class CarOrderQueryReq extends PagedReq {
", reserveInstallTimeEnd='" + reserveInstallTimeEnd + '\'' + ", reserveInstallTimeEnd='" + reserveInstallTimeEnd + '\'' +
", serviceName='" + serviceName + '\'' + ", serviceName='" + serviceName + '\'' +
", mechanicInfo='" + mechanicInfo + '\'' + ", mechanicInfo='" + mechanicInfo + '\'' +
", conditions='" + conditions + '\'' +
", subsidy=" + subsidy + ", subsidy=" + subsidy +
", ids=" + ids +
", carBrand=" + carBrand + ", carBrand=" + carBrand +
", carSeries=" + carSeries + ", carSeries=" + carSeries +
", carType='" + carType + '\'' + ", carType='" + carType + '\'' +
......
...@@ -15,22 +15,25 @@ public class DeliveryQueryReq extends PagedReq { ...@@ -15,22 +15,25 @@ public class DeliveryQueryReq extends PagedReq {
* 关键词 * 关键词
*/ */
private String keyword; private String keyword;
/** /**
* 当前用户ID * 当前用户ID
*/ */
private Integer userId; private Integer userId;
/** /**
* 当前用户类型 * 当前用户类型
*/ */
private Byte userType; private Byte userType;
/**
* 根据权限生成的状态列表
*/
private List<Byte> statusList;
/** /**
* 是否需要详细信息 * 是否需要详细信息
*/ */
private Boolean needDetail = true; private Boolean needDetail = true;
/** /**
* 快递单ID * 快递单ID
*/ */
...@@ -112,11 +115,6 @@ public class DeliveryQueryReq extends PagedReq { ...@@ -112,11 +115,6 @@ public class DeliveryQueryReq extends PagedReq {
private Byte status; private Byte status;
/** /**
* 根据权限生成的状态列表
*/
private List<Byte> statusList;
/**
* 是否取消:0已取消,1未取消 * 是否取消:0已取消,1未取消
*/ */
private Byte canceled; private Byte canceled;
...@@ -150,6 +148,14 @@ public class DeliveryQueryReq extends PagedReq { ...@@ -150,6 +148,14 @@ public class DeliveryQueryReq extends PagedReq {
this.userType = userType; this.userType = userType;
} }
public List<Byte> getStatusList() {
return statusList;
}
public void setStatusList(List<Byte> statusList) {
this.statusList = statusList;
}
public Boolean getNeedDetail() { public Boolean getNeedDetail() {
return needDetail; return needDetail;
} }
...@@ -286,14 +292,6 @@ public class DeliveryQueryReq extends PagedReq { ...@@ -286,14 +292,6 @@ public class DeliveryQueryReq extends PagedReq {
this.status = status; this.status = status;
} }
public List<Byte> getStatusList() {
return statusList;
}
public void setStatusList(List<Byte> statusList) {
this.statusList = statusList;
}
public Byte getCanceled() { public Byte getCanceled() {
return canceled; return canceled;
} }
...@@ -316,6 +314,7 @@ public class DeliveryQueryReq extends PagedReq { ...@@ -316,6 +314,7 @@ public class DeliveryQueryReq extends PagedReq {
"keyword='" + keyword + '\'' + "keyword='" + keyword + '\'' +
", userId=" + userId + ", userId=" + userId +
", userType=" + userType + ", userType=" + userType +
", statusList=" + statusList +
", needDetail=" + needDetail + ", needDetail=" + needDetail +
", id=" + id + ", id=" + id +
", orderId=" + orderId + ", orderId=" + orderId +
...@@ -333,7 +332,6 @@ public class DeliveryQueryReq extends PagedReq { ...@@ -333,7 +332,6 @@ public class DeliveryQueryReq extends PagedReq {
", receiverDistrict=" + receiverDistrict + ", receiverDistrict=" + receiverDistrict +
", receiverAddress='" + receiverAddress + '\'' + ", receiverAddress='" + receiverAddress + '\'' +
", status=" + status + ", status=" + status +
", statusList=" + statusList +
", canceled=" + canceled + ", canceled=" + canceled +
", remark='" + remark + '\'' + ", remark='" + remark + '\'' +
"} " + super.toString(); "} " + super.toString();
......
...@@ -11,6 +11,10 @@ import org.springframework.stereotype.Repository; ...@@ -11,6 +11,10 @@ import org.springframework.stereotype.Repository;
public interface SysCarOrderMapper { public interface SysCarOrderMapper {
List<SysOrder> selectList(CarOrderQueryReq req); List<SysOrder> selectList(CarOrderQueryReq req);
SysOrder selectOne(CarOrderQueryReq req);
long countByExample(SysOrderExample example); long countByExample(SysOrderExample example);
int deleteByExample(SysOrderExample example); int deleteByExample(SysOrderExample example);
......
...@@ -8,6 +8,10 @@ import org.springframework.stereotype.Repository; ...@@ -8,6 +8,10 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface SysDeliveryFileMapper { public interface SysDeliveryFileMapper {
List<SysDeliveryFile> selectByDeliveryId(@Param("deliveryId") Integer deliveryId);
long countByExample(SysDeliveryFileExample example); long countByExample(SysDeliveryFileExample example);
int deleteByExample(SysDeliveryFileExample example); int deleteByExample(SysDeliveryFileExample example);
...@@ -24,9 +28,11 @@ public interface SysDeliveryFileMapper { ...@@ -24,9 +28,11 @@ public interface SysDeliveryFileMapper {
SysDeliveryFile selectByPrimaryKey(Integer id); SysDeliveryFile selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysDeliveryFile record, @Param("example") SysDeliveryFileExample example); int updateByExampleSelective(@Param("record") SysDeliveryFile record,
@Param("example") SysDeliveryFileExample example);
int updateByExample(@Param("record") SysDeliveryFile record, @Param("example") SysDeliveryFileExample example); int updateByExample(@Param("record") SysDeliveryFile record,
@Param("example") SysDeliveryFileExample example);
int updateByPrimaryKeySelective(SysDeliveryFile record); int updateByPrimaryKeySelective(SysDeliveryFile record);
......
...@@ -11,7 +11,9 @@ import org.springframework.stereotype.Repository; ...@@ -11,7 +11,9 @@ import org.springframework.stereotype.Repository;
public interface SysDeliveryMapper { public interface SysDeliveryMapper {
List<SysDelivery> selectList(DeliveryQueryReq req); List<SysDelivery> selectList(DeliveryQueryReq req);
SysDelivery selectOneByUserId(DeliveryQueryReq req); SysDelivery selectOne(DeliveryQueryReq req);
long countByExample(SysDeliveryExample example); long countByExample(SysDeliveryExample example);
......
package com.glsx.ordercenter.mapper; package com.glsx.ordercenter.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.glsx.ordercenter.pojo.SysOrderFile; import com.glsx.ordercenter.pojo.SysOrderFile;
import org.apache.ibatis.annotations.Param;
public interface SysOrderFileMapper { public interface SysOrderFileMapper {
...@@ -42,4 +40,6 @@ public interface SysOrderFileMapper { ...@@ -42,4 +40,6 @@ public interface SysOrderFileMapper {
List<SysOrderFile> selectByOrderId(@Param("orderId") Integer orderId); List<SysOrderFile> selectByOrderId(@Param("orderId") Integer orderId);
List<SysOrderFile> selectOrderFile(@Param("orderId") Integer orderId,@Param("sort") Integer sort); List<SysOrderFile> selectOrderFile(@Param("orderId") Integer orderId,@Param("sort") Integer sort);
List<SysOrderFile> selectListByRecord(SysOrderFile orderFile);
} }
...@@ -8,6 +8,10 @@ import org.springframework.stereotype.Repository; ...@@ -8,6 +8,10 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface SysOrderMaterialMapper { public interface SysOrderMaterialMapper {
List<SysOrderMaterial> selectByOrderId(Integer orderId);
long countByExample(SysOrderMaterialExample example); long countByExample(SysOrderMaterialExample example);
int deleteByExample(SysOrderMaterialExample example); int deleteByExample(SysOrderMaterialExample example);
......
package com.glsx.ordercenter.mapper; package com.glsx.ordercenter.mapper;
import java.util.List; import java.util.List;
import com.glsx.ordercenter.dto.req.SubOrderQueryReq;
import com.glsx.ordercenter.pojo.SysSubOrder; import com.glsx.ordercenter.pojo.SysSubOrder;
import com.glsx.ordercenter.pojo.SysSubOrderExample; import com.glsx.ordercenter.pojo.SysSubOrderExample;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -8,6 +9,14 @@ import org.springframework.stereotype.Repository; ...@@ -8,6 +9,14 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface SysSubOrderMapper { public interface SysSubOrderMapper {
List<SysSubOrder> selectList(SubOrderQueryReq req);
SysSubOrder selectOne(SubOrderQueryReq req);
List<SysSubOrder> selectByOrderId(@Param("orderId") Integer orderId);
long countByExample(SysSubOrderExample example); long countByExample(SysSubOrderExample example);
int deleteByExample(SysSubOrderExample example); int deleteByExample(SysSubOrderExample example);
......
...@@ -19,6 +19,10 @@ public class SysDelivery implements Serializable { ...@@ -19,6 +19,10 @@ public class SysDelivery implements Serializable {
*/ */
private Byte userType; private Byte userType;
/** /**
* 收寄件类型:1寄件单,2收件单
*/
private Byte sendOrReceive;
/**
* 寄件人角色 * 寄件人角色
*/ */
private String senderType; private String senderType;
...@@ -169,6 +173,14 @@ public class SysDelivery implements Serializable { ...@@ -169,6 +173,14 @@ public class SysDelivery implements Serializable {
this.userType = userType; this.userType = userType;
} }
public Byte getSendOrReceive() {
return sendOrReceive;
}
public void setSendOrReceive(Byte sendOrReceive) {
this.sendOrReceive = sendOrReceive;
}
public String getSenderType() { public String getSenderType() {
return senderType; return senderType;
} }
...@@ -391,6 +403,7 @@ public class SysDelivery implements Serializable { ...@@ -391,6 +403,7 @@ public class SysDelivery implements Serializable {
return "SysDelivery{" + return "SysDelivery{" +
"userId=" + userId + "userId=" + userId +
", userType=" + userType + ", userType=" + userType +
", sendOrReceive=" + sendOrReceive +
", senderType='" + senderType + '\'' + ", senderType='" + senderType + '\'' +
", senderDistrictInfo=" + senderDistrictInfo + ", senderDistrictInfo=" + senderDistrictInfo +
", receiverType='" + receiverType + '\'' + ", receiverType='" + receiverType + '\'' +
......
...@@ -47,12 +47,20 @@ public class SysOrderFile { ...@@ -47,12 +47,20 @@ public class SysOrderFile {
this.subOrderId = subOrderId; this.subOrderId = subOrderId;
} }
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFilePath() { public String getFilePath() {
return filePath; return filePath;
} }
public void setFilePath(String filePath) { public void setFilePath(String filePath) {
this.filePath = filePath == null ? null : filePath.trim(); this.filePath = filePath;
} }
public Integer getFileType() { public Integer getFileType() {
...@@ -63,20 +71,12 @@ public class SysOrderFile { ...@@ -63,20 +71,12 @@ public class SysOrderFile {
this.fileType = fileType; this.fileType = fileType;
} }
public Integer getCreateBy() { public String getFileDesc() {
return createBy; return fileDesc;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
} }
public void setCreateTime(Date createTime) { public void setFileDesc(String fileDesc) {
this.createTime = createTime; this.fileDesc = fileDesc;
} }
public Integer getSort() { public Integer getSort() {
...@@ -87,20 +87,35 @@ public class SysOrderFile { ...@@ -87,20 +87,35 @@ public class SysOrderFile {
this.sort = sort; this.sort = sort;
} }
public String getFileName() { public Integer getCreateBy() {
return fileName; return createBy;
} }
public void setFileName(String fileName) { public void setCreateBy(Integer createBy) {
this.fileName = fileName; this.createBy = createBy;
} }
public String getFileDesc() { public Date getCreateTime() {
return fileDesc; return createTime;
} }
public void setFileDesc(String fileDesc) { public void setCreateTime(Date createTime) {
this.fileDesc = fileDesc; this.createTime = createTime;
} }
@Override
public String toString() {
return "SysOrderFile{" +
"id=" + id +
", orderId=" + orderId +
", subOrderId=" + subOrderId +
", fileName='" + fileName + '\'' +
", filePath='" + filePath + '\'' +
", fileType=" + fileType +
", fileDesc='" + fileDesc + '\'' +
", sort=" + sort +
", createBy=" + createBy +
", createTime=" + createTime +
'}';
}
} }
...@@ -53,7 +53,7 @@ public class SysSubOrder implements Serializable { ...@@ -53,7 +53,7 @@ public class SysSubOrder implements Serializable {
private Byte status; private Byte status;
/** /**
* 安装备注 * 办理备注
*/ */
private String remark; private String remark;
......
package com.glsx.ordercenter.service; package com.glsx.ordercenter.service;
import java.util.List;
import java.util.Map;
import com.glsx.common.pojo.PagedResp; import com.glsx.common.pojo.PagedResp;
import com.glsx.ordercenter.dto.OrderDeviceReq; import com.glsx.ordercenter.dto.OrderDeviceReq;
import com.glsx.ordercenter.dto.req.CarOrderQueryReq; import com.glsx.ordercenter.dto.req.CarOrderQueryReq;
...@@ -8,8 +10,6 @@ import com.glsx.ordercenter.pojo.SysOrder; ...@@ -8,8 +10,6 @@ import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysSubOrder; import com.glsx.ordercenter.pojo.SysSubOrder;
import com.glsx.plat.core.web.R; import com.glsx.plat.core.web.R;
import java.util.Map;
/** /**
* <p>Description: 车务单业务 * <p>Description: 车务单业务
* *
...@@ -21,7 +21,7 @@ import java.util.Map; ...@@ -21,7 +21,7 @@ import java.util.Map;
public interface CarOrderService { public interface CarOrderService {
Map<String, Integer> countByStatus(CarOrderQueryReq req); Map<String, Integer> countByStatus(CarOrderQueryReq req);
Map<String, Integer> countByServiceItem(CarOrderQueryReq req); List<Map<String, Object>> countByServiceItem(CarOrderQueryReq req);
PagedResp<SysOrder> getList(CarOrderQueryReq req); PagedResp<SysOrder> getList(CarOrderQueryReq req);
......
package com.glsx.ordercenter.service.impl; package com.glsx.ordercenter.service.impl;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.UUID;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -10,22 +23,126 @@ import com.glsx.common.constants.ResultObject; ...@@ -10,22 +23,126 @@ import com.glsx.common.constants.ResultObject;
import com.glsx.common.feign.client.UserClient; import com.glsx.common.feign.client.UserClient;
import com.glsx.common.pojo.OderReceivingReq; import com.glsx.common.pojo.OderReceivingReq;
import com.glsx.common.pojo.SysOrderWechatMsg; import com.glsx.common.pojo.SysOrderWechatMsg;
import com.glsx.common.utils.*; import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.HttpUtils;
import com.glsx.common.utils.Page;
import com.glsx.common.utils.PropertiesUtil;
import com.glsx.common.utils.RedisCacheUtil;
import com.glsx.common.utils.StringUtils;
import com.glsx.common.utils.UserUtils;
import com.glsx.common.utils.bean.BeanUtils; import com.glsx.common.utils.bean.BeanUtils;
import com.glsx.common.utils.wehcat.MiniProgram; import com.glsx.common.utils.wehcat.MiniProgram;
import com.glsx.common.utils.wehcat.TemplateData; import com.glsx.common.utils.wehcat.TemplateData;
import com.glsx.common.utils.wehcat.WechatTemplate; import com.glsx.common.utils.wehcat.WechatTemplate;
import com.glsx.common.utils.wehcat.WechatUtils; import com.glsx.common.utils.wehcat.WechatUtils;
import com.glsx.ordercenter.config.ThreadPoolConfig; import com.glsx.ordercenter.config.ThreadPoolConfig;
import com.glsx.ordercenter.constants.*; import com.glsx.ordercenter.constants.BizConstants;
import com.glsx.ordercenter.dto.*; import com.glsx.ordercenter.constants.CarOcrStatusEnum;
import com.glsx.ordercenter.constants.DeviceVerifyStrategyEnum;
import com.glsx.ordercenter.constants.IndentStatusEnum;
import com.glsx.ordercenter.constants.OrderActiveStatusEnum;
import com.glsx.ordercenter.constants.OrderFileTypeEnum;
import com.glsx.ordercenter.constants.OrderSyncStrategyEnum;
import com.glsx.ordercenter.constants.OrderTypeEnum;
import com.glsx.ordercenter.constants.ReconciliationStatusEnum;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.constants.SubOrderStatusEnum;
import com.glsx.ordercenter.dto.BizAmountResp;
import com.glsx.ordercenter.dto.CarInfo;
import com.glsx.ordercenter.dto.CreateAfterSaleRepairReq;
import com.glsx.ordercenter.dto.FinishedOrders;
import com.glsx.ordercenter.dto.MachanicInfo;
import com.glsx.ordercenter.dto.MechanicBusiness;
import com.glsx.ordercenter.dto.MerchantInfo;
import com.glsx.ordercenter.dto.OrderActivateReq;
import com.glsx.ordercenter.dto.OrderDeviceReq;
import com.glsx.ordercenter.dto.OrderRepairReq;
import com.glsx.ordercenter.dto.OrderStastic;
import com.glsx.ordercenter.dto.OrderSubSidyInfo;
import com.glsx.ordercenter.dto.QueryOrderReq;
import com.glsx.ordercenter.dto.ReconciliationDetailQuery;
import com.glsx.ordercenter.dto.ServiceInfo;
import com.glsx.ordercenter.dto.ServiceItemInfo;
import com.glsx.ordercenter.dto.ServiceItemScale;
import com.glsx.ordercenter.dto.ShopBizAmount;
import com.glsx.ordercenter.dto.SubOrders;
import com.glsx.ordercenter.dto.UnfinishedOrders;
import com.glsx.ordercenter.dto.WorkOrderNode;
import com.glsx.ordercenter.dto.req.SaveOrderSubsidyInfoReq; import com.glsx.ordercenter.dto.req.SaveOrderSubsidyInfoReq;
import com.glsx.ordercenter.exception.BusinessException; import com.glsx.ordercenter.exception.BusinessException;
import com.glsx.ordercenter.mapper.*; import com.glsx.ordercenter.mapper.DictionaryDataMapper;
import com.glsx.ordercenter.pojo.*; import com.glsx.ordercenter.mapper.SysCarOcrMapper;
import com.glsx.ordercenter.mapper.SysChannelOrgMapper;
import com.glsx.ordercenter.mapper.SysDeviceConsumeLogMapper;
import com.glsx.ordercenter.mapper.SysDeviceMapper;
import com.glsx.ordercenter.mapper.SysDeviceRepertoryMapper;
import com.glsx.ordercenter.mapper.SysIndentMapper;
import com.glsx.ordercenter.mapper.SysManagerMapper;
import com.glsx.ordercenter.mapper.SysMechanicMapper;
import com.glsx.ordercenter.mapper.SysMerchantMapper;
import com.glsx.ordercenter.mapper.SysOperationAdvanceMapper;
import com.glsx.ordercenter.mapper.SysOrderBiddingRecordsMapper;
import com.glsx.ordercenter.mapper.SysOrderDeviceMapper;
import com.glsx.ordercenter.mapper.SysOrderDeviceSupplierMapper;
import com.glsx.ordercenter.mapper.SysOrderFileMapper;
import com.glsx.ordercenter.mapper.SysOrderLabelMapper;
import com.glsx.ordercenter.mapper.SysOrderMapper;
import com.glsx.ordercenter.mapper.SysOrderRepairMapper;
import com.glsx.ordercenter.mapper.SysOrderServiceTypeMapper;
import com.glsx.ordercenter.mapper.SysOrderStatusMapper;
import com.glsx.ordercenter.mapper.SysOrderSubsidyMapper;
import com.glsx.ordercenter.mapper.SysOrderWechatMsgMapper;
import com.glsx.ordercenter.mapper.SysOrganizationMapper;
import com.glsx.ordercenter.mapper.SysReconciliationDetailMapper;
import com.glsx.ordercenter.mapper.SysReconciliationMapper;
import com.glsx.ordercenter.mapper.SysServiceItemDeviceConfigMapper;
import com.glsx.ordercenter.mapper.SysServiceItemMapper;
import com.glsx.ordercenter.mapper.SysServiceItemPhotoConfigMapper;
import com.glsx.ordercenter.mapper.SysSubOrderMapper;
import com.glsx.ordercenter.mapper.SysUserMapper;
import com.glsx.ordercenter.pojo.OrderOnHand;
import com.glsx.ordercenter.pojo.SysCarOcr;
import com.glsx.ordercenter.pojo.SysChannelOrg;
import com.glsx.ordercenter.pojo.SysDevice;
import com.glsx.ordercenter.pojo.SysDeviceConsumeLog;
import com.glsx.ordercenter.pojo.SysDeviceExample;
import com.glsx.ordercenter.pojo.SysDeviceRepertory;
import com.glsx.ordercenter.pojo.SysDeviceRepertoryExample;
import com.glsx.ordercenter.pojo.SysIndent;
import com.glsx.ordercenter.pojo.SysOperationAdvance;
import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysOrderBiddingRecords;
import com.glsx.ordercenter.pojo.SysOrderBiddingRecordsExample;
import com.glsx.ordercenter.pojo.SysOrderDevice;
import com.glsx.ordercenter.pojo.SysOrderDeviceSupplier;
import com.glsx.ordercenter.pojo.SysOrderExample;
import com.glsx.ordercenter.pojo.SysOrderExample.Criteria; import com.glsx.ordercenter.pojo.SysOrderExample.Criteria;
import com.glsx.ordercenter.pojo.user.*; import com.glsx.ordercenter.pojo.SysOrderFile;
import com.glsx.ordercenter.service.*; import com.glsx.ordercenter.pojo.SysOrderRepair;
import com.glsx.ordercenter.pojo.SysOrderRepairExample;
import com.glsx.ordercenter.pojo.SysOrderServiceType;
import com.glsx.ordercenter.pojo.SysOrderStatus;
import com.glsx.ordercenter.pojo.SysOrderSubsidy;
import com.glsx.ordercenter.pojo.SysOrganization;
import com.glsx.ordercenter.pojo.SysReconciliation;
import com.glsx.ordercenter.pojo.SysReconciliationDetail;
import com.glsx.ordercenter.pojo.SysReserveInstallLog;
import com.glsx.ordercenter.pojo.SysServiceItem;
import com.glsx.ordercenter.pojo.SysServiceItemDeviceConfig;
import com.glsx.ordercenter.pojo.SysServiceItemPhotoConfig;
import com.glsx.ordercenter.pojo.SysSubOrderExample;
import com.glsx.ordercenter.pojo.SysUserOrder;
import com.glsx.ordercenter.pojo.user.SysManager;
import com.glsx.ordercenter.pojo.user.SysMechanic;
import com.glsx.ordercenter.pojo.user.SysMechanicExample;
import com.glsx.ordercenter.pojo.user.SysMerchantExample;
import com.glsx.ordercenter.pojo.user.SysUser;
import com.glsx.ordercenter.pojo.user.SysUserExample;
import com.glsx.ordercenter.service.DeviceRepertoryService;
import com.glsx.ordercenter.service.IAreaService;
import com.glsx.ordercenter.service.IOrderChannelService;
import com.glsx.ordercenter.service.IOrderService;
import com.glsx.ordercenter.service.ReserveInstallLogService;
import com.glsx.ordercenter.strategy.DeviceVerifyStrategy; import com.glsx.ordercenter.strategy.DeviceVerifyStrategy;
import com.glsx.ordercenter.strategy.OrderSyncStrategy; import com.glsx.ordercenter.strategy.OrderSyncStrategy;
import com.glsx.ordercenter.utils.OrderUtil; import com.glsx.ordercenter.utils.OrderUtil;
...@@ -38,14 +155,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -38,14 +155,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
/** /**
* @author Zheng Xiajun * @author Zheng Xiajun
* @ClassName: OrderServiceImpl * @ClassName: OrderServiceImpl
...@@ -1227,8 +1336,8 @@ public class OrderServiceImpl implements IOrderService { ...@@ -1227,8 +1336,8 @@ public class OrderServiceImpl implements IOrderService {
SysOrderRepairExample orderRepairExample = new SysOrderRepairExample(); SysOrderRepairExample orderRepairExample = new SysOrderRepairExample();
orderRepairExample.createCriteria().andOrderIdEqualTo(sysOrder.getId()); orderRepairExample.createCriteria().andOrderIdEqualTo(sysOrder.getId());
List<SysOrderRepair> list = orderRepairMapper.selectByExample(orderRepairExample); List<SysOrderRepair> list = orderRepairMapper.selectByExample(orderRepairExample);
sysOrder.setIsApplyAfterSale(false); sysOrder.setAppliedAfterSale(false);
sysOrder.setIsDismantle(false); sysOrder.setDismantleOrder(false);
for (SysOrderRepair sysOrderRepair : list) { for (SysOrderRepair sysOrderRepair : list) {
List<Integer> ids = new ArrayList<>(); List<Integer> ids = new ArrayList<>();
ids.add(sysOrderRepair.getSubOrderId()); ids.add(sysOrderRepair.getSubOrderId());
...@@ -1238,7 +1347,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -1238,7 +1347,7 @@ public class OrderServiceImpl implements IOrderService {
.andOrderTypeNotEqualTo((byte) 1).andCanceledEqualTo((byte) 1); .andOrderTypeNotEqualTo((byte) 1).andCanceledEqualTo((byte) 1);
long count = orderMapper.countByExample(orderExample); long count = orderMapper.countByExample(orderExample);
if (count > 0) { if (count > 0) {
sysOrder.setIsApplyAfterSale(true); sysOrder.setAppliedAfterSale(true);
} }
orderExample.clear(); orderExample.clear();
// 已完成的检修单 // 已完成的检修单
...@@ -1246,7 +1355,7 @@ public class OrderServiceImpl implements IOrderService { ...@@ -1246,7 +1355,7 @@ public class OrderServiceImpl implements IOrderService {
.andOrderTypeEqualTo((byte) 2).andIdIn(ids); .andOrderTypeEqualTo((byte) 2).andIdIn(ids);
count = orderMapper.countByExample(orderExample); count = orderMapper.countByExample(orderExample);
if (count > 0) { if (count > 0) {
sysOrder.setIsDismantle(true); sysOrder.setDismantleOrder(true);
} }
} }
} }
......
...@@ -45,7 +45,12 @@ public class LogUtils { ...@@ -45,7 +45,12 @@ public class LogUtils {
String content; String content;
for (Object param : params) { for (Object param : params) {
contentSb.append(JSON.toJSONString(param)).append("; "); if (param instanceof String) {
contentSb.append(param);
} else {
contentSb.append(JSON.toJSONString(param));
}
contentSb.append("; ");
} }
content = contentSb.toString(); content = contentSb.toString();
......
...@@ -70,18 +70,21 @@ ...@@ -70,18 +70,21 @@
<result column="install_mode" jdbcType="TINYINT" property="installMode"/> <result column="install_mode" jdbcType="TINYINT" property="installMode"/>
<result column="receive_time" jdbcType="TIMESTAMP" property="receiveTime"/> <result column="receive_time" jdbcType="TIMESTAMP" property="receiveTime"/>
<result column="shopName" jdbcType="VARCHAR" property="merchantName"/> <result column="shopName" jdbcType="VARCHAR" property="merchantName"/>
<result column="spName" jdbcType="VARCHAR" property="serviceName"/> <result column="providerName" jdbcType="VARCHAR" property="serviceName"/>
<association property="machanicInfo" javaType="com.glsx.ordercenter.dto.MachanicInfo"> <association property="machanicInfo" javaType="com.glsx.ordercenter.dto.MachanicInfo">
<id column="mechanicId" property="id"/> <id column="mechanicId" property="id"/>
<result column="mechanicName" property="name"/> <result column="mechanicName" property="name"/>
<result column="mechanicPhone" property="phone"/> <result column="mechanicPhone" property="phone"/>
</association> </association>
<association property="subOrderCount" javaType="integer" <!--<association property="subOrderCount" javaType="integer"-->
select="selectSubOrderCount" column="id"/> <!-- select="selectSubOrderCount" column="id"/>-->
<association property="finishedCount" javaType="integer" <!--<association property="finishedCount" javaType="integer"-->
select="selectFinishedSubOrderCount" column="id"/> <!-- select="selectFinishedSubOrderCount" column="id"/>-->
<collection property="subOrderList" ofType="com.glsx.ordercenter.pojo.SysSubOrder" <!--<association property="orderMaterial" javaType="com.glsx.ordercenter.pojo.SysOrderMaterial"-->
select="selectSubOrderList" column="id"/> <!-- select="com.glsx.ordercenter.mapper.SysOrderMaterialMapper.selectByPrimaryKey"-->
<!-- column="id"/>-->
<!--<collection property="subOrderList" ofType="com.glsx.ordercenter.pojo.SysSubOrder"-->
<!-- select="selectSubOrderList" column="id"/>-->
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
...@@ -200,17 +203,14 @@ ...@@ -200,17 +203,14 @@
so.quote_last_time, so.reference_price, so.service_code, so.settlement_status, so.quote_last_time, so.reference_price, so.service_code, so.settlement_status,
so.install_mode, so.receive_time, so.install_mode, so.receive_time,
<!-- 服务商信息 --> <!-- 服务商信息 -->
tSp.user_id spId, tSp.provider_name spName, tProvider.user_id providerId, tProvider.provider_name providerName,
<!-- 商户信息 --> <!-- 商户信息 -->
tMerchant.user_id shopId, tMerchant.shop_name shopName, tMerchant.user_id shopId, ifnull(tMerchant.shop_name,so.merchant_name) shopName,
<!-- 技工信息 --> <!-- 技工信息 -->
tMechanic.id mechanicId, tMechanic.name mechanicName, tMechanic.phone_number mechanicPhone tMechanic.id mechanicId, tMechanic.name mechanicName, tMechanic.phone_number mechanicPhone
from sys_order so from sys_order so
<!-- 服务商表 --> left join sys_manager tProvider on so.merchant_id = tProvider.user_id
left join sys_manager tSp on so.merchant_id = tSp.user_id
<!-- 商户表 -->
left join sys_merchant tMerchant on so.shop_id = tMerchant.user_id left join sys_merchant tMerchant on so.shop_id = tMerchant.user_id
<!-- 技工表 -->
left join sys_user tMechanic on so.mechanic_id = tMechanic.id left join sys_user tMechanic on so.mechanic_id = tMechanic.id
<where> <where>
<choose> <choose>
...@@ -226,7 +226,10 @@ ...@@ -226,7 +226,10 @@
<if test="keyword != null and keyword != ''"> <if test="keyword != null and keyword != ''">
and (so.contact like "%"#{keyword,jdbcType=VARCHAR}"%" and (so.contact like "%"#{keyword,jdbcType=VARCHAR}"%"
or so.phone_number like "%"#{keyword,jdbcType=VARCHAR}"%" or so.phone_number like "%"#{keyword,jdbcType=VARCHAR}"%"
) or so.work_order_no like "%"#{keyword,jdbcType=VARCHAR}"%"
or shopName like "%"#{keyword,jdbcType=VARCHAR}"%"
or mechanicName like "%"#{keyword,jdbcType=VARCHAR}"%"
or mechanicPhone like "%"#{keyword,jdbcType=VARCHAR}"%")
</if> </if>
<if test="statusList != null and statusList.size() != 0"> <if test="statusList != null and statusList.size() != 0">
and so.active_status in and so.active_status in
...@@ -234,6 +237,9 @@ ...@@ -234,6 +237,9 @@
#{item,jdbcType=TINYINT} #{item,jdbcType=TINYINT}
</foreach> </foreach>
</if> </if>
<if test="serviceCode != null and serviceCode != ''">
and so.service_code = #{serviceCode,jdbcType=VARCHAR}
</if>
<!-- 不查找已删除的 --> <!-- 不查找已删除的 -->
and so.active_status != 9 and so.active_status != 9
and so.canceled = #{canceled,jdbcType=TINYINT} and so.canceled = #{canceled,jdbcType=TINYINT}
...@@ -242,6 +248,53 @@ ...@@ -242,6 +248,53 @@
</where> </where>
</select> </select>
<select id="selectOne" parameterType="com.glsx.ordercenter.dto.req.CarOrderQueryReq"
resultMap="BaseResultMap">
select so.id, so.order_sn, so.active_status, so.canceled, so.order_type, so.shop_id,
so.district, so.address, so.contact, so.phone_number, so.car_brand, so.car_series,
so.car_type, so.vin_no, so.car_color, so.expect_install_time, so.service_type,
so.car_owner, so.car_owner_phone, so.cancel_time, so.active_status_array, so.merchant_id,
so.mechanic_id, so.repair_reason, so.remark, so.create_time, so.update_time, so.create_by,
so.update_by, so.device_no, so.install_location, so.overdue_reason, so.repair_type,
so.car_picture, so.vin_no_picture, so.install_location_picture, so.complete_time,
so.install_remark, so.install_device_type, so.reserve_install_time, so.work_order_no,
so.work_order_number, so.channel, so.merchant_name, so.reassign_mechanic_time,
so.reserve_install_reason, so.connect_location_picture, so.surrounding_picture,
so.reserve_man, so.reserve_man_phone, so.is_check_in, so.overdue_remark,
so.mechanic_address, so.check_in_time, so.check_in_address, so.longitude, so.latitude,
so.quote_last_time, so.reference_price, so.service_code, so.settlement_status,
so.install_mode, so.receive_time,
<!-- 服务商信息 -->
tProvider.user_id providerId, tProvider.provider_name providerName,
<!-- 商户信息 -->
tMerchant.user_id shopId, ifnull(tMerchant.shop_name,so.merchant_name) shopName,
<!-- 技工信息 -->
tMechanic.id mechanicId, tMechanic.name mechanicName, tMechanic.phone_number mechanicPhone
from sys_order so
left join sys_manager tProvider on so.merchant_id = tProvider.user_id
left join sys_merchant tMerchant on so.shop_id = tMerchant.user_id
left join sys_user tMechanic on so.mechanic_id = tMechanic.id
<where>
<choose>
<when test="userType == 1">
<!-- 服务商,查找指派给自己的订单 -->
and so.merchant_id = #{userId,jdbcType=INTEGER}
</when>
<when test="userType == 2">
<!-- 商户,查找自己发起的订单 -->
and so.shop_id = #{userId,jdbcType=INTEGER}
</when>
</choose>
and so.id = #{id}
<!-- 不查找已删除的 -->
and so.active_status != 9
<!-- 只查找车务单 -->
and so.order_type = 6
</where>
</select>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderExample" <select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderExample"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select select
...@@ -302,7 +355,7 @@ ...@@ -302,7 +355,7 @@
overdue_remark, mechanic_address, check_in_time, overdue_remark, mechanic_address, check_in_time,
check_in_address, longitude, latitude, check_in_address, longitude, latitude,
quote_last_time, reference_price, service_code, quote_last_time, reference_price, service_code,
settlement_status, install_mode, receive_time) install_mode, receive_time)
values (#{orderSn,jdbcType=VARCHAR}, #{activeStatus,jdbcType=TINYINT}, values (#{orderSn,jdbcType=VARCHAR}, #{activeStatus,jdbcType=TINYINT},
#{canceled,jdbcType=TINYINT}, #{canceled,jdbcType=TINYINT},
#{orderType,jdbcType=TINYINT}, #{shopId,jdbcType=INTEGER}, #{orderType,jdbcType=TINYINT}, #{shopId,jdbcType=INTEGER},
...@@ -342,7 +395,6 @@ ...@@ -342,7 +395,6 @@
#{latitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR},
#{quoteLastTime,jdbcType=TIMESTAMP}, #{referencePrice,jdbcType=DECIMAL}, #{quoteLastTime,jdbcType=TIMESTAMP}, #{referencePrice,jdbcType=DECIMAL},
#{serviceCode,jdbcType=VARCHAR}, #{serviceCode,jdbcType=VARCHAR},
#{settlementStatus,jdbcType=INTEGER}, #{installMode,jdbcType=TINYINT},
#{receiveTime,jdbcType=TIMESTAMP}) #{receiveTime,jdbcType=TIMESTAMP})
</insert> </insert>
...@@ -530,9 +582,6 @@ ...@@ -530,9 +582,6 @@
<if test="serviceCode != null"> <if test="serviceCode != null">
service_code, service_code,
</if> </if>
<if test="settlementStatus != null">
settlement_status,
</if>
<if test="installMode != null"> <if test="installMode != null">
install_mode, install_mode,
</if> </if>
...@@ -718,9 +767,6 @@ ...@@ -718,9 +767,6 @@
<if test="serviceCode != null"> <if test="serviceCode != null">
#{serviceCode,jdbcType=VARCHAR}, #{serviceCode,jdbcType=VARCHAR},
</if> </if>
<if test="settlementStatus != null">
#{settlementStatus,jdbcType=INTEGER},
</if>
<if test="installMode != null"> <if test="installMode != null">
#{installMode,jdbcType=TINYINT}, #{installMode,jdbcType=TINYINT},
</if> </if>
...@@ -921,9 +967,6 @@ ...@@ -921,9 +967,6 @@
<if test="record.serviceCode != null"> <if test="record.serviceCode != null">
service_code = #{record.serviceCode,jdbcType=VARCHAR}, service_code = #{record.serviceCode,jdbcType=VARCHAR},
</if> </if>
<if test="record.settlementStatus != null">
settlement_status = #{record.settlementStatus,jdbcType=INTEGER},
</if>
<if test="record.installMode != null"> <if test="record.installMode != null">
install_mode = #{record.installMode,jdbcType=TINYINT}, install_mode = #{record.installMode,jdbcType=TINYINT},
</if> </if>
...@@ -998,7 +1041,6 @@ ...@@ -998,7 +1041,6 @@
quote_last_time = #{record.quoteLastTime,jdbcType=TIMESTAMP}, quote_last_time = #{record.quoteLastTime,jdbcType=TIMESTAMP},
reference_price = #{record.referencePrice,jdbcType=DECIMAL}, reference_price = #{record.referencePrice,jdbcType=DECIMAL},
service_code = #{record.serviceCode,jdbcType=VARCHAR}, service_code = #{record.serviceCode,jdbcType=VARCHAR},
settlement_status = #{record.settlementStatus,jdbcType=INTEGER},
install_mode = #{record.installMode,jdbcType=TINYINT}, install_mode = #{record.installMode,jdbcType=TINYINT},
receive_time = #{record.receiveTime,jdbcType=TIMESTAMP} receive_time = #{record.receiveTime,jdbcType=TIMESTAMP}
<if test="_parameter != null"> <if test="_parameter != null">
...@@ -1186,9 +1228,6 @@ ...@@ -1186,9 +1228,6 @@
<if test="serviceCode != null"> <if test="serviceCode != null">
service_code = #{serviceCode,jdbcType=VARCHAR}, service_code = #{serviceCode,jdbcType=VARCHAR},
</if> </if>
<if test="settlementStatus != null">
settlement_status = #{settlementStatus,jdbcType=INTEGER},
</if>
<if test="installMode != null"> <if test="installMode != null">
install_mode = #{installMode,jdbcType=TINYINT}, install_mode = #{installMode,jdbcType=TINYINT},
</if> </if>
...@@ -1260,7 +1299,6 @@ ...@@ -1260,7 +1299,6 @@
quote_last_time = #{quoteLastTime,jdbcType=TIMESTAMP}, quote_last_time = #{quoteLastTime,jdbcType=TIMESTAMP},
reference_price = #{referencePrice,jdbcType=DECIMAL}, reference_price = #{referencePrice,jdbcType=DECIMAL},
service_code = #{serviceCode,jdbcType=VARCHAR}, service_code = #{serviceCode,jdbcType=VARCHAR},
settlement_status = #{settlementStatus,jdbcType=INTEGER},
install_mode = #{installMode,jdbcType=TINYINT}, install_mode = #{installMode,jdbcType=TINYINT},
receive_time = #{receiveTime,jdbcType=TIMESTAMP} receive_time = #{receiveTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
......
...@@ -77,6 +77,15 @@ ...@@ -77,6 +77,15 @@
id, delivery_id, file_path, remark id, delivery_id, file_path, remark
</sql> </sql>
<select id="selectByDeliveryId" parameterType="integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from sys_delivery_file
where delivery_id = #{deliveryId,jdbcType=INTEGER}
</select>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysDeliveryFileExample" <select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysDeliveryFileExample"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select select
......
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
</where> </where>
</select> </select>
<select id="selectOneByUserId" parameterType="com.glsx.ordercenter.dto.req.DeliveryQueryReq" <select id="selectOne" parameterType="com.glsx.ordercenter.dto.req.DeliveryQueryReq"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
......
...@@ -32,11 +32,12 @@ ...@@ -32,11 +32,12 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into sys_order_file (order_id, file_path, file_type, insert into sys_order_file (order_id, sub_order_id, file_path, file_type,
sort, create_by, create_time sort, create_by, create_time)
) values (#{orderId,jdbcType=INTEGER}, #{subOrderId,jdbcType=INTEGER},
values (#{orderId,jdbcType=INTEGER}, #{filePath,jdbcType=VARCHAR}, #{fileType,jdbcType=TINYINT}, #{filePath,jdbcType=VARCHAR}, #{fileType,jdbcType=TINYINT},
#{sort,jdbcType=TINYINT}, #{createBy,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP} #{sort,jdbcType=TINYINT}, #{createBy,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}
) )
</insert> </insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysOrderFile"> <insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysOrderFile">
...@@ -48,6 +49,9 @@ ...@@ -48,6 +49,9 @@
<if test="orderId != null"> <if test="orderId != null">
order_id, order_id,
</if> </if>
<if test="subOrderId != null">
sub_order_id,
</if>
<if test="fileName != null"> <if test="fileName != null">
file_name, file_name,
</if> </if>
...@@ -74,6 +78,9 @@ ...@@ -74,6 +78,9 @@
<if test="orderId != null"> <if test="orderId != null">
#{orderId,jdbcType=INTEGER}, #{orderId,jdbcType=INTEGER},
</if> </if>
<if test="subOrderId != null">
#{subOrderId,jdbcType=INTEGER},
</if>
<if test="fileName != null"> <if test="fileName != null">
#{fileName}, #{fileName},
</if> </if>
...@@ -103,6 +110,9 @@ ...@@ -103,6 +110,9 @@
<if test="orderId != null"> <if test="orderId != null">
order_id = #{orderId,jdbcType=INTEGER}, order_id = #{orderId,jdbcType=INTEGER},
</if> </if>
<if test="subOrderId != null">
sub_order_id = #{subOrderId,jdbcType=INTEGER},
</if>
<if test="filePath != null"> <if test="filePath != null">
file_path = #{filePath,jdbcType=VARCHAR}, file_path = #{filePath,jdbcType=VARCHAR},
</if> </if>
...@@ -124,6 +134,7 @@ ...@@ -124,6 +134,7 @@
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysOrderFile"> <update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysOrderFile">
update sys_order_file update sys_order_file
set order_id = #{orderId,jdbcType=INTEGER}, set order_id = #{orderId,jdbcType=INTEGER},
sub_order_id = #{subOrderId,jdbcType=INTEGER},
file_path = #{filePath,jdbcType=VARCHAR}, file_path = #{filePath,jdbcType=VARCHAR},
file_type = #{fileType,jdbcType=TINYINT}, file_type = #{fileType,jdbcType=TINYINT},
sort = #{sort,jdbcType=TINYINT}, sort = #{sort,jdbcType=TINYINT},
...@@ -138,8 +149,11 @@ ...@@ -138,8 +149,11 @@
) )
values values
<foreach item="item" collection="fileList" separator=","> <foreach item="item" collection="fileList" separator=",">
(#{item.orderId,jdbcType=INTEGER},#{item.subOrderId,jdbcType=INTEGER}, #{item.filePath,jdbcType=VARCHAR}, #{item.fileType,jdbcType=TINYINT}, (
#{item.sort,jdbcType=TINYINT}, #{item.createBy,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP} #{item.orderId,jdbcType=INTEGER}, #{item.subOrderId,jdbcType=INTEGER},
#{item.filePath,jdbcType=VARCHAR}, #{item.fileType,jdbcType=TINYINT},
#{item.sort,jdbcType=TINYINT}, #{item.createBy,jdbcType=INTEGER},
#{item.createTime,jdbcType=TIMESTAMP}
) )
</foreach> </foreach>
</insert> </insert>
...@@ -175,4 +189,21 @@ ...@@ -175,4 +189,21 @@
where order_id = #{orderId} and sort = #{sort} where order_id = #{orderId} and sort = #{sort}
</select> </select>
<select id="selectListByRecord" parameterType="com.glsx.ordercenter.pojo.SysOrderFile"
resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from sys_order_file
<where>
<if test="orderId != null">
and order_id = #{orderId,jdbcType=INTEGER}
</if>
<if test="subOrderId != null">
and sub_order_id = #{subOrderId,jdbcType=INTEGER}
</if>
<if test="sort != null">
and sort = #{sort,jdbcType=INTEGER}
</if>
</where>
</select>
</mapper> </mapper>
...@@ -91,6 +91,14 @@ ...@@ -91,6 +91,14 @@
return_remark return_remark
</sql> </sql>
<select id="selectByOrderId" parameterType="integer" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from sys_order_material
where order_id = #{orderId,jdbcType=INTEGER}
</select>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderMaterialExample" <select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderMaterialExample"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select select
......
...@@ -86,6 +86,45 @@ ...@@ -86,6 +86,45 @@
create_time, update_time, create_by, update_by create_time, update_time, create_by, update_by
</sql> </sql>
<select id="selectList" parameterType="com.glsx.ordercenter.dto.req.SubOrderQueryReq"
resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from sys_sub_order
<where>
<if test="orderId != null">
and order_id = #{orderId,jdbcType=INTEGER}
</if>
<if test="status != null">
and status = #{status,jdbcType=TINYINT}
</if>
</where>
order by create_time desc
</select>
<select id="selectOne" parameterType="com.glsx.ordercenter.dto.req.SubOrderQueryReq"
resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from sys_sub_order
<where>
id = #{id,jdbcType=INTEGER}
<if test="orderId != null">
and order_id = #{orderId,jdbcType=INTEGER}
</if>
<if test="status != null">
and status = #{status,jdbcType=TINYINT}
</if>
</where>
</select>
<select id="selectByOrderId" parameterType="integer" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from sys_sub_order
where order_id = #{orderId,jdbcType=INTEGER}
order by create_time desc
</select>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysSubOrderExample" <select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysSubOrderExample"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select select
......
package com.glsx.ordercenter; package com.glsx.ordercenter;
import static org.junit.Assert.assertTrue; import java.io.IOException;
import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.junit.Test; public class AppTest {
protected void prettyPrint(Object o) {
import com.alibaba.druid.util.StringUtils; try {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
/** mapper.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false);
* Unit test for simple App. mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
*/ System.out.println(mapper.writeValueAsString(o));
public class AppTest } catch (IOException e) {
{ e.printStackTrace();
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
String s = null;
if (!StringUtils.isEmpty(s) && StringUtils.isNumber(s)) {
System.out.println(StringUtils.isNumber(s));
} }
} }
} }
package com.glsx.ordercenter.service; package com.glsx.ordercenter.service;
import com.glsx.ordercenter.AppTest;
import com.glsx.ordercenter.Application; import com.glsx.ordercenter.Application;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
...@@ -15,5 +16,5 @@ import org.springframework.test.context.junit4.SpringRunner; ...@@ -15,5 +16,5 @@ import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(classes = {Application.class}, @SpringBootTest(classes = {Application.class},
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class CarOrderServiceTest { public class CarOrderServiceTest extends AppTest {
} }
package com.glsx.ordercenter.service; package com.glsx.ordercenter.service;
import com.alibaba.fastjson.JSON; import com.glsx.ordercenter.AppTest;
import com.glsx.ordercenter.Application; import com.glsx.ordercenter.Application;
import com.glsx.ordercenter.dto.req.DeliveryQueryReq; import com.glsx.ordercenter.dto.req.DeliveryQueryReq;
import com.glsx.ordercenter.pojo.SysDelivery; import com.glsx.ordercenter.pojo.SysDelivery;
...@@ -20,7 +20,7 @@ import org.springframework.test.context.junit4.SpringRunner; ...@@ -20,7 +20,7 @@ import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(classes = {Application.class}, @SpringBootTest(classes = {Application.class},
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class DeliveryServiceTest { public class DeliveryServiceTest extends AppTest {
@Autowired @Autowired
private DeliveryService deliveryService; private DeliveryService deliveryService;
...@@ -28,14 +28,14 @@ public class DeliveryServiceTest { ...@@ -28,14 +28,14 @@ public class DeliveryServiceTest {
public void test_countByStatus() { public void test_countByStatus() {
DeliveryQueryReq req = new DeliveryQueryReq(); DeliveryQueryReq req = new DeliveryQueryReq();
req.setUserId(1); req.setUserId(1);
this.prettyPrint(deliveryService.countByStatus(req)); super.prettyPrint(deliveryService.countByStatus(req));
} }
@Test @Test
public void test_getList() { public void test_getList() {
DeliveryQueryReq req = new DeliveryQueryReq(); DeliveryQueryReq req = new DeliveryQueryReq();
req.setUserId(1); req.setUserId(1);
this.prettyPrint(deliveryService.getList(req)); super.prettyPrint(deliveryService.getList(req));
} }
@Test @Test
...@@ -43,38 +43,34 @@ public class DeliveryServiceTest { ...@@ -43,38 +43,34 @@ public class DeliveryServiceTest {
DeliveryQueryReq req = new DeliveryQueryReq(); DeliveryQueryReq req = new DeliveryQueryReq();
req.setUserId(1); req.setUserId(1);
req.setId(3); req.setId(3);
this.prettyPrint(deliveryService.getDetail(req)); super.prettyPrint(deliveryService.getDetail(req));
} }
@Test @Test
public void test_save() { public void test_save() {
SysDelivery delivery = new SysDelivery(); SysDelivery delivery = new SysDelivery();
this.prettyPrint(deliveryService.save(delivery)); super.prettyPrint(deliveryService.save(delivery));
} }
@Test @Test
public void test_send() { public void test_send() {
SysDelivery delivery = new SysDelivery(); SysDelivery delivery = new SysDelivery();
this.prettyPrint(deliveryService.send(delivery)); super.prettyPrint(deliveryService.send(delivery));
} }
@Test @Test
public void test_receive() { public void test_receive() {
SysDelivery delivery = new SysDelivery(); SysDelivery delivery = new SysDelivery();
this.prettyPrint(deliveryService.receive(delivery)); super.prettyPrint(deliveryService.receive(delivery));
} }
@Test @Test
public void test_cancel() { public void test_cancel() {
SysDelivery delivery = new SysDelivery(); SysDelivery delivery = new SysDelivery();
this.prettyPrint(deliveryService.cancel(delivery)); super.prettyPrint(deliveryService.cancel(delivery));
}
private void prettyPrint(Object o) {
System.out.println(JSON.toJSONString(o, true));
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!