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