Commit f65b98a2 authored by tianbo's avatar tianbo

Merge branch 'developer' into developer-latentDanger

# Conflicts: # amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IOrgUsrService.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
parents b8bbe044 bc3c95c7
package com.yeejoin.amos.boot.module.common.api.dto;
import java.io.Serializable;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "DutyFireFightingDto", description = "微型消防站值班")
public class DutyFireFightingDto implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "用户id")
private String userId;
@ApiModelProperty(value = "用户名称")
private String userName;
@ApiModelProperty(value = "单位ID")
private String teamId;
@ApiModelProperty(value = "单位名称")
private String teamName;
@ApiModelProperty(value = "岗位id")
private String postType;
@ApiModelProperty(value = "岗位名称")
private String postTypeName;
@ApiModelProperty(value = "值班信息")
private List<DutyPersonShiftDto> dutyShift;
@ApiModelProperty(value = "值班开始时间")
private String startTime;
@ApiModelProperty(value = "值班结束时间")
private String endTime;
@ApiModelProperty(value = "微型消防站")
private String fireFighting;
@ApiModelProperty(value = "微型消防站Id")
private String fireFightingId;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import java.io.Serializable;
import java.util.List;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "DutyFireFightingExcleDto", description = "微型消防站值班")
public class DutyFireFightingExcleDto implements Serializable{
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "序号", index = 0)
@ApiModelProperty(value = "序号")
private Integer number;
@ExcelIgnore
@ApiModelProperty(value = "单位ID")
private String teamId;
@ExcelProperty(value = "单位名称", index = 1)
@ApiModelProperty(value = "单位名称")
private String teamName;
@ExcelIgnore
@ApiModelProperty(value = "用户id")
private String userId;
@ExcelProperty(value = "用户名称", index = 2)
@ApiModelProperty(value = "用户名称")
private String userName;
// @ExcelIgnore
// @ApiModelProperty(value = "部门id")
// private String deptId;
// @ExcelIgnore
// @ApiModelProperty(value = "部门名称")
// private String deptName;
@ExcelIgnore
@ApiModelProperty(value = "岗位id")
private String postType;
@ExcelProperty(value = "岗位", index = 3)
@ApiModelProperty(value = "岗位名称")
private String postTypeName;
@ExcelProperty(value = "微型消防站", index = 4)
@ApiModelProperty(value = "微型消防站")
private String fireFighting;
@ExcelIgnore
@ApiModelProperty(value = "微型消防站Id")
private String fireFightingId;
@ExcelIgnore
@ApiModelProperty(value = "值班信息")
private List<DutyPersonShiftDto> dutyShift;
@ExcelIgnore
@ApiModelProperty(value = "值班开始时间")
private String startTime;
@ExcelIgnore
@ApiModelProperty(value = "值班结束时间")
private String endTime;
}
...@@ -63,48 +63,51 @@ public class FireExpertsDto extends BaseDto { ...@@ -63,48 +63,51 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "政治面貌") @ApiModelProperty(value = "政治面貌")
private String politicalOutlook; private String politicalOutlook;
@ExplicitConstraint(indexNum = 8, sourceClass = CommonExplicitConstraint.class, method = "getCitys") //固定下拉内容 // @ExplicitConstraint(indexNum = 8, sourceClass = CommonExplicitConstraint.class, method = "getCitys") //固定下拉内容
@ExcelProperty(value = "籍贯", index = 8) @ExcelIgnore
// @ExcelProperty(value = "籍贯", index = 8)
@ApiModelProperty(value = "籍贯") @ApiModelProperty(value = "籍贯")
private String nativePlace; private String nativePlace;
// @ExplicitConstraint(indexNum = 9, sourceClass = RoleNameExplicitConstraint.class, method = "getAdministrativeDivisions") //固定下拉内容 // @ExplicitConstraint(indexNum = 9, sourceClass = RoleNameExplicitConstraint.class, method = "getAdministrativeDivisions") //固定下拉内容
@ExplicitConstraint(indexNum = 8, sourceClass = CommonExplicitConstraint.class, method = "getCitys") //固定下拉内容
@ExcelProperty(value = "籍贯/户口所在地详细地址", index = 9) @ExcelProperty(value = "籍贯/户口所在地详细地址", index = 8)
@ApiModelProperty(value = "籍贯/户口所在地详细地址") @ApiModelProperty(value = "籍贯/户口所在地详细地址")
private String nativePlaceVal; private String nativePlaceVal;
@ExplicitConstraint(indexNum = 10,sourceClass = CommonExplicitConstraint.class,method ="getCitys") // @ExplicitConstraint(indexNum = 10,sourceClass = CommonExplicitConstraint.class,method ="getCitys")
@ApiModelProperty(value = "现居住地") @ApiModelProperty(value = "现居住地")
@ExcelProperty(value = "现居住地", index = 10) @ExcelIgnore
//@ExcelProperty(value = "现居住地", index = 10)
private String residence; private String residence;
// @ExcelIgnore
@ExplicitConstraint(indexNum =11,sourceClass = CommonExplicitConstraint.class,method ="getCitys") //@ExplicitConstraint(indexNum =11,sourceClass = CommonExplicitConstraint.class,method ="getCitys")
@ExcelProperty(value = "现居住地", index = 11) @ExcelProperty(value = "现居住地", index = 10)
@ApiModelProperty(value = "居住地详情") @ApiModelProperty(value = "居住地详情")
private String residenceDetails; private String residenceDetails;
@ExcelProperty(value = "现居住地详细地址", index = 12) @ExplicitConstraint(indexNum =9,sourceClass = CommonExplicitConstraint.class,method ="getCitys")
@ExcelProperty(value = "现居住地", index = 9)
@ApiModelProperty(value = "现居住地详细地址") @ApiModelProperty(value = "现居住地详细地址")
private String residenceDetailVal; private String residenceDetailVal;
@ExcelProperty(value = "办公电话", index = 13) @ExcelProperty(value = "办公电话", index = 11)
@ApiModelProperty(value = "办公电话") @ApiModelProperty(value = "办公电话")
private String officePhone; private String officePhone;
@ExcelProperty(value = "移动电话", index = 14) @ExcelProperty(value = "移动电话", index = 12)
@ApiModelProperty(value = "移动电话") @ApiModelProperty(value = "移动电话")
private String mobilePhone; private String mobilePhone;
@ExplicitConstraint(type = "XLLX", indexNum = 15, sourceClass = CommonExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "XLLX", indexNum = 13, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "最高学历", index = 15) @ExcelProperty(value = "最高学历", index = 13)
@ApiModelProperty(value = "最高学历") @ApiModelProperty(value = "最高学历")
private String highestEducation; private String highestEducation;
@ExplicitConstraint(type = "GWMC", indexNum = 16, sourceClass = CommonExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "GWMC", indexNum = 14, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位名称", index = 16) @ExcelProperty(value = "岗位名称", index = 14)
@ApiModelProperty(value = "岗位名称") @ApiModelProperty(value = "岗位名称")
private String jobs; private String jobs;
...@@ -112,8 +115,8 @@ public class FireExpertsDto extends BaseDto { ...@@ -112,8 +115,8 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "岗位名称code") @ApiModelProperty(value = "岗位名称code")
private String jobsCode; private String jobsCode;
@ExplicitConstraint(type = "ZJLY", indexNum = 17, sourceClass = CommonExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "ZJLY", indexNum = 15, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防专家领域", index = 17) @ExcelProperty(value = "消防专家领域", index = 15)
@ApiModelProperty(value = "消防专家领域") @ApiModelProperty(value = "消防专家领域")
private String expert; private String expert;
...@@ -147,7 +150,7 @@ public class FireExpertsDto extends BaseDto { ...@@ -147,7 +150,7 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "消防机构name") @ApiModelProperty(value = "消防机构name")
private Long fireTeamName; private Long fireTeamName;
@ExcelProperty(value = "备注", index = 18) @ExcelProperty(value = "备注", index = 16)
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String note; private String note;
......
...@@ -75,4 +75,7 @@ public class OrgUsrDto extends BaseDto { ...@@ -75,4 +75,7 @@ public class OrgUsrDto extends BaseDto {
@ApiModelProperty(value = "动态表单值") @ApiModelProperty(value = "动态表单值")
private List<DynamicFormInstance> dynamicFormValue; private List<DynamicFormInstance> dynamicFormValue;
@ApiModelProperty(value = "动态表单值-DTO类型")
private List<DynamicFormInstanceDto> dynamicFormValueDto;
} }
...@@ -65,8 +65,8 @@ public class WaterResourceDto extends BaseDto { ...@@ -65,8 +65,8 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "管理单位id") @ApiModelProperty(value = "管理单位id")
private Long managementUnitId; private Long managementUnitId;
@ExplicitConstraint(indexNum = 5, sourceClass = CommonExplicitConstraint.class, method = "getCompanyList") @ExplicitConstraint(indexNum = 9, sourceClass = CommonExplicitConstraint.class, method = "getCompanyList")
@ExcelProperty(value = "管理单位", index = 5) @ExcelProperty(value = "管理单位", index = 9)
@ApiModelProperty(value = "管理单位") @ApiModelProperty(value = "管理单位")
private String managementUnit; private String managementUnit;
...@@ -74,8 +74,8 @@ public class WaterResourceDto extends BaseDto { ...@@ -74,8 +74,8 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "维保单位id") @ApiModelProperty(value = "维保单位id")
private Long maintenanceUnitId; private Long maintenanceUnitId;
@ExplicitConstraint(indexNum = 6, sourceClass = CommonExplicitConstraint.class, method = "getCompanyList") @ExplicitConstraint(indexNum = 10, sourceClass = CommonExplicitConstraint.class, method = "getCompanyList")
@ExcelProperty(value = "维保单位", index = 6) @ExcelProperty(value = "维保单位", index = 10)
@ApiModelProperty(value = "维保单位") @ApiModelProperty(value = "维保单位")
private String maintenanceUnit; private String maintenanceUnit;
...@@ -103,11 +103,11 @@ public class WaterResourceDto extends BaseDto { ...@@ -103,11 +103,11 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "实景图") @ApiModelProperty(value = "实景图")
private String realityImg; private String realityImg;
@ExcelProperty(value = "联系人姓名", index = 9) @ExcelProperty(value = "联系人姓名", index = 41)
@ApiModelProperty(value = "联系人姓名") @ApiModelProperty(value = "联系人姓名")
private String contactUser; private String contactUser;
@ExcelProperty(value = "联系人电话", index = 10) @ExcelProperty(value = "联系人电话", index = 42)
@ApiModelProperty(value = "联系人电话") @ApiModelProperty(value = "联系人电话")
private String contactPhone; private String contactPhone;
...@@ -143,7 +143,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -143,7 +143,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "水源可用状态类别代码") @ApiModelProperty(value = "水源可用状态类别代码")
private String statusCode; private String statusCode;
@ExplicitConstraint(type = "SYKYZT", indexNum = 12, sourceClass = CommonExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "SYZT", indexNum = 12, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "水源可用状态", index = 12) @ExcelProperty(value = "水源可用状态", index = 12)
@ApiModelProperty(value = "水源可用状态类别名称") @ApiModelProperty(value = "水源可用状态类别名称")
private String status; private String status;
...@@ -160,7 +160,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -160,7 +160,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消防给水管网形式类型代码") @ApiModelProperty(value = "消防给水管网形式类型代码")
private String pipeTypeCode; private String pipeTypeCode;
@ExplicitConstraint(type = "XFJSGWXS", indexNum = 15, sourceClass = CommonExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "XFJSGW", indexNum = 15, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防给水管网形式", index = 15) @ExcelProperty(value = "消防给水管网形式", index = 15)
@ApiModelProperty(value = "消防给水管网形式") @ApiModelProperty(value = "消防给水管网形式")
private String pipeTypeName; private String pipeTypeName;
...@@ -254,11 +254,19 @@ public class WaterResourceDto extends BaseDto { ...@@ -254,11 +254,19 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "四季变化简要情况") @ApiModelProperty(value = "四季变化简要情况")
private String seasonChangeInfo; private String seasonChangeInfo;
@ExplicitConstraint(indexNum = 32, source = {"1", "0"}) //固定下拉内容 // @ExplicitConstraint(indexNum = 32, source = {"0", "1"}) //固定下拉内容
@ExcelProperty(value = "有无枯水期", index = 32) // @ExcelProperty(value = "有无枯水期", index = 32)
@ExcelIgnore
@ApiModelProperty(value = "有无枯水期") @ApiModelProperty(value = "有无枯水期")
private Boolean hasDrySeason; private Boolean hasDrySeason;
@ExplicitConstraint(indexNum = 32, source = {"有", "无"}) //固定下拉内容
@ExcelProperty(value = "有无枯水期", index = 32)
@ApiModelProperty(value = "有无枯水期")
private String hasDrySeasonType;
@ExcelProperty(value = "枯水期跨度简要情况", index = 33) @ExcelProperty(value = "枯水期跨度简要情况", index = 33)
@ApiModelProperty(value = "枯水期跨度简要情况") @ApiModelProperty(value = "枯水期跨度简要情况")
private String dryPeriodSpan; private String dryPeriodSpan;
...@@ -305,8 +313,8 @@ public class WaterResourceDto extends BaseDto { ...@@ -305,8 +313,8 @@ public class WaterResourceDto extends BaseDto {
private Long equipId; private Long equipId;
@ApiModelProperty("设施定义名称") @ApiModelProperty("设施定义名称")
@ExcelProperty(value = "设施定义名称", index = 41) @ExcelProperty(value = "设施定义名称", index = 5)
@ExplicitConstraint(indexNum = 41, sourceClass = CommonExplicitConstraint.class, method = "getEquipDefinition") @ExplicitConstraint(indexNum = 5, sourceClass = CommonExplicitConstraint.class, method = "getEquipDefinition")
private String equipName; private String equipName;
@ExcelIgnore @ExcelIgnore
...@@ -324,7 +332,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -324,7 +332,7 @@ public class WaterResourceDto extends BaseDto {
private String equipCode; private String equipCode;
@ApiModelProperty("维保周期") @ApiModelProperty("维保周期")
@ExcelProperty(value = "维保周期(月)", index = 42) @ExcelProperty(value = "维保周期(月)", index = 6)
private String maintenancePeriod; private String maintenancePeriod;
......
package com.yeejoin.amos.boot.module.common.api.excel;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.DataValidationHelper;
import org.apache.poi.ss.usermodel.Name;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
public class TemplateDynamicCellWriteHandlerDate implements SheetWriteHandler{
/**
* 构造器注入
*/
private List<Map<Integer, String[]>> explicitListConstraintMap = new ArrayList<Map<Integer, String[]>>();
public TemplateDynamicCellWriteHandlerDate(List<Map<Integer, String[]>> explicitListConstraintMap) {
this.explicitListConstraintMap = explicitListConstraintMap;
}
/**
* 避免生成的导入模板下拉值获取不到
*/
private static final Integer LIMIT_NUMBER = 0;
/**
* 返回excel列标A-Z-AA-ZZ
*
* @param num 列数
* @return java.lang.String
*/
private String getExcelLine(int num) {
String line = "";
int first = num / 26;
int second = num % 26;
if (first > 0) {
line = (char) ('A' + first - 1) + "";
}
line += (char) ('A' + second) + "";
return line;
}
@Override
public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
// TODO Auto-generated method stub
}
@Override
public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
if(explicitListConstraintMap!=null) {
// 这里可以对cell进行任何操作
Sheet sheet = writeSheetHolder.getSheet();
DataValidationHelper helper = sheet.getDataValidationHelper();
for(int index =0 ; index < explicitListConstraintMap.size() ;index++ ) {
int startIndex = index+1;
explicitListConstraintMap.get(index).forEach((k, v)->{
// 设置下拉单元格的首行 末行 首列 末列
CellRangeAddressList rangeList = new CellRangeAddressList(startIndex, startIndex, k, k);
// 如果下拉值总数大于100,则使用一个新sheet存储,避免生成的导入模板下拉值获取不到
if (v.length > LIMIT_NUMBER) {
//定义sheet的名称
//1.创建一个隐藏的sheet 名称为 hidden + k
String sheetName = "hidden" +startIndex + k;
Workbook workbook = writeWorkbookHolder.getWorkbook();
Sheet hiddenSheet = workbook.createSheet(sheetName);
for (int i = 0, length = v.length; i < length; i++) {
// 开始的行数i,列数k
hiddenSheet.createRow(i).createCell(k).setCellValue(v[i]);
}
Name category1Name = workbook.createName();
category1Name.setNameName(sheetName);
String excelLine = getExcelLine(k);
// =hidden!$H:$1:$H$50 sheet为hidden的 H1列开始H50行数据获取下拉数组
String refers = "=" + sheetName + "!$" + excelLine + "$1:$" + excelLine + "$" + (v.length + 1);
// 将刚才设置的sheet引用到你的下拉列表中
DataValidationConstraint constraint = helper.createFormulaListConstraint(refers);
DataValidation dataValidation = helper.createValidation(constraint, rangeList);
if(dataValidation instanceof XSSFDataValidation){
dataValidation.setSuppressDropDownArrow(true);
dataValidation.setShowErrorBox(true);
}else{
dataValidation.setSuppressDropDownArrow(false);
}
writeSheetHolder.getSheet().addValidationData(dataValidation);
// 设置存储下拉列值得sheet为隐藏
int hiddenIndex = workbook.getSheetIndex(sheetName);
if (!workbook.isSheetHidden(hiddenIndex)) {
workbook.setSheetHidden(hiddenIndex, true);
}
}
});
}
}
}
}
package com.yeejoin.amos.boot.module.common.api.service; package com.yeejoin.amos.boot.module.common.api.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import java.text.ParseException; import java.text.ParseException;
import java.util.List; import java.util.List;
...@@ -86,4 +87,33 @@ public interface IDutyCommonService { ...@@ -86,4 +87,33 @@ public interface IDutyCommonService {
* @return * @return
*/ */
List<Long> getDutyShiftIdList(); List<Long> getDutyShiftIdList();
/**
* 添加动态表单数据保存的方法,返回保存数据的instanceid
* @param userId
* @param map
* @param groupCode
* @return
*/
public Long excuteDynamicFormInstance( String userId,Map<String, Object> map, String groupCode);
/**
* 修改动态表单数据
* @param groupCode
* @param instanceId
* @param map
*/
public void updateDynamicFormInstance(String groupCode,Long instanceId, Map<String, Object> map) ;
/**
* 保存值班人的信息---
* @param instanceId
* @param dutyShift
* @param startTime
*/
public void saveDutyPersonShiftDetail( Long instanceId ,List<DutyPersonShiftDto> dutyShift ,String startTime) ;
/**
* 添加值班人的信息 可以保存空信息
* @param instanceId
* @param dutyShiftList
*/
public void insertPersonShift(Long instanceId, List<DutyPersonShiftDto> dutyShiftList);
} }
package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
public interface IDutyFireFightingService extends IDutyCommonService {
/**
* 值班信息保存
* @param DutyFireFightingDto 对象
* @return List<DutyCarDto>
*/
DutyFireFightingDto save(DutyFireFightingDto dto);
/**
* 更新
* @param instanceId 实例id
* @param DutyFireFightingDto 业务对象
* @return List<DutyCarDto>
*/
DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto);
}
...@@ -224,4 +224,11 @@ public interface IOrgUsrService { ...@@ -224,4 +224,11 @@ public interface IOrgUsrService {
* @return * @return
*/ */
String getAmosIdByOrgUserId(String orgUserId) throws Exception; String getAmosIdByOrgUserId(String orgUserId) throws Exception;
/**
* 查询目标公司下所有人员的简要信息,数据包含:所在公司id和name ,人员id和name,岗位id和name
* @param ids
* @return
*/
List<Map<String, Object>> getPersonDetailByCompanyIds(List<String> ids);
} }
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
r.contact_user, r.contact_user,
r.contact_phone, r.contact_phone,
r.equip_name, r.equip_name,
r.longitude,
r.latitude,
r.equip_category_name, r.equip_category_name,
r.equip_code, r.equip_code,
r.maintenance_period, r.maintenance_period,
...@@ -45,6 +47,7 @@ ...@@ -45,6 +47,7 @@
rn.quality_situation_info, rn.quality_situation_info,
rn.season_change_info, rn.season_change_info,
rn.has_dry_season, rn.has_dry_season,
(case rn.has_dry_season when 0 then '有' when 1 then '无' end) hasDrySeasonType,
rn.dry_period_span, rn.dry_period_span,
rp.intake_height, rp.intake_height,
rp.elevation_difference, rp.elevation_difference,
......
...@@ -25,8 +25,8 @@ public enum ExcelEnums { ...@@ -25,8 +25,8 @@ public enum ExcelEnums {
// BUG 2455 相关代码 bykongfm // BUG 2455 相关代码 bykongfm
TGRY ("特岗人员", "特岗人员", "com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto","TGRY"),//("TGRY","特岗人员") TGRY ("特岗人员", "特岗人员", "com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto","TGRY"),//("TGRY","特岗人员")
JYZB ("救援装备", "救援装备", "com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto","JYZB"),//("JYZB","救援装备") JYZB ("救援装备", "救援装备", "com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto","JYZB"),//("JYZB","救援装备")
XFZB ("消防装备", "消防装备", "com.yeejoin.amos.boot.module.common.api.dto.EquipmentDetailDownloadTemplateDto","XFZB");//("XFZB","消防装备") XFZB ("消防装备", "消防装备", "com.yeejoin.amos.boot.module.common.api.dto.EquipmentDetailDownloadTemplateDto","XFZB"),//("XFZB","消防装备")
WXXFZB("微型消防站值班", "微型消防站值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingExcleDto","WXXFZB");//("WXXFZB","微型消防站值班")
private String fileName; private String fileName;
private String sheetName; private String sheetName;
private String classUrl; private String classUrl;
......
...@@ -28,7 +28,7 @@ public class DispatchConsultFeedbackDto extends BaseDto { ...@@ -28,7 +28,7 @@ public class DispatchConsultFeedbackDto extends BaseDto {
private String emergencyCall; private String emergencyCall;
@ApiModelProperty(value = "投诉反馈方式") @ApiModelProperty(value = "投诉反馈方式")
private String consultFeedbackType; private String consultFeedbackCode;
@ApiModelProperty(value = "投诉反馈结果") @ApiModelProperty(value = "投诉反馈结果")
private String feedbackResult; private String feedbackResult;
......
...@@ -28,7 +28,7 @@ public class DispatchRepairFeedbackDto extends BaseDto { ...@@ -28,7 +28,7 @@ public class DispatchRepairFeedbackDto extends BaseDto {
private String emergencyCall; private String emergencyCall;
@ApiModelProperty(value = "报修反馈方式") @ApiModelProperty(value = "报修反馈方式")
private String fixFeedbackType; private String fixFeedbackCode;
@ApiModelProperty(value = "报修反馈结果") @ApiModelProperty(value = "报修反馈结果")
private String feedbackResult; private String feedbackResult;
......
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* 微信公众号维修反馈dto 类
*/
@Data
@ApiModel(value="WechatUserFeedbackDto", description="微信公众号上报人反馈DTO")
public class WechatUserFeedbackDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情id")
private Long alertId;
@ApiModelProperty(value = "结果评价")
private String feedBackResult;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "现场照片")
private List<AttachmentDto> imgs;
}
...@@ -19,9 +19,9 @@ public enum AlertStageEnums { ...@@ -19,9 +19,9 @@ public enum AlertStageEnums {
TSZX("962","TSZX", "投诉咨询"), TSZX("962","TSZX", "投诉咨询"),
// 来源类型JQLYLX // 来源类型JQLYLX
DHBJ("963","233","电话报警"), DHBJ("963","96333","电话报警"),
// 来源类型JQLYLX WLJR("1014","WLJR","物联接入"),
GZHSB("972","APPJJ","移动端上报"), APPJJ("1015","APPJJ","移动端上报"),
// 警情阶段 JQJD // 警情阶段 JQJD
JJ("964","JJ","接警"), JJ("964","JJ","接警"),
......
...@@ -22,11 +22,7 @@ public interface ElevatorMapper extends BaseMapper<Elevator> { ...@@ -22,11 +22,7 @@ public interface ElevatorMapper extends BaseMapper<Elevator> {
Long sequenceNbr, Long sequenceNbr,
int current, int size); int current, int size);
List<ElevatorWlInfoDto> queryElevatorListDetails(String address, List<ElevatorWlInfoDto> queryElevatorListDetails(
String registerCode,
Integer rescueCode,
String type,
Integer dealStatus,
Long sequenceNbr Long sequenceNbr
); );
......
...@@ -5,8 +5,10 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto; ...@@ -5,8 +5,10 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.MainPersonDto; import com.yeejoin.amos.boot.module.tzs.api.dto.MainPersonDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatUserFeedbackDto;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -46,5 +48,7 @@ public interface IDispatchTaskService { ...@@ -46,5 +48,7 @@ public interface IDispatchTaskService {
List<MainPersonDto> todayTaskPerson(); List<MainPersonDto> todayTaskPerson();
WechatMyBussinessDto saveUserFeed(WechatUserFeedbackDto wechatUserFeedbackDto);
} }
...@@ -323,7 +323,7 @@ ...@@ -323,7 +323,7 @@
</select> </select>
<select id="getImportantEventDetail" resultType="java.util.Map"> <select id="getImportantEventDetail" resultType="java.util.Map">
select tzs.contact_phone,tzs.rec_user_name, select tzs.contact_phone,tzs.rec_user_name,
tzs.type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address, tzs.alert_stage as type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address,
tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time, tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time,
tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id
,te.latitude ,te.region_code ,te.longitude,tzs.injured from ( ,te.latitude ,te.region_code ,te.longitude,tzs.injured from (
...@@ -357,7 +357,7 @@ ...@@ -357,7 +357,7 @@
<select id="getTodayEmergencyDetail" resultType="java.util.Map"> <select id="getTodayEmergencyDetail" resultType="java.util.Map">
select tzs.contact_phone,tzs.rec_user_name, select tzs.contact_phone,tzs.rec_user_name,
tzs.type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address, tzs.alert_stage as type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address,
tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time, tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time,
tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id
,te.latitude ,te.region_code ,te.longitude,tzs.injured from ( ,te.latitude ,te.region_code ,te.longitude,tzs.injured from (
...@@ -396,7 +396,7 @@ ...@@ -396,7 +396,7 @@
union all union all
select tzs.contact_phone,tzs.rec_user_name, select tzs.contact_phone,tzs.rec_user_name,
tzs.type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address, tzs.alert_stage as type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address,
tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time, tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time,
tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id
,te.latitude ,te.region_code ,te.longitude,tzs.injured from ( ,te.latitude ,te.region_code ,te.longitude,tzs.injured from (
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
select select
te.sequence_nbr sequenceNbr, te.sequence_nbr sequenceNbr,
concat(te.province,te.city,te.district) area, concat(te.province,te.city,te.district) area,
te.category, te.device_category category,
te.register_code registerCode, te.register_code registerCode,
te.rescue_code rescueCode, te.rescue_code rescueCode,
te.address , te.address ,
tea.start_date happenTime, te.start_date happenTime,
tea.type , te.type ,
case tea.deal_status case te.deal_status
when '0' then '处置完成' when '0' then '处置完成'
when '1' then '故障发生' when '1' then '故障发生'
when '2' then '发出通知' when '2' then '发出通知'
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
ELSE '' END dealStatus, ELSE '' END dealStatus,
'电梯' categoryName, '电梯' categoryName,
'立信远大科技有限公司' IotServiceProvider '立信远大科技有限公司' IotServiceProvider
from tcb_elevator te inner join tz_elevator_alarm tea on from tz_elevator_alarm te
te.register_code = tea.register_code
where 1=1 where 1=1
<if test="address != null and address != ''"> <if test="address != null and address != ''">
and te.address like CONCAT(CONCAT('%',#{address}),'%') and te.address like CONCAT(CONCAT('%',#{address}),'%')
...@@ -34,14 +33,15 @@ ...@@ -34,14 +33,15 @@
and te.rescue_code like CONCAT(CONCAT('%',#{rescueCode}),'%') and te.rescue_code like CONCAT(CONCAT('%',#{rescueCode}),'%')
</if> </if>
<if test="type != null and type != ''"> <if test="type != null and type != ''">
and tec.type = #{type} and te.type = #{type}
</if> </if>
<if test="dealStatus != null and dealStatus != ''">sequenceNbr <if test="dealStatus != null and dealStatus != ''">
and tec.deal_status = #{dealStatus} and te.deal_status = #{dealStatus}
</if> </if>
<if test="sequenceNbr != null and sequenceNbr != ''"> <if test="sequenceNbr != null and sequenceNbr != ''">
and te.sequence_nbr = #{sequenceNbr} and te.sequence_nbr = #{sequenceNbr}
</if> </if>
group by register_code
order by start_date DESC limit #{current},#{size} order by start_date DESC limit #{current},#{size}
</select> </select>
...@@ -49,13 +49,13 @@ ...@@ -49,13 +49,13 @@
select select
te.sequence_nbr sequenceNbr, te.sequence_nbr sequenceNbr,
concat(te.province,te.city,te.district) area, concat(te.province,te.city,te.district) area,
te.category, te.device_category category,
te.register_code registerCode, te.register_code registerCode,
te.rescue_code rescueCode, te.rescue_code rescueCode,
te.address , te.address ,
tea.start_date happenTime, te.start_date happenTime,
tea.type , te.type ,
case tea.deal_status case te.deal_status
when '0' then '处置完成' when '0' then '处置完成'
when '1' then '故障发生' when '1' then '故障发生'
when '2' then '发出通知' when '2' then '发出通知'
...@@ -65,8 +65,7 @@ ...@@ -65,8 +65,7 @@
ELSE '' END dealStatus, ELSE '' END dealStatus,
'电梯' categoryName, '电梯' categoryName,
'立信远大科技有限公司' IotServiceProvider '立信远大科技有限公司' IotServiceProvider
from tcb_elevator te inner join tz_elevator_alarm tea on from tz_elevator_alarm te
te.register_code = tea.register_code
where 1=1 where 1=1
<if test="sequenceNbr != null and sequenceNbr != ''"> <if test="sequenceNbr != null and sequenceNbr != ''">
and te.sequence_nbr = #{sequenceNbr} and te.sequence_nbr = #{sequenceNbr}
...@@ -77,9 +76,9 @@ ...@@ -77,9 +76,9 @@
select count(1) from ( select count(1) from (
select select
te.sequence_nbr te.sequence_nbr
from tcb_elevator te inner join tz_elevator_alarm tea on from tz_elevator_alarm te
te.register_code = tea.register_code
where 1=1 where 1=1
group by register_code order by start_date desc
) te ) te
</select> </select>
......
...@@ -33,7 +33,7 @@ import java.util.Map; ...@@ -33,7 +33,7 @@ import java.util.Map;
@Api(tags = "值班车辆接口Api") @Api(tags = "值班车辆接口Api")
@RequestMapping(value = "/common/duty-car") @RequestMapping(value = "/common/duty-car")
public class DutyCarController extends BaseController { public class DutyCarController extends BaseController {
@Autowired @Autowired
IDutyCarService iDutyCarService; IDutyCarService iDutyCarService;
......
package com.yeejoin.amos.boot.module.common.biz.controller;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@RestController
@Api(tags = "微型消防站值班接口Api")
@RequestMapping(value = "/common/duty-FireFighting")
public class DutyFireFightingController extends BaseController{
@Autowired
IDutyFireFightingService iDutyFireFightingService;
/**
* 值班列表视图--分页
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page-list")
@ApiOperation(httpMethod = "GET", value = "值班列表视图-分页", notes = "值班列表视图-分页")
public ResponseModel<IPage<Map<String, Object>>> pageList(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate,
@ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@ApiParam(value = "页面大小", required = true) @RequestParam(value = "size") int size) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.pageList(current, size, beginDate, endDate));
}
/**
* 值班列表视图--不分页
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/list")
@ApiOperation(httpMethod = "GET", value = "值班列表视图-不分页", notes = "值班列表视图-不分页")
public ResponseModel list(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.list(null,beginDate, endDate));
}
/**
* 值班月视图
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/statistics-day")
@ApiOperation(httpMethod = "GET", value = "值班月视图", notes = "值班月视图")
public ResponseModel<List<Map<String, Object>>> dutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.statisticsDay(beginDate, endDate));
}
/**
* 调班
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping("/duty-adjust")
@ApiOperation(httpMethod = "POST", value = "调班保存", notes = "调班保存")
public ResponseModel dutyAdjustSave(@RequestBody DutyFireFightingDto dto) {
return ResponseHelper.buildResponse(iDutyFireFightingService.save(dto));
}
/**
* 调班
*
* @param instanceId 实例id
* @param dutyCarDto 业务对象
* @return DutyCarDto
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping("/duty-adjust")
@ApiOperation(httpMethod = "PUT", value = "调班更新", notes = "调班更新")
public ResponseModel dutyAdjustUpdate(
@RequestParam Long instanceId,
@RequestBody DutyFireFightingDto dto) {
return ResponseHelper.buildResponse(iDutyFireFightingService.update(instanceId, dto));
}
/**
* 微型消防站导出
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/exportExcel")
@ApiOperation(httpMethod = "GET", value = "微型消防站导出", notes = "微型消防站导出")
public ResponseModel exportExcel(HttpServletResponse response, @ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.downloadList(beginDate, endDate));
}
/**
* 值班数据删除
*
* @param instanceId 实例id
* @param startTime 开始时间
* @param endTime 结束时间
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping("/{instanceId}/{startTime}/{endTime}")
@ApiOperation(httpMethod = "DELETE", value = "值班数据删除", notes = "值班数据删除")
public ResponseModel deleteDutyData(@PathVariable Long instanceId,@PathVariable String startTime,@PathVariable String endTime) {
if (ValidationUtil.isEmpty(instanceId)
|| ValidationUtil.isEmpty(startTime)
|| ValidationUtil.isEmpty(endTime)){
throw new BadRequest("参数校验失败.");
}
return ResponseHelper.buildResponse(iDutyFireFightingService.deleteDutyData(instanceId, startTime, endTime));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询指定日期值班人信息列表")
@GetMapping("/person/{dutyDay}/list")
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){
return ResponseHelper.buildResponse(iDutyFireFightingService.dayDutyPersonList(dutyDay,shiftId,postType));
}
}
package com.yeejoin.amos.boot.module.common.biz.controller; package com.yeejoin.amos.boot.module.common.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import java.text.ParseException;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import java.util.List;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto; import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -17,11 +23,14 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -17,11 +23,14 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import com.baomidou.mybatisplus.core.metadata.IPage;
import javax.servlet.http.HttpServletResponse; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.text.ParseException; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import java.util.List; import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import java.util.Map;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/** /**
......
...@@ -55,7 +55,7 @@ public class FireExpertsController extends BaseController { ...@@ -55,7 +55,7 @@ public class FireExpertsController extends BaseController {
@Autowired @Autowired
DataDictionaryServiceImpl dataDictionaryService; DataDictionaryServiceImpl dataDictionaryService;
/** /**
...@@ -67,6 +67,9 @@ public class FireExpertsController extends BaseController { ...@@ -67,6 +67,9 @@ public class FireExpertsController extends BaseController {
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增") @ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<FireExpertsDto> save(@RequestBody FireExpertsDto model) { public ResponseModel<FireExpertsDto> save(@RequestBody FireExpertsDto model) {
String expertCode = model.getExpertCode();
DataDictionary zjly = dataDictionaryService.getByCode(expertCode, "ZJLY");
model.setExpert(zjly.getName());
model = fireExpertsServiceImpl.createWithModel(model); model = fireExpertsServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
......
...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.common.biz.controller; ...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import java.util.Arrays; import java.util.Arrays;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -57,6 +59,9 @@ public class FirefightersPostController extends BaseController { ...@@ -57,6 +59,9 @@ public class FirefightersPostController extends BaseController {
@Autowired @Autowired
FirefightersWorkexperienceServiceImpl ifirefightersWorkexperienceService; FirefightersWorkexperienceServiceImpl ifirefightersWorkexperienceService;
@Autowired @Autowired
DataDictionaryServiceImpl dataDictionaryService;
@Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Value("${redis.cache.failure.time}") @Value("${redis.cache.failure.time}")
private long time; private long time;
...@@ -81,6 +86,13 @@ public class FirefightersPostController extends BaseController { ...@@ -81,6 +86,13 @@ public class FirefightersPostController extends BaseController {
queryWrapper.eq("firefighters_id", firefightersDataDto.getFirefightersPost().getFirefightersId()); queryWrapper.eq("firefighters_id", firefightersDataDto.getFirefightersPost().getFirefightersId());
FirefightersPost firefightersPost = iFirefightersPostService.getOne(queryWrapper); FirefightersPost firefightersPost = iFirefightersPostService.getOne(queryWrapper);
/*bug3071 消防人员,专家领域选择子分类时概要信息中专家领域未显示 2021-10-09 chenzhao */
if (firefightersDataDto.getFirefightersPost().getAreasExpertiseCode() != null){
String areasExpertiseCode = firefightersDataDto.getFirefightersPost().getAreasExpertiseCode();
DataDictionary zjly = dataDictionaryService.getByCode(areasExpertiseCode, "ZJLY");
firefightersDataDto.getFirefightersPost().setAreasExpertise(zjly.getName());
}
/*bug3071 消防人员,专家领域选择子分类时概要信息中专家领域未显示 2021-10-09 chenzhao */
if (firefightersPost == null) { if (firefightersPost == null) {
iFirefightersPostService.save(firefightersDataDto.getFirefightersPost()); iFirefightersPostService.save(firefightersDataDto.getFirefightersPost());
} else { } else {
......
...@@ -12,8 +12,10 @@ import com.yeejoin.amos.boot.biz.common.constants.CommonConstant; ...@@ -12,8 +12,10 @@ import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService; import com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -51,6 +53,10 @@ public class OrgUsrController extends BaseController { ...@@ -51,6 +53,10 @@ public class OrgUsrController extends BaseController {
OrgUsrServiceImpl iOrgUsrService; OrgUsrServiceImpl iOrgUsrService;
@Autowired @Autowired
ESOrgUsrService eSOrgUsrService; ESOrgUsrService eSOrgUsrService;
@Autowired
FireTeamMapper fireTeamMapper;
@Autowired @Autowired
EmqKeeper emqKeeper; EmqKeeper emqKeeper;
@Value("${jcs.company.topic.delete}") @Value("${jcs.company.topic.delete}")
...@@ -85,19 +91,16 @@ public class OrgUsrController extends BaseController { ...@@ -85,19 +91,16 @@ public class OrgUsrController extends BaseController {
public ResponseModel<String> deleteById(HttpServletRequest request, @PathVariable Long id) { public ResponseModel<String> deleteById(HttpServletRequest request, @PathVariable Long id) {
// 删除时,只作逻辑删除 // 删除时,只作逻辑删除
// BUG 2741 首先判断是否为公司 如果公司底下有人员不可直接删除 bykongfm // BUG 2741 首先判断是否为公司 如果公司底下有人员不可直接删除 bykongfm
OrgUsr tempOrg = iOrgUsrService.getById(id.toString());
if(tempOrg.getBizOrgType().equals("COMPANY")) {
List<OrgUsr> tempList = iOrgUsrService.list(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getParentId,id).eq(OrgUsr::getIsDelete,false));
if(tempList.size() > 0) {
return ResponseHelper.buildResponse("-1");
}
}
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 start //bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 start
if(tempOrg.getBizOrgType().equals("DEPARTMENT")) { OrgUsr tempOrg = iOrgUsrService.getById(id.toString());
if(tempOrg.getBizOrgType().equals("COMPANY") || tempOrg.getBizOrgType().equals("DEPARTMENT")) {
List<OrgUsr> tempList = iOrgUsrService.list(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getParentId,id).eq(OrgUsr::getIsDelete,false)); List<OrgUsr> tempList = iOrgUsrService.list(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getParentId,id).eq(OrgUsr::getIsDelete,false));
if(tempList.size() > 0) { /*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-09 start*/
List<FireTeam> fireTeams = fireTeamMapper.listFireTeamById(id);
if(tempList.size() > 0 || fireTeams.size() > 0 ) {
return ResponseHelper.buildResponse("-1"); return ResponseHelper.buildResponse("-1");
} }
/*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-09 end*/
} }
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 end //bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 end
// iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01)); // iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift; import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
...@@ -12,23 +29,6 @@ import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; ...@@ -12,23 +29,6 @@ import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper; import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService; import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/** /**
* @author DELL * @author DELL
*/ */
...@@ -58,14 +58,6 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -58,14 +58,6 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
public DutyCarDto save(DutyCarDto dutyCarDto) { public DutyCarDto save(DutyCarDto dutyCarDto) {
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14 // BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
//1.保存行数据 //1.保存行数据
String groupCode = this.getGroupCode();
String userId = dutyCarDto.getUserId();
List<DynamicFormInstance> instances = dynamicFormInstanceService
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "userId")
.eq(DynamicFormInstance::getFieldValue, userId)
.eq(DynamicFormInstance::getGroupCode, this.getGroupCode()));
Long instanceId = null;
if(StringUtils.isNotEmpty(dutyCarDto.getDutyAreaId())) { if(StringUtils.isNotEmpty(dutyCarDto.getDutyAreaId())) {
// 根据建筑id 查找建筑 // 根据建筑id 查找建筑
ResponseModel<Map<String, Object>> response = null; ResponseModel<Map<String, Object>> response = null;
...@@ -78,102 +70,28 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -78,102 +70,28 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
dutyCarDto.setDutyArea(result.get("name").toString()); dutyCarDto.setDutyArea(result.get("name").toString());
} }
Map<String, Object> map = Bean.BeantoMap(dutyCarDto); Map<String, Object> map = Bean.BeantoMap(dutyCarDto);
if (!instances.isEmpty()) {
// 0.定位instanceId,准备进行更新操作 // 修改操作动态表单的方法,修改人陈浩 -------------start 2021-09-28
instanceId = instances.get(0).getInstanceId(); // 已经有了走更新方法 Long instanceId =excuteDynamicFormInstance(dutyCarDto.getUserId(),map,this.getGroupCode());
//1.查询已有数据 saveDutyPersonShiftDetail( instanceId ,dutyCarDto.getDutyShift() ,dutyCarDto.getStartTime()) ;
List<DynamicFormInstance> hasInstances = dynamicFormInstanceService.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId)); insertPersonShift(instanceId, dutyCarDto.getDutyShift());
//2.list 转 map // 修改操作动态表单的方法,修改人陈浩 -------------end 2021-09-28
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(hasInstances, "fieldCode", DynamicFormInstance.class);
//3.查询列数据,已列为主
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
//4.已列为主 填充动态表单数据
List<DynamicFormInstance> entrys = new ArrayList<>();
for (DynamicFormColumn column : columns) {
DynamicFormInstance formInstance = instanceMap.get(column.getFieldCode());
if (!ObjectUtils.isEmpty(formInstance)) {
//有的更新
formInstance.setFieldValue(map.get(column.getFieldCode()) != null ? map.get(column.getFieldCode()).toString() : "");
} else {
//没有的新增
formInstance = new DynamicFormInstance();
buildFormInstanceData(instanceId, map, column, formInstance);
}
entrys.add(formInstance);
}
if(!entrys.isEmpty()){
dynamicFormInstanceService.saveOrUpdateBatch(entrys);
}
} else {
instanceId = dynamicFormInstanceService.commonSave(groupCode,map);
}
if(dutyCarDto.getDutyShift() != null && dutyCarDto.getDutyShift().size() == 0) {
Calendar startDate = Calendar.getInstance();
startDate.setTime(DateUtils.longStr2Date(dutyCarDto.getStartTime()));
int dates = startDate.getActualMaximum(Calendar.DAY_OF_MONTH);
startDate.set(Calendar.DAY_OF_MONTH, 1);
List<DutyPersonShift> dutyShift = new ArrayList<>(dates);
for (int i = 0 ; i < dates ; i ++) {
DutyPersonShift temp = new DutyPersonShift();
temp.setAppKey(RequestContext.getAppKey());
temp.setDutyDate(startDate.getTime());
temp.setIsDelete(false);
temp.setInstanceId(instanceId);
dutyShift.add(temp);
startDate.add(Calendar.DAY_OF_YEAR,1);
}
dutyPersonShiftService.saveOrUpdateBatch(dutyShift);
}
//2.保存值班信息
insertPersonShift(instanceId, dutyCarDto);
//3.返回保存后的数据 //3.返回保存后的数据
return dutyCarDto; return dutyCarDto;
} }
@Override @Override
public DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto) { public DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto) {
String groupCode = this.getGroupCode();
//1.查询已有数据 //修改操作动态表单修改的逻辑方法,陈浩 start ----2021-09-28
List<DynamicFormInstance> instances = dynamicFormInstanceService.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId)); updateDynamicFormInstance(this.getGroupCode(),instanceId,Bean.BeantoMap(dutyCarDto));
//2.list 转 map //修改操作动态表单修改的逻辑方法,陈浩 end ----2021-09-28
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(instances, "fieldCode", DynamicFormInstance.class);
//3.查询列数据,已列为主
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
//页面数据转Map
Map<String, Object> map = Bean.BeantoMap(dutyCarDto);
//4.已列为主 填充动态表单数据
List<DynamicFormInstance> entrys = new ArrayList<>();
updateFormValue(entrys, map, instanceId, columns, instanceMap);
if (!entrys.isEmpty()) {
dynamicFormInstanceService.saveOrUpdateBatch(entrys);
}
//5.更新值班信息人日期数据 //5.更新值班信息人日期数据
insertPersonShift(instanceId, dutyCarDto); insertPersonShift(instanceId, dutyCarDto.getDutyShift());
return dutyCarDto; return dutyCarDto;
} }
private void insertPersonShift(Long instanceId, DutyCarDto dutyCarDto) {
Set<DutyPersonShift> personShiftList = dutyCarDto.getDutyShift().stream().map(dto -> {
// BUG 2807 修改时发现BUG 车辆保存有问题 by kongfm 2021-09-14
// 根据instanceId 和 日期查找 如果有则更新
DutyPersonShift dutyPersonShift = dutyPersonShiftService.getOne(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId,instanceId).eq(DutyPersonShift::getDutyDate,dto.getDutyDate()));
if(dutyPersonShift == null) {
dutyPersonShift = new DutyPersonShift();
}
dto.setInstanceId(instanceId);
Bean.copyExistPropertis(dto, dutyPersonShift);
dutyPersonShift.setAppKey(RequestContext.getAppKey());
return dutyPersonShift;
}).collect(Collectors.toSet());
if (!personShiftList.isEmpty()) {
dutyPersonShiftService.saveOrUpdateBatch(personShiftList);
}
}
private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column, DynamicFormInstance formInstance) { private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column, DynamicFormInstance formInstance) {
fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId()); fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId());
......
...@@ -35,6 +35,7 @@ import com.baomidou.mybatisplus.core.toolkit.Sequence; ...@@ -35,6 +35,7 @@ import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; 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.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
...@@ -294,8 +295,10 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -294,8 +295,10 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
String fileName; String fileName;
if ("dutyCar".equals(groupCode)) { if ("dutyCar".equals(groupCode)) {
list = jsonArray.toJavaList(DutyCarDto.class); list = jsonArray.toJavaList(DutyCarDto.class);
} else { } else if("dutyPerson".equals(groupCode)){
list = jsonArray.toJavaList(DutyPersonDto.class); list = jsonArray.toJavaList(DutyPersonDto.class);
}else if("dutyFireFighting".equals(groupCode)){
list = jsonArray.toJavaList(DutyFireFightingDto.class);
} }
return list; return list;
} }
...@@ -487,4 +490,105 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -487,4 +490,105 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
public List<Long> getDutyShiftIdList() { public List<Long> getDutyShiftIdList() {
return getOnDuty(new DateTime()); return getOnDuty(new DateTime());
} }
/***
* 将操作动态表单的方法单独提出来
* @author 陈浩
* @serialData 2021-09-28
* @param userId
* @param map
* @param groupCode
* @return
*/
public Long excuteDynamicFormInstance( String userId,Map<String, Object> map, String groupCode) {
List<DynamicFormInstance> instances = dynamicFormInstanceService
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "userId")
.eq(DynamicFormInstance::getFieldValue, userId)
.eq(DynamicFormInstance::getGroupCode, this.getGroupCode()));
Long instanceId = null;
if (!instances.isEmpty()) {
// 0.定位instanceId,准备进行更新操作
instanceId = instances.get(0).getInstanceId(); // 已经有了走更新方法
//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);
//3.查询列数据,已列为主
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
//4.已列为主 填充动态表单数据
List<DynamicFormInstance> entrys = new ArrayList<>();
for (DynamicFormColumn column : columns) {
DynamicFormInstance formInstance = instanceMap.get(column.getFieldCode());
if (!ObjectUtils.isEmpty(formInstance)) {
//有的更新
formInstance.setFieldValue(map.get(column.getFieldCode()) != null ? map.get(column.getFieldCode()).toString() : "");
} else {
//没有的新增
formInstance = new DynamicFormInstance();
buildFormInstanceData(instanceId, map, column, formInstance);
}
entrys.add(formInstance);
}
if(!entrys.isEmpty()){
dynamicFormInstanceService.saveOrUpdateBatch(entrys);
}
} else {
instanceId = dynamicFormInstanceService.commonSave(groupCode,map);
}
return instanceId;
}
public void updateDynamicFormInstance(String groupCode,Long instanceId, Map<String, Object> map) {
//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);
//3.查询列数据,已列为主
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
//页面数据转Map
//4.已列为主 填充动态表单数据
List<DynamicFormInstance> entrys = new ArrayList<>();
updateFormValue(entrys, map, instanceId, columns, instanceMap);
if (!entrys.isEmpty()) {
dynamicFormInstanceService.saveOrUpdateBatch(entrys);
}
}
public void saveDutyPersonShiftDetail( Long instanceId ,List<DutyPersonShiftDto> dutyShift ,String startTime) {
if(dutyShift != null && dutyShift.size() == 0) {
Calendar startDate = Calendar.getInstance();
startDate.setTime(DateUtils.longStr2Date(startTime));
int dates = startDate.getActualMaximum(Calendar.DAY_OF_MONTH);
startDate.set(Calendar.DAY_OF_MONTH, 1);
List<DutyPersonShift> dutyShiftList = new ArrayList<>(dates);
for (int i = 0 ; i < dates ; i ++) {
DutyPersonShift temp = new DutyPersonShift();
temp.setAppKey(RequestContext.getAppKey());
temp.setDutyDate(startDate.getTime());
temp.setIsDelete(false);
temp.setInstanceId(instanceId);
dutyShiftList.add(temp);
startDate.add(Calendar.DAY_OF_YEAR,1);
}
dutyPersonShiftService.saveOrUpdateBatch(dutyShiftList);
}
}
public void insertPersonShift(Long instanceId, List<DutyPersonShiftDto> dutyShiftList) {
Set<DutyPersonShift> personShiftList = dutyShiftList.stream().map(dto -> {
// BUG 2807 修改时发现BUG 车辆保存有问题 by kongfm 2021-09-14
// 根据instanceId 和 日期查找 如果有则更新
DutyPersonShift dutyPersonShift = dutyPersonShiftService.getOne(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId,instanceId).eq(DutyPersonShift::getDutyDate,dto.getDutyDate()));
if(dutyPersonShift == null) {
dutyPersonShift = new DutyPersonShift();
}
dto.setInstanceId(instanceId);
Bean.copyExistPropertis(dto, dutyPersonShift);
dutyPersonShift.setAppKey(RequestContext.getAppKey());
return dutyPersonShift;
}).collect(Collectors.toSet());
if (!personShiftList.isEmpty()) {
dutyPersonShiftService.saveOrUpdateBatch(personShiftList);
}
}
} }
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
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.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService;
@Service
public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implements IDutyFireFightingService {
@Autowired
FireStationServiceImpl fireStationServiceImpl;
@Override
@Transactional(rollbackFor = Exception.class)
public DutyFireFightingDto save(DutyFireFightingDto dto) {
// 根据微型消防站ID,获取微型消防站名称
FireStationDto fireStationDtoResult = fireStationServiceImpl
.queryBySeq(Long.parseLong(dto.getFireFightingId()));
dto.setFireFighting(fireStationDtoResult.getName());
Map<String, Object> map = Bean.BeantoMap(dto);
Long instanceId = excuteDynamicFormInstance(dto.getUserId(), map, this.getGroupCode());
saveDutyPersonShiftDetail(instanceId, dto.getDutyShift(), dto.getStartTime());
insertPersonShift(instanceId, dto.getDutyShift());
return dto;
}
@Override
public DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto) {
updateDynamicFormInstance(this.getGroupCode(),instanceId,Bean.BeantoMap(dto));
insertPersonShift(instanceId, dto.getDutyShift());
return dto;
}
public String getGroupCode() {
return "dutyFireFighting";
}
}
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto; import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
...@@ -116,4 +117,25 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat ...@@ -116,4 +117,25 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
this.updateById(entity); this.updateById(entity);
return Bean.toModel(entity, model); return Bean.toModel(entity, model);
} }
/**
* 列表查询 示例
*/
public List<FireStation> queryForFireStationList(List<String> companyIdList) {
LambdaQueryWrapper<FireStation> wrapper =new LambdaQueryWrapper<FireStation>();
wrapper.eq(FireStation::getIsDelete, false);
wrapper.in(FireStation::getBizCompanyId, companyIdList);
return this.baseMapper.selectList(wrapper);
}
/**
* 查询当前公司下的所有微型消防站信息
* @param companyId
* @return
*/
public List<Map<String , Object>> queryForFireStationListByCompanyId(Long companyId) {
LambdaQueryWrapper<FireStation> wrapper =new LambdaQueryWrapper<FireStation>();
wrapper.eq(FireStation::getIsDelete, false);
wrapper.eq(FireStation::getBizCompanyId, companyId);
wrapper.select(FireStation::getSequenceNbr,FireStation::getName);
return this.baseMapper.selectMaps(wrapper);
}
} }
package com.yeejoin.amos.boot.module.tzs.biz.controller; package com.yeejoin.amos.boot.module.tzs.biz.controller;
import java.util.List; import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.tzs.api.dto.MainPersonDto; import com.yeejoin.amos.boot.module.tzs.api.dto.MainPersonDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatUserFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.service.IDispatchTaskService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormValueServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -14,7 +25,9 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -14,7 +25,9 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -46,6 +59,15 @@ public class DispatchTaskController extends BaseController { ...@@ -46,6 +59,15 @@ public class DispatchTaskController extends BaseController {
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired
ISourceFileService sourceFileService;
@Autowired
IDispatchTaskService dispatchTaskService;
@Autowired
AlertFormValueServiceImpl iAlertFormValueService;
/** /**
* 根据派遣单位类型和警情id 获取任务模板 * 根据派遣单位类型和警情id 获取任务模板
* @param orgTypeCode * @param orgTypeCode
...@@ -111,4 +133,206 @@ public class DispatchTaskController extends BaseController { ...@@ -111,4 +133,206 @@ public class DispatchTaskController extends BaseController {
List<MainPersonDto> list = dispatchTaskServiceImpl.todayTaskPerson(); List<MainPersonDto> list = dispatchTaskServiceImpl.todayTaskPerson();
return ResponseHelper.buildResponse(list); return ResponseHelper.buildResponse(list);
} }
/**
* 微信公众号维修反馈接口
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveUserFeed")
@ApiOperation(httpMethod = "POST", value = "微信公众号上报人反馈接口", notes = "微信公众号上报人反馈接口")
public ResponseModel<WechatMyBussinessDto> saveUserFeed(@RequestBody WechatUserFeedbackDto model) {
return ResponseHelper.buildResponse(dispatchTaskServiceImpl.saveUserFeed(model));
}
/**
* 点击到达触发事件
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/taskArrive/{taskId}")
@ApiOperation(httpMethod = "GET", value = "点击到达触发事件", notes = "点击到达触发事件")
public ResponseModel<WechatMyTaskDto> taskArrive(@PathVariable Long taskId) {
if (ValidationUtil.isEmpty(taskId)){
throw new BadRequest("参数校验失败.");
}
if(dispatchTaskServiceImpl.taskArrive(taskId)) {
return ResponseHelper.buildResponse(getTaskDtoByTaskId(taskId));
} else {
return ResponseHelper.buildResponse(new WechatMyTaskDto());
}
}
/**
* 点击救援完成触发事件
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/saveFinish/{taskId}")
@ApiOperation(httpMethod = "GET", value = "点击救援完成触发事件", notes = "点击救援完成触发事件")
public ResponseModel<WechatMyTaskDto> saveFinish(@PathVariable Long taskId) {
if (ValidationUtil.isEmpty(taskId)){
throw new BadRequest("参数校验失败.");
}
if(dispatchTaskServiceImpl.saveFinish(taskId)) {
return ResponseHelper.buildResponse(getTaskDtoByTaskId(taskId));
} else {
return ResponseHelper.buildResponse(new WechatMyTaskDto());
}
}
/**
* 获取任务详情
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getTaskInfo/{taskId}")
@ApiOperation(httpMethod = "GET", value = "获取任务详情", notes = "获取任务详情")
public ResponseModel<WechatMyTaskDto> getTaskInfo(@PathVariable Long taskId) {
if (ValidationUtil.isEmpty(taskId)){
throw new BadRequest("参数校验失败.");
}
return ResponseHelper.buildResponse(getTaskDtoByTaskId(taskId));
}
private WechatMyTaskDto getTaskDtoByTaskId(Long taskId) {
WechatMyTaskDto temp = dispatchTaskService.getTaskInfoByTaskId(taskId);
List<AlertFormValue> paperList = null;
Map<String, List<AttachmentDto>> imgMap = null;
List<AttachmentDto> imgDtos = null;
Map<String, List<AttachmentDto>> errorImgMap = null;
List<AttachmentDto> errorImgDtos = null;
List<AttachmentDto> feedbackDtos = null;
LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>();
switch (temp.getTaskTypeCode()) {
case "960" : // 困人救援
temp.setHasDeadHurt("无");
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getAlertId());
// 警情动态表单数据
List<AlertFormValue> alertList = iAlertFormValueService.list(queryWrapper);
alertList.stream().forEach(t -> {
String value = t.getFieldValue();
if("trapped_floor_num".equals(t.getFieldCode())) {
// 被困楼层
temp.setTrappedFloorNum(value);
} else if("trapped_num".equals(t.getFieldCode())) {
// 被困人数
temp.setTrappedNum(value);
} else if("injured_num".equals(t.getFieldCode())) {
// 受伤人数
if(StringUtils.isNotEmpty(value)) {
temp.setHasDeadHurt("有");
}
} else if("die_num".equals(t.getFieldCode())) {
// 死亡人数
if(StringUtils.isNotEmpty(value)) {
temp.setHasDeadHurt("有");
}
}
});
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("save_time".equals(t.getFieldCode())) {
// 救援完成时间
if(StringUtils.isNotBlank(value)) {
temp.setSaveTime(DateUtils.longStr2Date(value));
}
} else if("error_result".equals(t.getFieldCode())) {
// 故障原因
temp.setErrorResult(value);
} else if("fix_result".equals(t.getFieldCode())) {
// 维修结果
temp.setFixResult(value);
} else if("fix_remark".equals(t.getFieldCode())) {
// 维修备注
temp.setRemark(value);
}
});
imgMap = sourceFileService.getAttachments(temp.getPaperId());
imgDtos = imgMap.get("imgs");
temp.setFixImgs(imgDtos);
errorImgMap = sourceFileService.getAttachments(temp.getAlertId());
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break;
case "961" : // 故障维修
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("save_time".equals(t.getFieldCode())) {
// 救援完成时间
if(StringUtils.isNotBlank(value)) {
temp.setSaveTime(DateUtils.longStr2Date(value));
}
} else if("error_result".equals(t.getFieldCode())) {
// 故障原因
temp.setErrorResult(value);
} else if("fix_result".equals(t.getFieldCode())) {
// 维修结果
temp.setFixResult(value);
} else if("fix_remark".equals(t.getFieldCode())) {
// 维修备注
temp.setRemark(value);
} else if("feedback_result".equals(t.getFieldCode())) {
// 反馈结果
temp.setFeedbackResult(value);
}
});
imgMap = sourceFileService.getAttachments(temp.getPaperId());
imgDtos = imgMap.get("imgs");
temp.setFixImgs(imgDtos);
errorImgMap = sourceFileService.getAttachments(temp.getAlertId());
errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos);
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break;
case "962" : // 投诉建议
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("action_result".equals(t.getFieldCode())) {
// 处置结果
temp.setActionResult(value);
}
});
errorImgMap = sourceFileService.getAttachments(temp.getAlertId());
errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos);
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break;
}
return temp;
}
} }
...@@ -125,6 +125,7 @@ public class WechatController extends BaseController { ...@@ -125,6 +125,7 @@ public class WechatController extends BaseController {
@Autowired @Autowired
ISourceFileService sourceFileService; ISourceFileService sourceFileService;
/** /**
* 获取微信回调信息返回验证是否通过 * 获取微信回调信息返回验证是否通过
* @param signature * @param signature
...@@ -426,20 +427,6 @@ public class WechatController extends BaseController { ...@@ -426,20 +427,6 @@ public class WechatController extends BaseController {
} }
/**
* 获取任务详情
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getTaskInfo/{taskId}")
@ApiOperation(httpMethod = "GET", value = "获取任务详情", notes = "获取任务详情")
public ResponseModel<WechatMyTaskDto> getTaskInfo(@PathVariable Long taskId) {
if (ValidationUtil.isEmpty(taskId)){
throw new BadRequest("参数校验失败.");
}
return ResponseHelper.buildResponse(getTaskDtoByTaskId(taskId));
}
/** /**
* 获取业务详情 * 获取业务详情
...@@ -456,45 +443,6 @@ public class WechatController extends BaseController { ...@@ -456,45 +443,6 @@ public class WechatController extends BaseController {
return ResponseHelper.buildResponse(getBussinessDtoById(bussinessId)); return ResponseHelper.buildResponse(getBussinessDtoById(bussinessId));
} }
/**
* 点击到达触发事件
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/taskArrive/{taskId}")
@ApiOperation(httpMethod = "GET", value = "点击到达触发事件", notes = "点击到达触发事件")
public ResponseModel<WechatMyTaskDto> taskArrive(@PathVariable Long taskId) {
if (ValidationUtil.isEmpty(taskId)){
throw new BadRequest("参数校验失败.");
}
if(dispatchTaskService.taskArrive(taskId)) {
return ResponseHelper.buildResponse(getTaskDtoByTaskId(taskId));
} else {
return ResponseHelper.buildResponse(new WechatMyTaskDto());
}
}
/**
* 点击救援完成触发事件
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/saveFinish/{taskId}")
@ApiOperation(httpMethod = "GET", value = "点击救援完成触发事件", notes = "点击救援完成触发事件")
public ResponseModel<WechatMyTaskDto> saveFinish(@PathVariable Long taskId) {
if (ValidationUtil.isEmpty(taskId)){
throw new BadRequest("参数校验失败.");
}
if(dispatchTaskService.saveFinish(taskId)) {
return ResponseHelper.buildResponse(getTaskDtoByTaskId(taskId));
} else {
return ResponseHelper.buildResponse(new WechatMyTaskDto());
}
}
/** /**
* 获取任务列表 * 获取任务列表
...@@ -561,122 +509,7 @@ public class WechatController extends BaseController { ...@@ -561,122 +509,7 @@ public class WechatController extends BaseController {
return ResponseHelper.buildResponse(urlString); return ResponseHelper.buildResponse(urlString);
} }
private WechatMyTaskDto getTaskDtoByTaskId(Long taskId) {
WechatMyTaskDto temp = dispatchTaskService.getTaskInfoByTaskId(taskId);
List<AlertFormValue> paperList = null;
Map<String, List<AttachmentDto>> imgMap = null;
List<AttachmentDto> imgDtos = null;
Map<String, List<AttachmentDto>> errorImgMap = null;
List<AttachmentDto> errorImgDtos = null;
LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>();
switch (temp.getTaskTypeCode()) {
case "960" : // 困人救援
temp.setHasDeadHurt("无");
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getAlertId());
// 警情动态表单数据
List<AlertFormValue> alertList = iAlertFormValueService.list(queryWrapper);
alertList.stream().forEach(t -> {
String value = t.getFieldValue();
if("trapped_floor_num".equals(t.getFieldCode())) {
// 被困楼层
temp.setTrappedFloorNum(value);
} else if("trapped_num".equals(t.getFieldCode())) {
// 被困人数
temp.setTrappedNum(value);
} else if("injured_num".equals(t.getFieldCode())) {
// 受伤人数
if(StringUtils.isNotEmpty(value)) {
temp.setHasDeadHurt("有");
}
} else if("die_num".equals(t.getFieldCode())) {
// 死亡人数
if(StringUtils.isNotEmpty(value)) {
temp.setHasDeadHurt("有");
}
}
});
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("save_time".equals(t.getFieldCode())) {
// 救援完成时间
if(StringUtils.isNotBlank(value)) {
temp.setSaveTime(DateUtils.longStr2Date(value));
}
} else if("error_result".equals(t.getFieldCode())) {
// 故障原因
temp.setErrorResult(value);
} else if("fix_result".equals(t.getFieldCode())) {
// 维修结果
temp.setFixResult(value);
} else if("fix_remark".equals(t.getFieldCode())) {
// 维修备注
temp.setRemark(value);
}
});
imgMap = sourceFileService.getAttachments(temp.getPaperId());
imgDtos = imgMap.get("imgs");
temp.setFixImgs(imgDtos);
break;
case "961" : // 故障维修
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("save_time".equals(t.getFieldCode())) {
// 救援完成时间
if(StringUtils.isNotBlank(value)) {
temp.setSaveTime(DateUtils.longStr2Date(value));
}
} else if("error_result".equals(t.getFieldCode())) {
// 故障原因
temp.setErrorResult(value);
} else if("fix_result".equals(t.getFieldCode())) {
// 维修结果
temp.setFixResult(value);
} else if("fix_remark".equals(t.getFieldCode())) {
// 维修备注
temp.setRemark(value);
} else if("feedback_result".equals(t.getFieldCode())) {
// 反馈结果
temp.setFeedbackResult(value);
}
});
imgMap = sourceFileService.getAttachments(temp.getPaperId());
imgDtos = imgMap.get("imgs");
temp.setFixImgs(imgDtos);
errorImgMap = sourceFileService.getAttachments(temp.getAlertId());
errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos);
break;
case "962" : // 投诉建议
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("action_result".equals(t.getFieldCode())) {
// 处置结果
temp.setActionResult(value);
}
});
break;
}
return temp;
}
private WechatMyBussinessDto getBussinessDtoById(Long alertId) { private WechatMyBussinessDto getBussinessDtoById(Long alertId) {
...@@ -688,6 +521,7 @@ public class WechatController extends BaseController { ...@@ -688,6 +521,7 @@ public class WechatController extends BaseController {
List<AttachmentDto> imgDtos = null; List<AttachmentDto> imgDtos = null;
Map<String, List<AttachmentDto>> errorImgMap = null; Map<String, List<AttachmentDto>> errorImgMap = null;
List<AttachmentDto> errorImgDtos = null; List<AttachmentDto> errorImgDtos = null;
List<AttachmentDto> feedbackDtos = null;
LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>();
switch (temp.getTaskTypeCode()) { switch (temp.getTaskTypeCode()) {
case "960" : // 困人救援 case "960" : // 困人救援
...@@ -775,11 +609,11 @@ public class WechatController extends BaseController { ...@@ -775,11 +609,11 @@ public class WechatController extends BaseController {
imgMap = sourceFileService.getAttachments(temp.getPaperId()); imgMap = sourceFileService.getAttachments(temp.getPaperId());
imgDtos = imgMap.get("imgs"); imgDtos = imgMap.get("imgs");
temp.setFixImgs(imgDtos); temp.setFixImgs(imgDtos);
errorImgMap = sourceFileService.getAttachments(temp.getSequenceNbr()); errorImgMap = sourceFileService.getAttachments(temp.getSequenceNbr());
errorImgDtos = errorImgMap.get("imgs"); errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos); temp.setErrorImgs(errorImgDtos);
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break; break;
case "962" : // 投诉建议 case "962" : // 投诉建议
queryWrapper = new LambdaQueryWrapper<>(); queryWrapper = new LambdaQueryWrapper<>();
...@@ -793,6 +627,11 @@ public class WechatController extends BaseController { ...@@ -793,6 +627,11 @@ public class WechatController extends BaseController {
temp.setActionResult(value); temp.setActionResult(value);
} }
}); });
errorImgMap = sourceFileService.getAttachments(temp.getSequenceNbr());
errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos);
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break; break;
} }
return temp; return temp;
......
...@@ -40,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -40,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition; import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator; import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -289,15 +290,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -289,15 +290,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
LambdaQueryWrapper<DispatchPaper> queryWrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<DispatchPaper> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(DispatchPaper::getAlertId,Long.valueOf(alertId)); queryWrapper.eq(DispatchPaper::getAlertId,Long.valueOf(alertId));
DispatchPaper dispatchPaper = dispatchPaperService.getOne(queryWrapper); DispatchPaper dispatchPaper = dispatchPaperService.getOne(queryWrapper);
List<DispatchTask> dispatchTask = null;
LambdaQueryWrapper<DispatchTask> queryWrapper1 = new LambdaQueryWrapper(); if(!ValidationUtil.isEmpty(dispatchPaper)) {
queryWrapper1.eq(DispatchTask::getPaperId,Long.valueOf(dispatchPaper.getSequenceNbr())); LambdaQueryWrapper<DispatchTask> queryWrapper1 = new LambdaQueryWrapper();
List<DispatchTask> dispatchTask = dispatchTaskService.list(queryWrapper1); queryWrapper1.eq(DispatchTask::getPaperId,Long.valueOf(dispatchPaper.getSequenceNbr()));
dispatchTask = dispatchTaskService.list(queryWrapper1);
}
String [] str = new String[]{"使用单位","一级响应","二级响应","三级响应","市级监督"}; String [] str = new String[]{"使用单位","一级响应","二级响应","三级响应","市级监督"};
if(null != dispatchPaper) { if(null != dispatchPaper) {
for(String s:str) { for(String s:str) {
AlertHandlerInfoDto alertHandlerInfoDto = new AlertHandlerInfoDto(); AlertHandlerInfoDto alertHandlerInfoDto = new AlertHandlerInfoDto();
if(null != dispatchTask &&dispatchTask.size() > 0 ) { if(null != dispatchTask &&dispatchTask.size() > 0 ) {
...@@ -465,8 +467,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -465,8 +467,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
// 警情报送 // 警情报送
alertCalled.setAlertStatus(false); alertCalled.setAlertStatus(false);
alertCalled.setAlertSource(AlertStageEnums.GZHSB.getValue()); alertCalled.setAlertSource(AlertStageEnums.APPJJ.getValue());
alertCalled.setAlertSourceCode(AlertStageEnums.GZHSB.getCode()); alertCalled.setAlertSourceCode(AlertStageEnums.APPJJ.getCode());
alertCalled.setIsDelete(false); alertCalled.setIsDelete(false);
alertCalled.setAlertStage(AlertStageEnums.JJ.getValue()); alertCalled.setAlertStage(AlertStageEnums.JJ.getValue());
alertCalled.setAlertStageCode(AlertStageEnums.JJ.getId()); alertCalled.setAlertStageCode(AlertStageEnums.JJ.getId());
......
...@@ -173,6 +173,7 @@ public class ESElevatorServiceImpl { ...@@ -173,6 +173,7 @@ public class ESElevatorServiceImpl {
esElevatorDto.setHappenTime(al.getCallTime()); esElevatorDto.setHappenTime(al.getCallTime());
esElevatorDto.setAlertId(String.valueOf(al.getSequenceNbr())); esElevatorDto.setAlertId(String.valueOf(al.getSequenceNbr()));
esElevatorDto.setAlarmTypeCode(al.getAlarmTypeCode()); esElevatorDto.setAlarmTypeCode(al.getAlarmTypeCode());
esElevatorDto.setType(al.getAlertStage());
list.add(esElevatorDto); list.add(esElevatorDto);
break; break;
} }
......
...@@ -122,10 +122,8 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev ...@@ -122,10 +122,8 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev
} }
public List<ElevatorWlInfoDto> queryElevatorListDetails(ElevatorWlInfoDto esElevatorDto) { public List<ElevatorWlInfoDto> queryElevatorListDetails(ElevatorWlInfoDto esElevatorDto) {
return elevatorMapper.queryElevatorListDetails(esElevatorDto.getAddress(), return elevatorMapper.queryElevatorListDetails(
esElevatorDto.getRegisterCode(),esElevatorDto.getRescueCode(), esElevatorDto.getSequenceNbr());
esElevatorDto.getType(), esElevatorDto.getDealStatus() != null ? Integer.parseInt(esElevatorDto.getDealStatus()) :null
, esElevatorDto.getSequenceNbr());
} }
public int queryElevatorListCount() { public int queryElevatorListCount() {
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.biz.service.impl; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
...@@ -64,6 +65,10 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -64,6 +65,10 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
@Autowired @Autowired
RescueProcessServiceImpl rescueProcessServiceImpl; RescueProcessServiceImpl rescueProcessServiceImpl;
@Autowired
AlertFormValueServiceImpl iAlertFormValueService;
@Autowired @Autowired
private EmqKeeper emqKeeper; private EmqKeeper emqKeeper;
...@@ -197,15 +202,19 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -197,15 +202,19 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
String person = dispatchTask.getResponseUserName(); String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person); content = content.replace("$createTime",createTime).replace("$person",person);
DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId); DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId);
DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper();
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>(); Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> { dynamicForm.stream().forEach(alertFormValue -> {
if(TzsCommonParam.FIX_RESULT.equals(alertFormValue.getFieldCode())) { if(TzsCommonParam.FIX_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue()); tempMap.put("fixResult",alertFormValue.getFieldValue());
} }
if(TzsCommonParam.FIX_FEEDBACK_TYPE.equals(alertFormValue.getFieldCode())) {
tempMap.put("FKFS",alertFormValue.getFieldValue());
}
}); });
content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult")); // 反馈方式从动态表单中取得
String FKFS = tempMap.get("FKFS") == null ? "" : tempMap.get("FKFS");
content = content.replace("$FKFS",FKFS).replace("$fixResult",tempMap.get("fixResult"));
} else if(TzsCommonParam.WXFK_TS.equals(type)) { //从派遣单获取数据 } else if(TzsCommonParam.WXFK_TS.equals(type)) { //从派遣单获取数据
//投诉的维修反馈修改成维保已处置 //投诉的维修反馈修改成维保已处置
CZHJ = DispatchPaperEnums.disposed; CZHJ = DispatchPaperEnums.disposed;
...@@ -219,44 +228,40 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -219,44 +228,40 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
dynamicForm.stream().forEach(alertFormValue -> { dynamicForm.stream().forEach(alertFormValue -> {
if(TzsCommonParam.ACTION_RESULT.equals(alertFormValue.getFieldCode())) { if(TzsCommonParam.ACTION_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue()); tempMap.put("fixResult",alertFormValue.getFieldValue());
} else if(TzsCommonParam.CONSULT_FEEDBACK_TYPE.equals(alertFormValue.getFieldCode())) {
tempMap.put(TzsCommonParam.FKFS,alertFormValue.getFieldValue());
} }
}); });
content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult")); content = content.replace("$FKFS",tempMap.get(TzsCommonParam.FKFS)).replace("$fixResult",tempMap.get("fixResult"));
type = TzsCommonParam.WXFK; type = TzsCommonParam.WXFK;
} else if(TzsCommonParam.BXFK.equals(type)) { } else if(TzsCommonParam.BXFK.equals(type)) {
//报修反馈 //报修反馈
CZHJ = DispatchPaperEnums.reportorBack; CZHJ = DispatchPaperEnums.reportorBack;
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId); String person = alertCalledVo.getEmergencyPerson() + "(" + alertCalledVo.getEmergencyCall() + ")";
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person); content = content.replace("$createTime",createTime).replace("$person",person);
DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId); DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId);
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>(); Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> { dynamicForm.stream().forEach(alertFormValue -> {
if(TzsCommonParam.FIX_FEEDBACK_TYPE.equals(alertFormValue.getFieldCode())) { if(TzsCommonParam.FEEDBACK_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put(TzsCommonParam.FKFS,alertFormValue.getFieldValue()); tempMap.put("feedbackResult",alertFormValue.getFieldValue());
} else if(TzsCommonParam.FIX_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue());
} }
}); });
content = content.replace("$FKFS",tempMap.get(TzsCommonParam.FKFS)).replace("$feedbackResult",tempMap.get("fixResult")); content = content.replace("$FKFS",dispatchPaperFormDto.getDispatchPaper().getFeedbackType()).replace("$feedbackResult",tempMap.get("feedbackResult"));
} else if(TzsCommonParam.TSRFK.equals(type)) { } else if(TzsCommonParam.TSRFK.equals(type)) {
//投诉人已反馈 //投诉人已反馈
CZHJ = DispatchPaperEnums.complainantBack; CZHJ = DispatchPaperEnums.complainantBack;
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId); String person = alertCalledVo.getEmergencyPerson() + "(" + alertCalledVo.getEmergencyCall() + ")";
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person); content = content.replace("$createTime",createTime).replace("$person",person);
DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId); DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId);
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>(); Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> { dynamicForm.stream().forEach(alertFormValue -> {
if(TzsCommonParam.CONSULT_FEEDBACK_TYPE.equals(alertFormValue.getFieldCode())) { if(TzsCommonParam.FEEDBACK_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put(TzsCommonParam.FKFS,alertFormValue.getFieldValue()); tempMap.put("feedbackResult",alertFormValue.getFieldValue());
} else if(TzsCommonParam.ACTION_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("action_result",alertFormValue.getFieldValue());
} }
}); });
content = content.replace("$FKFS",tempMap.get(TzsCommonParam.FKFS)).replace("$feedbackResult",tempMap.get("action_result")); content = content.replace("$FKFS",dispatchPaperFormDto.getDispatchPaper().getFeedbackType()).replace("$feedbackResult",tempMap.get("feedbackResult"));
} }
AlertStageEnums RZHJ = AlertStageEnums.getEnumByCode(type); AlertStageEnums RZHJ = AlertStageEnums.getEnumByCode(type);
repairConsult.setType(RZHJ.getCode()); repairConsult.setType(RZHJ.getCode());
......
...@@ -42,9 +42,9 @@ tzs.cti.secretkey=7bd29115-99ee-4f7d-1fb1-7c4719d5f43a ...@@ -42,9 +42,9 @@ tzs.cti.secretkey=7bd29115-99ee-4f7d-1fb1-7c4719d5f43a
tzs.cti.url=http://36.46.151.113:8000 tzs.cti.url=http://36.46.151.113:8000
tzs.wechat.url=https://api.weixin.qq.com tzs.wechat.url=https://api.weixin.qq.com
##wechatAPPID wx79aca5bb1cb4af92 wx8918c1aaad956617 ##wechatAPPID wx79aca5bb1cb4af92 uat-wx8918c1aaad956617
tzs.wechat.appid=wx79aca5bb1cb4af92 tzs.wechat.appid=wx8918c1aaad956617
##wechatSECRET 337c3d8f3e749140d4f9aedc8311033b f3a12323ba731d282c3d4698c27c3e97 ##wechatSECRET f3a12323ba731d282c3d4698c27c3e97 uat-337c3d8f3e749140d4f9aedc8311033b
tzs.wechat.secret=337c3d8f3e749140d4f9aedc8311033b tzs.wechat.secret=337c3d8f3e749140d4f9aedc8311033b
##wechatToken ##wechatToken
......
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