diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/XzdSubcontract.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/XzdSubcontract.java index f68db242..f6c364c1 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/XzdSubcontract.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/contractManagement/fenbaohetongxinxi/domain/XzdSubcontract.java @@ -20,10 +20,8 @@ import java.time.LocalDateTime; @EqualsAndHashCode(callSuper = true) @TableName("xzd_subcontract") public class XzdSubcontract extends BaseEntity { - @Serial private static final long serialVersionUID = 1L; - /** * */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/costProjectApproval/costBudget/domain/bo/XzdCbysWgcbtbBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/costProjectApproval/costBudget/domain/bo/XzdCbysWgcbtbBo.java index dd54aa6f..c263ebda 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/costProjectApproval/costBudget/domain/bo/XzdCbysWgcbtbBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/costProjectApproval/costBudget/domain/bo/XzdCbysWgcbtbBo.java @@ -27,13 +27,11 @@ public class XzdCbysWgcbtbBo extends BaseEntity { /** * 主键ID,自增 */ - @NotNull(message = "主键ID,自增不能为空", groups = { EditGroup.class }) - private Long id; + private Long id; /** * 单据编码(带*,必填) */ - @NotBlank(message = "单据编码(带*,必填)不能为空", groups = { AddGroup.class, EditGroup.class }) private String docCode; /** diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/costProjectApproval/costBudget/domain/vo/XzdCbysWgcbtbVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/costProjectApproval/costBudget/domain/vo/XzdCbysWgcbtbVo.java index 972aac8f..d6d4a059 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/costProjectApproval/costBudget/domain/vo/XzdCbysWgcbtbVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/costProjectApproval/costBudget/domain/vo/XzdCbysWgcbtbVo.java @@ -1,5 +1,7 @@ package org.dromara.xzd.costProjectApproval.costBudget.domain.vo; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; import org.dromara.xzd.costProjectApproval.costBudget.domain.XzdCbysWgcbtb; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; @@ -68,12 +70,26 @@ public class XzdCbysWgcbtbVo implements Serializable { @ExcelProperty(value = "工程项目") private Long projectId; + /** + * 工程项目名称 + */ + @ExcelProperty(value = "工程项目名称") + private String projectName; + /** * 项目责任人 */ @ExcelProperty(value = "项目责任人") private Long projectLeader; + + /** + * 项目责任人名称 + */ + @ExcelProperty(value = "项目责任人名称") + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "projectLeader") + private String projectLeaderName; + /** * 开工日期 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/costProjectApproval/costBudget/service/impl/XzdCbysWgcbtbServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/costProjectApproval/costBudget/service/impl/XzdCbysWgcbtbServiceImpl.java index bd9538cc..ec90d3c7 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/costProjectApproval/costBudget/service/impl/XzdCbysWgcbtbServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/costProjectApproval/costBudget/service/impl/XzdCbysWgcbtbServiceImpl.java @@ -1,6 +1,7 @@ package org.dromara.xzd.costProjectApproval.costBudget.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.domain.R; import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; @@ -10,7 +11,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; +import org.dromara.common.utils.BatchNumberGenerator; +import org.dromara.system.service.impl.SysOssServiceImpl; +import org.dromara.xzd.costProjectApproval.costBudget.domain.XzdCbysWgcbtbFubiao; import org.dromara.xzd.costProjectApproval.costBudget.service.IXzdCbysWgcbtbFubiaoService; +import org.dromara.xzd.domain.XzdContractDetails; +import org.dromara.xzd.domain.dto.QuerCorrespondentDto; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.TaxInfo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.vo.AppreciationInvoiceVo; +import org.dromara.xzd.service.IXzdProjectService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.dromara.xzd.costProjectApproval.costBudget.domain.bo.XzdCbysWgcbtbBo; @@ -19,9 +28,8 @@ import org.dromara.xzd.costProjectApproval.costBudget.domain.XzdCbysWgcbtb; import org.dromara.xzd.costProjectApproval.costBudget.mapper.XzdCbysWgcbtbMapper; import org.dromara.xzd.costProjectApproval.costBudget.service.IXzdCbysWgcbtbService; -import java.util.List; -import java.util.Map; -import java.util.Collection; +import java.util.*; +import java.util.stream.Collectors; /** * 立项及成本-成本预算-完工成本填报Service业务层处理 @@ -38,6 +46,13 @@ public class XzdCbysWgcbtbServiceImpl extends ServiceImpl vo = List.of(xzdCbysWgcbtbVo); + saveValu(vo); + return vo.getFirst(); } /** @@ -60,9 +78,25 @@ public class XzdCbysWgcbtbServiceImpl extends ServiceImpl queryPageList(XzdCbysWgcbtbBo bo, PageQuery pageQuery) { LambdaQueryWrapper lqw = buildQueryWrapper(bo); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + saveValu(result.getRecords()); return TableDataInfo.build(result); } + private void saveValu(List records) { + for (XzdCbysWgcbtbVo item : records) { + //项目名称 + if (item.getProjectId() != null){ + String projectName = xzdProjectService.queryNameById(item.getProjectId()); + if (projectName != null){ + item.setProjectName(projectName); + } + } + + + } + + } + /** * 查询符合条件的立项及成本-成本预算-完工成本填报列表 * @@ -107,6 +141,8 @@ public class XzdCbysWgcbtbServiceImpl extends ServiceImpl 0; if (flag) { bo.setId(add.getId()); @@ -129,6 +165,16 @@ public class XzdCbysWgcbtbServiceImpl extends ServiceImpl hashMap = new HashMap<>(); + hashMap.put("main_doc_id", update.getId()); + fubiaoService.getBaseMapper().deleteByMap(hashMap); + bo.getXzdCbysWgcbtbFubiao().forEach(item -> {item.setMainDocId(update.getId());}); + fubiaoService.saveBatch(bo.getXzdCbysWgcbtbFubiao()); + return baseMapper.updateById(update) > 0; } @@ -151,6 +197,17 @@ public class XzdCbysWgcbtbServiceImpl extends ServiceImpl collect = Arrays.stream(vo.getFileId().split(",")).map(item -> { + return Long.parseLong(item); + }).collect(Collectors.toList()); + sysOssService.deleteWithValidByIds(collect, false); + } + } + fubiaoService.getBaseMapper().delete(new LambdaQueryWrapper().in(XzdCbysWgcbtbFubiao::getMainDocId, ids)); return baseMapper.deleteByIds(ids) > 0; } } diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/controller/AppreciationInvoiceController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/controller/AppreciationInvoiceController.java new file mode 100644 index 00000000..c9d1b9c1 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/controller/AppreciationInvoiceController.java @@ -0,0 +1,105 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.vo.AppreciationInvoiceVo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.bo.AppreciationInvoiceBo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.service.IAppreciationInvoiceService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 增值税发票 + * + * @author Lion Li + * @date 2025-10-17 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/zengzhishui/invoice") +public class AppreciationInvoiceController extends BaseController { + + private final IAppreciationInvoiceService appreciationInvoiceService; + + /** + * 查询增值税发票列表 + */ + @SaCheckPermission("zengzhishui:invoice:list") + @GetMapping("/list") + public TableDataInfo list(AppreciationInvoiceBo bo, PageQuery pageQuery) { + return appreciationInvoiceService.queryPageList(bo, pageQuery); + } + + /** + * 导出增值税发票列表 + */ + @SaCheckPermission("zengzhishui:invoice:export") + @Log(title = "增值税发票", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(AppreciationInvoiceBo bo, HttpServletResponse response) { + List list = appreciationInvoiceService.queryList(bo); + ExcelUtil.exportExcel(list, "增值税发票", AppreciationInvoiceVo.class, response); + } + + /** + * 获取增值税发票详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("zengzhishui:invoice:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(appreciationInvoiceService.queryById(id)); + } + + /** + * 新增增值税发票 + */ + @SaCheckPermission("zengzhishui:invoice:add") + @Log(title = "增值税发票", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody AppreciationInvoiceBo bo) { + return toAjax(appreciationInvoiceService.insertByBo(bo)); + } + + /** + * 修改增值税发票 + */ + @SaCheckPermission("zengzhishui:invoice:edit") + @Log(title = "增值税发票", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody AppreciationInvoiceBo bo) { + return toAjax(appreciationInvoiceService.updateByBo(bo)); + } + + /** + * 删除增值税发票 + * + * @param ids 主键串 + */ + @SaCheckPermission("zengzhishui:invoice:remove") + @Log(title = "增值税发票", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(appreciationInvoiceService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/controller/TaxInfoController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/controller/TaxInfoController.java new file mode 100644 index 00000000..6f86b9f2 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/controller/TaxInfoController.java @@ -0,0 +1,105 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.vo.TaxInfoVo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.bo.TaxInfoBo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.service.ITaxInfoService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 征税项目 + * + * @author Lion Li + * @date 2025-10-17 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/zengzhishui/info") +public class TaxInfoController extends BaseController { + + private final ITaxInfoService taxInfoService; + + /** + * 查询征税项目列表 + */ + @SaCheckPermission("zengzhishui:info:list") + @GetMapping("/list") + public TableDataInfo list(TaxInfoBo bo, PageQuery pageQuery) { + return taxInfoService.queryPageList(bo, pageQuery); + } + + /** + * 导出征税项目列表 + */ + @SaCheckPermission("zengzhishui:info:export") + @Log(title = "征税项目", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(TaxInfoBo bo, HttpServletResponse response) { + List list = taxInfoService.queryList(bo); + ExcelUtil.exportExcel(list, "征税项目", TaxInfoVo.class, response); + } + + /** + * 获取征税项目详细信息 + * + * @param levyCode 主键 + */ + @SaCheckPermission("zengzhishui:info:query") + @GetMapping("/{levyCode}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable String levyCode) { + return R.ok(taxInfoService.queryById(levyCode)); + } + + /** + * 新增征税项目 + */ + @SaCheckPermission("zengzhishui:info:add") + @Log(title = "征税项目", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody TaxInfoBo bo) { + return toAjax(taxInfoService.insertByBo(bo)); + } + + /** + * 修改征税项目 + */ + @SaCheckPermission("zengzhishui:info:edit") + @Log(title = "征税项目", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody TaxInfoBo bo) { + return toAjax(taxInfoService.updateByBo(bo)); + } + + /** + * 删除征税项目 + * + * @param levyCodes 主键串 + */ + @SaCheckPermission("zengzhishui:info:remove") + @Log(title = "征税项目", businessType = BusinessType.DELETE) + @DeleteMapping("/{levyCodes}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable String[] levyCodes) { + return toAjax(taxInfoService.deleteWithValidByIds(List.of(levyCodes), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/AppreciationInvoice.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/AppreciationInvoice.java new file mode 100644 index 00000000..46703fed --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/AppreciationInvoice.java @@ -0,0 +1,210 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serial; + +/** + * 增值税发票对象 appreciation_invoice + * + * @author Lion Li + * @date 2025-10-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("appreciation_invoice") +public class AppreciationInvoice extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @TableId(value = "id") + private Long id; + + /** + * 发票类型 + */ + private String invoiceType; + + /** + * 项目 + */ + private Long project; + + /** + * 合同号 承包合同 + */ + private Long contractNo; + + /** + * 录入日期 + */ + private LocalDate entryDate; + + /** + * 年度 + */ + private Long year; + + /** + * 会计期 + */ + private Long accountingPeriod; + + /** + * 销项类型 + */ + private String taxType; + + /** + * 征税项目 + */ + private Long taxItem; + + /** + * 所属组织 + */ + private Long organization; + + /** + * 经办人 + */ + private Long handler; + + /** + * 发票用途 + */ + private String invoicePurpose; + + /** + * 发票代码 + */ + private String invoiceCode; + + /** + * 发票号码 + */ + private String invoiceNo; + + /** + * 开票日期 + */ + private LocalDate invoiceDate; + + /** + * 公司税号 + */ + private String companyTaxNo; + + /** + * 公司名称 + */ + private String companyName; + + /** + * 金额 + */ + private BigDecimal amount; + + /** + * 税额 + */ + private BigDecimal taxAmount; + + /** + * 税率 + */ + private BigDecimal taxRate; + + /** + * 价税合计 + */ + private BigDecimal totalAmount; + + /** + * 购方税号 + */ + private String buyerTaxNo; + + /** + * 购方名称 + */ + private Long buyerName; + + /** + * 购方纳税人名称 + */ + private String buyerTaxpayerName; + + /** + * 跨区涉税报告 + */ + private String crossTaxReport; + + /** + * 3%征收率减按2%征收标识(0为否,1为是) + */ + private Long percentageCharges; + + /** + * 减征额 + */ + private BigDecimal deductionAmount; + + /** + * 拆分标志 + */ + private String splitFlag; + + /** + * 校验码 + */ + private String checkCode; + + /** + * 机器编码 + */ + private String machineCode; + + /** + * 备注信息1 + */ + private String remark1; + + /** + * 备注信息2 + */ + private String remark2; + + /** + * 数电票号码 + */ + private String electronicInvoiceNo; + + /** + * 文件ID + */ + private String fileId; + + /** + * 备注 + */ + private String remark; + + /** + * 审核状态 + */ + private String auditStatus; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/TaxInfo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/TaxInfo.java new file mode 100644 index 00000000..c96e2227 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/TaxInfo.java @@ -0,0 +1,44 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 征税项目对象 tax_info + * + * @author Lion Li + * @date 2025-10-17 + */ +@Data +@TableName("tax_info") +public class TaxInfo { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 征收编码 + */ + private String levyCode; + + /** + * 征收方式 + */ + private String levyMethod; + + /** + * 征税项目 + */ + private String taxItem; + + /** + * 税率 + */ + private String taxRate; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/bo/AppreciationInvoiceBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/bo/AppreciationInvoiceBo.java new file mode 100644 index 00000000..c900ba7e --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/bo/AppreciationInvoiceBo.java @@ -0,0 +1,209 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.bo; + +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.AppreciationInvoice; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * 增值税发票业务对象 appreciation_invoice + * + * @author Lion Li + * @date 2025-10-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = AppreciationInvoice.class, reverseConvertGenerate = false) +public class AppreciationInvoiceBo extends BaseEntity { + + /** + * 主键ID + */ + @NotNull(message = "主键ID不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 发票类型 + */ + private String invoiceType; + + /** + * 项目 + */ + private Long project; + + /** + * 合同号 承包合同 + */ + private Long contractNo; + + /** + * 录入日期 + */ + private LocalDate entryDate; + + /** + * 年度 + */ + private Long year; + + /** + * 会计期 + */ + private Long accountingPeriod; + + /** + * 销项类型 + */ + private String taxType; + + /** + * 征税项目 + */ + private Long taxItem; + + /** + * 所属组织 + */ + private Long organization; + + /** + * 经办人 + */ + private Long handler; + + /** + * 发票用途 + */ + private String invoicePurpose; + + /** + * 发票代码 + */ + private String invoiceCode; + + /** + * 发票号码 + */ + private String invoiceNo; + + /** + * 开票日期 + */ + private LocalDate invoiceDate; + + /** + * 公司税号 + */ + private String companyTaxNo; + + /** + * 公司名称 + */ + private String companyName; + + /** + * 金额 + */ + private BigDecimal amount; + + /** + * 税额 + */ + private BigDecimal taxAmount; + + /** + * 税率 + */ + private BigDecimal taxRate; + + /** + * 价税合计 + */ + private BigDecimal totalAmount; + + /** + * 购方税号 + */ + private String buyerTaxNo; + + /** + * 购方名称 + */ + private Long buyerName; + + /** + * 购方纳税人名称 + */ + private String buyerTaxpayerName; + + /** + * 跨区涉税报告 + */ + private String crossTaxReport; + + /** + * 3%征收率减按2%征收标识(0为否,1为是) + */ + private Long percentageCharges; + + /** + * 减征额 + */ + private BigDecimal deductionAmount; + + /** + * 拆分标志 + */ + private String splitFlag; + + /** + * 校验码 + */ + private String checkCode; + + /** + * 机器编码 + */ + private String machineCode; + + /** + * 备注信息1 + */ + private String remark1; + + /** + * 备注信息2 + */ + private String remark2; + + /** + * 数电票号码 + */ + private String electronicInvoiceNo; + + /** + * 文件ID + */ + private String fileId; + + /** + * 备注 + */ + private String remark; + + /** + * 审核状态 + */ + private String auditStatus; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/bo/TaxInfoBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/bo/TaxInfoBo.java new file mode 100644 index 00000000..3e55dc6a --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/bo/TaxInfoBo.java @@ -0,0 +1,43 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.bo; + +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.TaxInfo; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +/** + * 征税项目业务对象 tax_info + * + * @author Lion Li + * @date 2025-10-17 + */ +@Data +@AutoMapper(target = TaxInfo.class, reverseConvertGenerate = false) +public class TaxInfoBo { + + /** + * 征收编码 + */ + private String levyCode; + + /** + * 征收方式 + */ + private String levyMethod; + + /** + * 征税项目 + */ + private String taxItem; + + /** + * 税率 + */ + private String taxRate; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/vo/AppreciationInvoiceVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/vo/AppreciationInvoiceVo.java new file mode 100644 index 00000000..ecfae9bc --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/vo/AppreciationInvoiceVo.java @@ -0,0 +1,295 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.vo; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.AppreciationInvoice; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 增值税发票视图对象 appreciation_invoice + * + * @author Lion Li + * @date 2025-10-17 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = AppreciationInvoice.class) +public class AppreciationInvoiceVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + @ExcelProperty(value = "主键ID") + private Long id; + + /** + * 发票类型 + */ + @ExcelProperty(value = "发票类型") + private String invoiceType; + + /** + * 项目 + */ + @ExcelProperty(value = "项目") + private Long project; + + /** + * 项目名称 + */ + @ExcelProperty(value = "项目名称") + private String projectName; + + /** + * 合同号 承包合同 + */ + @ExcelProperty(value = "合同号 承包合同") + private Long contractNo; + + + /** + * 合同号 承包合同编码 + */ + @ExcelProperty(value = "合同号 承包合同编码") + private String contractNoName; + + /** + * 录入日期 + */ + @ExcelProperty(value = "录入日期") + private LocalDate entryDate; + + /** + * 年度 + */ + @ExcelProperty(value = "年度") + private Long year; + + /** + * 会计期 + */ + @ExcelProperty(value = "会计期") + private Long accountingPeriod; + + /** + * 销项类型 + */ + @ExcelProperty(value = "销项类型") + private String taxType; + + /** + * 征税项目 + */ + @ExcelProperty(value = "征税项目") + private Long taxItem; + + /** + * 征税项目名称 + */ + @ExcelProperty(value = "征税项目名称") + private String taxItemName; + + /** + * 所属组织 + */ + @ExcelProperty(value = "所属组织") + private Long organization; + + /** + * 所属组织名称 + */ + @ExcelProperty(value = "所属组织名称") + @Translation(type = TransConstant.DEPT_ID_TO_NAME, mapper = "organization") + private String organizationName; + + /** + * 经办人 + */ + @ExcelProperty(value = "经办人") + private Long handler; + + /** + * 经办人名称 + */ + @ExcelProperty(value = "经办人名称") + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "handler") + private String handlerNme; + + /** + * 发票用途 + */ + @ExcelProperty(value = "发票用途") + private String invoicePurpose; + + /** + * 发票代码 + */ + @ExcelProperty(value = "发票代码") + private String invoiceCode; + + /** + * 发票号码 + */ + @ExcelProperty(value = "发票号码") + private String invoiceNo; + + /** + * 开票日期 + */ + @ExcelProperty(value = "开票日期") + private LocalDate invoiceDate; + + /** + * 公司税号 + */ + @ExcelProperty(value = "公司税号") + private String companyTaxNo; + + /** + * 公司名称 + */ + @ExcelProperty(value = "公司名称") + private String companyName; + + /** + * 金额 + */ + @ExcelProperty(value = "金额") + private BigDecimal amount; + + /** + * 税额 + */ + @ExcelProperty(value = "税额") + private BigDecimal taxAmount; + + /** + * 税率 + */ + @ExcelProperty(value = "税率") + private BigDecimal taxRate; + + /** + * 价税合计 + */ + @ExcelProperty(value = "价税合计") + private BigDecimal totalAmount; + + /** + * 购方税号 + */ + @ExcelProperty(value = "购方税号") + private String buyerTaxNo; + + /** + * 购方名称(客户id) + */ + @ExcelProperty(value = "购方名称 id") + private Long buyerName; + + /** + * 购方名称 + */ + @ExcelProperty(value = "购方名称") + private String buyerNameS; + + + /** + * 购方纳税人名称 + */ + @ExcelProperty(value = "购方纳税人名称") + private String buyerTaxpayerName; + + /** + * 跨区涉税报告 + */ + @ExcelProperty(value = "跨区涉税报告") + private String crossTaxReport; + + /** + * 3%征收率减按2%征收标识(0为否,1为是) + */ + @ExcelProperty(value = "3%征收率减按2%征收标识", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=为否,1为是") + private Long percentageCharges; + + /** + * 减征额 + */ + @ExcelProperty(value = "减征额") + private BigDecimal deductionAmount; + + /** + * 拆分标志 + */ + @ExcelProperty(value = "拆分标志") + private String splitFlag; + + /** + * 校验码 + */ + @ExcelProperty(value = "校验码") + private String checkCode; + + /** + * 机器编码 + */ + @ExcelProperty(value = "机器编码") + private String machineCode; + + /** + * 备注信息1 + */ + @ExcelProperty(value = "备注信息1") + private String remark1; + + /** + * 备注信息2 + */ + @ExcelProperty(value = "备注信息2") + private String remark2; + + /** + * 数电票号码 + */ + @ExcelProperty(value = "数电票号码") + private String electronicInvoiceNo; + + /** + * 文件ID + */ + @ExcelProperty(value = "文件ID") + private String fileId; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 审核状态 + */ + @ExcelProperty(value = "审核状态") + private String auditStatus; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/vo/TaxInfoVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/vo/TaxInfoVo.java new file mode 100644 index 00000000..618da1b0 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/domain/vo/TaxInfoVo.java @@ -0,0 +1,56 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.vo; + +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.TaxInfo; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 征税项目视图对象 tax_info + * + * @author Lion Li + * @date 2025-10-17 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = TaxInfo.class) +public class TaxInfoVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 征收编码 + */ + @ExcelProperty(value = "征收编码") + private String levyCode; + + /** + * 征收方式 + */ + @ExcelProperty(value = "征收方式") + private String levyMethod; + + /** + * 征税项目 + */ + @ExcelProperty(value = "征税项目") + private String taxItem; + + /** + * 税率 + */ + @ExcelProperty(value = "税率") + private String taxRate; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/mapper/AppreciationInvoiceMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/mapper/AppreciationInvoiceMapper.java new file mode 100644 index 00000000..99eb1a36 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/mapper/AppreciationInvoiceMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.mapper; + +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.AppreciationInvoice; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.vo.AppreciationInvoiceVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 增值税发票Mapper接口 + * + * @author Lion Li + * @date 2025-10-17 + */ +public interface AppreciationInvoiceMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/mapper/TaxInfoMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/mapper/TaxInfoMapper.java new file mode 100644 index 00000000..fb1adf9b --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/mapper/TaxInfoMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.mapper; + +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.TaxInfo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.vo.TaxInfoVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 征税项目Mapper接口 + * + * @author Lion Li + * @date 2025-10-17 + */ +public interface TaxInfoMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/service/IAppreciationInvoiceService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/service/IAppreciationInvoiceService.java new file mode 100644 index 00000000..0936cab8 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/service/IAppreciationInvoiceService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.service; + +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.vo.AppreciationInvoiceVo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.bo.AppreciationInvoiceBo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.AppreciationInvoice; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 增值税发票Service接口 + * + * @author Lion Li + * @date 2025-10-17 + */ +public interface IAppreciationInvoiceService extends IService{ + + /** + * 查询增值税发票 + * + * @param id 主键 + * @return 增值税发票 + */ + AppreciationInvoiceVo queryById(Long id); + + /** + * 分页查询增值税发票列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 增值税发票分页列表 + */ + TableDataInfo queryPageList(AppreciationInvoiceBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的增值税发票列表 + * + * @param bo 查询条件 + * @return 增值税发票列表 + */ + List queryList(AppreciationInvoiceBo bo); + + /** + * 新增增值税发票 + * + * @param bo 增值税发票 + * @return 是否新增成功 + */ + Boolean insertByBo(AppreciationInvoiceBo bo); + + /** + * 修改增值税发票 + * + * @param bo 增值税发票 + * @return 是否修改成功 + */ + Boolean updateByBo(AppreciationInvoiceBo bo); + + /** + * 校验并批量删除增值税发票信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/service/ITaxInfoService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/service/ITaxInfoService.java new file mode 100644 index 00000000..aef1cca9 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/service/ITaxInfoService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.service; + +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.vo.TaxInfoVo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.bo.TaxInfoBo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.TaxInfo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 征税项目Service接口 + * + * @author Lion Li + * @date 2025-10-17 + */ +public interface ITaxInfoService extends IService{ + + /** + * 查询征税项目 + * + * @param levyCode 主键 + * @return 征税项目 + */ + TaxInfoVo queryById(String levyCode); + + /** + * 分页查询征税项目列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 征税项目分页列表 + */ + TableDataInfo queryPageList(TaxInfoBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的征税项目列表 + * + * @param bo 查询条件 + * @return 征税项目列表 + */ + List queryList(TaxInfoBo bo); + + /** + * 新增征税项目 + * + * @param bo 征税项目 + * @return 是否新增成功 + */ + Boolean insertByBo(TaxInfoBo bo); + + /** + * 修改征税项目 + * + * @param bo 征税项目 + * @return 是否修改成功 + */ + Boolean updateByBo(TaxInfoBo bo); + + /** + * 校验并批量删除征税项目信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/service/impl/AppreciationInvoiceServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/service/impl/AppreciationInvoiceServiceImpl.java new file mode 100644 index 00000000..989816b5 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/service/impl/AppreciationInvoiceServiceImpl.java @@ -0,0 +1,237 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.dromara.system.service.impl.SysOssServiceImpl; +import org.dromara.xzd.contractManagement.fenbaohetongxinxi.domain.vo.XzdSubcontractVo; +import org.dromara.xzd.contractManagement.fenbaohetongzhongzhi.domain.vo.XzdSubcontractTerminationVo; +import org.dromara.xzd.domain.*; +import org.dromara.xzd.domain.dto.QuerCorrespondentDto; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.TaxInfo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.vo.TaxInfoVo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.service.ITaxInfoService; +import org.dromara.xzd.service.IXzdContractDetailsService; +import org.dromara.xzd.service.IXzdCorrespondentList; +import org.dromara.xzd.service.IXzdProjectService; +import org.dromara.xzd.service.impl.XzdProjectServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.bo.AppreciationInvoiceBo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.vo.AppreciationInvoiceVo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.AppreciationInvoice; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.mapper.AppreciationInvoiceMapper; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.service.IAppreciationInvoiceService; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 增值税发票Service业务层处理 + * + * @author Lion Li + * @date 2025-10-17 + */ +@RequiredArgsConstructor +@Service +public class AppreciationInvoiceServiceImpl extends ServiceImpl implements IAppreciationInvoiceService { + + private final AppreciationInvoiceMapper baseMapper; + + + private final IXzdProjectService xzdProjectService; + + private final IXzdContractDetailsService xzdContractDetailsService; + private final ITaxInfoService iTaxInfoService; + + @Autowired + private IXzdCorrespondentList iXzdCorrespondentList; + + @Autowired + private SysOssServiceImpl sysOssService; + + /** + * 查询增值税发票 + * + * @param id 主键 + * @return 增值税发票 + */ + @Override + public AppreciationInvoiceVo queryById(Long id){ + AppreciationInvoiceVo appreciationInvoiceVo = baseMapper.selectVoById(id); + List vo = List.of(appreciationInvoiceVo); + saveValue(vo); + + return vo.getFirst(); + } + + /** + * 分页查询增值税发票列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 增值税发票分页列表 + */ + @Override + public TableDataInfo queryPageList(AppreciationInvoiceBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + saveValue(result.getRecords()); + return TableDataInfo.build(result); + } + + private void saveValue(List records) { + for (AppreciationInvoiceVo item : records) { + //项目名称 + if (item.getProject() != null){ + String projectName = xzdProjectService.queryNameById(item.getProject()); + if (projectName != null){ + item.setProjectName(projectName); + } + } + // 合同 + XzdContractDetails contractDetailsServiceById = xzdContractDetailsService.getById(item.getContractNo()); + if(contractDetailsServiceById != null){ + item.setContractNoName(contractDetailsServiceById.getContractName()); + } +// 征税项目 + TaxInfo taxInfoVo = iTaxInfoService.getBaseMapper().selectOne(new LambdaQueryWrapper().eq(TaxInfo::getLevyCode, item.getTaxItem())); + if (taxInfoVo != null){ + item.setTaxItemName(taxInfoVo.getTaxItem()); + } + //购方名称(客户信息列表) + R byid = iXzdCorrespondentList.getCustomerByid(item.getBuyerName()); + if (byid!=null){ + if (byid.getData().getXzdCustomerinformation() != null){ + item.setBuyerNameS(byid.getData().getXzdCustomerinformation().getUnitName()); + } + } + + } + + + } + + /** + * 查询符合条件的增值税发票列表 + * + * @param bo 查询条件 + * @return 增值税发票列表 + */ + @Override + public List queryList(AppreciationInvoiceBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(AppreciationInvoiceBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(AppreciationInvoice::getId); + lqw.eq(StringUtils.isNotBlank(bo.getInvoiceType()), AppreciationInvoice::getInvoiceType, bo.getInvoiceType()); + lqw.eq(bo.getProject() != null, AppreciationInvoice::getProject, bo.getProject()); + lqw.eq(bo.getContractNo() != null, AppreciationInvoice::getContractNo, bo.getContractNo()); + lqw.eq(bo.getEntryDate() != null, AppreciationInvoice::getEntryDate, bo.getEntryDate()); + lqw.eq(bo.getYear() != null, AppreciationInvoice::getYear, bo.getYear()); + lqw.eq(bo.getAccountingPeriod() != null, AppreciationInvoice::getAccountingPeriod, bo.getAccountingPeriod()); + lqw.eq(StringUtils.isNotBlank(bo.getTaxType()), AppreciationInvoice::getTaxType, bo.getTaxType()); + lqw.eq(bo.getTaxItem() != null, AppreciationInvoice::getTaxItem, bo.getTaxItem()); + lqw.eq(bo.getOrganization() != null, AppreciationInvoice::getOrganization, bo.getOrganization()); + lqw.eq(bo.getHandler() != null, AppreciationInvoice::getHandler, bo.getHandler()); + lqw.eq(StringUtils.isNotBlank(bo.getInvoicePurpose()), AppreciationInvoice::getInvoicePurpose, bo.getInvoicePurpose()); + lqw.eq(StringUtils.isNotBlank(bo.getInvoiceCode()), AppreciationInvoice::getInvoiceCode, bo.getInvoiceCode()); + lqw.eq(StringUtils.isNotBlank(bo.getInvoiceNo()), AppreciationInvoice::getInvoiceNo, bo.getInvoiceNo()); + lqw.eq(bo.getInvoiceDate() != null, AppreciationInvoice::getInvoiceDate, bo.getInvoiceDate()); + lqw.eq(StringUtils.isNotBlank(bo.getCompanyTaxNo()), AppreciationInvoice::getCompanyTaxNo, bo.getCompanyTaxNo()); + lqw.like(StringUtils.isNotBlank(bo.getCompanyName()), AppreciationInvoice::getCompanyName, bo.getCompanyName()); + lqw.eq(bo.getAmount() != null, AppreciationInvoice::getAmount, bo.getAmount()); + lqw.eq(bo.getTaxAmount() != null, AppreciationInvoice::getTaxAmount, bo.getTaxAmount()); + lqw.eq(bo.getTaxRate() != null, AppreciationInvoice::getTaxRate, bo.getTaxRate()); + lqw.eq(bo.getTotalAmount() != null, AppreciationInvoice::getTotalAmount, bo.getTotalAmount()); + lqw.eq(StringUtils.isNotBlank(bo.getBuyerTaxNo()), AppreciationInvoice::getBuyerTaxNo, bo.getBuyerTaxNo()); + lqw.like(bo.getBuyerName() != null, AppreciationInvoice::getBuyerName, bo.getBuyerName()); + lqw.like(StringUtils.isNotBlank(bo.getBuyerTaxpayerName()), AppreciationInvoice::getBuyerTaxpayerName, bo.getBuyerTaxpayerName()); + lqw.eq(StringUtils.isNotBlank(bo.getCrossTaxReport()), AppreciationInvoice::getCrossTaxReport, bo.getCrossTaxReport()); + lqw.eq(bo.getPercentageCharges() != null, AppreciationInvoice::getPercentageCharges, bo.getPercentageCharges()); + lqw.eq(bo.getDeductionAmount() != null, AppreciationInvoice::getDeductionAmount, bo.getDeductionAmount()); + lqw.eq(StringUtils.isNotBlank(bo.getSplitFlag()), AppreciationInvoice::getSplitFlag, bo.getSplitFlag()); + lqw.eq(StringUtils.isNotBlank(bo.getCheckCode()), AppreciationInvoice::getCheckCode, bo.getCheckCode()); + lqw.eq(StringUtils.isNotBlank(bo.getMachineCode()), AppreciationInvoice::getMachineCode, bo.getMachineCode()); + lqw.eq(StringUtils.isNotBlank(bo.getRemark1()), AppreciationInvoice::getRemark1, bo.getRemark1()); + lqw.eq(StringUtils.isNotBlank(bo.getRemark2()), AppreciationInvoice::getRemark2, bo.getRemark2()); + lqw.eq(StringUtils.isNotBlank(bo.getElectronicInvoiceNo()), AppreciationInvoice::getElectronicInvoiceNo, bo.getElectronicInvoiceNo()); + lqw.eq(StringUtils.isNotBlank(bo.getFileId()), AppreciationInvoice::getFileId, bo.getFileId()); + lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), AppreciationInvoice::getAuditStatus, bo.getAuditStatus()); + return lqw; + } + + /** + * 新增增值税发票 + * + * @param bo 增值税发票 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(AppreciationInvoiceBo bo) { + AppreciationInvoice add = MapstructUtils.convert(bo, AppreciationInvoice.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改增值税发票 + * + * @param bo 增值税发票 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(AppreciationInvoiceBo bo) { + AppreciationInvoice update = MapstructUtils.convert(bo, AppreciationInvoice.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(AppreciationInvoice entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除增值税发票信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + + } + + for (Long id : ids) { + AppreciationInvoiceVo vo = baseMapper.selectVoById(id); + // 删除附件 + if (!StringUtils.isEmpty(vo.getFileId())){ + List collect = Arrays.stream(vo.getFileId().split(",")).map(item -> { + return Long.parseLong(item); + }).collect(Collectors.toList()); + sysOssService.deleteWithValidByIds(collect, false); + } + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/service/impl/TaxInfoServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/service/impl/TaxInfoServiceImpl.java new file mode 100644 index 00000000..1c28140b --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/fapiaotaizhang/zengzhishui/service/impl/TaxInfoServiceImpl.java @@ -0,0 +1,132 @@ +package org.dromara.xzd.fapiaotaizhang.zengzhishui.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.bo.TaxInfoBo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.vo.TaxInfoVo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.domain.TaxInfo; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.mapper.TaxInfoMapper; +import org.dromara.xzd.fapiaotaizhang.zengzhishui.service.ITaxInfoService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 征税项目Service业务层处理 + * + * @author Lion Li + * @date 2025-10-17 + */ +@RequiredArgsConstructor +@Service +public class TaxInfoServiceImpl extends ServiceImpl implements ITaxInfoService { + + private final TaxInfoMapper baseMapper; + + /** + * 查询征税项目 + * + * @param levyCode 主键 + * @return 征税项目 + */ + @Override + public TaxInfoVo queryById(String levyCode){ + return baseMapper.selectVoById(levyCode); + } + + /** + * 分页查询征税项目列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 征税项目分页列表 + */ + @Override + public TableDataInfo queryPageList(TaxInfoBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的征税项目列表 + * + * @param bo 查询条件 + * @return 征税项目列表 + */ + @Override + public List queryList(TaxInfoBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(TaxInfoBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getLevyCode()), TaxInfo::getLevyCode, bo.getLevyCode()); + lqw.eq(StringUtils.isNotBlank(bo.getLevyMethod()), TaxInfo::getLevyMethod, bo.getLevyMethod()); + lqw.eq(StringUtils.isNotBlank(bo.getTaxItem()), TaxInfo::getTaxItem, bo.getTaxItem()); + lqw.eq(StringUtils.isNotBlank(bo.getTaxRate()), TaxInfo::getTaxRate, bo.getTaxRate()); + return lqw; + } + + /** + * 新增征税项目 + * + * @param bo 征税项目 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(TaxInfoBo bo) { + TaxInfo add = MapstructUtils.convert(bo, TaxInfo.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setLevyCode(add.getLevyCode()); + } + return flag; + } + + /** + * 修改征税项目 + * + * @param bo 征税项目 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(TaxInfoBo bo) { + TaxInfo update = MapstructUtils.convert(bo, TaxInfo.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(TaxInfo entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除征税项目信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/SettlementOfSubcontractingCompletion.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/SettlementOfSubcontractingCompletion.java index c212904b..412d872b 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/SettlementOfSubcontractingCompletion.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/SettlementOfSubcontractingCompletion.java @@ -67,7 +67,7 @@ public class SettlementOfSubcontractingCompletion extends BaseEntity { /** * 工程项目 */ - private String engineeringProject; + private Long engineeringProject; /** * 经营模式 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/bo/SettlementOfSubcontractingCompletionBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/bo/SettlementOfSubcontractingCompletionBo.java index d4e13f9c..71f5ce9f 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/bo/SettlementOfSubcontractingCompletionBo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/bo/SettlementOfSubcontractingCompletionBo.java @@ -25,13 +25,11 @@ public class SettlementOfSubcontractingCompletionBo extends BaseEntity { /** * 主键ID */ - @NotNull(message = "主键ID不能为空", groups = { EditGroup.class }) private Long id; /** * 单据编号 */ - @NotBlank(message = "单据编号不能为空", groups = { AddGroup.class, EditGroup.class }) private String documentCode; /** @@ -69,7 +67,7 @@ public class SettlementOfSubcontractingCompletionBo extends BaseEntity { /** * 工程项目 */ - private String engineeringProject; + private Long engineeringProject; /** * 经营模式 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/vo/SettlementOfSubcontractingCompletionVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/vo/SettlementOfSubcontractingCompletionVo.java index 834f9460..fa2f84b5 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/vo/SettlementOfSubcontractingCompletionVo.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/domain/vo/SettlementOfSubcontractingCompletionVo.java @@ -82,7 +82,13 @@ public class SettlementOfSubcontractingCompletionVo implements Serializable { * 工程项目 */ @ExcelProperty(value = "工程项目") - private String engineeringProject; + private Long engineeringProject; + + /** + * 工程项目名称 + */ + @ExcelProperty(value = "工程项目名称") + private String engineeringProjectName; /** * 经营模式 diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/service/impl/SettlementOfSubcontractingCompletionServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/service/impl/SettlementOfSubcontractingCompletionServiceImpl.java index 13388e97..ab3879f7 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/service/impl/SettlementOfSubcontractingCompletionServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/settlement/fenbaohetongjungong/service/impl/SettlementOfSubcontractingCompletionServiceImpl.java @@ -103,13 +103,13 @@ public class SettlementOfSubcontractingCompletionServiceImpl extends ServiceImpl private void setValue(List records) { for (SettlementOfSubcontractingCompletionVo item : records) { -// //项目名称 -// if (item.getProject() != null){ -// String projectName = xzdProjectService.queryNameById(item.getProject()); -// if (projectName != null){ -// item.setProjectName(projectName); -// } -// } + //项目名称 + if (item.getEngineeringProject() != null){ + String projectName = xzdProjectService.queryNameById(item.getEngineeringProject()); + if (projectName != null){ + item.setEngineeringProjectName(projectName); + } + } //甲方单位(客户信息列表) R byid = iXzdCorrespondentList.getCustomerByid(item.getPartyAUnit()); if (byid!=null){ @@ -194,7 +194,7 @@ public class SettlementOfSubcontractingCompletionServiceImpl extends ServiceImpl lqw.like(StringUtils.isNotBlank(bo.getContractName()), SettlementOfSubcontractingCompletion::getContractName, bo.getContractName()); lqw.eq(bo.getApprovedTotalPrice() != null, SettlementOfSubcontractingCompletion::getApprovedTotalPrice, bo.getApprovedTotalPrice()); lqw.eq(bo.getApprovedDate() != null, SettlementOfSubcontractingCompletion::getApprovedDate, bo.getApprovedDate()); - lqw.eq(StringUtils.isNotBlank(bo.getEngineeringProject()), SettlementOfSubcontractingCompletion::getEngineeringProject, bo.getEngineeringProject()); + lqw.eq(bo.getEngineeringProject() != null, SettlementOfSubcontractingCompletion::getEngineeringProject, bo.getEngineeringProject()); lqw.eq(StringUtils.isNotBlank(bo.getBusinessModel()), SettlementOfSubcontractingCompletion::getBusinessModel, bo.getBusinessModel()); lqw.eq(bo.getPartyAUnit() != null, SettlementOfSubcontractingCompletion::getPartyAUnit, bo.getPartyAUnit()); lqw.eq(bo.getPartyBUnit() != null, SettlementOfSubcontractingCompletion::getPartyBUnit, bo.getPartyBUnit()); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/controller/CbsTreeStructureController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/controller/CbsTreeStructureController.java new file mode 100644 index 00000000..8f72201e --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/controller/CbsTreeStructureController.java @@ -0,0 +1,106 @@ +package org.dromara.xzd.zijinjihua.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.dromara.xzd.zijinjihua.domain.bo.CbsTreeStructureBo; +import org.dromara.xzd.zijinjihua.domain.vo.CbsTreeStructureVo; +import org.dromara.xzd.zijinjihua.service.ICbsTreeStructureService; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; + + +/** + * cbs树形结构 + * + * @author Lion Li + * @date 2025-10-16 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/system/treeStructure") +public class CbsTreeStructureController extends BaseController { + + private final ICbsTreeStructureService cbsTreeStructureService; + + /** + * 查询cbs树形结构列表 + */ + @SaCheckPermission("system:treeStructure:list") + @GetMapping("/list") + public R> list(CbsTreeStructureBo bo) { + List list = cbsTreeStructureService.queryList(bo); + return R.ok(list); + } + + /** + * 导出cbs树形结构列表 + */ + @SaCheckPermission("system:treeStructure:export") + @Log(title = "cbs树形结构", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(CbsTreeStructureBo bo, HttpServletResponse response) { + List list = cbsTreeStructureService.queryList(bo); + ExcelUtil.exportExcel(list, "cbs树形结构", CbsTreeStructureVo.class, response); + } + + /** + * 获取cbs树形结构详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("system:treeStructure:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(cbsTreeStructureService.queryById(id)); + } + + /** + * 新增cbs树形结构 + */ + @SaCheckPermission("system:treeStructure:add") + @Log(title = "cbs树形结构", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody CbsTreeStructureBo bo) { + return toAjax(cbsTreeStructureService.insertByBo(bo)); + } + + /** + * 修改cbs树形结构 + */ + @SaCheckPermission("system:treeStructure:edit") + @Log(title = "cbs树形结构", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody CbsTreeStructureBo bo) { + return toAjax(cbsTreeStructureService.updateByBo(bo)); + } + + /** + * 删除cbs树形结构 + * + * @param ids 主键串 + */ + @SaCheckPermission("system:treeStructure:remove") + @Log(title = "cbs树形结构", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(cbsTreeStructureService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/domain/CbsTreeStructure.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/domain/CbsTreeStructure.java new file mode 100644 index 00000000..8860dd83 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/domain/CbsTreeStructure.java @@ -0,0 +1,50 @@ +package org.dromara.xzd.zijinjihua.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * cbs树形结构对象 cbs_tree_structure + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@TableName("cbs_tree_structure") +public class CbsTreeStructure { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 节点ID,无默认值,业务层自行赋值 + */ + @TableId(value = "id") + private Long id; + + /** + * 父节点ID,为空表示根节点 + */ + private Long parentId; + + /** + * 节点名称 + */ + private String name; + + /** + * 节点排序,用于同级节点的显示顺序 + */ + private Long sortOrder; + + /** + * 节点描述 + */ + private String description; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/domain/bo/CbsTreeStructureBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/domain/bo/CbsTreeStructureBo.java new file mode 100644 index 00000000..288c7ddb --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/domain/bo/CbsTreeStructureBo.java @@ -0,0 +1,50 @@ +package org.dromara.xzd.zijinjihua.domain.bo; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import org.dromara.xzd.zijinjihua.domain.CbsTreeStructure; + +/** + * cbs树形结构业务对象 cbs_tree_structure + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@AutoMapper(target = CbsTreeStructure.class, reverseConvertGenerate = false) +public class CbsTreeStructureBo { + + /** + * 节点ID,无默认值,业务层自行赋值 + */ + @NotNull(message = "节点ID,无默认值,业务层自行赋值不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 父节点ID,为空表示根节点 + */ + private Long parentId; + + /** + * 节点名称 + */ + @NotBlank(message = "节点名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String name; + + /** + * 节点排序,用于同级节点的显示顺序 + */ + private Long sortOrder; + + /** + * 节点描述 + */ + private String description; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/domain/vo/CbsTreeStructureVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/domain/vo/CbsTreeStructureVo.java new file mode 100644 index 00000000..0a516a41 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/domain/vo/CbsTreeStructureVo.java @@ -0,0 +1,62 @@ +package org.dromara.xzd.zijinjihua.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.xzd.zijinjihua.domain.CbsTreeStructure; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * cbs树形结构视图对象 cbs_tree_structure + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = CbsTreeStructure.class) +public class CbsTreeStructureVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 节点ID,无默认值,业务层自行赋值 + */ + @ExcelProperty(value = "节点ID,无默认值,业务层自行赋值") + private Long id; + + /** + * 父节点ID,为空表示根节点 + */ + @ExcelProperty(value = "父节点ID,为空表示根节点") + private Long parentId; + + /** + * 节点名称 + */ + @ExcelProperty(value = "节点名称") + private String name; + + /** + * 节点排序,用于同级节点的显示顺序 + */ + @ExcelProperty(value = "节点排序,用于同级节点的显示顺序") + private Long sortOrder; + + /** + * 节点描述 + */ + @ExcelProperty(value = "节点描述") + private String description; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/mapper/CbsTreeStructureMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/mapper/CbsTreeStructureMapper.java new file mode 100644 index 00000000..464e08a0 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/mapper/CbsTreeStructureMapper.java @@ -0,0 +1,16 @@ +package org.dromara.xzd.zijinjihua.mapper; + + +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; +import org.dromara.xzd.zijinjihua.domain.CbsTreeStructure; +import org.dromara.xzd.zijinjihua.domain.vo.CbsTreeStructureVo; + +/** + * cbs树形结构Mapper接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface CbsTreeStructureMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/service/ICbsTreeStructureService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/service/ICbsTreeStructureService.java new file mode 100644 index 00000000..b0d7e06d --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/service/ICbsTreeStructureService.java @@ -0,0 +1,62 @@ +package org.dromara.xzd.zijinjihua.service; + + + +import com.baomidou.mybatisplus.extension.service.IService; +import org.dromara.xzd.zijinjihua.domain.CbsTreeStructure; +import org.dromara.xzd.zijinjihua.domain.bo.CbsTreeStructureBo; +import org.dromara.xzd.zijinjihua.domain.vo.CbsTreeStructureVo; + +import java.util.Collection; +import java.util.List; + +/** + * cbs树形结构Service接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface ICbsTreeStructureService extends IService{ + + /** + * 查询cbs树形结构 + * + * @param id 主键 + * @return cbs树形结构 + */ + CbsTreeStructureVo queryById(Long id); + + + /** + * 查询符合条件的cbs树形结构列表 + * + * @param bo 查询条件 + * @return cbs树形结构列表 + */ + List queryList(CbsTreeStructureBo bo); + + /** + * 新增cbs树形结构 + * + * @param bo cbs树形结构 + * @return 是否新增成功 + */ + Boolean insertByBo(CbsTreeStructureBo bo); + + /** + * 修改cbs树形结构 + * + * @param bo cbs树形结构 + * @return 是否修改成功 + */ + Boolean updateByBo(CbsTreeStructureBo bo); + + /** + * 校验并批量删除cbs树形结构信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/service/impl/CbsTreeStructureServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/service/impl/CbsTreeStructureServiceImpl.java new file mode 100644 index 00000000..77bcf6f0 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/service/impl/CbsTreeStructureServiceImpl.java @@ -0,0 +1,118 @@ +package org.dromara.xzd.zijinjihua.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.dromara.xzd.zijinjihua.domain.CbsTreeStructure; +import org.dromara.xzd.zijinjihua.domain.bo.CbsTreeStructureBo; +import org.dromara.xzd.zijinjihua.domain.vo.CbsTreeStructureVo; +import org.dromara.xzd.zijinjihua.mapper.CbsTreeStructureMapper; +import org.dromara.xzd.zijinjihua.service.ICbsTreeStructureService; +import org.springframework.stereotype.Service; + + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * cbs树形结构Service业务层处理 + * + * @author Lion Li + * @date 2025-10-16 + */ +@RequiredArgsConstructor +@Service +public class CbsTreeStructureServiceImpl extends ServiceImpl implements ICbsTreeStructureService { + + private final CbsTreeStructureMapper baseMapper; + + /** + * 查询cbs树形结构 + * + * @param id 主键 + * @return cbs树形结构 + */ + @Override + public CbsTreeStructureVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + + /** + * 查询符合条件的cbs树形结构列表 + * + * @param bo 查询条件 + * @return cbs树形结构列表 + */ + @Override + public List queryList(CbsTreeStructureBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(CbsTreeStructureBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(CbsTreeStructure::getId); + lqw.eq(bo.getParentId() != null, CbsTreeStructure::getParentId, bo.getParentId()); + lqw.like(StringUtils.isNotBlank(bo.getName()), CbsTreeStructure::getName, bo.getName()); + lqw.eq(bo.getSortOrder() != null, CbsTreeStructure::getSortOrder, bo.getSortOrder()); + lqw.eq(StringUtils.isNotBlank(bo.getDescription()), CbsTreeStructure::getDescription, bo.getDescription()); + return lqw; + } + + /** + * 新增cbs树形结构 + * + * @param bo cbs树形结构 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(CbsTreeStructureBo bo) { + CbsTreeStructure add = MapstructUtils.convert(bo, CbsTreeStructure.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改cbs树形结构 + * + * @param bo cbs树形结构 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(CbsTreeStructureBo bo) { + CbsTreeStructure update = MapstructUtils.convert(bo, CbsTreeStructure.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(CbsTreeStructure entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除cbs树形结构信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/controller/FinancialRevenuePlanAlterationController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/controller/FinancialRevenuePlanAlterationController.java new file mode 100644 index 00000000..d3207ceb --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/controller/FinancialRevenuePlanAlterationController.java @@ -0,0 +1,106 @@ +package org.dromara.xzd.zijinjihua.yueduzijinbiangeng.controller; + +import java.util.List; + +import cn.dev33.satoken.annotation.SaCheckPermission; +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; + +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.vo.FinancialRevenuePlanAlterationVo; +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.bo.FinancialRevenuePlanAlterationBo; +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.service.IFinancialRevenuePlanAlterationService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 月度资金计划变更 + * + * @author Lion Li + * @date 2025-10-16 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/yueduzijinbiangeng/revenuePlanAlteration") +public class FinancialRevenuePlanAlterationController extends BaseController { + + private final IFinancialRevenuePlanAlterationService financialRevenuePlanAlterationService; + + /** + * 查询月度资金计划变更列表 + */ + @SaCheckPermission("yueduzijinbiangeng:revenuePlanAlteration:list") + @GetMapping("/list") + public TableDataInfo list(FinancialRevenuePlanAlterationBo bo, PageQuery pageQuery) { + return financialRevenuePlanAlterationService.queryPageList(bo, pageQuery); + } + + /** + * 导出月度资金计划变更列表 + */ + @SaCheckPermission("yueduzijinbiangeng:revenuePlanAlteration:export") + @Log(title = "月度资金计划变更", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(FinancialRevenuePlanAlterationBo bo, HttpServletResponse response) { + List list = financialRevenuePlanAlterationService.queryList(bo); + ExcelUtil.exportExcel(list, "月度资金计划变更", FinancialRevenuePlanAlterationVo.class, response); + } + + /** + * 获取月度资金计划变更详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("yueduzijinbiangeng:revenuePlanAlteration:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(financialRevenuePlanAlterationService.queryById(id)); + } + + /** + * 新增月度资金计划变更 + */ + @SaCheckPermission("yueduzijinbiangeng:revenuePlanAlteration:add") + @Log(title = "月度资金计划变更", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody FinancialRevenuePlanAlterationBo bo) { + return toAjax(financialRevenuePlanAlterationService.insertByBo(bo)); + } + + /** + * 修改月度资金计划变更 + */ + @SaCheckPermission("yueduzijinbiangeng:revenuePlanAlteration:edit") + @Log(title = "月度资金计划变更", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody FinancialRevenuePlanAlterationBo bo) { + return toAjax(financialRevenuePlanAlterationService.updateByBo(bo)); + } + + /** + * 删除月度资金计划变更 + * + * @param ids 主键串 + */ + @SaCheckPermission("yueduzijinbiangeng:revenuePlanAlteration:remove") + @Log(title = "月度资金计划变更", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(financialRevenuePlanAlterationService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/domain/FinancialRevenuePlanAlteration.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/domain/FinancialRevenuePlanAlteration.java new file mode 100644 index 00000000..70ba941d --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/domain/FinancialRevenuePlanAlteration.java @@ -0,0 +1,103 @@ +package org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; +import java.time.LocalDate; + +/** + * 月度资金计划变更对象 financial_revenue_plan_alteration + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("financial_revenue_plan_alteration") +public class FinancialRevenuePlanAlteration extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(value = "id") + private Long id; + + /** + * 单据编码 + */ + private String documentCode; + + /** + * 单据名称 + */ + private String documentName; + + /** + * 项目 + */ + private Long project; + + /** + * 计划类型 + */ + private String planType; + + /** + * 工作周期 + */ + private String workCycle; + + /** + * 开始日期 + */ + private LocalDate startDate; + + /** + * 结束日期 + */ + private LocalDate endDate; + + /** + * 支出总额 + */ + private BigDecimal expenseTotal; + + /** + * 收入总额 + */ + private BigDecimal incomeTotal; + + /** + * 是否临时计划 正常计划,临时计划 + */ + private String isTemporaryPlan; + + /** + * 备注 + */ + private String remarks; + + /** + * 文件ID + */ + private String fileId; + + /** + * 备注 + */ + private String remark; + + /** + * 审核状态 + */ + private String auditStatus; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/domain/bo/FinancialRevenuePlanAlterationBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/domain/bo/FinancialRevenuePlanAlterationBo.java new file mode 100644 index 00000000..9a6b46f6 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/domain/bo/FinancialRevenuePlanAlterationBo.java @@ -0,0 +1,119 @@ +package org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.bo; + +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.FinancialRevenuePlanAlteration; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.DetailOfEarningsBo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.StatementOfExpendituresBo; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.List; + +/** + * 月度资金计划变更业务对象 financial_revenue_plan_alteration + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = FinancialRevenuePlanAlteration.class, reverseConvertGenerate = false) +public class FinancialRevenuePlanAlterationBo extends BaseEntity { + + /** + * + */ + private Long id; + + /** + * 单据编码 + */ + private String documentCode; + + /** + * 单据名称 + */ + private String documentName; + + /** + * 项目 + */ + @NotNull(message = "项目不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long project; + + /** + * 计划类型 + */ + private String planType; + + /** + * 工作周期 + */ + private String workCycle; + + /** + * 开始日期 + */ + @NotNull(message = "开始日期不能为空", groups = { AddGroup.class, EditGroup.class }) + private LocalDate startDate; + + /** + * 结束日期 + */ + @NotNull(message = "结束日期不能为空", groups = { AddGroup.class, EditGroup.class }) + private LocalDate endDate; + + /** + * 支出总额 + */ + private BigDecimal expenseTotal; + + /** + * 收入总额 + */ + private BigDecimal incomeTotal; + + /** + * 是否临时计划 正常计划,临时计划 + */ + @NotBlank(message = "是否临时计划 正常计划,临时计划不能为空", groups = { AddGroup.class, EditGroup.class }) + private String isTemporaryPlan; + + /** + * 备注 + */ + private String remarks; + + /** + * 文件ID + */ + private String fileId; + + /** + * 备注 + */ + private String remark; + + /** + * 审核状态 + */ + private String auditStatus; + + /** + * 收入明细 + */ + private List detailOfEarnings; + + /** + * 支出明细 + */ + private List statementOfExpenditures; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/domain/vo/FinancialRevenuePlanAlterationVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/domain/vo/FinancialRevenuePlanAlterationVo.java new file mode 100644 index 00000000..9d4d5f75 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/domain/vo/FinancialRevenuePlanAlterationVo.java @@ -0,0 +1,170 @@ +package org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.vo; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.FinancialRevenuePlanAlteration; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.DetailOfEarningsVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.StatementOfExpendituresVo; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.util.Date; +import java.util.List; + + +/** + * 月度资金计划变更视图对象 financial_revenue_plan_alteration + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = FinancialRevenuePlanAlteration.class) +public class FinancialRevenuePlanAlterationVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 单据编码 + */ + @ExcelProperty(value = "单据编码") + private String documentCode; + + /** + * 单据名称 + */ + @ExcelProperty(value = "单据名称") + private String documentName; + + /** + * 项目 + */ + @ExcelProperty(value = "项目") + private Long project; + + /** + * 项目名称 + */ + @ExcelProperty(value = "项目") + private String projectName; + + /** + * 计划类型 + */ + @ExcelProperty(value = "计划类型") + private String planType; + + /** + * 工作周期 + */ + @ExcelProperty(value = "工作周期") + private String workCycle; + + /** + * 开始日期 + */ + @ExcelProperty(value = "开始日期") + private LocalDate startDate; + + /** + * 结束日期 + */ + @ExcelProperty(value = "结束日期") + private LocalDate endDate; + + /** + * 支出总额 + */ + @ExcelProperty(value = "支出总额") + private BigDecimal expenseTotal; + + /** + * 收入总额 + */ + @ExcelProperty(value = "收入总额") + private BigDecimal incomeTotal; + + /** + * 是否临时计划 正常计划,临时计划 + */ + @ExcelProperty(value = "是否临时计划 正常计划,临时计划") + private String isTemporaryPlan; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remarks; + + /** + * 文件ID + */ + @ExcelProperty(value = "文件ID") + private String fileId; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 审核状态 + */ + @ExcelProperty(value = "审核状态") + private String auditStatus; + + /** + * 创建部门 + */ + @TableField(fill = FieldFill.INSERT) + private Long createDept; + + + @ExcelProperty(value = "创建部门名称") + @Translation(type = TransConstant.DEPT_ID_TO_NAME, mapper = "createDept") + private String createDeptName; + + /** + * 创建者 + */ + @ExcelProperty(value = "创建者") + @TableField(fill = FieldFill.INSERT) + private Long createBy; + + @ExcelProperty(value = "创建者名称") + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy") + private String createByName; + + + /** + * 收入明细 + */ + private List detailOfEarnings; + + /** + * 支出明细 + */ + private List statementOfExpenditures; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/mapper/FinancialRevenuePlanAlterationMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/mapper/FinancialRevenuePlanAlterationMapper.java new file mode 100644 index 00000000..dd17011a --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/mapper/FinancialRevenuePlanAlterationMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.zijinjihua.yueduzijinbiangeng.mapper; + +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.FinancialRevenuePlanAlteration; +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.vo.FinancialRevenuePlanAlterationVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 月度资金计划变更Mapper接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface FinancialRevenuePlanAlterationMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/service/IFinancialRevenuePlanAlterationService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/service/IFinancialRevenuePlanAlterationService.java new file mode 100644 index 00000000..27cff876 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/service/IFinancialRevenuePlanAlterationService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.zijinjihua.yueduzijinbiangeng.service; + +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.vo.FinancialRevenuePlanAlterationVo; +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.bo.FinancialRevenuePlanAlterationBo; +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.FinancialRevenuePlanAlteration; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 月度资金计划变更Service接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface IFinancialRevenuePlanAlterationService extends IService{ + + /** + * 查询月度资金计划变更 + * + * @param id 主键 + * @return 月度资金计划变更 + */ + FinancialRevenuePlanAlterationVo queryById(Long id); + + /** + * 分页查询月度资金计划变更列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 月度资金计划变更分页列表 + */ + TableDataInfo queryPageList(FinancialRevenuePlanAlterationBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的月度资金计划变更列表 + * + * @param bo 查询条件 + * @return 月度资金计划变更列表 + */ + List queryList(FinancialRevenuePlanAlterationBo bo); + + /** + * 新增月度资金计划变更 + * + * @param bo 月度资金计划变更 + * @return 是否新增成功 + */ + Boolean insertByBo(FinancialRevenuePlanAlterationBo bo); + + /** + * 修改月度资金计划变更 + * + * @param bo 月度资金计划变更 + * @return 是否修改成功 + */ + Boolean updateByBo(FinancialRevenuePlanAlterationBo bo); + + /** + * 校验并批量删除月度资金计划变更信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/service/impl/FinancialRevenuePlanAlterationServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/service/impl/FinancialRevenuePlanAlterationServiceImpl.java new file mode 100644 index 00000000..bc12334c --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinbiangeng/service/impl/FinancialRevenuePlanAlterationServiceImpl.java @@ -0,0 +1,326 @@ +package org.dromara.xzd.zijinjihua.yueduzijinbiangeng.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.dromara.system.service.impl.SysOssServiceImpl; +import org.dromara.xzd.domain.XzdContractDetails; +import org.dromara.xzd.domain.dto.QuerCorrespondentDto; +import org.dromara.xzd.service.IXzdContractDetailsService; +import org.dromara.xzd.service.IXzdCorrespondentList; +import org.dromara.xzd.service.impl.XzdProjectServiceImpl; +import org.dromara.xzd.service.impl.XzdSupplierInfoServiceImpl; +import org.dromara.xzd.utilS.AreaUtil; +import org.dromara.xzd.zijinjihua.service.ICbsTreeStructureService; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.DetailOfEarnings; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.FinancialRevenueExpenditurePlan; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.StatementOfExpenditures; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.DetailOfEarningsBo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.StatementOfExpendituresBo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.DetailOfEarningsVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.FinancialRevenueExpenditurePlanVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.StatementOfExpendituresVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.service.IDetailOfEarningsService; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.service.IStatementOfExpendituresService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.bo.FinancialRevenuePlanAlterationBo; +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.vo.FinancialRevenuePlanAlterationVo; +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.domain.FinancialRevenuePlanAlteration; +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.mapper.FinancialRevenuePlanAlterationMapper; +import org.dromara.xzd.zijinjihua.yueduzijinbiangeng.service.IFinancialRevenuePlanAlterationService; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDate; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 月度资金计划变更Service业务层处理 + * + * @author Lion Li + * @date 2025-10-16 + */ +@RequiredArgsConstructor +@Service +public class FinancialRevenuePlanAlterationServiceImpl extends ServiceImpl implements IFinancialRevenuePlanAlterationService { + + private final FinancialRevenuePlanAlterationMapper baseMapper; + private final AreaUtil areaUtil; + + + private final IDetailOfEarningsService iDetailOfEarningsService; + + + private final ICbsTreeStructureService iCbsTreeStructureService; + + private final IStatementOfExpendituresService iStatementOfExpendituresService; + + + private final IXzdContractDetailsService xzdContractDetailsService; + + @Autowired + private XzdProjectServiceImpl xzdProjectService; + + @Autowired + private IXzdCorrespondentList iXzdCorrespondentList; + + + @Autowired + private XzdSupplierInfoServiceImpl xzdSupplierInfoService; + + @Autowired + private SysOssServiceImpl sysOssService; + + /** + * 查询月度资金计划变更 + * + * @param id 主键 + * @return 月度资金计划变更 + */ + @Override + public FinancialRevenuePlanAlterationVo queryById(Long id){ + FinancialRevenuePlanAlterationVo financialRevenuePlanAlterationVo = baseMapper.selectVoById(id); + List vo = List.of(financialRevenuePlanAlterationVo); + savaValue(vo,true); + return vo.getFirst(); + } + + /** + * 分页查询月度资金计划变更列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 月度资金计划变更分页列表 + */ + @Override + public TableDataInfo queryPageList(FinancialRevenuePlanAlterationBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + savaValue(result.getRecords(),false); + return TableDataInfo.build(result); + } + + private void savaValue(List records, boolean type) { + for (FinancialRevenuePlanAlterationVo item : records) { + //项目名称 + if (item.getProject() != null){ + String projectName = xzdProjectService.queryNameById(item.getProject()); + if (projectName != null){ + item.setProjectName(projectName); + } + } + HashMap hashMap = new HashMap<>(); + hashMap.put("financial_revenue_id",item.getId()); +// 收入 + List detail = iDetailOfEarningsService.getBaseMapper().selectByMap(hashMap); + if (detail != null && detail.size() > 0){ + List convert = MapstructUtils.convert(detail, DetailOfEarningsVo.class); + if (type){ + convert.forEach(temp ->{ + //甲方单位(客户信息列表) + R byid = iXzdCorrespondentList.getCustomerByid(temp.getPartyAUnit()); + if (byid!=null){ + if (byid.getData().getXzdCustomerinformation() != null){ + temp.setPartyAUnitName(byid.getData().getXzdCustomerinformation().getUnitName()); + } + } +// cbs + Long cbs = temp.getCbs(); + if (cbs != null){ + String name = iCbsTreeStructureService.queryById(cbs).getName(); + temp.setCbsName(name); + } + +// 合同 + XzdContractDetails contractDetailsServiceById = xzdContractDetailsService.getById(temp.getContractCode()); + if(contractDetailsServiceById != null){ + temp.setContractCodeName(contractDetailsServiceById.getContractCode()); + } + }); + } + item.setDetailOfEarnings(convert); + } +// 支出 + List statementOfExpenditures = iStatementOfExpendituresService.getBaseMapper().selectByMap(hashMap); + if (statementOfExpenditures != null && statementOfExpenditures.size() > 0){ + List convert = MapstructUtils.convert(statementOfExpenditures, StatementOfExpendituresVo.class); + if (type){ + convert.forEach(temp ->{ + //供应商 supplier + String unitName = xzdSupplierInfoService.queryNameById(temp.getSupplier()); + if (StringUtils.isNotBlank(unitName)){ + temp.setSupplierName(unitName); + } + Long cbs = temp.getCbs(); + if (cbs != null){ + String name = iCbsTreeStructureService.queryById(cbs).getName(); + temp.setCbsName(name); + } +// 合同 + XzdContractDetails contractDetailsServiceById = xzdContractDetailsService.getById(temp.getContractCode()); + if(contractDetailsServiceById != null){ + temp.setContractCodeName(contractDetailsServiceById.getContractCode()); + } + + }); + } + item.setStatementOfExpenditures(convert); + } + } + } + + /** + * 查询符合条件的月度资金计划变更列表 + * + * @param bo 查询条件 + * @return 月度资金计划变更列表 + */ + @Override + public List queryList(FinancialRevenuePlanAlterationBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(FinancialRevenuePlanAlterationBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(FinancialRevenuePlanAlteration::getId); + lqw.eq(StringUtils.isNotBlank(bo.getDocumentCode()), FinancialRevenuePlanAlteration::getDocumentCode, bo.getDocumentCode()); + lqw.like(StringUtils.isNotBlank(bo.getDocumentName()), FinancialRevenuePlanAlteration::getDocumentName, bo.getDocumentName()); + lqw.eq(bo.getProject() != null, FinancialRevenuePlanAlteration::getProject, bo.getProject()); + lqw.eq(StringUtils.isNotBlank(bo.getPlanType()), FinancialRevenuePlanAlteration::getPlanType, bo.getPlanType()); + lqw.eq(StringUtils.isNotBlank(bo.getWorkCycle()), FinancialRevenuePlanAlteration::getWorkCycle, bo.getWorkCycle()); + lqw.eq(bo.getStartDate() != null, FinancialRevenuePlanAlteration::getStartDate, bo.getStartDate()); + lqw.eq(bo.getEndDate() != null, FinancialRevenuePlanAlteration::getEndDate, bo.getEndDate()); + lqw.eq(bo.getExpenseTotal() != null, FinancialRevenuePlanAlteration::getExpenseTotal, bo.getExpenseTotal()); + lqw.eq(bo.getIncomeTotal() != null, FinancialRevenuePlanAlteration::getIncomeTotal, bo.getIncomeTotal()); + lqw.eq(StringUtils.isNotBlank(bo.getIsTemporaryPlan()), FinancialRevenuePlanAlteration::getIsTemporaryPlan, bo.getIsTemporaryPlan()); + lqw.eq(StringUtils.isNotBlank(bo.getRemarks()), FinancialRevenuePlanAlteration::getRemarks, bo.getRemarks()); + lqw.eq(StringUtils.isNotBlank(bo.getFileId()), FinancialRevenuePlanAlteration::getFileId, bo.getFileId()); + lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), FinancialRevenuePlanAlteration::getAuditStatus, bo.getAuditStatus()); + return lqw; + } + + /** + * 新增月度资金计划变更 + * + * @param bo 月度资金计划变更 + * @return 是否新增成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean insertByBo(FinancialRevenuePlanAlterationBo bo) { + FinancialRevenuePlanAlteration add = MapstructUtils.convert(bo, FinancialRevenuePlanAlteration.class); + validEntityBeforeSave(add); + Long l = baseMapper.selectCount(new LambdaQueryWrapper().gt(FinancialRevenuePlanAlteration::getCreateTime, LocalDate.now())); + String s = areaUtil.generateDateBasedNumber(); + add.setDocumentCode( s+"-"+(l+1)); + boolean flag = baseMapper.insert(add) > 0; + + + // 收入明细 + List detailOfEarnings = bo.getDetailOfEarnings(); + if (detailOfEarnings != null && detailOfEarnings.size() > 0) { + detailOfEarnings.forEach(item -> { + item.setFinancialRevenueId(add.getId() ); + }); + iDetailOfEarningsService.saveBatch(MapstructUtils.convert(detailOfEarnings, DetailOfEarnings.class)); + } + +// 支出明细 + List statementOfExpenditures = bo.getStatementOfExpenditures(); + statementOfExpenditures.forEach(item -> { + item.setFinancialRevenueId(add.getId()); + }); + iStatementOfExpendituresService.saveBatch(MapstructUtils.convert(statementOfExpenditures, StatementOfExpenditures.class)); + + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改月度资金计划变更 + * + * @param bo 月度资金计划变更 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(FinancialRevenuePlanAlterationBo bo) { + FinancialRevenuePlanAlteration update = MapstructUtils.convert(bo, FinancialRevenuePlanAlteration.class); + validEntityBeforeSave(update); + + List detailOfEarnings = bo.getDetailOfEarnings(); + HashMap hashMap = new HashMap<>(); + hashMap.put("financial_revenue_id",bo.getId()); +// 收入 + iDetailOfEarningsService.getBaseMapper().deleteByMap(hashMap); + if (detailOfEarnings != null && detailOfEarnings.size() > 0) { + detailOfEarnings.forEach(item ->{ + item.setFinancialRevenueId(bo.getId()); + }); + iDetailOfEarningsService.saveBatch(MapstructUtils.convert(detailOfEarnings, DetailOfEarnings.class)); + } +// 支出 + iStatementOfExpendituresService.getBaseMapper().deleteByMap(hashMap); + List statementOfExpenditures = bo.getStatementOfExpenditures(); + if (statementOfExpenditures != null && statementOfExpenditures.size() > 0) { + statementOfExpenditures.forEach(item ->{ + item.setFinancialRevenueId(bo.getId()); + }); + iStatementOfExpendituresService.saveBatch(MapstructUtils.convert(statementOfExpenditures, StatementOfExpenditures.class)); + } + + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(FinancialRevenuePlanAlteration entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除月度资金计划变更信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + + for (Long id : ids) { + FinancialRevenuePlanAlterationVo vo = baseMapper.selectVoById(id); + // 删除附件 + if (!StringUtils.isEmpty(vo.getFileId())){ + List collect = Arrays.stream(vo.getFileId().split(",")).map(item -> { + return Long.parseLong(item); + }).collect(Collectors.toList()); + sysOssService.deleteWithValidByIds(collect, false); + } + } +// 删除支出,收入 + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.in(DetailOfEarnings::getFinancialRevenueId, ids); + iDetailOfEarningsService.getBaseMapper().delete(lambdaQueryWrapper); + + LambdaQueryWrapper lambdaQueryWrapper1 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper1.in(StatementOfExpenditures::getFinancialRevenueId, ids); + iStatementOfExpendituresService.getBaseMapper().delete(lambdaQueryWrapper1); + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/controller/FinancialRevenueExpenditurePlanController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/controller/FinancialRevenueExpenditurePlanController.java new file mode 100644 index 00000000..fa8d1051 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/controller/FinancialRevenueExpenditurePlanController.java @@ -0,0 +1,108 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.service.IDetailOfEarningsService; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.service.IStatementOfExpendituresService; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.FinancialRevenueExpenditurePlanVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.FinancialRevenueExpenditurePlanBo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.service.IFinancialRevenueExpenditurePlanService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 月度资金计划 + * + * @author Lion Li + * @date 2025-10-15 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/yueduzijinjihua/revenueExpenditurePlan") +public class FinancialRevenueExpenditurePlanController extends BaseController { + + private final IFinancialRevenueExpenditurePlanService financialRevenueExpenditurePlanService; + + + /** + * 查询月度资金计划列表 + */ + @SaCheckPermission("yueduzijinjihua:revenueExpenditurePlan:list") + @GetMapping("/list") + public TableDataInfo list(FinancialRevenueExpenditurePlanBo bo, PageQuery pageQuery) { + return financialRevenueExpenditurePlanService.queryPageList(bo, pageQuery); + } + + /** + * 导出月度资金计划列表 + */ + @SaCheckPermission("yueduzijinjihua:revenueExpenditurePlan:export") + @Log(title = "月度资金计划", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(FinancialRevenueExpenditurePlanBo bo, HttpServletResponse response) { + List list = financialRevenueExpenditurePlanService.queryList(bo); + ExcelUtil.exportExcel(list, "月度资金计划", FinancialRevenueExpenditurePlanVo.class, response); + } + + /** + * 获取月度资金计划详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("yueduzijinjihua:revenueExpenditurePlan:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(financialRevenueExpenditurePlanService.queryById(id)); + } + + /** + * 新增月度资金计划 + */ + @SaCheckPermission("yueduzijinjihua:revenueExpenditurePlan:add") + @Log(title = "月度资金计划", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody FinancialRevenueExpenditurePlanBo bo) { + return toAjax(financialRevenueExpenditurePlanService.insertByBo(bo)); + } + + /** + * 修改月度资金计划 + */ + @SaCheckPermission("yueduzijinjihua:revenueExpenditurePlan:edit") + @Log(title = "月度资金计划", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody FinancialRevenueExpenditurePlanBo bo) { + return toAjax(financialRevenueExpenditurePlanService.updateByBo(bo)); + } + + /** + * 删除月度资金计划 + * + * @param ids 主键串 + */ + @SaCheckPermission("yueduzijinjihua:revenueExpenditurePlan:remove") + @Log(title = "月度资金计划", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(financialRevenueExpenditurePlanService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/DetailOfEarnings.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/DetailOfEarnings.java new file mode 100644 index 00000000..fa5201fa --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/DetailOfEarnings.java @@ -0,0 +1,116 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; + +/** + * 资金计划-收入明细对象 detail_of_earnings + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@TableName("detail_of_earnings") +public class DetailOfEarnings { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(value = "id") + private Long id; + + /** + * 月度资金id + */ + private Long financialRevenueId; + + /** + * 预算项 + */ + private String budgetItem; + + /** + * 收入金额 + */ + private BigDecimal incomeAmount; + + /** + * 是否开票 + */ + private String isInvoice; + /** + * + * 变更原因 + */ + private String reasonsForChange; + + /** + * 变更后金额 + */ + private BigDecimal changedAmount; + + /** + * CBS + */ + private Long cbs; + + /** + * CBS金额 + */ + private BigDecimal cbsAmount; + + /** + * CBS余额 + */ + private BigDecimal cbsBalance; + + /** + * 甲方单位 客户 + */ + private Long partyAUnit; + + /** + * 合同编码 + */ + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 合同金额 + */ + private BigDecimal contractAmount; + + /** + * 累计审定产值金额 + */ + private BigDecimal cumulativeApprovedOutputValue; + + /** + * 累计收款金额 + */ + private BigDecimal cumulativeReceiptAmount; + + /** + * 截止本期结算比例(结算/合同) + */ + private BigDecimal settlementRatio; + + /** + * 截止本期收款比例(收款/结算) + */ + private BigDecimal receiptRatio; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/FinancialRevenueExpenditurePlan.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/FinancialRevenueExpenditurePlan.java new file mode 100644 index 00000000..82f79c81 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/FinancialRevenueExpenditurePlan.java @@ -0,0 +1,163 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; +import java.time.LocalDate; + +/** + * 月度资金计划对象 financial_revenue_expenditure_plan + * + * @author Lion Li + * @date 2025-10-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("financial_revenue_expenditure_plan") +public class FinancialRevenueExpenditurePlan extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(value = "id") + private Long id; + + /** + * 单据编码 + */ + private String documentCode; + + /** + * 单据名称 + */ + private String documentName; + + /** + * 项目 + */ + private Long project; + + /** + * 计划类型 + */ + private String planType; + + /** + * 工作周期 + */ + private String workCycle; + + /** + * 开始日期 + */ + private LocalDate startDate; + + /** + * 结束日期 + */ + private LocalDate endDate; + + /** + * 支出总额 + */ + private BigDecimal expenseTotal; + + /** + * 收入总额 + */ + private BigDecimal incomeTotal; + + /** + * 是否临时计划 + */ + private String isTemporaryPlan; + + /** + * 单据日期(上月) + */ + private LocalDate documentDateLastMonth; + + /** + * 备注 + */ + private String remarks; + + /** + * 项目可用余额 + */ + private BigDecimal projectAvailableBalance; + + /** + * 累计收款金额 + */ + private BigDecimal cumulativeReceiptAmount; + + /** + * 累计支付金额 + */ + private BigDecimal cumulativePaymentAmount; + + /** + * 报销支出金额 + */ + private BigDecimal reimbursementAmount; + + /** + * 合同支付金额 + */ + private BigDecimal contractPaymentAmount; + + /** + * 剩余资金金额 + */ + private BigDecimal remainingFunds; + + /** + * 实时刷新(0:不刷新,1:刷新) + */ + private Integer realTimeRefresh; + + /** + * 月度支出余额 + */ + private BigDecimal monthlyExpenditureBalance; + + /** + * 月度累计支出 + */ + private BigDecimal monthlyCumulativeExpenditure; + + /** + * 年度支出余额 + */ + private BigDecimal annualExpenditureBalance; + + /** + * 年度累计支出 + */ + private BigDecimal annualCumulativeExpenditure; + + /** + * 文件ID + */ + private String fileId; + + /** + * 备注 + */ + private String remark; + + /** + * 审核状态 + */ + private String auditStatus; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/StatementOfExpenditures.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/StatementOfExpenditures.java new file mode 100644 index 00000000..40bfc8a5 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/StatementOfExpenditures.java @@ -0,0 +1,127 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.math.BigDecimal; + +import java.io.Serial; + +/** + * 资金计划-支出明细对象 statement_of_expenditures + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@TableName("statement_of_expenditures") +public class StatementOfExpenditures { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(value = "id") + private Long id; + + /** + * 月度资金id + */ + private Long financialRevenueId; + + /** + * 预算项 + */ + private String budgetItem; + + /** + * + * 变更原因 + */ + private String reasonsForChange; + + /** + * 支出类型 + */ + private String expenseType; + + /** + * 支出金额 + */ + private BigDecimal expenseAmount; + + /** + * 变更后金额 + */ + private BigDecimal changedAmount; + + /** + * CBS + */ + private Long cbs; + + /** + * CBS金额 + */ + private BigDecimal cbsAmount; + + /** + * CBS余额 + */ + private BigDecimal cbsBalance; + + /** + * 供应商 + */ + private Long supplier; + + /** + * 合同编码 + */ + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 合同金额 + */ + private BigDecimal contractAmount; + + /** + * 累计进度结算金额 + */ + private BigDecimal cumulativeProgressSettlement; + + /** + * 累计支付金额 + */ + private BigDecimal cumulativePaymentAmount; + + /** + * 累计收票金额 + */ + private BigDecimal cumulativeInvoiceAmount; + + /** + * 截止至本期应付款金额 + */ + private BigDecimal currentPeriodPayableAmount; + + /** + * 累计支付占合同比例 + */ + private BigDecimal paymentContractRatio; + + /** + * 截止至本期进度支付占截止至本期应付款金额的比例 + */ + private BigDecimal progressPaymentToCurrentPayableRatio; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/bo/DetailOfEarningsBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/bo/DetailOfEarningsBo.java new file mode 100644 index 00000000..fc239d44 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/bo/DetailOfEarningsBo.java @@ -0,0 +1,118 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo; + +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.DetailOfEarnings; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; + +/** + * 资金计划-收入明细业务对象 detail_of_earnings + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@AutoMapper(target = DetailOfEarnings.class, reverseConvertGenerate = false) +public class DetailOfEarningsBo { + + /** + * + */ + private Long id; + + /** + * 月度资金id + */ + private Long financialRevenueId; + + /** + * 预算项 + */ + @NotBlank(message = "预算项不能为空", groups = { AddGroup.class, EditGroup.class }) + private String budgetItem; + + /** + * 收入金额 + */ + @NotNull(message = "收入金额不能为空", groups = { AddGroup.class, EditGroup.class }) + private BigDecimal incomeAmount; + + /** + * 是否开票 + */ + @NotBlank(message = "是否开票不能为空", groups = { AddGroup.class, EditGroup.class }) + private String isInvoice; + + /** + * 变更后金额 + */ + private BigDecimal changedAmount; + + /** + * CBS + */ + private Long cbs; + + /** + * + * 变更原因 + */ + private String reasonsForChange; + + /** + * CBS金额 + */ + private BigDecimal cbsAmount; + + /** + * CBS余额 + */ + private BigDecimal cbsBalance; + + /** + * 甲方单位 客户 + */ + private Long partyAUnit; + + /** + * 合同编码 + */ + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 合同金额 + */ + private BigDecimal contractAmount; + + /** + * 累计审定产值金额 + */ + private BigDecimal cumulativeApprovedOutputValue; + + /** + * 累计收款金额 + */ + private BigDecimal cumulativeReceiptAmount; + + /** + * 截止本期结算比例(结算/合同) + */ + private BigDecimal settlementRatio; + + /** + * 截止本期收款比例(收款/结算) + */ + private BigDecimal receiptRatio; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/bo/FinancialRevenueExpenditurePlanBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/bo/FinancialRevenueExpenditurePlanBo.java new file mode 100644 index 00000000..bf7247a1 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/bo/FinancialRevenueExpenditurePlanBo.java @@ -0,0 +1,178 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo; + +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.FinancialRevenueExpenditurePlan; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.DetailOfEarningsVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.StatementOfExpendituresVo; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.List; + +/** + * 月度资金计划业务对象 financial_revenue_expenditure_plan + * + * @author Lion Li + * @date 2025-10-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = FinancialRevenueExpenditurePlan.class, reverseConvertGenerate = false) +public class FinancialRevenueExpenditurePlanBo extends BaseEntity { + + /** + * + */ + private Long id; + + /** + * 单据编码 + */ + private String documentCode; + + /** + * 单据名称 + */ + private String documentName; + + /** + * 项目 + */ + @NotNull(message = "项目不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long project; + + /** + * 计划类型 + */ + private String planType; + + /** + * 工作周期 + */ + private String workCycle; + + /** + * 开始日期 + */ + private LocalDate startDate; + + /** + * 结束日期 + */ + private LocalDate endDate; + + /** + * 支出总额 + */ + private BigDecimal expenseTotal; + + /** + * 收入总额 + */ + private BigDecimal incomeTotal; + + /** + * 是否临时计划 + */ + @NotBlank(message = "是否临时计划不能为空", groups = { AddGroup.class, EditGroup.class }) + private String isTemporaryPlan; + + /** + * 单据日期(上月) + */ + private LocalDate documentDateLastMonth; + + /** + * 备注 + */ + private String remarks; + + /** + * 项目可用余额 + */ + private BigDecimal projectAvailableBalance; + + /** + * 累计收款金额 + */ + private BigDecimal cumulativeReceiptAmount; + + /** + * 累计支付金额 + */ + private BigDecimal cumulativePaymentAmount; + + /** + * 报销支出金额 + */ + private BigDecimal reimbursementAmount; + + /** + * 合同支付金额 + */ + private BigDecimal contractPaymentAmount; + + /** + * 剩余资金金额 + */ + private BigDecimal remainingFunds; + + /** + * 实时刷新(0:不刷新,1:刷新) + */ + private Integer realTimeRefresh; + + /** + * 月度支出余额 + */ + private BigDecimal monthlyExpenditureBalance; + + /** + * 月度累计支出 + */ + private BigDecimal monthlyCumulativeExpenditure; + + /** + * 年度支出余额 + */ + private BigDecimal annualExpenditureBalance; + + /** + * 年度累计支出 + */ + private BigDecimal annualCumulativeExpenditure; + + /** + * 文件ID + */ + private String fileId; + + /** + * 备注 + */ + private String remark; + + /** + * 审核状态 + */ + private String auditStatus; + + + /** + * 收入明细 + */ + private List detailOfEarnings; + + /** + * 支出明细 + */ + private List statementOfExpenditures; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/bo/StatementOfExpendituresBo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/bo/StatementOfExpendituresBo.java new file mode 100644 index 00000000..162a58bc --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/bo/StatementOfExpendituresBo.java @@ -0,0 +1,128 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo; + +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.StatementOfExpenditures; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.math.BigDecimal; + +/** + * 资金计划-支出明细业务对象 statement_of_expenditures + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@AutoMapper(target = StatementOfExpenditures.class, reverseConvertGenerate = false) +public class StatementOfExpendituresBo { + + /** + * + */ + @NotNull(message = "不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 月度资金id + */ + private Long financialRevenueId; + + /** + * 预算项 + */ + @NotBlank(message = "预算项不能为空", groups = { AddGroup.class, EditGroup.class }) + private String budgetItem; + + /** + * 支出类型 + */ + private String expenseType; + + /** + * + * 变更原因 + */ + private String reasonsForChange; + + /** + * 支出金额 + */ + private BigDecimal expenseAmount; + + /** + * 变更后金额 + */ + private BigDecimal changedAmount; + + /** + * CBS + */ + private Long cbs; + + /** + * CBS金额 + */ + private BigDecimal cbsAmount; + + /** + * CBS余额 + */ + private BigDecimal cbsBalance; + + /** + * 供应商 + */ + @NotNull(message = "供应商不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long supplier; + + /** + * 合同编码 + */ + private Long contractCode; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 合同金额 + */ + private BigDecimal contractAmount; + + /** + * 累计进度结算金额 + */ + private BigDecimal cumulativeProgressSettlement; + + /** + * 累计支付金额 + */ + private BigDecimal cumulativePaymentAmount; + + /** + * 累计收票金额 + */ + private BigDecimal cumulativeInvoiceAmount; + + /** + * 截止至本期应付款金额 + */ + private BigDecimal currentPeriodPayableAmount; + + /** + * 累计支付占合同比例 + */ + private BigDecimal paymentContractRatio; + + /** + * 截止至本期进度支付占截止至本期应付款金额的比例 + */ + private BigDecimal progressPaymentToCurrentPayableRatio; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/vo/DetailOfEarningsVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/vo/DetailOfEarningsVo.java new file mode 100644 index 00000000..fe69b3eb --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/vo/DetailOfEarningsVo.java @@ -0,0 +1,163 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo; + +import java.math.BigDecimal; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.DetailOfEarnings; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 资金计划-收入明细视图对象 detail_of_earnings + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = DetailOfEarnings.class) +public class DetailOfEarningsVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 月度资金id + */ + @ExcelProperty(value = "月度资金id") + private Long financialRevenueId; + + /** + * 预算项 + */ + @ExcelProperty(value = "预算项") + private String budgetItem; + + /** + * + * 变更原因 + */ + private String reasonsForChange; + + /** + * 收入金额 + */ + @ExcelProperty(value = "收入金额") + private BigDecimal incomeAmount; + + /** + * 是否开票 + */ + @ExcelProperty(value = "是否开票") + private String isInvoice; + + /** + * 变更后金额 + */ + @ExcelProperty(value = "变更后金额") + private BigDecimal changedAmount; + + /** + * CBS + */ + @ExcelProperty(value = "CBS") + private Long cbs; + + /** + * CBS名称 + */ + @ExcelProperty(value = "CBS名称") + private String cbsName; + + + /** + * CBS金额 + */ + @ExcelProperty(value = "CBS金额") + private BigDecimal cbsAmount; + + /** + * CBS余额 + */ + @ExcelProperty(value = "CBS余额") + private BigDecimal cbsBalance; + + /** + * 甲方单位 客户 + */ + @ExcelProperty(value = "甲方单位 客户") + private Long partyAUnit; + + /** + * 甲方单位名称 客户 + */ + @ExcelProperty(value = "甲方单位名称 客户") + private String partyAUnitName; + + /** + * 合同编码 + */ + @ExcelProperty(value = "合同编码 ") + private Long contractCode; + + + /** + * 合同编码 名称 + */ + @ExcelProperty(value = "合同编码名称 ") + private String contractCodeName; + + /** + * 合同名称 + */ + @ExcelProperty(value = "合同名称") + private String contractName; + + /** + * 合同金额 + */ + @ExcelProperty(value = "合同金额") + private BigDecimal contractAmount; + + /** + * 累计审定产值金额 + */ + @ExcelProperty(value = "累计审定产值金额") + private BigDecimal cumulativeApprovedOutputValue; + + /** + * 累计收款金额 + */ + @ExcelProperty(value = "累计收款金额") + private BigDecimal cumulativeReceiptAmount; + + /** + * 截止本期结算比例(结算/合同) + */ + @ExcelProperty(value = "截止本期结算比例", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "结=算/合同") + private BigDecimal settlementRatio; + + /** + * 截止本期收款比例(收款/结算) + */ + @ExcelProperty(value = "截止本期收款比例", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "收=款/结算") + private BigDecimal receiptRatio; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/vo/FinancialRevenueExpenditurePlanVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/vo/FinancialRevenueExpenditurePlanVo.java new file mode 100644 index 00000000..0d88bd60 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/vo/FinancialRevenueExpenditurePlanVo.java @@ -0,0 +1,254 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import org.dromara.common.translation.annotation.Translation; +import org.dromara.common.translation.constant.TransConstant; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.FinancialRevenueExpenditurePlan; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.DetailOfEarningsBo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.StatementOfExpendituresBo; + +import java.io.Serial; +import java.io.Serializable; +import java.time.LocalDate; +import java.util.Date; +import java.util.List; + + +/** + * 月度资金计划视图对象 financial_revenue_expenditure_plan + * + * @author Lion Li + * @date 2025-10-15 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = FinancialRevenueExpenditurePlan.class) +public class FinancialRevenueExpenditurePlanVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 单据编码 + */ + @ExcelProperty(value = "单据编码") + private String documentCode; + + /** + * 单据名称 + */ + @ExcelProperty(value = "单据名称") + private String documentName; + + /** + * 项目 + */ + @ExcelProperty(value = "项目") + private Long project; + + + /** + * 项目名称 + */ + @ExcelProperty(value = "项目名称") + private String projectName; + + /** + * 计划类型 + */ + @ExcelProperty(value = "计划类型") + private String planType; + + /** + * 工作周期 + */ + @ExcelProperty(value = "工作周期") + private String workCycle; + + /** + * 开始日期 + */ + @ExcelProperty(value = "开始日期") + private LocalDate startDate; + + /** + * 结束日期 + */ + @ExcelProperty(value = "结束日期") + private LocalDate endDate; + + /** + * 支出总额 + */ + @ExcelProperty(value = "支出总额") + private BigDecimal expenseTotal; + + /** + * 收入总额 + */ + @ExcelProperty(value = "收入总额") + private BigDecimal incomeTotal; + + /** + * 是否临时计划 + */ + @ExcelProperty(value = "是否临时计划") + private String isTemporaryPlan; + + /** + * 单据日期(上月) + */ + @ExcelProperty(value = "单据日期(上月)") + private LocalDate documentDateLastMonth; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remarks; + + /** + * 项目可用余额 + */ + @ExcelProperty(value = "项目可用余额") + private BigDecimal projectAvailableBalance; + + /** + * 累计收款金额 + */ + @ExcelProperty(value = "累计收款金额") + private BigDecimal cumulativeReceiptAmount; + + /** + * 累计支付金额 + */ + @ExcelProperty(value = "累计支付金额") + private BigDecimal cumulativePaymentAmount; + + /** + * 报销支出金额 + */ + @ExcelProperty(value = "报销支出金额") + private BigDecimal reimbursementAmount; + + /** + * 合同支付金额 + */ + @ExcelProperty(value = "合同支付金额") + private BigDecimal contractPaymentAmount; + + /** + * 剩余资金金额 + */ + @ExcelProperty(value = "剩余资金金额") + private BigDecimal remainingFunds; + + /** + * 实时刷新(0:不刷新,1:刷新) + */ + @ExcelProperty(value = "实时刷新", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=:不刷新,1:刷新") + private Integer realTimeRefresh; + + /** + * 月度支出余额 + */ + @ExcelProperty(value = "月度支出余额") + private BigDecimal monthlyExpenditureBalance; + + /** + * 月度累计支出 + */ + @ExcelProperty(value = "月度累计支出") + private BigDecimal monthlyCumulativeExpenditure; + + /** + * 年度支出余额 + */ + @ExcelProperty(value = "年度支出余额") + private BigDecimal annualExpenditureBalance; + + /** + * 年度累计支出 + */ + @ExcelProperty(value = "年度累计支出") + private BigDecimal annualCumulativeExpenditure; + + /** + * 文件ID + */ + @ExcelProperty(value = "文件ID") + private String fileId; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 审核状态 + */ + @ExcelProperty(value = "审核状态") + private String auditStatus; + + /** + * 创建部门 + */ + @TableField(fill = FieldFill.INSERT) + private Long createDept; + + + @ExcelProperty(value = "创建部门名称") + @Translation(type = TransConstant.DEPT_ID_TO_NAME, mapper = "createDept") + private String createDeptName; + + /** + * 创建者 + */ + @ExcelProperty(value = "创建者") + @TableField(fill = FieldFill.INSERT) + private Long createBy; + + @ExcelProperty(value = "创建者名称") + @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy") + private String createByName; + + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + + /** + * 收入明细 + */ + private List detailOfEarnings; + + /** + * 支出明细 + */ + private List statementOfExpenditures; + + + + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/vo/StatementOfExpendituresVo.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/vo/StatementOfExpendituresVo.java new file mode 100644 index 00000000..c35c4f90 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/domain/vo/StatementOfExpendituresVo.java @@ -0,0 +1,171 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo; + +import java.math.BigDecimal; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.StatementOfExpenditures; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 资金计划-支出明细视图对象 statement_of_expenditures + * + * @author Lion Li + * @date 2025-10-16 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = StatementOfExpenditures.class) +public class StatementOfExpendituresVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 月度资金id + */ + @ExcelProperty(value = "月度资金id") + private Long financialRevenueId; + + /** + * 预算项 + */ + @ExcelProperty(value = "预算项") + private String budgetItem; + + /** + * 支出类型 + */ + @ExcelProperty(value = "支出类型") + private String expenseType; + + /** + * 支出金额 + */ + @ExcelProperty(value = "支出金额") + private BigDecimal expenseAmount; + + /** + * 变更后金额 + */ + @ExcelProperty(value = "变更后金额") + private BigDecimal changedAmount; + + /** + * CBS + */ + @ExcelProperty(value = "CBS") + private Long cbs; + + /** + * CBS名称 + */ + @ExcelProperty(value = "CBS名称") + private String cbsName; + + /** + * CBS金额 + */ + @ExcelProperty(value = "CBS金额") + private BigDecimal cbsAmount; + + /** + * CBS余额 + */ + @ExcelProperty(value = "CBS余额") + private BigDecimal cbsBalance; + + /** + * 供应商 + */ + @ExcelProperty(value = "供应商") + private Long supplier; + + /** + * 供应商名称 + */ + @ExcelProperty(value = "供应商名称") + private String supplierName; + + /** + * 合同编码 + */ + @ExcelProperty(value = "合同编码") + private Long contractCode; + + /** + * 合同编码名称 + */ + @ExcelProperty(value = "合同编码名称") + private String contractCodeName; + + /** + * 合同名称 + */ + @ExcelProperty(value = "合同名称") + private String contractName; + + /** + * 合同金额 + */ + @ExcelProperty(value = "合同金额") + private BigDecimal contractAmount; + + /** + * + * 变更原因 + */ + private String reasonsForChange; + + /** + * 累计进度结算金额 + */ + @ExcelProperty(value = "累计进度结算金额") + private BigDecimal cumulativeProgressSettlement; + + /** + * 累计支付金额 + */ + @ExcelProperty(value = "累计支付金额") + private BigDecimal cumulativePaymentAmount; + + /** + * 累计收票金额 + */ + @ExcelProperty(value = "累计收票金额") + private BigDecimal cumulativeInvoiceAmount; + + /** + * 截止至本期应付款金额 + */ + @ExcelProperty(value = "截止至本期应付款金额") + private BigDecimal currentPeriodPayableAmount; + + /** + * 累计支付占合同比例 + */ + @ExcelProperty(value = "累计支付占合同比例") + private BigDecimal paymentContractRatio; + + /** + * 截止至本期进度支付占截止至本期应付款金额的比例 + */ + @ExcelProperty(value = "截止至本期进度支付占截止至本期应付款金额的比例") + private BigDecimal progressPaymentToCurrentPayableRatio; + + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/mapper/DetailOfEarningsMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/mapper/DetailOfEarningsMapper.java new file mode 100644 index 00000000..db95028e --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/mapper/DetailOfEarningsMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.mapper; + +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.DetailOfEarnings; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.DetailOfEarningsVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 资金计划-收入明细Mapper接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface DetailOfEarningsMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/mapper/FinancialRevenueExpenditurePlanMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/mapper/FinancialRevenueExpenditurePlanMapper.java new file mode 100644 index 00000000..c0e691b2 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/mapper/FinancialRevenueExpenditurePlanMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.mapper; + +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.FinancialRevenueExpenditurePlan; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.FinancialRevenueExpenditurePlanVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 月度资金计划Mapper接口 + * + * @author Lion Li + * @date 2025-10-15 + */ +public interface FinancialRevenueExpenditurePlanMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/mapper/StatementOfExpendituresMapper.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/mapper/StatementOfExpendituresMapper.java new file mode 100644 index 00000000..7c04ec4c --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/mapper/StatementOfExpendituresMapper.java @@ -0,0 +1,15 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.mapper; + +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.StatementOfExpenditures; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.StatementOfExpendituresVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 资金计划-支出明细Mapper接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface StatementOfExpendituresMapper extends BaseMapperPlus { + +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/IDetailOfEarningsService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/IDetailOfEarningsService.java new file mode 100644 index 00000000..12a59c0f --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/IDetailOfEarningsService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.service; + +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.DetailOfEarningsVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.DetailOfEarningsBo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.DetailOfEarnings; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 资金计划-收入明细Service接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface IDetailOfEarningsService extends IService{ + + /** + * 查询资金计划-收入明细 + * + * @param id 主键 + * @return 资金计划-收入明细 + */ + DetailOfEarningsVo queryById(Long id); + + /** + * 分页查询资金计划-收入明细列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 资金计划-收入明细分页列表 + */ + TableDataInfo queryPageList(DetailOfEarningsBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的资金计划-收入明细列表 + * + * @param bo 查询条件 + * @return 资金计划-收入明细列表 + */ + List queryList(DetailOfEarningsBo bo); + + /** + * 新增资金计划-收入明细 + * + * @param bo 资金计划-收入明细 + * @return 是否新增成功 + */ + Boolean insertByBo(DetailOfEarningsBo bo); + + /** + * 修改资金计划-收入明细 + * + * @param bo 资金计划-收入明细 + * @return 是否修改成功 + */ + Boolean updateByBo(DetailOfEarningsBo bo); + + /** + * 校验并批量删除资金计划-收入明细信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/IFinancialRevenueExpenditurePlanService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/IFinancialRevenueExpenditurePlanService.java new file mode 100644 index 00000000..8cb5ffaf --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/IFinancialRevenueExpenditurePlanService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.service; + +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.FinancialRevenueExpenditurePlanVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.FinancialRevenueExpenditurePlanBo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.FinancialRevenueExpenditurePlan; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 月度资金计划Service接口 + * + * @author Lion Li + * @date 2025-10-15 + */ +public interface IFinancialRevenueExpenditurePlanService extends IService{ + + /** + * 查询月度资金计划 + * + * @param id 主键 + * @return 月度资金计划 + */ + FinancialRevenueExpenditurePlanVo queryById(Long id); + + /** + * 分页查询月度资金计划列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 月度资金计划分页列表 + */ + TableDataInfo queryPageList(FinancialRevenueExpenditurePlanBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的月度资金计划列表 + * + * @param bo 查询条件 + * @return 月度资金计划列表 + */ + List queryList(FinancialRevenueExpenditurePlanBo bo); + + /** + * 新增月度资金计划 + * + * @param bo 月度资金计划 + * @return 是否新增成功 + */ + Boolean insertByBo(FinancialRevenueExpenditurePlanBo bo); + + /** + * 修改月度资金计划 + * + * @param bo 月度资金计划 + * @return 是否修改成功 + */ + Boolean updateByBo(FinancialRevenueExpenditurePlanBo bo); + + /** + * 校验并批量删除月度资金计划信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/IStatementOfExpendituresService.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/IStatementOfExpendituresService.java new file mode 100644 index 00000000..4c65b907 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/IStatementOfExpendituresService.java @@ -0,0 +1,70 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.service; + +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.StatementOfExpendituresVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.StatementOfExpendituresBo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.StatementOfExpenditures; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Collection; +import java.util.List; + +/** + * 资金计划-支出明细Service接口 + * + * @author Lion Li + * @date 2025-10-16 + */ +public interface IStatementOfExpendituresService extends IService{ + + /** + * 查询资金计划-支出明细 + * + * @param id 主键 + * @return 资金计划-支出明细 + */ + StatementOfExpendituresVo queryById(Long id); + + /** + * 分页查询资金计划-支出明细列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 资金计划-支出明细分页列表 + */ + TableDataInfo queryPageList(StatementOfExpendituresBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的资金计划-支出明细列表 + * + * @param bo 查询条件 + * @return 资金计划-支出明细列表 + */ + List queryList(StatementOfExpendituresBo bo); + + /** + * 新增资金计划-支出明细 + * + * @param bo 资金计划-支出明细 + * @return 是否新增成功 + */ + Boolean insertByBo(StatementOfExpendituresBo bo); + + /** + * 修改资金计划-支出明细 + * + * @param bo 资金计划-支出明细 + * @return 是否修改成功 + */ + Boolean updateByBo(StatementOfExpendituresBo bo); + + /** + * 校验并批量删除资金计划-支出明细信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/impl/DetailOfEarningsServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/impl/DetailOfEarningsServiceImpl.java new file mode 100644 index 00000000..a7e17b53 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/impl/DetailOfEarningsServiceImpl.java @@ -0,0 +1,145 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.DetailOfEarningsBo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.DetailOfEarningsVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.DetailOfEarnings; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.mapper.DetailOfEarningsMapper; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.service.IDetailOfEarningsService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 资金计划-收入明细Service业务层处理 + * + * @author Lion Li + * @date 2025-10-16 + */ +@RequiredArgsConstructor +@Service +public class DetailOfEarningsServiceImpl extends ServiceImpl implements IDetailOfEarningsService { + + private final DetailOfEarningsMapper baseMapper; + + /** + * 查询资金计划-收入明细 + * + * @param id 主键 + * @return 资金计划-收入明细 + */ + @Override + public DetailOfEarningsVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询资金计划-收入明细列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 资金计划-收入明细分页列表 + */ + @Override + public TableDataInfo queryPageList(DetailOfEarningsBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的资金计划-收入明细列表 + * + * @param bo 查询条件 + * @return 资金计划-收入明细列表 + */ + @Override + public List queryList(DetailOfEarningsBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(DetailOfEarningsBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(DetailOfEarnings::getId); + lqw.eq(bo.getFinancialRevenueId() != null, DetailOfEarnings::getFinancialRevenueId, bo.getFinancialRevenueId()); + lqw.eq(StringUtils.isNotBlank(bo.getBudgetItem()), DetailOfEarnings::getBudgetItem, bo.getBudgetItem()); + lqw.eq(bo.getIncomeAmount() != null, DetailOfEarnings::getIncomeAmount, bo.getIncomeAmount()); + lqw.eq(StringUtils.isNotBlank(bo.getIsInvoice()), DetailOfEarnings::getIsInvoice, bo.getIsInvoice()); + lqw.eq(bo.getChangedAmount() != null, DetailOfEarnings::getChangedAmount, bo.getChangedAmount()); + lqw.eq(bo.getCbs() != null, DetailOfEarnings::getCbs, bo.getCbs()); + lqw.eq(bo.getCbsAmount() != null, DetailOfEarnings::getCbsAmount, bo.getCbsAmount()); + lqw.eq(bo.getCbsBalance() != null, DetailOfEarnings::getCbsBalance, bo.getCbsBalance()); + lqw.eq(bo.getPartyAUnit() != null, DetailOfEarnings::getPartyAUnit, bo.getPartyAUnit()); + lqw.eq(bo.getContractCode() != null, DetailOfEarnings::getContractCode, bo.getContractCode()); + lqw.like(StringUtils.isNotBlank(bo.getContractName()), DetailOfEarnings::getContractName, bo.getContractName()); + lqw.eq(bo.getContractAmount() != null, DetailOfEarnings::getContractAmount, bo.getContractAmount()); + lqw.eq(bo.getCumulativeApprovedOutputValue() != null, DetailOfEarnings::getCumulativeApprovedOutputValue, bo.getCumulativeApprovedOutputValue()); + lqw.eq(bo.getCumulativeReceiptAmount() != null, DetailOfEarnings::getCumulativeReceiptAmount, bo.getCumulativeReceiptAmount()); + lqw.eq(bo.getSettlementRatio() != null, DetailOfEarnings::getSettlementRatio, bo.getSettlementRatio()); + lqw.eq(bo.getReceiptRatio() != null, DetailOfEarnings::getReceiptRatio, bo.getReceiptRatio()); + return lqw; + } + + /** + * 新增资金计划-收入明细 + * + * @param bo 资金计划-收入明细 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(DetailOfEarningsBo bo) { + DetailOfEarnings add = MapstructUtils.convert(bo, DetailOfEarnings.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改资金计划-收入明细 + * + * @param bo 资金计划-收入明细 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(DetailOfEarningsBo bo) { + DetailOfEarnings update = MapstructUtils.convert(bo, DetailOfEarnings.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(DetailOfEarnings entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除资金计划-收入明细信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/impl/FinancialRevenueExpenditurePlanServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/impl/FinancialRevenueExpenditurePlanServiceImpl.java new file mode 100644 index 00000000..79565b72 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/impl/FinancialRevenueExpenditurePlanServiceImpl.java @@ -0,0 +1,336 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.dromara.system.service.impl.SysOssServiceImpl; +import org.dromara.xzd.contractManagement.caigoucontractTermination.domain.vo.XzdPurchaseContractSuspendVo; +import org.dromara.xzd.contractManagement.fenbaohetongxinxi.domain.XzdSubcontract; +import org.dromara.xzd.contractManagement.fenbaohetongxinxi.domain.vo.XzdSubcontractVo; +import org.dromara.xzd.domain.*; +import org.dromara.xzd.domain.dto.QuerCorrespondentDto; +import org.dromara.xzd.service.IXzdContractDetailsService; +import org.dromara.xzd.service.IXzdCorrespondentList; +import org.dromara.xzd.service.impl.XzdProjectServiceImpl; +import org.dromara.xzd.service.impl.XzdSupplierInfoServiceImpl; +import org.dromara.xzd.utilS.AreaUtil; +import org.dromara.xzd.zijinjihua.service.ICbsTreeStructureService; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.DetailOfEarnings; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.StatementOfExpenditures; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.DetailOfEarningsBo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.StatementOfExpendituresBo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.DetailOfEarningsVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.StatementOfExpendituresVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.service.IDetailOfEarningsService; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.service.IStatementOfExpendituresService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.FinancialRevenueExpenditurePlanBo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.FinancialRevenueExpenditurePlanVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.FinancialRevenueExpenditurePlan; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.mapper.FinancialRevenueExpenditurePlanMapper; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.service.IFinancialRevenueExpenditurePlanService; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDate; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 月度资金计划Service业务层处理 + * + * @author Lion Li + * @date 2025-10-15 + */ +@RequiredArgsConstructor +@Service +public class FinancialRevenueExpenditurePlanServiceImpl extends ServiceImpl implements IFinancialRevenueExpenditurePlanService { + + private final FinancialRevenueExpenditurePlanMapper baseMapper; + private final AreaUtil areaUtil; + + + private final IDetailOfEarningsService iDetailOfEarningsService; + + + private final IStatementOfExpendituresService iStatementOfExpendituresService; + + + private final IXzdContractDetailsService xzdContractDetailsService; + private final ICbsTreeStructureService iCbsTreeStructureService; + + @Autowired + private XzdProjectServiceImpl xzdProjectService; + + @Autowired + private IXzdCorrespondentList iXzdCorrespondentList; + + + @Autowired + private XzdSupplierInfoServiceImpl xzdSupplierInfoService; + + @Autowired + private SysOssServiceImpl sysOssService; + + + + /** + * 查询月度资金计划 + * + * @param id 主键 + * @return 月度资金计划 + */ + @Override + public FinancialRevenueExpenditurePlanVo queryById(Long id){ + FinancialRevenueExpenditurePlanVo financialRevenueExpenditurePlanVo = baseMapper.selectVoById(id); + List vo = List.of(financialRevenueExpenditurePlanVo); + savaValue(vo,true); + return vo.getFirst(); + } + + /** + * 分页查询月度资金计划列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 月度资金计划分页列表 + */ + @Override + public TableDataInfo queryPageList(FinancialRevenueExpenditurePlanBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + savaValue(result.getRecords(),false); + return TableDataInfo.build(result); + } + + private void savaValue(List records,Boolean type) { + for (FinancialRevenueExpenditurePlanVo item : records) { + //项目名称 + if (item.getProject() != null){ + String projectName = xzdProjectService.queryNameById(item.getProject()); + if (projectName != null){ + item.setProjectName(projectName); + } + } + HashMap hashMap = new HashMap<>(); + hashMap.put("financial_revenue_id",item.getId()); +// 收入 + List detail = iDetailOfEarningsService.getBaseMapper().selectByMap(hashMap); + if (detail != null && detail.size() > 0){ + List convert = MapstructUtils.convert(detail, DetailOfEarningsVo.class); + if (type){ + convert.forEach(temp ->{ + //甲方单位(客户信息列表) + R byid = iXzdCorrespondentList.getCustomerByid(temp.getPartyAUnit()); + if (byid!=null){ + if (byid.getData().getXzdCustomerinformation() != null){ + temp.setPartyAUnitName(byid.getData().getXzdCustomerinformation().getUnitName()); + } + } +// cbs + Long cbs = temp.getCbs(); + if (cbs != null){ + String name = iCbsTreeStructureService.queryById(cbs).getName(); + temp.setCbsName(name); + } + +// 合同 + XzdContractDetails contractDetailsServiceById = xzdContractDetailsService.getById(temp.getContractCode()); + if(contractDetailsServiceById != null){ + temp.setContractCodeName(contractDetailsServiceById.getContractCode()); + } + }); + } + item.setDetailOfEarnings(convert); + } +// 支出 + List statementOfExpenditures = iStatementOfExpendituresService.getBaseMapper().selectByMap(hashMap); + if (statementOfExpenditures != null && statementOfExpenditures.size() > 0){ + List convert = MapstructUtils.convert(statementOfExpenditures, StatementOfExpendituresVo.class); + if (type){ + convert.forEach(temp ->{ + //供应商 supplier + String unitName = xzdSupplierInfoService.queryNameById(temp.getSupplier()); + if (StringUtils.isNotBlank(unitName)){ + temp.setSupplierName(unitName); + } + Long cbs = temp.getCbs(); + if (cbs != null){ + String name = iCbsTreeStructureService.queryById(cbs).getName(); + temp.setCbsName(name); + } +// 合同 + XzdContractDetails contractDetailsServiceById = xzdContractDetailsService.getById(temp.getContractCode()); + if(contractDetailsServiceById != null){ + temp.setContractCodeName(contractDetailsServiceById.getContractCode()); + } + + }); + } + item.setStatementOfExpenditures(convert); + } + } + + } + + /** + * 查询符合条件的月度资金计划列表 + * + * @param bo 查询条件 + * @return 月度资金计划列表 + */ + @Override + public List queryList(FinancialRevenueExpenditurePlanBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(FinancialRevenueExpenditurePlanBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(FinancialRevenueExpenditurePlan::getId); + lqw.eq(StringUtils.isNotBlank(bo.getDocumentCode()), FinancialRevenueExpenditurePlan::getDocumentCode, bo.getDocumentCode()); + lqw.like(StringUtils.isNotBlank(bo.getDocumentName()), FinancialRevenueExpenditurePlan::getDocumentName, bo.getDocumentName()); + lqw.eq(bo.getProject() != null, FinancialRevenueExpenditurePlan::getProject, bo.getProject()); + lqw.eq(StringUtils.isNotBlank(bo.getPlanType()), FinancialRevenueExpenditurePlan::getPlanType, bo.getPlanType()); + lqw.eq(bo.getWorkCycle() != null, FinancialRevenueExpenditurePlan::getWorkCycle, bo.getWorkCycle()); + lqw.eq(bo.getStartDate() != null, FinancialRevenueExpenditurePlan::getStartDate, bo.getStartDate()); + lqw.eq(bo.getEndDate() != null, FinancialRevenueExpenditurePlan::getEndDate, bo.getEndDate()); + lqw.eq(bo.getExpenseTotal() != null, FinancialRevenueExpenditurePlan::getExpenseTotal, bo.getExpenseTotal()); + lqw.eq(bo.getIncomeTotal() != null, FinancialRevenueExpenditurePlan::getIncomeTotal, bo.getIncomeTotal()); + lqw.eq(StringUtils.isNotBlank(bo.getIsTemporaryPlan()), FinancialRevenueExpenditurePlan::getIsTemporaryPlan, bo.getIsTemporaryPlan()); + lqw.eq(bo.getDocumentDateLastMonth() != null, FinancialRevenueExpenditurePlan::getDocumentDateLastMonth, bo.getDocumentDateLastMonth()); + lqw.eq(StringUtils.isNotBlank(bo.getRemarks()), FinancialRevenueExpenditurePlan::getRemarks, bo.getRemarks()); + lqw.eq(bo.getProjectAvailableBalance() != null, FinancialRevenueExpenditurePlan::getProjectAvailableBalance, bo.getProjectAvailableBalance()); + lqw.eq(bo.getCumulativeReceiptAmount() != null, FinancialRevenueExpenditurePlan::getCumulativeReceiptAmount, bo.getCumulativeReceiptAmount()); + lqw.eq(bo.getCumulativePaymentAmount() != null, FinancialRevenueExpenditurePlan::getCumulativePaymentAmount, bo.getCumulativePaymentAmount()); + lqw.eq(bo.getReimbursementAmount() != null, FinancialRevenueExpenditurePlan::getReimbursementAmount, bo.getReimbursementAmount()); + lqw.eq(bo.getContractPaymentAmount() != null, FinancialRevenueExpenditurePlan::getContractPaymentAmount, bo.getContractPaymentAmount()); + lqw.eq(bo.getRemainingFunds() != null, FinancialRevenueExpenditurePlan::getRemainingFunds, bo.getRemainingFunds()); + lqw.eq(bo.getRealTimeRefresh() != null, FinancialRevenueExpenditurePlan::getRealTimeRefresh, bo.getRealTimeRefresh()); + lqw.eq(bo.getMonthlyExpenditureBalance() != null, FinancialRevenueExpenditurePlan::getMonthlyExpenditureBalance, bo.getMonthlyExpenditureBalance()); + lqw.eq(bo.getMonthlyCumulativeExpenditure() != null, FinancialRevenueExpenditurePlan::getMonthlyCumulativeExpenditure, bo.getMonthlyCumulativeExpenditure()); + lqw.eq(bo.getAnnualExpenditureBalance() != null, FinancialRevenueExpenditurePlan::getAnnualExpenditureBalance, bo.getAnnualExpenditureBalance()); + lqw.eq(bo.getAnnualCumulativeExpenditure() != null, FinancialRevenueExpenditurePlan::getAnnualCumulativeExpenditure, bo.getAnnualCumulativeExpenditure()); + lqw.eq(StringUtils.isNotBlank(bo.getFileId()), FinancialRevenueExpenditurePlan::getFileId, bo.getFileId()); + lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), FinancialRevenueExpenditurePlan::getAuditStatus, bo.getAuditStatus()); + return lqw; + } + + /** + * 新增月度资金计划 + * + * @param bo 月度资金计划 + * @return 是否新增成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean insertByBo(FinancialRevenueExpenditurePlanBo bo) { + FinancialRevenueExpenditurePlan add = MapstructUtils.convert(bo, FinancialRevenueExpenditurePlan.class); + validEntityBeforeSave(add); + Long l = baseMapper.selectCount(new LambdaQueryWrapper().gt(FinancialRevenueExpenditurePlan::getCreateTime, LocalDate.now())); + String s = areaUtil.generateDateBasedNumber(); + add.setDocumentCode(s+"-"+(l+1)); + boolean flag = baseMapper.insert(add) > 0; + +// 收入明细 + List detailOfEarnings = bo.getDetailOfEarnings(); + if (detailOfEarnings != null && detailOfEarnings.size() > 0) { + detailOfEarnings.forEach(item -> { + item.setFinancialRevenueId(add.getId() ); + }); + iDetailOfEarningsService.saveBatch(MapstructUtils.convert(detailOfEarnings, DetailOfEarnings.class)); + } + +// 支出明细 + List statementOfExpenditures = bo.getStatementOfExpenditures(); + statementOfExpenditures.forEach(item -> { + item.setFinancialRevenueId(add.getId()); + }); + iStatementOfExpendituresService.saveBatch(MapstructUtils.convert(statementOfExpenditures, StatementOfExpenditures.class)); + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改月度资金计划 + * + * @param bo 月度资金计划 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(FinancialRevenueExpenditurePlanBo bo) { + FinancialRevenueExpenditurePlan update = MapstructUtils.convert(bo, FinancialRevenueExpenditurePlan.class); + List detailOfEarnings = bo.getDetailOfEarnings(); + HashMap hashMap = new HashMap<>(); + hashMap.put("financial_revenue_id",bo.getId()); +// 收入 + iDetailOfEarningsService.getBaseMapper().deleteByMap(hashMap); + if (detailOfEarnings != null && detailOfEarnings.size() > 0) { + detailOfEarnings.forEach(item ->{ + item.setFinancialRevenueId(bo.getId()); + }); + iDetailOfEarningsService.saveBatch(MapstructUtils.convert(detailOfEarnings, DetailOfEarnings.class)); + } +// 支出 + iStatementOfExpendituresService.getBaseMapper().deleteByMap(hashMap); + List statementOfExpenditures = bo.getStatementOfExpenditures(); + if (statementOfExpenditures != null && statementOfExpenditures.size() > 0) { + statementOfExpenditures.forEach(item ->{ + item.setFinancialRevenueId(bo.getId()); + }); + iStatementOfExpendituresService.saveBatch(MapstructUtils.convert(statementOfExpenditures, StatementOfExpenditures.class)); + } + + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(FinancialRevenueExpenditurePlan entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除月度资金计划信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + + } + for (Long id : ids) { + FinancialRevenueExpenditurePlanVo vo = baseMapper.selectVoById(id); + // 删除附件 + if (!StringUtils.isEmpty(vo.getFileId())){ + List collect = Arrays.stream(vo.getFileId().split(",")).map(item -> { + return Long.parseLong(item); + }).collect(Collectors.toList()); + sysOssService.deleteWithValidByIds(collect, false); + } + } +// 删除支出,收入 + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.in(DetailOfEarnings::getFinancialRevenueId, ids); + iDetailOfEarningsService.getBaseMapper().delete(lambdaQueryWrapper); + + LambdaQueryWrapper lambdaQueryWrapper1 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper1.in(StatementOfExpenditures::getFinancialRevenueId, ids); + iStatementOfExpendituresService.getBaseMapper().delete(lambdaQueryWrapper1); + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/impl/StatementOfExpendituresServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/impl/StatementOfExpendituresServiceImpl.java new file mode 100644 index 00000000..a7750f15 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/xzd/zijinjihua/yueduzijinjihua/service/impl/StatementOfExpendituresServiceImpl.java @@ -0,0 +1,147 @@ +package org.dromara.xzd.zijinjihua.yueduzijinjihua.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.bo.StatementOfExpendituresBo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.vo.StatementOfExpendituresVo; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.domain.StatementOfExpenditures; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.mapper.StatementOfExpendituresMapper; +import org.dromara.xzd.zijinjihua.yueduzijinjihua.service.IStatementOfExpendituresService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 资金计划-支出明细Service业务层处理 + * + * @author Lion Li + * @date 2025-10-16 + */ +@RequiredArgsConstructor +@Service +public class StatementOfExpendituresServiceImpl extends ServiceImpl implements IStatementOfExpendituresService { + + private final StatementOfExpendituresMapper baseMapper; + + /** + * 查询资金计划-支出明细 + * + * @param id 主键 + * @return 资金计划-支出明细 + */ + @Override + public StatementOfExpendituresVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询资金计划-支出明细列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 资金计划-支出明细分页列表 + */ + @Override + public TableDataInfo queryPageList(StatementOfExpendituresBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的资金计划-支出明细列表 + * + * @param bo 查询条件 + * @return 资金计划-支出明细列表 + */ + @Override + public List queryList(StatementOfExpendituresBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(StatementOfExpendituresBo bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(StatementOfExpenditures::getId); + lqw.eq(bo.getFinancialRevenueId() != null, StatementOfExpenditures::getFinancialRevenueId, bo.getFinancialRevenueId()); + lqw.eq(StringUtils.isNotBlank(bo.getBudgetItem()), StatementOfExpenditures::getBudgetItem, bo.getBudgetItem()); + lqw.eq(StringUtils.isNotBlank(bo.getExpenseType()), StatementOfExpenditures::getExpenseType, bo.getExpenseType()); + lqw.eq(bo.getExpenseAmount() != null, StatementOfExpenditures::getExpenseAmount, bo.getExpenseAmount()); + lqw.eq(bo.getChangedAmount() != null, StatementOfExpenditures::getChangedAmount, bo.getChangedAmount()); + lqw.eq(bo.getCbs() != null, StatementOfExpenditures::getCbs, bo.getCbs()); + lqw.eq(bo.getCbsAmount() != null, StatementOfExpenditures::getCbsAmount, bo.getCbsAmount()); + lqw.eq(bo.getCbsBalance() != null, StatementOfExpenditures::getCbsBalance, bo.getCbsBalance()); + lqw.eq(bo.getSupplier() != null, StatementOfExpenditures::getSupplier, bo.getSupplier()); + lqw.eq(bo.getContractCode() != null, StatementOfExpenditures::getContractCode, bo.getContractCode()); + lqw.like(StringUtils.isNotBlank(bo.getContractName()), StatementOfExpenditures::getContractName, bo.getContractName()); + lqw.eq(bo.getContractAmount() != null, StatementOfExpenditures::getContractAmount, bo.getContractAmount()); + lqw.eq(bo.getCumulativeProgressSettlement() != null, StatementOfExpenditures::getCumulativeProgressSettlement, bo.getCumulativeProgressSettlement()); + lqw.eq(bo.getCumulativePaymentAmount() != null, StatementOfExpenditures::getCumulativePaymentAmount, bo.getCumulativePaymentAmount()); + lqw.eq(bo.getCumulativeInvoiceAmount() != null, StatementOfExpenditures::getCumulativeInvoiceAmount, bo.getCumulativeInvoiceAmount()); + lqw.eq(bo.getCurrentPeriodPayableAmount() != null, StatementOfExpenditures::getCurrentPeriodPayableAmount, bo.getCurrentPeriodPayableAmount()); + lqw.eq(bo.getPaymentContractRatio() != null, StatementOfExpenditures::getPaymentContractRatio, bo.getPaymentContractRatio()); + lqw.eq(bo.getProgressPaymentToCurrentPayableRatio() != null, StatementOfExpenditures::getProgressPaymentToCurrentPayableRatio, bo.getProgressPaymentToCurrentPayableRatio()); + return lqw; + } + + /** + * 新增资金计划-支出明细 + * + * @param bo 资金计划-支出明细 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(StatementOfExpendituresBo bo) { + StatementOfExpenditures add = MapstructUtils.convert(bo, StatementOfExpenditures.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改资金计划-支出明细 + * + * @param bo 资金计划-支出明细 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(StatementOfExpendituresBo bo) { + StatementOfExpenditures update = MapstructUtils.convert(bo, StatementOfExpenditures.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(StatementOfExpenditures entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除资金计划-支出明细信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +}