修改一次性支付和联合支付
This commit is contained in:
parent
42198f9ddc
commit
c65ee4d28d
@ -40,17 +40,17 @@ public class CpopGenerator {
|
||||
/**
|
||||
* 输出路径
|
||||
*/
|
||||
private static final String EXPORT_URL = "/Cpop-Jambox";
|
||||
private static final String EXPORT_URL = "/Cpop-Mini";
|
||||
|
||||
/**
|
||||
* 模块
|
||||
*/
|
||||
private static final String EXPORT_ITEM = "jambox";
|
||||
private static final String EXPORT_ITEM = "mini";
|
||||
|
||||
/**
|
||||
* 表前缀
|
||||
*/
|
||||
private static final String TABLE_PREFIX = "cp_j_";
|
||||
private static final String TABLE_PREFIX = "cp_mini_";
|
||||
|
||||
/**
|
||||
* 主入口
|
||||
|
||||
@ -0,0 +1,66 @@
|
||||
package com.cpop.jambox.business.controller.backstage;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.cpop.core.base.R;
|
||||
import com.cpop.jambox.business.bo.EasyLearnPageBo;
|
||||
import com.cpop.jambox.business.bo.EasyLearnUnifiedPayBo;
|
||||
import com.cpop.jambox.business.bo.EasyLearnUnionPayBo;
|
||||
import com.cpop.jambox.business.bo.OncePlaceOrderBo;
|
||||
import com.cpop.jambox.business.dto.EasyLearnPageDto;
|
||||
import com.cpop.jambox.business.service.EasyLearnOrderService;
|
||||
import com.cpop.jambox.business.vo.EasyLearnPageVo;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/**
|
||||
* 果酱-放心学订单表 控制层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2023-12-14
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "果酱-放心学订单表接口")
|
||||
@RequestMapping("/easyLearn")
|
||||
@Deprecated
|
||||
public class EasyLearnController {
|
||||
|
||||
@Autowired
|
||||
private EasyLearnOrderService easyLearnOrderService;
|
||||
|
||||
/**
|
||||
* 一次性支付下单
|
||||
* @author DB
|
||||
* @since 2023/10/23 12:15
|
||||
* @param bo 下单请求对象
|
||||
* @return com.cpop.core.base.R<java.lang.Void>
|
||||
*/
|
||||
@PostMapping("/oncePlaceOrder")
|
||||
@ApiOperation("一次性支付下单")
|
||||
public R<Object> oncePlaceOrder(@RequestBody @Validated @ApiParam("一次性支付") OncePlaceOrderBo bo) {
|
||||
return R.ok(easyLearnOrderService.oncePlaceOrder(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 放心学统一支付
|
||||
* @author DB
|
||||
* @since 2023/12/28
|
||||
* @param bo 请求参数
|
||||
* @return R<Object>
|
||||
*/
|
||||
@Deprecated
|
||||
@PostMapping("/unionPay")
|
||||
@ApiOperation("放心学统一支付")
|
||||
public R<Object> unionPay(@RequestBody @Validated EasyLearnUnionPayBo bo) {
|
||||
return R.ok(easyLearnOrderService.unionPay(bo));
|
||||
}
|
||||
|
||||
}
|
||||
@ -405,7 +405,6 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
||||
}
|
||||
//课卡信息
|
||||
JSONObject jsonBody = new JSONObject();
|
||||
|
||||
jsonBody.put("_type", "addPeriod");
|
||||
//办卡实收金额
|
||||
jsonBody.put("money", easyLearnOrder.getTotalPayAmount());
|
||||
@ -468,7 +467,7 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
||||
if (easyLearnOrder == null) {
|
||||
//创建订单
|
||||
easyLearnOrder = BeanUtils.mapToClass(bo, EasyLearnOrder.class);
|
||||
easyLearnOrder.setOrderType(2).setBrandId(brandExtend.getBrandId()).setStoreId(storeExtend.getStoreId());
|
||||
easyLearnOrder.setOrderType(2).setBrandId(brandExtend.getBrandId()).setStoreId(storeExtend.getStoreId()).setOrderContent(bo.getOrderContent());
|
||||
//需要分账
|
||||
if (bo.getTotalAmount().scaleByPowerOfTen(2).intValue() >= Math.ceil(1 / OrderSource.EASY_LEARN.getRate())) {
|
||||
easyLearnOrder.setRate(OrderSource.EASY_LEARN.getRate());
|
||||
@ -558,7 +557,7 @@ public class EasyLearnOrderServiceImpl extends ServiceImpl<EasyLearnOrderMapper,
|
||||
easyLearnOrder.setStoreId(storeExtend.getStoreId());
|
||||
}
|
||||
EasyLearnPayPayEnum easyLearnPayPayEnum = EasyLearnPayPayEnum.valueOf(bo.getEasyLearnUnionPay());
|
||||
easyLearnOrder.setOrderType(easyLearnPayPayEnum.getOrderType());
|
||||
easyLearnOrder.setOrderType(easyLearnPayPayEnum.getOrderType()).setOrderContent(bo.getOrderContent());
|
||||
this.save(easyLearnOrder);
|
||||
String payNotifyUrl;
|
||||
if (StringUtils.equals("prod", SpringUtils.getActiveProfile())) {
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
package com.cpop.mall.web;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.mybatisflex.core.row.DbChain;
|
||||
import com.mybatisflex.core.row.Row;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @version 1.0.0
|
||||
* @since 2024-01-24 16:34
|
||||
*/
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class CpopMiniUserSyncTests {
|
||||
|
||||
@Test
|
||||
public void syncMiniUser() {
|
||||
List<Row> list = DbChain.table("cp_mini_user").from("cp_mini_user").list();
|
||||
System.out.println(JSONArray.toJSONString(list));
|
||||
}
|
||||
}
|
||||
@ -51,11 +51,11 @@ public class CpopWxPayTests {
|
||||
WxPayRefundV3Request.Amount amount = new WxPayRefundV3Request.Amount();
|
||||
//退款金额(单位分)
|
||||
//int refund = order.getTotalAmount().scaleByPowerOfTen(2).intValue();
|
||||
int refund = 500;
|
||||
int refund = 100;
|
||||
amount.setRefund(refund)
|
||||
.setTotal(refund)
|
||||
.setCurrency("CNY");
|
||||
request.setTransactionId("4200002130202401237828582894")
|
||||
request.setTransactionId("4200002127202401249900965739")
|
||||
//.setOutTradeNo("1000000000202401121937112562856")
|
||||
//.setTransactionId(order.getOutOrderNo())
|
||||
//.setOutTradeNo(order.getId())
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
package com.cpop.mini.business.entity;
|
||||
|
||||
import com.cpop.core.base.entity.BaseEntity;
|
||||
import com.cpop.core.base.entity.BaseInsertListener;
|
||||
import com.cpop.core.base.entity.BaseUpdateListener;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 小程序用户-系统用户中间表 实体类。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-01-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@Table(value = "cp_mini_user_mid_sys", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
|
||||
public class MiniUserMidSys extends BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 小程序用户id
|
||||
*/
|
||||
@Id
|
||||
private String miniId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Id
|
||||
private String userId;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.mini.business.mapper;
|
||||
|
||||
import com.cpop.mini.business.entity.MiniUserMidSys;
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
|
||||
/**
|
||||
* 小程序用户-系统用户中间表 映射层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-01-24
|
||||
*/
|
||||
public interface MiniUserMidSysMapper extends BaseMapper<MiniUserMidSys> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cpop.mini.business.service;
|
||||
|
||||
import com.cpop.mini.business.entity.MiniUserMidSys;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
/**
|
||||
* 小程序用户-系统用户中间表 服务层。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-01-24
|
||||
*/
|
||||
public interface MiniUserMidSysService extends IService<MiniUserMidSys> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.cpop.mini.business.service.impl;
|
||||
|
||||
import com.cpop.mini.business.entity.MiniUserMidSys;
|
||||
import com.cpop.mini.business.mapper.MiniUserMidSysMapper;
|
||||
import com.cpop.mini.business.service.MiniUserMidSysService;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 小程序用户-系统用户中间表 服务层实现。
|
||||
*
|
||||
* @author DB
|
||||
* @since 2024-01-24
|
||||
*/
|
||||
@Service("userMidSysService")
|
||||
public class MiniUserMidSysServiceImpl extends ServiceImpl<MiniUserMidSysMapper, MiniUserMidSys> implements MiniUserMidSysService {
|
||||
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cpop.mini.business.mapper.MiniUserMidSysMapper">
|
||||
|
||||
</mapper>
|
||||
@ -4,7 +4,7 @@ cpop:
|
||||
profile: /root/cpop-union/cpop-oam/upload
|
||||
jwt:
|
||||
#白名单
|
||||
whiteList: /websocket/*,/login,/backstage/wxOpen/**,/sysCommon/miniSyncBrandAndStore,/easyLearn/callback/*/*,/easyLearn/*,/mini/cardTemplate/*,/website/**,/backstage/wxCp/*,/callback/wxCp/*/registerCode,/callback/easyLearn/**
|
||||
whiteList: /websocket/*,/login,/backstage/wxOpen/**,/sysCommon/miniSyncBrandAndStore,/easyLearn/callback/*/*,/easyLearn/*,/mini/cardTemplate/*,/website/**,/backstage/wxCp/*,/callback/wxCp/*/registerCode,/callback/easyLearn/**,/mini/sysCommon/miniSyncBrandAndStore
|
||||
#拦截
|
||||
gateway:
|
||||
rsa-keypair:
|
||||
|
||||
@ -5,6 +5,7 @@ import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.read.listener.ReadListener;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cpop.common.utils.DateUtils;
|
||||
import com.cpop.common.utils.StringUtils;
|
||||
import com.cpop.common.utils.bean.BeanUtils;
|
||||
import com.cpop.core.base.entity.PageDomain;
|
||||
@ -45,6 +46,7 @@ import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
@ -380,6 +382,7 @@ public class BusinessServiceImpl extends ServiceImpl<BusinessMapper, Business> i
|
||||
.and(STORE.STORE_NAME.like(params)
|
||||
.or(STORE.PERSON_CHARGE.like(params)
|
||||
.or(STORE.PHONE.eq(params))))
|
||||
.and(STORE.CREATE_TIME.ge(LocalDate.parse("2023-12-01", DateTimeFormatter.ofPattern("yyyy-MM-dd"))))
|
||||
.orderBy(STORE.CREATE_TIME.desc()),
|
||||
BusinessUnSignPageVo.class);
|
||||
}
|
||||
@ -400,6 +403,7 @@ public class BusinessServiceImpl extends ServiceImpl<BusinessMapper, Business> i
|
||||
storeSignService.save(storeSign);
|
||||
SpringUtils.getBean(StoreService.class).updateChain()
|
||||
.set(STORE.SIGN_ID,storeSign.getId())
|
||||
.set(STORE.HAVE_COUNSELOR,true)
|
||||
.where(STORE.ID.eq(id))
|
||||
.update();
|
||||
}
|
||||
|
||||
@ -17,4 +17,4 @@ wx:
|
||||
service-app-id: wx1eb0e5fb7dac3c05
|
||||
logging:
|
||||
level:
|
||||
com.github.binarywang.wxpay: info
|
||||
com.github.binarywang.wxpay: debug
|
||||
@ -89,18 +89,4 @@ public class BackstageSysCommonController {
|
||||
return R.ok(sysFileVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序同步品牌和校区
|
||||
* @author DB
|
||||
* @since 2023/12/21
|
||||
* @param bo 请求参数
|
||||
* @return R<SysFileVo>
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiOperation("小程序同步品牌和校区")
|
||||
@PostMapping("/miniSyncBrandAndStore")
|
||||
public R<Void> miniSyncBrandAndStore(@RequestBody SyncBrandAndStoreBo bo) {
|
||||
storeService.miniSyncBrandAndStore(bo);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
package com.cpop.system.business.controller.mini;
|
||||
|
||||
import com.cpop.core.base.R;
|
||||
import com.cpop.system.business.bo.SyncBrandAndStoreBo;
|
||||
import com.cpop.system.business.service.StoreService;
|
||||
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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @createTime 2023/09/13 15:10
|
||||
* @description 通用接口
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "通用接口")
|
||||
@RestController
|
||||
@RequestMapping("sysCommon")
|
||||
@Deprecated
|
||||
public class SysCommonController {
|
||||
|
||||
@Autowired
|
||||
private StoreService storeService;
|
||||
|
||||
/**
|
||||
* 小程序同步品牌和校区
|
||||
* @author DB
|
||||
* @since 2023/12/21
|
||||
* @param bo 请求参数
|
||||
* @return R<SysFileVo>
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiOperation("小程序同步品牌和校区")
|
||||
@PostMapping("/syncBrandAndStore")
|
||||
public R<Void> miniSyncBrandAndStore(@RequestBody SyncBrandAndStoreBo bo) {
|
||||
storeService.miniSyncBrandAndStore(bo);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user