From dfc135e42d184419cc974c3836a0f5ceca1fb5a8 Mon Sep 17 00:00:00 2001 From: bobol Date: Fri, 22 Dec 2023 08:53:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=8D=95=E6=8D=AE=E5=BD=95?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcBusiPlanBillMasterController.java | 131 +++++++++++++ .../DcBusiPlanBillSubController.java | 131 +++++++++++++ .../bill/domain/DcBusiPlanBillMaster.java | 85 +++++++++ .../lzbi/bill/domain/DcBusiPlanBillSub.java | 82 +++++++++ .../mapper/DcBusiPlanBillMasterMapper.java | 89 +++++++++ .../bill/mapper/DcBusiPlanBillSubMapper.java | 63 +++++++ .../service/DcBusiPlanBillMasterService.java | 130 +++++++++++++ .../service/DcBusiPlanBillSubService.java | 91 +++++++++ .../asset/DcBusiPlanBillMasterMapper.xml | 174 ++++++++++++++++++ .../mapper/asset/DcBusiPlanBillSubMapper.xml | 138 ++++++++++++++ 10 files changed, 1114 insertions(+) create mode 100644 lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiPlanBillMasterController.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiPlanBillSubController.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanBillMaster.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanBillSub.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiPlanBillMasterMapper.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiPlanBillSubMapper.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanBillMasterService.java create mode 100644 lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanBillSubService.java create mode 100644 lzbi-module/src/main/resources/mapper/asset/DcBusiPlanBillMasterMapper.xml create mode 100644 lzbi-module/src/main/resources/mapper/asset/DcBusiPlanBillSubMapper.xml diff --git a/lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiPlanBillMasterController.java b/lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiPlanBillMasterController.java new file mode 100644 index 0000000..6676bb8 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiPlanBillMasterController.java @@ -0,0 +1,131 @@ +package com.lzbi.bill.controller; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.lzbi.common.annotation.Log; +import com.lzbi.common.core.controller.BaseController; +import com.lzbi.common.core.domain.AjaxResult; +import com.lzbi.common.enums.BusinessType; +import com.lzbi.bill.domain. DcBusiPlanBillMaster; +import com.lzbi.bill.service.DcBusiPlanBillMasterService; +import com.lzbi.common.utils.poi.ExcelUtil; +import com.lzbi.common.core.page.TableDataInfo; + +/** + * 计划单据主Controller + * + * @author lienbo + * @date 2023-12-21 + */ +@RestController +@RequestMapping("/bill/planBillMaster") +public class DcBusiPlanBillMasterController extends BaseController +{ + @Autowired + private DcBusiPlanBillMasterService dcBusiPlanBillMasterService; + + /** + * 查询计划单据主列表 + */ + @ApiOperation("查询计划单据主列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBusiPlanBillMaster", value = "", dataType = "DcBusiPlanBillMaster", dataTypeClass = DcBusiPlanBillMaster.class), + }) + @PreAuthorize("@ss.hasPermi('bill:planBillMaster:list')") + @GetMapping("/list") + public TableDataInfo list(DcBusiPlanBillMaster DcBusiPlanBillMaster) + { + startPage(); + List< DcBusiPlanBillMaster> list = dcBusiPlanBillMasterService.selectDcBusiPlanBillMasterList(DcBusiPlanBillMaster); + return getDataTable(list); + } + + /** + * 导出计划单据主列表 + */ + @ApiOperation("导出计划单据主列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBusiPlanBillMaster", value = "", dataType = "DcBusiPlanBillMaster", dataTypeClass = DcBusiPlanBillMaster.class), + }) + @PreAuthorize("@ss.hasPermi('bill:planBillMaster:export')") + @Log(title = "计划单据主", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response,DcBusiPlanBillMaster DcBusiPlanBillMaster) + { + List list = dcBusiPlanBillMasterService.selectDcBusiPlanBillMasterList(DcBusiPlanBillMaster); + ExcelUtil util = new ExcelUtil(DcBusiPlanBillMaster.class); + util.exportExcel(response, list, "计划单据主数据"); + } + + /** + * 获取计划单据主详细信息 + */ + @ApiOperation("获取计划单据主详细信息") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class), + }) + @PreAuthorize("@ss.hasPermi('bill:planBillMaster:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(dcBusiPlanBillMasterService.selectDcBusiPlanBillMasterById(id)); + } + + /** + * 新增计划单据主 + */ + @ApiOperation("新增计划单据主") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBusiPlanBillMaster", value = "", dataType = "DcBusiPlanBillMaster", dataTypeClass = DcBusiPlanBillMaster.class), + }) + @PreAuthorize("@ss.hasPermi('bill:planBillMaster:add')") + @Log(title = "计划单据主", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DcBusiPlanBillMaster DcBusiPlanBillMaster) + { + return toAjax(dcBusiPlanBillMasterService.insertDcBusiPlanBillMaster(DcBusiPlanBillMaster)); + } + + /** + * 修改计划单据主 + */ + + @ApiOperation("修改计划单据主") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBusiPlanBillMaster", value = "", dataType = "DcBusiPlanBillMaster", dataTypeClass = DcBusiPlanBillMaster.class), + }) + @PreAuthorize("@ss.hasPermi('bill:planBillMaster:edit')") + @Log(title = "计划单据主", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DcBusiPlanBillMaster DcBusiPlanBillMaster) + { + return toAjax(dcBusiPlanBillMasterService.updateDcBusiPlanBillMaster(DcBusiPlanBillMaster)); + } + + /** + * 删除计划单据主 + */ + @ApiOperation("删除计划单据主") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class), + }) + @PreAuthorize("@ss.hasPermi('bill:planBillMaster:remove')") + @Log(title = "计划单据主", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dcBusiPlanBillMasterService.deleteDcBusiPlanBillMasterByIds(ids)); + } +} diff --git a/lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiPlanBillSubController.java b/lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiPlanBillSubController.java new file mode 100644 index 0000000..24d2982 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiPlanBillSubController.java @@ -0,0 +1,131 @@ +package com.lzbi.bill.controller; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.lzbi.common.annotation.Log; +import com.lzbi.common.core.controller.BaseController; +import com.lzbi.common.core.domain.AjaxResult; +import com.lzbi.common.enums.BusinessType; +import com.lzbi.bill.domain. DcBusiPlanBillSub; +import com.lzbi.bill.service.DcBusiPlanBillSubService; +import com.lzbi.common.utils.poi.ExcelUtil; +import com.lzbi.common.core.page.TableDataInfo; + +/** + * 计划单据明细Controller + * + * @author lienbo + * @date 2023-12-21 + */ +@RestController +@RequestMapping("/bill/planBillSub") +public class DcBusiPlanBillSubController extends BaseController +{ + @Autowired + private DcBusiPlanBillSubService dcBusiPlanBillSubService; + + /** + * 查询计划单据明细列表 + */ + @ApiOperation("查询计划单据明细列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBusiPlanBillSub", value = "", dataType = "DcBusiPlanBillSub", dataTypeClass = DcBusiPlanBillSub.class), + }) + @PreAuthorize("@ss.hasPermi('bill:planBillSub:list')") + @GetMapping("/list") + public TableDataInfo list(DcBusiPlanBillSub DcBusiPlanBillSub) + { + startPage(); + List< DcBusiPlanBillSub> list = dcBusiPlanBillSubService.selectDcBusiPlanBillSubList(DcBusiPlanBillSub); + return getDataTable(list); + } + + /** + * 导出计划单据明细列表 + */ + @ApiOperation("导出计划单据明细列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBusiPlanBillSub", value = "", dataType = "DcBusiPlanBillSub", dataTypeClass = DcBusiPlanBillSub.class), + }) + @PreAuthorize("@ss.hasPermi('bill:planBillSub:export')") + @Log(title = "计划单据明细", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response,DcBusiPlanBillSub DcBusiPlanBillSub) + { + List list = dcBusiPlanBillSubService.selectDcBusiPlanBillSubList(DcBusiPlanBillSub); + ExcelUtil util = new ExcelUtil(DcBusiPlanBillSub.class); + util.exportExcel(response, list, "计划单据明细数据"); + } + + /** + * 获取计划单据明细详细信息 + */ + @ApiOperation("获取计划单据明细详细信息") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class), + }) + @PreAuthorize("@ss.hasPermi('bill:planBillSub:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(dcBusiPlanBillSubService.selectDcBusiPlanBillSubById(id)); + } + + /** + * 新增计划单据明细 + */ + @ApiOperation("新增计划单据明细") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBusiPlanBillSub", value = "", dataType = "DcBusiPlanBillSub", dataTypeClass = DcBusiPlanBillSub.class), + }) + @PreAuthorize("@ss.hasPermi('bill:planBillSub:add')") + @Log(title = "计划单据明细", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DcBusiPlanBillSub DcBusiPlanBillSub) + { + return toAjax(dcBusiPlanBillSubService.insertDcBusiPlanBillSub(DcBusiPlanBillSub)); + } + + /** + * 修改计划单据明细 + */ + + @ApiOperation("修改计划单据明细") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBusiPlanBillSub", value = "", dataType = "DcBusiPlanBillSub", dataTypeClass = DcBusiPlanBillSub.class), + }) + @PreAuthorize("@ss.hasPermi('bill:planBillSub:edit')") + @Log(title = "计划单据明细", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DcBusiPlanBillSub DcBusiPlanBillSub) + { + return toAjax(dcBusiPlanBillSubService.updateDcBusiPlanBillSub(DcBusiPlanBillSub)); + } + + /** + * 删除计划单据明细 + */ + @ApiOperation("删除计划单据明细") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class), + }) + @PreAuthorize("@ss.hasPermi('bill:planBillSub:remove')") + @Log(title = "计划单据明细", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dcBusiPlanBillSubService.deleteDcBusiPlanBillSubByIds(ids)); + } +} diff --git a/lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanBillMaster.java b/lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanBillMaster.java new file mode 100644 index 0000000..0e471ba --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanBillMaster.java @@ -0,0 +1,85 @@ +package com.lzbi.bill.domain; + +import java.util.List; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import lombok.Data; +import io.swagger.annotations.ApiModelProperty; +import lombok.experimental.Accessors; +import com.lzbi.common.annotation.Excel; +import com.lzbi.module.base.BaseModuleEntity; + +/** + * 计划单据主对象 dc_busi_plan_bill_master + * + * @author lienbo + * @date 2023-12-21 + */ +@Data +@Accessors(chain = true) +public class DcBusiPlanBillMaster extends BaseModuleEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 单据编号 */ + @Excel(name = "单据编号") + @ApiModelProperty(name = "单据编号",notes = "billNo") + private String billNo; + + /** 采集时间 */ + @Excel(name = "采集时间") + @ApiModelProperty(name = "采集时间",notes = "billIncomeDate") + private String billIncomeDate; + + /** 单据类型 */ + @Excel(name = "单据类型") + @ApiModelProperty(name = "单据类型",notes = "billType") + private String billType; + + /** 审核类型 */ + @Excel(name = "审核类型") + @ApiModelProperty(name = "审核类型",notes = "checkType") + private String checkType; + + /** 审核状态 */ + @Excel(name = "审核状态") + @ApiModelProperty(name = "审核状态",notes = "checkStatus") + private String checkStatus; + + /** 创建人 */ + private String createdBy; + + /** 创建时间 */ + private Date createdTime; + + /** 更新人 */ + private String updatedBy; + + /** 更新时间 */ + private Date updatedTime; + + /** 公司ID */ + private Long companyId; + + /** 公司名称 */ + @Excel(name = "公司名称") + @ApiModelProperty(name = "公司名称",notes = "companyName") + private String companyName; + + /** 组织机构名称 */ + @Excel(name = "组织机构名称") + @ApiModelProperty(name = "组织机构名称",notes = "organizeName") + private String organizeName; + + /** 组织机构ID */ + private Long oragnizeId; + + /** 计划单据明细信息 */ + private List dcBusiPlanBillSubList; + +} diff --git a/lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanBillSub.java b/lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanBillSub.java new file mode 100644 index 0000000..ee32e88 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanBillSub.java @@ -0,0 +1,82 @@ +package com.lzbi.bill.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.lzbi.common.annotation.Excel; +import com.lzbi.module.base.BaseModuleEntity; + +/** + * 计划单据明细对象 dc_busi_plan_bill_sub + * + * @author lienbo + * @date 2023-12-21 + */ +@Data +public class DcBusiPlanBillSub +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 单据编码 */ + @Excel(name = "单据编码") + private String billNo; + + /** 所属专业 */ + @Excel(name = "所属专业") + private String fieldCode; + + /** 所属专业名称 */ + @Excel(name = "所属专业名称") + private String fieldName; + + /** 统计单元编码 */ + @Excel(name = "统计单元编码") + private String assetCode; + + /** 统计单元名称 */ + @Excel(name = "统计单元名称") + private String assetName; + + /** 指标编码 */ + @Excel(name = "指标编码") + private String targetCode; + + /** 指标名称 */ + @Excel(name = "指标名称") + private String tagetName; + + /** 参数值 */ + @Excel(name = "参数值") + private BigDecimal planValue; + + /** 年 */ + @Excel(name = "年") + private String dateYear; + + /** 月 */ + @Excel(name = "月") + private String dateMonth; + + /** 日 */ + @Excel(name = "日") + private String dateDay; + + /** 创建人 */ + private String createdBy; + + /** 创建时间 */ + private Date createdTime; + + /** 更新人 */ + private String updatedBy; + + /** 更新时间 */ + private Date updatedTime; + +} diff --git a/lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiPlanBillMasterMapper.java b/lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiPlanBillMasterMapper.java new file mode 100644 index 0000000..fe80d69 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiPlanBillMasterMapper.java @@ -0,0 +1,89 @@ +package com.lzbi.bill.mapper; + +import java.util.List; +import com.lzbi.bill.domain.DcBusiPlanBillMaster; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lzbi.bill.domain.DcBusiPlanBillSub; + +/** + * 计划单据主Mapper接口 + * + * @author lienbo + * @date 2023-12-21 + */ + +public interface DcBusiPlanBillMasterMapper extends BaseMapper +{ + /** + * 查询计划单据主 + * + * @param id 计划单据主主键 + * @return 计划单据主 + */ + public DcBusiPlanBillMaster selectDcBusiPlanBillMasterById(Long id); + + /** + * 查询计划单据主列表 + * + * @param dcBusiPlanBillMaster 计划单据主 + * @return 计划单据主集合 + */ + public List selectDcBusiPlanBillMasterList(DcBusiPlanBillMaster dcBusiPlanBillMaster); + + /** + * 新增计划单据主 + * + * @param dcBusiPlanBillMaster 计划单据主 + * @return 结果 + */ + public int insertDcBusiPlanBillMaster(DcBusiPlanBillMaster dcBusiPlanBillMaster); + + /** + * 修改计划单据主 + * + * @param dcBusiPlanBillMaster 计划单据主 + * @return 结果 + */ + public int updateDcBusiPlanBillMaster(DcBusiPlanBillMaster dcBusiPlanBillMaster); + + /** + * 删除计划单据主 + * + * @param id 计划单据主主键 + * @return 结果 + */ + public int deleteDcBusiPlanBillMasterById(Long id); + + /** + * 批量删除计划单据主 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDcBusiPlanBillMasterByIds(Long[] ids); + + /** + * 批量删除计划单据明细 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDcBusiPlanBillSubByBillNos(Long[] ids); + + /** + * 批量新增计划单据明细 + * + * @param dcBusiPlanBillSubList 计划单据明细列表 + * @return 结果 + */ + public int batchDcBusiPlanBillSub(List dcBusiPlanBillSubList); + + + /** + * 通过计划单据主主键删除计划单据明细信息 + * + * @param id 计划单据主ID + * @return 结果 + */ + public int deleteDcBusiPlanBillSubByBillNo(Long id); +} diff --git a/lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiPlanBillSubMapper.java b/lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiPlanBillSubMapper.java new file mode 100644 index 0000000..1508267 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiPlanBillSubMapper.java @@ -0,0 +1,63 @@ +package com.lzbi.bill.mapper; + +import java.util.List; +import com.lzbi.bill.domain.DcBusiPlanBillSub; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 计划单据明细Mapper接口 + * + * @author lienbo + * @date 2023-12-21 + */ + +public interface DcBusiPlanBillSubMapper extends BaseMapper +{ + /** + * 查询计划单据明细 + * + * @param id 计划单据明细主键 + * @return 计划单据明细 + */ + public DcBusiPlanBillSub selectDcBusiPlanBillSubById(Long id); + + /** + * 查询计划单据明细列表 + * + * @param dcBusiPlanBillSub 计划单据明细 + * @return 计划单据明细集合 + */ + public List selectDcBusiPlanBillSubList(DcBusiPlanBillSub dcBusiPlanBillSub); + + /** + * 新增计划单据明细 + * + * @param dcBusiPlanBillSub 计划单据明细 + * @return 结果 + */ + public int insertDcBusiPlanBillSub(DcBusiPlanBillSub dcBusiPlanBillSub); + + /** + * 修改计划单据明细 + * + * @param dcBusiPlanBillSub 计划单据明细 + * @return 结果 + */ + public int updateDcBusiPlanBillSub(DcBusiPlanBillSub dcBusiPlanBillSub); + + /** + * 删除计划单据明细 + * + * @param id 计划单据明细主键 + * @return 结果 + */ + public int deleteDcBusiPlanBillSubById(Long id); + + /** + * 批量删除计划单据明细 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDcBusiPlanBillSubByIds(Long[] ids); +} diff --git a/lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanBillMasterService.java b/lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanBillMasterService.java new file mode 100644 index 0000000..ac9932e --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanBillMasterService.java @@ -0,0 +1,130 @@ +package com.lzbi.bill.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lzbi.bill.domain.DcBusiPlanBillMaster; +import com.lzbi.bill.domain.DcBusiPlanBillSub; +import com.lzbi.bill.mapper.DcBusiPlanBillMasterMapper; +import com.lzbi.common.utils.DateUtils; +import com.lzbi.common.utils.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; +/** + * 计划单据主Service业务层处理 + * + * @author lienbo + * @date 2023-12-21 + */ +@Service +public class DcBusiPlanBillMasterService extends ServiceImpl implements IService +{ + + /** + * 查询计划单据主 + * + * @param id 计划单据主主键 + * @return 计划单据主 + */ + public DcBusiPlanBillMaster selectDcBusiPlanBillMasterById(Long id) + { + return baseMapper.selectDcBusiPlanBillMasterById(id); + } + + /** + * 查询计划单据主列表 + * + * @param dcBusiPlanBillMaster 计划单据主 + * @return 计划单据主 + */ + public List selectDcBusiPlanBillMasterList(DcBusiPlanBillMaster dcBusiPlanBillMaster) + { + return baseMapper.selectDcBusiPlanBillMasterList(dcBusiPlanBillMaster); + } + + /** + * 新增计划单据主 + * + * @param dcBusiPlanBillMaster 计划单据主 + * @return 结果 + */ + @Transactional + + public int insertDcBusiPlanBillMaster(DcBusiPlanBillMaster dcBusiPlanBillMaster) + { + dcBusiPlanBillMaster.setCreatedTime(DateUtils.getNowDate()); + int rows = baseMapper.insertDcBusiPlanBillMaster(dcBusiPlanBillMaster); + insertDcBusiPlanBillSub(dcBusiPlanBillMaster); + return rows; + } + + /** + * 修改计划单据主 + * + * @param dcBusiPlanBillMaster 计划单据主 + * @return 结果 + */ + @Transactional + + public int updateDcBusiPlanBillMaster(DcBusiPlanBillMaster dcBusiPlanBillMaster) + { + dcBusiPlanBillMaster.setUpdatedTime(DateUtils.getNowDate()); + baseMapper.deleteDcBusiPlanBillSubByBillNo(dcBusiPlanBillMaster.getId()); + insertDcBusiPlanBillSub(dcBusiPlanBillMaster); + return baseMapper.updateDcBusiPlanBillMaster(dcBusiPlanBillMaster); + } + + /** + * 批量删除计划单据主 + * + * @param ids 需要删除的计划单据主主键 + * @return 结果 + */ + @Transactional + + public int deleteDcBusiPlanBillMasterByIds(Long[] ids) + { + baseMapper.deleteDcBusiPlanBillSubByBillNos(ids); + return baseMapper.deleteDcBusiPlanBillMasterByIds(ids); + } + + /** + * 删除计划单据主信息 + * + * @param id 计划单据主主键 + * @return 结果 + */ + @Transactional + + public int deleteDcBusiPlanBillMasterById(Long id) + { + baseMapper.deleteDcBusiPlanBillSubByBillNo(id); + return baseMapper.deleteDcBusiPlanBillMasterById(id); + } + + /** + * 新增计划单据明细信息 + * + * @param dcBusiPlanBillMaster 计划单据主对象 + */ + public void insertDcBusiPlanBillSub(DcBusiPlanBillMaster dcBusiPlanBillMaster) + { + List dcBusiPlanBillSubDaoList = dcBusiPlanBillMaster.getDcBusiPlanBillSubList(); + String billNo = dcBusiPlanBillMaster.getBillNo(); + if (StringUtils.isNotNull(dcBusiPlanBillSubDaoList)) + { + List list = new ArrayList(); + for (DcBusiPlanBillSub dcBusiPlanBillSubDao : dcBusiPlanBillSubDaoList) + { + dcBusiPlanBillSubDao.setBillNo(billNo); + list.add(dcBusiPlanBillSubDao); + } + if (list.size() > 0) + { + baseMapper.batchDcBusiPlanBillSub(list); + } + } + } +} diff --git a/lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanBillSubService.java b/lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanBillSubService.java new file mode 100644 index 0000000..b4acd2c --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanBillSubService.java @@ -0,0 +1,91 @@ +package com.lzbi.bill.service; + +import java.util.List; +import com.lzbi.common.utils.DateUtils; +import org.springframework.stereotype.Service; +import com.lzbi.bill.domain.DcBusiPlanBillSub; +import com.lzbi.bill.mapper.DcBusiPlanBillSubMapper; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +/** + * 计划单据明细Service业务层处理 + * + * @author lienbo + * @date 2023-12-21 + */ +@Service +public class DcBusiPlanBillSubService extends ServiceImpl implements IService +{ + + /** + * 查询计划单据明细 + * + * @param id 计划单据明细主键 + * @return 计划单据明细 + */ + public DcBusiPlanBillSub selectDcBusiPlanBillSubById(Long id) + { + return baseMapper.selectDcBusiPlanBillSubById(id); + } + + /** + * 查询计划单据明细列表 + * + * @param dcBusiPlanBillSub 计划单据明细 + * @return 计划单据明细 + */ + public List selectDcBusiPlanBillSubList(DcBusiPlanBillSub dcBusiPlanBillSub) + { + return baseMapper.selectDcBusiPlanBillSubList(dcBusiPlanBillSub); + } + + /** + * 新增计划单据明细 + * + * @param dcBusiPlanBillSub 计划单据明细 + * @return 结果 + */ + + public int insertDcBusiPlanBillSub(DcBusiPlanBillSub dcBusiPlanBillSub) + { + dcBusiPlanBillSub.setCreatedTime(DateUtils.getNowDate()); + return baseMapper.insertDcBusiPlanBillSub(dcBusiPlanBillSub); + } + + /** + * 修改计划单据明细 + * + * @param dcBusiPlanBillSub 计划单据明细 + * @return 结果 + */ + + public int updateDcBusiPlanBillSub(DcBusiPlanBillSub dcBusiPlanBillSub) + { + dcBusiPlanBillSub.setUpdatedTime(DateUtils.getNowDate()); + return baseMapper.updateDcBusiPlanBillSub(dcBusiPlanBillSub); + } + + /** + * 批量删除计划单据明细 + * + * @param ids 需要删除的计划单据明细主键 + * @return 结果 + */ + + public int deleteDcBusiPlanBillSubByIds(Long[] ids) + { + return baseMapper.deleteDcBusiPlanBillSubByIds(ids); + } + + /** + * 删除计划单据明细信息 + * + * @param id 计划单据明细主键 + * @return 结果 + */ + + public int deleteDcBusiPlanBillSubById(Long id) + { + return baseMapper.deleteDcBusiPlanBillSubById(id); + } +} diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBusiPlanBillMasterMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBusiPlanBillMasterMapper.xml new file mode 100644 index 0000000..18467d4 --- /dev/null +++ b/lzbi-module/src/main/resources/mapper/asset/DcBusiPlanBillMasterMapper.xml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, bill_no, bill_income_date, bill_type, check_type, check_status, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, company_id, company_name, organize_name, oragnize_id from dc_busi_plan_bill_master + + + + + + + + insert into dc_busi_plan_bill_master + + bill_no, + bill_income_date, + bill_type, + check_type, + check_status, + tenant_id, + revision, + created_by, + created_time, + updated_by, + updated_time, + delete_by, + delete_time, + company_id, + company_name, + organize_name, + oragnize_id, + + + #{billNo}, + #{billIncomeDate}, + #{billType}, + #{checkType}, + #{checkStatus}, + #{tenantId}, + #{revision}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, + #{deleteBy}, + #{deleteTime}, + #{companyId}, + #{companyName}, + #{organizeName}, + #{oragnizeId}, + + + + + update dc_busi_plan_bill_master + + bill_no = #{billNo}, + bill_income_date = #{billIncomeDate}, + bill_type = #{billType}, + check_type = #{checkType}, + check_status = #{checkStatus}, + tenant_id = #{tenantId}, + revision = #{revision}, + created_by = #{createdBy}, + created_time = #{createdTime}, + updated_by = #{updatedBy}, + updated_time = #{updatedTime}, + delete_by = #{deleteBy}, + delete_time = #{deleteTime}, + company_id = #{companyId}, + company_name = #{companyName}, + organize_name = #{organizeName}, + oragnize_id = #{oragnizeId}, + + where id = #{id} + + + + delete from dc_busi_plan_bill_master where id = #{id} + + + + delete from dc_busi_plan_bill_master where id in + + #{id} + + + + + delete from dc_busi_plan_bill_sub where bill_no in + + #{billNo} + + + + + delete from dc_busi_plan_bill_sub where bill_no = #{billNo} + + + + insert into dc_busi_plan_bill_sub( id, bill_no, field_code, field_name, asset_code, asset_name, target_code, taget_name, plan_value, date_year, date_month, date_day, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time) values + + ( #{item.id}, #{item.billNo}, #{item.fieldCode}, #{item.fieldName}, #{item.assetCode}, #{item.assetName}, #{item.targetCode}, #{item.tagetName}, #{item.planValue}, #{item.dateYear}, #{item.dateMonth}, #{item.dateDay}, #{item.tenantId}, #{item.revision}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}, #{item.deleteBy}, #{item.deleteTime}) + + + \ No newline at end of file diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBusiPlanBillSubMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBusiPlanBillSubMapper.xml new file mode 100644 index 0000000..88081b1 --- /dev/null +++ b/lzbi-module/src/main/resources/mapper/asset/DcBusiPlanBillSubMapper.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, bill_no, field_code, field_name, asset_code, asset_name, target_code, taget_name, plan_value, date_year, date_month, date_day, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_busi_plan_bill_sub + + + + + + + + insert into dc_busi_plan_bill_sub + + bill_no, + field_code, + field_name, + asset_code, + asset_name, + target_code, + taget_name, + plan_value, + date_year, + date_month, + date_day, + tenant_id, + revision, + created_by, + created_time, + updated_by, + updated_time, + delete_by, + delete_time, + + + #{billNo}, + #{fieldCode}, + #{fieldName}, + #{assetCode}, + #{assetName}, + #{targetCode}, + #{tagetName}, + #{planValue}, + #{dateYear}, + #{dateMonth}, + #{dateDay}, + #{tenantId}, + #{revision}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, + #{deleteBy}, + #{deleteTime}, + + + + + update dc_busi_plan_bill_sub + + bill_no = #{billNo}, + field_code = #{fieldCode}, + field_name = #{fieldName}, + asset_code = #{assetCode}, + asset_name = #{assetName}, + target_code = #{targetCode}, + taget_name = #{tagetName}, + plan_value = #{planValue}, + date_year = #{dateYear}, + date_month = #{dateMonth}, + date_day = #{dateDay}, + tenant_id = #{tenantId}, + revision = #{revision}, + created_by = #{createdBy}, + created_time = #{createdTime}, + updated_by = #{updatedBy}, + updated_time = #{updatedTime}, + delete_by = #{deleteBy}, + delete_time = #{deleteTime}, + + where id = #{id} + + + + delete from dc_busi_plan_bill_sub where id = #{id} + + + + delete from dc_busi_plan_bill_sub where id in + + #{id} + + + \ No newline at end of file