Commit 02e178d5 authored by tangwei's avatar tangwei

修复扫描出来问题

parent 26274cdf
......@@ -44,7 +44,6 @@ public class PersonIdentifyAspect {
UserDto userDto = orgUsrService.getUserParentInfo(userId);
ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity();
// TODO 没有绑定机场单位的人员,则赋值不存在的bizOrgCode,规避查询出所有数据
// personIdentity.setBizOrgCode(StringUtils.isEmpty(userDto.getBizOrgCode()) ? "-1" : userDto.getBizOrgCode());
personIdentity.setCompanyId(userDto.getCompanyId());
personIdentity.setCompanyName(userDto.getCompanyName());
personIdentity.setPersonSeq(userDto.getPersonSeq());
......@@ -59,7 +58,7 @@ public class PersonIdentifyAspect {
personIdentity.setCompanyBizOrgCode(userDto.getCompanyBizOrgCode());
reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSON.toJSONString(reginParam));
}
}
......
......@@ -7,7 +7,6 @@ import java.util.Map;
@Data
public class BigScreen1VO {
// private Map<String, Object> firefightersInfo;
private List<Map<String, Object>> personList;
......@@ -16,5 +15,4 @@ public class BigScreen1VO {
private List<Map<String, Object>> usrSignInfo;
private List<Map<String, Object>> usrSignInfoByCode;
// private Integer teamNum;
}
//package com.yeejoin.amos.boot.module.common.api.dto;
//
//import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
///**
//* 数据字典
//*
//* @author tb
//* @date 2021-06-07
//*/
//@Data
//@EqualsAndHashCode(callSuper = true)
//@ApiModel(value="DataDictionaryDto", description="数据字典")
//public class DataDictionaryDto extends BaseDto {
// private static final long serialVersionUID = 1L;
//
//
// @ApiModelProperty(value = "code")
// private String code;
//
// @ApiModelProperty(value = "名称")
// private String name;
//
// @ApiModelProperty(value = "类型")
// private String type;
//
// @ApiModelProperty(value = "父级")
// private Long parent;
//
// @ApiModelProperty(value = "操作人名称")
// private String recUserName;
//
//}
......@@ -37,12 +37,6 @@ public class DutyFireFightingExcleDto implements Serializable{
private String userName;
// @ExcelIgnore
// @ApiModelProperty(value = "部门id")
// private String deptId;
// @ExcelIgnore
// @ApiModelProperty(value = "部门名称")
// private String deptName;
@ExcelIgnore
@ApiModelProperty(value = "岗位id")
......
......@@ -32,8 +32,7 @@ public class DutyPersonShiftDto extends BaseDto {
@ApiModelProperty(value = "实例id")
private Long instanceId;
@ApiModelProperty(value = "更新人员")
private String recUserName;
@ApiModelProperty(value = "班次名称")
private String shiftName;
......
......@@ -200,8 +200,7 @@ public class FirefightersExcelDto extends BaseDto {
@ExcelProperty(value = "消防救援人员类别", index = 25)
private String category;
// @ApiModelProperty(value = "消防救援人员状态")
// private String state;
@ApiModelProperty(value = "消防救援衔级别代码")
@ExplicitConstraint(type = "XFJYJB", indexNum = 26, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
......
......@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.experimental.Accessors;
import net.bytebuddy.implementation.bind.annotation.Super;
import java.util.List;
......
......@@ -31,6 +31,5 @@ public class WaterResourceDyDto {
@ApiModelProperty(value = "表单值")
private String data;
public WaterResourceDyDto() {
}
}
//package com.yeejoin.amos.boot.module.common.api.entity;
//
//import com.baomidou.mybatisplus.annotation.TableName;
//import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//import lombok.experimental.Accessors;
///**
//* 数据字典
//*
//* @author tb
//* @date 2021-06-07
//*/
//@Data
//@EqualsAndHashCode(callSuper = true)
//@Accessors(chain = true)
//@TableName("cb_data_dictionary")
//@ApiModel(value="DataDictionary对象", description="数据字典")
//public class DataDictionary extends BaseEntity {
// /**
// *
// */
// private static final long serialVersionUID = 1L;
//
// @ApiModelProperty(value = "code")
// private String code;
//
// @ApiModelProperty(value = "名称")
// private String name;
//
// @ApiModelProperty(value = "类型")
// private String type;
//
// @ApiModelProperty(value = "父级")
// private Long parent;
//
// //新加排序字段
// @ApiModelProperty(value = "排序字段")
// private int sortNum;
//
//}
......@@ -52,12 +52,7 @@ public class FailureAudit extends BaseEntity {
@TableField("audit_opinion")
private String auditOpinion;
/* *//**
* 审核状态
*//*
@TableField("audit_status")
private String auditStatus;
*/
/**
* 设备故障报修单id
*/
......
......@@ -44,8 +44,7 @@ public class FirefightersPost extends BaseEntity {
@ApiModelProperty(value = "消防救援人员类别")
private String category;
// @ApiModelProperty(value = "消防救援人员状态")
// private String state;
@ApiModelProperty(value = "消防救援衔级别代码")
private String level;
......@@ -69,14 +68,12 @@ public class FirefightersPost extends BaseEntity {
@ApiModelProperty(value = "消防救援人员类别字典code")
private String categoryCode;
// @ApiModelProperty(value = "消防救援人员状态")
// private String stateCode;
@ApiModelProperty(value = "消防救援衔级别代码字典code")
private String levelCode;
// @ApiModelProperty(value = "资质证书字典code")
// private String qualificationCertificateCode;
@ApiModelProperty(value = "消防专家领域字典code")
private String areasExpertiseCode;
......
......@@ -14,7 +14,6 @@ import org.apache.poi.ss.usermodel.*;
public class ExcelStyleUtil implements IExcelExportStyler {
private static final short STRING_FORMAT = (short) BuiltinFormats.getBuiltinFormat("TEXT");
private static final short FONT_SIZE_TEN = 10;
private static final short FONT_SIZE_ELEVEN = 11;
private static final short FONT_SIZE_TWELVE = 12;
/**
* 大标题样式
......@@ -39,7 +38,6 @@ public class ExcelStyleUtil implements IExcelExportStyler {
* @param workbook
*/
private void init(Workbook workbook) {
//this.headerStyle = initHeaderStyle(workbook);
this.titleStyle = initTitleStyle(workbook);
this.styles = initStyles(workbook);
}
......@@ -98,17 +96,7 @@ public class ExcelStyleUtil implements IExcelExportStyler {
return null;
}
/**
* 初始化--大标题样式
*
* @param workbook
* @return
*/
private CellStyle initHeaderStyle(Workbook workbook) {
CellStyle style = getBaseCellStyle(workbook);
style.setFont(getFont(workbook, FONT_SIZE_TWELVE, true));
return style;
}
/**
* 初始化--每列标题样式
......@@ -118,7 +106,6 @@ public class ExcelStyleUtil implements IExcelExportStyler {
*/
private CellStyle initTitleStyle(Workbook workbook) {
CellStyle style = getBaseCellStyle(workbook);
//style.setFont(getFont(workbook, FONT_SIZE_ELEVEN, false));
//背景色
style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
......
......@@ -30,10 +30,13 @@ import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
public class ExcelUtil {
private static final Integer DUTY_CAR_START_INDEX = 5;
private ExcelUtil() {
}
/**
* 生成excel模板
......@@ -69,7 +72,7 @@ public class ExcelUtil {
.registerWriteHandler(horizontalCellStyleStrategy).doWrite(data);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
throw new BadRequest("系统错误!");
}
}
......@@ -126,9 +129,7 @@ public class ExcelUtil {
}
}
}
// String s = new String(fileName.getBytes(), "UTF-8");
// response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(s, "UTF-8"));
ExcelWriterSheetBuilder excelWriterSheetBuilder =EasyExcel
.write(getOutputStream(fileName, response, ExcelTypeEnum.XLSX))
.head(dutyCarTitleList)
......@@ -273,8 +274,9 @@ public class ExcelUtil {
*/
public static Map<Integer, String[]> resolveExplicitConstraint(Map<Integer, String[]> explicitListConstraintMap,
ExplicitConstraint explicitConstraint, DataSources dataDictionaryMapper) {
Map<Integer, String[]> map =new HashMap<>();
if (explicitConstraint == null) {
return null;
return map;
}
// 固定下拉信息
String[] source = explicitConstraint.source();
......@@ -300,7 +302,7 @@ public class ExcelUtil {
e.printStackTrace();
}
}
return null;
return map;
}
/**
......@@ -330,27 +332,7 @@ public class ExcelUtil {
*/
public static HorizontalCellStyleStrategy setMyCellStyle() {
// // 头的策略
// WriteCellStyle headWriteCellStyle = new WriteCellStyle();
// // 设置表头居中对齐
// headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
// // 颜色
// headWriteCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
//
// WriteFont headWriteFont = new WriteFont();
// headWriteFont.setFontHeightInPoints((short) 10);
// // 字体
// headWriteCellStyle.setWriteFont(headWriteFont);
// headWriteCellStyle.setWrapped(true);
// // 内容的策略
// WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
// // 设置内容靠中对齐
// contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
// // 这个策略是 头是头的样式 内容是内容的样式 其他的策略可以自己实现
// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy
// (headWriteCellStyle, contentWriteCellStyle);
// // 这里 需要指定写用哪个class去写,然后写到第一个sheet,名字为模板 然后文件流会自动关闭
// return horizontalCellStyleStrategy;
// 表头样式策略
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
......@@ -375,8 +357,6 @@ public class ExcelUtil {
contentWriteCellStyle.setWrapped(true);
// 设置垂直居中
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
// 头默认了 FillPatternType所以可以不指定。
// contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
// 设置水平居中
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
......@@ -409,7 +389,6 @@ public class ExcelUtil {
for (Object t : data) {
List<Object> rowLine = new ArrayList<>();
for(String head: headstr) {
List<Object> row = new ArrayList<>();
String getMethodName = "get" + head.substring(0,1).toUpperCase() + head.substring(1);
Class clazz = t.getClass();
Method getMethod;
......
......@@ -48,33 +48,7 @@ public class TemplateCellWriteHandler implements CellWriteHandler {
cellStyle.setFont(font1);
cell.setCellStyle(cellStyle);
}
// //其他列
// if (!isHead){
// CellStyle style = workbooks.createCellStyle();
// DataFormat dataFormat = workbooks.createDataFormat();
// style.setDataFormat(dataFormat.getFormat("@"));
// style.setVerticalAlignment(VerticalAlignment.CENTER);
// style.setAlignment(HorizontalAlignment.CENTER);
// cell.setCellStyle(style);
// }
// //设置日期
// if (!isHead && cell.getColumnIndex()==19 || !isHead && cell.getColumnIndex()==21|| !isHead && cell.getColumnIndex()==20){
// CellStyle style = workbooks.createCellStyle();
// DataFormat dataFormat = workbooks.createDataFormat();
// style.setDataFormat(dataFormat.getFormat("yyyy/mm/dd hh:mm:ss"));
// style.setVerticalAlignment(VerticalAlignment.CENTER);
// style.setAlignment(HorizontalAlignment.CENTER);
// cell.setCellStyle(style);
// }
// //设置金额
// if (!isHead && cell.getColumnIndex()==15 ||!isHead && cell.getColumnIndex()==16||!isHead && cell.getColumnIndex()==22 ||!isHead && cell.getColumnIndex()==24||!isHead && cell.getColumnIndex()==25){
// CellStyle style = workbooks.createCellStyle();
// DataFormat dataFormat = workbooks.createDataFormat();
// style.setDataFormat(dataFormat.getFormat("0.00"));
// style.setVerticalAlignment(VerticalAlignment.CENTER);
// style.setAlignment(HorizontalAlignment.CENTER);
// cell.setCellStyle(style);
// }
}
......
......@@ -105,17 +105,7 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
workbook.setSheetHidden(hiddenIndex, true);
}
}
// // 下拉列表约束数据
// DataValidationConstraint constraint = helper.createExplicitListConstraint(v);
// // 设置约束
// DataValidation validation = helper.createValidation(constraint, rangeList);
// // 阻止输入非下拉选项的值
// validation.setErrorStyle(DataValidation.ErrorStyle.STOP);
// validation.setShowErrorBox(true);
// validation.setSuppressDropDownArrow(true);
// validation.createErrorBox("提示", "此值与单元格定义格式不一致");
// // validation.createPromptBox("填写说明:","填写内容只能为下拉数据集中的单位,其他单位将会导致无法入仓");
// sheet.addValidationData(validation);
});
}
......
......@@ -57,6 +57,6 @@ public interface AmosTrainingFeignClient {
* @return
*/
@GetMapping("/v1/examination/onlineExamPage?pageSize=10&pageNum=1&flag=online&examinationName=")
ResponseModel<PageInfo> getExamStatisticsList();
ResponseModel<PageInfo<Object>> getExamStatisticsList();
}
......@@ -384,15 +384,15 @@ public interface EquipFeignClient {
@RequestMapping(value = "/car/all/fusion", method = RequestMethod.GET)
ResponseModel<List> getCarFusionList();
ResponseModel<List<Object>> getCarFusionList();
@RequestMapping(value = "/equipment/query/classification/", method = RequestMethod.GET)
ResponseModel<List> getClassification();
ResponseModel<List<Object>> getClassification();
@RequestMapping(value = "/equipment/list/{typeCode}", method = RequestMethod.GET)
ResponseModel<List> getEquipmentList(@PathVariable("typeCode") String typeCode);
ResponseModel<List<Object>> getEquipmentList(@PathVariable("typeCode") String typeCode);
@RequestMapping(value = "equipment-category/list-tree", method = RequestMethod.GET)
ResponseModel<Object> list() ;
......
//package com.yeejoin.amos.boot.module.common.api.mapper;
//
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
//import com.yeejoin.amos.boot.module.common.api.entity.DataDictionary;
//
///**
//* 数据字典 Mapper 接口
//*
//* @author tb
//* @date 2021-06-07
//*/
//public interface DataDictionaryMapper extends BaseMapper<DataDictionary> {
//
//}
......@@ -55,7 +55,7 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
* @return IPage<Map < String, Object>>
*/
IPage<Map<String, Object>> pageList(
Page page,
Page<Map<String, Object>> page,
@Param("appKey") String appKey,
@Param("fieldCodes") Map<String, Object> fieldCodes,
@Param("groupCode") String groupCode,
......@@ -106,7 +106,7 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
* @return IPage<Map < String, Object>>
*/
IPage<Map<String, Object>> pageListNew(
Page page,
Page<Map<String, Object>> page,
@Param("appKey") String appKey,
@Param("fieldCodes") Map<String, Object> fieldCodes,
@Param("groupCode") String groupCode,
......@@ -156,7 +156,7 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
* @param page
* @return
*/
Page<Map<String, Object>> getPersonInfoByPage(Page page, @Param("bizOrgCode") String bizOrgCode);
Page<Map<String, Object>> getPersonInfoByPage(Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> dutyCardCount();
List<Map<String, Object>> dutyCardList ();
......
......@@ -59,109 +59,4 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> {
List<FailureDetails> selectForReceive(Long currentStatus, String startTime, String endTime, Integer submissionPid, String userId,Long current, Long size,String ruleName);
/* List<StatusDto> selectAudit(Long currentStatus, String startTime, String endTime, Integer submissionPid, String userId);
List<StatusDto> selectMaintain(Long currentStatus, String startTime, String endTime, Integer submissionPid, String userId);
List<StatusDto> selectUserId(Long currentStatus, String startTime, String endTime, String userId);*/
/* List<FailureDetails> selectYJ(Long currentStatus, String startTime, String endTime, String userId,Long current, Long size);*/
/* List<FailureDetails> selectForAudit(Long currentStatus, String startTime, String endTime,Integer submissionPid, String userId,Long current, Long size);*/
/* List<FailureDetails> selectForMaintain(Long currentStatus, String startTime, String endTime, Integer submissionPid, String userId,Long current, Long size);*/
/**
* 统计 维修人员
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
* @return
*/
/* List<StatusDto> selectStatusWx(Long currentStatus, String startTime, String endTime, Integer submissionPid);
*//**
* 统计 应急指挥科人员
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
* @return
*//*
List<StatusDto> selectStatusFq(Long currentStatus, String startTime, String endTime, Integer submissionPid);
*//**
* 统计 我发起
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
* @return
*//*
List<StatusDto> selectStatusFqp(Long currentStatus, String startTime, String endTime, Integer submissionPid);
*//**
* 统计 领导
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
* @return
*//*
List<StatusDto> selectStatusLeader(Long currentStatus, String startTime, String endTime, Integer submissionPid);*/
/* /**
* 查询待处理 分页
*
* @param currentStatus 当前任务状态
* * @param startTime 起始时间
* * @param endTime 结束时间
* * @param submissionPid 报送人
* @param
* @return
*//*
List<FailureDetails> selectInProcessing(Long current, Long size, Long currentStatus,
String startTime, String endTime, Integer submissionPid);
/**
* 查询待处理 应急指挥科人员分页
*
* @param
* @return
*//*
List<FailureDetails> selectStatusWaitTj(Long current, Long size, Long currentStatus,
String startTime, String endTime, Integer submissionPid);*/
/* /**
* 查询待处理 维修人员分页
*
* @param currentStatus 当前任务状态
* * @param startTime 起始时间
* * @param endTime 结束时间
* * @param submissionPid 报送人
* @param
* @return
*//*
List<FailureDetails> selectStatusWaitWx(Long current, Long size, Long currentStatus,
String startTime, String endTime, Integer submissionPid);*/
/* *//**
* 查询我发起的 分页
* current 当前页
* size 条数
*
* @param currentStatus 当前任务状态
* * @param startTime 起始时间
* * @param endTime 结束时间
* * @param submissionPid 报送人
* @return
*//*
List<FailureDetails> selectISubPage(Long current, Long size, Long currentStatus,
String startTime, String endTime, Integer submissionPid);*/
}
......@@ -17,22 +17,6 @@ import java.util.List;
*/
public interface FireTeamMapper extends BaseMapper<FireTeam> {
// @Select("<script>"
// + "select a.sequence_nbr sequenceNbr, a.img,a.name,a.contact_user contactUser,a.contact_phone contactPhone, a.address from cb_fire_team a where a.is_delete=0"
// + "<if test='par.parent!=null'>" + "and a.parent= #{par.parent}" + "</if>"
// + "<if test='par.typeCode!=null'>" + "and a.type_code= #{par.typeCode}" + "</if>"
// + "<if test='par.companyCode!=null'>" + "and a.company_code= #{par.companyCode}" + "</if>"
// + "<if test='par.name!=null'>" + "and a.name= #{par.name}" + "</if>"
// + "</script>")
// List<FireTeamVo> getFireTeam(int pageNum, int pageSize, FireTeamListVo par);
// @Select("<script>"
// + "select COUNT(a.sequence_nbr) num from cb_fire_team a where a.is_delete=0"
// + "<if test='par.parent!=null'>" + "and a.parent= #{par.parent}" + "</if>"
// + "<if test='par.typeCode!=null'>" + "and a.type_code= #{par.typeCode}" + "</if>"
// + "<if test='par.companyCode!=null'>" + "and a.company_code= #{par.companyCode}" + "</if>"
// + "<if test='par.name!=null'>" + " and a.name= #{par.name}" + "</if>"
// + "</script>")
// Map<String, Long> getFireTeamCount(int pageNum, int pageSize, FireTeamListVo par);
/**
* 返回监控大队信息列表
......@@ -48,7 +32,7 @@ public interface FireTeamMapper extends BaseMapper<FireTeam> {
* @param par
* @return
*/
IPage<FireTeamCardDto> getFireTeamForPage(Page page, FireTeamListDto par);
IPage<FireTeamCardDto> getFireTeamForPage(Page<FireTeamCardDto> page, FireTeamListDto par);
/**
......
......@@ -55,5 +55,5 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<Map<String, Object>> getUserInfoByYJYA(String bizOrgCode);
IPage<Map<String, Object>> selectSignPersonList(Page page, @Param("bizOrgCode") String bizOrgCode);
IPage<Map<String, Object>> selectSignPersonList(Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode);
}
......@@ -28,7 +28,7 @@ public interface MaintenanceCompanyMapper extends BaseMapper<MaintenanceCompany>
* @param seq
* @return
*/
public Page<OrgUsrDto> selectOrgUsrPageList(Page page, @Param("seq") Long seq);
public Page<OrgUsrDto> selectOrgUsrPageList(Page<OrgUsrDto> page, @Param("seq") Long seq);
List<MaintenanceCompany> findByCodeAndType(String code, String type);
......
//package com.yeejoin.amos.boot.module.common.api.service;
//
//import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
//
//import java.util.List;
//
///**
// * 数据字典 服务类
// *
// * @author tb
// * @date 2021-06-07
// */
//public interface IDataDictionaryService {
//
//
// Object getFireChemical(String type) throws Exception;
//
// Object gwmcDataDictionary(String type) throws Exception;
//
// List<MenuFrom> getGWMCDataDictionary(String type) throws Exception;
//}
......@@ -72,7 +72,7 @@ public interface IDutyCommonService {
*/
String getGroupCode();
List downloadList(String beginDate, String endDate) throws ParseException;
List<Object> downloadList(String beginDate, String endDate) throws ParseException;
/**
* 值班数据入库
......
......@@ -161,7 +161,7 @@ public interface IMaintenanceCompanyService {
* 将所有的维保人员导入到excle中
* @return
*/
public List<MaintenancePersonExcleDto> exportToMaintenancePersonExcel(Map map);
public List<MaintenancePersonExcleDto> exportToMaintenancePersonExcel(Map<String,Object> map);
List<MaintenanceCompany> findByInstanceIdAndType(Long instanceId, String type);
......
......@@ -42,10 +42,10 @@ public interface IOrgUsrService {
* @return
* @throws Exception
*/
List<OrgMenuDto> getTree(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
List<OrgMenuDto> getTree(Long topId, Collection<Object> entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
List<OrgMenuDto> getCompanyTree(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
List<OrgMenuDto> getCompanyTree(Long topId, Collection<Object> entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName, String OrgCodeMethodName) throws Exception;
/**
......@@ -62,10 +62,10 @@ public interface IOrgUsrService {
* @return
* @throws Exception
*/
List<OrgMenuDto> getSub(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
List<OrgMenuDto> getSub(Long topId, Collection<Object> entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
List<OrgMenuDto> getCompanySub(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
List<OrgMenuDto> getCompanySub(Long topId, Collection<Object> entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName, String OrgCodeMethodName) throws Exception;
/**
......@@ -132,7 +132,7 @@ public interface IOrgUsrService {
OrgUsrFormDto selectCompanyById(Long id) throws Exception;
IPage bizOrgTypeListPage(String pageNum, String pageSize, String bizOrgType) throws Exception;
IPage<Object> bizOrgTypeListPage(String pageNum, String pageSize, String bizOrgType) throws Exception;
void saveDepartment(List<OrgDepartmentDto> OrgDepartmentDto, Long id) throws Exception;
......@@ -195,7 +195,7 @@ public interface IOrgUsrService {
List<Map<String, Object>> getparent();
List<OrgUsrExcelDto> exportToExcel(Map par);
List<OrgUsrExcelDto> exportToExcel(Map<String,Object> par);
UserUnitDto getUserUnit(String userId);
......@@ -304,7 +304,7 @@ public interface IOrgUsrService {
* @return
* @throws Exception
*/
List<OrgMenuDto> getTreeFlc(Long topId, Collection entityList, String packageURL, String IDMethodName, int IDHierarchy,
List<OrgMenuDto> getTreeFlc(Long topId, Collection<Object> entityList, String packageURL, String IDMethodName, int IDHierarchy,
String NAMEMethodName, String PARENTIDMethodName, String OrgTypeMethodName) throws Exception;
......
//package com.yeejoin.amos.boot.module.common.biz.service;
//
//import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
//
///**
// * @author DELL
// */
//public interface IDutyCarService extends IDutyCommonService {
//
// /**
// * 值班信息保存
// * @param dutyCarDto 对象
// * @return List<DutyCarDto>
// */
// DutyCarDto save(DutyCarDto dutyCarDto);
//
// /**
// * 更新
// * @param instanceId 实例id
// * @param dutyCarDto 业务对象
// * @return List<DutyCarDto>
// */
// DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto);
//}
//package com.yeejoin.amos.boot.module.common.biz.service;
//
//import com.baomidou.mybatisplus.core.metadata.IPage;
//
//import java.text.ParseException;
//import java.util.List;
//import java.util.Map;
//
///**
// * @author DELL
// */
//public interface IDutyCommonService {
// /**
// * 分页查询
// *
// * @param current 当前页
// * @param size 页大小
// * @param beginDate 开始日期
// * @param endDate 结束日期
// * @return IPage<Map < String, Object>>
// */
// IPage<Map<String, Object>> pageList(int current, int size, String beginDate, String endDate) throws ParseException;
//
// /**
// * 值班明细
// *
// * @param beginDate 开始日期
// * @param endDate 结束日期
// * @return ResponseModel
// */
// List<Map<String, Object>> statisticsDay(String beginDate, String endDate) throws ParseException;
//
// /**
// * 不分页查询
// *
// * @param beginDate 开始日期
// * @param endDate 结束日期
// * @return ResponseModel
// */
// List<Map<String, Object>> list(String beginDate, String endDate) throws ParseException;
//
// /**
// * 获取表单参数
// *
// * @return String
// */
// String getGroupCode();
//
// List downloadList(String beginDate, String endDate) throws ParseException;
//
// /**
// * 值班数据入库
// *
// * @param dataList 数据
// */
// void saveImportData(List<Map<String, Object>> dataList);
//
// /**
// * 删除值班数据
// *
// * @param instanceId 实例id
// * @return Boolean
// */
// Boolean deleteDutyData(Long instanceId);
//
// /**
// * 查询指定条件的值班人信息
// *
// * @param dutyDay 查询条件
// * @param shiftId 班次
// * @param postType 岗位
// * @return List<Map < String, Object>>
// */
// List<Map<String, Object>> dayDutyPersonList(String dutyDay, Long shiftId, String postType);
//
// /**
// * 查询当前值班人信息
// *
// * @return List<Map < String, Object>>
// */
// List<Map<String, Object>> listOnDutyPerson();
//}
//package com.yeejoin.amos.boot.module.common.biz.service;
//
//import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
//
///**
// * @author DELL
// */
//public interface IDutyPersonService extends IDutyCommonService {
// /**
// * 保存
// *
// * @param dutyPersonDto 业务对象
// * @return List<DutyPersonDto>
// */
// DutyPersonDto save(DutyPersonDto dutyPersonDto);
//
//
// /**
// * 更新
// *
// * @param instanceId 实例id
// * @param dutyPersonDto 业务对象
// * @return List<DutyCarDto>
// */
// DutyPersonDto update(Long instanceId, DutyPersonDto dutyPersonDto);
//}
......@@ -89,7 +89,7 @@ public class ContractServiceImpl extends BaseService<ContractDto, Contract, Cont
* @throws Exception
*/
private List<FileInfoModel> buildFileInfo(String agencyCode, List<String> attachments,
ContractDto contractDto, String fileCategory) throws Exception {
ContractDto contractDto, String fileCategory) {
List<FileInfoModel> fileInfoModelList = new ArrayList<>();
for (String attachment : attachments) {
FileInfoModel fileInfoModel = new FileInfoModel();
......@@ -112,7 +112,7 @@ public class ContractServiceImpl extends BaseService<ContractDto, Contract, Cont
* @return
* @throws Exception
*/
private boolean saveAircraftFile(String agencyCode, ContractDto contractDto) throws Exception {
private boolean saveAircraftFile(String agencyCode, ContractDto contractDto) {
List<FileInfoModel> fileInfoModelList = new ArrayList<FileInfoModel>();
// 获取附件信息
if (!ValidationUtil.isEmpty(contractDto.getContractAttachment())) {
......@@ -137,7 +137,7 @@ public class ContractServiceImpl extends BaseService<ContractDto, Contract, Cont
* @return
* @throws Exception
*/
public ContractDto saveContractDto(String agencyCode, ContractDto contractDto) throws Exception {
public ContractDto saveContractDto(String agencyCode, ContractDto contractDto) {
contractDto.setIsDelete(false);
// 保存合同基本信息
contractDto = this.createWithModel(contractDto);
......@@ -154,7 +154,7 @@ public class ContractServiceImpl extends BaseService<ContractDto, Contract, Cont
* @return
* @throws Exception
*/
public ContractDto updateAircraft(String agencyCode, ContractDto model) throws Exception {
public ContractDto updateAircraft(String agencyCode, ContractDto model) {
ContractDto oldModel = this.queryBySeq(model.getSequenceNbr());
if (ValidationUtil.isEmpty(oldModel)) {
throw new DataNotFound("找不到指定的合同信息.");
......@@ -206,7 +206,7 @@ public class ContractServiceImpl extends BaseService<ContractDto, Contract, Cont
* @throws Exception
*/
@Transactional(rollbackFor = {Exception.class, BaseException.class})
public List<Long> multDeleteAircraft(String agencyCode, String ids) throws Exception {
public List<Long> multDeleteAircraft(String agencyCode, String ids) {
List<Long> seqs = StringUtil.String2LongList(ids);
for (Long id : seqs) {
//删除附件信息
......
//package com.yeejoin.amos.boot.module.common.biz.service.impl;
//
//
//import com.alibaba.fastjson.JSON;
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.yeejoin.amos.boot.biz.common.utils.*;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Service;
//import org.typroject.tyboot.core.rdbms.service.BaseService;
//
//import com.yeejoin.amos.boot.module.common.api.dto.DataDictionaryDto;
//import com.yeejoin.amos.boot.module.common.api.entity.DataDictionary;
//import com.yeejoin.amos.boot.module.common.api.mapper.DataDictionaryMapper;
//import com.yeejoin.amos.boot.module.common.api.service.IDataDictionaryService;
//import org.typroject.tyboot.core.restful.utils.ResponseHelper;
//
//import java.util.Collection;
//import java.util.List;
//
///**
// * 数据字典 服务实现类
// *
// * @author tb
// * @date 2021-06-07
// */
//@Service
//public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, DataDictionary, DataDictionaryMapper> implements IDataDictionaryService {
// @Autowired
// RedisUtils redisUtils;
//
// @Value("${redis.cache.failure.time}")
// private long time;
//
//
// @Override
// public Object getFireChemical(String type) throws Exception {
// QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("type", type);
// queryWrapper.orderByAsc("sort_num");
//
// if (redisUtils.hasKey(RedisKey.DATA_DICTIONARY_CODE + type)) {
// Object obj = redisUtils.get(RedisKey.DATA_DICTIONARY_CODE + type);
// return obj;
// } else {
// Collection<DataDictionary> list = this.list(queryWrapper);
// List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0,
// "getName", "getParent", null);
// MenuFrom Me = new MenuFrom("-1", "-1", "-1", "危化品库", "危化品库", "危化品库", "-1", null);
// Me.setIsLeaf(false);
// Me.setChildren(menus);
// redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(Me), time);
// return Me;
// }
// }
//
// @Override
// public Object gwmcDataDictionary(String type) throws Exception {
// QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("type", type);
// queryWrapper.orderByAsc("sort_num");
//
// if (redisUtils.hasKey(RedisKey.DATA_DICTIONARY_CODE + type)) {
// Object obj = redisUtils.get(RedisKey.DATA_DICTIONARY_CODE + type);
// return obj;
// } else {
// Collection<DataDictionary> list = this.list(queryWrapper);
// List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
// , "getParent", null);
// redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
// return menus;
// }
// }
//
// public List<MenuFrom> getGWMCDataDictionary(String type) throws Exception {
// QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("type", type);
// queryWrapper.orderByAsc("sort_num");
//
// Collection<DataDictionary> list = this.list(queryWrapper);
// List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
// , "getParent", null);
// return menus;
//
// }
//}
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrSyncDto;
import com.yeejoin.amos.boot.module.common.api.enums.DataSyncTopicEnum;
......@@ -42,7 +43,7 @@ public class DataSyncServiceImpl implements IDataSyncService {
emqKeeper.getMqttClient().publish(DataSyncTopicEnum.EQM_PATROL_CREATED.getTopic(), message.getBytes(), RuleConfig.DEFAULT_QOS, false);
//站端人员信息同步
emqKeeper.getMqttClient().publish(DataSyncTopicEnum.STATION_USER_UPDATE.getTopic(), JSONObject.toJSONString(x).getBytes(), RuleConfig.DEFAULT_QOS, false);
emqKeeper.getMqttClient().publish(DataSyncTopicEnum.STATION_USER_UPDATE.getTopic(), JSON.toJSONString(x).getBytes(), RuleConfig.DEFAULT_QOS, false);
}
}
......@@ -63,7 +64,7 @@ public class DataSyncServiceImpl implements IDataSyncService {
emqKeeper.getMqttClient().publish(DataSyncTopicEnum.EQM_PATROL_CREATED.getTopic(), message.getBytes(), RuleConfig.DEFAULT_QOS, false);
//站端人员信息删除同步
emqKeeper.getMqttClient().publish(DataSyncTopicEnum.STATION_USER_DELETE.getTopic(), JSONObject.toJSONString(orgUsrSyncDto).getBytes(), RuleConfig.DEFAULT_QOS, false);
emqKeeper.getMqttClient().publish(DataSyncTopicEnum.STATION_USER_DELETE.getTopic(), JSON.toJSONString(orgUsrSyncDto).getBytes(), RuleConfig.DEFAULT_QOS, false);
}
} catch (Exception e) {
......@@ -75,6 +76,6 @@ public class DataSyncServiceImpl implements IDataSyncService {
Map<String, Object> map = new HashMap<>();
map.put("topic", topic);
map.put("data", object);
return JSONObject.toJSONString(map);
return JSON.toJSONString(map);
}
}
......@@ -33,8 +33,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService;
@Service
public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCarService {
@Autowired
DynamicFormInstanceServiceImpl dynamicFormInstanceService;
@Autowired
FirefightersMapper firefightersMapper;
......@@ -47,14 +46,21 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
@Autowired
EquipFeignClient equipFeign;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
@Override
public String getGroupCode() {
return "dutyCar";
}
private static final String USERNAME="userName";
private static final String POSTTYPENAME="postTypeName";
private static final String TEAMNAME="teamName";
private static final String CARNAME="carName";
private static final String CARSTATUS="carStatus";
private static final String CARID="carId";
@Override
public DutyCarDto save(DutyCarDto dutyCarDto) {
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
......@@ -93,17 +99,14 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
return dutyCarDto;
}
private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column,
DynamicFormInstance formInstance) {
fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId());
}
@Override
public JSONObject isFireCarDriver() {
JSONObject result = new JSONObject();
result.put("isDriver", false);
result.put("carStatus", "");
result.put("carId", "");
result.put(CARSTATUS, "");
result.put(CARID, "");
String loginUserId = RequestContext.getExeUserId();
// 根据登陆人id查询对应消防人员
......@@ -133,18 +136,18 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
}
result.put("isDriver", true);
result.put("carId", personList.get(0).get("carId"));
result.put(CARID, personList.get(0).get(CARID));
ResponseModel<Map<String, Object>> resultModel = equipFeignClient
.queryCarSimpleInfoById((Long) personList.get(0).get("carId"));
.queryCarSimpleInfoById((Long) personList.get(0).get(CARID));
Map<String, Object> carInfo = resultModel.getResult();
result.put("carStatus", carInfo.get("carStatus"));
result.put(CARSTATUS, carInfo.get(CARSTATUS));
return result;
}
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "carId", "carName", "teamName","result.carId");
this.getGroupCode(), CARID, CARNAME, TEAMNAME,"result.carId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
return null;
}
......@@ -152,18 +155,17 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
for (Map<String, Object> map : equipmentList) {
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
LinkedHashMap<String, Object> titleMap_1 =new LinkedHashMap<String, Object>();
titleMap_1.put("消防车辆", map.get("carName").toString());
if(map.containsKey("carName") && map.get("carName") != null){
titleMap_1.put("消防车辆", map.get("carName").toString());
titleMap_1.put("消防车辆", map.get(CARNAME).toString());
if(map.containsKey(CARNAME) && map.get(CARNAME) != null){
titleMap_1.put("消防车辆", map.get(CARNAME).toString());
}
resultList.add(titleMap_1);
LinkedHashMap<String, Object> titleMap_2 =new LinkedHashMap<String, Object>();
//titleMap_2.put("单位/部门", map.get("teamName").toString());
if(map.containsKey("teamName") && map.get("teamName") != null){
titleMap_2.put("单位/部门", map.get("teamName").toString());
if(map.containsKey(TEAMNAME) && map.get(TEAMNAME) != null){
titleMap_2.put("单位/部门", map.get(TEAMNAME).toString());
}
resultList.add(titleMap_2);
String carId =map.get("carId").toString();
String carId =map.get(CARID).toString();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId);
if(instanceMap==null) {
......@@ -173,36 +175,24 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
// List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
// if(dutyList!=null && dutyList.size()>0) {
// for (Map<String, Object> dutyDetail : dutyList) {
// if(!dutyDetail.containsKey("name")) {
// continue;
// }
// 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,null, fieldCode);
/*if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue;
}*/
LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
//取消掉班次的显示---2022-01-16 by chenhao ---start
//infoMap_1.put(dutyDetail.get("name").toString(), "");
//resultList.add(infoMap_1);
//取消掉班次的显示---2022-01-16 by chenhao ---end
if (specifyDateList.size()>0 && specifyDateList != null) {
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 = new LinkedHashMap<String, Object>();
// infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
// resultList.add(infoMap_2);
if (specify.containsKey("postTypeName") && specify.get("postTypeName") != null && specify.containsKey("userName") && specify.get("userName") != null) {
infoMap_2.put(specify.get("postTypeName").toString(), specify.get("userName").toString());
if (specify.containsKey(POSTTYPENAME) && specify.get(POSTTYPENAME) != null && specify.containsKey(USERNAME) && specify.get(USERNAME) != null) {
infoMap_2.put(specify.get(POSTTYPENAME).toString(), specify.get(USERNAME).toString());
resultList.add(infoMap_2);
}
}
}
// }
//}
}
detailList.add(resultList);
}
......@@ -211,10 +201,10 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
@Override
public int getDutyCarCount(Long carId) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(DateUtils.getDateNowShortStr(),
this.getGroupCode(), "carId", "carName", "teamName","");
this.getGroupCode(), CARID, CARNAME, TEAMNAME,"");
int count =0;
for (Map<String, Object> map : equipmentList) {
if(map.containsKey("carId") && map.get("carId").equals(Long.toString(carId))) {
if(map.containsKey(CARID) && map.get(CARID).equals(Long.toString(carId))) {
count++;
}
}
......@@ -224,10 +214,10 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
@Override
public List<Map<String, Object>> getDutyCaruser(Long carId) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(DateUtils.getDateNowShortStr(),
this.getGroupCode(), "carId", "carName", "teamName","");
this.getGroupCode(), CARID, CARNAME, TEAMNAME,"");
equipmentList = equipmentList.stream().filter((e) ->
e.containsKey("carId") && e.get("carId").equals(Long.toString(carId))
e.containsKey(CARID) && e.get(CARID).equals(Long.toString(carId))
).collect(Collectors.toList());
return equipmentList;
......@@ -240,7 +230,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId.toString());
if(instanceMap==null) {
return null;
return specifyDateList;
}
String instanceId = instanceMap.get("instanceIds").toString();
if (StringUtils.isNotBlank(instanceId)) {
......
......@@ -85,6 +85,22 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Autowired
DynamicFormInstanceMapper dynamicFormInstanceMapper;
private static final String PERSON="person";
private static final String TOTAL="total";
private static final String STATION="station";
private static final String TEAMNAME = "teamName";
private static final String VIEWTYPE ="viewType";
private static final String DUTYSHIFT ="dutyShift";
private static final String DEPTID ="deptId";
private static final String COMPANYID ="companyId";
private static final String TELEPHONE ="telephone";
private static final String PERSONIMG ="personImg";
private static final String POSTSORT ="postSort";
private static final String USERID ="userId";
private static final String QUERYSTRATEGY ="queryStrategy";
private static final String FIELDCODE ="fieldCode";
private static final String YYYY_MM_DD ="yyyy-MM-dd";
/**
* 每天单个班次执勤人数全部小于等于3人
*/
......@@ -118,20 +134,20 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
DateTime now = new DateTime();
List<Long> shiftIdList = getOnDuty(now);
String shiftIds = StringUtils.join(shiftIdList.toArray(), ",");
String dutyDay = now.toString("yyyy-MM-dd");
String dutyDay = now.toString(YYYY_MM_DD);
// 获取当前值班人员
List<DynamicFormColumn> columns = dynamicFormColumnService
.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
Map<String, Object> fieldCodes = Bean.listToMap(columns, FIELDCODE, QUERYSTRATEGY, DynamicFormColumn.class);
List<Map<String, Object>> maps = dynamicFormInstanceService.getBaseMapper().listOnDutyPersonByAid(dutyDay, shiftIds,
fieldCodes, groupCode);
// 获取人员照片和电话
List<Long> ids = new ArrayList<>();
maps.forEach(item -> ids.add(Long.valueOf(String.valueOf(item.get("userId")))));
maps.forEach(item -> ids.add(Long.valueOf(String.valueOf(item.get(USERID)))));
try {
List<Map<String, Object>> orgUsrList = orgUsrService.selectForShowByListId(ids);
maps.forEach(item -> {
String userId = String.valueOf(item.get("userId"));
String userId = String.valueOf(item.get(USERID));
//此处是用来给119日常值班首页值班岗位排序用
String sort = "";
switch ( item.get("postType").toString() ){
......@@ -148,12 +164,12 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
sort = "1";
break;
}
item.put("postSort",sort);
item.put(POSTSORT,sort);
for (Map<String, Object> usr : orgUsrList) {
if (userId.equals(String.valueOf(usr.get("sequenceNbr")))) {
item.put("personImg", usr.get("personImg"));
item.put("telephone", usr.get("telephone"));
item.put("companyId", usr.get("companyId"));
item.put(PERSONIMG, usr.get(PERSONIMG));
item.put(TELEPHONE, usr.get(TELEPHONE));
item.put(COMPANYID, usr.get(COMPANYID));
item.put("bizOrgType", usr.get("bizOrgType"));
item.put("parentId", usr.get("parentId"));
break;
......@@ -161,14 +177,14 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}
});
maps= maps.stream().sorted((map1,map2)->{
if (map1.get("companyId").toString().equals(map2.get("companyId").toString())){
if (map1.get("deptId").toString().equals(map2.get("deptId").toString())){
return map2.get("postSort").toString().compareTo(map1.get("postSort").toString());
if (map1.get(COMPANYID).toString().equals(map2.get(COMPANYID).toString())){
if (map1.get(DEPTID).toString().equals(map2.get(DEPTID).toString())){
return map2.get(POSTSORT).toString().compareTo(map1.get(POSTSORT).toString());
}else {
return map1.get("deptId").toString().compareTo(map2.get("deptId").toString());
return map1.get(DEPTID).toString().compareTo(map2.get(DEPTID).toString());
}
}else {
return map2.get("companyId").toString().compareTo(map1.get("companyId").toString());
return map2.get(COMPANYID).toString().compareTo(map1.get(COMPANYID).toString());
}
}).collect(Collectors.toList());
} catch (Exception e) {
......@@ -181,32 +197,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Override
public IPage<Map<String, Object>> pageListDetail(int current, int size, String beginDate, String endDate, String bizOrgCode)
throws ParseException {
// // 1.已column为准 进行返回
// String groupCode = this.getGroupCode();
// // 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14
// IPage<Map<String, Object>> iPage = dynamicFormInstanceService.pageListNew(current, size, groupCode, beginDate, endDate);
// List<Map<String, Object>> records = iPage.getRecords();
// HashSet<String> userIdSet = new HashSet<>();
// if (!CollectionUtils.isEmpty(records)) {
// records.forEach(x -> {
// userIdSet.add(x.get("userId").toString());
// });
// }
// // 获取人员详细信息
// List<Map<String, Object>> personInfoList = dynamicFormInstanceService.personInfoList(DynamicGroupCodeEnum.JCS_PERSON.getCode(), userIdSet);
// if (!CollectionUtils.isEmpty(personInfoList)) {
// Map<String, List<Map<String, Object>>> listMap = personInfoList.stream().collect(Collectors.groupingBy((Map m) -> String.valueOf(m.get("userId"))));
// records.forEach(x -> {
// String userId = x.get("userId").toString();
// List<Map<String, Object>> list = listMap.get(userId);
// if (!CollectionUtils.isEmpty(list)) {
// list.forEach(x::putAll);
// }
// });
// iPage.setRecords(records);
// }
// return iPage;
return dynamicFormInstanceMapper.getPersonInfoByPage(new Page(current, size), bizOrgCode);
return dynamicFormInstanceMapper.getPersonInfoByPage(new Page<Map<String, Object>>(current, size), bizOrgCode);
}
......@@ -232,7 +224,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
// 根据时间 查询值班关系表
// BUG 2806 获取月份第一天和最后一天 2021-09-09 by kongfm
SimpleDateFormat shortformat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat shortformat = new SimpleDateFormat(YYYY_MM_DD);
if(beginDate != null ) {
Calendar c = Calendar.getInstance();
if(DateUtils.longStr2Date(beginDate) != null) {
......@@ -275,7 +267,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
dto.setColor(dutyShift != null ? dutyShift.getColor() : "");
return dto;
}).collect(Collectors.toList());
m.put("dutyShift", personShiftList);
m.put(DUTYSHIFT, personShiftList);
}
/*bug2468 值班排班,日历视图单班次执勤人数满足≤3且班次≤2时,值班显示方式错误 陈召 开始*/
......@@ -311,7 +303,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
endTime = time + " 23:59:59";
Map<String, Object> viewTypeMap = new HashMap<>();
viewTypeMap.put("date",time);
viewTypeMap.put("viewType", this.inferView(beginTime, endTime, RequestContext.getAppKey()));
viewTypeMap.put(VIEWTYPE, this.inferView(beginTime, endTime, RequestContext.getAppKey()));
viewTypeResult.add(viewTypeMap);
}
......@@ -322,9 +314,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
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");
DutyViewTypeEnum viewType = (DutyViewTypeEnum) stringObjectMap.get(VIEWTYPE);
result.put("key", objectMap.get("date"));
result.put("viewType", viewType.getCode());
result.put(VIEWTYPE, viewType.getCode());
result.put("data", this.buildViewData(viewType, objectMap.get("date").toString(), RequestContext.getAppKey()));
resultMap.add(result);
}
......@@ -343,12 +335,10 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
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);
viewTypeResult.add(viewTypeMap);
......@@ -382,7 +372,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
* 岗位: 岗位人员数量
*
* @param dutyDate
* @param dutyType
* @param
* @return
*/
public Object getPersonPostTypeNameAndCount(String dutyDate, String fieldCode) {
......@@ -401,18 +391,18 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
int station =0;
int person=0;
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDate,
this.getGroupCode(), "carId", "carName", "teamName","result.carId");
this.getGroupCode(), "carId", "carName", TEAMNAME,"result.carId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
station =0;
}else {
station=equipmentList.size();
}
map.put("station", station);
map.put(STATION, station);
List<Map<String, Object>> list = dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
for (Map<String, Object> map2 : list) {
person = person +Integer.parseInt(map2.get("total").toString());
person = person +Integer.parseInt(map2.get(TOTAL).toString());
}
map.put("person", person);
map.put(PERSON, person);
return map;
}
......@@ -422,18 +412,18 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
int station =0;
int person=0;
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDate,
this.getGroupCode(), "fireFightingId", "fireFighting", "teamName","result.fireFightingId");
this.getGroupCode(), "fireFightingId", "fireFighting", TEAMNAME,"result.fireFightingId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
station =0;
}else {
station=equipmentList.size();
}
map.put("station", station);
map.put(STATION, station);
List<Map<String, Object>> list = dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
for (Map<String, Object> map2 : list) {
person = person +Integer.parseInt(map2.get("total").toString());
person = person +Integer.parseInt(map2.get(TOTAL).toString());
}
map.put("person", person);
map.put(PERSON, person);
return map;
}
......@@ -442,18 +432,18 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
int station =0;
int person=0;
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDate,
this.getGroupCode(), "firstAidId", "firstAid", "teamName", "result.firstAidId");
this.getGroupCode(), "firstAidId", "firstAid", TEAMNAME, "result.firstAidId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
station =0;
}else {
station=equipmentList.size();
}
map.put("station", station);
map.put(STATION, station);
List<Map<String, Object>> list = dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
for (Map<String, Object> map2 : list) {
person = person +Integer.parseInt(map2.get("total").toString());
person = person +Integer.parseInt(map2.get(TOTAL).toString());
}
map.put("person", person);
map.put(PERSON, person);
return map;
}
......@@ -500,7 +490,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
list = list.stream().filter(m ->
m.get("dutyShift") != null && ((List<DutyPersonShiftDto>) m.get("dutyShift")).size() > 0
m.get(DUTYSHIFT) != null && ((List<DutyPersonShiftDto>) m.get(DUTYSHIFT)).size() > 0
).collect(Collectors.toList());
/*bug2472 添加根据部门id筛选数据的方法 陈浩 2021-08-21 开始 */
......@@ -509,7 +499,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
List<Map<String, Object>> resultList= new ArrayList<Map<String, Object>>();
list.stream().forEach(i->{
orgUsrList.forEach(m->{
if(i.get("userId").toString().equals(m.getSequenceNbr().longValue()+"")) {
if(i.get(USERID).toString().equals(m.getSequenceNbr().longValue()+"")) {
resultList.add(i);
}
});
......@@ -530,7 +520,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
List<Map<String, Object>> maps = this.list(null,beginDate, endDate);
// BUG 2807 如果不存在值班数据则不显示
maps = maps.stream().filter(m ->
m.get("dutyShift") != null && ((List<DutyPersonShiftDto>) m.get("dutyShift")).size() > 0
m.get(DUTYSHIFT) != null && ((List<DutyPersonShiftDto>) m.get(DUTYSHIFT)).size() > 0
).collect(Collectors.toList());
JSONArray jsonArray = new JSONArray();
......@@ -556,9 +546,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
Set<DutyPersonShift> dutyPersonShifts = new HashSet<>();
dataList.forEach(d -> {
// TODO: 业务唯一索引,用户id
String userId = d.get("userId").toString();
String userId = d.get(USERID).toString();
List<DynamicFormInstance> instances = dynamicFormInstanceService
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "userId")
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, USERID)
.eq(DynamicFormInstance::getFieldValue, userId)
.eq(DynamicFormInstance::getGroupCode, this.getGroupCode()));
Long instanceId = null;
......@@ -574,7 +564,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId,
instanceId));
// 2.list 转 map
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(instancesInDb, "fieldCode",
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(instancesInDb, FIELDCODE,
DynamicFormInstance.class);
// 3.待更新数据组装,待批量入库
this.updateFormValue(formInstanceList, dataMap, instanceId, columns, instanceMap);
......@@ -592,7 +582,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
formInstanceList.addAll(newInstances);
}
// 2.组装值班数据
List<DutyPersonShiftDto> shiftDtos = (List<DutyPersonShiftDto>) dataMap.get("dutyShift");
List<DutyPersonShiftDto> shiftDtos = (List<DutyPersonShiftDto>) dataMap.get(DUTYSHIFT);
Long finalInstanceId = instanceId;
// 按照业务唯一索引查询主键
List<DutyPersonShift> dutyPersonShiftsDb = dutyPersonShiftService
......@@ -602,7 +592,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
// todo: 只更新当天及值班之后数据
// 修复导入当天值班数据bug
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(YYYY_MM_DD);
String format = simpleDateFormat.format(new Date());
Date date = null;
try {
......@@ -688,7 +678,6 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Override
public Boolean deleteDutyData(Long instanceId, String startTime, String endTime) {
// BUG 2807 删除逻辑缺陷,现在前端后端传入 删除月份 2021-09-10 by kongfm
//dynamicFormInstanceService.remove(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId));
dutyPersonShiftService
.remove(new LambdaQueryWrapper<DutyPersonShift>().ge(DutyPersonShift::getDutyDate,startTime).le(DutyPersonShift::getDutyDate,endTime).eq(DutyPersonShift::getInstanceId, instanceId));
return true;
......@@ -701,7 +690,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
params.put("postType", postType);
List<DynamicFormColumn> columns = dynamicFormColumnService
.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
Map<String, Object> fieldCodes = Bean.listToMap(columns, FIELDCODE, QUERYSTRATEGY, DynamicFormColumn.class);
return dynamicFormInstanceService.getBaseMapper().listOneDayDutyPerson(dutyDay, shiftId, fieldCodes,
RequestContext.getAppKey(), groupCode, params);
}
......@@ -713,24 +702,24 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
DateTime now = new DateTime();
List<Long> shiftIdList = getOnDuty(now);
String shiftIds = StringUtils.join(shiftIdList.toArray(), ",");
String dutyDay = now.toString("yyyy-MM-dd");
String dutyDay = now.toString(YYYY_MM_DD);
// 获取当前值班人员
List<DynamicFormColumn> columns = dynamicFormColumnService
.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
Map<String, Object> fieldCodes = Bean.listToMap(columns, FIELDCODE, QUERYSTRATEGY, DynamicFormColumn.class);
List<Map<String, Object>> maps = dynamicFormInstanceService.getBaseMapper().listOnDutyPerson(dutyDay, shiftIds,
fieldCodes, groupCode);
// 获取人员照片和电话
List<Long> ids = new ArrayList<>();
maps.forEach(item -> ids.add(Long.valueOf(String.valueOf(item.get("userId")))));
maps.forEach(item -> ids.add(Long.valueOf(String.valueOf(item.get(USERID)))));
try {
List<Map<String, Object>> orgUsrList = orgUsrService.selectForShowByListId(ids);
maps.forEach(item -> {
String userId = String.valueOf(item.get("userId"));
String userId = String.valueOf(item.get(USERID));
for (Map<String, Object> usr : orgUsrList) {
if (userId.equals(String.valueOf(usr.get("sequenceNbr")))) {
item.put("personImg", usr.get("personImg"));
item.put("telephone", usr.get("telephone"));
item.put(PERSONIMG, usr.get(PERSONIMG));
item.put(TELEPHONE, usr.get(TELEPHONE));
break;
}
}
......@@ -782,7 +771,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
*/
public Long excuteDynamicFormInstance( String userId,Map<String, Object> map, String groupCode) {
List<DynamicFormInstance> instances = dynamicFormInstanceService
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "userId")
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, USERID)
.eq(DynamicFormInstance::getFieldValue, userId)
.eq(DynamicFormInstance::getGroupCode, this.getGroupCode()));
Long instanceId = null;
......@@ -792,7 +781,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
//1.查询已有数据
List<DynamicFormInstance> hasInstances = dynamicFormInstanceService.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId));
//2.list 转 map
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(hasInstances, "fieldCode", DynamicFormInstance.class);
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(hasInstances, FIELDCODE, DynamicFormInstance.class);
//3.查询列数据,已列为主
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
//4.已列为主 填充动态表单数据
......@@ -823,7 +812,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
//1.查询已有数据
List<DynamicFormInstance> instances = dynamicFormInstanceService.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId));
//2.list 转 map
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(instances, "fieldCode", DynamicFormInstance.class);
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(instances, FIELDCODE, DynamicFormInstance.class);
//3.查询列数据,已列为主
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
//页面数据转Map
......
......@@ -16,7 +16,6 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService;
@Service
......@@ -25,8 +24,9 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
@Autowired
FireStationServiceImpl fireStationServiceImpl;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
private static final String USERNAME="userName";
private static final String POSTTYPENAME="postTypeName";
private static final String TEAMNAME="teamName";
@Autowired
DynamicFormInstanceServiceImpl alertFormValueServiceImpl;
......@@ -57,7 +57,7 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
}
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "fireFightingId", "fireFighting", "teamName","result.fireFightingId");
this.getGroupCode(), "fireFightingId", "fireFighting", TEAMNAME,"result.fireFightingId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
return null;
}
......@@ -68,8 +68,8 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
titleMap_1.put("微型消防站", map.get("fireFighting").toString());
resultList.add(titleMap_1);
LinkedHashMap<String, Object> titleMap_2 =new LinkedHashMap<String, Object>();
if(map.containsKey("teamName") && map.get("teamName") != null){
titleMap_2.put("单位/部门", map.get("teamName").toString());
if(map.containsKey(TEAMNAME) && map.get(TEAMNAME) != null){
titleMap_2.put("单位/部门", map.get(TEAMNAME).toString());
}
resultList.add(titleMap_2);
String carId =map.get("fireFightingId").toString();
......@@ -82,29 +82,21 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
// List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
// if(dutyList!=null && dutyList.size()>0) {
// for (Map<String, Object> dutyDetail : dutyList) {
// if(!dutyDetail.containsKey("name")) {
// continue;
// }
// 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,null, fieldCode);
if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue;
}
// LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
// infoMap_1.put(dutyDetail.get("name").toString(), "");
// resultList.add(infoMap_1);
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
if( specify.containsKey("postTypeName")&& specify.get("postTypeName")!=null && specify.containsKey("userName")&& specify.get("userName")!=null ) {
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
if( specify.containsKey(POSTTYPENAME)&& specify.get(POSTTYPENAME)!=null && specify.containsKey(USERNAME)&& specify.get(USERNAME)!=null ) {
infoMap_2.put(specify.get(POSTTYPENAME).toString(),specify.get(USERNAME).toString());
resultList.add(infoMap_2);
}
// }
// }
}
}
detailList.add(resultList);
......@@ -122,7 +114,7 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
for (DynamicFormInstanceDto dto : dyList) {
if ("positionType".equals(dto.getFieldCode())) {
map.put("postType", dto.getFieldValue());
map.put("postTypeName", dto.getFieldValueLabel());
map.put(POSTTYPENAME, dto.getFieldValueLabel());
break;
}
}
......
......@@ -5,31 +5,28 @@ import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
@Service
public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements IDutyFirstAidService {
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
@Autowired
OrgUsrServiceImpl orgUsrServiceImpl;
@Autowired
DataDictionaryServiceImpl dataDictionaryService;
private static final String POSTTYPENAME="postTypeName";
private static final String USERNAME= "userName";
public String getGroupCode() {
return "dutyFirstAid";
......@@ -39,7 +36,7 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
public DutyFirstAidDto save(DutyFirstAidDto dto) {
Map<String, Object> fireStationDtoResult = dutyPersonShiftMapper.getFireTeamBySequenceNbr(Long.parseLong(dto.getFirstAidId()));
if(fireStationDtoResult==null || !fireStationDtoResult.containsKey("name")) {
throw new RuntimeException("此120急救站不存在");
throw new BadRequest("此120急救站不存在");
}
dto.setFirstAid(fireStationDtoResult.get("name").toString());
Map<String, Object> map = Bean.BeantoMap(dto);
......@@ -66,14 +63,9 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
List<Object> detailList = new ArrayList<Object>();
for (Map<String, Object> map : equipmentList) {
List<Object> resultList = new ArrayList<Object>();
//LinkedHashMap<String, Object> titleMap_1 = new LinkedHashMap<String, Object>();
//titleMap_1.put("120急救站", map.get("firstAid").toString());
resultList.add( map.get("firstAid").toString());
// LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>();
// if(map.containsKey("teamName") && map.get("teamName") != null){
// titleMap_2.put("单位/部门", map.get("teamName").toString());
// }
// resultList.add(titleMap_2);
String carId = map.get("firstAidId").toString();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId);
......@@ -84,12 +76,6 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
// List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
// if (dutyList != null && dutyList.size() > 0) {
// for (Map<String, Object> dutyDetail : dutyList) {
// if (!dutyDetail.containsKey("name")) {
// continue;
// }
// 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper
.getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds,
......@@ -97,20 +83,15 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue;
}
// LinkedHashMap<String, Object> infoMap_1 = new LinkedHashMap<String, Object>();
// infoMap_1.put(dutyDetail.get("name").toString(), "");
// resultList.add(infoMap_1);
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 = new LinkedHashMap<String, Object>();
// infoMap_2.put(specify.get("postTypeName").toString(), specify.get("userName").toString());
// resultList.add(infoMap_2);
if( specify.containsKey("postTypeName")&& specify.get("postTypeName")!=null && specify.containsKey("userName")&& specify.get("userName")!=null ) {
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
if( specify.containsKey(POSTTYPENAME)&& specify.get(POSTTYPENAME)!=null && specify.containsKey(USERNAME)&& specify.get(USERNAME)!=null ) {
infoMap_2.put(specify.get(POSTTYPENAME).toString(),specify.get(USERNAME).toString());
resultList.add(infoMap_2);
}
// }
//
// }
}
}
detailList.add(resultList);
......@@ -128,7 +109,7 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
List<String> companyNameList = new ArrayList<String>();
String firstAidCompanyId = dutyPersonShiftMapper.getFirstAidCompanyId();
if (firstAidCompanyId != "" && firstAidCompanyId != null){
if (!"".equals(firstAidCompanyId) && firstAidCompanyId != null){
ids.add(firstAidCompanyId);
OrgUsr companyDetail = orgUsrServiceImpl.getDetailById(Long.parseLong(firstAidCompanyId));
String companyNameString = companyDetail.getBizOrgName()+ "@" +companyDetail.getSequenceNbr();
......@@ -144,7 +125,7 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
String userNameString =m.getBizOrgName()+ "@" +m.getSequenceNbr();
userNameList.add(userNameString);
});
detailMap.put("userName", userNameList);
detailMap.put(USERNAME, userNameList);
}
//单位默认为 消防救援保障部,不可编辑。
......@@ -157,7 +138,7 @@ public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements ID
dataDicSimpleList.add(dataDic);
});
detailMap.put("postTypeName",dataDicSimpleList);
detailMap.put(POSTTYPENAME,dataDicSimpleList);
List<Map<String, Object>> list = dutyPersonShiftMapper.getFirstAidForTypeCodeAndCompanyId(
Long.parseLong(firstAidCompanyId));
list.stream().forEach(m -> {
......
......@@ -10,6 +10,7 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
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;
......@@ -44,11 +45,17 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
@Autowired
EquipFeignClient equipFeign;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
@Override
private static final String USERNAME="userName";
private static final String DEPTID="deptId";
private static final String DEPTNAME="deptName";
private static final String POSTTYPENAME="postTypeName";
private static final String WXXFZ="微型消防站";
private static final String VALUE="value";
@Override
public String getGroupCode(){
return "dutyPerson";
}
......@@ -240,15 +247,15 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
for(DynamicFormInstance t : instances) {
if("userId".equals(t.getFieldCode())) {
dto.setUserId(t.getFieldValue());
} else if("userName".equals(t.getFieldCode())) {
} else if(USERNAME.equals(t.getFieldCode())) {
dto.setUserName(t.getFieldValue());
} else if("deptId".equals(t.getFieldCode())) {
} else if(DEPTID.equals(t.getFieldCode())) {
dto.setDeptId(t.getFieldValue());
} else if("deptName".equals(t.getFieldCode())) {
} else if(DEPTNAME.equals(t.getFieldCode())) {
dto.setDeptName(t.getFieldValue());
} else if("postType".equals(t.getFieldCode())) {
dto.setPostType(t.getFieldValue());
} else if("postTypeName".equals(t.getFieldCode())) {
} else if(POSTTYPENAME.equals(t.getFieldCode())) {
dto.setPostTypeName(t.getFieldValue());
} else if("dutyArea".equals(t.getFieldCode())) {
dto.setDutyArea(t.getFieldValue());
......@@ -277,13 +284,13 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
List<Object> fieldsList= new ArrayList<Object>();
List<Object>infoList= new ArrayList<Object>();
LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
map.put("name", "微型消防站");
map.put("value",i.get("deptName").toString());
map.put("name", WXXFZ);
map.put(VALUE,i.get(DEPTNAME).toString());
map.put("id","1");
fieldsList.add(map);
map.clear();
map.put("name", "微型消防站");
map.put("value",i.get("deptName").toString());
map.put("name", WXXFZ);
map.put(VALUE,i.get(DEPTNAME).toString());
});
......@@ -295,26 +302,25 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String 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= JSONArray.parseArray(ssString, Map.class);
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", "微型消防站");
map.put("value",i.get("carName").toString());
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", "微型消防站");
map1.put("value",i.get("teamName").toString());
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);
}
System.out.println("ssssssssss");
});
......@@ -342,7 +348,7 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getNewEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "deptId", "deptName", "result.deptId");
this.getGroupCode(), DEPTID, DEPTNAME, "result.deptId");
if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) {
return null;
}
......@@ -350,10 +356,10 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
for (Map<String, Object> map : equipmentList) {
List<Object> resultList = new ArrayList<Object>();
LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>();
if(map.containsKey("deptName") && map.get("deptName") != null){
resultList.add( map.get("deptName").toString());
if(map.containsKey(DEPTNAME) && map.get(DEPTNAME) != null){
resultList.add( map.get(DEPTNAME).toString());
}
String carId = map.get("deptId").toString();
String carId = map.get(DEPTID).toString();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId);
if (instanceMap == null) {
......@@ -372,8 +378,8 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
}
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 = new LinkedHashMap<String, Object>();
if( specify.containsKey("postTypeName")&& specify.get("postTypeName")!=null && specify.containsKey("userName")&& specify.get("userName")!=null ) {
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
if( specify.containsKey(POSTTYPENAME)&& specify.get(POSTTYPENAME)!=null && specify.containsKey(USERNAME)&& specify.get(USERNAME)!=null ) {
infoMap_2.put(specify.get(POSTTYPENAME).toString(),specify.get(USERNAME).toString());
resultList.add(infoMap_2);
}
}
......
......@@ -8,6 +8,7 @@ import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import org.springframework.beans.BeanUtils;
......@@ -114,8 +115,7 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
queryWrappercolumnMap.orderByAsc("sort_num");
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrappercolumnMap);
// List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName"
// , "getParent", null);
List<MenuFrom> menus = TreeParser.getTreexin(null, list, DataDictionary.class.getName(), "getCode", 0,
......@@ -149,7 +149,7 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
String type = ObjectUtils.isEmpty(columnConfigJson) ? "" : columnConfigJson.get("type").toString();
switch (type) {
case "custom":
List<SelectItem> selectItems = JSONArray.parseArray(columnConfigJson.get("data").toString(), SelectItem.class);
List<SelectItem> selectItems = JSON.parseArray(columnConfigJson.get("data").toString(), SelectItem.class);
vo = new DynamicFormInitDto(dynamicForm.getFieldCode(), dynamicForm.getFieldName(),
dynamicForm.getFieldType(), new SelectItems(selectItems), dynamicForm.getColumnConfig().toJSONString());
dynamicFormValue = new DynamicFormInstanceDto();
......
......@@ -46,6 +46,9 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
@Autowired
HttpServletRequest request;
private static final String QUERYSTRATEGY= "queryStrategy";
private static final String FIELDCODE= "fieldCode";
/**
* 分页查询
*/
......@@ -103,7 +106,7 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
List<DynamicFormInstance> list = this.queryByInstanceId(instanceId);
if (!CollectionUtils.isEmpty(list)) {
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> instanceMap = Bean.listToMap(list, "fieldCode", "fieldValue", DynamicFormInstance.class);
Map<String, Object> instanceMap = Bean.listToMap(list, FIELDCODE, "fieldValue", DynamicFormInstance.class);
for (DynamicFormColumn optionModel : columns) {
Optional<DynamicFormInstance> first = list.stream().filter(i -> i.getFieldCode().equals(optionModel.getFieldCode())).findFirst();
if (first.isPresent()){
......@@ -132,19 +135,19 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
public IPage<Map<String, Object>> pageList(int current, int size, String groupCode) {
Map<String, String> params = this.getRequestParamMap();
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
Page page = new Page();
Map<String, Object> fieldCodes = Bean.listToMap(columns, FIELDCODE, QUERYSTRATEGY, DynamicFormColumn.class);
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
if (current > 0){
page.setCurrent((long) (current - 1) *size);
page.setSize(size);
}
if (!params.isEmpty()&&params !=null){
if (!params.get("sort").isEmpty() && params.get("sort") != null){
if (!params.isEmpty()&&!params.get("sort").isEmpty() && params.get("sort") != null){
String[] sorts = params.get("sort").split(",");
params.put("date",sorts[0]);
params.put("lift",sorts[1]);
}
}
return this.getBaseMapper().pageList(page, RequestContext.getAppKey(), fieldCodes, groupCode, params);
}
// 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14
......@@ -155,8 +158,8 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
params.put("endTime", endDate);
}
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
Page page = new Page(current, size);
Map<String, Object> fieldCodes = Bean.listToMap(columns, FIELDCODE, QUERYSTRATEGY, DynamicFormColumn.class);
Page<Map<String, Object>> page = new Page<Map<String, Object>>(current, size);
return this.getBaseMapper().pageListNew(page, RequestContext.getAppKey(), fieldCodes, groupCode, params, beginDate, endDate);
}
......@@ -166,15 +169,15 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
public IPage<Map<String, Object>> pageList(int current, int size, String groupCode, Map<String, String> params) {
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
Page page = new Page(current, size);
Map<String, Object> fieldCodes = Bean.listToMap(columns, FIELDCODE, QUERYSTRATEGY, DynamicFormColumn.class);
Page<Map<String, Object>> page = new Page<Map<String, Object>>(current, size);
return this.getBaseMapper().pageList(page, RequestContext.getAppKey(), fieldCodes, groupCode, params);
}
public List<Map<String, Object>> listAll(String groupCode) {
Map<String, String> params = this.getRequestParamMap();
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
Map<String, Object> fieldCodes = Bean.listToMap(columns, FIELDCODE, QUERYSTRATEGY, DynamicFormColumn.class);
return this.getBaseMapper().listAll(RequestContext.getAppKey(), fieldCodes, groupCode, params);
}
......
......@@ -36,9 +36,6 @@ public class ESOrgUsrService {
private OrgUsrServiceImpl orgUsrServiceImpl;
public void init() throws Exception {
// elasticsearchTemplate.deleteIndex(ESOrgUsrDto.class);
// elasticsearchTemplate.createIndex(ESOrgUsrDto.class);
// elasticsearchTemplate.putMapping(ESOrgUsrDto.class);
//初始化ES,重建索引
initEs();
}
......@@ -70,10 +67,6 @@ public class ESOrgUsrService {
public void saveAll(List<OrgUsr> orgUsrs) throws Exception {
if (!ValidationUtil.isEmpty(orgUsrs)) {
// for (OrgUsr orgUsr : orgUsrs) {
// this.saveAlertCalledToES(orgUsr);
// }
this.saveAlertCalledToES(orgUsrs);
}
......@@ -130,12 +123,13 @@ public class ESOrgUsrService {
//设置模糊搜索
if (orgUsr.getBizOrgName() != null) {
queryBuilder = QueryBuilders.matchQuery("bizOrgName", orgUsr.getBizOrgName());
Iterable<ESOrgUsrDto> search = esOrgUsrDtoRepository.search(queryBuilder);
if (!search.iterator().hasNext()) {
esOrgUsrDto.setBizOrgName(orgUsr.getBizOrgName());
esOrgUsrDtoRepository.save(esOrgUsrDto);
}
}
Iterable<ESOrgUsrDto> search = esOrgUsrDtoRepository.search(queryBuilder);
if (!search.iterator().hasNext()) {
esOrgUsrDto.setBizOrgName(orgUsr.getBizOrgName());
esOrgUsrDtoRepository.save(esOrgUsrDto);
}
} catch (Exception e) {
e.printStackTrace();
}
......@@ -164,16 +158,18 @@ public class ESOrgUsrService {
public Set<ESOrgUsrDto> queryByKeys(String name) {
//创建builder
FuzzyQueryBuilder queryBuilder = null;
Set<ESOrgUsrDto> list = new LinkedHashSet<>();
//设置模糊搜索
if (name != null) {
queryBuilder = QueryBuilders.fuzzyQuery("bizOrgName", name);
Iterable<ESOrgUsrDto> search = esOrgUsrDtoRepository.search(queryBuilder);
search.forEach(esOrgUsrDto -> {
list.add(esOrgUsrDto);
});
}
Iterable<ESOrgUsrDto> search = esOrgUsrDtoRepository.search(queryBuilder);
Set<ESOrgUsrDto> list = new LinkedHashSet<>();
search.forEach(esOrgUsrDto -> {
list.add(esOrgUsrDto);
});
return list;
......
......@@ -163,7 +163,6 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
* 根据FaultId查询
*/
public List<FailureAudit> findByfaultId(Long faultId) {
Page<FailureAudit> page = new Page<>();
QueryWrapper<FailureAudit> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("fault_id", faultId).orderByDesc("audit_time");
return baseMapper.selectList(queryWrapper);
......
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