From 4715df61b12de072560e0357f558e02ebc5df80f Mon Sep 17 00:00:00 2001 From: hayu <1604366271@qq.com> Date: Thu, 20 Feb 2025 20:40:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/common/biz/config/PoiOutPage.java | 123 +++++++++++++++++- .../common/biz/utils/NumberToChinese.java | 82 ++++++++++++ .../controller/DirectRotationController.java | 12 ++ .../ma/service/DirectRotationService.java | 7 + .../ma/service/impl/DirectRotationImpl.java | 25 +++- .../DerateRecordQueryController.java | 11 ++ .../controller/SltRecordQueryController.java | 2 +- .../mapper/DerateRecordQueryMapper.java | 22 ++++ .../service/IDerateReocrdQueryService.java | 8 ++ .../service/ISltReocrdQueryService.java | 7 + .../impl/DerateRecordQueryServiceImpl.java | 24 ++++ .../impl/SltRecordQueryServiceImpl.java | 23 +++- .../SltAgreementInfoController.java | 94 +++++++++---- .../SltAgreementReduceController.java | 15 +++ .../settlement/domain/SltAgreementInfo.java | 9 ++ .../settlement/domain/SltAgreementReduce.java | 7 + .../settlement/domain/vo/SltLeaseInfo.java | 7 +- .../mapper/SltAgreementReduceMapper.java | 14 ++ .../service/ISltAgreementReduceService.java | 7 + .../impl/SltAgreementReduceServiceImpl.java | 58 +++++++++ .../mapper/material/lease/LeaseTaskMapper.xml | 3 +- .../material/ma/DirectRotationMapper.xml | 8 +- .../record/DerateRecordQueryMapper.xml | 54 +++++++- .../settlement/SltAgreementReduceMapper.xml | 30 ++++- 24 files changed, 611 insertions(+), 41 deletions(-) create mode 100644 bonus-common-biz/src/main/java/com/bonus/common/biz/utils/NumberToChinese.java diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/config/PoiOutPage.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/config/PoiOutPage.java index b1c6fe14..22ee5971 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/config/PoiOutPage.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/config/PoiOutPage.java @@ -1,5 +1,6 @@ package com.bonus.common.biz.config; +import com.bonus.common.biz.utils.NumberToChinese; import org.apache.poi.hssf.usermodel.*; import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.util.CellRangeAddress; @@ -248,9 +249,9 @@ public class PoiOutPage { return workbook; } - public static HSSFWorkbook excelForcheckAll(List> resultLease,List> resultLose,List> resultRepair,List> resultScrap, - List listLease,List listLose,List listRepair,List listScrap, String filename, String projectName, String unit, - BigDecimal totalCostLease, BigDecimal totalCostLose, BigDecimal totalCostRepair, BigDecimal totalCostScrap) { + public static HSSFWorkbook excelForcheckAll(List> resultLease,List> resultLose,List> resultRepair,List> resultScrap,List> resultsReduction, + List listLease,List listLose,List listRepair,List listScrap,List listReduction, String filename, String projectName, String unit, + BigDecimal totalCostLease, BigDecimal totalCostLose, BigDecimal totalCostRepair, BigDecimal totalCostScrap,BigDecimal totalCostReduction) { // 创建工作簿和工作表 HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet(); @@ -267,7 +268,18 @@ public class PoiOutPage { // 填充标题行 int rowNum = 0; rowNum = createTitleRowStyle(sheet, rowNum, filename, titleStyle, listLease.size()); - rowNum = createProjectAndUnitRow(sheet, rowNum, projectName, unit, titleStyle, listLease.size()); + rowNum = createTitleRowStyleCost(sheet, rowNum, "本工程清算项目及金额(元)", titleStyle, listLease.size()); + BigDecimal totalCost1 = totalCostLease.subtract(totalCostReduction); + //合计 + BigDecimal totalCostAll = totalCostLease.add(totalCostLose).add(totalCostRepair).add(totalCostScrap).subtract(totalCostReduction); + String all= NumberToChinese.number2CN(totalCostAll); + rowNum = createProjectAndUnitRows(sheet, rowNum, "一、施工机具有偿使用费:", totalCost1+"", titleStyle, listLease.size()); + rowNum = createProjectAndUnitRows(sheet, rowNum, "二、施工机具维修费:", totalCostRepair+"", titleStyle, listLease.size()); + rowNum = createProjectAndUnitRows(sheet, rowNum, "三、施工机具丢失费:", totalCostLose+"", titleStyle, listLease.size()); + rowNum = createProjectAndUnitRows(sheet, rowNum, "四、施工机具损坏赔偿费:", totalCostScrap+"", titleStyle, listLease.size()); + rowNum = createProjectAndUnitRowss(sheet,rowNum,"费用合计金额(大写)",all,totalCostAll+"", titleStyle, listLease.size()); + rowNum = createProjectAndUnitRows(sheet, rowNum, "说明", "本协议一式三份,甲方一份,乙方一份,经双方签字后生效。", titleStyle, listLease.size()); + rowNum = createProjectAndUnitRows(sheet, rowNum, "备注", "此费用仅为在机具设备分公司发生费用,未计从项目部领用机具费用。", titleStyle, listLease.size()); /** * 租赁费用明细 @@ -381,8 +393,34 @@ public class PoiOutPage { } rowNum = createTotalRow(sheet, rowNum, listLose, totalCostLose, headerStyle); - //合计 - BigDecimal totalCostAll = totalCostLease.add(totalCostLose).add(totalCostRepair).add(totalCostScrap); + /** + * 减免费用明细 + */ + // 填充标题行 + rowNum = createTitleRowStyleCost(sheet, rowNum, "减免费用明细", titleStyle, listReduction.size()); + // 填充表头 + rowNum = createHeaderRow(sheet, rowNum, listReduction, headerStyle); + // 填充数据行 + if (resultsReduction != null && !resultsReduction.isEmpty()) { + rowNum = createDataRows(sheet, rowNum, resultsReduction, contentStyle, listReduction.size()); + } else { + // 如果没有数据,则仅显示表头 +// rowNum++; +// rowNum = createDataRows(sheet, rowNum, resultLease, contentStyle, listLease.size()); + HSSFRow row = sheet.createRow(rowNum++); + HSSFCell cell = row.createCell(0); + cell.setCellStyle(headerStyle); + cell.setCellValue("暂无数据"); + sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, (short) (listReduction.size() - 1))); + CellRangeAddress cellRange = new CellRangeAddress(rowNum - 1, rowNum - 1, 0, (short) (listReduction.size() - 1)); + // 设置边框样式 + RegionUtil.setBorderTop(BorderStyle.THIN, cellRange, sheet); + RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange, sheet); + RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange, sheet); + RegionUtil.setBorderRight(BorderStyle.THIN, cellRange, sheet); + } + rowNum = createTotalRow(sheet, rowNum, listReduction, totalCostReduction, headerStyle); + rowNum = createTotalRowAll(sheet, rowNum, listScrap, totalCostAll, headerStyle); return workbook; @@ -564,6 +602,79 @@ public class PoiOutPage { return rowNum; } + /** + * 创建结算单位和结算工程行 + */ + private static int createProjectAndUnitRows(HSSFSheet sheet, int rowNum, String projectName, String unitName,HSSFCellStyle titleStyle, int nColumn) { + // 第一行:结算单位 + HSSFRow row1 = sheet.createRow(rowNum++); + row1.setHeightInPoints(30); + // bug修复:修改合并单元格区域,确保包含两个或以上单元格 + sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 2)); // 结算单位: 占8 + HSSFCell cell1 = row1.createCell(0); + cell1.setCellStyle(titleStyle); + cell1.setCellValue(projectName); + + sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 3, (short) (nColumn - 1))); // unitName 占剩余的22 + HSSFCell cell2 = row1.createCell(3); + cell2.setCellStyle(titleStyle); + cell2.setCellValue(unitName); + + // 添加边框 + CellRangeAddress cellRange1 = new CellRangeAddress(rowNum - 2, rowNum - 2, 0, 2); + CellRangeAddress cellRange2 = new CellRangeAddress(rowNum - 2, rowNum - 2, 3, (short) (nColumn - 1)); + // 设置边框样式 + RegionUtil.setBorderTop(BorderStyle.THIN, cellRange1, sheet); + RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange1, sheet); + RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange1, sheet); + RegionUtil.setBorderRight(BorderStyle.THIN, cellRange1, sheet); + RegionUtil.setBorderTop(BorderStyle.THIN, cellRange2, sheet); + RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange2, sheet); + RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange2, sheet); + RegionUtil.setBorderRight(BorderStyle.THIN, cellRange2, sheet); + return rowNum; + } + + private static int createProjectAndUnitRowss(HSSFSheet sheet, int rowNum, String projectName, String unitName,String data,HSSFCellStyle titleStyle, int nColumn) { + // 第一行:结算单位 + HSSFRow row1 = sheet.createRow(rowNum++); + row1.setHeightInPoints(30); + // bug修复:修改合并单元格区域,确保包含两个或以上单元格 + sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 0, 2)); // 结算单位: 占8 + HSSFCell cell1 = row1.createCell(0); + cell1.setCellStyle(titleStyle); + cell1.setCellValue(projectName); + + sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 3, 5)); // 结算单位: 占8 + HSSFCell cell2 = row1.createCell(3); + cell2.setCellStyle(titleStyle); + cell2.setCellValue(unitName); + + sheet.addMergedRegion(new CellRangeAddress(rowNum - 1, rowNum - 1, 6, (short) (nColumn - 1))); // unitName 占剩余的22 + HSSFCell cell3 = row1.createCell(6); + cell3.setCellStyle(titleStyle); + cell3.setCellValue(data); + + // 添加边框 + CellRangeAddress cellRange1 = new CellRangeAddress(rowNum - 2, rowNum - 2, 0, 2); + CellRangeAddress cellRange2 = new CellRangeAddress(rowNum - 2, rowNum - 2, 3, 5); + CellRangeAddress cellRange3 = new CellRangeAddress(rowNum - 2, rowNum - 2, 6, (short) (nColumn - 1)); + // 设置边框样式 + RegionUtil.setBorderTop(BorderStyle.THIN, cellRange1, sheet); + RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange1, sheet); + RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange1, sheet); + RegionUtil.setBorderRight(BorderStyle.THIN, cellRange1, sheet); + RegionUtil.setBorderTop(BorderStyle.THIN, cellRange2, sheet); + RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange2, sheet); + RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange2, sheet); + RegionUtil.setBorderRight(BorderStyle.THIN, cellRange2, sheet); + RegionUtil.setBorderTop(BorderStyle.THIN, cellRange3, sheet); + RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange3, sheet); + RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange3, sheet); + RegionUtil.setBorderRight(BorderStyle.THIN, cellRange3, sheet); + return rowNum; + } + /** * 创建项目名称和单位信息行 */ diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/utils/NumberToChinese.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/utils/NumberToChinese.java new file mode 100644 index 00000000..1cb217ac --- /dev/null +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/utils/NumberToChinese.java @@ -0,0 +1,82 @@ +package com.bonus.common.biz.utils; + +import java.math.BigDecimal; + +public class NumberToChinese { + + private static final String[] NUMBERS = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"}; + private static final String[] UNITS = {"", "拾", "佰", "仟"}; + private static final String[] BIG_UNITS = {"", "万", "亿", "兆"}; + + public static String number2CN(BigDecimal number) { + // 分离整数和小数部分 + BigDecimal integerPart = number.setScale(0, BigDecimal.ROUND_DOWN); + BigDecimal decimalPart = number.subtract(integerPart).multiply(new BigDecimal(100)).setScale(0, BigDecimal.ROUND_HALF_UP); + + StringBuilder result = new StringBuilder(); + + if (integerPart.compareTo(BigDecimal.ZERO) > 0) { + result.append(integerToChinese(integerPart.longValue())).append("元"); + } + + if (decimalPart.compareTo(BigDecimal.ZERO) > 0) { + int jiao = decimalPart.intValue() / 10; + int fen = decimalPart.intValue() % 10; + if(jiao > 0){ + result.append(NUMBERS[jiao]).append("角"); + } + if(fen > 0){ + result.append(NUMBERS[fen]).append("分"); + } else if(jiao == 0 && fen == 0){ + result.append("整"); + } + } else { + result.append("整"); + } + + return result.toString(); + } + + private static String integerToChinese(long num) { + if (num == 0) return NUMBERS[0]; // 如果是0直接返回"零" + + StringBuilder chineseNum = new StringBuilder(); + int unitPos = 0; + boolean needZero = false; + + while (num > 0) { + long index = num % 10; // 获取当前位的数字 + if (index != 0 || unitPos % 4 == 0 && num / 10 % 10 != 0) { // 只有在非零或特定位置(万、亿等)才添加单位 + chineseNum.insert(0, UNITS[unitPos % 4]); // 添加对应的单位 + chineseNum.insert(0, NUMBERS[(int)index]); // 添加对应的数字字符 + needZero = false; + } else if (!needZero) { // 避免连续的零 + if (!(chineseNum.length() > 0 && chineseNum.charAt(0) == NUMBERS[0].charAt(0))) { + chineseNum.insert(0, NUMBERS[0]); + } + needZero = true; + } + num /= 10; + unitPos++; + + if(unitPos % 4 == 0 && num > 0){ + chineseNum.insert(0, BIG_UNITS[unitPos / 4]); + } + } + + // 清理多余的“零” + String result = chineseNum.toString().replaceAll("零[仟佰拾]", "零") + .replaceAll("零{2,}", "零") + .replaceFirst("^零", ""); + + // 处理特殊情况如“壹拾”前加“壹”的情况 + result = result.replaceAll("壹拾", "拾"); + + return result; + } + +// public static void main(String[] args) { +// BigDecimal totalCostAll = new BigDecimal("84341.59000"); +// System.out.println(number2CN(totalCostAll)); +// } +} \ No newline at end of file diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/DirectRotationController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/DirectRotationController.java index 786db2a9..544f7123 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/DirectRotationController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/DirectRotationController.java @@ -125,7 +125,19 @@ public class DirectRotationController extends BaseController { } catch (Exception e) { return AjaxResult.success(new DirectApplyInfo()); } + } + /** + * 用于APP + */ + @ApiOperation(value = "查看详情") + @GetMapping("/getInfoApp") + public AjaxResult getInfoApp(SltAgreementInfo sltAgreementInfo) { + try { + return AjaxResult.success(service.getInfoApp(sltAgreementInfo)); + } catch (Exception e) { + return AjaxResult.success(new DirectApplyInfo()); + } } /** diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/DirectRotationService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/DirectRotationService.java index d49714ed..01bb9dbe 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/DirectRotationService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/DirectRotationService.java @@ -43,6 +43,13 @@ public interface DirectRotationService { */ DirectApplyInfo getInfoById(SltAgreementInfo sltAgreementInfo); + /** + * 查看详情 + * @param sltAgreementInfo + * @return + */ + DirectApplyInfo getInfoApp(SltAgreementInfo sltAgreementInfo); + /** * 修改直转申请 * @param directApplyInfoDetails diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/DirectRotationImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/DirectRotationImpl.java index 5bdbca6b..1a7befda 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/DirectRotationImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/DirectRotationImpl.java @@ -121,6 +121,7 @@ public class DirectRotationImpl implements DirectRotationService { int i2 = workSiteDirectManageService.saveDirectApplyDetails(directApplyDetail); } } + return AjaxResult.success("修改成功"); } } else { return AjaxResult.error("修改失败"); @@ -128,7 +129,7 @@ public class DirectRotationImpl implements DirectRotationService { } else { return AjaxResult.error("修改失败"); } - return null; + return AjaxResult.success(); } @Override @@ -148,6 +149,28 @@ public class DirectRotationImpl implements DirectRotationService { return directApplyInfo; } + @Override + public DirectApplyInfo getInfoApp(SltAgreementInfo sltAgreementInfo) { + DirectApplyInfo directApplyInfo = mapper.getInfoById(sltAgreementInfo); + if (directApplyInfo != null){ + if (sltAgreementInfo.getAgreementId()!=directApplyInfo.getLeaseAgreementId()){ + return new DirectApplyInfo(); + } + } + if (directApplyInfo.getDirUrl()!= null){ + //用逗号分割放入数组 + String[] split = directApplyInfo.getDirUrl().split(","); + List list1 = new ArrayList<>(); + for (String s : split) { + list1.add(new DirectApplyUrl(s)); + } + directApplyInfo.setDirUrls(list1); + } + List detailById = mapper.getDetailById(sltAgreementInfo); + directApplyInfo.setDirectApplyDetails(detailById); + return directApplyInfo; + } + @Override public int delData(Long id) { try { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/DerateRecordQueryController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/DerateRecordQueryController.java index 25232071..c6e13f73 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/DerateRecordQueryController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/DerateRecordQueryController.java @@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; @@ -62,6 +63,16 @@ public class DerateRecordQueryController extends BaseController { } } + /** + * 减免记录详情查看 + */ + @ApiOperation(value = "减免记录详情查看") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@NotNull(message = "减免任务ID不能为空") @PathVariable("id") Long id, + @RequestParam(value = "keyWord", required = false) String keyWord) { + return success(service.getInfo(id, keyWord)); + } + /** * 删除减免记录 */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/SltRecordQueryController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/SltRecordQueryController.java index c656a50a..79cca8b6 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/SltRecordQueryController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/controller/SltRecordQueryController.java @@ -52,7 +52,7 @@ public class SltRecordQueryController extends BaseController { @GetMapping("/getAppList") public AjaxResult getAppList(SltAgreementInfo bean) { try { - List list = service.getList(bean); + List list = service.getAppList(bean); return AjaxResult.success(list); } catch (Exception e) { return AjaxResult.success(new ArrayList<>()); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/mapper/DerateRecordQueryMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/mapper/DerateRecordQueryMapper.java index 426cc273..9fcb2b58 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/mapper/DerateRecordQueryMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/mapper/DerateRecordQueryMapper.java @@ -1,6 +1,7 @@ package com.bonus.material.record.mapper; +import com.bonus.common.biz.domain.BmFileInfo; import com.bonus.material.settlement.domain.SltAgreementInfo; import com.bonus.material.settlement.domain.SltAgreementReduce; @@ -26,4 +27,25 @@ public interface DerateRecordQueryMapper { * @return */ int delData(Long id); + + /** + * 减免记录详情查看 + * @param id + * @return + */ + SltAgreementReduce getInfo(Long id); + + /** + * 减免记录附件 + * @param info + * @return + */ + List getBmFileInfos(SltAgreementReduce info); + + /** + * 减免记录详情查看 + * @param id + * @return + */ + List getDetailList(Long id); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/IDerateReocrdQueryService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/IDerateReocrdQueryService.java index 187da5be..7fffd5b3 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/IDerateReocrdQueryService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/IDerateReocrdQueryService.java @@ -26,4 +26,12 @@ public interface IDerateReocrdQueryService { * @return */ int delData(Long id); + + /** + * 根据ID获取减免记录 + * @param id + * @param keyWord + * @return + */ + SltAgreementReduce getInfo(Long id, String keyWord); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/ISltReocrdQueryService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/ISltReocrdQueryService.java index fa90da75..a1aa6d29 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/ISltReocrdQueryService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/ISltReocrdQueryService.java @@ -18,4 +18,11 @@ public interface ISltReocrdQueryService { * @return */ List getList(SltAgreementInfo bean); + + /** + * 根据条件获取结算记录 + * @param bean + * @return + */ + List getAppList(SltAgreementInfo bean); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/DerateRecordQueryServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/DerateRecordQueryServiceImpl.java index 26402e42..1aa987c2 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/DerateRecordQueryServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/DerateRecordQueryServiceImpl.java @@ -1,5 +1,6 @@ package com.bonus.material.record.service.impl; +import com.bonus.common.biz.domain.BmFileInfo; import com.bonus.material.record.mapper.DerateRecordQueryMapper; import com.bonus.material.record.mapper.SltRecordQueryMapper; import com.bonus.material.record.service.IDerateReocrdQueryService; @@ -35,4 +36,27 @@ public class DerateRecordQueryServiceImpl implements IDerateReocrdQueryService { return 0; } } + + @Override + public SltAgreementReduce getInfo(Long id, String keyWord) { + try { + //先根据Id查询apply信息 + SltAgreementReduce info = mapper.getInfo(id); + if (info != null && info.getId() != null) { + //查询附件 + List bmFileInfos= mapper.getBmFileInfos(info); + if (bmFileInfos != null && bmFileInfos.size() > 0){ + info.setBmFileInfos(bmFileInfos); + } + //查询详情 + List detailList = mapper.getDetailList(id); + if (detailList != null && detailList.size() > 0){ + info.setDetailList(detailList); + } + } + return info; + } catch (Exception e) { + return new SltAgreementReduce(); + } + } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/SltRecordQueryServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/SltRecordQueryServiceImpl.java index 0b06a609..faa9c605 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/SltRecordQueryServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/record/service/impl/SltRecordQueryServiceImpl.java @@ -3,10 +3,13 @@ package com.bonus.material.record.service.impl; import com.bonus.material.record.mapper.SltRecordQueryMapper; import com.bonus.material.record.service.ISltReocrdQueryService; import com.bonus.material.settlement.domain.SltAgreementInfo; +import com.bonus.material.settlement.domain.vo.SltInfoVo; +import com.bonus.material.settlement.service.ISltAgreementInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.List; /** @@ -19,13 +22,31 @@ public class SltRecordQueryServiceImpl implements ISltReocrdQueryService { @Resource private SltRecordQueryMapper mapper; + @Autowired + private ISltAgreementInfoService sltAgreementInfoService; + @Override public List getList(SltAgreementInfo bean) { + return mapper.getList(bean); + } + + @Override + public List getAppList(SltAgreementInfo bean) { List list = mapper.getList(bean); if (list.size()>0){ for (SltAgreementInfo sltAgreementInfo : list) { if (sltAgreementInfo.getAgreementId()!=null){ - + //todo 后面优化 + SltInfoVo beans = sltAgreementInfoService.getSltRecordDetailsList(sltAgreementInfo); + if (beans!=null){ + sltAgreementInfo.setLeaseCost(beans.getLeaseCost()); + sltAgreementInfo.setRepairCost(beans.getRepairCost()); + sltAgreementInfo.setScrapCost(beans.getScrapCost()); + sltAgreementInfo.setLoseCost(beans.getLoseCost()); + sltAgreementInfo.setReductionCost(beans.getReductionCost()); + BigDecimal totalCostAll = beans.getLeaseCost().add(beans.getLoseCost()).add(beans.getRepairCost()).add(beans.getScrapCost()).subtract(beans.getReductionCost()); + sltAgreementInfo.setTotalCostAll(totalCostAll); + } } } } 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 96b8bb7f..2d0cc7cb 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 @@ -262,7 +262,8 @@ public class SltAgreementInfoController extends BaseController { List headersLose = receiveDetailsHeader(2,1); List headersRepair = receiveDetailsHeader(3,1); List headersScrap = receiveDetailsHeader(4,1); - HSSFWorkbook workbook = PoiOutPage.excelForcheckAll(resultsLease,resultsLose,resultsRepair,resultsScrap, headersLease,headersLose,headersRepair,headersScrap, filename,projectName,unitName,totalCostLease,totalCostLose,totalCostRepair,totalCostScrap); + List headersReduction = receiveDetailsHeader(5,1); + HSSFWorkbook workbook = PoiOutPage.excelForcheckAll(resultsLease,resultsLose,resultsRepair,resultsScrap,resultsReduction, headersLease,headersLose,headersRepair,headersScrap,headersReduction, filename,projectName,unitName,totalCostLease,totalCostLose,totalCostRepair,totalCostScrap,totalCostReduction); OutputStream out = null; response.setContentType("application/vnd.ms-excel;charset=UTF-8"); response.addHeader("Content-Disposition", @@ -287,15 +288,28 @@ public class SltAgreementInfoController extends BaseController { if(type==1){ // maps.put("unitName", bean.getUnitName()); // maps.put("projectName", bean.getProjectName()); - maps.put("typeName", bean.getTypeName()); - maps.put("modelName", bean.getModelName()); - maps.put("mtUnitName", bean.getMtUnitName()); - maps.put("leasePrice", bean.getLeasePrice()); - maps.put("num", bean.getNum()); - maps.put("startTime", bean.getStartTime()==null ? null:dateFormat.format(bean.getStartTime())); - maps.put("endTime", bean.getEndTime()==null ? null:dateFormat.format(bean.getEndTime())); - maps.put("leaseDays", bean.getLeaseDays()); - maps.put("costs", bean.getCosts().setScale(2, RoundingMode.HALF_UP)); + if (flag==0){ + maps.put("typeName", bean.getTypeName()); + maps.put("modelName", bean.getModelName()); + maps.put("mtUnitName", bean.getMtUnitName()); + maps.put("leasePrice", bean.getLeasePrice()); + maps.put("num", bean.getNum()); + maps.put("startTime", bean.getStartTime()==null ? null:dateFormat.format(bean.getStartTime())); + maps.put("endTime", bean.getEndTime()==null ? null:dateFormat.format(bean.getEndTime())); + maps.put("leaseDays", bean.getLeaseDays()); + maps.put("costs", bean.getCosts().setScale(2, RoundingMode.HALF_UP)); + }else { + maps.put("typeName", bean.getTypeName()); + maps.put("modelName", bean.getModelName()); + maps.put("mtUnitName", bean.getMtUnitName()); + maps.put("leasePrice", bean.getLeasePrice()); + maps.put("num", bean.getNum()); + maps.put("startTime", bean.getStartTime()==null ? null:dateFormat.format(bean.getStartTime())); + maps.put("endTime", bean.getEndTime()==null ? null:dateFormat.format(bean.getEndTime())); + maps.put("leaseDays", bean.getLeaseDays()); + maps.put("costs", bean.getCosts().setScale(2, RoundingMode.HALF_UP)); + maps.put("t1", ""); + } }else if(type==2) { if(flag==0){ maps.put("typeName", bean.getTypeName()); @@ -313,6 +327,7 @@ public class SltAgreementInfoController extends BaseController { maps.put("t2", ""); maps.put("t3", ""); maps.put("t4", ""); + maps.put("t5", ""); } }else if(type==3){ if(flag==0){ @@ -332,6 +347,7 @@ public class SltAgreementInfoController extends BaseController { maps.put("t1", ""); maps.put("t2", ""); maps.put("t3", ""); + maps.put("t4", ""); } }else if(type==4){ if(flag==0){ @@ -356,14 +372,14 @@ public class SltAgreementInfoController extends BaseController { } else if(type==5){ maps.put("typeName", bean.getTypeName()); maps.put("modelName", bean.getModelName()); - maps.put("mtUnitName", bean.getMtUnitName()); + maps.put("mtUnitName", bean.getUnitName()); maps.put("leasePrice", bean.getLeasePrice()); - maps.put("num", bean.getNum()); + maps.put("num", bean.getReduceNum()); maps.put("startTime", bean.getStartTime()==null ? null:dateFormat.format(bean.getStartTime())); maps.put("endTime", bean.getEndTime()==null ? null:dateFormat.format(bean.getEndTime())); - maps.put("leaseDays", bean.getLeaseDays()); - maps.put("costs", bean.getCosts().setScale(2, RoundingMode.HALF_UP)); + maps.put("leaseDays", bean.getDays()); maps.put("remark", bean.getRemark()); + maps.put("costs", bean.getLeaseMoney().setScale(2, RoundingMode.HALF_UP)); } return maps; } @@ -378,15 +394,28 @@ public class SltAgreementInfoController extends BaseController { // list.add("结算单位"); // list.add("结算工程"); - list.add("设备名称"); - list.add("规格型号"); - list.add("计量单位"); - list.add("租赁单价"); - list.add("租赁数量"); - list.add("租赁日期"); - list.add("归还日期"); - list.add("租赁天数"); - list.add("租赁费用(元)"); + if (flag==0){ + list.add("设备名称"); + list.add("规格型号"); + list.add("计量单位"); + list.add("租赁单价"); + list.add("租赁数量"); + list.add("租赁日期"); + list.add("归还日期"); + list.add("租赁天数"); + list.add("租赁费用(元)"); + }else { + list.add("设备名称"); + list.add("规格型号"); + list.add("计量单位"); + list.add("租赁单价"); + list.add("租赁数量"); + list.add("租赁日期"); + list.add("归还日期"); + list.add("租赁天数"); + list.add("租赁费用(元)"); + list.add(" "); + } }else if(type==2){ if(flag==0){ list.add("设备名称"); @@ -404,7 +433,7 @@ public class SltAgreementInfoController extends BaseController { list.add(" "); list.add(" "); list.add(" "); - + list.add(" "); } }else if(type==3){ @@ -425,6 +454,7 @@ public class SltAgreementInfoController extends BaseController { list.add(""); list.add(""); list.add(""); + list.add(" "); } }else if(type==4){ if(flag==0){ @@ -444,7 +474,19 @@ public class SltAgreementInfoController extends BaseController { list.add(""); list.add(""); list.add(""); + list.add(" "); } + }else if (type==5){ + list.add("设备名称"); + list.add("规格型号"); + list.add("单位"); + list.add("租赁单价"); + list.add("减免数量"); + list.add("减免开始日期"); + list.add("减免结束日期"); + list.add("减免天数"); + list.add("减免原因"); + list.add("减免费用(元)"); } return list; } @@ -597,7 +639,7 @@ public class SltAgreementInfoController extends BaseController { } } List repair = Convert.toList(SltLeaseInfo.class, reductionList); - expOutExcel(response,repair,fileName,projectName,unitName,reductionCost,3); + expOutExcel(response,repair,fileName,projectName,unitName,reductionCost,5); } catch (Exception e) { log.error(e.toString(), e); } @@ -672,7 +714,7 @@ public class SltAgreementInfoController extends BaseController { @PostMapping("/exportAll") public void exportAll(HttpServletResponse response, SltAgreementInfo sltAgreementInfo) { try { - String fileName = "结算明细"; + String fileName = "结算费用明细"; String projectName = sltAgreementInfo.getProjectName(); String unitName = sltAgreementInfo.getUnitName(); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementReduceController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementReduceController.java index 1605786e..eee807eb 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementReduceController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementReduceController.java @@ -109,4 +109,19 @@ public class SltAgreementReduceController extends BaseController { return error("系统错误, " + e.getMessage()); } } + + + /** + * 修改减免申请 + */ + @ApiOperation(value = "修改减免申请") + @SysLog(title = "减免申请记录查询", businessType = OperaType.UPDATE, logType = 1,module = "减免申请记录查询->修改减免申请") + @PostMapping("/editApply") + public AjaxResult editApply( @RequestBody SltAgreementReduce sltAgreement) { + try { + return sltAgreementReduceService.editApply(sltAgreement); + } catch (Exception e) { + return error("修改失败"); + } + } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java index 00b3ba2c..65e64ee6 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java @@ -221,4 +221,13 @@ public class SltAgreementInfo extends BaseEntity { private Integer isApp; + private BigDecimal leaseCost; + private BigDecimal repairCost; + private BigDecimal scrapCost; + private BigDecimal loseCost; + private BigDecimal reductionCost; + //结算费用 + private BigDecimal totalCostAll; + + } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduce.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduce.java index de6ac32b..e03a4ac6 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduce.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementReduce.java @@ -123,7 +123,14 @@ public class SltAgreementReduce extends BaseEntity { private List detailList; private String typeName; + private String modeName; + private String modelName; + + private Integer unitId; + private String unitName; + + private Integer proId; private String projectName; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltLeaseInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltLeaseInfo.java index b2c7a2e8..385436ff 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltLeaseInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltLeaseInfo.java @@ -106,6 +106,8 @@ public class SltLeaseInfo extends BaseEntity { @ApiModelProperty(value = "租赁费用") private BigDecimal costs; + private BigDecimal leaseMoney; + /** 机具id */ @ApiModelProperty(value = "机具id") @@ -135,8 +137,9 @@ public class SltLeaseInfo extends BaseEntity { @ApiModelProperty(value = "原值") private BigDecimal buyPrice; - /** 是否结算 */ + private BigDecimal reduceNum; + /** 是否结算 */ @ApiModelProperty(value = "是否结算") private String isSlt; @@ -165,6 +168,8 @@ public class SltLeaseInfo extends BaseEntity { @ApiModelProperty(value = "租赁天数") private Long leaseDay; + private Long days; + @ApiModelProperty(value = "往来单位id") private Long unitId; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementReduceMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementReduceMapper.java index b11358ba..59c488d0 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementReduceMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementReduceMapper.java @@ -38,4 +38,18 @@ public interface SltAgreementReduceMapper { * @return */ List getReductionList(SltAgreementReduce bean); + + /** + * 根据Id删除减免明细 + * @param id + * @return + */ + int deleteReduceDetail(Long id); + + /** + * 修改减免申请 + * @param sltAgreement + * @return + */ + Long updateReduce(SltAgreementReduce sltAgreement); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementReduceService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementReduceService.java index f916c557..75a713ad 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementReduceService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementReduceService.java @@ -22,4 +22,11 @@ public interface ISltAgreementReduceService { List selectByMatype(SltAgreementReduce sltAgreement); List selectByMaModel(SltAgreementReduce sltAgreement); + + /** + * 修改减免申请 + * @param sltAgreement + * @return + */ + AjaxResult editApply(SltAgreementReduce sltAgreement); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementReduceServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementReduceServiceImpl.java index 8570ffbe..9fda72ba 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementReduceServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementReduceServiceImpl.java @@ -2,6 +2,7 @@ package com.bonus.material.settlement.service.impl; import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.common.security.utils.SecurityUtils; import com.bonus.material.basic.mapper.BmFileInfoMapper; import com.bonus.material.settlement.domain.SltAgreementReduce; import com.bonus.material.settlement.mapper.SltAgreementReduceMapper; @@ -11,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; import java.math.BigDecimal; import java.text.SimpleDateFormat; @@ -62,6 +64,7 @@ public class SltAgreementReduceServiceImpl implements ISltAgreementReduceService } if(list != null){ + sltAgreement.setCreator(SecurityUtils.getUserId().toString()); Long rs = sltAgreementRecudceMapper.insertReduce(sltAgreement); Long id = sltAgreement.getId(); AtomicBoolean addFileInfoResult = new AtomicBoolean(false); @@ -111,6 +114,61 @@ public class SltAgreementReduceServiceImpl implements ISltAgreementReduceService return sltAgreementRecudceMapper.selectByMaModel(sltAgreement); } + @Override + @Transactional(rollbackFor = Exception.class) + public AjaxResult editApply(SltAgreementReduce sltAgreement) { + try { + //先删除详情表和附件表数据 + sltAgreementRecudceMapper.deleteReduceDetail(sltAgreement.getId()); + + List list = sltAgreement.getDetailList(); + // 初始化 SltAgreementReduce 对象 + initSltAgreement(sltAgreement); + + List applyReduction = applyReduction(sltAgreement); + + if (applyReduction.size() > 0 && applyReduction!= null) { + list = applyReduction; + }else{ + list = null; + } + if(list != null){ + Long rs = sltAgreementRecudceMapper.updateReduce(sltAgreement); + Long id = sltAgreement.getId(); + AtomicBoolean addFileInfoResult = new AtomicBoolean(false); + + if(sltAgreement.getBmFileInfos()!=null){ + sltAgreement.getBmFileInfos().forEach(bmFileInfo -> { + bmFileInfo.setModelId(id); + bmFileInfo.setCreateTime(DateUtils.getNowDate()); + addFileInfoResult.set(bmFileInfoMapper.insertBmFileInfo(bmFileInfo) > 0); + }); + + } + if (list != null) { + // 批量插入明细 + List detailList = list.stream() + .peek(detail -> detail.setId(id)) + .collect(Collectors.toList()); + sltAgreementRecudceMapper.insertBatchReduceDetail(detailList); + } + }else{ + //回滚事务 + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return AjaxResult.warn("检索历史申请减免区间数据,已申请减免,请勿在提交申请单!"); + } + return AjaxResult.success(); + } catch (DataAccessException e) { + // 记录详细的数据库操作异常日志 + log.error("数据库操作失败: {}", e.getMessage(), e); + return AjaxResult.error("系统错误, 数据库操作失败"); + } catch (Exception e) { + // 记录其他异常日志 + log.error("系统错误: {}", e.getMessage(), e); + return AjaxResult.error("系统错误, " + e.getMessage()); + } + } + private void initSltAgreement(SltAgreementReduce sltAgreement) { sltAgreement.setCode(generateCode()); sltAgreement.setCreateTime(new Date()); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml index 3405fd9e..b98f7922 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml @@ -33,6 +33,7 @@ + @@ -109,7 +110,7 @@ lai.create_by, lai.create_time, lai.update_by, lai.update_time, lai.remark, lai.company_id, lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url, lai.lease_sign_type, - bai.unit_id,bai.project_id,bu.unit_name, bp.pro_name, bai.agreement_code, tt.task_status as taskStatus, + bai.unit_id,bai.project_id,bu.unit_name, bp.pro_name,bai.agreement_id, bai.agreement_code, tt.task_status as taskStatus, case tt.task_status when 0 then '待审核' when 1 then '待审核' diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/DirectRotationMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/DirectRotationMapper.xml index 18844e68..e1cb54b0 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/DirectRotationMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/DirectRotationMapper.xml @@ -63,6 +63,7 @@ DATE(sai.start_time) as startTime, sai.ma_id as maId, sai.type_id as typeId, + lai.create_time as createTime, sai.* FROM slt_agreement_info sai @@ -77,9 +78,14 @@ and mt.parent_id = #{maId} + + AND DATE_FORMAT(lai.create_time, '%Y-%m-%d' ) BETWEEN #{startDate} AND #{endDate} + and (mt2.type_name like concat('%', #{keyWord}, '%') or - mt.type_name like concat('%', #{keyWord}, '%')) + mt.type_name like concat('%', #{keyWord}, '%') or + mt.ma_code like concat('%', #{keyWord}, '%') + ) GROUP BY sai.ma_id,sai.type_id diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/record/DerateRecordQueryMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/record/DerateRecordQueryMapper.xml index 76dec806..6a12f793 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/record/DerateRecordQueryMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/record/DerateRecordQueryMapper.xml @@ -36,10 +36,10 @@ where 1=1 - AND sra.create_time BETWEEN #{startTime} AND #{endTime} + AND DATE_FORMAT(sra.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} - AND sra.create_time BETWEEN #{startDate} AND #{endDate} + AND DATE_FORMAT(sra.create_time, '%Y-%m-%d' ) BETWEEN #{startDate} AND #{endDate} AND ( @@ -57,6 +57,56 @@ GROUP BY sra.id ORDER BY sra.create_time DESC + + + diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementReduceMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementReduceMapper.xml index 5c38710b..865682f7 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementReduceMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementReduceMapper.xml @@ -30,6 +30,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select id, code, creator, create_time, update_time, status, company_id, cost, remark from slt_reduce_apply + + delete + from slt_reduce_details + where apply_id = #{id}; + delete + from bm_file_info + where model_id = #{id} + +