From 0f188988ab377050b5939596149d84a42f5baa4d Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Wed, 28 Jan 2026 17:05:45 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E7=BB=93=E7=AE=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SltAgreementInfoController.java | 133 ++++++++---------- .../settlement/SltAgreementInfoMapper.xml | 42 +++++- 2 files changed, 97 insertions(+), 78 deletions(-) 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 da716705..1f6d388e 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 @@ -754,10 +754,10 @@ public class SltAgreementInfoController extends BaseController { } String projectName = handleData(projectNames); String unitName = handleData(unitNames); - BigDecimal totalCost = BigDecimal.valueOf(0.00); + BigDecimal totalCost = BigDecimal.ZERO; for (SltAgreementInfo bean : leaseList) { if (null == bean.getLeasePrice()) { - bean.setLeasePrice(BigDecimal.valueOf(0.00)); + bean.setLeasePrice(BigDecimal.ZERO); }else{ bean.setLeasePrice(bean.getLeasePrice().setScale(3, RoundingMode.DOWN)); } @@ -802,16 +802,15 @@ public class SltAgreementInfoController extends BaseController { for (SltAgreementInfo info : sltAgreementInfo) { projectNames.add(info.getProjectName()); unitNames.add(info.getUnitName()); - List oneOfList =new ArrayList<>(); - - if ( info.getEnableQuerySltData()) { + List oneOfList; + if (info.getEnableQuerySltData()) { oneOfList = sltAgreementInfoMapper.getSltLoseList(info); - }else{ + } else { oneOfList = sltAgreementInfoMapper.getLoseList(info); } - loseList.addAll(oneOfList); } + String projectName = handleData(projectNames); String unitName = handleData(unitNames); BigDecimal totalCost = BigDecimal.ZERO; @@ -847,21 +846,18 @@ public class SltAgreementInfoController extends BaseController { @PostMapping("/exportRepair") public void exportRepair(HttpServletResponse response, @RequestParam("params") String params) { try { - String fileName = "维修费用明细表"; List sltAgreementInfo = JSONObject.parseArray(params,SltAgreementInfo.class); List projectNames = new ArrayList<>(); List unitNames = new ArrayList<>(); - BigDecimal totalCost = BigDecimal.valueOf(0.00); + BigDecimal totalCost = BigDecimal.ZERO; List repairList = new ArrayList<>(); for (SltAgreementInfo info : sltAgreementInfo) { projectNames.add(info.getProjectName()); unitNames.add(info.getUnitName()); List taskList = taskMapper.getTaskIdList(info); - - List taskList2 = new ArrayList<>(); + List taskList2; taskList2 = checkTeamAgreementInfo(info); - if (null != taskList && !taskList.isEmpty()) { if (null != taskList2 && !taskList2.isEmpty()) { taskList.addAll(taskList2); @@ -885,6 +881,7 @@ public class SltAgreementInfoController extends BaseController { List repair = Convert.toList(SltLeaseInfo.class, repairList); expOutExcel(response,repair,fileName,projectName,unitName,totalCost,3); } catch (Exception e) { + System.err.println(e.getMessage()); log.error(e.toString(), e); } } @@ -897,12 +894,10 @@ public class SltAgreementInfoController extends BaseController { if (null != agreementInfoList && !agreementInfoList.isEmpty()) { teamTaskList = taskMapper.getTaskIdListByAgreementList(agreementInfoList); } - }catch (Exception e){ + } catch (Exception e){ + System.err.println(e.getMessage()); e.printStackTrace(); } - - - return teamTaskList; } @@ -920,7 +915,7 @@ public class SltAgreementInfoController extends BaseController { List sltAgreementInfo = JSONObject.parseArray(params,SltAgreementInfo.class); List projectNames = new ArrayList<>(); List unitNames = new ArrayList<>(); - BigDecimal reductionCost = BigDecimal.valueOf(0.00); + BigDecimal reductionCost = BigDecimal.ZERO; List reductionList = new ArrayList<>(); for (SltAgreementInfo info : sltAgreementInfo) { projectNames.add(info.getProjectName()); @@ -966,7 +961,7 @@ public class SltAgreementInfoController extends BaseController { List sltAgreementInfo = JSONObject.parseArray(params,SltAgreementInfo.class); List projectNames = new ArrayList<>(); List unitNames = new ArrayList<>(); - BigDecimal totalCost = BigDecimal.valueOf(0.00); + BigDecimal totalCost = BigDecimal.ZERO; List scrapList = new ArrayList<>(); for (SltAgreementInfo info : sltAgreementInfo) { @@ -1060,13 +1055,13 @@ public class SltAgreementInfoController extends BaseController { projectNames.add(info.getProjectName()); unitNames.add(info.getUnitName()); //租赁费用明细 - BigDecimal totalCostLease = BigDecimal.valueOf(0.00); + BigDecimal totalCostLease = BigDecimal.ZERO; List leaseList = new ArrayList<>(); List oneOfList = sltAgreementInfoMapper.getLeaseList(info); leaseList.addAll(oneOfList); for (SltAgreementInfo bean : leaseList) { if (null == bean.getLeasePrice()) { - bean.setLeasePrice(BigDecimal.valueOf(0.00)); + bean.setLeasePrice(BigDecimal.ZERO); } if (null == bean.getNum()) { bean.setNum(BigDecimal.valueOf(0L)); @@ -1086,13 +1081,13 @@ public class SltAgreementInfoController extends BaseController { List lease = Convert.toList(SltLeaseInfo.class, leaseList); //丢失费用明细 - BigDecimal totalCostLose = BigDecimal.valueOf(0.00); + BigDecimal totalCostLose = BigDecimal.ZERO; List loseList = new ArrayList<>(); List oneOfListLose = sltAgreementInfoMapper.getLoseList(info); loseList.addAll(oneOfListLose); for (SltAgreementInfo bean : loseList) { if (null == bean.getBuyPrice()) { - bean.setBuyPrice(BigDecimal.valueOf(0.00)); + bean.setBuyPrice(BigDecimal.ZERO); } if (null == bean.getNum()) { bean.setNum(BigDecimal.valueOf(0L)); @@ -1111,7 +1106,7 @@ public class SltAgreementInfoController extends BaseController { //维修费用明细 - BigDecimal totalCostRepair = BigDecimal.valueOf(0.00); + BigDecimal totalCostRepair = BigDecimal.ZERO; List repairList = new ArrayList<>(); List taskList = taskMapper.getTaskIdList(info); @@ -1136,7 +1131,7 @@ public class SltAgreementInfoController extends BaseController { //报废费用明细 - BigDecimal totalCostScrap = BigDecimal.valueOf(0.00); + BigDecimal totalCostScrap = BigDecimal.ZERO; List scrapList = new ArrayList<>(); List taskListScrap = taskMapper.getTaskIdList(info); @@ -1160,7 +1155,7 @@ public class SltAgreementInfoController extends BaseController { //减免费用明细 - BigDecimal totalCostReduction = BigDecimal.valueOf(0.00); + BigDecimal totalCostReduction = BigDecimal.ZERO; List reductionList = new ArrayList<>(); if (info.getAgreementId() != null){ @@ -1270,27 +1265,26 @@ public class SltAgreementInfoController extends BaseController { // String unitName = sltAgreementInfo.getUnitName(); //租赁费用明细 - BigDecimal totalCostLease = BigDecimal.valueOf(0.00); + BigDecimal totalCostLease = BigDecimal.ZERO; List leaseList = new ArrayList<>(); for (SltAgreementInfo info : sltAgreementInfo) { projectNames.add(info.getProjectName()); unitNames.add(info.getUnitName()); - List oneOfList = new ArrayList<>(); - if (info != null && info.getEnableQuerySltData() != null && info.getEnableQuerySltData()) { + List oneOfList; + if (info.getEnableQuerySltData() != null && info.getEnableQuerySltData()) { oneOfList = sltAgreementInfoMapper.getLeaseSltDetails(info); } else { oneOfList = sltAgreementInfoMapper.getLeaseList(info); } - - leaseList.addAll(oneOfList); } + for (SltAgreementInfo bean : leaseList) { if (null == bean.getLeasePrice()) { - bean.setLeasePrice(BigDecimal.valueOf(0.00)); + bean.setLeasePrice(BigDecimal.ZERO); } if (null == bean.getNum()) { - bean.setNum(BigDecimal.valueOf(0L)); + bean.setNum(BigDecimal.ZERO); } if (null == bean.getLeaseDays()) { bean.setLeaseDay(0L); @@ -1300,32 +1294,28 @@ public class SltAgreementInfoController extends BaseController { BigDecimal leaseDays = new BigDecimal(bean.getLeaseDays()); // BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays); BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays).setScale(GlobalConstants.INT_2, RoundingMode.HALF_UP); - if(costs!=null){ - totalCostLease = totalCostLease.add(costs); - } + totalCostLease = totalCostLease.add(costs); bean.setCosts(costs); } List lease = Convert.toList(SltLeaseInfo.class, leaseList); //丢失费用明细 - BigDecimal totalCostLose = BigDecimal.valueOf(0.00); + BigDecimal totalCostLose = BigDecimal.ZERO; List loseList = new ArrayList<>(); for (SltAgreementInfo info : sltAgreementInfo) { - List oneOfList = new ArrayList<>(); - if ( info.getEnableQuerySltData()) { + List oneOfList; + if (info.getEnableQuerySltData()) { oneOfList = sltAgreementInfoMapper.getSltLoseList(info); - }else{ + } else { oneOfList = sltAgreementInfoMapper.getLoseList(info); } - - loseList.addAll(oneOfList); } for (SltAgreementInfo bean : loseList) { if (null == bean.getBuyPrice()) { - bean.setBuyPrice(BigDecimal.valueOf(0.00)); + bean.setBuyPrice(BigDecimal.ZERO); } if (null == bean.getNum()) { bean.setNum(BigDecimal.valueOf(0L)); @@ -1334,26 +1324,21 @@ public class SltAgreementInfoController extends BaseController { BigDecimal num = bean.getNum(); // 原价 x 数量 BigDecimal costs = buyPrice.multiply(num); - if(costs!=null){ - totalCostLose = totalCostLose.add(costs); - } + totalCostLose = totalCostLose.add(costs); //计算租赁费用 bean.setCosts(costs); } List lose = Convert.toList(SltLeaseInfo.class, loseList); //维修费用明细 - BigDecimal totalCostRepair = BigDecimal.valueOf(0.00); + BigDecimal totalCostRepair = BigDecimal.ZERO; List repairList = new ArrayList<>(); for (SltAgreementInfo info : sltAgreementInfo) { List taskList = taskMapper.getTaskIdList(info); - - List taskList2 = new ArrayList<>(); + List taskList2; taskList2 = checkTeamAgreementInfo(info); - if (null != taskList && !taskList.isEmpty()) { - if (null != taskList2 && !taskList2.isEmpty()) { taskList.addAll(taskList2); } @@ -1361,6 +1346,7 @@ public class SltAgreementInfoController extends BaseController { repairList.addAll(repairDetailsList); } } + for (SltAgreementInfo bean : repairList) { if (bean.getCosts()!=null && (bean.getPartType().equals("收费"))) { totalCostRepair = totalCostRepair.add(bean.getCosts()); @@ -1369,11 +1355,11 @@ public class SltAgreementInfoController extends BaseController { List repair = Convert.toList(SltLeaseInfo.class, repairList); //报废费用明细 - BigDecimal totalCostScrap = BigDecimal.valueOf(0.00); + BigDecimal totalCostScrap = BigDecimal.ZERO; List scrapList = new ArrayList<>(); for (SltAgreementInfo info : sltAgreementInfo) { List taskList = taskMapper.getTaskIdList(info); - List taskList2 = new ArrayList<>(); + List taskList2; taskList2 = checkTeamAgreementInfo(info); if (null != taskList && !taskList.isEmpty()) { if (null != taskList2 && !taskList2.isEmpty()) { @@ -1389,10 +1375,11 @@ public class SltAgreementInfoController extends BaseController { totalCostScrap = totalCostScrap.add(bean.getCosts()); } } + List scrap = Convert.toList(SltLeaseInfo.class, scrapList); //减免费用明细 - BigDecimal totalCostReduction = BigDecimal.valueOf(0.00); + BigDecimal totalCostReduction = BigDecimal.ZERO; List reductionList = new ArrayList<>(); // if (sltAgreementInfo.getAgreementId()!=null){ // SltAgreementReduce bean =new SltAgreementReduce(); @@ -1407,7 +1394,7 @@ public class SltAgreementInfoController extends BaseController { for (SltAgreementInfo info : sltAgreementInfo) { if (info.getAgreementId() != null){ - SltAgreementReduce bean =new SltAgreementReduce(); + SltAgreementReduce bean = new SltAgreementReduce(); bean.setAgreementId(info.getAgreementId()); List oneOfList = sltAgreementRecudceMapper.getReductionList(bean); reductionList.addAll(oneOfList); @@ -1424,7 +1411,9 @@ public class SltAgreementInfoController extends BaseController { String unitName = handleData(unitNames); expOutExcelAll(response,lease,lose,repair,scrap,reduction,fileName,projectName,unitName,totalCostLease,totalCostLose,totalCostRepair,totalCostScrap,totalCostReduction); } catch (Exception e) { + System.err.println(e.getMessage()); log.error(e.toString(), e); + throw new ServiceException("导出异常, 请联系系统管理员"); } } @@ -1467,13 +1456,13 @@ public class SltAgreementInfoController extends BaseController { List lease = Convert.toList(SltLeaseInfo.class, leaseList); //丢失费用明细 - BigDecimal totalCostLose = BigDecimal.valueOf(0.00); + BigDecimal totalCostLose = BigDecimal.ZERO; List oneOfListLose = sltAgreementInfoMapper.getLoseList(sltAgreementInfo); List loseList = new ArrayList<>(oneOfListLose); for (SltAgreementInfo bean : loseList) { if (null == bean.getBuyPrice()) { - bean.setBuyPrice(BigDecimal.valueOf(0.00)); + bean.setBuyPrice(BigDecimal.ZERO); } if (null == bean.getNum()) { bean.setNum(BigDecimal.valueOf(0L)); @@ -1533,7 +1522,7 @@ public class SltAgreementInfoController extends BaseController { List scrap = Convert.toList(SltLeaseInfo.class, scrapList); //减免费用明细 - BigDecimal totalCostReduction = BigDecimal.valueOf(0.00); + BigDecimal totalCostReduction = BigDecimal.ZERO; List reductionList = new ArrayList<>(); if (sltAgreementInfo.getAgreementId()!=null){ SltAgreementReduce bean =new SltAgreementReduce(); @@ -2143,13 +2132,13 @@ public class SltAgreementInfoController extends BaseController { rawFileName.substring(0, 150) + ".xls" : rawFileName; //租赁费用明细 - BigDecimal totalCostLease = BigDecimal.valueOf(0.00); + BigDecimal totalCostLease = BigDecimal.ZERO; List leaseList = new ArrayList<>(); leaseList = sltAgreementInfoMapper.getLeaseList(info); for (SltAgreementInfo bean : leaseList) { if (null == bean.getLeasePrice()) { - bean.setLeasePrice(BigDecimal.valueOf(0.00)); + bean.setLeasePrice(BigDecimal.ZERO); } if (null == bean.getNum()) { bean.setNum(BigDecimal.valueOf(0L)); @@ -2169,14 +2158,14 @@ public class SltAgreementInfoController extends BaseController { List lease = Convert.toList(SltLeaseInfo.class, leaseList); //丢失费用明细 - BigDecimal totalCostLose = BigDecimal.valueOf(0.00); + BigDecimal totalCostLose = BigDecimal.ZERO; List loseList = new ArrayList<>(); loseList = sltAgreementInfoMapper.getLoseList(info); for (SltAgreementInfo bean : loseList) { if (null == bean.getBuyPrice()) { - bean.setBuyPrice(BigDecimal.valueOf(0.00)); + bean.setBuyPrice(BigDecimal.ZERO); } if (null == bean.getNum()) { bean.setNum(BigDecimal.valueOf(0L)); @@ -2194,12 +2183,12 @@ public class SltAgreementInfoController extends BaseController { List lose = Convert.toList(SltLeaseInfo.class, loseList); //维修费用明细 - BigDecimal totalCostRepair = BigDecimal.valueOf(0.00); + BigDecimal totalCostRepair = BigDecimal.ZERO; List repairList = new ArrayList<>(); List taskRepairList = taskMapper.getTaskIdList(info); - List taskRepairList2 = new ArrayList<>(); + List taskRepairList2; taskRepairList2 = checkTeamAgreementInfo(info); if (null != taskRepairList && !taskRepairList.isEmpty()) { if (null != taskRepairList2 && !taskRepairList2.isEmpty()) { @@ -2216,7 +2205,7 @@ public class SltAgreementInfoController extends BaseController { List repair = Convert.toList(SltLeaseInfo.class, repairList); //报废费用明细 - BigDecimal totalCostScrap = BigDecimal.valueOf(0.00); + BigDecimal totalCostScrap = BigDecimal.ZERO; List scrapList = new ArrayList<>(); List taskScrapList = taskMapper.getTaskIdList(info); @@ -2241,7 +2230,7 @@ public class SltAgreementInfoController extends BaseController { List scrap = Convert.toList(SltLeaseInfo.class, scrapList); //减免费用明细 - BigDecimal totalCostReduction = BigDecimal.valueOf(0.00); + BigDecimal totalCostReduction = BigDecimal.ZERO; List reductionList = new ArrayList<>(); if (info.getAgreementId() != null){ @@ -2399,13 +2388,13 @@ public class SltAgreementInfoController extends BaseController { rawFileName.substring(0, 150) + ".xls" : rawFileName; //租赁费用明细 - BigDecimal totalCostLease = BigDecimal.valueOf(0.00); + BigDecimal totalCostLease = BigDecimal.ZERO; List leaseList = new ArrayList<>(); leaseList = sltAgreementInfoMapper.getLeaseList(info); for (SltAgreementInfo bean : leaseList) { if (null == bean.getLeasePrice()) { - bean.setLeasePrice(BigDecimal.valueOf(0.00)); + bean.setLeasePrice(BigDecimal.ZERO); } if (null == bean.getNum()) { bean.setNum(BigDecimal.valueOf(0L)); @@ -2425,14 +2414,14 @@ public class SltAgreementInfoController extends BaseController { List lease = Convert.toList(SltLeaseInfo.class, leaseList); //丢失费用明细 - BigDecimal totalCostLose = BigDecimal.valueOf(0.00); + BigDecimal totalCostLose = BigDecimal.ZERO; List loseList = new ArrayList<>(); loseList = sltAgreementInfoMapper.getLoseList(info); for (SltAgreementInfo bean : loseList) { if (null == bean.getBuyPrice()) { - bean.setBuyPrice(BigDecimal.valueOf(0.00)); + bean.setBuyPrice(BigDecimal.ZERO); } if (null == bean.getNum()) { bean.setNum(BigDecimal.valueOf(0L)); @@ -2450,7 +2439,7 @@ public class SltAgreementInfoController extends BaseController { List lose = Convert.toList(SltLeaseInfo.class, loseList); //维修费用明细 - BigDecimal totalCostRepair = BigDecimal.valueOf(0.00); + BigDecimal totalCostRepair = BigDecimal.ZERO; List repairList = new ArrayList<>(); @@ -2472,7 +2461,7 @@ public class SltAgreementInfoController extends BaseController { List repair = Convert.toList(SltLeaseInfo.class, repairList); //报废费用明细 - BigDecimal totalCostScrap = BigDecimal.valueOf(0.00); + BigDecimal totalCostScrap = BigDecimal.ZERO; List scrapList = new ArrayList<>(); List taskScrapList = taskMapper.getTaskIdList(info); @@ -2497,7 +2486,7 @@ public class SltAgreementInfoController extends BaseController { List scrap = Convert.toList(SltLeaseInfo.class, scrapList); //减免费用明细 - BigDecimal totalCostReduction = BigDecimal.valueOf(0.00); + BigDecimal totalCostReduction = BigDecimal.ZERO; List reductionList = new ArrayList<>(); if (info.getAgreementId() != null){ 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 bd6c33a1..f83562ac 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 @@ -396,7 +396,12 @@ left join ma_type mt1 on mt.parent_id = mt1.type_id where rc.status in ('0','1') and rc.repair_type in ('1','2') - and mt.jiju_type = #{info.settlementType} + + and mt.jiju_type = #{info.settlementType} + + + and mt.jiju_type in (1,2) + and rc.task_id in @@ -434,7 +439,12 @@ left join ma_type mt1 on mt.parent_id = mt1.type_id where rc.status in ('0','1') and rc.repair_type = '3' - and mt.jiju_type = #{info.settlementType} + + and mt.jiju_type = #{info.settlementType} + + + and mt.jiju_type in (1,2) + and rc.task_id in @@ -1195,7 +1205,12 @@ and bai.company_id = #{info.companyId} - and mt.jiju_type = #{info.settlementType} + + and mt.jiju_type = #{info.settlementType} + + + and mt.jiju_type in (1,2) + @@ -1263,7 +1278,12 @@ and rc.repair_type in ('1','2') and bai.company_id = #{info.companyId} - and mt.jiju_type = #{info.settlementType} + + and mt.jiju_type = #{info.settlementType} + + + and mt.jiju_type in (1,2) + and tta.agreement_id in @@ -1326,7 +1346,12 @@ and rc.repair_type = '3' and bai.company_id =#{info.companyId} - and mt.jiju_type = #{info.settlementType} + + and mt.jiju_type = #{info.settlementType} + + + and mt.jiju_type in (1,2) + @@ -1394,7 +1419,12 @@ and rc.repair_type = '3' and bai.company_id = #{info.companyId} - and mt.jiju_type = #{info.settlementType} + + and mt.jiju_type = #{info.settlementType} + + + and mt.jiju_type in (1,2) + and tt.create_time between #{info.startTime} and #{info.endTime} From 45dba9ad51f9fb795d976d9abae22a1202160c61 Mon Sep 17 00:00:00 2001 From: mashuai Date: Wed, 28 Jan 2026 17:42:24 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../clz/service/impl/MaterialMachineServiceImpl.java | 2 +- .../mapper/material/clz/MaterialMachineMapper.xml | 9 +++++++++ .../resources/mapper/material/common/SelectMapper.xml | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialMachineServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialMachineServiceImpl.java index 7779dafa..75fa70f9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialMachineServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialMachineServiceImpl.java @@ -918,7 +918,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService { // 获取usList中的班组id,且去重的数量 info.setTeamNum((int) useInfoList.stream() - .map(MaterialRetainedEquipmentInfo::getTeamId) + .map(MaterialRetainedEquipmentInfo::getTeamName) .filter(Objects::nonNull) .distinct() .count()); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialMachineMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialMachineMapper.xml index e5a4e96e..564a4fb3 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialMachineMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialMachineMapper.xml @@ -1483,6 +1483,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id WHERE mt.`level` = 4 and mt.del_flag = '0' + and mt2.type_name not in ('安全围栏(三角旗)', '安全围网', '标牌', '标识卡', '彩旗', '冲锋衣', '春秋装(管理)' + , '春秋装(一线)', '电力复合脂', '胶鞋', '救生衣', '军棉袄', '劳保鞋', '铝包带', '滤盒', '滤芯', '马夹', '毛巾' + , '棉村', '棉大衣', '手电筒', '手套', '洗衣粉', '夏装(管理)', '夏装(一线)', '雨衣') AND mt.unit_value = #{unitValue} @@ -1540,6 +1543,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and sd.dept_id not in (342,345,347,348,101,344) and bp.pro_id not in (3414,1192,3321,3595) and bp.pro_center IS NOT NULL + and mt2.type_name not in ('安全围栏(三角旗)', '安全围网', '标牌', '标识卡', '彩旗', '冲锋衣', '春秋装(管理)' + , '春秋装(一线)', '电力复合脂', '胶鞋', '救生衣', '军棉袄', '劳保鞋', '铝包带', '滤盒', '滤芯', '马夹', '毛巾' + , '棉村', '棉大衣', '手电筒', '手套', '洗衣粉', '夏装(管理)', '夏装(一线)', '雨衣') AND sd.dept_name = #{impUnitName} @@ -2439,6 +2445,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.type_id in(32,33) and bp.pro_id not in (3414,1192,3321,3595) and bp.pro_center IS NOT NULL + and mt2.type_name not in ('安全围栏(三角旗)', '安全围网', '标牌', '标识卡', '彩旗', '冲锋衣', '春秋装(管理)' + , '春秋装(一线)', '电力复合脂', '胶鞋', '救生衣', '军棉袄', '劳保鞋', '铝包带', '滤盒', '滤芯', '马夹', '毛巾' + , '棉村', '棉大衣', '手电筒', '手套', '洗衣粉', '夏装(管理)', '夏装(一线)', '雨衣') AND sd.dept_name = #{impUnitName} diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml index 9ac5edf2..8350af0b 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml @@ -983,6 +983,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = '0' WHERE sai.STATUS = '0' and mt1.type_name is not NULL and mt.type_name is not NULL + and mt1.type_name not in ('安全围栏(三角旗)', '安全围网', '标牌', '标识卡', '彩旗', '冲锋衣', '春秋装(管理)' + , '春秋装(一线)', '电力复合脂', '胶鞋', '救生衣', '军棉袄', '劳保鞋', '铝包带', '滤盒', '滤芯', '马夹', '毛巾' + , '棉村', '棉大衣', '手电筒', '手套', '洗衣粉', '夏装(管理)', '夏装(一线)', '雨衣') and sai.agreement_id in #{id} From c68073d7bc6a58a3ef3517d75ff315f54b0b7132 Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Wed, 28 Jan 2026 18:01:26 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E7=BB=93=E7=AE=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/settlement/SltAgreementInfoMapper.xml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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 f83562ac..1583991e 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 @@ -1223,6 +1223,9 @@ #{aid} + + and bai.unit_id = #{info.unitId} + and bai.agreement_code like concat('%',#{info.agreementCode},'%') @@ -1353,7 +1356,9 @@ and mt.jiju_type in (1,2) - + + and bai.unit_id = #{info.unitId} + and tt.create_time between #{info.startTime} and #{info.endTime} @@ -1530,8 +1535,7 @@ bp.actual_end_date as actualEndDate FROM bm_agreement_info bai - LEFT JOIN slt_agreement_apply saa - ON bai.agreement_id = saa.agreement_id AND saa.settlement_type = #{settlementType} + LEFT JOIN slt_agreement_apply saa ON bai.agreement_id = saa.agreement_id AND saa.settlement_type = #{settlementType} LEFT JOIN slt_agreement_details sad ON saa.id = sad.apply_id AND sad.slt_type = '2' LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit @@ -1539,6 +1543,9 @@ left join ma_type mt on sad.type_id = mt.type_id left join ma_type mt1 on mt.parent_id = mt1.type_id + + and bai.unit_id = #{unitId} + and bai.company_id = #{companyId} From 8ea263dcd2247610c7cc4966988a882d3c9fa3d8 Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Thu, 29 Jan 2026 09:40:13 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E7=BB=93=E7=AE=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../settlement/SltAgreementInfoMapper.xml | 18 ------------------ 1 file changed, 18 deletions(-) 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 1583991e..bf3e02cf 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 @@ -399,9 +399,6 @@ and mt.jiju_type = #{info.settlementType} - - and mt.jiju_type in (1,2) - and rc.task_id in @@ -442,9 +439,6 @@ and mt.jiju_type = #{info.settlementType} - - and mt.jiju_type in (1,2) - and rc.task_id in @@ -1208,9 +1202,6 @@ and mt.jiju_type = #{info.settlementType} - - and mt.jiju_type in (1,2) - @@ -1284,9 +1275,6 @@ and mt.jiju_type = #{info.settlementType} - - and mt.jiju_type in (1,2) - and tta.agreement_id in @@ -1352,9 +1340,6 @@ and mt.jiju_type = #{info.settlementType} - - and mt.jiju_type in (1,2) - and bai.unit_id = #{info.unitId} @@ -1427,9 +1412,6 @@ and mt.jiju_type = #{info.settlementType} - - and mt.jiju_type in (1,2) - and tt.create_time between #{info.startTime} and #{info.endTime} From 4eaae591dee8200a0c166533992389bf983de1aa Mon Sep 17 00:00:00 2001 From: mashuai Date: Thu, 29 Jan 2026 10:21:04 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/material/back/BackApplyInfoMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml index 21d9fe6e..da3be0cb 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/back/BackApplyInfoMapper.xml @@ -198,7 +198,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN sys_user su ON ( (bai.create_by REGEXP '^[0-9]+$' AND su.user_id = bai.create_by) -- 数字ID关联 OR - (NOT bai.create_by REGEXP '^[0-9]+$' AND su.nick_name = bai.create_by and su.sign_type != null and su.sign_url != null) -- 汉字昵称关联 + (NOT bai.create_by REGEXP '^[0-9]+$' AND su.nick_name = bai.create_by) -- 汉字昵称关联 ) and su.del_flag='0' WHERE bai.id = #{id} From 140f7c02e15053cad0fbfde13c15ec9f8d0cd3af Mon Sep 17 00:00:00 2001 From: bonus <1203338439@qq.com> Date: Thu, 29 Jan 2026 15:00:33 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E7=AD=BE=E8=AE=A2?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/SelectController.java | 4 ++++ .../mapper/LossAssignMapper.java | 2 ++ .../service/impl/LossAssignServiceImpl.java | 8 +++++++- .../mapper/material/common/SelectMapper.xml | 20 +++++++++++++++++-- .../lossAssessment/LossAssignMapper.xml | 12 +++++++---- 5 files changed, 39 insertions(+), 7 deletions(-) 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 44ccf2c5..711d7fb0 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 @@ -52,12 +52,16 @@ public class SelectController { @ApiOperation(value = "根据工程名称查询所属项目部下拉选") @PostMapping("getDepartList") public AjaxResult getDepartList(@RequestBody BmUnit bmUnit) { + Long deptId = typeService.getUserDeptId(); + bmUnit.setCompanyId(deptId); return service.getDepartList(bmUnit); } @ApiOperation(value = "协议往来单位下拉选") @PostMapping("getAgreementUnitList") public AjaxResult getAgreementUnitList(@RequestBody BmUnit bmUnit) { + Long deptId = typeService.getUserDeptId(); + bmUnit.setCompanyId(deptId); return service.getAgreementUnitList(bmUnit); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lossAssessment/mapper/LossAssignMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lossAssessment/mapper/LossAssignMapper.java index 794add7f..93a6aa76 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lossAssessment/mapper/LossAssignMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lossAssessment/mapper/LossAssignMapper.java @@ -192,4 +192,6 @@ public interface LossAssignMapper { * @return */ int deleteApplyDetails(Integer id); + + int updateLossDate(@Param("maId")Long maId, @Param("agreementId") Integer agreementId); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lossAssessment/service/impl/LossAssignServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lossAssessment/service/impl/LossAssignServiceImpl.java index 3552d3c8..4dae1d50 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lossAssessment/service/impl/LossAssignServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lossAssessment/service/impl/LossAssignServiceImpl.java @@ -424,7 +424,7 @@ public class LossAssignServiceImpl implements LossAssignService { private void extractedDept(LossAssignInfo lossAssignInfo) { String deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId().toString(); Set targetUnits = new HashSet<>(Arrays.asList( - "101", "102", "309", "327", "330", "333", "337", "338", + "102", "327", "330", "333", "337", "338", "339", "340", "341", "342", "344", "345", "346", "347", "348", "349" )); @@ -618,6 +618,12 @@ public class LossAssignServiceImpl implements LossAssignService { if (result == 0) { throw new ServiceException("更新设备状态失败"); } + + //截至租赁费用 + result = mapper.updateLossDate(details.getMaId(), details.getAgreementId()); + if (result == 0) { + throw new ServiceException("更新设备状态丢失日期失败"); + } } // 更新任务状态为已完成 updateWorkflowStatus(lossAssignInfo.getId(), 2); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml index 8350af0b..079a3e62 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml @@ -1644,7 +1644,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.unit_name = #{unitName} - + + AND bu.company_id = #{companyId} + UNION SELECT DISTINCT @@ -1664,7 +1666,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.unit_name = #{unitName} - + + AND bu.company_id = #{companyId} + UNION SELECT @@ -1684,6 +1688,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.unit_name = #{unitName} + + AND bu.company_id = #{companyId} + ) ff ORDER BY LEVEL @@ -1723,6 +1730,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.unit_id = #{unitId} + + AND bu.company_id = #{companyId} + UNION @@ -1746,6 +1756,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.unit_id = #{unitId} + + AND bu.company_id = #{companyId} + UNION SELECT @@ -1768,6 +1781,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.unit_id = #{unitId} + + AND bu.company_id = #{companyId} + ) ff ORDER BY LEVEL diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lossAssessment/LossAssignMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lossAssessment/LossAssignMapper.xml index facbdb86..f8ccc378 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lossAssessment/LossAssignMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lossAssessment/LossAssignMapper.xml @@ -205,6 +205,10 @@ where ma_id = #{maId} + + update slt_agreement_info set end_time = now() where ma_id = #{maId} and agreement_id = #{agreementId} and status = 0 + + update bm_loss_assign_details set del_flag = '0' @@ -249,7 +253,7 @@ LEFT JOIN lease_apply_info lai ON lai.id = sai.lease_id WHERE sai.agreement_id = #{agreementId} AND sai.status = '0' - AND mt.jiju_type = '2' AND sai.ma_id is not null + AND mt.manage_type = 0 AND sai.ma_id is not null AND mm.ma_status = '2' AND sai.type_id = #{typeId} @@ -562,7 +566,7 @@ WHERE sai.agreement_id = #{agreementId} AND sai.STATUS = '0' ) AS sai_filtered INNER JOIN ma_type mt ON mt.type_id = sai_filtered.type_id - WHERE mt.parent_id IS NOT NULL and mt.jiju_type = '2' + WHERE mt.parent_id IS NOT NULL and mt.manage_type = 0 UNION ALL -- 二级父节点 @@ -575,7 +579,7 @@ ) AS sai_filtered INNER JOIN ma_type mt ON mt.type_id = sai_filtered.type_id INNER JOIN ma_type mt2 ON mt2.type_id = mt.parent_id - WHERE mt2.parent_id IS NOT NULL and mt.jiju_type = '2' + WHERE mt2.parent_id IS NOT NULL and mt.manage_type = 0 UNION ALL -- 一级父节点 @@ -589,7 +593,7 @@ INNER JOIN ma_type mt ON mt.type_id = sai_filtered.type_id INNER JOIN ma_type mt2 ON mt2.type_id = mt.parent_id INNER JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id - WHERE mt3.parent_id IS NOT NULL and mt.jiju_type = '2' + WHERE mt3.parent_id IS NOT NULL and mt.manage_type = 0 ) AS all_nodes ); From acad22be83b41c04da1389565da79a45987e68c4 Mon Sep 17 00:00:00 2001 From: mashuai Date: Thu, 29 Jan 2026 15:01:44 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/basic/controller/ComplexQueryController.java | 2 ++ .../material/basic/service/impl/ComplexQueryServiceImpl.java | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java index c060f360..7c52d81e 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/ComplexQueryController.java @@ -542,6 +542,8 @@ public class ComplexQueryController extends BaseController { @ApiOperation(value = "施工机具需求、供应分析统计表") @GetMapping("/getStatisticsList") public AjaxResult getStatisticsList(ProjUsingRecord bean) { + Long companyId = typeService.getUserDeptId(); + bean.setCompanyId(companyId.intValue()); startPage(); List pageList = complexQueryService.getStatisticsList(bean); return AjaxResult.success(getDataTable(pageList)); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java index 524a5bb2..8f2faaea 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/ComplexQueryServiceImpl.java @@ -656,11 +656,6 @@ public class ComplexQueryServiceImpl implements ComplexQueryService { @Override public List getStatisticsList(ProjUsingRecord bean) { try { - /** - * jsk - */ - Long companyId=iTypeService.getUserDeptId(); - bean.setCompanyId(companyId.intValue()); // 1、查询工程对应的物资名称、型号、需求数量、已供数量 List list = complexQueryMapper.getStatisticsList(bean);