Commit f7708a9a authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://39.100.92.250:5000/moa/amos-boot-biz into develop_tzs_register
parents b8c3737c d0d46010
......@@ -50,6 +50,10 @@ public class EquCategoryConverter implements Converter<String> {
equipmentMap.put("客运缆车", "9200");
equipmentMap.put("客运拖牵索道", "9300");
equipmentMap.put("水上游乐设施类", "6D00");
equipmentMap.put("曳引与强制驱动电梯", "3100");
equipmentMap.put("液压驱动电梯", "3200");
equipmentMap.put("自动扶梯与自动人行道", "3300");
equipmentMap.put("其它类型电梯", "3400");
}
@Override
......
......@@ -73,6 +73,16 @@ public class EquDefineConverter implements Converter<String> {
equipmentMap.put("低位客运拖牵索道", "9310");
equipmentMap.put("高位客运拖牵索道", "9320");
equipmentMap.put("电动单梁起重机", "4170");
equipmentMap.put("曳引驱动乘客电梯", "3110");
equipmentMap.put("曳引驱动载货电梯", "3120");
equipmentMap.put("强制驱动载货电梯", "3130");
equipmentMap.put("液压乘客电梯", "3210");
equipmentMap.put("液压载货电梯", "3220");
equipmentMap.put("自动扶梯", "3310");
equipmentMap.put("自动人行道", "3320");
equipmentMap.put("防爆电梯", "3410");
equipmentMap.put("消防员电梯", "3420");
equipmentMap.put("杂物电梯", "3430");
}
@Override
......
......@@ -22,6 +22,7 @@ public class EquListConverter implements Converter<String> {
equipmentMap.put("压力管道", "8000");
equipmentMap.put("大型游乐设施", "6000");
equipmentMap.put("客运索道", "9000");
equipmentMap.put("电梯", "3000");
}
@Override
......
......@@ -75,6 +75,8 @@ public class DictParamsConverter implements Converter<String> {
dictMap.put("并联", "2");
dictMap.put("按钮", "3");
dictMap.put("其他控制方式", "4");
dictMap.put("直接顶升", "1");
dictMap.put("间接顶升", "2");
}
@Override
......
......@@ -2574,12 +2574,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
pBuilder.must(QueryBuilders.termQuery(EQU_CATEGORY_CODE, test));
boolMust.must(pBuilder);
}
// 是否车用气瓶
if (!ObjectUtils.isEmpty(map.getString(WHETHER_VEHICLE_CYLINDER))) {
BoolQueryBuilder pBuilder = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString(WHETHER_VEHICLE_CYLINDER));
pBuilder.must(QueryBuilders.termQuery(WHETHER_VEHICLE_CYLINDER, test));
boolMust.must(pBuilder);
//设备类别为气瓶时,添加是否车用气瓶字段
if (CylinderTypeEnum.CYLINDER.getCode().equals(map.getString(EQU_CATEGORY_CODE))) {
Optional.ofNullable(map.getString(WHETHER_VEHICLE_CYLINDER))
.filter(s -> !s.trim().isEmpty())
.ifPresent(cylinder -> boolMust.must(
QueryBuilders.boolQuery()
.must(QueryBuilders.termQuery(WHETHER_VEHICLE_CYLINDER, QueryParser.escape(cylinder)))
));
}
// 是否撬装式压力容器
if (!ObjectUtils.isEmpty(map.getString(WHETHER_SKID_MOUNTED_PRESSURE_VESSEL))) {
......
......@@ -54,15 +54,14 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
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 java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import static com.yeejoin.amos.boot.module.jg.api.enums.VehicleApanageEnum.XIAN_YANG;
import static com.yeejoin.amos.boot.module.jg.api.enums.VehicleApanageEnum.XI_XIAN;
......@@ -143,8 +142,6 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
dto.setOrgBranchCode(splitMaintenanceUnitCode[0]);
dto.setOrgBranchName(splitMaintenanceUnitCode[1]);
}
}
@Transactional(rollbackFor = Exception.class)
......@@ -153,6 +150,9 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
try {
CompanyBo company = reginParams.getCompany();
JgChangeVehicleRegistrationUnit dto = new JgChangeVehicleRegistrationUnit();
if (!ValidationUtil.isEmpty(map.get("changeCertificateList"))) {
dto.setChangeCertificate(JSON.toJSONString(map.get("changeCertificateList")));
}
if (!ObjectUtils.isEmpty(map.get("submit")) && SUBMIT_TYPE_FLOW.equals(map.get("submit").toString())) {
if (map.containsKey("dataList")) {
List<Map<String, Object>> equipList = new ArrayList<>();
......@@ -192,6 +192,9 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
// 更新
JgChangeVehicleRegistrationUnit updateDto = this.getById(Long.parseLong(map.get("sequenceNbr").toString()));
BeanUtil.copyProperties(map, updateDto);
if (!ValidationUtil.isEmpty(map.get("changeCertificateList"))) {
updateDto.setChangeCertificate(JSON.toJSONString(map.get("changeCertificateList")));
}
changeData(updateDto, reginParams.getCompany());
this.updateById(updateDto);
BeanUtil.copyProperties(updateDto, dto);
......
......@@ -93,7 +93,7 @@
LEFT JOIN p_plan_task ppt ON pc.plan_task_id = ppt.id
LEFT JOIN p_check_input pci ON pc.id = pci.check_id
LEFT JOIN p_input_item pii ON pci.input_id = pii.id
LEFT JOIN p_check_shot pcs ON pci.check_id = pcs.check_id
LEFT JOIN p_check_shot pcs ON pc.id = pcs.check_id
WHERE
pc.plan_task_id = #{planTaskId}
</select>
......
......@@ -15,7 +15,6 @@ import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
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.DPFilterParamDto;
import com.yeejoin.amos.boot.module.statistics.api.dto.TzBaseEnterpriseInfoDto;
import com.yeejoin.amos.boot.module.statistics.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.statistics.api.entity.TzsBaseInstitution;
......@@ -42,7 +41,6 @@ import com.yeejoin.amos.boot.module.ymt.flc.api.mapper.RegUnitInfoMapper;
import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -358,40 +356,41 @@ public class EnterpriseBizByTCMServiceImpl {
//查询列表信息
Page<HashMap<String, Object>> pageList = planTaskMapper.getPlanTaskInfo(page,map);
//处理userName
if(!CollectionUtils.isEmpty(pageList.getRecords())) {
Map<String, String> userMap = new HashMap<>();
List<String> userIds = new ArrayList<>();
for (Map<String, Object> record : pageList.getRecords()) {
String ids = record.get("userName")+"";
if (StrUtil.isNotBlank(ids)) {
for (String id : ids.split(",")) {
userIds.add(id);
}
}
}
if(!CollectionUtils.isEmpty(userIds)){
List<Map<String,String>> userinfoList =planTaskMapper.getUserByUserName(userIds);
for (Map<String, String> userinfo : userinfoList) {
userMap.put(userinfo.get("userName"),userinfo.get("realName"));
}
}
for (Map<String, Object> record : pageList.getRecords()) {
String ids = record.get("userName")+"";
if (StrUtil.isNotBlank(ids)) {
List<String> realNameList = new ArrayList<>();
for (String id : ids.split(",")) {
if(StrUtil.isNotBlank(userMap.get(id))) {
realNameList.add(userMap.get(id));
}
}
if(!CollectionUtils.isEmpty(realNameList)) {
record.put("userName", realNameList.stream().collect(Collectors.joining(",")));
}else{
record.put("userName","");
}
}
}
}
// 2025/04/14 htt 处理了源头的错误数据 故不需要转化了
// if(!CollectionUtils.isEmpty(pageList.getRecords())) {
// Map<String, String> userMap = new HashMap<>();
// List<String> userIds = new ArrayList<>();
// for (Map<String, Object> record : pageList.getRecords()) {
// String ids = record.get("userName")+"";
// if (StrUtil.isNotBlank(ids)) {
// for (String id : ids.split(",")) {
// userIds.add(id);
// }
// }
// }
// if(!CollectionUtils.isEmpty(userIds)){
// List<Map<String,String>> userinfoList =planTaskMapper.getUserByUserName(userIds);
// for (Map<String, String> userinfo : userinfoList) {
// userMap.put(userinfo.get("userName"),userinfo.get("realName"));
// }
// }
// for (Map<String, Object> record : pageList.getRecords()) {
// String ids = record.get("userName")+"";
// if (StrUtil.isNotBlank(ids)) {
// List<String> realNameList = new ArrayList<>();
// for (String id : ids.split(",")) {
// if(StrUtil.isNotBlank(userMap.get(id))) {
// realNameList.add(userMap.get(id));
// }
// }
// if(!CollectionUtils.isEmpty(realNameList)) {
// record.put("userName", realNameList.stream().collect(Collectors.joining(",")));
// }else{
// record.put("userName","");
// }
// }
// }
// }
result.put("taskList",pageList);
//查询企业类型
......
......@@ -210,7 +210,7 @@
SELECT
${groupId} groupId,
tui.amos_user_id userId,
tui.amos_user_name userName,
tui.name userName,
tui.unit_name,
tui.unit_code,
REPLACE ( tzei.unit_type, '#', ',' ) unitType,
......
......@@ -15,7 +15,6 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.amos.patrol.business.bo.CheckInputSyncBo;
import com.yeejoin.amos.patrol.business.constants.XJConstant;
import com.yeejoin.amos.patrol.business.dao.mapper.*;
import com.yeejoin.amos.patrol.business.dao.repository.*;
......@@ -51,17 +50,13 @@ import org.springframework.cglib.beans.BeanMap;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.Transactional;
import java.lang.reflect.InvocationTargetException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
......@@ -2116,7 +2111,7 @@ public class CheckServiceImpl implements ICheckService {
List<CheckInputParam> checkItems = requestParam.getCheckItems();
Map<String,List<Map<String,Object>>> mapList = (Map<String,List<Map<String,Object>>>)JSON.parse(appCheckInput.toJSONString());
List<AppCheckInputRespone> appCheckInputRespones = new ArrayList<>();
if (!ObjectUtils.isEmpty(mapList.get("items"))){
for (Map<String,Object> map : mapList.get("items")) {
AppCheckInputRespone appCheckInputRespone = new AppCheckInputRespone();
CheckInputParam checkInputId = checkItems.stream().filter(x -> x.getInputItemId()== Long.valueOf(map.get("checkInputId").toString())).collect(Collectors.toList()).get(0);
......@@ -2141,8 +2136,10 @@ public class CheckServiceImpl implements ICheckService {
appCheckInputRespones.add(appCheckInputRespone);
}
appCheckInput.put("items", appCheckInputRespones);
}
esTaskDetailDto.setPointImgUrls(requestParam.getCheckRecordImg());
esTaskDetailDto.setAppCheckInput(appCheckInput);
esTaskDetailDto.setRemark(requestParam.getRemark());
return esTaskDetailDto;
}
......
......@@ -574,17 +574,16 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
throw new YeeException("删除数据内容不能为空");
}
Set<Long> taskNos = new HashSet<>();
ArrayList<ESPlanTaskListDto> esPlanTaskListDtos = new ArrayList<>();
List<ESTaskDetailDto> esTaskDetailDtos = new ArrayList<>();
for (String id : strArry) {
esTaskDetailDtos.add(new ESTaskDetailDto().setId(id));
PlanTaskDetail planTkDet = planTaskDetail.findById(Long.parseLong(id)).get();
if (null != planTkDet) {
taskNos.add(planTkDet.getTaskNo());
esPlanTaskListDtos.add(new ESPlanTaskListDto().setId(Objects.toString(planTkDet.getTaskNo())));
}
}
// 删除es数据
esPlanTaskList.deleteAll(esPlanTaskListDtos);
List<ESTaskDetailDto> esTaskDetailDtos = planTaskDetailMapper.findAllByTaskNos(esPlanTaskListDtos.stream().map(ESPlanTaskListDto::getId).collect(Collectors.toList()));
// 删除对应的es数据 + 更新巡检点数
this.handleEsPlanTaskListPointsByIds(Arrays.asList(strArry), taskNos.stream().map(Objects::toString).collect(Collectors.toList()));
esTaskDetail.deleteAll(esTaskDetailDtos);
planTaskMapper.planTaskDet(strArry);// 删除数据
HashMap<String, Object> param = new HashMap<String, Object>();
......@@ -593,6 +592,25 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
planTaskMapper.updatePlanTaskPtInfo(param);// 更新主表,点数量,完成数量
}
/**
* 删除任务中的巡检点 + 更新巡检点数 + 未开始数
* @param taskDetailIds
* @param taskIds
*/
private void handleEsPlanTaskListPointsByIds(List<String> taskDetailIds, List<String> taskIds) {
taskIds.forEach(taskId -> esPlanTaskList.findById(taskId).ifPresent(esPlanTaskListDto -> {
List<PlanTaskDetail> points = (List<PlanTaskDetail>) esPlanTaskListDto.getPoints();
List<PlanTaskDetail> filterPoints = points.stream().filter(point -> !taskDetailIds.contains(Objects.toString(point.getId()))).collect(Collectors.toList());
esPlanTaskList.deleteById(taskId);
if (!filterPoints.isEmpty()) {
esPlanTaskListDto.setPoints(filterPoints);
esPlanTaskListDto.setTaskPlanNum(Objects.toString(filterPoints.size()));
esPlanTaskListDto.setUnplan(Objects.toString(filterPoints.stream().filter(point -> "0".equals(point.getStatus())).count()));
esPlanTaskList.save(esPlanTaskListDto);
}
}));
}
@Override
public List<PlanTaskVo> planTaskReport(String toke, String product, String appKey, PlanTaskPageParam param) {
List<PlanTaskVo> content = planTaskMapper.getPlanTaskInfoList(param);
......@@ -2125,6 +2143,10 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
if (!CollectionUtils.isEmpty(list)) {
list.forEach(e -> {
e.put("executiveName", e.get("userName"));
// 填充 routeName ,企业自查显示,区分不同的管控类型的计划
String planTaskId = Objects.toString(e.get("planTaskId"));
Long routeId = planTaskMapper.selectRoutId(planTaskId);
e.put("routeName", routeDao.getOne(routeId).getName());
});
}
return new PageImpl<>(list, pageParam, totle);
......
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