Commit e8a6de31 by wangnb

包活干V2.0.0功能开发--think.wang

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@28223 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent aa8aa9fc
package com.glsx.ordercenter.controller; package com.glsx.ordercenter.controller;
import javax.servlet.http.HttpServletRequest;
import javax.validation.groups.Default;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
...@@ -23,40 +16,19 @@ import com.glsx.ordercenter.constants.BizConstants; ...@@ -23,40 +16,19 @@ import com.glsx.ordercenter.constants.BizConstants;
import com.glsx.ordercenter.constants.OrderActiveStatusEnum; import com.glsx.ordercenter.constants.OrderActiveStatusEnum;
import com.glsx.ordercenter.constants.OrderTypeEnum; import com.glsx.ordercenter.constants.OrderTypeEnum;
import com.glsx.ordercenter.constants.ResultCodeEnum; import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.dto.BizAmountResp; import com.glsx.ordercenter.dto.*;
import com.glsx.ordercenter.dto.CreateAfterSaleRepairReq;
import com.glsx.ordercenter.dto.MechanicBusiness;
import com.glsx.ordercenter.dto.MechanicStatistics;
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.QueryOrderReq;
import com.glsx.ordercenter.dto.ServiceItemScale;
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.pojo.GroupA; import com.glsx.ordercenter.pojo.*;
import com.glsx.ordercenter.pojo.SysOrder; import com.glsx.ordercenter.service.*;
import com.glsx.ordercenter.pojo.SysOrderDevice;
import com.glsx.ordercenter.pojo.SysOrderDeviceSupplier;
import com.glsx.ordercenter.pojo.SysOrderExample;
import com.glsx.ordercenter.pojo.SysReserveInstallLog;
import com.glsx.ordercenter.pojo.SysServiceItemDeviceConfig;
import com.glsx.ordercenter.pojo.SysServiceItemPhotoConfig;
import com.glsx.ordercenter.service.DscFeedbackService;
import com.glsx.ordercenter.service.IOrderChannelService;
import com.glsx.ordercenter.service.IOrderDeviceService;
import com.glsx.ordercenter.service.IOrderService;
import com.glsx.ordercenter.service.OraOrderService;
import com.glsx.ordercenter.service.ReserveInstallLogService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestParam; import javax.validation.groups.Default;
import org.springframework.web.bind.annotation.RestController; import java.util.*;
/** /**
* @author Zheng Xiajun * @author Zheng Xiajun
...@@ -276,11 +248,9 @@ public class OrderController extends BaseController { ...@@ -276,11 +248,9 @@ public class OrderController extends BaseController {
@RequestMapping(value = "/getOrderDetail", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/getOrderDetail", method = {RequestMethod.GET, RequestMethod.POST})
public ResultObject getOrderDetail(HttpServletRequest request, Integer id, String orderSn) { public ResultObject getOrderDetail(HttpServletRequest request, Integer id, String orderSn) {
logger.info("已登录状态---查看订单详情....orderId:" + id + ",orderSn:" + orderSn); logger.info("已登录状态---查看订单详情....orderId:" + id + ",orderSn:" + orderSn);
if (id == null) { if (id == null) {
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), "id不能为空"); return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), "id不能为空");
} }
// 获取当前用户信息 根据用户角色筛选订单 // 获取当前用户信息 根据用户角色筛选订单
SysOrder sysOrderDetail = orderService.getOrderDetail(id, orderSn, UserUtils.getUserId(request)); SysOrder sysOrderDetail = orderService.getOrderDetail(id, orderSn, UserUtils.getUserId(request));
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), sysOrderDetail); return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), sysOrderDetail);
......
package com.glsx.ordercenter.controller; package com.glsx.ordercenter.controller;
import java.util.HashMap; import com.glsx.common.annotation.AuthCheck;
import java.util.List; import com.glsx.ordercenter.constants.ResultCodeEnum;
import java.util.Map; import com.glsx.ordercenter.pojo.SysOrderStatus;
import com.glsx.ordercenter.service.IOrderStatusService;
import com.glsx.plat.core.web.R;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
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; import org.springframework.web.bind.annotation.RestController;
import com.glsx.common.annotation.AuthCheck; import java.util.HashMap;
import com.glsx.common.constants.ResultObject; import java.util.List;
import com.glsx.ordercenter.constants.ResultCodeEnum; import java.util.Map;
import com.glsx.ordercenter.pojo.SysOrderStatus;
import com.glsx.ordercenter.service.IOrderStatusService;
/** /**
* *
* @Title OrderStatusController.java * @Title OrderStatusController.java
* @Package com.glsx.ordercenter.controller * @Package com.glsx.ordercenter.controller
* @Description TODO 订单状态变化流水controller * @Description 订单状态变化流水controller
* @author zhanghj * @author zhanghj
* @date 2019年7月15日 上午10:08:27 * @date 2019年7月15日 上午10:08:27
* @version 1.0.0 * @version 1.0.0
...@@ -35,7 +34,7 @@ public class OrderStatusController { ...@@ -35,7 +34,7 @@ public class OrderStatusController {
* *
* @author zhanghj * @author zhanghj
* @Title: getOrderProgress * @Title: getOrderProgress
* @Description: TODO 获取订单进度列表 * @Description: 获取订单进度列表
* @param orderId * @param orderId
* @return * @return
* ResultObject * ResultObject
...@@ -43,13 +42,14 @@ public class OrderStatusController { ...@@ -43,13 +42,14 @@ public class OrderStatusController {
*/ */
@AuthCheck @AuthCheck
@RequestMapping(value="/getOrderProgress", method=RequestMethod.GET) @RequestMapping(value="/getOrderProgress", method=RequestMethod.GET)
public ResultObject getOrderProgress(Integer orderId) { public R getOrderProgress(Integer orderId) {
if (orderId == null) { if (orderId == null) {
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg()); return R.error(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg());
} }
Map<String, Object> result = new HashMap<String, Object>(); Map<String, Object> result = new HashMap<>();
List<SysOrderStatus> list = orderStatusService.getOrderProgress(orderId); List<SysOrderStatus> list = orderStatusService.getOrderProgress(orderId);
result.put("items", list); result.put("items", list);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), result); return R.ok().data(result);
} }
} }
package com.glsx.ordercenter.controller; package com.glsx.ordercenter.controller;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.validation.groups.Default;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.glsx.common.annotation.AuthCheck; import com.glsx.common.annotation.AuthCheck;
import com.glsx.common.constants.ResultObject;
import com.glsx.common.utils.Page; import com.glsx.common.utils.Page;
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.pojo.GroupA; import com.glsx.ordercenter.pojo.GroupA;
import com.glsx.ordercenter.pojo.SysOrder;
import com.glsx.ordercenter.pojo.SysServiceItem; import com.glsx.ordercenter.pojo.SysServiceItem;
import com.glsx.ordercenter.service.IServiceItemService; import com.glsx.ordercenter.service.IServiceItemService;
import com.glsx.plat.core.web.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.groups.Default;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* * @author zhanghj
* @version 1.5.0
* @Title ServiceItemController.java * @Title ServiceItemController.java
* @Package com.glsx.ordercenter.controller * @Package com.glsx.ordercenter.controller
* @Description TODO 服务项目controller * @Description 服务项目controller
* @author zhanghj
* @date 2019年9月30日 下午2:12:52 * @date 2019年9月30日 下午2:12:52
* @version 1.5.0
*/ */
@Slf4j
@RestController @RestController
@RequestMapping(value="/serviceItme") @RequestMapping(value = "/serviceItme")
public class ServiceItemController extends BaseController{ public class ServiceItemController extends BaseController {
private Logger log = LoggerFactory.getLogger(ServiceItemController.class);
@Autowired @Autowired
private IServiceItemService serviceItemService; private IServiceItemService serviceItemService;
@AuthCheck @AuthCheck
@RequestMapping(value="/add", method=RequestMethod.POST) @RequestMapping(value = "/add", method = RequestMethod.POST)
public ResultObject add(HttpServletRequest request, @RequestBody @Validated(value=Default.class)SysServiceItem serviceItem, BindingResult bindingResult) { public R add(HttpServletRequest request, @RequestBody @Validated(value = Default.class) SysServiceItem serviceItem, BindingResult bindingResult) {
if (bindingResult.hasErrors()) { if (bindingResult.hasErrors()) {
Map<String, String> errorMap = getErrors(bindingResult); Map<String, String> errorMap = getErrors(bindingResult);
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg(), errorMap); return R.error(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg()).data(errorMap);
} }
String serviceCode = serviceItem.getServiceCode(); SysServiceItem item = serviceItemService.selectByServiceCode(serviceItem.getServiceCode());
SysServiceItem item = new SysServiceItem(); if (item != null) {
item.setServiceCode(serviceCode); return R.error(ResultCodeEnum.SERVICE_ITEM_SERVICE_CODE_EXIST.getCode(), ResultCodeEnum.SERVICE_ITEM_SERVICE_CODE_EXIST.getMsg());
SysServiceItem sysServiceItem = serviceItemService.getServiceItem(item);
if (sysServiceItem != null) {
return new ResultObject(ResultCodeEnum.SERVICE_ITEM_SERVICE_CODE_EXIST.getCode(), ResultCodeEnum.SERVICE_ITEM_SERVICE_CODE_EXIST.getMsg());
} }
Integer userId = UserUtils.getUserId(request); Integer userId = UserUtils.getUserId(request);
serviceItem.setCreateBy(userId); serviceItem.setCreateBy(userId);
serviceItem.setCreateTime(new Date()); serviceItem.setCreateTime(new Date());
serviceItemService.add(serviceItem); serviceItemService.add(serviceItem);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg()); return R.ok();
} }
@AuthCheck @AuthCheck
@RequestMapping(value="/update", method=RequestMethod.POST) @RequestMapping(value = "/update", method = RequestMethod.POST)
public ResultObject update(HttpServletRequest request, @RequestBody @Validated(value=GroupA.class)SysServiceItem serviceItem, BindingResult bindingResult) { public R update(HttpServletRequest request, @RequestBody @Validated(value = GroupA.class) SysServiceItem serviceItem, BindingResult bindingResult) {
if (bindingResult.hasErrors()) { if (bindingResult.hasErrors()) {
Map<String, String> errorMap = getErrors(bindingResult); Map<String, String> errorMap = getErrors(bindingResult);
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg(), errorMap); return R.error(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg()).data(errorMap);
} }
String serviceCode = serviceItem.getServiceCode(); SysServiceItem item = serviceItemService.selectByServiceCode(serviceItem.getServiceCode());
Integer id = serviceItem.getId(); if (item != null && !item.getId().equals(serviceItem.getId())) {
SysServiceItem item = new SysServiceItem(); return R.error(ResultCodeEnum.SERVICE_ITEM_SERVICE_CODE_EXIST.getCode(), ResultCodeEnum.SERVICE_ITEM_SERVICE_CODE_EXIST.getMsg());
item.setServiceCode(serviceCode);
SysServiceItem sysServiceItem = serviceItemService.getServiceItem(item);
if (sysServiceItem != null && ! id.equals(sysServiceItem.getId())) {
return new ResultObject(ResultCodeEnum.SERVICE_ITEM_SERVICE_CODE_EXIST.getCode(), ResultCodeEnum.SERVICE_ITEM_SERVICE_CODE_EXIST.getMsg());
} }
Integer userId = UserUtils.getUserId(request); Integer userId = UserUtils.getUserId(request);
serviceItem.setUpdateBy(userId); serviceItem.setUpdateBy(userId);
serviceItem.setUpdateTime(new Date()); serviceItem.setUpdateTime(new Date());
int num = serviceItemService.update(serviceItem); serviceItemService.update(serviceItem);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg()); return R.ok();
} }
@AuthCheck @AuthCheck
@RequestMapping(value="/delete", method=RequestMethod.POST) @RequestMapping(value = "/delete", method = RequestMethod.POST)
public ResultObject delete(HttpServletRequest request, Integer id) { public R delete(HttpServletRequest request, Integer id) {
if (id == null) { if (id == null) {
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg()); return R.error(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg());
} }
int num = serviceItemService.delete(id); serviceItemService.delete(id);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg()); return R.ok();
} }
@AuthCheck @AuthCheck
@RequestMapping(value="/getServiceItemList", method=RequestMethod.GET) @RequestMapping(value = "/getServiceItemList", method = RequestMethod.GET)
public ResultObject getServiceItemList(HttpServletRequest request, @RequestParam(defaultValue = "1") int pageIndex, @RequestParam(defaultValue = "10") int pageSize public R getServiceItemList(HttpServletRequest request, @RequestParam(defaultValue = "1") int pageIndex, @RequestParam(defaultValue = "10") int pageSize
, String keyWord) { , String keyWord) {
Map<String, Object> result = new HashMap<String, Object>(); Map<String, Object> result = new HashMap<>();
Page page = new Page(pageIndex, pageSize); Page page = new Page(pageIndex, pageSize);
List<SysServiceItem> list = serviceItemService.getServiceItemList(page, keyWord); List<SysServiceItem> list = serviceItemService.getServiceItemList(page, keyWord);
...@@ -112,24 +95,22 @@ public class ServiceItemController extends BaseController{ ...@@ -112,24 +95,22 @@ public class ServiceItemController extends BaseController{
page.setTotalCount((int) pages.getTotal()); page.setTotalCount((int) pages.getTotal());
result.put("page", page); result.put("page", page);
result.put("items", list); result.put("items", list);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), result); return R.ok().data(result);
} }
@AuthCheck @AuthCheck
@RequestMapping(value="/getDetail", method=RequestMethod.GET) @RequestMapping(value = "/getDetail", method = RequestMethod.GET)
public ResultObject getDetail(HttpServletRequest request, Integer id) { public R getDetail(HttpServletRequest request, Integer id) {
if (id == null) { if (id == null) {
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg()); return R.error(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg());
} }
SysServiceItem serviceItem = serviceItemService.getDetail(id); SysServiceItem serviceItem = serviceItemService.getDetail(id);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), serviceItem); return R.ok().data(serviceItem);
} }
// @AuthCheck // @AuthCheck
@RequestMapping(value = "/getAll", method = RequestMethod.GET) @RequestMapping(value = "/getAll", method = RequestMethod.GET)
public ResultObject getServiceItemList() { public R getServiceItemByType(Integer type) {
return R.ok().data(serviceItemService.selectByType(type));
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(),
serviceItemService.selectAll());
} }
} }
/*
* Copyright (c) 2018, 2028, glsx and/or its affiliates. All rights reserved.
* GLSX PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.glsx.ordercenter.dto; package com.glsx.ordercenter.dto;
/** /**
* @ClassName: ServiceItem * @ClassName: ServiceItem
* @Description: TODO(这里用一句话描述这个类的作用) * @Description: 服务项目
* @author Zheng Xiajun * @author Zheng Xiajun
* @date 2019年11月2日 * @date 2019年11月2日
* *
...@@ -39,6 +15,8 @@ public class ServiceItem { ...@@ -39,6 +15,8 @@ public class ServiceItem {
private String serviceName; private String serviceName;
private Integer type;
public String getServiceCode() { public String getServiceCode() {
return serviceCode; return serviceCode;
} }
...@@ -63,4 +41,11 @@ public class ServiceItem { ...@@ -63,4 +41,11 @@ public class ServiceItem {
this.id = id; this.id = id;
} }
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
} }
package com.glsx.ordercenter.mapper; package com.glsx.ordercenter.mapper;
import java.util.List; import com.glsx.ordercenter.pojo.SysOrderStatus;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.glsx.ordercenter.pojo.SysOrderStatus; import java.util.List;
public interface SysOrderStatusMapper { public interface SysOrderStatusMapper {
...@@ -21,20 +20,13 @@ public interface SysOrderStatusMapper { ...@@ -21,20 +20,13 @@ public interface SysOrderStatusMapper {
int updateByPrimaryKey(SysOrderStatus record); int updateByPrimaryKey(SysOrderStatus record);
/** /**
* * 获取订单进度列表
* @author zhanghj
* @Title: getOrderProgress
* @Description: TODO 获取订单进度列表
* @param orderId * @param orderId
* @return * @return
* List<SysOrderStatus>
*
*/ */
List<SysOrderStatus> getOrderProgress(@Param("orderId")Integer orderId); List<SysOrderStatus> getOrderProgress(@Param("orderId")Integer orderId);
SysOrderStatus getLastOrderStatus(@Param("orderId")Integer orderId);
SysOrderStatus getTheLastestOrderStatus(@Param("orderId")Integer orderId);
int updateRemark(SysOrderStatus record); int updateRemark(SysOrderStatus record);
} }
\ No newline at end of file \ No newline at end of file
package com.glsx.ordercenter.mapper; package com.glsx.ordercenter.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.glsx.ordercenter.dto.ServiceItem; import com.glsx.ordercenter.dto.ServiceItem;
import com.glsx.ordercenter.pojo.SysServiceItem; import com.glsx.ordercenter.pojo.SysServiceItem;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* *
* @Title SysServiceItemMapper.java * @Title SysServiceItemMapper.java
* @Package com.glsx.ordercenter.mapper * @Package com.glsx.ordercenter.mapper
* @Description TODO 服务项目mapper * @Description 服务项目mapper
* @author zhanghj * @author zhanghj
* @date 2019年9月27日 下午5:32:43 * @date 2019年9月27日 下午5:32:43
* @version 1.0.0 * @version 1.0.0
...@@ -32,20 +31,15 @@ public interface SysServiceItemMapper { ...@@ -32,20 +31,15 @@ public interface SysServiceItemMapper {
SysServiceItem getServiceItem(SysServiceItem item); SysServiceItem getServiceItem(SysServiceItem item);
/** /**
* * 获取服务项目列表
* @author zhanghj
* @Title: getServiceItemList
* @Description: TODO 获取服务项目列表
* @param keyWord * @param keyWord
* @return * @return
* List<SysServiceItem>
*
*/ */
List<SysServiceItem> getServiceItemList(@Param("keyWord")String keyWord); List<SysServiceItem> getServiceItemList(@Param("keyWord")String keyWord);
SysServiceItem selectByServiceCode(@Param("serviceCode") String serviceCode); SysServiceItem selectByServiceCode(@Param("serviceCode") String serviceCode);
List<ServiceItem> selectAll(); List<ServiceItem> selectByType(@Param("type") Integer type);
List<SysServiceItem> selectListByCodes(List<String> codes); List<SysServiceItem> selectListByCodes(List<String> codes);
......
package com.glsx.ordercenter.mapper; package com.glsx.ordercenter.mapper;
import java.util.List;
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;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
@Repository @Repository
public interface SysSubOrderMapper { public interface SysSubOrderMapper {
long countByExample(SysSubOrderExample example); long countByExample(SysSubOrderExample example);
...@@ -20,6 +21,8 @@ public interface SysSubOrderMapper { ...@@ -20,6 +21,8 @@ public interface SysSubOrderMapper {
List<SysSubOrder> selectByExample(SysSubOrderExample example); List<SysSubOrder> selectByExample(SysSubOrderExample example);
int getCountByParams(SysSubOrderExample example);
SysSubOrder selectByPrimaryKey(Integer id); SysSubOrder selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysSubOrder record, @Param("example") SysSubOrderExample example); int updateByExampleSelective(@Param("record") SysSubOrder record, @Param("example") SysSubOrderExample example);
......
...@@ -6,15 +6,14 @@ import javax.validation.groups.Default; ...@@ -6,15 +6,14 @@ import javax.validation.groups.Default;
import java.util.List; import java.util.List;
public class SysServiceItem extends BaseModel {
public class SysServiceItem extends BaseModel{ @NotNull(message = "{param.not.null}", groups = {GroupA.class})
@NotNull(message="{param.not.null}", groups={GroupA.class})
private Integer id; private Integer id;
/** /**
* 服务名称 * 服务名称
*/ */
@NotBlank(message="{param.not.null}", groups={Default.class, GroupA.class}) @NotBlank(message = "{param.not.null}", groups = {Default.class, GroupA.class})
private String serviceName; private String serviceName;
private String serviceCode; private String serviceCode;
...@@ -22,11 +21,21 @@ public class SysServiceItem extends BaseModel{ ...@@ -22,11 +21,21 @@ public class SysServiceItem extends BaseModel{
private String imgPath; private String imgPath;
/** /**
* 车务单推送接口
*/
private String pushUrl;
/**
* 新增工单信息补录 * 新增工单信息补录
*/ */
private Byte isUpdateInfo; private Byte isUpdateInfo;
/** /**
* 业务类型
*/
private Byte type;
/**
* 设备配置列表 * 设备配置列表
*/ */
private List<SysServiceItemDeviceConfig> deviceConfigList; private List<SysServiceItemDeviceConfig> deviceConfigList;
...@@ -117,4 +126,19 @@ public class SysServiceItem extends BaseModel{ ...@@ -117,4 +126,19 @@ public class SysServiceItem extends BaseModel{
this.deviceTypeName = deviceTypeName; this.deviceTypeName = deviceTypeName;
} }
public String getPushUrl() {
return pushUrl;
}
public void setPushUrl(String pushUrl) {
this.pushUrl = pushUrl;
}
public Byte getType() {
return type;
}
public void setType(Byte type) {
this.type = type;
}
} }
\ No newline at end of file \ No newline at end of file
package com.glsx.ordercenter.service; package com.glsx.ordercenter.service;
import java.util.List;
import com.glsx.common.utils.Page; import com.glsx.common.utils.Page;
import com.glsx.ordercenter.dto.ServiceItem; import com.glsx.ordercenter.dto.ServiceItem;
import com.glsx.ordercenter.pojo.SysServiceItem; import com.glsx.ordercenter.pojo.SysServiceItem;
import java.util.List;
/** /**
* *
* @Title IServiceItem.java * @Title IServiceItem.java
...@@ -18,78 +18,60 @@ import com.glsx.ordercenter.pojo.SysServiceItem; ...@@ -18,78 +18,60 @@ import com.glsx.ordercenter.pojo.SysServiceItem;
public interface IServiceItemService { public interface IServiceItemService {
/** /**
* * 增加服务项目
* @author zhanghj
* @Title: add
* @Description: TODO 增加服务项目
* @param serviceItem * @param serviceItem
* @return * @return
* int
*
*/ */
int add(SysServiceItem serviceItem); int add(SysServiceItem serviceItem);
/** /**
* * 获取服务项目
* @author zhanghj
* @Title: getServiceItem
* @Description: TODO 获取服务项目
* @param item * @param item
* @return * @return
* SysServiceItem
*
*/ */
SysServiceItem getServiceItem(SysServiceItem item); SysServiceItem getServiceItem(SysServiceItem item);
/** /**
* * 更新某个服务项目
* @author zhanghj
* @Title: update
* @Description: TODO 更新某个服务项目
* @param serviceItem * @param serviceItem
* @return * @return
* int
*
*/ */
int update(SysServiceItem serviceItem); int update(SysServiceItem serviceItem);
/** /**
* * 删除服务项目
* @author zhanghj
* @Title: delete
* @Description: TODO 删除服务项目
* @param id * @param id
* @return * @return
* int
*
*/ */
int delete(Integer id); int delete(Integer id);
/** /**
* * 获取服务项目列表
* @author zhanghj
* @Title: getServiceItemList
* @Description: TODO 获取服务项目列表
* @param page * @param page
* @param keyWord * @param keyWord
* @return * @return
* List<SysServiceItem>
*
*/ */
List<SysServiceItem> getServiceItemList(Page page, String keyWord); List<SysServiceItem> getServiceItemList(Page page, String keyWord);
/** /**
* * 获取服务项目详情
* @author zhanghj
* @Title: getDetail
* @Description: TODO 获取服务项目详情
* @param id * @param id
* @return * @return
* SysServiceItem
*
*/ */
SysServiceItem getDetail(Integer id); SysServiceItem getDetail(Integer id);
List<ServiceItem> selectAll(); /**
* 通过业务类型查找
* @return
*/
List<ServiceItem> selectByType(Integer type);
/**
* 通过serviceCode查找服务项目
* @param serviceCode
* @return
*/
SysServiceItem selectByServiceCode(String serviceCode);
} }
package com.glsx.ordercenter.service.impl; package com.glsx.ordercenter.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.glsx.ordercenter.mapper.SysOrderStatusMapper; import com.glsx.ordercenter.mapper.SysOrderStatusMapper;
import com.glsx.ordercenter.pojo.SysOrderStatus; import com.glsx.ordercenter.pojo.SysOrderStatus;
import com.glsx.ordercenter.service.IOrderStatusService; import com.glsx.ordercenter.service.IOrderStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* *
* @Title OrderStatusServiceImpl.java * @Title OrderStatusServiceImpl.java
* @Package com.glsx.ordercenter.service.impl * @Package com.glsx.ordercenter.service.impl
* @Description TODO 订单状态变化流水 * @Description 订单状态变化流水
* @author zhanghj * @author zhanghj
* @date 2019年7月15日 上午10:50:09 * @date 2019年7月15日 上午10:50:09
* @version 1.0.0 * @version 1.0.0
...@@ -22,12 +21,11 @@ import com.glsx.ordercenter.service.IOrderStatusService; ...@@ -22,12 +21,11 @@ import com.glsx.ordercenter.service.IOrderStatusService;
public class OrderStatusServiceImpl implements IOrderStatusService{ public class OrderStatusServiceImpl implements IOrderStatusService{
@Autowired @Autowired
private SysOrderStatusMapper orderStatusDao; private SysOrderStatusMapper orderStatusMapper;
@Override @Override
public List<SysOrderStatus> getOrderProgress(Integer orderId) { public List<SysOrderStatus> getOrderProgress(Integer orderId) {
// TODO Auto-generated method stub return orderStatusMapper.getOrderProgress(orderId);
return orderStatusDao.getOrderProgress(orderId);
} }
} }
...@@ -142,8 +142,12 @@ public class ServiceItemImpl implements IServiceItemService { ...@@ -142,8 +142,12 @@ public class ServiceItemImpl implements IServiceItemService {
} }
@Override @Override
public List<ServiceItem> selectAll() { public List<ServiceItem> selectByType(Integer type) {
return serviceItemMapper.selectAll(); return serviceItemMapper.selectByType(type);
} }
@Override
public SysServiceItem selectByServiceCode(String serviceCode) {
return serviceItemMapper.selectByServiceCode(serviceCode);
}
} }
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause"/> <include refid="Example_Where_Clause"/>
</if> </if>
and order_type!=5 and order_type != 5
<if test="orderByClause != null"> <if test="orderByClause != null">
order by ${orderByClause} order by ${orderByClause}
</if> </if>
...@@ -754,31 +754,20 @@ ...@@ -754,31 +754,20 @@
<result column="shop_id" jdbcType="INTEGER" property="shopId"/> <result column="shop_id" jdbcType="INTEGER" property="shopId"/>
<result column="biz_amount" jdbcType="BIGINT" property="bizAmount"/> <result column="biz_amount" jdbcType="BIGINT" property="bizAmount"/>
</resultMap> </resultMap>
<!-- <select id="selectByParams" parameterType="com.glsx.ordercenter.pojo.SysOrderExample"
resultMap="OrderDetailResultMap"> SELECT so.*,sm.shop_name,su.`name`,su.phone_number
FROM sys_order so LEFT JOIN sys_merchant sm ON so.merchant_id = sm.id LEFT
JOIN sys_user su ON sm.user_id = su.id LEFT JOIN sys_mechanic smc ON so.mechanic_id
= smc.id and smc.user_id = su.id <if test="_parameter != null"> <include
refid="Example_Where_Clause" /> </if> <if test="orderByClause != null"> order
by ${orderByClause} </if> </select> -->
<select id="selectByParams" parameterType="com.glsx.ordercenter.pojo.SysOrderExample" <select id="selectByParams" parameterType="com.glsx.ordercenter.pojo.SysOrderExample" resultMap="BaseResultMap">
resultMap="OrderDetailResultMap"> select
SELECT <if test="distinct">
so.*, sm.shop_name distinct
FROM
sys_order so
LEFT JOIN sys_merchant sm ON
so.merchant_id = sm.id
LEFT JOIN sys_user su ON sm.user_id = su.id
<where>
<if test="id != null">
and id = #{id,jdbcType=INTEGER}
</if> </if>
<if test="orderSn != null"> <include refid="Base_Column_List"/>
and order_sn = #{orderSn,jdbcType=VARCHAR} from sys_order
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if> </if>
</where>
</select> </select>
<select id="countByParams" parameterType="java.util.Map" resultMap="OrderCountResultMap"> <select id="countByParams" parameterType="java.util.Map" resultMap="OrderCountResultMap">
...@@ -829,8 +818,8 @@ ...@@ -829,8 +818,8 @@
<select id="getServiceItemScale" resultType="com.glsx.ordercenter.dto.ServiceItemInfo"> <select id="getServiceItemScale" resultType="com.glsx.ordercenter.dto.ServiceItemInfo">
SELECT SELECT
install_device_type installDeviceType, so.service_code installDeviceType,
COUNT(install_device_type) count COUNT(so.service_code) count
<choose> <choose>
<when test="userType == 1"> <when test="userType == 1">
FROM FROM
...@@ -850,7 +839,7 @@ ...@@ -850,7 +839,7 @@
<if test="dateStart != null and dateEnd!=null and dateStart !='' and dateEnd !=''"> <if test="dateStart != null and dateEnd!=null and dateStart !='' and dateEnd !=''">
and so.complete_time between #{dateStart,jdbcType=TIMESTAMP} and #{dateEnd,jdbcType=TIMESTAMP} and so.complete_time between #{dateStart,jdbcType=TIMESTAMP} and #{dateEnd,jdbcType=TIMESTAMP}
</if> </if>
GROUP BY install_device_type GROUP BY so.service_code
</select> </select>
<select id="getMechanicBusiness" resultType="com.glsx.ordercenter.dto.MechanicBusiness"> <select id="getMechanicBusiness" resultType="com.glsx.ordercenter.dto.MechanicBusiness">
...@@ -1503,7 +1492,7 @@ ...@@ -1503,7 +1492,7 @@
LEFT JOIN sys_dict_data dd on so.install_device_type = dd.data_key LEFT JOIN sys_dict_data dd on so.install_device_type = dd.data_key
LEFT JOIN sys_service_item ssi on so.service_code=ssi.service_code LEFT JOIN sys_service_item ssi on so.service_code=ssi.service_code
WHERE so.active_status &lt;&gt; 9 WHERE so.active_status &lt;&gt; 9
and so.order_type &lt;&gt; 4 AND so.order_type IN (1,2,3)
<if test="userId != null and userId!=''"> <if test="userId != null and userId!=''">
AND suo.user_id = #{userId} AND suo.user_id = #{userId}
</if> </if>
......
...@@ -184,23 +184,23 @@ ...@@ -184,23 +184,23 @@
</update> </update>
<select id="getOrderProgress" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="getOrderProgress" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select SELECT
( CASE WHEN sos.update_by is NULL ( CASE WHEN sos.update_by IS NULL
THEN so.merchant_name THEN so.merchant_name
ELSE su.name ELSE su.name
END ) AS `name`, END ) AS `name`,
sos.id, sos.order_id, sos.active_status, sos.update_time, sos.update_by, sos.id, sos.order_id, sos.active_status, sos.update_time, sos.update_by,
sos.reason, sos.property1, sos.property2, sos.phone1, sos.phone2, sos.reason, sos.property1, sos.property2, sos.phone1, sos.phone2,
sos.remark, sos.is_show sos.remark, sos.is_show
from sys_order_status sos FROM sys_order_status sos
LEFT JOIN sys_order so ON sos.order_id = so.id LEFT JOIN sys_order so ON sos.order_id = so.id
left join sys_user su on sos.update_by = su.id LEFT JOIN sys_user su ON sos.update_by = su.id
where sos.order_id = #{orderId} WHERE sos.order_id = #{orderId}
and sos.is_show = 1 AND sos.is_show = 1
order by sos.update_time desc, sos.id desc ORDER BY sos.update_time DESC, sos.id DESC
</select> </select>
<select id="getTheLastestOrderStatus" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="getLastOrderStatus" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from sys_order_status from sys_order_status
......
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
<result column="service_name" jdbcType="VARCHAR" property="serviceName"/> <result column="service_name" jdbcType="VARCHAR" property="serviceName"/>
<result column="service_code" jdbcType="VARCHAR" property="serviceCode"/> <result column="service_code" jdbcType="VARCHAR" property="serviceCode"/>
<result column="img_path" jdbcType="VARCHAR" property="imgPath"/> <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_update_info" jdbcType="TINYINT" property="isUpdateInfo"/>
<result column="type" jdbcType="TINYINT" property="type"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/> <result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="create_by" jdbcType="INTEGER" property="createBy"/> <result column="create_by" jdbcType="INTEGER" property="createBy"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
...@@ -16,8 +18,8 @@ ...@@ -16,8 +18,8 @@
<result column="photoCount" jdbcType="INTEGER" property="photoCount"/> <result column="photoCount" jdbcType="INTEGER" property="photoCount"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, service_name, service_code, img_path, is_update_info, remark, create_by, create_time, update_by, id, service_name, service_code, push_url, type, img_path, is_update_info, remark,
update_time create_by, create_time, update_by,update_time
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
...@@ -70,9 +72,15 @@ ...@@ -70,9 +72,15 @@
<if test="imgPath != null"> <if test="imgPath != null">
img_path, img_path,
</if> </if>
<if test="pushUrl != null">
push_url,
</if>
<if test="isUpdateInfo != null"> <if test="isUpdateInfo != null">
is_update_info, is_update_info,
</if> </if>
<if test="type != null">
type,
</if>
<if test="remark != null"> <if test="remark != null">
remark, remark,
</if> </if>
...@@ -99,9 +107,15 @@ ...@@ -99,9 +107,15 @@
<if test="imgPath != null"> <if test="imgPath != null">
#{imgPath,jdbcType=VARCHAR}, #{imgPath,jdbcType=VARCHAR},
</if> </if>
<if test="pushUrl != null">
#{pushUrl,jdbcType=VARCHAR},
</if>
<if test="isUpdateInfo != null"> <if test="isUpdateInfo != null">
#{isUpdateInfo,jdbcType=TINYINT}, #{isUpdateInfo,jdbcType=TINYINT},
</if> </if>
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
<if test="remark != null"> <if test="remark != null">
#{remark,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
</if> </if>
...@@ -131,9 +145,15 @@ ...@@ -131,9 +145,15 @@
<if test="imgPath != null"> <if test="imgPath != null">
img_path = #{imgPath,jdbcType=VARCHAR}, img_path = #{imgPath,jdbcType=VARCHAR},
</if> </if>
<if test="pushUrl != null">
push_url = #{pushUrl,jdbcType=VARCHAR},
</if>
<if test="isUpdateInfo != null"> <if test="isUpdateInfo != null">
is_update_info = #{isUpdateInfo,jdbcType=TINYINT}, is_update_info = #{isUpdateInfo,jdbcType=TINYINT},
</if> </if>
<if test="type != null">
type = #{type,jdbcType=TINYINT},
</if>
<if test="remark != null"> <if test="remark != null">
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
</if> </if>
...@@ -157,6 +177,9 @@ ...@@ -157,6 +177,9 @@
set service_name = #{serviceName,jdbcType=VARCHAR}, set service_name = #{serviceName,jdbcType=VARCHAR},
service_code = #{serviceCode,jdbcType=VARCHAR}, service_code = #{serviceCode,jdbcType=VARCHAR},
img_path = #{imgPath,jdbcType=VARCHAR}, img_path = #{imgPath,jdbcType=VARCHAR},
push_url = #{pushUrl,jdbcType=VARCHAR},
is_update_info = #{isUpdateInfo,jdbcType=TINYINT},
type = #{type,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=INTEGER}, create_by = #{createBy,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
...@@ -178,7 +201,9 @@ ...@@ -178,7 +201,9 @@
ssi.service_name, ssi.service_name,
ssi.service_code, ssi.service_code,
ssi.img_path, ssi.img_path,
ssi.push_url,
ssi.is_update_info, ssi.is_update_info,
ssi.type,
ssi.remark, ssi.remark,
ssi.create_by, ssi.create_by,
ssi.create_time, ssi.create_time,
...@@ -223,12 +248,16 @@ ...@@ -223,12 +248,16 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from sys_service_item from sys_service_item
where service_code = #{serviceCode,jdbcType=VARCHAR} where service_code = #{serviceCode,jdbcType=VARCHAR} limit 1
</select> </select>
<select id="selectAll" resultType="com.glsx.ordercenter.dto.ServiceItem"> <select id="selectByType" parameterType="java.lang.Integer" resultType="com.glsx.ordercenter.dto.ServiceItem">
select id, service_name as serviceName,service_code as serviceCode SELECT id, service_name AS serviceName,service_code AS serviceCode, `type` FROM sys_service_item
from sys_service_item <where>
<if test="type != null">
type = #{type, jdbcType=TINYINT}
</if>
</where>
</select> </select>
<select id="selectListByCodes" resultMap="BaseResultMap"> <select id="selectListByCodes" resultMap="BaseResultMap">
......
...@@ -101,6 +101,13 @@ ...@@ -101,6 +101,13 @@
</if> </if>
</select> </select>
<select id="getCountByParams" parameterType="com.glsx.ordercenter.pojo.SysSubOrderExample" resultType="java.lang.Integer">
select count(id) from sys_sub_order
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!