代理文件批量审核

This commit is contained in:
duandongmei
2018-09-13 20:34:13 +08:00
parent d62799a0c1
commit 59a69613de

View File

@@ -85,43 +85,47 @@ public class ProxyFileStrategyService extends BaseService{
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void audit(Integer isAudit,Integer isValid,Integer functionId,String id){
public void audit(Integer isAudit,Integer isValid,Integer functionId,String ids){
Date auditTime = new Date();//审核时间
ProxyFileStrategyCfg entity = proxyFileDao.getCfgById(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(auditTime);
proxyFileDao.update(entity);
if(isAudit == 1) {//审核通过,下发配置回调配置信息
Map<String,Object> params = Maps.newHashMap();
params.put("fileId", entity.getCompileId());//文件ID
params.put("service", entity.getServiceId());//业务ID
params.put("fileDesc", entity.getFileDesc());//文件描述
params.put("contentType", entity.getContentType());//内容类型
params.put("contentLength", entity.getContentLength());//文件长度
params.put("filePath", entity.getUrl());//文件路径
params.put("isValid", 1);//有效标志,有效
params.put("opTime", new Date());
List list = Lists.newArrayList();
list.add(params);
String json = gsonToJson(list);
logger.debug("params:" + json);
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
logger.debug("响应:"+gsonToJson(result));
}else if(isAudit == 3) {//取消审核通过,将回调配置信息置为无效
Map<String,Object> params = Maps.newHashMap();
params.put("fileId", entity.getCompileId());//文件ID
params.put("service", entity.getServiceId());//业务ID
params.put("isValid", 0);//有效标志,无效
params.put("opTime", new Date());
List list = Lists.newArrayList();
list.add(params);
String json = gsonToJson(list);
logger.debug("params:" + json);
ToMaatResult result = ConfigServiceUtil.put(json,2);
logger.debug("响应:"+gsonToJson(result));
String[] idArray = ids.split(",");
for(String id : idArray) {
ProxyFileStrategyCfg entity = proxyFileDao.getCfgById(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(auditTime);
proxyFileDao.update(entity);
if(isAudit == 1) {//审核通过,下发配置回调配置信息
Map<String,Object> params = Maps.newHashMap();
params.put("fileId", entity.getCompileId());//文件ID
params.put("service", entity.getServiceId());//业务ID
params.put("fileDesc", entity.getFileDesc());//文件描述
params.put("contentType", entity.getContentType());//内容类型
params.put("contentLength", entity.getContentLength());//文件长度
params.put("filePath", entity.getUrl());//文件路径
params.put("isValid", 1);//有效标志,有效
params.put("opTime", new Date());
List list = Lists.newArrayList();
list.add(params);
String json = gsonToJson(list);
logger.debug("params:" + json);
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
logger.debug("响应:"+gsonToJson(result));
}else if(isAudit == 3) {//取消审核通过,将回调配置信息置为无效
Map<String,Object> params = Maps.newHashMap();
params.put("fileId", entity.getCompileId());//文件ID
params.put("service", entity.getServiceId());//业务ID
params.put("isValid", 0);//有效标志,无效
params.put("opTime", new Date());
List list = Lists.newArrayList();
list.add(params);
String json = gsonToJson(list);
logger.debug("params:" + json);
ToMaatResult result = ConfigServiceUtil.put(json,2);
logger.debug("响应:"+gsonToJson(result));
}
}
}
/**