| @@ -268,7 +268,7 @@ public class WxWeappInfoController extends BaseController { | |||
| WxWeappCodeStatus codeStatus = weappCodeStatusService.getByAppId(appId); | |||
| if(extSet != null) { | |||
| boolean codeCommitStatus = false; | |||
| if(codeStatus != null && codeStatus.getCodeStatus().equals(0)) { | |||
| if(codeStatus != null && codeStatus.getCodeStatus().equals(0) && codeStatus.getUserVersion().equals(userVersion)) { | |||
| codeCommitStatus = true; | |||
| } | |||
| if(!codeCommitStatus) { | |||
| @@ -388,20 +388,23 @@ public class WxWeappInfoController extends BaseController { | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation(value = "批量审核撤回", notes = "{\"apps\":\"appid,appid\"}") | |||
| @ApiOperation(value = "批量审核撤回", notes = "{\"version\":\"string\"}") | |||
| @PostMapping("batchAuditCancel") | |||
| public ResultData batchAuditCancel(@RequestBody Map<String, String> params) { | |||
| logger.debug("[" + getIpAddr() + "] WxWeappInfoController::batchAuditCancel"); | |||
| String appsStr = params.get("apps"); | |||
| // 逐一设置app配置 | |||
| String [] apps = appsStr.split(","); | |||
| for(String appId: apps) { | |||
| String version = params.get("version"); | |||
| WxWeappCodeStatusVo queryVo = new WxWeappCodeStatusVo(); | |||
| if(StringUtils.isNotBlank(version)) { | |||
| queryVo.setUserVersion(version); | |||
| } | |||
| List<WxWeappCodeStatusVo> apps = weappCodeStatusService.getList(queryVo); | |||
| apps.stream().forEach( app -> { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(app.getAppId()); | |||
| WxOpenResult openResult = openMaService.undoCodeAudit(); | |||
| logger.info(openResult.toString()); | |||
| if(openResult.isSuccess()) { | |||
| WxWeappCodeStatus codeStatus = weappCodeStatusService.getByAppId(appId); | |||
| WxWeappCodeStatus codeStatus = weappCodeStatusService.getByAppId(app.getAppId()); | |||
| if(codeStatus != null) { | |||
| codeStatus.setAuditStatus(EnumWeappAuditStatus.UNDO.getCode()); | |||
| weappCodeStatusService.updateAuditStatus(codeStatus); | |||
| @@ -410,27 +413,30 @@ public class WxWeappInfoController extends BaseController { | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| } | |||
| }); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation(value = "批量发布", notes = "{\"apps\":\"appid,appid\"}") | |||
| @ApiOperation(value = "批量发布", notes = "{\"version\":\"string\"}") | |||
| @PostMapping("batchRelease") | |||
| public ResultData batchRelease(@RequestBody Map<String, String> params) { | |||
| logger.debug("[" + getIpAddr() + "] WxWeappInfoController::batchRelease"); | |||
| String appsStr = params.get("apps"); | |||
| // 逐一设置app配置 | |||
| String [] apps = appsStr.split(","); | |||
| for(String appId: apps) { | |||
| String version = params.get("version"); | |||
| WxWeappCodeStatusVo queryVo = new WxWeappCodeStatusVo(); | |||
| if(StringUtils.isNotBlank(version)) { | |||
| queryVo.setUserVersion(version); | |||
| } | |||
| List<WxWeappCodeStatusVo> apps = weappCodeStatusService.getList(queryVo); | |||
| apps.stream().forEach( app -> { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(app.getAppId()); | |||
| WxOpenResult openRet = openMaService.releaesAudited(); | |||
| boolean releaseSuccess = false; | |||
| if(openRet.isSuccess()) { | |||
| releaseSuccess = true; | |||
| } | |||
| logger.info(openRet.toString()); | |||
| WxWeappCodeStatus codeStatus = weappCodeStatusService.getByAppId(appId); | |||
| WxWeappCodeStatus codeStatus = weappCodeStatusService.getByAppId(app.getAppId()); | |||
| if(codeStatus != null) { | |||
| if(releaseSuccess) { | |||
| codeStatus.setReleaseStatus(EnumWeappReleaseStatus.SUCCESS.getCode()); | |||
| @@ -443,7 +449,7 @@ public class WxWeappInfoController extends BaseController { | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| } | |||
| }); | |||
| return new ResultData(); | |||
| } | |||