Преглед на файлове

Merge remote-tracking branch 'origin/test_saas' into test_saas

zouxuan преди 3 години
родител
ревизия
983df912d8
променени са 42 файла, в които са добавени 2211 реда и са изтрити 148 реда
  1. 3 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PlatformServeDao.java
  2. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysAreaDao.java
  3. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TenantApplyCallRecordDao.java
  4. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TenantPreJoinDao.java
  5. 275 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TenantPreJoinDto.java
  6. 28 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantApply.java
  7. 85 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantApplyCallRecord.java
  8. 336 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantPreJoin.java
  9. 17 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/TenantContractTemplateQueryInfo.java
  10. 78 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/vo/TenantInfoInfoPageVo.java
  11. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/PlatformServeService.java
  12. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysAreaService.java
  13. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TenantApplyCallRecordService.java
  14. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TenantConfigService.java
  15. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/service/TenantContractTemplateService.java
  16. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TenantInfoService.java
  17. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TenantPreJoinService.java
  18. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/UploadFileService.java
  19. 28 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java
  20. 16 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PlatformServeServiceImpl.java
  21. 9 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysAreaServiceImpl.java
  22. 74 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantApplyCallRecordServiceImpl.java
  23. 2 16
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantAssetsInfoServiceImpl.java
  24. 38 15
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantConfigServiceImpl.java
  25. 3 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantContractTemplateServiceImpl.java
  26. 174 77
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantInfoServiceImpl.java
  27. 97 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantPreJoinServiceImpl.java
  28. 140 0
      mec-biz/src/main/resources/config/contracts/latest_contract_template.ftl
  29. 416 0
      mec-biz/src/main/resources/config/contracts/lexiaoyaContract.ftl
  30. 4 1
      mec-biz/src/main/resources/config/mybatis/PlatformServeMapper.xml
  31. 4 0
      mec-biz/src/main/resources/config/mybatis/SysAreaMapper.xml
  32. 25 0
      mec-biz/src/main/resources/config/mybatis/TenantApplyCallRecordMapper.xml
  33. 10 2
      mec-biz/src/main/resources/config/mybatis/TenantApplyMapper.xml
  34. 14 2
      mec-biz/src/main/resources/config/mybatis/TenantContractTemplateMapper.xml
  35. 16 1
      mec-biz/src/main/resources/config/mybatis/TenantInfoMapper.xml
  36. 58 0
      mec-biz/src/main/resources/config/mybatis/TenantPreJoinMapper.xml
  37. 27 2
      mec-common/common-core/src/main/java/com/ym/mec/common/page/WrapperUtil.java
  38. 2 2
      mec-web/src/main/java/com/ym/mec/web/config/ResourceServerConfig.java
  39. 58 0
      mec-web/src/main/java/com/ym/mec/web/controller/TenantApplyCallRecordController.java
  40. 5 4
      mec-web/src/main/java/com/ym/mec/web/controller/TenantContractTemplateController.java
  41. 9 1
      mec-web/src/main/java/com/ym/mec/web/controller/TenantInfoController.java
  42. 53 0
      mec-web/src/main/java/com/ym/mec/web/controller/TenantPreJoinController.java

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PlatformServeDao.java

