Parcourir la source

Merge remote-tracking branch 'origin/master'

FengChaoYu il y a 3 semaines
Parent
commit
40d60d605b

+ 27 - 1
src/main/java/com/gree/mall/manager/bean/admin/AdminWebsitVO.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.enums.IsYesNoEnum;
 import com.gree.mall.manager.enums.StateEnum;
 import com.gree.mall.manager.enums.StatusEnum;
 import com.gree.mall.manager.plus.entity.AdminWebsit;
@@ -16,7 +17,7 @@ import java.util.Date;
 
 @Data
 @ApiModel
-public class AdminWebsitVO   {
+public class AdminWebsitVO {
 
     @ApiModelProperty(value = "商家编号")
     private String websitId;
@@ -61,6 +62,31 @@ public class AdminWebsitVO   {
     private String payWorkerCodeId;
 
 
+    @ApiModelProperty(value = "云闪付appid")
+    private String yunAppid;
+
+    @ApiModelProperty(value = "云闪付appkey")
+    private String yunAppkey;
+
+    @ApiModelProperty(value = "云闪付商户号")
+    private String yunCompany;
+
+    @ApiModelProperty(value = "云闪付终端号")
+    private String yunNumber;
+
+    @ApiModelProperty(value = "云闪付系统编号")
+    private String yunSystem;
+
+    @ApiModelProperty(value = "云闪付税号")
+    private String yunTax;
+
+    @ApiModelProperty(value = "云闪付企业简称")
+    private String yunName;
+
+    @ApiModelProperty(value = "云闪付是否O2O")
+    private IsYesNoEnum yunTwo;
+
+
     @ApiModelProperty(value = "创建时间")
     @TableField(fill = FieldFill.INSERT)
     private Date createTime;

+ 25 - 0
src/main/java/com/gree/mall/manager/enums/IsYesNoEnum.java

@@ -0,0 +1,25 @@
+package com.gree.mall.manager.enums;
+
+
+import com.baomidou.mybatisplus.annotation.EnumValue;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import com.gree.mall.manager.enums.base.BaseEnum;
+import lombok.AccessLevel;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor(access = AccessLevel.PRIVATE)
+public enum IsYesNoEnum implements BaseEnum {
+    YES("YES","是"),
+    NO("NO","否");
+
+    @EnumValue
+    @JsonValue
+    private final String key;
+    private final String remark;
+
+
+
+}

+ 20 - 0
src/main/java/com/gree/mall/manager/logic/admin/AdminWebsitLogic.java

@@ -9,12 +9,15 @@ import com.gree.mall.manager.bean.admin.AdminWebsitVO;
 import com.gree.mall.manager.commonmapper.AdminMapper;
 import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.logic.common.CommonLogic;
+import com.gree.mall.manager.plus.entity.AdminCompanyWechat;
 import com.gree.mall.manager.plus.entity.AdminCompanyWechatPayConfig;
 import com.gree.mall.manager.plus.entity.AdminWebsit;
 import com.gree.mall.manager.plus.entity.AdminZone;
 import com.gree.mall.manager.plus.service.AdminCompanyWechatPayConfigService;
+import com.gree.mall.manager.plus.service.AdminCompanyWechatService;
 import com.gree.mall.manager.plus.service.AdminWebsitService;
 import com.gree.mall.manager.plus.service.AdminZoneService;
+import com.gree.mall.manager.utils.StringUtil;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
 import lombok.extern.slf4j.Slf4j;
@@ -44,6 +47,9 @@ public class AdminWebsitLogic {
     AdminMapper adminMapper;
 
     @Autowired
+    AdminCompanyWechatService adminCompanyWechatService;
+
+    @Autowired
     AdminCompanyWechatPayConfigService adminCompanyWechatPayConfigService;
 
     /**
@@ -96,12 +102,18 @@ public class AdminWebsitLogic {
         if(adminWebsit.getParentId() == 0){
             throw new RemoteServiceException("请选择父部门");
         }
+        if (StringUtil.isEmpty(adminWebsit.getCompanyWechatId()))
+            throw new RemoteServiceException("上级商家不能为空");
+        AdminCompanyWechat adminCompanyWechat = adminCompanyWechatService.getById(adminWebsit.getPayWorkerCodeId());
+        AdminCompanyWechat adminCompanyWechatP = adminCompanyWechatService.getById(adminWebsit.getCompanyWechatId());
 
         //Long aLong = workWechatLogic.addOrganization(adminWebsit.getName(), adminWebsit.getParentId(),adminUser.getAdminCompanyWechat());
         String aLong = IdWorker.getIdStr();
         adminWebsit.setWebsitId(aLong+"");
 //        adminWebsit.setCorpId(adminUser.getCorpIds().get(0));
         adminWebsit.setWebsitId(aLong);
+        adminWebsit.setCompanyName(adminCompanyWechatP.getCompanyName());
+        adminWebsit.setPayWorkerCodeName(adminCompanyWechat.getCompanyName());
         adminWebsit.insert();
 
     }
@@ -125,7 +137,15 @@ public class AdminWebsitLogic {
         }
         if(adminWebsit.getParentId() == 0){
             throw new RemoteServiceException("请选择父部门");
+
         }
+
+        if (StringUtil.isEmpty(adminWebsit.getCompanyWechatId()))
+            throw new RemoteServiceException("上级商家不能为空");
+        AdminCompanyWechat adminCompanyWechat = adminCompanyWechatService.getById(adminWebsit.getPayWorkerCodeId());
+        AdminCompanyWechat adminCompanyWechatP = adminCompanyWechatService.getById(adminWebsit.getCompanyWechatId());
+        adminWebsit.setCompanyName(adminCompanyWechatP.getCompanyName());
+        adminWebsit.setPayWorkerCodeName(adminCompanyWechat.getCompanyName());
         adminWebsit.updateById();
         //workWechatLogic.updateOrganization(adminWebsit.getWebsitId(),adminWebsit.getName(),adminWebsit.getParentId(),adminUser.getAdminCompanyWechat());