plf пре 4 година
родитељ
комит
5200bd8a40

+ 0 - 15
src/main/java/com/caimei/controller/OrderSubmitApi.java

@@ -146,19 +146,4 @@ public class OrderSubmitApi {
         log.info("****** 提交订单参数:【机构自己下单】:" + params);
         return orderSubmitService.orderSubmit(clubUserId, addressId, orderInfo, payInfo, orderInvoice);
     }
-
-    /**
-     * 获取运费
-     */
-    @ApiOperation("获取运费")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "productIds", value = "组织商品ID串用逗号隔开。", required = true),
-            @ApiImplicitParam(name = "userId", value = "机构用户id。", required = true),
-            @ApiImplicitParam(name = "totalPrice", value = "商品总金额。", required = true),
-            @ApiImplicitParam(name = "townId", value = "区id", required = true)
-    })
-    @GetMapping("/postage")
-    public ResponseJson<Map<String, Object>> orderPostage(String productIds, Double totalPrice, Integer townId, Integer userId) {
-        return orderSubmitService.orderPostage(productIds, totalPrice, townId, userId);
-    }
 }

+ 0 - 26
src/main/java/com/caimei/controller/PayOrderApi.java

@@ -14,11 +14,9 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.HttpHeaders;
-import org.springframework.http.server.reactive.ServerHttpResponse;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.reactive.function.server.ServerRequest;
 
-import java.io.IOException;
 import java.util.Map;
 
 /**
@@ -45,9 +43,6 @@ public class PayOrderApi {
     @Value("${caimei.redirectLink}")
     private String redirectLink;
 
-    @Value("${caimei.linkPage}")
-    private String linkPage;
-
     /**
      * 获取线上支付开关状态
      *
@@ -136,27 +131,6 @@ public class PayOrderApi {
         return payOrderService.payLink(orderPayLink);
     }
 
-    /**
-     * 支付链接重定向到页面
-     */
-    @ApiOperation("支付链接重定向到页面")
-    @GetMapping("/jumpPage")
-    public void jumpPage(String linkLogo, ServerHttpResponse response) throws IOException {
-        payOrderService.jumpPage(linkLogo, linkPage, response);
-    }
-
-    /**
-     * 链接数据
-     */
-    @ApiOperation("链接数据")
-    @GetMapping("/linkData")
-    public ResponseJson<Map<String, Object>> linkData(String linkLogo) {
-        if (StringUtils.isBlank(linkLogo)) {
-            return ResponseJson.error("参数异常", null);
-        }
-        return payOrderService.linkData(linkLogo);
-    }
-
     /**
      * pc端支付,银联,支付宝
      */

+ 0 - 24
src/main/java/com/caimei/mapper/OrderSubmitMapper.java

@@ -163,28 +163,4 @@ public interface OrderSubmitMapper {
      * @return
      */
     AddressVo findByAddressId(Integer addressId);
-
-    /**
-     * 查询商品
-     *
-     * @param productId
-     * @return
-     */
-    ProductPo findProductById(int productId);
-
-    /**
-     * 是否首单
-     *
-     * @param userId
-     * @return
-     */
-    Integer countUserOrder(Integer userId);
-
-    /**
-     * 查询省市
-     *
-     * @param townId
-     * @return
-     */
-    CityVo findCityByTownId(Integer townId);
 }

+ 0 - 8
src/main/java/com/caimei/mapper/PayOrderMapper.java

@@ -68,14 +68,6 @@ public interface PayOrderMapper {
      */
     void insertOrderPayLink(OrderPayLinkVo orderPayLink);
 
-    /**
-     * 查询线上支付链接
-     *
-     * @param linkLogo
-     * @return
-     */
-    OrderPayLinkVo getOrderPayLink(String linkLogo);
-
     /**
      * 查询订单商品
      *

+ 0 - 11
src/main/java/com/caimei/service/OrderSubmitService.java

@@ -32,15 +32,4 @@ public interface OrderSubmitService {
      * @return
      */
     ResponseJson<Map<String, String>> orderSubmit(Integer clubUserId, Integer addressId, List<Map<String, Object>> orderInfo, Map<String, Object> payInfo, Map<String, Object> orderInvoice);
-
-    /**
-     * 运费规则
-     *
-     * @param productIds
-     * @param totalPrice
-     * @param townId
-     * @param userId
-     * @return
-     */
-    ResponseJson<Map<String, Object>> orderPostage(String productIds, Double totalPrice, Integer townId, Integer userId);
 }

