Commit 8f3fd402 authored by kongfm's avatar kongfm

Merge remote-tracking branch 'origin/developer' into developer

parents 9f19ead7 2e4b2ab0
......@@ -71,6 +71,35 @@ public interface EquipFeignClient {
@RequestMapping(value = "/car/list-all", method = RequestMethod.GET)
ResponseModel<Object> getFireCarListAll();
/**
* 获取本单位下车辆列表
*
* @return
*/
@RequestMapping(value = "/car/list-allpag", method = RequestMethod.GET)
ResponseModel<Object> equipmentCarList( @RequestParam Long teamId,
@RequestParam String name,
@RequestParam String code ,
@RequestParam String pageNum,
@RequestParam String pageSize,
@RequestParam Long id);
/**
* 车辆树
**/
@RequestMapping(value = "/equipment-category/tree/2", method = RequestMethod.GET)
ResponseModel<Object> gettree();
/**
* 获取个队伍下车辆统计
*
......
......@@ -72,4 +72,60 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
@Param("beginDate") String beginDate,
@Param("endDate") String endDate
);
/**
* 获取指定日期下的当前排班的人员列表
* eg : {"name":"夜班","value":"李某某、张作霖、张作相"}
* @param dutyDate
* @param groupCode
* @param targetFiled
* @return
*/
List<Map<String, Object>> getSpecifyDateList(String dutyDate,String groupCode,String[] instanceIds,String params);
/**
* 获取指定日期下的装备ID、eg:车辆、微型消防站
* @param dutyDate
* @param groupCode
* @param targetFiled
* @return
*/
List<Map<String, Object>> getEquipmentForSpecifyDate(String dutyDate,String groupCode,String equipmentId,String equipmentName,String teamName,String groupByName);
/**
* 通过装备ID查询指定如期下的该装备所包含的InstanceId
* @param dutyDate
* @param groupCode
* @param targetId eg: carId
* @return
*/
Map<String, Object> getInstanceIdForSpecifyDateAndEquipment(String dutyDate,String groupCode,String targetId);
/**
* 获取指定日期装备的操作人员,例如车辆的驾驶员
* @param dutyDate
* @param groupCode
* @param instanceIds
* @param operator
* @return
*/
Map<String, Object> getEquipmentOperator(String dutyDate,String groupCode,String[] instanceIds,String operator,String duty);
/**
* 获取指定日期下的排班人员与岗位等信息
* @param dutyDate
* @param groupCode
* @param instanceIds
* @return
*/
List<Map<String, Object>> getPositionStaffDutyForSpecifyDate(String dutyDate,String groupCode,String[] instanceIds,String duty);
/**
* 获取指定日期下的班次信息
* @param duty
* @return
*/
List<Map<String, Object>> getDutyForSpecifyDate(String duty);
}
......@@ -29,4 +29,6 @@ public interface IDutyCarService extends IDutyCommonService {
* @return
*/
JSONObject isFireCarDriver();
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType);
}
......@@ -17,4 +17,6 @@ public interface IDutyFireFightingService extends IDutyCommonService {
* @return List<DutyCarDto>
*/
DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto);
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType);
}
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
/**
......@@ -27,9 +28,9 @@ public interface IFirefightersService {
List<Menu> getFirefightersJobTitleCount() throws Exception;
void saveFirefighters(FirefightersInfoDto firefighters);
Firefighters selectByAmosOrgId(Long id);
......
......@@ -235,4 +235,8 @@ public interface IOrgUsrService {
List<OrgUsr> selectCompanyUsers(Long orgUnitId);
OrgUsr selectByAmosOrgId(Long id);
}
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "UserCarDto", description = "人与车")
public class UserCarDto extends BaseDto {
@TableField("amos_user_name")
private String amosUserName;
@TableField("amos_user_id")
private Long amosUserId;
@TableField("car_num")
private String carNum;
@TableField("car_id")
private Long carId;
}
package com.yeejoin.amos.boot.module.jcs.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* 人员与车辆关系
*
*
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("jc_user_car")
public class UserCar extends BaseEntity {
private static final long serialVersionUID = 1L;
@TableField("amos_user_name")
private String amosUserName;
@TableField("amos_user_id")
private Long amosUserId;
@TableField("car_num")
private String carNum;
@TableField("car_id")
private Long carId;
}
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftListTreeDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.api.entity.UserCar;
import java.util.List;
import java.util.Map;
/**
*
*人员与车辆信息
*/
public interface UserCarMapper extends BaseMapper<UserCar> {
}
package com.yeejoin.amos.boot.module.jcs.api.service;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftListTreeDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.api.entity.UserCar;
import java.util.List;
import java.util.Map;
/**
*
*/
public interface IUserCarService {
UserCar selectByAmosUserId(Long id);
void add (UserCar userCar);
void delete (UserCar userCar);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.UserCarMapper">
</mapper>
......@@ -18,6 +18,8 @@ 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.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
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.IotFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService;
......@@ -40,13 +42,10 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.dto.StateDot;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
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.service.IAircraftService;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferCompanyService;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService;
import com.yeejoin.amos.boot.module.jcs.api.service.*;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.PermissionModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -149,6 +148,11 @@ public class CommandController extends BaseController {
IDutyCarService iDutyCarService;
@Autowired
IotFeignClient iotFeignClient;
@Autowired
IUserCarService userCarService;
/**
* 警情列表
*
......@@ -1178,10 +1182,62 @@ public class CommandController extends BaseController {
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "equipmentCarList")
@ApiOperation(httpMethod = "GET", value = "车辆列表", notes = "车辆列表")
public ResponseModel<Object> equipmentCarList( String name,
String code ,
String pageNum,
String pageSize,
Boolean isNo ) {
//获取用户所属单位id
AgencyUserModel agencyUserModel= getUserInfo();
Long teamId=null;
// Firefighters orgUsr= firefightersService.selectByAmosOrgId(Long.valueOf(agencyUserModel.getUserId()));
// teamId=orgUsr!=null?Long.valueOf(orgUsr.getFireTeamId()):null;
Long id =null;
//获取用户已绑定车辆id、
UserCar userCar=userCarService.selectByAmosUserId(Long.valueOf(agencyUserModel.getUserId()));
if(isNo!=null&&isNo){
id =userCar!=null?userCar.getAmosUserId():null;
}
ResponseModel<Object> data= equipFeignClient.equipmentCarList(teamId,name,code , pageNum,pageSize,id);
Map map =new HashMap();
map.put("select",userCar!=null?userCar.getAmosUserId():null);
map.put("data",data!=null?data.getResult():null);
return ResponseHelper.buildResponse(map);
}
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "gettree")
@ApiOperation(httpMethod = "GET", value = "车辆分类", notes = "车辆分类")
public ResponseModel<Object> gettree( ) {
ResponseModel<Object> data= equipFeignClient.gettree();
return ResponseHelper.buildResponse(data!=null?data.getResult():null);
}
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "adduserCar/{type}", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "增加绑定", notes = "增加绑定")
public ResponseModel<Object> adduserCar(@PathVariable String type,UserCar userCar ) {
AgencyUserModel agencyUserModel= getUserInfo();
userCar.setAmosUserId(Long.valueOf(agencyUserModel.getUserId()));
userCar.setAmosUserName(agencyUserModel.getUserName());
if("1".equals(type)){
userCarService.add(userCar);
}else{
userCarService.delete(userCar);
}
return ResponseHelper.buildResponse(null);
}
}
\ No newline at end of file
......@@ -152,7 +152,7 @@ public class DutyCarController extends BaseController {
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(iDutyCarService.dayDutyPersonList(dutyDay,shiftId,postType));
return ResponseHelper.buildResponse(iDutyCarService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType));
}
}
\ No newline at end of file
......@@ -155,6 +155,6 @@ public class DutyFireFightingController extends BaseController{
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));
return ResponseHelper.buildResponse(iDutyFireFightingService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType));
}
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireStation;
......@@ -139,4 +140,18 @@ public class FireStationController extends BaseController {
public ResponseModel<List<FireStationDto>> selectForList() {
return ResponseHelper.buildResponse(fireStationServiceImpl.queryForFireStationList(false));
}
/**
* 查询机场单位
*
* @return
* @throws Exception
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/company/listTree", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "查询机场单位树", notes = "查询机场单位树")
public ResponseModel<List<MenuFrom>> listCompanyTree() throws Exception {
List<MenuFrom> menus = fireStationServiceImpl.getCompanyTeamTree();
return ResponseHelper.buildResponse(menus);
}
}
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mysql.cj.x.protobuf.MysqlxDatatypes;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils;
......@@ -31,10 +32,12 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourcePoolSer
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -50,9 +53,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
......@@ -90,8 +91,14 @@ public class WaterResourceController extends BaseController {
String resourceType = model.getResourceType();
Optional<WaterResourceTypeEnum> resourceTypeEnum = EnumsUtils.getEnumObject(WaterResourceTypeEnum.class,
e -> e.getCode().equals(resourceType));
/*bug 2913 截取名字防止传递文件名太长随机生成文件名保存 chenzhao 2021-09-30 start*/
List<Object> realityImgList = model.getRealityImgList();
realityImgList.forEach(i->{
((Map<String, Object>) i).put("name",QRCodeUtil.generateQRCode()+"."+i.toString().substring(i.toString().lastIndexOf(".") + 1).toLowerCase());
});
/*截取名字防止传递文件名太长随机生成文件名保存 chenzhao 2021-09-30 end*/
model.setResourceTypeName(resourceTypeEnum.get().getName());
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList()));
model.setRealityImg(JSONArray.toJSONString(realityImgList));
model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList()));
/*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/
/* if(model.getAddress()!=null){
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
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.springframework.transaction.annotation.Transactional;
......@@ -9,13 +13,22 @@ 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.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService;
@Service
public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implements IDutyFireFightingService {
@Autowired
FireStationServiceImpl fireStationServiceImpl;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
public String getGroupCode() {
return "dutyFireFighting";
}
@Override
@Transactional(rollbackFor = Exception.class)
public DutyFireFightingDto save(DutyFireFightingDto dto) {
......@@ -32,13 +45,61 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
@Override
public DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto) {
updateDynamicFormInstance(this.getGroupCode(),instanceId,Bean.BeantoMap(dto));
insertPersonShift(instanceId, dto.getDutyShift());
updateDynamicFormInstance(this.getGroupCode(), instanceId, Bean.BeantoMap(dto));
insertPersonShift(instanceId, dto.getDutyShift());
return dto;
}
public String getGroupCode() {
return "dutyFireFighting";
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "fireFightingId", "fireFighting", "teamName","result.fireFightingId");
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("微型消防站", map.get("fireFighting").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("fireFightingId").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;
}
}
package com.yeejoin.amos.boot.module.common.biz.service.impl;
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.DutyPersonDto;
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.DutyShift;
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.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
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;
......@@ -20,13 +19,15 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
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.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONArray;
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.DutyPersonDto;
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.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
/**
* @author DELL
......@@ -36,6 +37,7 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
@Autowired
EquipFeignClient equipFeign;
@Override
public String getGroupCode(){
......@@ -234,4 +236,98 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
});
return temp;
}
public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType) {
List<Map<String, Object>> list = dayDutyPersonList(dutyDay, shiftId, postType);
list.stream().forEach(i->{
List<Object> fieldsList= new ArrayList<Object>();
List<Object>infoList= new ArrayList<Object>();
LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
map.put("name", "微型消防站");
map.put("value",i.get("deptName").toString());
map.put("id","1");
fieldsList.add(map);
map.clear();
map.put("name", "微型消防站");
map.put("value",i.get("deptName").toString());
});
return postType;
}
public static void main(String[] args) {
String ssString="[{\"teamName\":\"发士大夫大师傅\",\"shiftId\":\"1437585222345547778\",\"carName\":\"特种消防车(46586458)\",\"postType\":\"\",\"dutyArea\":\"测试控制室\",\"dutyAreaId\":\"1382166994773610497\",\"postTypeName\":\"\",\"userName\":\"故障报修\",\"userId\":\"1428653787706347522\",\"dutyDate\":\"2021-10-12 00:00:00\",\"carId\":\"1432590747256770562\",\"shiftName\":\"晚班\",\"instanceId\":\"1447490875843239937\",\"teamId\":\"1404995716634050561\",\"groupCode\":\"dutyCar\"},{\"teamName\":\"发士大夫大师傅\",\"shiftId\":\"1432883228491972609\",\"carName\":\"特种消防车(46586458)\",\"postType\":\"\",\"dutyArea\":\"消防小室-shg\",\"dutyAreaId\":\"1382530839199387650\",\"postTypeName\":\"\",\"userName\":\"78678676\",\"userId\":\"1435886728803000322\",\"dutyDate\":\"2021-10-12 00:00:00\",\"carId\":\"1432590747256770562\",\"shiftName\":\"夜班\",\"instanceId\":\"1447490812534415361\",\"teamId\":\"1404995716634050561\",\"groupCode\":\"dutyCar\"},{\"teamName\":\"发士大夫大师傅\",\"shiftId\":\"1432883228491972609\",\"carName\":\"特种消防车(46586458)\",\"postType\":\"1\",\"dutyArea\":\"建构住-shg\",\"dutyAreaId\":\"1382157469081407490\",\"postTypeName\":\"指挥员\",\"userName\":\"张小四6\",\"userId\":\"1435072204550225922\",\"dutyDate\":\"2021-10-12 00:00:00\",\"carId\":\"1432590747256770562\",\"shiftName\":\"夜班\",\"instanceId\":\"1447490699435008001\",\"teamId\":\"1404995716634050561\",\"groupCode\":\"dutyCar\"}]\r\n"
+ "";
List<Map> jjList= JSONArray.parseArray(ssString, Map.class);
Map< String, String> map20 = new HashMap<String, String>();
jjList.forEach(i->{
List<Object> fieldsList= new ArrayList<Object>();
List<Object>infoList= new ArrayList<Object>();
Map<String, String> map = new HashMap<String, String>();
map.put("name", "微型消防站");
map.put("value",i.get("carName").toString());
map.put("id","1");
fieldsList.add(map);
Map<String, String> map1 = new HashMap<String, String>();
map1.put("name", "微型消防站");
map1.put("value",i.get("teamName").toString());
map1.put("id","2");
fieldsList.add(map1);
if(!map20.containsKey(i.get("shiftName").toString())) {
map20.put(ssString, ssString);
}
System.out.println("ssssssssss");
});
}
}
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.List;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyShift;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyShiftService;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
* 值班班次服务实现类
......@@ -35,4 +36,5 @@ public class DutyShiftServiceImpl extends BaseService<DutyShiftDto, DutyShift, D
public List<DutyShiftDto> queryForDutyShiftList(Boolean isDelete) {
return this.queryForList("", false, isDelete);
}
}
......@@ -3,8 +3,12 @@ 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.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationzhDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.FireStation;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
......@@ -14,6 +18,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFireStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -36,7 +41,8 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
FireStationMapper fireStationMapper;
@Autowired
OrgUsrMapper orgUsrMapper;
@Autowired
OrgUsrServiceImpl orgUsrService;
/**
* 分页查询
*/
......@@ -143,4 +149,28 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
wrapper.select(FireStation::getSequenceNbr,FireStation::getName);
return this.baseMapper.selectMaps(wrapper);
}
/**
* 获取机场单位树
* chenzhao 2021-10-14
* @return
*/
public List<MenuFrom> getCompanyTeamTree() throws Exception {
MenuFrom root = new MenuFrom("-1", "微型消防站", null, null);
List<OrgUsr> companyDeptList = orgUsrService.selectCompanyList();
List<MenuFrom> companyDeptMenuList = Lists.newArrayList();
companyDeptList.forEach(o -> {
if (ValidationUtil.isEmpty(o.getParentId())) {
o.setParentId("-1");
}
companyDeptMenuList.add(new MenuFrom(o.getSequenceNbr().toString(), o.getBizOrgName(), o.getParentId(),
"1"));
});
List<MenuFrom> menuList = TreeParser.getTreexin("-1", companyDeptMenuList, MenuFrom.class.getName(), "getKey",
1, "getName", "getParentId", "getNodeType");
root.setChildren(menuList);
return Lists.newArrayList(root);
}
}
......@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
......@@ -82,6 +83,16 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
firefighters.setFirefighters(firefighter);
}
@Override
public Firefighters selectByAmosOrgId(Long id) {
QueryWrapper<Firefighters> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("amos_user_id",id);
Firefighters firefighters = firefightersMapper.selectOne(queryWrapper);
return firefighters;
}
/**
* 导出列表
*/
......
......@@ -1674,6 +1674,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
@Override
public OrgUsr selectByAmosOrgId(Long id) {
QueryWrapper<OrgUsr> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("amos_org_id",id);
OrgUsr orgUsr = orgUsrMapper.selectOne(queryWrapper);
return orgUsr;
}
@Override
public AgencyUserModel getAmosIdByOrgUserId(String orgUserId) throws Exception {
OrgUsr orgUsr = this.baseMapper.selectOne(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getSequenceNbr,
orgUserId));
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftListTreeDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.UserCar;
import com.yeejoin.amos.boot.module.jcs.api.enums.AircraftFileTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AircraftMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.UserCarMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAircraftService;
import com.yeejoin.amos.boot.module.jcs.api.service.IUserCarService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.FileInfoModel;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.DataNotFound;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 航空器信息服务实现类
*
* @author system_generator
* @date 2021-06-29
*/
@Service
public class UserCarServiceImpl extends BaseService<AircraftDto, UserCar, UserCarMapper> implements IUserCarService {
@Autowired
UserCarMapper UserCarMapper;
@Override
public UserCar selectByAmosUserId(Long id) {
QueryWrapper<UserCar> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("amos_user_id", id);
return UserCarMapper.selectOne(queryWrapper);
}
@Override
public void add(UserCar userCar) {
QueryWrapper<UserCar> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("amos_user_id", userCar.getAmosUserId());
UserCar uer= UserCarMapper.selectOne(queryWrapper);
if(uer!=null){
userCar.setSequenceNbr(uer.getSequenceNbr());
UserCarMapper.updateById(userCar);
}else{
UserCarMapper.insert(userCar);
}
}
@Override
public void delete(UserCar userCar) {
QueryWrapper<UserCar> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("amos_user_id", userCar.getAmosUserId());
UserCarMapper.delete(queryWrapper);
}
}
......@@ -1729,4 +1729,38 @@
<changeSet author="tw" id="2021-10-13-tw-01">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="jc_user_car"/>
</not>
</preConditions>
<comment>create table jc_user_car</comment>
<sql>
CREATE TABLE `jc_user_car` (
`sequence_nbr` bigint(20) NOT NULL COMMENT '物理主键',
`amos_user_name` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '平台账号',
`amos_user_id` bigint(20) NULL DEFAULT NULL COMMENT '平台账号id',
`car_num` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '车牌号',
`car_id` bigint(20) NULL DEFAULT NULL COMMENT '车辆id',
`rec_user_name` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作人名称',
`rec_user_id` varchar(19) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作人员',
`rec_date` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '创建时间',
`is_delete` bit(1) NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`sequence_nbr`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
</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