修订财务批量下款存在的金额超出问题;修订任务转交扣除绩点问题;修订工单完结超时记录问题
This commit is contained in:
parent
75bb2374e3
commit
f20a744ec9
File diff suppressed because it is too large
Load Diff
@ -32,7 +32,7 @@ public class TaskItemBo {
|
|||||||
* 任务项(0:待开发;1:待测试:2:待部署;3:已归档)
|
* 任务项(0:待开发;1:待测试:2:待部署;3:已归档)
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "任务项不能为空")
|
@NotNull(message = "任务项不能为空")
|
||||||
@ApiModelProperty(value = "任务项(0:待开发;1:待测试:2:待部署;3:已归档)",required = true)
|
@ApiModelProperty(value = "任务项(0:待开发;1:待测试:2:待部署;3:已归档;-1:逾期)",required = true)
|
||||||
private Integer taskItem;
|
private Integer taskItem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -239,8 +239,7 @@ public class TaskTechnologyController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("技术模块-今日事务-新增任务小组成员")
|
@ApiOperation("技术模块-今日事务-新增任务小组成员")
|
||||||
@PostMapping("/insertTaskStaffGroup")
|
@PostMapping("/insertTaskStaffGroup")
|
||||||
public R<Void> insertTaskStaffGroup(@RequestBody @Validated
|
public R<Void> insertTaskStaffGroup(@RequestBody @Validated TaskStaffGroupBo bo) {
|
||||||
TaskStaffGroupBo bo) {
|
|
||||||
taskStaffGroupService.insertTaskStaffGroup(bo);
|
taskStaffGroupService.insertTaskStaffGroup(bo);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@ -255,8 +254,7 @@ public class TaskTechnologyController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("技术模块-今日事务-修改任务负责人")
|
@ApiOperation("技术模块-今日事务-修改任务负责人")
|
||||||
@PutMapping("/updateTaskResponsibleStaff")
|
@PutMapping("/updateTaskResponsibleStaff")
|
||||||
public R<Void> updateTaskResponsibleStaff(@RequestBody @Validated
|
public R<Void> updateTaskResponsibleStaff(@RequestBody @Validated TransferTaskBo bo) {
|
||||||
TransferTaskBo bo) {
|
|
||||||
taskService.updateTaskResponsibleStaff(bo);
|
taskService.updateTaskResponsibleStaff(bo);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@ -271,8 +269,7 @@ public class TaskTechnologyController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("技术模块-今日事务-修改员工任务绩点")
|
@ApiOperation("技术模块-今日事务-修改员工任务绩点")
|
||||||
@PutMapping("/updateStaffGradePoint")
|
@PutMapping("/updateStaffGradePoint")
|
||||||
public R<Void> updateStaffGradePoint(@RequestBody @Validated
|
public R<Void> updateStaffGradePoint(@RequestBody @Validated TaskStaffGroupBo bo) {
|
||||||
TaskStaffGroupBo bo) {
|
|
||||||
taskStaffGroupService.updateStaffGradePoint(bo);
|
taskStaffGroupService.updateStaffGradePoint(bo);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@ -287,8 +284,7 @@ public class TaskTechnologyController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("技术模块-今日事务-删除成员组")
|
@ApiOperation("技术模块-今日事务-删除成员组")
|
||||||
@DeleteMapping("/removeTaskStaffGroup/{id}")
|
@DeleteMapping("/removeTaskStaffGroup/{id}")
|
||||||
public R<Void> removeTaskStaffGroup(@PathVariable
|
public R<Void> removeTaskStaffGroup(@PathVariable String id) {
|
||||||
String id) {
|
|
||||||
taskStaffGroupService.removeTaskStaffGroupById(id);
|
taskStaffGroupService.removeTaskStaffGroupById(id);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@ -303,8 +299,7 @@ public class TaskTechnologyController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("技术模块-今日事务-更新任务进度")
|
@ApiOperation("技术模块-今日事务-更新任务进度")
|
||||||
@PutMapping("/updateTaskProgress")
|
@PutMapping("/updateTaskProgress")
|
||||||
public R<Void> updateTaskProgress(@RequestBody @Validated
|
public R<Void> updateTaskProgress(@RequestBody @Validated TaskProgressBo bo) {
|
||||||
TaskProgressBo bo) {
|
|
||||||
taskService.updateTaskProgress(bo);
|
taskService.updateTaskProgress(bo);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
@ -319,8 +314,7 @@ public class TaskTechnologyController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("技术模块-今日事务-转交任务")
|
@ApiOperation("技术模块-今日事务-转交任务")
|
||||||
@PutMapping("/updateTaskItem")
|
@PutMapping("/updateTaskItem")
|
||||||
public R<Void> updateTaskItem(@RequestBody @Validated
|
public R<Void> updateTaskItem(@RequestBody @Validated TaskItemBo bo) {
|
||||||
TaskItemBo bo) {
|
|
||||||
taskService.updateTaskItem(bo);
|
taskService.updateTaskItem(bo);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,7 +50,7 @@ public class Task extends BaseEntity implements Serializable {
|
|||||||
private Integer taskStatus;
|
private Integer taskStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务项(0:开发中;1:待测试:2:待部署;3:已归档)
|
* 任务项(0:开发中;1:待测试:2:待部署;3:已归档;-1:逾期)
|
||||||
*/
|
*/
|
||||||
private Integer taskItem;
|
private Integer taskItem;
|
||||||
|
|
||||||
|
|||||||
@ -121,25 +121,39 @@ public class FinanceReimburseServiceImpl extends ServiceImpl<FinanceReimburseMap
|
|||||||
if (item.getStatus() > 2){
|
if (item.getStatus() > 2){
|
||||||
throw new ServiceException("状态超标");
|
throw new ServiceException("状态超标");
|
||||||
}
|
}
|
||||||
item.setStatus(item.getStatus() + 1);
|
|
||||||
if (list.size() > 1) {
|
if (list.size() > 1) {
|
||||||
//审批转下款,全下
|
//审批转下款,全下
|
||||||
if (item.getStatus() == 1){
|
if (item.getStatus() == 1 || item.getStatus() == 2){
|
||||||
|
allFinishReimburseIds.add(item.getId());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//审批转下款,全下
|
||||||
|
if (item.getStatus() == 2){
|
||||||
allFinishReimburseIds.add(item.getId());
|
allFinishReimburseIds.add(item.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
item.setStatus(item.getStatus() + 1);
|
||||||
});
|
});
|
||||||
//存在全下的报销
|
//存在全下的报销
|
||||||
if (!allFinishReimburseIds.isEmpty()) {
|
if (!allFinishReimburseIds.isEmpty()) {
|
||||||
Map<String, FinanceReimburse> idToPrice = list.stream().collect(Collectors.toMap(FinanceReimburse::getId, item->item));
|
Map<String, FinanceReimburse> idToPrice = list.stream().collect(Collectors.toMap(FinanceReimburse::getId, item->item));
|
||||||
|
//获取已有的报销阶段
|
||||||
|
Map<String, List<FinanceReimburseStage>> stageMap = SpringUtils.getBean(FinanceReimburseStageService.class).queryChain()
|
||||||
|
.where(FINANCE_REIMBURSE_STAGE.FINANCE_REIMBURSE_ID.in(allFinishReimburseIds)).list()
|
||||||
|
.stream().collect(Collectors.groupingBy(FinanceReimburseStage::getFinanceReimburseId));
|
||||||
List<FinanceReimburseStage> financeReimburseStages = new ArrayList<>();
|
List<FinanceReimburseStage> financeReimburseStages = new ArrayList<>();
|
||||||
allFinishReimburseIds.forEach(item -> {
|
allFinishReimburseIds.forEach(item -> {
|
||||||
FinanceReimburseStage entity = new FinanceReimburseStage();
|
FinanceReimburseStage entity = new FinanceReimburseStage();
|
||||||
BeanUtils.copyBeanProp(entity, bo);
|
BeanUtils.copyBeanProp(entity, bo);
|
||||||
FinanceReimburse financeReimburse = idToPrice.get(item);
|
FinanceReimburse financeReimburse = idToPrice.get(item);
|
||||||
entity.setFinanceReimburseId(item)
|
entity.setFinanceReimburseId(item)
|
||||||
.setPaymentTime(LocalDateTime.now())
|
.setPaymentTime(LocalDateTime.now());
|
||||||
.setStageAmount(financeReimburse.getPrice());
|
if (stageMap.get(item) != null) {
|
||||||
|
//减去已下发的
|
||||||
|
entity.setStageAmount(financeReimburse.getPrice().subtract(stageMap.get(item).stream().map(FinanceReimburseStage::getStageAmount).reduce(BigDecimal.ZERO, BigDecimal::add)));
|
||||||
|
} else {
|
||||||
|
entity.setStageAmount(financeReimburse.getPrice());
|
||||||
|
}
|
||||||
financeReimburseStages.add(entity);
|
financeReimburseStages.add(entity);
|
||||||
//修改状态
|
//修改状态
|
||||||
financeReimburse.setStatus(3);
|
financeReimburse.setStatus(3);
|
||||||
|
|||||||
@ -50,6 +50,8 @@ import static com.mybatisflex.core.query.QueryMethods.*;
|
|||||||
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OAM-任务表 服务层实现。
|
* OAM-任务表 服务层实现。
|
||||||
*
|
*
|
||||||
@ -345,7 +347,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|||||||
queryWrapper.and(TASK.TASK_STATUS.in(3, 6));
|
queryWrapper.and(TASK.TASK_STATUS.in(3, 6));
|
||||||
} else {
|
} else {
|
||||||
//进行中与已完成的任务
|
//进行中与已完成的任务
|
||||||
queryWrapper.and(TASK.TASK_STATUS.in(2, 3, 4, 6))
|
queryWrapper.and(TASK.TASK_STATUS.in(2, 3))
|
||||||
//对比当前员工是否是测试管理员
|
//对比当前员工是否是测试管理员
|
||||||
.and(TASK_STAFF_GROUP.STAFF_ID.eq(loginUserInfo.getString("id")));
|
.and(TASK_STAFF_GROUP.STAFF_ID.eq(loginUserInfo.getString("id")));
|
||||||
}
|
}
|
||||||
@ -378,31 +380,60 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateTaskItem(TaskItemBo bo) {
|
public void updateTaskItem(TaskItemBo bo) {
|
||||||
isTaskResponsibleStaff(bo.getId());
|
|
||||||
//查询任务进度
|
//查询任务进度
|
||||||
Task task = this.getById(bo.getId());
|
Task task = this.getById(bo.getId());
|
||||||
if (bo.getTaskItem() == 0) {
|
//进行中转测试
|
||||||
if (task.getTaskProgress() == null || task.getTaskProgress().split(",").length < 5) {
|
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
|
||||||
throw new ServiceException("当前任务的进度尚未完全完成,不允许转交");
|
switch (bo.getTaskItem()) {
|
||||||
}
|
//逾期
|
||||||
LocalDate now = LocalDate.now();
|
case -1:
|
||||||
LocalDate expectedCompletionDate = task.getExpectedCompletionDate();
|
//判断当前任务状态
|
||||||
long day = expectedCompletionDate.until(now, ChronoUnit.DAYS);
|
if (task.getTaskStatus() == 1) {
|
||||||
// 逾期完成
|
if (!StringUtils.equals(task.getResponsibleStaffId(), loginUserInfo.getString("id"))) {
|
||||||
if (day > 0) {
|
throw new ServiceException("当前操作员工不是当前任务主要负责人,不允许操作当前任务!");
|
||||||
task.setTaskStatus(6);
|
}
|
||||||
//扣除绩点
|
if (task.getTaskProgress() == null || task.getTaskProgress().split(",").length < 5) {
|
||||||
deductGradePoint(day, bo.getId());
|
throw new ServiceException("当前任务的进度尚未完全完成,不允许转交");
|
||||||
} else {
|
}
|
||||||
task.setTaskStatus(3);
|
task.setToTestTime(LocalDateTime.now()).setTaskStatus(3);
|
||||||
}
|
} else {
|
||||||
task.setToTestTime(LocalDateTime.now()).setTaskItem(1);
|
//测试转部署
|
||||||
}
|
if (StringUtils.isBlank(bo.getTestToFinishUrl())) {
|
||||||
if (bo.getTaskItem() == 1) {
|
throw new ServiceException("当前任务未提交测试部署相关文件,不允许转交");
|
||||||
if (StringUtils.isBlank(bo.getTestToFinishUrl())) {
|
}
|
||||||
throw new ServiceException("当前任务未提交测试部署相关文件,不允许转交");
|
task.setToDeployTime(LocalDateTime.now()).setTestToFinishUrl(bo.getTestToFinishUrl()).setTaskStatus(8);
|
||||||
}
|
testStaffAddPoint(task, loginUserInfo);
|
||||||
task.setToDeployTime(LocalDateTime.now()).setTestToFinishUrl(bo.getTestToFinishUrl()).setTaskStatus(8).setTaskItem(2);
|
LocalDate now = LocalDate.now();
|
||||||
|
LocalDate expectedCompletionDate = task.getExpectedCompletionDate();
|
||||||
|
//测试任务延期一天
|
||||||
|
long day = expectedCompletionDate.until(now.plusDays(1), ChronoUnit.DAYS);
|
||||||
|
// 逾期完成
|
||||||
|
if (day > 0) {
|
||||||
|
task.setTaskItem(-1);
|
||||||
|
//扣除绩点
|
||||||
|
deductGradePoint(day, bo.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
//转测试
|
||||||
|
case 0:
|
||||||
|
if (!StringUtils.equals(task.getResponsibleStaffId(), loginUserInfo.getString("id"))) {
|
||||||
|
throw new ServiceException("当前操作员工不是当前任务主要负责人,不允许操作当前任务!");
|
||||||
|
}
|
||||||
|
if (task.getTaskProgress() == null || task.getTaskProgress().split(",").length < 5) {
|
||||||
|
throw new ServiceException("当前任务的进度尚未完全完成,不允许转交");
|
||||||
|
}
|
||||||
|
task.setToTestTime(LocalDateTime.now()).setTaskItem(1).setTaskStatus(3);
|
||||||
|
break;
|
||||||
|
//转部署
|
||||||
|
case 1:
|
||||||
|
if (StringUtils.isBlank(bo.getTestToFinishUrl())) {
|
||||||
|
throw new ServiceException("当前任务未提交测试部署相关文件,不允许转交");
|
||||||
|
}
|
||||||
|
task.setToDeployTime(LocalDateTime.now()).setTestToFinishUrl(bo.getTestToFinishUrl()).setTaskStatus(8).setTaskItem(2);
|
||||||
|
testStaffAddPoint(task, loginUserInfo);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
}
|
}
|
||||||
this.updateById(task);
|
this.updateById(task);
|
||||||
// 企微通知手机号
|
// 企微通知手机号
|
||||||
@ -424,6 +455,20 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试员工添加绩点
|
||||||
|
* @author DB
|
||||||
|
* @since 2023/12/21
|
||||||
|
* @param task 任务
|
||||||
|
*/
|
||||||
|
private void testStaffAddPoint(Task task, JSONObject loginUserInfo) {
|
||||||
|
//计算绩点
|
||||||
|
double v = task.getTaskWeight() * 0.2;
|
||||||
|
TaskStaffGroup taskStaffGroup = new TaskStaffGroup();
|
||||||
|
taskStaffGroup.setTaskId(task.getId()).setStaffId(loginUserInfo.getString("id")).setGradePoint((int) v).setRemark("测试员工获取绩点");
|
||||||
|
SpringUtils.getBean(TaskStaffGroupService.class).save(taskStaffGroup);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 逾期扣除绩点
|
* 逾期扣除绩点
|
||||||
*
|
*
|
||||||
|
|||||||
@ -130,6 +130,7 @@ public class TaskWorkOrderReceiveDealPauseVo {
|
|||||||
/**
|
/**
|
||||||
* 提交时间
|
* 提交时间
|
||||||
*/
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
@ApiModelProperty(value = "提交时间")
|
@ApiModelProperty(value = "提交时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,6 @@ import static com.cpop.oam.business.entity.table.TaskTableDef.TASK;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Configuration
|
@Configuration
|
||||||
@Profile(value = "prod")
|
|
||||||
public class OamScheduledTasks {
|
public class OamScheduledTasks {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -39,6 +38,7 @@ public class OamScheduledTasks {
|
|||||||
* @date 2023/11/22 18:08
|
* @date 2023/11/22 18:08
|
||||||
* @return: void
|
* @return: void
|
||||||
*/
|
*/
|
||||||
|
@Profile(value = "prod")
|
||||||
@Scheduled(cron = "0 0 9 * * *")
|
@Scheduled(cron = "0 0 9 * * *")
|
||||||
public void dutyNotice() {
|
public void dutyNotice() {
|
||||||
dutyService.dutyNotice();
|
dutyService.dutyNotice();
|
||||||
@ -49,6 +49,7 @@ public class OamScheduledTasks {
|
|||||||
* @author DB
|
* @author DB
|
||||||
* @since 2023/12/10
|
* @since 2023/12/10
|
||||||
*/
|
*/
|
||||||
|
@Profile(value = "prod")
|
||||||
@Scheduled(cron = "0 20 0 * * *")
|
@Scheduled(cron = "0 20 0 * * *")
|
||||||
public void syncImportData() throws InterruptedException {
|
public void syncImportData() throws InterruptedException {
|
||||||
log.info("==============开始同步校区数据===========");
|
log.info("==============开始同步校区数据===========");
|
||||||
@ -69,14 +70,16 @@ public class OamScheduledTasks {
|
|||||||
* @author DB
|
* @author DB
|
||||||
* @since 2023/12/11
|
* @since 2023/12/11
|
||||||
*/
|
*/
|
||||||
|
@Profile(value = {"prod", "test", "dev"})
|
||||||
@Scheduled(cron = "0 10 0 * * *")
|
@Scheduled(cron = "0 10 0 * * *")
|
||||||
public void checkTaskWhetherFinish() {
|
public void checkTaskWhetherFinish() {
|
||||||
log.info("==============开始检查进行中任务===========");
|
log.info("==============开始检查进行中任务===========");
|
||||||
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
TaskService taskService = SpringUtils.getBean(TaskService.class);
|
||||||
List<Task> taskList = taskService.queryChain().where(TASK.TASK_STATUS.eq(2)).list();
|
List<Task> taskList = taskService.queryChain().where(TASK.TASK_STATUS.in(2, 3)).and(TASK.TASK_TYPE.in(0, 1)).list();
|
||||||
List<Task> filterList = taskList.stream().filter(item -> item.getExpectedCompletionDate().isBefore(LocalDate.now())).collect(Collectors.toList());
|
List<Task> filterList = taskList.stream().filter(item -> item.getExpectedCompletionDate().isBefore(LocalDate.now().plusDays(1))).collect(Collectors.toList());
|
||||||
if (!filterList.isEmpty()) {
|
if (!filterList.isEmpty()) {
|
||||||
taskService.updateChain().set(TASK.TASK_STATUS, 4).where(TASK.ID.in(filterList.stream().map(Task::getId).collect(Collectors.toSet()))).update();
|
//任务项逾期
|
||||||
|
taskService.updateChain().set(TASK.TASK_ITEM, -1).where(TASK.ID.in(filterList.stream().map(Task::getId).collect(Collectors.toSet()))).update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ public class WorkOrderOvertimeTask implements Job {
|
|||||||
// 扣除5点绩点
|
// 扣除5点绩点
|
||||||
SpringUtils.getBean(TaskStaffGroupService.class).updateChain()
|
SpringUtils.getBean(TaskStaffGroupService.class).updateChain()
|
||||||
.setRaw(TASK_STAFF_GROUP.GRADE_POINT, "grade_point - 5")
|
.setRaw(TASK_STAFF_GROUP.GRADE_POINT, "grade_point - 5")
|
||||||
.setRaw(TASK_STAFF_GROUP.REMARK, "concat(remark,'工单完结超时扣除5绩点')")
|
.setRaw(TASK_STAFF_GROUP.REMARK, "concat(IFNULL(remark,''),'工单完结超时扣除5绩点')")
|
||||||
.where(TASK_STAFF_GROUP.TASK_ID.eq(task.getId()))
|
.where(TASK_STAFF_GROUP.TASK_ID.eq(task.getId()))
|
||||||
.and(TASK_STAFF_GROUP.STAFF_ID.eq(task.getResponsibleStaffId()))
|
.and(TASK_STAFF_GROUP.STAFF_ID.eq(task.getResponsibleStaffId()))
|
||||||
.update();
|
.update();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user