diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java index d2639fa8..5e2f2396 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java @@ -10,16 +10,14 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import cn.hutool.core.convert.Convert; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.bonus.common.biz.config.ListPagingUtil; import com.bonus.common.biz.config.PoiOutPage; -import com.bonus.common.biz.enums.TmTaskTypeEnum; +import com.bonus.common.core.utils.ServletUtils; import com.bonus.common.log.enums.OperaType; import com.bonus.material.basic.domain.BmProject; import com.bonus.material.common.annotation.PreventRepeatSubmit; import com.bonus.material.common.domain.dto.SelectDto; -import com.bonus.material.countersign.domain.SignConfigVo; -import com.bonus.material.lease.domain.vo.LeaseOutVo; import com.bonus.material.settlement.domain.SltAgreementApply; import com.bonus.material.settlement.domain.SltAgreementReduce; import com.bonus.material.settlement.domain.SltAgreementRelation; @@ -34,9 +32,6 @@ import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.poi.hssf.usermodel.*; -import org.apache.poi.ss.usermodel.BorderStyle; -import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.ss.util.RegionUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import com.bonus.common.log.annotation.SysLog; @@ -89,10 +84,11 @@ public class SltAgreementInfoController extends BaseController { */ @ApiOperation(value = "根据条件获取协议结算列表") @GetMapping("/getSltAgreementInfo4Project") - public TableDataInfo getSltAgreementInfo4Project(SltAgreementInfo bean) { - startPage(); + public AjaxResult getSltAgreementInfo4Project(SltAgreementInfo bean) { + Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); List list = sltAgreementInfoService.getSltAgreementInfo4Project(bean); - return getDataTable(list); + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); } @ApiOperation(value = "工程下拉选") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java index d87fa39b..1c321970 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java @@ -215,4 +215,10 @@ public interface SltAgreementInfoMapper { int backInUseNum(RepairApplyDetails repairApplyDetails); + /** + * 获取结算信息 + * @param info + * @return + */ + List getSltAgreementInfoById(SltAgreementInfo info); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java index 7834f710..c2b107f8 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java @@ -73,7 +73,24 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { @Override public List getSltAgreementInfo4Project(SltAgreementInfo bean) { - return sltAgreementInfoMapper.getSltAgreementInfo4Project(bean); + Long userId = SecurityUtils.getLoginUser().getUserid(); + List list = sltAgreementInfoMapper.getSltAgreementInfo4Project(bean); + if (CollectionUtils.isNotEmpty(list)) { + // 创建一个集合来保存需要移除的元素 + List toRemove = new ArrayList<>(); + for (SltAgreementInfo info : list) { + info.setUserId(userId); + // 根据协议id查询数据 + List newList = sltAgreementInfoMapper.getSltAgreementInfoById(info); + if (CollectionUtils.isEmpty(newList)) { + // 将要移除的元素添加到待移除集合中 + toRemove.add(info); + } + } + // 遍历结束后统一移除元素 + list.removeAll(toRemove); + } + return list; } @Override diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml index 592d9f4f..0ef424e7 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml @@ -684,4 +684,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND project_id = #{projectId} AND status = '1' + +