Commit 855d5e3a authored by lisong's avatar lisong

Merge remote-tracking branch 'origin/developer' into developer

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/PlanTaskServiceImpl.java
parents bd4a6c56 5fad6605
...@@ -29,7 +29,8 @@ WHERE ...@@ -29,7 +29,8 @@ WHERE
biz_org_type, biz_org_type,
build_name, build_name,
build_id, build_id,
parent_id parent_id,
code
FROM FROM
cb_org_usr cb_org_usr
WHERE WHERE
......
...@@ -5,6 +5,7 @@ package com.yeejoin.amos.supervision.common.enums; ...@@ -5,6 +5,7 @@ package com.yeejoin.amos.supervision.common.enums;
*/ */
public enum PlanFrequencyEnum { public enum PlanFrequencyEnum {
NUM("次", "0", "次检查报告"),
WEEK("周", "2", "周检查报告"), WEEK("周", "2", "周检查报告"),
MONTH("月", "3", "月检查报告"), MONTH("月", "3", "月检查报告"),
QUARTER("季度", "4", "季度检查报告"); QUARTER("季度", "4", "季度检查报告");
......
...@@ -42,6 +42,8 @@ import java.util.*; ...@@ -42,6 +42,8 @@ import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static org.typroject.tyboot.core.foundation.utils.DateTimeUtil.ISO8601_DATE_HOUR_MIN_SEC;
/** /**
* <p> * <p>
* 前端控制器 * 前端控制器
...@@ -795,10 +797,12 @@ public class TopographyController extends AbstractBaseController { ...@@ -795,10 +797,12 @@ public class TopographyController extends AbstractBaseController {
try { try {
//Date date = DateUtils.dateParse(String.valueOf(timeList.get(j-1).getValue()), DateUtils.DATE_TIME_T_PATTERN); //Date date = DateUtils.dateParse(String.valueOf(timeList.get(j-1).getValue()), DateUtils.DATE_TIME_T_PATTERN);
SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_TIME_T_PATTERN); String value = String.valueOf(timeList.get(j-1).getValue());
String strDate = value.substring(0, 19);
SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC);
SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN); SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
sdf.setTimeZone(TimeZone.getTimeZone("UTC")); sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date1=sdf.parse(String.valueOf(timeList.get(j-1).getValue())); Date date1=sdf.parse(strDate);
String time= DateTimeUtil.format(date1, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC); String time= DateTimeUtil.format(date1, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
iotVo.setTime(sdf1.parse(time)); iotVo.setTime(sdf1.parse(time));
...@@ -874,11 +878,13 @@ public class TopographyController extends AbstractBaseController { ...@@ -874,11 +878,13 @@ public class TopographyController extends AbstractBaseController {
List<IotDataVO> timeList = vos.stream().filter(x -> x.getKey().equals("time")).collect(Collectors.toList()); List<IotDataVO> timeList = vos.stream().filter(x -> x.getKey().equals("time")).collect(Collectors.toList());
List<Date> dates = new ArrayList<>(); List<Date> dates = new ArrayList<>();
for (IotDataVO vo : timeList) { for (IotDataVO vo : timeList) {
SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_TIME_T_PATTERN); String value = String.valueOf(vo.getValue());
String strDate = value.substring(0, 19);
SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC);
SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN); SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
logger.info("返回时间===================================(" + vo.getValue() + ") ======================================="); logger.info("返回时间===================================(" + vo.getValue() + ") =======================================");
sdf.setTimeZone(TimeZone.getTimeZone("UTC")); sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date=sdf.parse(String.valueOf(vo.getValue())); Date date=sdf.parse(strDate);
// String time= sdf.format(date); // String time= sdf.format(date);
String time= DateTimeUtil.format(date, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC); String time= DateTimeUtil.format(date, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
......
...@@ -276,12 +276,14 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -276,12 +276,14 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
fireCarDto.setCarStateDesc(FireCarStatusEnum.执勤.getName()); fireCarDto.setCarStateDesc(FireCarStatusEnum.执勤.getName());
} else { } else {
if (appleMap != null) { if (appleMap != null) {
String state = appleMap.containsKey(car.get("id")) ? appleMap.get(car.get("id")) : null; //bug: 6268
String state = appleMap.containsKey(car.get("id")) ? appleMap.get(car.get("id")) : FireCarStatusEnum.执勤.getCode();
fireCarDto.setCarState(state); fireCarDto.setCarState(state);
fireCarDto.setCarStateDesc(state != null ? FireCarStatusEnum.getEnum(state).getName() : null); fireCarDto.setCarStateDesc(state != null ? FireCarStatusEnum.getEnum(state).getName() : null);
} else { } else {
fireCarDto.setCarState(null); //bug: 6268
fireCarDto.setCarStateDesc(null); fireCarDto.setCarState(FireCarStatusEnum.执勤.getCode());
fireCarDto.setCarStateDesc(FireCarStatusEnum.执勤.getName());
} }
} }
......
...@@ -370,6 +370,13 @@ public class LatentDangerController extends BaseController { ...@@ -370,6 +370,13 @@ public class LatentDangerController extends BaseController {
return ResponseHelper.buildResponse((iLatentDangerService.getAllDangerLevel())); return ResponseHelper.buildResponse((iLatentDangerService.getAllDangerLevel()));
} }
@ApiOperation(value = "获取所有隐患等级名称", notes = "获取所有隐患等级名称")
@GetMapping(value = "/all/dangerLevelName")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel getAllDangerLevelName() {
return ResponseHelper.buildResponse((iLatentDangerService.getAllDangerLevelName()));
}
@ApiOperation(value = "获取所有隐患整改方式", notes = "获取所有隐患整改方式") @ApiOperation(value = "获取所有隐患整改方式", notes = "获取所有隐患整改方式")
@GetMapping(value = "/all/dangerGovernance") @GetMapping(value = "/all/dangerGovernance")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
package com.yeejoin.amos.latentdanger.business.service.impl; package com.yeejoin.amos.latentdanger.business.service.impl;
import static com.yeejoin.amos.latentdanger.business.util.RandomUtil.buildOrderNo; import static com.yeejoin.amos.latentdanger.business.util.RandomUtil.buildOrderNo;
import static com.yeejoin.amos.latentdanger.common.enums.LatentDangerLevelEnum.patrolDangerLevelEnumMap;
import static com.yeejoin.amos.latentdanger.common.enums.LatentDangerLevelEnum.supervisionDangerLevelEnumMap;
import static org.typroject.tyboot.core.foundation.context.RequestContext.getProduct; import static org.typroject.tyboot.core.foundation.context.RequestContext.getProduct;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -1893,7 +1885,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1893,7 +1885,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
}); });
} }
if (bizTypeSet.contains("patrol")) { if (bizTypeSet.contains("patrol")) {
LatentDangerLevelEnum.patrolDangerLevelEnumMap.forEach((code, e) -> { patrolDangerLevelEnumMap.forEach((code, e) -> {
Map<String, String> l = Maps.newHashMap(); Map<String, String> l = Maps.newHashMap();
l.put("code", code); l.put("code", code);
l.put("name", e.getName()); l.put("name", e.getName());
...@@ -1904,6 +1896,23 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1904,6 +1896,23 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
} }
@Override @Override
public Set<String> getAllDangerLevelName() {
Set<String> levelList = new HashSet<>();
Set<String> bizTypeSet = getBizTypeSet();
if (bizTypeSet.contains("supervision")) {
LatentDangerLevelEnum.supervisionDangerLevelEnumMap.forEach((code, e) -> {
levelList.add(e.getName());
});
}
if (bizTypeSet.contains("patrol")) {
patrolDangerLevelEnumMap.forEach((code, e) -> {
levelList.add(e.getName());
});
}
return levelList;
}
@Override
public List<Map<String, String>> getAllDangerGovernance() { public List<Map<String, String>> getAllDangerGovernance() {
List<Map<String, String>> governanceList = Lists.newArrayList(); List<Map<String, String>> governanceList = Lists.newArrayList();
Set<String> bizTypeSet = getBizTypeSet(); Set<String> bizTypeSet = getBizTypeSet();
...@@ -2049,6 +2058,22 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2049,6 +2058,22 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
@Override @Override
public IPage<LatentDanger> pageListDanger(PageParam pageParam, String userId) throws Exception { public IPage<LatentDanger> pageListDanger(PageParam pageParam, String userId) throws Exception {
if (pageParam.containsKey("dangerLevelName")) {
List<String> dangerLevelList = new ArrayList<>();
Collection<LatentDangerLevelEnum> values1 = patrolDangerLevelEnumMap.values();
values1.stream().forEach(item -> {
if (item.getName().equals(pageParam.get("dangerLevelName"))) {
dangerLevelList.add(item.getCode());
}
});
Collection<LatentDangerLevelEnum> values = supervisionDangerLevelEnumMap.values();
values.stream().forEach(item -> {
if (item.getName().equals(pageParam.get("dangerLevelName"))) {
dangerLevelList.add(item.getCode());
}
});
pageParam.put("dangerLevelList", dangerLevelList);
}
List allTaskList; List allTaskList;
String idsStr = (String) pageParam.get("dangerIds"); String idsStr = (String) pageParam.get("dangerIds");
List<String> dangerIdList = Lists.newArrayList(); List<String> dangerIdList = Lists.newArrayList();
......
...@@ -157,6 +157,13 @@ public interface ILatentDangerService { ...@@ -157,6 +157,13 @@ public interface ILatentDangerService {
List<Map<String, String>> getAllDangerLevel(); List<Map<String, String>> getAllDangerLevel();
/** /**
* 获取多个业务的隐患等级名称
*
* @return
*/
Set<String> getAllDangerLevelName();
/**
* 获取多个业务的隐患治理方式 * 获取多个业务的隐患治理方式
* *
* @return * @return
......
...@@ -182,6 +182,24 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -182,6 +182,24 @@ public class PlanTaskController extends AbstractBaseController {
} }
/** /**
* 模拟发送维保待办任务消息定时任务
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "模拟发送维保待办任务消息定时任务", notes = "模拟发送维保待办任务消息定时任务")
@RequestMapping(value = "/taskMessage", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public CommonResponse taskMessage(@ApiParam(value = "跑批日期格式yyyyMMdd", required = false) @RequestParam(required = false) String runDate) {
try {
planTaskService.taskMessage(runDate);
return CommonResponseUtil.success();
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure();
}
}
/**
* 查询任务列表 * 查询任务列表
* *
* @param * @param
......
package com.yeejoin.amos.maintenance.business.dao.mapper; package com.yeejoin.amos.maintenance.business.dao.mapper;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.maintenance.dao.entity.Plan;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo; import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo;
...@@ -186,4 +188,7 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -186,4 +188,7 @@ public interface PlanTaskMapper extends BaseMapper {
List<Map<String, Object>> statisticsTaskWithAuth(Map<String, Object> param); List<Map<String, Object>> statisticsTaskWithAuth(Map<String, Object> param);
List<Plan> getPlanIdsByDate(Date date);
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.service.impl; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum; import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
...@@ -32,6 +33,7 @@ import com.yeejoin.amos.maintenance.exception.YeeException; ...@@ -32,6 +33,7 @@ import com.yeejoin.amos.maintenance.exception.YeeException;
import com.yeejoin.amos.maintenance.feign.RemoteSecurityService; import com.yeejoin.amos.maintenance.feign.RemoteSecurityService;
import com.yeejoin.amos.maintenance.quartz.IJobService; import com.yeejoin.amos.maintenance.quartz.IJobService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.tomcat.jni.Time;
import org.assertj.core.util.Lists; import org.assertj.core.util.Lists;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -90,6 +92,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -90,6 +92,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Autowired @Autowired
ICheckInputDao checkInputDao; ICheckInputDao checkInputDao;
@Autowired
RedisUtils redisUtils;
private final String MAINTENANCE_PLAN_TASK_KEY = "MAINTENANCE_PLAN_ID:";
@Override @Override
public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) { public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) {
long total = planTaskMapper.countPlanTask(params); long total = planTaskMapper.countPlanTask(params);
...@@ -258,6 +265,32 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -258,6 +265,32 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
return bigDecimal.compareTo(bigDecimal1) <= 0 && bigDecimal.compareTo(new BigDecimal(0)) >= 0; return bigDecimal.compareTo(bigDecimal1) <= 0 && bigDecimal.compareTo(new BigDecimal(0)) >= 0;
} }
//bug 5980 待办任务消息应只触发执行中的任务,漏检的任务和未开始的任务不需要触发待办任务消息.
@Override
@Transactional
public void taskMessage(String runDate) {
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
//1.扫描plan表查询,需要生成执行数据的任务信息,无则return
Date now = new Date();//今天
String format = df.format(now);
if (runDate != null) {//上送则已上送的为准
runDate = runDate + " " + format;
now = DateUtil.str2Date(runDate, "yyyyMMdd HH:mm:ss");
}
List<Plan> planIdsByDate = planTaskMapper.getPlanIdsByDate(now);
for (Plan plan : planIdsByDate) {
if (!redisUtils.hasKey(MAINTENANCE_PLAN_TASK_KEY + plan.getId())) {
try {
sendMessage(plan);
} catch (Exception e) {
e.printStackTrace();
}
redisUtils.set(MAINTENANCE_PLAN_TASK_KEY + plan.getId(), 1, (long) plan.getDuration() * 60);
}
}
}
/** /**
* 自动任务执行 * 自动任务执行
*/ */
...@@ -277,23 +310,6 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -277,23 +310,6 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
log.info(strDate + " " + " 暂无待生成执行数据的计划"); log.info(strDate + " " + " 暂无待生成执行数据的计划");
return; return;
} }
// //bug 5980 待办任务消息应只触发执行中的任务,漏检的任务和未开始的任务不需要触发待办任务消息.
// List<Plan> planListTwo = new ArrayList<>();
// //将日期格式化
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
// LocalTime nowTime = LocalTime.parse(simpleDateFormat.format(new Date()));
// for (Plan plan : planList) {
// LocalTime dayTime = LocalTime.parse(plan.getDayTime());
//// LocalTime plusHoursTime = dayTime.plusHours(1);
// if (getTimeDifference(nowTime, dayTime)) {
// planListTwo.add(plan);
// }
// }
// if (planListTwo == null || planListTwo.size() <= 0) {
// log.info(strDate + " " + " 暂无待生成执行数据的计划 (更改后,只执行进行中的数据)");
// return;
// }
// planList = planListTwo;
//2.循环遍历执行 //2.循环遍历执行
HashMap<String, Object> paramMap = new HashMap<String, Object>(); HashMap<String, Object> paramMap = new HashMap<String, Object>();
for (Plan plan : planList) { for (Plan plan : planList) {
...@@ -482,7 +498,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -482,7 +498,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
// 2.保存执行数据明细表 // 2.保存执行数据明细表
planTaskDetail.saveAndFlush(planTaskDetailInstance); planTaskDetail.saveAndFlush(planTaskDetailInstance);
} }
sendMessage(plan); //bug 5980 待办任务消息应只触发执行中的任务,漏检的任务和未开始的任务不需要触发待办任务消息.
//(重写定时任务去发送消息)
// sendMessage(plan);
// 定时任务监控 // 定时任务监控
jobService.planTaskAddJob(planTask); jobService.planTaskAddJob(planTask);
} }
......
...@@ -37,6 +37,13 @@ public interface IPlanTaskService { ...@@ -37,6 +37,13 @@ public interface IPlanTaskService {
List<PlanTaskVo> planTaskReport(String toke, String product, String appKey, PlanTaskPageParam params); List<PlanTaskVo> planTaskReport(String toke, String product, String appKey, PlanTaskPageParam params);
/** /**
* 定时任务发送消息执行中的消息
*
* @param runDate
*/
void taskMessage(String runDate);
/**
* 自动任务执行 * 自动任务执行
* *
* @param runDate * @param runDate
......
...@@ -24,4 +24,12 @@ public class PlanTaskJob { ...@@ -24,4 +24,12 @@ public class PlanTaskJob {
public void scheduleJob() { public void scheduleJob() {
planTaskService.taskExecution(null); planTaskService.taskExecution(null);
} }
/**
* 定时任务推送维保待办任务消息
*/
@Scheduled(cron = "${jobs.cron}")
public void taskMessage() {
planTaskService.taskMessage(null);
}
} }
...@@ -493,12 +493,14 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -493,12 +493,14 @@ public class PlanTaskController extends AbstractBaseController {
@ApiParam(value = "检查人员") @RequestParam(value = "executorId", required = false) Long executorId, @ApiParam(value = "检查人员") @RequestParam(value = "executorId", required = false) Long executorId,
@ApiParam(value = "任务类型") @RequestParam(value = "taskType", required = false) String taskType, @ApiParam(value = "任务类型") @RequestParam(value = "taskType", required = false) String taskType,
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber, @ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception { @ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize,
@ApiParam(value = "1-排除外部计划 0-或空-正常查询") @RequestParam(value = "outsideType", required = false) Integer outsideType) throws Exception {
HashMap<String, Object> params = new HashMap<String, Object>(); HashMap<String, Object> params = new HashMap<String, Object>();
// ReginParams reginParams = getSelectedOrgInfo(); // ReginParams reginParams = getSelectedOrgInfo();
// String loginOrgCode = getOrgCode(reginParams); // String loginOrgCode = getOrgCode(reginParams);
// Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity()); // Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity());
// params.putAll(authMap); // params.putAll(authMap);
params.put("outsideType", outsideType);
params.put("userId", userId); params.put("userId", userId);
params.put("companyId", companyId); params.put("companyId", companyId);
params.put("orgCode", loginOrgCode); params.put("orgCode", loginOrgCode);
......
...@@ -200,13 +200,16 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep ...@@ -200,13 +200,16 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
routePoints.forEach(item -> { routePoints.forEach(item -> {
CheckReportCompanyDto checkReportCompanyDto = new CheckReportCompanyDto(); CheckReportCompanyDto checkReportCompanyDto = new CheckReportCompanyDto();
checkReportCompanyDto.setCheckResult("正常"); checkReportCompanyDto.setCheckResult("正常");
checkReportCompanyDto.setId(collect.get(item.getPointId()).getPointNo()); //TODO 外部消防单位报错 -- p_point表数据丢失(后面问唐伟)
checkReportCompanyDto.setName(collect.get(item.getPointId()).getName()); if (collect.containsKey(item.getPointId())) {
if (map.containsKey(item.getPointId())) { checkReportCompanyDto.setId(collect.get(item.getPointId()).getPointNo());
checkReportCompanyDto.setCheckResult("存在隐患"); checkReportCompanyDto.setName(collect.get(item.getPointId()).getName());
if (map.containsKey(item.getPointId())) {
checkReportCompanyDto.setCheckResult("存在隐患");
}
checkReportCompanyDto.setDeptCount(companyDeptCountMap.get(checkReportCompanyDto.getId()));
companyDtoList.add(checkReportCompanyDto);
} }
checkReportCompanyDto.setDeptCount(companyDeptCountMap.get(checkReportCompanyDto.getId()));
companyDtoList.add(checkReportCompanyDto);
}); });
checkReportDto.setCheckCompanyList(companyDtoList); checkReportDto.setCheckCompanyList(companyDtoList);
} }
...@@ -263,6 +266,11 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep ...@@ -263,6 +266,11 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
return month + weekDateStr + "日"; return month + weekDateStr + "日";
} }
public static String getNumDate(Date date) throws ParseException {
String monthDayStr = DateUtils.dateFormat(date, "MM月dd日");
return monthDayStr;
}
public static String getMonthDate(Date date) { public static String getMonthDate(Date date) {
return DateUtils.getMonth(date) + "月份"; return DateUtils.getMonth(date) + "月份";
} }
...@@ -400,6 +408,9 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep ...@@ -400,6 +408,9 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
PlanFrequencyEnum frequencyEnum = PlanFrequencyEnum.getEnumByCode(checkReportDto.getPlanCheckFrequencyType()); PlanFrequencyEnum frequencyEnum = PlanFrequencyEnum.getEnumByCode(checkReportDto.getPlanCheckFrequencyType());
String reportDate; String reportDate;
switch (frequencyEnum) { switch (frequencyEnum) {
case NUM:
reportDate = getNumDate(checkReportDto.getStartPlanTaskDate());
break;
case WEEK: case WEEK:
reportDate = getWeekDate(checkReportDto.getStartPlanTaskDate()); reportDate = getWeekDate(checkReportDto.getStartPlanTaskDate());
break; break;
......
...@@ -2932,5 +2932,29 @@ ...@@ -2932,5 +2932,29 @@
ALTER TABLE jc_power_transfer_company_resources ADD arrival_time varchar(255) NULL COMMENT '车辆到场时间'; ALTER TABLE jc_power_transfer_company_resources ADD arrival_time varchar(255) NULL COMMENT '车辆到场时间';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="cz" id="2022-06-13-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="jc_powerr_transfer_log" columnName="receive_name"/>
</not>
</preConditions>
<comment>修改字段长度</comment>
<sql>
ALTER TABLE jc_powerr_transfer_log MODIFY receive_name varchar(5000) NULL COMMENT '接收人' ;
</sql>
</changeSet>
<changeSet author="cz" id="2022-06-13-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="jc_alert_submitted" columnName="submission_content"/>
</not>
</preConditions>
<comment>修改字段长度</comment>
<sql>
ALTER TABLE jc_alert_submitted MODIFY submission_content varchar(5000) NULL COMMENT '报送内容';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -1002,6 +1002,12 @@ ...@@ -1002,6 +1002,12 @@
<if test="key == 'dangerLevel' and value != null and value != ''"> <if test="key == 'dangerLevel' and value != null and value != ''">
and a.danger_level = #{value} and a.danger_level = #{value}
</if> </if>
<if test="key == 'dangerLevelList' and value != null and value.size() > 0">
and a.danger_level in
<foreach collection="value" item="dangerLevel" open="(" separator="," close=")">
#{dangerLevel}
</foreach>
</if>
<if test="key == 'startTime' and value != null and value != ''"> <if test="key == 'startTime' and value != null and value != ''">
and a.create_date <![CDATA[ >= ]]> #{value} and a.create_date <![CDATA[ >= ]]> #{value}
</if> </if>
...@@ -1095,6 +1101,7 @@ WHERE ...@@ -1095,6 +1101,7 @@ WHERE
( (
discoverer_user_id = #{userId} AND danger_state = 'draft' discoverer_user_id = #{userId} AND danger_state = 'draft'
AND biz_info LIKE concat('%',#{planId},'%') AND biz_info LIKE concat('%',#{planId},'%')
AND deleted = 0
) )
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -879,4 +879,19 @@ ...@@ -879,4 +879,19 @@
</choose> </choose>
GROUP BY td.is_finish GROUP BY td.is_finish
</select> </select>
<select id="getPlanIdsByDate" resultType="com.yeejoin.amos.maintenance.dao.entity.Plan">
select *
from p_plan
where id in (
select plan_id
from p_plan_task
where
begin_time &lt;= #{date,jdbcType=TIMESTAMP}
and end_time &gt; #{date,jdbcType=TIMESTAMP}
and finish_status in (0, 1)
and status = 0
group by plan_id
)
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -210,6 +210,10 @@ ...@@ -210,6 +210,10 @@
p_plan_task pt p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id INNER JOIN p_route r on r.id = pt.route_id
<if test="outsideType != null and outsideType == 1 ">
where
p.check_level != 3
</if>
) a ) a
<include refid="mobile-plan-task-where"/> <include refid="mobile-plan-task-where"/>
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
...@@ -273,6 +277,10 @@ ...@@ -273,6 +277,10 @@
p_plan_task pt p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id INNER JOIN p_route r on r.id = pt.route_id
<if test="outsideType != null and outsideType == 1 ">
where
p.check_level != 3
</if>
) a ) a
<include refid="mobile-plan-task-where"/> <include refid="mobile-plan-task-where"/>
</select> </select>
...@@ -401,6 +409,9 @@ ...@@ -401,6 +409,9 @@
<if test="offset != null and pageSize != null"> <if test="offset != null and pageSize != null">
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
</if> </if>
<if test="pointId != null and pointId != ''">
and ppn.id = #{planId}
</if>
</select> </select>
<select id="getPlanTaskPointsCount" resultType="long"> <select id="getPlanTaskPointsCount" resultType="long">
......
...@@ -120,7 +120,7 @@ public class UnitInfoController extends BaseController { ...@@ -120,7 +120,7 @@ public class UnitInfoController extends BaseController {
Iterator<CompanyModel> it = result.iterator(); Iterator<CompanyModel> it = result.iterator();
while(it.hasNext()) { while(it.hasNext()) {
CompanyModel temp = it.next(); CompanyModel temp = it.next();
if(temp.getLevel().equals("emergencyCenter") || temp.getLevel().equals("company")) { if("emergencyCenter".equals(temp.getLevel()) || "company".equals(temp.getLevel())) {
it.remove(); it.remove();
} else { } else {
this.dealCompanyTree(temp); this.dealCompanyTree(temp);
...@@ -617,35 +617,35 @@ public class UnitInfoController extends BaseController { ...@@ -617,35 +617,35 @@ public class UnitInfoController extends BaseController {
private void dealCompanyTree(CompanyModel company) { private void dealCompanyTree(CompanyModel company) {
if(!company.getLevel().equals("emergencyCenter") && !company.getLevel().equals("company")) { if(!"emergencyCenter".equals(company.getLevel()) && !"company".equals(company.getLevel())) {
// 判断子节点是否是headquarter // 判断子节点是否是headquarter
Collection children = company.getChildren(); Collection children = company.getChildren();
Iterator<Map> it = children.iterator(); if (!ValidationUtil.isEmpty(children)) {
while(it.hasNext()) { Iterator<Map> it = children.iterator();
Map temp = it.next(); while(it.hasNext()) {
if(company.getLevel().equals("emergencyCenter") || company.getLevel().equals("company")) { Map temp = it.next();
it.remove(); if("emergencyCenter".equals(company.getLevel()) || "company".equals(company.getLevel())) {
} else { it.remove();
this.dealCompanyTree(temp); } else {
this.dealCompanyTree(temp);
}
} }
} }
} else {
return;
} }
} }
private void dealCompanyTree(Map company) { private void dealCompanyTree(Map company) {
// 判断子节点是否是headquarter // 判断子节点是否是headquarter
Collection children = (Collection) company.get("children"); Collection children = (Collection) company.get("children");
Iterator<Map> it = children.iterator(); if (!ValidationUtil.isEmpty(children)) {
while(it.hasNext()) { Iterator<Map> it = children.iterator();
Map temp = it.next(); while(it.hasNext()) {
if(temp.get("level").equals("emergencyCenter") || temp.get("level").equals("company")) { Map temp = it.next();
it.remove(); if("emergencyCenter".equals(temp.get("level")) || "company".equals(temp.get("level"))) {
} else { it.remove();
this.dealCompanyTree(temp); } else {
this.dealCompanyTree(temp);
}
} }
} }
} }
} }
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