diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmUnit.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmUnit.java index 65dcad83..ade84fe9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmUnit.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmUnit.java @@ -105,4 +105,9 @@ public class BmUnit extends BaseEntity /** 班组ID */ private Long teamId; + /** + * 是否过滤班组(true 过滤,默认不过滤) + */ + private boolean enableFilterTeam; + } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/controller/SelectController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/controller/SelectController.java index 7ba8d2c6..45f6de00 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/controller/SelectController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/controller/SelectController.java @@ -38,6 +38,13 @@ public class SelectController { return service.getUnitList(bmUnit); } + @ApiOperation(value = "往来单位下拉选,过滤掉班组类型") + @PostMapping("getUnitListFilterTeam") + public AjaxResult getUnitListFilterTeam(@RequestBody BmUnit bmUnit) { + bmUnit.setEnableFilterTeam(true); + return service.getUnitList(bmUnit); + } + /** * todo 领用申请往来单位下拉选专用 * @param bmUnit diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java index 4cf61075..53486a8a 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java @@ -98,6 +98,10 @@ public class SelectServiceImpl implements SelectService { .filter(Objects::nonNull) .filter(unit -> unit.getId() != null && unit.getParentId() != null) .collect(Collectors.toList()); + + if (bmUnit.isEnableFilterTeam()) { + list.removeIf(item -> Objects.equals("0101", item.getTypeKey())); + } } stepTimes.put("数据过滤", System.currentTimeMillis() - filterStart); @@ -111,7 +115,7 @@ public class SelectServiceImpl implements SelectService { List newList = mapper.getTeam(); stepTimes.put("获取班组数据", System.currentTimeMillis() - teamStart); - if (CollectionUtils.isNotEmpty(newList)) { + if (CollectionUtils.isNotEmpty(newList) && !bmUnit.isEnableFilterTeam()) { groupList.addAll(newList); } } else { 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 954fd977..1664b1cb 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 @@ -31,6 +31,7 @@ import com.bonus.material.task.mapper.TmTaskMapper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.poi.hssf.usermodel.*; import org.springframework.beans.factory.annotation.Autowired; @@ -1410,6 +1411,54 @@ public class SltAgreementInfoController extends BaseController { return getDataTable(list); } + /** + * 已结算报表--列表 + */ + @ApiOperation(value = "已结算报表list查询") + @GetMapping("/getSltReportedList") + public TableDataInfo getSltReportedList(SltAgreementInfo bean) { + startPage(); + List list = sltAgreementInfoService.getSltReportedList(bean); + return getDataTable(list); + } + + /** + * 未结算报表--列表 + */ + @ApiOperation(value = "未结算报表list查询") + @GetMapping("/getSltReportList") + public TableDataInfo getSltReportList(SltAgreementInfo query) { + // ----------- 定义返回集合 ------------ + List resultList = new ArrayList<>(); + + // ----------- 查询列表 --------------- + List list = sltAgreementInfoService.getSltReportList(query); + + // ----------- 遍历列表,设置默认值 --------------- + Byte settlementType = sltAgreementInfoService.checkLoginUserHasSettlementPermission(); + // 设置结算权限,控制展示 + list.forEach(info -> info.setSettlementType(settlementType)); + + List dataList = new ArrayList<>(); + SltInfoVo bean = new SltInfoVo(); + for (SltAgreementInfo info : list) { + SltInfoVo vo = sltAgreementInfoService.getSltInfo(info); + if (vo == null) { continue; } + vo.setAgreementId(info.getAgreementId()); + vo.setAgreementCode(info.getAgreementCode()); + dataList.add(vo); + } + + // 移除领、修、丢、废4项都没有明细的结算信息 + dataList.removeIf(vo -> CollectionUtils.isEmpty(vo.getLeaseList()) + && CollectionUtils.isEmpty(vo.getRepairList()) + && CollectionUtils.isEmpty(vo.getScrapList()) + && CollectionUtils.isEmpty(vo.getLoseList()) + ); + + return getDataTable(dataList); + } + /** * 进行结算审批 */ 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 252a3963..bd9cba5f 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 @@ -188,6 +188,18 @@ public interface SltAgreementInfoMapper { */ List getSltList(SltAgreementInfo bean); + /** + * 已结算报表list查询 + */ + List getSltReportedList(SltAgreementInfo bean); + + /** + * 未结算报表查询 + * @param bean + * @return + */ + List getSltReportList(SltAgreementInfo bean); + /** * 对驳回的结算信息进行重新设置为未结算 * diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java index 36bd2796..5a0a719a 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java @@ -93,6 +93,21 @@ public interface ISltAgreementInfoService { */ List getSltList(SltAgreementInfo bean); + /** + * 查询已结算报表list + * @param bean + * @return + */ + List getSltReportedList(SltAgreementInfo bean); + + /** + * 查询未结算报表list + * @param bean + * @return + */ + List getSltReportList(SltAgreementInfo bean); + + /** * 进行结算审批 * 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 2b3b4d73..92a9d1d7 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 @@ -132,6 +132,13 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { //丢失费用列表 List loseList = getLoseList(info); + if (CollectionUtils.isEmpty(leaseList) && CollectionUtils.isEmpty(repairList) + && CollectionUtils.isEmpty(scrapList) && CollectionUtils.isEmpty(loseList)) + { + return null; + } + + //费用减免列表 List reductionList = getReductionList(info); sltInfoVo.setLeaseList(leaseList); sltInfoVo.setRepairList(repairList); @@ -536,6 +543,34 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { return sltAgreementInfoMapper.getSltList(bean); } + /** + * 查询已结算报表list + */ + @Override + public List getSltReportedList(SltAgreementInfo bean) { + return sltAgreementInfoMapper.getSltReportedList(bean); + } + + /** + * 查询未结算报表list + * + * @param bean + * @return + */ + @Override + public List getSltReportList(SltAgreementInfo bean) { + Long userId = SecurityUtils.getLoginUser().getUserid(); + List list = sltAgreementInfoMapper.getSltReportList(bean); + // 删除 null 对象 + list.removeIf(Objects::isNull); + // 遍历列表,设置默认值 + list.forEach(obj -> { + if (obj.getIsSlt() == null) { obj.setIsSlt("0");} + }); + + return list; + } + /** * 判断以逗号分隔的字符串是否包含指定的值(严格判断) * @param strings 以逗号分隔的字符串 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 8d34aaa7..9975a076 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 @@ -196,7 +196,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id LEFT JOIN slt_agreement_apply saa on saa.agreement_id = bai.agreement_id - where bai.status = '1' + where bai.status = '1' AND bui.type_id != '1731' and bui.unit_id in @@ -784,4 +784,71 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and saa.settlement_type = #{sltType} and (saa.status = '1' or saa.status = '2') + + + +