修改报错

This commit is contained in:
HH 2023-02-16 23:01:36 +08:00
parent bbd5e6ae5c
commit f8b88dddf1
3 changed files with 59 additions and 66 deletions

View File

@ -14,7 +14,6 @@ import com.ghy.common.utils.StringUtils;
import com.ghy.common.utils.poi.ExcelUtil; import com.ghy.common.utils.poi.ExcelUtil;
import com.ghy.customer.domain.CustomerAddress; import com.ghy.customer.domain.CustomerAddress;
import com.ghy.customer.service.CustomerAddressService; import com.ghy.customer.service.CustomerAddressService;
import com.ghy.customer.service.CustomerService;
import com.ghy.goods.domain.Goods; import com.ghy.goods.domain.Goods;
import com.ghy.goods.domain.GoodsImgs; import com.ghy.goods.domain.GoodsImgs;
import com.ghy.goods.domain.GoodsStandard; import com.ghy.goods.domain.GoodsStandard;
@ -48,15 +47,14 @@ import com.ghy.worker.domain.WorkerCertification;
import com.ghy.worker.service.IWorkerCertificationService; import com.ghy.worker.service.IWorkerCertificationService;
import com.ghy.worker.service.WorkerService; import com.ghy.worker.service.WorkerService;
import com.huifu.adapay.core.exception.BaseAdaPayException; import com.huifu.adapay.core.exception.BaseAdaPayException;
import org.apache.commons.collections.CollectionUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -74,37 +72,35 @@ public class OrderMasterController extends BaseController {
private final String prefix = "order/master"; private final String prefix = "order/master";
@Autowired @Resource
private OrderMasterService orderMasterService; private OrderMasterService orderMasterService;
@Autowired @Resource
private CustomerService customerService;
@Autowired
private WorkerService workerService; private WorkerService workerService;
@Autowired @Resource
private IWorkerCertificationService workerCertificationService; private IWorkerCertificationService workerCertificationService;
@Autowired @Resource
private OrderDetailService orderDetailService; private OrderDetailService orderDetailService;
@Autowired @Resource
private OrderGoodsService orderGoodsService; private OrderGoodsService orderGoodsService;
@Autowired @Resource
private CustomerAddressService addressService; private CustomerAddressService addressService;
@Autowired @Resource
private GoodsService goodsService; private GoodsService goodsService;
@Autowired @Resource
private GoodsImgsService goodsImgsService; private GoodsImgsService goodsImgsService;
@Autowired @Resource
private FinancialMasterService financialMasterService; private FinancialMasterService financialMasterService;
@Autowired @Resource
private FinancialDetailService financialDetailService; private FinancialDetailService financialDetailService;
@Autowired @Resource
private GoodsStandardService goodsStandardService; private GoodsStandardService goodsStandardService;
@Autowired @Resource
private OrderFineRecordService orderFineRecordService; private OrderFineRecordService orderFineRecordService;
@Autowired @Resource
private ISysAreaService sysAreaService; private ISysAreaService sysAreaService;
@Autowired @Resource
private IAfterServiceRecordService afterServiceRecordService; private IAfterServiceRecordService afterServiceRecordService;
@Autowired @Resource
private FinancialChangeRecordService financialChangeRecordService; private FinancialChangeRecordService financialChangeRecordService;
@RequiresPermissions("order:master:view") @RequiresPermissions("order:master:view")
@ -164,7 +160,7 @@ public class OrderMasterController extends BaseController {
// 查询售后记录 // 查询售后记录
List<AfterServiceRecord> afterServiceRecords = new ArrayList<>(); List<AfterServiceRecord> afterServiceRecords = new ArrayList<>();
List<OrderDetail> detailOrderList = orderDetailService.selectByOrderMasterId(master.getId()); List<OrderDetail> detailOrderList = orderDetailService.selectByOrderMasterId(master.getId());
detailOrderList.stream().forEach(detail -> { detailOrderList.forEach(detail -> {
OrderTimeoutRecord timeoutRecord = orderFineRecordService.selectByDetailIdAndStatus(detail.getId(), detail.getOrderStatus()); OrderTimeoutRecord timeoutRecord = orderFineRecordService.selectByDetailIdAndStatus(detail.getId(), detail.getOrderStatus());
if (timeoutRecord != null) { if (timeoutRecord != null) {
timeoutRecords.add(timeoutRecord); timeoutRecords.add(timeoutRecord);
@ -277,7 +273,7 @@ public class OrderMasterController extends BaseController {
List<OrderMaster> list = orderMasterService.selectOrderMasterList(orderMaster); List<OrderMaster> list = orderMasterService.selectOrderMasterList(orderMaster);
list.forEach(master -> { list.forEach(master -> {
//子单 //子单
List<OrderDetail> detailList = orderDetailService.selectByOrderMasterId(master.getId()); // List<OrderDetail> detailList = orderDetailService.selectByOrderMasterId(master.getId());
// 初始化属性 // 初始化属性
OrderListResponse orderListResponse = new OrderListResponse(); OrderListResponse orderListResponse = new OrderListResponse();
@ -320,7 +316,7 @@ public class OrderMasterController extends BaseController {
// 查询是否超时 // 查询是否超时
List<OrderTimeoutRecord> timeoutRecords = new ArrayList<>(); List<OrderTimeoutRecord> timeoutRecords = new ArrayList<>();
List<OrderDetail> detailOrderList = orderDetailService.selectByOrderMasterId(master.getId()); List<OrderDetail> detailOrderList = orderDetailService.selectByOrderMasterId(master.getId());
detailOrderList.stream().forEach(detail -> { detailOrderList.forEach(detail -> {
OrderTimeoutRecord timeoutRecord = orderFineRecordService.selectByDetailIdAndStatus(detail.getId(), detail.getOrderStatus()); OrderTimeoutRecord timeoutRecord = orderFineRecordService.selectByDetailIdAndStatus(detail.getId(), detail.getOrderStatus());
if (timeoutRecord != null) { if (timeoutRecord != null) {
timeoutRecords.add(timeoutRecord); timeoutRecords.add(timeoutRecord);
@ -623,7 +619,7 @@ public class OrderMasterController extends BaseController {
orderMasterResponseVo.setWorkerName(worker.getName()); orderMasterResponseVo.setWorkerName(worker.getName());
} }
// 消费者信息 // 消费者信息
CustomerAddress customerAddress = addressService.selectByCustomerAddressId(orderMaster.getAddressId()); CustomerAddress customerAddress = addressService.selectByCustomerAddressId(master.getAddressId());
orderMasterResponseVo.setCustomerName(customerAddress.getName()); orderMasterResponseVo.setCustomerName(customerAddress.getName());
orderMasterResponseVos.add(orderMasterResponseVo); orderMasterResponseVos.add(orderMasterResponseVo);

View File

@ -3,6 +3,7 @@ package com.ghy.customer.mapper;
import com.ghy.customer.domain.CustomerAddress; import com.ghy.customer.domain.CustomerAddress;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
public interface CustomerAddressMapper { public interface CustomerAddressMapper {
@ -35,7 +36,7 @@ public interface CustomerAddressMapper {
* @param customerAddressId 地址id * @param customerAddressId 地址id
* @return 地址 * @return 地址
*/ */
CustomerAddress selectByCustomerAddressId(@Param("customerAddressId") Long customerAddressId); CustomerAddress selectByCustomerAddressId(@NotNull @Param("customerAddressId") Long customerAddressId);
/** /**
* @param customerAddress 地址信息 * @param customerAddress 地址信息

View File

@ -59,11 +59,7 @@
<select id="selectByCustomerAddressId" resultMap="CustomerAddressResult"> <select id="selectByCustomerAddressId" resultMap="CustomerAddressResult">
<include refid="selectCustomerAddress"/> <include refid="selectCustomerAddress"/>
<where> WHERE customer_address_id = #{customerAddressId}
<if test="customerAddressId != null and customerAddressId != 0">
AND customer_address_id = #{customerAddressId}
</if>
</where>
</select> </select>
<insert id="insertCustomerAddress" parameterType="com.ghy.customer.domain.CustomerAddress" useGeneratedKeys="true" keyProperty="customerAddressId"> <insert id="insertCustomerAddress" parameterType="com.ghy.customer.domain.CustomerAddress" useGeneratedKeys="true" keyProperty="customerAddressId">