Commit e2d64218 authored by 李秀明's avatar 李秀明

fix(JCS#14822|#14821) 人员更换单位、执勤人员换车导致排班历史数据被修改

parent 24b24622
...@@ -2,8 +2,6 @@ package com.yeejoin.amos.boot.module.common.api.dto; ...@@ -2,8 +2,6 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -28,40 +26,10 @@ public class DutyCarExcelDto implements Serializable { ...@@ -28,40 +26,10 @@ public class DutyCarExcelDto implements Serializable {
private Integer number; private Integer number;
@ExcelIgnore @ExcelIgnore
@ApiModelProperty(value = "消防队伍id")
private String teamId;
@ExcelProperty(value = "消防队伍", index = 1)
@ApiModelProperty(value = "消防队伍名称")
private String teamName;
@ExcelIgnore
@ApiModelProperty(value = "用户id")
private String userId;
@ExcelProperty(value = "姓名", index = 2)
@ApiModelProperty(value = "用户名称")
private String userName;
@ExcelIgnore
@ApiModelProperty(value = "岗位id")
private String postType;
@ExcelProperty(value = "岗位", index = 3)
@ApiModelProperty(value = "岗位名称")
private String postTypeName;
@ExcelIgnore
@ApiModelProperty(value = "车辆id") @ApiModelProperty(value = "车辆id")
private String carId; private String carId;
@ExplicitConstraint(indexNum = 4, sourceClass = CommonExplicitConstraint.class, method = "getCarList") //固定下拉内容 @ExcelProperty(value = "车辆名称", index = 1)
@ExcelProperty(value = "车辆名称(车牌)", index = 4)
@ApiModelProperty(value = "车辆名称") @ApiModelProperty(value = "车辆名称")
private String carName; private String carName;
// 需求 958 新增值班区域 值班区域id 字段 导出字段 by kongfm 2021-09-15 }
@ExplicitConstraint(indexNum = 5, sourceClass = CommonExplicitConstraint.class, method = "getDutyArea") //固定下拉内容
@ExcelProperty(value = "值班区域", index = 5)
@ApiModelProperty(value = "值班区域")
private String dutyArea;
}
...@@ -34,26 +34,26 @@ public class DutyPersonExcelDto implements Serializable { ...@@ -34,26 +34,26 @@ public class DutyPersonExcelDto implements Serializable {
@ExcelProperty(value = "姓名", index = 2) @ExcelProperty(value = "姓名", index = 2)
@ApiModelProperty(value = "用户名称") @ApiModelProperty(value = "用户名称")
private String userName; private String userName;
//
@ExcelIgnore // @ExcelIgnore
@ApiModelProperty(value = "部门id") // @ApiModelProperty(value = "部门id")
private String deptId; // private String deptId;
//
@ExcelProperty(value = "单位/部门", index = 3) // @ExcelProperty(value = "单位/部门", index = 3)
@ApiModelProperty(value = "部门名称") // @ApiModelProperty(value = "部门名称")
private String deptName; // private String deptName;
//
@ExcelIgnore // @ExcelIgnore
@ApiModelProperty(value = "岗位id") // @ApiModelProperty(value = "岗位id")
private String postType; // private String postType;
//
@ExplicitConstraint(type = "DUTY_POST_TYPE", indexNum = 4, sourceClass = CommonExplicitConstraint.class) //动态下拉内容 // @ExplicitConstraint(type = "DUTY_POST_TYPE", indexNum = 4, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位", index = 4) // @ExcelProperty(value = "岗位", index = 4)
@ApiModelProperty(value = "岗位名称") // @ApiModelProperty(value = "岗位名称")
private String postTypeName; // private String postTypeName;
// 需求 958 新增值班区域 值班区域id 字段 导出字段 by kongfm 2021-09-15 // // 需求 958 新增值班区域 值班区域id 字段 导出字段 by kongfm 2021-09-15
@ExplicitConstraint(indexNum = 5, sourceClass = CommonExplicitConstraint.class, method = "getDutyArea") //固定下拉内容 // @ExplicitConstraint(indexNum = 5, sourceClass = CommonExplicitConstraint.class, method = "getDutyArea") //固定下拉内容
@ExcelProperty(value = "值班区域", index = 5) // @ExcelProperty(value = "值班区域", index = 5)
@ApiModelProperty(value = "值班区域") // @ApiModelProperty(value = "值班区域")
private String dutyArea; // private String dutyArea;
} }
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 值班班次
*
* @author system_generator
* @date 2021-07-06
*/
@Data
@ApiModel(value = "TemplateDutyCarExcelDto", description = "值班车辆")
public class TemplateDutyCarExcelDto implements Serializable {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "序号", index = 0)
@ApiModelProperty(value = "序号")
private Integer number;
@ExcelIgnore
@ApiModelProperty(value = "消防队伍id")
private String teamId;
@ExcelProperty(value = "消防队伍", index = 1)
@ApiModelProperty(value = "消防队伍名称")
private String teamName;
@ExcelIgnore
@ApiModelProperty(value = "用户id")
private String userId;
@ExcelProperty(value = "姓名", index = 2)
@ApiModelProperty(value = "用户名称")
private String userName;
@ExcelIgnore
@ApiModelProperty(value = "岗位id")
private String postType;
@ExcelProperty(value = "岗位", index = 3)
@ApiModelProperty(value = "岗位名称")
private String postTypeName;
@ExcelIgnore
@ApiModelProperty(value = "车辆id")
private String carId;
@ExplicitConstraint(indexNum = 4, sourceClass = CommonExplicitConstraint.class, method = "getCarList") //固定下拉内容
@ExcelProperty(value = "车辆名称(车牌)", index = 4)
@ApiModelProperty(value = "车辆名称")
private String carName;
// 需求 958 新增值班区域 值班区域id 字段 导出字段 by kongfm 2021-09-15
@ExplicitConstraint(indexNum = 5, sourceClass = CommonExplicitConstraint.class, method = "getDutyArea") //固定下拉内容
@ExcelProperty(value = "值班区域", index = 5)
@ApiModelProperty(value = "值班区域")
private String dutyArea;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 值班班次
*
* @author system_generator
* @date 2021-07-06
*/
@Data
@ApiModel(value = "TemplateDutyPersonExcelDto", description = "值班人")
public class TemplateDutyPersonExcelDto implements Serializable {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "序号", index = 0)
@ApiModelProperty(value = "序号")
private Integer number;
@ExcelProperty(value = "用户ID", index = 1)
@ApiModelProperty(value = "用户id")
private String userId;
@ExcelProperty(value = "姓名", index = 2)
@ApiModelProperty(value = "用户名称")
private String userName;
@ExcelIgnore
@ApiModelProperty(value = "部门id")
private String deptId;
@ExcelProperty(value = "单位/部门", index = 3)
@ApiModelProperty(value = "部门名称")
private String deptName;
@ExcelIgnore
@ApiModelProperty(value = "岗位id")
private String postType;
@ExplicitConstraint(type = "DUTY_POST_TYPE", indexNum = 4, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位", index = 4)
@ApiModelProperty(value = "岗位名称")
private String postTypeName;
// 需求 958 新增值班区域 值班区域id 字段 导出字段 by kongfm 2021-09-15
@ExplicitConstraint(indexNum = 5, sourceClass = CommonExplicitConstraint.class, method = "getDutyArea") //固定下拉内容
@ExcelProperty(value = "值班区域", index = 5)
@ApiModelProperty(value = "值班区域")
private String dutyArea;
}
package com.yeejoin.amos.boot.module.common.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.experimental.Accessors;
import java.util.Date;
/**
* 值班人员日期日志表
*/
@Data
@Accessors(chain = true)
@TableName("cb_duty_person_shift_log")
public class DutyPersonShiftLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 实例ID
*/
@TableField("instance_id")
private Long instanceId;
/**
* 值班日期
*/
@TableField("duty_date")
private Date dutyDate;
/**
* 分组类型
*/
@TableField("group_code")
private String groupCode;
/**
* 消防队伍
*/
@TableField("dept_name")
private String deptName;
/**
* 值班人
*/
@TableField("duty_user_id")
private String dutyUserId;
/**
* 值班人
*/
@TableField("duty_user")
private String dutyUser;
/**
* 岗位
*/
@TableField("post_type_name")
private String postTypeName;
/**
* 值班区域
*/
@TableField("duty_area")
private String dutyArea;
/**
* 值班类型
*/
@TableField("shift_name")
private String shiftName;
/**
* 车辆名称
*/
@TableField("car_name")
private String carName;
}
package com.yeejoin.amos.boot.module.common.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShiftLog;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 值班人员日期日志表 Mapper 接口
*/
public interface DutyPersonShiftLogMapper extends BaseMapper<DutyPersonShiftLog> {
List<Map<String, String>> selectSpecificDateLogForCar(@Param("dutyDate") String dutyDate);
List<Map<String, String>> selectSpecificDateLogForPerson(@Param("dutyDate") String dutyDate);
List<Map<String, String>> selectSpecificDateLogForPersonGroupByPostTypeName(@Param("dutyDate") String dutyDate);
}
...@@ -11,6 +11,7 @@ import org.apache.poi.ss.formula.functions.T; ...@@ -11,6 +11,7 @@ import org.apache.poi.ss.formula.functions.T;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* 值班人员日期关联关系表 Mapper 接口 * 值班人员日期关联关系表 Mapper 接口
...@@ -66,7 +67,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -66,7 +67,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
@Param("appKey") String appKey, @Param("appKey") String appKey,
@Param("groupCode") String groupCode @Param("groupCode") String groupCode
); );
List<Map<String, Object>> newStationViewData( List<Map<String, Object>> newStationViewData(
@Param("dutyDate") String dutyDate, @Param("dutyDate") String dutyDate,
@Param("groupCode") String groupCode @Param("groupCode") String groupCode
...@@ -97,7 +98,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -97,7 +98,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
* @return * @return
*/ */
List<Map<String, Object>> getSpecifyDateList(String dutyDate,String groupCode,String[] instanceIds,String params); List<Map<String, Object>> getSpecifyDateList(String dutyDate,String groupCode,String[] instanceIds,String params);
/** /**
* 获取指定日期下的装备ID、eg:车辆、微型消防站 * 获取指定日期下的装备ID、eg:车辆、微型消防站
* @param dutyDate * @param dutyDate
...@@ -106,8 +107,8 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -106,8 +107,8 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
* @return * @return
*/ */
List<Map<String, Object>> getEquipmentForSpecifyDate(String dutyDate,String groupCode,String equipmentId,String equipmentName,String teamName,String groupByName); List<Map<String, Object>> getEquipmentForSpecifyDate(String dutyDate,String groupCode,String equipmentId,String equipmentName,String teamName,String groupByName);
/** /**
* 通过装备ID查询指定如期下的该装备所包含的InstanceId * 通过装备ID查询指定如期下的该装备所包含的InstanceId
* @param dutyDate * @param dutyDate
...@@ -116,7 +117,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -116,7 +117,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
* @return * @return
*/ */
Map<String, Object> getInstanceIdForSpecifyDateAndEquipment(String dutyDate,String groupCode,String targetId); Map<String, Object> getInstanceIdForSpecifyDateAndEquipment(String dutyDate,String groupCode,String targetId);
/** /**
* 获取指定日期装备的操作人员,例如车辆的驾驶员 * 获取指定日期装备的操作人员,例如车辆的驾驶员
* @param dutyDate * @param dutyDate
...@@ -126,8 +127,8 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -126,8 +127,8 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
* @return * @return
*/ */
Map<String, Object> getEquipmentOperator(String dutyDate,String groupCode,String[] instanceIds,String operator,String duty); Map<String, Object> getEquipmentOperator(String dutyDate,String groupCode,String[] instanceIds,String operator,String duty);
/** /**
* 获取指定日期下的排班人员与岗位等信息 * 获取指定日期下的排班人员与岗位等信息
* @param dutyDate * @param dutyDate
...@@ -136,23 +137,25 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -136,23 +137,25 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
* @return * @return
*/ */
List<Map<String, Object>> getPositionStaffDutyForSpecifyDate(String dutyDate,String groupCode,String[] instanceIds,String duty, String fieldCode); List<Map<String, Object>> getPositionStaffDutyForSpecifyDate(String dutyDate,String groupCode,String[] instanceIds,String duty, String fieldCode);
/** /**
* 获取指定日期下的班次信息 * 获取指定日期下的班次信息
* @param duty * @param duty
* @return * @return
*/ */
List<Map<String, Object>> getDutyForSpecifyDate(String duty); List<Map<String, Object>> getDutyForSpecifyDate(String duty);
Map<String, Object> getFireTeamBySequenceNbr (long sequenceNbr); Map<String, Object> getFireTeamBySequenceNbr (long sequenceNbr);
List<Map<String, Object>> getFirstAidForTypeCodeAndCompanyId(long company); List<Map<String, Object>> getFirstAidForTypeCodeAndCompanyId(long company);
List<Map<String, Object>> queryByCompanyId(@Param(value="bizNames") List<String> bizNames); List<Map<String, Object>> queryByCompanyId(@Param(value="bizNames") List<String> bizNames);
List<Map<String, Object>> queryByCompanyNew(String bizOrgName); List<Map<String, Object>> queryByCompanyNew(String bizOrgName);
List<DutyPersonShift> getOldDutyPersonShifts(String groupCode);
List<Map<String, Object>> getNewEquipmentForSpecifyDate(String dutyDate,String groupCode,String equipmentId,String equipmentName,String groupByName); List<Map<String, Object>> getNewEquipmentForSpecifyDate(String dutyDate,String groupCode,String equipmentId,String equipmentName,String groupByName);
......
...@@ -20,7 +20,7 @@ import java.util.Map; ...@@ -20,7 +20,7 @@ import java.util.Map;
*/ */
public interface OrgUsrMapper extends BaseMapper<OrgUsr> { public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
String selectUpUnitByParam(@Param("id")String biz_org_code); String selectUpUnitByParam(@Param("id")String biz_org_code);
int selectPersonListCount(@Param("map")Map<String, Object> map); int selectPersonListCount(@Param("map")Map<String, Object> map);
List<Map<String, Object>> selectPersonList(@Param("map")Map<String, Object> map); List<Map<String, Object>> selectPersonList(@Param("map")Map<String, Object> map);
...@@ -95,7 +95,7 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -95,7 +95,7 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
void updatelistByParentId(String codex, String code); void updatelistByParentId(String codex, String code);
List< Map<String,String>> getPersonSimpleDetail(); List< Map<String,String>> getPersonSimpleDetail();
List<Map<String, Long>> countDeptByCompanyId(@Param("companyIdList") List<String> companyIdList); List<Map<String, Long>> countDeptByCompanyId(@Param("companyIdList") List<String> companyIdList);
...@@ -137,4 +137,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -137,4 +137,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<DynamicFormInstance> checkCertificatesNumber(String certificatesNumber, Long orgUserId); List<DynamicFormInstance> checkCertificatesNumber(String certificatesNumber, Long orgUserId);
OrgUsr queryByCompanyCode(@Param("companyCode") String companyCode); OrgUsr queryByCompanyCode(@Param("companyCode") String companyCode);
List<Map<String, String>> selectUserDeptMap(@Param("ids") List<Long> userIds);
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.service; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import java.text.ParseException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -39,4 +40,6 @@ public interface IDutyCarService extends IDutyCommonService { ...@@ -39,4 +40,6 @@ public interface IDutyCarService extends IDutyCommonService {
//查询今日值班车辆 //查询今日值班车辆
List<Map<String, String>>getDutyCar(); List<Map<String, String>>getDutyCar();
void writeHistoryDutyLog();
} }
package com.yeejoin.amos.boot.module.common.api.service; package com.yeejoin.amos.boot.module.common.api.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
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.dto.DutyPersonShiftDto;
import java.text.ParseException; import java.text.ParseException;
...@@ -134,13 +135,13 @@ public interface IDutyCommonService { ...@@ -134,13 +135,13 @@ public interface IDutyCommonService {
* @param startTime * @param startTime
*/ */
public void saveDutyPersonShiftDetail( Long instanceId ,List<DutyPersonShiftDto> dutyShift ,String startTime) ; public void saveDutyPersonShiftDetail( Long instanceId ,List<DutyPersonShiftDto> dutyShift ,String startTime) ;
/** /**
* 添加值班人的信息 可以保存空信息 * 添加值班人的信息 可以保存空信息
* @param instanceId * @param instanceId
* @param dutyShiftList * @param dutyShiftList
*/ */
public void insertPersonShift(Long instanceId, List<DutyPersonShiftDto> dutyShiftList,String type); public void insertPersonShift(Long instanceId, List<DutyPersonShiftDto> dutyShiftList,String type);
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode); public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode);
} }
...@@ -37,4 +37,6 @@ public interface IDutyPersonService extends IDutyCommonService { ...@@ -37,4 +37,6 @@ public interface IDutyPersonService extends IDutyCommonService {
List<Map<String, Object>> queryByCompanyId(List<String> bizNames); List<Map<String, Object>> queryByCompanyId(List<String> bizNames);
List<Map<String, Object>> queryByCompanyNew(String bizOrgName); List<Map<String, Object>> queryByCompanyNew(String bizOrgName);
void writeHistoryDutyLog();
} }
<?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.common.api.mapper.DutyPersonShiftLogMapper">
<select id="selectSpecificDateLogForCar" resultType="java.util.Map">
select
car_name AS carName,
dept_name AS teamName,
post_type_name as postTypeName,
group_concat(duty_user) AS dutyUsers
from
cb_duty_person_shift_log
where
group_code = 'dutyCar'
and duty_date = #{dutyDate}
group by
car_name, dept_name, post_type_name
</select>
<select id="selectSpecificDateLogForPerson" resultType="java.util.Map">
select
dept_name as deptName,
post_type_name as postTypeName,
group_concat(duty_user) AS dutyUsers
from
cb_duty_person_shift_log
where
group_code = 'dutyPerson'
and duty_date = #{dutyDate}
group by
dept_name, post_type_name
</select>
<select id="selectSpecificDateLogForPersonGroupByPostTypeName" resultType="java.util.Map">
select
post_type_name as postTypeName,
group_concat(duty_user) AS dutyUsers
from
cb_duty_person_shift_log
where
group_code = 'dutyPerson'
and duty_date = #{dutyDate}
group by
post_type_name
</select>
</mapper>
...@@ -245,7 +245,6 @@ ...@@ -245,7 +245,6 @@
cd.FIELD_VALUE cd.FIELD_VALUE
END END
) AS #{teamName} ) AS #{teamName}
FROM FROM
cb_dynamic_form_instance cd cb_dynamic_form_instance cd
LEFT JOIN ( LEFT JOIN (
...@@ -267,6 +266,20 @@ ...@@ -267,6 +266,20 @@
</if> </if>
</select> </select>
<select id="getOldDutyPersonShifts" resultType='com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift'>
SELECT
DISTINCT dp.duty_date AS dutyDate
FROM
cb_duty_person_shift dp
LEFT JOIN cb_dynamic_form_instance cd ON dp.instance_id = cd.instance_id
AND cd.group_code = #{groupCode}
AND cd.instance_id IS NOT NULL
AND dp.instance_id IS NOT NULL
AND cd.is_delete = 0
AND dp.is_delete = 0
ORDER BY dp.duty_date DESC
</select>
<select id='getNewEquipmentForSpecifyDate' resultType='map'> <select id='getNewEquipmentForSpecifyDate' resultType='map'>
select *, select *,
(SELECT (SELECT
...@@ -295,13 +308,16 @@ ...@@ -295,13 +308,16 @@
WHEN cd.FIELD_CODE = #{equipmentName} THEN WHEN cd.FIELD_CODE = #{equipmentName} THEN
cd.FIELD_VALUE cd.FIELD_VALUE
END END
) AS #{equipmentName} ) AS #{equipmentName},
cds.instance_row AS instanceRow
FROM FROM
cb_dynamic_form_instance cd cb_dynamic_form_instance cd
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
dp.instance_id, dp.instance_id,
ds.`name` ds.`name`,
dp.instance_row
FROM FROM
cb_duty_person_shift dp cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
......
...@@ -1100,5 +1100,31 @@ LEFT JOIN ( ...@@ -1100,5 +1100,31 @@ LEFT JOIN (
cb_org_usr.is_delete=0 AND cb_org_usr.amos_org_id IS NOT NULL AND cb_org_usr.amos_org_id !='' cb_org_usr.is_delete=0 AND cb_org_usr.amos_org_id IS NOT NULL AND cb_org_usr.amos_org_id !=''
</select> </select>
<select id="selectUserDeptMap" resultType="map">
-- 根据人员的id列表查询人员所属部门名称,根据parent_id查询。 返回map,人员名称对应人员部门
SELECT
u.biz_org_name AS userName,
(
SELECT
biz_org_name
FROM
cb_org_usr
WHERE
sequence_nbr = u.parent_id
) AS deptName
FROM
cb_org_usr u
<where>
u.biz_org_type = 'PERSON'
AND u.is_delete = 0
<if test="ids != null and ids.size > 0">
AND u.sequence_nbr IN
<foreach collection="ids" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>
...@@ -43,7 +43,7 @@ import io.swagger.annotations.ApiParam; ...@@ -43,7 +43,7 @@ import io.swagger.annotations.ApiParam;
@Api(tags = "值班车辆接口Api") @Api(tags = "值班车辆接口Api")
@RequestMapping(value = "/common/duty-car") @RequestMapping(value = "/common/duty-car")
public class DutyCarController extends BaseController { public class DutyCarController extends BaseController {
@Autowired @Autowired
IDutyCarService iDutyCarService; IDutyCarService iDutyCarService;
...@@ -156,7 +156,7 @@ public class DutyCarController extends BaseController { ...@@ -156,7 +156,7 @@ public class DutyCarController extends BaseController {
* @param startTime 开始时间 * @param startTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
* @return ResponseModel * @return ResponseModel
* @throws Exception * @throws Exception
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping("/{instanceId}/{startTime}/{endTime}") @DeleteMapping("/{instanceId}/{startTime}/{endTime}")
...@@ -186,4 +186,15 @@ public class DutyCarController extends BaseController { ...@@ -186,4 +186,15 @@ public class DutyCarController extends BaseController {
public ResponseModel<List<Map<String, Object>>> theCarDutyPerson(@RequestParam Long carId){ public ResponseModel<List<Map<String, Object>>> theCarDutyPerson(@RequestParam Long carId){
return ResponseHelper.buildResponse(iDutyCarService.theCarDutyPerson(carId)); return ResponseHelper.buildResponse(iDutyCarService.theCarDutyPerson(carId));
} }
/**
* 写入历史展板数据到日志表
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping ("/write-history-duty-log")
@ApiOperation(httpMethod = "GET", value = "历史值班数据写入日志表", notes = "历史值班数据写入日志表")
public ResponseModel writeHistoryDutyLog() {
iDutyCarService.writeHistoryDutyLog();
return ResponseHelper.buildResponse("running...");
}
} }
\ No newline at end of file
...@@ -159,7 +159,7 @@ public class DutyPersonController extends BaseController { ...@@ -159,7 +159,7 @@ public class DutyPersonController extends BaseController {
* @param startTime 开始时间 * @param startTime 开始时间
* @param endTime 结束时间 * @param endTime 结束时间
* @return ResponseModel * @return ResponseModel
* @throws Exception * @throws Exception
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping("/{instanceId}/{startTime}/{endTime}") @DeleteMapping("/{instanceId}/{startTime}/{endTime}")
...@@ -250,5 +250,14 @@ public class DutyPersonController extends BaseController { ...@@ -250,5 +250,14 @@ public class DutyPersonController extends BaseController {
// return ResponseHelper.buildResponse(iDutyPersonService.queryByCompanyId(companyId)); // return ResponseHelper.buildResponse(iDutyPersonService.queryByCompanyId(companyId));
// } // }
/**
* 写入历史展板数据到日志表
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping ("/write-history-duty-log")
@ApiOperation(httpMethod = "GET", value = "历史值班数据写入日志表", notes = "历史值班数据写入日志表")
public ResponseModel writeHistoryDutyLog() {
iDutyPersonService.writeHistoryDutyLog();
return ResponseHelper.buildResponse("running...");
}
} }
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="chenhao" id="2021-08-31-chenhao-1"> <changeSet author="chenhao" id="2021-08-31-chenhao-1">
<comment>modify table cb_firefighters_thought add one columns</comment> <comment>modify table cb_firefighters_thought add one columns</comment>
<sql> <sql>
ALTER TABLE `cb_firefighters_thought` modify talking_time datetime COMMENT '谈话时间'; ALTER TABLE `cb_firefighters_thought` modify talking_time datetime COMMENT '谈话时间';
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
INSERT INTO cb_data_dictionary (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES ('1169', '1169', '环支状管网', 'XFJSGW', NULL, NULL, NULL, NULL, NULL, '\0', '1'); INSERT INTO cb_data_dictionary (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES ('1169', '1169', '环支状管网', 'XFJSGW', NULL, NULL, NULL, NULL, NULL, '\0', '1');
INSERT INTO cb_data_dictionary (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES ('1170', '1170', '可用', 'SYZT', NULL, NULL, NULL, NULL, NULL, '\0', '1'); INSERT INTO cb_data_dictionary (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES ('1170', '1170', '可用', 'SYZT', NULL, NULL, NULL, NULL, NULL, '\0', '1');
INSERT INTO cb_data_dictionary (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES ('1171', '1171', '不可用', 'SYZT', NULL, NULL, NULL, NULL, NULL, '\0', '1'); INSERT INTO cb_data_dictionary (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES ('1171', '1171', '不可用', 'SYZT', NULL, NULL, NULL, NULL, NULL, '\0', '1');
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="guowubin" id="1629430730658-1"> <changeSet author="guowubin" id="1629430730658-1">
<comment>alter table jc_controller</comment> <comment>alter table jc_controller</comment>
...@@ -561,7 +561,7 @@ ...@@ -561,7 +561,7 @@
'调派任务状态(执行中:executing,已完成:finished)'; '调派任务状态(执行中:executing,已完成:finished)';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="chenhao" id="2021-09-13-chenhao-1"> <changeSet author="chenhao" id="2021-09-13-chenhao-1">
<comment>update data cb_firefighters_workexperience</comment> <comment>update data cb_firefighters_workexperience</comment>
<sql> <sql>
...@@ -1583,7 +1583,7 @@ ...@@ -1583,7 +1583,7 @@
INSERT INTO cb_dynamic_form_group (`sequence_nbr`, `group_name`, `group_code`, `parent_id`, `group_config`, `org_code`, `sort`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`) VALUES ('132828674815', '值班消防', 'dutyFireFighting', '0', NULL, '10', '1', NULL, NULL, '2021-09-28 10:34:05', '\0'); INSERT INTO cb_dynamic_form_group (`sequence_nbr`, `group_name`, `group_code`, `parent_id`, `group_config`, `org_code`, `sort`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`) VALUES ('132828674815', '值班消防', 'dutyFireFighting', '0', NULL, '10', '1', NULL, NULL, '2021-09-28 10:34:05', '\0');
</sql> </sql>
</changeSet> </changeSet>
<changeSet id="2021-10-13" author="chenhao-2"> <changeSet id="2021-10-13" author="chenhao-2">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<tableExists tableName="cb_dynamic_form_column" /> <tableExists tableName="cb_dynamic_form_column" />
...@@ -1775,7 +1775,7 @@ ...@@ -1775,7 +1775,7 @@
INSERT INTO cb_dynamic_form_group (`sequence_nbr`, `group_name`, `group_code`, `parent_id`, `group_config`, `org_code`, `sort`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`) VALUES ('132828674816', '值班120急救站', 'dutyFirstAid', '0', NULL, '10', '1', NULL, NULL, '2021-10-14 16:48:41', '\0'); INSERT INTO cb_dynamic_form_group (`sequence_nbr`, `group_name`, `group_code`, `parent_id`, `group_config`, `org_code`, `sort`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`) VALUES ('132828674816', '值班120急救站', 'dutyFirstAid', '0', NULL, '10', '1', NULL, NULL, '2021-10-14 16:48:41', '\0');
</sql> </sql>
</changeSet> </changeSet>
<changeSet id="2021-10-14" author="chenhao-2"> <changeSet id="2021-10-14" author="chenhao-2">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<tableExists tableName="cb_dynamic_form_column" /> <tableExists tableName="cb_dynamic_form_column" />
...@@ -2032,8 +2032,8 @@ ...@@ -2032,8 +2032,8 @@
<sql> <sql>
ALTER TABLE cb_firefighters ADD fire_team_name varchar(100) NULL COMMENT '消防队伍名称' ALTER TABLE cb_firefighters ADD fire_team_name varchar(100) NULL COMMENT '消防队伍名称'
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="chenhao" id="2021-11-02-3"> <changeSet author="chenhao" id="2021-11-02-3">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<not> <not>
...@@ -2044,8 +2044,8 @@ ...@@ -2044,8 +2044,8 @@
<sql> <sql>
ALTER TABLE cb_key_site ADD belong_name varchar(100) NULL COMMENT '所属单位/部门名称'; ALTER TABLE cb_key_site ADD belong_name varchar(100) NULL COMMENT '所属单位/部门名称';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="chenhao" id="2021-11-02-4"> <changeSet author="chenhao" id="2021-11-02-4">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<not> <not>
...@@ -2056,8 +2056,8 @@ ...@@ -2056,8 +2056,8 @@
<sql> <sql>
ALTER TABLE cb_org_usr ADD parent_name varchar(100) NULL COMMENT '归属机构/部门/人员名称'; ALTER TABLE cb_org_usr ADD parent_name varchar(100) NULL COMMENT '归属机构/部门/人员名称';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="chenhao" id="2021-11-04-1"> <changeSet author="chenhao" id="2021-11-04-1">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<not> <not>
...@@ -2068,8 +2068,8 @@ ...@@ -2068,8 +2068,8 @@
<sql> <sql>
ALTER TABLE cb_fire_team ADD parent_name varchar(100) NULL COMMENT '父级队伍名称'; ALTER TABLE cb_fire_team ADD parent_name varchar(100) NULL COMMENT '父级队伍名称';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="litw" id="2021-11-03-01"> <changeSet author="litw" id="2021-11-03-01">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<not> <not>
...@@ -2093,7 +2093,7 @@ ...@@ -2093,7 +2093,7 @@
) COMMENT = '消防水源物联参数' ; ) COMMENT = '消防水源物联参数' ;
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="chenhao" id="2021-11-05-1"> <changeSet author="chenhao" id="2021-11-05-1">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<not> <not>
...@@ -2104,7 +2104,7 @@ ...@@ -2104,7 +2104,7 @@
<sql> <sql>
ALTER TABLE cb_maintenance_company ADD parent_name varchar(100) NULL COMMENT '所属单位/部门名称'; ALTER TABLE cb_maintenance_company ADD parent_name varchar(100) NULL COMMENT '所属单位/部门名称';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="litw" id="2021-11-05-01"> <changeSet author="litw" id="2021-11-05-01">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
...@@ -2745,7 +2745,7 @@ ...@@ -2745,7 +2745,7 @@
ALTER TABLE cb_fire_station ADD parent_building_id varchar(1000) NULL COMMENT '所属建筑节点的所有父节点id集合'; ALTER TABLE cb_fire_station ADD parent_building_id varchar(1000) NULL COMMENT '所属建筑节点的所有父节点id集合';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="tw" id="20220207-1" runAlways="true"> <changeSet author="tw" id="20220207-1" runAlways="true">
<comment>`getParentList`</comment> <comment>`getParentList`</comment>
<sql endDelimiter="#"> <sql endDelimiter="#">
...@@ -3643,6 +3643,33 @@ ...@@ -3643,6 +3643,33 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="lixiuming" id="2023-10-24-01">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_duty_person_shift_log"/>
</preConditions>
<comment>create table cb_duty_person_shift_log 值班人员日期变更日志表</comment>
<sql>
CREATE TABLE `cb_duty_person_shift_log` (
`sequence_nbr` bigint NOT NULL COMMENT '物理主键',
`instance_id` bigint COMMENT '实例ID',
`duty_date` date COMMENT '值班日期',
`group_code` varchar(255) COMMENT '分组code',
`dept_name` varchar(255) COMMENT '单位/部门',
`duty_user_id` varchar(255) COMMENT '值班人ID',
`duty_user` varchar(255) COMMENT '值班人',
`post_type_name` varchar(255) COMMENT '岗位',
`duty_area` varchar(255) COMMENT '值班区域',
`shift_name` varchar(255) COMMENT '值班类型',
`car_name` varchar(255) COMMENT '车辆名称(车辆特有)',
`rec_user_id` bigint NULL DEFAULT NULL COMMENT '更新人员id',
`rec_user_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人员',
`rec_date` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`is_delete` bit(1) NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`sequence_nbr`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '值班人员日期变更日志表' ROW_FORMAT = Dynamic;
</sql>
</changeSet>
......
...@@ -307,18 +307,18 @@ ...@@ -307,18 +307,18 @@
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<repositories> <repositories>
<!--<repository> <id>Releases</id> <name>Releases</name> <url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/releases/</url> <!--<repository> <id>Releases</id> <name>Releases</name> <url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/releases/</url>
</repository> <repository> <id>Snapshots</id> <name>Snapshots</name> <url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/snapshots/</url> </repository> <repository> <id>Snapshots</id> <name>Snapshots</name> <url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/snapshots/</url>
</repository> --> </repository> -->
<repository> <repository>
<id>Releases</id> <id>Releases</id>
<name>Releases</name> <name>Releases</name>
<url>http://36.46.149.14:8081/nexus/content/repositories/releases/</url> <url>http://113.142.68.105:8081/nexus/content/repositories/releases/</url>
</repository> </repository>
<repository> <repository>
<id>Snapshots</id> <id>Snapshots</id>
<name>Snapshots</name> <name>Snapshots</name>
<url>http://36.46.149.14:8081/nexus/content/repositories/snapshots/</url> <url>http://113.142.68.105:8081/nexus/content/repositories/snapshots/</url>
</repository> </repository>
<repository> <repository>
<id>com.e-iceblue</id> <id>com.e-iceblue</id>
......
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