Merge remote-tracking branch 'origin/hph' into test
This commit is contained in:
@@ -25,7 +25,7 @@ public interface TbOrderDetailMapper {
|
|||||||
|
|
||||||
int updateByPrimaryKey(TbOrderDetail record);
|
int updateByPrimaryKey(TbOrderDetail record);
|
||||||
|
|
||||||
void updateStatusByOrderId(@Param("orderId") int orderId,@Param("status") String status);
|
void updateStatusByOrderId(@Param("orderId") int orderId,@Param("status") String status,@Param("radio") BigDecimal radio);
|
||||||
|
|
||||||
void updateStatusByOrderIdAndStatus(@Param("orderId") int orderId,@Param("status") String status);
|
void updateStatusByOrderIdAndStatus(@Param("orderId") int orderId,@Param("status") String status);
|
||||||
void deleteByOUrderId(@Param("orderId") int orderId);
|
void deleteByOUrderId(@Param("orderId") int orderId);
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ public class PrintMechineConsumer {
|
|||||||
|
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(detailList) && detailList.size() > 0) {
|
if (ObjectUtil.isNotEmpty(detailList) && detailList.size() > 0) {
|
||||||
OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", ObjectUtil.isEmpty(orderInfo.getMasterId()) || ObjectUtil.isNull(orderInfo.getMasterId()) ? orderInfo.getTableName() : orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", orderInfo.getOrderAmount().toPlainString(), balance, orderInfo.getPayType(), "0", detailList, orderInfo.getRemark(), null, null);
|
OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", ObjectUtil.isEmpty(orderInfo.getMasterId()) || ObjectUtil.isNull(orderInfo.getMasterId()) ? orderInfo.getTableName() : orderInfo.getMasterId(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", orderInfo.getPayAmount().toPlainString(), balance, orderInfo.getPayType(), "0", detailList, orderInfo.getRemark(), null, null);
|
||||||
|
|
||||||
String printType = "退款单";
|
String printType = "退款单";
|
||||||
|
|
||||||
|
|||||||
@@ -509,8 +509,7 @@ public class OrderService {
|
|||||||
.set(TbCashierCart::getStatus, "create")
|
.set(TbCashierCart::getStatus, "create")
|
||||||
.in(TbCashierCart::getId, ids));
|
.in(TbCashierCart::getId, ids));
|
||||||
if (orderId > 0) {
|
if (orderId > 0) {
|
||||||
tbOrderInfoMapper.updateStatusById(orderId, "cancelled");
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
||||||
orderDetailMapper.updateStatusByOrderId(orderId, "cancelled");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1173,7 +1172,7 @@ public class OrderService {
|
|||||||
// cashierCartMapper.updateStatusByMaster(shopId, masterId, "create", day, uuid);
|
// cashierCartMapper.updateStatusByMaster(shopId, masterId, "create", day, uuid);
|
||||||
if (orderId > 0) {
|
if (orderId > 0) {
|
||||||
tbOrderInfoMapper.updateStatusById(orderId, "cancelled");
|
tbOrderInfoMapper.updateStatusById(orderId, "cancelled");
|
||||||
orderDetailMapper.updateStatusByOrderId(orderId, "cancelled");
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Result.success(CodeEnum.SUCCESS);
|
return Result.success(CodeEnum.SUCCESS);
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ public class PayService {
|
|||||||
log.info("更新购物车:{}", cartCount);
|
log.info("更新购物车:{}", cartCount);
|
||||||
|
|
||||||
//更新子单状态
|
//更新子单状态
|
||||||
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("token", token);
|
jsonObject.put("token", token);
|
||||||
@@ -385,8 +385,11 @@ public class PayService {
|
|||||||
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
||||||
log.info("更新购物车:{}", cartCount);
|
log.info("更新购物车:{}", cartCount);
|
||||||
|
|
||||||
//更新子单状态
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
||||||
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
||||||
|
}else {
|
||||||
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
||||||
|
}
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("token", token);
|
jsonObject.put("token", token);
|
||||||
@@ -504,8 +507,11 @@ public class PayService {
|
|||||||
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
||||||
log.info("更新购物车:{}", cartCount);
|
log.info("更新购物车:{}", cartCount);
|
||||||
|
|
||||||
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
||||||
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
||||||
|
}else {
|
||||||
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
||||||
|
}
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("token", token);
|
jsonObject.put("token", token);
|
||||||
jsonObject.put("type", "create");
|
jsonObject.put("type", "create");
|
||||||
@@ -639,10 +645,11 @@ public class PayService {
|
|||||||
//更新购物车状态
|
//更新购物车状态
|
||||||
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
||||||
|
|
||||||
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
||||||
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed");
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
||||||
|
}else {
|
||||||
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
||||||
|
}
|
||||||
|
|
||||||
log.info("更新购物车:{}", cartCount);
|
log.info("更新购物车:{}", cartCount);
|
||||||
|
|
||||||
@@ -769,9 +776,13 @@ public class PayService {
|
|||||||
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
||||||
|
|
||||||
|
|
||||||
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed");
|
|
||||||
|
|
||||||
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
||||||
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
||||||
|
}else {
|
||||||
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
log.info("更新购物车:{}", cartCount);
|
log.info("更新购物车:{}", cartCount);
|
||||||
|
|
||||||
@@ -876,7 +887,13 @@ public class PayService {
|
|||||||
//更新购物车状态
|
//更新购物车状态
|
||||||
int cartCount = tbCashierCartMapper.updateByOrderId(String.valueOf(orderId), "final");
|
int cartCount = tbCashierCartMapper.updateByOrderId(String.valueOf(orderId), "final");
|
||||||
|
|
||||||
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
|
||||||
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
||||||
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
||||||
|
}else {
|
||||||
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
||||||
|
}
|
||||||
|
|
||||||
log.info("更新购物车:{}", cartCount);
|
log.info("更新购物车:{}", cartCount);
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
@@ -955,11 +972,17 @@ public class PayService {
|
|||||||
orderInfo.setPayType("cash");
|
orderInfo.setPayType("cash");
|
||||||
orderInfo.setStatus("closed");
|
orderInfo.setStatus("closed");
|
||||||
orderInfo.setPayOrderNo("cash".concat(SnowFlakeUtil.generateOrderNo()));
|
orderInfo.setPayOrderNo("cash".concat(SnowFlakeUtil.generateOrderNo()));
|
||||||
|
|
||||||
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
||||||
//更新购物车状态
|
//更新购物车状态
|
||||||
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
||||||
|
|
||||||
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
|
||||||
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
||||||
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
||||||
|
}else {
|
||||||
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
||||||
|
}
|
||||||
log.info("更新购物车:{}", cartCount);
|
log.info("更新购物车:{}", cartCount);
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
@@ -1047,10 +1070,14 @@ public class PayService {
|
|||||||
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
||||||
//更新购物车状态
|
//更新购物车状态
|
||||||
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
||||||
|
|
||||||
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
|
||||||
log.info("更新购物车:{}", cartCount);
|
log.info("更新购物车:{}", cartCount);
|
||||||
|
|
||||||
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
||||||
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
||||||
|
}else {
|
||||||
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
||||||
|
}
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("token", token);
|
jsonObject.put("token", token);
|
||||||
jsonObject.put("type", "create");
|
jsonObject.put("type", "create");
|
||||||
@@ -1097,7 +1124,7 @@ public class PayService {
|
|||||||
TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId()));
|
TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId()));
|
||||||
|
|
||||||
|
|
||||||
if ("1".equals(shopInfo.getIsReturn())) {
|
if ("0".equals(shopInfo.getIsReturn())) {
|
||||||
if (ObjectUtil.isEmpty(pwd)) {
|
if (ObjectUtil.isEmpty(pwd)) {
|
||||||
return Result.fail(CodeEnum.PARAM);
|
return Result.fail(CodeEnum.PARAM);
|
||||||
}
|
}
|
||||||
@@ -1173,11 +1200,10 @@ public class PayService {
|
|||||||
// totalAmount = totalAmount.add(it.getPriceAmount());
|
// totalAmount = totalAmount.add(it.getPriceAmount());
|
||||||
totalAmount = totalAmount.add(it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN).multiply(new BigDecimal(map1.get(it.getId()))));
|
totalAmount = totalAmount.add(it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN).multiply(new BigDecimal(map1.get(it.getId()))));
|
||||||
saleAmount = saleAmount.add(it.getPrice());
|
saleAmount = saleAmount.add(it.getPrice());
|
||||||
|
|
||||||
payAmount = payAmount.add(it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN)
|
payAmount = payAmount.add(it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN)
|
||||||
.multiply(new BigDecimal(map1.get(it.getId()))));
|
.multiply(new BigDecimal(map1.get(it.getId()))));
|
||||||
if (ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio()) && ObjectUtil.isNotNull(orderInfo.getDiscountRatio())) {
|
//
|
||||||
payAmount = payAmount.multiply(orderInfo.getDiscountRatio()).setScale(2, BigDecimal.ROUND_DOWN);
|
|
||||||
}
|
|
||||||
// payAmount=payAmount.add(it.getPriceAmount());
|
// payAmount=payAmount.add(it.getPriceAmount());
|
||||||
packAMount = packAMount.add(it.getPackAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN).multiply(new BigDecimal(map1.get(it.getId()))));
|
packAMount = packAMount.add(it.getPackAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN).multiply(new BigDecimal(map1.get(it.getId()))));
|
||||||
|
|
||||||
@@ -1190,10 +1216,6 @@ public class PayService {
|
|||||||
}
|
}
|
||||||
BigDecimal returnAmount = it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN).multiply(new BigDecimal(map1.get(it.getId())));;
|
BigDecimal returnAmount = it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN).multiply(new BigDecimal(map1.get(it.getId())));;
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio()) && ObjectUtil.isNotNull(orderInfo.getDiscountRatio())) {
|
|
||||||
returnAmount = returnAmount.multiply(orderInfo.getDiscountRatio()).setScale(2, BigDecimal.ROUND_DOWN);
|
|
||||||
}
|
|
||||||
|
|
||||||
detailPo.setReturnNum(map1.get(it.getId()));
|
detailPo.setReturnNum(map1.get(it.getId()));
|
||||||
detailPos.add(detailPo);
|
detailPos.add(detailPo);
|
||||||
it.setNum(map1.get(it.getId()));
|
it.setNum(map1.get(it.getId()));
|
||||||
@@ -1287,7 +1309,7 @@ public class PayService {
|
|||||||
flow.setBizCode("accountReturnPay");
|
flow.setBizCode("accountReturnPay");
|
||||||
flow.setBizName("会员储值卡退款");
|
flow.setBizName("会员储值卡退款");
|
||||||
flow.setType("+");
|
flow.setType("+");
|
||||||
flow.setAmount(newOrderInfo.getOrderAmount());
|
flow.setAmount(newOrderInfo.getPayAmount());
|
||||||
flow.setBalance(user.getAmount());
|
flow.setBalance(user.getAmount());
|
||||||
flow.setCreateTime(new Date());
|
flow.setCreateTime(new Date());
|
||||||
flow.setIsReturn("0");
|
flow.setIsReturn("0");
|
||||||
|
|||||||
@@ -205,7 +205,13 @@
|
|||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</update>
|
</update>
|
||||||
<update id="updateStatusByOrderId">
|
<update id="updateStatusByOrderId">
|
||||||
update tb_order_detail set status = #{status} where order_id = #{orderId}
|
update tb_order_detail set status = #{status}
|
||||||
|
|
||||||
|
<if test="radio != null">
|
||||||
|
,price_amount=price_amount*#{radio}
|
||||||
|
</if>
|
||||||
|
|
||||||
|
where order_id = #{orderId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user