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 { ...@@ -71,6 +71,35 @@ public interface EquipFeignClient {
@RequestMapping(value = "/car/list-all", method = RequestMethod.GET) @RequestMapping(value = "/car/list-all", method = RequestMethod.GET)
ResponseModel<Object> getFireCarListAll(); 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> { ...@@ -72,4 +72,60 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
@Param("beginDate") String beginDate, @Param("beginDate") String beginDate,
@Param("endDate") String endDate @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 { ...@@ -29,4 +29,6 @@ public interface IDutyCarService extends IDutyCommonService {
* @return * @return
*/ */
JSONObject isFireCarDriver(); JSONObject isFireCarDriver();
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType);
} }
...@@ -17,4 +17,6 @@ public interface IDutyFireFightingService extends IDutyCommonService { ...@@ -17,4 +17,6 @@ public interface IDutyFireFightingService extends IDutyCommonService {
* @return List<DutyCarDto> * @return List<DutyCarDto>
*/ */
DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto); 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; ...@@ -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.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto; 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.dto.FirefightersZhDto;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
/** /**
...@@ -29,7 +30,7 @@ public interface IFirefightersService { ...@@ -29,7 +30,7 @@ public interface IFirefightersService {
void saveFirefighters(FirefightersInfoDto firefighters); void saveFirefighters(FirefightersInfoDto firefighters);
Firefighters selectByAmosOrgId(Long id);
......
...@@ -235,4 +235,8 @@ public interface IOrgUsrService { ...@@ -235,4 +235,8 @@ public interface IOrgUsrService {
List<OrgUsr> selectCompanyUsers(Long orgUnitId); List<OrgUsr> selectCompanyUsers(Long orgUnitId);
OrgUsr selectByAmosOrgId(Long id);
} }
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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.common.api.mapper.DutyPersonShiftMapper"> <mapper
namespace="com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper">
<select id="calMaxPersonAndShiftNum" resultType="java.util.Map"> <select id="calMaxPersonAndShiftNum" resultType="java.util.Map">
select select
(select (select
...@@ -17,8 +18,10 @@ ...@@ -17,8 +18,10 @@
and s.instance_id = i.instance_id and s.instance_id = i.instance_id
AND i.field_code = 'userId' AND i.field_code = 'userId'
and s.duty_date >= #{beginDate} and s.duty_date >= #{beginDate}
and s.duty_date <![CDATA[<=]]> #{endDate} and s.duty_date <![CDATA[<=]]>
AND s.shift_id is not null <!--// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14--> #{endDate}
AND s.shift_id is not null <!--// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。
同步修改 查询 导出相关逻辑 by kongfm 2021-09-14 -->
and s.app_Key = #{appKey} and s.app_Key = #{appKey}
GROUP BY s.duty_date,s.shift_id <!--增添分组条件 根据班次分组技术 --> GROUP BY s.duty_date,s.shift_id <!--增添分组条件 根据班次分组技术 -->
) a) as maxDutyPersonNumDay, ) a) as maxDutyPersonNumDay,
...@@ -36,7 +39,8 @@ ...@@ -36,7 +39,8 @@
and s.instance_id = i.instance_id and s.instance_id = i.instance_id
AND i.field_code = 'userId' AND i.field_code = 'userId'
and s.duty_date >= #{beginDate} and s.duty_date >= #{beginDate}
and s.duty_date <![CDATA[<=]]> #{endDate} and s.duty_date <![CDATA[<=]]>
#{endDate}
and s.app_Key = #{appKey} and s.app_Key = #{appKey}
GROUP BY s.duty_date) b) as maxShiftNumDay GROUP BY s.duty_date) b) as maxShiftNumDay
</select> </select>
...@@ -91,6 +95,217 @@ ...@@ -91,6 +95,217 @@
mysql.help_topic, mysql.help_topic,
( SELECT @s := 0 ) temp ( SELECT @s := 0 ) temp
WHERE WHERE
@s <![CDATA[<=]]> DATEDIFF(#{endDate},#{beginDate}) @s <![CDATA[<=]]>
DATEDIFF(#{endDate},#{beginDate})
</select> </select>
<select id='getSpecifyDateList' resultType='map'>
SELECT
GROUP_CONCAT(cd.field_value) AS
value
,
cds.name
FROM
cb_dynamic_form_instance cd
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate}
AND dp.is_delete = 0
) cds ON cd.instance_id = cds.instance_id
WHERE
cd.group_code = #{groupCode}
AND cds.instance_id IS NOT NULL
AND cd.is_delete = 0
AND cd.field_code = 'userName'
<if test="params != null and params!='' ">
and cd.field_value !='消防车驾驶员'
</if>
AND cd.instance_id IN
<foreach collection ='instanceIds' item='instanceId' index='index' open="(" close= ")" separator=",">
#{instanceId}
</foreach>
GROUP BY
cds.`name`
</select>
<select id='getEquipmentForSpecifyDate' resultType='map'>
select * from (
SELECT
MAX(
CASE
WHEN cd.FIELD_CODE = #{equipmentId} THEN
cd.FIELD_VALUE
END
) AS #{equipmentId},
MAX(
CASE
WHEN cd.FIELD_CODE = #{equipmentName} THEN
cd.FIELD_VALUE
END
) AS #{equipmentName},
MAX(
CASE
WHEN cd.FIELD_CODE = #{teamName} THEN
cd.FIELD_VALUE
END
) AS #{teamName}
FROM
cb_dynamic_form_instance cd
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate} and dp.is_delete=0
) cds ON cd.instance_id = cds.instance_id
where cd.group_code =#{groupCode} and cds.instance_id is not null and
cd.is_delete=0
group by cd.instance_id
) result group by ${groupByName}
</select>
<select id='getInstanceIdForSpecifyDateAndEquipment'
resultType='map'>
SELECT
GROUP_CONCAT(cd.instance_id) as instanceIds
FROM
cb_dynamic_form_instance cd
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate}
AND dp.is_delete = 0
) cds ON cd.instance_id = cds.instance_id
WHERE
cd.group_code = #{groupCode}
AND cds.instance_id IS NOT NULL
AND cd.is_delete = 0
AND cd.field_value = #{targetId}
</select>
<select id='getEquipmentOperator' resultType='map'>
SELECT
result.userName
FROM
(
SELECT
MAX(
CASE
WHEN cd.FIELD_CODE = 'userName' THEN
cd.FIELD_VALUE
END
) AS 'userName',
MAX(
CASE
WHEN cd.FIELD_CODE = 'postTypeName' THEN
cd.FIELD_VALUE
END
) AS 'postTypeName',
cds. NAME
FROM
cb_dynamic_form_instance cd
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate}
AND dp.is_delete = 0
) cds ON cd.instance_id = cds.instance_id
WHERE
cd.group_code = #{groupCode}
AND cds.instance_id IS NOT NULL
AND cd.is_delete = 0
AND cd.instance_id IN
<foreach collection ='instanceIds' item='instanceId' index='index' open="(" close= ")" separator=",">
#{instanceId}
</foreach>
) result
WHERE
result.postTypeName = #{operator} and result.name =#{duty}
</select>
<select id ='getPositionStaffDutyForSpecifyDate' resultType="map">
SELECT
GROUP_CONCAT(ss.userName) AS userName,
ss.postTypeName
FROM
(
SELECT
MAX(
CASE
WHEN cd.FIELD_CODE = 'userName' THEN
cd.FIELD_VALUE
END
) AS 'userName',
MAX(
CASE
WHEN cd.FIELD_CODE = 'postTypeName' THEN
cd.FIELD_VALUE
END
) AS 'postTypeName',
cd.instance_id
FROM
cb_dynamic_form_instance cd
WHERE
cd.instance_id in
<foreach collection ='instanceIds' item='instanceId' index='index' open="(" close= ")" separator=",">
#{instanceId}
</foreach>
AND cd.group_code = #{groupCode}
AND cd.is_delete = 0
GROUP BY
cd.instance_id
) ss
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate}
AND dp.is_delete = 0
AND NAME IS NOT NULL
) cds ON ss.instance_id = cds.instance_id
WHERE
cds.NAME =#{duty}
GROUP BY
ss.postTypeName
</select>
<select id='getDutyForSpecifyDate' resultType="map">
SELECT
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate}
AND dp.is_delete = 0
AND NAME IS NOT NULL
GROUP BY
NAME
</select>
</mapper> </mapper>
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; ...@@ -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.command.biz.service.impl.RemoteSecurityService;
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.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.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService; import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService;
...@@ -40,13 +42,10 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel; ...@@ -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.dto.StateDot;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; 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.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.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.service.IAircraftService; import com.yeejoin.amos.boot.module.jcs.api.service.*;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
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.feign.privilege.model.PermissionModel; import com.yeejoin.amos.feign.privilege.model.PermissionModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -149,6 +148,11 @@ public class CommandController extends BaseController { ...@@ -149,6 +148,11 @@ public class CommandController extends BaseController {
IDutyCarService iDutyCarService; IDutyCarService iDutyCarService;
@Autowired @Autowired
IotFeignClient iotFeignClient; IotFeignClient iotFeignClient;
@Autowired
IUserCarService userCarService;
/** /**
* 警情列表 * 警情列表
* *
...@@ -1178,10 +1182,62 @@ public class CommandController extends BaseController { ...@@ -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 { ...@@ -152,7 +152,7 @@ public class DutyCarController extends BaseController {
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay, public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId, @ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){ @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{ ...@@ -155,6 +155,6 @@ public class DutyFireFightingController extends BaseController{
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay, public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId, @ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){ @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; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto; 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.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireStation; import com.yeejoin.amos.boot.module.common.api.entity.FireStation;
...@@ -139,4 +140,18 @@ public class FireStationController extends BaseController { ...@@ -139,4 +140,18 @@ public class FireStationController extends BaseController {
public ResponseModel<List<FireStationDto>> selectForList() { public ResponseModel<List<FireStationDto>> selectForList() {
return ResponseHelper.buildResponse(fireStationServiceImpl.queryForFireStationList(false)); 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; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.constants.BizConstant;
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.EnumsUtils; import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils;
...@@ -31,10 +32,12 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourcePoolSer ...@@ -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 com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; 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.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; 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.DeleteMapping;
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;
...@@ -50,9 +53,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -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.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -90,8 +91,14 @@ public class WaterResourceController extends BaseController { ...@@ -90,8 +91,14 @@ public class WaterResourceController extends BaseController {
String resourceType = model.getResourceType(); String resourceType = model.getResourceType();
Optional<WaterResourceTypeEnum> resourceTypeEnum = EnumsUtils.getEnumObject(WaterResourceTypeEnum.class, Optional<WaterResourceTypeEnum> resourceTypeEnum = EnumsUtils.getEnumObject(WaterResourceTypeEnum.class,
e -> e.getCode().equals(resourceType)); 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.setResourceTypeName(resourceTypeEnum.get().getName());
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList())); model.setRealityImg(JSONArray.toJSONString(realityImgList));
model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList())); model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList()));
/*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/ /*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/
/* if(model.getAddress()!=null){ /* if(model.getAddress()!=null){
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import static org.hamcrest.CoreMatchers.nullValue;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -18,14 +19,14 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -18,14 +19,14 @@ 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.itextpdf.text.pdf.PdfStructTreeController.returnType;
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.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;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters; import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
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.DutyPersonShiftMapper;
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;
...@@ -49,6 +50,9 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -49,6 +50,9 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
@Autowired @Autowired
EquipFeignClient equipFeign; EquipFeignClient equipFeign;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
@Override @Override
public String getGroupCode() { public String getGroupCode() {
return "dutyCar"; return "dutyCar";
...@@ -57,8 +61,8 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -57,8 +61,8 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
@Override @Override
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.保存行数据
if(StringUtils.isNotEmpty(dutyCarDto.getDutyAreaId())) { if (StringUtils.isNotEmpty(dutyCarDto.getDutyAreaId())) {
// 根据建筑id 查找建筑 // 根据建筑id 查找建筑
ResponseModel<Map<String, Object>> response = null; ResponseModel<Map<String, Object>> response = null;
try { try {
...@@ -72,11 +76,11 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -72,11 +76,11 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
Map<String, Object> map = Bean.BeantoMap(dutyCarDto); Map<String, Object> map = Bean.BeantoMap(dutyCarDto);
// 修改操作动态表单的方法,修改人陈浩 -------------start 2021-09-28 // 修改操作动态表单的方法,修改人陈浩 -------------start 2021-09-28
Long instanceId =excuteDynamicFormInstance(dutyCarDto.getUserId(),map,this.getGroupCode()); Long instanceId = excuteDynamicFormInstance(dutyCarDto.getUserId(), map, this.getGroupCode());
saveDutyPersonShiftDetail( instanceId ,dutyCarDto.getDutyShift() ,dutyCarDto.getStartTime()) ; saveDutyPersonShiftDetail(instanceId, dutyCarDto.getDutyShift(), dutyCarDto.getStartTime());
insertPersonShift(instanceId, dutyCarDto.getDutyShift()); insertPersonShift(instanceId, dutyCarDto.getDutyShift());
// 修改操作动态表单的方法,修改人陈浩 -------------end 2021-09-28 // 修改操作动态表单的方法,修改人陈浩 -------------end 2021-09-28
//3.返回保存后的数据 // 3.返回保存后的数据
return dutyCarDto; return dutyCarDto;
} }
...@@ -84,16 +88,16 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -84,16 +88,16 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
@Override @Override
public DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto) { public DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto) {
//修改操作动态表单修改的逻辑方法,陈浩 start ----2021-09-28 // 修改操作动态表单修改的逻辑方法,陈浩 start ----2021-09-28
updateDynamicFormInstance(this.getGroupCode(),instanceId,Bean.BeantoMap(dutyCarDto)); updateDynamicFormInstance(this.getGroupCode(), instanceId, Bean.BeantoMap(dutyCarDto));
//修改操作动态表单修改的逻辑方法,陈浩 end ----2021-09-28 // 修改操作动态表单修改的逻辑方法,陈浩 end ----2021-09-28
//5.更新值班信息人日期数据 // 5.更新值班信息人日期数据
insertPersonShift(instanceId, dutyCarDto.getDutyShift()); insertPersonShift(instanceId, dutyCarDto.getDutyShift());
return dutyCarDto; return dutyCarDto;
} }
private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column,
private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column, DynamicFormInstance formInstance) { DynamicFormInstance formInstance) {
fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId()); fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId());
} }
...@@ -106,9 +110,8 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -106,9 +110,8 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
String loginUserId = RequestContext.getExeUserId(); String loginUserId = RequestContext.getExeUserId();
// 根据登陆人id查询对应消防人员 // 根据登陆人id查询对应消防人员
Firefighters firefighters = Firefighters firefighters = firefightersMapper
firefightersMapper.selectOne(new LambdaQueryWrapper<Firefighters>().eq(Firefighters::getSystemAccount, .selectOne(new LambdaQueryWrapper<Firefighters>().eq(Firefighters::getSystemAccount, loginUserId));
loginUserId));
if (ValidationUtil.isEmpty(firefighters)) { if (ValidationUtil.isEmpty(firefighters)) {
return result; return result;
} }
...@@ -135,10 +138,88 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -135,10 +138,88 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
result.put("isDriver", true); result.put("isDriver", true);
result.put("carId", personList.get(0).get("carId")); result.put("carId", personList.get(0).get("carId"));
ResponseModel<Map<String, Object>> resultModel = ResponseModel<Map<String, Object>> resultModel = equipFeignClient
equipFeignClient.queryCarSimpleInfoById((Long) personList.get(0).get("carId")); .queryCarSimpleInfoById((Long) personList.get(0).get("carId"));
Map<String, Object> carInfo = resultModel.getResult(); Map<String, Object> carInfo = resultModel.getResult();
result.put("carStatus", carInfo.get("carStatus")); result.put("carStatus", carInfo.get("carStatus"));
return result; return result;
} }
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "carId", "carName", "teamName","result.carId");
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("carName").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("carId").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);
}
}
}
// 获取当前装备ID下的排版数据
// List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getSpecifyDateList(dutyDay,
// this.getGroupCode(), instanceIds,null);
// for (Map<String, Object> specify : specifyDateList) {
//
// if(!specify.containsKey("name") || specify.get("name").toString()==null) {
// continue;
// }
// LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
// infoMap_1.put(specify.get("name").toString(), "");
// resultList.add(infoMap_1);
// Map<String, Object> equipmentOperatorMap = dutyPersonShiftMapper.getEquipmentOperator(dutyDay,
// this.getGroupCode(), instanceIds, "消防车驾驶员", specify.get("name").toString());
// String operator =null;
// if (equipmentOperatorMap!=null && equipmentOperatorMap.containsKey("userName")) {
// operator = equipmentOperatorMap.get("equipmentOperatorMap").toString();
// }
// LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
// infoMap_2.put("驾驶员", operator!=null?operator:"");
// resultList.add(infoMap_2);
// LinkedHashMap<String, Object> infoMap_3 =new LinkedHashMap<String, Object>();
// infoMap_3.put("战斗员",specify.get("value").toString());
// resultList.add(infoMap_3);
// }
}
detailList.add(resultList);
}
return detailList;
}
} }
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.LinkedHashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -9,13 +13,22 @@ import org.typroject.tyboot.core.foundation.utils.Bean; ...@@ -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.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto; 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; import com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService;
@Service @Service
public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implements IDutyFireFightingService { public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implements IDutyFireFightingService {
@Autowired @Autowired
FireStationServiceImpl fireStationServiceImpl; FireStationServiceImpl fireStationServiceImpl;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
public String getGroupCode() {
return "dutyFireFighting";
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public DutyFireFightingDto save(DutyFireFightingDto dto) { public DutyFireFightingDto save(DutyFireFightingDto dto) {
...@@ -32,13 +45,61 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement ...@@ -32,13 +45,61 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
@Override @Override
public DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto) { public DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto) {
updateDynamicFormInstance(this.getGroupCode(),instanceId,Bean.BeantoMap(dto)); updateDynamicFormInstance(this.getGroupCode(), instanceId, Bean.BeantoMap(dto));
insertPersonShift(instanceId, dto.getDutyShift()); insertPersonShift(instanceId, dto.getDutyShift());
return dto; return dto;
} }
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(",");
public String getGroupCode() { List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
return "dutyFireFighting"; 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; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import java.util.ArrayList;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import java.util.Calendar;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto; import java.util.Date;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto; import java.util.HashMap;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift; import java.util.LinkedHashMap;
import com.yeejoin.amos.boot.module.common.api.entity.DutyShift; import java.util.List;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn; import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import java.util.Set;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
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;
...@@ -20,13 +19,15 @@ import org.typroject.tyboot.core.foundation.utils.Bean; ...@@ -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.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList; import com.alibaba.fastjson.JSONArray;
import java.util.Calendar; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.Date; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
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.entity.DutyPersonShift;
import java.util.Set; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import java.util.stream.Collectors; 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 * @author DELL
...@@ -37,6 +38,7 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut ...@@ -37,6 +38,7 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
@Autowired @Autowired
EquipFeignClient equipFeign; EquipFeignClient equipFeign;
@Override @Override
public String getGroupCode(){ public String getGroupCode(){
return "dutyPerson"; return "dutyPerson";
...@@ -234,4 +236,98 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut ...@@ -234,4 +236,98 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
}); });
return temp; 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; 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.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto; 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.entity.DutyShift;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper; import com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyShiftService; 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 ...@@ -35,4 +36,5 @@ public class DutyShiftServiceImpl extends BaseService<DutyShiftDto, DutyShift, D
public List<DutyShiftDto> queryForDutyShiftList(Boolean isDelete) { public List<DutyShiftDto> queryForDutyShiftList(Boolean isDelete) {
return this.queryForList("", false, isDelete); return this.queryForList("", false, isDelete);
} }
} }
...@@ -3,8 +3,12 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl; ...@@ -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.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.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.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationzhDto; 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.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.FireStation; import com.yeejoin.amos.boot.module.common.api.entity.FireStation;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
...@@ -14,6 +18,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFireStationService; ...@@ -14,6 +18,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFireStationService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean; 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.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;
...@@ -36,7 +41,8 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat ...@@ -36,7 +41,8 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
FireStationMapper fireStationMapper; FireStationMapper fireStationMapper;
@Autowired @Autowired
OrgUsrMapper orgUsrMapper; OrgUsrMapper orgUsrMapper;
@Autowired
OrgUsrServiceImpl orgUsrService;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -143,4 +149,28 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat ...@@ -143,4 +149,28 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
wrapper.select(FireStation::getSequenceNbr,FireStation::getName); wrapper.select(FireStation::getSequenceNbr,FireStation::getName);
return this.baseMapper.selectMaps(wrapper); 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; ...@@ -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.FirefightersInfoDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto; 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.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
...@@ -82,6 +83,16 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -82,6 +83,16 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
firefighters.setFirefighters(firefighter); 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 ...@@ -1674,6 +1674,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
@Override @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 { public AgencyUserModel getAmosIdByOrgUserId(String orgUserId) throws Exception {
OrgUsr orgUsr = this.baseMapper.selectOne(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getSequenceNbr, OrgUsr orgUsr = this.baseMapper.selectOne(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getSequenceNbr,
orgUserId)); 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 @@ ...@@ -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> </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