hanzhenchao vor 2 Jahren
Ursprung
Commit
b5f9186618
64 geänderte Dateien mit 2050 neuen und 2143 gelöschten Zeilen
  1. +1
    -1
      .gitignore
  2. +5
    -0
      common/pom.xml
  3. +30
    -0
      common/src/main/java/com/trust/ywx/customer/common/enu/CrmFirmStatusEnum.java
  4. +1
    -0
      common/src/main/java/com/trust/ywx/customer/common/enu/FirmErrEum.java
  5. +2
    -10
      common/src/main/java/com/trust/ywx/customer/common/enu/TempFirmStatusEnum.java
  6. +118
    -0
      common/src/main/java/com/trust/ywx/customer/common/model/PageBean.java
  7. +23
    -0
      common/src/main/java/com/trust/ywx/customer/common/model/PageBeanUtil.java
  8. +2
    -18
      common/src/main/java/com/trust/ywx/customer/common/model/manager/request/TempFirmParam.java
  9. +1
    -0
      common/src/main/java/com/trust/ywx/customer/common/model/manager/request/TrustFirmInfoParam.java
  10. +0
    -6
      common/src/main/java/com/trust/ywx/customer/common/model/manager/request/TrustFirmParam.java
  11. +29
    -5
      common/src/main/java/com/trust/ywx/customer/common/model/manager/response/TempFirmDto.java
  12. +8
    -2
      common/src/main/java/com/trust/ywx/customer/common/model/manager/response/TrustFirmDto.java
  13. +0
    -28
      common/src/main/java/com/trust/ywx/customer/common/model/manager/response/TrustFirmDtoWithBLOBs.java
  14. +17
    -1
      common/src/main/java/com/trust/ywx/customer/common/model/query/request/SearchCrmFirmParam.java
  15. +8
    -3
      common/src/main/java/com/trust/ywx/customer/common/model/query/request/SearchFirmParam.java
  16. +7
    -2
      common/src/main/java/com/trust/ywx/customer/common/model/query/request/SearchTrustFirmParam.java
  17. +1
    -0
      common/src/main/java/com/trust/ywx/customer/common/model/query/response/CrmFirmDto.java
  18. +97
    -59
      customer/pom.xml
  19. +240
    -0
      customer/src/main/java/com/trust/ywx/customer/commons/CatMybatisPlugin.java
  20. +191
    -0
      customer/src/main/java/com/trust/ywx/customer/commons/ValidateUtil.java
  21. +44
    -6
      customer/src/main/java/com/trust/ywx/customer/dao/TempFirmDao.java
  22. +27
    -10
      customer/src/main/java/com/trust/ywx/customer/dao/TrustFirmDao.java
  23. +22
    -5
      customer/src/main/java/com/trust/ywx/customer/dao/datasource/MyBatisConfiguration.java
  24. +2
    -18
      customer/src/main/java/com/trust/ywx/customer/dao/po/FirmInfo.java
  25. +11
    -215
      customer/src/main/java/com/trust/ywx/customer/dao/po/FirmInfoTemp.java
  26. +202
    -1102
      customer/src/main/java/com/trust/ywx/customer/dao/po/FirmInfoTempExample.java
  27. +2
    -1
      customer/src/main/java/com/trust/ywx/customer/service/manager/TempFirmManagerService.java
  28. +56
    -4
      customer/src/main/java/com/trust/ywx/customer/service/manager/impl/FirmManagerServiceImpl.java
  29. +66
    -21
      customer/src/main/java/com/trust/ywx/customer/service/manager/impl/TempFirmManagerServiceImpl.java
  30. +11
    -16
      customer/src/main/java/com/trust/ywx/customer/service/query/FirmQueryService.java
  31. +154
    -136
      customer/src/main/java/com/trust/ywx/customer/service/query/impl/FirmQueryServiceImpl.java
  32. +2
    -2
      customer/src/main/java/com/trust/ywx/customer/service/query/impl/FirmQueryServiceImpl_bak.java
  33. +1
    -1
      customer/src/main/resources.dev/jdbc.properties
  34. +85
    -0
      customer/src/main/resources.dev/logback.xml
  35. +4
    -6
      customer/src/main/resources.dev/redis.properties
  36. +6
    -0
      customer/src/main/resources.dev/server.properties
  37. +0
    -0
      customer/src/main/resources.on/jdbc.properties
  38. +4
    -0
      customer/src/main/resources.on/pay.properties
  39. +1
    -3
      customer/src/main/resources.on/redis.properties
  40. +6
    -0
      customer/src/main/resources.on/server.properties
  41. +3
    -0
      customer/src/main/resources.test/jdbc.properties
  42. +85
    -0
      customer/src/main/resources.test/logback.xml
  43. +11
    -0
      customer/src/main/resources.test/redis.properties
  44. +1
    -1
      customer/src/main/resources.test/server.properties
  45. +4
    -7
      customer/src/main/resources/application.properties
  46. +0
    -2
      customer/src/main/resources/dev/base.properties
  47. +35
    -22
      customer/src/main/resources/generatorConfig.xml
  48. +7
    -28
      customer/src/main/resources/mybatis/mapper/FirmInfoMapper.xml
  49. +54
    -355
      customer/src/main/resources/mybatis/mapper/FirmInfoTempMapper.xml
  50. +0
    -2
      customer/src/main/resources/on/base.properties
  51. +0
    -2
      customer/src/main/resources/on/server.properties
  52. +5
    -4
      customer/src/main/resources/spring/dubbo-provider.xml
  53. +1
    -2
      customer/src/main/resources/spring/spring-applicationContext.xml
  54. +0
    -2
      customer/src/main/resources/test/base.properties
  55. +0
    -3
      customer/src/main/resources/test/jdbc.properties
  56. +0
    -12
      customer/src/main/resources/test/redis.properties
  57. +0
    -2
      customer/src/main/resources/test/server.properties
  58. +21
    -3
      customer/src/test/java/com/trust/ywx/customer/FirmServiceTests.java
  59. +98
    -0
      customer/src/test/java/com/trust/ywx/customer/TempFirmServiceTests.java
  60. +4
    -0
      facade/pom.xml
  61. +56
    -0
      facade/src/main/java/com/trust/ywx/customer/service/manager/FirmManagerService.java
  62. +56
    -0
      facade/src/main/java/com/trust/ywx/customer/service/manager/TempFirmManagerService.java
  63. +84
    -0
      facade/src/main/java/com/trust/ywx/customer/service/query/FirmQueryService.java
  64. +38
    -15
      pom.xml

+ 1
- 1
.gitignore Datei anzeigen

@@ -26,6 +26,6 @@ target/
/nbdist/
/.nb-gradle/
build/
logs/
### VS Code ###
.vscode/

+ 5
- 0
common/pom.xml Datei anzeigen

@@ -25,5 +25,10 @@
<groupId>com.51trust.rd</groupId>
<artifactId>common-model</artifactId>
</dependency>

<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
</dependency>
</dependencies>
</project>

+ 30
- 0
common/src/main/java/com/trust/ywx/customer/common/enu/CrmFirmStatusEnum.java Datei anzeigen

@@ -0,0 +1,30 @@
package com.trust.ywx.customer.common.enu;
/**
* *************************************************************************
* <pre></pre>
* @文件名称: FirmStatus.java
* @包 路 径: cn.org.bjca.ywq.config.common.status
* @版权所有:北京数字认证股份有限公司 (C) 2017
*
* @类描述: crm客户状态枚举
* @版本: V1.0
* @创建人: hudan
* @创建时间:2017年1月22日 上午10:42:38
* @修改记录:
*/
public enum CrmFirmStatusEnum {
UN_CONFIRM(0,"待确认"),
CONFIRM(1,"已确认"),
;

private int code;
private String dec;
private CrmFirmStatusEnum(int code, String dec) {
this.code = code;
this.dec = dec;
}
public int getCode() {
return code;
}

}

+ 1
- 0
common/src/main/java/com/trust/ywx/customer/common/enu/FirmErrEum.java Datei anzeigen

@@ -91,6 +91,7 @@ public enum FirmErrEum {
CLIENT_ORG_CODE_NULL("008x006","客户的统一信用代码为空"),
SUPPORT_INFO_TOOLONG("008x007","实施支持内容及验收标准超长,仅支持最多300字符"),
CLIENT_ORG_CODE_CHECK_ERR("008x008","客户的统一信用代码已存在"),
EMAIL("008x009","邮箱格式错误"),
;

/**


+ 2
- 10
common/src/main/java/com/trust/ywx/customer/common/enu/TempFirmStatusEnum.java Datei anzeigen

@@ -2,28 +2,20 @@ package com.trust.ywx.customer.common.enu;
/**
* *************************************************************************
* <pre></pre>
* @文件名称: FirmStatus.java
* @文件名称: TempFirmStatusEnum.java
* @包 路 径: cn.org.bjca.ywq.config.common.status
* @版权所有:北京数字认证股份有限公司 (C) 2017
*
* @类描述: 厂商状态枚举
* @类描述: 临时客户状态枚举
* @版本: V1.0
* @创建人: hudan
* @创建时间:2017年1月22日 上午10:42:38
* @修改记录:
*/
public enum TempFirmStatusEnum {

//可信任客户
FIRM_RIGHT(1,"正常"),
FIRM_STOP(3,"停用"),
FIRM_CREATE_STAMP(5,"已制章"),

// 临时客户
TEMP_UNAUTHEN(0,"未审核"),
TEMP_PASS(1,"审核通过"),
TEMP_REFUSE(2,"拒绝"),
TEMP_DEL(4, "删除")
;
private int code;


+ 118
- 0
common/src/main/java/com/trust/ywx/customer/common/model/PageBean.java Datei anzeigen

@@ -0,0 +1,118 @@
package com.trust.ywx.customer.common.model;

import com.github.pagehelper.Page;

import java.io.Serializable;
import java.util.List;

/***************************************************************************
* <pre></pre>
* @文件名称: PageBean.java
* @包 路 径: cn.org.bjca.ywq.common.base.mybatis
* @版权所有:北京数字认证股份有限公司 (C) 2016
*
* @类描述: 分页返回对象(消费者jar使用)
* @版本: V1.5
* @创建人: hudan
* @创建时间:2016年10月26日 上午9:35:49
*
* @修改记录:
***/
public class PageBean<T> implements Serializable {
private static final long serialVersionUID = 1814051162533922236L;
private int pageNum;
private int pageSize;
private long total;
private int pages;
private List<T> list;

private boolean isFirstPage;
private boolean isLastPage;
private boolean hasPreviousPage;
private boolean hasNextPage;

public PageBean(List<T> list) {
if (list instanceof Page) {
Page page = (Page) list;
this.pageNum = page.getPageNum();
this.pageSize = page.getPageSize();
this.total = page.getTotal();
this.pages = page.getPages();

judgePageBoudary();
}
this.list = list;
}

public PageBean(List<T> desclist, List orginalList) {
if (orginalList instanceof Page) {
Page page = (Page) orginalList;
this.pageNum = page.getPageNum();
this.pageSize = page.getPageSize();
this.total = page.getTotal();
this.pages = page.getPages();
}
this.list = desclist;
}

public int getPageNum() {
return pageNum;
}

public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}

public int getPageSize() {
return pageSize;
}

public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}

public long getTotal() {
return total;
}

public void setTotal(long total) {
this.total = total;
}

public int getPages() {
return pages;
}

public void setPages(int pages) {
this.pages = pages;
}

public List<T> getList() {
return list;
}

public void setList(List<T> list) {
this.list = list;
}

private void judgePageBoudary()
/* */ {
/* 188 */
this.isFirstPage = (this.pageNum == 1);
/* 189 */
this.isLastPage = (this.pageNum == this.pages);
/* 190 */
this.hasPreviousPage = (this.pageNum > 1);
/* 191 */
this.hasNextPage = (this.pageNum < this.pages);
/* */
}

@Override
public String toString() {
return "PageBean [pageNum=" + pageNum + ", pageSize=" + pageSize + ", total=" + total + ", pages=" + pages
+ ", isFirstPage=" + isFirstPage + ", isLastPage=" + isLastPage + ", hasPreviousPage=" + hasPreviousPage
+ ", hasNextPage=" + hasNextPage + "]";
}

}

+ 23
- 0
common/src/main/java/com/trust/ywx/customer/common/model/PageBeanUtil.java Datei anzeigen

@@ -0,0 +1,23 @@
/**
*
*/
package com.trust.ywx.customer.common.model;

import java.util.ArrayList;

public class PageBeanUtil {

public static PageBean getEmptyPage(Integer pageNum, Integer pageSize) {
PageBean pageBean = new PageBean(new ArrayList());
if (pageSize != null) {
pageBean.setPageSize(pageSize);
}
if (pageNum != null) {
pageBean.setPageNum(pageNum);
}
pageBean.setPages(0);
pageBean.setTotal(0);
return pageBean;
}

}

+ 2
- 18
common/src/main/java/com/trust/ywx/customer/common/model/manager/request/TempFirmParam.java Datei anzeigen

@@ -2,10 +2,6 @@ package com.trust.ywx.customer.common.model.manager.request;

