| @@ -4,4 +4,55 @@ ADD COLUMN `pay_type` smallint(2) NOT NULL DEFAULT 0 AFTER `owner_id`; | |||||
| ALTER TABLE `mallink`.`wx_card_spend` | ALTER TABLE `mallink`.`wx_card_spend` | ||||
| ADD COLUMN `refund_status` smallint(2) NOT NULL DEFAULT 0 COMMENT '退款状态' AFTER `subsidy`, | ADD COLUMN `refund_status` smallint(2) NOT NULL DEFAULT 0 COMMENT '退款状态' AFTER `subsidy`, | ||||
| ADD COLUMN `refund_remark` varchar(255) AFTER `refund_status`; | |||||
| ADD COLUMN `refund_remark` varchar(255) AFTER `refund_status`; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '营销审批' and tenant_id = '789') parent_id, | |||||
| '789' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '营销审批' and tenant_id = '1001') parent_id, | |||||
| '1001' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '营销审批' and tenant_id = '1002') parent_id, | |||||
| '1002' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '营销审批' and tenant_id = '1003') parent_id, | |||||
| '1003' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '营销审批' and tenant_id = '1004') parent_id, | |||||
| '1004' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '营销审批' and tenant_id = '1005') parent_id, | |||||
| '1005' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '营销审批' and tenant_id = '1006') parent_id, | |||||
| '1006' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '营销审批' and tenant_id = '1007') parent_id, | |||||
| '1007' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '营销审批' and tenant_id = '1008') parent_id, | |||||
| '1008' tenant_id,'1028' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '营销审批' and tenant_id = '1007') parent_id, | |||||
| '1007' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; | |||||
| @@ -26,10 +26,7 @@ import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
| import java.util.ArrayList; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| import java.util.*; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| /** | /** | ||||
| @@ -98,6 +95,39 @@ public class WxCardPayController extends BaseController { | |||||
| final Map<String, BigDecimal> mapList = wxCardSpendService.sumCardSpend(wxCardSpend); | final Map<String, BigDecimal> mapList = wxCardSpendService.sumCardSpend(wxCardSpend); | ||||
| return new ResultData(mapList); | return new ResultData(mapList); | ||||
| } | } | ||||
| @ApiOperation("支付详情") | |||||
| @GetMapping("detail") | |||||
| public ResultData sumCardSpendList(Long cardSpendId) { | |||||
| String ipStr = getIpAddr(); | |||||
| logger.info("sumCardSpendList: " + ipStr + " :" + cardSpendId.toString()); | |||||
| if (cardSpendId == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "cardSpendId不能为空"); | |||||
| } | |||||
| Map<String,Object> map = new HashMap<>(); | |||||
| WxCardSpend cardSend = wxCardSpendService.getById(cardSpendId); | |||||
| if(cardSend == null || !EnumPayType.PAY_PAYMENT.getCode().equals(cardSend.getPayType())){ | |||||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND.getCode(), "未找到订单"); | |||||
| } | |||||
| if(!getLoginBUser().getMerchantId().equals(cardSend.getMerchantId())){ | |||||
| return new ResultData(ErrorCode.ORDER_PAY_REFUND_FAIL.getCode(), "该门店与订单不匹配"); | |||||
| } | |||||
| map.put("cardSend",cardSend); | |||||
| if(EnumPayType.PAY_PAYMENT.getCode().equals(cardSend.getPayType())){//付款订单 | |||||
| if(EnumRentContractAppStatus.DEFAULT.getCode().equals(cardSend.getRefundStatus())){//查询退款订单 | |||||
| WxRefundOrder refundOrder = wxRefundOrderService.findRefundOrder(cardSend, cardSend.getOrderId()); | |||||
| map.put("refund",refundOrder); | |||||
| } | |||||
| }else if(EnumPayType.PAY_B_REFUND.getCode().equals(cardSend.getPayType())){ | |||||
| //查询原cardSend | |||||
| WxCardSpend payCardSend = wxCardSpendService.findPayCardSpend(cardSend,cardSend.getCardId(),cardSend.getOrderId()); | |||||
| map.put("oldCardSend",payCardSend); | |||||
| }else{ | |||||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND.getCode(), "订单类型错误"); | |||||
| } | |||||
| return new ResultData(map); | |||||
| } | |||||
| @ApiOperation(value = "微信B端扫储值卡码支付订单", notes = "params:{\"dynamicId\":\"String\",\"totalFee\":\"String(元)\"}") | @ApiOperation(value = "微信B端扫储值卡码支付订单", notes = "params:{\"dynamicId\":\"String\",\"totalFee\":\"String(元)\"}") | ||||
| @PostMapping("scanCard") | @PostMapping("scanCard") | ||||
| @@ -41,7 +41,7 @@ public enum EnumFlowKey { | |||||
| CASH_OUT(23,"商户提现审批"), | CASH_OUT(23,"商户提现审批"), | ||||
| CARD_ORDER_REFUND(31,"商户提现审批") | |||||
| CARD_ORDER_REFUND(31,"消费卡退款审批") | |||||
| ; | ; | ||||
| public static EnumFlowKey getEnum(Integer code) { | public static EnumFlowKey getEnum(Integer code) { | ||||
| @@ -116,5 +116,6 @@ public interface WxCardSpendService { | |||||
| WxCardSpend cardSpendForPosPay(PromotionCalc scoreCreditCalc, WxCardSpend record, WxMerchant merchant, WxMerchantBUser buUser,Integer payWay) throws MallinkException; | WxCardSpend cardSpendForPosPay(PromotionCalc scoreCreditCalc, WxCardSpend record, WxMerchant merchant, WxMerchantBUser buUser,Integer payWay) throws MallinkException; | ||||
| Integer sumRealPayment(WxCardSpendVo wxCardSpend); | Integer sumRealPayment(WxCardSpendVo wxCardSpend); | ||||
| WxCardSpend findPayCardSpend(TenantEntity tenantEntity, Long cardId, Long orderId); | |||||
| } | } | ||||
| @@ -1330,4 +1330,14 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| public Integer sumRealPayment(WxCardSpendVo wxCardSpend) { | public Integer sumRealPayment(WxCardSpendVo wxCardSpend) { | ||||
| return wxCardSpendMapper.sumRealPayment(wxCardSpend); | return wxCardSpendMapper.sumRealPayment(wxCardSpend); | ||||
| } | } | ||||
| @Override | |||||
| public WxCardSpend findPayCardSpend(TenantEntity tenantEntity, Long cardId, Long orderId) { | |||||
| WxCardSpend wxCardSpendQ = new WxCardSpend(); | |||||
| wxCardSpendQ.updateTenantInfo(tenantEntity); | |||||
| wxCardSpendQ.setPayType(EnumPayType.PAY_PAYMENT.getCode()); | |||||
| wxCardSpendQ.setCardId(cardId); | |||||
| wxCardSpendQ.setOrderId(orderId); | |||||
| return wxCardSpendMapper.selectOne(new QueryWrapper<>(wxCardSpendQ)); | |||||
| } | |||||
| } | } | ||||
| @@ -122,9 +122,10 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '砍价审批', '12', '0', '" + nowTimestr + "', '" + nowTimestr + "', '4')," + | " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '砍价审批', '12', '0', '" + nowTimestr + "', '" + nowTimestr + "', '4')," + | ||||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '商户建券审批', '22', '0', '" + nowTimestr + "', '" + nowTimestr + "', '5')," + | " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '商户建券审批', '22', '0', '" + nowTimestr + "', '" + nowTimestr + "', '5')," + | ||||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '商户提现审批', '23', '0', '" + nowTimestr + "', '" + nowTimestr + "', '6')," + | " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '商户提现审批', '23', '0', '" + nowTimestr + "', '" + nowTimestr + "', '6')," + | ||||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '商品预购审批', '24', '0', '" + nowTimestr + "', '" + nowTimestr + "', '5')," + | |||||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '配送商品审批', '25', '0', '" + nowTimestr + "', '" + nowTimestr + "', '5')," + | |||||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '积分券审批', '26', '0', '" + nowTimestr + "', '" + nowTimestr + "', '5')," + | |||||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '商品预购审批', '24', '0', '" + nowTimestr + "', '" + nowTimestr + "', '7')," + | |||||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '配送商品审批', '25', '0', '" + nowTimestr + "', '" + nowTimestr + "', '8')," + | |||||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '积分券审批', '26', '0', '" + nowTimestr + "', '" + nowTimestr + "', '9')," + | |||||
| " ( '" + idWorker.nextId() + "', '" + id1 + "', '" + tenantId + "', '消费卡退款审批', '31', '0', '" + nowTimestr + "', '" + nowTimestr + "', '10')," + | |||||
| " ( '" + idWorker.nextId() + "', '" + id2 + "', '" + tenantId + "', '商铺租金合同签约', '4', '0', '" + nowTimestr + "', '" + nowTimestr + "', '1')," + | " ( '" + idWorker.nextId() + "', '" + id2 + "', '" + tenantId + "', '商铺租金合同签约', '4', '0', '" + nowTimestr + "', '" + nowTimestr + "', '1')," + | ||||
| " ( '" + idWorker.nextId() + "', '" + id2 + "', '" + tenantId + "', '多经点位租金合同签约', '5', '0', '" + nowTimestr + "', '" + nowTimestr + "', '2')," + | " ( '" + idWorker.nextId() + "', '" + id2 + "', '" + tenantId + "', '多经点位租金合同签约', '5', '0', '" + nowTimestr + "', '" + nowTimestr + "', '2')," + | ||||