From 2ead4399fae2dacc97bffeb55d8aa70190ba2b5e Mon Sep 17 00:00:00 2001 From: bobol Date: Mon, 11 Dec 2023 08:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../asset/mapper/DcBaseAssetInfoMapper.java | 8 -- ...DcBusiTargetAdjustDayMasterController.java | 32 ++---- .../DcBusiTargetAdjustDaySubController.java | 105 ++++++++++++++++++ .../DcBusiTargetAdjustDayMasterDao.java | 2 +- .../DcBusiTargetAdjustDaySubMapper.java | 12 ++ .../DcBusiTargetAdjustDayMasterService.java | 52 +++++++-- .../DcBusiTargetAdjustDaySubService.java | 6 +- .../mapper/DcBaseWorkSpecialMapper.java | 8 -- .../mapper/DcBaseAssetTargetMapper.java | 5 +- .../DcBusiTargetAdjustDayMasterMapper.xml | 2 +- .../asset/DcBusiTargetAdjustDaySubMapper.xml | 20 ++++ .../targetFolder/DcBaseAssetTargetMapper.xml | 4 +- 12 files changed, 203 insertions(+), 53 deletions(-) create mode 100644 lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetAdjustDaySubController.java diff --git a/lzbi-module/src/main/java/com/lzbi/asset/mapper/DcBaseAssetInfoMapper.java b/lzbi-module/src/main/java/com/lzbi/asset/mapper/DcBaseAssetInfoMapper.java index ee130a7..819b6fd 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/mapper/DcBaseAssetInfoMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/mapper/DcBaseAssetInfoMapper.java @@ -28,14 +28,6 @@ public interface DcBaseAssetInfoMapper { */ public List selectDcBaseAssetInfoList(DcBaseAssetInfo dcBaseAssetInfo); - /** - * 根据资产编码查询资产信息 - * - * @param assetCode 资产编码 - * @return 资产信息 - */ - DcBaseAssetInfo selectDcBaseAssetInfoByAssetCode(String assetCode); - /** * 新增资产信息 * diff --git a/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetAdjustDayMasterController.java b/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetAdjustDayMasterController.java index 9ad4289..faf2ab2 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetAdjustDayMasterController.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetAdjustDayMasterController.java @@ -1,31 +1,23 @@ package com.lzbi.draft.controller; -import java.util.List; -import javax.servlet.http.HttpServletResponse; - +import com.lzbi.common.annotation.Log; +import com.lzbi.common.core.controller.BaseController; +import com.lzbi.common.core.domain.AjaxResult; +import com.lzbi.common.core.page.TableDataInfo; +import com.lzbi.common.enums.BusinessType; +import com.lzbi.common.utils.poi.ExcelUtil; import com.lzbi.draft.domain.DcBusiTargetAdjustDayMasterDao; import com.lzbi.draft.domain.DcBusiTargetAdjustDaySubDao; import com.lzbi.draft.service.DcBusiTargetAdjustDayMasterService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; -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.common.utils.poi.ExcelUtil; -import com.lzbi.common.core.page.TableDataInfo; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 资产指标调整单主(日)Controller @@ -94,7 +86,7 @@ public class DcBusiTargetAdjustDayMasterController extends BaseController @PreAuthorize("@ss.hasPermi('asset:targetAdjustBill:edit')") @Log(title = "资产指标调整单主(日)", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody DcBusiTargetAdjustDayMasterDao dcBusiTargetAdjustDayMasterDao) + public AjaxResult edit(@RequestBody DcBusiTargetAdjustDayMasterDao dcBusiTargetAdjustDayMasterDao) { return toAjax(dcBusiTargetAdjustDayMasterService.updateDcBusiTargetAdjustDayMasterDao(dcBusiTargetAdjustDayMasterDao)); } diff --git a/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetAdjustDaySubController.java b/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetAdjustDaySubController.java new file mode 100644 index 0000000..5ebb855 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiTargetAdjustDaySubController.java @@ -0,0 +1,105 @@ +package com.lzbi.draft.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.lzbi.draft.domain.DcBusiTargetAdjustDaySubDao; +import com.lzbi.draft.service.DcBusiTargetAdjustDaySubService; +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.common.utils.poi.ExcelUtil; +import com.lzbi.common.core.page.TableDataInfo; + +/** + * 统计单元指标调整单子(日)Controller + * + * @author win + * @date 2023-12-05 + */ +@RestController +@RequestMapping("/asset/target/adjust/sub") +public class DcBusiTargetAdjustDaySubController extends BaseController +{ + @Autowired + private DcBusiTargetAdjustDaySubService dcBusiTargetAdjustDaySubService; + + /** + * 查询统计单元指标调整单子(日)列表 + */ + @PreAuthorize("@ss.hasPermi('asset:targetAdjustBill:list')") + @GetMapping("/list") + public TableDataInfo list(DcBusiTargetAdjustDaySubDao dcBusiTargetAdjustDaySubDao) + { + startPage(); + List list = dcBusiTargetAdjustDaySubService.selectDcBusiTargetAdjustDaySubDaoList(dcBusiTargetAdjustDaySubDao); + return getDataTable(list); + } + + /** + * 导出统计单元指标调整单子(日)列表 + */ + @PreAuthorize("@ss.hasPermi('asset:targetAdjustBill:export')") + @Log(title = "统计单元指标调整单子(日)", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DcBusiTargetAdjustDaySubDao dcBusiTargetAdjustDaySubDao) + { + List list = dcBusiTargetAdjustDaySubService.selectDcBusiTargetAdjustDaySubDaoList(dcBusiTargetAdjustDaySubDao); + ExcelUtil util = new ExcelUtil(DcBusiTargetAdjustDaySubDao.class); + util.exportExcel(response, list, "统计单元指标调整单子(日)数据"); + } + + /** + * 获取统计单元指标调整单子(日)详细信息 + */ + @PreAuthorize("@ss.hasPermi('asset:targetAdjustBill:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(dcBusiTargetAdjustDaySubService.selectDcBusiTargetAdjustDaySubDaoById(id)); + } + +// /** +// * 新增统计单元指标调整单子(日) +// */ +// @PreAuthorize("@ss.hasPermi('asset:targetAdjustBill:add')") +// @Log(title = "统计单元指标调整单子(日)", businessType = BusinessType.INSERT) +// @PostMapping +// public AjaxResult add(@RequestBody DcBusiTargetAdjustDaySubDao dcBusiTargetAdjustDaySubDao) +// { +// return toAjax(dcBusiTargetAdjustDaySubService.insertDcBusiTargetAdjustDaySubDao(dcBusiTargetAdjustDaySubDao)); +// } + + /** + * 修改统计单元指标调整单子(日) + */ + @PreAuthorize("@ss.hasPermi('asset:targetAdjustBill:edit')") + @Log(title = "统计单元指标调整单子(日)", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DcBusiTargetAdjustDaySubDao dcBusiTargetAdjustDaySubDao) + { + return toAjax(dcBusiTargetAdjustDaySubService.updateDcBusiTargetAdjustDaySubDao(dcBusiTargetAdjustDaySubDao)); + } + + /** + * 删除统计单元指标调整单子(日) + */ + @PreAuthorize("@ss.hasPermi('asset:targetAdjustBill:remove')") + @Log(title = "统计单元指标调整单子(日)", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dcBusiTargetAdjustDaySubService.deleteDcBusiTargetAdjustDaySubDaoByIds(ids)); + } +} diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetAdjustDayMasterDao.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetAdjustDayMasterDao.java index b3f4000..a1fe430 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetAdjustDayMasterDao.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetAdjustDayMasterDao.java @@ -37,7 +37,7 @@ public class DcBusiTargetAdjustDayMasterDao extends BaseModuleEntity { /** * 人工 */ - public static final String CHECK_TYPE_ARTIFICIAL = "0"; + public static final String CHECK_TYPE_ARTIFICIAL = "1"; private static final long serialVersionUID = 1L; diff --git a/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetAdjustDaySubMapper.java b/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetAdjustDaySubMapper.java index 4a4e996..a6e56cd 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetAdjustDaySubMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetAdjustDaySubMapper.java @@ -60,4 +60,16 @@ public interface DcBusiTargetAdjustDaySubMapper extends BaseMapper dcBusiTargetAdjustDaySubDaos = dcBusiTargetAdjustDaySubMapper.selectDcBusiTargetAdjustDaySubDaoList(dcBusiTargetAdjustDaySubDao); + dcBusiTargetAdjustDayMasterDao.setChildren(dcBusiTargetAdjustDaySubDaos); + return dcBusiTargetAdjustDayMasterDao; } /** @@ -98,12 +103,12 @@ public class DcBusiTargetAdjustDayMasterService extends ServiceImpl children = dcBusiTargetAdjustDayMasterDao.getChildren(); + for (DcBusiTargetAdjustDaySubDao dcBusiTargetAdjustDaySubDao : children) { + dcBusiTargetAdjustDaySubDao.setBillNoMaster(dcBusiTargetAdjustDayMasterDao.getBillSerial()); + dcBusiTargetAdjustDaySubService.insertDcBusiTargetAdjustDaySubDao(dcBusiTargetAdjustDaySubDao, assetCode); + } dcBusiTargetAdjustDayMasterDao.setUpdatedTime(DateUtils.getNowDate()); return baseMapper.updateDcBusiTargetAdjustDayMasterDao(dcBusiTargetAdjustDayMasterDao); } @@ -138,8 +172,10 @@ public class DcBusiTargetAdjustDayMasterService extends ServiceImpl dcBusiTargetDraftDayList = dcBusiTargetDraftDayMapper.selectDcBusiTargetDraftDayList(dcBusiTargetDraftDay); // 如果未查询出来指标数据底稿数据,就新增,否则修改 if (CollectionUtils.isEmpty(dcBusiTargetDraftDayList)) { @@ -224,7 +260,7 @@ public class DcBusiTargetAdjustDayMasterService extends ServiceImpl public DcBaseWorkSpecial selectDcBaseWorkSpecialById(Long id); public DcBaseWorkSpecial selectDcBaseWorkSpecialByCode(String specialCode); - /** - * 查询生产专业管理 - * - * @param specialCode 专业编码 - * @return 生产专业管理 - */ - public DcBaseWorkSpecial selectDcBaseWorkSpecialBySpecialCode(String specialCode); - /** * 查询生产专业管理列表 * diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java index a82e59e..8f86879 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java @@ -4,6 +4,7 @@ import java.util.List; import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 资产指标配置Mapper接口 @@ -26,10 +27,10 @@ public interface DcBaseAssetTargetMapper extends BaseMapper - and bill_serial = #{billSerial} + and INSTR(bill_serial, #{billSerial}) > 0 and biil_type = #{biilType} and company_id = #{companyId} and company_name like concat('%', #{companyName}, diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBusiTargetAdjustDaySubMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBusiTargetAdjustDaySubMapper.xml index f74de61..0fee577 100644 --- a/lzbi-module/src/main/resources/mapper/asset/DcBusiTargetAdjustDaySubMapper.xml +++ b/lzbi-module/src/main/resources/mapper/asset/DcBusiTargetAdjustDaySubMapper.xml @@ -119,10 +119,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from dc_busi_target_adjust_day_sub where id = #{id} + + delete from dc_busi_target_adjust_day_sub where bill_no_master = #{billNoMaster} + + delete from dc_busi_target_adjust_day_sub where id in #{id} + + + delete from dc_busi_target_adjust_day_sub where bill_no_master in ( + SELECT + bill_serial + FROM + dc_busi_target_adjust_day_master + WHERE + id IN + + #{id} + + ) + + + \ No newline at end of file diff --git a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml index a8d4434..4467f0f 100644 --- a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml +++ b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml @@ -51,9 +51,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - - where target_code = #{targetCode} and asset_id = #{assetId} + where target_code = #{targetCode} and asset_code = #{assetCode}