+ 0 - 16
src/main/java/com/caimei/service/PayOrderService.java

@@ -4,10 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.caimei.model.ResponseJson;
 import com.caimei.model.dto.PaymentDto;
 import com.caimei.model.vo.OrderPayLinkVo;
-import org.springframework.http.server.reactive.ServerHttpResponse;
-import org.springframework.web.reactive.function.server.ServerRequest;
 
-import java.io.IOException;
 import java.util.Map;
 
 /**
@@ -50,19 +47,6 @@ public interface PayOrderService {
      */
     ResponseJson<String> payLink(OrderPayLinkVo orderPayLink);
 
-    /**
-     * 重定向到收银台页面
-     */
-    void jumpPage(String linkLogo, String linkPage, ServerHttpResponse response) throws IOException;
-
-    /**
-     * 链接数据
-     *
-     * @param linkLogo
-     * @return
-     */
-    ResponseJson<Map<String, Object>> linkData(String linkLogo);
-
     /**
      * 判断此次支付是否完成
      *

+ 0 - 65
src/main/java/com/caimei/service/impl/OrderSubmitServiceImpl.java

@@ -565,71 +565,6 @@ public class OrderSubmitServiceImpl implements OrderSubmitService {
         return ResponseJson.success(info);
     }
 
-    @Override
-    public ResponseJson<Map<String, Object>> orderPostage(String productIds, Double totalPrice, Integer townId, Integer userId) {
-        List<String> productIdList = new ArrayList<>();
-        if (productIds.contains(",")) {
-            productIdList = Arrays.asList(productIds.split(","));
-        } else {
-            productIdList.add(productIds);
-        }
-        if (productIdList.size() == 0 || null == totalPrice || null == townId || null == userId) {
-            return ResponseJson.error("参数错误", null);
-        }
-        log.info("<<<<<<<<<<<<<<<<<<<<<<<<计算运费>>>>>>>>>>>>>>>>>>>>>>>>");
-        // 默认运费到付
-        Map<String, Object> postageFeeMap = new HashMap<>(2);
-        postageFeeMap.put("freePostFlag", -1);
-        postageFeeMap.put("freight", 0);
-        //商品是否全部设置为包邮
-        boolean isFreeShipping = true;
-        // 是否包含仪器(1001:轻光电,1002:重光电)
-        for (String s : productIdList) {
-            if ("".equals(s) || "undefined".equals(s) || null == s) {
-                return ResponseJson.error("参数错误", null);
-            }
-            ProductPo product = orderSubmitMapper.findProductById(Integer.parseInt(s));
-            //商品是否设置到付
-            boolean isToPay = product.getFreePostFlag() != null && "1".equals(product.getFreePostFlag());
-            if ("2".equals(product.getCommodityType()) || isToPay) {
-                // 仪器运费到付
-                postageFeeMap.put("freePostFlag", -1);
-                postageFeeMap.put("freight", 0);
-                log.info("<<<<<<<<<<<<<<<<<<<<<<<<运费到付");
-                return ResponseJson.success("运费到付", postageFeeMap);
-            }
-            //商品是否全部设置为包邮
-            if (StringUtils.isBlank(product.getFreePostFlag()) || "2".equals(product.getFreePostFlag())) {
-                isFreeShipping = false;
-            }
-        }
-        // 是否首单(订单数)
-        Integer count = orderSubmitMapper.countUserOrder(userId);
-        if (Integer.valueOf(0).equals(count) || isFreeShipping) {
-            postageFeeMap.put("freePostFlag", 0);
-            postageFeeMap.put("freight", 0);
-            // 除含有仪器类外 首单,全国包邮
-            log.info("<<<<<<<<<<<<<<<<<<<<<<<<包邮");
-            return ResponseJson.success("包邮", postageFeeMap);
-        }
-        // 总运费计算
-        CityVo city = orderSubmitMapper.findCityByTownId(townId);
-        Double totalPostageFee = computedPostageFee(city.getProvinceId(), city.getCityId());
-        if (totalPostageFee == 0d) {
-            postageFeeMap.put("freePostFlag", 0);
-            postageFeeMap.put("freight", 0);
-            log.info("<<<<<<<<<<<<<<<<<<<<<<<<包邮");
-            return ResponseJson.success("包邮", postageFeeMap);
-        } else if (totalPostageFee != -1d) {
-            postageFeeMap.put("freePostFlag", 1);
-            postageFeeMap.put("freight", totalPostageFee);
-            log.info("<<<<<<<<<<<<<<<<<<<<<<<<运费金额:" + totalPostageFee);
-            return ResponseJson.success("运费金额", postageFeeMap);
-        }
-        log.info("<<<<<<<<<<<<<<<<<<<<<<<<运费到付");
-        return ResponseJson.success("运费到付", postageFeeMap);
-    }
-
     /**
      * 设置订单发票
      *

+ 1 - 49
src/main/java/com/caimei/service/impl/PayOrderServiceImpl.java

@@ -20,15 +20,11 @@ import com.caimei.util.PayUtils;
 import com.caimei.util.RandomCodeGenerator;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.server.reactive.ServerHttpResponse;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
-import java.io.IOException;
 import java.math.BigDecimal;
-import java.net.URI;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -356,7 +352,7 @@ public class PayOrderServiceImpl implements PayOrderService {
         Date date = new Date();
         GregorianCalendar calendar = new GregorianCalendar();
         calendar.setTime(date);
-        calendar.add(Calendar.DATE, 1);
+        calendar.add(Calendar.DATE, 3);
         orderPayLink.setGenerateTime(date);
         orderPayLink.setEffectiveTime(calendar.getTime());
         orderPayLink.setPayStatus("0");
@@ -372,50 +368,6 @@ public class PayOrderServiceImpl implements PayOrderService {
         return ResponseJson.success(link);
     }
 
-    @Override
-    public void jumpPage(String linkLogo, String linkPage, ServerHttpResponse response) throws IOException {
-        String linkUrl = linkPage + "?linkLogo=" + linkLogo;
-        response.setStatusCode(HttpStatus.FOUND);
-        response.getHeaders().setLocation(URI.create(linkUrl));
-    }
-
-    @Override
-    public ResponseJson<Map<String, Object>> linkData(String linkLogo) {
-        Map<String, Object> map = new HashMap<>(3);
-        OrderPayLinkVo orderPayLink = payOrderMapper.getOrderPayLink(linkLogo);
-        //链接状态,0成功
-        int code = 0;
-        if (null == orderPayLink) {
-            //已重新生成链接
-            return ResponseJson.error("链接更新,请重新获取", null);
-        } else {
-            OrderVo order = orderMapper.findOrder(orderPayLink.getOrderId().intValue());
-            List<DiscernReceiptVo> discernReceiptList = payOrderMapper.getDiscernReceipt(order);
-            if (orderPayLink.getEffectiveTime().compareTo(new Date()) < 0) {
-                //链接失效
-                code = -3;
-            }
-            if (null != discernReceiptList && discernReceiptList.size() > 0) {
-                for (DiscernReceiptVo discernReceipt : discernReceiptList) {
-                    if ("2".equals(discernReceipt.getPayWay())) {
-                        // 已线下支付
-                        code = -2;
-                    }
-                }
-            }
-            if ("1".equals(orderPayLink.getPayStatus())) {
-                //链接已支付
-                code = 5;
-            }
-            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            String time = dateFormat.format(orderPayLink.getEffectiveTime());
-            map.put("orderPayLink", orderPayLink);
-            map.put("code", code);
-            map.put("time", time);
-        }
-        return ResponseJson.success(map);
-    }
-
     @Override
     public ResponseJson<String> payWhetherSuccess(Integer orderId, Integer paySuccessCounter) {
         OrderVo order = orderMapper.findOrder(orderId);

+ 11 - 0
src/main/resources/config/beta/application-beta.yml

@@ -53,6 +53,17 @@ logging:
 swagger:
   enabled: false
 
+#自定义配置
+wx:
+  AppId: wxca7172d7a20bdf7a
+  AppSecret: d7f853a64b73d01ef93f3829852a790e
+  crmAppId: wxea43a0f9ebce9e66
+  crmAppSecret: 1c3cd60908e72dd280840bee9e15f7f6
+
 # 新旧www服务域名
 caimei:
   oldapi: https://www-b.caimei365.com
+  #支付异步回调地址
+  notifyUrl: https://spi-b.caimei365.com/PayOrder/paymentCallback
+  #支付链接重定向地址
+  redirectLink: https://spi-b.caimei365.com/PayOrder/jumpPage

+ 1 - 5
src/main/resources/config/dev/application-dev.yml

@@ -67,8 +67,4 @@ caimei:
   #支付异步回调地址
   notifyUrl: https://spi-b.caimei365.com/PayOrder/paymentCallback
   #支付链接重定向地址
-  redirectLink: https://spi-b.caimei365.com/PayOrder/jumpPage
-  #链接页面
-  linkPage: https://www-b.caimei365.com/pay/caimei-pay.html
-  #延时分账异步回调地址
-  delayedSplittingUrl: https://spi-b.caimei365.com/PayOrder/delayedSplittingCallback
+  redirectLink: https://spi-b.caimei365.com/PayOrder/jumpPage

+ 12 - 1
src/main/resources/config/prod/application-prod.yml

@@ -53,7 +53,18 @@ logging:
 swagger:
   enabled: false
 
+
+#自定义配置
+wx:
+  AppId: wxca7172d7a20bdf7a
+  AppSecret: d7f853a64b73d01ef93f3829852a790e
+  crmAppId: wxea43a0f9ebce9e66
+  crmAppSecret: 1c3cd60908e72dd280840bee9e15f7f6
+
 # 新旧www服务域名
 caimei:
   oldapi: https://www.caimei365.com
-
+  #支付异步回调地址
+  notifyUrl: https://spi.caimei365.com/PayOrder/paymentCallback
+  #支付链接重定向地址
+  redirectLink: https://spi.caimei365.com/PayOrder/jumpPage

+ 1 - 0
src/main/resources/mapper/AddressMapper.xml

@@ -142,6 +142,7 @@
 
     <select id="findInvoice" resultType="com.caimei.model.po.CmUserInvoiceInfoPo">
         SELECT
+            id,
            userId,
            invoiceTitle,
            corporationTaxNum,

+ 2 - 2
src/main/resources/mapper/OrderMapper.xml

@@ -257,7 +257,7 @@
           LEFT JOIN cm_order_product cop ON clr.orderProductID = cop.orderProductID
         WHERE
           clr.shopOrderID = #{shopOrderId}
-          and clr.logisticsBatchID = #{logisticsBatchId}
+          and clr.logisticsBatchID = #{batchId}
     </select>
 
     <select id="findLogisticsInfo" resultType="com.caimei.model.vo.LogisticsInformationVo">
@@ -339,7 +339,7 @@
           LEFT JOIN cm_mall_order_share_code osc ON scr.shareCodeId = osc.id
         WHERE
           scr.openid = #{openid}
-          AND osc.orderID = #{orderID}
+          AND osc.orderID = #{orderId}
           AND scr.delFlag = '0'
     </select>
 

+ 0 - 26
src/main/resources/mapper/OrderSubmitMapper.xml

@@ -1801,30 +1801,4 @@
                  LEFT JOIN province p ON p.provinceID = c.provinceID
         WHERE a.addressID = #{addressId}
     </select>
-
-    <select id="findProductById" resultType="com.caimei.model.po.ProductPo">
-        select
-            <include refid="Product_Column_List" />
-        FROM
-        cm_organize_product cop
-        LEFT JOIN product p ON cop.productId = p.productID
-        where cop.id = #{productId}
-    </select>
-
-    <select id="countUserOrder" resultType="java.lang.Integer">
-        SELECT COUNT(*) FROM cm_order
-        WHERE userID = #{userId}
-        AND delFlag=0 AND STATUS != 6
-    </select>
-
-    <select id="findCityByTownId" resultType="com.caimei.model.vo.CityVo">
-        SELECT
-          cityID AS cityId,
-          provinceID AS provinceId,
-          name
-        FROM city
-        WHERE cityID =(
-            SELECT cityID from town where townID = #{townId}
-        )
-    </select>
 </mapper>

+ 0 - 18
src/main/resources/mapper/PayOrderMapper.xml

@@ -345,24 +345,6 @@
         where id = #{id,jdbcType=INTEGER}
     </update>
 
-    <select id="getOrderPayLink" resultType="com.caimei.model.vo.OrderPayLinkVo">
-        SELECT
-            `id`,
-          `orderId`,
-          `linkLogo`,
-          `unpaidAmount`,
-          `generateTime`,
-          `effectiveTime`,
-          `payStatus`,
-          `payType`,
-          `delFlag`
-        FROM
-          cm_order_pay_link
-        WHERE
-          linkLogo = #{linkLogo}
-          AND delFlag = '0'
-    </select>
-
     <select id="findAllOrderProduct" resultType="com.caimei.model.vo.OrderProductVo">
         SELECT
           orderProductID AS orderProductId,