parent
68d4a4a6a1
commit
cf5cc60fe4
|
|
@ -74,6 +74,7 @@ public enum SourceTypeEnum {
|
|||
OUTER_THIRD_MACHINE(101, "外部第三方设备"),
|
||||
CANTEEN_VOICE(102, "收银喇叭(食堂)"),
|
||||
MARKET_VOICE(103, "收银喇叭(商超)"),
|
||||
YWT_H5_MOBILE(104, "一网通H5"),
|
||||
UNKNOW(999, "未知设备");
|
||||
|
||||
private final Integer key;
|
||||
|
|
|
|||
|
|
@ -81,5 +81,6 @@ public interface AccInfoMapper extends BaseMapper<AccountInfo> {
|
|||
@Param("updateBy") String updateBy);
|
||||
List<AccInfoDetailsVO> queryAccInfoByUserIds(@Param("userIds") List<Long> userIds);
|
||||
AccInfoDetailsVO queryAccInfoByUserId(@Param("userId") Long userId);
|
||||
AccInfoDetailsVO queryAccInfoByUserCode(@Param("userCode") String userCode);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.bonus.canteen.core.account.domain.vo.AccInfoDetailsVO;
|
|||
import com.bonus.canteen.core.account.domain.vo.AccInfoInvalidSumVO;
|
||||
import com.bonus.canteen.core.account.domain.vo.AccOperationListVO;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -69,6 +70,7 @@ public interface IAccInfoService {
|
|||
public WalletBalanceVO queryWalletBalance(AccountInfo accountInfo);
|
||||
List<AccInfoDetailsVO> queryAccInfoByUserIds(List<Long> userIds);
|
||||
AccInfoDetailsVO queryAccInfoByUserId(Long userId);
|
||||
AccInfoDetailsVO queryAccInfoByUserCode(String userId);
|
||||
void checkAccStatus(AccInfoDetailsVO accInfoVO);
|
||||
void individualAccRecharge(AccRechargeParam param);
|
||||
void individualAccWithdraw(AccWithdrawParam param);
|
||||
|
|
|
|||
|
|
@ -358,6 +358,12 @@ public class AccInfoServiceImpl implements IAccInfoService {
|
|||
public AccInfoDetailsVO queryAccInfoByUserId(Long userId) {
|
||||
return accInfoMapper.queryAccInfoByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccInfoDetailsVO queryAccInfoByUserCode(String userCode) {
|
||||
return accInfoMapper.queryAccInfoByUserCode(userCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkAccStatus(AccInfoDetailsVO accInfoVO) {
|
||||
if (ObjectUtil.isNull(accInfoVO) || DelFlagEnum.DEL_TRUE.key().equals(accInfoVO.getDelFlag())) {
|
||||
|
|
|
|||
|
|
@ -435,12 +435,14 @@ public class OrderBusiness {
|
|||
refundOrderInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
orderInfoMapper.updateOrderInfo(refundOrderInfo);
|
||||
orderDetailList = orderInfo.getOrderDetailList();
|
||||
for(OrderDetail orderDetail : orderDetailList) {
|
||||
orderDetail.setRefundAmount(orderDetail.getRealAmount());
|
||||
orderDetail.setRefundNum(orderDetail.getQuantity());
|
||||
orderDetail.setDetailState(OrderDetailStateEnum.REFUNDED.getKey());
|
||||
orderDetail.setUpdateBy(StringUtils.isBlank(operationUser) ? SecurityUtils.getUsername() : operationUser);
|
||||
orderDetailService.updateOrderDetail(orderDetail);
|
||||
if(CollUtil.isNotEmpty(orderDetailList)) {
|
||||
for(OrderDetail orderDetail : orderDetailList) {
|
||||
orderDetail.setRefundAmount(orderDetail.getRealAmount());
|
||||
orderDetail.setRefundNum(orderDetail.getQuantity());
|
||||
orderDetail.setDetailState(OrderDetailStateEnum.REFUNDED.getKey());
|
||||
orderDetail.setUpdateBy(StringUtils.isBlank(operationUser) ? SecurityUtils.getUsername() : operationUser);
|
||||
orderDetailService.updateOrderDetail(orderDetail);
|
||||
}
|
||||
}
|
||||
isSendMQ = true;
|
||||
}else {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ public class OrderInfo extends BaseEntity
|
|||
@Excel(name = "设备订单号")
|
||||
private String deviceOrderId;
|
||||
|
||||
private String zhhqOrderId;
|
||||
|
||||
/** 设备sn */
|
||||
@Excel(name = "设备sn")
|
||||
private String deviceSn;
|
||||
|
|
|
|||
|
|
@ -16,31 +16,31 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 订单Mapper接口
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
public interface OrderInfoMapper
|
||||
{
|
||||
public interface OrderInfoMapper {
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
*
|
||||
* @param orderId 订单主键
|
||||
* @return 订单
|
||||
*/
|
||||
public OrderInfo selectOrderInfoByOrderId(Long orderId);
|
||||
|
||||
public OrderInfo selectOrderInfoByDeviceOrderId(String orderId);
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
*
|
||||
* @return 订单集合
|
||||
*/
|
||||
public List<OrderInfo> selectOrderInfoList(OrderQueryParam orderQueryParam);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
*
|
||||
* @param orderInfo 订单
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -50,16 +50,17 @@ public interface OrderInfoMapper
|
|||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
*
|
||||
* @param orderInfo 订单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateOrderInfo(OrderInfo orderInfo);
|
||||
|
||||
public int updateOrderPayResult(@Param("param") OrderPayResultDTO orderInfo);
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*
|
||||
*
|
||||
* @param orderId 订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -67,7 +68,7 @@ public interface OrderInfoMapper
|
|||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*
|
||||
*
|
||||
* @param orderIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -78,8 +79,10 @@ public interface OrderInfoMapper
|
|||
public void writeOffOrderByOrderIds(@Param("param") OrderWriteOffParam param);
|
||||
|
||||
public Long goodsSellNumCount(@Param("param") CookRecipeDetail param,
|
||||
@Param("userId")Long userId,
|
||||
@Param("orderDate")LocalDate orderDate,
|
||||
@Param("dishesId")Long dishesId);
|
||||
@Param("userId") Long userId,
|
||||
@Param("orderDate") LocalDate orderDate,
|
||||
@Param("dishesId") Long dishesId);
|
||||
|
||||
OrderInfo selectOrderInfoByZhhqOrderId(@Param("zhhqOrderId") String zhhqOrderId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.bonus.canteen.core.order.service;
|
|||
import com.bonus.canteen.core.order.domain.OrderInfo;
|
||||
import com.bonus.canteen.core.order.domain.OrderRefundHistoryVO;
|
||||
import com.bonus.canteen.core.order.domain.param.*;
|
||||
import com.bonus.canteen.core.zhhq.domain.OrderAddDTO;
|
||||
import com.bonus.canteen.core.zhhq.domain.OrderRefundDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -38,8 +40,11 @@ public interface IOrderInfoService
|
|||
* @return 结果
|
||||
*/
|
||||
public int insertCanteenOrderInfo(OrderAddParam orderAddParam);
|
||||
|
||||
public int insertDeviceOrderInfo(DeviceOrderAddParam orderAddParam);
|
||||
|
||||
public int insertZhhqOrderInfo(OrderAddDTO orderAddParam);
|
||||
|
||||
public int insertShopOrderInfo(ShopOrderAddParam orderAddParam);
|
||||
|
||||
/**
|
||||
|
|
@ -72,4 +77,6 @@ public interface IOrderInfoService
|
|||
List<OrderRefundHistoryVO> orderRefundHistory(OrderRefundHistoryParam param);
|
||||
public void writeOffOrderByOrderIds(OrderWriteOffParam param);
|
||||
public void timeOutCancel(Long orderId, String operationUser);
|
||||
|
||||
public void zhhqRefund(OrderRefundDTO params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ import com.bonus.canteen.core.pay.constants.PayChannelEnum;
|
|||
import com.bonus.canteen.core.pay.constants.PayStateEnum;
|
||||
import com.bonus.canteen.core.pay.constants.PayTypeEnum;
|
||||
import com.bonus.canteen.core.user.domain.DeviceMqPersonalUpdateMessageDTO;
|
||||
import com.bonus.canteen.core.zhhq.domain.OrderAddDTO;
|
||||
import com.bonus.canteen.core.zhhq.domain.OrderRefundDTO;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
|
|
@ -115,6 +117,19 @@ public class OrderInfoServiceImpl implements IOrderInfoService
|
|||
return orderInfo;
|
||||
}
|
||||
|
||||
public OrderInfo selectOrderInfoZhhqOrderId(String zhhqOrderId)
|
||||
{
|
||||
OrderInfo orderInfo = orderInfoMapper.selectOrderInfoByZhhqOrderId(zhhqOrderId);
|
||||
if(Objects.isNull(orderInfo)) {
|
||||
throw new ServiceException("订单不存在");
|
||||
}
|
||||
// OrderDetail orderDetail = new OrderDetail();
|
||||
// orderDetail.setOrderId(orderInfo.getOrderId());
|
||||
// List<OrderDetail> orderDetailList = orderDetailService.selectOrderDetailList(orderDetail);
|
||||
// orderInfo.setOrderDetailList(orderDetailList);
|
||||
return orderInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
|
|
@ -220,6 +235,32 @@ public class OrderInfoServiceImpl implements IOrderInfoService
|
|||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public int insertZhhqOrderInfo(OrderAddDTO orderAddParam) {
|
||||
log.info("[一网通下单]入参:{}", JacksonUtil.writeValueAsString(orderAddParam));
|
||||
String paramMd5 = "sc:zhhq_order_"+DigestUtil.md5Hex(JacksonUtil.writeValueAsString(orderAddParam));
|
||||
if (!RedisUtil.setNx(paramMd5, 1, 2)) {
|
||||
log.info("[一网通下单]重复提交:{}", paramMd5);
|
||||
throw new ServiceException("请勿重复提交订单");
|
||||
}
|
||||
AccInfoDetailsVO accInfoVO = this.accInfoService.queryAccInfoByUserCode(orderAddParam.getEmpCode());
|
||||
accInfoService.checkAccStatus(accInfoVO);
|
||||
List<OrderInfo> canteenOrderInfoList = new OrderAddDTO().of(orderAddParam, accInfoVO);
|
||||
checkzhhqOrderExisting(canteenOrderInfoList);
|
||||
List<OrderInfo> orderInfoList = orderBusiness.orderPlaceHandler(canteenOrderInfoList);
|
||||
try {
|
||||
AccRedisUtils.lockUpdateAccWalletBalance(accInfoVO.getUserId());
|
||||
orderBusiness.orderPay(orderInfoList);
|
||||
}catch (Exception ex) {
|
||||
orderBusiness.updateOrderPayFailed(orderInfoList);
|
||||
throw new ServiceException(ex.getMessage());
|
||||
}finally {
|
||||
AccRedisUtils.unlockUpdateAccWalletBalance(accInfoVO.getUserId());
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
private void checkDeviceOrderExisting(List<OrderInfo> orderInfoList) {
|
||||
if(CollUtil.isEmpty(orderInfoList)) {
|
||||
throw new ServiceException("订单不能为空");
|
||||
|
|
@ -232,6 +273,18 @@ public class OrderInfoServiceImpl implements IOrderInfoService
|
|||
}
|
||||
}
|
||||
|
||||
private void checkzhhqOrderExisting(List<OrderInfo> orderInfoList) {
|
||||
if(CollUtil.isEmpty(orderInfoList)) {
|
||||
throw new ServiceException("订单不能为空");
|
||||
}
|
||||
for (OrderInfo orderInfo : orderInfoList) {
|
||||
OrderInfo orderInfoByzhhqOrderId = orderInfoMapper.selectOrderInfoByZhhqOrderId(orderInfo.getZhhqOrderId());
|
||||
if(Objects.nonNull(orderInfoByzhhqOrderId)) {
|
||||
throw new ServiceException("该订单已存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkStallStatus(List<OrderInfo> orderInfoList) {
|
||||
if(CollUtil.isEmpty(orderInfoList)) {
|
||||
throw new ServiceException("订单不能为空");
|
||||
|
|
@ -391,6 +444,33 @@ public class OrderInfoServiceImpl implements IOrderInfoService
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void zhhqRefund(OrderRefundDTO params) {
|
||||
if(Objects.isNull(params.getOrderId())) {
|
||||
throw new ServiceException("订单ID不能为空");
|
||||
}
|
||||
AccInfoDetailsVO accInfoVO = this.accInfoService.queryAccInfoByUserCode(params.getEmpCode());
|
||||
if(Objects.isNull(accInfoVO)) {
|
||||
throw new ServiceException("账户不存在");
|
||||
}
|
||||
OrderInfo orderInfo = selectOrderInfoZhhqOrderId(params.getOrderId());
|
||||
if(Objects.isNull(orderInfo)) {
|
||||
throw new ServiceException("订单不存在");
|
||||
}
|
||||
boolean isSendMQ = orderBusiness.refund(accInfoVO.getNickName(), orderInfo);
|
||||
if(!isSendMQ){
|
||||
return;
|
||||
}
|
||||
try {
|
||||
DeviceMqPersonalUpdateMessageDTO bean = new DeviceMqPersonalUpdateMessageDTO().setUpdatePerson(Math.toIntExact(orderInfo.getUserId()),"update");
|
||||
String jsonString = JacksonUtil.writeValueAsString(bean);
|
||||
log.info("账户变动发送mq内容:{}", jsonString);
|
||||
MqUtil.pushToTenantAllDevice(bean, LeMqConstant.Topic.DEVICE_UPDATE_PERSONAL_CONFIG_V4);
|
||||
} catch (Exception e) {
|
||||
log.error("发送MQ消息失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partRefund(OrderPartRefundParam param) {
|
||||
log.info("[部分退单]入参:{}", JacksonUtil.writeValueAsString(param));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
package com.bonus.canteen.core.zhhq.controller;
|
||||
|
||||
import com.bonus.canteen.core.common.utils.HeaderFetchUtil;
|
||||
import com.bonus.canteen.core.order.service.IOrderInfoService;
|
||||
import com.bonus.canteen.core.zhhq.domain.OrderAddDTO;
|
||||
import com.bonus.canteen.core.zhhq.domain.OrderRefundDTO;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.houqin.constant.GlobalConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.bonus.canteen.core.common.utils.DateUtil.getCurrentDateStr;
|
||||
|
||||
/**
|
||||
* 账户信息Controller
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-05-25
|
||||
*/
|
||||
@Api(tags = "订单h5接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/zhhq/order")
|
||||
@Slf4j
|
||||
public class ZhhqOrderController extends BaseController {
|
||||
@Autowired
|
||||
private IOrderInfoService orderInfoService;
|
||||
|
||||
@ApiOperation("消费扣款")
|
||||
@PostMapping({"/payment"})
|
||||
public AjaxResult payment(@RequestHeader Map<String, String> requestHeader, @RequestBody @Valid OrderAddDTO dto) {
|
||||
// if (!(GlobalConstants.JYY + getCurrentDateStr()).equals(Sm4Utils.decrypt(HeaderFetchUtil.getSign(requestHeader)))) {
|
||||
// throw new ServiceException("访问缺少认证信息");
|
||||
// }
|
||||
try {
|
||||
orderInfoService.insertZhhqOrderInfo(dto);
|
||||
return AjaxResult.success();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("退款")
|
||||
@PostMapping({"/refund"})
|
||||
public AjaxResult refund(@RequestHeader Map<String, String> requestHeader, @RequestBody @Valid OrderRefundDTO dto) {
|
||||
// if (!(GlobalConstants.JYY + getCurrentDateStr()).equals(Sm4Utils.decrypt(HeaderFetchUtil.getSign(requestHeader)))) {
|
||||
// throw new ServiceException("访问缺少认证信息");
|
||||
// }
|
||||
try {
|
||||
orderInfoService.zhhqRefund(dto);
|
||||
return AjaxResult.success();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.bonus.canteen.core.zhhq.domain;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.canteen.core.account.domain.vo.AccInfoDetailsVO;
|
||||
import com.bonus.canteen.core.order.constants.*;
|
||||
import com.bonus.canteen.core.order.domain.OrderInfo;
|
||||
import com.bonus.canteen.core.order.domain.param.ShopOrderInfoAddParam;
|
||||
import com.bonus.canteen.core.pay.constants.PayChannelEnum;
|
||||
import com.bonus.canteen.core.pay.constants.PayStateEnum;
|
||||
import com.bonus.canteen.core.pay.constants.PayTypeEnum;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.bonus.common.houqin.constant.SourceTypeEnum.YWT_H5_MOBILE;
|
||||
|
||||
@Data
|
||||
public class OrderAddDTO implements Serializable {
|
||||
@ApiModelProperty(value = "员工号")
|
||||
@NotNull(message = "员工号不能为空")
|
||||
private String empCode;
|
||||
|
||||
@ApiModelProperty(value = "订单id")
|
||||
@NotNull(message = "订单id不能为空")
|
||||
private String orderId;
|
||||
|
||||
@ApiModelProperty(value = "订单金额")
|
||||
@NotNull(message = "订单金额不能为空")
|
||||
private BigDecimal amount;
|
||||
|
||||
public List<OrderInfo> of(OrderAddDTO param, AccInfoDetailsVO accInfoVO) {
|
||||
List<OrderInfo> orderInfoList = new ArrayList<>();
|
||||
OrderInfo orderInfo = new OrderInfo();
|
||||
orderInfo.setZhhqOrderId(param.getOrderId());
|
||||
orderInfo.setDeviceOrderId(StringUtils.EMPTY);
|
||||
orderInfo.setDeviceSn(StringUtils.EMPTY);
|
||||
orderInfo.setDeviceNum(StringUtils.EMPTY);
|
||||
orderInfo.setUserId(accInfoVO.getUserId());
|
||||
orderInfo.setSourceType(YWT_H5_MOBILE.getKey());
|
||||
orderInfo.setCreateBy(accInfoVO.getNickName());
|
||||
orderInfo.setCreateTime(DateUtils.getNowDate());
|
||||
orderInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||
orderInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
orderInfo.setPayType(PayTypeEnum.MEAL_CARD.getKey());
|
||||
orderInfo.setOrderDate(LocalDate.now());
|
||||
orderInfo.setOrderType(OrderTypeEnum.RESERVE_MEAL.getKey());
|
||||
orderInfo.setIsOnline(1);
|
||||
orderInfo.setOrderState(OrderStateEnum.WAIT_PLACE.getKey());
|
||||
orderInfo.setOrderRefundState(OrderRefundStateEnum.UN_REFUND.getKey());
|
||||
orderInfo.setDeductionType(DeductionTypeEnum.PAY_PLACE.getKey());
|
||||
orderInfo.setPayChannel(PayChannelEnum.ACC.getKey());
|
||||
orderInfo.setPayState(PayStateEnum.PAY_INPROCESS.getKey());
|
||||
orderInfo.setDeliveryAmount(BigDecimal.ZERO);
|
||||
orderInfo.setPackingAmount(BigDecimal.ZERO);
|
||||
orderInfo.setDeliveryType(DeliveryTypeEnum.SELF_TAKE.getKey());
|
||||
orderInfo.setCommentState(CommentStateEnum.UN_COMMENT.getKey());
|
||||
orderInfo.setOrderTime(DateUtils.getNowDate());
|
||||
orderInfo.setExternalPayAmount(BigDecimal.ZERO);
|
||||
orderInfo.setRefundAmount(BigDecimal.ZERO);
|
||||
orderInfo.setPayableAmount(param.getAmount());
|
||||
orderInfo.setDiscountsAmount(BigDecimal.ZERO);
|
||||
orderInfo.setRealAmount(param.getAmount());
|
||||
orderInfo.setAccountPayAmount(param.getAmount());
|
||||
orderInfo.setCanteenId(-1L);
|
||||
orderInfo.setStallId(-1L);
|
||||
orderInfo.setMealtimeType(-1L);
|
||||
orderInfoList.add(orderInfo);
|
||||
return orderInfoList;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.bonus.canteen.core.zhhq.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class OrderRefundDTO implements Serializable {
|
||||
@ApiModelProperty(value = "食堂id")
|
||||
@NotNull(message = "员工号不能为空")
|
||||
private String empCode;
|
||||
|
||||
@ApiModelProperty(value = "订单id")
|
||||
@NotNull(message = "订单id不能为空")
|
||||
private String orderId;
|
||||
}
|
||||
|
|
@ -399,4 +399,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN sys_dept co ON co.dept_id = su.dept_id
|
||||
WHERE ai.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="queryAccInfoByUserCode" resultType="com.bonus.canteen.core.account.domain.vo.AccInfoDetailsVO">
|
||||
SELECT ai.account_id,
|
||||
ai.user_id,
|
||||
ai.end_date,
|
||||
ai.del_flag,
|
||||
ai.account_status,
|
||||
su.nick_name,
|
||||
su.phonenumber,
|
||||
su.dept_id
|
||||
FROM sys_user su
|
||||
LEFT JOIN account_info ai ON su.user_id = ai.user_id
|
||||
LEFT JOIN sys_dept co ON co.dept_id = su.dept_id
|
||||
WHERE su.user_code = #{userCode}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="com.bonus.canteen.core.order.domain.OrderInfo" id="OrderInfoResult">
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="deviceOrderId" column="device_order_id" />
|
||||
<result property="zhhqOrderId" column="zhhq_order_id" />
|
||||
<result property="deviceSn" column="device_sn" />
|
||||
<result property="deviceNum" column="device_num" />
|
||||
<result property="userId" column="user_id" />
|
||||
|
|
@ -58,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
oi.deduction_type, oi.pay_time, oi.pay_type, oi.pay_channel, oi.pay_state, oi.pay_param,
|
||||
oi.delivery_amount, oi.packing_amount, oi.delivery_type, oi.comment_state,
|
||||
di.device_name, su.nick_name, oi.create_by, oi.create_time, oi.update_by, oi.update_time,
|
||||
su.phonenumber as phoneNumber, sd.dept_full_name, ba.area_name, oi.remark
|
||||
su.phonenumber as phoneNumber, sd.dept_full_name, ba.area_name, oi.remark, oi.zhhq_order_id
|
||||
from order_info oi
|
||||
left join basic_canteen bc on bc.canteen_id = oi.canteen_id
|
||||
left join basic_stall bs on bs.stall_id = oi.stall_id
|
||||
|
|
@ -180,6 +181,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where oi.device_order_id = #{orderId}
|
||||
</select>
|
||||
|
||||
<select id="selectOrderInfoByZhhqOrderId" parameterType="String" resultMap="OrderInfoResult">
|
||||
<include refid="selectOrderInfoVo"/>
|
||||
where oi.zhhq_order_id = #{zhhqOrderId}
|
||||
</select>
|
||||
|
||||
<insert id="insertOrderInfo" parameterType="com.bonus.canteen.core.order.domain.OrderInfo">
|
||||
insert into order_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -268,6 +274,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
insert into order_info (
|
||||
order_id,
|
||||
device_order_id,
|
||||
zhhq_order_id,
|
||||
device_sn,
|
||||
device_num,
|
||||
user_id,
|
||||
|
|
@ -308,6 +315,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
(
|
||||
#{orderInfo.orderId},
|
||||
#{orderInfo.deviceOrderId},
|
||||
#{orderInfo.zhhqOrderId},
|
||||
#{orderInfo.deviceSn},
|
||||
#{orderInfo.deviceNum},
|
||||
#{orderInfo.userId},
|
||||
|
|
|
|||
Loading…
Reference in New Issue