Commit fbe6db89 authored by chenhao's avatar chenhao

添加120急救站开发的代码

parent b1e78d84
package com.yeejoin.amos.boot.biz.common.service;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import java.util.List;
......@@ -18,4 +19,6 @@ public interface IDataDictionaryService {
Object gwmcDataDictionary(String type) throws Exception;
List<MenuFrom> getGWMCDataDictionary(String type) throws Exception;
public List<DataDictionary> getByType(String type);
}
......@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.dto.DataDictionaryDto;
......@@ -106,4 +107,10 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
return list;
}
public List<DataDictionary> getByType(String type) {
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<DataDictionary>();
wrapper.eq(DataDictionary::getIsDelete, false);
wrapper.eq(DataDictionary::getType, type);
return this.baseMapper.selectList(wrapper);
}
}
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 = "DutyFirstAidDto", description = "120急救站值班")
public class DutyFirstAidDto 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 = "120急救站")
private String firstAid;
@ApiModelProperty(value = "120急救站Id")
private String firstAidId;
}
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 = "DutyFirstAidExcleDto", description = "120急救站值班")
public class DutyFirstAidExcleDto 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 postType;
@ExcelProperty(value = "岗位", index = 3)
@ApiModelProperty(value = "岗位名称")
private String postTypeName;
@ExcelProperty(value = "120急救站", index = 4)
@ApiModelProperty(value = "120急救站")
private String firstAid;
@ExcelIgnore
@ApiModelProperty(value = "120急救站Id")
private String firstAidId;
@ExcelIgnore
@ApiModelProperty(value = "值班信息")
private List<DutyPersonShiftDto> dutyShift;
@ExcelIgnore
@ApiModelProperty(value = "值班开始时间")
private String startTime;
@ExcelIgnore
@ApiModelProperty(value = "值班结束时间")
private String endTime;
}
......@@ -30,5 +30,4 @@ public interface IDutyCarService extends IDutyCommonService {
*/
JSONObject isFireCarDriver();
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType);
}
......@@ -116,4 +116,6 @@ public interface IDutyCommonService {
* @param dutyShiftList
*/
public void insertPersonShift(Long instanceId, List<DutyPersonShiftDto> dutyShiftList);
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType);
}
package com.yeejoin.amos.boot.module.common.api.service;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
public interface IDutyFireFightingService extends IDutyCommonService {
......@@ -17,6 +20,7 @@ public interface IDutyFireFightingService extends IDutyCommonService {
* @return List<DutyCarDto>
*/
DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto);
List<Map<String, Object>> getFirstAidExportData(List<String> companyIdList);
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType);
}
package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
public interface IDutyFirstAidService extends IDutyCommonService {
/**
* 值班信息保存
* @param DutyFireFightingDto 对象
* @return List<DutyCarDto>
*/
DutyFirstAidDto save(DutyFirstAidDto dto);
/**
* 更新
* @param instanceId 实例id
* @param DutyFireFightingDto 业务对象
* @return List<DutyCarDto>
*/
DutyFirstAidDto update(Long instanceId, DutyFirstAidDto dto);
}
......@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import java.util.List;
import java.util.Map;
/**
* 消防队伍 服务类
......@@ -43,5 +44,7 @@ public interface IFireTeamService {
*
* **/
List<FireTeamZhDto> getFireTeamCountList();
public List<FireTeam> getFirstAidForTypeCodeAndCompanyId(String dicCode,String typeCode,Long companyId);
}
......@@ -239,4 +239,6 @@ public interface IOrgUsrService {
OrgUsr selectByAmosOrgId(Long id);
public List<OrgUsr> getPersonListByParentIds(List<String> ids) ;
}
......@@ -27,6 +27,7 @@ public enum ExcelEnums {
JYZB ("救援装备", "救援装备", "com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto","JYZB"),//("JYZB","救援装备")
XFZB ("消防装备", "消防装备", "com.yeejoin.amos.boot.module.common.api.dto.EquipmentDetailDownloadTemplateDto","XFZB"),//("XFZB","消防装备")
WXXFZB("微型消防站值班", "微型消防站值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingExcleDto","WXXFZB"),//("WXXFZB","微型消防站值班")
JJZB("120急救站值班", "120急救站值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidExcleDto","JJZB"),//("JJZB","120急救站值班")
XFAQBG("消防安全报告", "消防安全报告", "com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrSafeReportExcelDto","XFAQBG");//("XFAQBG","微型消防站值班")
private String fileName;
private String sheetName;
......
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.DutyFirstAidDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@RestController
@Api(tags = "120急救站值班接口Api")
@RequestMapping(value = "/common/duty-FirstAid")
public class DutyFirstAidController extends BaseController{
@Autowired
IDutyFirstAidService iDutyFirstAidService;
/**
* 值班列表视图--分页
*
* @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(iDutyFirstAidService.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(iDutyFirstAidService.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(iDutyFirstAidService.statisticsDay(beginDate, endDate));
}
/**
* 调班
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping("/duty-adjust")
@ApiOperation(httpMethod = "POST", value = "调班保存", notes = "调班保存")
public ResponseModel dutyAdjustSave(@RequestBody DutyFirstAidDto dto) {
return ResponseHelper.buildResponse(iDutyFirstAidService.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 DutyFirstAidDto dto) {
return ResponseHelper.buildResponse(iDutyFirstAidService.update(instanceId, dto));
}
/**
* 微型消防站导出
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/exportExcel")
@ApiOperation(httpMethod = "GET", value = "120急救站导出", notes = "120急救站导出")
public ResponseModel exportExcel(HttpServletResponse response, @ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) throws ParseException {
return ResponseHelper.buildResponse(iDutyFirstAidService.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(iDutyFirstAidService.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(iDutyFirstAidService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType));
}
}
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import static org.hamcrest.CoreMatchers.nullValue;
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.LinkedHashMap;
......@@ -19,7 +17,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
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.entity.DynamicFormColumn;
......
......@@ -36,6 +36,7 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
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.DutyShiftDto;
......@@ -299,6 +300,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
list = jsonArray.toJavaList(DutyPersonDto.class);
}else if("dutyFireFighting".equals(groupCode)){
list = jsonArray.toJavaList(DutyFireFightingDto.class);
}else if("dutyFirstAid".equals(groupCode)){
list = jsonArray.toJavaList(DutyFirstAidDto.class);
}
return list;
}
......@@ -591,4 +594,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}
}
@Override
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) {
// TODO Auto-generated method stub
return null;
}
}
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService;
import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
@Service
public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements IDutyFirstAidService {
@Autowired
IFireTeamService fireTeamService;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
@Autowired
OrgUsrServiceImpl orgUsrServiceImpl;
@Autowired
DataDictionaryServiceImpl dataDictionaryService;
public String getGroupCode() {
return "dutyFirstAid";
}
@Override
public DutyFirstAidDto save(DutyFirstAidDto dto) {
FireTeam fireStationDtoResult = fireTeamService.getFireTeamBySequenceNbr(Long.parseLong(dto.getFirstAidId()));
dto.setFirstAid(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 DutyFirstAidDto update(Long instanceId, DutyFirstAidDto dto) {
updateDynamicFormInstance(this.getGroupCode(), instanceId, Bean.BeantoMap(dto));
insertPersonShift(instanceId, dto.getDutyShift());
return dto;
}
@Override
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "firstAidId", "firstAid", "teamName", "result.firstAidId");
if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) {
return null;
}
List<Object> detailList = new ArrayList<Object>();
for (Map<String, Object> map : equipmentList) {
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
LinkedHashMap<String, Object> titleMap_1 = new LinkedHashMap<String, Object>();
titleMap_1.put("120急救站", map.get("firstAid").toString());
resultList.add(titleMap_1);
LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>();
titleMap_2.put("单位/部门", map.get("teamName").toString());
resultList.add(titleMap_2);
String carId = map.get("firstAidId").toString();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId);
if (instanceMap == null) {
continue;
}
String instanceId = instanceMap.get("instanceIds").toString();
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if (dutyList != null && dutyList.size() > 0) {
for (Map<String, Object> dutyDetail : dutyList) {
if (!dutyDetail.containsKey("name")) {
continue;
}
// 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper
.getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds,
dutyDetail.get("name").toString());
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue;
}
LinkedHashMap<String, Object> infoMap_1 = new LinkedHashMap<String, Object>();
infoMap_1.put(dutyDetail.get("name").toString(), "");
resultList.add(infoMap_1);
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 = new LinkedHashMap<String, Object>();
infoMap_2.put(specify.get("postTypeName").toString(), specify.get("userName").toString());
resultList.add(infoMap_2);
}
}
}
}
detailList.add(resultList);
}
return detailList;
}
public List< Map<String, Object>> getFirstAidExportData(List<String> ids) {
List< Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
String dicCodeString = "830";
String typeString = "XFJGLX";
List<OrgUsr> personList = orgUsrServiceImpl.getPersonListByParentIds(ids);
personList.stream().forEach(i -> {
String userNameString =i.getBizOrgName()+ "@" +i.getSequenceNbr();
Map<String, Object> map = new HashMap<String, Object>();
List<FireTeam> list = fireTeamService.getFirstAidForTypeCodeAndCompanyId(dicCodeString, typeString,
Long.parseLong(i.getParentId()));
List<String> firstAidSimpleList = new ArrayList<String>();
List<String> companySimpleList = new ArrayList<String>();
list.stream().forEach(m -> {
String firstAidNameString = m.getName() + "@" + m.getSequenceNbr();
String companyNameString = m.getCompanyName() + "@" + m.getCompany();
firstAidSimpleList.add(firstAidNameString);
companySimpleList.add(companyNameString);
});
List<DataDictionary> dataDicList= dataDictionaryService.getByType(typeString);
List<String> dataDicSimpleList = new ArrayList<String>();
dataDicList.stream().forEach(l->{
String dataDic = l.getName() + "@" +l.getCode();
dataDicSimpleList.add(dataDic);
});
map.put("firstAidName", firstAidSimpleList);
map.put("companyName", companySimpleList);
map.put("userName", userNameString);
map.put("postTypeName",dataDicSimpleList);
resultList.add(map);
});
return resultList;
}
}
......@@ -1527,6 +1527,19 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
wrapper.eq(OrgUsr::getBizOrgType, OrgPersonEnum.人员.getKey());
return this.baseMapper.selectList(wrapper);
}
/**
* 查询组织机构下面的人员信息
*
* @param id
* @return
*/
public List<OrgUsr> getPersonListByParentIds(List<String> ids) {
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<OrgUsr>();
wrapper.eq(OrgUsr::getIsDelete, false);
wrapper.in(OrgUsr::getParentId, ids);
wrapper.eq(OrgUsr::getBizOrgType, OrgPersonEnum.人员.getKey());
return this.baseMapper.selectList(wrapper);
}
@Override
public List<OrgUsrExcelDto> exportPersonToExcelByParentId(Long parentId) {
......
......@@ -243,4 +243,11 @@ public class FireTeamController extends BaseController {
List<FirefightersDto> fighters = iFireTeamService.getFighterByTeamId(teamIdList);
return ResponseHelper.buildResponse(fighters);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/firstAid", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "急救站", notes = "急救站")
public Object getFirstAidForTypeCodeAndCompanyId(String code, String typeCode,Long companyId) {
return ResponseHelper.buildResponse(iFireTeamService.getFirstAidForTypeCodeAndCompanyId(code,typeCode,companyId));
}
}
\ No newline at end of file
......@@ -1187,6 +1187,8 @@ public class ExcelServiceImpl {
data = initDutyPersonTemplate(ids);
} else if (ExcelEnums.WXXFZB.getType().equals(excelDto.getType())) {
data = initDutyDutyFireFightingTemplate(ids);
} else if (ExcelEnums.JJZB.getType().equals(excelDto.getType())) {
//data = initDutyDutyFirstAidTemplate(ids);
}
// 获取日期
List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, endDate);
......@@ -1199,7 +1201,29 @@ public class ExcelServiceImpl {
}
}
private List<List<Object>> initDutyDutyFirstAidTemplate(String ids) {
List<List<Object>> data = new ArrayList<>();
// 根据id列表获取单位下的微型消防站集合
List<String> companyIdList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(ids)) {
companyIdList = Lists.newArrayList(ids.split(","));
}
List<Map<String, Object>> personDetailList = dutyFireFightingService.getFirstAidExportData(companyIdList);
if (!personDetailList.isEmpty()) {
AtomicInteger row = new AtomicInteger(1);
personDetailList.forEach(o -> {
ArrayList<Object> list = new ArrayList<>();
list.add(row.getAndIncrement());
list.add(null);
list.add(null);
list.add(null);
list.add(o.get("fireStation"));
data.add(list);
});
}
return data;
}
private List<List<Object>> initDutyDutyFireFightingTemplate(String ids) {
List<List<Object>> data = new ArrayList<>();
// 根据id列表获取单位下的微型消防站集合
......
......@@ -1753,14 +1753,34 @@
</changeSet>
<changeSet id="2021-10-14" author="chenhao-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_dynamic_form_group" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_dynamic_form_group"/>
</preConditions>
<comment>add data cb_dynamic_form_group</comment>
<sql>
INSERT INTO cb_dynamic_form_group (`sequence_nbr`, `group_name`, `group_code`, `parent_id`, `group_config`, `org_code`, `sort`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`) VALUES ('132828674816', '值班120急救站', 'dutyFirstAid', '0', NULL, '10', '1', NULL, NULL, '2021-10-14 16:48:41', '\0');
</sql>
</changeSet>
<changeSet id="2021-10-14" author="chenhao-2">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_dynamic_form_column" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_dynamic_form_column"/>
</preConditions>
<comment>add data cb_dynamic_form_column</comment>
<sql>
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812077', 'userId', '用户id', 'input', '132828674816', 'eq', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812078', 'userName', '用户名称', 'input', '132828674816', 'like', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812079', 'postType', '岗位id', 'input', '132828674816', 'eq', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812080', 'postTypeName', '岗位名称', 'input', '132828674816', 'like', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812081', 'firstAid', '120急救站', 'input', '132828674816', 'like', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812082', 'firstAidId', '120急救站Id', 'input', '132828674816', 'eq', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812083', 'teamId', '单位名称id', 'input', '132828674816', 'eq', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812084', 'teamName', '单位名称', 'input', '132828674816', 'like', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812076', 'teamName', '单位名称', 'input', '132828674815', 'like', '\0', '\0', 'dutyFireFighting', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
</sql>
</changeSet>
</databaseChangeLog>
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