Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
e2d64218
Commit
e2d64218
authored
Oct 24, 2023
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(JCS#14822|#14821) 人员更换单位、执勤人员换车导致排班历史数据被修改
parent
24b24622
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
533 additions
and
121 deletions
+533
-121
DutyCarExcelDto.java
...join/amos/boot/module/common/api/dto/DutyCarExcelDto.java
+2
-34
DutyPersonExcelDto.java
...n/amos/boot/module/common/api/dto/DutyPersonExcelDto.java
+22
-22
TemplateDutyCarExcelDto.java
...s/boot/module/common/api/dto/TemplateDutyCarExcelDto.java
+67
-0
TemplateDutyPersonExcelDto.java
...oot/module/common/api/dto/TemplateDutyPersonExcelDto.java
+59
-0
DutyPersonShiftLog.java
...mos/boot/module/common/api/entity/DutyPersonShiftLog.java
+71
-0
DutyPersonShiftLogMapper.java
...ot/module/common/api/mapper/DutyPersonShiftLogMapper.java
+17
-0
DutyPersonShiftMapper.java
.../boot/module/common/api/mapper/DutyPersonShiftMapper.java
+3
-0
OrgUsrMapper.java
...join/amos/boot/module/common/api/mapper/OrgUsrMapper.java
+2
-0
IDutyCarService.java
.../amos/boot/module/common/api/service/IDutyCarService.java
+3
-0
IDutyCommonService.java
...os/boot/module/common/api/service/IDutyCommonService.java
+1
-0
IDutyPersonService.java
...os/boot/module/common/api/service/IDutyPersonService.java
+2
-0
DutyPersonShiftLogMapper.xml
...pi/src/main/resources/mapper/DutyPersonShiftLogMapper.xml
+46
-0
DutyPersonShiftMapper.xml
...n-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
+19
-3
OrgUsrMapper.xml
...ule-common-api/src/main/resources/mapper/OrgUsrMapper.xml
+26
-0
DutyCarController.java
.../boot/module/common/biz/controller/DutyCarController.java
+12
-0
DutyPersonController.java
...ot/module/common/biz/controller/DutyPersonController.java
+10
-1
DutyCarServiceImpl.java
...ot/module/common/biz/service/impl/DutyCarServiceImpl.java
+0
-0
DutyCommonServiceImpl.java
...module/common/biz/service/impl/DutyCommonServiceImpl.java
+72
-22
DutyPersonServiceImpl.java
...module/common/biz/service/impl/DutyPersonServiceImpl.java
+0
-0
ExcelServiceImpl.java
...os/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
+70
-37
jcs-1.0.0.0.xml
...ystem-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
+27
-0
pom.xml
pom.xml
+2
-2
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/DutyCarExcelDto.java
View file @
e2d64218
...
@@ -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
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/DutyPersonExcelDto.java
View file @
e2d64218
...
@@ -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;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/TemplateDutyCarExcelDto.java
0 → 100644
View file @
e2d64218
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
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/TemplateDutyPersonExcelDto.java
0 → 100644
View file @
e2d64218
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
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/DutyPersonShiftLog.java
0 → 100644
View file @
e2d64218
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
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/DutyPersonShiftLogMapper.java
0 → 100644
View file @
e2d64218
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
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/DutyPersonShiftMapper.java
View file @
e2d64218
...
@@ -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 接口
...
@@ -153,6 +154,8 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
...
@@ -153,6 +154,8 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
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
);
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/OrgUsrMapper.java
View file @
e2d64218
...
@@ -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
);
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IDutyCarService.java
View file @
e2d64218
...
@@ -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
();
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IDutyCommonService.java
View file @
e2d64218
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
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IDutyPersonService.java
View file @
e2d64218
...
@@ -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
();
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/DutyPersonShiftLogMapper.xml
0 → 100644
View file @
e2d64218
<?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>
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
View file @
e2d64218
...
@@ -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
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
e2d64218
...
@@ -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>
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyCarController.java
View file @
e2d64218
...
@@ -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
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyPersonController.java
View file @
e2d64218
...
@@ -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..."
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyCarServiceImpl.java
View file @
e2d64218
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyCommonServiceImpl.java
View file @
e2d64218
...
@@ -3,21 +3,34 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
...
@@ -3,21 +3,34 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.Period
;
import
java.time.temporal.ChronoUnit
;
import
java.time.temporal.ChronoUnit
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.function.Consumer
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.yeejoin.amos.boot.module.common.api.entity.*
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftLogMapper
;
import
com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCode
;
import
com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCode
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.joda.time.DateTime
;
import
org.joda.time.DateTime
;
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.TransactionManager
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.support.TransactionSynchronization
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
...
@@ -34,11 +47,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
...
@@ -34,11 +47,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto
;
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.DutyPersonShift
;
import
com.yeejoin.amos.boot.module.common.api.entity.DutyShift
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.enums.DutyViewTypeEnum
;
import
com.yeejoin.amos.boot.module.common.api.enums.DutyViewTypeEnum
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyCommonService
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyCommonService
;
...
@@ -76,6 +84,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
...
@@ -76,6 +84,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Autowired
@Autowired
DutyPersonShiftMapper
dutyPersonShiftMapper
;
DutyPersonShiftMapper
dutyPersonShiftMapper
;
@Autowired
DutyPersonShiftLogMapper
dutyPersonShiftLogMapper
;
/**
/**
* 每天单个班次执勤人数全部小于等于3人
* 每天单个班次执勤人数全部小于等于3人
*/
*/
...
@@ -343,7 +354,18 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
...
@@ -343,7 +354,18 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
if
(
StringUtils
.
isNotBlank
(
fieldCode
))
{
if
(
StringUtils
.
isNotBlank
(
fieldCode
))
{
return
dutyPersonShiftService
.
getBaseMapper
().
newStationViewDataByFieldCode
(
dutyDate
,
this
.
getGroupCode
(),
fieldCode
);
return
dutyPersonShiftService
.
getBaseMapper
().
newStationViewDataByFieldCode
(
dutyDate
,
this
.
getGroupCode
(),
fieldCode
);
}
}
return
dutyPersonShiftService
.
getBaseMapper
().
newStationViewData
(
dutyDate
,
this
.
getGroupCode
());
// return dutyPersonShiftService.getBaseMapper().newStationViewData(dutyDate, this.getGroupCode());
List
<
Map
<
String
,
String
>>
dutyLogs
=
dutyPersonShiftLogMapper
.
selectSpecificDateLogForPersonGroupByPostTypeName
(
dutyDate
);
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
for
(
Map
<
String
,
String
>
dutyLog
:
dutyLogs
)
{
Map
<
String
,
Object
>
item
=
new
HashMap
<
String
,
Object
>()
{{
this
.
put
(
"postTypeName"
,
dutyLog
.
getOrDefault
(
"postTypeName"
,
""
));
this
.
put
(
"total"
,
dutyLog
.
getOrDefault
(
"dutyUsers"
,
""
).
split
(
","
).
length
);
}};
result
.
add
(
item
);
}
return
result
;
}
}
/**
/**
* 车辆值班人员左侧的统计: 只有几辆车
* 车辆值班人员左侧的统计: 只有几辆车
...
@@ -351,22 +373,21 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
...
@@ -351,22 +373,21 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
* @return
* @return
*/
*/
public
Object
getCarPostTypeNameAndCount
(
String
dutyDate
)
{
public
Object
getCarPostTypeNameAndCount
(
String
dutyDate
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
int
station
=
0
;
List
<
DutyPersonShiftLog
>
dutyCarLogs
=
dutyPersonShiftLogMapper
.
selectList
(
int
person
=
0
;
Wrappers
.<
DutyPersonShiftLog
>
lambdaQuery
()
List
<
Map
<
String
,
Object
>>
equipmentList
=
dutyPersonShiftMapper
.
getEquipmentForSpecifyDate
(
dutyDate
,
.
select
(
DutyPersonShiftLog:
:
getCarName
)
this
.
getGroupCode
(),
"carId"
,
"carName"
,
"teamName"
,
"result.carId"
);
.
eq
(
DutyPersonShiftLog:
:
getDutyDate
,
dutyDate
)
if
(
equipmentList
==
null
||
equipmentList
.
size
()<
1
||
equipmentList
.
get
(
0
)==
null
)
{
.
eq
(
DutyPersonShiftLog:
:
getGroupCode
,
"dutyCar"
)
station
=
0
;
.
eq
(
DutyPersonShiftLog:
:
getIsDelete
,
false
)
}
else
{
);
station
=
equipmentList
.
size
();
dutyCarLogs
=
dutyCarLogs
.
stream
().
filter
(
Objects:
:
nonNull
).
collect
(
Collectors
.
toList
());
}
Map
<
String
,
List
<
DutyPersonShiftLog
>>
logsMap
=
dutyCarLogs
.
stream
().
collect
(
Collectors
.
groupingBy
(
DutyPersonShiftLog:
:
getCarName
));
int
station
=
logsMap
.
size
();
map
.
put
(
"station"
,
station
);
map
.
put
(
"station"
,
station
);
List
<
Map
<
String
,
Object
>>
list
=
dutyPersonShiftService
.
getBaseMapper
().
newStationViewData
(
dutyDate
,
this
.
getGroupCode
());
map
.
put
(
"person"
,
dutyCarLogs
.
size
());
for
(
Map
<
String
,
Object
>
map2
:
list
)
{
person
=
person
+
Integer
.
parseInt
(
map2
.
get
(
"total"
).
toString
());
}
map
.
put
(
"person"
,
person
);
return
map
;
return
map
;
}
}
...
@@ -634,6 +655,13 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
...
@@ -634,6 +655,13 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
//dynamicFormInstanceService.remove(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId));
//dynamicFormInstanceService.remove(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId));
dutyPersonShiftService
dutyPersonShiftService
.
remove
(
new
LambdaQueryWrapper
<
DutyPersonShift
>().
ge
(
DutyPersonShift:
:
getDutyDate
,
startTime
).
le
(
DutyPersonShift:
:
getDutyDate
,
endTime
).
eq
(
DutyPersonShift:
:
getInstanceId
,
instanceId
));
.
remove
(
new
LambdaQueryWrapper
<
DutyPersonShift
>().
ge
(
DutyPersonShift:
:
getDutyDate
,
startTime
).
le
(
DutyPersonShift:
:
getDutyDate
,
endTime
).
eq
(
DutyPersonShift:
:
getInstanceId
,
instanceId
));
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
dutyPersonShiftLogMapper
.
delete
(
Wrappers
.<
DutyPersonShiftLog
>
lambdaQuery
()
.
eq
(
DutyPersonShiftLog:
:
getInstanceId
,
instanceId
)
.
ge
(
DutyPersonShiftLog:
:
getDutyDate
,
dateFormat
.
format
(
new
Date
()))
.
le
(
DutyPersonShiftLog:
:
getDutyDate
,
endTime
)
);
return
true
;
return
true
;
}
}
...
@@ -802,8 +830,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
...
@@ -802,8 +830,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
dutyPersonShiftService
.
saveOrUpdateBatch
(
dutyShiftList
);
dutyPersonShiftService
.
saveOrUpdateBatch
(
dutyShiftList
);
}
}
}
}
public
void
insertPersonShift
(
Long
instanceId
,
List
<
DutyPersonShiftDto
>
dutyShiftList
,
String
type
)
{
public
void
insertPersonShift
(
Long
instanceId
,
List
<
DutyPersonShiftDto
>
dutyShiftList
,
String
type
)
{
dutyPersonService
.
dataCheck
(
dutyShiftList
,
instanceId
,
type
);
dutyPersonService
.
dataCheck
(
dutyShiftList
,
instanceId
,
type
);
Set
<
DutyPersonShift
>
personShiftList
=
dutyShiftList
.
stream
().
map
(
dto
->
{
Set
<
DutyPersonShift
>
personShiftList
=
dutyShiftList
.
stream
().
map
(
dto
->
{
// BUG 2807 修改时发现BUG 车辆保存有问题 by kongfm 2021-09-14
// BUG 2807 修改时发现BUG 车辆保存有问题 by kongfm 2021-09-14
...
@@ -822,9 +850,31 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
...
@@ -822,9 +850,31 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}
}
}
}
/**
* 判断是否是历史值班日
* @param dutyDate 值班日期
*/
public
boolean
isAfterToday
(
Date
dutyDate
)
{
// 获取今天的开始时间
Calendar
todayStart
=
Calendar
.
getInstance
();
todayStart
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
todayStart
.
set
(
Calendar
.
MINUTE
,
0
);
todayStart
.
set
(
Calendar
.
SECOND
,
0
);
todayStart
.
set
(
Calendar
.
MILLISECOND
,
0
);
Calendar
duty
=
Calendar
.
getInstance
();
duty
.
setTime
(
dutyDate
);
return
duty
.
after
(
todayStart
)
||
duty
.
equals
(
todayStart
);
}
@Override
@Override
public
Object
getSchedulingDutyForSpecifyDate
(
String
dutyDay
,
Long
shiftId
,
String
postType
,
String
fieldCode
)
{
public
Object
getSchedulingDutyForSpecifyDate
(
String
dutyDay
,
Long
shiftId
,
String
postType
,
String
fieldCode
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
return
null
;
return
null
;
}
}
public
Object
getDutyPersonShiftLogData
(
String
dutyDay
,
String
fieldCode
){
return
null
;
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyPersonServiceImpl.java
View file @
e2d64218
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/ExcelServiceImpl.java
View file @
e2d64218
...
@@ -13,7 +13,9 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -13,7 +13,9 @@ import javax.servlet.http.HttpServletResponse;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
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.*
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.entity.*
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftLogMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.SignDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.SignDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.SinStaticDto
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.SinStaticDto
;
...
@@ -52,21 +54,6 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
...
@@ -52,21 +54,6 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import
com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil
;
import
com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
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.FireChemical
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireExperts
;
import
com.yeejoin.amos.boot.module.common.api.entity.FireStation
;
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.FirefightersContacts
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersEducation
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost
;
import
com.yeejoin.amos.boot.module.common.api.entity.FirefightersWorkexperience
;
import
com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment
;
import
com.yeejoin.amos.boot.module.common.api.entity.SpecialPositionStaff
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService
;
...
@@ -193,6 +180,9 @@ public class ExcelServiceImpl {
...
@@ -193,6 +180,9 @@ public class ExcelServiceImpl {
@Autowired
@Autowired
SignServiceImpl
signServiceImpl
;
SignServiceImpl
signServiceImpl
;
@Autowired
DutyPersonShiftLogMapper
dutyPersonShiftLogMapper
;
public
void
templateExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
)
throws
ClassNotFoundException
{
public
void
templateExport
(
HttpServletResponse
response
,
ExcelDto
excelDto
)
throws
ClassNotFoundException
{
String
url
=
excelDto
.
getClassUrl
();
String
url
=
excelDto
.
getClassUrl
();
Class
<?>
clz
=
Class
.
forName
(
url
);
Class
<?>
clz
=
Class
.
forName
(
url
);
...
@@ -1784,6 +1774,12 @@ public class ExcelServiceImpl {
...
@@ -1784,6 +1774,12 @@ public class ExcelServiceImpl {
dataList
.
add
(
dutyCarDtoMap
);
dataList
.
add
(
dutyCarDtoMap
);
}
}
}
}
// 生成变更日志
dataList
.
forEach
(
v
->
{
DutyCarDto
dutyCarDto
=
(
DutyCarDto
)
Bean
.
mapToBean
(
v
,
DutyCarDto
.
class
);
dutyCarService
.
createDutyPersonShiftLog
(
dutyCarDto
,
false
,
null
);
});
}
}
private
void
initDutyPersonData
(
XSSFSheet
sheet
,
List
<
Map
<
String
,
Object
>>
dataList
,
List
<
Date
>
dayByMonth
)
{
private
void
initDutyPersonData
(
XSSFSheet
sheet
,
List
<
Map
<
String
,
Object
>>
dataList
,
List
<
Date
>
dayByMonth
)
{
...
@@ -1848,6 +1844,12 @@ public class ExcelServiceImpl {
...
@@ -1848,6 +1844,12 @@ public class ExcelServiceImpl {
dataList
.
add
(
dutyPersonDtoMap
);
dataList
.
add
(
dutyPersonDtoMap
);
}
}
}
}
// 生成变更日志
dataList
.
forEach
(
v
->
{
DutyPersonDto
dutyPersonDto
=
(
DutyPersonDto
)
Bean
.
mapToBean
(
v
,
DutyPersonDto
.
class
);
dutyPersonService
.
createDutyPersonShiftLog
(
dutyPersonDto
,
false
,
null
);
});
}
}
private
void
initDutyFireFightingData
(
XSSFSheet
sheet
,
List
<
Map
<
String
,
Object
>>
dataList
,
List
<
Date
>
dayByMonth
)
{
private
void
initDutyFireFightingData
(
XSSFSheet
sheet
,
List
<
Map
<
String
,
Object
>>
dataList
,
List
<
Date
>
dayByMonth
)
{
...
@@ -1956,8 +1958,10 @@ public class ExcelServiceImpl {
...
@@ -1956,8 +1958,10 @@ public class ExcelServiceImpl {
String
ids
)
{
String
ids
)
{
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
if
(
ExcelEnums
.
CLZQ
.
getType
().
equals
(
excelDto
.
getType
()))
{
if
(
ExcelEnums
.
CLZQ
.
getType
().
equals
(
excelDto
.
getType
()))
{
excelDto
.
setClassUrl
(
"com.yeejoin.amos.boot.module.common.api.dto.TemplateDutyCarExcelDto"
);
data
=
initDutyCarTemplate
(
ids
);
data
=
initDutyCarTemplate
(
ids
);
}
else
if
(
ExcelEnums
.
RYZB
.
getType
().
equals
(
excelDto
.
getType
()))
{
}
else
if
(
ExcelEnums
.
RYZB
.
getType
().
equals
(
excelDto
.
getType
()))
{
excelDto
.
setClassUrl
(
"com.yeejoin.amos.boot.module.common.api.dto.TemplateDutyPersonExcelDto"
);
data
=
initDutyPersonTemplate
(
ids
);
data
=
initDutyPersonTemplate
(
ids
);
}
else
if
(
ExcelEnums
.
WXXFZB
.
getType
().
equals
(
excelDto
.
getType
()))
{
}
else
if
(
ExcelEnums
.
WXXFZB
.
getType
().
equals
(
excelDto
.
getType
()))
{
data
=
initDutyDutyFireFightingTemplate
(
ids
);
data
=
initDutyDutyFireFightingTemplate
(
ids
);
...
@@ -2170,28 +2174,45 @@ public class ExcelServiceImpl {
...
@@ -2170,28 +2174,45 @@ public class ExcelServiceImpl {
private
List
<
List
<
Object
>>
initDutyCarInfo
(
String
beginDate
,
String
endDate
,
List
<
String
>
dayByMonth
)
private
List
<
List
<
Object
>>
initDutyCarInfo
(
String
beginDate
,
String
endDate
,
List
<
String
>
dayByMonth
)
throws
ParseException
{
throws
ParseException
{
// 查询已值班数据
// 查询已值班数据
List
<
DutyCarDto
>
contentList
=
dutyCarService
.
downloadList
(
beginDate
,
endDate
);
Map
<
String
,
List
<
DutyPersonShiftLog
>>
dutyPersonShiftLogs
=
dutyCarService
.
getDownloadData
(
beginDate
,
endDate
);
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
List
<
String
>
monthDays
=
getMonthDays
(
beginDate
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
// 组装导出数据
// 组装导出数据
if
(!
contentList
.
isEmpty
())
{
if
(!
dutyPersonShiftLogs
.
isEmpty
())
{
AtomicInteger
row
=
new
AtomicInteger
(
1
);
AtomicInteger
row
=
new
AtomicInteger
(
1
);
contentList
.
forEach
(
o
->
{
for
(
Map
.
Entry
<
String
,
List
<
DutyPersonShiftLog
>>
entry
:
dutyPersonShiftLogs
.
entrySet
())
{
String
carName
=
entry
.
getKey
();
List
<
DutyPersonShiftLog
>
shiftLogs
=
entry
.
getValue
();
Map
<
String
,
List
<
DutyPersonShiftLog
>>
shiftLogsMap
=
shiftLogs
.
stream
().
collect
(
Collectors
.
groupingBy
(
v
->
formatter
.
format
(
v
.
getDutyDate
())));
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
o
.
getTeamName
());
list
.
add
(
carName
);
list
.
add
(
o
.
getUserName
());
list
.
add
(
o
.
getPostTypeName
());
list
.
add
(
o
.
getCarName
());
list
.
add
(
o
.
getDutyArea
());
List
<
DutyPersonShiftDto
>
dutyShift
=
o
.
getDutyShift
();
initDutyShift
(
dayByMonth
,
dutyShift
,
list
);
for
(
String
monthDay
:
monthDays
)
{
List
<
DutyPersonShiftLog
>
targetLogs
=
shiftLogsMap
.
get
(
monthDay
);
if
(
Objects
.
isNull
(
targetLogs
)
||
targetLogs
.
isEmpty
())
{
list
.
add
(
""
);
continue
;
}
DutyPersonShiftLog
shiftLog
=
targetLogs
.
get
(
0
);
String
deptName
=
shiftLog
.
getDeptName
();
String
dutyUsers
=
targetLogs
.
stream
().
map
(
DutyPersonShiftLog:
:
getDutyUser
).
distinct
().
collect
(
Collectors
.
joining
(
","
));
String
value
=
String
.
format
(
"%s|%s"
,
deptName
,
dutyUsers
);
list
.
add
(
value
);
}
data
.
add
(
list
);
data
.
add
(
list
);
}
);
}
}
}
return
data
;
return
data
;
}
}
private
List
<
String
>
getMonthDays
(
String
date
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
return
DateUtils
.
getDayByMonth
(
date
).
stream
().
map
(
formatter:
:
format
).
collect
(
Collectors
.
toList
());
}
private
void
initDutyShift
(
List
<
String
>
dayByMonth
,
List
<
DutyPersonShiftDto
>
dutyShift
,
ArrayList
<
Object
>
list
)
{
private
void
initDutyShift
(
List
<
String
>
dayByMonth
,
List
<
DutyPersonShiftDto
>
dutyShift
,
ArrayList
<
Object
>
list
)
{
HashMap
<
String
,
String
>
dutyShiftMap
=
new
HashMap
<>();
HashMap
<
String
,
String
>
dutyShiftMap
=
new
HashMap
<>();
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
...
@@ -2209,24 +2230,36 @@ public class ExcelServiceImpl {
...
@@ -2209,24 +2230,36 @@ public class ExcelServiceImpl {
private
List
<
List
<
Object
>>
initDutyPersonInfo
(
String
beginDate
,
String
endDate
,
List
<
String
>
dayByMonth
)
private
List
<
List
<
Object
>>
initDutyPersonInfo
(
String
beginDate
,
String
endDate
,
List
<
String
>
dayByMonth
)
throws
ParseException
{
throws
ParseException
{
// 查询已值班数据
// 查询已值班数据
List
<
DutyPersonDto
>
contentList
=
iDutyPersonService
.
downloadList
(
beginDate
,
endDate
);
Map
<
String
,
List
<
DutyPersonShiftLog
>>
dutyPersonShiftLogs
=
dutyPersonService
.
getDownloadData
(
beginDate
,
endDate
);
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
List
<
List
<
Object
>>
data
=
new
ArrayList
<>();
List
<
String
>
monthDays
=
getMonthDays
(
beginDate
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
// 组装导出数据
// 组装导出数据
if
(!
contentList
.
isEmpty
())
{
if
(!
dutyPersonShiftLogs
.
isEmpty
())
{
AtomicInteger
row
=
new
AtomicInteger
(
1
);
AtomicInteger
row
=
new
AtomicInteger
(
1
);
contentList
.
forEach
(
o
->
{
for
(
Map
.
Entry
<
String
,
List
<
DutyPersonShiftLog
>>
entry
:
dutyPersonShiftLogs
.
entrySet
())
{
String
userName
=
entry
.
getKey
();
List
<
DutyPersonShiftLog
>
shiftLogs
=
entry
.
getValue
();
shiftLogs
=
shiftLogs
.
stream
().
sorted
(
Comparator
.
comparing
(
DutyPersonShiftLog:
:
getDutyDate
)).
collect
(
Collectors
.
toList
());
DutyPersonShiftLog
dutyPersonShiftLog
=
shiftLogs
.
get
(
0
);
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
ArrayList
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
row
.
getAndIncrement
());
list
.
add
(
o
.
getUserId
());
list
.
add
(
dutyPersonShiftLog
.
getDutyUserId
());
list
.
add
(
o
.
getUserName
());
list
.
add
(
userName
);
list
.
add
(
o
.
getDeptName
());
list
.
add
(
o
.
getPostTypeName
());
list
.
add
(
o
.
getDutyArea
());
List
<
DutyPersonShiftDto
>
dutyShift
=
o
.
getDutyShift
();
initDutyShift
(
dayByMonth
,
dutyShift
,
list
);
for
(
String
monthDay
:
monthDays
)
{
List
<
DutyPersonShiftLog
>
targetLogs
=
shiftLogs
.
stream
().
filter
(
v
->
Objects
.
equals
(
monthDay
,
formatter
.
format
(
v
.
getDutyDate
()))).
collect
(
Collectors
.
toList
());
if
(
targetLogs
.
isEmpty
())
{
list
.
add
(
NOT_DUTY
);
continue
;
}
DutyPersonShiftLog
shiftLog
=
targetLogs
.
get
(
0
);
String
value
=
String
.
format
(
"%s|%s|%s|%s"
,
shiftLog
.
getDeptName
(),
shiftLog
.
getPostTypeName
(),
Objects
.
isNull
(
shiftLog
.
getDutyArea
())
?
"无"
:
shiftLog
.
getDutyArea
(),
shiftLog
.
getShiftName
());
list
.
add
(
value
);
}
data
.
add
(
list
);
data
.
add
(
list
);
}
);
}
}
}
return
data
;
return
data
;
}
}
...
...
amos-boot-system-jcs/src/main/resources/db/changelog/jcs-1.0.0.0.xml
View file @
e2d64218
...
@@ -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>
...
...
pom.xml
View file @
e2d64218
...
@@ -313,12 +313,12 @@
...
@@ -313,12 +313,12 @@
<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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment