Commit 7808ce1a authored by tangwei's avatar tangwei

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents 0e402daf 59f742c4
......@@ -36,4 +36,7 @@ public class ShiftChangeDto extends BaseDto {
@ApiModelProperty(value = "操作人名称")
private String recUserName;
@ApiModelProperty(value = "日常工作")
private String dutyWork;
}
......@@ -43,4 +43,10 @@ public class ShiftChange extends BaseEntity {
*/
@TableField("remark")
private String remark;
/**
* 日常工作
*/
@TableField("duty_work")
private String dutyWork;
}
......@@ -129,7 +129,9 @@
a.rescue_grid,
a.coordinate_x,
a.coordinate_y,
a.response_level
a.response_level,
a.system_source,
a.system_source_code
FROM
jc_alert_called a
<where>
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.command.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -17,6 +18,7 @@ import com.yeejoin.amos.boot.module.command.api.dto.CarTaskDto;
import com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto;
import com.yeejoin.amos.boot.module.command.biz.service.impl.RemoteSecurityService;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient;
......@@ -39,10 +41,14 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources;
import com.yeejoin.amos.boot.module.jcs.api.entity.UserCar;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyResourcesMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.*;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -50,7 +56,9 @@ import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.DateUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -65,6 +73,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* *指挥资源Api
......@@ -120,18 +129,24 @@ public class CommandController extends BaseController {
private String readUrl;
@Autowired
EquipFeignClient equipFeignClient;
@Autowired
PowerTransferMapper powerTransferMapper;
@Autowired
VideoFeignClient videoFeignClient;
@Autowired
IKeySiteService keySiteService;
@Autowired
EquipFeignClient equipFeignService;
@Autowired
IPowerTransferCompanyService powerTransferCompanyService;
@Autowired
IPowerTransferCompanyResourcesService powerTransferCompanyResourcesService;
@Autowired
PowerTransferCompanyResourcesMapper powerTransferCompanyResourcesMapper;
@Autowired
ISourceFileService sourceFileService;
@Value("${video.url}")
......@@ -1031,9 +1046,28 @@ public class CommandController extends BaseController {
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "fireCar/list")
@ApiOperation(httpMethod = "GET", value = "车辆资源", notes = "车辆资源")
public ResponseModel<List<Map<String,Object>>> getTeamCarList(RequestData par) {
ResponseModel<List<Map<String, Object>>> date= equipFeignClient.getTeamCarList(par.getLongitude(),par.getLatitude());
public ResponseModel<Object> getTeamCarList(RequestData par) {
/*bug 2583 地图屏,消防车辆类型时,左侧车辆状态显示错误 陈召 开始 */
ResponseModel<List<Map<String, Object>>> date= equipFeignClient.getTeamCarList(par.getLongitude(),par.getLatitude());
List<Map<String, Object>> result = date.getResult();
QueryWrapper<PowerTransferCompanyResources> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status", FireCarStatusEnum.执行中.getCode() );
List<PowerTransferCompanyResources> alertFormValue = powerTransferCompanyResourcesMapper.selectList(queryWrapper);
result.stream().forEach(e->{
if (e.get("carState").equals("在位")){
e.put("carState",FireCarStatusEnum.执勤.getName());
}
String sequenceNbr = e.get("sequenceNbr").toString();
//同步力量调派车辆任务状态
alertFormValue.stream().forEach(v->{
if (v.getResourcesId().equals(sequenceNbr)) {
String carStatus = v.getCarStatus();
e.put("carState",carStatus!=null?FireCarStatusEnum.getEnum(carStatus).getName():null);
}
});
});
return ResponseHelper.buildResponse(date!=null?date.getResult():null);
/*bug 2583 地图屏,消防车辆类型时,左侧车辆状态显示错误 2021-10-26 陈召 结束 */
}
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
......
......@@ -25,7 +25,6 @@ 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.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService;
......
......@@ -8,9 +8,6 @@ import java.util.List;
import java.util.Map;
import java.util.Random;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -18,6 +15,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -26,6 +24,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.dto.CurrentStatusDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.dto.StatusDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
......
......@@ -706,7 +706,7 @@ public class MaintenanceCompanyServiceImpl
maintenanceCompany.put("code", list.getCode());
maintenanceCompany.put("name", list.getName());
maintenanceCompany.put("type", 1);
maintenanceCompany.put("parentId", null);
maintenanceCompany.put("parentId", 0);
// 查询该维保单位下的业主信息
List<OrgUsrDto> orgUsrDtos = this.baseMapper.selectOrgUsrList(list.getSequenceNbr());
orgUsrDtos.forEach(orgUsrDto -> {
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl;
......@@ -41,10 +43,25 @@ public class ExcelController extends BaseController {
@Autowired
DataSourcesImpl dataSources;
@Autowired
RedisUtils redisUtils;
@Autowired
Sequence sequence;
private static final String NOT_DUTY = "休班";
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取上传excle文件是否成功")
@GetMapping("/get/template/isSuccess/{key}")
public ResponseModel<Object> getTemplateIsSuccess(HttpServletResponse response, @PathVariable(value = "key") String key) {
if (redisUtils.hasKey(key)) {
Object obj = redisUtils.get(key);
return ResponseHelper.buildResponse(obj);
}
return ResponseHelper.buildResponse(null);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "下载模板")
......@@ -88,10 +105,13 @@ public class ExcelController extends BaseController {
@PostMapping("/upload/{type}")
public ResponseModel<Object> upload(@RequestPart("file") MultipartFile multipartFile, @PathVariable(value = "type") String type) {
try {
long uuid = sequence.nextId();
String uuidString = Long.toString(uuid);
redisUtils.set(uuidString, 0);
ExcelEnums excelEnums= ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
excelService.commonUpload(multipartFile, excelDto);
return ResponseHelper.buildResponse(null);
excelService.commonUpload(multipartFile, excelDto,uuidString);
return ResponseHelper.buildResponse(uuidString);
} catch (RuntimeException e) {
e.printStackTrace();
throw new BadRequest("文件格式不正确或excel 模板不匹配"); // BUG 2821 by litw 2021年9月16日
......
......@@ -96,6 +96,7 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
......@@ -196,7 +197,7 @@ public class ExcelServiceImpl {
@Autowired
DynamicFormInstanceServiceImpl dynamicFormInstanceService;
public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException {
String url = excelDto.getClassUrl();
Class<?> clz = Class.forName(url);
......@@ -352,8 +353,8 @@ public class ExcelServiceImpl {
break;
}
}
public void commonUpload(MultipartFile multipartFile, ExcelDto excelDto) throws Exception {
public void commonUpload(MultipartFile multipartFile, ExcelDto excelDto,String uuidString) throws Exception {
switch (excelDto.getType()) {
case "WHP":
......@@ -378,10 +379,10 @@ public class ExcelServiceImpl {
excelImportFirefighters(multipartFile);
break;
case "CLZQ":
excelImportDutyPerson(multipartFile, "CLZQ");
excelImportDutyPerson(multipartFile, "CLZQ",uuidString);
break;
case "RYZB":
excelImportDutyPerson(multipartFile, "RYZB");
excelImportDutyPerson(multipartFile, "RYZB",uuidString);
break;
case "WBRY":
excelImportMaintenancePerson(multipartFile);
......@@ -403,13 +404,13 @@ public class ExcelServiceImpl {
excelImportLinkageUnitJYZBDto(multipartFile);
break;
case "WXXFZB":
excelImportDutyPerson(multipartFile, "WXXFZB");
excelImportDutyPerson(multipartFile, "WXXFZB",uuidString);
break;
case "XFAQBG":
excelImportSafeReport(multipartFile);
break;
case "JJZB":
excelImportDutyPerson(multipartFile, "JJZB");
excelImportDutyPerson(multipartFile, "JJZB",uuidString);
break;
}
return;
......@@ -999,10 +1000,22 @@ public class ExcelServiceImpl {
});
fireExpertsServiceImpl.saveBatch(excelEntityList);
}
private void excelImportDutyPerson(MultipartFile multipartFile, String dutyType) throws Exception {
String fileName = multipartFile.getOriginalFilename();
@Async
private void excelImportDutyPerson(MultipartFile multipartFile, String dutyType,String uuidString) throws Exception {
try {
ImportDutyPerson(multipartFile,dutyType);
if(redisUtils.hasKey(uuidString)){
redisUtils.set(uuidString, 1);
}
} catch (Exception e) {
if(redisUtils.hasKey(uuidString)){
redisUtils.set(uuidString, 2);
}
}
}
private void ImportDutyPerson(MultipartFile multipartFile, String dutyType) throws Exception {
String fileName = multipartFile.getOriginalFilename();
if (fileName == null) {
throw new Exception("文件不存在!");
}
......@@ -1036,8 +1049,8 @@ public class ExcelServiceImpl {
dutyFirstAidService.saveImportData(dataList);
}
}
}
}
private void initDutyFirstAidData(XSSFSheet sheet, List<Map<String, Object>> dataList, List<Date> dayByMonth) {
for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) {
DutyFirstAidDto dutyFirstAidDto = new DutyFirstAidDto();
......@@ -1128,6 +1141,10 @@ public class ExcelServiceImpl {
if (row == null) {
continue;
}
Cell cell4 = row.getCell(4);
if(cell4 ==null) {
continue;
}
Cell cell = row.getCell(1);
if (cell != null) {
String[] split = cell.toString().split("@");
......@@ -1184,6 +1201,10 @@ public class ExcelServiceImpl {
if (row == null) {
continue;
}
Cell cell4 = row.getCell(4);
if(cell4 ==null) {
continue;
}
Cell cell = row.getCell(1);
if (cell != null) {
dutyPersonDto.setUserId(cell.toString());
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.base.Joiner;
import com.itextpdf.text.*;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPTable;
import com.yeejoin.amos.boot.biz.common.utils.PdfUtils;
......@@ -18,26 +42,6 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.ShiftChangePowerDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.ShiftChange;
import com.yeejoin.amos.boot.module.jcs.api.mapper.ShiftChangeMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IShiftChangeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import springfox.documentation.spring.web.json.Json;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 交接班记录表服务实现类
......@@ -59,7 +63,6 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha
@Override
public Map<String, Object> createFormAndEntry(Map<String, Object> model) {
Long instanceId = dynamicFormInstanceService.commonSave(GROUP_CODE, model);
ShiftChange shiftChange = (ShiftChange) Bean.mapToBean(model, ShiftChange.class);
shiftChange.setInstanceId(instanceId);
......
......@@ -1915,7 +1915,15 @@
ALTER TABLE jc_alert_submitted MODIFY COLUMN sender varchar(50) DEFAULT NULL COMMENT '发送人';
</sql>
</changeSet>
<changeSet author="ltw" id="2021-10-26-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_shift_change"/>
</preConditions>
<comment>119值班交接班填报新增工作日常字段</comment>
<sql>
ALTER TABLE `jc_shift_change` ADD duty_work varchar(4000) NULL COMMENT '日常工作';
</sql>
</changeSet>
<changeSet author="tw" id="2021-10-26-1">
......
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