import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Data
@@ -19,30 +15,21 @@ public class TempFirmParam implements Serializable {
/**
* 客户名称
*/
@NotBlank(message = "客户名称不能为空")
@Size(max = 29, message = "客户名称最多29个字符")
private String firmName;

/**
* 客户联系人
*/
@NotBlank(message = "客户联系人不能为空")
@Size(max = 10, message = "客户联系人最多10个字符")
private String firmPerson;

/**
* 客户联系电话
*/
@NotBlank(message = "客户联系电话不能为空")
@Size(max = 11, message = "客户联系电话11位")
@Size(min = 11, message = "客户联系电话11位")
@Pattern(regexp = "1[0-9][0-9]\\d{8}", message = "手机号格式有误")
private String firmPhone;

/**
* 客户邮箱
*/
@Email(message = "邮箱格式有误")
private String firmEmail;

/**
@@ -52,7 +39,9 @@ public class TempFirmParam implements Serializable {

/**
* 代理商ID
*
*/
@Deprecated
private String agentClientId;

/**
@@ -61,11 +50,6 @@ public class TempFirmParam implements Serializable {
private String agentSaleId;

/**
* 客户状态 0待审核 1审核通过 2审核拒绝 4删除
*/
private String firmStatus;

/**
* 医生端产品形态 支持app
*/
private Boolean channelApp;


+ 1
- 0
common/src/main/java/com/trust/ywx/customer/common/model/manager/request/TrustFirmInfoParam.java Datei anzeigen

@@ -20,6 +20,7 @@ import java.util.Date;
*/
@Data
public class TrustFirmInfoParam implements Serializable {
private static final long serialVersionUID = -2412440392747736130L;
/**
* 客户主键
*/


+ 0
- 6
common/src/main/java/com/trust/ywx/customer/common/model/manager/request/TrustFirmParam.java Datei anzeigen

@@ -1,6 +1,5 @@
package com.trust.ywx.customer.common.model.manager.request;

import com.trust.ywx.customer.common.model.manager.request.FirmPropParam;
import lombok.Data;

import java.util.Date;
@@ -81,11 +80,6 @@ public class TrustFirmParam extends FirmPropParam {
*/

private Integer projectStatus;
/**
* 审核状态
* see com.trust.ywx.customer.common.enu.FirmStatusEnum
*/
private Integer FirmStatus;

/**
* 信步云appid


+ 29
- 5
common/src/main/java/com/trust/ywx/customer/common/model/manager/response/TempFirmDto.java Datei anzeigen

@@ -18,10 +18,8 @@ import java.io.Serializable;
*/
@Data
public class TempFirmDto implements Serializable {
/**
* 客户主键
*/
private String uniqueid;

private static final long serialVersionUID = -1810636349149250285L;
/**
* 客户id
*/
@@ -34,5 +32,31 @@ public class TempFirmDto implements Serializable {
/**
* 审核状态
*/
private String firmStatus;
private String status;
/**
* 邮箱
*/
private String firmEmail;
/**
* 联系人
*/
private String firmPerson;
/**
* 联系电话
*/
private String firmPhoto;
/**
* 客户logo
*/
private String firmLogo;
/**
* 产品形态 支持app
*/
private Boolean channelApp;

/**
* 产品形态 支持sdk
*/
private Boolean channelSdk;

}

+ 8
- 2
common/src/main/java/com/trust/ywx/customer/common/model/manager/response/TrustFirmDto.java Datei anzeigen

@@ -2,6 +2,7 @@ package com.trust.ywx.customer.common.model.manager.response;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
@@ -17,7 +18,8 @@ import java.util.Date;
* @Modify:
*/
@Data
public class TrustFirmDto{
public class TrustFirmDto implements Serializable {
private static final long serialVersionUID = -6279431833840706044L;
/**
* 客户主键
*/
@@ -34,7 +36,7 @@ public class TrustFirmDto{
/**
* 审核状态
*/
private String firmStatus;
private String status;

/**
* 第三方应用APP_SECRET
@@ -154,4 +156,8 @@ public class TrustFirmDto{
*/
private Integer platAppId;

/**
* 客户图标
*/
private String appIcon;
}

+ 0
- 28
common/src/main/java/com/trust/ywx/customer/common/model/manager/response/TrustFirmDtoWithBLOBs.java Datei anzeigen

@@ -1,28 +0,0 @@
package com.trust.ywx.customer.common.model.manager.response;

import lombok.Data;

/**
* <pre></pre>
*
* @文件名称: CustomerWithBLOBs.java
* @包 路 径: com.trust.ywx.customer.service.dto.response
* @Copyright:北京数字医信责任有限公司 (C) 2022 *
* @Description:
* @Version: V1.0
* @Author: hanzhenchao
* @Date:2022/6/15 10:05
* @Modify:
*/
@Data
public class TrustFirmDtoWithBLOBs extends TrustFirmDto {

/**
* 证书
*/
private String appCert;
/**
* 客户图标
*/
private String appIcon;
}

+ 17
- 1
common/src/main/java/com/trust/ywx/customer/common/model/query/request/SearchCrmFirmParam.java Datei anzeigen

@@ -3,6 +3,8 @@ package com.trust.ywx.customer.common.model.query.request;
import com.fiftyonetrust.common.model.param.PageParam;
import lombok.Data;

import java.io.Serializable;

/***************************************************************************
* <pre></pre>
* @文件名称: Search1FirmParam.java
@@ -15,7 +17,16 @@ import lombok.Data;
* @创建时间:2017年3月13日 下午1:54:17
*/
@Data
public class SearchCrmFirmParam extends SearchFirmParam {
public class SearchCrmFirmParam extends PageParam implements Serializable {
private static final long serialVersionUID = 112265601007415768L;
/**
* 客户id
*/
private String clientId;
/**
* 客户名称
*/
private String firmName;
/**
* 申请人
*/
@@ -24,5 +35,10 @@ public class SearchCrmFirmParam extends SearchFirmParam {
* 订单id
*/
private String orderId;
/**
* 审核状态
* see com.trust.ywx.customer.common.enu.CrmFirmStatusEnum
*/
private Integer status;

}

+ 8
- 3
common/src/main/java/com/trust/ywx/customer/common/model/query/request/SearchFirmParam.java Datei anzeigen

@@ -3,6 +3,8 @@ package com.trust.ywx.customer.common.model.query.request;
import com.fiftyonetrust.common.model.param.PageParam;
import lombok.Data;

import java.io.Serializable;

/***************************************************************************
* <pre></pre>
* @文件名称: Search1FirmParam.java
@@ -15,7 +17,8 @@ import lombok.Data;
* @创建时间:2017年3月13日 下午1:54:17
*/
@Data
public class SearchFirmParam extends PageParam {
public class SearchFirmParam extends PageParam implements Serializable {
private static final long serialVersionUID = -2043152823582713056L;
/**
* 客户id
*/
@@ -26,11 +29,13 @@ public class SearchFirmParam extends PageParam {
private String firmName;
/**
* 代理商id
* 废弃
*/
private String agentClientId;
// private String agentClientId;
/**
* 审核状态
* see com.trust.ywx.customer.common.enu.TempFirmStatusEnum
*/
private Integer firmStatus;
private Integer status;

}

+ 7
- 2
common/src/main/java/com/trust/ywx/customer/common/model/query/request/SearchTrustFirmParam.java Datei anzeigen

@@ -3,6 +3,9 @@ package com.trust.ywx.customer.common.model.query.request;
import com.fiftyonetrust.common.model.param.PageParam;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

/***************************************************************************
* <pre></pre>
* @文件名称: Search1FirmParam.java
@@ -15,7 +18,8 @@ import lombok.Data;
* @创建时间:2017年3月13日 下午1:54:17
*/
@Data
public class SearchTrustFirmParam extends PageParam{
public class SearchTrustFirmParam extends PageParam implements Serializable{
private static final long serialVersionUID = 3584593088828595491L;
/**
* 客户id
*/
@@ -26,8 +30,9 @@ public class SearchTrustFirmParam extends PageParam{
private String firmName;
/**
* 代理商id
* 已废弃
*/
private String agentClientId;
// private String agentClientId;
/**
* 审核状态
*/


+ 1
- 0
common/src/main/java/com/trust/ywx/customer/common/model/query/response/CrmFirmDto.java Datei anzeigen

@@ -20,6 +20,7 @@ import java.util.List;
*/
@Data
public class CrmFirmDto implements Serializable {
private static final long serialVersionUID = 3453284774140479038L;
private String agentClientId;
/*CRM订单id*/
private String orderId;


+ 97
- 59
customer/pom.xml Datei anzeigen

@@ -29,7 +29,6 @@
<dependency>
<groupId>com.51trust.ywx</groupId>
<artifactId>ywx-customer-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>


@@ -65,16 +64,28 @@
<groupId>com.51trust.rd</groupId>
<artifactId>common-util</artifactId>
</dependency>
<dependency>
<groupId>com.51trust.rd</groupId>
<artifactId>common-redis</artifactId>
</dependency>

<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>

<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>druid</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
</dependency>
<dependency>
<groupId>com.dianping.cat</groupId>
<artifactId>cat-client</artifactId>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
@@ -104,6 +115,10 @@
<artifactId>dubbo-remoting-api</artifactId>
<groupId>org.apache.dubbo</groupId>
</exclusion>
<exclusion>
<artifactId>fastjson</artifactId>
<groupId>com.alibaba</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
@@ -116,15 +131,11 @@
<artifactId>mysql-connector-java</artifactId>
<!-- <scope>runtime</scope>-->
</dependency>
<!-- dubbo Registry zk -->

<!-- <dependency>-->
<!-- <groupId>com.101tec</groupId>-->
<!-- <artifactId>zkclient</artifactId>-->
<!-- <version>0.10</version>-->
<!-- </dependency>-->

<!-- DUBBO Registry zk end-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>

<dependency>
<groupId>com.itfsw</groupId>
@@ -197,56 +208,83 @@
</dependencies>
</plugin>
</plugins>
<!-- <resources>-->
<!-- <resource>-->
<!-- <directory>src/main/resources.${deploy.type}</directory>-->
<!-- </resource>-->
<!-- <resource>-->
<!-- <directory>src/main/resources</directory>-->
<!-- <excludes>-->
<!-- </excludes>-->
<!-- <includes>-->
<!-- <include>logback.xml</include>-->
<!-- <include>application.properties</include>-->
<!-- </includes>-->
<!-- <filtering>true</filtering>-->
<!-- </resource>-->
<!-- <resource>-->
<!-- <directory>src/main/resources</directory>-->
<!-- <includes>-->
<!-- <include>spring/**</include>-->
<!-- <include>mybatis/**</include>-->
<!-- <include>META-INF/**</include>-->
<!-- </includes>-->
<!-- <filtering>false</filtering>-->
<!-- </resource>-->
<resources>
<resource>
<directory>src/main/resources.${deploy.type}</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
<excludes>
</excludes>
<includes>
<include>logback.xml</include>
<include>application.properties</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>spring/**</include>
<include>mybatis/**</include>
<include>META-INF/**</include>
</includes>
<filtering>false</filtering>
</resource>

<!-- <resource>-->
<!-- <directory>src/main/resources.${deploy.type}</directory>-->
<!-- <excludes>-->
<!-- </excludes>-->
<!-- <includes>-->
<!-- <include>logback.xml</include>-->
<!-- <include>application.properties</include>-->
<!-- </includes>-->
<!-- <filtering>true</filtering>-->
<!-- </resource>-->
<!-- <resource>-->
<!-- <directory>src/main/resources.${deploy.type}</directory>-->
<!-- <includes>-->
<!-- <include>spring/**</include>-->
<!-- <include>mybatis/**</include>-->
<!-- <include>base.properties</include>-->
<!-- <include>server.properties</include>-->
<!-- <include>redis.properties</include>-->
<!-- <include>jdbc.properties</include>-->
<!-- </includes>-->
<!-- <filtering>false</filtering>-->
<!-- </resource>-->
<resource>
<directory>src/main/resources.${deploy.type}</directory>
<excludes>
</excludes>
<includes>
<include>logback.xml</include>
<include>application.properties</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources.${deploy.type}</directory>
<includes>
<include>spring/**</include>
<include>mybatis/**</include>
<include>base.properties</include>
<include>server.properties</include>
<include>redis.properties</include>
<include>jdbc.properties</include>
</includes>
<filtering>false</filtering>
</resource>

<!-- </resources>-->
</resources>

</build>
<profiles>
<profile>
<id>local</id>
<properties>
<deploy.type>local</deploy.type>
</properties>
</profile>
<profile>
<id>dev</id>
<properties>
<deploy.type>dev</deploy.type>
<activeByDefault>true</activeByDefault>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<deploy.type>test</deploy.type>
</properties>
</profile>
<profile>
<id>on</id>
<properties>
<deploy.type>on</deploy.type>
</properties>
</profile>
</profiles>

<!--发布-->
<distributionManagement>


+ 240
- 0
customer/src/main/java/com/trust/ywx/customer/commons/CatMybatisPlugin.java Datei anzeigen

@@ -0,0 +1,240 @@
package com.trust.ywx.customer.commons;

import com.alibaba.druid.pool.DruidDataSource;
import com.dianping.cat.Cat;
import com.dianping.cat.message.Message;
import com.dianping.cat.message.Transaction;
import org.apache.commons.dbcp.BasicDataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.ParameterMapping;
import org.apache.ibatis.mapping.SqlCommandType;
import org.apache.ibatis.plugin.*;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.TypeHandlerRegistry;
import org.mybatis.spring.transaction.SpringManagedTransaction;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
import org.springframework.util.ReflectionUtils;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.text.DateFormat;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Matcher;


/**
* 对MyBatis进行拦截,添加Cat监控
* 目前仅支持RoutingDataSource和Druid组合配置的数据源
*
* @author Steven
*/

@Intercepts({
@Signature(method = "query", type = Executor.class, args = {
MappedStatement.class, Object.class, RowBounds.class,
ResultHandler.class}),
@Signature(method = "update", type = Executor.class, args = {MappedStatement.class, Object.class})
})
public class CatMybatisPlugin implements Interceptor {

private static Log logger = LogFactory.getLog(CatMybatisPlugin.class);

//缓存,提高性能
private static final Map<String, String> sqlURLCache = new ConcurrentHashMap<String, String>(256);

private static final String EMPTY_CONNECTION = "jdbc:mysql://unknown:3306/%s?useUnicode=true";

private Executor target;

@Override
public Object intercept(Invocation invocation) throws Throwable {
MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
//得到类名,方法
String[] strArr = mappedStatement.getId().split("\\.");
String methodName = strArr[strArr.length - 2] + "." + strArr[strArr.length - 1];

Transaction t = Cat.newTransaction("SQL", methodName);

//得到sql语句
Object parameter = null;
if (invocation.getArgs().length > 1) {
parameter = invocation.getArgs()[1];
}
BoundSql boundSql = mappedStatement.getBoundSql(parameter);
Configuration configuration = mappedStatement.getConfiguration();
String sql = showSql(configuration, boundSql);

//获取SQL类型
SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType();
Cat.logEvent("SQL.Method", sqlCommandType.name().toLowerCase(), Message.SUCCESS, sql);

String s = this.getSQLDatabase();
Cat.logEvent("SQL.Database", s);
Object returnObj = null;
try {
returnObj = invocation.proceed();
t.setStatus(Transaction.SUCCESS);
} catch (Exception e) {
Cat.logError(e);
} finally {
t.complete();
}

return returnObj;
}

private javax.sql.DataSource getDataSource() {
org.apache.ibatis.transaction.Transaction transaction = this.target.getTransaction();
if (transaction == null) {
logger.error(String.format("Could not find transaction on target [%s]", this.target));
return null;
}
if (transaction instanceof SpringManagedTransaction) {
String fieldName = "dataSource";
Field field = ReflectionUtils.findField(transaction.getClass(), fieldName, javax.sql.DataSource.class);

if (field == null) {
logger.error(String.format("Could not find field [%s] of type [%s] on target [%s]",
fieldName, javax.sql.DataSource.class, this.target));
return null;
}

ReflectionUtils.makeAccessible(field);
javax.sql.DataSource dataSource = (javax.sql.DataSource) ReflectionUtils.getField(field, transaction);
return dataSource;
}

logger.error(String.format("---the transaction is not SpringManagedTransaction:%s", transaction.getClass().toString()));

return null;
}

private String getSqlURL() {
javax.sql.DataSource dataSource = this.getDataSource();

if (dataSource == null) {
return null;
}

if (dataSource instanceof AbstractRoutingDataSource) {
String methodName = "determineTargetDataSource";
Method method = ReflectionUtils.findMethod(AbstractRoutingDataSource.class, methodName);

if (method == null) {
logger.error(String.format("---Could not find method [%s] on target [%s]",
methodName, dataSource));
return null;
}

ReflectionUtils.makeAccessible(method);
javax.sql.DataSource dataSource1 = (javax.sql.DataSource) ReflectionUtils.invokeMethod(method, dataSource);
if (dataSource1 instanceof DruidDataSource) {
DruidDataSource druidDataSource = (DruidDataSource) dataSource1;
return druidDataSource.getUrl();
} else {
logger.error("---only surpport DruidDataSource:" + dataSource1.getClass().toString());
}
} else if (dataSource instanceof BasicDataSource) {
return ((BasicDataSource) dataSource).getUrl();
}
return null;
}

private String getSQLDatabase() {
// String dbName = RouteDataSourceContext.getRouteKey();
String dbName = null; //根据设置的多数据源修改此处,获取dbname
if (dbName == null) {
dbName = "DEFAULT";
}
String url = CatMybatisPlugin.sqlURLCache.get(dbName);
if (url != null) {
return url;
}

url = this.getSqlURL();//目前监控只支持mysql ,其余数据库需要各自修改监控服务端
if (url == null) {
url = String.format(EMPTY_CONNECTION, dbName);
}
CatMybatisPlugin.sqlURLCache.put(dbName, url);
return url;
}

/**
* 解析sql语句
*
* @param configuration
* @param boundSql
* @return
*/
public String showSql(Configuration configuration, BoundSql boundSql) {
Object parameterObject = boundSql.getParameterObject();
List<ParameterMapping> parameterMappings = boundSql.getParameterMappings();
String sql = boundSql.getSql().replaceAll("[\\s]+", " ");
if (parameterMappings.size() > 0 && parameterObject != null) {
TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry();
if (typeHandlerRegistry.hasTypeHandler(parameterObject.getClass())) {
sql = sql.replaceFirst("\\?", Matcher.quoteReplacement(getParameterValue(parameterObject)));

} else {
MetaObject metaObject = configuration.newMetaObject(parameterObject);
for (ParameterMapping parameterMapping : parameterMappings) {
String propertyName = parameterMapping.getProperty();
if (metaObject.hasGetter(propertyName)) {
Object obj = metaObject.getValue(propertyName);
sql = sql.replaceFirst("\\?", Matcher.quoteReplacement(getParameterValue(obj)));
} else if (boundSql.hasAdditionalParameter(propertyName)) {
Object obj = boundSql.getAdditionalParameter(propertyName);
sql = sql.replaceFirst("\\?", Matcher.quoteReplacement(getParameterValue(obj)));
}
}
}
}
return sql;
}

/**
* 参数解析
*
* @param obj
* @return
*/
private String getParameterValue(Object obj) {
String value = null;
if (obj instanceof String) {
value = "'" + obj.toString() + "'";
} else if (obj instanceof Date) {
DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.CHINA);
value = "'" + formatter.format(new Date()) + "'";
} else {
if (obj != null) {
value = obj.toString();
} else {
value = "";
}

}
return value;
}

@Override
public Object plugin(Object target) {
if (target instanceof Executor) {
this.target = (Executor) target;
return Plugin.wrap(target, this);
}
return target;
}

@Override
public void setProperties(Properties properties) {
}

}

+ 191
- 0
customer/src/main/java/com/trust/ywx/customer/commons/ValidateUtil.java Datei anzeigen

@@ -0,0 +1,191 @@
package com.trust.ywx.customer.commons;

import org.apache.commons.lang3.StringUtils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* 公用参数校验工具类。
*
* @Author hezhao
* @Date 2015年3月25日
*/
public class ValidateUtil {

private static final Pattern pip4 = Pattern.compile("\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}");// ip地址匹配192.168.1.3
private static final Pattern pdomain = Pattern.compile("[a-zA-Z0-9-\\u4e00-\\u9fa5]+(.[a-zA-Z0-9-]+)+");
private static final Pattern purl = Pattern.compile("(http|https):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&amp;:/~\\+#]*[\\w\\-\\@?^=%&amp;/~\\+#])?");
private static final Pattern pserialno = Pattern.compile("[a-z0-9-_]+");
private static final String DOMAINS = ".com.cn|.net.cn|.org.cn|.gov.cn|.com|.net|.tv|.gd|.org|.cc|.vc|.mobi|.cd|.info|.name|.asia|.hk|.me|.la|.sh|.biz|.li|.kr|.in|.us|.io|.ac.cn|.bj.cn|.sh.cn|.tj.cn|.cq.cn|.he.cn|.sx.cn|.nm.cn|.ln.cn|.jl.cn|.hl.cn|.js.cn|.zj.cn|.ah.cn|.fj.cn|.jx.cn|.sd.cn|.ha.cn|.hb.cn|.hn.cn|.gd.cn|.gx.cn|.hi.cn|.sc.cn|.gz.cn|.yn.cn|.xz.cn|.sn.cn|.gs.cn|.qh.cn|.nx.cn|.xj.cn|.tw.cn|.hk.cn|.mo.cn|.cn";

private ValidateUtil() {
// 私有类构造方法
}

/**
* 校验字符串是否是英文字母,不分大小写
*
* @author yuanchangjian
* @return
*/
public static boolean isEnglish(String value) {
if (StringUtils.isBlank(value)) {
return false;
}
Pattern pattern = Pattern.compile("^[A-Za-z]+$");
Matcher m = pattern.matcher(value);
return m.matches();
}

/**
* 校验电话号码(座机)
*
* @author yuanchangjian
* @return
*/
public static boolean checkPhone(String value) {
if (StringUtils.isBlank(value)) {
return false;
}
Pattern pattern = Pattern.compile("^((\\d{3,4})\\-(\\d{8})|(\\d{4})\\-(\\d{7}))$");
Matcher m = pattern.matcher(value);
return m.matches();

}

/**
* 校验电话号码(手机)
*
* @author yuanchangjian
* @return
*/
public static boolean checkMobile(String value) {
if (StringUtils.isBlank(value)) {
return false;
}
Pattern pattern = Pattern.compile("^1(4[0-9]|3[0-9]|5[0-9]|8[0-9]|7[0-9])\\d{8}$");
Matcher m = pattern.matcher(value);
return m.matches();
}

/**
* 运营商号段如下: 中国联通号码:130、131、132、145(无线上网卡)、155、156、185(iPhone5上市后开放)、186、176(4G号段)、 175(2015年9月10日正式启用,暂只对北京、上海和广东投放办理)
* 中国移动号码:134、135、136、137、138、139、147(无线上网卡)、150、151、152、157、158、159、182、183、187、188、178 中国电信号码:133、153、180、181、189、177、173、149 虚拟运营商:170、1718、1719 手机号前3位的数字包括: 1 :1 2 :3,4,5,7,8 3
* :0,1,2,3,4,5,6,7,8,9 总结: 目前java手机号码正则表达式有: a :"^1[3|4|5|7|8][0-9]\\d{4,8}$" 一般验证情况下这个就可以了 b :"^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$"
* Pattern和Matcher详解(字符串匹配和字节码)http://blog.csdn.net/u010700335/article/details/44616451
*/
public static boolean checkMobileNo(String mobileNo) {
if (StringUtils.isBlank(mobileNo)) {
return false;
}
String regex = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$";
boolean isMatch = false;//默认不合格
try {
if (mobileNo.length() != 11) {
isMatch = false;
} else {
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(mobileNo);
isMatch = m.matches();
}
} catch (Exception e) {
isMatch = false;
e.printStackTrace();
}
return isMatch;
}

/**
* 校验电子邮箱
*
* @author yuanchangjian
* @return
*/
public static boolean checkEmail(String value) {
if (StringUtils.isBlank(value)) {
return false;
}
Pattern pattern = Pattern.compile("^([a-zA-Z0-9]+[_|\\_|\\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\\_|\\.]?)*[a-zA-Z0-9]+\\.[a-zA-Z]{2,3}$");
Matcher m = pattern.matcher(value);
return m.matches();
}

/**
* 是否是url地址
*
* @param str http://www.oppo.com url地址
* @return 是否是url地址
*/
public static boolean checkURL(String str) {
if (StringUtils.isBlank(str)) {
return false;
}
Matcher m = purl.matcher(str);
return m.matches();
}

/**
* 是否是主域名如 baidu.com
*
* @param str 目标字符串
* @return 是否是主域名
*/
public static boolean checkMainDomain(String str) {
if (StringUtils.isBlank(str)) {
return false;
}
String[] domains = DOMAINS.split("\\|");
for (String s : domains) {
if (null != s && !s.trim().equals("") && str.indexOf(s) > 0) {
str = str.replace(s, "");
if (checkSerialNo(str)) {
return true;
} else {
return false;
}
}
}
return false;
}

public static boolean checkDomain(String s) {
if (StringUtils.isBlank(s)) {
return false;
}
Matcher m = pdomain.matcher(s);
return m.matches();
}


/**
* 是不是IP地址
*
* @param s 目标字符串
* @return 是不是IP地址
*/
public static boolean checkIP(String s) {
if (StringUtils.isBlank(s)) {
return false;
}
Matcher m = pip4.matcher(s);
return m.matches();
}

/**
* 校验编号, 只能是数字,字母, 下划线, 减号
*
* @param str 目标字符串 例如:http://www.oppo.com
* @return 是否是编号
*/
public static boolean checkSerialNo(String str) {
if (StringUtils.isBlank(str)) {
return false;
}
str = str.toLowerCase().trim();

Matcher isSerialNo = pserialno.matcher(str);
return isSerialNo.matches();
}

}

+ 44
- 6
customer/src/main/java/com/trust/ywx/customer/dao/TempFirmDao.java Datei anzeigen

@@ -1,12 +1,19 @@
package com.trust.ywx.customer.dao;

import com.github.pagehelper.PageHelper;
import com.trust.ywx.customer.common.enu.TempFirmStatusEnum;
import com.trust.ywx.customer.common.model.manager.response.TempFirmDto;
import com.trust.ywx.customer.common.model.query.request.SearchFirmParam;
import com.trust.ywx.customer.common.model.PageBean;
import com.trust.ywx.customer.dao.mapper.FirmInfoTempMapper;
import com.trust.ywx.customer.dao.po.FirmInfoTemp;
import com.trust.ywx.customer.dao.po.FirmInfoTempExample;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
@@ -26,20 +33,22 @@ public class TempFirmDao {
@Resource
FirmInfoTempMapper tempMapper;

private List<String> statusList = Arrays.asList(TempFirmStatusEnum.TEMP_UNAUTHEN.getCode()+"",TempFirmStatusEnum.TEMP_REFUSE.getCode()+"");

public FirmInfoTemp getByClientId(String clientId){
FirmInfoTempExample example = new FirmInfoTempExample();
example.createCriteria().andClientIdEqualTo(clientId);
return tempMapper.selectOneByExample(example);
example.createCriteria().andClientIdEqualTo(clientId).andStatusIn(statusList);
return tempMapper.selectOneByExampleWithBLOBs(example);
}

public int auditPass(String clientId){
// 将临时客户修改为已审核!
FirmInfoTempExample example = new FirmInfoTempExample();
example.createCriteria().andClientIdEqualTo(clientId).
andFirmStatusEqualTo(TempFirmStatusEnum.TEMP_UNAUTHEN.getCode()+"");
andStatusEqualTo(TempFirmStatusEnum.TEMP_UNAUTHEN.getCode()+"");

FirmInfoTemp record = new FirmInfoTemp();
record.setFirmStatus(TempFirmStatusEnum.TEMP_PASS.getCode()+"");
record.setStatus(TempFirmStatusEnum.TEMP_PASS.getCode()+"");
return tempMapper.updateByExampleSelective(record,example);
}

@@ -47,10 +56,10 @@ public class TempFirmDao {
// 将临时客户修改为审核拒绝!
FirmInfoTempExample example = new FirmInfoTempExample();
example.createCriteria().andClientIdEqualTo(clientId).
andFirmStatusEqualTo(TempFirmStatusEnum.TEMP_UNAUTHEN.getCode()+"");
andStatusEqualTo(TempFirmStatusEnum.TEMP_UNAUTHEN.getCode()+"");

FirmInfoTemp record = new FirmInfoTemp();
record.setFirmStatus(TempFirmStatusEnum.TEMP_REFUSE.getCode()+"");
record.setStatus(TempFirmStatusEnum.TEMP_REFUSE.getCode()+"");
return tempMapper.updateByExampleSelective(record,example);
}

@@ -71,4 +80,33 @@ public class TempFirmDao {
example.createCriteria().andClientIdEqualTo(temp.getClientId());
return tempMapper.updateByExampleSelective(temp,example);
}

public int deleteByClientId(String clientId) {
FirmInfoTempExample example = new FirmInfoTempExample();
example.createCriteria().andClientIdEqualTo(clientId);
return tempMapper.deleteByExample(example);
}

public PageBean<TempFirmDto> getListByParam(SearchFirmParam param) {
PageHelper.startPage(param.getPageNo(),param.getPageSize());
FirmInfoTempExample example = new FirmInfoTempExample();
FirmInfoTempExample.Criteria where = example.createCriteria();

if(StringUtils.isNotBlank(param.getClientId())){
where.andClientIdEqualTo(param.getClientId());
}
if(StringUtils.isNotBlank(param.getFirmName())){
where.andFirmNameEqualTo(param.getFirmName());
}
if(null != param.getStatus()){
where.andStatusEqualTo(param.getStatus()+"");
}else{
// 查询待审核和审核拒绝的
where.andStatusIn(statusList);
}
example.setOrderByClause(FirmInfoTemp.Column.createTime.desc());

List<FirmInfoTemp> list = tempMapper.selectByExample(example);
return new PageBean(new ArrayList<>(list),list);
}
}

+ 27
- 10
customer/src/main/java/com/trust/ywx/customer/dao/TrustFirmDao.java Datei anzeigen

@@ -1,13 +1,15 @@
package com.trust.ywx.customer.dao;

import com.github.pagehelper.PageHelper;
import com.trust.ywx.customer.common.enu.FirmStatusEnum;
import com.trust.ywx.customer.common.enu.ProjectStatusEnum;
import com.trust.ywx.customer.common.model.PageBean;
import com.trust.ywx.customer.dao.mapper.FirmInfoMapper;
import com.trust.ywx.customer.dao.po.FirmInfo;
import com.trust.ywx.customer.dao.po.FirmInfoExample;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
@@ -28,27 +30,39 @@ public class TrustFirmDao {
@Resource
private FirmInfoMapper firmInfoMapper;

public List<FirmInfo> getListByOrgCode(String orgCode){
public List<FirmInfo> getListByOrgCode(String orgCode) {
FirmInfoExample example = new FirmInfoExample();
example.createCriteria().andClientOrgCodeEqualTo(orgCode);
return firmInfoMapper.selectByExample(example);
}
public List<FirmInfo> getListByFirmName(String firmName){

public List<FirmInfo> getListByFirmName(String firmName) {
FirmInfoExample example = new FirmInfoExample();
example.createCriteria().andFirmNameEqualTo(firmName);
return firmInfoMapper.selectByExample(example);
}

public List<FirmInfo> getListByIds(List<String> clientIdList, int pageSize, int pageNo) {
public PageBean<FirmInfo> getListByIds(List<String> clientIdList, int pageNo,int pageSize) {
PageHelper.startPage(pageNo, pageSize);

FirmInfoExample example = new FirmInfoExample();
example.createCriteria().andClientIdIn(clientIdList);
example.page(pageNo, pageSize);
return firmInfoMapper.selectByExample(example);
example.createCriteria().andClientIdIn(clientIdList).andStatusNotEqualTo(FirmStatusEnum.FIRM_SUB_DELETE.getCode());
List list = firmInfoMapper.selectByExample(example);
return new PageBean<>(new ArrayList<>(list),list);
}

public PageBean<FirmInfo> getList( int pageNo,int pageSize) {
PageHelper.startPage(pageNo, pageSize);
FirmInfoExample example = new FirmInfoExample();
example.createCriteria().andStatusNotEqualTo(FirmStatusEnum.FIRM_SUB_DELETE.getCode());
List list = firmInfoMapper.selectByExample(example);
return new PageBean<>(new ArrayList<>(list),list);
}

/**
* 根据客户Id查询客户信息
* 已删除的客户不对外暴露
*
* @param clientId
* @return
*/
@@ -60,7 +74,8 @@ public class TrustFirmDao {

/**
* 根据客户Id查询客户信息
* 已删除的客户不对外暴露
* 已删除的客户不对外暴露
*
* @param clientId
* @return
*/
@@ -76,15 +91,17 @@ public class TrustFirmDao {
firmInfo.setUpdateTime(null);
return firmInfoMapper.insertSelective(firmInfo);
}

public int update(FirmInfo firmInfo) {
firmInfo.setUpdateTime(null);
FirmInfoExample example = new FirmInfoExample();
example.createCriteria().andClientIdEqualTo(firmInfo.getClientId());
return firmInfoMapper.updateByExampleSelective(firmInfo,example);
return firmInfoMapper.updateByExampleSelective(firmInfo, example);
}

/**
* 根据客户id删除客户
*
* @param clientId
* @return
*/
@@ -94,6 +111,6 @@ public class TrustFirmDao {
firmInfo.setStatus(FirmStatusEnum.FIRM_SUB_DELETE.getCode());
FirmInfoExample example = new FirmInfoExample();
example.createCriteria().andClientIdEqualTo(clientId);
return firmInfoMapper.updateByExampleSelective(firmInfo,example);
return firmInfoMapper.updateByExampleSelective(firmInfo, example);
}
}

+ 22
- 5
customer/src/main/java/com/trust/ywx/customer/dao/datasource/MyBatisConfiguration.java Datei anzeigen

@@ -1,6 +1,8 @@
package com.trust.ywx.customer.dao.datasource;

import com.alibaba.druid.pool.DruidDataSource;
import com.github.pagehelper.PageHelper;
import com.trust.ywx.customer.commons.CatMybatisPlugin;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
@@ -38,7 +40,7 @@ public class MyBatisConfiguration {
@Resource
private Environment env;

@Value("${spring.datasource.url}")
@Value("${jdbc.url}")
private String dbUrl;
@Value("${jdbc.username}")
private String username;
@@ -122,6 +124,9 @@ public class MyBatisConfiguration {
public SqlSessionFactory sqlSessionFactory(DataSource ds) throws Exception {
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(ds);
Interceptor[] plugins = new Interceptor[]{pageHelper(), catInterceptor()};
sqlSessionFactoryBean.setPlugins(plugins);

PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();

String typeAliasesPackage = env.getProperty("mybatis.typeAliasesPackage");
@@ -132,8 +137,20 @@ public class MyBatisConfiguration {
return sqlSessionFactoryBean.getObject();
}

// @Bean
// public CatMybatisPlugin catInterceptor() {
// return new CatMybatisPlugin();
// }
@Bean
public PageHelper pageHelper() {
PageHelper pageHelper = new PageHelper();
Properties p = new Properties();
p.setProperty("offsetAsPageNum", "true");
p.setProperty("rowBoundsWithCount", "true");
p.setProperty("reasonable", "true");
p.setProperty("helper-dialect", env.getProperty("datasource.dialect"));
pageHelper.setProperties(p);
return pageHelper;
}

@Bean
public CatMybatisPlugin catInterceptor() {
return new CatMybatisPlugin();
}
}

+ 2
- 18
customer/src/main/java/com/trust/ywx/customer/dao/po/FirmInfo.java Datei anzeigen

@@ -196,7 +196,7 @@ public class FirmInfo implements Serializable {
*
* Table: firm_info
* Column: create_time
* Nullable: true
* Nullable: false
*/
private Date createTime;

@@ -205,7 +205,7 @@ public class FirmInfo implements Serializable {
*
* Table: firm_info
* Column: update_time
* Nullable: true
* Nullable: false
*/
private Date updateTime;

@@ -253,15 +253,6 @@ public class FirmInfo implements Serializable {
private Integer platAppId;

/**
* 第三方应用证书
*
* Table: firm_info
* Column: app_cert
* Nullable: true
*/
private String appCert;

/**
* 第三方厂商图标
*
* Table: firm_info
@@ -305,7 +296,6 @@ public class FirmInfo implements Serializable {
sb.append(", caChannel=").append(caChannel);
sb.append(", projectStatus=").append(projectStatus);
sb.append(", platAppId=").append(platAppId);
sb.append(", appCert=").append(appCert);
sb.append(", appIcon=").append(appIcon);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
@@ -458,11 +448,6 @@ public class FirmInfo implements Serializable {
return this;
}

public Builder appCert(String appCert) {
obj.setAppCert(appCert);
return this;
}

public Builder appIcon(String appIcon) {
obj.setAppIcon(appIcon);
return this;
@@ -501,7 +486,6 @@ public class FirmInfo implements Serializable {
caChannel("ca_channel", "caChannel", "INTEGER", false),
projectStatus("project_status", "projectStatus", "INTEGER", false),
platAppId("plat_app_id", "platAppId", "INTEGER", false),
appCert("app_cert", "appCert", "LONGVARCHAR", false),
appIcon("app_icon", "appIcon", "LONGVARCHAR", false);

private static final String BEGINNING_DELIMITER = "\"";


+ 11
- 215
customer/src/main/java/com/trust/ywx/customer/dao/po/FirmInfoTemp.java Datei anzeigen

@@ -21,15 +21,6 @@ public class FirmInfoTemp implements Serializable {
private String uniqueid;

/**
* 外键ID
*
* Table: firm_info_temp
* Column: open_id
* Nullable: true
*/
private String openId;

/**
* 企业营业执照
*
* Table: firm_info_temp
@@ -48,33 +39,6 @@ public class FirmInfoTemp implements Serializable {
private String orgCodeUrl;

/**
* 法人身份证正面
*
* Table: firm_info_temp
* Column: juridical_idcard_front_url
* Nullable: true
*/
private String juridicalIdcardFrontUrl;

/**
* 法人身份证背面
*
* Table: firm_info_temp
* Column: juridical_idcard_back_url
* Nullable: true
*/
private String juridicalIdcardBackUrl;

/**
* 法人临时身份证
*
* Table: firm_info_temp
* Column: juridical_tmp_id_url
* Nullable: true
*/
private String juridicalTmpIdUrl;

/**
* 企业名称
*
* Table: firm_info_temp
@@ -84,24 +48,6 @@ public class FirmInfoTemp implements Serializable {
private String firmName;

/**
* 工商注册号
*
* Table: firm_info_temp
* Column: firm_bus_reg_num
* Nullable: true
*/
private String firmBusRegNum;

/**
* 社会信用代码
*
* Table: firm_info_temp
* Column: firm_soc_cre_code
* Nullable: true
*/
private String firmSocCreCode;

/**
* 企业地址
*
* Table: firm_info_temp
@@ -118,15 +64,6 @@ public class FirmInfoTemp implements Serializable {
private String firmOrgCode;

/**
* 税务登记证号
*
* Table: firm_info_temp
* Column: firm_tax_reg_cert_code
* Nullable: true
*/
private String firmTaxRegCertCode;

/**
* 经营范围
*
* Table: firm_info_temp
@@ -145,51 +82,6 @@ public class FirmInfoTemp implements Serializable {
private Date firmBusTime;

/**
* 法人归属地
*
* Table: firm_info_temp
* Column: juridical_nationality
* Nullable: true
*/
private String juridicalNationality;

/**
* 法人姓名
*
* Table: firm_info_temp
* Column: juridical_name
* Nullable: true
*/
private String juridicalName;

/**
* 法人联系电话
*
* Table: firm_info_temp
* Column: juridical_phone
* Nullable: true
*/
private String juridicalPhone;

/**
* 法人身份证号
*
* Table: firm_info_temp
* Column: juridical_idcard
* Nullable: true
*/
private String juridicalIdcard;

/**
* 法人证件有效期
*
* Table: firm_info_temp
* Column: juridical_time
* Nullable: true
*/
private Date juridicalTime;

/**
* 代理人姓名
*
* Table: firm_info_temp
@@ -235,22 +127,13 @@ public class FirmInfoTemp implements Serializable {
private String firmEmail;

/**
* 实名认证标识(0:未认证 1:已认证 2:认证不通过 3:认证失败)
*
* Table: firm_info_temp
* Column: realname_check
* Nullable: false
*/
private String realnameCheck;

/**
* 厂商状态0待审核 1审核通过 2审核拒绝 4删除
*
* Table: firm_info_temp
* Column: firm_status
* Nullable: false
*/
private String firmStatus;
private String status;

/**
* 实名认证标识(0:未认证 1:已认证 2:认证不通过 3:认证失败)
@@ -305,16 +188,20 @@ public class FirmInfoTemp implements Serializable {
private String clientId;

/**
* 创建
*
* Table: firm_info_temp
* Column: create_time
* Nullable: true
* Nullable: false
*/
private Date createTime;

/**
* 修改时间
*
* Table: firm_info_temp
* Column: update_time
* Nullable: true
* Nullable: false
*/
private Date updateTime;

@@ -343,32 +230,19 @@ public class FirmInfoTemp implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", uniqueid=").append(uniqueid);
sb.append(", openId=").append(openId);
sb.append(", businessLicenseUrl=").append(businessLicenseUrl);
sb.append(", orgCodeUrl=").append(orgCodeUrl);
sb.append(", juridicalIdcardFrontUrl=").append(juridicalIdcardFrontUrl);
sb.append(", juridicalIdcardBackUrl=").append(juridicalIdcardBackUrl);
sb.append(", juridicalTmpIdUrl=").append(juridicalTmpIdUrl);
sb.append(", firmName=").append(firmName);
sb.append(", firmBusRegNum=").append(firmBusRegNum);
sb.append(", firmSocCreCode=").append(firmSocCreCode);
sb.append(", firmAddress=").append(firmAddress);
sb.append(", firmOrgCode=").append(firmOrgCode);
sb.append(", firmTaxRegCertCode=").append(firmTaxRegCertCode);
sb.append(", firmBusScope=").append(firmBusScope);
sb.append(", firmBusTime=").append(firmBusTime);
sb.append(", juridicalNationality=").append(juridicalNationality);
sb.append(", juridicalName=").append(juridicalName);
sb.append(", juridicalPhone=").append(juridicalPhone);
sb.append(", juridicalIdcard=").append(juridicalIdcard);
sb.append(", juridicalTime=").append(juridicalTime);
sb.append(", agentName=").append(agentName);
sb.append(", agentIdcard=").append(agentIdcard);
sb.append(", agentTime=").append(agentTime);
sb.append(", firmPhone=").append(firmPhone);
sb.append(", firmEmail=").append(firmEmail);
sb.append(", realnameCheck=").append(realnameCheck);
sb.append(", firmStatus=").append(firmStatus);
sb.append(", status=").append(status);
sb.append(", juridicalRealnameCheck=").append(juridicalRealnameCheck);
sb.append(", agentPhone=").append(agentPhone);
sb.append(", channel=").append(channel);
@@ -400,11 +274,6 @@ public class FirmInfoTemp implements Serializable {
return this;
}

public Builder openId(String openId) {
obj.setOpenId(openId);
return this;
}

public Builder businessLicenseUrl(String businessLicenseUrl) {
obj.setBusinessLicenseUrl(businessLicenseUrl);
return this;
@@ -415,41 +284,11 @@ public class FirmInfoTemp implements Serializable {
return this;
}

public Builder juridicalIdcard(String juridicalIdcard) {
obj.setJuridicalIdcard(juridicalIdcard);
return this;
}

public Builder juridicalIdcardFrontUrl(String juridicalIdcardFrontUrl) {
obj.setJuridicalIdcardFrontUrl(juridicalIdcardFrontUrl);
return this;
}

public Builder juridicalIdcardBackUrl(String juridicalIdcardBackUrl) {
obj.setJuridicalIdcardBackUrl(juridicalIdcardBackUrl);
return this;
}

public Builder juridicalTmpIdUrl(String juridicalTmpIdUrl) {
obj.setJuridicalTmpIdUrl(juridicalTmpIdUrl);
return this;
}

public Builder firmName(String firmName) {
obj.setFirmName(firmName);
return this;
}

public Builder firmBusRegNum(String firmBusRegNum) {
obj.setFirmBusRegNum(firmBusRegNum);
return this;
}

public Builder firmSocCreCode(String firmSocCreCode) {
obj.setFirmSocCreCode(firmSocCreCode);
return this;
}

public Builder firmAddress(String firmAddress) {
obj.setFirmAddress(firmAddress);
return this;
@@ -460,11 +299,6 @@ public class FirmInfoTemp implements Serializable {
return this;
}

public Builder firmTaxRegCertCode(String firmTaxRegCertCode) {
obj.setFirmTaxRegCertCode(firmTaxRegCertCode);
return this;
}

public Builder firmBusScope(String firmBusScope) {
obj.setFirmBusScope(firmBusScope);
return this;
@@ -475,26 +309,6 @@ public class FirmInfoTemp implements Serializable {
return this;
}

public Builder juridicalNationality(String juridicalNationality) {
obj.setJuridicalNationality(juridicalNationality);
return this;
}

public Builder juridicalName(String juridicalName) {
obj.setJuridicalName(juridicalName);
return this;
}

public Builder juridicalPhone(String juridicalPhone) {
obj.setJuridicalPhone(juridicalPhone);
return this;
}

public Builder juridicalTime(Date juridicalTime) {
obj.setJuridicalTime(juridicalTime);
return this;
}

public Builder agentName(String agentName) {
obj.setAgentName(agentName);
return this;
@@ -520,13 +334,8 @@ public class FirmInfoTemp implements Serializable {
return this;
}

public Builder realnameCheck(String realnameCheck) {
obj.setRealnameCheck(realnameCheck);
return this;
}

public Builder firmStatus(String firmStatus) {
obj.setFirmStatus(firmStatus);
public Builder status(String status) {
obj.setStatus(status);
return this;
}

@@ -587,32 +396,19 @@ public class FirmInfoTemp implements Serializable {

public enum Column {
uniqueid("uniqueid", "uniqueid", "VARCHAR", false),
openId("open_id", "openId", "VARCHAR", false),
businessLicenseUrl("business_license_url", "businessLicenseUrl", "VARCHAR", false),
orgCodeUrl("org_code_url", "orgCodeUrl", "VARCHAR", false),
juridicalIdcardFrontUrl("juridical_idcard_front_url", "juridicalIdcardFrontUrl", "VARCHAR", false),
juridicalIdcardBackUrl("juridical_idcard_back_url", "juridicalIdcardBackUrl", "VARCHAR", false),
juridicalTmpIdUrl("juridical_tmp_id_url", "juridicalTmpIdUrl", "VARCHAR", false),
firmName("firm_name", "firmName", "VARCHAR", false),
firmBusRegNum("firm_bus_reg_num", "firmBusRegNum", "VARCHAR", false),
firmSocCreCode("firm_soc_cre_code", "firmSocCreCode", "VARCHAR", false),
firmAddress("firm_addr", "firmAddress", "VARCHAR", false),
firmOrgCode("firm_org_code", "firmOrgCode", "VARCHAR", false),
firmTaxRegCertCode("firm_tax_reg_cert_code", "firmTaxRegCertCode", "VARCHAR", false),
firmBusScope("firm_bus_scope", "firmBusScope", "VARCHAR", false),
firmBusTime("firm_bus_time", "firmBusTime", "TIMESTAMP", false),
juridicalNationality("juridical_nationality", "juridicalNationality", "VARCHAR", false),
juridicalName("juridical_name", "juridicalName", "VARCHAR", false),
juridicalPhone("juridical_phone", "juridicalPhone", "VARCHAR", false),
juridicalIdcard("juridical_idcard", "juridicalIdcard", "VARCHAR", false),
juridicalTime("juridical_time", "juridicalTime", "TIMESTAMP", false),
agentName("agent_name", "agentName", "VARCHAR", false),
agentIdcard("agent_idcard", "agentIdcard", "VARCHAR", false),
agentTime("agent_time", "agentTime", "TIMESTAMP", false),
firmPhone("firm_phone", "firmPhone", "VARCHAR", false),
firmEmail("firm_email", "firmEmail", "VARCHAR", false),
realnameCheck("realname_check", "realnameCheck", "CHAR", false),
firmStatus("firm_status", "firmStatus", "VARCHAR", false),
status("firm_status", "status", "VARCHAR", false),
juridicalRealnameCheck("juridical_realname_check", "juridicalRealnameCheck", "CHAR", false),
agentPhone("agent_phone", "agentPhone", "VARCHAR", false),
channel("channel", "channel", "VARCHAR", false),


+ 202
- 1102
customer/src/main/java/com/trust/ywx/customer/dao/po/FirmInfoTempExample.java
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 2
- 1
customer/src/main/java/com/trust/ywx/customer/service/manager/TempFirmManagerService.java Datei anzeigen

@@ -20,9 +20,10 @@ public interface TempFirmManagerService {
/**
* 添加临时客户
* 互联网医院通过开放平台自注册临时客户,会在firm_info_temp表生成client_id
* 返回clientId
*
*/
boolean add(TempFirmParam param) throws BizException;
String add(TempFirmParam param) throws BizException;

/**
* 更新临时客户


+ 56
- 4
customer/src/main/java/com/trust/ywx/customer/service/manager/impl/FirmManagerServiceImpl.java Datei anzeigen

@@ -1,7 +1,11 @@
package com.trust.ywx.customer.service.manager.impl;

import com.trust.ywx.customer.common.enu.CaChannelEnum;
import com.trust.ywx.customer.common.enu.CommonStatusEnum;
import com.trust.ywx.customer.common.enu.FirmErrEum;
import com.trust.ywx.customer.common.enu.FirmStatusEnum;
import com.trust.ywx.customer.commons.UniqueIdUtils;
import com.trust.ywx.customer.commons.ValidateUtil;
import com.trust.ywx.customer.dao.FirmExtendDao;
import com.trust.ywx.customer.dao.TrustFirmDao;
import com.trust.ywx.customer.dao.po.FirmInfo;
@@ -9,6 +13,7 @@ import com.trust.ywx.customer.common.model.manager.request.TrustFirmParam;
import com.trust.ywx.customer.common.model.manager.response.TrustFirmDto;
import com.trust.ywx.customer.common.exception.BizException;
import com.trust.ywx.customer.service.manager.FirmManagerService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionStatus;
@@ -64,8 +69,55 @@ public class FirmManagerServiceImpl implements FirmManagerService {
return doAddTrust(param);
}

private void checkParam(TrustFirmParam param) {
//TODO
private void checkParam(TrustFirmParam param) throws BizException {
if (StringUtils.isBlank(param.getClientId())) {
throw new BizException(FirmErrEum.FIRM_CLIENT_ID_NULL);
}
if (StringUtils.isBlank(param.getAppSecret())) {
throw new BizException(FirmErrEum.FIRM_APP_SECRET_NULL);
}
if (StringUtils.isBlank(param.getFirmName())) {
throw new BizException(FirmErrEum.FIRM_NAME_NULL);
}
if (StringUtils.isNotEmpty(param.getFirmName()) && param.getFirmName().length() > 30) {
throw new BizException(FirmErrEum.FIRM_NAME_TOO_LONG);
}
if (StringUtils.isBlank(param.getFirmPerson())) {
throw new BizException(FirmErrEum.FIRM_PERSON);
}
if (!ValidateUtil.checkMobile(param.getFirmPhone())) {
throw new BizException(FirmErrEum.FIRM_PHONE);
}

if (StringUtils.isBlank(param.getClientOrgCode())) {
throw new BizException(FirmErrEum.CLIENT_ORG_CODE_NULL);
}

if ("Y".equals(param.getSmsCustomize()) && StringUtils.isNotBlank(param.getSmsCustomizeContent())
&& param.getSmsCustomizeContent().length() > 101) {
throw new BizException(FirmErrEum.FIRM_SMS_CUSTOMIZECONTENT_TOOLONG);
}
// if (!StringUtils.isBlank(param.getDoctorProductType()) && !publicProductType.equals("SDK")
// && !publicProductType.equals("H5")) {
// throw new BizException(GlobalExcpEnum.PARAM_ERROR);
// }
/*cachannel校验*/
if(param.getCaChannel()!=null&& org.apache.commons.lang3.StringUtils.isBlank(CaChannelEnum.getDes(param.getCaChannel()))){
throw new BizException(FirmErrEum.FIRM_CA_CHANNEL_ERR);
}

if (StringUtils.isBlank(param.getAppIcon())) {
if (param.getAppIcon().length() > 64 * 1024) {
throw new BizException(FirmErrEum.FIRM_ICON_TOOBIG);
}
}

if ((CommonStatusEnum.YES.getCode() == param.getTechSupport()) && param.getTechSupportInfo().length() > 300) {
throw new BizException(FirmErrEum.SUPPORT_INFO_TOOLONG);
}

// 其他属性枚举值范围校验 TODO

}

@Override
@@ -86,7 +138,7 @@ public class FirmManagerServiceImpl implements FirmManagerService {
}

/**
* 执行添加(包含事务)
* 执行添加
*
* @param param
* @return
@@ -113,8 +165,8 @@ public class FirmManagerServiceImpl implements FirmManagerService {
BeanUtils.copyProperties(param, firmInfo);
if (isAdd) {
firmInfo.setUniqueid(UniqueIdUtils.genrateUniqueId());
firmInfo.setStatus(FirmStatusEnum.FIRM_SUB_NORMAL.getCode());
}
firmInfo.setStatus(param.getFirmStatus());
// TODO 客户属性有几个属性在此表维护,以后要迁移至extend表。
firmInfo.setSendSms(param.getSmsSend() == null ? "N" : (param.getSmsSend() == 1 ? "Y" : "N"));
firmInfo.setStampType(param.getUserStampAuto() == null ? "0" : String.valueOf(param.getUserStampAuto()));


+ 66
- 21
customer/src/main/java/com/trust/ywx/customer/service/manager/impl/TempFirmManagerServiceImpl.java Datei anzeigen

@@ -1,7 +1,9 @@
package com.trust.ywx.customer.service.manager.impl;

import com.fiftyonetrust.common.redis.template.RedisRepository;
import com.trust.ywx.customer.common.enu.*;
import com.trust.ywx.customer.commons.UniqueIdUtils;
import com.trust.ywx.customer.commons.ValidateUtil;
import com.trust.ywx.customer.dao.TempFirmDao;
import com.trust.ywx.customer.dao.po.FirmInfoTemp;
import com.trust.ywx.customer.common.model.manager.request.TempFirmParam;
@@ -12,6 +14,8 @@ import com.trust.ywx.customer.service.manager.TempFirmManagerService;
import lombok.SneakyThrows;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
@@ -21,6 +25,7 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
* <pre></pre>
@@ -43,21 +48,24 @@ public class TempFirmManagerServiceImpl implements TempFirmManagerService {
@Resource
FirmManagerService firmManagerService;


@Override
public boolean add(TempFirmParam param) throws BizException {
public String add(TempFirmParam param) throws BizException {
// 参数校验
//checkParam(param);
checkParam(param,true);
// 业务校验
checkBiz(param);
checkBiz(param,true);
// 入库
return doAddTemp(param);
}

@Override
@CacheEvict(cacheNames = "firm",key = "'temp:'+#param.clientId")
public boolean update(TempFirmParam param) throws BizException {
// 参数校验
//checkParam(param);
checkParam(param,false);
// 业务校验
checkBiz(param);
checkBiz(param,false);
// 入库
return doUpdateTemp(param);
}
@@ -69,7 +77,6 @@ public class TempFirmManagerServiceImpl implements TempFirmManagerService {
if (null == tempFirm) {
throw new BizException(FirmErrEum.FIRM_NOT_EXIST);
}

// 封装可信客户参数
TrustFirmParam trustFirmParam = buildTrustFirmParam(tempFirm);

@@ -92,6 +99,7 @@ public class TempFirmManagerServiceImpl implements TempFirmManagerService {
@Override
public boolean delete(String clientId) {
// fixme 此处应该为物理删除,否则客户在此添加时 客户名称就重复了
tempFirmDao.deleteByClientId(clientId);
return true;
}

@@ -100,18 +108,33 @@ public class TempFirmManagerServiceImpl implements TempFirmManagerService {
return tempFirmDao.update(temp)==1;
}

private void checkBiz(TempFirmParam param) throws BizException {
private void checkBiz(TempFirmParam param,boolean isAdd) throws BizException {
// clientId
if(!isAdd){
FirmInfoTemp temp = tempFirmDao.getByClientId(param.getClientId());
if(null == temp){
throw new BizException(FirmErrEum.FIRM_NOT_EXIST);
}
}
// firmName冲突校验
List<FirmInfoTemp> list = tempFirmDao.getListByFirmName(param.getFirmName());
if (null != list && list.size() > 0) {
throw new BizException(FirmErrEum.FIRM_NAME_CHECK_ERR);
if (isAdd) {
throw new BizException(FirmErrEum.FIRM_NAME_CHECK_ERR);
} else {
for (FirmInfoTemp temp:list) {
if (!Objects.equals(temp.getClientId(),param.getClientId())) {
throw new BizException(FirmErrEum.FIRM_NAME_CHECK_ERR);
}
}
}
}
}

private boolean doAddTemp(TempFirmParam param) {
private String doAddTemp(TempFirmParam param) {
FirmInfoTemp temp = convertToTempFirm(param, true);
tempFirmDao.insert(temp);
return true;
return temp.getClientId();

}

@@ -125,8 +148,7 @@ public class TempFirmManagerServiceImpl implements TempFirmManagerService {
temp.setClientId(param.getClientId());
}
temp.setFirmOrgCode(param.getFirmOrgCode());
temp.setFirmStatus(TempFirmStatusEnum.TEMP_UNAUTHEN.getCode() + "");
temp.setJuridicalName(param.getFirmPerson());
temp.setStatus(TempFirmStatusEnum.TEMP_UNAUTHEN.getCode() + "");
if (param.getChannelApp() != null && true == param.getChannelApp()
&& param.getChannelSdk() != null && true == param.getChannelSdk()) {
temp.setChannel("2");
@@ -161,13 +183,7 @@ public class TempFirmManagerServiceImpl implements TempFirmManagerService {

private TrustFirmParam buildTrustFirmParam(FirmInfoTemp temp) {
TrustFirmParam trustFirmParam = new TrustFirmParam();
trustFirmParam.setFirmPerson(temp.getFirmPerson()); //厂商联系人 (不是法人)
trustFirmParam.setFirmName(temp.getFirmName());
trustFirmParam.setFirmEmail(temp.getFirmEmail());
String phone = StringUtils.isBlank(temp.getJuridicalPhone()) ? temp.getFirmPhone() :
temp.getJuridicalPhone();
trustFirmParam.setFirmPhone(phone);
trustFirmParam.setFirmAddress(temp.getFirmAddress());
BeanUtils.copyProperties(temp,trustFirmParam);
trustFirmParam.setClientOrgCode(temp.getFirmOrgCode());
trustFirmParam.setAgentSaleId(temp.getAgentSaleId());
trustFirmParam.setAppIcon(temp.getFirmLogo());
@@ -186,9 +202,9 @@ public class TempFirmManagerServiceImpl implements TempFirmManagerService {
trustFirmParam.setDoctorProductType(doctorProTypeList);
trustFirmParam.setCertAlg("RSA");
trustFirmParam.setAppSecret(UniqueIdUtils.generateAppSecret());
// TODO 什么时候审核临时客户会携带clientId??
String clientId = null;
if (StringUtils.isBlank(temp.getClientId())) {
// fixme 设么时候会出现这种情况?
clientId = UniqueIdUtils.generateClientId();
} else {
clientId = temp.getClientId();
@@ -200,7 +216,6 @@ public class TempFirmManagerServiceImpl implements TempFirmManagerService {
trustFirmParam.setUserStampType(CommonStatusEnum.YES.getCode());
// 信步云默认
trustFirmParam.setCertAgency("1");
trustFirmParam.setFirmStatus(FirmStatusEnum.FIRM_SUB_NORMAL.getCode());
trustFirmParam.setSmsSend(CommonStatusEnum.YES.getCode());
String channel = temp.getChannel();
if ("1".equals(channel) || "2".equals(channel)) {
@@ -219,4 +234,34 @@ public class TempFirmManagerServiceImpl implements TempFirmManagerService {
return trustFirmParam;
}


/**
* 参数校验
* @param param
* @param isAdd
*/
private void checkParam(TempFirmParam param, boolean isAdd) throws BizException {
if (!isAdd && StringUtils.isBlank(param.getClientId())) {
throw new BizException(FirmErrEum.FIRM_CLIENT_ID_NULL);
}
if (StringUtils.isBlank(param.getFirmName())) {
throw new BizException(FirmErrEum.FIRM_NAME_NULL);
}
if (StringUtils.isNotEmpty(param.getFirmName()) && param.getFirmName().length() > 30) {
throw new BizException(FirmErrEum.FIRM_NAME_TOO_LONG);
}
// if (StringUtils.isBlank(param.getFirmPerson())) {
// throw new BizException(FirmErrEum.FIRM_PERSON);
// }
// if (!ValidateUtil.checkMobile(param.getFirmPhone())) {
// throw new BizException(FirmErrEum.FIRM_PHONE);
// }
// if(!ValidateUtil.checkEmail(param.getFirmEmail())){
// throw new BizException(FirmErrEum.EMAIL);
// }
// 待补充

}


}

+ 11
- 16
customer/src/main/java/com/trust/ywx/customer/service/query/FirmQueryService.java Datei anzeigen

@@ -1,12 +1,12 @@
package com.trust.ywx.customer.service.query;

import com.fiftyonetrust.common.model.result.PageList;
import com.trust.ywx.customer.common.model.manager.response.TrustFirmDto;
import com.trust.ywx.customer.common.model.query.request.SearchCrmFirmParam;
import com.trust.ywx.customer.common.model.query.request.SearchFirmParam;
import com.trust.ywx.customer.common.model.query.request.SearchTrustFirmParam;
import com.trust.ywx.customer.common.model.manager.response.TempFirmDto;
import com.trust.ywx.customer.common.model.query.response.CrmFirmDto;
import com.trust.ywx.customer.common.model.PageBean;

import java.util.List;
import java.util.Map;
@@ -26,19 +26,13 @@ import java.util.Map;
public interface FirmQueryService {

//-------------------------可信客户--------------------
/**
* 获取可信客户列表 (fixme 量大的话,不应该提供一次返回全量数据的接口)
* @param param
* @return
*/
List<TrustFirmDto> getTrustFirmList(SearchTrustFirmParam param);

/**
* 获取可信客户列表 (分页)
* @param param
* @return
*/
PageList<List<TrustFirmDto>> getTrustFirmListWithPage(SearchTrustFirmParam param);
PageBean<TrustFirmDto> getTrustFirmList(SearchTrustFirmParam param);

/**
* 获取可信客户详情 (不包括证书和厂商图标信息)
@@ -46,6 +40,7 @@ public interface FirmQueryService {
* @return
*/
TrustFirmDto getTrustFirm(String clientId);

TrustFirmDto getTrustFirmWithBLOBs(String clientId);

/**
@@ -55,13 +50,6 @@ public interface FirmQueryService {
Map<String,String> getAllProp(String clientId);

/**
* 根据属性值获取客户列表
* fixme 要不要提供这个接口呢?
* 例如:白名单 感觉最好是明确获取白名单的接口
*/
// List<TrustFirmDto> getListByProp(String propName,String propValue);

/**
* 查询客户白名单
* @param firmName
* @return
@@ -72,8 +60,15 @@ public interface FirmQueryService {
/**
* 获取待审核客户列表
* @param param
* @return
*/
PageBean<TempFirmDto> getTempFirmList(SearchFirmParam param);
/**
* 获取待审核客户详情
* @param clientId
* @return
*/
List<TempFirmDto> getTempFirmList(SearchFirmParam param);
TempFirmDto getTempFirmByClientId(String clientId);


//-------------------------北京CA客户------------------------


customer/src/main/java/com/trust/ywx/customer/service/impl/FirmQueryServiceImpl.java → customer/src/main/java/com/trust/ywx/customer/service/query/impl/FirmQueryServiceImpl.java Datei anzeigen

@@ -1,15 +1,14 @@
package com.trust.ywx.customer.service.impl;
package com.trust.ywx.customer.service.query.impl;

import com.fiftyonetrust.common.model.result.Page;
import com.fiftyonetrust.common.model.result.PageList;
import com.fiftyonetrust.common.redis.template.RedisRepository;
import com.trust.ywx.customer.common.enu.FirmProperEnum;
import com.trust.ywx.customer.common.enu.NetworkTypeEnum;
import com.trust.ywx.customer.dao.DoctorProductTypeDao;
import com.trust.ywx.customer.dao.TrustFirmDao;
import com.trust.ywx.customer.dao.FirmExtendDao;
import com.trust.ywx.customer.dao.FirmGroupDao;
import com.trust.ywx.customer.common.model.PageBean;
import com.trust.ywx.customer.common.model.PageBeanUtil;
import com.trust.ywx.customer.dao.*;
import com.trust.ywx.customer.dao.po.FirmInfo;
import com.trust.ywx.customer.dao.po.FirmInfoExtend;
import com.trust.ywx.customer.dao.po.FirmInfoTemp;
import com.trust.ywx.customer.dao.po.FirmUsercertChannel;
import com.trust.ywx.customer.common.model.manager.response.TrustFirmDto;
import com.trust.ywx.customer.common.model.query.request.SearchCrmFirmParam;
@@ -18,9 +17,11 @@ import com.trust.ywx.customer.common.model.query.request.SearchTrustFirmParam;
import com.trust.ywx.customer.common.model.manager.response.TempFirmDto;
import com.trust.ywx.customer.common.model.query.response.CrmFirmDto;
import com.trust.ywx.customer.service.query.FirmQueryService;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

@@ -30,7 +31,7 @@ import java.util.*;
* <pre></pre>
*
* @文件名称: FirmQueryServiceImpl.java
* @包 路 径: com.trust.ywx.customer.service.impl
* @包 路 径: com.trust.ywx.customer.service.query.impl
* @Copyright:北京数字医信责任有限公司 (C) 2022 *
* @Description:
* @Version: V1.0
@@ -38,139 +39,42 @@ import java.util.*;
* @Date:2022/6/15 18:43
* @Modify:
*/
@Service
@CacheConfig(cacheNames = {"firm"})
@Service("firmQueryService")
public class FirmQueryServiceImpl implements FirmQueryService {
@Autowired
private TrustFirmDao trustFirmDao;
@Autowired
private TempFirmDao tempFirmDao;
@Autowired
private FirmGroupDao firmGroupDao;
@Autowired
private FirmExtendDao firmExtendDao;
@Autowired
private DoctorProductTypeDao doctorProductTypeDao;

@Override
public List<TrustFirmDto> getTrustFirmList(SearchTrustFirmParam param) {
return doSearch(param,false);
}

@Override
public PageList<List<TrustFirmDto>> getTrustFirmListWithPage(SearchTrustFirmParam param) {
List<TrustFirmDto> dtoList = doSearch(param,true);

// fixme 组装好麻烦,需要改进下
PageList pageList = new PageList();
pageList.setItems(dtoList);
Page page = new Page();
page.setPageNo(param.getPageNo());
page.setPageSize(param.getPageSize());
page.setTotal(dtoList.size());
pageList.setPage(page);
return pageList;
}


private TrustFirmDto converPoToDto(FirmInfo po) {
if (null == po) {
return null;
}
TrustFirmDto dto = new TrustFirmDto();
BeanUtils.copyProperties(po, dto);

// TODO 差异属性转换
return dto;
}

@Override
public TrustFirmDto getTrustFirm(String clientId) {
FirmInfo po = trustFirmDao.getFrimByClientId(clientId);
return converPoToDto(po);
}

@Override
public TrustFirmDto getTrustFirmWithBLOBs(String clientId) {
FirmInfo po = trustFirmDao.getFrimByClientId(clientId);
return converPoToDto(po);
}

@Override
public Map<String, String> getAllProp(String clientId) {
if (StringUtils.isEmpty(clientId)) {
return new HashMap<>();
}
Map<String, String> map = new HashMap<>(64);
// 1、从firm_info_extend获取全量属性
List<FirmInfoExtend> extendList = firmExtendDao.getListByClientId(clientId);
for (FirmInfoExtend extendPo : extendList) {
map.put(extendPo.getPropName(), extendPo.getPropValue());
}

//2、从firm_usercert_channel 获取医师产品形态属性 fixme 以后要去掉
List<FirmUsercertChannel> doctorProductList = doctorProductTypeDao.getByClientId(clientId);

for (FirmUsercertChannel doctorPo : doctorProductList) {
if(doctorPo.getChannelType()==0){
map.put(FirmProperEnum.DOCTOR_PRODUCT_APP.getProperName(), doctorPo.getChannelType() + "");
}
if(doctorPo.getChannelType()==1){
map.put(FirmProperEnum.DOCTOR_PRODUCT_SDK.getProperName(), doctorPo.getChannelType() + "");
}
}
return map;
}

@Override
public List<TrustFirmDto> getFirmWhite(String firmName) {
return null;
}

@Override
public List<TempFirmDto> getTempFirmList(SearchFirmParam param) {
return null;
}

@Autowired
RedisRepository redisRepository;
@Override
public List<CrmFirmDto> getCrmFirmList(SearchCrmFirmParam param) {
return null;
}

private List<String> getClientIdListByProp(String propName, Integer propValue, List<String> clientIdList) {
String convertPropValue = "";
if (Objects.equals(propName, FirmProperEnum.DOCTOR_PRODUCT_SDK.getProperName())
||Objects.equals(propName, FirmProperEnum.DOCTOR_PRODUCT_APP.getProperName())) {
//fixme,目前医师产品形态单独存储在firm_usercert_channel表,后期挪到firm_info_extends表
return doctorProductTypeDao.getClientIdByProp(clientIdList, propValue);
} else {
// 其他属性都在firm_info_extends表
if (Objects.equals(propName, FirmProperEnum.NETWORK_TYPE.getProperName())) {
convertPropValue = NetworkTypeEnum.getNameOfCode(propValue);
} else {
convertPropValue = String.valueOf(propValue);
}
return firmExtendDao.getByPropsAndClientId(propName, convertPropValue, clientIdList);
}
}

private List<TrustFirmDto> doSearch(SearchTrustFirmParam param , boolean isPage) {
public PageBean<TrustFirmDto> getTrustFirmList(SearchTrustFirmParam param) {
List<String> clientIdList = new ArrayList<>();

// clientId筛选
if (StringUtils.isNotEmpty(param.getClientId())) {
FirmInfo firmInfo = trustFirmDao.getFrimByClientId(param.getClientId());
if (null == firmInfo) {
return Arrays.asList();
return PageBeanUtil.getEmptyPage(param.getPageNo(),param.getPageSize());
}
// 增加项目状态的判断
if (null != param.getProjectStatus() && !Objects.equals(firmInfo.getProjectStatus(), param.getProjectStatus())) {
return Arrays.asList();
return PageBeanUtil.getEmptyPage(param.getPageNo(),param.getPageSize());
}
// 增加实施人员的判断
if(null!=param.getTechId() && !Objects.equals(firmInfo.getTechPersonId(),param.getTechId())){
return Arrays.asList();
if (null != param.getTechId() && !Objects.equals(firmInfo.getTechPersonId(), param.getTechId())) {
return PageBeanUtil.getEmptyPage(param.getPageNo(),param.getPageSize());
}
// 增加销售人员的判断
if(null!=param.getSaleId() && !Objects.equals(firmInfo.getSalePersonId(),param.getTechId())){
return Arrays.asList();
if (null != param.getSaleId() && !Objects.equals(firmInfo.getSalePersonId(), param.getTechId())) {
return PageBeanUtil.getEmptyPage(param.getPageNo(),param.getPageSize());
}

clientIdList.add(param.getClientId());
@@ -184,7 +88,7 @@ public class FirmQueryServiceImpl implements FirmQueryService {
} else {
clientIdList.retainAll(groupClientIdList);
if (CollectionUtils.isEmpty(clientIdList)) {
return Arrays.asList();
return PageBeanUtil.getEmptyPage(param.getPageNo(),param.getPageSize());
}
}
}
@@ -200,7 +104,7 @@ public class FirmQueryServiceImpl implements FirmQueryService {
// 与clientIdList求并集
clientIdList.retainAll(subClientIdList);
if (CollectionUtils.isEmpty(clientIdList)) {
return Arrays.asList();
return PageBeanUtil.getEmptyPage(param.getPageNo(),param.getPageSize());
}

if (StringUtils.isNotEmpty(param.getClientId())) {
@@ -211,7 +115,7 @@ public class FirmQueryServiceImpl implements FirmQueryService {
// 与clientIdList求并集
clientIdList.retainAll(subClientIdList);
if (CollectionUtils.isEmpty(clientIdList)) {
return Arrays.asList();
return PageBeanUtil.getEmptyPage(param.getPageNo(),param.getPageSize());
}
}

@@ -223,7 +127,7 @@ public class FirmQueryServiceImpl implements FirmQueryService {
// 与clientIdList求并集
clientIdList.retainAll(subClientIdList);
if (CollectionUtils.isEmpty(clientIdList)) {
return Arrays.asList();
return PageBeanUtil.getEmptyPage(param.getPageNo(),param.getPageSize());
}
}
if (null != param.getChargingMode()) {
@@ -231,7 +135,7 @@ public class FirmQueryServiceImpl implements FirmQueryService {
// 与clientIdList求并集
clientIdList.retainAll(subClientIdList);
if (CollectionUtils.isEmpty(clientIdList)) {
return Arrays.asList();
return PageBeanUtil.getEmptyPage(param.getPageNo(),param.getPageSize());
}
}
if (null != param.getPublicProductType()) {
@@ -239,27 +143,141 @@ public class FirmQueryServiceImpl implements FirmQueryService {
// 与clientIdList求并集
clientIdList.retainAll(subClientIdList);
if (CollectionUtils.isEmpty(clientIdList)) {
return Arrays.asList();
return PageBeanUtil.getEmptyPage(param.getPageNo(),param.getPageSize());
}
}
List<FirmInfo> firmList = null;
if (isPage) {
firmList = trustFirmDao.getListByIds(clientIdList, 100000, 0);
} else {
PageBean<FirmInfo> page = null;

if(CollectionUtils.isEmpty(clientIdList)){
page = trustFirmDao.getList(param.getPageNo(),param.getPageSize());
}else{
if (clientIdList.size() < param.getPageSize() * param.getPageNo()) {
return Arrays.asList();
return PageBeanUtil.getEmptyPage(param.getPageNo(),param.getPageSize());
}
firmList = trustFirmDao.getListByIds(clientIdList, param.getPageSize(), param.getPageNo());
page = trustFirmDao.getListByIds(clientIdList, param.getPageNo(),param.getPageSize());
}

List<TrustFirmDto> dtoList = new ArrayList<>(firmList.size());
if (CollectionUtils.isEmpty(firmList)) {
return Arrays.asList();
if (CollectionUtils.isEmpty(page.getList())) {
return PageBeanUtil.getEmptyPage(param.getPageNo(),param.getPageSize());
}
for (FirmInfo po : firmList) {
List<TrustFirmDto> dtoList = new ArrayList<>(page.getList().size());
for (FirmInfo po : page.getList()) {
TrustFirmDto dto = converPoToDto(po);
dtoList.add(dto);
}
return dtoList;

PageBean pageBean = new PageBean(dtoList);
pageBean.setPageNum(page.getPageNum());
pageBean.setPageSize(page.getPageSize());
pageBean.setTotal(page.getTotal());
pageBean.setPages(page.getPages());
return pageBean;
}


private TrustFirmDto converPoToDto(FirmInfo po) {
if (null == po) {
return null;
}
TrustFirmDto dto = new TrustFirmDto();
BeanUtils.copyProperties(po, dto);

// TODO 差异属性转换
return dto;
}

@Override
public TrustFirmDto getTrustFirm(String clientId) {
FirmInfo po = trustFirmDao.getFrimByClientId(clientId);
return converPoToDto(po);
}

@Override
public TrustFirmDto getTrustFirmWithBLOBs(String clientId) {
FirmInfo po = trustFirmDao.getFrimByClientId(clientId);
return converPoToDto(po);
}

@Override
public Map<String, String> getAllProp(String clientId) {
if (StringUtils.isEmpty(clientId)) {
return new HashMap<>();
}
Map<String, String> map = new HashMap<>(64);
// 1、从firm_info_extend获取全量属性
List<FirmInfoExtend> extendList = firmExtendDao.getListByClientId(clientId);
for (FirmInfoExtend extendPo : extendList) {
map.put(extendPo.getPropName(), extendPo.getPropValue());
}

//2、从firm_usercert_channel 获取医师产品形态属性 fixme 以后要去掉
List<FirmUsercertChannel> doctorProductList = doctorProductTypeDao.getByClientId(clientId);

for (FirmUsercertChannel doctorPo : doctorProductList) {
if (doctorPo.getChannelType() == 0) {
map.put(FirmProperEnum.DOCTOR_PRODUCT_APP.getProperName(), doctorPo.getChannelType() + "");
}
if (doctorPo.getChannelType() == 1) {
map.put(FirmProperEnum.DOCTOR_PRODUCT_SDK.getProperName(), doctorPo.getChannelType() + "");
}
}
return map;
}

@Override
public List<TrustFirmDto> getFirmWhite(String firmName) {
return null;
}

@Override
public PageBean<TempFirmDto> getTempFirmList(SearchFirmParam param) {
return tempFirmDao.getListByParam(param);
}

@Override
@Cacheable(key = "'temp:'+#clientId")
public TempFirmDto getTempFirmByClientId(String clientId) {
FirmInfoTemp tempPo = tempFirmDao.getByClientId(clientId);
TempFirmDto dto =converTempPoToDto(tempPo);
return dto;
}

private TempFirmDto converTempPoToDto(FirmInfoTemp tempPo) {
TempFirmDto dto = new TempFirmDto();
BeanUtils.copyProperties(tempPo,dto);
if(StringUtils.isNotBlank(tempPo.getChannel())){
if("0".equals(tempPo.getChannel())){
dto.setChannelApp(true);
}else if("1".equals(tempPo.getChannel())){
dto.setChannelSdk(true);
}else if("2".equals(tempPo.getChannel())){
dto.setChannelApp(true);
dto.setChannelSdk(true);
}
}
return dto;
}

@Override
public List<CrmFirmDto> getCrmFirmList(SearchCrmFirmParam param) {
return null;
}

private List<String> getClientIdListByProp(String propName, Integer propValue, List<String> clientIdList) {
String convertPropValue = "";
if (Objects.equals(propName, FirmProperEnum.DOCTOR_PRODUCT_SDK.getProperName())
|| Objects.equals(propName, FirmProperEnum.DOCTOR_PRODUCT_APP.getProperName())) {
//fixme,目前医师产品形态单独存储在firm_usercert_channel表,后期挪到firm_info_extends表
return doctorProductTypeDao.getClientIdByProp(clientIdList, propValue);
} else {
// 其他属性都在firm_info_extends表
if (Objects.equals(propName, FirmProperEnum.NETWORK_TYPE.getProperName())) {
convertPropValue = NetworkTypeEnum.getNameOfCode(propValue);
} else {
convertPropValue = String.valueOf(propValue);
}
return firmExtendDao.getByPropsAndClientId(propName, convertPropValue, clientIdList);
}
}

}

customer/src/main/java/com/trust/ywx/customer/service/impl/FirmQueryServiceImpl_bak.java → customer/src/main/java/com/trust/ywx/customer/service/query/impl/FirmQueryServiceImpl_bak.java Datei anzeigen

@@ -1,4 +1,4 @@
//package com.trust.ywx.customer.service.impl;
//package com.trust.ywx.customer.service.query.impl;
//
//import com.fiftyonetrust.common.model.result.Page;
//import com.fiftyonetrust.common.model.result.PageList;
@@ -32,7 +32,7 @@
// * <pre></pre>
// *
// * @文件名称: FirmQueryServiceImpl.java
// * @包 路 径: com.trust.ywx.customer.service.impl
// * @包 路 径: com.trust.ywx.customer.service.query.impl
// * @Copyright:北京数字医信责任有限公司 (C) 2022 *
// * @Description:
// * @Version: V1.0

customer/src/main/resources/dev/jdbc.properties → customer/src/main/resources.dev/jdbc.properties Datei anzeigen

@@ -1,3 +1,3 @@
jdbc.url=jdbc:mysql://192.168.126.22:3306/tms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=true
jdbc.url=jdbc:mysql://192.168.126.22:3306/tms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8
jdbc.username=root
jdbc.password=tiger

+ 85
- 0
customer/src/main/resources.dev/logback.xml Datei anzeigen

@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<!--加载外部配置文件-->
<!--<property resource="application.properties"/>-->
<!--日志文件输出路径-->
<property name="LOG_DIRECTOR" value="./logs"/>
<property name="LOG_PREFIX" value="@application.name@"/>
<!--单日志文件大小 单位 KB、MB或者GB-->
<property name="MAX_FILE_SIZE" value="100MB"/>
<!--最大日志历史记录 如果按日轮转 则该数值单位为日-->
<property name="MAX_HISTORY" value="15"/>
<!--日志文件总大小 单位 KB、MB或者GB-->
<property name="TOTAL_SIZE_CAP" value="5GB"/>
<!-- 格式化输出:%d 表示日期,%X{tid} SkWalking 链路追踪编号,%thread 表示线程名,%-5level:级别从左显示 5 个字符宽度,%msg:日志消息,%n是换行符 -->
<property name="PATTERN_DEFAULT"
value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%thread] %-40.40logger{39} : %m%n"/>

<!--日志文件-->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_DIRECTOR}/${LOG_PREFIX}.log</file>
<append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_DIRECTOR}/archive/${LOG_PREFIX}-%d.%i.zip</fileNamePattern>
<maxFileSize>${MAX_FILE_SIZE}</maxFileSize>
<maxHistory>${MAX_HISTORY}</maxHistory>
<totalSizeCap>${TOTAL_SIZE_CAP}</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>${PATTERN_DEFAULT}</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>

<!--日志文件 异步输出-->
<appender name="ASYNC_FILE" class="ch.qos.logback.classic.AsyncAppender">
<!--队列的最大容量,默认为 256-->
<queueSize>512</queueSize>
<appender-ref ref="FILE"/>
</appender>

<!--控制台日志输出-->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>

<!--控制台日志异步输出-->
<appender name="ASYNC_STDOUT" class="ch.qos.logback.classic.AsyncAppender">
<queueSize>512</queueSize>
<appender-ref ref="STDOUT"/>
</appender>

<!--日志文件-->
<appender name="ACCESS_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_DIRECTOR}/access.log</file>
<append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_DIRECTOR}/archive/access-%d.%i.zip</fileNamePattern>
<maxFileSize>${MAX_FILE_SIZE}</maxFileSize>
<maxHistory>${MAX_HISTORY}</maxHistory>
<totalSizeCap>${TOTAL_SIZE_CAP}</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>${PATTERN_DEFAULT}</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>

<logger name="accessDataLog" level="INFO" additivity="false">
<appender-ref ref="ACCESS_LOG_FILE"/>
</logger>

<!--常用日志-->
<logger name="java.sql" level="@log.level@"/>
<logger name="org.apache.ibatis" level="@log.level@"/>
<logger name="org.springframework" level="@log.level@"/>

<root level="@log.lever@">
<appender-ref ref="FILE"/>
<appender-ref ref="STDOUT"/>
</root>
</configuration>

customer/src/main/resources/dev/redis.properties → customer/src/main/resources.dev/redis.properties Datei anzeigen

@@ -1,13 +1,11 @@
ywq.cache-manager.configs[0].key=mr-admin
ywq.cache-manager.configs[0].key=ywx-customer
ywq.lock.lockerType=REDIS
spring.redis.database=5
spring.redis.database=0
spring.redis.host=192.168.126.22
spring.redis.port=6379
spring.redis.password=ywq@centos7
spring.redis.timeout=2000
spring.redis.pool.laxative=5
spring.redis.pool.maxillae=5
spring.redis.pool.laxative=64
spring.redis.pool.maxillae=64
spring.redis.pool.maxi=-1
spring.redis.pool.middle=1
user.root.name=root
user.root.passwd=root

+ 6
- 0
customer/src/main/resources.dev/server.properties Datei anzeigen

@@ -0,0 +1,6 @@
application.name=ywx-customer
log.level=DEBUG
server.port=8089

# dubbo register nacos
dubbo.registry.address.nacos=nacos.server:8848?namespace=dev

customer/src/main/resources/on/jdbc.properties → customer/src/main/resources.on/jdbc.properties Datei anzeigen


+ 4
- 0
customer/src/main/resources.on/pay.properties Datei anzeigen

@@ -0,0 +1,4 @@
pay.domain=http://pay.51trust.com
pay.clientId=2022032910290110
pay.clientSecret=7DEDEE048AEB908EE70239D3108A66BA
wx.domain=http://mr.51trust.com

customer/src/main/resources/on/redis.properties → customer/src/main/resources.on/redis.properties Datei anzeigen

@@ -1,4 +1,4 @@
ywq.cache-manager.configs[0].key=mr-admin
ywq.cache-manager.configs[0].key=mr-cloud
ywq.lock.lockerType=REDIS
spring.redis.database=5
spring.redis.host=r-2zetn1j21ge0njlzfn.redis.rds.aliyuncs.com
@@ -9,5 +9,3 @@ spring.redis.pool.laxative=64
spring.redis.pool.maxillae=64
spring.redis.pool.maxi=-1
spring.redis.pool.middle=1
user.root.name=root
user.root.passwd=root

+ 6
- 0
customer/src/main/resources.on/server.properties Datei anzeigen

@@ -0,0 +1,6 @@
application.name=ywx-customer
log.level=INFO
server.port=8089

cloud.host=hhttp://pubhos.51trust.com/mediAdmin
express.token=33dc06c00a39df7177cc45a5

+ 3
- 0
customer/src/main/resources.test/jdbc.properties Datei anzeigen

@@ -0,0 +1,3 @@
jdbc.url=jdbc:mysql://192.168.126.22:3306/tms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8
jdbc.username=root
jdbc.password=tiger

+ 85
- 0
customer/src/main/resources.test/logback.xml Datei anzeigen

@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<!--加载外部配置文件-->
<!--<property resource="application.properties"/>-->
<!--日志文件输出路径-->
<property name="LOG_DIRECTOR" value="./logs"/>
<property name="LOG_PREFIX" value="@application.name@"/>
<!--单日志文件大小 单位 KB、MB或者GB-->
<property name="MAX_FILE_SIZE" value="100MB"/>
<!--最大日志历史记录 如果按日轮转 则该数值单位为日-->
<property name="MAX_HISTORY" value="15"/>
<!--日志文件总大小 单位 KB、MB或者GB-->
<property name="TOTAL_SIZE_CAP" value="5GB"/>
<!-- 格式化输出:%d 表示日期,%X{tid} SkWalking 链路追踪编号,%thread 表示线程名,%-5level:级别从左显示 5 个字符宽度,%msg:日志消息,%n是换行符 -->
<property name="PATTERN_DEFAULT"
value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%thread] %-40.40logger{39} : %m%n"/>

<!--日志文件-->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_DIRECTOR}/${LOG_PREFIX}.log</file>
<append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_DIRECTOR}/archive/${LOG_PREFIX}-%d.%i.zip</fileNamePattern>
<maxFileSize>${MAX_FILE_SIZE}</maxFileSize>
<maxHistory>${MAX_HISTORY}</maxHistory>
<totalSizeCap>${TOTAL_SIZE_CAP}</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>${PATTERN_DEFAULT}</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>

<!--日志文件 异步输出-->
<appender name="ASYNC_FILE" class="ch.qos.logback.classic.AsyncAppender">
<!--队列的最大容量,默认为 256-->
<queueSize>512</queueSize>
<appender-ref ref="FILE"/>
</appender>

<!--控制台日志输出-->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>

<!--控制台日志异步输出-->
<appender name="ASYNC_STDOUT" class="ch.qos.logback.classic.AsyncAppender">
<queueSize>512</queueSize>
<appender-ref ref="STDOUT"/>
</appender>

<!--日志文件-->
<appender name="ACCESS_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_DIRECTOR}/access.log</file>
<append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_DIRECTOR}/archive/access-%d.%i.zip</fileNamePattern>
<maxFileSize>${MAX_FILE_SIZE}</maxFileSize>
<maxHistory>${MAX_HISTORY}</maxHistory>
<totalSizeCap>${TOTAL_SIZE_CAP}</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>${PATTERN_DEFAULT}</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>

<logger name="accessDataLog" level="INFO" additivity="false">
<appender-ref ref="ACCESS_LOG_FILE"/>
</logger>

<!--常用日志-->
<logger name="java.sql" level="@log.level@"/>
<logger name="org.apache.ibatis" level="@log.level@"/>
<logger name="org.springframework" level="@log.level@"/>

<root level="@log.lever@">
<appender-ref ref="FILE"/>
<appender-ref ref="STDOUT"/>
</root>
</configuration>

+ 11
- 0
customer/src/main/resources.test/redis.properties Datei anzeigen

@@ -0,0 +1,11 @@
ywq.cache-manager.configs[0].key=ywx-customer
ywq.lock.lockerType=REDIS
spring.redis.database=0
spring.redis.host=192.168.126.22
spring.redis.port=6379
spring.redis.password=ywq@centos7
spring.redis.timeout=2000
spring.redis.pool.laxative=64
spring.redis.pool.maxillae=64
spring.redis.pool.maxi=-1
spring.redis.pool.middle=1

customer/src/main/resources/dev/server.properties → customer/src/main/resources.test/server.properties Datei anzeigen

@@ -1,3 +1,3 @@
application.name=ywx-customer
log.level=DEBUG
server.port=7013
server.port=8089

+ 4
- 7
customer/src/main/resources/application.properties Datei anzeigen

@@ -1,18 +1,13 @@
# 应用名称
spring.application.name=ywx-customer

logging.level.com.trust.ywx.customer.dao=DEBUG
# 应用服务 WEB 访问端口
server.port=8089
spring.profiles.active=dev

# dubbo register nacos
dubbo.registry.address.nacos=nacos.server:8848?namespace=dev

spring.main.allow-bean-definition-overriding=true

########################## druid配置 ##########################
spring.datasource.url=jdbc:mysql://192.168.126.22:3306/tms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
jdbc.username=root
jdbc.password=tiger
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.initialSize=20
@@ -41,7 +36,9 @@ spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowS
spring.datasource.useGlobalDataSourceStat=true
########################################################

########################mybatis======================
mybatis.mapperLocations=classpath*:/mybatis/**/*.xml
datasource.dialect=com.github.pagehelper.dialect.helper.MySqlDialect





+ 0
- 2
customer/src/main/resources/dev/base.properties Datei anzeigen

@@ -1,2 +0,0 @@
application.name=ywx-customer
log.level=DEBUG

+ 35
- 22
customer/src/main/resources/generatorConfig.xml Datei anzeigen

@@ -82,40 +82,53 @@
</javaClientGenerator>

<!--表格实体配置-->
<table tableName="firm_group" domainObjectName="FirmGroup"
enableCountByExample="true" enableUpdateByExample="true"
enableSelectByExample="true" enableDeleteByExample="true">
<columnOverride column="is_del" property="isDel" javaType="Integer"></columnOverride>
<columnOverride column="firm_role" property="firmRole" javaType="Integer"></columnOverride>
<columnOverride column="group_num" property="groupId" ></columnOverride>
</table>
<!-- <table tableName="firm_group" domainObjectName="FirmGroup"-->
<!-- enableCountByExample="true" enableUpdateByExample="true"-->
<!-- enableSelectByExample="true" enableDeleteByExample="true">-->
<!-- <columnOverride column="is_del" property="isDel" javaType="Integer"></columnOverride>-->
<!-- <columnOverride column="firm_role" property="firmRole" javaType="Integer"></columnOverride>-->
<!-- <columnOverride column="group_num" property="groupId" ></columnOverride>-->
<!-- </table>-->
<table tableName="firm_info" domainObjectName="FirmInfo"
enableCountByExample="true" enableUpdateByExample="true"
enableSelectByExample="true" enableDeleteByExample="true">
<!-- <columnOverride column="firm_name" property="CustomerName"></columnOverride>-->
<!-- <property name="firm_name" value="CustomerName"/>-->
<ignoreColumn column="app_cert"></ignoreColumn>
<columnOverride column="status" property="status" javaType="Integer"></columnOverride>
</table>
<table tableName="firm_info_temp" domainObjectName="FirmInfoTemp"
enableCountByExample="true" enableUpdateByExample="true"
enableSelectByExample="true" enableDeleteByExample="true">
<columnOverride column="firm_status" property="status"></columnOverride>
<columnOverride column="firm_addr" property="firmAddress"></columnOverride>
<columnOverride column="firm_client_id" property="clientId"></columnOverride>
<ignoreColumn column="open_id"></ignoreColumn>
<ignoreColumn column="juridical_idcard_front_url"></ignoreColumn>
<ignoreColumn column="juridical_idcard_back_url"></ignoreColumn>
<ignoreColumn column="juridical_tmp_id_url"></ignoreColumn>
<ignoreColumn column="firm_bus_reg_num"></ignoreColumn>
<ignoreColumn column="firm_soc_cre_code"></ignoreColumn>
<ignoreColumn column="firm_tax_reg_cert_code"></ignoreColumn>
<ignoreColumn column="juridical_nationality"></ignoreColumn>
<ignoreColumn column="juridical_name"></ignoreColumn>
<ignoreColumn column="juridical_phone"></ignoreColumn>
<ignoreColumn column="juridical_idcard"></ignoreColumn>
<ignoreColumn column="juridical_time"></ignoreColumn>
<ignoreColumn column="realname_check"></ignoreColumn>
</table>
<table tableName="firm_oauth_token" domainObjectName="FirmOauthToken"
enableCountByExample="true" enableUpdateByExample="true"
enableSelectByExample="true" enableDeleteByExample="true">
</table>
<table tableName="firm_info_extend" domainObjectName="FirmInfoExtend"
enableCountByExample="true" enableUpdateByExample="true"
enableSelectByExample="true" enableDeleteByExample="true">
</table>
<!-- <table tableName="firm_oauth_token" domainObjectName="FirmOauthToken"-->
<!-- enableCountByExample="true" enableUpdateByExample="true"-->
<!-- enableSelectByExample="true" enableDeleteByExample="true">-->
<!-- </table>-->
<!-- <table tableName="firm_info_extend" domainObjectName="FirmInfoExtend"-->
<!-- enableCountByExample="true" enableUpdateByExample="true"-->
<!-- enableSelectByExample="true" enableDeleteByExample="true">-->
<!-- </table>-->

<table tableName="firm_usercert_channel" domainObjectName="FirmUsercertChannel"
enableCountByExample="true" enableUpdateByExample="true"
enableSelectByExample="true" enableDeleteByExample="true">
<columnOverride column="channel_type" property="channelType" javaType="Integer"></columnOverride>
</table>
<!-- <table tableName="firm_usercert_channel" domainObjectName="FirmUsercertChannel"-->
<!-- enableCountByExample="true" enableUpdateByExample="true"-->
<!-- enableSelectByExample="true" enableDeleteByExample="true">-->
<!-- <columnOverride column="channel_type" property="channelType" javaType="Integer"></columnOverride>-->
<!-- </table>-->

</context>
</generatorConfiguration>

+ 7
- 28
customer/src/main/resources/mybatis/mapper/FirmInfoMapper.xml Datei anzeigen

@@ -84,9 +84,6 @@
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.trust.ywx.customer.dao.po.FirmInfo">
<!-- 第三方应用证书 -->
<result column="app_cert" jdbcType="LONGVARCHAR" property="appCert" />
<!-- 第三方厂商图标 -->
<result column="app_icon" jdbcType="LONGVARCHAR" property="appIcon" />
</resultMap>
@@ -155,7 +152,7 @@
agent_sale_id, ca_channel, project_status, plat_app_id
</sql>
<sql id="Blob_Column_List">
app_cert, app_icon
app_icon
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.trust.ywx.customer.dao.po.FirmInfoExample" resultMap="ResultMapWithBLOBs">
select
@@ -231,7 +228,7 @@
sale_person_id, tech_person_id, create_time,
update_time, agent_client_id, agent_sale_id,
ca_channel, project_status, plat_app_id,
app_cert, app_icon)
app_icon)
values (#{uniqueid,jdbcType=VARCHAR}, #{clientId,jdbcType=VARCHAR}, #{firmPerson,jdbcType=VARCHAR},
#{appSecret,jdbcType=VARCHAR}, #{firmName,jdbcType=VARCHAR}, #{firmPhone,jdbcType=VARCHAR},
#{certAlg,jdbcType=VARCHAR}, #{firmAddress,jdbcType=VARCHAR}, #{note,jdbcType=VARCHAR},
@@ -241,7 +238,7 @@
#{salePersonId,jdbcType=VARCHAR}, #{techPersonId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{agentClientId,jdbcType=VARCHAR}, #{agentSaleId,jdbcType=VARCHAR},
#{caChannel,jdbcType=INTEGER}, #{projectStatus,jdbcType=INTEGER}, #{platAppId,jdbcType=INTEGER},
#{appCert,jdbcType=LONGVARCHAR}, #{appIcon,jdbcType=LONGVARCHAR})
#{appIcon,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective">
insert into firm_info
@@ -327,9 +324,6 @@
<if test="platAppId != null">
plat_app_id,
</if>
<if test="appCert != null">
app_cert,
</if>
<if test="appIcon != null">
app_icon,
</if>
@@ -416,9 +410,6 @@
<if test="platAppId != null">
#{platAppId,jdbcType=INTEGER},
</if>
<if test="appCert != null">
#{appCert,jdbcType=LONGVARCHAR},
</if>
<if test="appIcon != null">
#{appIcon,jdbcType=LONGVARCHAR},
</if>
@@ -514,9 +505,6 @@
<if test="record.platAppId != null">
plat_app_id = #{record.platAppId,jdbcType=INTEGER},
</if>
<if test="record.appCert != null">
app_cert = #{record.appCert,jdbcType=LONGVARCHAR},
</if>
<if test="record.appIcon != null">
app_icon = #{record.appIcon,jdbcType=LONGVARCHAR},
</if>
@@ -554,7 +542,6 @@
ca_channel = #{record.caChannel,jdbcType=INTEGER},
project_status = #{record.projectStatus,jdbcType=INTEGER},
plat_app_id = #{record.platAppId,jdbcType=INTEGER},
app_cert = #{record.appCert,jdbcType=LONGVARCHAR},
app_icon = #{record.appIcon,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@@ -674,9 +661,6 @@
<if test="platAppId != null">
plat_app_id = #{platAppId,jdbcType=INTEGER},
</if>
<if test="appCert != null">
app_cert = #{appCert,jdbcType=LONGVARCHAR},
</if>
<if test="appIcon != null">
app_icon = #{appIcon,jdbcType=LONGVARCHAR},
</if>
@@ -711,7 +695,6 @@
ca_channel = #{caChannel,jdbcType=INTEGER},
project_status = #{projectStatus,jdbcType=INTEGER},
plat_app_id = #{platAppId,jdbcType=INTEGER},
app_cert = #{appCert,jdbcType=LONGVARCHAR},
app_icon = #{appIcon,jdbcType=LONGVARCHAR}
where uniqueid = #{uniqueid,jdbcType=VARCHAR}
</update>
@@ -746,7 +729,7 @@
where uniqueid = #{uniqueid,jdbcType=VARCHAR}
</update>
<!-- ### 浠ヤ笂浠g爜鐢盡BG + CommentPlugin鑷姩鐢熸垚, 鐢熸垚鏃堕棿: 2022-06-20 18:12:43 ### -->
<!-- ### 浠ヤ笂浠g爜鐢盡BG + CommentPlugin鑷姩鐢熸垚, 鐢熸垚鏃堕棿: 2022-06-22 11:18:32 ### -->



@@ -783,8 +766,8 @@
(uniqueid, client_id, firm_person, app_secret, firm_name, firm_phone, cert_alg, firm_address,
note, firm_email, status, client_org_code, mssp_appid, cert_agency, stamp_type,
stamp_name, open_id, send_sms, sale_person_id, tech_person_id, create_time, update_time,
agent_client_id, agent_sale_id, ca_channel, project_status, plat_app_id, app_cert,
app_icon)
agent_client_id, agent_sale_id, ca_channel, project_status, plat_app_id, app_icon
)
values
<foreach collection="list" item="item" separator=",">
(#{item.uniqueid,jdbcType=VARCHAR}, #{item.clientId,jdbcType=VARCHAR}, #{item.firmPerson,jdbcType=VARCHAR},
@@ -796,8 +779,7 @@
#{item.salePersonId,jdbcType=VARCHAR}, #{item.techPersonId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
#{item.updateTime,jdbcType=TIMESTAMP}, #{item.agentClientId,jdbcType=VARCHAR},
#{item.agentSaleId,jdbcType=VARCHAR}, #{item.caChannel,jdbcType=INTEGER}, #{item.projectStatus,jdbcType=INTEGER},
#{item.platAppId,jdbcType=INTEGER}, #{item.appCert,jdbcType=LONGVARCHAR}, #{item.appIcon,jdbcType=LONGVARCHAR}
)
#{item.platAppId,jdbcType=INTEGER}, #{item.appIcon,jdbcType=LONGVARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
@@ -891,9 +873,6 @@
<if test="'plat_app_id'.toString() == column.value">
#{item.platAppId,jdbcType=INTEGER}
</if>
<if test="'app_cert'.toString() == column.value">
#{item.appCert,jdbcType=LONGVARCHAR}
</if>
<if test="'app_icon'.toString() == column.value">
#{item.appIcon,jdbcType=LONGVARCHAR}
</if>


+ 54
- 355
customer/src/main/resources/mybatis/mapper/FirmInfoTempMapper.xml Datei anzeigen

@@ -6,61 +6,25 @@
<!-- 唯一主键 -->
<id column="uniqueid" jdbcType="VARCHAR" property="uniqueid" />
<!-- 外键ID -->
<result column="open_id" jdbcType="VARCHAR" property="openId" />
<!-- 企业营业执照 -->
<result column="business_license_url" jdbcType="VARCHAR" property="businessLicenseUrl" />
<!-- 组织机构代码照片 -->
<result column="org_code_url" jdbcType="VARCHAR" property="orgCodeUrl" />
<!-- 法人身份证正面 -->
<result column="juridical_idcard_front_url" jdbcType="VARCHAR" property="juridicalIdcardFrontUrl" />
<!-- 法人身份证背面 -->
<result column="juridical_idcard_back_url" jdbcType="VARCHAR" property="juridicalIdcardBackUrl" />
<!-- 法人临时身份证 -->
<result column="juridical_tmp_id_url" jdbcType="VARCHAR" property="juridicalTmpIdUrl" />
<!-- 企业名称 -->
<result column="firm_name" jdbcType="VARCHAR" property="firmName" />
<!-- 工商注册号 -->
<result column="firm_bus_reg_num" jdbcType="VARCHAR" property="firmBusRegNum" />
<!-- 社会信用代码 -->
<result column="firm_soc_cre_code" jdbcType="VARCHAR" property="firmSocCreCode" />
<!-- 企业地址 -->
<result column="firm_addr" jdbcType="VARCHAR" property="firmAddress" />
<result column="firm_org_code" jdbcType="VARCHAR" property="firmOrgCode" />
<!-- 税务登记证号 -->
<result column="firm_tax_reg_cert_code" jdbcType="VARCHAR" property="firmTaxRegCertCode" />
<!-- 经营范围 -->
<result column="firm_bus_scope" jdbcType="VARCHAR" property="firmBusScope" />
<!-- 经营期限 -->
<result column="firm_bus_time" jdbcType="TIMESTAMP" property="firmBusTime" />
<!-- 法人归属地 -->
<result column="juridical_nationality" jdbcType="VARCHAR" property="juridicalNationality" />
<!-- 法人姓名 -->
<result column="juridical_name" jdbcType="VARCHAR" property="juridicalName" />
<!-- 法人联系电话 -->
<result column="juridical_phone" jdbcType="VARCHAR" property="juridicalPhone" />
<!-- 法人身份证号 -->
<result column="juridical_idcard" jdbcType="VARCHAR" property="juridicalIdcard" />
<!-- 法人证件有效期 -->
<result column="juridical_time" jdbcType="TIMESTAMP" property="juridicalTime" />
<!-- 代理人姓名 -->
<result column="agent_name" jdbcType="VARCHAR" property="agentName" />
@@ -76,11 +40,8 @@
<!-- 邮箱 -->
<result column="firm_email" jdbcType="VARCHAR" property="firmEmail" />
<!-- 实名认证标识(0:未认证 1:已认证 2:认证不通过 3:认证失败) -->
<result column="realname_check" jdbcType="CHAR" property="realnameCheck" />
<!-- 厂商状态0待审核 1审核通过 2审核拒绝 4删除 -->
<result column="firm_status" jdbcType="VARCHAR" property="firmStatus" />
<result column="firm_status" jdbcType="VARCHAR" property="status" />
<!-- 实名认证标识(0:未认证 1:已认证 2:认证不通过 3:认证失败) -->
<result column="juridical_realname_check" jdbcType="CHAR" property="juridicalRealnameCheck" />
@@ -97,7 +58,11 @@
<!-- 厂商clientid -->
<result column="firm_client_id" jdbcType="VARCHAR" property="clientId" />
<!-- 创建 -->
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<!-- 修改时间 -->
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<!-- 厂商联系人 -->
@@ -165,13 +130,10 @@
</where>
</sql>
<sql id="Base_Column_List">
uniqueid, open_id, business_license_url, org_code_url, juridical_idcard_front_url,
juridical_idcard_back_url, juridical_tmp_id_url, firm_name, firm_bus_reg_num, firm_soc_cre_code,
firm_addr, firm_org_code, firm_tax_reg_cert_code, firm_bus_scope, firm_bus_time,
juridical_nationality, juridical_name, juridical_phone, juridical_idcard, juridical_time,
agent_name, agent_idcard, agent_time, firm_phone, firm_email, realname_check, firm_status,
juridical_realname_check, agent_phone, channel, agent_client_id, agent_sale_id, firm_client_id,
create_time, update_time, firm_person
uniqueid, business_license_url, org_code_url, firm_name, firm_addr, firm_org_code,
firm_bus_scope, firm_bus_time, agent_name, agent_idcard, agent_time, firm_phone,
firm_email, firm_status, juridical_realname_check, agent_phone, channel, agent_client_id,
agent_sale_id, firm_client_id, create_time, update_time, firm_person
</sql>
<sql id="Blob_Column_List">
firm_logo
@@ -241,32 +203,24 @@
</if>
</delete>
<insert id="insert">
insert into firm_info_temp (uniqueid, open_id, business_license_url,
org_code_url, juridical_idcard_front_url, juridical_idcard_back_url,
juridical_tmp_id_url, firm_name, firm_bus_reg_num,
firm_soc_cre_code, firm_addr, firm_org_code,
firm_tax_reg_cert_code, firm_bus_scope, firm_bus_time,
juridical_nationality, juridical_name, juridical_phone,
juridical_idcard, juridical_time, agent_name,
insert into firm_info_temp (uniqueid, business_license_url, org_code_url,
firm_name, firm_addr, firm_org_code,
firm_bus_scope, firm_bus_time, agent_name,
agent_idcard, agent_time, firm_phone,
firm_email, realname_check, firm_status,
juridical_realname_check, agent_phone, channel,
agent_client_id, agent_sale_id, firm_client_id,
create_time, update_time, firm_person,
firm_logo)
values (#{uniqueid,jdbcType=VARCHAR}, #{openId,jdbcType=VARCHAR}, #{businessLicenseUrl,jdbcType=VARCHAR},
#{orgCodeUrl,jdbcType=VARCHAR}, #{juridicalIdcardFrontUrl,jdbcType=VARCHAR}, #{juridicalIdcardBackUrl,jdbcType=VARCHAR},
#{juridicalTmpIdUrl,jdbcType=VARCHAR}, #{firmName,jdbcType=VARCHAR}, #{firmBusRegNum,jdbcType=VARCHAR},
#{firmSocCreCode,jdbcType=VARCHAR}, #{firmAddress,jdbcType=VARCHAR}, #{firmOrgCode,jdbcType=VARCHAR},
#{firmTaxRegCertCode,jdbcType=VARCHAR}, #{firmBusScope,jdbcType=VARCHAR}, #{firmBusTime,jdbcType=TIMESTAMP},
#{juridicalNationality,jdbcType=VARCHAR}, #{juridicalName,jdbcType=VARCHAR}, #{juridicalPhone,jdbcType=VARCHAR},
#{juridicalIdcard,jdbcType=VARCHAR}, #{juridicalTime,jdbcType=TIMESTAMP}, #{agentName,jdbcType=VARCHAR},
firm_email, firm_status, juridical_realname_check,
agent_phone, channel, agent_client_id,
agent_sale_id, firm_client_id, create_time,
update_time, firm_person, firm_logo
)
values (#{uniqueid,jdbcType=VARCHAR}, #{businessLicenseUrl,jdbcType=VARCHAR}, #{orgCodeUrl,jdbcType=VARCHAR},
#{firmName,jdbcType=VARCHAR}, #{firmAddress,jdbcType=VARCHAR}, #{firmOrgCode,jdbcType=VARCHAR},
#{firmBusScope,jdbcType=VARCHAR}, #{firmBusTime,jdbcType=TIMESTAMP}, #{agentName,jdbcType=VARCHAR},
#{agentIdcard,jdbcType=VARCHAR}, #{agentTime,jdbcType=TIMESTAMP}, #{firmPhone,jdbcType=VARCHAR},
#{firmEmail,jdbcType=VARCHAR}, #{realnameCheck,jdbcType=CHAR}, #{firmStatus,jdbcType=VARCHAR},
#{juridicalRealnameCheck,jdbcType=CHAR}, #{agentPhone,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR},
#{agentClientId,jdbcType=VARCHAR}, #{agentSaleId,jdbcType=VARCHAR}, #{clientId,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{firmPerson,jdbcType=VARCHAR},
#{firmLogo,jdbcType=LONGVARCHAR})
#{firmEmail,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{juridicalRealnameCheck,jdbcType=CHAR},
#{agentPhone,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR}, #{agentClientId,jdbcType=VARCHAR},
#{agentSaleId,jdbcType=VARCHAR}, #{clientId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{firmPerson,jdbcType=VARCHAR}, #{firmLogo,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective">
insert into firm_info_temp
@@ -274,63 +228,27 @@
<if test="uniqueid != null">
uniqueid,
</if>
<if test="openId != null">
open_id,
</if>
<if test="businessLicenseUrl != null">
business_license_url,
</if>
<if test="orgCodeUrl != null">
org_code_url,
</if>
<if test="juridicalIdcardFrontUrl != null">
juridical_idcard_front_url,
</if>
<if test="juridicalIdcardBackUrl != null">
juridical_idcard_back_url,
</if>
<if test="juridicalTmpIdUrl != null">
juridical_tmp_id_url,
</if>
<if test="firmName != null">
firm_name,
</if>
<if test="firmBusRegNum != null">
firm_bus_reg_num,
</if>
<if test="firmSocCreCode != null">
firm_soc_cre_code,
</if>
<if test="firmAddress != null">
firm_addr,
</if>
<if test="firmOrgCode != null">
firm_org_code,
</if>
<if test="firmTaxRegCertCode != null">
firm_tax_reg_cert_code,
</if>
<if test="firmBusScope != null">
firm_bus_scope,
</if>
<if test="firmBusTime != null">
firm_bus_time,
</if>
<if test="juridicalNationality != null">
juridical_nationality,
</if>
<if test="juridicalName != null">
juridical_name,
</if>
<if test="juridicalPhone != null">
juridical_phone,
</if>
<if test="juridicalIdcard != null">
juridical_idcard,
</if>
<if test="juridicalTime != null">
juridical_time,
</if>
<if test="agentName != null">
agent_name,
</if>
@@ -346,10 +264,7 @@
<if test="firmEmail != null">
firm_email,
</if>
<if test="realnameCheck != null">
realname_check,
</if>
<if test="firmStatus != null">
<if test="status != null">
firm_status,
</if>
<if test="juridicalRealnameCheck != null">
@@ -387,63 +302,27 @@
<if test="uniqueid != null">
#{uniqueid,jdbcType=VARCHAR},
</if>
<if test="openId != null">
#{openId,jdbcType=VARCHAR},
</if>
<if test="businessLicenseUrl != null">
#{businessLicenseUrl,jdbcType=VARCHAR},
</if>
<if test="orgCodeUrl != null">
#{orgCodeUrl,jdbcType=VARCHAR},
</if>
<if test="juridicalIdcardFrontUrl != null">
#{juridicalIdcardFrontUrl,jdbcType=VARCHAR},
</if>
<if test="juridicalIdcardBackUrl != null">
#{juridicalIdcardBackUrl,jdbcType=VARCHAR},
</if>
<if test="juridicalTmpIdUrl != null">
#{juridicalTmpIdUrl,jdbcType=VARCHAR},
</if>
<if test="firmName != null">
#{firmName,jdbcType=VARCHAR},
</if>
<if test="firmBusRegNum != null">
#{firmBusRegNum,jdbcType=VARCHAR},
</if>
<if test="firmSocCreCode != null">
#{firmSocCreCode,jdbcType=VARCHAR},
</if>
<if test="firmAddress != null">
#{firmAddress,jdbcType=VARCHAR},
</if>
<if test="firmOrgCode != null">
#{firmOrgCode,jdbcType=VARCHAR},
</if>
<if test="firmTaxRegCertCode != null">
#{firmTaxRegCertCode,jdbcType=VARCHAR},
</if>
<if test="firmBusScope != null">
#{firmBusScope,jdbcType=VARCHAR},
</if>
<if test="firmBusTime != null">
#{firmBusTime,jdbcType=TIMESTAMP},
</if>
<if test="juridicalNationality != null">
#{juridicalNationality,jdbcType=VARCHAR},
</if>
<if test="juridicalName != null">
#{juridicalName,jdbcType=VARCHAR},
</if>
<if test="juridicalPhone != null">
#{juridicalPhone,jdbcType=VARCHAR},
</if>
<if test="juridicalIdcard != null">
#{juridicalIdcard,jdbcType=VARCHAR},
</if>
<if test="juridicalTime != null">
#{juridicalTime,jdbcType=TIMESTAMP},
</if>
<if test="agentName != null">
#{agentName,jdbcType=VARCHAR},
</if>
@@ -459,11 +338,8 @@
<if test="firmEmail != null">
#{firmEmail,jdbcType=VARCHAR},
</if>
<if test="realnameCheck != null">
#{realnameCheck,jdbcType=CHAR},
</if>
<if test="firmStatus != null">
#{firmStatus,jdbcType=VARCHAR},
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="juridicalRealnameCheck != null">
#{juridicalRealnameCheck,jdbcType=CHAR},
@@ -509,63 +385,27 @@
<if test="record.uniqueid != null">
uniqueid = #{record.uniqueid,jdbcType=VARCHAR},
</if>
<if test="record.openId != null">
open_id = #{record.openId,jdbcType=VARCHAR},
</if>
<if test="record.businessLicenseUrl != null">
business_license_url = #{record.businessLicenseUrl,jdbcType=VARCHAR},
</if>
<if test="record.orgCodeUrl != null">
org_code_url = #{record.orgCodeUrl,jdbcType=VARCHAR},
</if>
<if test="record.juridicalIdcardFrontUrl != null">
juridical_idcard_front_url = #{record.juridicalIdcardFrontUrl,jdbcType=VARCHAR},
</if>
<if test="record.juridicalIdcardBackUrl != null">
juridical_idcard_back_url = #{record.juridicalIdcardBackUrl,jdbcType=VARCHAR},
</if>
<if test="record.juridicalTmpIdUrl != null">
juridical_tmp_id_url = #{record.juridicalTmpIdUrl,jdbcType=VARCHAR},
</if>
<if test="record.firmName != null">
firm_name = #{record.firmName,jdbcType=VARCHAR},
</if>
<if test="record.firmBusRegNum != null">
firm_bus_reg_num = #{record.firmBusRegNum,jdbcType=VARCHAR},
</if>
<if test="record.firmSocCreCode != null">
firm_soc_cre_code = #{record.firmSocCreCode,jdbcType=VARCHAR},
</if>
<if test="record.firmAddress != null">
firm_addr = #{record.firmAddress,jdbcType=VARCHAR},
</if>
<if test="record.firmOrgCode != null">
firm_org_code = #{record.firmOrgCode,jdbcType=VARCHAR},
</if>
<if test="record.firmTaxRegCertCode != null">
firm_tax_reg_cert_code = #{record.firmTaxRegCertCode,jdbcType=VARCHAR},
</if>
<if test="record.firmBusScope != null">
firm_bus_scope = #{record.firmBusScope,jdbcType=VARCHAR},
</if>
<if test="record.firmBusTime != null">
firm_bus_time = #{record.firmBusTime,jdbcType=TIMESTAMP},
</if>
<if test="record.juridicalNationality != null">
juridical_nationality = #{record.juridicalNationality,jdbcType=VARCHAR},
</if>
<if test="record.juridicalName != null">
juridical_name = #{record.juridicalName,jdbcType=VARCHAR},
</if>
<if test="record.juridicalPhone != null">
juridical_phone = #{record.juridicalPhone,jdbcType=VARCHAR},
</if>
<if test="record.juridicalIdcard != null">
juridical_idcard = #{record.juridicalIdcard,jdbcType=VARCHAR},
</if>
<if test="record.juridicalTime != null">
juridical_time = #{record.juridicalTime,jdbcType=TIMESTAMP},
</if>
<if test="record.agentName != null">
agent_name = #{record.agentName,jdbcType=VARCHAR},
</if>
@@ -581,11 +421,8 @@
<if test="record.firmEmail != null">
firm_email = #{record.firmEmail,jdbcType=VARCHAR},
</if>
<if test="record.realnameCheck != null">
realname_check = #{record.realnameCheck,jdbcType=CHAR},
</if>
<if test="record.firmStatus != null">
firm_status = #{record.firmStatus,jdbcType=VARCHAR},
<if test="record.status != null">
firm_status = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.juridicalRealnameCheck != null">
juridical_realname_check = #{record.juridicalRealnameCheck,jdbcType=CHAR},
@@ -625,32 +462,19 @@
<update id="updateByExampleWithBLOBs" parameterType="map">
update firm_info_temp
set uniqueid = #{record.uniqueid,jdbcType=VARCHAR},
open_id = #{record.openId,jdbcType=VARCHAR},
business_license_url = #{record.businessLicenseUrl,jdbcType=VARCHAR},
org_code_url = #{record.orgCodeUrl,jdbcType=VARCHAR},
juridical_idcard_front_url = #{record.juridicalIdcardFrontUrl,jdbcType=VARCHAR},
juridical_idcard_back_url = #{record.juridicalIdcardBackUrl,jdbcType=VARCHAR},
juridical_tmp_id_url = #{record.juridicalTmpIdUrl,jdbcType=VARCHAR},
firm_name = #{record.firmName,jdbcType=VARCHAR},
firm_bus_reg_num = #{record.firmBusRegNum,jdbcType=VARCHAR},
firm_soc_cre_code = #{record.firmSocCreCode,jdbcType=VARCHAR},
firm_addr = #{record.firmAddress,jdbcType=VARCHAR},
firm_org_code = #{record.firmOrgCode,jdbcType=VARCHAR},
firm_tax_reg_cert_code = #{record.firmTaxRegCertCode,jdbcType=VARCHAR},
firm_bus_scope = #{record.firmBusScope,jdbcType=VARCHAR},
firm_bus_time = #{record.firmBusTime,jdbcType=TIMESTAMP},
juridical_nationality = #{record.juridicalNationality,jdbcType=VARCHAR},
juridical_name = #{record.juridicalName,jdbcType=VARCHAR},
juridical_phone = #{record.juridicalPhone,jdbcType=VARCHAR},
juridical_idcard = #{record.juridicalIdcard,jdbcType=VARCHAR},
juridical_time = #{record.juridicalTime,jdbcType=TIMESTAMP},
agent_name = #{record.agentName,jdbcType=VARCHAR},
agent_idcard = #{record.agentIdcard,jdbcType=VARCHAR},
agent_time = #{record.agentTime,jdbcType=TIMESTAMP},
firm_phone = #{record.firmPhone,jdbcType=VARCHAR},
firm_email = #{record.firmEmail,jdbcType=VARCHAR},
realname_check = #{record.realnameCheck,jdbcType=CHAR},
firm_status = #{record.firmStatus,jdbcType=VARCHAR},
firm_status = #{record.status,jdbcType=VARCHAR},
juridical_realname_check = #{record.juridicalRealnameCheck,jdbcType=CHAR},
agent_phone = #{record.agentPhone,jdbcType=VARCHAR},
channel = #{record.channel,jdbcType=VARCHAR},
@@ -668,32 +492,19 @@
<update id="updateByExample" parameterType="map">
update firm_info_temp
set uniqueid = #{record.uniqueid,jdbcType=VARCHAR},
open_id = #{record.openId,jdbcType=VARCHAR},
business_license_url = #{record.businessLicenseUrl,jdbcType=VARCHAR},
org_code_url = #{record.orgCodeUrl,jdbcType=VARCHAR},
juridical_idcard_front_url = #{record.juridicalIdcardFrontUrl,jdbcType=VARCHAR},
juridical_idcard_back_url = #{record.juridicalIdcardBackUrl,jdbcType=VARCHAR},
juridical_tmp_id_url = #{record.juridicalTmpIdUrl,jdbcType=VARCHAR},
firm_name = #{record.firmName,jdbcType=VARCHAR},
firm_bus_reg_num = #{record.firmBusRegNum,jdbcType=VARCHAR},
firm_soc_cre_code = #{record.firmSocCreCode,jdbcType=VARCHAR},
firm_addr = #{record.firmAddress,jdbcType=VARCHAR},
firm_org_code = #{record.firmOrgCode,jdbcType=VARCHAR},
firm_tax_reg_cert_code = #{record.firmTaxRegCertCode,jdbcType=VARCHAR},
firm_bus_scope = #{record.firmBusScope,jdbcType=VARCHAR},
firm_bus_time = #{record.firmBusTime,jdbcType=TIMESTAMP},
juridical_nationality = #{record.juridicalNationality,jdbcType=VARCHAR},
juridical_name = #{record.juridicalName,jdbcType=VARCHAR},
juridical_phone = #{record.juridicalPhone,jdbcType=VARCHAR},
juridical_idcard = #{record.juridicalIdcard,jdbcType=VARCHAR},
juridical_time = #{record.juridicalTime,jdbcType=TIMESTAMP},
agent_name = #{record.agentName,jdbcType=VARCHAR},
agent_idcard = #{record.agentIdcard,jdbcType=VARCHAR},
agent_time = #{record.agentTime,jdbcType=TIMESTAMP},
firm_phone = #{record.firmPhone,jdbcType=VARCHAR},
firm_email = #{record.firmEmail,jdbcType=VARCHAR},
realname_check = #{record.realnameCheck,jdbcType=CHAR},
firm_status = #{record.firmStatus,jdbcType=VARCHAR},
firm_status = #{record.status,jdbcType=VARCHAR},
juridical_realname_check = #{record.juridicalRealnameCheck,jdbcType=CHAR},
agent_phone = #{record.agentPhone,jdbcType=VARCHAR},
channel = #{record.channel,jdbcType=VARCHAR},
@@ -710,63 +521,27 @@
<update id="updateByPrimaryKeySelective">
update firm_info_temp
<set>
<if test="openId != null">
open_id = #{openId,jdbcType=VARCHAR},
</if>
<if test="businessLicenseUrl != null">
business_license_url = #{businessLicenseUrl,jdbcType=VARCHAR},
</if>
<if test="orgCodeUrl != null">
org_code_url = #{orgCodeUrl,jdbcType=VARCHAR},
</if>
<if test="juridicalIdcardFrontUrl != null">
juridical_idcard_front_url = #{juridicalIdcardFrontUrl,jdbcType=VARCHAR},
</if>
<if test="juridicalIdcardBackUrl != null">
juridical_idcard_back_url = #{juridicalIdcardBackUrl,jdbcType=VARCHAR},
</if>
<if test="juridicalTmpIdUrl != null">
juridical_tmp_id_url = #{juridicalTmpIdUrl,jdbcType=VARCHAR},
</if>
<if test="firmName != null">
firm_name = #{firmName,jdbcType=VARCHAR},
</if>
<if test="firmBusRegNum != null">
firm_bus_reg_num = #{firmBusRegNum,jdbcType=VARCHAR},
</if>
<if test="firmSocCreCode != null">
firm_soc_cre_code = #{firmSocCreCode,jdbcType=VARCHAR},
</if>
<if test="firmAddress != null">
firm_addr = #{firmAddress,jdbcType=VARCHAR},
</if>
<if test="firmOrgCode != null">
firm_org_code = #{firmOrgCode,jdbcType=VARCHAR},
</if>
<if test="firmTaxRegCertCode != null">
firm_tax_reg_cert_code = #{firmTaxRegCertCode,jdbcType=VARCHAR},
</if>
<if test="firmBusScope != null">
firm_bus_scope = #{firmBusScope,jdbcType=VARCHAR},
</if>
<if test="firmBusTime != null">
firm_bus_time = #{firmBusTime,jdbcType=TIMESTAMP},
</if>
<if test="juridicalNationality != null">
juridical_nationality = #{juridicalNationality,jdbcType=VARCHAR},
</if>
<if test="juridicalName != null">
juridical_name = #{juridicalName,jdbcType=VARCHAR},
</if>
<if test="juridicalPhone != null">
juridical_phone = #{juridicalPhone,jdbcType=VARCHAR},
</if>
<if test="juridicalIdcard != null">
juridical_idcard = #{juridicalIdcard,jdbcType=VARCHAR},
</if>
<if test="juridicalTime != null">
juridical_time = #{juridicalTime,jdbcType=TIMESTAMP},
</if>
<if test="agentName != null">
agent_name = #{agentName,jdbcType=VARCHAR},
</if>
@@ -782,11 +557,8 @@
<if test="firmEmail != null">
firm_email = #{firmEmail,jdbcType=VARCHAR},
</if>
<if test="realnameCheck != null">
realname_check = #{realnameCheck,jdbcType=CHAR},
</if>
<if test="firmStatus != null">
firm_status = #{firmStatus,jdbcType=VARCHAR},
<if test="status != null">
firm_status = #{status,jdbcType=VARCHAR},
</if>
<if test="juridicalRealnameCheck != null">
juridical_realname_check = #{juridicalRealnameCheck,jdbcType=CHAR},
@@ -823,32 +595,19 @@
</update>
<update id="updateByPrimaryKeyWithBLOBs">
update firm_info_temp
set open_id = #{openId,jdbcType=VARCHAR},
business_license_url = #{businessLicenseUrl,jdbcType=VARCHAR},
set business_license_url = #{businessLicenseUrl,jdbcType=VARCHAR},
org_code_url = #{orgCodeUrl,jdbcType=VARCHAR},
juridical_idcard_front_url = #{juridicalIdcardFrontUrl,jdbcType=VARCHAR},
juridical_idcard_back_url = #{juridicalIdcardBackUrl,jdbcType=VARCHAR},
juridical_tmp_id_url = #{juridicalTmpIdUrl,jdbcType=VARCHAR},
firm_name = #{firmName,jdbcType=VARCHAR},
firm_bus_reg_num = #{firmBusRegNum,jdbcType=VARCHAR},
firm_soc_cre_code = #{firmSocCreCode,jdbcType=VARCHAR},
firm_addr = #{firmAddress,jdbcType=VARCHAR},
firm_org_code = #{firmOrgCode,jdbcType=VARCHAR},
firm_tax_reg_cert_code = #{firmTaxRegCertCode,jdbcType=VARCHAR},
firm_bus_scope = #{firmBusScope,jdbcType=VARCHAR},
firm_bus_time = #{firmBusTime,jdbcType=TIMESTAMP},
juridical_nationality = #{juridicalNationality,jdbcType=VARCHAR},
juridical_name = #{juridicalName,jdbcType=VARCHAR},
juridical_phone = #{juridicalPhone,jdbcType=VARCHAR},
juridical_idcard = #{juridicalIdcard,jdbcType=VARCHAR},
juridical_time = #{juridicalTime,jdbcType=TIMESTAMP},
agent_name = #{agentName,jdbcType=VARCHAR},
agent_idcard = #{agentIdcard,jdbcType=VARCHAR},
agent_time = #{agentTime,jdbcType=TIMESTAMP},
firm_phone = #{firmPhone,jdbcType=VARCHAR},
firm_email = #{firmEmail,jdbcType=VARCHAR},
realname_check = #{realnameCheck,jdbcType=CHAR},
firm_status = #{firmStatus,jdbcType=VARCHAR},
firm_status = #{status,jdbcType=VARCHAR},
juridical_realname_check = #{juridicalRealnameCheck,jdbcType=CHAR},
agent_phone = #{agentPhone,jdbcType=VARCHAR},
channel = #{channel,jdbcType=VARCHAR},
@@ -863,32 +622,19 @@
</update>
<update id="updateByPrimaryKey">
update firm_info_temp
set open_id = #{openId,jdbcType=VARCHAR},
business_license_url = #{businessLicenseUrl,jdbcType=VARCHAR},
set business_license_url = #{businessLicenseUrl,jdbcType=VARCHAR},
org_code_url = #{orgCodeUrl,jdbcType=VARCHAR},
juridical_idcard_front_url = #{juridicalIdcardFrontUrl,jdbcType=VARCHAR},
juridical_idcard_back_url = #{juridicalIdcardBackUrl,jdbcType=VARCHAR},
juridical_tmp_id_url = #{juridicalTmpIdUrl,jdbcType=VARCHAR},
firm_name = #{firmName,jdbcType=VARCHAR},
firm_bus_reg_num = #{firmBusRegNum,jdbcType=VARCHAR},
firm_soc_cre_code = #{firmSocCreCode,jdbcType=VARCHAR},
firm_addr = #{firmAddress,jdbcType=VARCHAR},
firm_org_code = #{firmOrgCode,jdbcType=VARCHAR},
firm_tax_reg_cert_code = #{firmTaxRegCertCode,jdbcType=VARCHAR},
firm_bus_scope = #{firmBusScope,jdbcType=VARCHAR},
firm_bus_time = #{firmBusTime,jdbcType=TIMESTAMP},
juridical_nationality = #{juridicalNationality,jdbcType=VARCHAR},
juridical_name = #{juridicalName,jdbcType=VARCHAR},
juridical_phone = #{juridicalPhone,jdbcType=VARCHAR},
juridical_idcard = #{juridicalIdcard,jdbcType=VARCHAR},
juridical_time = #{juridicalTime,jdbcType=TIMESTAMP},
agent_name = #{agentName,jdbcType=VARCHAR},
agent_idcard = #{agentIdcard,jdbcType=VARCHAR},
agent_time = #{agentTime,jdbcType=TIMESTAMP},
firm_phone = #{firmPhone,jdbcType=VARCHAR},
firm_email = #{firmEmail,jdbcType=VARCHAR},
realname_check = #{realnameCheck,jdbcType=CHAR},
firm_status = #{firmStatus,jdbcType=VARCHAR},
firm_status = #{status,jdbcType=VARCHAR},
juridical_realname_check = #{juridicalRealnameCheck,jdbcType=CHAR},
agent_phone = #{agentPhone,jdbcType=VARCHAR},
channel = #{channel,jdbcType=VARCHAR},
@@ -901,7 +647,7 @@
where uniqueid = #{uniqueid,jdbcType=VARCHAR}
</update>
<!-- ### 浠ヤ笂浠g爜鐢盡BG + CommentPlugin鑷姩鐢熸垚, 鐢熸垚鏃堕棿: 2022-06-20 18:12:43 ### -->
<!-- ### 浠ヤ笂浠g爜鐢盡BG + CommentPlugin鑷姩鐢熸垚, 鐢熸垚鏃堕棿: 2022-06-22 11:18:32 ### -->



@@ -935,30 +681,22 @@
</select>
<insert id="batchInsert" parameterType="map">
insert into firm_info_temp
(uniqueid, open_id, business_license_url, org_code_url, juridical_idcard_front_url,
juridical_idcard_back_url, juridical_tmp_id_url, firm_name, firm_bus_reg_num, firm_soc_cre_code,
firm_addr, firm_org_code, firm_tax_reg_cert_code, firm_bus_scope, firm_bus_time,
juridical_nationality, juridical_name, juridical_phone, juridical_idcard, juridical_time,
agent_name, agent_idcard, agent_time, firm_phone, firm_email, realname_check, firm_status,
juridical_realname_check, agent_phone, channel, agent_client_id, agent_sale_id,
firm_client_id, create_time, update_time, firm_person, firm_logo)
(uniqueid, business_license_url, org_code_url, firm_name, firm_addr, firm_org_code,
firm_bus_scope, firm_bus_time, agent_name, agent_idcard, agent_time, firm_phone,
firm_email, firm_status, juridical_realname_check, agent_phone, channel, agent_client_id,
agent_sale_id, firm_client_id, create_time, update_time, firm_person, firm_logo
)
values
<foreach collection="list" item="item" separator=",">
(#{item.uniqueid,jdbcType=VARCHAR}, #{item.openId,jdbcType=VARCHAR}, #{item.businessLicenseUrl,jdbcType=VARCHAR},
#{item.orgCodeUrl,jdbcType=VARCHAR}, #{item.juridicalIdcardFrontUrl,jdbcType=VARCHAR},
#{item.juridicalIdcardBackUrl,jdbcType=VARCHAR}, #{item.juridicalTmpIdUrl,jdbcType=VARCHAR},
#{item.firmName,jdbcType=VARCHAR}, #{item.firmBusRegNum,jdbcType=VARCHAR}, #{item.firmSocCreCode,jdbcType=VARCHAR},
#{item.firmAddress,jdbcType=VARCHAR}, #{item.firmOrgCode,jdbcType=VARCHAR}, #{item.firmTaxRegCertCode,jdbcType=VARCHAR},
#{item.firmBusScope,jdbcType=VARCHAR}, #{item.firmBusTime,jdbcType=TIMESTAMP},
#{item.juridicalNationality,jdbcType=VARCHAR}, #{item.juridicalName,jdbcType=VARCHAR},
#{item.juridicalPhone,jdbcType=VARCHAR}, #{item.juridicalIdcard,jdbcType=VARCHAR},
#{item.juridicalTime,jdbcType=TIMESTAMP}, #{item.agentName,jdbcType=VARCHAR}, #{item.agentIdcard,jdbcType=VARCHAR},
#{item.agentTime,jdbcType=TIMESTAMP}, #{item.firmPhone,jdbcType=VARCHAR}, #{item.firmEmail,jdbcType=VARCHAR},
#{item.realnameCheck,jdbcType=CHAR}, #{item.firmStatus,jdbcType=VARCHAR}, #{item.juridicalRealnameCheck,jdbcType=CHAR},
#{item.agentPhone,jdbcType=VARCHAR}, #{item.channel,jdbcType=VARCHAR}, #{item.agentClientId,jdbcType=VARCHAR},
#{item.agentSaleId,jdbcType=VARCHAR}, #{item.clientId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
#{item.updateTime,jdbcType=TIMESTAMP}, #{item.firmPerson,jdbcType=VARCHAR}, #{item.firmLogo,jdbcType=LONGVARCHAR}
)
(#{item.uniqueid,jdbcType=VARCHAR}, #{item.businessLicenseUrl,jdbcType=VARCHAR},
#{item.orgCodeUrl,jdbcType=VARCHAR}, #{item.firmName,jdbcType=VARCHAR}, #{item.firmAddress,jdbcType=VARCHAR},
#{item.firmOrgCode,jdbcType=VARCHAR}, #{item.firmBusScope,jdbcType=VARCHAR}, #{item.firmBusTime,jdbcType=TIMESTAMP},
#{item.agentName,jdbcType=VARCHAR}, #{item.agentIdcard,jdbcType=VARCHAR}, #{item.agentTime,jdbcType=TIMESTAMP},
#{item.firmPhone,jdbcType=VARCHAR}, #{item.firmEmail,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR},
#{item.juridicalRealnameCheck,jdbcType=CHAR}, #{item.agentPhone,jdbcType=VARCHAR},
#{item.channel,jdbcType=VARCHAR}, #{item.agentClientId,jdbcType=VARCHAR}, #{item.agentSaleId,jdbcType=VARCHAR},
#{item.clientId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.firmPerson,jdbcType=VARCHAR}, #{item.firmLogo,jdbcType=LONGVARCHAR})
</foreach>
</insert>
<insert id="batchInsertSelective" parameterType="map">
@@ -974,63 +712,27 @@
<if test="'uniqueid'.toString() == column.value">
#{item.uniqueid,jdbcType=VARCHAR}
</if>
<if test="'open_id'.toString() == column.value">
#{item.openId,jdbcType=VARCHAR}
</if>
<if test="'business_license_url'.toString() == column.value">
#{item.businessLicenseUrl,jdbcType=VARCHAR}
</if>
<if test="'org_code_url'.toString() == column.value">
#{item.orgCodeUrl,jdbcType=VARCHAR}
</if>
<if test="'juridical_idcard_front_url'.toString() == column.value">
#{item.juridicalIdcardFrontUrl,jdbcType=VARCHAR}
</if>
<if test="'juridical_idcard_back_url'.toString() == column.value">
#{item.juridicalIdcardBackUrl,jdbcType=VARCHAR}
</if>
<if test="'juridical_tmp_id_url'.toString() == column.value">
#{item.juridicalTmpIdUrl,jdbcType=VARCHAR}
</if>
<if test="'firm_name'.toString() == column.value">
#{item.firmName,jdbcType=VARCHAR}
</if>
<if test="'firm_bus_reg_num'.toString() == column.value">
#{item.firmBusRegNum,jdbcType=VARCHAR}
</if>
<if test="'firm_soc_cre_code'.toString() == column.value">
#{item.firmSocCreCode,jdbcType=VARCHAR}
</if>
<if test="'firm_addr'.toString() == column.value">
#{item.firmAddress,jdbcType=VARCHAR}
</if>
<if test="'firm_org_code'.toString() == column.value">
#{item.firmOrgCode,jdbcType=VARCHAR}
</if>
<if test="'firm_tax_reg_cert_code'.toString() == column.value">
#{item.firmTaxRegCertCode,jdbcType=VARCHAR}
</if>
<if test="'firm_bus_scope'.toString() == column.value">
#{item.firmBusScope,jdbcType=VARCHAR}
</if>
<if test="'firm_bus_time'.toString() == column.value">
#{item.firmBusTime,jdbcType=TIMESTAMP}
</if>
<if test="'juridical_nationality'.toString() == column.value">
#{item.juridicalNationality,jdbcType=VARCHAR}
</if>
<if test="'juridical_name'.toString() == column.value">
#{item.juridicalName,jdbcType=VARCHAR}
</if>
<if test="'juridical_phone'.toString() == column.value">
#{item.juridicalPhone,jdbcType=VARCHAR}
</if>
<if test="'juridical_idcard'.toString() == column.value">
#{item.juridicalIdcard,jdbcType=VARCHAR}
</if>
<if test="'juridical_time'.toString() == column.value">
#{item.juridicalTime,jdbcType=TIMESTAMP}
</if>
<if test="'agent_name'.toString() == column.value">
#{item.agentName,jdbcType=VARCHAR}
</if>
@@ -1046,11 +748,8 @@
<if test="'firm_email'.toString() == column.value">
#{item.firmEmail,jdbcType=VARCHAR}
</if>
<if test="'realname_check'.toString() == column.value">
#{item.realnameCheck,jdbcType=CHAR}
</if>
<if test="'firm_status'.toString() == column.value">
#{item.firmStatus,jdbcType=VARCHAR}
#{item.status,jdbcType=VARCHAR}
</if>
<if test="'juridical_realname_check'.toString() == column.value">
#{item.juridicalRealnameCheck,jdbcType=CHAR}


+ 0
- 2
customer/src/main/resources/on/base.properties Datei anzeigen

@@ -1,2 +0,0 @@
application.name=ywx-customer
log.level=INFO

+ 0
- 2
customer/src/main/resources/on/server.properties Datei anzeigen

@@ -1,2 +0,0 @@
application.name==ywx-customer
server.port=7013

+ 5
- 4
customer/src/main/resources/spring/dubbo-provider.xml Datei anzeigen

@@ -7,13 +7,14 @@
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd">

<!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 -->
<dubbo:application name="ywx-customer">
<dubbo:parameter key="qos.enable" value="false"/>
</dubbo:application>

<!-- fixme 需要替换 5011-->
<dubbo:protocol name="dubbo" port="5011"/>
<dubbo:registry protocol="nacos" address="${dubbo.registry.address.nacos}"/>
<!-- <dubbo:registry address="zookeeper://192.168.126.21:2181"/>-->
<dubbo:registry protocol="nacos" address="${dubbo.registry.address.nacos}"/>
<!-- 提供服务 -->
<!-- <dubbo:service interface="com.trust.ywx.customer.service.TrustCustomerService" ref="trustCustomerServiceimpl" timeout="30000" />-->
<dubbo:service interface="com.trust.ywx.customer.service.query.FirmQueryService" ref="firmQueryService"
timeout="30000" validation="true"/>
</beans>

+ 1
- 2
customer/src/main/resources/spring/spring-applicationContext.xml Datei anzeigen

@@ -10,7 +10,6 @@
default-autowire="byName">
<context:component-scan base-package="com.trust.ywx"/>
<!-- <aop:aspectj-autoproxy proxy-target-class="true"/>-->
<!-- <context:property-placeholder location="classpath*:*.properties" ignore-unresolvable="true"/>-->

<context:property-placeholder location="classpath*:*.properties" ignore-unresolvable="true"/>
<import resource="classpath:spring/dubbo-provider.xml" />
</beans>

+ 0
- 2
customer/src/main/resources/test/base.properties Datei anzeigen

@@ -1,2 +0,0 @@
application.name==ywx-customer
log.level=INFO

+ 0
- 3
customer/src/main/resources/test/jdbc.properties Datei anzeigen

@@ -1,3 +0,0 @@
jdbc.url=jdbc:mysql://192.168.126.122:3306/tms?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=true
jdbc.username=root
jdbc.password=tiger

+ 0
- 12
customer/src/main/resources/test/redis.properties Datei anzeigen

@@ -1,12 +0,0 @@
ywq.cache-manager.configs[0].key=mr-admin
ywq.lock.lockerType=REDIS
spring.redis.database=5
spring.redis.host=192.168.126.122
spring.redis.port=6379
spring.redis.timeout=2000
spring.redis.pool.laxative=5
spring.redis.pool.maxillae=5
spring.redis.pool.maxi=-1
spring.redis.pool.middle=1
user.root.name=root
user.root.passwd=root

+ 0
- 2
customer/src/main/resources/test/server.properties Datei anzeigen

@@ -1,2 +0,0 @@
application.name==ywx-customer
server.port=7013

+ 21
- 3
customer/src/test/java/com/trust/ywx/customer/FirmServiceTests.java Datei anzeigen

@@ -1,11 +1,17 @@
package com.trust.ywx.customer;

import com.alibaba.fastjson.JSONObject;
import com.fiftyonetrust.common.model.param.PageParam;
import com.trust.ywx.customer.common.enu.CaChannelEnum;
import com.trust.ywx.customer.common.enu.CommonStatusEnum;
import com.trust.ywx.customer.common.enu.ProjectStatusEnum;
import com.trust.ywx.customer.common.model.manager.request.TrustFirmParam;
import com.trust.ywx.customer.common.exception.BizException;
import com.trust.ywx.customer.common.model.manager.response.TrustFirmDto;
import com.trust.ywx.customer.common.model.query.request.SearchTrustFirmParam;
import com.trust.ywx.customer.common.model.PageBean;
import com.trust.ywx.customer.service.manager.FirmManagerService;
import com.trust.ywx.customer.service.query.FirmQueryService;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@@ -29,7 +35,9 @@ import javax.annotation.Resource;
@SpringBootTest(classes = Application.class)
public class FirmServiceTests {
@Resource
FirmManagerService firmManagerService;
FirmManagerService managerService;
@Resource
FirmQueryService queryService;

@Test
public void addTest() throws BizException {
@@ -45,12 +53,22 @@ public class FirmServiceTests {
param.setSmsSend(CommonStatusEnum.YES.getCode());
param.setSmsCustomize(CommonStatusEnum.YES.getCode());
param.setSmsCustomizeContent("我的短信我做主");
firmManagerService.add(param);
managerService.add(param);
System.out.println("success");
}

@Test
public void delTest(){
firmManagerService.delete("12345");
managerService.delete("12345");
}

@Test
public void queryListTest(){
SearchTrustFirmParam param = new SearchTrustFirmParam();
PageParam pageParam = new PageParam();
pageParam.setPageNo(0);
pageParam.setPageSize(10);
PageBean<TrustFirmDto> pageList = queryService.getTrustFirmList(param);
System.out.println(JSONObject.toJSONString(pageList));
}
}

+ 98
- 0
customer/src/test/java/com/trust/ywx/customer/TempFirmServiceTests.java Datei anzeigen

@@ -0,0 +1,98 @@
package com.trust.ywx.customer;

import com.trust.ywx.customer.common.exception.BizException;
import com.trust.ywx.customer.common.model.manager.request.TempFirmParam;
import com.trust.ywx.customer.common.model.manager.response.TempFirmDto;
import com.trust.ywx.customer.common.model.query.request.SearchFirmParam;
import com.trust.ywx.customer.common.model.PageBean;
import com.trust.ywx.customer.service.manager.TempFirmManagerService;
import com.trust.ywx.customer.service.query.FirmQueryService;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;

/**
* <pre></pre>
*
* @文件名称: FirmServiceTests.java
* @包 路 径: com.trust.ywx.customer
* @Copyright:北京数字医信责任有限公司 (C) 2022 *
* @Description:
* @Version: V1.0
* @Author: hanzhenchao
* @Date:2022/6/20 17:19
* @Modify:
*/

@Slf4j
@SpringBootTest(classes = Application.class)
public class TempFirmServiceTests {
@Resource
TempFirmManagerService managerService;
@Resource
FirmQueryService queryService;

@Test
public void addTest() throws BizException {
TempFirmParam param = new TempFirmParam();
param.setAgentClientId("agentId");
param.setFirmOrgCode("orgCode");
param.setFirmName("莆田医院2");
param.setAppIcon("http://url.com");
param.setFirmPerson("firmPerson");
param.setFirmEmail("firmEmail");
param.setFirmPhone("firmPhone");
param.setAgentSaleId("saleId");
param.setChannelApp(true);
param.setChannelSdk(true);
String clientId = managerService.add(param);
System.out.println(clientId);
}



@Test
public void updateTest() throws BizException {
TempFirmParam param = new TempFirmParam();
param.setClientId("2022062117474932");
param.setFirmOrgCode("orgCode");
param.setFirmName("莆田医院2");
param.setAppIcon("http://url.com");
param.setFirmPerson("firmPerson");
param.setFirmEmail("firmEmail");
param.setFirmPhone("韩振超");
param.setAgentSaleId("saleId");
param.setChannelApp(true);
param.setChannelSdk(true);
System.out.println(managerService.update(param));
}

@Test
public void auditTest() throws BizException {
System.out.println(managerService.audit("2022062117474932"));
}

@Test
public void rejectTest() throws BizException {
System.out.println(managerService.reject("2022062117474932"));
}

@Test
public void delTest(){
System.out.println(managerService.delete("2022062117474932"));
}

@Test
public void listTest(){
SearchFirmParam param = new SearchFirmParam();
PageBean<TempFirmDto> result = queryService.getTempFirmList(param);
System.out.println(result);
}
@Test
public void getTest(){
TempFirmDto result = queryService.getTempFirmByClientId("2022062117474932");
System.out.println(result);
}
}

+ 4
- 0
facade/pom.xml Datei anzeigen

@@ -28,6 +28,10 @@
<groupId>com.51trust.rd</groupId>
<artifactId>common-model</artifactId>
</dependency>
<dependency>
<groupId>com.51trust.ywx</groupId>
<artifactId>ywx-customer-common</artifactId>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>


+ 56
- 0
facade/src/main/java/com/trust/ywx/customer/service/manager/FirmManagerService.java Datei anzeigen

@@ -0,0 +1,56 @@
package com.trust.ywx.customer.service.manager;

import com.trust.ywx.customer.common.exception.BizException;
import com.trust.ywx.customer.common.model.manager.request.TrustFirmParam;
import com.trust.ywx.customer.common.model.manager.response.TrustFirmDto;

/**
* <pre></pre>
*
* @文件名称: FirmManagerService.java
* @包 路 径: com.trust.ywx.customer.service.manager
* @Copyright:北京数字医信责任有限公司 (C) 2022 *
* @Description:
* @Version: V1.0
* @Author: hanzhenchao
* @Date:2022/6/15 18:55
* @Modify:
*/
public interface FirmManagerService {
/**
* 初始化客户
* 返回clientId和appSecret
* @param clientId
* @return
*/
TrustFirmDto init(String clientId);

/**
* 添加可信客户
*/
boolean add(TrustFirmParam param) throws BizException;

/**
* 更新可信客户
*/
boolean update(TrustFirmParam param) throws BizException;

/**
* 删除可信客户
*
* @param clientId
* @return
*/
boolean delete(String clientId);


/**
* 添加CA渠道客户
*/
boolean addCaChannelFirm();

/**
* 添加客户白名单
*/
boolean addFirmWhite();
}

+ 56
- 0
facade/src/main/java/com/trust/ywx/customer/service/manager/TempFirmManagerService.java Datei anzeigen

@@ -0,0 +1,56 @@
package com.trust.ywx.customer.service.manager;

import com.trust.ywx.customer.common.exception.BizException;
import com.trust.ywx.customer.common.model.manager.request.TempFirmParam;

/**
* <pre></pre>
*
* @文件名称: FirmManagerService.java
* @包 路 径: com.trust.ywx.customer.service.manager
* @Copyright:北京数字医信责任有限公司 (C) 2022 *
* @Description:
* @Version: V1.0
* @Author: hanzhenchao
* @Date:2022/6/15 18:55
* @Modify:
*/
public interface TempFirmManagerService {

/**
* 添加临时客户
* 互联网医院通过开放平台自注册临时客户,会在firm_info_temp表生成client_id
* 返回clientId
*
*/
String add(TempFirmParam param) throws BizException;

/**
* 更新临时客户
* @param param
* @return
* @throws BizException
*/
boolean update(TempFirmParam param) throws BizException;

/**
* 审核临时客户
* @param clientId
* @return
*/
boolean audit(String clientId) throws BizException;

/**
* 拒绝临时客户
* @param clientId
* @return
*/
boolean reject(String clientId) throws BizException;

/**
* 删除临时客户
* @param clientId
* @return
*/
boolean delete(String clientId);
}

+ 84
- 0
facade/src/main/java/com/trust/ywx/customer/service/query/FirmQueryService.java Datei anzeigen

@@ -0,0 +1,84 @@
package com.trust.ywx.customer.service.query;

import com.trust.ywx.customer.common.model.PageBean;
import com.trust.ywx.customer.common.model.manager.response.TempFirmDto;
import com.trust.ywx.customer.common.model.manager.response.TrustFirmDto;
import com.trust.ywx.customer.common.model.query.request.SearchCrmFirmParam;
import com.trust.ywx.customer.common.model.query.request.SearchFirmParam;
import com.trust.ywx.customer.common.model.query.request.SearchTrustFirmParam;
import com.trust.ywx.customer.common.model.query.response.CrmFirmDto;

import java.util.List;
import java.util.Map;

/**
* <pre></pre>
*
* @文件名称: FirmQueryService.java
* @包 路 径: com.trust.ywx.customer.service.query
* @Copyright:北京数字医信责任有限公司 (C) 2022 *
* @Description:
* @Version: V1.0
* @Author: hanzhenchao
* @Date:2022/6/14 19:34
* @Modify:
*/
public interface FirmQueryService {

//-------------------------可信客户--------------------

/**
* 获取可信客户列表 (分页)
* @param param
* @return
*/
PageBean<TrustFirmDto> getTrustFirmList(SearchTrustFirmParam param);

/**
* 获取可信客户详情 (不包括证书和厂商图标信息)
* @param clientId
* @return
*/
TrustFirmDto getTrustFirm(String clientId);

TrustFirmDto getTrustFirmWithBLOBs(String clientId);

/**
* 获取客户配置属性集合
* 主要给customer-client内部使用!
*/
Map<String,String> getAllProp(String clientId);

/**
* 查询客户白名单
* @param firmName
* @return
*/
List<TrustFirmDto> getFirmWhite(String firmName);

//------------------------临时客户--------------------
/**
* 获取待审核客户列表
* @param param
* @return
*/
PageBean<TempFirmDto> getTempFirmList(SearchFirmParam param);
/**
* 获取待审核客户详情
* @param clientId
* @return
*/
TempFirmDto getTempFirmByClientId(String clientId);


//-------------------------北京CA客户------------------------
/**
* 获取CRM<北京CA,...>客户列表
* @param param
*/
List<CrmFirmDto> getCrmFirmList(SearchCrmFirmParam param);




}

+ 38
- 15
pom.xml Datei anzeigen

@@ -56,6 +56,39 @@
<artifactId>common-util</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.51trust.rd</groupId>
<artifactId>common-redis</artifactId>
<version>1.0.0</version>
</dependency>

<dependency>
<groupId>com.51trust.ywx</groupId>
<artifactId>ywx-customer-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>

<!-- <dependency>-->
<!-- <groupId>jakarta.servlet</groupId>-->
<!-- <artifactId>jakarta.servlet-api</artifactId>-->
<!-- <version>4.0.3</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.dianping.cat</groupId>
<artifactId>cat-client</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>4.1.0</version>
</dependency>
<!--参数校验 -->
<dependency>
<groupId>org.hibernate.validator</groupId>
@@ -117,21 +150,11 @@
<artifactId>dubbo</artifactId>
<version>${dubbo.version}</version>
</dependency>
<!-- &lt;!&ndash;Curator 存在版本兼容问题。-->
<!-- Curator 2.x.x-兼容两个zk 3.4.x 和zk 3.5.x,-->
<!-- Curator 3.x.x-兼容兼容zk 3.5。 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>org.apache.curator</groupId>-->
<!-- <artifactId>curator-framework</artifactId>-->
<!-- <version>2.10.0</version>-->
<!-- </dependency>-->

<!-- <dependency>-->
<!-- <groupId>org.apache.curator</groupId>-->
<!-- <artifactId>curator-recipes</artifactId>-->
<!-- <version>2.10.0</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; dubbo rigister zk end &ndash;&gt;-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.83</version>
</dependency>

</dependencies>
</dependencyManagement>


Laden…
Abbrechen
Speichern