Commit f0708648 authored by tangwei's avatar tangwei

修改扫描错误

parent 3c1d6f3c
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.biz.enums.DataDictionaryTypeEnum;
import com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCodeEnum;
import org.apache.commons.collections4.CollectionUtils;
......@@ -23,19 +18,11 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author DELL
......@@ -299,33 +286,8 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
return postType;
}
public static void main(String[] args) {
String ssString="[{\"teamName\":\"发士大夫大师傅\",\"shiftId\":\"1437585222345547778\",\"carName\":\"特种消防车(46586458)\",\"postType\":\"\",\"dutyArea\":\"测试控制室\",\"dutyAreaId\":\"1382166994773610497\",\"postTypeName\":\"\",\"userName\":\"故障报修\",\"userId\":\"1428653787706347522\",\"dutyDate\":\"2021-10-12 00:00:00\",\"carId\":\"1432590747256770562\",\"shiftName\":\"晚班\",\"instanceId\":\"1447490875843239937\",\"teamId\":\"1404995716634050561\",\"groupCode\":\"dutyCar\"},{\"teamName\":\"发士大夫大师傅\",\"shiftId\":\"1432883228491972609\",\"carName\":\"特种消防车(46586458)\",\"postType\":\"\",\"dutyArea\":\"消防小室-shg\",\"dutyAreaId\":\"1382530839199387650\",\"postTypeName\":\"\",\"userName\":\"78678676\",\"userId\":\"1435886728803000322\",\"dutyDate\":\"2021-10-12 00:00:00\",\"carId\":\"1432590747256770562\",\"shiftName\":\"夜班\",\"instanceId\":\"1447490812534415361\",\"teamId\":\"1404995716634050561\",\"groupCode\":\"dutyCar\"},{\"teamName\":\"发士大夫大师傅\",\"shiftId\":\"1432883228491972609\",\"carName\":\"特种消防车(46586458)\",\"postType\":\"1\",\"dutyArea\":\"建构住-shg\",\"dutyAreaId\":\"1382157469081407490\",\"postTypeName\":\"指挥员\",\"userName\":\"张小四6\",\"userId\":\"1435072204550225922\",\"dutyDate\":\"2021-10-12 00:00:00\",\"carId\":\"1432590747256770562\",\"shiftName\":\"夜班\",\"instanceId\":\"1447490699435008001\",\"teamId\":\"1404995716634050561\",\"groupCode\":\"dutyCar\"}]\r\n"
+ "";
List<Map> jjList= JSON.parseArray(ssString, Map.class);
Map< String, String> map20 = new HashMap<String, String>();
jjList.forEach(i->{
List<Object> fieldsList= new ArrayList<Object>();
List<Object>infoList= new ArrayList<Object>();
Map<String, String> map = new HashMap<String, String>();
map.put("name", WXXFZ);
map.put(VALUE,i.get("carName").toString());
map.put("id","1");
fieldsList.add(map);
Map<String, String> map1 = new HashMap<String, String>();
map1.put("name", WXXFZ);
map1.put(VALUE,i.get("teamName").toString());
map1.put("id","2");
fieldsList.add(map1);
if(!map20.containsKey(i.get("shiftName").toString())) {
map20.put(ssString, ssString);
}
});
}
@Override
public List<Map<String, Object>> queryByCompanyId(List<String> bizNames){
return dutyPersonShiftMapper.queryByCompanyId(bizNames);
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -38,6 +23,16 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
import com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService;
import com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService;
import com.yeejoin.amos.boot.module.common.biz.constats.Constants;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 服务实现类
......@@ -87,6 +82,10 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public static Integer SELECY_ACCEPT = 9;
public String[] roleName = {"maintenance_department_maintenance_personnel", "emergency_command_staff", "emergency_command_leader", "maintenance_department"};
private static final String CHECKFLAG="checkFlag";
private static final String TASKID= "taskId";
private static final String OPERATOR= "operator";
/**
* 分页查询接口
*
......@@ -114,13 +113,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
iPage.setRecords(list);
return iPage;
}
/* //当传递类型参数为我提交时
if (type.equals(SELECY_ISUBMIT)) {
List<FailureDetails> list = baseMapper.selectISubPage(page.getCurrent(), page.getSize(), currentStatus, startTime, endTime, Integer.parseInt(userInfo.getUserModel().getUserId()));
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(list);
return iPage;
}*/
//当传递类型参数为我接收时
if (type.equals(SELECY_ACCEPT)) {
//当角色为维修人员时
......@@ -128,25 +121,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(receiveList);
return iPage;
/* if (userInfo.getRole().getRoleName().equals(roleName[0])) {
List<FailureDetails> failureDetails = baseMapper.selectForMaintain(currentStatus, startTime, endTime, userId, userInfo.getUserModel().getUserId(), page.getCurrent(), page.getSize());
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(failureDetails);
return iPage;
} else if (userInfo.getRole().getRoleName().equals(roleName[2]) || userInfo.getRole().getRoleName().equals(roleName[3])) {
List<FailureDetails> failureDetails = baseMapper.selectForAudit(currentStatus, startTime, endTime, userId, userInfo.getUserModel().getUserId(), page.getCurrent(), page.getSize());
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(failureDetails);
return iPage;
} else {
List<FailureDetails> failureDetails = baseMapper.selectYJ(currentStatus, startTime, endTime, userInfo.getUserModel().getUserId(), page.getCurrent(), page.getSize());
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(failureDetails);
return iPage;
}*/
}
//否则就查询待处理
return this.queryForWaitManage(page, userInfo, currentStatus, startTime, endTime, userId);
......@@ -172,18 +147,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public IPage<FailureDetails> queryForWaitManage(Page<FailureDetails> page, ReginParams userInfo, Long currentStatus,
String startTime, String endTime, Integer userId) {
/* if (userInfo.getRole().getRoleName().equals(roleName[0])) {
IPage<FailureDetails> wxIpage = new Page<FailureDetails>();
List<FailureDetails> list = baseMapper.selectStatusWaitWx(page.getCurrent(), page.getSize(), currentStatus, startTime, endTime, userId);
wxIpage.setRecords(list);
return wxIpage;
} else if (userInfo.getRole().getRoleName().equals(roleName[1])) {
currentStatus = FailureStatuEnum.WAITING_SUBMIT.getCode().longValue();
List<FailureDetails> list = baseMapper.selectStatusWaitTj(page.getCurrent(), page.getSize(), currentStatus, startTime, endTime, userId);
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(list);
return iPage;
}*/
List<FailureDetails> list = baseMapper.queryForWaitManage(page.getCurrent(), page.getSize(), currentStatus, startTime, endTime, userId,userInfo.getRole().getRoleName());
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(list);
......@@ -218,22 +182,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
*/
public List<CurrentStatusDto> queryStatusCount(ReginParams userInfo, Integer type, Long currentStatus, String startTime, String endTime, Integer userId) {
List<StatusDto> statusDtos = null;
/* if (type.equals(SELECY_STATUS) && userInfo.getRole().getRoleName().equals(roleName[0])) {
statusDtos = baseMapper.selectStatusWx(currentStatus, startTime, endTime, userId);
} else if (type.equals(SELECY_STATUS) && userInfo.getRole().getRoleName().equals(roleName[1])) {
statusDtos = baseMapper.selectStatusFq(currentStatus, startTime, endTime, userId);
} else if (type.equals(SELECY_ISUBMIT)) {
statusDtos = baseMapper.selectStatusFqp(currentStatus, startTime, endTime, Integer.parseInt(userInfo.getUserModel().getUserId()));
} else if (type.equals(SELECY_ALL)) {
statusDtos = baseMapper.selectStatusCount(currentStatus, startTime, endTime, userId);
} else*/ if (type.equals(SELECY_ACCEPT)) {
/* if (userInfo.getRole().getRoleName().equals(roleName[2]) || userInfo.getRole().getRoleName().equals(roleName[3])){
statusDtos = baseMapper.selectAudit(currentStatus, startTime, endTime, userId, userInfo.getUserModel().getUserId());
}else if (userInfo.getRole().getRoleName().equals(roleName[0])){
statusDtos = baseMapper.selectMaintain(currentStatus, startTime, endTime, userId, userInfo.getUserModel().getUserId());
}else {
statusDtos = baseMapper.selectUserId(currentStatus, startTime, endTime, userInfo.getUserModel().getUserId());
}*/
if (type.equals(SELECY_ACCEPT)) {
statusDtos= baseMapper.queryAcceptCount(currentStatus, startTime, endTime, userId, userInfo.getUserModel().getUserId(),userInfo.getRole().getRoleName());
} else {
statusDtos = baseMapper.queryStatusCount(currentStatus, startTime, endTime, userId,userInfo.getRole().getRoleName());
......@@ -264,17 +214,17 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
body.put("businessKey", businessKey);
body.put("processDefinitionKey", processDefinitionKey);
JSONObject jsonObject = workflowFeignService.startByVariable(body);
JSONObject instance=null;
if (jsonObject == null) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
// return CommonResponseUtil.failure("启动流程失败");
}
JSONObject instance = jsonObject.getJSONObject("data");
if (instance == null) {
// return CommonResponseUtil.failure("无提交隐患权限");
}else{
instance = jsonObject.getJSONObject("data");
}
failureDetailsDto.setCurrentStatus(FailureStatuEnum.WAITING_AUDIT.getCode());
// 拿到流程processId
failureDetailsDto.setProcessId(instance.getString("id"));
failureDetailsDto.setProcessId(instance!=null?instance.getString("id"):null);
FailureDetailsDto model = null;
// 发起主表流程 并添加至报修日志
......@@ -306,7 +256,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
String processAuditorName = failureDetailsDto.getSubmissionName();
repairlog(faultId, processAuditorId, departmentId, processTime, processDepartment, processResult, processAuditorName);
if (excuteTask(instance.getString("id"), userInfo, null)) {
if (excuteTask(instance!=null?instance.getString("id"):null, userInfo, null)) {
return true;
} else {
......@@ -318,7 +268,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/**
* 更新故障保修单
*/
@Transactional
public Object updatetoModel(FailureDetailsDto failureDetailsDto, ReginParams userInfo) throws Exception {
// 发起主表流程 并添加至报修日志
......@@ -374,12 +324,12 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
HashMap<String, Object> conditionMap = new HashMap<String, Object>();
conditionMap.put("condition", Integer.parseInt(condition));
Map<String, Object> map = checkExcuteTaskAuthMap(sequenceNbr, userInfo);
if (Boolean.parseBoolean(map.get("checkFlag").toString())) {
if (Boolean.parseBoolean(map.get(CHECKFLAG).toString())) {
if (map.get("name").toString().startsWith(PROCESS_NAME[4])) {
workflowFeignService.completeNoExecuteFromInstanceAdd(map.get("taskId").toString(), conditionMap);
workflowFeignService.completeNoExecuteFromInstanceAdd(map.get(TASKID).toString(), conditionMap);
} else {
workflowFeignService.pickupAndCompleteTask(map.get("taskId").toString(), conditionMap);
workflowFeignService.pickupAndCompleteTask(map.get(TASKID).toString(), conditionMap);
}
// 判断下一个节点是不是维修中,如果是则添加当前任务的执行人
String nextTaskId = checkIsInMaintenance(sequenceNbr);
......@@ -401,9 +351,9 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Map<String, Object> map = checkExcuteTaskAuthMap(sequenceNbr, userInfo);
try {
if (Boolean.parseBoolean(map.get("checkFlag").toString())
&& map.get("checkFlag").toString().startsWith(PROCESS_NAME[4])) {
workflowFeignService.completeByVariable(map.get("taskId").toString(), null);
if (Boolean.parseBoolean(map.get(CHECKFLAG).toString())
&& map.get(CHECKFLAG).toString().startsWith(PROCESS_NAME[4])) {
workflowFeignService.completeByVariable(map.get(TASKID).toString(), null);
}
} catch (Exception e) {
e.printStackTrace();
......@@ -419,7 +369,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
if (ObjectUtils.isNotEmpty(teskObject)) {
JSONArray taskDetailArray = teskObject.getJSONArray("data");
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
JSONObject detail = JSON.parseObject(JSON.toJSONString(obj));
workflowFeignService.pickupAndCompleteTask(detail.getString("id"), conditionMap);
}
}
......@@ -431,10 +381,10 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
JSONArray taskDetailArray = teskObject.getJSONArray("data");
String currentRoleName = "";
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
JSONObject detail = JSON.parseObject(JSON.toJSONString(obj));
JSONObject taskGroupNameObject = workflowFeignService.getTaskGroupName(detail.getString("id"));
for (Object object : taskGroupNameObject.getJSONArray("data")) {
JSONObject taskGroupNameDetail = JSONObject.parseObject(JSONObject.toJSONString(object));
JSONObject taskGroupNameDetail = JSON.parseObject(JSON.toJSONString(object));
currentRoleName = currentRoleName + taskGroupNameDetail.getString("groupId") + ",";
}
}
......@@ -443,7 +393,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public boolean checkExcuteTaskAuth(Long sequenceNbr, ReginParams userInfo) {
Map<String, Object> map = this.checkExcuteTaskAuthMap(sequenceNbr, userInfo);
return Boolean.parseBoolean(map.get("checkFlag").toString());
return Boolean.parseBoolean(map.get(CHECKFLAG).toString());
}
public String checkIsInMaintenance(Long sequenceNbr) {
......@@ -453,7 +403,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
if (ObjectUtils.isNotEmpty(teskObject)) {
JSONArray taskDetailArray = teskObject.getJSONArray("data");
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
JSONObject detail = JSON.parseObject(JSON.toJSONString(obj));
String name = detail.getString("name");
if (name.startsWith(PROCESS_NAME[4])) {
String id = detail.getString("id");
......@@ -467,7 +417,6 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public Map<String, Object> checkExcuteTaskAuthMap(Long sequenceNbr, ReginParams userInfo) {
// 获取当前登录用户的角色
String currentLoginUserRole = null;
// String currentLoginUserRole = userInfo.getRole().getRoleName();
if (userInfo.getUserModel().getOrgNames().contains(roleName[0])) {
currentLoginUserRole = roleName[0];
......@@ -479,7 +428,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
currentLoginUserRole = roleName[3];
}
Map<String, Object> map = new HashMap<String, Object>();
map.put("checkFlag", false);
map.put(CHECKFLAG, false);
FailureDetailsDto failureDetailsDto = this.queryBySeq(sequenceNbr);
// 获取送达部门的ID
Long failureEquipmentId = failureDetailsDto.getSubmissionBranchId();
......@@ -490,7 +439,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
if (ObjectUtils.isNotEmpty(teskObject)) {
JSONArray taskDetailArray = teskObject.getJSONArray("data");
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
JSONObject detail = JSON.parseObject(JSON.toJSONString(obj));
String name = detail.getString("name");
JSONObject taskGroupNameObject = workflowFeignService.getTaskGroupName(detail.getString("id"));
// 获取流程中原本设置的当前节点的执行权限
......@@ -506,19 +455,19 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
}
// 当流程节点为应急指挥科时,需要判断当前用户所在的部门id和前面处理的用户部门id是否一致
if (name.contains(EMERGENCY_COMMAND)) {
FailureRepairlog failureRepairlog = failureRepairlogService.findByFaultId(sequenceNbr);
Long auditDepartmentId = failureRepairlog.getProcessDepartmentId();
FailureRepairlog failureRepairlog1 = failureRepairlogService.findByFaultId(sequenceNbr);
Long auditDepartmentId = failureRepairlog1.getProcessDepartmentId();
if (auditDepartmentId.intValue() == seq.intValue()) {
map.put("taskId", detail.getString("id"));
map.put("checkFlag", true);
map.put(TASKID, detail.getString("id"));
map.put(CHECKFLAG, true);
map.put("name", detail.getString("name"));
break;
}
} else {
// 判断当前节点任务属于送达部门节点时需要判断当前登录人所在的部门id是否与表单发起时设置的送达部门一致
if (failureEquipmentId.intValue() == seq.intValue()) {
map.put("taskId", detail.getString("id"));
map.put("checkFlag", true);
map.put(TASKID, detail.getString("id"));
map.put(CHECKFLAG, true);
map.put("name", detail.getString("name"));
break;
}
......@@ -541,19 +490,19 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
// 获取同角色信息的我的待办任务
JSONObject taskListJson = workflowFeignService.getTasksNoAuth(processDefinitionKey,
userInfo.getUserModel().getUserId());
JSONArray taskList = JSONArray.parseArray(JSONObject.toJSONString(taskListJson.getString("data")));
JSONArray taskList = JSON.parseArray(JSON.toJSONString(taskListJson.getString("data")));
for (Object i : taskList) {
JSONObject task = JSONObject.parseObject(JSONObject.toJSONString(i));
JSONObject task = JSON.parseObject(JSON.toJSONString(i));
String procressId = task.getString("processInstanceId");
// 通过流程ID查找当前的故障报修表ID 的信息
LambdaQueryWrapper<FailureDetails> wrapper = new LambdaQueryWrapper<FailureDetails>();
wrapper.eq(FailureDetails::getProcessId, procressId);
FailureDetails failureDetails = this.baseMapper.selectOne(wrapper);
// 通过故障报修单查找创建人的部门ID
FailureRepairlog failureRepairlog = failureRepairlogService.findByFaultId(failureDetails.getSequenceNbr());
FailureRepairlog failureRepairlog1 = failureRepairlogService.findByFaultId(failureDetails.getSequenceNbr());
// 再去判断当前的任务节点信息是不是维修部门,是的话将于第一次填报保单的操作人部门id进行匹配,符合将视作为一条合法的待办任务
if (task.getString("name").contains(EMERGENCY_COMMAND)) {
Long auditDepartmentId = failureRepairlog.getProcessDepartmentId();
Long auditDepartmentId = failureRepairlog1.getProcessDepartmentId();
if (auditDepartmentId.intValue() == seq.intValue()) {
countNum++;
break;
......@@ -581,14 +530,14 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
List<Object> list = new ArrayList<Object>();
if (datArray != null) {
for (Object i : datArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(i));
if (detail.containsKey("operator") && !detail.getString("name").contains("维修中")) {
JSONObject detail = JSON.parseObject(JSON.toJSONString(i));
if (detail.containsKey(OPERATOR) && !detail.getString("name").contains("维修中")) {
// 从流程记录表中拿到处理人的名称
FailureRepairlog failureRepairlog = failureRepairlogService
.findByprocessAuditor(detail.getString("operator"));
if (failureRepairlog != null) {
detail.replace("operator", failureRepairlog.getProcessAuditorName() == null ? ""
: failureRepairlog.getProcessAuditorName());
FailureRepairlog failureRepairlog1 = failureRepairlogService
.findByprocessAuditor(detail.getString(OPERATOR));
if (failureRepairlog1 != null) {
detail.replace(OPERATOR, failureRepairlog1.getProcessAuditorName() == null ? ""
: failureRepairlog1.getProcessAuditorName());
}
}
list.add(detail);
......@@ -618,7 +567,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public Integer getExcuteTaskAuthButton(Long sequenceNbr, ReginParams userInfo) {
int flag = 0;
Map<String, Object> map = this.checkExcuteTaskAuthMap(sequenceNbr, userInfo);
if (Boolean.parseBoolean(map.get("checkFlag").toString())) {
if (Boolean.parseBoolean(map.get(CHECKFLAG).toString())) {
String buttonValueString = map.get("name").toString();
if (buttonValueString.endsWith(PROCESS_NAME[0])) { // 提交维修单
flag = 1;
......@@ -637,7 +586,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
JSONObject object = workflowFeignService.queryHistoryTasksByProcessInstanceId(details.getProcessId());
JSONArray array = object.getJSONArray("rows");
for (Object historyDetail : array) {
JSONObject historyDetailJson = JSONObject.parseObject(JSONObject.toJSONString(historyDetail));
JSONObject historyDetailJson = JSON.parseObject(JSON.toJSONString(historyDetail));
if ("rejected".equals(historyDetailJson.getString("activityId"))) {
flag = 6;
}
......@@ -654,7 +603,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
if (ObjectUtils.isNotEmpty(teskObject)) {
taskDetailArray = teskObject.getJSONArray("data");
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
JSONObject detail = JSON.parseObject(JSON.toJSONString(obj));
String name = detail.getString("name");
Map<String, String> map = new HashMap<String, String>();
......@@ -669,8 +618,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
JSONArray informerList = detail.getJSONArray("informerList");
if (informerList != null && informerList.size() > 0) {
for (Object informerDetail : informerList) {
JSONObject informerDetailJson = JSONObject
.parseObject(JSONObject.toJSONString(informerDetail));
JSONObject informerDetailJson = JSON
.parseObject(JSON.toJSONString(informerDetail));
if (informerDetailJson.getString("userName")
.equals(resultObject.getString("assignee"))) {
map.put("assignee", informerDetailJson.getString("realName"));
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureMaintainDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureMaintain;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureMaintainMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 服务实现类
......@@ -77,7 +63,6 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
private static int MAINTENANCE_ADD = 1;
private static String[] PROCESS_RESULT = {"验证通过", "验证未通过"};
......@@ -119,8 +104,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
}
String nextTaskId = failureDetailsService.checkIsInMaintenance(failureDetailsDto.getSequenceNbr());
if (nextTaskId == null) {
if (failureDetailsService.excuteTask(failureMaintainDto.getFaultId(), userInfo, condition)) {
} else {
if (!failureDetailsService.excuteTask(failureMaintainDto.getFaultId(), userInfo, condition)) {
throw new RuntimeException("执行维修中流程失败");
}
} else {
......@@ -150,7 +134,6 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
failureMaintainDto.setDepartment(orgUsr.getBizOrgName());
failureMaintainDto.setBizId(userInfo.getDepartment().getSequenceNbr());
failureMaintainDto.setRecoreType(RECORE_TYPE);
// this.createWithModel(failureMaintainDto);
// 添加完成后修改保修单状态为维修完成
FailureDetailsDto failureDetailsDto = failureDetailsService.queryBySeq(failureMaintainDto.getFaultId());
failureDetailsDto.setCurrentStatus(FailureStatuEnum.WAITING_ACCEPTANCE.getCode());
......@@ -166,8 +149,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
sourceFileServiceImpl.saveSourceFile(failureMaintainDto.getSequenceNbr(),
failureMaintainDto.getAttachment());
}
if (failureDetailsService.excuteTask(failureMaintainDto.getFaultId(), userInfo, condition)) {
} else {
if (!failureDetailsService.excuteTask(failureMaintainDto.getFaultId(), userInfo, condition)) {
throw new RuntimeException("执行维修完成流程失败");
}
}
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -12,6 +7,11 @@ import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureRepairlogMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
* 流程日志服务实现类
......@@ -40,7 +40,6 @@ public class FailureRepairlogServiceImpl extends BaseService<FailureRepairlogDto
* 根据FaultId查询
*/
public List<FailureRepairlog> findByfaultIdLog(Long faultId) {
Page<FailureRepairlogDto> page = new Page<>();
QueryWrapper<FailureRepairlog> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("fault_id", faultId).orderByAsc("process_time");
return baseMapper.selectList(queryWrapper);
......
......@@ -3,9 +3,9 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.FailureVerifyDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureVerifyDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureVerify;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum;
......@@ -14,10 +14,9 @@ import com.yeejoin.amos.boot.module.common.api.mapper.FailureVerifyMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureVerifyService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.Date;
import java.util.List;
......@@ -55,14 +54,14 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
if (!result) {
return new RuntimeException("无权限");
}
Boolean repairResult = null;
//根据验收的结果进行业务操作
if (condition == (AuditResultEnum.REFUSE.getCode())) {
verifyResult = AuditResultEnum.REFUSE.getCode();
repairResult = updateStatus(model, FailureStatuEnum.REFUSE, userInfo, condition);
updateStatus(model, FailureStatuEnum.REFUSE, userInfo, condition);
} else if (condition == AuditResultEnum.AGREE.getCode()) {
verifyResult = AuditResultEnum.AGREE.getCode();
repairResult = updateStatus(model, FailureStatuEnum.FINISH, userInfo, condition);
updateStatus(model, FailureStatuEnum.FINISH, userInfo, condition);
}
model.setVerifyResult(verifyResult);
......
......@@ -54,7 +54,7 @@ public class FireChemicalServiceImpl extends BaseService<FireChemicalDto,FireChe
/**
* 删除
* */
public Boolean updateisDelete( List sequenceNbr) {
public Boolean updateisDelete( List<Object> sequenceNbr) {
return this.update(new UpdateWrapper<FireChemical>().in("sequence_nbr", sequenceNbr).set("is_delete", 1));
}
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.itextpdf.text.log.SysoCounter;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
......@@ -35,6 +17,21 @@ import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.FireStationMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFireStationService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 微型消防站服务实现类
......@@ -57,8 +54,9 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
@Autowired
EquipFeignClient equipFeignClient;
private static final String CHILDREN= "children";
private static final String COUNT= "count";
private static final String PARENTID="parentId";
/**
* 分页查询
*/
......@@ -227,14 +225,16 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
@SuppressWarnings("unchecked")
public List<Map<String, Object>> fireStationCountAndBuildingTree(String bizOrgCode) {
List<Map<String, Object>> lit=null;
Map<String, Integer> FireStationCountMap = parseFireStationCount(bizOrgCode);
ResponseModel<Object> response = equipFeignClient.getBuildingTree();
List<Map<String, Object>> buildingMapList = (List<Map<String, Object>>) response.getResult();
if(buildingMapList==null || buildingMapList.size()<1) {
return null;
return lit;
}
List<Map<String, Object>> childrens = ((List<Map<String, Object>>) buildingMapList.get(0).get("children")).stream().filter(i-> i.containsKey("bizOrgCode") && i.get("bizOrgCode").toString().contains(bizOrgCode)).collect(Collectors.toList());
return parseTree(childrens,FireStationCountMap);
List<Map<String, Object>> childrens = ((List<Map<String, Object>>) buildingMapList.get(0).get(CHILDREN)).stream().filter(i-> i.containsKey("bizOrgCode") && i.get("bizOrgCode").toString().contains(bizOrgCode)).collect(Collectors.toList());
lit=parseTree(childrens,FireStationCountMap);
return lit;
}
@SuppressWarnings("unchecked")
......@@ -245,15 +245,15 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
for (Map<String, Object> child : children) {
if (child.get("id") != null) {
if (keySiteCountMap.containsKey(child.get("id").toString())) {
child.put("count",keySiteCountMap.get(child.get("id").toString()));
child.put(COUNT,keySiteCountMap.get(child.get("id").toString()));
}else {
child.put("count",0);
child.put(COUNT,0);
}
}else {
child.put("count",0);
child.put(COUNT,0);
}
if (!ValidationUtil.isEmpty(child.get("children"))) {
parseTree((List<Map<String, Object>>) child.get("children"), keySiteCountMap);
if (!ValidationUtil.isEmpty(child.get(CHILDREN))) {
parseTree((List<Map<String, Object>>) child.get(CHILDREN), keySiteCountMap);
}
}
}
......@@ -272,10 +272,10 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
for (int i = 0; i < parentBuilingIdArray.length; i++) {
if (map.containsKey(parentBuilingIdArray[i])) {
int num = map.get(parentBuilingIdArray[i]).intValue();
num = num + Integer.parseInt(map2.get("count").toString());
num = num + Integer.parseInt(map2.get(COUNT).toString());
map.put(parentBuilingIdArray[i], num);
} else {
map.put(parentBuilingIdArray[i], Integer.parseInt(map2.get("count").toString()));
map.put(parentBuilingIdArray[i], Integer.parseInt(map2.get(COUNT).toString()));
}
}
}
......@@ -300,27 +300,29 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
private String getNodeAllParentIds(List<Map<String, Object>> list , String id,String tegartString){
for (Map<String, Object> map : list) {
if(map.get("id").toString().equals(id) && map.get("parentId")!=null ) {
tegartString=tegartString+","+map.get("parentId").toString();
getNodeAllParentIds(list,map.get("parentId").toString(),tegartString);
if(map.get("id").toString().equals(id) && map.get(PARENTID)!=null ) {
tegartString=tegartString+","+map.get(PARENTID).toString();
getNodeAllParentIds(list,map.get(PARENTID).toString(),tegartString);
}
}
return tegartString;
}
public List<String> getNodeAllnodeIds(String id) {
List<String> listdate=null;
List<String> resultList = new ArrayList<String>();
resultList.add(id);
ResponseModel<List<Map<String, Object>>> response= equipFeignClient.getBuildingTreeList();
List<Map<String, Object>> responseList =response.getResult();
if(response.getResult()==null && response.getResult().size()<1) {
return null;
return listdate;
}
return getNodeAllnodeIds(resultList, responseList,id.toString());
listdate=getNodeAllnodeIds(resultList, responseList,id.toString());
return listdate;
}
private List<String> getNodeAllnodeIds(List<String> resultList,List<Map<String, Object>> list,String id){
for (Map<String, Object> map : list) {
if(map.get("parentId").toString().equals(id) && map.get("parentId")!=null ) {
if(map.get(PARENTID).toString().equals(id) && map.get(PARENTID)!=null ) {
resultList.add(map.get("id").toString());
getNodeAllnodeIds(resultList,list,map.get("id").toString());
}
......
......@@ -9,15 +9,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.dto.*;
......@@ -31,7 +28,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -68,8 +64,11 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
@Value("${fire-rescue}")
private String fireRescueId;
private static final String GETPARENT ="getParent";
private static final String GETNAME="getName";
private static final String GETSEQUENCENBR="getSequenceNbr";
private static final String TEAMID ="teamId";
private static final String IS_DELETE="is_delete";
/**
* 获取监控大队列表
*
......@@ -86,15 +85,15 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
* @param team 查询参数
* @return
*/
public IPage<FireTeamCardDto> listFireTeamByPage(Page page, FireTeamListDto team) {
public IPage<FireTeamCardDto> listFireTeamByPage(Page<FireTeamCardDto> page, FireTeamListDto team) {
// 获取消防车辆列表
ResponseModel<Object> result = equipFeignClient.getFireCarListAll();
Map<Object, Long> teamCarCountMap = Maps.newConcurrentMap();
if (!ValidationUtil.isEmpty(result)) {
List<Map<String, Object>> fireCarListMapList = (List<Map<String, Object>>) result.getResult();
if (!ValidationUtil.isEmpty(fireCarListMapList)) {
teamCarCountMap = fireCarListMapList.stream().filter(car -> !ValidationUtil.isEmpty(car.get("teamId")))
.collect(Collectors.groupingBy(car -> car.get("teamId"), Collectors.counting()));
teamCarCountMap = fireCarListMapList.stream().filter(car -> !ValidationUtil.isEmpty(car.get(TEAMID)))
.collect(Collectors.groupingBy(car -> car.get(TEAMID), Collectors.counting()));
}
}
......@@ -119,7 +118,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
Map<Object, Long> finalTeamCarCountMap = teamCarCountMap;
fireTeamList.forEach(t -> {
// 递归返回teamId bug2684 bykongfm
List<Long> teamIds = new ArrayList<Long>();
List<Long> teamIds = new ArrayList<>();
getAllTeamId(teamIds, t.getSequenceNbr());
int carNum = 0;
int fighterNum = 0;
......@@ -131,10 +130,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
}
t.setCarNum(carNum);
t.setFighterNum(fighterNum);
/*
* //递归查找全部战备人数 BUG2217 bykongfmfirefighters/1435850387868385282
* t.setFighterNum(getFightNumByTeamId(t.getSequenceNbr()));
*/
});
fireTeamListPage.setRecords(fireTeamList);
return fireTeamListPage;
......@@ -148,7 +144,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
return fireTeamMapper.listFireTeamDtoTree(isDelete);
}
public List<FireTeamDto> queryFireTeamForList(Boolean isDelete, Map map) {
public List<FireTeamDto> queryFireTeamForList(Boolean isDelete, Map<String,Object> map) {
if (map == null || map.size() < 1) {
return fireTeamMapper.listFireTeamDto(isDelete, null, null, null, null, null,null);
}
......@@ -183,13 +179,13 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
*/
public List<Menu> getTeamTree(Map<String, Object> columnMap) throws Exception {
Collection<FireTeam> list = this.listByMap(columnMap);
return TreeParser.getTree(null, list, FireTeam.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
return TreeParser.getTree(null, list, FireTeam.class.getName(), GETSEQUENCENBR, 2, GETNAME, GETPARENT,
null,null);
}
public List<Menu> getTeamTreeLikeCode(QueryWrapper<FireTeam> columnMap) throws Exception {
Collection<FireTeam> list = this.list(columnMap);
return TreeParser.getTree(null, list, FireTeam.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
return TreeParser.getTree(null, list, FireTeam.class.getName(), GETSEQUENCENBR, 2, GETNAME, GETPARENT,
null,null);
}
/**
......@@ -201,7 +197,6 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
MenuFrom root = new MenuFrom("-1", "消防队伍", null, null);
// 机场单位
// bug:2457需求要求不显示部门,因此更换方法 by 陈浩 2021-08-18
// List<OrgUsr> companyDeptList = orgUsrService.selectCompanyDepartmentMsg();
List<OrgUsr> companyDeptList = orgUsrService.selectCompanyList();
List<MenuFrom> companyDeptMenuList = Lists.newArrayList();
companyDeptList.forEach(o -> {
......@@ -224,7 +219,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
});
companyDeptMenuList.addAll(teamMenuList);
List<MenuFrom> menuList = TreeParser.getTreexin("-1", companyDeptMenuList, MenuFrom.class.getName(), "getKey",
1, "getName", "getParentId", "getNodeType");
1, GETNAME, "getParentId", "getNodeType");
root.setChildren(menuList);
return Lists.newArrayList(root);
}
......@@ -240,13 +235,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
}
public FireTeam saveFireTeam(FireTeam fireTeam) {
// /*修改bug 4547 名称在前端没有完成修改的问题 by 陈浩 on 2022-01-26 start */
// if(fireTeam.getContactUserId() !=null) {
// OrgUsr org =orgUsrService.getById(fireTeam.getContactUserId());
// if(org!=null) {
// fireTeam.setContactUser(org.getBizOrgName());
// }
// }
// /*修改bug 4547 名称在前端没有完成修改的问题 by 陈浩 on 2022-01-26 end */
if (fireTeam.getAddress() != null) {
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(fireTeam.getAddress());
......@@ -323,7 +312,6 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
*/
public void deleteById(Long parent) throws Exception {
// 查询是否有下属队伍
// List<FireTeamDto> fireTeamList = queryForList(null, false, parent);
/* 3026 【web】日常管理>机场单位,删除有级联数据的部门时,应无法直接删除 chenzhao 2021-09-28 start */
LambdaQueryWrapper<FireTeam> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(FireTeam::getParent, parent);
......@@ -334,7 +322,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
// 有下属队伍不能删除
throw new BaseException("该队伍下有下级队伍,不能删除", null, "该队伍下有下级队伍,不能删除");
}
update(new UpdateWrapper<FireTeam>().eq("sequence_nbr", parent).set("is_delete", 1));
update(new UpdateWrapper<FireTeam>().eq("sequence_nbr", parent).set(IS_DELETE, 1));
}
@Override
......@@ -357,7 +345,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
list.forEach(fireTeamZhDto -> {
Long sequenceNbr = fireTeamZhDto.getSequenceNbr();
result1.forEach(map -> {
String mapId = String.valueOf(map.get("teamId"));
String mapId = String.valueOf(map.get(TEAMID));
if (String.valueOf(sequenceNbr).equals(mapId)) {
Integer carNum = Integer.valueOf(map.get("carNum").toString());
fireTeamZhDto.setCarNum(carNum);
......@@ -368,16 +356,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
/*
*
* if(result1!=null&&result1.size()>0){ Map<String, Object> combineResultMap =
* new HashMap<String, Object>(); result1.stream().forEach(obj ->{
* combineResultMap.put(obj.get("teamId").toString(),obj.get("carNum")); });
* list.stream().forEach(obj ->{
* if(combineResultMap.containsKey(obj.getSequenceNbr())){
* obj.setCarNum(Integer.valueOf(combineResultMap.get(obj.getSequenceNbr()).
* toString())); } }); }
*/
return list;
}
......@@ -403,7 +382,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
if (result1 != null && result1.size() > 0) {
Map<String, Object> combineResultMap = new HashMap<String, Object>();
result1.stream().forEach(obj -> {
combineResultMap.put(obj.get("teamId").toString(), obj.get("carNum"));
combineResultMap.put(obj.get(TEAMID).toString(), obj.get("carNum"));
});
list.stream().forEach(obj -> {
if (combineResultMap.containsKey(obj.getSequenceNbr().toString())) {
......@@ -455,9 +434,10 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
* @param typeCode
*/
public List<FireTeam> getFirstAidForTypeCodeAndCompanyId(String dicCode, String typeCode, Long companyId) {
List<FireTeam> da=null;
DataDictionary dataDictionary = iDataDictionaryService.getByCode(dicCode, typeCode);
if (ObjectUtils.isEmpty(dataDictionary)) {
return null;
return da;
}
String code = dataDictionary.getCode();
LambdaQueryWrapper<FireTeam> queryWrapper = new LambdaQueryWrapper<FireTeam>();
......@@ -471,7 +451,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
public List<FireTeam> getFireTeamList() {
QueryWrapper<FireTeam> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_delete", false);
queryWrapper.eq(IS_DELETE, false);
return fireTeamMapper.selectList(queryWrapper);
}
......@@ -479,7 +459,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
public List<FireTeam> getExcelFireTeamList(String bizOrgCode) {
QueryWrapper<FireTeam> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_delete", false);
queryWrapper.eq(IS_DELETE, false);
queryWrapper.like("biz_org_code",bizOrgCode);
return fireTeamMapper.selectList(queryWrapper);
}
......@@ -490,7 +470,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
queryWrapper.eq(FireTeam::getTypeCode, "116");
queryWrapper.eq(FireTeam::getIsDelete, false);
return TreeParser.getTree(null, this.baseMapper.selectList(queryWrapper), FireTeam.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
return TreeParser.getTree(null, this.baseMapper.selectList(queryWrapper), FireTeam.class.getName(), GETSEQUENCENBR, 2, GETNAME, GETPARENT,
null,null);
}
......@@ -501,28 +481,28 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
*/
public List<Menu> getFirstTeamToDesignatedDepartment(String dicCode, String typeCode) throws Exception {
List<Menu> da=null;
DataDictionary dataDictionary = iDataDictionaryService.getByCode(dicCode, typeCode);
if (ObjectUtils.isEmpty(dataDictionary)) {
return null;
return da;
}
String code = dataDictionary.getCode();
LambdaQueryWrapper<FireTeam> queryWrapper = new LambdaQueryWrapper<FireTeam>();
queryWrapper.eq(FireTeam::getTypeCode, code);
queryWrapper.eq(FireTeam::getIsDelete, false);
// queryWrapper.eq(FireTeam::getCompanyName, "消防急救保障部");
// 消防救援保障部为保证灵活性以及防止名字变更 通过id查询 ID在配置文件中配置
queryWrapper.eq(FireTeam::getCompany,fireRescueId);
LambdaQueryWrapper<FireTeam> queryWrapper1 = new LambdaQueryWrapper<FireTeam>();
queryWrapper1.eq(FireTeam::getIsDelete, false);
// queryWrapper1.eq(FireTeam::getCompanyName, "消防急救保障部");
queryWrapper1.eq(FireTeam::getCompany,fireRescueId);
queryWrapper1.isNull(FireTeam::getParent);
queryWrapper1.eq(FireTeam::getTypeCode,code);
FireTeam parentFireTeam = this.baseMapper.selectOne(queryWrapper1);
if (parentFireTeam == null) {
return null;
return da;
}
return TreeParser.getTreeTeam(parentFireTeam.getSequenceNbr(), this.baseMapper.selectList(queryWrapper), FireTeam.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
return TreeParser.getTreeTeam(parentFireTeam.getSequenceNbr(), this.baseMapper.selectList(queryWrapper), FireTeam.class.getName(), GETSEQUENCENBR, 2, GETNAME, GETPARENT,
null,null);
// TODO Auto-generated method stub
}
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDataSyncService;
import com.yeejoin.amos.boot.module.common.api.service.IFirefightersService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
......@@ -25,17 +36,7 @@ import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFirefightersService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import java.util.*;
/**
* 消防队员 服务实现类
......@@ -65,6 +66,14 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
@Autowired
private IDataSyncService dataSyncService;
private static final String BIZORGCODE ="bizOrgCode";
private static final String AREASEXPERTISE ="areasExpertise";
private static final String JOBTITLE ="jobTitle";
private static final String STATE ="state";
private static final String FIRETEAMID ="fireTeamId";
private static final String POSTQUALIFICATION ="postQualification";
@Override
public List<FirefightersZhDto> getFirefighters(int pageNum, int pageSize, FirefightersDto par) {
return firefightersMapper.getFirefighters(pageNum, pageSize, par);
......@@ -123,18 +132,18 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
/**
* 导出列表
*/
public List<FirefightersExcelDto> exportToExcel(@Condition(Operator.eq) Boolean isDelete, Map par) {
public List<FirefightersExcelDto> exportToExcel(@Condition(Operator.eq) Boolean isDelete, Map<String,Object> par) {
if (par == null || par.size() < 1) {
return firefightersMapper.exportToExcel(isDelete, null, null, null, null, null, null,null);
}
String name = par.containsKey("name") ? par.get("name").toString() : null;
String postQualification = par.containsKey("postQualification") ? par.get("postQualification").toString()
String postQualification = par.containsKey(POSTQUALIFICATION) ? par.get(POSTQUALIFICATION).toString()
: null;
String fireTeamId = par.containsKey("fireTeamId") ? par.get("fireTeamId").toString() : null;
String state = par.containsKey("state") ? par.get("state").toString() : null;
String areasExpertise = par.containsKey("areasExpertise") ? par.get("areasExpertise").toString() : null;
String jobTitle = par.containsKey("jobTitle") ? par.get("jobTitle").toString() : null;
String bizOrgCode = par.containsKey("bizOrgCode") ? par.get("bizOrgCode").toString() : null;
String fireTeamId = par.containsKey(FIRETEAMID) ? par.get(FIRETEAMID).toString() : null;
String state = par.containsKey(STATE) ? par.get(STATE).toString() : null;
String areasExpertise = par.containsKey(AREASEXPERTISE) ? par.get(AREASEXPERTISE).toString() : null;
String jobTitle = par.containsKey(JOBTITLE) ? par.get(JOBTITLE).toString() : null;
String bizOrgCode = par.containsKey(BIZORGCODE) ? par.get(BIZORGCODE).toString() : null;
return firefightersMapper.exportToExcel(isDelete, name, postQualification, fireTeamId, state, areasExpertise,
jobTitle,bizOrgCode);
}
......@@ -142,18 +151,18 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
/**
* 导出列表
*/
public List<OrgUsrFireExcelDto> exportToExcelNew(@Condition(Operator.eq) Boolean isDelete, Map par) {
public List<OrgUsrFireExcelDto> exportToExcelNew(@Condition(Operator.eq) Boolean isDelete, Map<String,Object> par) {
if (par == null || par.size() < 1) {
return firefightersMapper.exportToExcelNew(isDelete, null, null, null, null, null, null,null);
}
String name = par.containsKey("name") ? par.get("name").toString() : null;
String postQualification = par.containsKey("postQualification") ? par.get("postQualification").toString()
String postQualification = par.containsKey(POSTQUALIFICATION) ? par.get(POSTQUALIFICATION).toString()
: null;
String fireTeamId = par.containsKey("fireTeamId") ? par.get("fireTeamId").toString() : null;
String state = par.containsKey("state") ? par.get("state").toString() : null;
String areasExpertise = par.containsKey("areasExpertise") ? par.get("areasExpertise").toString() : null;
String jobTitle = par.containsKey("jobTitle") ? par.get("jobTitle").toString() : null;
String bizOrgCode = par.containsKey("bizOrgCode") ? par.get("bizOrgCode").toString() : null;
String fireTeamId = par.containsKey(FIRETEAMID) ? par.get(FIRETEAMID).toString() : null;
String state = par.containsKey(STATE) ? par.get(STATE).toString() : null;
String areasExpertise = par.containsKey(AREASEXPERTISE) ? par.get(AREASEXPERTISE).toString() : null;
String jobTitle = par.containsKey(JOBTITLE) ? par.get(JOBTITLE).toString() : null;
String bizOrgCode = par.containsKey(BIZORGCODE) ? par.get(BIZORGCODE).toString() : null;
return firefightersMapper.exportToExcelNew(isDelete, name, postQualification, fireTeamId, state, areasExpertise,
jobTitle,bizOrgCode);
}
......@@ -161,10 +170,7 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
@Override
public List<Menu> getFirefightersJobTitleCount(String bizOrgCode) throws Exception {
// QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("type", "GWMC");
// queryWrapper.orderByAsc("sort_num");
// Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
Collection<DataDictionary> list =dataDictionaryMapper.getFirefightersJobTitle("GWMC");
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
......@@ -302,7 +308,6 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
}
}
BigScreen1VO bigScreen1VO = new BigScreen1VO();
// Integer teamCount = firefightersMapper.getTeamCountByCode(companyCode);
Map<String, Object> fireForceInfoByCode = firefightersMapper.getFireForceInfoByCode(bizOrgCode);
List<Map<String, Object>> personInfoList = new ArrayList<>();
HashMap<String, Object> fireInfo = new HashMap<>();
......@@ -320,11 +325,8 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
bigScreen1VO.setPersonList(personInfoList);
List<Map<String, Object>> teamInfoList = new ArrayList<>();
HashMap<String, Object> teamInfoMap = new HashMap<>();
// teamInfoMap.put("teamNum", teamCount);
teamInfoList.add(teamInfoMap);
bigScreen1VO.setTeamNumInfo(teamInfoList);
// bigScreen1VO.setTeamNum(teamCount);
// bigScreen1VO.setFirefightersInfo(fireForceInfoByCode);
List<Map<String, Object>> stationSignInfo = firefightersMapper.getStationSignInfo(bizOrgCode);
bigScreen1VO.setUsrSignInfo(stationSignInfo);
List<Map<String, Object>> usrSignInfoByBizOrgCode = firefightersMapper.getUsrSignInfoByBizOrgCode(bizOrgCode);
......@@ -340,7 +342,7 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
OrgUsr orgUsr = orgUsrMapper.selectList(lambda).get(0);
if (!ObjectUtils.isEmpty(orgUsr.getBizOrgType()) && "COMPANY".equals(orgUsr.getBizOrgType())) {
Map<String,Object> map = new HashMap<>();
map.put("bizOrgCode",orgUsr.getBizOrgCode());
map.put(BIZORGCODE,orgUsr.getBizOrgCode());
map.put("bizOrgName",orgUsr.getBizOrgName());
return map;
} else {
......@@ -356,7 +358,7 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
OrgUsr orgUsr = orgUsrMapper.selectList(lambda).get(0);
if (!ObjectUtils.isEmpty(orgUsr.getBizOrgType()) && "COMPANY".equals(orgUsr.getBizOrgType())) {
Map<String,Object> map = new HashMap<>();
map.put("bizOrgCode",orgUsr.getBizOrgCode());
map.put(BIZORGCODE,orgUsr.getBizOrgCode());
map.put("bizOrgName",orgUsr.getBizOrgName());
return map;
} else {
......@@ -372,7 +374,7 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
@Override
public IPage<Map<String, Object>> signPersonPageList(int current, int size, String bizOrgCode) {
Page page = new Page();
Page<Map<String, Object>> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return firefightersMapper.selectSignPersonList(page, bizOrgCode);
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.KeySite;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
......@@ -54,8 +24,24 @@ import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.Resource;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 重点部位服务实现类
......@@ -89,8 +75,9 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
@Autowired
private RedisUtils redisUtils;
private static final String BIZORGCODE= "bizOrgCode";
private static final String CHILDREN= "children";
private static final String PARENTID ="parentId";
@Resource
DataDictionaryMapper dataDictionaryMapper;
......@@ -108,11 +95,12 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
@Override
public List<Object> getBuildTree() {
List<Object> da=null;
ResponseModel<Object> response = equipFeignClient.getBuildingTree();
if (200 == response.getStatus() && ObjectUtils.isNotEmpty(response.getResult())) {
return JSONArray.parseArray(JSON.toJSONString(response.getResult()));
return JSON.parseArray(JSON.toJSONString(response.getResult()));
}
return null;
return da;
}
/**
......@@ -129,7 +117,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
public List<KeySiteExcleDto> exportToExcel(String name, Long buildingId, String fireEnduranceRate, String useNature,
String fireFacilitiesInfo, String bizOrgCode) {
// 导出模板增加权限
ReginParams reginParams = JSONObject.parseObject(redisUtils
ReginParams reginParams = JSON.parseObject(redisUtils
.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(),
ReginParams.class);
// 权限处理
......@@ -248,11 +236,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
.filter(k -> StringUtils.isNotBlank(k.getBizOrgCode()) && k.getBizOrgCode().contains(c.getBizOrgCode()))
.count())).collect(Collectors.toList());
List<OrgMenuDto> menuList = comDeptList.stream().map(o -> {
/*
* OrgMenuDto menu = new OrgMenuDto(o.getSequenceNbr(), o.getBizOrgName() + " ("
* + o.getTotal() + ")", ObjectUtils.isEmpty(o.getParentId()) ? 0L :
* Long.valueOf(o.getParentId()), o.getBizOrgType(), false, o.getBizOrgCode());
*/
return new OrgMenuDto(o.getSequenceNbr(), o.getBizOrgName(),
ObjectUtils.isEmpty(o.getParentId()) ? 0L : Long.parseLong(o.getParentId()), o.getBizOrgType(), false,
o.getBizOrgCode());
......@@ -309,7 +293,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
List<KeySite> excelList = new ArrayList<KeySite>();
Map<String, Object> param = new HashMap<>();
param.put("bizOrgCode", null);
param.put(BIZORGCODE, null);
param.put("type", null);
List<OrgUsr> comDeptList = orgUsrMapper.companyTreeByUserAndType(param);
......@@ -389,12 +373,6 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
public BaseEntity getCurrentInfo() {
BaseEntity userModel = new BaseEntity();
/*
* String keyString= RequestContext.getExeUserId(); String
* token=RequestContext.getToken(); ReginParams params =
* JSONObject.parseObject(redisUtils .get(RedisKey.buildReginKey(keyString,
* token)).toString(), ReginParams.class);
*/
userModel.setRecUserId("3141675");
userModel.setRecUserName("admin_jcs");
userModel.setRecDate(new Date());
......@@ -403,12 +381,13 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
@Override
public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr) {
List<OrgMenuDto> dal=null;
LambdaQueryWrapper<KeySite> mapper = new LambdaQueryWrapper<KeySite>();
mapper.eq(KeySite::getBuildingId, sequenceNbr);
mapper.eq(KeySite::getIsDelete, false);
List<KeySite> list = this.baseMapper.selectList(mapper);
if (list == null || list.size() == 0) {
return null;
return dal;
}
String buildNameString = list.get(0).getBuildingName();
List<OrgMenuDto> menuList = list.stream().map(o -> {
......@@ -450,20 +429,21 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
@SuppressWarnings("unchecked")
@Override
public List<Map<String, Object>> keySiteCountAndBuildingTree(String bizOrgCode) {
List<Map<String, Object>> da=null;
int allCount = 0;
Map<String, Integer> keySiteCountMap = parseKeySiteCount(bizOrgCode);
ResponseModel<Object> response = equipFeignClient.getBuildingTree();
List<Map<String, Object>> buildingMapList = (List<Map<String, Object>>) response.getResult();
if (buildingMapList == null || buildingMapList.size() < 1) {
return null;
return da;
}
List<Map<String, Object>> childrens = ((List<Map<String, Object>>) buildingMapList.get(0).get("children")).stream().filter(i->i.containsKey("bizOrgCode") && i.get("bizOrgCode").toString().contains(bizOrgCode)).collect(Collectors.toList());
List<Map<String, Object>> childrens = ((List<Map<String, Object>>) buildingMapList.get(0).get(CHILDREN)).stream().filter(i->i.containsKey(BIZORGCODE) && i.get(BIZORGCODE).toString().contains(bizOrgCode)).collect(Collectors.toList());
Map<String, Object> reMap = parseTree(childrens,
keySiteCountMap, allCount);
Map<String, Object> fristMap = buildingMapList.get(0);
fristMap.put("id", 0);
fristMap.put("name", fristMap.get("instanceName") + "(" + reMap.get("allCount") + ")");
fristMap.put("children", reMap.get("children"));
fristMap.put(CHILDREN, reMap.get(CHILDREN));
buildingMapList.clear();
buildingMapList.add(fristMap);
return buildingMapList;
......@@ -486,12 +466,12 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
} else {
child.put("name", child.get("name") + "(" + 0 + ")");
}
if (!ValidationUtil.isEmpty(child.get("children"))) {
parseTree((List<Map<String, Object>>) child.get("children"), keySiteCountMap, allCount);
if (!ValidationUtil.isEmpty(child.get(CHILDREN))) {
parseTree((List<Map<String, Object>>) child.get(CHILDREN), keySiteCountMap, allCount);
}
}
}
resultMap.put("children", children);
resultMap.put(CHILDREN, children);
resultMap.put("allCount", allCount);
return resultMap;
}
......@@ -537,28 +517,29 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
private String getNodeAllParentIds(List<Map<String, Object>> list, String id, String tegartString) {
for (Map<String, Object> map : list) {
if (map.get("id").toString().equals(id) && map.get("parentId") != null) {
tegartString = tegartString + "," + map.get("parentId").toString();
getNodeAllParentIds(list, map.get("parentId").toString(), tegartString);
if (map.get("id").toString().equals(id) && map.get(PARENTID) != null) {
tegartString = tegartString + "," + map.get(PARENTID).toString();
getNodeAllParentIds(list, map.get(PARENTID).toString(), tegartString);
}
}
return tegartString;
}
public List<Long> getNodeAllnodeIds(Long id) {
List<Long> da=null;
List<Long> resultList = new ArrayList<Long>();
resultList.add(id);
ResponseModel<List<Map<String, Object>>> response = equipFeignClient.getBuildingTreeList();
List<Map<String, Object>> responseList = response.getResult();
if (response.getResult() == null && response.getResult().size() < 1) {
return null;
return da;
}
return getNodeAllnodeIds(resultList, responseList, id.toString());
}
private List<Long> getNodeAllnodeIds(List<Long> resultList, List<Map<String, Object>> list, String id) {
for (Map<String, Object> map : list) {
if (map.get("parentId").toString().equals(id) && map.get("parentId") != null) {
if (map.get(PARENTID).toString().equals(id) && map.get(PARENTID) != null) {
resultList.add(Long.parseLong(map.get("id").toString()));
getNodeAllnodeIds(resultList, list, map.get("id").toString());
}
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -80,7 +80,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
String inAgreement,
String bizOrgCode) {
Page<List<LinkageUnitDto>> linkageUnitList = linkageUnitMapper.getEmergencyLinkageUnitList(page,unitName, linkageUnitType,linkageUnitTypeCode, emergencyLinkageUnitCode,inAgreement, bizOrgCode);
List<Map> linkageUnitListMap =JSONArray.parseArray(JSONArray.toJSONString(linkageUnitList.getRecords()), Map.class);
List<Map> linkageUnitListMap = JSON.parseArray(JSON.toJSONString(linkageUnitList.getRecords()), Map.class);
List<Map<String, Object>> pageList = dynamicFormInstanceService.listAll(getGroupCode());
linkageUnitListMap.forEach(i -> {
......@@ -92,7 +92,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
});
});
List<LinkageUnitDto> resultDtoList = JSONArray.parseArray(JSONArray.toJSONString(linkageUnitListMap),
List<LinkageUnitDto> resultDtoList = JSON.parseArray(JSON.toJSONString(linkageUnitListMap),
LinkageUnitDto.class);
List<LinkageUnitDto> detaiList = resultDtoList.stream().map(item -> {
Date now = new Date();
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
......@@ -80,6 +80,12 @@ public class MaintenanceCompanyServiceImpl
SourceFileServiceImpl sourceFileService;
@Autowired
OrgUsrMapper orgUsrMapper;
private static final String STATUS ="status";
private static final String PARENTID="parentId";
/**
* 分页查询
*/
......@@ -243,6 +249,7 @@ public class MaintenanceCompanyServiceImpl
@Override
public List<Map<String, Object>> getAllMaintenanceList(String maintenanceType) {
List<Map<String, Object>> da=null;
String type = null;
switch (maintenanceType.toUpperCase()) {
case PERSON:
......@@ -255,7 +262,7 @@ public class MaintenanceCompanyServiceImpl
type = MAINTENANCE_COMPANY;
}
if (StringUtils.isBlank(type)) {
return null;
return da;
}
List<Map<String, Object>> dynamicFormList = dynamicFormInstanceService.listAll(type);
LambdaQueryWrapper<MaintenanceCompany> wrapper = new LambdaQueryWrapper<MaintenanceCompany>();
......@@ -278,7 +285,8 @@ public class MaintenanceCompanyServiceImpl
return dynamicFormList;
}
public List<Map<String, Object>> getAllMaintenanceEexcleList(String maintenanceType, Map parms) {
public List<Map<String, Object>> getAllMaintenanceEexcleList(String maintenanceType, Map<String, Object> parms) {
List<Map<String, Object>> da=null;
String type = null;
switch (maintenanceType.toUpperCase()) {
case PERSON:
......@@ -291,7 +299,7 @@ public class MaintenanceCompanyServiceImpl
type = MAINTENANCE_COMPANY;
}
if (StringUtils.isBlank(type)) {
return null;
return da;
}
List<Map<String, Object>> dynamicFormList = dynamicFormInstanceService.listAll(type);
LambdaQueryWrapper<MaintenanceCompany> wrapper = new LambdaQueryWrapper<MaintenanceCompany>();
......@@ -299,7 +307,7 @@ public class MaintenanceCompanyServiceImpl
wrapper.eq(MaintenanceCompany::getIsDelete, false);
if (parms != null && parms.size() > 0) {
String name = parms.containsKey("name") ? parms.get("name").toString() : null;
String parentId = parms.containsKey("parentId") ? parms.get("parentId").toString() : null;
String parentId = parms.containsKey(PARENTID) ? parms.get(PARENTID).toString() : null;
if (name != null) {
wrapper.like(MaintenanceCompany::getName, name);
}
......@@ -328,7 +336,7 @@ public class MaintenanceCompanyServiceImpl
@Override
public List<MaintenancePersonExcleDto> exportToMaintenancePersonExcel(Map map) {
List<Map<String, Object>> list = this.getAllMaintenanceEexcleList(PERSON, map);
return JSONArray.parseArray(JSONArray.toJSONString(list), MaintenancePersonExcleDto.class);
return JSON.parseArray(JSON.toJSONString(list), MaintenancePersonExcleDto.class);
}
@Override
......@@ -421,8 +429,8 @@ public class MaintenanceCompanyServiceImpl
case PERSON:
type = MAINTENANCE_PERSON;
filedParamsMap = new HashMap<>();
if (paramsMap.containsKey("status")) {
filedParamsMap.put("status", paramsMap.get("status").toString());
if (paramsMap.containsKey(STATUS)) {
filedParamsMap.put(STATUS, paramsMap.get(STATUS).toString());
}
mainTableList = this.checkMaintenanceCompanyList(wrapper, paramsMap);
/*BUG 2503 人员头像存在附件中,获取附件信息返回前端 start*/
......@@ -470,8 +478,8 @@ public class MaintenanceCompanyServiceImpl
if (paramsMap.containsKey("name")) {
wrapper.like(MaintenanceCompany::getName, paramsMap.get("name").toString());
}
if (paramsMap.containsKey("parentId") && !"-1".equals(paramsMap.get("parentId"))) {
Long parentId = Long.parseLong(paramsMap.get("parentId").toString());
if (paramsMap.containsKey(PARENTID) && !"-1".equals(paramsMap.get(PARENTID))) {
Long parentId = Long.parseLong(paramsMap.get(PARENTID).toString());
MaintenanceCompany company = getOne(
new LambdaQueryWrapper<MaintenanceCompany>().eq(MaintenanceCompany::getSequenceNbr, parentId));
wrapper.likeRight(MaintenanceCompany::getCode, company.getCode());
......@@ -651,7 +659,7 @@ public class MaintenanceCompanyServiceImpl
* @return
*/
public Page<Map<String, Object>> queryOrgUsrMsgPage(int pageNum, int pageSize, Long seq, String amosUserId) {
MaintenanceCompany maintenanceCompany = new MaintenanceCompany();
MaintenanceCompany maintenanceCompany = null;
if (ValidationUtil.isEmpty(seq)) {
maintenanceCompany = getMaintenanceCompany(amosUserId);
seq = maintenanceCompany.getSequenceNbr();
......@@ -660,7 +668,7 @@ public class MaintenanceCompanyServiceImpl
if (pageNum == -1 || pageSize == -1) {
pageSize = Integer.MAX_VALUE;
}
Page page = new Page(pageNum, pageSize);
Page<OrgUsrDto> page = new Page<>(pageNum, pageSize);
Page<Map<String, Object>> companys = new Page<>(pageNum, pageSize);
Page<OrgUsrDto> pageResult = this.baseMapper.selectOrgUsrPageList(page, seq);
List<Map<String, Object>> finalResultMap = Lists.newArrayList();
......@@ -687,17 +695,11 @@ public class MaintenanceCompanyServiceImpl
wrapper.eq(MaintenanceCompany::getIsDelete, false);
wrapper.eq(MaintenanceCompany::getAmosId, amosUserId);
MaintenanceCompany maintenancePerson = this.baseMapper.selectOne(wrapper);
// DynamicFormInstance dyFormInstance = dynamicFormInstanceService.getOne(
// new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "amosAccount")
// .eq(DynamicFormInstance::getFieldValue, amosUserId));
if (ValidationUtil.isEmpty(maintenancePerson)) {
throw new BadRequest("维保账号不存在或未关联系统账号.");
}
// MaintenanceCompany person = this.getOne(new LambdaQueryWrapper<MaintenanceCompany>()
// .eq(MaintenanceCompany::getInstanceId, dyFormInstance.getInstanceId()));
// if (ValidationUtil.isEmpty(person)) {
// throw new BadRequest("维保账号不存在或未关联系统账号.");
// }
MaintenanceCompany maintenanceCompany = this.getOne(new LambdaQueryWrapper<MaintenanceCompany>()
.eq(MaintenanceCompany::getSequenceNbr, maintenancePerson.getParentId()));
if (ValidationUtil.isEmpty(maintenanceCompany)) {
......@@ -713,14 +715,13 @@ public class MaintenanceCompanyServiceImpl
wrapper.eq(MaintenanceCompany::getType, COMPANY);
// 查询所有维保单位信息
List<MaintenanceCompany> lists = maintenanceCompanyMapper.selectList(wrapper);
//List<MaintenanceCompany> lists = this.list();
lists.forEach(list -> {
Map<String, Object> maintenanceCompany = new HashMap<>();
maintenanceCompany.put("id", list.getSequenceNbr());
maintenanceCompany.put("code", list.getCode());
maintenanceCompany.put("name", list.getName());
maintenanceCompany.put("type", 1);
maintenanceCompany.put("parentId", 0);
maintenanceCompany.put(PARENTID, 0);
// 查询该维保单位下的业主信息
List<OrgUsrDto> orgUsrDtos = orgUsrMapper.selectOrgUsrList(list.getSequenceNbr());
orgUsrDtos.forEach(orgUsrDto -> {
......@@ -729,7 +730,7 @@ public class MaintenanceCompanyServiceImpl
airCompany.put("code", orgUsrDto.getBizOrgCode());
airCompany.put("name", orgUsrDto.getBizOrgName());
airCompany.put("type", 2);
airCompany.put("parentId", list.getSequenceNbr());
airCompany.put(PARENTID, list.getSequenceNbr());
airCompany.put("contractId", orgUsrDto.getContractId());
companysMsg.add(airCompany);
});
......@@ -745,17 +746,17 @@ public class MaintenanceCompanyServiceImpl
* @param resultMap 拷贝后的对象
* @explain 将paramsMap中的键值对全部拷贝到resultMap中;
*/
private static void mapCopy(Map paramsMap, Map resultMap) {
private static void mapCopy(Map<String, Object> paramsMap, Map<String, Object> resultMap) {
if (resultMap == null) {
return;
}
if (paramsMap == null) {
return;
}
Iterator it = paramsMap.entrySet().iterator();
Iterator<Map.Entry<String, Object>> it = paramsMap.entrySet().iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
Object key = entry.getKey();
Map.Entry<String, Object> entry = (Map.Entry) it.next();
String key = entry.getKey().toString();
resultMap.put(key, paramsMap.get(key) != null ? paramsMap.get(key) : "");
}
}
......
......@@ -119,8 +119,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Autowired
OrgUsrServiceImpl iOrgUsrService;
// @Autowired
// OrgUsrAgencyUserMapper orgUsrAgencyUserMapper;
@Value("${jcs.company.topic.delete:jcs/company/topic/delete}")
private String airportDeleteTopic;
......@@ -184,7 +182,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
menuList.forEach(e -> map.put(e.getKey(), e));
Set<? extends Map.Entry<Long, ? extends OrgMenuDto>> entries = map.entrySet();
// 此处多线程,会value 出现null 的情况
// entries.parallelStream().forEach(entry -> {
entries.forEach(entry -> {
OrgMenuDto value = entry.getValue();
if (value != null) {
......@@ -248,12 +245,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
parentId = !ObjectUtils.isEmpty(PARENTIDMethodNameme.invoke(entity))
? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity)))
: null;
// if (parentId == null || topId ==parentId ) {
// OrgMenuDto menu = new OrgMenuDto(Long.valueOf(String.valueOf(IDMethodNameme.invoke(entity))),
// String.valueOf(NAMEMethodNameme.invoke(entity)), parentId,
// String.valueOf(OrgTypeMethodNameme.invoke(entity)), false);
// resultList.add(menu);
// }
/*
* *******************topId与parentId的等值判断,修改人陈浩 on 2021/07/21---start
******************************/
......@@ -631,11 +623,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 2021-09-16
if (null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString())) {
amosIds.add(t.get("amosOrgId").toString());
// FeignClientResult<AgencyUserModel> result1 = Privilege.agencyUserClient
// .queryByUserId(t.get("amosOrgId").toString());
// if (null != result1.getResult()) {
// t.put("amosOrgCode", result1.getResult().getRealName());
// }
String chargePersonId = iOrgUsrService.getIdNumberByAmosId(t.get("amosOrgId").toString());
t.put("chargePersonId", chargePersonId);
} else {
......@@ -670,15 +657,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
/* Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束 */
pageBean.setRecords(list);
// Calendar calendar = Calendar.getInstance();
// calendar.add(Calendar.DAY_OF_YEAR,1);
// calendar.set(Calendar.HOUR_OF_DAY,0);
// calendar.set(Calendar.SECOND,0);
// calendar.set(Calendar.MINUTE,0);
// calendar.set(Calendar.MILLISECOND,0);
//当前时间与晚上十二点的秒差
// Long timeOut = (calendar.getTimeInMillis()-System.currentTimeMillis()) / 1000;
// redisUtils.set("userList", pageBean, timeOut);
return pageBean;
}
......@@ -746,11 +724,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 2021-09-16
if (null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString())) {
amosIds.add(t.get("amosOrgId").toString());
// FeignClientResult<AgencyUserModel> result1 = Privilege.agencyUserClient
// .queryByUserId(t.get("amosOrgId").toString());
// if (null != result1.getResult()) {
// t.put("amosOrgCode", result1.getResult().getRealName());
// }
String chargePersonId = iOrgUsrService.getIdNumberByAmosId(t.get("amosOrgId").toString());
t.put("chargePersonId", chargePersonId);
} else {
......@@ -779,15 +753,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
/* Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束 */
pageBean.setRecords(list);
// Calendar calendar = Calendar.getInstance();
// calendar.add(Calendar.DAY_OF_YEAR,1);
// calendar.set(Calendar.HOUR_OF_DAY,0);
// calendar.set(Calendar.SECOND,0);
// calendar.set(Calendar.MINUTE,0);
// calendar.set(Calendar.MILLISECOND,0);
// //当前时间与晚上十二点的秒差
// Long timeOut = (calendar.getTimeInMillis()-System.currentTimeMillis()) / 1000;
// redisUtils.set("userList:" + bizOrgCode, pageBean, timeOut);
return pageBean;
}
......@@ -799,17 +765,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
List<FormValue> formValue = new ArrayList<>();
for (DynamicFormInstanceDto alertFormValue : list) {
/* 修改为动态表单返回的数据参数量 2021-09-08 陈浩 开始 */
// if (alertFormValue.getFieldValueLabel() != null) {
// FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(),
// alertFormValue.getFieldType(), alertFormValue.getFieldValueLabel(), alertFormValue.getBlock());
// formValue.add(value);
// } else {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(),
alertFormValue.getFieldType(), alertFormValue.getFieldValue(), alertFormValue.getBlock(),
alertFormValue.getFieldValueLabel());
formValue.add(value);
/* 修改为动态表单返回的数据参数量 2021-09-08 陈浩 结束 */
// }
/* BUG2580 返回值为code值 修改为类型名称 2021-08-31 陈召 开始 */
}
return formValue;
......@@ -1079,9 +1040,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} else {
orgUsr.setBizOrgCode(getOrgCodeStr());
}
// if(redisUtils.get("userList")!= null){
// redisUtils.del("userList");
// }
return saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue());
}
......@@ -1098,10 +1057,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
orgUsr.setBizOrgCode(getOrgCodeStr());
}
//已在前面对此字段赋值 废弃
// if (!ObjectUtils.isEmpty(OrgPersonVo.getAmosOrgId())) {
// AgencyUserModel user = Privilege.agencyUserClient.queryByUserId(OrgPersonVo.getAmosOrgId()).getResult();
// OrgPersonVo.setAmosOrgCode(user.getRealName());
// }
return saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue());
}
......@@ -1124,14 +1080,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
orgUsr.setSequenceNbr(id);
// 查询机构下的所有部门单位人员数据,进行bizOrgCode的统一修改 BUG 2880 by litw start 2021年9月16日
// String oriOrgCode = oriOrgUsr.getBizOrgCode();
// Map<String, Object> columnMap = new HashMap<>();
// columnMap.put("bizOrgCode", oriOrgCode);
// List<OrgUsr> list = orgUsrMapper.selectAllChildrenList(columnMap);
// list.stream().forEach(e -> {
// e.setBizOrgCode(e.getBizOrgCode().replace(oriOrgCode, orgUsr.getBizOrgCode()));
// });
// this.updateBatchById(list);
// /*单位编辑后 code值也应做出修改 2021-09-09 陈召 结束 */8888
orgUsrMapper.updatelistByParentId(orgUsr.getBizOrgCode(), oriOrgUsr.getBizOrgCode());
}else {
......@@ -1249,7 +1198,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
try {
updatePersonNumber(id, orgPersonDto);
} catch (Exception e) {
logger.info("同步修改培训计划中的人员编号:---------------" + id);
logger.info("同步修改培训计划中的人员编号:---------------");
}
// 修改人员信息
OrgUsr orgUsr = new OrgUsr();
......@@ -1982,7 +1931,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 返回全部单位列表
return companyAndKeySiteList(companyList);
} else if (roles.equals(code)) {
// } else {
// 人员与多个部门/公司关联
List<OrgUsr> orgUsrList = orgUsrList(user);
if (ObjectUtils.isEmpty(orgUsrList)) {
......@@ -2048,7 +1997,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
int num = orgUsrTreeDto.getNum() + value.getNum();
orgUsrTreeDto.setNum(num);
}
System.out.println(value.getSequenceNbr()+"---------------------------------------");
// 只查出一级单位,顶级为西部机场集团
if (value.getBizOrgCode() !=null && value.getBizOrgType().equals(OrgPersonEnum.公司.getKey())
&& value.getBizOrgCode().length() == TreeParser.CODE_LENGTH * 2) {
......@@ -2069,7 +2017,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
String codeAdmin = UserRolesEnum.ADMIN.getCode();
String roles = getRoles(user, code);
if (!StringUtils.isEmpty(roles)) {
// treeList = getDepartmentTreeByUser(user,list);
if (roles.equals(codeAdmin)) {
// 返回全量树
treeList = buildTreeParallel(list);
......@@ -2307,47 +2254,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
* @return
*/
@Override
/*
* public List<Map<String, Object>> getPersonDetailByCompanyIds(List<String>
* ids) {
*
* List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
* LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<OrgUsr>();
* wrapper.eq(OrgUsr::getIsDelete, false); wrapper.eq(OrgUsr::getBizOrgType,
* OrgPersonEnum.人员.getKey()); wrapper.in(OrgUsr::getParentId, ids);
* List<OrgUsr> orgPersonList = this.baseMapper.selectList(wrapper);
*
* List<String> fireStationSimpleList = new ArrayList<String>();
* ids.forEach(id-> { List<Map<String, Object>> maps = fireStationServiceImpl
* .queryForFireStationListByCompanyId(Long.parseLong(id));
* maps.stream().forEach(i -> { String tagertString = i.get("name").toString() +
* "@" + i.get("sequence_nbr").toString();
* fireStationSimpleList.add(tagertString); }); });
*
* for (OrgUsr orgUsr : orgPersonList) { Map<String, Object> map = new
* HashMap<String, Object>(); List<DynamicFormInstanceDto> dyList =
* alertFormValueServiceImpl.queryByCalledId(orgUsr.getSequenceNbr()); if
* (ObjectUtils.isEmpty(dyList)) { continue; } for (DynamicFormInstanceDto dto :
* dyList) { if ("positionType".equals(dto.getFieldCode())) {
* map.put("postType", dto.getFieldValue()); map.put("postTypeName",
* dto.getFieldValueLabel()); break; } } if (!map.containsKey("postType") ||
* map.get("postType") == null ||
* StringUtils.isBlank(map.get("postType").toString())) { continue; }
* map.put("userName", orgUsr.getBizOrgName()); map.put("userId",
* orgUsr.getSequenceNbr().toString()); LambdaQueryWrapper<OrgUsr> wrapper1 =
* new LambdaQueryWrapper<OrgUsr>(); wrapper1.eq(OrgUsr::getIsDelete, false);
* wrapper1.eq(OrgUsr::getBizOrgType, OrgPersonEnum.公司.getKey());
* wrapper1.eq(OrgUsr::getSequenceNbr, Long.parseLong(orgUsr.getParentId()));
* OrgUsr orgCompany = this.baseMapper.selectOne(wrapper1); if
* (ObjectUtils.isEmpty(orgCompany)) { continue; } map.put("teamName",
* orgCompany.getBizOrgName()); map.put("teamId",
* orgCompany.getSequenceNbr().toString()); List<Map<String, Object>>
* fireStationList = fireStationServiceImpl
* .queryForFireStationListByCompanyId(Long.parseLong(orgUsr.getParentId())); if
* (ObjectUtils.isEmpty(fireStationList)) { continue; } if
* (!map.containsKey("fireStation")){ map.put("fireStation",
* fireStationSimpleList); } list.add(map); } return list; }
*/
public List<Map<String, Object>> getPersonDetailByCompanyIds(List<String> ids) {
......@@ -2412,7 +2319,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (null == orgUnitId) {
return null;
}
LambdaQueryWrapper<OrgUsr> queryWrapper = new LambdaQueryWrapper();
LambdaQueryWrapper<OrgUsr> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(OrgUsr::getBizOrgCode, orgUsr.getBizOrgCode());
queryWrapper.eq(OrgUsr::getBizOrgType, CommonConstant.BIZ_ORG_TYPE_PERSON);
queryWrapper.eq(OrgUsr::getIsDelete, false);
......@@ -2606,20 +2513,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
parentId = !ObjectUtils.isEmpty(PARENTIDMethodNameme.invoke(entity))
? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity)))
: null;
// if (parentId == null || topId ==parentId ) {
// OrgMenuDto menu = new OrgMenuDto(Long.valueOf(String.valueOf(IDMethodNameme.invoke(entity))),
// String.valueOf(NAMEMethodNameme.invoke(entity)), parentId,
// String.valueOf(OrgTypeMethodNameme.invoke(entity)), false);
// resultList.add(menu);
// }
/*
* *******************topId与parentId的等值判断,修改人陈浩 on 2021/07/21---start
******************************/
if (parentId == null) {// topId与parentId的等值判断,修改人陈浩 on 2021/07/21
// OrgMenuDto menu = new OrgMenuDto(Long.valueOf(String.valueOf(IDMethodNameme.invoke(entity))),
// String.valueOf(NAMEMethodNameme.invoke(entity)), parentId,
// String.valueOf(OrgTypeMethodNameme.invoke(entity)), false);
// resultList.add(menu);
} else if (topId != null && topId.longValue() == parentId.longValue()) {
OrgMenuDto menu = new OrgMenuDto(Long.valueOf(String.valueOf(IDMethodNameme.invoke(entity))),
String.valueOf(NAMEMethodNameme.invoke(entity)), parentId,
......@@ -2644,13 +2543,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
BeanUtils.copyProperties(OrgPersonVo, orgUsr);
orgUsr.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
// orgCode 前端调用接口生成 不再后台生成orgCode
/*
* if (OrgPersonVo.getParentId() != null) {OrgUsrMapper OrgUsr parent =
* getById(OrgPersonVo.getParentId()); if (parent != null &&
* ObjectUtils.isEmpty(OrgPersonVo.getBizOrgCode())) {
* orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr()); } } else {
* orgUsr.setBizOrgCode(getOrgCodeStr()); }
*/
OrgUsrDto result = new OrgUsrDto();
if (orgUsr.getSequenceNbr() != null) { // 走更新方法
this.updateById(orgUsr);
......@@ -2658,17 +2551,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} else {
result = saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue());
}
// }*/
// OrgUsrDto result = new OrgUsrDto();
// if (orgUsr.getSequenceNbr() != null) { // 走更新方法
// this.updateById(orgUsr);
// BeanUtils.copyProperties(orgUsr, result);
// } else {
// if(OrgPersonVo.getDynamicFormValue() == null || OrgPersonVo.getDynamicFormValue().size() == 0) {
// throw new BadRequest("人员动态表单信息未填写");
// }
// result = saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue());
// }
return result;
}
......@@ -2766,12 +2649,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return orgUsr1;
}
// orgUsr.setBizOrgCode(getOrgCodeStr());
//
//
//
// return result;
// }
@Override
public void updateByIdOrgPersonFlc(OrgPersonDto OrgPersonVo, Long id) throws Exception {
......@@ -3404,10 +3282,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
// 1.删除单位人员
// QueryWrapper<CompanyInfo> queryWrapper = new QueryWrapper<>();
// CompanyInfo info = fireCompanyInfoServiceImpl.getOne(queryWrapper.eq("instance_id", id));
// info.setIsDelete(true);
// fireCompanyInfoServiceImpl.updateById(info);
// 删除时,只作逻辑删除
// BUG 2741 首先判断是否为公司 如果公司底下有人员不可直接删除 bykongfm
// bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 start
......@@ -3428,7 +3303,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
/* bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-13 end */
}
// bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 end
// iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
/* bug 2812 一次删除多条数据 传入类型修改为string 问题解决 2021-09-09 陈召 开始 */
iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", String.valueOf(id)).set("is_delete",
CommonConstant.IS_DELETE_01));
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto;
import com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment;
import com.yeejoin.amos.boot.module.common.api.entity.SpecialPositionStaff;
import com.yeejoin.amos.boot.module.common.api.mapper.RescueEquipmentMapper;
import com.yeejoin.amos.boot.module.common.api.service.IRescueEquipmentService;
import com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -69,14 +69,14 @@ public class RescueEquipmentServiceImpl extends BaseService<RescueEquipmentDto,
// 查询已有数据的岗位类型
List<Long> vehicleCodeCodeList = this.baseMapper.getVehicleCodeCodeList(false, companyId);
// 排除已有数据的,返回
List<MenuFrom> menuListd=new ArrayList<>();
for (int i = 0; i < menuList.size(); i++) {
if (vehicleCodeCodeList.contains(Long.valueOf(menuList.get(i).getKey()))) {
menuList.remove(i);
i--;
if (!vehicleCodeCodeList.contains(Long.valueOf(menuList.get(i).getKey()))) {
menuListd.add(menuList.get(i));
}
}
HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
objectObjectHashMap.put("JYZBLX", menuList);
objectObjectHashMap.put("JYZBLX", menuListd);
return objectObjectHashMap;
}
}
\ No newline at end of file
......@@ -77,23 +77,20 @@ public class SourceFileServiceImpl extends BaseService<SourceFileDto, SourceFile
return new ArrayList<>();
}
// sourceFiles.forEach(s -> {
// s.setSourceId(sourceId);
// this.saveOrUpdate(s);
// });
boolean flag =false;
for (SourceFile sourceFile : sourceFiles) {
sourceFile.setSourceId(sourceId);
flag =this.saveOrUpdate(sourceFile);
}
// boolean flag = this.saveOrUpdate(sourceFiles);
return false ? sourceFiles : Collections.EMPTY_LIST;
return flag ? sourceFiles : Collections.EMPTY_LIST;
}
/**
* 保存附件
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void saveAttachments(Long sequenceNbr, Map<String, List<AttachmentDto>> attachmentMap) {
if (!ValidationUtil.isEmpty(attachmentMap)) {
List<SourceFile> sourceFiles = Lists.newArrayList();
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto;
import com.yeejoin.amos.boot.module.common.api.entity.SpecialPositionStaff;
import com.yeejoin.amos.boot.module.common.api.mapper.SpecialPositionStaffMapper;
import com.yeejoin.amos.boot.module.common.api.service.ISpecialPositionStaffService;
import com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;
/**
* 特岗人员服务实现类
......@@ -72,6 +70,7 @@ public class SpecialPositionStaffServiceImpl extends BaseService<SpecialPosition
List<Long> positionStaffCodeList = this.baseMapper.getPositionStaffCodeList(false,companyId);
// 排除已有数据的,返回
/*bug 3483 陈召 2021-11-18 开始*/
List<MenuFrom> menuListds=new ArrayList<>();
for (int i = 0; i < menuList.size(); i++) {
//排除父岗位是否已有 有就删除
if (positionStaffCodeList.contains(Long.valueOf(menuList.get(i).getKey()))) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment