Commit 92bb7250 by wubh

Revert: 包活干V2.1.0-回退2.1.0功能

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@28739 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 378f7536
Showing 26 changed files with 68 additions and 1792 deletions
package com.glsx.ordercenter.constants;
/**
* <p>Description: 订单审核状态枚举
* <p>Project: car-service
*
* @author wbh
* @date 2020-09-27
*/
public enum AuditStatusEnum {
NOT_AUDIT((byte) 1, "待审核"),
REJECTED((byte) 2, "已退回"),
NORMALLY_PASSED((byte) 3, "已通过(正常通过)"),
ABNORMALLY_PASSED((byte) 4, "已通过(退回通过)"),
;
private final Byte code;
private final String text;
AuditStatusEnum(Byte code, String text) {
this.code = code;
this.text = text;
}
public Byte getCode() {
return code;
}
public String getText() {
return text;
}
public static String getText(byte code) {
String text = null;
AuditStatusEnum[] values = AuditStatusEnum.values();
for (AuditStatusEnum value : values) {
if (value.code.equals(code)) {
text = value.text;
break;
}
}
return text;
}
}
package com.glsx.ordercenter.controller;
import java.util.Map;
import com.glsx.common.annotation.AuthCheck;
import com.glsx.common.pojo.PagedResp;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.dto.req.AuditOrderQueryReq;
import com.glsx.ordercenter.exception.BusinessException;
import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.service.AuditOrderService;
import com.glsx.plat.core.web.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>Description: 审核单业务
* <p>Project: car-service
*
* @author wbh
* @date 2020-09-28
*/
@RestController
@RequestMapping("/auditOrder")
@AuthCheck
public class AuditOrderController extends BaseController {
@Autowired
private AuditOrderService auditOrderService;
/**
* 根据状态统计审核单数量
*
* @param req 请求体
* @return 结果
*/
@RequestMapping(value = "/countByStatus", method = {RequestMethod.POST, RequestMethod.GET})
public R countByStatus(AuditOrderQueryReq req) {
super.logInfo("==== /auditOrder/countByStatus param", req);
R result;
Map<String, Integer> statusCountMap = this.auditOrderService.countByStatus(req);
result = R.ok().data(statusCountMap);
super.logInfo("==== /auditOrder/countByStatus result", result);
return result;
}
/**
* 获取审核单列表
*
* @param req 请求体
* @return 结果
*/
@RequestMapping(value = "/getList", method = {RequestMethod.POST, RequestMethod.GET})
public R getList(AuditOrderQueryReq req) {
super.logInfo("==== /auditOrder/getList param", req);
PagedResp<SysOrder> pagedResp = this.auditOrderService.getList(req);
R result = R.ok().data(pagedResp);
super.logInfo("==== /auditOrder/getList result", result);
return result;
}
/**
* 获取审核单详情
*
* @param req 请求体
* @return 结果
*/
@RequestMapping(value = "/getDetail", method = {RequestMethod.POST, RequestMethod.GET})
public R getDetail(AuditOrderQueryReq req) {
super.logInfo("==== /auditOrder/getDetail param", req);
if (req.getId() == null) {
throw BusinessException.create(ResultCodeEnum.PARAM_ERROR.getCode(),
ResultCodeEnum.PARAM_ERROR.getMsg());
}
SysOrder order = this.auditOrderService.getDetail(req);
R result = R.ok().data(order);
super.logInfo("==== /auditOrder/getDetail result", result);
return result;
}
///**
// * 保存审核单
// *
// * @param order 审核单
// * @return 结果
// */
//public R save(SysOrder order) {
// return null;
//}
//
///**
// * 小程序提交审核单
// *
// * @param order 审核单
// * @return 结果
// */
//public R submit(SysOrder order) {
// return null;
//}
//
///**
// * 退回审核单
// *
// * @param order 审核单
// * @return 结果
// */
//public R reject(SysOrder order) {
// return null;
//}
}
......@@ -23,16 +23,11 @@ import com.glsx.ordercenter.constants.DeliveryStatusEnum;
import com.glsx.ordercenter.constants.OrderTypeEnum;
import com.glsx.ordercenter.constants.ReconciliationStatusEnum;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.dto.AuditOrderVo;
import com.glsx.ordercenter.dto.CarInfo;
import com.glsx.ordercenter.dto.CarOrderVo;
import com.glsx.ordercenter.dto.DeliveryVo;
import com.glsx.ordercenter.dto.DeviceRepertoryReq;
import com.glsx.ordercenter.dto.ExportOperationAdvanceVO;
import com.glsx.ordercenter.dto.ExportOrderExceptionVo;
import com.glsx.ordercenter.dto.ExportOrderVo;
import com.glsx.ordercenter.dto.ExportReconciliationDetailVO;
import com.glsx.ordercenter.dto.ExportUnknownOrderVo;
import com.glsx.ordercenter.dto.GroupOperation;
import com.glsx.ordercenter.dto.IndentExport;
import com.glsx.ordercenter.dto.MachanicInfo;
......@@ -42,7 +37,6 @@ import com.glsx.ordercenter.dto.OrderExceptionVO;
import com.glsx.ordercenter.dto.QueryOrderReq;
import com.glsx.ordercenter.dto.ReconciliationDetailQuery;
import com.glsx.ordercenter.dto.ReconciliationDetailVO;
import com.glsx.ordercenter.dto.req.AuditOrderQueryReq;
import com.glsx.ordercenter.dto.req.CarOrderQueryReq;
import com.glsx.ordercenter.dto.req.DeliveryQueryReq;
import com.glsx.ordercenter.dto.req.InsuranceReq;
......@@ -52,6 +46,9 @@ import com.glsx.ordercenter.dto.resp.InsuranceResp;
import com.glsx.ordercenter.exception.BusinessException;
import com.glsx.ordercenter.exception.SysException;
import com.glsx.ordercenter.pojo.DictionaryData;
import com.glsx.ordercenter.pojo.ExportOrderExceptionVo;
import com.glsx.ordercenter.pojo.ExportOrderVo;
import com.glsx.ordercenter.pojo.ExportUnknownOrderVo;
import com.glsx.ordercenter.pojo.SysArea;
import com.glsx.ordercenter.pojo.SysDelivery;
import com.glsx.ordercenter.pojo.SysIndent;
......@@ -59,7 +56,6 @@ import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysOrderException;
import com.glsx.ordercenter.pojo.SysOrderMaterial;
import com.glsx.ordercenter.pojo.SysReconciliation;
import com.glsx.ordercenter.service.AuditOrderService;
import com.glsx.ordercenter.service.CarOrderService;
import com.glsx.ordercenter.service.DeliveryService;
import com.glsx.ordercenter.service.DeviceRepertoryService;
......@@ -95,10 +91,6 @@ public class ReportController extends BaseReportController {
private IUnknownOrderService unknownOrderService;
@Autowired
private IOrderService orderService;
@Autowired
private AuditOrderService auditOrderService;
@Autowired
private DeviceRepertoryService deviceRepertoryService;
@Autowired
......@@ -233,7 +225,8 @@ public class ReportController extends BaseReportController {
} else {
exportOrderVo.setServiceType("驻店");
}
exportOrderVo.setActiveStatus(this.tranceActiveStatus(sysOrder, userType));
exportOrderVo.setActiveStatus(this.tranceActiveStatus(sysOrder.getActiveStatus(), userType,
sysOrder.getCanceled()));
if (sysOrder.getMachanicInfo() != null) {
exportOrderVo.setMechanicInfo(
sysOrder.getMachanicInfo().getName() + "\n" + sysOrder.getMachanicInfo()
......@@ -283,99 +276,6 @@ public class ReportController extends BaseReportController {
}
}
/**
* 导出审核单
*
* @param req 请求
*/
@RequestMapping(value = "/exportAuditOrder", method = {RequestMethod.GET, RequestMethod.POST})
public void exportAuditOrder(AuditOrderQueryReq req) {
this.logger.info("==== /exportAuditOrder param: {}", JSON.toJSONString(req));
ServletRequestAttributes attributes =
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null || attributes.getResponse() == null) {
throw BusinessException.create(ResultCodeEnum.EXPORT_FAIL.getCode(),
ResultCodeEnum.EXPORT_FAIL.getMsg());
}
req.setPageIndex(null);
req.setPageSize(null);
req.setNeedDetail(false);
PagedResp<SysOrder> countResp = this.auditOrderService.getList(req);
if (countResp.getItems().size() > 10000) {
throw BusinessException.create(ResultCodeEnum.EXPORT_OEDER_OUTOF_NUMBER.getCode(),
ResultCodeEnum.EXPORT_OEDER_OUTOF_NUMBER.getMsg());
}
try {
req.setNeedDetail(true);
PagedResp<SysOrder> pagedResp = this.auditOrderService.getList(req);
List<SysOrder> orderList = pagedResp.getItems();
List<AuditOrderVo> auditOrderVoList = new ArrayList<>();
orderList.forEach(order -> {
AuditOrderVo auditOrderVo = new AuditOrderVo();
BeanUtils.copyProperties(order, auditOrderVo);
auditOrderVoList.add(this.convertAuditOrderVo(auditOrderVo, order));
});
String fileName = "审核单详情-" + DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss")
.format(LocalDateTime.now());
this.exportObject(attributes.getResponse(), auditOrderVoList, fileName);
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 转换订单信息为导出信息
*
* @param auditOrderVo 导出信息
* @param order 订单
* @return 导出信息
*/
private AuditOrderVo convertAuditOrderVo(AuditOrderVo auditOrderVo, SysOrder order) {
Byte userType = UserUtils.getCurrentUserType();
// 订单状态
auditOrderVo.setActiveStatus(this.tranceActiveStatus(order, Integer.valueOf(userType)));
//订单类型
auditOrderVo.setOrderType(this.tranceOrderType(order.getOrderType()));
// 上门类型
auditOrderVo.setServiceType("1".equals(order.getServiceType()) ? "上门" : "驻店");
// 技工信息
MachanicInfo mechanicInfo = order.getMachanicInfo();
if (mechanicInfo != null) {
String mechanicContact = mechanicInfo.getName() + "\n" + mechanicInfo.getPhone();
auditOrderVo.setMechanicInfo(mechanicContact);
}
// 品牌车型
CarInfo carInfo = order.getCarInfo();
if (carInfo != null) {
auditOrderVo.setCarBrand(StringUtils.join(new String[]{
carInfo.getBrand(), carInfo.getSeries(), carInfo.getType()
}, "/"));
} else {
auditOrderVo.setCarBrand(order.getCarType());
}
// 安装地址
Integer district = order.getDistrict();
if (district != null) {
String fullArea = this.areaService.getFullAreaByDistrictId(district);
String address = order.getAddress();
auditOrderVo.setInstallAddress(StringUtils.join(fullArea, address));
}
// 安装照片地址
if (StringUtils.isNotEmpty(order.getInstallPiuctures())) {
auditOrderVo.setInstallLocationPicture(StringUtils.join(
order.getInstallPiuctures(), ",\n"));
}
return auditOrderVo;
}
@RequestMapping(value = "/exporRepertoryList", method = {RequestMethod.GET, RequestMethod.POST})
public void exportIndent(HttpServletRequest request, HttpServletResponse response,
......@@ -417,10 +317,7 @@ public class ReportController extends BaseReportController {
}
private String tranceActiveStatus(SysOrder order, Integer userType) {
Byte activeStatus = order.getActiveStatus();
Byte canceled = order.getCanceled();
private String tranceActiveStatus(Byte activeStatus, Integer userType, Byte canceled) {
if (userType == 0 && canceled == 1) {
if (activeStatus == 1) {
return "商户已派单";
......@@ -510,7 +407,8 @@ public class ReportController extends BaseReportController {
exportOrderVo.setServiceType("驻店");
}
exportOrderVo.setActiveStatus(
this.tranceActiveStatus(sysOrder, oueryOrderReq.getUserType()));
this.tranceActiveStatus(sysOrder.getActiveStatus(), oueryOrderReq.getUserType(),
sysOrder.getCanceled()));
if (sysOrder.getMachanicInfo() != null) {
exportOrderVo.setMechanicInfo(
sysOrder.getMachanicInfo().getName() + "\r\n" + sysOrder.getMachanicInfo()
......
package com.glsx.ordercenter.dto;
import java.util.Date;
import com.glsx.excel.poi.annotation.ExcelColumn;
import com.glsx.excel.poi.annotation.ExcelExport;
@ExcelExport
public class AuditOrderVo {
@ExcelColumn(value = "订单编号", index = 0)
private String orderSn;
@ExcelColumn(value = "第三方工单号", index = 1)
private String workOrderNo;
@ExcelColumn(value = "订单渠道", index = 2)
private String orderChannel;
@ExcelColumn(value = "服务类型", index = 3)
private String installDeviceTypeName;
@ExcelColumn(value = "派单日期", index = 4, pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@ExcelColumn(value = "接单时间", index = 5, pattern = "yyyy-MM-dd HH:mm:ss")
private Date receiveTime;
@ExcelColumn(value = "预约时间", index = 6, pattern = "yyyy-MM-dd HH:mm:ss")
private Date reserveInstallTime;
@ExcelColumn(value = "上门时间", index = 7, pattern = "yyyy-MM-dd HH:mm:ss")
private Date checkInTime;
@ExcelColumn(value = "完成时间", index = 8, pattern = "yyyy-MM-dd HH:mm:ss")
private Date completeTime;
@ExcelColumn(value = "状态", index = 9)
private String activeStatus;
@ExcelColumn(value = "上门类型", index = 10)
private String serviceType;
@ExcelColumn(value = "车架号", index = 11)
private String vinNo;
@ExcelColumn(value = "品牌车型", index = 12)
private String carBrand;
@ExcelColumn(value = "车主姓名", index = 13)
private String carOwner;
@ExcelColumn(value = "车主联系方式", index = 14)
private String carOwnerPhone;
@ExcelColumn(value = "商户名称", index = 15)
private String merchantName;
@ExcelColumn(value = "所在省", index = 16)
private String province;
@ExcelColumn(value = "所在市", index = 17)
private String city;
@ExcelColumn(value = "服务地址", index = 18)
private String address;
@ExcelColumn(value = "服务商名称", index = 19)
private String serviceName;
@ExcelColumn(value = "技工信息", index = 20)
private String mechanicInfo;
@ExcelColumn(value = "订单类型", index = 21)
private String orderType;
@ExcelColumn(value = "安装地址", index = 22)
private String installAddress;
@ExcelColumn(value = "安装照片地址", index = 23)
private String installLocationPicture;
@ExcelColumn(value = "提交审核时间", index = 24, pattern = "yyyy-MM-dd HH:mm:ss")
private Date auditTime;
@ExcelColumn(value = "退回次数", index = 25)
private Byte auditCount;
public String getOrderSn() {
return orderSn;
}
public void setOrderSn(String orderSn) {
this.orderSn = orderSn;
}
public String getWorkOrderNo() {
return workOrderNo;
}
public void setWorkOrderNo(String workOrderNo) {
this.workOrderNo = workOrderNo;
}
public String getOrderChannel() {
return orderChannel;
}
public void setOrderChannel(String orderChannel) {
this.orderChannel = orderChannel;
}
public String getInstallDeviceTypeName() {
return installDeviceTypeName;
}
public void setInstallDeviceTypeName(String installDeviceTypeName) {
this.installDeviceTypeName = installDeviceTypeName;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getReceiveTime() {
return receiveTime;
}
public void setReceiveTime(Date receiveTime) {
this.receiveTime = receiveTime;
}
public Date getReserveInstallTime() {
return reserveInstallTime;
}
public void setReserveInstallTime(Date reserveInstallTime) {
this.reserveInstallTime = reserveInstallTime;
}
public Date getCheckInTime() {
return checkInTime;
}
public void setCheckInTime(Date checkInTime) {
this.checkInTime = checkInTime;
}
public Date getCompleteTime() {
return completeTime;
}
public void setCompleteTime(Date completeTime) {
this.completeTime = completeTime;
}
public String getActiveStatus() {
return activeStatus;
}
public void setActiveStatus(String activeStatus) {
this.activeStatus = activeStatus;
}
public String getServiceType() {
return serviceType;
}
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public String getVinNo() {
return vinNo;
}
public void setVinNo(String vinNo) {
this.vinNo = vinNo;
}
public String getCarBrand() {
return carBrand;
}
public void setCarBrand(String carBrand) {
this.carBrand = carBrand;
}
public String getCarOwner() {
return carOwner;
}
public void setCarOwner(String carOwner) {
this.carOwner = carOwner;
}
public String getCarOwnerPhone() {
return carOwnerPhone;
}
public void setCarOwnerPhone(String carOwnerPhone) {
this.carOwnerPhone = carOwnerPhone;
}
public String getMerchantName() {
return merchantName;
}
public void setMerchantName(String merchantName) {
this.merchantName = merchantName;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
public String getMechanicInfo() {
return mechanicInfo;
}
public void setMechanicInfo(String mechanicInfo) {
this.mechanicInfo = mechanicInfo;
}
public String getOrderType() {
return orderType;
}
public void setOrderType(String orderType) {
this.orderType = orderType;
}
public String getInstallAddress() {
return installAddress;
}
public void setInstallAddress(String installAddress) {
this.installAddress = installAddress;
}
public String getInstallLocationPicture() {
return installLocationPicture;
}
public void setInstallLocationPicture(String installLocationPicture) {
this.installLocationPicture = installLocationPicture;
}
public Date getAuditTime() {
return auditTime;
}
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
public Byte getAuditCount() {
return auditCount;
}
public void setAuditCount(Byte auditCount) {
this.auditCount = auditCount;
}
@Override
public String toString() {
return "AuditOrderVo{" +
"orderSn='" + orderSn + '\'' +
", workOrderNo='" + workOrderNo + '\'' +
", orderChannel='" + orderChannel + '\'' +
", installDeviceTypeName='" + installDeviceTypeName + '\'' +
", createTime=" + createTime +
", receiveTime=" + receiveTime +
", reserveInstallTime=" + reserveInstallTime +
", checkInTime=" + checkInTime +
", completeTime=" + completeTime +
", activeStatus='" + activeStatus + '\'' +
", serviceType='" + serviceType + '\'' +
", vinNo='" + vinNo + '\'' +
", carBrand='" + carBrand + '\'' +
", carOwner='" + carOwner + '\'' +
", carOwnerPhone='" + carOwnerPhone + '\'' +
", merchantName='" + merchantName + '\'' +
", province='" + province + '\'' +
", city='" + city + '\'' +
", address='" + address + '\'' +
", serviceName='" + serviceName + '\'' +
", mechanicInfo='" + mechanicInfo + '\'' +
", orderType='" + orderType + '\'' +
", installAddress='" + installAddress + '\'' +
", installLocationPicture='" + installLocationPicture + '\'' +
", auditTime=" + auditTime +
", auditCount=" + auditCount +
'}';
}
}
package com.glsx.ordercenter.dto;
import javax.validation.constraints.NotNull;
import java.util.List;
import com.glsx.ordercenter.pojo.GroupC;
import com.glsx.ordercenter.pojo.SysOrderDevice;
import com.glsx.ordercenter.pojo.SysOrderFile;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @author zhanghj
* @version 1.0.0
......@@ -62,15 +63,6 @@ public class OrderDeviceReq {
*/
private String supplier;
/**
* 审核通过类型:1正常通过,2退回通过
*/
private Byte auditPassType;
/**
* 审核退回原因
*/
private String reason;
public Integer getOrderId() {
return orderId;
......@@ -144,36 +136,13 @@ public class OrderDeviceReq {
this.supplier = supplier;
}
public Byte getAuditPassType() {
return auditPassType;
}
public void setAuditPassType(Byte auditPassType) {
this.auditPassType = auditPassType;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
@Override
public String toString() {
return "OrderDeviceReq{" +
"orderId=" + orderId +
", subOrderId=" + subOrderId +
", orderDeviceList=" + orderDeviceList +
", installRemark='" + installRemark + '\'' +
", orderFileList=" + orderFileList +
", mechanicAddress='" + mechanicAddress + '\'' +
", orderSn='" + orderSn + '\'' +
", serviceCode='" + serviceCode + '\'' +
", supplier='" + supplier + '\'' +
", auditPassType=" + auditPassType +
", reason='" + reason + '\'' +
'}';
return "OrderDeviceReq [orderId=" + orderId + ", orderDeviceList="
+ orderDeviceList + ", installRemark=" + installRemark
+ ", orderFileList=" + orderFileList + ", mechanicAddress="
+ mechanicAddress + "]";
}
}
......@@ -5,9 +5,7 @@
package com.glsx.ordercenter.dto;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.springframework.format.annotation.DateTimeFormat;
/**
* Description: 订单查询入参
......@@ -16,19 +14,6 @@ import org.springframework.format.annotation.DateTimeFormat;
*/
public class QueryOrderReq implements Serializable {
private static final long serialVersionUID = 3945235994796311064L;
/**
* 完成时间开始
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date completeTimeStart;
/**
* 完成时间结束
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date completeTimeEnd;
private String orderSn;
private Integer orderChannel;
private String serviceType;
......@@ -85,22 +70,6 @@ public class QueryOrderReq implements Serializable {
*/
private String carType;
public Date getCompleteTimeStart() {
return completeTimeStart;
}
public void setCompleteTimeStart(Date completeTimeStart) {
this.completeTimeStart = completeTimeStart;
}
public Date getCompleteTimeEnd() {
return completeTimeEnd;
}
public void setCompleteTimeEnd(Date completeTimeEnd) {
this.completeTimeEnd = completeTimeEnd;
}
public String getOrderSn() {
return orderSn;
}
......
package com.glsx.ordercenter.dto.req;
import java.util.Date;
import java.util.List;
import com.glsx.common.pojo.PagedReq;
/**
* <p>Description:
* <p>Project: car-service
*
* @author wbh
* @date 2020-08-31
*/
public class AuditOrderQueryReq extends PagedReq {
/**
* 关键词
*/
private String keyword;
/**
* 当前用户ID
*/
private Integer userId;
/**
* 当前用户角色
*/
private Byte userType;
/**
* 服务商ID,根据用户角色生成
*/
private Integer providerId;
/**
* 商户ID,根据用户角色生成
*/
private Integer shopId;
/**
* 状态列表,用于不同角色
*/
private List<Byte> statusList;
/**
* 订单渠道
*/
private Integer orderChannel;
/**
* 提交审核时间开始
*/
private Date auditTimeStart;
/**
* 提交审核时间结束
*/
private Date auditTimeEnd;
/**
* 服务商名称
*/
private String serviceName;
/**
* 所在省市
*/
private String city;
/**
* 是否需要详情
*/
private Boolean needDetail = true;
/**
* 订单ID
*/
private Integer id;
/**
* 订单单号
*/
private String orderSn;
/**
* 订单类型
*/
private Byte orderType;
/**
* 状态
*/
private Byte auditStatus;
/**
* 服务类型
*/
private String serviceType;
/**
* 服务项目代码
*/
private String serviceCode;
/**
* 车架号
*/
private String vinNo;
/**
* 车主姓名,用于模糊搜索
*/
private String carOwner;
/**
* 车主姓名或车主电话,用于模糊搜索
*/
private String carOwnerPhone;
/**
* 车品牌
*/
private Integer carBrand;
/**
* 车系
*/
private Integer carSeries;
/**
* 车型
*/
private String carType;
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Byte getUserType() {
return userType;
}
public void setUserType(Byte userType) {
this.userType = userType;
}
public Integer getProviderId() {
return providerId;
}
public void setProviderId(Integer providerId) {
this.providerId = providerId;
}
public Integer getShopId() {
return shopId;
}
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
public List<Byte> getStatusList() {
return statusList;
}
public void setStatusList(List<Byte> statusList) {
this.statusList = statusList;
}
public Integer getOrderChannel() {
return orderChannel;
}
public void setOrderChannel(Integer orderChannel) {
this.orderChannel = orderChannel;
}
public Date getAuditTimeStart() {
return auditTimeStart;
}
public void setAuditTimeStart(Date auditTimeStart) {
this.auditTimeStart = auditTimeStart;
}
public Date getAuditTimeEnd() {
return auditTimeEnd;
}
public void setAuditTimeEnd(Date auditTimeEnd) {
this.auditTimeEnd = auditTimeEnd;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public Boolean getNeedDetail() {
return needDetail;
}
public void setNeedDetail(Boolean needDetail) {
this.needDetail = needDetail;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getOrderSn() {
return orderSn;
}
public void setOrderSn(String orderSn) {
this.orderSn = orderSn;
}
public Byte getOrderType() {
return orderType;
}
public void setOrderType(Byte orderType) {
this.orderType = orderType;
}
public Byte getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(Byte auditStatus) {
this.auditStatus = auditStatus;
}
public String getServiceType() {
return serviceType;
}
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public String getServiceCode() {
return serviceCode;
}
public void setServiceCode(String serviceCode) {
this.serviceCode = serviceCode;
}
public String getVinNo() {
return vinNo;
}
public void setVinNo(String vinNo) {
this.vinNo = vinNo;
}
public String getCarOwner() {
return carOwner;
}
public void setCarOwner(String carOwner) {
this.carOwner = carOwner;
}
public String getCarOwnerPhone() {
return carOwnerPhone;
}
public void setCarOwnerPhone(String carOwnerPhone) {
this.carOwnerPhone = carOwnerPhone;
}
public Integer getCarBrand() {
return carBrand;
}
public void setCarBrand(Integer carBrand) {
this.carBrand = carBrand;
}
public Integer getCarSeries() {
return carSeries;
}
public void setCarSeries(Integer carSeries) {
this.carSeries = carSeries;
}
public String getCarType() {
return carType;
}
public void setCarType(String carType) {
this.carType = carType;
}
@Override
public String toString() {
return "AuditOrderQueryReq{" +
"keyword='" + keyword + '\'' +
", userId=" + userId +
", userType=" + userType +
", providerId=" + providerId +
", shopId=" + shopId +
", statusList=" + statusList +
", orderChannel=" + orderChannel +
", auditTimeStart=" + auditTimeStart +
", auditTimeEnd=" + auditTimeEnd +
", serviceName='" + serviceName + '\'' +
", city='" + city + '\'' +
", needDetail=" + needDetail +
", id=" + id +
", orderSn='" + orderSn + '\'' +
", orderType=" + orderType +
", auditStatus=" + auditStatus +
", serviceType='" + serviceType + '\'' +
", serviceCode='" + serviceCode + '\'' +
", vinNo='" + vinNo + '\'' +
", carOwner='" + carOwner + '\'' +
", carOwnerPhone='" + carOwnerPhone + '\'' +
", carBrand=" + carBrand +
", carSeries=" + carSeries +
", carType='" + carType + '\'' +
"} " + super.toString();
}
}
package com.glsx.ordercenter.mapper;
import java.util.List;
import com.glsx.ordercenter.dto.req.AuditOrderQueryReq;
import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysOrderExample;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@Repository
public interface SysAuditOrderMapper {
List<SysOrder> selectList(AuditOrderQueryReq req);
SysOrder selectOne(AuditOrderQueryReq req);
long countByExample(SysOrderExample example);
int deleteByExample(SysOrderExample example);
int deleteByPrimaryKey(Integer id);
int insert(SysOrder record);
int insertSelective(SysOrder record);
List<SysOrder> selectByExample(SysOrderExample example);
SysOrder selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysOrder record,
@Param("example") SysOrderExample example);
int updateByExample(@Param("record") SysOrder record,
@Param("example") SysOrderExample example);
int updateByPrimaryKeySelective(SysOrder record);
int updateByPrimaryKey(SysOrder record);
}
package com.glsx.ordercenter.mapper;
import java.util.List;
import com.glsx.ordercenter.pojo.SysOrderAuditStatus;
import com.glsx.ordercenter.pojo.SysOrderAuditStatusExample;
import org.apache.ibatis.annotations.Param;
/**
* <p>Description:
* <p>Project: car-service
*
* @author wbh
* @date 2020-09-27
*/
public interface SysOrderAuditStatusMapper {
List<SysOrderAuditStatus> selectByRecord(SysOrderAuditStatus record);
SysOrderAuditStatus selectLatestOneByRecord(SysOrderAuditStatus record);
long countByExample(SysOrderAuditStatusExample example);
int deleteByExample(SysOrderAuditStatusExample example);
int deleteByPrimaryKey(Integer id);
int insert(SysOrderAuditStatus record);
int insertSelective(SysOrderAuditStatus record);
List<SysOrderAuditStatus> selectByExample(SysOrderAuditStatusExample example);
SysOrderAuditStatus selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysOrderAuditStatus record,
@Param("example") SysOrderAuditStatusExample example);
int updateByExample(@Param("record") SysOrderAuditStatus record,
@Param("example") SysOrderAuditStatusExample example);
int updateByPrimaryKeySelective(SysOrderAuditStatus record);
int updateByPrimaryKey(SysOrderAuditStatus record);
}
package com.glsx.ordercenter.dto;
package com.glsx.ordercenter.pojo;
import java.util.Date;
import com.glsx.excel.poi.annotation.ExcelColumn;
import com.glsx.excel.poi.annotation.ExcelExport;
import java.util.Date;
@ExcelExport
public class ExportOrderExceptionVo {
......
package com.glsx.ordercenter.dto;
package com.glsx.ordercenter.pojo;
import java.util.Date;
import com.glsx.excel.poi.annotation.ExcelColumn;
......
package com.glsx.ordercenter.dto;
package com.glsx.ordercenter.pojo;
import java.util.Date;
import com.glsx.excel.poi.annotation.ExcelColumn;
import com.glsx.excel.poi.annotation.ExcelExport;
import java.util.Date;
@ExcelExport
public class ExportUnknownOrderVo {
......
......@@ -51,18 +51,6 @@ public class SysOrder {
* 已完成子订单数
*/
private Integer finishedCount;
/**
* 订单设备列表
*/
private List<SysOrderDevice> orderDeviceList;
/**
* 订单文件列表
*/
private List<SysOrderFile> orderFileList;
/**
* 最新审核进度
*/
private List<SysOrderAuditStatus> auditStatusList;
......@@ -448,7 +436,7 @@ public class SysOrder {
private Long quotationQuantity;
private List<SysOrderDevice> orderDevices;
List<SysOrderDevice> orderDevices;
/**
* 服务项目icon
......@@ -485,21 +473,6 @@ public class SysOrder {
*/
private Date receiveTime;
/**
* 审核状态:-1无需审核,1待审核,2已退回,3正常通过,4退回通过
*/
private Byte auditStatus;
/**
* 审核退回次数
*/
private Byte auditCount;
/**
* 审核提交时间(最后时间)
*/
private Date auditTime;
public Integer getUserId() {
return userId;
}
......@@ -556,31 +529,6 @@ public class SysOrder {
this.finishedCount = finishedCount;
}
public List<SysOrderDevice> getOrderDeviceList() {
return orderDeviceList;
}
public void setOrderDeviceList(List<SysOrderDevice> orderDeviceList) {
this.orderDeviceList = orderDeviceList;
}
public List<SysOrderFile> getOrderFileList() {
return orderFileList;
}
public void setOrderFileList(List<SysOrderFile> orderFileList) {
this.orderFileList = orderFileList;
}
public List<SysOrderAuditStatus> getAuditStatusList() {
return auditStatusList;
}
public void setAuditStatusList(
List<SysOrderAuditStatus> auditStatusList) {
this.auditStatusList = auditStatusList;
}
public String getNoBidingDuration() {
return noBidingDuration;
}
......@@ -1429,30 +1377,6 @@ public class SysOrder {
this.receiveTime = receiveTime;
}
public Byte getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(Byte auditStatus) {
this.auditStatus = auditStatus;
}
public Byte getAuditCount() {
return auditCount;
}
public void setAuditCount(Byte auditCount) {
this.auditCount = auditCount;
}
public Date getAuditTime() {
return auditTime;
}
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
@Override
public String toString() {
return "SysOrder{" +
......@@ -1463,9 +1387,6 @@ public class SysOrder {
", subOrderList=" + subOrderList +
", subOrderCount=" + subOrderCount +
", finishedCount=" + finishedCount +
", orderDeviceList=" + orderDeviceList +
", orderFileList=" + orderFileList +
", auditStatusList=" + auditStatusList +
", noBidingDuration='" + noBidingDuration + '\'' +
", serviceItems=" + serviceItems +
", id=" + id +
......@@ -1572,9 +1493,6 @@ public class SysOrder {
", installMode=" + installMode +
", ifAddDevice=" + ifAddDevice +
", receiveTime=" + receiveTime +
", auditStatus=" + auditStatus +
", auditCount=" + auditCount +
", auditTime=" + auditTime +
'}';
}
}
package com.glsx.ordercenter.pojo;
import java.util.Date;
/**
* <p>Description:
* <p>Project: car-service
*
* @author wbh
* @date 2020-09-27
*/
/**
* 订单审核流水表
*/
public class SysOrderAuditStatus {
/**
* 审核人
*/
private String createName;
/**
* 主键ID
*/
private Integer id;
/**
* 订单ID,关联sys_order.id
*/
private Integer orderId;
/**
* 审核状态:1待审核,2已退回,3正常通过,4退回通过
*/
private Byte auditStatus;
/**
* 原因
*/
private String reason;
/**
* 备注
*/
private String remark;
/**
* 创建时间
*/
private Date createTime;
/**
* 创建人
*/
private Integer createBy;
public String getCreateName() {
return createName;
}
public void setCreateName(String createName) {
this.createName = createName;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getOrderId() {
return orderId;
}
public void setOrderId(Integer orderId) {
this.orderId = orderId;
}
public Byte getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(Byte auditStatus) {
this.auditStatus = auditStatus;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
@Override
public String toString() {
return "SysOrderAuditStatus{" +
"createName='" + createName + '\'' +
", id=" + id +
", orderId=" + orderId +
", auditStatus=" + auditStatus +
", reason='" + reason + '\'' +
", remark='" + remark + '\'' +
", createTime=" + createTime +
", createBy=" + createBy +
'}';
}
}
......@@ -31,11 +31,6 @@ public class SysServiceItem extends BaseModel {
private Byte isUpdateInfo;
/**
* 是否需要审核订单
*/
private Byte isAudit;
/**
* 业务类型
*/
private Byte type;
......@@ -98,14 +93,6 @@ public class SysServiceItem extends BaseModel {
this.isUpdateInfo = isUpdateInfo;
}
public Byte getIsAudit() {
return isAudit;
}
public void setIsAudit(Byte isAudit) {
this.isAudit = isAudit;
}
public List<SysServiceItemDeviceConfig> getDeviceConfigList() {
return deviceConfigList;
}
......@@ -154,22 +141,4 @@ public class SysServiceItem extends BaseModel {
public void setType(Byte type) {
this.type = type;
}
@Override
public String toString() {
return "SysServiceItem{" +
"id=" + id +
", serviceName='" + serviceName + '\'' +
", serviceCode='" + serviceCode + '\'' +
", imgPath='" + imgPath + '\'' +
", pushUrl='" + pushUrl + '\'' +
", isUpdateInfo=" + isUpdateInfo +
", isAudit=" + isAudit +
", type=" + type +
", deviceConfigList=" + deviceConfigList +
", photoConfigList=" + photoConfigList +
", photoCount=" + photoCount +
", deviceTypeName='" + deviceTypeName + '\'' +
"} " + super.toString();
}
}
package com.glsx.ordercenter.service;
import java.util.Map;
import com.glsx.common.pojo.PagedResp;
import com.glsx.ordercenter.dto.req.AuditOrderQueryReq;
import com.glsx.ordercenter.pojo.SysOrder;
/**
* <p>Description:
* <p>Project: car-service
*
* @author wbh
* @date 2020-09-27
*/
public interface AuditOrderService {
Map<String, Integer> countByStatus(AuditOrderQueryReq req);
PagedResp<SysOrder> getList(AuditOrderQueryReq req);
SysOrder getDetail(AuditOrderQueryReq req);
//R save(SysOrder order);
//
//R submit(SysOrder order);
//
//R reject(SysOrder order);
}
package com.glsx.ordercenter.service.impl;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.github.pagehelper.PageHelper;
import com.glsx.common.pojo.PagedResp;
import com.glsx.common.utils.StringUtils;
import com.glsx.ordercenter.constants.AuditStatusEnum;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.dto.req.AuditOrderQueryReq;
import com.glsx.ordercenter.exception.BusinessException;
import com.glsx.ordercenter.mapper.SysAuditOrderMapper;
import com.glsx.ordercenter.mapper.SysOrderAuditStatusMapper;
import com.glsx.ordercenter.mapper.SysOrderDeviceMapper;
import com.glsx.ordercenter.mapper.SysOrderDeviceSupplierMapper;
import com.glsx.ordercenter.mapper.SysOrderFileMapper;
import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysOrderAuditStatus;
import com.glsx.ordercenter.pojo.SysOrderDevice;
import com.glsx.ordercenter.pojo.SysOrderDeviceSupplier;
import com.glsx.ordercenter.pojo.SysOrderFile;
import com.glsx.ordercenter.service.AuditOrderService;
import com.glsx.ordercenter.service.BaseOrderService;
import com.glsx.ordercenter.utils.OrderUtil;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>Description: 审核单业务
* <p>Project: car-service
*
* @author wbh
* @date 2020-09-28
*/
@Service
public class AuditOrderServiceImpl extends BaseOrderService implements AuditOrderService {
@Autowired
private SysAuditOrderMapper auditOrderMapper;
@Autowired
private SysOrderDeviceMapper orderDeviceMapper;
@Autowired
private SysOrderDeviceSupplierMapper orderDeviceSupplierMapper;
@Autowired
private SysOrderFileMapper orderFileMapper;
@Autowired
private SysOrderAuditStatusMapper orderAuditStatusMapper;
@Autowired
private OrderUtil orderUtil;
/**
* 根据状态统计审核单数量
*
* @param req 请求体
* @return 结果
*/
@Override
public Map<String, Integer> countByStatus(AuditOrderQueryReq req) {
Map<String, Integer> statusCountMap = new HashMap<>(4);
int totalCount = 0;
req.setPageIndex(null);
req.setPageSize(null);
// 待审核
req.setAuditStatus(AuditStatusEnum.NOT_AUDIT.getCode());
PagedResp<SysOrder> notAuditResp = this.getList(req);
statusCountMap.put("notAudit", notAuditResp.getItems().size());
totalCount += notAuditResp.getItems().size();
// 已退回
req.setAuditStatus(AuditStatusEnum.NOT_AUDIT.getCode());
PagedResp<SysOrder> rejectedResp = this.getList(req);
statusCountMap.put("rejected", rejectedResp.getItems().size());
totalCount += rejectedResp.getItems().size();
// 正常通过
req.setAuditStatus(AuditStatusEnum.NOT_AUDIT.getCode());
PagedResp<SysOrder> normallyPassedResp = this.getList(req);
statusCountMap.put("normallyPassed", normallyPassedResp.getItems().size());
totalCount += normallyPassedResp.getItems().size();
// 退回通过
req.setAuditStatus(AuditStatusEnum.NOT_AUDIT.getCode());
PagedResp<SysOrder> abnormallyPassedResp = this.getList(req);
statusCountMap.put("abnormallyPassed", abnormallyPassedResp.getItems().size());
totalCount += abnormallyPassedResp.getItems().size();
// 全部
statusCountMap.put("total", totalCount);
return statusCountMap;
}
/**
* 获取审核单列表
*
* @param req 请求体
* @return 结果
*/
@Override
public PagedResp<SysOrder> getList(AuditOrderQueryReq req) {
Integer pageIndex = req.getPageIndex();
Integer pageSize = req.getPageSize();
if (pageIndex != null && pageSize != null) {
PageHelper.startPage(pageIndex, pageSize, true);
}
List<SysOrder> orderList = this.auditOrderMapper.selectList(req);
if (Boolean.TRUE.equals(req.getNeedDetail())) {
for (SysOrder order : orderList) {
this.wrapOrderChannel(order);
this.wrapLatestAuditStatus(order);
}
}
PagedResp<SysOrder> pagedResp = PagedResp.of(req, orderList);
return pagedResp;
}
/**
* 获取审核单详情
*
* @param req 请求体
* @return 结果
*/
@Override
public SysOrder getDetail(AuditOrderQueryReq req) {
SysOrder order = this.auditOrderMapper.selectOne(req);
if (order == null) {
throw BusinessException.create(ResultCodeEnum.ORDER_NOT_EXIST.getCode(),
ResultCodeEnum.ORDER_NOT_EXIST.getMsg());
}
this.wrapOrderChannel(order);
this.wrapOrderDeviceList(order);
this.wrapOrderFileList(order);
this.wrapAuditStatusList(order);
return order;
}
///**
// * 保存审核单
// *
// * @param order 审核单
// * @return 结果
// */
//@Override
//public R save(SysOrder order) {
// return null;
//}
//
///**
// * 小程序提交审核单
// *
// * @param order 审核单
// * @return 结果
// */
//@Override
//public R submit(SysOrder order) {
// return null;
//}
//
///**
// * 退回审核单
// *
// * @param order 审核单
// * @return 结果
// */
//@Override
//public R reject(SysOrder order) {
// return null;
//}
/**
* 封装订单设备信息
*
* @param order 订单
* @return 订单
*/
private SysOrder wrapOrderDeviceList(SysOrder order) {
SysOrderDevice record = new SysOrderDevice();
record.setOrderId(order.getId());
List<SysOrderDevice> orderDeviceList = this.orderDeviceMapper.getOrderDeviceList(record);
for (SysOrderDevice orderDevice : orderDeviceList) {
Integer orderId = orderDevice.getOrderId();
String deviceType = orderDevice.getDeviceType();
Integer sort = orderDevice.getSort();
// 获取设备供应商信息
SysOrderDeviceSupplier deviceSupplier = this.orderDeviceSupplierMapper
.getDeviceSupplier(orderId, deviceType, sort);
if (deviceSupplier == null) {
continue;
}
// 安装时选择的供应商
orderDevice.setChooseSupplier(deviceSupplier.getChooseSupplier());
// 顺序?
orderDevice.setIndexNo(deviceSupplier.getSort());
if (StringUtils.isNotBlank(deviceSupplier.getSupplier())) {
// 可选供应商列表
List<String> supplierList = Arrays.asList(
deviceSupplier.getSupplier().split("#"));
orderDevice.setSuppliers(supplierList);
}
}
order.setOrderDeviceList(orderDeviceList);
return order;
}
/**
* 封装订单信息
*
* @param order 订单
* @return 订单
*/
private SysOrder wrapOrderChannel(SysOrder order) {
return this.orderUtil.wrapOrderChannel(order);
}
/**
* 封装订单文件信息
*
* @param order 订单
* @return 订单
*/
private SysOrder wrapOrderFileList(SysOrder order) {
List<SysOrderFile> orderFileList = this.orderFileMapper.selectByOrderId(order.getId());
order.setOrderFileList(orderFileList);
return order;
}
/**
* 封装最新的审核进度
*
* @param order 订单
* @return 订单
*/
private SysOrder wrapLatestAuditStatus(SysOrder order) {
this.wrapAuditStatusList(order);
// 只取第一个,即为最新的订单进度
List<SysOrderAuditStatus> auditStatusList = order.getAuditStatusList();
if (CollectionUtils.isNotEmpty(auditStatusList)) {
order.setAuditStatusList(Collections.singletonList(auditStatusList.get(0)));
}
return order;
}
/**
* 封装所有审核进度
*
* @param order 订单
* @return 订单
*/
private SysOrder wrapAuditStatusList(SysOrder order) {
SysOrderAuditStatus record = new SysOrderAuditStatus();
record.setOrderId(order.getId());
List<SysOrderAuditStatus> auditStatusList = this.orderAuditStatusMapper.selectByRecord(
record);
order.setAuditStatusList(auditStatusList);
return order;
}
}
......@@ -35,14 +35,17 @@ import com.glsx.ordercenter.mapper.SysServiceItemMapper;
import com.glsx.ordercenter.mapper.SysSubOrderMapper;
import com.glsx.ordercenter.mapper.SysUserMapper;
import com.glsx.ordercenter.pojo.SysArea;
import com.glsx.ordercenter.pojo.SysChannelOrg;
import com.glsx.ordercenter.pojo.SysDelivery;
import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysOrderFile;
import com.glsx.ordercenter.pojo.SysOrderMaterial;
import com.glsx.ordercenter.pojo.SysOrderStatus;
import com.glsx.ordercenter.pojo.SysOrganization;
import com.glsx.ordercenter.pojo.SysServiceItem;
import com.glsx.ordercenter.pojo.SysSubOrder;
import com.glsx.ordercenter.pojo.SysSubOrderExample;
import com.glsx.ordercenter.pojo.user.SysUser;
import com.glsx.ordercenter.service.BaseOrderService;
import com.glsx.ordercenter.service.CarOrderService;
import com.glsx.ordercenter.service.IAreaService;
......@@ -1001,7 +1004,30 @@ public class CarOrderServiceImpl extends BaseOrderService implements CarOrderSer
* @return 结果
*/
private SysOrder wrapOrderChannel(SysOrder order) {
return this.orderUtil.wrapOrderChannel(order);
Integer shopId = order.getShopId();
if (shopId != null) {
// 已知渠道
SysUser shopInfo = this.userMapper.selectByPrimaryKey(shopId);
if (shopInfo != null) {
SysOrganization organization = this.organizationMapper.selectByPrimaryKey(
shopInfo.getGroupId());
order.setOrderChannel(organization.getName());
order.setOrderChannelOrgId(organization.getId());
}
} else {
// 未知渠道
SysChannelOrg example = new SysChannelOrg();
example.setChannel(order.getChannel());
SysChannelOrg channelOrg = this.channelOrgMapper.getChannelOrg(example);
if (channelOrg.getId() != null) {
SysOrganization organization = this.organizationMapper.selectByPrimaryKey(
channelOrg.getOrgid());
order.setOrderChannel(organization.getName());
order.setOrderChannelOrgId(organization.getId());
}
}
return order;
}
/**
......
......@@ -22,13 +22,8 @@ import com.glsx.ordercenter.constants.BizConstants;
import com.glsx.ordercenter.constants.OrderActiveStatusEnum;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.dto.CarInfo;
import com.glsx.ordercenter.mapper.SysChannelOrgMapper;
import com.glsx.ordercenter.mapper.SysOrderMapper;
import com.glsx.ordercenter.mapper.SysOrganizationMapper;
import com.glsx.ordercenter.mapper.SysUserMapper;
import com.glsx.ordercenter.pojo.SysChannelOrg;
import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysOrganization;
import com.glsx.ordercenter.pojo.SysResourceMatching;
import com.glsx.ordercenter.pojo.user.SysUser;
import com.glsx.ordercenter.service.IOrderService;
......@@ -57,51 +52,12 @@ public class OrderUtil {
@Autowired
private CarBrandClient carBrandClient;
@Autowired
private SysOrderMapper orderMapper;
private SysOrderMapper orderDao;
@Autowired
private IOrderService orderService;
@Autowired
private IResourceMatchingService resourceMatchingService;
@Autowired
private SysUserMapper userMapper;
@Autowired
private SysOrganizationMapper organizationMapper;
@Autowired
private SysChannelOrgMapper channelOrgMapper;
/**
* 封装开机渠道信息
*
* @param order 订单
* @return 结果
*/
public SysOrder wrapOrderChannel(SysOrder order) {
Integer shopId = order.getShopId();
if (shopId != null) {
// 已知渠道
SysUser shopInfo = this.userMapper.selectByPrimaryKey(shopId);
if (shopInfo != null) {
SysOrganization organization = this.organizationMapper.selectByPrimaryKey(
shopInfo.getGroupId());
order.setOrderChannel(organization.getName());
order.setOrderChannelOrgId(organization.getId());
}
} else {
// 未知渠道
SysChannelOrg example = new SysChannelOrg();
example.setChannel(order.getChannel());
SysChannelOrg channelOrg = this.channelOrgMapper.getChannelOrg(example);
if (channelOrg.getId() != null) {
SysOrganization organization = this.organizationMapper.selectByPrimaryKey(
channelOrg.getOrgid());
order.setOrderChannel(organization.getName());
order.setOrderChannelOrgId(organization.getId());
}
}
return order;
}
/**
* 订单类型转中文描述
......@@ -256,7 +212,7 @@ public class OrderUtil {
* @param id orderId
*/
public void sendActivateWechatRemind(Integer id) {
SysOrder order = orderMapper.selectByPrimaryKey(id);
SysOrder order = orderDao.selectByPrimaryKey(id);
// 当前订单不为空且订单状态为已完成
if (order != null && order.getActiveStatus() == 8) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
......
......@@ -435,7 +435,7 @@
#{checkInAddress,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR},
#{latitude,jdbcType=VARCHAR},
#{quoteLastTime,jdbcType=TIMESTAMP}, #{referencePrice,jdbcType=DECIMAL},
#{serviceCode,jdbcType=VARCHAR}, #{installMode,jdbcType=TINYINT},
#{serviceCode,jdbcType=VARCHAR}, #{installMode,jdbcType=TINYINT}
#{receiveTime,jdbcType=TIMESTAMP})
</insert>
......
......@@ -6,19 +6,18 @@
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="order_id" jdbcType="INTEGER" property="orderId"/>
<result column="sub_order_id" jdbcType="INTEGER" property="subOrderId"/>
<result column="file_name" jdbcType="VARCHAR" property="fileName"/>
<result column="file_path" jdbcType="VARCHAR" property="filePath"/>
<result column="file_type" jdbcType="TINYINT" property="fileType"/>
<result column="sort" jdbcType="TINYINT" property="sort"/>
<result column="create_by" jdbcType="INTEGER" property="createBy"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<!--<result column="fileName" jdbcType="VARCHAR" property="fileName"/>-->
<!--<result column="fileDesc" jdbcType="VARCHAR" property="fileDesc"/>-->
<result column="fileName" jdbcType="VARCHAR" property="fileName"/>
<result column="fileDesc" jdbcType="VARCHAR" property="fileDesc"/>
</resultMap>
<sql id="Base_Column_List">
id, order_id, sub_order_id, file_name, file_path, file_type, sort, create_by, create_time
id, order_id, sub_order_id, file_path, file_type, sort, create_by, create_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
......@@ -38,12 +37,12 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_order_file (order_id, sub_order_id, file_name, file_path, file_type, sort,
create_by, create_time)
insert into sys_order_file (order_id, sub_order_id, file_path, file_type, sort, create_by,
create_time)
values (#{orderId,jdbcType=INTEGER}, #{subOrderId,jdbcType=INTEGER},
#{fileName,jdbcType=VARCHAR}, #{filePath,jdbcType=VARCHAR},
#{fileType,jdbcType=TINYINT}, #{sort,jdbcType=TINYINT},
#{createBy,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP})
#{filePath,jdbcType=VARCHAR}, #{fileType,jdbcType=TINYINT},
#{sort,jdbcType=TINYINT}, #{createBy,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysOrderFile">
......@@ -58,9 +57,6 @@
<if test="subOrderId != null">
sub_order_id,
</if>
<if test="fileName != null">
file_name,
</if>
<if test="filePath != null">
file_path,
</if>
......@@ -84,9 +80,6 @@
<if test="subOrderId != null">
#{subOrderId,jdbcType=INTEGER},
</if>
<if test="fileName != null">
#{fileName,jdbcType=VARCHAR},
</if>
<if test="filePath != null">
#{filePath,jdbcType=VARCHAR},
</if>
......@@ -114,9 +107,6 @@
<if test="subOrderId != null">
sub_order_id = #{subOrderId,jdbcType=INTEGER},
</if>
<if test="fileName != null">
file_name = #{fileName,jdbcType=VARCHAR},
</if>
<if test="filePath != null">
file_path = #{filePath,jdbcType=VARCHAR},
</if>
......@@ -140,7 +130,6 @@
update sys_order_file
set order_id = #{orderId,jdbcType=INTEGER},
sub_order_id = #{subOrderId,jdbcType=INTEGER},
file_name = #{fileName,jdbcType=VARCHAR},
file_path = #{filePath,jdbcType=VARCHAR},
file_type = #{fileType,jdbcType=TINYINT},
sort = #{sort,jdbcType=TINYINT},
......@@ -152,12 +141,11 @@
<insert id="addOrderFileList" keyProperty="id" useGeneratedKeys="true">
insert into sys_order_file (order_id, sub_order_id, file_name, file_path, file_type, sort,
create_by, create_time)
insert into sys_order_file (order_id, sub_order_id, file_path, file_type, sort, create_by,
create_time)
values
<foreach item="item" collection="fileList" separator=",">
(#{item.orderId,jdbcType=INTEGER}, #{item.subOrderId,jdbcType=INTEGER},
#{item.fileName,jdbcType=VARCHAR},
#{item.filePath,jdbcType=VARCHAR}, #{item.fileType,jdbcType=TINYINT},
#{item.sort,jdbcType=TINYINT}, #{item.createBy,jdbcType=INTEGER},
#{item.createTime,jdbcType=TIMESTAMP})
......
......@@ -68,9 +68,6 @@
<result column="latitude" jdbcType="VARCHAR" property="latitude"/>
<result column="install_mode" jdbcType="TINYINT" property="installMode"/>
<result column="receive_time" jdbcType="TIMESTAMP" property="receiveTime"/>
<result column="audit_status" jdbcType="TINYINT" property="auditStatus"/>
<result column="audit_count" jdbcType="TINYINT" property="auditCount"/>
<result column="audit_time" jdbcType="TIMESTAMP" property="auditTime"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -103,7 +100,6 @@
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, order_sn, active_status, canceled, order_type, shop_id, district,
address ,contact, phone_number, car_brand, car_series, car_type, vin_no, car_color,
......@@ -114,9 +110,8 @@
work_order_no, work_order_number, channel,
merchant_name,reassign_mechanic_time,reserve_install_reason,connect_location_picture,surrounding_picture,is_check_in,
check_in_time,reserve_man,reserve_man_phone,quote_last_time,service_code,longitude,latitude,
receive_time, audit_status, audit_count, audit_time
receive_time
</sql>
<select id="selectByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderExample" resultMap="BaseResultMap">
select
<if test="distinct">
......@@ -133,19 +128,16 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from sys_order
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_order
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysOrder">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
......@@ -345,15 +337,6 @@
<if test="receiveTime != null">
receive_time,
</if>
<if test="auditStatus != null">
audit_status,
</if>
<if test="auditCount != null">
audit_count,
</if>
<if test="auditTime != null">
audit_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderSn != null">
......@@ -512,15 +495,6 @@
<if test="receiveTime != null">
#{receiveTime,jdbcType=TIMESTAMP},
</if>
<if test="auditStatus != null">
#{auditStatus,jdbcType=TINYINT},
</if>
<if test="auditCount != null">
#{auditCount,jdbcType=TINYINT},
</if>
<if test="auditTime != null">
#{auditTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.ordercenter.pojo.SysOrderExample" resultType="java.lang.Long">
......@@ -706,15 +680,6 @@
<if test="receiveTime != null">
receive_time = #{receiveTime,jdbcType=TIMESTAMP},
</if>
<if test="auditStatus != null">
audit_status = #{auditStatus,jdbcType=TINYINT},
</if>
<if test="auditCount != null">
audit_count = #{auditCount,jdbcType=TINYINT},
</if>
<if test="auditTime != null">
audit_time = #{auditTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -776,10 +741,7 @@
channel = #{channel,jdbcType=VARCHAR},
merchant_name = #{merchantName,jdbcType=VARCHAR},
service_code = #{serviceCode},
receive_time = #{receiveTime,jdbcType=TIMESTAMP},
audit_status = #{auditStatus,jdbcType=TINYINT},
audit_count = #{auditCount,jdbcType=TINYINT},
audit_time = #{auditTime,jdbcType=TIMESTAMP}
receive_time = #{receiveTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<resultMap id="OrderDetailResultMap" type="com.glsx.ordercenter.dto.QueryOrderResp"
......@@ -1177,15 +1139,6 @@
<if test="receiveTime != null">
receive_time = #{receiveTime,jdbcType=TIMESTAMP},
</if>
<if test="auditStatus != null">
audit_status = #{auditStatus,jdbcType=TINYINT},
</if>
<if test="auditCount != null">
audit_count = #{auditCount,jdbcType=TINYINT},
</if>
<if test="auditTime != null">
audit_time = #{auditTime,jdbcType=TIMESTAMP},
</if>
</set>
where work_order_no = #{workOrderNo}
and channel = #{channel,jdbcType=VARCHAR}
......@@ -1290,7 +1243,6 @@
</where>
ORDER BY o.create_time DESC, id DESC
</select>
<select id="getOrderListByExample" resultType="com.glsx.ordercenter.pojo.SysOrder">
SELECT DISTINCT so.id id, so.district district, so.order_sn orderSn,
so.active_status as activeStatus, so.canceled as canceled, so.order_type
......@@ -1304,8 +1256,7 @@
so.receive_time receiveTime, so.reserve_install_time reserveInstallTime,
ifnull(ssm.shop_name,so.merchant_name) as merchantName,
sd.data_value as reserveInstallReason,ssp.provider_name as serviceName,
ifnull(ssi.service_name, '') as installDeviceTypeName, ifnull(so.work_order_no, '') as workOrderNo, so.channel,
so.audit_status auditStatus, so.audit_count auditCount, so.audit_time auditTime
ifnull(ssi.service_name, '') as installDeviceTypeName, ifnull(so.work_order_no, '') as workOrderNo, so.channel
FROM
<choose>
<!--超级管理员 -->
......
......@@ -8,7 +8,6 @@
<result column="img_path" jdbcType="VARCHAR" property="imgPath"/>
<result column="push_url" jdbcType="VARCHAR" property="pushUrl"/>
<result column="is_update_info" jdbcType="TINYINT" property="isUpdateInfo"/>
<result column="is_audit" jdbcType="TINYINT" property="isAudit"/>
<result column="type" jdbcType="TINYINT" property="type"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="create_by" jdbcType="INTEGER" property="createBy"/>
......@@ -19,7 +18,7 @@
<result column="photoCount" jdbcType="INTEGER" property="photoCount"/>
</resultMap>
<sql id="Base_Column_List">
id, service_name, service_code, push_url, type, img_path, is_update_info, is_audit, remark,
id, service_name, service_code, push_url, type, img_path, is_update_info, remark,
create_by, create_time, update_by,update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
......@@ -79,9 +78,6 @@
<if test="isUpdateInfo != null">
is_update_info,
</if>
<if test="isAudit != null">
is_audit,
</if>
<if test="type != null">
type,
</if>
......@@ -117,9 +113,6 @@
<if test="isUpdateInfo != null">
#{isUpdateInfo,jdbcType=TINYINT},
</if>
<if test="isAudit != null">
#{isAudit,jdbcType=TINYINT},
</if>
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
......@@ -158,9 +151,6 @@
<if test="isUpdateInfo != null">
is_update_info = #{isUpdateInfo,jdbcType=TINYINT},
</if>
<if test="isAudit != null">
is_audit = #{isAudit,jdbcType=TINYINT},
</if>
<if test="type != null">
type = #{type,jdbcType=TINYINT},
</if>
......@@ -189,7 +179,6 @@
img_path = #{imgPath,jdbcType=VARCHAR},
push_url = #{pushUrl,jdbcType=VARCHAR},
is_update_info = #{isUpdateInfo,jdbcType=TINYINT},
is_audit = #{isAudit,jdbcType=TINYINT},
type = #{type,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=INTEGER},
......@@ -214,7 +203,6 @@
ssi.img_path,
ssi.push_url,
ssi.is_update_info,
ssi.is_audit,
ssi.type,
ssi.remark,
ssi.create_by,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!