diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java index 222250510f..9c2f1c506f 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java @@ -20,6 +20,11 @@ public class SubmitAuditFormDTO implements Serializable { */ private String codeId; + /** + * 是否加急 + */ + private Boolean isSpeed; + /** * 小程序版本说明和功能解释 */ diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AccountBasicInfoResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AccountBasicInfoResultDTO.java new file mode 100644 index 0000000000..4a6f221c8d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AccountBasicInfoResultDTO.java @@ -0,0 +1,129 @@ +package com.epmet.dto.result; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/6 10:50 + */ +@NoArgsConstructor +@Data +public class AccountBasicInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -5111203845293330004L; + /** + * 帐号 appid + */ + @SerializedName("appid") + private String appid; + /** + * 帐号类型(1:订阅号,2:服务号,3:小程序) + */ + @SerializedName("account_type") + private Integer accountType; + /** + * 主体类型 0.个人 1.企业 2.媒体 3.政府 4.其他组织 + */ + @SerializedName("principal_type") + private Integer principalType; + /** + * 主体名称 + */ + @SerializedName("principal_name") + private String principalName; + /** + * 实名验证状态 1.实名验证成功 2.实名验证中 3.实名验证失败 + */ + @SerializedName("realname_status") + private Integer realnameStatus; + /** + * 微信认证信息 + */ + @SerializedName("wx_verify_info") + private WxVerifyInfoBean wxVerifyInfo; + /** + * 功能介绍信息 + */ + @SerializedName("signature_info") + private SignatureInfoBean signatureInfo; + /** + * 头像信息 + */ + @SerializedName("head_image_info") + private HeadImageInfoBean headImageInfo; + + @NoArgsConstructor + @Data + public static class WxVerifyInfoBean { + /** + * 是否资质认证,若是,拥有微信认证相关的权限。 + */ + @SerializedName("qualification_verify") + private Boolean qualificationVerify; + /** + * 是否名称认证 + */ + @SerializedName("naming_verify") + private Boolean namingVerify; + /** + * 是否需要年审(qualification_verify == true 时才有该字段) + */ + @SerializedName("annual_review") + private Boolean annualReview; + /** + * 年审开始时间,时间戳(qualification_verify == true 时才有该字段) + */ + @SerializedName("annual_review_begin_time") + private String annualReviewBeginTime; + /** + * 年审截止时间,时间戳(qualification_verify == true 时才有该字段) + */ + @SerializedName("annual_review_end_time") + private String annualReviewEndTime; + } + + @NoArgsConstructor + @Data + public static class SignatureInfoBean { + /** + * 功能介绍 + */ + @SerializedName("signature") + private String signature; + /** + * 功能介绍已使用修改次数(本月) + */ + @SerializedName("modify_used_count") + private Integer modifyUsedCount; + /** + * 功能介绍修改次数总额度(本月) + */ + @SerializedName("modify_quota") + private Integer modifyQuota; + } + + @NoArgsConstructor + @Data + public static class HeadImageInfoBean { + /** + * 头像 url + */ + @SerializedName("head_image_url") + private String headImageUrl; + /** + * 头像已使用修改次数(本月) + */ + @SerializedName("modify_used_count") + private Integer modifyUsedCount; + /** + * 头像修改次数总额度(本月) + */ + @SerializedName("modify_quota") + private Integer modifyQuota; + } +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/GetCategoryResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/GetCategoryResultDTO.java new file mode 100644 index 0000000000..9dd7117852 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/GetCategoryResultDTO.java @@ -0,0 +1,69 @@ +package com.epmet.dto.result; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/6 10:03 + */ +@NoArgsConstructor +@Data +public class GetCategoryResultDTO implements Serializable { + + private static final long serialVersionUID = -6803569581887971887L; + /** + * 一个更改周期内可以添加类目的次数 + */ + private Integer limit; + /** + * 本更改周期内还可以添加类目的次数 + */ + private Integer quota; + /** + * 最多可以设置的类目数量 + */ + private Integer categoryLimit; + /** + * 已设置的类目信息列表 + */ + private List categories; + + @NoArgsConstructor + @Data + public static class CategoriesBean { + /** + * 一级类目 ID + */ + private Integer first; + /** + * 一级类目名称 + */ + @SerializedName("first_name") + private String firstName; + /** + * 二级类目 ID + */ + private Integer second; + /** + * 二级类目名称 + */ + @SerializedName("second_name") + private String secondName; + /** + * 审核状态(1 审核中 2 审核不通过 3 审核通过) + */ + @SerializedName("audit_status") + private Integer auditStatus; + /** + * 审核不通过的原因 + */ + @SerializedName("audit_reason") + private String auditReason; + } +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/SupportVersionResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/SupportVersionResultDTO.java index 6a75b4972c..57092a3755 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/SupportVersionResultDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/SupportVersionResultDTO.java @@ -31,7 +31,7 @@ public class SupportVersionResultDTO implements Serializable { /** * 百分比 */ - private int percentage; + private Integer percentage; /** * 基础库版本号 */ diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java index 36e561394e..25cc536e72 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java @@ -6,10 +6,8 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.service.CodeService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -203,4 +201,10 @@ public class CodeController { List result = codeService.getCategory(formDTO); return new Result>().ok(result); } + + @PostMapping("setdomain/{customerId}") + public Result setDomain(@PathVariable("customerId") String customerId) { + codeService.setDomain(customerId); + return new Result<>(); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerController.java index cbff84f9e3..ef9f3d3425 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerController.java @@ -137,7 +137,7 @@ public class PaCustomerController { * @return com.epmet.commons.tools.utils.Result */ @PostMapping(value = "getweappsupportversion") - public Result getSupportVersion( @RequestBody CustomerClientFormDTO formDTO) { + public Result getSupportVersion(@RequestBody CustomerClientFormDTO formDTO) { return new Result().ok( paCustomerService.getSupportVersion(formDTO)); } @@ -149,9 +149,35 @@ public class PaCustomerController { * @return com.epmet.commons.tools.utils.Result */ @PostMapping(value = "setweappsupportversion") - public Result setSupportVersion( @RequestBody CustomerClientFormDTO formDTO) { + public Result setSupportVersion(@RequestBody CustomerClientFormDTO formDTO) { paCustomerService.getSupportVersion(formDTO); return new Result(); } + + /** + * 获取已设置的所有类目 + * @author zhaoqifeng + * @date 2020/8/6 14:36 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping(value = "getcategory") + public Result getSetCategory(@RequestBody CustomerClientFormDTO formDTO) { + return new Result().ok(paCustomerService.getSetCategory(formDTO)); + } + + /** + * 获取基本信息 + * @author zhaoqifeng + * @date 2020/8/6 14:36 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping(value = "getaccountbasicinfo") + public Result getAccountBasicInfo(@RequestBody CustomerClientFormDTO formDTO) { + return new Result().ok(paCustomerService.getAccountBasicInfo(formDTO)); + } + + } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java index 3d26bcffab..88ba820fba 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java @@ -90,4 +90,13 @@ public interface AuthorizationInfoDao extends BaseDao { */ AuthCodeResultDTO selectCustomerIdByAuthAppId(@Param("authAppId")String authAppId); + /** + * 根据客户ID,客户端类型获取授权信息 + * @author zhaoqifeng + * @date 2020/8/6 15:36 + * @param customerId + * @return java.util.List + */ + List getAuthInfoByCustomerId(@Param("customerId") String customerId); + } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java index cdd7123ade..19928c70f6 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java @@ -139,4 +139,13 @@ public interface CodeService { */ List getCategory(CodeCommonFormDTO formDTO); + /** + * 设置服务器域名和业务域名 + * @author zhaoqifeng + * @date 2020/8/6 15:34 + * @param customerId + * @return int + */ + void setDomain(String customerId); + } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerService.java index fec268261b..88259e13c9 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerService.java @@ -186,4 +186,22 @@ public interface PaCustomerService extends BaseService { * @return void */ void setSupportVersion(CustomerClientFormDTO formDTO); + + /** + * 获取已设置的所有类目 + * @author zhaoqifeng + * @date 2020/8/6 14:36 + * @param formDTO + * @return com.epmet.dto.result.GetCategoryResultDTO + */ + GetCategoryResultDTO getSetCategory(CustomerClientFormDTO formDTO); + + /** + * 获取基本信息 + * @author zhaoqifeng + * @date 2020/8/6 14:36 + * @param formDTO + * @return com.epmet.dto.result.AccountBasicInfoResultDTO + */ + AccountBasicInfoResultDTO getAccountBasicInfo(CustomerClientFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java index 836261721b..a922fbd20b 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -166,19 +166,6 @@ public class CodeServiceImpl implements CodeService { codeCustomerDTO.setStatus(CodeConstant.UNAUDITED); String codeId = codeCustomerService.save(codeCustomerDTO); - //设置服务器域名 - wxResult = wxMaCodeService.modifyDomain(authInfo.getAuthorizerAccessToken()); - if (!wxResult.success()) { - saveOperation(formDTO.getCustomerId(), null, formDTO.getUserVersion(), CodeConstant.OPER_UPLOAD, wxResult.getErrorMsg()); - throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); - } - //设置业务域名 - wxResult = wxMaCodeService.setWebviewDomain(authInfo.getAuthorizerAccessToken()); - if (!wxResult.success()) { - saveOperation(formDTO.getCustomerId(), null, formDTO.getUserVersion(), CodeConstant.OPER_UPLOAD, wxResult.getErrorMsg()); - throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); - } - saveOperation(formDTO.getCustomerId(), codeId, formDTO.getUserVersion(), CodeConstant.OPER_UPLOAD, "上传成功"); } @@ -250,6 +237,17 @@ public class CodeServiceImpl implements CodeService { wxResult.getErrorMsg()); throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); } + if(formDTO.getIsSpeed()) { + //调用微信API 加急审核 + WxMaSpeedUpAuditReq speedRequest = new WxMaSpeedUpAuditReq(); + speedRequest.setAuditId(wxResult.getData()); + WxResult wxSpeedResult = wxMaCodeService.speedUpAudit(authInfo.getAuthorizerAccessToken(), speedRequest); + if (!wxSpeedResult.success()) { + saveOperation(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getId(), codeCustomerDTO.getUserVersion(), CodeConstant.OPER_SUBMIT, + wxSpeedResult.getErrorMsg()); + throw new RenException(wxSpeedResult.getErrorCode(), wxSpeedResult.getErrorMsg()); + } + } //获取审核结果信息 CodeAuditResultDTO codeAuditResultDTO = codeAuditResultService.getAuditResultByCodeId(formDTO.getCodeId()); if (null == codeAuditResultDTO) { @@ -504,6 +502,26 @@ public class CodeServiceImpl implements CodeService { return ConvertUtils.sourceToTarget(wxResult.getData(), CategoryResultDTO.class); } + @Override + public void setDomain(String customerId) { + List authInfoList = authorizationInfoDao.getAuthInfoByCustomerId(customerId); + if (null == authInfoList || authInfoList.size() == NumConstant.ZERO) { + throw new RenException("没有有效的Access Token"); + } + authInfoList.forEach(authInfo -> { + //设置服务器域名 + WxResult wxResult = wxMaCodeService.modifyDomain(authInfo.getAuthorizerAccessToken()); + if (!wxResult.success()) { + throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); + } + //设置业务域名 + wxResult = wxMaCodeService.setWebviewDomain(authInfo.getAuthorizerAccessToken()); + if (!wxResult.success()) { + throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); + } + }); + } + private void saveOperation(String customerId, String codeId, String version, String operation, String describe) { CodeOperationHistoryDTO operationDTO = new CodeOperationHistoryDTO(); operationDTO.setCustomerId(customerId); diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java index 3e2f971062..806be0f664 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java @@ -31,7 +31,6 @@ import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; -import com.epmet.constant.CodeConstant; import com.epmet.constant.PaConstant; import com.epmet.dao.*; import com.epmet.dto.*; @@ -44,6 +43,8 @@ import com.epmet.service.PaCustomerAgencyService; import com.epmet.service.PaCustomerService; import com.epmet.service.PaCustomerUserAgencyService; import com.epmet.wxapi.param.WxSetWeAppSupportVersionReq; +import com.epmet.wxapi.result.WxBasicInfoResult; +import com.epmet.wxapi.result.WxOpenGetCategoryResult; import com.epmet.wxapi.result.WxResult; import com.epmet.wxapi.result.WxSupportVersionResult; import com.epmet.wxapi.service.WxMaCodeService; @@ -596,4 +597,40 @@ public class PaCustomerServiceImpl extends BaseServiceImpl wxResult = wxMaCodeService.getSetCategory(authInfo.getAuthorizerAccessToken()); + if (!wxResult.success()) { + throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); + } + WxOpenGetCategoryResult categoryResult = wxResult.getData(); + result = ConvertUtils.sourceToTarget(categoryResult, GetCategoryResultDTO.class); + return result; + } + + @Override + public AccountBasicInfoResultDTO getAccountBasicInfo(CustomerClientFormDTO formDTO) { + //获取小程序调用令牌 + AccountBasicInfoResultDTO result; + AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); + if (null == authInfo) { + throw new RenException("未授权"); + } + //调用微信API + WxResult wxResult = wxMaCodeService.getAccountBasicInfo(authInfo.getAuthorizerAccessToken()); + if (!wxResult.success()) { + throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); + } + WxBasicInfoResult basicInfoResult = wxResult.getData(); + result = ConvertUtils.sourceToTarget(basicInfoResult, AccountBasicInfoResultDTO.class); + return result; + } + } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java index f27eaff2c1..08f17ae49a 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java @@ -171,5 +171,18 @@ public interface WxMaCodeConstant { */ String GET_TEMPLATE_URL = "https://api.weixin.qq.com/wxa/gettemplatelist"; + /** + * 获取基本信息 + */ + String GET_BASIC_INFO_URL = "https://api.weixin.qq.com/cgi-bin/account/getaccountbasicinfo"; + /** + * 获取已设置的所有类目 + */ + String GET_SET_CATEGORY_URL = "https://api.weixin.qq.com/cgi-bin/wxopen/getcategory"; + + /** + * 加急审核申请 + */ + String SPEED_UP_AUDIT_URL = "https://api.weixin.qq.com/wxa/speedupaudit"; } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaSpeedUpAuditReq.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaSpeedUpAuditReq.java new file mode 100644 index 0000000000..7f07a4bb8b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaSpeedUpAuditReq.java @@ -0,0 +1,21 @@ +package com.epmet.wxapi.param; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/6 15:10 + */ +@Data +public class WxMaSpeedUpAuditReq implements Serializable { + private static final long serialVersionUID = 3042725610534211385L; + /** + * 审核单ID + */ + @SerializedName("auditid") + private String auditId; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxBasicInfoResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxBasicInfoResult.java new file mode 100644 index 0000000000..adc88ce88b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxBasicInfoResult.java @@ -0,0 +1,66 @@ +package com.epmet.wxapi.result; + +import com.epmet.dto.result.AccountBasicInfoResultDTO; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/6 14:05 + */ +@Data +public class WxBasicInfoResult implements Serializable { + private static final long serialVersionUID = -9027187315142350899L; + /** + * 返回码 + */ + private Integer errcode; + /** + * 错误信息 + */ + private String errmsg; + /** + * 帐号 appid + */ + @SerializedName("appid") + private String appid; + /** + * 帐号类型(1:订阅号,2:服务号,3:小程序) + */ + @SerializedName("account_type") + private Integer accountType; + /** + * 主体类型 0.个人 1.企业 2.媒体 3.政府 4.其他组织 + */ + @SerializedName("principal_type") + private Integer principalType; + /** + * 主体名称 + */ + @SerializedName("principal_name") + private String principalName; + /** + * 实名验证状态 1.实名验证成功 2.实名验证中 3.实名验证失败 + */ + @SerializedName("realname_status") + private Integer realnameStatus; + /** + * 微信认证信息 + */ + @SerializedName("wx_verify_info") + private AccountBasicInfoResultDTO.WxVerifyInfoBean wxVerifyInfo; + /** + * 功能介绍信息 + */ + @SerializedName("signature_info") + private AccountBasicInfoResultDTO.SignatureInfoBean signatureInfo; + /** + * 头像信息 + */ + @SerializedName("head_image_info") + private AccountBasicInfoResultDTO.HeadImageInfoBean headImageInfo; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxOpenGetCategoryResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxOpenGetCategoryResult.java new file mode 100644 index 0000000000..609679cc5a --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxOpenGetCategoryResult.java @@ -0,0 +1,44 @@ +package com.epmet.wxapi.result; + +import com.epmet.dto.result.GetCategoryResultDTO; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/6 10:11 + */ +@NoArgsConstructor +@Data +public class WxOpenGetCategoryResult { + + /** + * 返回码 + */ + private Integer errcode; + /** + * 错误信息 + */ + private String errmsg; + /** + * 一个更改周期内可以添加类目的次数 + */ + private Integer limit; + /** + * 本更改周期内还可以添加类目的次数 + */ + private Integer quota; + /** + * 最多可以设置的类目数量类目信息说明 + */ + @SerializedName("category_limit") + private Integer categoryLimit; + /** + * 已设置的类目信息列表 + */ + private List categories; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxSupportVersionResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxSupportVersionResult.java index f15ab9f48b..c9cced8352 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxSupportVersionResult.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxSupportVersionResult.java @@ -48,7 +48,7 @@ public class WxSupportVersionResult implements Serializable { /** * 百分比 */ - private int percentage; + private Integer percentage; /** * 基础库版本号 */ diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java index 6f41f29539..28212e5674 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java @@ -72,6 +72,16 @@ public interface WxMaCodeService { */ WxResult submitAudit(String accessToken, WxMaCodeSubmitAuditRequest auditRequest); + /** + * 加急审核申请 + * @author zhaoqifeng + * @date 2020/8/6 15:11 + * @param accessToken + * @param request + * @return com.epmet.wxapi.result.WxResult + */ + WxResult speedUpAudit(String accessToken, WxMaSpeedUpAuditReq request); + /** * 查询指定版本审核状态(仅供第三方代小程序调用). * @@ -161,4 +171,24 @@ public interface WxMaCodeService { * @date 2020/8/5 16:06 */ WxResult setWeAppSupportVersion(String accessToken, WxSetWeAppSupportVersionReq request); + + /** + * 获取已设置的所有类目 + * + * @param accessToken + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/8/6 10:47 + */ + WxResult getSetCategory(String accessToken); + + /** + * 获取基本信息 + * + * @param accessToken + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/8/6 14:07 + */ + WxResult getAccountBasicInfo(String accessToken); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java index 1f92c3b1fd..e91b31cee6 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.wxapi.service.impl; import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.wxapi.constant.WxMaCodeConstant; @@ -147,6 +148,22 @@ public class WxMaCodeServiceImpl implements WxMaCodeService { return result; } + @Override + public WxResult speedUpAudit(String accessToken, WxMaSpeedUpAuditReq request) { + WxResult result = new WxResult(); + String url = WxMaCodeConstant.SPEED_UP_AUDIT_URL + "?" + "access_token=" + accessToken; + Result submitResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if (!submitResult.success()) { + result.setErrorCode(submitResult.getCode()); + result.setErrorMsg(submitResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(submitResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(jsonObject.getInteger(ERR_CODE))); + return result; + } + @Override public WxResult getAuditStatus(String accessToken, WxMaCodeAuditStatusReq request) { WxResult result = new WxResult<>(); @@ -308,6 +325,48 @@ public class WxMaCodeServiceImpl implements WxMaCodeService { return result; } + @Override + public WxResult getSetCategory(String accessToken) { + WxResult result = new WxResult<>(); + String url = WxMaCodeConstant.GET_SET_CATEGORY_URL + "?" + "access_token=" + accessToken; + Result statusResult = HttpClientManager.getInstance().sendGet(url, null); + if (!statusResult.success()) { + result.setErrorCode(statusResult.getCode()); + result.setErrorMsg(statusResult.getMsg()); + return result; + } + Gson gson = new Gson(); + WxOpenGetCategoryResult categoryResult = gson.fromJson(statusResult.getData(), WxOpenGetCategoryResult.class); + if (categoryResult.getErrcode() != NumConstant.ZERO) { + result.setErrorCode(categoryResult.getErrcode()); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(categoryResult.getErrcode())); + return result; + } + result.ok(categoryResult); + return result; + } + + @Override + public WxResult getAccountBasicInfo(String accessToken) { + WxResult result = new WxResult<>(); + String url = WxMaCodeConstant.GET_BASIC_INFO_URL + "?" + "access_token=" + accessToken; + Result statusResult = HttpClientManager.getInstance().sendGet(url, null); + if (!statusResult.success()) { + result.setErrorCode(statusResult.getCode()); + result.setErrorMsg(statusResult.getMsg()); + return result; + } + Gson gson = new Gson(); + WxBasicInfoResult basicInfoResult = gson.fromJson(statusResult.getData(), WxBasicInfoResult.class); + if (basicInfoResult.getErrcode() != NumConstant.ZERO) { + result.setErrorCode(basicInfoResult.getErrcode()); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(basicInfoResult.getErrcode())); + return result; + } + result.ok(basicInfoResult); + return result; + } + private String toJson(Object object) { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.setPrettyPrinting(); diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml index ec104db583..b06647013c 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml @@ -90,5 +90,13 @@ del_flag = 0 AND authorizer_appid = #{authAppId} + \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 06413c8a1e..219ad17f20 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -526,6 +526,14 @@ public class CustomerServiceImpl extends BaseServiceImpl