减免接口开发

This commit is contained in:
bonus 2025-07-25 18:34:36 +08:00
parent fc34e7371c
commit 604aadd425
7 changed files with 113 additions and 6 deletions

View File

@ -77,6 +77,18 @@ public class LeaseApplyInfoController extends BaseController {
List<LeaseApplyInfo> 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<LeaseApplyInfo> list = leaseApplyInfoService.getConfirmTaskList(leaseApplyInfo);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
@ApiOperation(value = "材料员确认接口")
@PostMapping("/confirmMaterial")

View File

@ -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);
}

View File

@ -176,4 +176,6 @@ public interface ILeaseApplyInfoService {
List<LeaseApplyDetails> selectLeaseApplyInfoByIdTwo(LeaseApplyInfo bean);
LeaseApplyRequestVo getLeaseRequestVo(LeaseApplyDetails bean);
List<LeaseApplyInfo> getConfirmTaskList(LeaseApplyInfo leaseApplyInfo);
}

View File

@ -550,6 +550,79 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
return sortedList;
}
/**
* 查询材料员确认
*
* @param leaseApplyInfo 领料任务
* @return 领料任务集合
*/
@Override
public List<LeaseApplyInfo> getConfirmTaskList(LeaseApplyInfo leaseApplyInfo) {
leaseApplyInfo.setUserId(SecurityUtils.getLoginUser().getUserid());
List<LeaseApplyInfo> 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<LeaseApplyInfo> 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

View File

@ -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);

View File

@ -259,7 +259,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="directId != null">direct_id = #{directId},</if>
<if test="leaseType != null">lease_type = #{leaseType},</if>
<if test="estimateLeaseTime != null">estimate_lease_time = #{estimateLeaseTime},</if>
<if test="releaseTime != null">release_time = #{releaseTime},</if>
release_time = now(),
<if test="costBearingParty != null">cost_bearing_party = #{costBearingParty},</if>
<if test="updateBy != null and updateBy != ''">publisher = #{updateBy},</if>
</trim>

View File

@ -1043,4 +1043,13 @@
and type_id = #{typeId}
and publish_task = #{publishTask}
</delete>
<select id="getAgreementInfo" resultType="com.bonus.material.task.domain.TmTaskAgreement">
select
agreement_id as agreementId
from
bm_agreement_info
where unit_id = #{unitId} and project_id = #{projectId}
limit 1
</select>
</mapper>