|
|
|
@@ -24,6 +24,7 @@ import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.models.auth.In; |
|
|
|
import me.chanjar.weixin.common.error.WxErrorException; |
|
|
|
import me.chanjar.weixin.open.api.WxOpenMaService; |
|
|
|
import me.chanjar.weixin.open.bean.ma.WxMaOpenCommitExtInfo; |
|
|
|
@@ -313,21 +314,40 @@ public class WxWeappInfoController extends BaseController { |
|
|
|
return keyArr; |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "批量授权的小程序上传code", notes = "{\"apps\":\"appid,appid\",\"templateId\":\"String\",\"userVersion\":\"String\",\"userDesc\":\"String\"}") |
|
|
|
@ApiOperation(value = "批量授权的小程序code提交", notes = "{\"apps\":\"appid,appid\",\"templateId\":\"String\",\"type\":\"String\",\"userVersion\":\"String\",\"userDesc\":\"String\"}") |
|
|
|
@PostMapping("batchCodeCommit") |
|
|
|
public ResultData batchCodeCommit(@RequestBody Map<String, String> params) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxWeappInfoController::batchExtSet"); |
|
|
|
String appsStr = params.get("apps"); |
|
|
|
String templateIdStr = params.get("templateId"); |
|
|
|
String typeStr = params.get("type"); |
|
|
|
String userVersion = params.get("userVersion"); |
|
|
|
String userDesc = params.get("userDesc"); |
|
|
|
|
|
|
|
Integer type = null; |
|
|
|
Long templateId = null; |
|
|
|
try { |
|
|
|
templateId = Long.parseLong(templateIdStr); |
|
|
|
type = Integer.parseInt(typeStr); |
|
|
|
} catch (Exception e) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(appsStr)) { |
|
|
|
WxWeappInfo authQ = new WxWeappInfo(); |
|
|
|
authQ.setType(type); |
|
|
|
List<WxWeappInfo> appList = authorizerInfoService.getList(authQ); |
|
|
|
appsStr = ""; |
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
boolean bfirst = true; |
|
|
|
for(WxWeappInfo app: appList) { |
|
|
|
if(bfirst) { |
|
|
|
sb.append(app.getAuthorizerAppid()); |
|
|
|
bfirst = false; |
|
|
|
} else { |
|
|
|
sb.append(app.getAuthorizerAppid()).append(","); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String [] apps = appsStr.split(","); |
|
|
|
// 逐一检查app的设置 |
|
|
|
for(String appId: apps) { |
|
|
|
@@ -390,12 +410,35 @@ public class WxWeappInfoController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "小程序批量提交审核", notes = "{\"apps\":\"appid,appid\",\"userVersion\":\"String\"}") |
|
|
|
@ApiOperation(value = "小程序批量提交审核", notes = "{\"type\":\"String\",\"userVersion\":\"String\",\"apps\":\"appid,appid\"}") |
|
|
|
@PostMapping("batchCodeAudit") |
|
|
|
public ResultData batchCodeAudit(@RequestBody Map<String, String> params) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxWeappInfoController::batchExtSet"); |
|
|
|
String appsStr = params.get("apps"); |
|
|
|
String typeStr = params.get("type"); |
|
|
|
String userVersion = params.get("userVersion"); |
|
|
|
Integer type = null; |
|
|
|
try { |
|
|
|
type = Integer.parseInt(typeStr); |
|
|
|
} catch (Exception e) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(appsStr)) { |
|
|
|
WxWeappInfo authQ = new WxWeappInfo(); |
|
|
|
authQ.setType(type); |
|
|
|
List<WxWeappInfo> appList = authorizerInfoService.getList(authQ); |
|
|
|
appsStr = ""; |
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
boolean bfirst = true; |
|
|
|
for(WxWeappInfo app: appList) { |
|
|
|
if(bfirst) { |
|
|
|
sb.append(app.getAuthorizerAppid()); |
|
|
|
bfirst = false; |
|
|
|
} else { |
|
|
|
sb.append(app.getAuthorizerAppid()).append(","); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String [] apps = appsStr.split(","); |
|
|
|
// 逐一检查app的设置 |
|
|
|
for(String appId: apps) { |
|
|
|
@@ -572,13 +615,23 @@ public class WxWeappInfoController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "批量审核查询", notes = "{\"version\":\"string\"}") |
|
|
|
@ApiOperation(value = "批量审核查询", notes = "{\"type\":\"string\",\"version\":\"string\"}") |
|
|
|
@PostMapping("batchAuditQuery") |
|
|
|
public ResultData batchAuditQuery(@RequestBody Map<String, String> params) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxWeappInfoController::batchAuditQuery"); |
|
|
|
Gson gson = new GsonBuilder().create(); |
|
|
|
String typeStr = params.get("type"); |
|
|
|
String version = params.get("version"); |
|
|
|
Integer type = null; |
|
|
|
try { |
|
|
|
type = Integer.parseInt(typeStr); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
} |
|
|
|
WxWeappAuditStatusVo queryVo = new WxWeappAuditStatusVo(); |
|
|
|
if(StringUtils.isNotBlank(typeStr)) { |
|
|
|
queryVo.setType(type); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(version)) { |
|
|
|
queryVo.setUserVersion(version); |
|
|
|
} |
|
|
|
@@ -598,7 +651,6 @@ public class WxWeappInfoController extends BaseController { |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
auditStatus.setAuditStatus(EnumWeappAuditStatus.FAIL.getCode()); |
|
|
|
auditStatus.setAuditErrCode(gson.toJson(openResult)); |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
auditStatus.setAuditStatus(EnumWeappAuditStatus.AUDITING.getCode()); |
|
|
|
@@ -610,6 +662,7 @@ public class WxWeappInfoController extends BaseController { |
|
|
|
auditStatus.setAuditStatus(EnumWeappAuditStatus.AUDITING.getCode()); |
|
|
|
break; |
|
|
|
} |
|
|
|
auditStatus.setAuditErrCode(gson.toJson(openResult)); |
|
|
|
auditStatus.setAuditid(openResult.getAuditId()); |
|
|
|
auditStatus.setAuditTime(new Date()); |
|
|
|
weappAuditStatusService.updateStatus(auditStatus); |
|
|
|
@@ -621,13 +674,23 @@ public class WxWeappInfoController extends BaseController { |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "批量审核撤回", notes = "{\"version\":\"string\"}") |
|
|
|
@ApiOperation(value = "批量审核撤回", notes = "{\"type\":\"string\",\"version\":\"string\"}") |
|
|
|
@PostMapping("batchAuditCancel") |
|
|
|
public ResultData batchAuditCancel(@RequestBody Map<String, String> params) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxWeappInfoController::batchAuditCancel"); |
|
|
|
Gson gson = new GsonBuilder().create(); |
|
|
|
String typeStr = params.get("type"); |
|
|
|
String version = params.get("version"); |
|
|
|
Integer type = null; |
|
|
|
try { |
|
|
|
type = Integer.parseInt(typeStr); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
} |
|
|
|
WxWeappAuditStatusVo queryVo = new WxWeappAuditStatusVo(); |
|
|
|
if(StringUtils.isNotBlank(typeStr)) { |
|
|
|
queryVo.setType(type); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(version)) { |
|
|
|
queryVo.setUserVersion(version); |
|
|
|
} |
|
|
|
@@ -657,8 +720,18 @@ public class WxWeappInfoController extends BaseController { |
|
|
|
public ResultData batchRelease(@RequestBody Map<String, String> params) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxWeappInfoController::batchRelease"); |
|
|
|
Gson gson = new GsonBuilder().create(); |
|
|
|
String typeStr = params.get("type"); |
|
|
|
String version = params.get("version"); |
|
|
|
Integer type = null; |
|
|
|
try { |
|
|
|
type = Integer.parseInt(typeStr); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
} |
|
|
|
WxWeappAuditStatusVo queryVo = new WxWeappAuditStatusVo(); |
|
|
|
if(StringUtils.isNotBlank(typeStr)) { |
|
|
|
queryVo.setType(type); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(version)) { |
|
|
|
queryVo.setUserVersion(version); |
|
|
|
} |
|
|
|
@@ -781,10 +854,11 @@ public class WxWeappInfoController extends BaseController { |
|
|
|
@ApiOperation("小程序审核版本列表") |
|
|
|
@GetMapping("auditVersionList") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "type", value = "小程序类型", dataType = "int", paramType = "query", required = true)}) |
|
|
|
public ResultData getAuditVersionList(Integer type) { |
|
|
|
@ApiImplicitParam(name = "type", value = "小程序类型", dataType = "int", paramType = "query", required = true), |
|
|
|
@ApiImplicitParam(name = "status", value = "审核状态", dataType = "int", paramType = "query")}) |
|
|
|
public ResultData getAuditVersionList(Integer type, Integer status) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxWeappInfoController::getAuditVersionList"); |
|
|
|
final List<Map> list = weappAuditStatusService.getVersionList(type); |
|
|
|
final List<Map> list = weappAuditStatusService.getVersionList(type, status); |
|
|
|
return new ResultData(list); |
|
|
|
} |
|
|
|
|
|
|
|
|