部分接口增加日志以便排查问题;关闭mybatis日志
This commit is contained in:
parent
d4cd85c72b
commit
4e253e37a6
|
|
@ -1,22 +1,22 @@
|
|||
package com.ghy.web.controller.order;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ghy.common.annotation.Log;
|
||||
import com.ghy.common.core.controller.BaseController;
|
||||
import com.ghy.common.core.domain.AjaxResult;
|
||||
import com.ghy.common.core.page.TableDataInfo;
|
||||
import com.ghy.common.enums.BusinessType;
|
||||
import com.ghy.common.utils.poi.ExcelUtil;
|
||||
import com.ghy.order.domain.AfterServiceRecord;
|
||||
import com.ghy.order.service.IAfterServiceRecordService;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ghy.common.annotation.Log;
|
||||
import com.ghy.common.enums.BusinessType;
|
||||
import com.ghy.order.domain.AfterServiceRecord;
|
||||
import com.ghy.order.service.IAfterServiceRecordService;
|
||||
import com.ghy.common.core.controller.BaseController;
|
||||
import com.ghy.common.core.domain.AjaxResult;
|
||||
import com.ghy.common.utils.poi.ExcelUtil;
|
||||
import com.ghy.common.core.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 售后记录Controller
|
||||
|
|
@ -26,8 +26,7 @@ import com.ghy.common.core.page.TableDataInfo;
|
|||
*/
|
||||
@Controller
|
||||
@RequestMapping("/worker/record")
|
||||
public class AfterServiceRecordController extends BaseController
|
||||
{
|
||||
public class AfterServiceRecordController extends BaseController {
|
||||
private String prefix = "worker/record";
|
||||
|
||||
@Autowired
|
||||
|
|
@ -35,8 +34,7 @@ public class AfterServiceRecordController extends BaseController
|
|||
|
||||
@RequiresPermissions("worker:record:view")
|
||||
@GetMapping()
|
||||
public String record()
|
||||
{
|
||||
public String record() {
|
||||
return prefix + "/record";
|
||||
}
|
||||
|
||||
|
|
@ -57,8 +55,7 @@ public class AfterServiceRecordController extends BaseController
|
|||
@RequiresPermissions("worker:record:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(AfterServiceRecord afterServiceRecord)
|
||||
{
|
||||
public TableDataInfo list(AfterServiceRecord afterServiceRecord) {
|
||||
startPage();
|
||||
List<AfterServiceRecord> list = afterServiceRecordService.selectAfterServiceRecordList(afterServiceRecord);
|
||||
return getDataTable(list);
|
||||
|
|
@ -69,8 +66,7 @@ public class AfterServiceRecordController extends BaseController
|
|||
*/
|
||||
@PostMapping("/app/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo appList(@RequestBody AfterServiceRecord afterServiceRecord)
|
||||
{
|
||||
public TableDataInfo appList(@RequestBody AfterServiceRecord afterServiceRecord) {
|
||||
startPage();
|
||||
List<AfterServiceRecord> list = afterServiceRecordService.selectAfterServiceRecordList(afterServiceRecord);
|
||||
return getDataTable(list);
|
||||
|
|
@ -84,8 +80,7 @@ public class AfterServiceRecordController extends BaseController
|
|||
@Log(title = "售后记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(AfterServiceRecord afterServiceRecord)
|
||||
{
|
||||
public AjaxResult export(AfterServiceRecord afterServiceRecord) {
|
||||
List<AfterServiceRecord> list = afterServiceRecordService.selectAfterServiceRecordList(afterServiceRecord);
|
||||
ExcelUtil<AfterServiceRecord> util = new ExcelUtil<AfterServiceRecord>(AfterServiceRecord.class);
|
||||
return util.exportExcel(list, "售后记录数据");
|
||||
|
|
@ -95,8 +90,7 @@ public class AfterServiceRecordController extends BaseController
|
|||
* 新增售后记录
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
public String add() {
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
|
|
@ -106,8 +100,8 @@ public class AfterServiceRecordController extends BaseController
|
|||
@Log(title = "售后记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(@RequestBody AfterServiceRecord afterServiceRecord)
|
||||
{
|
||||
public AjaxResult addSave(@RequestBody AfterServiceRecord afterServiceRecord) {
|
||||
logger.info("新增售后记录:{}", afterServiceRecord);
|
||||
return toAjax(afterServiceRecordService.insertAfterServiceRecord(afterServiceRecord));
|
||||
}
|
||||
|
||||
|
|
@ -116,8 +110,7 @@ public class AfterServiceRecordController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("worker:record:edit")
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") String id, ModelMap mmap)
|
||||
{
|
||||
public String edit(@PathVariable("id") String id, ModelMap mmap) {
|
||||
AfterServiceRecord afterServiceRecord = afterServiceRecordService.selectAfterServiceRecordById(id);
|
||||
mmap.put("afterServiceRecord", afterServiceRecord);
|
||||
return prefix + "/edit";
|
||||
|
|
@ -129,8 +122,8 @@ public class AfterServiceRecordController extends BaseController
|
|||
@Log(title = "售后记录", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(@RequestBody AfterServiceRecord afterServiceRecord)
|
||||
{
|
||||
public AjaxResult editSave(@RequestBody AfterServiceRecord afterServiceRecord) {
|
||||
logger.info("修改售后记录:{}", afterServiceRecord);
|
||||
try {
|
||||
return toAjax(afterServiceRecordService.updateAfterServiceRecord(afterServiceRecord));
|
||||
} catch (Exception exception) {
|
||||
|
|
@ -146,8 +139,7 @@ public class AfterServiceRecordController extends BaseController
|
|||
@Log(title = "售后记录", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
public AjaxResult remove(String ids) {
|
||||
return toAjax(afterServiceRecordService.deleteAfterServiceRecordByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -723,6 +723,7 @@ public class OrderDetailController extends BaseController {
|
|||
@PostMapping("/finish")
|
||||
@ResponseBody
|
||||
public AjaxResult finish(Long orderDetailId) {
|
||||
logger.info("消费者确认完成子订单,orderDetailId={}", orderDetailId);
|
||||
try {
|
||||
orderDetailService.finish(orderDetailId);
|
||||
} catch (BaseAdaPayException e) {
|
||||
|
|
@ -740,6 +741,7 @@ public class OrderDetailController extends BaseController {
|
|||
@PostMapping("/cancel")
|
||||
@ResponseBody
|
||||
public AjaxResult applyForCancel(Long orderDetailId) throws BaseAdaPayException {
|
||||
logger.info("消费者申请取消子订单,orderDetailId={}", orderDetailId);
|
||||
orderDetailService.applyForCancel(orderDetailId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
|
@ -753,6 +755,7 @@ public class OrderDetailController extends BaseController {
|
|||
@PostMapping("/cancel/agree")
|
||||
@ResponseBody
|
||||
public AjaxResult cancelAgree(Long orderDetailId, Integer agree) throws BaseAdaPayException {
|
||||
logger.info("师傅审核取消子订单申请,orderDetailId={},agree={}", orderDetailId, agree);
|
||||
orderDetailService.cancelAgree(orderDetailId, agree);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
|
@ -765,7 +768,8 @@ public class OrderDetailController extends BaseController {
|
|||
@PostMapping("/app/applyFinishOrder")
|
||||
@ResponseBody
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult applyFinishOrder(@RequestBody OrderProcessRequest request) throws Exception {
|
||||
public AjaxResult applyFinishOrder(@RequestBody OrderProcessRequest request) {
|
||||
logger.info("师傅发起完单,orderDetailId={}", request.getOrderDetailId());
|
||||
// 判断工单状态是否为服务中以及是否已支付
|
||||
OrderDetail orderDetail = orderDetailService.selectById(request.getOrderDetailId());
|
||||
OrderMaster orderMaster = orderMasterService.selectById(orderDetail.getOrderMasterId());
|
||||
|
|
|
|||
|
|
@ -734,8 +734,8 @@ public class OrderMasterController extends BaseController {
|
|||
*/
|
||||
@PostMapping("/cancel")
|
||||
@ResponseBody
|
||||
public AjaxResult cancel(Long orderMasterId) throws BaseAdaPayException {
|
||||
// 校验
|
||||
public AjaxResult applyForCancel(Long orderMasterId) throws BaseAdaPayException {
|
||||
logger.info("消费者申请取消主订单,orderMasterId={}", orderMasterId);
|
||||
List<OrderDetail> orderDetails = orderDetailService.selectByOrderMasterId(orderMasterId);
|
||||
for (OrderDetail detail : orderDetails) {
|
||||
if (detail.getOrderStatus() != 6) {
|
||||
|
|
@ -755,6 +755,7 @@ public class OrderMasterController extends BaseController {
|
|||
@PostMapping("/cancel/agree")
|
||||
@ResponseBody
|
||||
public AjaxResult cancelAgree(Long orderMasterId, Integer agree) {
|
||||
logger.info("师傅审核取消主订单申请,orderMasterId={}, agree={}", orderMasterId, agree);
|
||||
orderMasterService.cancelAgree(orderMasterId, agree);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
|||
<!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
|
||||
<setting name="defaultExecutorType" value="SIMPLE" />
|
||||
<!-- 指定 MyBatis 所用日志的具体实现 -->
|
||||
<setting name="logImpl" value="SLF4J" />
|
||||
<setting name="logImpl" value="org.apache.ibatis.logging.nologging.NoLoggingImpl" />
|
||||
<!-- 使用驼峰命名法转换字段 -->
|
||||
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
|
||||
</settings>
|
||||
|
|
|
|||
|
|
@ -216,22 +216,6 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
|||
OrderDetail orderDetail = selectById(orderDetailId);
|
||||
Assert.notNull(orderDetail, "找不到对应的子订单");
|
||||
|
||||
// 查询出所有的子订单 如果除了这个子订单以外 没有其它未取消的订单 就走主订单取消流程
|
||||
List<OrderDetail> orderDetails = orderDetailMapper.selectByOrderMasterId(orderDetail.getOrderMasterId());
|
||||
boolean allCancel = true;
|
||||
for (OrderDetail od : orderDetails) {
|
||||
if (!od.getId().equals(orderDetailId)) {
|
||||
if (!od.getOrderStatus().equals(OrderStatus.CANCEL.code())) {
|
||||
allCancel = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (allCancel) {
|
||||
logger.info("主订单[id={}]下所有的子订单都被取消 直接进入主订单取消流程", orderDetail.getOrderMasterId());
|
||||
orderMasterService.applyForCancel(orderDetail.getOrderMasterId());
|
||||
return;
|
||||
}
|
||||
|
||||
switch (orderDetail.getOrderStatus()) {
|
||||
case 0:
|
||||
case 1: // 待接单和待排期状态可直接取消
|
||||
|
|
@ -239,12 +223,15 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
|||
break;
|
||||
case 2: // 待上门状态需要师傅同意才能取消
|
||||
orderDetailMapper.updateStatus(orderDetailId, OrderStatus.GOING_CANCEL.code());
|
||||
logger.info("Set OrderDetail[{}].orderStatus = {}", orderDetailId, OrderStatus.GOING_CANCEL.code());
|
||||
break;
|
||||
case 3: // 服务中状态需要师傅同意才能取消
|
||||
orderDetailMapper.updateStatus(orderDetailId, OrderStatus.SERVER_CANCEL.code());
|
||||
logger.info("Set OrderDetail[{}].orderStatus = {}", orderDetailId, OrderStatus.SERVER_CANCEL.code());
|
||||
break;
|
||||
case 4: // 待确认状态需要师傅同意才能取消
|
||||
orderDetailMapper.updateStatus(orderDetailId, OrderStatus.FINISH_CHECK_CANCEL.code());
|
||||
logger.info("Set OrderDetail[{}].orderStatus = {}", orderDetailId, OrderStatus.FINISH_CHECK_CANCEL.code());
|
||||
break;
|
||||
default: // 其他状态不可取消
|
||||
throw new IllegalArgumentException("这个子订单不能取消了");
|
||||
|
|
@ -266,6 +253,7 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
|||
}
|
||||
// 更新子订单状态
|
||||
orderDetailMapper.updateStatus(orderDetailId, OrderStatus.CANCEL.code());
|
||||
logger.info("Set OrderDetail[{}].orderStatus = {}", orderDetailId, OrderStatus.CANCEL.code());
|
||||
// 查询出所有的子订单 就走主订单取消流程
|
||||
List<OrderDetail> orderDetails = orderDetailMapper.selectByOrderMasterId(orderDetail.getOrderMasterId());
|
||||
// 发起退款
|
||||
|
|
|
|||
Loading…
Reference in New Issue