From 604aadd425694d9db1614dfda53b50e9d0c51f93 Mon Sep 17 00:00:00 2001 From: bonus <1203338439@qq.com> Date: Fri, 25 Jul 2025 18:34:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=8F=E5=85=8D=E6=8E=A5=E5=8F=A3=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/LeaseApplyInfoController.java | 12 +++ .../lease/mapper/LeaseTaskMapper.java | 3 + .../lease/service/ILeaseApplyInfoService.java | 2 + .../impl/LeaseApplyInfoServiceImpl.java | 73 +++++++++++++++++++ .../service/impl/LeaseTaskServiceImpl.java | 8 ++ .../material/lease/LeaseApplyInfoMapper.xml | 12 +-- .../mapper/material/lease/LeaseTaskMapper.xml | 9 +++ 7 files changed, 113 insertions(+), 6 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java index 455435cd..facb7dcd 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/controller/LeaseApplyInfoController.java @@ -77,6 +77,18 @@ public class LeaseApplyInfoController extends BaseController { List list = leaseApplyInfoService.getCompleteOutTaskList(leaseApplyInfo); return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); } + /** + * 材料员查询页面 + */ + @ApiOperation(value = "材料员查询页面") + //@RequiresPermissions("lease:info:list") + @GetMapping("/getConfirmTaskList") + public AjaxResult getConfirmTaskList(LeaseApplyInfo leaseApplyInfo) { + Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); + List list = leaseApplyInfoService.getConfirmTaskList(leaseApplyInfo); + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); + } @ApiOperation(value = "材料员确认接口") @PostMapping("/confirmMaterial") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java index d9a1f358..ff5e046d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java @@ -10,6 +10,7 @@ import com.bonus.material.lease.domain.LeasePublishDetails; import com.bonus.material.lease.domain.vo.LeaseDeptInfo; import com.bonus.material.ma.domain.Type; import com.bonus.material.ma.domain.vo.MaTypeVoLevelTwo; +import com.bonus.material.task.domain.TmTaskAgreement; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -194,4 +195,6 @@ public interface LeaseTaskMapper { * @return */ LeasePublishDetails selectPublishDetailsByCode(); + + TmTaskAgreement getAgreementInfo(LeaseApplyInfo leaseApplyInfo); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseApplyInfoService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseApplyInfoService.java index 11d26d1d..a6eb6264 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseApplyInfoService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/ILeaseApplyInfoService.java @@ -176,4 +176,6 @@ public interface ILeaseApplyInfoService { List selectLeaseApplyInfoByIdTwo(LeaseApplyInfo bean); LeaseApplyRequestVo getLeaseRequestVo(LeaseApplyDetails bean); + + List getConfirmTaskList(LeaseApplyInfo leaseApplyInfo); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java index c656f91b..5fe281a2 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseApplyInfoServiceImpl.java @@ -550,6 +550,79 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService { return sortedList; } + /** + * 查询材料员确认 + * + * @param leaseApplyInfo 领料任务 + * @return 领料任务集合 + */ + @Override + public List getConfirmTaskList(LeaseApplyInfo leaseApplyInfo) { + leaseApplyInfo.setUserId(SecurityUtils.getLoginUser().getUserid()); + + List list = leaseApplyInfoMapper.selectCompleteOutList(leaseApplyInfo); + + + if (leaseApplyInfo.getIsConfirm()!=null) { + if (leaseApplyInfo.getIsConfirm() == 2) { + // 已确认 + list = list.stream() + .filter(item -> item.getIsConfirm() == 2) + .collect(Collectors.toList()); + } else { + // 未确认 + list = list.stream() + .filter(item -> item.getIsConfirm() == 1) + .collect(Collectors.toList()); + } + + } + // 使用 Stream API 进行降序排序 + List sortedList = list.stream() + .sorted(Comparator.comparing(LeaseApplyInfo::getCreateTime, + Comparator.nullsFirst(Comparator.naturalOrder())).reversed()) + .collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(sortedList)) { + String keyWord = leaseApplyInfo.getKeyWord(); + // 如果关键字不为空,进行过滤 + if (!StringUtils.isBlank(keyWord)) { + sortedList = sortedList.stream() + .filter(item -> containsKeyword(item, keyWord)) + .collect(Collectors.toList()); + } +// // 判断状态 +// if (!CollectionUtils.isEmpty(leaseApplyInfo.getStatusList())) { +// // 将集合sortedList中状态taskStatus包含在leaseApplyInfo.getStatusList()中的元素 +// sortedList = sortedList.stream() +// .filter(item -> leaseApplyInfo.getStatusList().contains(item.getTaskStatus())) +// .collect(Collectors.toList()); +// } + } + sortedList.removeIf(Objects::isNull); + if (leaseApplyInfo.getIsConfirm() != null) { + if (leaseApplyInfo.getIsConfirm() == 1) { + for (LeaseApplyInfo item : sortedList) { + if(item.getPreCountNum().compareTo(item.getAlNum()) != 0){ + item.setIsConfirm(1); + }else{ + //查找签名的数量之和是否为 + + } + } +// sortedList.removeIf(item -> item.getIsConfirm() != null && item.getIsConfirm() == 2); + } else if (leaseApplyInfo.getIsConfirm() == 2) { + sortedList.removeIf(item -> item.getIsConfirm() == null || item.getIsConfirm() != 2); + } + } + // 再次移除可能的null值 + sortedList.removeIf(Objects::isNull); + // 只有出库完成的任务才需要进行确认,这里过滤掉任务状态不等于4(出库已完成)的 +// sortedList.removeIf(item -> item.getTaskStatus() != 4); + + return sortedList; + } + + /** * 关键字搜索 * @param item diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java index 2c6376bb..ed1ef55f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java @@ -32,6 +32,7 @@ import com.bonus.material.lease.service.ILeaseTaskService; import com.bonus.material.ma.domain.Type; import com.bonus.material.ma.domain.vo.MaTypeVoLevelTwo; import com.bonus.material.task.domain.TmTask; +import com.bonus.material.task.domain.TmTaskAgreement; import com.bonus.material.task.mapper.TmTaskAgreementMapper; import com.bonus.material.task.mapper.TmTaskMapper; import com.bonus.material.work.domain.SysWorkflowConfig; @@ -904,6 +905,13 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { } } String code = genderTaskCode(monthMaxOrder); + +// TmTaskAgreement taskAgreement = mapper.getAgreementInfo(leaseApplyInfo); +// +// taskAgreement.setTaskId(parentId); +// +// tmTaskAgreementMapper.insertTmTaskAgreement(taskAgreement); + for (LeaseApplyDetails applyDetails : leaseApplyDetailsList) { // 根据parentId及typeId更新lease_apply_details表的发布数量 result = mapper.updatePublish(applyDetails); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml index 6d001016..ea04bb1e 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseApplyInfoMapper.xml @@ -121,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into lease_apply_info @@ -259,7 +259,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" direct_id = #{directId}, lease_type = #{leaseType}, estimate_lease_time = #{estimateLeaseTime}, - release_time = #{releaseTime}, + release_time = now(), cost_bearing_party = #{costBearingParty}, publisher = #{updateBy}, @@ -271,7 +271,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from lease_apply_info where id in + delete from lease_apply_info where id in #{id} @@ -668,4 +668,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" is_confirm = 2 where id = #{id} - \ No newline at end of file + diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml index 467540ef..92300298 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml @@ -1043,4 +1043,13 @@ and type_id = #{typeId} and publish_task = #{publishTask} + +