Browse Source

Merge branch 'saas' of http://git.dayaedu.com/yonge/mec into saas

yonge 3 years ago
parent
commit
7d754021f3

+ 24 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TenantConfigDto.java

@@ -37,6 +37,14 @@ public class TenantConfigDto implements Serializable {
     @ApiModelProperty(value = "主题色")
     private String themeColor;
 
+    @NotBlank(message = "企业公章不能为空")
+    @ApiModelProperty(value = "企业公章图片地址")
+    private String corporateChops;
+
+    @NotBlank(message = "企业财务公章不能为空")
+    @ApiModelProperty(value = "企业财务公章图片地址")
+    private String corporateFinanceChops;
+
     @ApiModelProperty(value = "机构动态配置,以json格式储存")
     private String config;
 
@@ -106,4 +114,20 @@ public class TenantConfigDto implements Serializable {
     public void setUpdatedBy(Integer updatedBy) {
         this.updatedBy = updatedBy;
     }
+
+    public String getCorporateChops() {
+        return corporateChops;
+    }
+
+    public void setCorporateChops(String corporateChops) {
+        this.corporateChops = corporateChops;
+    }
+
+    public String getCorporateFinanceChops() {
+        return corporateFinanceChops;
+    }
+
+    public void setCorporateFinanceChops(String corporateFinanceChops) {
+        this.corporateFinanceChops = corporateFinanceChops;
+    }
 }

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantConfig.java

@@ -54,6 +54,14 @@ public class TenantConfig implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private Date updatedTime;
 
+    @TableField("corporate_chops_")
+    @ApiModelProperty(value = "企业公章图片地址")
+    private String corporateChops;
+
+    @TableField("corporate_finance_chops_")
+    @ApiModelProperty(value = "企业财务公章图片地址")
+    private String corporateFinanceChops;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -128,4 +136,19 @@ public class TenantConfig implements Serializable {
         this.updatedTime = updatedTime;
     }
 
+    public String getCorporateChops() {
+        return corporateChops;
+    }
+
+    public void setCorporateChops(String corporateChops) {
+        this.corporateChops = corporateChops;
+    }
+
+    public String getCorporateFinanceChops() {
+        return corporateFinanceChops;
+    }
+
+    public void setCorporateFinanceChops(String corporateFinanceChops) {
+        this.corporateFinanceChops = corporateFinanceChops;
+    }
 }

+ 7 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantInfoServiceImpl.java

@@ -342,16 +342,14 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
         //建立角色
         Integer roleId = createRole(tenantInfo);
         //密码规则 gym + 随机6位数字
-        String pw = new BCryptPasswordEncoder().encode("gym" + (int) ((Math.random() * 9 + 1) * 100000));
+        String pwStr = "gym" + (int) ((Math.random() * 9 + 1) * 100000);
         // 创建账号、用户信息、用户和角色关系
-        createUser(tenantInfo, orgId, Lists.newArrayList(roleId), pw);
+        createUser(tenantInfo, orgId, Lists.newArrayList(roleId), new BCryptPasswordEncoder().encode(pwStr));
         //建立角色和菜单关系数据
         Lists.partition(collectMenuId, 50)
                 .forEach(idList -> employeeService.batchInsertRoleMenu(roleId, idList, tenantId));
-        if (!profiles.equals("dev")) {
-            //添加签章信息
-            contractService.addTsign(tenantInfo.getTsignCode(), tenantInfo.getTsignName());
-        }
+        //添加签章信息
+        contractService.addTsign(tenantInfo.getTsignCode(), tenantInfo.getTsignName());
 
         Date now = new Date();
 
@@ -369,7 +367,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
         //释放锁
         bucket.delete();
 
-        return pw;
+        return pwStr;
     }
 
     //计算过期时间
@@ -602,7 +600,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
         //原子操作 抢锁成功为true
         if (!bucket.trySet(tenantId, 10, TimeUnit.SECONDS)) {
             if (tenantInfo.getPayState() == 1) {
-                throw new BizException("已缴费请勿重复缴费!");
+                throw new BizException("请勿频繁操作!");
             }
             throw new BizException("正在缴费中请稍后!");
         }
@@ -880,4 +878,5 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
 
         return false;
     }
+
 }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantOrderRecordServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service.impl;
 
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.biz.dal.dao.TenantOrderRecordDao;
@@ -51,6 +52,8 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
     private RedissonClient redissonClient;
     @Autowired
     private TenantAssetsInfoService assetsInfoService;
+    @Autowired
+    private TenantConfigService tenantConfigService;
 
     //订单不存在
     private static final String PAYMENT_ID_NOT_EXISTS = "payment_id_not_exists";
@@ -110,6 +113,10 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
         //购买的信息
         Map<String, Object> detail = new HashMap<>();
         result.put("detail", detail);
+        //查询该机构的财务公章
+        TenantConfig tenantConfig = tenantConfigService.getOne(new QueryWrapper<TenantConfig>()
+                .eq("tenant_id_", orderRecord.getTenantId()));
+        result.put("financeChops",tenantConfig.getCorporateFinanceChops());
 
         log.info("checkTenantOrder  getOrderState>>>>> {}", JSON.toJSONString(orderRecord));
         getOrderState(orderRecord, result);

+ 6 - 3
mec-biz/src/main/resources/config/mybatis/TenantConfigMapper.xml

@@ -11,21 +11,24 @@
         <result column="config_" jdbcType="VARCHAR" property="config"/>
         <result column="updated_by_" jdbcType="INTEGER" property="updatedBy"/>
         <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime"/>
+        <result column="corporate_chops_" jdbcType="VARCHAR" property="corporateChops"/>
+        <result column="corporate_finance_chops_" jdbcType="VARCHAR" property="corporateFinanceChops"/>
     </resultMap>
 
     <sql id="Base_Column_List">
         id_
-        , tenant_id_, charge_rate_, teaching_material_id_, theme_, theme_color_, config_, updated_by_, updated_time_
+        , tenant_id_, charge_rate_, teaching_material_id_, theme_, theme_color_, config_, updated_by_, updated_time_, corporate_chops_, corporate_finance_chops_
     </sql>
 
     <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
             parameterType="com.ym.mec.biz.dal.entity.TenantConfig">
         insert into tenant_config(tenant_id_, charge_rate_, teaching_material_id_, theme_, theme_color_, config_,
-        updated_by_, updated_time_)
+        updated_by_, updated_time_, corporate_chops_, corporate_finance_chops_)
         values
         <foreach collection="entities" item="entity" separator=",">
             (#{entity.tenantId}, #{entity.chargeRate}, #{entity.teachingMaterialId}, #{entity.theme},
-            #{entity.themeColor}, #{entity.config}, #{entity.updatedBy}, #{entity.updatedTime})
+            #{entity.themeColor}, #{entity.config}, #{entity.updatedBy}, #{entity.updatedTime},
+            #{entity.corporateChops}, #{entity.corporateFinanceChops})
         </foreach>
     </insert>