This commit is contained in:
dinggang 2022-12-01 18:17:07 +08:00
commit f8088fb2f9
13 changed files with 325 additions and 42 deletions

View File

@ -91,4 +91,14 @@ public class ProcessInstanceDTO {
@ApiModelProperty(value = "申请单号")
private String applyNumber;
/**
* 催办功能增加字段
*/
@ApiModelProperty(value = "该流程的节点当前是否允许催办")
private Boolean allowReminders;
@ApiModelProperty(value = "该流程的节点当前是否已经进行过催办")
private Boolean doneReminders;
@ApiModelProperty(value = "该流程的节点需几天后进行催办")
private Integer nextRemindersDays;
}

View File

@ -12,6 +12,7 @@ import io.renren.modules.demandComment.entity.TDemandCommentEntityDelFlag;
import io.renren.modules.demandComment.service.TDemandCommentService;
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.processForm.service.TAbilityApplicationService;
import io.renren.modules.reminders.service.TRemindersService;
import io.renren.modules.resource.dto.ResourceDTO;
import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.resourceMountApply.dto.TResourceMountApplyDTO;
@ -37,12 +38,15 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.InputStream;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
@ -92,6 +96,11 @@ public class ActHistoryService {
@Autowired
private ProcessEngine processEngine_;
@Autowired
private TRemindersService tRemindersService;
@Value("${reminders.interval:7}") // 流程发起后多少天允许催办
private Integer interval;
public void getProcessInstanceDiagram(String processInstanceId, HttpServletResponse response) throws Exception {
if (StringUtils.isEmpty(processInstanceId)) {
@ -375,10 +384,42 @@ public class ActHistoryService {
.filter(Objects::nonNull)
.filter(index -> null != index.getName() && index.getName().contains(params.get("name").toString()))
.collect(Collectors.toList());
List<ProcessInstanceDTO> list2 = list1.stream().skip((Integer.parseInt(page) - 1) * Integer.parseInt(limit)).limit(Integer.parseInt(limit)).collect(Collectors.toList());
List<ProcessInstanceDTO> list2 = list1.stream().skip((Integer.parseInt(page) - 1) * Integer.parseInt(limit))
.limit(Integer.parseInt(limit)).collect(Collectors.toList());
pageData.setTotal(list1.size());
pageData.setList(list2);
}
/**
* 处理催办相关条件数据
*/
pageData.setList(pageData.getList().stream().map(index -> {
Optional<Task> nowTask = taskService.createTaskQuery().processInstanceId(index.getProcessInstanceId())
.orderByTaskCreateTime().desc().active().list().stream().findFirst(); // 尝试获取当前task
if (nowTask.isPresent()) { // 存在正在进行的任务
LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId());
if (localDate == null) { // 未进行过催办
index.setAllowReminders(Boolean.TRUE); // 允许催办
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
index.setNextRemindersDays(0); // 距离下次催办天数为0
} else { // 进行过催办
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
if (between <= interval) { // 间隔天数小于限制天数
index.setAllowReminders(Boolean.FALSE); // 不允许催办
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数
} else {
index.setAllowReminders(Boolean.TRUE); // 不允许催办
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
index.setNextRemindersDays(0); // 距离下次催办天数为0
}
}
} else {
index.setAllowReminders(Boolean.FALSE);
index.setDoneReminders(Boolean.FALSE);
index.setNextRemindersDays(0);
}
return index;
}).collect(Collectors.toList()));
return pageData;
}

View File

@ -24,6 +24,7 @@ import io.renren.modules.processForm.dto.TAbilityApplicationV2DTO;
import io.renren.modules.processForm.entity.TAbilityApplicationEntity;
import io.renren.modules.processForm.excel.TAbilityApplicationExcel;
import io.renren.modules.processForm.service.TAbilityApplicationService;
import io.renren.modules.reminders.service.TRemindersService;
import io.renren.modules.resource.dto.ResourceDTO;
import io.renren.modules.resource.excel.census.config.CustomCellWriteHeightConfig;
import io.renren.modules.resource.excel.census.config.CustomCellWriteWeightConfig;
@ -57,7 +58,9 @@ import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
@ -98,6 +101,12 @@ public class TAbilityApplicationController {
@Value("${infrastructure.dept-can-apply-max}")
private Integer infrastructureMax;
@Value("${reminders.interval:7}") // 流程发起后多少天允许催办
private Integer interval;
@Autowired
private TRemindersService tRemindersService;
/**
* 根据能力资源id获取该能力申请使用分页
@ -142,14 +151,14 @@ public class TAbilityApplicationController {
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
List<TAbilityApplicationDTO> list =
page.getList().stream().map(index -> {
String inStanceIdSql = String.format("SELECT DISTINCT instance_id FROM t_ability_application WHERE apply_flag = '%s' LIMIT 1", index.getApplyFlag());
Integer inStanceId =
jdbcTemplate.queryForObject(String.format("SELECT DISTINCT instance_id FROM t_ability_application WHERE apply_flag = '%s' LIMIT 1", index.getApplyFlag()), Integer.class);
jdbcTemplate.queryForObject(inStanceIdSql, Integer.class);
if (inStanceId == null) {
return index;
}
List<TAbilityApplicationDTO> dtos =
tAbilityApplicationService.getByInstanceId(inStanceId + "");
List<TAbilityApplicationDTO> dtos = tAbilityApplicationService.getByInstanceId(inStanceId + "");
if (!dtos.isEmpty()) {
dtos.stream()
.limit(1L)
@ -161,7 +170,6 @@ public class TAbilityApplicationController {
} else {
index.setSystem("视频资源申请:" + index.getSystem());
}
return;
}
});
}
@ -172,6 +180,52 @@ public class TAbilityApplicationController {
Boolean ended = jdbcTemplate.queryForObject(sql, Boolean.class);
index.setEnded(Boolean.TRUE.equals(ended));
}
/**
* 判断该次申请是否存在驳回的子单
*/
// 该条申请的实例id列表
String inStanceIdsSql = String.format("SELECT DISTINCT instance_id FROM t_ability_application WHERE apply_flag = '%s';", index.getApplyFlag());
List<Map<String, Object>> inStanceIds = jdbcTemplate.queryForList(inStanceIdsSql);
index.setBackToFirst(inStanceIds.stream().map(inStanceId_ -> {
List<Task> listTask = taskService.createTaskQuery().processInstanceId(inStanceId_.get("instance_id").toString())
.includeProcessVariables().includeTaskLocalVariables().list();
return listTask.stream().anyMatch(task ->
task.getProcessVariables().containsKey("backToFirst") ?
(task.getProcessVariables().get("backToFirst") != null ? Boolean.valueOf(task.getProcessVariables().get("backToFirst").toString()) : Boolean.FALSE)
: Boolean.FALSE
);
}).filter(i -> i).findAny().isPresent()); // 子单内是否存在驳回流程
/**
* 处理催办条件与催办信息
*/
Optional<Task> nowTask = taskService.createTaskQuery().processInstanceId(index.getInstanceId())
.orderByTaskCreateTime().desc().active().list().stream().findFirst(); // 尝试获取当前task
if (nowTask.isPresent()) { // 存在正在进行的任务
LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId());
if (localDate == null) { // 未进行过催办
index.setAllowReminders(Boolean.TRUE); // 允许催办
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
index.setNextRemindersDays(0); // 距离下次催办天数为0
} else { // 进行过催办
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
if (between <= interval) { // 间隔天数小于限制天数
index.setAllowReminders(Boolean.FALSE); // 不允许催办
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数
} else {
index.setAllowReminders(Boolean.TRUE); // 不允许催办
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
index.setNextRemindersDays(0); // 距离下次催办天数为0
}
}
} else {
index.setAllowReminders(Boolean.FALSE);
index.setDoneReminders(Boolean.FALSE);
index.setNextRemindersDays(0);
}
return index;
}).collect(Collectors.toList());
page.setList(list);
@ -489,7 +543,7 @@ public class TAbilityApplicationController {
@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query", dataType = "INTEGER"),
@ApiImplicitParam(name = "pageSize", value = "页数大小", paramType = "query", dataType = "INTEGER")
})
public Result getFundStatement (@ApiIgnore @RequestParam Map<String, Object> params) {
public Result getFundStatement(@ApiIgnore @RequestParam Map<String, Object> params) {
return new Result().ok(tAbilityApplicationService.getFundStatement(params));
}
@ -557,14 +611,14 @@ public class TAbilityApplicationController {
@GetMapping("/getDistrictFundStatement")
@ApiOperation("获取区市资金报表")
@LogOperation("获取区市资金报表")
public Result getDistrictFundStatement (Map<String, Object> params) {
public Result getDistrictFundStatement(Map<String, Object> params) {
return new Result().ok(tAbilityApplicationService.getDistrictFundStatement(params));
}
@GetMapping("/getComponentFundStatement")
@ApiOperation("获取组件节约资金列表")
@LogOperation("获取组件节约资金列表")
public Result getComponentFundStatement (Map<String, Object> params) {
public Result getComponentFundStatement(Map<String, Object> params) {
return new Result().ok(tAbilityApplicationService.getComponentFundStatement(params));
}
@ -572,7 +626,7 @@ public class TAbilityApplicationController {
@GetMapping("/getResourceFundStatement")
@ApiOperation("获取应用资源节约资金列表")
@LogOperation("获取应用资源节约资金列表")
public Result getResourceFundStatement (Map<String, Object> params) {
public Result getResourceFundStatement(Map<String, Object> params) {
return new Result().ok(tAbilityApplicationService.getResourceFundStatement(params));
}
@ -580,7 +634,7 @@ public class TAbilityApplicationController {
@GetMapping("/getInfrastructureFundStatement")
@ApiOperation("获取基础设施节约资金列表")
@LogOperation("获取基础设施节约资金列表")
public Result getInfrastructureFundStatement (Map<String, Object> params) {
public Result getInfrastructureFundStatement(Map<String, Object> params) {
return new Result().ok(tAbilityApplicationService.getInfrastructureFundStatement(params));
}
@ -588,7 +642,7 @@ public class TAbilityApplicationController {
@GetMapping("/getProvideDeptFundStatement")
@ApiOperation("获取提供部门节约资金列表")
@LogOperation("获取提供部门节约资金列表")
public Result getProvideDeptFundStatement (Map<String, Object> params) {
public Result getProvideDeptFundStatement(Map<String, Object> params) {
return new Result().ok(tAbilityApplicationService.getProvideDeptFundStatement(params));
}
@ -596,7 +650,7 @@ public class TAbilityApplicationController {
@GetMapping("/getApplyDeptFundStatement")
@ApiOperation("获取申请部门节约资金列表")
@LogOperation("获取申请部门节约资金列表")
public Result getApplyDeptFundStatement (Map<String, Object> params) {
public Result getApplyDeptFundStatement(Map<String, Object> params) {
return new Result().ok(tAbilityApplicationService.getApplyDeptFundStatement(params));
}
@ -604,7 +658,7 @@ public class TAbilityApplicationController {
@GetMapping("/getProvideDistrictFundStatement")
@ApiOperation("获取提供区市节约资金列表")
@LogOperation("获取提供区市节约资金列表")
public Result getProvideDistrictFundStatement (Map<String, Object> params) {
public Result getProvideDistrictFundStatement(Map<String, Object> params) {
return new Result().ok(tAbilityApplicationService.getProvideDistrictFundStatement(params));
}
@ -612,7 +666,7 @@ public class TAbilityApplicationController {
@GetMapping("/getApplyDistrictFundStatement")
@ApiOperation("获取申请区市节约资金列表")
@LogOperation("获取申请区市节约资金列表")
public Result getApplyDistrictFundStatement (Map<String, Object> params) {
public Result getApplyDistrictFundStatement(Map<String, Object> params) {
return new Result().ok(tAbilityApplicationService.getApplyDistrictFundStatement(params));
}

View File

@ -97,4 +97,15 @@ public class TAbilityApplicationDTO extends AuditingBaseDTO implements Serializa
@ApiModelProperty(value = "申请价格")
private BigDecimal applyPrice;
/**
* 催办功能增加字段
*/
@ApiModelProperty(value = "该流程的节点当前是否允许催办")
private Boolean allowReminders;
@ApiModelProperty(value = "该流程的节点当前是否已经进行过催办")
private Boolean doneReminders;
@ApiModelProperty(value = "该流程的节点需几天后进行催办")
private Integer nextRemindersDays;
}

View File

@ -3,14 +3,24 @@ package io.renren.modules.reminders.dao;
import io.renren.common.dao.BaseDao;
import io.renren.modules.reminders.entity.TRemindersEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 催办信息
*
* @author wangliwen wangliwen@hisense.com
* @since 1.0 2022-11-30
*/
* 催办信息
*
* @author wangliwen wangliwen@hisense.com
* @since 1.0 2022-11-30
*/
@Mapper
public interface TRemindersDao extends BaseDao<TRemindersEntity> {
/**
* 获取该任务的最新催办记录时间
*
* @param taskId
* @return
*/
List<Map> selectRemindersTime(@Param("taskId") String taskId);
}

View File

@ -4,6 +4,8 @@ import io.renren.common.service.CrudService;
import io.renren.modules.reminders.dto.TRemindersDTO;
import io.renren.modules.reminders.entity.TRemindersEntity;
import java.time.LocalDate;
/**
* 催办信息
*
@ -11,5 +13,11 @@ import io.renren.modules.reminders.entity.TRemindersEntity;
* @since 1.0 2022-11-30
*/
public interface TRemindersService extends CrudService<TRemindersEntity, TRemindersDTO> {
/**
* 获取该任务最近一次催办日期
*
* @param taskId
* @return
*/
LocalDate selectRemindersTime(String taskId);
}

View File

@ -24,6 +24,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -45,16 +49,6 @@ public class TRemindersServiceImpl extends CrudServiceImpl<TRemindersDao, TRemin
@Value("${reminders.interval:7}") // 流程发起后多少天允许催办
private Integer interval;
// @Autowired
// private RestTemplate restTemplate;
// @Autowired
// private SysUserDao sysUserDao;
// @Autowired
// private SysNoticeUserService sysNoticeUserService;
// @Autowired
// private NoticeUntil noticeUntil;
// @Autowired
// private ActTaskService actTaskService;
@Autowired
protected HistoryService historyService;
@Autowired
@ -89,6 +83,8 @@ public class TRemindersServiceImpl extends CrudServiceImpl<TRemindersDao, TRemin
dto.setRecipient(assignee.get());
}
Map<String, Object> kv = task.getProcessVariables();
LocalDate taskCreateDate = task.getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
long between = ChronoUnit.DAYS.between(taskCreateDate, LocalDate.now());
Boolean allowEntrust = Boolean.valueOf(kv.get("allowEntrust") != null ? kv.get("allowEntrust").toString() : Boolean.FALSE.toString()); // 允许被委托他人(特殊通知)
final StringBuilder resourceName = new StringBuilder();
if (kv.containsKey("resourceDTO")) {
@ -112,18 +108,19 @@ public class TRemindersServiceImpl extends CrudServiceImpl<TRemindersDao, TRemin
}
SysUserDTO creatorDto = sysUserService.get(Long.parseLong(creator));
String content = "【催办通知】" + creatorDto.getRealName() + "发起的流程 " + resourceName + dto.getProcessType() +
" 进入审核节点:" + task.getName() +
";当前审核人指派为您";
" 进入审核节点:" + task.getName() + "" + between + "" +
";当前审核人指派为您,请及时处理";
if (allowEntrust) {
content = "【催办通知】" + dto.getSponsor().getRealName() + "发起的流程 " + resourceName + dto.getProcessType() +
" 已进入审核节点:" + task.getName() +
";因无法分配到审核人,故当前审核人指派为您";
" 已进入审核节点:" + task.getName() + "" + between + "" +
";因无法分配到审核人,故当前审核人指派为您,请及时处理";
}
Integer type = 12;
if ("能力申请".equals(dto.getProcessType())) {
type = 1;
//待办通知通知的是流程当前审核人通知内容[待办通知]申请部门+申请人+提出资源名称+申请请进入UCS后台管理系统进行审核
content = "【催办通知】" + dto.getSponsor().getDeptName() + dto.getSponsor().getRealName() + "提出 ”" + resourceName + " ”申请请进入UCS后台管理系统进行审核。";
// 催办通知通知的是流程当前审核人通知内容[待办通知]申请部门+申请人+提出资源名称+申请请进入UCS后台管理系统进行审核
content = "【催办通知】" + dto.getSponsor().getDeptName() + dto.getSponsor().getRealName() + "提出 ”"
+ resourceName + " ”申请已过去" + between + "请进入UCS后台管理系统及时进行审核。";
if (allowEntrust) {
content = content + "(因无法分配到审核人,故当前审核人指派为您,您可进行委托他人转办)";
}
@ -161,4 +158,17 @@ public class TRemindersServiceImpl extends CrudServiceImpl<TRemindersDao, TRemin
super.save(dto);
}
/**
* 获取该任务最近一次催办日期
*
* @param taskId
* @return
*/
@Override
public LocalDate selectRemindersTime(String taskId) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
return baseDao.selectRemindersTime(taskId).stream().map(index ->
LocalDate.parse(index.get("reminders_time").toString(), formatter)
).findFirst().orElse(null);
}
}

View File

@ -690,11 +690,24 @@ public class ResourceController {
Optional<AbstractDataResourceService> factory = DataResourceFactory.build();
if (factory.isPresent()) {
Object dataResource = factory.get().getDataResource(dto);
return new Result<Object>().ok(dataResource);
return new Result<>().ok(dataResource);
}
return null;
}
@PostMapping("/getDataResourceDeptList")
@ApiOperation("获取各部门数据资源数量")
@LogOperation("获取各部门数据资源数量")
public Result<Object> getDataResourceDeptList(@RequestBody GetDataResourceListDto dto) {
Optional<AbstractDataResourceService> factory = DataResourceFactory.build();
if (factory.isPresent()) {
Object dataResource = factory.get().getDataResourceDeptList();
return new Result<>().ok(dataResource);
}
return null;
}
@GetMapping("/getApplyCameraList/{instanceId}")
@ApiOperation("根据流程实例ID获取申请摄像头列表")
@LogOperation("根据流程实例ID获取申请摄像头列表")

View File

@ -15,4 +15,12 @@ public abstract class AbstractDataResourceService {
* @return
*/
public abstract Object getDataResource(GetDataResourceListDto dto);
/**
* 获取各部门上架数据资源的数目情况
*
* @return
*/
public abstract Object getDataResourceDeptList();
}

View File

@ -1,5 +1,6 @@
package io.renren.modules.resource.dataResource.domain;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.renren.common.utils.SpringContextUtils;
import io.renren.modules.resource.dataResource.AbstractDataResourceService;
@ -13,9 +14,7 @@ import org.springframework.web.client.ResourceAccessException;
import org.springframework.web.client.RestTemplate;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -85,4 +84,101 @@ public class TsingtaoDataResourceService extends AbstractDataResourceService {
return null;
}
}
/**
* 获取各部门上架数据资源的数目情况
*
* @return
*/
@Override
public Object getDataResourceDeptList() {
String url = "http://15.72.158.81/zyjk/ZywMessage.asmx?op=ZyFbCountPort";
String parame = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
" <soap:Body>\n" +
" <ZyFbCountPort xmlns=\"http://tempuri.org/\" />\n" +
" </soap:Body>\n" +
"</soap:Envelope>";
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.set("SOAPAction", "http://tempuri.org/ZyFbCountPort");
requestHeaders.setContentType(new MediaType("text", "xml", Charset.forName("utf-8")));
HttpEntity<String> requestEntity = new HttpEntity(parame, requestHeaders);
try {
String body = restTemplate.postForEntity(url, requestEntity, String.class).getBody();
String startTag = "<ZyFbCountPortResult>";
String endTag = "</ZyFbCountPortResult>";
String json = body.substring(body.indexOf(startTag) + startTag.length(), body.indexOf(endTag));
List<Map> result = JSONArray.parseArray(json, Map.class);
List<LinkedHashMap<String, Object>> allDept = new ArrayList<>();
LinkedHashMap<String, Object> allInfo = new LinkedHashMap<>(); // 所有单位
allInfo.put("total", result.stream().mapToInt(index -> Integer.parseInt(index.get("Lenth").toString())).sum());
allInfo.put("type", "全部能力目录");
allDept.add(allInfo); // 所有单位
LinkedHashMap<String, Object> cityInfo = new LinkedHashMap<>(); // 市级单位
List<LinkedHashMap<String, Object>> cityList = result.stream().filter(index -> "青岛市".equals(index.getOrDefault("ssqs", "").toString()))
.map(index -> {
LinkedHashMap<String, Object> temp = new LinkedHashMap<>();
temp.put("districtName", index.get("ssqs").toString());
temp.put("districtId", "250000");
temp.put("deptName", index.get("BMName").toString());
temp.put("deptId", index.get("TGBM").toString());
temp.put("deptCount", index.get("Lenth").toString());
return temp;
})
.collect(Collectors.toList()); // 获取市级单位
cityInfo.put("dataList", cityList);
cityInfo.put("total", cityList.stream().mapToInt(index -> Integer.parseInt(index.get("deptCount").toString())).sum());
cityInfo.put("type", "市级");
allDept.add(cityInfo); //市级部门
LinkedHashMap<String, Object> qyInfo = new LinkedHashMap<>(); // 区级单位
Map<String, List<LinkedHashMap<String, Object>>> group = result.stream()
.filter(index -> !"青岛市".equals(index.getOrDefault("ssqs", "").toString()))
.map(index -> {
LinkedHashMap<String, Object> temp = new LinkedHashMap<>();
temp.put("districtName", index.get("ssqs").toString());
temp.put("districtId", "250000");
temp.put("deptName", index.get("BMName").toString());
temp.put("deptId", index.get("TGBM").toString());
temp.put("deptCount", index.get("Lenth"));
return temp;
})
.collect(Collectors.groupingBy(t -> t.get("districtName").toString())); // 获取非市级单位
qyInfo.put("dataList", group.keySet().stream().map(index -> {
LinkedHashMap<String, Object> temp = new LinkedHashMap<>();
temp.put("dataList", group.get(index).stream().map(i -> {
LinkedHashMap<String, Object> temp1 = new LinkedHashMap<>();
temp1.put("districtName", i.get("districtName").toString());
temp1.put("districtId", i.get("districtId").toString());
temp1.put("deptName", i.get("deptName").toString());
temp1.put("deptId", i.get("deptId").toString());
temp1.put("deptCount", i.get("deptCount").toString());
temp1.put("type", i.get("deptName"));
return temp1; // 每个区县下
}).collect(Collectors.toList()));
temp.put("total", group.get(index).stream().mapToInt(index_ -> Integer.parseInt(index_.get("deptCount").toString())).sum());
temp.put("type", index);
return temp;
}).collect(Collectors.toList()));
qyInfo.put("total", result.stream().filter(index -> !"青岛市".equals(index.getOrDefault("ssqs", "").toString()))
.mapToInt(index -> Integer.parseInt(index.get("Lenth").toString())).sum());
qyInfo.put("type", "区级");
allDept.add(qyInfo); //市级部门
return allDept;
} catch (ResourceAccessException e) {
logger.error("青岛市资源数据接口连接超时!!!");
return null;
} catch (Exception e) {
logger.error("青岛市资源数据调用失败!!!", e);
return null;
}
}
}

View File

@ -57,4 +57,14 @@ public class TsingtaoXHADataResourceService extends AbstractDataResourceService
}
return result;
}
/**
* 获取各部门上架数据资源的数目情况
*
* @return
*/
@Override
public Object getDataResourceDeptList() {
return null;
}
}

View File

@ -24,7 +24,7 @@ public class SysRoleUserServiceImpl extends BaseServiceImpl<SysRoleUserDao, SysR
private static final Logger logger = LoggerFactory.getLogger(SysUserController.class);
@Override
@Transactional
@Transactional(rollbackFor = Exception.class)
public void saveOrUpdate(Long userId, List<Long> roleIdList) {
logger.error("------------------准备更新用户角色信息,准备更新的用户为{} 修改后的角色列表为{}-------------------", userId, roleIdList);
//先删除角色用户关系

View File

@ -21,4 +21,16 @@
<result property="additional3" column="additional3"/>
</resultMap>
<select id="selectRemindersTime" resultType="java.util.Map">
SELECT
DATE_FORMAT( reminders_time, '%Y-%m-%d' ) AS reminders_time
FROM
t_reminders
WHERE
process_task_id = #{taskId}
ORDER BY
create_date DESC
LIMIT 1;
</select>
</mapper>