@@ -16,7 +16,9 @@ public interface PlatformServeDao extends BaseMapper<PlatformServe> {
 
     int insert(PlatformServe record);
 
-    <T> IPage<T> queryPage(Page<T> page, @Param("search") String search);
+    <T> IPage<T> queryPage(Page<T> page, @Param("search") String search, @Param("id") Integer id);
+
+    <T> T queryPage(@Param("search") String search, @Param("id") Integer id);
 
     PlatformServeInfoVo queryInfo(Integer id);
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysAreaDao.java

@@ -25,4 +25,6 @@ public interface SysAreaDao extends BaseDAO<Integer, SysArea> {
      * @return
      */
     SysArea getParentArea(Integer id);
+
+    SysArea queryByCode(String code);
 }

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TenantApplyCallRecordDao.java

@@ -0,0 +1,20 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ym.mec.biz.dal.entity.TenantApplyCallRecord;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 机构申请记录(TenantApplyCallRecord)表数据库访问层
+ *
+ * @author hgw
+ * @since 2022-02-09 10:44:00
+ */
+public interface TenantApplyCallRecordDao extends BaseMapper<TenantApplyCallRecord> {
+
+    int insertBatch(@Param("entities") List<TenantApplyCallRecord> entities);
+
+}
+

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TenantPreJoinDao.java

@@ -0,0 +1,20 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ym.mec.biz.dal.entity.TenantPreJoin;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 机构入驻表(预加入)(TenantPreJoin)表数据库访问层
+ *
+ * @author hgw
+ * @since 2022-02-09 14:38:08
+ */
+public interface TenantPreJoinDao extends BaseMapper<TenantPreJoin> {
+
+    int insertBatch(@Param("entities") List<TenantPreJoin> entities);
+
+}
+

+ 275 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TenantPreJoinDto.java

@@ -0,0 +1,275 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.Email;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import java.io.Serializable;
+
+/**
+ * @author hgw
+ * Created by 2022-02-10
+ */
+public class TenantPreJoinDto implements Serializable {
+    @ApiModelProperty(value = "主键")
+    private Integer id;
+
+    @NotBlank(message = "公司全称不能为空")
+    @ApiModelProperty(value = "公司全称")
+    private String tsignName;
+
+    @NotBlank(message = "公司简称不能为空")
+    @ApiModelProperty(value = "机构名称/公司简称")
+    private String name;
+
+    @ApiModelProperty(value = "area表code字段")
+    private String areaCode;
+
+    @NotBlank(message = "邮箱不能为空!")
+    @Email(message = "邮箱格式不正确!")
+    @Size(max = 64, message = "邮箱长度不能超过64位!")
+    @ApiModelProperty(value = "机构邮箱")
+    private String email;
+
+    @Size(max = 13, message = "客服电话电话-手机号最高11位、座机号最高为13位,请核实后再填写!")
+    @Pattern(regexp = "^[0-9]*$", message = "客服电话只能填写数字!")
+    @ApiModelProperty(value = "客服电话")
+    private String customerServicePhone;
+
+    @NotBlank(message = "营业执照编码不能为空!")
+    @ApiModelProperty(value = "营业执照编码")
+    private String tsignCode;
+
+    @Size(max = 200, message = "地址不能超过200个字!")
+    @ApiModelProperty(value = "地址")
+    private String address;
+
+    @Size(max = 200, message = "机构描述不能超过200个字!")
+    @ApiModelProperty(value = "机构描述-200字")
+    private String remark;
+
+    @NotBlank(message = "企业负责人不能为空!")
+    @ApiModelProperty(value = "企业负责人")
+    private String enterpriseLiableName;
+
+    @NotBlank(message = "企业负责人电话不能为空!")
+    @Size(max = 11, message = "手机号最高11位请核实后再填写!")
+    @Pattern(regexp = "^[0-9]*$", message = "企业负责人电话只能填写数字!")
+    @ApiModelProperty(value = "企业负责人电话")
+    private String enterpriseLiablePhone;
+
+    @NotBlank(message = "法人身份证正面照片不能为空!")
+    @ApiModelProperty(value = "法人身份证正面照片地址")
+    private String legalPersonIdFrontPic;
+
+    @NotBlank(message = "法人身份证反面照片不能为空!")
+    @ApiModelProperty(value = "法人身份证反面照片地址")
+    private String legalPersonIdReversePic;
+
+    @NotBlank(message = "项目负责人不能为空!")
+    @ApiModelProperty(value = "项目负责人/机构联系人")
+    private String contacts;
+
+    @NotBlank(message = "项目负责人电话电话不能为空!")
+    @Size(max = 11, message = "手机号最高11位请核实后再填写!")
+    @Pattern(regexp = "^[0-9]*$", message = "项目负责人电话电话只能填写数字!")
+    @ApiModelProperty(value = "项目负责人电话/机构联系人电话")
+    private String phone;
+
+    @NotBlank(message = "公司营业执照图片不能为空!")
+    @ApiModelProperty(value = "公司营业执照图片")
+    private String tsignPic;
+
+    @NotBlank(message = "税务登记证照片不能为空!")
+    @ApiModelProperty(value = "税务登记证照片地址")
+    private String taxRegisterPic;
+
+    @NotBlank(message = "公司开户信息照片不能为空!")
+    @ApiModelProperty(value = "公司开户信息照片地址")
+    private String companyAccountInfoPic;
+
+    @NotBlank(message = "机构logo照片不能为空!")
+    @ApiModelProperty(value = "机构logo")
+    private String logo;
+
+    @NotBlank(message = "企业公章图片不能为空!")
+    @ApiModelProperty(value = "企业公章图片地址")
+    private String corporateChops;
+
+    @NotBlank(message = "企业财务公章图片不能为空!")
+    @ApiModelProperty(value = "企业财务公章图片地址")
+    private String corporateFinanceChops;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getTsignName() {
+        return tsignName;
+    }
+
+    public void setTsignName(String tsignName) {
+        this.tsignName = tsignName;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getCustomerServicePhone() {
+        return customerServicePhone;
+    }
+
+    public void setCustomerServicePhone(String customerServicePhone) {
+        this.customerServicePhone = customerServicePhone;
+    }
+
+    public String getTsignCode() {
+        return tsignCode;
+    }
+
+    public void setTsignCode(String tsignCode) {
+        this.tsignCode = tsignCode;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getEnterpriseLiableName() {
+        return enterpriseLiableName;
+    }
+
+    public void setEnterpriseLiableName(String enterpriseLiableName) {
+        this.enterpriseLiableName = enterpriseLiableName;
+    }
+
+    public String getEnterpriseLiablePhone() {
+        return enterpriseLiablePhone;
+    }
+
+    public void setEnterpriseLiablePhone(String enterpriseLiablePhone) {
+        this.enterpriseLiablePhone = enterpriseLiablePhone;
+    }
+
+    public String getLegalPersonIdFrontPic() {
+        return legalPersonIdFrontPic;
+    }
+
+    public void setLegalPersonIdFrontPic(String legalPersonIdFrontPic) {
+        this.legalPersonIdFrontPic = legalPersonIdFrontPic;
+    }
+
+    public String getLegalPersonIdReversePic() {
+        return legalPersonIdReversePic;
+    }
+
+    public void setLegalPersonIdReversePic(String legalPersonIdReversePic) {
+        this.legalPersonIdReversePic = legalPersonIdReversePic;
+    }
+
+    public String getContacts() {
+        return contacts;
+    }
+
+    public void setContacts(String contacts) {
+        this.contacts = contacts;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getTsignPic() {
+        return tsignPic;
+    }
+
+    public void setTsignPic(String tsignPic) {
+        this.tsignPic = tsignPic;
+    }
+
+    public String getTaxRegisterPic() {
+        return taxRegisterPic;
+    }
+
+    public void setTaxRegisterPic(String taxRegisterPic) {
+        this.taxRegisterPic = taxRegisterPic;
+    }
+
+    public String getCompanyAccountInfoPic() {
+        return companyAccountInfoPic;
+    }
+
+    public void setCompanyAccountInfoPic(String companyAccountInfoPic) {
+        this.companyAccountInfoPic = companyAccountInfoPic;
+    }
+
+    public String getLogo() {
+        return logo;
+    }
+
+    public void setLogo(String logo) {
+        this.logo = logo;
+    }
+
+    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;
+    }
+
+    public String getAreaCode() {
+        return areaCode;
+    }
+
+    public void setAreaCode(String areaCode) {
+        this.areaCode = areaCode;
+    }
+
+}

+ 28 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantApply.java

@@ -35,7 +35,17 @@ public class TenantApply {
 	
 	/** 回访记录 */
 	private String callBackLog;
-	
+
+    /**
+     * 回访人/沟通人
+     */
+    private String callBackPeople;
+
+    /**
+     * 推荐人/非必填
+     */
+    private String recommender;
+
 	private String smsCode;
 	
 	public void setId(Long id){
@@ -126,7 +136,23 @@ public class TenantApply {
 		this.smsCode = smsCode;
 	}
 
-	@Override
+    public String getCallBackPeople() {
+        return callBackPeople;
+    }
+
+    public void setCallBackPeople(String callBackPeople) {
+        this.callBackPeople = callBackPeople;
+    }
+
+    public String getRecommender() {
+        return recommender;
+    }
+
+    public void setRecommender(String recommender) {
+        this.recommender = recommender;
+    }
+
+    @Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 	}

+ 85 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantApplyCallRecord.java

@@ -0,0 +1,85 @@
+package com.ym.mec.biz.dal.entity;
+
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+
+/**
+ * 机构申请记录(TenantApplyCallRecord)表实体类
+ *
+ * @author hgw
+ * @since 2022-02-09 10:44:23
+ */
+@ApiModel(value = "tenant_apply_call_record-机构申请记录")
+public class TenantApplyCallRecord implements Serializable {
+    @TableId(value = "id_", type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
+    private Integer id;
+
+    @TableField("tenant_apply_id_")
+    @ApiModelProperty(value = "tenant_apply表id")
+    private Integer tenantApplyId;
+
+    @TableField("call_back_people_")
+    @ApiModelProperty(value = "回访人/沟通人姓名")
+    private String callBackPeople;
+
+    @TableField("call_back_log_")
+    @ApiModelProperty(value = "回访/沟通记录-最多140个字符")
+    private String callBackLog;
+
+    @TableField("create_time_")
+    @ApiModelProperty(value = "沟通时间")
+    private Date createTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getTenantApplyId() {
+        return tenantApplyId;
+    }
+
+    public void setTenantApplyId(Integer tenantApplyId) {
+        this.tenantApplyId = tenantApplyId;
+    }
+
+    public String getCallBackPeople() {
+        return callBackPeople;
+    }
+
+    public void setCallBackPeople(String callBackPeople) {
+        this.callBackPeople = callBackPeople;
+    }
+
+    public String getCallBackLog() {
+        return callBackLog;
+    }
+
+    public void setCallBackLog(String callBackLog) {
+        this.callBackLog = callBackLog;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+}
+

+ 336 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantPreJoin.java

@@ -0,0 +1,336 @@
+package com.ym.mec.biz.dal.entity;
+
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 机构入驻表(预加入)(TenantPreJoin)表实体类
+ *
+ * @author hgw
+ * @since 2022-02-10 13:53:58
+ */
+@ApiModel(value = "tenant_pre_join-机构入驻表(预加入)")
+public class TenantPreJoin implements Serializable {
+    @TableId(value = "id_", type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
+    private Integer id;
+
+    @TableField("tsign_name_")
+    @ApiModelProperty(value = "公司全称")
+    private String tsignName;
+
+    @TableField("name_")
+    @ApiModelProperty(value = "机构名称/公司简称")
+    private String name;
+
+    @TableField("area_id_")
+    @ApiModelProperty(value = "城市id")
+    private Integer areaId;
+
+    @TableField("area_name_")
+    @ApiModelProperty(value = "城市名称")
+    private String areaName;
+
+    @TableField("email_")
+    @ApiModelProperty(value = "机构邮箱")
+    private String email;
+
+    @TableField("customer_service_phone_")
+    @ApiModelProperty(value = "客服电话")
+    private String customerServicePhone;
+
+    @TableField("tsign_code_")
+    @ApiModelProperty(value = "营业执照编码")
+    private String tsignCode;
+
+    @TableField("address_")
+    @ApiModelProperty(value = "地址")
+    private String address;
+
+    @TableField("remark_")
+    @ApiModelProperty(value = "机构描述-200字")
+    private String remark;
+
+    @TableField("enterprise_liable_name_")
+    @ApiModelProperty(value = "企业负责人")
+    private String enterpriseLiableName;
+
+    @TableField("enterprise_liable_phone_")
+    @ApiModelProperty(value = "企业负责人电话")
+    private String enterpriseLiablePhone;
+
+    @TableField("legal_person_id_front_pic_")
+    @ApiModelProperty(value = "法人身份证正面照片地址")
+    private String legalPersonIdFrontPic;
+
+    @TableField("legal_person_id_reverse_pic_")
+    @ApiModelProperty(value = "法人身份证反面照片地址")
+    private String legalPersonIdReversePic;
+
+    @TableField("contacts_")
+    @ApiModelProperty(value = "项目负责人/机构联系人")
+    private String contacts;
+
+    @TableField("phone_")
+    @ApiModelProperty(value = "项目负责人电话/机构联系人电话")
+    private String phone;
+
+    @TableField("tsign_pic_")
+    @ApiModelProperty(value = "公司营业执照图片")
+    private String tsignPic;
+
+    @TableField("tax_register_pic_")
+    @ApiModelProperty(value = "税务登记证照片地址")
+    private String taxRegisterPic;
+
+    @TableField("company_account_info_pic_")
+    @ApiModelProperty(value = "公司开户信息照片地址")
+    private String companyAccountInfoPic;
+
+    @TableField("logo_")
+    @ApiModelProperty(value = "机构logo")
+    private String logo;
+
+    @TableField("corporate_chops_")
+    @ApiModelProperty(value = "企业公章图片地址")
+    private String corporateChops;
+
+    @TableField("corporate_finance_chops_")
+    @ApiModelProperty(value = "企业财务公章图片地址")
+    private String corporateFinanceChops;
+
+    @TableField("state_")
+    @ApiModelProperty(value = "是否已创建为机构 0未创建 1已创建")
+    private Integer state;
+
+    @TableField("created_time_")
+    @ApiModelProperty(value = "创建时间")
+    private Date createdTime;
+
+    @TableField("province_id_")
+    @ApiModelProperty(value = "省份id")
+    private Integer provinceId;
+
+    @TableField("province_name_")
+    @ApiModelProperty(value = "省份名称")
+    private String provinceName;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getTsignName() {
+        return tsignName;
+    }
+
+    public void setTsignName(String tsignName) {
+        this.tsignName = tsignName;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getAreaId() {
+        return areaId;
+    }
+
+    public void setAreaId(Integer areaId) {
+        this.areaId = areaId;
+    }
+
+    public String getAreaName() {
+        return areaName;
+    }
+
+    public void setAreaName(String areaName) {
+        this.areaName = areaName;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getCustomerServicePhone() {
+        return customerServicePhone;
+    }
+
+    public void setCustomerServicePhone(String customerServicePhone) {
+        this.customerServicePhone = customerServicePhone;
+    }
+
+    public String getTsignCode() {
+        return tsignCode;
+    }
+
+    public void setTsignCode(String tsignCode) {
+        this.tsignCode = tsignCode;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getEnterpriseLiableName() {
+        return enterpriseLiableName;
+    }
+
+    public void setEnterpriseLiableName(String enterpriseLiableName) {
+        this.enterpriseLiableName = enterpriseLiableName;
+    }
+
+    public String getEnterpriseLiablePhone() {
+        return enterpriseLiablePhone;
+    }
+
+    public void setEnterpriseLiablePhone(String enterpriseLiablePhone) {
+        this.enterpriseLiablePhone = enterpriseLiablePhone;
+    }
+
+    public String getLegalPersonIdFrontPic() {
+        return legalPersonIdFrontPic;
+    }
+
+    public void setLegalPersonIdFrontPic(String legalPersonIdFrontPic) {
+        this.legalPersonIdFrontPic = legalPersonIdFrontPic;
+    }
+
+    public String getLegalPersonIdReversePic() {
+        return legalPersonIdReversePic;
+    }
+
+    public void setLegalPersonIdReversePic(String legalPersonIdReversePic) {
+        this.legalPersonIdReversePic = legalPersonIdReversePic;
+    }
+
+    public String getContacts() {
+        return contacts;
+    }
+
+    public void setContacts(String contacts) {
+        this.contacts = contacts;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getTsignPic() {
+        return tsignPic;
+    }
+
+    public void setTsignPic(String tsignPic) {
+        this.tsignPic = tsignPic;
+    }
+
+    public String getTaxRegisterPic() {
+        return taxRegisterPic;
+    }
+
+    public void setTaxRegisterPic(String taxRegisterPic) {
+        this.taxRegisterPic = taxRegisterPic;
+    }
+
+    public String getCompanyAccountInfoPic() {
+        return companyAccountInfoPic;
+    }
+
+    public void setCompanyAccountInfoPic(String companyAccountInfoPic) {
+        this.companyAccountInfoPic = companyAccountInfoPic;
+    }
+
+    public String getLogo() {
+        return logo;
+    }
+
+    public void setLogo(String logo) {
+        this.logo = logo;
+    }
+
+    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;
+    }
+
+    public Integer getState() {
+        return state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public Date getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Date createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Integer getProvinceId() {
+        return provinceId;
+    }
+
+    public void setProvinceId(Integer provinceId) {
+        this.provinceId = provinceId;
+    }
+
+    public String getProvinceName() {
+        return provinceName;
+    }
+
+    public void setProvinceName(String provinceName) {
+        this.provinceName = provinceName;
+    }
+
+}
+

+ 17 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TenantContractTemplateQueryInfo.java

@@ -0,0 +1,17 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+
+public class TenantContractTemplateQueryInfo extends QueryInfo {
+
+    private Boolean status;
+
+	public Boolean getStatus() {
+		return status;
+	}
+
+	public void setStatus(Boolean status) {
+		this.status = status;
+	}
+
+}

+ 78 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/TenantInfoInfoPageVo.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -20,12 +21,18 @@ public class TenantInfoInfoPageVo implements Serializable {
     @ApiModelProperty(value = "机构名称")
     private String name;
 
+    @ApiModelProperty(value = "企业全称称")
+    private String tsignName;
+
     @ApiModelProperty(value = "机构联系人")
     private String contacts;
 
     @ApiModelProperty(value = "机构联系人电话")
     private String phone;
 
+    @ApiModelProperty(value = "地址")
+    private String address;
+
     @ApiModelProperty(value = "机构email")
     private String email;
 
@@ -48,6 +55,9 @@ public class TenantInfoInfoPageVo implements Serializable {
     @ApiModelProperty(value = "服务名称")
     private String serveName;
 
+    @ApiModelProperty(value = "服务id")
+    private Integer serveId;
+
     @ApiModelProperty(value = "学员上限")
     private Integer studentUpLimit;
 
@@ -55,6 +65,18 @@ public class TenantInfoInfoPageVo implements Serializable {
     @ApiModelProperty(value = "到期时间")
     private Date expireDate;
 
+    @ApiModelProperty(value = "合同价单价")
+    private BigDecimal contractPrice;
+
+    @ApiModelProperty(value = "有效期(数字-结合有效期单位)")
+    private Integer expiryCount;
+
+    @ApiModelProperty(value = "有效期单位(年/月)")
+    private String expiryUnit;
+
+    @ApiModelProperty(value = "城市/区域id")
+    private Integer areaId;
+
     @ApiModelProperty(value = "学员上限")
     private Integer userId;
 
@@ -169,4 +191,60 @@ public class TenantInfoInfoPageVo implements Serializable {
     public void setUserId(Integer userId) {
         this.userId = userId;
     }
+
+    public String getTsignName() {
+        return tsignName;
+    }
+
+    public void setTsignName(String tsignName) {
+        this.tsignName = tsignName;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public BigDecimal getContractPrice() {
+        return contractPrice;
+    }
+
+    public void setContractPrice(BigDecimal contractPrice) {
+        this.contractPrice = contractPrice;
+    }
+
+    public Integer getExpiryCount() {
+        return expiryCount;
+    }
+
+    public void setExpiryCount(Integer expiryCount) {
+        this.expiryCount = expiryCount;
+    }
+
+    public String getExpiryUnit() {
+        return expiryUnit;
+    }
+
+    public void setExpiryUnit(String expiryUnit) {
+        this.expiryUnit = expiryUnit;
+    }
+
+    public Integer getAreaId() {
+        return areaId;
+    }
+
+    public void setAreaId(Integer areaId) {
+        this.areaId = areaId;
+    }
+
+    public Integer getServeId() {
+        return serveId;
+    }
+
+    public void setServeId(Integer serveId) {
+        this.serveId = serveId;
+    }
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/PlatformServeService.java

@@ -20,6 +20,8 @@ public interface PlatformServeService extends IService<PlatformServe> {
 
     PageInfo<PlatformServePageVo> queryPage(String search, Integer page, Integer rows);
 
+    PlatformServePageVo queryProductNameById(Integer id);
+
     PlatformServeInfoVo queryInfo(Integer id);
 
     List<PlatformServeModeVo> queryModeDetail(Integer id);

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysAreaService.java

@@ -29,4 +29,10 @@ public interface SysAreaService extends BaseService<Integer, SysArea> {
      * @return
      */
     SysArea getParentArea(Integer id);
+
+    /**
+     * 根据code查询
+     */
+    SysArea queryByCode(String code);
+
 }

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/TenantApplyCallRecordService.java

@@ -0,0 +1,22 @@
+package com.ym.mec.biz.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ym.mec.biz.dal.entity.TenantApplyCallRecord;
+import com.ym.mec.common.page.PageInfo;
+
+import java.util.Map;
+
+/**
+ * 机构申请记录(TenantApplyCallRecord)表服务接口
+ *
+ * @author hgw
+ * @since 2022-02-09 10:44:23
+ */
+public interface TenantApplyCallRecordService extends IService<TenantApplyCallRecord> {
+
+    PageInfo<TenantApplyCallRecord> queryPage(Map<String,Object> param);
+
+    int insert(TenantApplyCallRecord obj);
+
+}
+

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

@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.biz.dal.dto.TenantConfigDto;
 import com.ym.mec.biz.dal.entity.TenantConfig;
 
+import java.math.BigDecimal;
+import java.util.Map;
+
 public interface TenantConfigService extends IService<TenantConfig> {
 
     void addConfig(TenantConfigDto dto);
@@ -11,4 +14,8 @@ public interface TenantConfigService extends IService<TenantConfig> {
     void updateConfig(TenantConfigDto dto);
     
     TenantConfig queryByTenantId(Integer tenantId);
+
+    Map<String, BigDecimal> getRule(Integer tenantId);
+
+    Map<String, BigDecimal> getCloudRoomRule(String config);
 }

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/TenantContractTemplateService.java

@@ -31,10 +31,11 @@ public interface TenantContractTemplateService extends BaseService<Integer, Tena
 	
 	/**
 	 * 查询最新协议模板
+	 * @param tenantId
 	 * @param owner
 	 * @param type
 	 * @return
 	 */
-	String queryLatestContractTemplate(String owner, String type);
+	TenantContractTemplate queryLatestContractTemplate(Integer tenantId, String owner, String type);
 	
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/TenantInfoService.java

@@ -35,6 +35,8 @@ public interface TenantInfoService extends IService<TenantInfo> {
 
     TenantInfo get(Integer tenantId);
 
+    String getContract(Integer tenantId);
+
     Map<String, Object> tenantOpenPay(Integer tenantId) throws Exception;
 
     Map<String, Object> tenantRenewPay(Integer tenantId, Integer val) throws Exception;

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/TenantPreJoinService.java

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ym.mec.biz.dal.dto.TenantPreJoinDto;
+import com.ym.mec.biz.dal.entity.TenantPreJoin;
+import com.ym.mec.common.page.PageInfo;
+
+import java.util.Map;
+
+/**
+ * 机构入驻表(预加入)(TenantPreJoin)表服务接口
+ *
+ * @author hgw
+ * @since 2022-02-09 14:38:28
+ */
+public interface TenantPreJoinService extends IService<TenantPreJoin> {
+
+    PageInfo<TenantPreJoin> queryPage(Map<String, Object> param);
+
+    int insert(TenantPreJoinDto obj);
+
+}
+

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/UploadFileService.java

@@ -31,7 +31,7 @@ public class UploadFileService {
 	private int maxSize;
 
 	/** 支持的扩展名 */
-	@Value("${common.upload.supportExtensions:jpg,jpeg,gif,png,mp3,mid,midi,aac,m4a,mp4,xml,xlsx,xls,doc,docx,txt,pdf,psd,eps,rar,zip}")
+	@Value("${common.upload.supportExtensions:jpg,jpeg,gif,png,mp3,mid,midi,aac,m4a,mp4,xml,xlsx,xls,doc,docx,txt,pdf,psd,eps,rar,zip,ai,eps,svg,sketch}")
 	private String supportExtensions;
 
 	/** 文件根目录 */

+ 28 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java

@@ -16,6 +16,7 @@ import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.thirdparty.eseal.ESealPlugin;
 import com.ym.mec.thirdparty.storage.StoragePluginContext;
 import com.ym.mec.thirdparty.storage.provider.KS3StoragePlugin;
@@ -25,6 +26,7 @@ import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.freemarker.FreemarkerTemplateEngine;
 import com.ym.mec.util.money.MoneyUtil;
 import com.ym.mec.util.pdf.PDFUtil;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -45,6 +47,7 @@ import java.io.File;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.nio.charset.Charset;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
@@ -115,6 +118,9 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
     
     @Autowired
     private TenantConfigService tenantConfigService;
+    
+    @Autowired
+    private TenantContractTemplateService tenantContractTemplateService;
 
     @Value("${contract.baseDir:/var/pdf}")
     private String contractBaseDir;
@@ -907,8 +913,18 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
         if (Objects.nonNull(courseViewType)) {
             ownershipType = courseViewType;
         }
+		
+        // 查询最新协议模板
+		TenantContractTemplate tenantContractTemplate = tenantContractTemplateService.queryLatestContractTemplate(TenantContextHolder.getTenantId(), null, null);
+		if(tenantContractTemplate == null){
+			logger.error("最新协议模板查询失败");
+			return;
+		}
+		String mainContent = tenantContractTemplate.getContractTemplateContent();
+		params.put("contractMainContent", mainContent);
 
-        List<SysUserContracts> userContracts = sysUserContractsService.getUserContractWithType(userId, ContractType.PRODUCT, ownershipType.getContractVersion());
+        // 查询是否已生成协议
+        List<SysUserContracts> userContracts = sysUserContractsService.getUserContractWithType(userId, ContractType.PRODUCT, tenantContractTemplate.getVersion());
         if (!CollectionUtils.isEmpty(userContracts)) {
             return;
         }
@@ -936,7 +952,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 			}
 		}
 
-        templateEngine.render(params, "product" + ownershipType.getContractVersion() + ".ftl", srcFile);
+        templateEngine.render(params, "latest_contract_template.ftl", srcFile);
 
         // 生成借款协议PDF
         try {
@@ -979,7 +995,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
         sysUserContracts.setType(ContractType.PRODUCT);
         sysUserContracts.setUrl(pdfFilePath);
         sysUserContracts.setUserId(userId);
-        sysUserContracts.setVersion(ownershipType.getContractVersion());
+        sysUserContracts.setVersion(tenantContractTemplate.getVersion());
 
         sysUserContractsService.insert(sysUserContracts);
 
@@ -1061,8 +1077,15 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 				params.put("sealPicture", "https://daya-online.oss-cn-beijing.aliyuncs.com/website/clcf.png");
 			}
 		}
+		
+		TenantContractTemplate tenantContractTemplate = tenantContractTemplateService.queryLatestContractTemplate(TenantContextHolder.getTenantId(), null, null);
+		if(tenantContractTemplate == null){
+			throw new BizException("最新协议模板查询失败");
+		}
+		String mainContent = tenantContractTemplate.getContractTemplateContent();
+		params.put("contractMainContent", mainContent);
 
-        templateEngine.render(params, "product" + ownershipType.getContractVersion() + ".ftl", srcFile);
+        templateEngine.render(params, "latest_contract_template.ftl", srcFile);
 
         String html = "";
         try {
@@ -1165,7 +1188,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 
         // 生成借款协议PDF
         try {
-            PDFUtil.renderToPDFByData(ContractServiceImpl.class.getResource("/").getFile(), FileUtils.readFileToString(srcFile), srcPdfPath, "simsun.ttc");
+            PDFUtil.renderToPDFByData(ContractServiceImpl.class.getResource("/").getFile(), FileUtils.readFileToString(srcFile, Charset.defaultCharset()), srcPdfPath, "simsun.ttc");
         } catch (IOException e) {
             logger.error("生成产品协议失败", e);
             return BaseController.failed("生成产品协议失败");

+ 16 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PlatformServeServiceImpl.java

@@ -93,7 +93,7 @@ public class PlatformServeServiceImpl extends ServiceImpl<PlatformServeDao, Plat
 
         TenantProductInfo productInfo = tenantProductInfoService.getOne(new QueryWrapper<TenantProductInfo>()
                 .eq("serve_id_", id));
-        if(Objects.nonNull(productInfo)){
+        if (Objects.nonNull(productInfo)) {
             throw new BizException("该服务已关联机构无法删除!");
         }
 
@@ -116,11 +116,21 @@ public class PlatformServeServiceImpl extends ServiceImpl<PlatformServeDao, Plat
     public PageInfo<PlatformServePageVo> queryPage(String search, Integer page, Integer rows) {
         Page<PlatformServePageVo> pageInfo = PageUtil.getPage(page, rows);
         pageInfo.setAsc("a.id_");
-        IPage<PlatformServePageVo> pageData = baseMapper.queryPage(pageInfo, search);
+        IPage<PlatformServePageVo> pageData = baseMapper.queryPage(pageInfo, search,null);
         return PageUtil.pageInfo(pageData);
     }
 
     /**
+     * 根据服务id查询关联的产品名称(名称用逗号分割)
+     *
+     * @param id
+     */
+    @Override
+    public PlatformServePageVo queryProductNameById(Integer id) {
+        return baseMapper.queryPage(null, id);
+    }
+
+    /**
      * 查询单个服务的详情
      *
      * @param id 服务id
@@ -141,7 +151,10 @@ public class PlatformServeServiceImpl extends ServiceImpl<PlatformServeDao, Plat
     }
 
     private PlatformServeServiceInfo getServeInfo(PlatformServeDto obj) {
-        List<PlatformServeDetail> detailList = getDetailList(obj);
+        List<PlatformServeDetail> detailList = Optional.ofNullable(obj)
+                .filter(o -> CollectionUtils.isNotEmpty(obj.getDetailList()))
+                .map(PlatformServeDto::getDetailList)
+                .orElseThrow(() -> new BizException("请填入服务详情"));
 
         Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
                 .map(SysUser::getId)
@@ -189,13 +202,6 @@ public class PlatformServeServiceImpl extends ServiceImpl<PlatformServeDao, Plat
         }
     }
 
-    private List<PlatformServeDetail> getDetailList(PlatformServeDto obj) {
-        return Optional.ofNullable(obj)
-                .filter(o -> CollectionUtils.isNotEmpty(obj.getDetailList()))
-                .map(PlatformServeDto::getDetailList)
-                .orElseThrow(() -> new BizException("请填入服务详情"));
-    }
-
     private void addDetail(List<PlatformServeDetail> detailList, Integer id) {
         detailList.forEach(detail -> {
             detail.setServeId(id);

+ 9 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysAreaServiceImpl.java

@@ -7,12 +7,14 @@ import com.ym.mec.biz.dal.entity.SysArea;
 import com.ym.mec.biz.dal.page.OrganizationQueryInfo;
 import com.ym.mec.biz.service.SysAreaService;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.Optional;
 
 @Service
 public class SysAreaServiceImpl extends BaseServiceImpl<Integer, SysArea> implements SysAreaService {
@@ -44,7 +46,13 @@ public class SysAreaServiceImpl extends BaseServiceImpl<Integer, SysArea> implem
 		return sysAreaDao.getParentArea(id);
 	}
 
-	private SysArea getTree(SysArea area){
+    @Override
+    public SysArea queryByCode(String code) {
+        Optional.ofNullable(code).orElseThrow(() -> new BizException("区域code不能为空"));
+        return sysAreaDao.queryByCode(code);
+    }
+
+    private SysArea getTree(SysArea area){
 		//得到根节点对象
 		//获取子节点list
 		List<SysArea> sysAreas = sysAreaDao.findRootList(area.getId(), area.getDelFlag());

+ 74 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantApplyCallRecordServiceImpl.java

@@ -0,0 +1,74 @@
+package com.ym.mec.biz.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.TenantApplyCallRecordDao;
+import com.ym.mec.biz.dal.entity.TenantApplyCallRecord;
+import com.ym.mec.biz.service.TenantApplyCallRecordService;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.PageUtil;
+import com.ym.mec.common.page.WrapperUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+/**
+ * 机构申请记录(TenantApplyCallRecord)表服务实现类
+ *
+ * @author hgw
+ * @since 2022-02-09 10:44:26
+ */
+@Service("tenantApplyCallRecordService")
+public class TenantApplyCallRecordServiceImpl extends ServiceImpl<TenantApplyCallRecordDao, TenantApplyCallRecord> implements TenantApplyCallRecordService {
+
+    private final static Logger log = LoggerFactory.getLogger(TenantApplyCallRecordServiceImpl.class);
+
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @Override
+    public PageInfo<TenantApplyCallRecord> queryPage(Map<String, Object> param) {
+        int pageSize = PageUtil.getPage(param, "rows").orElse(50);
+        int pageIndex = PageUtil.getPage(param, "page").orElse(1);
+        Page<TenantApplyCallRecord> pageInfo = new Page<>(pageIndex, pageSize);
+        IPage<TenantApplyCallRecord> page = this.page(pageInfo,
+                new WrapperUtil<TenantApplyCallRecord>()
+                        .hasEq("tenant_apply_id_", param.get("applyId"))
+                        .hasGe("create_time_", param.get("startTime"))
+                        .hasLe("create_time_", param.get("endTime"))
+                        .queryWrapper());
+        return PageUtil.pageInfo(page);
+    }
+
+    @Override
+    public int insert(TenantApplyCallRecord obj) {
+        Optional<TenantApplyCallRecord> optional = Optional.ofNullable(obj);
+        optional.orElseThrow(() -> new BizException("参数异常!"));
+        optional.map(TenantApplyCallRecord::getTenantApplyId)
+                                .orElseThrow(() -> new BizException("参数异常"));
+        optional.map(TenantApplyCallRecord::getCallBackLog)
+                .filter(a -> StringUtils.isNotBlank(a) && a.length() <= 140)
+                .orElseThrow(() -> new BizException("请填写小于140字的沟通记录!"));
+        obj.setCallBackPeople(getUser().getRealName());
+        return baseMapper.insert(obj);
+    }
+
+    private SysUser getUser() {
+        //修改机构基础信息
+        return Optional.ofNullable(sysUserFeignService.queryUserInfo())
+                .orElseThrow(() -> new BizException("用户信息获取失败,请刷新页面或者重新登录!"));
+    }
+
+
+}
+

+ 2 - 16
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantAssetsInfoServiceImpl.java

@@ -75,7 +75,7 @@ public class TenantAssetsInfoServiceImpl extends ServiceImpl<TenantAssetsInfoDao
             //获取总人数 (算上老师
             String totalPeople = getTotalPeople(record.getType(), record.getCourseId());
             //获取云教室规则  String人数-BigDecimal每分钟扣费标准
-            Map<String, BigDecimal> rule = getRule(record.getTenantId());
+            Map<String, BigDecimal> rule = tenantConfigService.getRule(record.getTenantId());
             if (Objects.isNull(rule)) {
                 throw new BizException("未查询到该机构的课程收费标准!");
             }
@@ -124,7 +124,7 @@ public class TenantAssetsInfoServiceImpl extends ServiceImpl<TenantAssetsInfoDao
             //获取总人数 ,+1算上老师
             String totalPeople = getTotalPeople(course.getType().getCode(), course.getId().intValue());
             //获取云教室规则  String人数-BigDecimal每分钟扣费标准
-            Map<String, BigDecimal> rule = getRule(course.getTenantId());
+            Map<String, BigDecimal> rule = tenantConfigService.getRule(course.getTenantId());
             if (Objects.isNull(rule)) {
                 //没有这个扣费标准,写未扣费流水记录
                 insertRecord(course, BigDecimal.ZERO, 3);
@@ -273,20 +273,6 @@ public class TenantAssetsInfoServiceImpl extends ServiceImpl<TenantAssetsInfoDao
         return result;
     }
 
-    private Map<String, BigDecimal> getRule(Integer tenantId) {
-        //查询云教室扣费标准
-        TenantConfig tenantConfig = tenantConfigService.getOne(new WrapperUtil<TenantConfig>()
-                .hasEq("tenant_id_", tenantId).queryWrapper());
-        if (Objects.isNull(tenantConfig)) {
-            return null;
-        }
-        return Optional.ofNullable(tenantConfig.getConfig())
-                .map(c -> JSON.parseObject(c, TenantConfigDetail.class))
-                .map(TenantConfigDetail::getCloud_room_rule)
-                .map(CloudRoomRule::getCloud_room_config)
-                .orElse(null);
-    }
-
     private BigDecimal getCourseDate(Date date, Date startTime, Date endTime) {
         String dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD_DEF);
         int durationMinute = 0;

+ 38 - 15
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantConfigServiceImpl.java

@@ -1,24 +1,27 @@
 package com.ym.mec.biz.service.impl;
 
-import java.util.Date;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.function.Consumer;
-
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.TenantConfigDao;
 import com.ym.mec.biz.dal.dto.TenantConfigDto;
 import com.ym.mec.biz.dal.entity.TenantConfig;
+import com.ym.mec.biz.dal.entity.TenantConfigDetail;
 import com.ym.mec.biz.service.TenantConfigService;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.WrapperUtil;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Consumer;
 
 /**
  * @author hgw
@@ -50,12 +53,32 @@ public class TenantConfigServiceImpl extends ServiceImpl<TenantConfigDao, Tenant
     }
 
     @Override
-	public TenantConfig queryByTenantId(Integer tenantId) {
-		return getOne(new WrapperUtil<TenantConfig>().hasEq("tenant_id_", tenantId)
-				.queryWrapper());
-	}
+    public TenantConfig queryByTenantId(Integer tenantId) {
+        return getOne(new WrapperUtil<TenantConfig>().hasEq("tenant_id_", tenantId)
+                .queryWrapper());
+    }
+
+    @Override
+    public Map<String, BigDecimal> getRule(Integer tenantId) {
+        //查询云教室扣费标准
+        TenantConfig tenantConfig = this.getOne(new WrapperUtil<TenantConfig>()
+                .hasEq("tenant_id_", tenantId).queryWrapper());
+        if (Objects.isNull(tenantConfig)) {
+            return null;
+        }
+        return getCloudRoomRule(tenantConfig.getConfig());
+    }
+
+    @Override
+    public Map<String, BigDecimal> getCloudRoomRule(String config) {
+        return Optional.ofNullable(config)
+                .map(c -> JSON.parseObject(c, TenantConfigDetail.class))
+                .map(TenantConfigDetail::getCloud_room_rule)
+                .map(TenantConfigDetail.CloudRoomRule::getCloud_room_config)
+                .orElse(null);
+    }
 
-	private void setUserId(Integer id, Consumer<Integer> setOption) {
+    private void setUserId(Integer id, Consumer<Integer> setOption) {
         if (Objects.isNull(id)) {
             Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
                     .map(SysUser::getId)

+ 3 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantContractTemplateServiceImpl.java

@@ -19,7 +19,6 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
-import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.collection.MapUtil;
 
 @Service
@@ -86,13 +85,13 @@ public class TenantContractTemplateServiceImpl extends BaseServiceImpl<Integer,
 	}
 
 	@Override
-	public String queryLatestContractTemplate(String owner, String type) {
-		TenantContractTemplate tenantContractTemplate = tenantContractTemplateDao.queryLatestContractTemplate(owner, type, TenantContextHolder.getTenantId());
+	public TenantContractTemplate queryLatestContractTemplate(Integer tenantId, String owner, String type) {
+		TenantContractTemplate tenantContractTemplate = tenantContractTemplateDao.queryLatestContractTemplate(owner, type, tenantId);
 		
 		if(tenantContractTemplate == null){
 			throw new BizException("未查询到协议模板");
 		}
-		return tenantContractTemplate.getContractTemplateContent();
+		return tenantContractTemplate;
 	}
 	
 }

+ 174 - 77
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantInfoServiceImpl.java

@@ -1,40 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
-import static com.ym.mec.biz.dal.enums.MessageTypeEnum.EMAIL_TENANT_EXPIRATION_REMINDERS;
-import static com.ym.mec.biz.dal.enums.MessageTypeEnum.EMAIL_TENANT_RENEWAL_SUCCESSFUL;
-import static com.ym.mec.biz.dal.enums.MessageTypeEnum.SMS_TENANT_EXPIRATION_REMINDERS;
-import static com.ym.mec.biz.dal.enums.MessageTypeEnum.SMS_TENANT_RENEWAL_SUCCESSFUL;
-
-import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
-import org.redisson.api.RBucket;
-import org.redisson.api.RedissonClient;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.dao.DuplicateKeyException;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -48,39 +14,11 @@ import com.ym.mec.biz.dal.dao.TenantInfoDao;
 import com.ym.mec.biz.dal.dto.TenantConfigDto;
 import com.ym.mec.biz.dal.dto.TenantInfoDto;
 import com.ym.mec.biz.dal.dto.TenantProductInfoDto;
-import com.ym.mec.biz.dal.entity.Employee;
-import com.ym.mec.biz.dal.entity.Organization;
-import com.ym.mec.biz.dal.entity.PlatformServe;
-import com.ym.mec.biz.dal.entity.PlatformServeDetail;
-import com.ym.mec.biz.dal.entity.SysConfig;
-import com.ym.mec.biz.dal.entity.SysUserTsign;
-import com.ym.mec.biz.dal.entity.TenantAssetsInfo;
-import com.ym.mec.biz.dal.entity.TenantConfig;
-import com.ym.mec.biz.dal.entity.TenantInfo;
-import com.ym.mec.biz.dal.entity.TenantOrderRecord;
-import com.ym.mec.biz.dal.entity.TenantProductInfo;
-import com.ym.mec.biz.dal.entity.TenantProductSumm;
-import com.ym.mec.biz.dal.enums.GradeTypeEnum;
-import com.ym.mec.biz.dal.enums.JobNatureEnum;
-import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
-import com.ym.mec.biz.dal.enums.TenantOrderRecordEnum;
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.dal.vo.PlatformServePageVo;
 import com.ym.mec.biz.dal.vo.TenantInfoInfoPageVo;
-import com.ym.mec.biz.service.ContractService;
-import com.ym.mec.biz.service.EmployeeService;
-import com.ym.mec.biz.service.PayService;
-import com.ym.mec.biz.service.PlatformProductService;
-import com.ym.mec.biz.service.PlatformServeDetailService;
-import com.ym.mec.biz.service.PlatformServeService;
-import com.ym.mec.biz.service.StudentService;
-import com.ym.mec.biz.service.SysConfigService;
-import com.ym.mec.biz.service.SysMessageService;
-import com.ym.mec.biz.service.SysUserTsignService;
-import com.ym.mec.biz.service.TenantAssetsInfoService;
-import com.ym.mec.biz.service.TenantConfigService;
-import com.ym.mec.biz.service.TenantInfoService;
-import com.ym.mec.biz.service.TenantOrderRecordService;
-import com.ym.mec.biz.service.TenantProductInfoService;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.PageUtil;
@@ -90,6 +28,40 @@ import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.thirdparty.yqpay.DateUtils;
 import com.ym.mec.util.date.DateUtil;
+import com.ym.mec.util.freemarker.FreemarkerTemplateEngine;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.joda.time.LocalDate;
+import org.joda.time.LocalDateTime;
+import org.redisson.api.RBucket;
+import org.redisson.api.RedissonClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.dao.DuplicateKeyException;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.File;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.nio.charset.Charset;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.BiConsumer;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+import static com.ym.mec.biz.dal.enums.MessageTypeEnum.*;
 
 @Service
 public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo> implements TenantInfoService {
@@ -168,13 +140,14 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
         setIdByApply(tenantId, dto.getProductInfo(), dto.getProductInfo()::setTenantId,
                 tenantProductInfoService::addTenantProduct);
         //新建机构是0元时,直接默认支付成功
-        if (dto.getProductInfo().getPayAmount().compareTo(BigDecimal.ZERO) == 0) {
-            //修机构相关的改付款时间
-            tenantOpen(tenantId);
-            String orderNo = idGenerator.generatorId("payment") + "";
-            //写入付款记录
-            createOrderRecord(tenantId, BigDecimal.ZERO, orderNo, TenantOrderRecordEnum.TENANT_OPEN, 1, null);
-        }
+        //2022年2月10日 根据需求进行变更,0元要走缴费流程,因为缴费之前要弹协议给客户看
+//        if (dto.getProductInfo().getPayAmount().compareTo(BigDecimal.ZERO) == 0) {
+//            //修机构相关的改付款时间
+//            tenantOpen(tenantId);
+//            String orderNo = idGenerator.generatorId("payment") + "";
+//            //写入付款记录
+//            createOrderRecord(tenantId, BigDecimal.ZERO, orderNo, TenantOrderRecordEnum.TENANT_OPEN, 1, null);
+//        }
         //添加机构配置
         setIdByApply(tenantId, dto.getConfig(), dto.getConfig()::setTenantId, tenantConfigService::addConfig);
         //释放
@@ -495,6 +468,129 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
         return baseMapper.selectById(tenantId);
     }
 
+    @Value("${contract.baseDir:/var/pdf}")
+    private String contractBaseDir;
+    @Autowired
+    private SysAreaService sysAreaService;
+    //乐小雅协议名称
+    public static final String lexiaoyaContract = "lexiaoyaContract";
+    //云教室每分钟价格
+    public static final String cloudAmount = "${cloudAmount}";
+    //云教室人数
+    public static final String cloudCount = "${cloudCount}";
+    //协议中云教室价格动态的样式 默认一个人的价格
+    public static final String defSpan = "<td style='text-align: center;'>" + cloudAmount + "/分钟/1V" + cloudCount + "</td>";
+    //超过1人的则需要这样的样式
+    public static final String rowspan = "<tr>" + defSpan + "</tr>";
+
+    /**
+     * 预览协议
+     *
+     * @param tenantId 机构id
+     */
+    public String getContract(Integer tenantId) {
+        List<TenantInfoInfoPageVo> tenantInfoList = baseMapper.queryPage(new HashMap<String, Object>() {{
+            put("tenantId", tenantId);
+        }});
+        //查询协议中的信息
+        TenantInfoInfoPageVo tenantInfo = Optional.ofNullable(tenantInfoList)
+                .filter(CollectionUtils::isNotEmpty)
+                .map(a -> a.get(0))
+                .orElseThrow(() -> new BizException("未查询到机构信息"));
+        Date now = new Date();
+        //将数据转换为Map
+        Map<String, Object> param = toMap(tenantInfo);
+        param.put("nowDate", DateUtils.formatDate(now, "yyyy年MM月dd日"));
+        param.put("expireDate", DateUtils.formatDate(getExpiryDate(tenantInfo.getExpiryCount(), tenantInfo.getExpiryUnit(), now), "yyyy年MM月dd日"));
+        param.put("expiryUnit", TenantProductInfo.MONTH.equals(tenantInfo.getExpiryUnit()) ? "月" : "年");
+        param.put("officialSealB", "https://daya.ks3-cn-beijing.ksyun.com/202202/Sx6rzWm.png");
+        //写入产品名称
+        opsContactData(tenantInfo.getServeId(), platformServeService::queryProductNameById,
+                "未查询到产品信息!",
+                param::put, "productName", PlatformServePageVo::getProductName);
+        //获取城市
+        SysArea city = opsContactData(tenantInfo.getAreaId(), sysAreaService::get,
+                "未查询到城市信息!",
+                param::put, "city", SysArea::getName);
+        //获取省份
+        opsContactData(city.getId(), sysAreaService::getParentArea,
+                "未查询到省份信息!",
+                param::put, "province", SysArea::getName);
+        //查询机构配置信息
+        TenantConfig tenantConfig = opsContactData(tenantId, tenantConfigService::queryByTenantId,
+                "未查询到机构配置信息!",
+                param::put, "chargeRate", TenantConfig::getChargeRate);
+        //获取云教室规则  String人数 BigDecimal每分钟扣费标准
+        Map<String, BigDecimal> rule = opsContactData(tenantConfig.getConfig(), tenantConfigService::getCloudRoomRule,
+                "未查询到云教室的价格配置!",
+                param::put, "rowspan", Map::size);
+
+        AtomicReference<String> rowspanData = new AtomicReference<>("");
+        //生成默认云教室数据
+        rule.forEach((k, v) -> {
+            //人数
+            int count = Integer.parseInt(k) - 1;
+            if (count == 1) {
+                param.put("defRowspanData", replaceTemplate(defSpan, count, v));
+            } else {
+                rowspanData.set(rowspanData.get() + replaceTemplate(rowspan, count, v));
+            }
+        });
+        param.put("rowspanData", rowspanData.get());
+
+        //生成模版
+        FreemarkerTemplateEngine templateEngine = FreemarkerTemplateEngine.getInstance();
+        templateEngine.setClassForTemplateLoading(TenantInfoServiceImpl.class, "/config/contracts/");
+        //文件地址验证
+        String srcPath = contractBaseDir + "/" + lexiaoyaContract + "/" + tenantId + "-" + tenantInfo.getServeName() + DateUtils.formatDate(now, "yyyyMMddHHmmss") + ".html";
+//        String srcPath = "C:\\Users\\hgw\\Desktop\\" + tenantId +"-"+tenantInfo.getServeName()+DateUtils.formatDate(now, "yyyyMMddHHmmss")+ ".html";
+        File srcFile = new File(srcPath);
+        if (!srcFile.getParentFile().exists()) {
+            srcFile.getParentFile().mkdirs();
+        }
+        //读取模版并替换模版内容
+        templateEngine.render(param, lexiaoyaContract + ".ftl", srcPath);
+        String html;
+        try {
+            html = FileUtils.readFileToString(srcFile, Charset.defaultCharset());
+        } catch (IOException e) {
+            log.error("读取产品协议出错", e.getCause());
+            throw new BizException("读取产品协议出错");
+        } finally {
+            //删除文件
+            FileUtils.deleteQuietly(srcFile);
+        }
+
+        return html;
+    }
+
+    private Map toMap(TenantInfoInfoPageVo tenantInfo) {
+        return Optional.ofNullable(tenantInfo)
+                .map(JSONObject::toJSON)
+                .map(o -> JSONObject.toJavaObject((JSONObject) o, Map.class))
+                .orElse(null);
+    }
+
+    private static <O, T, S> T opsContactData(O param, Function<O, T> fun, String msg,
+                                              BiConsumer<String, Object> putC, String key, Function<T, S> val) {
+        Optional<T> optional = Optional.ofNullable(fun.apply(param));
+        optional.orElseThrow(() -> new BizException(msg));
+        optional.ifPresent(a -> {
+            S apply = val.apply(a);
+            if (apply instanceof BigDecimal) {
+                putC.accept(key, ((BigDecimal) apply).setScale(2, RoundingMode.HALF_UP).toString());
+            } else {
+                putC.accept(key, apply);
+            }
+        });
+        return optional.get();
+    }
+
+    private String replaceTemplate(String tem, Integer count, BigDecimal v) {
+        return tem.replace(cloudCount, count + "")
+                .replace(cloudAmount, v.toString());
+    }
+
     /**
      * 机构开通缴费
      */
@@ -918,11 +1014,12 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
         Map<String, Object> par = new HashMap<>();
         par.put("state", 1);
         par.put("expiryDate", expiryDate);
-        List<TenantInfoInfoPageVo> oneTenant = baseMapper.queryPage(par);
-        send(oneTenant, DateUtils.formatDate(expiryDate, "yyyy年MM月dd日"), i);
+        List<TenantInfoInfoPageVo> tenantList = baseMapper.queryPage(par);
+        expiringSend(tenantList, DateUtils.formatDate(expiryDate, "yyyy年MM月dd日"), i);
     }
 
-    private void send(List<TenantInfoInfoPageVo> infoList, String dateStr, int i) {
+    //向即将到期的机构发送信息
+    private void expiringSend(List<TenantInfoInfoPageVo> infoList, String dateStr, int i) {
         infoList.forEach(t -> {
             //邮件
             if (StringUtils.isNotBlank(t.getEmail())) {

+ 97 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantPreJoinServiceImpl.java

@@ -0,0 +1,97 @@
+package com.ym.mec.biz.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ym.mec.biz.dal.dao.TenantPreJoinDao;
+import com.ym.mec.biz.dal.dto.TenantPreJoinDto;
+import com.ym.mec.biz.dal.entity.SysArea;
+import com.ym.mec.biz.dal.entity.TenantPreJoin;
+import com.ym.mec.biz.service.TenantPreJoinService;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.PageUtil;
+import com.ym.mec.common.page.WrapperUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Consumer;
+import java.util.function.Function;
+import java.util.function.Supplier;
+
+/**
+ * 机构入驻表(预加入)(TenantPreJoin)表服务实现类
+ *
+ * @author hgw
+ * @since 2022-02-09 14:38:28
+ */
+@Service("tenantPreJoinService")
+public class TenantPreJoinServiceImpl extends ServiceImpl<TenantPreJoinDao, TenantPreJoin> implements TenantPreJoinService {
+
+    private final static Logger log = LoggerFactory.getLogger(TenantPreJoinServiceImpl.class);
+
+    @Autowired
+    private SysAreaServiceImpl sysAreaService;
+
+    /**
+     * 分页查询
+     *
+     * @param param 条件
+     */
+    @Override
+    public PageInfo<TenantPreJoin> queryPage(Map<String, Object> param) {
+        Page<TenantPreJoin> pageInfo = PageUtil.getPageInfo(param);
+        //模糊搜索的字段
+        Object search = param.get("search");
+        //分页查询
+        IPage<TenantPreJoin> page = this.page(pageInfo,
+                new WrapperUtil<TenantPreJoin>()
+                        .hasEq("state_", param.get("state"))
+                        .hasGe("create_time_", param.get("startTime"))
+                        .hasLe("create_time_", param.get("endTime"))
+                        .queryWrapper()
+                        .and(Objects.nonNull(search),
+                                o -> o.eq("tsign_name_", search)
+                                        .or().eq("enterprise_liable_name_", search)
+                                        .or().eq("contacts_", search)
+                        ));
+        return PageUtil.pageInfo(page);
+    }
+
+    @Override
+    public int insert(TenantPreJoinDto dto) {
+        TenantPreJoin obj = new TenantPreJoin();
+        BeanUtils.copyProperties(dto, obj);
+        //根据code获取市级数据
+        opsAreaData(dto.getAreaCode(), sysAreaService::queryByCode,
+                () -> new BizException("未查询到区域编号为 [" + dto.getAreaCode() + "]的数据!"),
+                obj::setAreaId, obj::setAreaName);
+
+        //根据市级数据获取省级数据
+        opsAreaData(obj.getAreaId(), sysAreaService::getParentArea,
+                () -> new BizException("未查询到区域id为 [" + obj.getAreaId() + "]的数据!"),
+                obj::setProvinceId, obj::setProvinceName);
+
+        obj.setCreatedTime(new Date());
+        return baseMapper.insert(obj);
+    }
+
+    private <O> void opsAreaData(O param, Function<O, SysArea> fun, Supplier<BizException> supplier,
+                                 Consumer<Integer> setId, Consumer<String> setName) {
+        Optional<SysArea> optional = Optional.ofNullable(fun.apply(param));
+        optional.orElseThrow(supplier);
+        optional.ifPresent(a -> {
+            setId.accept(a.getId());
+            setName.accept(a.getName());
+        });
+    }
+
+}
+

+ 140 - 0
mec-biz/src/main/resources/config/contracts/latest_contract_template.ftl

@@ -0,0 +1,140 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
+    <meta http-equiv="Pragma" content="no-cache" />
+    <meta http-equiv="Cache-Control" content="no-cache" />
+    <meta http-equiv="Expires" content="0" />
+    <title>产品与服务协议</title>
+    <style>
+        body { margin: 0; }
+        header {
+            height: 40px;
+            line-height: .40px;
+            color: #000;
+            font-size: 17px;
+            background: #fff;
+            box-shadow: 0px 1px 8px 0px rgba(0, 0, 0, 0.07);
+            text-align: center;
+        }
+        header .back {
+            width: 20px;
+            height: 20px;
+            position: absolute;
+            left: 12px;
+            top: 10px;
+        }
+        .container {
+            padding: 22px 20px 3px;
+            font-size: 14px;
+        }
+        h1 {
+            font-size: 18px;
+            text-align: center;
+            margin-bottom: 8px;
+        }
+        h2 {
+            font-size: 16px;
+            font-weight: bold;
+            padding-top: 15px;
+        }
+        h3 {
+            font-size: 14px;
+            font-weight: bold;
+        }
+        .signature {
+            padding-top: 50px;
+        }
+        .signature .sign {
+            position: relative;
+            width: 49%;
+            display: inline-block;
+        }
+        .signature span {
+            display: block;
+        }
+        .signature .cachet {
+            position: absolute;
+            top: -60px;
+            left: 0;
+            width: 150px;
+            height: 150px;
+        }
+        .iInfo {
+            display: flex;
+        }
+        .iInfo span {
+            flex: 1;
+        }
+        .iInfoContent, .iInfoContent span {
+            display: block;
+        }
+
+        .underline {
+            text-decoration: underline;
+        }
+        .bold {
+            font-weight: bold;
+        }
+    </style>
+</head>
+<body style="font-family:'SimSun'">
+    <div class="container">
+        <h1>《产品与服务协议》</h1>
+                            甲方:${companyName} <br/>
+
+        <div style="display: flex;">乙方:
+            <div style="flex: 1 auto;">
+                <div class="iInfo">
+                    <span>家长姓名:${studentInfo.realName!}</span>
+                    <span>电话:${studentInfo.phone!}</span>
+                </div>
+                <#if studentInfo.certificateType == 'IDENTITY'>
+                    <div class="iInfo">
+                        <span>身份证号:${studentInfo.idCardNo!}</span>
+                    </div>
+                </#if>
+                <div class="iInfo">
+                    <span>学生姓名:${studentInfo.username!}</span>
+                </div>
+                <#if studentInfo.grade?default("")?trim?length gt 1>
+                <div class="iInfo">
+                    <span>所在班级:${studentInfo.grade!} ${studentInfo.clazz!}</span>
+                </div>
+                </#if>
+                <#if studentInfo.subject.name?default("")?trim?length gt 1>
+                <div class="iInfo">
+                    <span>所在声部:${studentInfo.subject.name!}</span>
+                </div>
+                </#if>
+            </div>
+        </div>
+        <div>(本协议中“乙方“指学员及家长;”乙方学员“指购买甲方产品或服务的学员;”乙方家长“仅指乙方学员的法定监护人。)</div>
+
+        <p class="underline bold">重要须知:在注册或购买使用甲方提供的产品、服务之前,请您务必审慎阅读、充分理解本使用协议各条款内容, 特别是免除或者限制甲方责任的条款、对您权利进行限制的条款、约定争议解决方式和司法管辖的条款等。 限制、免责条款或者其他涉及您重大权益的条款可能以加粗、加下划线等形式提示您重点注意。您注册或购买使用甲方提供的产品和服务,均视为您同意本使用协议,以及同意接受本使用协议的约束。</p>
+        <p class="underline bold">如无特别说明 ,下列术语在本协议中的定义为:管乐迷平台(下称“本平台”),即管乐迷APP;(下称“本平台”)指由甲方提供的器乐教学全流程辅助系统,包括媒体资料,教师点评,课前、课中、课后管理等服务;乐器练习云教练 (下称“本系统”),指由甲方提供和维护的器乐辅助练习系统;具体以该系统实际提供为准。该系统将根据实际需要进行调整和增减,乙方使用平台时需遵守本服务协议。</p>
+
+		${contractMainContent!}
+        
+        <div class="signature">
+        	<#if isShowVisualSeal>
+            <div class="sign">甲方签章:${companyName}<img class="cachet" src="${sealPicture!}" alt="" />
+                <span>日期:${.now?string("yyyy年MM月dd日")}</span>
+            </div>
+            <div class="sign">乙方签章:${studentInfo.realName!}
+                <span>日期:${.now?string("yyyy年MM月dd日")} </span>
+            </div>
+        	<#else>
+            <div class="sign">甲方签章:${companyName}
+                <span>日期:${.now?string("yyyy年MM月dd日")}</span>
+            </div>
+            <div class="sign">乙方签章:
+                <span>日期:${.now?string("yyyy年MM月dd日")} </span>
+            </div>
+        	</#if>
+        </div>
+    </div>
+</body>
+</html>

+ 416 - 0
mec-biz/src/main/resources/config/contracts/lexiaoyaContract.ftl

@@ -0,0 +1,416 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8"/>
+    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"/>
+    <meta http-equiv="Pragma" content="no-cache"/>
+    <meta http-equiv="Cache-Control" content="no-cache"/>
+    <meta http-equiv="Expires" content="0"/>
+    <title>管乐迷产品服务协议</title>
+    <style>
+        body {
+            margin: 0;
+        }
+
+        header {
+            height: 40px;
+            line-height: .40px;
+            color: #000;
+            font-size: 17px;
+            background: #fff;
+            box-shadow: 0px 1px 8px 0px rgba(0, 0, 0, 0.07);
+            text-align: center;
+        }
+
+        header .back {
+            width: 20px;
+            height: 20px;
+            position: absolute;
+            left: 12px;
+            top: 10px;
+        }
+
+        .container {
+            padding: 22px 20px 3px;
+            font-size: 14px;
+        }
+
+        h1 {
+            font-size: 16px;
+            text-align: center;
+        }
+
+        h2 {
+            font-size: 16px;
+            font-weight: bold;
+            padding-top: 15px;
+        }
+
+        h3 {
+            font-size: 14px;
+            font-weight: bold;
+        }
+
+        .sign {
+            position: relative;
+            /* width: 49%; */
+            /* display: inline-block; */
+        }
+
+        .cachet {
+            position: absolute;
+            top: -60px;
+            left: 50%;
+            width: 140px;
+            height: 140px;
+            margin-left: -70px;
+        }
+
+        .iInfo {
+            display: flex;
+        }
+
+        .iInfo span {
+            flex: 1;
+        }
+
+        .iInfoContent, .iInfoContent span {
+            display: block;
+        }
+
+        .thStyle {
+            background: #cdcdcd;
+        }
+    </style>
+</head>
+<body>
+<div class="container">
+    <h1>管乐迷产品服务协议</h1>
+    <table border="1" style="width: 100%; border-collapse: collapse;">
+        <tr>
+            <th class="thStyle" style="text-align: left;" colspan="2">甲方信息:</th>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">名称:</td>
+            <td style="text-align: center;">${tsignName}</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">通讯地址:</td>
+            <td style="text-align: center;">${address}</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">电子邮箱:</td>
+            <td style="text-align: center;">${email}</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">联系人:</td>
+            <td style="text-align: center;">${contacts}</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">联系电话:</td>
+            <td style="text-align: center;">${phone}</td>
+        </tr>
+        <!--  -->
+        <tr>
+            <th class="thStyle" style="text-align: left;" colspan="2">乙方信息:</th>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">名称:</td>
+            <td style="text-align: center;">武汉乐小雅网络科技有限公司</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">通讯地址:</td>
+            <td style="text-align: center;">武昌区水果湖街中北路与东沙大道交汇处武汉中央文化区K1地块一期一区K1-2栋16层7室-18</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">电子邮箱:</td>
+            <td style="text-align: center;">lexiaoyaVIP@163.com</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">联系人:</td>
+            <td style="text-align: center;">潘彤彤</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">联系电话:</td>
+            <td style="text-align: center;">13296657052</td>
+        </tr>
+
+        <br/>
+    </table>
+    武汉乐小雅网络科技有限公司(以下称为“乙方”)系专业的乐团运营管理综合服务提供方。甲、乙双方本着互惠互利、共同发展的原则,在平等、公平、自愿、诚信的基础上,经友好协商,就甲方向已方提供乐团运营管理综合服务相关事宜达成一致,同意按照下述协议条款及相关附件执行:
+
+
+    <h2>第一条 产品与服务项</h2>
+    在授权区域 ${province} ${city} (区/县)范围内,乙方向甲方提供基于提高乐团管理效率、提升乐团训练水平、增强乐团运营能力为目的的管乐迷系列产品,具体包括:<br/>
+    (1)“团控宝”,即乐团管理工具。提供即时通讯基础能力和云端服务;同时针对甲方使用场景,通过Saas平台提供乐团运营管理系统解决方案;<br/>
+    (2)“团易宝”,即乐团收费工具。提供可配置的收费模式,覆盖报名、续费、加课、零星收费、特殊课程收费等全场景,实时监控收款进度,同时可根据需要出具营收报表;<br/>
+    (3)“团运宝”,即乐团经营工具。提供基于乐团服务与运营管理规则的实时监控后台,同时可根据需要出具多维度经营报表;<br/>
+    (4)“团练宝”,即乐团训练工具。根据乐团训练所需的声部、合奏、独奏、考级等曲目,借助先进的互联网技术,帮助机构定制专属品牌的AI智能乐团练习系统。建立直观、可视的乐团训练标准,同时能够实现课后练习布置、回传、点评一键操作,深度解决学生在家不会练习、家长无法辅导的痛点,从而全面提升乐团训练质量。<br/>
+    (5)“云教室”,即线上教学工具。提供包括互动白板、教学伴奏、音乐模式、学员展示、课堂节拍器等丰富功能的高保真、低延时的网络直播教室。<br/>
+
+    <h2>第二条 协议有效期</h2>
+    2.1本协议的服务期限为 ${expiryCount} ${expiryUnit},即自 ${nowDate} 起至 ${expireDate}止。<br/>
+    2.2协议期满前30天内,如果双方未就续签事项达成一致,则本协议到期后自动终止。<br/>
+
+    <h2>第三条 产品服务收费方式</h2>
+    3.1本协议所称产品与服务以甲方选购为准,由甲方自行确定需要采购的功能或服务并记载于本协议附件1《产品服务清单》中。<br/>
+    3.2乙方按照本协议附件 1《产品服务清单》所列项目向甲方提供产品和服务,甲方应在附件1规定的有效期内使用,因甲方原因超过有效期尚未使用的部分不能退款。<br/>
+
+    <h2>第四条 双方的权利和义务</h2>
+    4.1甲方的权利和义务<br/>
+    4.1.1在协议有效期内,甲方拥有授权区域乙方团练宝产品的经营权。甲方独立经营,自负盈亏;<br/>
+    4.1.2在协议有效期内,甲方有权优先获得同城其它区域的经营权;<br/>
+    4.1.3甲方拥有协议期满后续约的优先权;<br/>
+    4.1.4在使用乙方提供的服务之前,甲方须与乙方完成相关账户的注册,取得乙方提供给甲方的后台账户,甲方同意并保证:<br/>
+    (1)甲方所填写的信息是真实、准确、完整、及时的,且保证乙方可以通过甲方所填写的联系方式与甲方取得联系。<br/>
+    (2)甲方应根据乙方对于服务的要求及时提供相应的身份证明等资料,否则乙方有权拒绝向甲方提供相关服务。<br/>
+    (3)如果甲方提供的资料或信息包含有不正确、不真实的信息,乙方有权在书面通知相关情况后,取消甲方注册账户并随时结束服务。<br/>
+    (4)甲方应对所注册的账户负责,该账户只有甲方可以使用,不可转让、不可赠与、不可继承。<br/>
+    (5)乙方将通过甲方的用户名和密码识别甲方的指示,甲方应对使用其账户及密码进行的一切行为负完全的责任。<br/>
+    (6)甲方应自行妥善保管用户名和密码,对于因甲方原因导致其用户名和密码泄露而产生的损失,由甲方自行承担。<br/>
+    (7)如甲方发现有他人冒用或盗用其账户及密码或任何其他未经合法授权使用其用户名和密码之情形时,应立即以有效方式通知乙方,要求乙方暂停相关服务。同时,甲方理解乙方对甲方的请求采取行动需要合理期限,此合理期限为24小时,在此之前,乙方对已执行的指令及所导致的甲方的损失不承担任何责任。<br/>
+    4.1.5甲方需自行对其发送信息的行为承担一切责任,乙方及其合作方均没有对甲方及甲方客户所发送的内容进行过滤或审核的义务,亦没有任何审查、监督的责任或其他连带责任。<br/>
+    4.1.6甲方仅有权在本协议所约定的区域使用乙方所提供的产品与服务,除非获得乙方书面授权并另行签署补充协议,否则不得用于其他目的或以任何方式擅自提供给第三方使用。<br/>
+    4.1.7甲方保证其为合法成立并有效存续的主体,有资质和能力签署和履行本协议,其签署及履行本协议不侵犯任何第三方的合法权益。否则乙方将终止提供服务,因此产生的一切法律责任,均由甲方自行承担。同时,甲方应对乙方因此而遭受的损失承担赔偿责任。<br/>
+    4.1.8对由于甲方提供的联络方式有误以及甲方用于接收乙方邮件的电子邮箱安全性、稳定性不佳而导致的一切后果,甲方应自行承担责任。<br/>
+    4.1.9甲方保证使用乙方服务时将遵从国家法律、法规、行业惯例和社会公共道德,不得利用乙方提供的服务进行存储、发布、传播如下信息和内容:<br/>
+    (1)违反国家法律、法规及政策的任何内容(信息);<br/>
+    (2)违反国家规定的政治宣传或新闻信息,损坏国家荣誉和利益的;<br/>
+    (3)涉及国家秘密或安全的信息,泄露国家秘密,颠覆国家政权,破坏国家统一的;封建迷信或淫秽、色情等违反公序良俗的信息或教唆犯罪的信息;<br/>
+    (4)博彩有奖、赌博游戏;<br/>
+    (5)违反国家民族和宗教政策的信息;<br/>
+    (6)妨碍互联网运行安全的信息;<br/>
+    (7)侮辱或者诽谤他人,侵害他人合法权益的信息或其他有损于社会秩序、社会治安、公共道德的信息或内容。<br/>
+    4.1.10甲方同时应确保甲方用户在自愿的情形下接受实时音视频服务,且所有用户在接入实时音视频服务时应在法律法规规定范围内发布信息,确保该等信息不违反网络信息服务行业的各项法律法规。不利用实时音视频服务查阅、保存、制作、复制、发布、传播含有下列内容的信息:<br/>
+    (1)违反宪法所确定的基本原则的;<br/>
+    (2)危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的;<br/>
+    (3)损坏国家荣誉和利益的;<br/>
+    (4)煽动民族仇恨、民族歧视,破坏民族团结的;<br/>
+    (5)破坏国家民族宗教政策,宣扬邪教和封建迷信的;<br/>
+    (6)散布谣言,扰乱社会秩序,破坏社会稳定的;<br/>
+    (7)散布淫秽、色情、赌博、暴力、凶杀、恐怖或者教唆犯罪的;<br/>
+    (8)侮辱或者诽谤他人,侵害他人合法权益的;<br/>
+    (9)含有法律、法规禁止的其他内容的。<br/>
+    乙方如发现用户所发布、传送或储存的信息明显属本协议所列的禁止发布的信息的,乙方有权立即停止该用户的数据传输,对涉嫌违禁的信息直接予以删除或屏蔽,并根据事态的严重程度决定是否停止向甲方提供实时音视频通话服务。乙方将向国家有关机关报告该等情况,甲方应通过向其用户索偿等方式确保乙方及乙方合作方免于因此承担损失或责任。<br/>
+
+    4.2乙方的权利和义务<br/>
+    4.2.1乙方应根据甲方选择的服务内容向甲方提供服务,并做好相关培训。<br/>
+    4.2.2乙方网站有权使用本协议规定用途所需的甲方的资料和信息(该等资料和信息仅指甲方自有的资料和信息,不包括甲方及甲方用户的各类隐私信息)。未经甲方事先书面允许,乙方不得擅自将甲方各类隐私信息透露给任何第三方。<br/>
+    4.2.3乙方有权对甲方提交的应用信息进行审查,如甲方提供的应用信息违反法律法规规定的,乙方有权拒绝提供服务。<br/>
+    4.2.4若甲方违反国家法律法规规定的,乙方将终止为甲方提供服务。乙方对因甲方违反国家法律法规规定所导致的的损害不承担任何责任。<br/>
+    4.2.5对于甲方利用即时通讯通道所发布的信息,乙方保留依据国家相关法律法规对其通讯的信息进行关键词过滤的权利,如发现甲方发送内容违反国家相关法律法规的,乙方有权作出包括但不限于劝阻、拦截、向有关部门举报等行为。<br/>
+    4.2.6乙方有义务运用各种安全技术和程序建立完善的管理制度来保护甲方的账户信息。<br/>
+    4.2.7如甲方的应用存在滥用系统资源的情形,引发大量不合理的系统资源消耗行为;或者使用乙方系统发布、传播违反法律法规、社会道德的内容;脱离正常业务模型大量发送消息或者持续连接服务器等,乙方应及时书面通知甲方,在甲方同意的前提下,乙方可以强制关闭服务及冻结账户。<br/>
+    4.2.8因国家政策调整或因电信运营商业务调整所造成的费用或通道服务代码变化的,乙方及乙方合作方将根据调整后的新政策为用户提供相应服务。因电信运营商的基础设备或基础电信系统发生故障、公共区域网络或电力主干线路被他人破坏、有关部门对网络或电力资源进行维护改造,或者乙方系统遭受网络安全事故冲击(如计算机病毒、木马软件、恶意代码或其他恶意攻击,但因乙方未采取行业普遍采用的安全防护标准所导致的网络安全事故除外)等原因造成甲方用户使用实时音视频通话服务期间的相关数据发送延时、数据丢失、服务中断或者遭受其他损失的,乙方及乙方合作方不承担任何赔偿责任。<br/>
+    4.2.9乙方因系统或服务升级,需要甲方强制升级应用,应提前通知甲方联络人或负责人,并告知甲方系统或服务的暂停时间,以便甲方采取合理的应对措施,且升级后不得影响甲方现有服务使用。<br/>
+    4.2.10乙方承诺乙方提供的服务符合法律法规规定及本协议约定,不含有任何恶意程序,不影响甲方产品的正常使用。 <br/>
+    4.2.11除本协议另有明确约定外,乙方不承担甲方在使用乙方合作方产品服务当中的任何风险及相关违约责任,但在合作方系统服务升级时、官方对外价格调整时有提前7日书面通知的义务。在非不可抗力因素导致的服务异常时,有义务与乙方合作方沟通解决,且在必要时协助甲方向乙方合作方追责。<br/>
+    4.2.12如甲方账号有未消耗的现金余额,乙方有权无需另行通知,直接将预付费用和现金余额用于抵扣拖欠款项。如涉及违约金,乙方有权从甲方的预付费用和现金余额中扣除。<br/>
+
+    <h2>第五条 知识产权</h2>
+    5.1乙方产品所拥有的服务著作权、商标权、专利权等所有知识产权及相关利益,甲方将采取所有合理的方法保护乙方的上述权利。如甲方发现有第三人侵犯乙方产品的知识产权或其他合法权益,应及时通知乙方,并采取措施,协助乙方追究侵权者的法律责任。<br/>
+    5.2除非乙方书面明确授权,甲方不得更改、演绎、拆分、反解乙方的技术和程序或以其它任何方式进行可能损害乙方知识产权的行为。<br/>
+    5.3甲方拥有自有企业产品的商标,著作权以及其他所有知识产权及相关利益。双方合作过程中由甲方提供的教材或谱面,如涉及到版权纠纷均由甲方负责。<br/>
+    5.4除因本协议规定的用途所需外,未经对方事先同意,任何一方不得擅自使用、复制对方的商标、标志、商业信息、技术及其他资料。<br/>
+    5.5本协议终止后,本条款仍然有效。<br/>
+
+    <h2>第六条 保密条款</h2>
+    6.1未经对方书面许可或本协议另有约定,任何一方不得向与履行本协议无关的第三方泄露本协议条款的任何内容,以及通过签订和履行本协议而获知的对方的任何信息,或将上述信息用作其他商业用途。但为本协议履行之需任何一方可向其法律、会计、商业及其它顾问、授权雇员(以下统称为“接受方代表”)披露前述信息,接受方应保证其代表承担与其同等的保密义务,并对其代表违反保密义务的行为承担连带责任。<br/>
+    6.2尽管有上述规定,但本条款不适用以下信息:<br/>
+    (1)依据法律法规的规定应当提供,行政、司法等职权部门要求提供的信息;<br/>
+    (2)披露方同意接受方向第三方提供的信息;<br/>
+    (3)不违反本协议的情况下,接受方从第三方合法正当接受不受保密限制的信息;<br/>
+    (4)接受方未违反本协议的情况下即已公开或可以公开获得的信息;<br/>
+    (5)法律法规所要求披露的信息<br/>
+    6.3在本协议期满或终止后,按披露方的要求,接受方应当立即返还或者销毁披露方的保密文件。<br/>
+    6.4在本协议终止之后,本条款仍然有效,直到另一方同意其解除此项义务。<br/>
+
+    <h2>第七条 违约责任</h2>
+    7.1除本协议另有明确约定外,任何一方直接或间接违反本协议的任何条款,或不及时承担或不及时、充分地承担本协议项下其应承担的义务即构成为违约行为,守约方有权以书面方式通知违约方纠正其违约行为并采取合理的补救措施消除违约后果,并赔偿相应损失,同时,守约方还有权主张法律赋予的相关抗辩权,暂停履行守约方相应的合同义务直至违约方纠正违约行为并承担违约责任为止。违约方在收到守约方要求其纠正违约行为的书面通知之日后30日内未纠正其违约行为,守约方有权在做出书面通知情况下提前解除本协议。<br/>
+    7.2除本协议另有约定外,在违约事实发生以后,经守约方的合理及客观的判断,该等违约事实已造成守约方签署本协议的根本目的无法实现,则守约方有权在做出书面通知情况下提前解除本协议,违约方应赔偿守约方因违约方之违约行为而遭致的所有损失。<br/>
+    7.3一方违约的,另一方有权向对方主张因维权而支出的诉讼费用、律师费用、公证费用、差旅费用等实际支出的维权费用。<br/>
+
+    <h2>第八条 争议解决和法律适用</h2>
+    8.1本协议的订立、效力、解释、履行和争议的解决均应适用中华人民共和国法律。<br/>
+    8.2本协议在履行过程中,若发生争议,由双方协商解决;协商不成的,可向乙方所在地有管辖权的人民法院提起诉讼解决。<br/>
+
+    <h2>第九条 协议终止</h2>
+    9.1若甲方未及时向乙方支付服务费用,且在乙方书面催促后超过7日仍不予支付的,乙方有权终止本协议并停止向甲方提供服务。<br/>
+    9.2若一方存在下述情况,另一方有权经书面通知后终止本协议:<br/>
+    (1)一方违反本协议的约定,经另一方书面通知7日后一方仍继续进行违约行为或不履行其义务;<br/>
+    (2)一方停业、清算、解散、破产或关闭;<br/>
+    (3)一方签订、履行本协议的资质被依法吊销;<br/>
+    (4)其他本协议所约定的情形。<br/>
+    9.3除本协议另有明确约定及发生不可抗力情况外,在本协议所约定的服务期限内,未经另一方的书面同意,任何一方不得单方面终止本协议。<br/>
+
+    <h2>第十条 不可抗力</h2>
+    10.1不可抗力是指双方不能合理控制、不可预见或即使预见亦无法避免的事件,该事件妨碍、影响或延误任何一方根据协议履行其全部或部分义务。
+    鉴于互联网的特殊性质,本协议项下的不可抗力亦包括但不限于下列影响互联网正常运行的情形:<br/>
+    (1)黑客攻击;<br/>
+    (2)电信部门技术调整导致之重大影响;<br/>
+    (3)因政府管制而造成之暂时关闭;<br/>
+    (4)电信运营商造成的基础通讯网络瘫痪、延迟。;<br/>
+    (5)任何其他类似事件。<br/>
+    10.2声称遭受不可抗力的一方应在不可抗力发生后15日内书面通知另一方,并随附经有关部门确认的不可抗力之书面证明,且应尽可能减少不可抗力所产生之影响。<br/>
+    10.3由于以上所述不可抗力事件致使本协议的部分或全部不能履行或延迟履行,则双方于彼此间不承担任何违约责任,如该不可抗力事件持续30日以上的,则任何一方有权单方解除本协议。<br/>
+
+    <h2>第十一条 通知送达</h2>
+    11.1任何一方发给对方的通知,应以书面形式并应通过电子邮件、传真或专人递送、特快专递、挂号邮件的形式送到文首所示的通讯地址。如任何一方的地址有变更时,须在变更前10日以书面形式通知对方。<br/>
+    11.2双方将按如下约定确定通知被视为送达的日期:<br/>
+    A)以电子邮件或专人递送的,接收人签收之日视为送达;<br/>
+    B)以传真方式发出的,以发件方发送后打印出的发送确认单所示时间视为送达;<br/>
+    C)以特快专递形式发出的,发往本市内的,发出后第5日视为送达。发往国内其他地区的,发出后第10日视为送达。发往港、澳、台地区的,发出后第15日视为送达。发往境外其他国家或地区的,发出后第20日视为送达。<br/>
+
+    <h2>第十二条 其他</h2>
+    12.1本协议任何部分被视作无效或不可执行,将不会因此而影响本协议其他条款及附件的有效性与可执行性。<br/>
+    12.2本协议一式二份,自双方法定代表人或授权代表签字并加盖公章(含合同章)之日起生效,双方各执一份,具有同等法律效力。<br/>
+    12.3无论何种原因(包括但不限于违反适用的法律法定)导致本协议任何条款完全或部分无效或不具有执行力,不影响本协议任何其他条款的效力、合法和可执行性。此种情况下,双方将以有效的约定替换该约定,且该有效约定应尽可能接近原约定和本协议相应的精神和宗旨。<br/>
+    12.4本协议的附件是本协议不可分割的组成部份,与本协议正文互为补充并具有同等的法律效力,本协议附件与本协议正文冲突的,以本协议附件约定为准。本协议包括如下附件:<br/>
+    本协议附件一:【管乐迷产品服务清单】
+
+    <table border="1" style="width: 100%; border-collapse: collapse;">
+        <tr>
+            <td style="text-align: center;">甲方盖章:</td>
+            <td style="text-align: center;" class="sign">
+                乙方盖章 <img class="cachet" src="${officialSealB}" alt="">
+            </td>
+        </tr>
+        <tr>
+            <td style="text-align: center;">授权代表人:${contacts}</td>
+            <td style="text-align: center;">授权代表人:潘彤彤</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;">签订日期: ${nowDate}</td>
+            <td style="text-align: center;">签订日期: ${nowDate}</td>
+        </tr>
+    </table>
+
+    <h2>附件1: 管乐迷产品服务清单 </h2>
+    <table border="1" style="width: 100%; border-collapse: collapse;">
+        <tr>
+            <th class="thStyle" style="text-align: left;" colspan="2">甲方信息:</th>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">名称:</td>
+            <td style="text-align: center;">${tsignName}</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">地址:</td>
+            <td style="text-align: center;">${address}</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">联系人:</td>
+            <td style="text-align: center;">${contacts}</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">联系电话:</td>
+            <td style="text-align: center;">${phone}</td>
+        </tr>
+        <!--  -->
+        <tr>
+            <th class="thStyle" style="text-align: left;" colspan="2">乙方信息:</th>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">名称:</td>
+            <td style="text-align: center;">武汉乐小雅网络科技有限公司</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">地址:</td>
+            <td style="text-align: center;">武昌区水果湖街中北路与东沙大道交汇处武汉中央文化区K1地块一期一区K1-2栋16层7室-18</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">联系人:</td>
+            <td style="text-align: center;">潘彤彤</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;width: 90px;">联系电话:</td>
+            <td style="text-align: center;">13296657052</td>
+        </tr>
+    </table>
+    <table border="1" style="width: 100%; border-collapse: collapse;">
+        <tr>
+            <th class="thStyle" style="text-align: left;" colspan="4">产品和服务详细信息:</th>
+        </tr>
+        <tr>
+            <th>服务名称</th>
+            <th>数量</th>
+            <th>有效期</th>
+            <th>结算标准</th>
+        </tr>
+        <tr>
+            <td style="text-align: center;">${serveName}(含:${productName})</td>
+            <td style="text-align: center;">${expiryCount}</td>
+            <td style="text-align: center;">${expiryUnit}</td>
+            <td style="text-align: center;">${contractPrice}元(0~${studentUpLimit}人)</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;">团练宝</td>
+            <td style="text-align: center;">/</td>
+            <td style="text-align: center;">/</td>
+            <td style="text-align: center;">单独签订协议开放使用</td>
+        </tr>
+        <tr>
+            <!--    rowspan 里面的数字是动态的  如果要调试就修改${rowspan}为1 -->
+            <td style="text-align: center;" rowspan="${rowspan}">云教室</td>
+            <td style="text-align: center;" rowspan="${rowspan}">/</td>
+            <td style="text-align: center;" rowspan="${rowspan}">/</td>
+            ${defRowspanData}
+            <!--            <td style="text-align: center;">0.2元/分钟/1V1</td>-->
+        </tr>
+        <!--    rowspan 里面的数字大于1 则在这里加一个  -->
+        ${rowspanData}
+        <!--        <tr>-->
+        <!--            <td style="text-align: center;">0.2元/分钟/1V2</td>-->
+        <!--        </tr>-->
+        <!--        <tr>-->
+        <!--            <td style="text-align: center;">0.2元/分钟/1V3</td>-->
+        <!--        </tr>-->
+        <!--        <tr>-->
+        <!--            <td style="text-align: center;">0.2元/分钟/1V4</td>-->
+        <!--        </tr>-->
+        <tr>
+            <td style="text-align: left;" colspan="4">
+                备注:
+                1.Saas平台及产品定制,甲方需在协议签订后3日内将相关费用汇款至乙方指定银行账户;乙方在收到款项后21个工作日内完成定制开发;<br/>
+                2.${serveName}服务采用付费购买方式,有效期内使用,超期未续费将导致停止服务;团易宝按照实际收款金额的${chargeRate}‰即时结算手续费;<br/>
+                3.云教室产品采用预付款开通、实时结算方式,首次开通预付金额不低于1000元,根据乙方实际课时消耗后按照相应标准扣费,甲方应保持足额预付,欠费将导致停止服务;<br/>
+                所有产品一旦投入使用,均不予退费;<br/>
+            </td>
+        </tr>
+    </table>
+    <br/>
+    <table border="1" style="width: 100%; border-collapse: collapse;">
+        <tr>
+            <td class="thStyle">乙方指定银行账户:</td>
+        </tr>
+        <tr>
+            <td>
+                ① 开户名:武汉乐小雅网络科技有限公司<br/>
+                ② 户行:湖北省武汉市招商银行汉街支行<br/>
+                ③ 账户:127915876910501<br/>
+                ④ 税号:91420106MA4F3W1H7K<br/>
+            </td>
+        </tr>
+    </table>
+    <br/>
+    <table border="1" style="width: 100%; border-collapse: collapse;margin-bottom: 50px;">
+        <tr>
+            <td style="text-align: center;">甲方:${tsignName}</td>
+            <td style="text-align: center;">乙方:武汉乐小雅网络科技有限公司</td>
+        </tr>
+        <tr>
+            <td style="text-align: center;">甲方盖章:</td>
+            <td style="text-align: center;" class="sign">
+                乙方盖章 <img class="cachet" src="${officialSealB}" alt="">
+            </td>
+        </tr>
+        <tr>
+            <td style="text-align: center;"> ${nowDate}</td>
+            <td style="text-align: center;"> ${nowDate}</td>
+        </tr>
+    </table>
+</div>
+</body>
+</html>

+ 4 - 1
mec-biz/src/main/resources/config/mybatis/PlatformServeMapper.xml

@@ -62,7 +62,7 @@
         where id_ = #{id,jdbcType=INTEGER}
     </update>
 
-    <select id="queryPage" resultType="com.ym.mec.biz.dal.vo.PlatformServePageVo">
+    <select id="queryPage" parameterType="object" resultType="com.ym.mec.biz.dal.vo.PlatformServePageVo">
         SELECT
         a.id_ AS id,
         a.`name_` AS serveName,
@@ -76,6 +76,9 @@
             <if test="search != null">
                and a.`name_` like CONCAT('%',#{search},'%')
             </if>
+            <if test="id != null">
+                and a.id_ = #{id}
+            </if>
         </where>
         GROUP BY a.`id_`
     </select>

+ 4 - 0
mec-biz/src/main/resources/config/mybatis/SysAreaMapper.xml

@@ -83,4 +83,8 @@
     <select id="getParentArea" resultMap="SysArea">
         SELECT * FROM sys_area WHERE id_ = (SELECT parent_organ_id_ FROM sys_area WHERE id_ = #{id})
     </select>
+
+    <select id="queryByCode" resultMap="SysArea">
+       SELECT * FROM sys_area WHERE code_ = #{code}
+    </select>
 </mapper>

+ 25 - 0
mec-biz/src/main/resources/config/mybatis/TenantApplyCallRecordMapper.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ym.mec.biz.dal.dao.TenantApplyCallRecordDao">
+    <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.TenantApplyCallRecord">
+        <id column="id_" jdbcType="INTEGER" property="id"/>
+        <result column="tenant_apply_id_" jdbcType="INTEGER" property="tenantApplyId"/>
+        <result column="call_back_people_" jdbcType="VARCHAR" property="callBackPeople"/>
+        <result column="call_back_log_" jdbcType="VARCHAR" property="callBackLog"/>
+        <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id_, tenant_apply_id_, call_back_people_, call_back_log_, create_time_
+    </sql>
+
+    <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
+            parameterType="com.ym.mec.biz.dal.entity.TenantApplyCallRecord">
+        insert into tenant_apply_call_record(tenant_apply_id_, call_back_people_, call_back_log_, create_time_)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.tenantApplyId}, #{entity.callBackPeople}, #{entity.callBackLog}, #{entity.createTime})
+        </foreach>
+    </insert>
+
+</mapper>

+ 10 - 2
mec-biz/src/main/resources/config/mybatis/TenantApplyMapper.xml

@@ -14,6 +14,8 @@
 		<result column="create_time_" property="createTime" />
 		<result column="call_back_time_" property="callBackTime" />
 		<result column="call_back_log_" property="callBackLog" />
+		<result column="call_back_people_" property="callBackPeople" />
+		<result column="recommender_" property="recommender" />
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -34,8 +36,8 @@
 		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO tenant_apply
-		(id_,name_,city_,linkman_,mobile_no_,student_num_level_,name_of_referrer_,create_time_,call_back_time_,call_back_log_)
-		VALUES(#{id},#{name},#{city},#{linkman},#{mobileNo},#{studentNumLevel},#{nameOfReferrer},#{createTime},#{callBackTime},#{callBackLog})
+		(id_,name_,city_,linkman_,mobile_no_,student_num_level_,name_of_referrer_,create_time_,call_back_time_,call_back_log_,call_back_people_,recommender_)
+		VALUES(#{id},#{name},#{city},#{linkman},#{mobileNo},#{studentNumLevel},#{nameOfReferrer},#{createTime},#{callBackTime},#{callBackLog},#{callBackPeople},#{recommender})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -72,6 +74,12 @@
 			<if test="createTime != null">
 				create_time_ = #{createTime},
 			</if>
+            <if test="callBackPeople != null">
+                call_back_people_ = #{callBackPeople},
+            </if>
+            <if test="recommender != null">
+                recommender_ = #{recommender},
+            </if>
 		</set>
 		WHERE id_ = #{id}
 	</update>

+ 14 - 2
mec-biz/src/main/resources/config/mybatis/TenantContractTemplateMapper.xml

@@ -130,10 +130,22 @@
 	</select>
 	
 	<select id="queryLatestContractTemplate" resultMap="TenantContractTemplate" parameterType="map">
-		SELECT * FROM tenant_contract_template where type_ = #{type} and owner_ = #{owner} and status_ = 1 and tenant_id_ = #{tenantId}
+		SELECT * FROM tenant_contract_template where status_ = 1 and tenant_id_ = #{tenantId}
+		<if test="type != null">
+			and type_ = #{type}
+		</if>
+		<if test="owner != null">
+			and owner_ = #{owner}
+		</if>
 	</select>
 	
 	<update id="disableContract" parameterType="map">
-		update tenant_contract_template set status_ = 0 where type_ = #{type} and owner_ = #{owner} and status_ = 1 and tenant_id_ = #{tenantId}
+		update tenant_contract_template set status_ = 0 where status_ = 1 and tenant_id_ = #{tenantId}
+		<if test="type != null">
+			and type_ = #{type}
+		</if>
+		<if test="owner != null">
+			and owner_ = #{owner}
+		</if>
 	</update>
 </mapper>

+ 16 - 1
mec-biz/src/main/resources/config/mybatis/TenantInfoMapper.xml

@@ -40,36 +40,51 @@
         <!--  机构基础信息-->
         <id column="id_" jdbcType="INTEGER" property="id"/>
         <result column="name_" jdbcType="VARCHAR" property="name"/>
+        <result column="tsign_name_" jdbcType="VARCHAR" property="tsignName"/>
         <result column="contacts_" jdbcType="VARCHAR" property="contacts"/>
         <result column="phone_" jdbcType="VARCHAR" property="phone"/>
+        <result column="address_" jdbcType="VARCHAR" property="address"/>
         <result column="email_" jdbcType="VARCHAR" property="email"/>
         <result column="pay_state_" jdbcType="INTEGER" property="payState"/>
         <result column="state_" jdbcType="INTEGER" property="state"/>
         <result column="logo_" jdbcType="VARCHAR" property="logo"/>
         <result column="real_name_" jdbcType="VARCHAR" property="createdName"/>
         <result column="studentCount" jdbcType="INTEGER" property="studentCount"/>
+        <result column="area_id_" jdbcType="INTEGER" property="areaId"/>
         <result column="userId" jdbcType="INTEGER" property="userId"/>
         <!-- 机构产品信息-->
         <result column="serve_name_" jdbcType="VARCHAR" property="serveName"/>
+        <result column="serve_id_" jdbcType="INTEGER" property="serveId"/>
         <result column="student_up_limit_" jdbcType="INTEGER" property="studentUpLimit"/>
         <result column="expiry_date_" jdbcType="TIMESTAMP" property="expireDate"/>
+        <result column="contract_price_" jdbcType="VARCHAR" property="contractPrice"/>
+        <result column="expiry_count_" jdbcType="INTEGER" property="expiryCount"/>
+        <result column="expiry_unit_" jdbcType="VARCHAR" property="expiryUnit"/>
     </resultMap>
 
     <select id="queryPage" parameterType="map" resultMap="TenantInfoInfoResult">
         SELECT a.`id_`,
         a.`name_`,
+        a.`tsign_name_`,
         a.`contacts_`,
         a.`phone_`,
+        a.`address_`,
         a.`email_`,
+        a.`area_id_`,
         a.`pay_state_`,
         a.`state_`,
         a.logo_,
         u.`real_name_`,
         c.`name_` AS serve_name_,
+        c.`id_` AS serve_id_,
         d.`student_up_limit_`,
         b.`expiry_date_`,
         ifnull(st.studentCount, 0) as studentCount,
-        a.user_id_ as userId
+        a.user_id_ as userId,
+        b.contract_price_,
+        b.expiry_unit_,
+        b.expiry_count_,
+        d.student_up_limit_
         FROM tenant_info AS a
         LEFT JOIN tenant_product_info AS b ON a.`id_` = b.`tenant_id_` and b.using_ = 0
         LEFT JOIN platform_serve AS c ON b.`serve_id_` = c.`id_`

+ 58 - 0
mec-biz/src/main/resources/config/mybatis/TenantPreJoinMapper.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ym.mec.biz.dal.dao.TenantPreJoinDao">
+    <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.TenantPreJoin">
+        <id column="id_" jdbcType="INTEGER" property="id"/>
+        <result column="tsign_name_" jdbcType="VARCHAR" property="tsignName"/>
+        <result column="name_" jdbcType="VARCHAR" property="name"/>
+        <result column="area_id_" jdbcType="INTEGER" property="areaId"/>
+        <result column="area_name_" jdbcType="VARCHAR" property="areaName"/>
+        <result column="email_" jdbcType="VARCHAR" property="email"/>
+        <result column="customer_service_phone_" jdbcType="VARCHAR" property="customerServicePhone"/>
+        <result column="tsign_code_" jdbcType="VARCHAR" property="tsignCode"/>
+        <result column="address_" jdbcType="VARCHAR" property="address"/>
+        <result column="remark_" jdbcType="VARCHAR" property="remark"/>
+        <result column="enterprise_liable_name_" jdbcType="VARCHAR" property="enterpriseLiableName"/>
+        <result column="enterprise_liable_phone_" jdbcType="VARCHAR" property="enterpriseLiablePhone"/>
+        <result column="legal_person_id_front_pic_" jdbcType="VARCHAR" property="legalPersonIdFrontPic"/>
+        <result column="legal_person_id_reverse_pic_" jdbcType="VARCHAR" property="legalPersonIdReversePic"/>
+        <result column="contacts_" jdbcType="VARCHAR" property="contacts"/>
+        <result column="phone_" jdbcType="VARCHAR" property="phone"/>
+        <result column="tsign_pic_" jdbcType="VARCHAR" property="tsignPic"/>
+        <result column="tax_register_pic_" jdbcType="VARCHAR" property="taxRegisterPic"/>
+        <result column="company_account_info_pic_" jdbcType="VARCHAR" property="companyAccountInfoPic"/>
+        <result column="logo_" jdbcType="VARCHAR" property="logo"/>
+        <result column="corporate_chops_" jdbcType="VARCHAR" property="corporateChops"/>
+        <result column="corporate_finance_chops_" jdbcType="VARCHAR" property="corporateFinanceChops"/>
+        <result column="state_" jdbcType="INTEGER" property="state"/>
+        <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
+        <result column="province_id_" jdbcType="INTEGER" property="provinceId"/>
+        <result column="province_name_" jdbcType="VARCHAR" property="provinceName"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id_
+        , tsign_name_, name_, area_id_, area_name_, email_, customer_service_phone_
+        , tsign_code_, address_, remark_, enterprise_liable_name_, enterprise_liable_phone_, legal_person_id_front_pic_
+        , legal_person_id_reverse_pic_, contacts_, phone_, tsign_pic_, tax_register_pic_, company_account_info_pic_
+        , logo_, corporate_chops_, corporate_finance_chops_, state_, created_time_, province_id_, province_name_
+    </sql>
+
+    <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
+            parameterType="com.ym.mec.biz.dal.entity.TenantPreJoin">
+        insert into tenant_pre_join(tsign_name_, name_, area_id_, area_name_, email_, customer_service_phone_,
+        tsign_code_, address_, remark_, enterprise_liable_name_, enterprise_liable_phone_, legal_person_id_front_pic_,
+        legal_person_id_reverse_pic_, contacts_, phone_, tsign_pic_, tax_register_pic_, company_account_info_pic_,
+        logo_, corporate_chops_, corporate_finance_chops_, state_, created_time_, province_id_, province_name_)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.tsignName}, #{entity.name}, #{entity.areaId}, #{entity.areaName}, #{entity.email},
+            #{entity.customerServicePhone}, #{entity.tsignCode}, #{entity.address}, #{entity.remark},
+            #{entity.enterpriseLiableName}, #{entity.enterpriseLiablePhone}, #{entity.legalPersonIdFrontPic},
+            #{entity.legalPersonIdReversePic}, #{entity.contacts}, #{entity.phone}, #{entity.tsignPic},
+            #{entity.taxRegisterPic}, #{entity.companyAccountInfoPic}, #{entity.logo}, #{entity.corporateChops},
+            #{entity.corporateFinanceChops}, #{entity.state}, #{entity.createdTime}, #{entity.provinceId},
+            #{entity.provinceName})
+        </foreach>
+    </insert>
+</mapper>

+ 27 - 2
mec-common/common-core/src/main/java/com/ym/mec/common/page/WrapperUtil.java

@@ -76,6 +76,28 @@ public class WrapperUtil<T> {
         return this.hasIn(column, WrapperUtil.toList(val));
     }
 
+    /**
+     * 大于等于 >=
+     *
+     * @param column 列名称
+     * @param val    条件
+     */
+    public WrapperUtil<T> hasGe(String column, Object val) {
+        queryWrapper.ge(ObjPredicate.test(val), column, val);
+        return this;
+    }
+
+    /**
+     * 小于等于 <=
+     *
+     * @param column 列名称
+     * @param val    条件
+     */
+    public WrapperUtil<T> hasLe(String column, Object val) {
+        queryWrapper.le(ObjPredicate.test(val), column, val);
+        return this;
+    }
+
     public static <S, O> Integer toInt(Map<S, O> map, S str, String exMsg) {
         Optional<O> o = Optional.ofNullable(map)
                 .map(m -> m.get(str));
@@ -151,7 +173,10 @@ public class WrapperUtil<T> {
     }
 
     public static List<String> collectToList(String[] b) {
-        return Arrays.stream(b).filter(StrPredicate).distinct().collect(Collectors.toList());
+        return Arrays.stream(b)
+                .filter(StrPredicate)
+                .distinct()
+                .collect(Collectors.toList());
     }
 
     /**
@@ -210,7 +235,7 @@ public class WrapperUtil<T> {
     /**
      * 对比a,b集和
      * <p> 示例
-     * <p>  传入a -> [1, 3,4,6]
+     * <p>  传入a -> [1,3,4,6]
      * <p>  传入b -> [1,2,4]
      * <p> 执行该方法后a,b会被修改为
      * <p> a -> [3,6]

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/config/ResourceServerConfig.java

@@ -38,8 +38,8 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
                         "/eduSubject/findSubSubjects", "/eduFinancialExpenditure/batchAdd", "/eduSendNotice/*",
                         "/oaContracts/*", "/eduStudent/organStudentOverView", "/activity/countCloudTeacherActive",
                         "/activity/organDoubleEleven2021Statis", "/activity/doubleEleven2021Statis", "/questionnaireTopic/getDetail", "/questionnaireUserResult/add",
-                        "/tenantInfo/info/*", "/tenantInfo/checkInfo/*", "/tenantInfo/pay/*", "/tenantInfo/notify",
-                             "/tenantInfo/testCheck"
+                        "/tenantInfo/info/*", "/tenantInfo/checkInfo/*", "/tenantInfo/pay/*","/tenantInfo/testCheck", "/tenantInfo/getContract/*",
+                        "/tenantPreJoin/add"
                 )
                 .permitAll().anyRequest().authenticated().and().httpBasic();
     }

+ 58 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TenantApplyCallRecordController.java

@@ -0,0 +1,58 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.biz.dal.entity.TenantApplyCallRecord;
+import com.ym.mec.biz.service.TenantApplyCallRecordService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.Map;
+
+/**
+ * 机构申请记录(TenantApplyCallRecord)表控制层
+ *
+ * @author hgw
+ * @since 2022-02-09 10:44:00
+ */
+@Api(tags = "机构申请记录")
+@RestController
+@RequestMapping("/tenantApplyCallRecord")
+public class TenantApplyCallRecordController extends BaseController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private TenantApplyCallRecordService tenantApplyCallRecordService;
+
+    @ApiOperation("分页查询")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "applyId", value = "申请表id", required = true, dataType = "Integer"),
+            @ApiImplicitParam(name = "startTime", value = "开始时间-年月日时分秒", dataType = "String"),
+            @ApiImplicitParam(name = "endTime", value = "开始时间-年月日时分秒", dataType = "String"),
+    })
+    @PostMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('tenantApplyCallRecord/queryPage')")
+    public HttpResponseResult<PageInfo<TenantApplyCallRecord>> queryPage(@RequestBody Map<String, Object> param) {
+        return succeed(tenantApplyCallRecordService.queryPage(param));
+    }
+
+    @ApiOperation("添加")
+    @PostMapping("/add")
+    @PreAuthorize("@pcs.hasPermissions('tenantApplyCallRecord/add')")
+    public HttpResponseResult add(@RequestBody TenantApplyCallRecord obj) {
+        tenantApplyCallRecordService.insert(obj);
+        return succeed();
+    }
+
+}
+

+ 5 - 4
mec-web/src/main/java/com/ym/mec/web/controller/TenantContractTemplateController.java

@@ -1,11 +1,11 @@
 package com.ym.mec.web.controller;
 
-import java.util.Date;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiOperation;
 
+import java.util.Date;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -18,11 +18,11 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.TenantContractTemplateDto;
 import com.ym.mec.biz.dal.entity.TenantContractTemplate;
+import com.ym.mec.biz.dal.page.TenantContractTemplateQueryInfo;
 import com.ym.mec.biz.service.TenantContractTemplateService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.tenant.TenantContextHolder;
 
 @RequestMapping("tenantContractTemplate")
@@ -39,7 +39,7 @@ public class TenantContractTemplateController extends BaseController {
 	@ApiOperation("分页查询")
 	@GetMapping(value = "/list")
 	@PreAuthorize("@pcs.hasPermissions('tenantContractTemplate/list')")
-	public HttpResponseResult<PageInfo<TenantContractTemplateDto>> getList(QueryInfo queryInfo) {
+	public HttpResponseResult<PageInfo<TenantContractTemplateDto>> getList(TenantContractTemplateQueryInfo queryInfo) {
 		return succeed(tenantContractTemplateService.queryPageList(queryInfo));
 	}
 
@@ -63,6 +63,7 @@ public class TenantContractTemplateController extends BaseController {
 		tenantContractTemplate.setUpdateTime(date);
 		tenantContractTemplate.setModifyBy(sysUser.getId());
 		tenantContractTemplate.setTenantId(TenantContextHolder.getTenantId());
+		tenantContractTemplate.setVersion(1);
 		tenantContractTemplateService.insert(tenantContractTemplate);
 		return succeed();
 	}

+ 9 - 1
mec-web/src/main/java/com/ym/mec/web/controller/TenantInfoController.java

@@ -11,7 +11,6 @@ import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.WrapperUtil;
 import com.ym.mec.common.tenant.TenantContextHolder;
-import com.ym.mec.thirdparty.yqpay.Msg;
 import com.ym.mec.util.validator.ValidationKit;
 import io.swagger.annotations.*;
 import org.apache.commons.lang3.StringUtils;
@@ -124,6 +123,15 @@ public class TenantInfoController extends BaseController {
         return succeed(tenantInfoService.queryPage(param));
     }
 
+    /**
+     * 获取机构付款及续费时需要预览的协议
+     */
+    @ApiOperation("获取机构付款及续费时需要预览的协议")
+    @GetMapping(value = "/getContract/{id}")
+    public Object getContract(@PathVariable("id") Integer id) {
+        return succeed(tenantInfoService.getContract(id));
+    }
+
     @ApiOperation("机构支付")
     @GetMapping(value = "/pay/{id}")
     public Object pay(@ApiParam(value = "机构ID", required = true) @PathVariable("id") Integer id) throws Exception {

+ 53 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TenantPreJoinController.java

@@ -0,0 +1,53 @@
+package com.ym.mec.web.controller;
+
+
+import com.ym.mec.biz.dal.dto.TenantPreJoinDto;
+import com.ym.mec.biz.dal.entity.TenantPreJoin;
+import com.ym.mec.biz.service.TenantPreJoinService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+import java.util.Map;
+
+/**
+ * 机构入驻表(预加入)(TenantPreJoin)表控制层
+ *
+ * @author hgw
+ * @since 2022-02-09 14:38:08
+ */
+@Api(tags = "机构入驻")
+@RestController
+@RequestMapping("/tenantPreJoin")
+public class TenantPreJoinController extends BaseController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private TenantPreJoinService tenantPreJoinService;
+
+    @ApiOperation("分页查询")
+    @PostMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('tenantPreJoin/queryPage')")
+    public HttpResponseResult<PageInfo<TenantPreJoin>> queryPage(@RequestBody Map<String, Object> param) {
+        return succeed(tenantPreJoinService.queryPage(param));
+    }
+
+    @ApiOperation("添加")
+    @PostMapping("/add")
+    public HttpResponseResult add(@Valid  @RequestBody TenantPreJoinDto dto) {
+        tenantPreJoinService.insert(dto);
+        return succeed();
+    }
+
+}
+