Commit 1873fafc authored by chenhao's avatar chenhao

Merge branch 'chenhao' into developer

parents 5675d573 01ebd4e2
......@@ -299,7 +299,8 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "状态物联编码")
private String iotStatus;
@ExcelProperty(value = "管网压力", index = 43)
//BUG 2920 管网压力字段冗余 2021-09-18 陈召
@ExcelIgnore
@ApiModelProperty(value = "管网压力物联编码")
private String iotPipePressure;
......@@ -312,7 +313,7 @@ public class WaterResourceDto extends BaseDto {
private Long equipId;
@ApiModelProperty("设施定义名称")
@ExcelProperty(value = "设施定义名称", index = 44)
@ExcelProperty(value = "设施定义名称", index = 43)
private String equipName;
@ExcelIgnore
......@@ -320,15 +321,15 @@ public class WaterResourceDto extends BaseDto {
private Long equipCategoryId;
// BUG 2935 优化项 分类从93060000 取得字典数据 by kongfm 2021-09-17
@ApiModelProperty("设施分类名称")
@ExplicitConstraint(indexNum = 45, sourceClass = RoleNameExplicitConstraint.class, method = "getEquipCategory")
@ExcelProperty(value = "设施分类名称", index = 45)
@ExplicitConstraint(indexNum = 44, sourceClass = RoleNameExplicitConstraint.class, method = "getEquipCategory")
@ExcelProperty(value = "设施分类名称", index = 44)
private String equipCategoryName;
@ApiModelProperty("设施编码")
@ExcelProperty(value = "设施编码", index = 46)
@ExcelIgnore
private String equipCode;
@ApiModelProperty("维保周期")
@ExcelProperty(value = "维保周期(月)", index = 47)
@ExcelProperty(value = "维保周期(月)", index = 45)
private String maintenancePeriod;
}
......@@ -387,16 +387,6 @@
*
FROM
cb_failure_details d
WHERE
d.sequence_nbr in
(SELECT
fault_id
FROM
cb_failure_audit
where
) and
submission_pid = #{userId}
<where>
d.sequence_nbr in
(SELECT
......
......@@ -101,13 +101,16 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/*bug 2408 接警记录,按警情状态和接警时间筛选功能失效 陈召 2021-09-22 开始*/
@ApiModelProperty(value = "接警时间开始---用于列表过滤")
@TableField(exist=false)
private Date callTimeStart ;
private String callTimeStart ;
@ApiModelProperty(value = "接警时间结束---用于列表过滤")
@TableField(exist=false)
private Date callTimeEnd ;
private String callTimeEnd ;
/*bug 2408 接警记录,按警情状态和接警时间筛选功能失效 陈召 2021-09-22 结束*/
@TableField(exist=false)
@ApiModelProperty(value = "是否处警")
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
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.Bean;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
......@@ -19,22 +46,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.enums.DutyViewTypeEnum;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCommonService;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
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.Bean;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author DELL
*/
......@@ -146,17 +157,59 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
m.put("dutyShift", personShiftList);
}
/*bug2468 值班排班,日历视图单班次执勤人数满足≤3且班次≤2时,值班显示方式错误 陈召 开始*/
//获取时间段内的每一天
public static List<String> getBetweenDate(String start, String end) {
List<String> list = new ArrayList<>();
LocalDate startDate = LocalDate.parse(start);
LocalDate endDate = LocalDate.parse(end);
long distance = ChronoUnit.DAYS.between(startDate, endDate);
if (distance < 1) {
return list;
}
Stream.iterate(startDate, d -> d.plusDays(1)).limit(distance + 1).forEach(f -> list.add(f.toString()));
return list;
}
@Override
public List<Map<String, Object>> statisticsDay(String beginDate, String endDate) throws ParseException {
DutyViewTypeEnum viewTypeEnum = this.inferView(beginDate, endDate, RequestContext.getAppKey());
Date dateBegin = DateUtils.dateParse(beginDate, DateUtils.DATE_PATTERN);
String timeStart = DateUtils.dateTimeToDateString(dateBegin);
Date dateEnd = DateUtils.dateParse(endDate, DateUtils.DATE_PATTERN);
String timeEnd = DateUtils.dateTimeToDateString(dateEnd);
List<String> betweenDate = getBetweenDate(timeStart, timeEnd);
//拿到每一天的视图展示
String beginTime = null;
String endTime = null;
List<Map<String, Object>> viewTypeResult = new ArrayList<>();
for (String time : betweenDate) {
beginTime = time + " 00:00:00";
endTime = time + " 23:59:59";
Map<String, Object> viewTypeMap = new HashMap<>();
viewTypeMap.put("date",time);
viewTypeMap.put("viewType", this.inferView(beginTime, endTime, RequestContext.getAppKey()));
viewTypeResult.add(viewTypeMap);
}
List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, endDate);
return rangeDate.stream().map(p -> {
Map<String, Object> result = new LinkedHashMap<>();
result.put("key", p.get("date"));
result.put("viewType", viewTypeEnum.getCode());
result.put("data", this.buildViewData(viewTypeEnum, p.get("date").toString(), RequestContext.getAppKey()));
return result;
}).collect(Collectors.toList());
List<Map<String, Object>> resultMap = new ArrayList<>();
for (Map<String, Object> stringObjectMap : viewTypeResult) {
for (Map<String, Object> objectMap : rangeDate) {
if (stringObjectMap.get("date").equals(objectMap.get("date"))){
Map<String, Object> result = new LinkedHashMap<>();
DutyViewTypeEnum viewType = (DutyViewTypeEnum) stringObjectMap.get("viewType");
result.put("key", objectMap.get("date"));
result.put("viewType", viewType.getCode());
result.put("data", this.buildViewData(viewType, objectMap.get("date").toString(), RequestContext.getAppKey()));
resultMap.add(result);
}
}
}
return resultMap;
/*bug2468 值班排班,日历视图单班次执勤人数满足≤3且班次≤2时,值班显示方式错误 陈召 结束*/
}
private Object buildViewData(DutyViewTypeEnum viewTypeEnum, String dutyDate, String appKey) {
......
......@@ -144,6 +144,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
IPage<FailureDetailsDto> iPage = new Page<>();
iPage.setRecords(list);
iPage.setTotal(list.size());
return iPage;
}
......@@ -273,7 +274,11 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
// 发起主表流程 并添加至报修日志
failureDetailsDto.setSubmissionTime(new Date());
failureDetailsDto.setFailureCode(buildOrderNo());
failureDetailsDto.setBizCode(Long.valueOf(iOrgUsrService.getParentId(userInfo.getUserModel().getUserId())));
String parentId = iOrgUsrService.getParentId(userInfo.getUserModel().getUserId());
OrgUsr orgUsr = iOrgUsrService.getById(parentId);
failureDetailsDto.setBizCode(Long.valueOf(parentId));
model = this.createWithModel(failureDetailsDto);
if (ObjectUtils.isNotEmpty(failureDetailsDto.getAttachment())) {
......@@ -284,11 +289,12 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Long faultId = model.getSequenceNbr();
Integer processAuditorId = model.getSubmissionPid();
String processResult = "提交报修单";
String processDepartment = userInfo.getDepartment().getDepartmentName();
String processDepartment = orgUsr.getBizOrgName();
Long departmentId = failureDetailsDto.getBizCode();
Date processTime = model.getSubmissionTime();
String processAuditorName = failureDetailsDto.getSubmissionName();
System.out.println(System.currentTimeMillis());
repairlog(faultId, processAuditorId, departmentId, processTime, processDepartment, processResult, processAuditorName);
if (excuteTask(instance.getString("id"), userInfo, null)) {
......
......@@ -7,6 +7,7 @@ import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -144,25 +145,29 @@ public class AlertCalledController extends BaseController {
public ResponseModel<IPage<AlertCalled>> listPage(String pageNum, String pageSize, String sort, AlertCalled alertCalled, Integer alertStatus,
String alertTypeCode,
String alertSourceCode,
String startTime,
String endTime){
Page<AlertCalled> pageBean;
IPage<AlertCalled> page;
String callTimeStart,
String callTimeEnd){
//Page<AlertCalled> pageBean;
// IPage<AlertCalled> page;
QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>();
/* page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
return ResponseHelper.buildResponse(page);*/
setQueryWrapper(alertCalledQueryWrapper, alertCalled,sort);
/*分页存在问题 修改分页参数 陈召 2021-09-22 开始*/
Page<AlertCalled> page = new Page<>();
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
page = new Page<>(0, Long.MAX_VALUE);
} else {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
page.setCurrent(Long.parseLong(pageNum) * Long.parseLong(pageSize));
page.setSize(Long.parseLong(pageSize));
}
/*分页存在问题 修改分页参数 陈召 2021-09-22 结束*/
/* bug2407 表头筛选失效 补充条件方法 XML中添加了排序条件判断 data代表排序条件 lift 升降序 陈召 2021-09-03 开始*/
/* bug2408 筛选参数解析异常 修改筛选条件方法 修改入参分离筛选条件
alertStatus 警情状态 alertTypeCode 报警类型code alertSourceCode 警情来源code
陈召 2021-08-21 开始*/
IPage<AlertCalled> alertCalledIPage = iAlertCalledService.queryForCalledList(pageBean, alertStatus, alertTypeCode, alertSourceCode, startTime, endTime,sort);
IPage<AlertCalled> alertCalledIPage = iAlertCalledService.queryForCalledList(page, alertStatus, alertTypeCode, alertSourceCode, callTimeStart, callTimeEnd,sort);
/* bug 2406 接警记录,列表缺少警情状态字段 by litw start*/
alertCalledIPage.getRecords().stream().forEach(e->{
if(e.getAlertStatus()) {
......
......@@ -33,6 +33,7 @@ import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
......@@ -738,7 +739,11 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
private void excelImportWaterResource(MultipartFile multipartFile) throws Exception {
List<WaterResourceDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, WaterResourceDto.class, 1);
excelDtoList.forEach(item -> {
//BUG 2953 导入模板没有设备编码生成 2021-09-18 陈召开始
item.setEquipCode(QRCodeUtil.generateQRCode());
//BUG 2953 导入模板没有设备编码生成 2021-09-18 陈召结束
if (item.getResourceTypeName() != null) {
String[] resourceTypeName = item.getResourceTypeName().split("@");
item.setResourceTypeName(resourceTypeName[0]);
......
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