| @@ -57,6 +57,10 @@ public class WxAuthorizerInfo implements Serializable { | |||||
| private Integer templateStatus; | private Integer templateStatus; | ||||
| @io.swagger.annotations.ApiModelProperty(value="微信小程序模板设置时间",name="templateTime") | @io.swagger.annotations.ApiModelProperty(value="微信小程序模板设置时间",name="templateTime") | ||||
| private Date templateTime; | private Date templateTime; | ||||
| @io.swagger.annotations.ApiModelProperty(value="小程序每月审核撤回次数",name="auditBackNum") | |||||
| private Integer auditBackNum; | |||||
| @io.swagger.annotations.ApiModelProperty(value="微信小程序审核最后撤回时间",name="auditBackTime") | |||||
| private Date auditBackTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="当前版本",name="currentVersion") | @io.swagger.annotations.ApiModelProperty(value="当前版本",name="currentVersion") | ||||
| private String currentVersion; | private String currentVersion; | ||||
| @io.swagger.annotations.ApiModelProperty(value="当前版本描述",name="currentDesc") | @io.swagger.annotations.ApiModelProperty(value="当前版本描述",name="currentDesc") | ||||
| @@ -96,6 +100,8 @@ public class WxAuthorizerInfo implements Serializable { | |||||
| ,WebDomainTime_ASC("`webdomain_time` ASC"),WebDomainTime_DESC("`webdomain_time` DESC") | ,WebDomainTime_ASC("`webdomain_time` ASC"),WebDomainTime_DESC("`webdomain_time` DESC") | ||||
| ,TemplateStatus_ASC("`template_status` ASC"),TemplateStatus_DESC("`template_status` DESC") | ,TemplateStatus_ASC("`template_status` ASC"),TemplateStatus_DESC("`template_status` DESC") | ||||
| ,TemplateTime_ASC("`template_time` ASC"),TemplateTime_DESC("`template_time` DESC") | ,TemplateTime_ASC("`template_time` ASC"),TemplateTime_DESC("`template_time` DESC") | ||||
| ,AuditBackNum_ASC("`audit_back_num` ASC"),AuditBackNum_DESC("`audit_back_num` DESC") | |||||
| ,AuditBackTime_ASC("`audit_back_time` ASC"),AuditBackTime_DESC("`audit_back_time` DESC") | |||||
| ,CurrentVersion_ASC("`current_version` ASC"),CurrentVersion_DESC("`current_version` DESC") | ,CurrentVersion_ASC("`current_version` ASC"),CurrentVersion_DESC("`current_version` DESC") | ||||
| ,CurrentDesc_ASC("`current_desc` ASC"),CurrentDesc_DESC("`current_desc` DESC") | ,CurrentDesc_ASC("`current_desc` ASC"),CurrentDesc_DESC("`current_desc` DESC") | ||||
| ,ReleaseTime_ASC("`release_time` ASC"),ReleaseTime_DESC("`release_time` DESC") | ,ReleaseTime_ASC("`release_time` ASC"),ReleaseTime_DESC("`release_time` DESC") | ||||
| @@ -21,6 +21,8 @@ public interface WxAuthorizerInfoMapper extends CommonMapper<WxAuthorizerInfo, L | |||||
| int updateAccessToken(WxAuthorizerInfo wxAuthorizerInfo); | int updateAccessToken(WxAuthorizerInfo wxAuthorizerInfo); | ||||
| int updateAuthBackInfo(WxAuthorizerInfo wxAuthorizerInfo); | |||||
| int removeOpenAppId(WxAuthorizerInfo wxAuthorizerInfo); | int removeOpenAppId(WxAuthorizerInfo wxAuthorizerInfo); | ||||
| List<WxWeappInfo> findWeappList(); | List<WxWeappInfo> findWeappList(); | ||||
| @@ -82,4 +82,6 @@ public interface WxAuthorizerInfoService { | |||||
| int updateAuthAppidInfo(WxAuthorizerInfo record); | int updateAuthAppidInfo(WxAuthorizerInfo record); | ||||
| int updateAuthBackInfo(WxAuthorizerInfo record); | |||||
| } | } | ||||
| @@ -12,6 +12,7 @@ import com.iformall.mapper.WxAppinfoMapper; | |||||
| import com.iformall.mapper.WxAuthorizerInfoMapper; | import com.iformall.mapper.WxAuthorizerInfoMapper; | ||||
| import com.iformall.mapper.WxWeappExtSetMapper; | import com.iformall.mapper.WxWeappExtSetMapper; | ||||
| import com.iformall.service.WxAuthorizerInfoService; | import com.iformall.service.WxAuthorizerInfoService; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -204,6 +205,26 @@ public class WxAuthorizerInfoServiceImpl implements WxAuthorizerInfoService { | |||||
| } | } | ||||
| @Override | |||||
| public int updateAuthBackInfo(WxAuthorizerInfo record) { | |||||
| WxAuthorizerInfo authorizerInfo = authorizerInfoMapper.findByAppid(record.getAuthorizerAppid()); | |||||
| if(authorizerInfo != null) { | |||||
| if(DateUtils.isSameMonth(authorizerInfo.getAuditBackTime(), record.getAuditBackTime())) | |||||
| { | |||||
| // 同一个月,增加 | |||||
| record.setId(authorizerInfo.getId()); | |||||
| return authorizerInfoMapper.updateAuthBackInfo(record); | |||||
| } else { | |||||
| // 不是同一个月,重置authBackNum | |||||
| record.setAuditBackNum(1); | |||||
| return authorizerInfoMapper.updateByPrimaryKeySelective(record); | |||||
| } | |||||
| } else { | |||||
| /// TODO | |||||
| } | |||||
| return 0; | |||||
| } | |||||
| @@ -147,6 +147,12 @@ | |||||
| where `authorizer_appid` = #{authorizerAppid} | where `authorizer_appid` = #{authorizerAppid} | ||||
| </update> | </update> | ||||
| <update id="updateAuthBackInfo" parameterType="com.iformall.domain.po.WxAuthorizerInfo"> | |||||
| update wx_authorizer_info | |||||
| set `auth_back_num` = `auth_back_num` + 1, `auth_back_time` = #{authBackTime} | |||||
| where `authorizer_appid` = #{authorizerAppid} | |||||
| </update> | |||||
| <update id="removeOpenAppId" parameterType="com.iformall.domain.po.WxAuthorizerInfo"> | <update id="removeOpenAppId" parameterType="com.iformall.domain.po.WxAuthorizerInfo"> | ||||
| update wx_authorizer_info | update wx_authorizer_info | ||||
| set `open_appid` = null, `bind_open_time` = null | set `open_appid` = null, `bind_open_time` = null | ||||
| @@ -637,11 +637,18 @@ public class WechatWeappCodeController { | |||||
| try { | try { | ||||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | ||||
| WxOpenResult openResult = openMaService.undoCodeAudit(); | WxOpenResult openResult = openMaService.undoCodeAudit(); | ||||
| Date curDate = new Date(); | |||||
| if(openResult.isSuccess()) { | if(openResult.isSuccess()) { | ||||
| // 审核状态 | |||||
| auditStatus.setAuditStatus(EnumWeappAuditStatus.UNDO.getCode()); | auditStatus.setAuditStatus(EnumWeappAuditStatus.UNDO.getCode()); | ||||
| auditStatus.setAuditErrCode(gson.toJson(openResult)); | auditStatus.setAuditErrCode(gson.toJson(openResult)); | ||||
| auditStatus.setAuditTime(new Date()); | |||||
| auditStatus.setAuditTime(curDate); | |||||
| weappAuditStatusService.updateStatus(auditStatus); | weappAuditStatusService.updateStatus(auditStatus); | ||||
| // 审核次数记入wx_authorizer_info | |||||
| WxAuthorizerInfo authorizerInfo = new WxAuthorizerInfo(); | |||||
| authorizerInfo.setAuthorizerAppid(appId); | |||||
| authorizerInfo.setAuditBackTime(curDate); | |||||
| authorizerInfoService.updateAuthBackInfo(authorizerInfo); | |||||
| return new ResultData("审核撤回成功"); | return new ResultData("审核撤回成功"); | ||||
| } | } | ||||
| return new ResultData(Result.ERROR, "审核撤回失败"); | return new ResultData(Result.ERROR, "审核撤回失败"); | ||||