zhangxin 3 долоо хоног өмнө
parent
commit
639987a465

+ 3 - 3
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/dto/AddFamilyMembersDTO.java

@@ -32,11 +32,11 @@ public class AddFamilyMembersDTO {
     @Schema(description = "身份证号")
     private String identityCard;
     /**身份证正面照*/
-    @NotBlank(message = "身份证正面照不允许为空")
+//    @NotBlank(message = "身份证正面照不允许为空")
     @Schema(description = "身份证正面照")
     private String idCardFrontImg;
     /**身份证反面照*/
-    @NotBlank(message = "身份证反面照不允许为空")
+//    @NotBlank(message = "身份证反面照不允许为空")
     @Schema(description = "身份证反面照")
     private String idCardBackImg;
     /**手机号*/
@@ -48,7 +48,7 @@ public class AddFamilyMembersDTO {
     @NotNull(message = "实名状态不允许为空")
     private Integer realNameStatus;
     /**身份证反面照*/
-    @NotBlank(message = "实名认证照片不允许为空")
+//    @NotBlank(message = "实名认证照片不允许为空")
     @Schema(description = "实名认证照片")
     private String realNameImg;
 

+ 1 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/WeChatPayService.java

@@ -182,6 +182,7 @@ public class WeChatPayService {
 
             result.put("code", "SUCCESS");
             result.put("message", "OK");
+            result.put("orderCode",orderCode);
             return result;
         } catch (Exception e) {
             result.put("code", "FAIL");

+ 48 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/OrderServiceImpl.java

@@ -40,10 +40,14 @@ import org.jeecg.modules.pay.config.WechatUrlConstants;
 import org.jeecg.modules.pay.vo.NotifyRequest;
 import org.jeecg.modules.pay.vo.NotifyResponse;
 import org.jeecg.modules.redission.RedissonDelayQueue;
+import org.jeecg.modules.system.app.dto.receiptPaymentDetails.ReceiptPaymentDetailsInfoVo;
 import org.jeecg.modules.system.app.entity.*;
 import org.jeecg.modules.system.app.mapper.*;
+import org.jeecg.modules.system.app.service.IReceiptPaymentDetailsInfoService;
 import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.mapper.SysDepartMapper;
 import org.jeecg.modules.system.mapper.SysUserMapper;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -120,6 +124,12 @@ public class OrderServiceImpl implements IOrderService {
     @Resource
     private RedisTemplate<String, Object> redisTemplate;
 
+    @Autowired
+    IReceiptPaymentDetailsInfoService iReceiptPaymentDetailsInfoService;
+
+    @Autowired
+    SysDepartMapper sysDepartMapper;
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public OrderVO.createOrderPlaceSchool createOrderPlaceSchool(String rulesId, String userIds) {
@@ -1562,7 +1572,44 @@ public class OrderServiceImpl implements IOrderService {
 
     @Override
     public Map<String, String> wechatPayNotify(HttpServletRequest request) {
-        return weChatPayService.wechatPayNotify(request);
+        Map<String, String> stringStringMap = weChatPayService.wechatPayNotify(request);
+        //对订单进行封账金额统计
+        if (stringStringMap!=null
+                && stringStringMap.containsKey("code")
+                && "SUCCESS".equals(stringStringMap.get("code"))
+                && stringStringMap.containsKey("orderCode")
+               ){
+            String orderCode = stringStringMap.get("orderCode");
+
+
+            if(StringUtils.isEmpty(orderCode)){
+                log.error("微信支付成功通知成功,订单编号为空,通知失败:"+JSONObject.toJSONString(stringStringMap));
+                throw new JeecgBootException("微信支付成功通知成功,订单编号为空,通知失败");
+            }
+            AppOrder appOrder = appOrderMapper.selectOne(Wrappers.<AppOrder>lambdaQuery().eq(AppOrder::getOrderCode, orderCode).last("limit 1"));
+            if (appOrder==null){
+                log.error("微信支付成功通知成功,订单未查询到,通知失败:"+JSONObject.toJSONString(stringStringMap));
+                throw new JeecgBootException("微信支付成功通知成功,订单未查询到,通知失败");
+            }
+            log.info("订单信息:"+JSONObject.toJSONString(appOrder));
+            if (StringUtils.isEmpty(appOrder.getOrgCode())){
+                log.error("微信支付成功通知成功,订单属于未知机构,通知失败");
+                return stringStringMap;
+            }
+            if (appOrder.getType()!=null&&appOrder.getType()!=2){
+                BigDecimal priceSum= appOrderProInfoMapper.findByOrderId(appOrder.getId());
+                if (priceSum==null||priceSum.compareTo(BigDecimal.ZERO)==0){
+                    log.error("微信支付成功通知成功,订单明细订单金额为0,不进行分账,orderId:"+appOrder.getId());
+                    return stringStringMap;
+                }
+//                sysDepartMapper.findByOrgCodeAndParentId();
+                log.info("支付成功消息通知,订单信息:"+JSONObject.toJSONString(appOrder));
+                ReceiptPaymentDetailsInfoVo receiptPaymentDetailsInfoVo = new ReceiptPaymentDetailsInfoVo();
+                iReceiptPaymentDetailsInfoService.add(receiptPaymentDetailsInfoVo);
+            }
+
+        }
+        return stringStringMap;
     }
 
     /**

+ 2 - 2
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/dto/receiptPaymentDetails/ReceiptPaymentDetailsInfoVo.java

@@ -70,10 +70,10 @@ public class ReceiptPaymentDetailsInfoVo {
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @Schema(description = "创建时间;创建时间")
-    private Date createTime;
+    private Date createTime=new Date();
 	/**更新时间;更新时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @Schema(description = "更新时间;更新时间")
-    private Date updateTime;
+    private Date updateTime =new Date();
 }

+ 4 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppOrderProInfoMapper.java

@@ -2,8 +2,12 @@ package org.jeecg.modules.system.app.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.system.app.entity.AppOrderProInfo;
 
+import java.math.BigDecimal;
+
 @Mapper
 public interface AppOrderProInfoMapper extends BaseMapper<AppOrderProInfo> {
+    BigDecimal findByOrderId(@Param("orderId") String orderId);
 }

+ 3 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppOrderProInfoMapper.xml

@@ -2,4 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.system.app.mapper.AppOrderProInfoMapper">
 
+    <select id="findByOrderId" resultType="java.math.BigDecimal">
+        select SUM(price) from  nm_order_pro_info where order_id = #{orderId} and  type in (0,1,2,5)
+    </select>
 </mapper>