chenjiahe
2024-08-01 8e251e8ba1262ee5183f92315a9c8373d7b636ff
Merge remote-tracking branch 'origin/master-base' into master-base
3个文件已修改
204 ■■■■■ 已修改文件
phi_platform_common/src/main/java/com/hx/phip/config/CustomParameter.java 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/order/OrderControllerV2.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderCreateUtil.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/java/com/hx/phip/config/CustomParameter.java
@@ -2,6 +2,7 @@
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;
/**
@@ -9,6 +10,7 @@
 */
@Data
@Component
@RefreshScope
public class CustomParameter {
@@ -86,191 +88,12 @@
    @Value("${integral.cash.data:key_jfdkxjpz}")
    private String integralCashKey;
    /** 订单折扣算法(OrderItemConstants) */
    @Value("${order.discount.algorithm:0}")
    private Integer discountAlgorithm;
    public CustomParameter() {
    }
    public String getAesFixedKey() {
        return aesFixedKey;
    }
    public void setAesFixedKey(String aesFixedKey) {
        this.aesFixedKey = aesFixedKey;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getAppId() {
        return appId;
    }
    public void setAppId(String appId) {
        this.appId = appId;
    }
    public String getPublicKey() {
        return publicKey;
    }
    public void setPublicKey(String publicKey) {
        this.publicKey = publicKey;
    }
    public String getPrivatekey() {
        return privatekey;
    }
    public void setPrivatekey(String privatekey) {
        this.privatekey = privatekey;
    }
    public String getAppIdCode() {
        return appIdCode;
    }
    public void setAppIdCode(String appIdCode) {
        this.appIdCode = appIdCode;
    }
    public String getPlatformPattern() {
        return platformPattern;
    }
    public void setPlatformPattern(String platformPattern) {
        this.platformPattern = platformPattern;
    }
    public String getPlatformPatternMoney() {
        return platformPatternMoney;
    }
    public void setPlatformPatternMoney(String platformPatternMoney) {
        this.platformPatternMoney = platformPatternMoney;
    }
    public String getAppointmentUrl() {
        return appointmentUrl;
    }
    public void setAppointmentUrl(String appointmentUrl) {
        this.appointmentUrl = appointmentUrl;
    }
    public String getWarehouseUrl() {
        return warehouseUrl;
    }
    public void setWarehouseUrl(String warehouseUrl) {
        this.warehouseUrl = warehouseUrl;
    }
    public String getDefaultPayMethodCode() {
        return defaultPayMethodCode;
    }
    public void setDefaultPayMethodCode(String defaultPayMethodCode) {
        this.defaultPayMethodCode = defaultPayMethodCode;
    }
    public String getDefaultPayMethodId() {
        return defaultPayMethodId;
    }
    public void setDefaultPayMethodId(String defaultPayMethodId) {
        this.defaultPayMethodId = defaultPayMethodId;
    }
    public String getCorpAppId() {
        return corpAppId;
    }
    public void setCorpAppId(String corpAppId) {
        this.corpAppId = corpAppId;
    }
    public Integer getCorpAgentId() {
        return corpAgentId;
    }
    public void setCorpAgentId(Integer corpAgentId) {
        this.corpAgentId = corpAgentId;
    }
    public String getCorpSecret() {
        return corpSecret;
    }
    public void setCorpSecret(String corpSecret) {
        this.corpSecret = corpSecret;
    }
    public String getCorpMpSecret() {
        return corpMpSecret;
    }
    public void setCorpMpSecret(String corpMpSecret) {
        this.corpMpSecret = corpMpSecret;
    }
    public String getCorpMpAppId() {
        return corpMpAppId;
    }
    public void setCorpMpAppId(String corpMpAppId) {
        this.corpMpAppId = corpMpAppId;
    }
    public String getCommonBaseUrl() {
        return commonBaseUrl;
    }
    public void setCommonBaseUrl(String commonBaseUrl) {
        this.commonBaseUrl = commonBaseUrl;
    }
    public String getCrmMpAppId() {
        return crmMpAppId;
    }
    public void setCrmMpAppId(String crmMpAppId) {
        this.crmMpAppId = crmMpAppId;
    }
    public String getDoctorRoleCode() {
        return doctorRoleCode;
    }
    public void setDoctorRoleCode(String doctorRoleCode) {
        this.doctorRoleCode = doctorRoleCode;
    }
    public String getEmpId() {
        return empId;
    }
    public void setEmpId(String empId) {
        this.empId = empId;
    }
    public String getGzhAppid() {
        return gzhAppid;
    }
    public void setGzhAppid(String gzhAppid) {
        this.gzhAppid = gzhAppid;
    }
    public String getIntegralCashKey() {
        return integralCashKey;
    }
    public void setIntegralCashKey(String integralCashKey) {
        this.integralCashKey = integralCashKey;
    }
}
phi_platform_user/src/main/java/com/hx/phip/controller/order/OrderControllerV2.java
@@ -102,6 +102,7 @@
    @Resource
    private OrderGeneralServiceTool orderGeneralServiceTool;
    /**固定线程池-改*/
    public static ExecutorServiceTool threadPool = new ExecutorServiceTool(5,100);
@@ -136,7 +137,7 @@
        //获取订单的子订单
        List<OrderItem> orderItem = JSONObject.parseArray(object.getString("orderItem"), OrderItem.class);
        //校验子订单参数
        orderItem=OrderCreateUtil.checkOrderItem(orderItem,orderTotal.getType());
        orderItem=OrderCreateUtil.checkOrderItem(orderItem,orderTotal.getType(), customParameter, orderTotal.getAppIdCode());
        //校验升单关联信息
        List<OrderRise> orderRiseList = OrderCreateUtil.checkOrderRise(commonService, dto.getOrderRiseList());
phi_platform_user/src/main/java/com/hx/phip/util/api/OrderCreateUtil.java
@@ -226,7 +226,7 @@
     * @param orderItem 一级子订单
     * @return
     */
    public static List<OrderItem> checkOrderItem(List<OrderItem> orderItem, String type) {
    public static List<OrderItem> checkOrderItem(List<OrderItem> orderItem, String type, CustomParameter customParameter, String appIdCode) {
        if ((orderItem == null || orderItem.size() == 0) && !OrderItemConstants.TYPE_RECHARGE.equals(type)) {
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "订单的子订单不能为空");
        }
@@ -245,6 +245,16 @@
            if (o.getDiscount() == null) {
                throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "折扣为空,默认:100");
            }
            //先写死判断非CRM的才使用配置
            if(!PlatformConstants.TYPE_PLATFORM_CRM.equals(appIdCode)){
                //赋值计算的折扣方式
                if(customParameter.getDiscountAlgorithm() != null){
                    o.setDiscountAlgorithm(customParameter.getDiscountAlgorithm());
                }
            }
        });
        return orderItem;
    }