Commit fe177946 authored by kongfm's avatar kongfm

修改BUG 2455 2532

parent fd8af58b
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -18,27 +22,37 @@ import lombok.EqualsAndHashCode;
@ApiModel(value = "RescueEquipmentDto", description = "救援装备")
public class RescueEquipmentDto extends BaseDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "车辆类型", index = 0)
@ExplicitConstraint(type = "JYZBLX", indexNum = 0, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "车辆类型")
private String vehicleType;
@ExcelIgnore
@ApiModelProperty(value = "车辆类型code")
private String vehicleTypeCode;
@ExcelProperty(value = "车辆数量", index = 1)
@ApiModelProperty(value = "车辆数量")
private Long vehicleNumber;
@ExcelProperty(value = "费用", index = 2)
@ApiModelProperty(value = "费用")
private Double fee;
@ExcelProperty(value = "单位名称", index =3)
@ExplicitConstraint(indexNum = 3, sourceClass = RoleNameExplicitConstraint.class,method="getUnitTeam") //动态下拉内容
@ApiModelProperty(value = "单位名称")
private String company;
@ExcelIgnore
@ApiModelProperty(value = "单位id")
private Long companyId;
@ExcelIgnore
@ApiModelProperty(value = "更新人名称")
private String recUserName;
......
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
......@@ -19,24 +23,32 @@ import java.util.Date;
@ApiModel(value = "SpecialPositionStaffDto", description = "特岗人员")
public class SpecialPositionStaffDto extends BaseDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "岗位名称", index = 0)
@ExplicitConstraint(type = "GWMC", indexNum = 0, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "岗位名称")
private String positionName;
@ExcelIgnore
@ApiModelProperty(value = "岗位名称code")
private String positionNameCode;
@ExcelProperty(value = "人数", index = 1)
@ApiModelProperty(value = "人数")
private Long personNumber;
@ExcelProperty(value = "单位名称", index = 2)
@ExplicitConstraint(indexNum = 2, sourceClass = RoleNameExplicitConstraint.class,method="getUnitTeam") //动态下拉内容
@ApiModelProperty(value = "单位名称")
private String company;
@ExcelIgnore
@ApiModelProperty(value = "单位id")
private Long companyId;
@ExcelIgnore
@ApiModelProperty(value = "更新人名称")
private String recUserName;
......
......@@ -21,7 +21,10 @@ public enum ExcelEnums {
CLZQ ("车辆执勤", "车辆执勤", "com.yeejoin.amos.boot.module.common.api.dto.DutyCarExcelDto","CLZQ"),//("CLZQ","车辆执勤")
JCDWRY ("机场单位人员", "机场单位人员", "com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto","JCDWRY"),//("JCDW","机场单位")
LDDW ("联动单位", "联动单位", "com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto","LDDW"),//("JCDW","机场单位")
RYZB ("人员值班", "人员值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto","RYZB");//("RYZB","人员值班")
RYZB ("人员值班", "人员值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto","RYZB"),//("RYZB","人员值班")
// BUG 2455 相关代码 bykongfm
TGRY ("特岗人员", "特岗人员", "com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto","TGRY"),//("TGRY","特岗人员")
JYZB ("救援装备", "救援装备", "com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto","JYZB");//("JYZB","救援装备")
private String fileName;
private String sheetName;
......
......@@ -327,7 +327,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
});
Map<String, Integer> statusCountMap = alertCalledMapper.queryAlertStatusCount(beginDate, endDate);
Integer unFinishedCount =
this.count(new LambdaQueryWrapper<AlertCalled>().eq(AlertCalled::getAlertStatus, "0"));
this.count(new LambdaQueryWrapper<AlertCalled>().eq(AlertCalled::getAlertStatus, false));//bug2532 未结案警情统计错误 bykongfm
result.put("alertInfoList", contentList);
result.putAll(statusCountMap);
......
......@@ -7,7 +7,9 @@ import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.LinkageUnitServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -67,6 +69,9 @@ public class DataSourcesImpl implements DataSources {
@Autowired
private RestTemplate restTemplate;
@Autowired
LinkageUnitServiceImpl linkageUnitServiceImpl;
@Value("${security.systemctl.name}")
private String systemctl;
......@@ -130,9 +135,9 @@ public class DataSourcesImpl implements DataSources {
case "getparent":
str =getparent();
break;
case "getUnitTeam":
str =getUnitTeam();
break;
}
}
return str;
......@@ -294,4 +299,17 @@ public class DataSourcesImpl implements DataSources {
return str;
}
/**
* 特岗人员模板及救援车辆模板获取联动单位 BUG 2455 相关代码 bykongfm
* @return
*/
private String[] getUnitTeam() {
List<LinkageUnitDto> units = linkageUnitServiceImpl.queryForLinkageUnitList(false);
List<String> names = units.stream().map(item -> {
return item.getUnitName() + "@" + item.getSequenceNbr();
}).collect(Collectors.toList());
String[] str = names.toArray(new String[names.size()]);
return str;
}
}
......@@ -16,6 +16,8 @@ import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment;
import com.yeejoin.amos.boot.module.common.api.entity.SpecialPositionStaff;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
......@@ -100,6 +102,10 @@ public class ExcelServiceImpl {
DynamicFormColumnServiceImpl dynamicFormColumnServiceImpl;
@Autowired
LinkageUnitServiceImpl linkageUnitServiceImpl;
@Autowired
SpecialPositionStaffServiceImpl specialPositionStaffServiceImpl;
@Autowired
RescueEquipmentServiceImpl rescueEquipmentServiceImpl;
public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException {
String url = excelDto.getClassUrl();
......@@ -216,10 +222,90 @@ public class ExcelServiceImpl {
case "LDDW":
excelImportLinkageUnitZhDto(multipartFile);
break;
// BUG 2455 相关代码 bykongfm
case "TGRY":
excelImportLinkageUnitTGRYDto(multipartFile);
break;
case "JYZB":
excelImportLinkageUnitJYZBDto(multipartFile);
break;
}
return;
}
private void excelImportLinkageUnitTGRYDto(MultipartFile multipartFile) throws Exception {
List<SpecialPositionStaffDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile,
SpecialPositionStaffDto.class, 1);
if(excelDtoList!=null&&excelDtoList.size()>0){
outer : for(SpecialPositionStaffDto positionStaffDto : excelDtoList) {
String code = "";
if(positionStaffDto.getPositionName()!=null){
String[] certificates = positionStaffDto.getPositionName().split("@");
positionStaffDto.setPositionName(certificates[0]);
positionStaffDto.setPositionNameCode(certificates[1]);
code = certificates[1];
} else {
continue;
}
if(positionStaffDto.getCompany()!=null){
String[] certificates = positionStaffDto.getCompany().split("@");
positionStaffDto.setCompany(certificates[0]);
positionStaffDto.setCompanyId(Long.parseLong(certificates[1]));
// 获取特岗人员已经存在的岗位 如果存在则不导入
LambdaQueryWrapper<SpecialPositionStaff> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SpecialPositionStaff::getCompanyId,Long.parseLong(certificates[1])).eq(SpecialPositionStaff::getIsDelete,false);
List<SpecialPositionStaff> tempList = specialPositionStaffServiceImpl.list(queryWrapper);
for(SpecialPositionStaff temp : tempList) {
if(temp.getPositionNameCode().equals(code)) {
continue outer; // 已经存在则不导入继续循环
}
}
} else {
continue;
}
specialPositionStaffServiceImpl.createWithModel(positionStaffDto);
}
}
}
private void excelImportLinkageUnitJYZBDto(MultipartFile multipartFile) throws Exception {
List<RescueEquipmentDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile,
RescueEquipmentDto.class, 1);
if(excelDtoList!=null&&excelDtoList.size()>0){
outer : for(RescueEquipmentDto rescueEquipmentDto : excelDtoList ) {
String code = "";
if(rescueEquipmentDto.getVehicleType()!=null){
String[] certificates = rescueEquipmentDto.getVehicleType().split("@");
rescueEquipmentDto.setVehicleType(certificates[0]);
rescueEquipmentDto.setVehicleTypeCode(certificates[1]);
code = certificates[1];
} else {
continue;
}
if(rescueEquipmentDto.getCompany()!=null){
String[] certificates = rescueEquipmentDto.getCompany().split("@");
rescueEquipmentDto.setCompany(certificates[0]);
rescueEquipmentDto.setCompanyId(Long.parseLong(certificates[1]));
// 获取救援装备已经存在的装备 如果存在则不导入
LambdaQueryWrapper<RescueEquipment> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(RescueEquipment::getCompanyId,Long.parseLong(certificates[1])).eq(RescueEquipment::getIsDelete,false);
List<RescueEquipment> tempList = rescueEquipmentServiceImpl.list(queryWrapper);
for(RescueEquipment temp : tempList) {
if(temp.getVehicleTypeCode().equals(code)) {
continue outer; // 已经存在则不导入继续循环
}
}
} else {
continue ;
}
rescueEquipmentServiceImpl.createWithModel(rescueEquipmentDto);
}
}
}
private void excelImportLinkageUnitZhDto(MultipartFile multipartFile) throws Exception {
......
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