he2802 2 anos atrás
pai
commit
4795059de0

+ 3 - 3
zhongzheng-api/src/main/java/com/zhongzheng/controller/wx/WxLoginController.java

@@ -113,10 +113,10 @@ public class WxLoginController
 
     @ApiOperation("考前获取用户小程序openid")
     @PostMapping("/app/common/wx/exam/getOpenid")
-    public AjaxResult<Void> getExamOpenid(@RequestBody WxLoginBody loginBody)
+    public AjaxResult<Map<String,String>> getExamOpenid(@RequestBody WxLoginBody loginBody)
     {
-        String openId = wxLoginService.getExamWxOpenId(loginBody);
-        return AjaxResult.success(openId);
+        Map<String,String> map = wxLoginService.getExamWxOpenId(loginBody);
+        return AjaxResult.success(map);
     }
 
     @ApiOperation("考前获取公众号openid")

+ 15 - 5
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/WxLoginService.java

@@ -274,10 +274,10 @@ public class WxLoginService implements IWxLoginService {
 
     @Transactional(rollbackFor = Exception.class)
     public Map<String, Object> openIdLogin(WxLoginBody loginBody) {
-        if(Validator.isEmpty(loginBody.getOpenid())){
+        if(Validator.isEmpty(loginBody.getOpenId())){
             throw new CustomException("openid缺失");
         }
-        User user = iUserService.getOne(new LambdaQueryWrapper<User>().eq(User::getOpenId, loginBody.getOpenid()).last("limit 1"));
+        User user = iUserService.getOne(new LambdaQueryWrapper<User>().eq(User::getOpenId, loginBody.getOpenId()).last("limit 1"));
         if (ObjectUtils.isNull(user)&&Validator.isEmpty(loginBody.getUserId())) {
             throw new CustomException("该openid暂无绑定!",666);
         }
@@ -286,7 +286,10 @@ public class WxLoginService implements IWxLoginService {
             if(Validator.isNotEmpty(user.getOpenId())){
                 throw new CustomException("该用户已绑定过openid!",667);
             }
-            user.setOpenId(loginBody.getOpenid());
+            user.setOpenId(loginBody.getOpenId());
+            if(Validator.isNotEmpty(loginBody.getUnionId())){
+                user.setUnionId(loginBody.getUnionId());
+            }
             iUserService.updateById(user);
         }
 
@@ -418,7 +421,7 @@ public class WxLoginService implements IWxLoginService {
         return openId;
     }
 
-    public String getExamWxOpenId(WxLoginBody loginBody) {
+    public Map<String,String> getExamWxOpenId(WxLoginBody loginBody) {
         if(Validator.isEmpty(loginBody.getCode())){
             throw new CustomException("code缺失");
         }
@@ -432,7 +435,14 @@ public class WxLoginService implements IWxLoginService {
         JSONObject jsonObject = (JSONObject) JSONObject.parse(resultString);
         String session_key = String.valueOf(jsonObject.get("session_key"));
         openId = String.valueOf(jsonObject.get("openid"));
-        return openId;
+        String unionId = null;
+        if (jsonObject.containsKey("unionid")) { //当没绑定开放平台
+            unionId = String.valueOf(jsonObject.get("unionid"));
+        }
+        Map<String,String> map = new HashMap();
+        map.put("openId",openId);
+        map.put("unionId",unionId);
+        return map;
     }
 
 

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/service/impl/TopDivideLogServiceImpl.java

@@ -83,6 +83,7 @@ public class TopDivideLogServiceImpl extends ServiceImpl<TopDivideLogMapper, Top
             SysTenantVo tenantVo = iSysTenantService.queryById(Long.parseLong(db.getTenantId()));
             divideLogVo.setTenantName(tenantVo.getTenantName());
             divideLogVo.setBillType(tenantVo.getBillType());
+            divideLogVo.setPayType(bankPay.getPayType());
             return divideLogVo;
         }
         return null;

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/vo/TopDivideLogVo.java

@@ -130,5 +130,6 @@ public class TopDivideLogVo {
 
 	@ApiModelProperty("审核意见")
 	private String checkReason;
-
+	/** 支付平台 1微信 2支付宝 3金币 4现金 5网银支付6协议7对公转账 */
+	private Integer payType;
 }

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/bo/WxLoginBody.java

@@ -63,6 +63,6 @@ public class WxLoginBody {
     @ApiModelProperty("union_id")
     private String unionId;
 
-    @ApiModelProperty("小程序openid")
-    private String openid;
+    @ApiModelProperty("小程序openId")
+    private String openId;
 }