结算权限

This commit is contained in:
mashuai 2025-07-17 20:54:12 +08:00
parent 76fe998670
commit 7794c7de56
4 changed files with 49 additions and 11 deletions

View File

@ -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<SltAgreementInfo> list = sltAgreementInfoService.getSltAgreementInfo4Project(bean);
return getDataTable(list);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
@ApiOperation(value = "工程下拉选")

View File

@ -215,4 +215,10 @@ public interface SltAgreementInfoMapper {
int backInUseNum(RepairApplyDetails repairApplyDetails);
/**
* 获取结算信息
* @param info
* @return
*/
List<SltAgreementInfo> getSltAgreementInfoById(SltAgreementInfo info);
}

View File

@ -73,7 +73,24 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
@Override
public List<SltAgreementInfo> getSltAgreementInfo4Project(SltAgreementInfo bean) {
return sltAgreementInfoMapper.getSltAgreementInfo4Project(bean);
Long userId = SecurityUtils.getLoginUser().getUserid();
List<SltAgreementInfo> list = sltAgreementInfoMapper.getSltAgreementInfo4Project(bean);
if (CollectionUtils.isNotEmpty(list)) {
// 创建一个集合来保存需要移除的元素
List<SltAgreementInfo> toRemove = new ArrayList<>();
for (SltAgreementInfo info : list) {
info.setUserId(userId);
// 根据协议id查询数据
List<SltAgreementInfo> newList = sltAgreementInfoMapper.getSltAgreementInfoById(info);
if (CollectionUtils.isEmpty(newList)) {
// 将要移除的元素添加到待移除集合中
toRemove.add(info);
}
}
// 遍历结束后统一移除元素
list.removeAll(toRemove);
}
return list;
}
@Override

View File

@ -684,4 +684,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
AND project_id = #{projectId} AND status = '1'
</select>
<select id="getSltAgreementInfoById" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
SELECT
sai.agreement_id as agreementId
FROM
slt_agreement_info sai
LEFT JOIN ma_type mt1 ON mt1.type_id = sai.type_id
AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id
AND mt2.del_flag = '0'
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id
AND mt3.del_flag = '0'
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id
AND mt4.del_flag = '0'
LEFT JOIN ma_type_manage mt ON mt4.type_id = mt.type_id
WHERE
mt.user_id = #{userId}
LIMIT 1
</select>
</mapper>