diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java index 85408813..5375be3d 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java @@ -2,8 +2,8 @@ package com.ghy.web.controller.order; import com.ghy.common.core.controller.BaseController; import com.ghy.common.core.domain.AjaxResult; +import com.ghy.common.core.domain.entity.SysUser; import com.ghy.common.enums.*; -import com.ghy.common.utils.StringUtils; import com.ghy.customer.domain.Customer; import com.ghy.customer.domain.CustomerAddress; import com.ghy.customer.service.CustomerAddressService; @@ -23,11 +23,9 @@ import com.ghy.order.service.*; import com.ghy.payment.domain.FinancialChangeRecord; import com.ghy.payment.domain.FinancialDetail; import com.ghy.payment.domain.FinancialMaster; -import com.ghy.payment.domain.OrderTimeoutRecord; import com.ghy.payment.service.FinancialChangeRecordService; import com.ghy.payment.service.FinancialDetailService; import com.ghy.payment.service.FinancialMasterService; -import com.ghy.payment.service.OrderFineRecordService; import com.ghy.system.domain.SysArea; import com.ghy.system.service.ISysAreaService; import com.ghy.system.service.IWxMsgService; @@ -37,6 +35,7 @@ import com.ghy.worker.domain.WorkerCertification; import com.ghy.worker.service.IWorkerCertificationService; import com.ghy.worker.service.WorkerService; import com.huifu.adapay.core.exception.BaseAdaPayException; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.time.DateUtils; import org.springframework.beans.BeanUtils; @@ -70,6 +69,8 @@ public class OrderController extends BaseController { @Resource private CustomerService customerService; @Resource + private CustomerAddressService customerAddressService; + @Resource private GoodsService goodsService; @Resource private DeptGoodsCategoryService deptGoodsCategoryService; @@ -92,8 +93,6 @@ public class OrderController extends BaseController { @Resource private ISysAreaService sysAreaService; @Resource - private OrderFineRecordService orderFineRecordService; - @Resource private FinancialChangeRecordService financialChangeRecordService; @Resource private IWorkerCertificationService workerCertificationService; @@ -143,6 +142,34 @@ public class OrderController extends BaseController { @ResponseBody @Transactional(rollbackFor = Exception.class) public AjaxResult sysOrder(@RequestBody SysOrderAssignRequest request) { + + SysUser sysUser = getSysUser(); + Long deptId = sysUser.getDeptId(); + String loginName = sysUser.getLoginName(); + Customer customer = customerService.selectByAccount("sys_" + loginName); + if (customer == null) { + customer = new Customer(); + customer.setAccount("sys_" + loginName); + customer.setName("平台用户_" + loginName); + customerService.insertCustomer(customer); + } + + if (request.getProvinceId() == null || request.getCityId() == null || request.getCountryId() == null || StringUtils.isBlank(request.getAddress())) { + return AjaxResult.error("请填写地址"); + } + CustomerAddress customerAddress = customerAddressService.selectByCustomerAndAddress(customer.getCustomerId(), + request.getProvinceId(), request.getCityId(), request.getCountryId(), request.getAddress()); + if (customerAddress == null) { + customerAddress = new CustomerAddress(); + customerAddress.setCustomerId(customer.getCustomerId()); + customerAddress.setProvinceId(request.getProvinceId()); + customerAddress.setCityId(request.getCityId()); + customerAddress.setCountryId(request.getCountryId()); + customerAddress.setAddress(request.getAddress()); + customerAddress.setIsDefault(0); + customerAddressService.insertCustomerAddress(customerAddress); + } + request.setGoodsDeptCategoryId(request.getCategory4()); List ids = new ArrayList<>(); ids.add(request.getCategory1()); @@ -154,10 +181,9 @@ public class OrderController extends BaseController { OrderTemplateGoods orderTemplateGoods = new OrderTemplateGoods(); orderTemplateGoods.setGoodsName(request.getGoodsBrand() + " " + deptGoodsCategory.getGoodsCategoryName()); orderTemplateGoods.setDeptGoodsCategoryIds(ids); - orderTemplateGoods.setDeptGoodsCategoryNames(Arrays.asList(orderTemplateGoods.getGoodsName())); - request.setGoods(Arrays.asList(orderTemplateGoods)); + orderTemplateGoods.setDeptGoodsCategoryNames(Collections.singletonList(orderTemplateGoods.getGoodsName())); + request.setGoods(Collections.singletonList(orderTemplateGoods)); String goodsBrand = request.getGoodsBrand(); - Long deptId = getSysUser().getDeptId(); List goodsList = request.getGoods(); // 订单总价 不能小于0 BigDecimal orderPrice = BigDecimal.valueOf(request.getPrice()).max(BigDecimal.ZERO); @@ -205,10 +231,10 @@ public class OrderController extends BaseController { orderMaster.setCode(orderMasterService.createOrderCode()); orderMaster.setOrderType(0); orderMaster.setOrderStatus(OrderStatus.RECEIVE.code()); - orderMaster.setAddressId(request.getAddressId()); + orderMaster.setAddressId(customerAddress.getCustomerAddressId()); orderMaster.setPayStatus(PayStatus.WAIT_PAY.getCode()); orderMaster.setCreateTime(new Date()); - orderMaster.setWorkerId(goods.getWorkerId()); + orderMaster.setCustomerId(customer.getCustomerId()); orderMaster.setGoodsId(goods.getGoodsId()); orderMasterService.insertOrderMaster(orderMaster); Assert.notNull(orderMaster.getId(), "OrderMaster.id is null!"); @@ -406,7 +432,7 @@ public class OrderController extends BaseController { public AjaxResult appOrder(@RequestBody AppOrderRequest appOrderRequest) throws ParseException { // 校验用户信息 Customer customer = customerService.selectByCustomerId(appOrderRequest.getCustomerId()); - if (StringUtils.isNull(customer)) { + if (customer == null) { return AjaxResult.error("用户不存在!"); } List appGoodsList = appOrderRequest.getGoodsList(); diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderGoodsController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderGoodsController.java index 61783a32..00e9bd66 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderGoodsController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderGoodsController.java @@ -39,6 +39,7 @@ public class OrderGoodsController extends BaseController { @GetMapping() public String orderGoods(Long orderId, ModelMap mmap) { OrderMaster orderMaster = orderMasterService.selectById(orderId); + mmap.put("orderId", orderId); mmap.put("orderMaster", orderMaster); return prefix; } diff --git a/ghy-admin/src/main/java/com/ghy/web/timer/AdapaySyncTimer.java b/ghy-admin/src/main/java/com/ghy/web/timer/AdapaySyncTimer.java index 0c693b58..22c64d97 100644 --- a/ghy-admin/src/main/java/com/ghy/web/timer/AdapaySyncTimer.java +++ b/ghy-admin/src/main/java/com/ghy/web/timer/AdapaySyncTimer.java @@ -74,6 +74,8 @@ public class AdapaySyncTimer { String orderNo = AdapayUtils.createOrderNo(AdapayOrderType.DRAW_CASH); JSONObject drawCash = adapayService.drawCash(deptId, orderNo, "T1", avlBalance, memberId, "提现", null); log.info("Worker[{},{}]提现结果: {}", workerBank.getWorkerId(), workerBank.getName(), drawCash.toJSONString()); + } else { + log.error("Worker[{},{}]查询账户余额失败: {}", workerBank.getWorkerId(), workerBank.getName(), accountBalance.toJSONString()); } } catch (BaseAdaPayException e) { log.error(e.getMessage(), e); @@ -101,6 +103,8 @@ public class AdapaySyncTimer { String orderNo = AdapayUtils.createOrderNo(AdapayOrderType.DRAW_CASH); JSONObject drawCash = adapayService.drawCash(deptId, orderNo, "T1", avlBalance, memberId, "提现", null); log.info("Customer[{},{}]提现结果: {}", customer.getCustomerId(), customer.getName(), drawCash.toJSONString()); + } else { + log.error("Customer[{},{}]查询账户余额失败: {}", customer.getCustomerId(), customer.getName(), accountBalance.toJSONString()); } } catch (BaseAdaPayException e) { log.error(e.getMessage(), e); @@ -108,6 +112,9 @@ public class AdapaySyncTimer { } } + /** + * 定时同步提现状态 + */ @Scheduled(fixedRate = 5 * 60 * 1000L) public void syncDrawCash() { List records = drawCashRecordMapper.selectByStatus("pending"); @@ -147,7 +154,7 @@ public class AdapaySyncTimer { // 更新提现记录表状态 drawCashRecordMapper.updateStatus(record.getId(), "succeeded"); // 更新子订单表状态 - orderDetailService.updateDrawCashStatus(record.getId(), 2, new Date()); + orderDetailService.updateDrawCashStatus(record.getId(), 2, null, new Date()); break; // 提现失败 case "F": @@ -155,7 +162,7 @@ public class AdapaySyncTimer { // 更新提现记录表状态 drawCashRecordMapper.updateStatus(record.getId(), "failed"); // 更新子订单表状态 - orderDetailService.updateDrawCashStatus(record.getId(), -1, null); + orderDetailService.updateDrawCashStatus(record.getId(), -1, null, null); break; default: break; diff --git a/ghy-admin/src/main/resources/templates/order/goods.html b/ghy-admin/src/main/resources/templates/order/goods.html index 375afb01..916f29a7 100644 --- a/ghy-admin/src/main/resources/templates/order/goods.html +++ b/ghy-admin/src/main/resources/templates/order/goods.html @@ -13,7 +13,7 @@
- +
@@ -50,7 +50,7 @@ function queryOrderGoodsList() { var options = { - url: prefix + "/list", + url: prefix + "/list?orderDetailId=" + orderId, modalName: "订单商品", search: false, showSearch: false, diff --git a/ghy-custom/src/main/java/com/ghy/customer/mapper/CustomerAddressMapper.java b/ghy-custom/src/main/java/com/ghy/customer/mapper/CustomerAddressMapper.java index b895e1b2..7289d34b 100644 --- a/ghy-custom/src/main/java/com/ghy/customer/mapper/CustomerAddressMapper.java +++ b/ghy-custom/src/main/java/com/ghy/customer/mapper/CustomerAddressMapper.java @@ -50,4 +50,9 @@ public interface CustomerAddressMapper { */ int updateCustomerAddress(CustomerAddress customerAddress); + CustomerAddress selectByCustomerAndAddress(@Param("customerId") Long customerId, + @Param("provinceId") Long provinceId, + @Param("cityId") Long cityId, + @Param("countryId") Long countryId, + @Param("address") String address); } diff --git a/ghy-custom/src/main/java/com/ghy/customer/mapper/CustomerMapper.java b/ghy-custom/src/main/java/com/ghy/customer/mapper/CustomerMapper.java index 8729fcc8..95f83c26 100644 --- a/ghy-custom/src/main/java/com/ghy/customer/mapper/CustomerMapper.java +++ b/ghy-custom/src/main/java/com/ghy/customer/mapper/CustomerMapper.java @@ -63,4 +63,5 @@ public interface CustomerMapper { */ List selectByIds(@Param("customerIds") Collection customerIds); + Customer selectByAccount(String account); } diff --git a/ghy-custom/src/main/java/com/ghy/customer/service/CustomerAddressService.java b/ghy-custom/src/main/java/com/ghy/customer/service/CustomerAddressService.java index f03596c4..8303811e 100644 --- a/ghy-custom/src/main/java/com/ghy/customer/service/CustomerAddressService.java +++ b/ghy-custom/src/main/java/com/ghy/customer/service/CustomerAddressService.java @@ -49,4 +49,6 @@ public interface CustomerAddressService { * @return 修改成功条数 */ int updateCustomerAddress(CustomerAddress customerAddress); + + CustomerAddress selectByCustomerAndAddress(Long customerId, Long provinceId, Long cityId, Long countryId, String address); } diff --git a/ghy-custom/src/main/java/com/ghy/customer/service/CustomerService.java b/ghy-custom/src/main/java/com/ghy/customer/service/CustomerService.java index 774b73b7..2159f834 100644 --- a/ghy-custom/src/main/java/com/ghy/customer/service/CustomerService.java +++ b/ghy-custom/src/main/java/com/ghy/customer/service/CustomerService.java @@ -73,4 +73,6 @@ public interface CustomerService { * @return Customer */ List selectByIds(Set customerIds); + + Customer selectByAccount(String account); } diff --git a/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerAddressServiceImpl.java b/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerAddressServiceImpl.java index f6b94e6c..73153f91 100644 --- a/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerAddressServiceImpl.java +++ b/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerAddressServiceImpl.java @@ -60,4 +60,9 @@ public class CustomerAddressServiceImpl implements CustomerAddressService { public int updateCustomerAddress(CustomerAddress customerAddress) { return customerAddressMapper.updateCustomerAddress(customerAddress); } + + @Override + public CustomerAddress selectByCustomerAndAddress(Long customerId, Long provinceId, Long cityId, Long countryId, String address) { + return customerAddressMapper.selectByCustomerAndAddress(customerId, provinceId, cityId, countryId, address); + } } diff --git a/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerServiceImpl.java b/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerServiceImpl.java index b166e522..05f48b8e 100644 --- a/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerServiceImpl.java +++ b/ghy-custom/src/main/java/com/ghy/customer/service/impl/CustomerServiceImpl.java @@ -104,4 +104,9 @@ public class CustomerServiceImpl implements CustomerService { } return customerMapper.selectByIds(customerIds); } + + @Override + public Customer selectByAccount(String account) { + return customerMapper.selectByAccount(account); + } } diff --git a/ghy-custom/src/main/resources/mapper/customer/CustomerAddressMapper.xml b/ghy-custom/src/main/resources/mapper/customer/CustomerAddressMapper.xml index c893bd39..e4c81373 100644 --- a/ghy-custom/src/main/resources/mapper/customer/CustomerAddressMapper.xml +++ b/ghy-custom/src/main/resources/mapper/customer/CustomerAddressMapper.xml @@ -62,6 +62,15 @@ WHERE customer_address_id = #{customerAddressId} + + insert into customer_address( customer_id, diff --git a/ghy-custom/src/main/resources/mapper/customer/CustomerMapper.xml b/ghy-custom/src/main/resources/mapper/customer/CustomerMapper.xml index 3bf0e060..110a684f 100644 --- a/ghy-custom/src/main/resources/mapper/customer/CustomerMapper.xml +++ b/ghy-custom/src/main/resources/mapper/customer/CustomerMapper.xml @@ -146,4 +146,9 @@ + + diff --git a/ghy-order/src/main/java/com/ghy/order/mapper/OrderDetailMapper.java b/ghy-order/src/main/java/com/ghy/order/mapper/OrderDetailMapper.java index 8f964968..97ff8196 100644 --- a/ghy-order/src/main/java/com/ghy/order/mapper/OrderDetailMapper.java +++ b/ghy-order/src/main/java/com/ghy/order/mapper/OrderDetailMapper.java @@ -106,10 +106,12 @@ public interface OrderDetailMapper { * * @param drawCashId 发起提现后Adapay返回的对象ID * @param drawCashStatus 提现状态见{@link OrderDetail#getDrawCashStatus()} + * @param drawCashTime 发起提现时间 * @param arrivalTime 提现到账时间 * @return 1 */ - int updateDrawCashStatus(@Param("drawCashId") String drawCashId, @Param("drawCashStatus") int drawCashStatus, @Param("arrivalTime") Date arrivalTime); + int updateDrawCashStatus(@Param("drawCashId") String drawCashId, @Param("drawCashStatus") int drawCashStatus, + @Param("drawCashTime") Date drawCashTime, @Param("arrivalTime") Date arrivalTime); int deleteByMaster(Long masterId); } diff --git a/ghy-order/src/main/java/com/ghy/order/request/SysOrderAssignRequest.java b/ghy-order/src/main/java/com/ghy/order/request/SysOrderAssignRequest.java index 8a8db7be..029d50a8 100644 --- a/ghy-order/src/main/java/com/ghy/order/request/SysOrderAssignRequest.java +++ b/ghy-order/src/main/java/com/ghy/order/request/SysOrderAssignRequest.java @@ -31,4 +31,13 @@ public class SysOrderAssignRequest { private Long addressId; // 发布价格(限制整数) private Integer price; + + private Long provinceId; + + private Long cityId; + + private Long countryId; + + // 详细地址 + private String address; } diff --git a/ghy-order/src/main/java/com/ghy/order/service/OrderDetailService.java b/ghy-order/src/main/java/com/ghy/order/service/OrderDetailService.java index bdf164be..756ddc1a 100644 --- a/ghy-order/src/main/java/com/ghy/order/service/OrderDetailService.java +++ b/ghy-order/src/main/java/com/ghy/order/service/OrderDetailService.java @@ -143,10 +143,11 @@ public interface OrderDetailService { * * @param drawCashId 发起提现后Adapay返回的对象ID * @param drawCashStatus 提现状态见{@link OrderDetail#getDrawCashStatus()} + * @param drawCashTime 发起提现时间 * @param arrivalTime 提现到账时间 * @return 1 */ - int updateDrawCashStatus(String drawCashId, int drawCashStatus, Date arrivalTime); + int updateDrawCashStatus(String drawCashId, int drawCashStatus, Date drawCashTime, Date arrivalTime); /** * 退款成功时 退款回调接口里会调用这个方法 diff --git a/ghy-order/src/main/java/com/ghy/order/service/impl/OrderDetailServiceImpl.java b/ghy-order/src/main/java/com/ghy/order/service/impl/OrderDetailServiceImpl.java index 98471aed..e83a4fc4 100644 --- a/ghy-order/src/main/java/com/ghy/order/service/impl/OrderDetailServiceImpl.java +++ b/ghy-order/src/main/java/com/ghy/order/service/impl/OrderDetailServiceImpl.java @@ -746,8 +746,8 @@ public class OrderDetailServiceImpl implements OrderDetailService { } @Override - public int updateDrawCashStatus(String drawCashId, int drawCashStatus, Date arrivalTime) { - return orderDetailMapper.updateDrawCashStatus(drawCashId, drawCashStatus, arrivalTime); + public int updateDrawCashStatus(String drawCashId, int drawCashStatus, Date drawCashTime, Date arrivalTime) { + return orderDetailMapper.updateDrawCashStatus(drawCashId, drawCashStatus, drawCashTime, arrivalTime); } @Override diff --git a/ghy-order/src/main/java/com/ghy/order/service/impl/OrderMasterServiceImpl.java b/ghy-order/src/main/java/com/ghy/order/service/impl/OrderMasterServiceImpl.java index b565f007..91eb7371 100644 --- a/ghy-order/src/main/java/com/ghy/order/service/impl/OrderMasterServiceImpl.java +++ b/ghy-order/src/main/java/com/ghy/order/service/impl/OrderMasterServiceImpl.java @@ -254,12 +254,14 @@ public class OrderMasterServiceImpl implements OrderMasterService { } } + // 大师傅的MemberId + String masterWorkerMemberId = AdapayUtils.getWorkerMemberId(orderMaster.getWorkerId(), orderMaster.getDeptId()); // 罚金分给平台账户 memberMap.merge("0", fineMoney, BigDecimal::add); // 大师傅服务金额减去罚金后剩下的钱 如果小于等于0元 就不用分账给大师傅了 BigDecimal bigWorkerAmtSubtractFine = bigWorkerAmt.subtract(fineMoney); if (BigDecimal.ZERO.compareTo(bigWorkerAmtSubtractFine) < 0) { - memberMap.put(AdapayUtils.getWorkerMemberId(orderMaster.getWorkerId(), orderMaster.getDeptId()), bigWorkerAmtSubtractFine); + memberMap.put(masterWorkerMemberId, bigWorkerAmtSubtractFine); } confirmAmt = confirmAmt.add(bigWorkerAmt); @@ -307,7 +309,24 @@ public class OrderMasterServiceImpl implements OrderMasterService { } String amount = member.getAmount(); try { - drawCash(orderMaster.getDeptId(), memberId, amount); + String drawCashId = drawCash(orderMaster.getDeptId(), memberId, amount); + + // 判断是否为大师傅的提现 + if (masterWorkerMemberId.equals(memberId)) { + // 给大师傅的子单设置提现状态和提现时间 丢到线程池里执行 避免影响原业务逻辑 2023/5/18 + executor.execute(() -> { + for (OrderDetail orderDetail : orderDetails) { + if (orderMaster.getWorkerId().equals(orderDetail.getWorkerId())) { + OrderDetail odUpdate = new OrderDetail(); + odUpdate.setId(orderDetail.getId()); + odUpdate.setDrawCashTime(new Date()); + odUpdate.setDrawCashStatus(1); + odUpdate.setDrawCashId(drawCashId); + orderDetailService.updateOrderDetail(odUpdate); + } + } + }); + } } catch (BaseAdaPayException e) { logger.error("自动发起提现失败: orderMasterId={}, memberId={}, cashAmt={}", orderMasterId, memberId, amount, e); } @@ -321,15 +340,18 @@ public class OrderMasterServiceImpl implements OrderMasterService { * @param memberId Adapay实名账户ID * @param amount 提现金额 */ - private void drawCash(Long deptId, String memberId, String amount) throws BaseAdaPayException { + private String drawCash(Long deptId, String memberId, String amount) throws BaseAdaPayException { String orderNo = AdapayUtils.createOrderNo(AdapayOrderType.DRAW_CASH); JSONObject response = adapayService.drawCash(deptId, orderNo, "T1", amount, memberId, "订单结算", null); boolean status = AdapayStatusEnum.pending.code.equals(response.getString("status")) || AdapayStatusEnum.succeeded.code.equals(response.getString("status")); - if (!status) { + if (status) { + return response.getString("id"); + } else { //如果提现失败 把信息记录到error日志里 logger.error("提现失败: deptId={}, memberId={}, amount={}, 失败原因:{}", deptId, memberId, amount, response.getString("error_msg")); + return null; } } diff --git a/ghy-order/src/main/resources/mapper/order/OrderDetailMapper.xml b/ghy-order/src/main/resources/mapper/order/OrderDetailMapper.xml index c15acfed..5c6e2394 100644 --- a/ghy-order/src/main/resources/mapper/order/OrderDetailMapper.xml +++ b/ghy-order/src/main/resources/mapper/order/OrderDetailMapper.xml @@ -392,9 +392,12 @@ - UPDATE order_detail - SET draw_cash_status = #{drawCashStatus}, - arrival_time = #{arrivalTime} + UPDATE order_detail SET + draw_cash_id = #{drawCashId}, + draw_cash_time = #{drawCashTime}, + arrival_time = #{arrivalTime}, + draw_cash_status = #{drawCashStatus}, + update_time = NOW() WHERE draw_cash_id = #{drawCashId} diff --git a/ghy-order/src/main/resources/mapper/order/OrderGoodsMapper.xml b/ghy-order/src/main/resources/mapper/order/OrderGoodsMapper.xml index 3c3bacf8..6206b606 100644 --- a/ghy-order/src/main/resources/mapper/order/OrderGoodsMapper.xml +++ b/ghy-order/src/main/resources/mapper/order/OrderGoodsMapper.xml @@ -72,6 +72,9 @@ AND order_id = #{orderId} + + AND order_detail_id = #{orderDetailId} + AND goods_standard_id = #{goodsStandardId} diff --git a/ghy-order/src/main/resources/mapper/order/OrderMasterMapper.xml b/ghy-order/src/main/resources/mapper/order/OrderMasterMapper.xml index 634df086..7c99bcbe 100644 --- a/ghy-order/src/main/resources/mapper/order/OrderMasterMapper.xml +++ b/ghy-order/src/main/resources/mapper/order/OrderMasterMapper.xml @@ -183,7 +183,7 @@ SELECT COUNT(*) FROM order_master om - AND (om.all_self_assigned = 0 or om.all_self_assigned is not null) AND om.order_status in (1,2,3,4) + AND (om.all_self_assigned = 0 or om.all_self_assigned is null) AND om.order_status in (1,2,3,4) AND om.dept_id = #{deptId} diff --git a/ghy-system/src/main/java/com/ghy/system/mapper/SysUserMapper.java b/ghy-system/src/main/java/com/ghy/system/mapper/SysUserMapper.java index 864e7f8d..dc3ef2ff 100644 --- a/ghy-system/src/main/java/com/ghy/system/mapper/SysUserMapper.java +++ b/ghy-system/src/main/java/com/ghy/system/mapper/SysUserMapper.java @@ -37,10 +37,10 @@ public interface SysUserMapper /** * 通过用户名查询用户 * - * @param userName 用户名 + * @param loginName 用户名 * @return 用户对象信息 */ - public SysUser selectUserByLoginName(String userName); + public SysUser selectUserByLoginName(String loginName); /** * 通过手机号码查询用户 diff --git a/ghy-system/src/main/java/com/ghy/system/service/ISysUserService.java b/ghy-system/src/main/java/com/ghy/system/service/ISysUserService.java index 4d49b5bd..624a3d0a 100644 --- a/ghy-system/src/main/java/com/ghy/system/service/ISysUserService.java +++ b/ghy-system/src/main/java/com/ghy/system/service/ISysUserService.java @@ -38,10 +38,10 @@ public interface ISysUserService /** * 通过用户名查询用户 * - * @param userName 用户名 + * @param loginName 用户名 * @return 用户对象信息 */ - public SysUser selectUserByLoginName(String userName); + public SysUser selectUserByLoginName(String loginName); /** * 通过手机号码查询用户 diff --git a/ghy-system/src/main/java/com/ghy/system/service/impl/SysUserServiceImpl.java b/ghy-system/src/main/java/com/ghy/system/service/impl/SysUserServiceImpl.java index 53164ae6..b2fe3fad 100644 --- a/ghy-system/src/main/java/com/ghy/system/service/impl/SysUserServiceImpl.java +++ b/ghy-system/src/main/java/com/ghy/system/service/impl/SysUserServiceImpl.java @@ -105,13 +105,13 @@ public class SysUserServiceImpl implements ISysUserService /** * 通过用户名查询用户 * - * @param userName 用户名 + * @param loginName 用户名 * @return 用户对象信息 */ @Override - public SysUser selectUserByLoginName(String userName) + public SysUser selectUserByLoginName(String loginName) { - return userMapper.selectUserByLoginName(userName); + return userMapper.selectUserByLoginName(loginName); } /**