From ec4b8fe33d6c53c9e55397fa6c9f75f80f9fe1aa Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Wed, 6 Dec 2023 09:36:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E2=80=98=E8=A7=A3=E5=86=B3=E5=86=B2?= =?UTF-8?q?=E7=AA=81=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lzbi/special/controller/DcBaseWorkSpecialController.java | 3 --- .../main/java/com/lzbi/task/service/WorkParamReadService.java | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lzbi-module/src/main/java/com/lzbi/special/controller/DcBaseWorkSpecialController.java b/lzbi-module/src/main/java/com/lzbi/special/controller/DcBaseWorkSpecialController.java index d02b40f..710cc66 100644 --- a/lzbi-module/src/main/java/com/lzbi/special/controller/DcBaseWorkSpecialController.java +++ b/lzbi-module/src/main/java/com/lzbi/special/controller/DcBaseWorkSpecialController.java @@ -1,6 +1,5 @@ package com.lzbi.special.controller; -import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletResponse; @@ -120,8 +119,6 @@ public class DcBaseWorkSpecialController extends BaseController List list = dcBaseWorkSpecialService.selectDcBaseWorkSpecialDaoList(dcBaseWorkSpecial); return AjaxResult.success(list); } - - /** * 新增生产专业管理 */ diff --git a/lzbi-module/src/main/java/com/lzbi/task/service/WorkParamReadService.java b/lzbi-module/src/main/java/com/lzbi/task/service/WorkParamReadService.java index a15825c..1f71412 100644 --- a/lzbi-module/src/main/java/com/lzbi/task/service/WorkParamReadService.java +++ b/lzbi-module/src/main/java/com/lzbi/task/service/WorkParamReadService.java @@ -13,7 +13,7 @@ import java.util.List; /** * 编码规则定义Service业务层处理 - * + * * @author win * @date 2023-11-29 */ @@ -23,7 +23,7 @@ public class WorkParamReadService extends ServiceImpl readWorkValue(ReadQueryParams readQueryParams){ return baseMapper.readWorkValue(readQueryParams); } From 814f68e47cc3e4c5ddb4513312a17a8b28a3baf9 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Thu, 7 Dec 2023 19:09:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?vxe-table=E7=95=8C=E9=9D=A2=E6=94=B9?= =?UTF-8?q?=E9=80=A0=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD=20=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=B9=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcBaseParamModelController.java | 93 ++++++-- .../lzbi/asset/domain/DcBaseParamModel.java | 2 +- .../lzbi/asset/domain/DcBusiParamSource.java | 2 +- .../asset/domain/DcBusiWorkReadConfig.java | 2 + .../code/domain/DcBaseCoderuleDefine.java | 2 + .../code/domain/DcBaseCoderuleDefineDao.java | 2 + .../code/domain/DcBaseCoderuleSerialDao.java | 2 +- .../code/domain/DcBusiCoderuleConfig.java | 2 + .../code/domain/DcBusiCoderuleConfigDao.java | 2 +- .../lzbi/draft/domain/DcBusiParamBillSub.java | 2 +- .../draft/domain/DcBusiParamDraftDay.java | 4 +- .../DcBusiTargetAdjustDayMasterDao.java | 2 + .../domain/DcBusiTargetAdjustDaySubDao.java | 2 + .../draft/domain/DcBusiTargetDraftDay.java | 2 + .../draft/domain/DcBusiTargetDraftMonth.java | 2 + .../lzbi/module/base/BaseModuleEntity.java | 198 ++++++------------ .../special/domain/DcBaseWorkSpecial.java | 120 +---------- .../DcBaseAssetTargetController.java | 1 + .../DcBaseTargetModelController.java | 129 ++++++++++-- .../domain/DcBaseAssetTargetDao.java | 2 + ...etModelDao.java => DcBaseTargetModel.java} | 15 +- .../mapper/DcBaseTargetModelMapper.java | 40 ++-- .../service/DcBaseTargetModelService.java | 60 +++--- .../targetFolder/DcBaseAssetTargetMapper.xml | 34 +-- .../targetFolder/DcBaseTargetModelMapper.xml | 42 ++-- 25 files changed, 389 insertions(+), 375 deletions(-) rename lzbi-module/src/main/java/com/lzbi/targetFolder/domain/{DcBaseTargetModelDao.java => DcBaseTargetModel.java} (75%) diff --git a/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseParamModelController.java b/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseParamModelController.java index 666f3fb..fcbf22b 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseParamModelController.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseParamModelController.java @@ -1,5 +1,8 @@ package com.lzbi.asset.controller; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.lzbi.common.annotation.Log; import com.lzbi.common.core.controller.BaseController; @@ -12,7 +15,11 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; + +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -36,6 +43,7 @@ public class DcBaseParamModelController extends BaseController * 分页列表查询 * @return 分页数据 */ + @PreAuthorize("@ss.hasPermi('asset:paramModel:list')") @GetMapping("/list") public TableDataInfo list(DcBaseParamModel dcBaseParamModel) { startPage(); @@ -47,6 +55,7 @@ public class DcBaseParamModelController extends BaseController *@param id @return DcBaseParamModel 没有反馈空 */ + @PreAuthorize("@ss.hasPermi('asset:paramModel:query')") @ApiOperation("根据ID获取参数模版表详细信息") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { @@ -57,6 +66,7 @@ public class DcBaseParamModelController extends BaseController *@param *@return DcBaseParamModel */ + @PreAuthorize("@ss.hasPermi('asset:paramModel:add')") @ApiOperation("新增参数模版表一条数据") @Log(title = "", businessType = BusinessType.INSERT) @PostMapping @@ -74,6 +84,7 @@ public class DcBaseParamModelController extends BaseController *@param *@return DcBaseParamModel */ + @PreAuthorize("@ss.hasPermi('asset:paramModel:edit')") @ApiOperation("参数模版表修改") @Log(title = "", businessType = BusinessType.UPDATE) @PutMapping @@ -83,27 +94,16 @@ public class DcBaseParamModelController extends BaseController dcBaseParamModel.setUpdatedTime(DateUtils.getNowDate()); return toAjax(dcBaseParamModelService.updateById(dcBaseParamModel)); } - /** - * 通过ID删除参数模版表 - * @param id - * @return 成功1 失败0 - */ - @ApiOperation("根据ID删除参数模版表") - @Log(title = "单一参数模版表", businessType = BusinessType.DELETE) - @DeleteMapping("/id/{id}") - public AjaxResult batchRemove(@PathVariable Long id) { - DcBaseParamModel dcBaseParamModel=new DcBaseParamModel(); - dcBaseParamModel.setId(id); - return toAjax(dcBaseParamModelService.removeById( dcBaseParamModel)); - } + /** * 批量删除参数模版表 * @param ids 数组 * @return 删除的条数 */ + @PreAuthorize("@ss.hasPermi('asset:paramModel:remove')") @ApiOperation("批量删除参数模版表") @Log(title = "批量删除参数模版表", businessType = BusinessType.DELETE) - @DeleteMapping("/ids/{ids}") + @DeleteMapping("/{ids}") public AjaxResult batchRemove(@PathVariable Long[] ids) { List collect = Arrays.stream(ids).collect(Collectors.toList()); return toAjax(dcBaseParamModelService.removeBatchByIds(collect)); @@ -121,6 +121,7 @@ public class DcBaseParamModelController extends BaseController /** * "参数模版表数据导出功能 */ + @PreAuthorize("@ss.hasPermi('asset:paramModel:export')") @ApiOperation("导出参数模版表数据") @PostMapping("/export") public void export(HttpServletResponse response, DcBaseParamModel dcBaseParamModel) { @@ -129,4 +130,68 @@ public class DcBaseParamModelController extends BaseController ExcelUtil util = new ExcelUtil<>(DcBaseParamModel.class); util.exportExcel(response, list, "导出的参数模版表数据"); } + + + + + + /** + * 新增参数模版 + */ + @PreAuthorize("@ss.hasPermi('asset:paramModel:add')") + @Log(title = "参数模版", businessType = BusinessType.INSERT) + @PostMapping("/addBatch") + public AjaxResult addBatch(@RequestBody JSONArray jsonArray) + { + if (jsonArray == null) { + throw new IllegalArgumentException("未能接收任何参数!"); + } + List dcBaseParamModelList = new ArrayList<>(); + try { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject beanObject = jsonArray.getJSONObject(i); + // 移除ID属性 + beanObject.remove("id"); + DcBaseParamModel dcBaseParamModel = JSON.toJavaObject(beanObject, DcBaseParamModel.class); + dcBaseParamModel.setCreatedTime(DateUtils.getNowDate()); + dcBaseParamModel.setDeptId(getDeptId()); + dcBaseParamModel.setUserId(getUserId()); + dcBaseParamModel.setCreatedBy(String.valueOf(getUserId())); + dcBaseParamModel.setCreatedTime(DateUtils.getNowDate()); + dcBaseParamModelList.add(dcBaseParamModel); + } + } catch (Exception e) { + throw new IllegalArgumentException("解析list对象异常!"); + } + return toAjax(dcBaseParamModelService.saveBatch(dcBaseParamModelList)); + } + + + /** + * 修改指标模版配置 + */ + @PreAuthorize("@ss.hasPermi('asset:paramModel:edit')") + @Log(title = "指标模版配置", businessType = BusinessType.UPDATE) + @PutMapping("/editBatch") + public AjaxResult editBatch(@RequestBody JSONArray jsonArray) + { + if (jsonArray == null) { + throw new IllegalArgumentException("未能接收任何参数!"); + } + List dcBaseParamModelList = new ArrayList<>(); + try { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject beanObject = jsonArray.getJSONObject(i); + DcBaseParamModel dcBaseParamModel = JSON.toJavaObject(beanObject, DcBaseParamModel.class); + dcBaseParamModel.setUpdatedBy(String.valueOf(getUserId())); + dcBaseParamModel.setUpdatedTime(DateUtils.getNowDate()); + dcBaseParamModelList.add(dcBaseParamModel); + } + } catch (Exception e) { + throw new IllegalArgumentException("解析list对象异常!"); + } + return toAjax(dcBaseParamModelService.updateBatchById(dcBaseParamModelList)); + } + + } diff --git a/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseParamModel.java b/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseParamModel.java index 4455be5..a2aa9ba 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseParamModel.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBaseParamModel.java @@ -24,7 +24,7 @@ public class DcBaseParamModel extends BaseModuleEntity{ /** 主键 */ @ApiModelProperty(name = "主键",notes = "") - private long id ; + private Long id ; /** 参数模型编码 */ @ApiModelProperty(name = "参数模型编码",notes = "") private String paramModelCode ; diff --git a/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBusiParamSource.java b/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBusiParamSource.java index d3a1d8e..3b7c343 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBusiParamSource.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBusiParamSource.java @@ -49,7 +49,7 @@ public class DcBusiParamSource extends BaseModuleEntity{ /** 主键 */ @ApiModelProperty(name = "主键",notes = "") @TableId(type= IdType.AUTO) - private Integer id ; + private Long id ; /** 所属专业 */ @ApiModelProperty(name = "所属专业",notes = "") private String fieldCode ; diff --git a/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBusiWorkReadConfig.java b/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBusiWorkReadConfig.java index 4416cbe..b117dc7 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBusiWorkReadConfig.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/domain/DcBusiWorkReadConfig.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import lombok.Data; import com.lzbi.common.annotation.Excel; import com.lzbi.module.base.BaseModuleEntity; +import lombok.experimental.Accessors; /** * 互联参数读取数据对照对象 dc_busi_work_read_config @@ -13,6 +14,7 @@ import com.lzbi.module.base.BaseModuleEntity; * @date 2023-12-04 */ @Data + @Accessors(chain = true) public class DcBusiWorkReadConfig extends BaseModuleEntity { private static final long serialVersionUID = 1L; diff --git a/lzbi-module/src/main/java/com/lzbi/code/domain/DcBaseCoderuleDefine.java b/lzbi-module/src/main/java/com/lzbi/code/domain/DcBaseCoderuleDefine.java index aa03417..69861b9 100644 --- a/lzbi-module/src/main/java/com/lzbi/code/domain/DcBaseCoderuleDefine.java +++ b/lzbi-module/src/main/java/com/lzbi/code/domain/DcBaseCoderuleDefine.java @@ -2,6 +2,7 @@ package com.lzbi.code.domain; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.experimental.Accessors; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import lombok.Data; @@ -15,6 +16,7 @@ import com.lzbi.module.base.BaseModuleEntity; * @date 2023-12-06 */ @Data +@Accessors(chain = true) public class DcBaseCoderuleDefine extends BaseModuleEntity { private static final long serialVersionUID = 1L; diff --git a/lzbi-module/src/main/java/com/lzbi/code/domain/DcBaseCoderuleDefineDao.java b/lzbi-module/src/main/java/com/lzbi/code/domain/DcBaseCoderuleDefineDao.java index 23b0c55..363abf8 100644 --- a/lzbi-module/src/main/java/com/lzbi/code/domain/DcBaseCoderuleDefineDao.java +++ b/lzbi-module/src/main/java/com/lzbi/code/domain/DcBaseCoderuleDefineDao.java @@ -2,6 +2,7 @@ package com.lzbi.code.domain; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.experimental.Accessors; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import lombok.Data; @@ -15,6 +16,7 @@ import com.lzbi.module.base.BaseModuleEntity; * @date 2023-11-29 */ @Data + @Accessors(chain = true) public class DcBaseCoderuleDefineDao extends BaseModuleEntity { private static final long serialVersionUID = 1L; diff --git a/lzbi-module/src/main/java/com/lzbi/code/domain/DcBaseCoderuleSerialDao.java b/lzbi-module/src/main/java/com/lzbi/code/domain/DcBaseCoderuleSerialDao.java index c3bcbab..b9e8474 100644 --- a/lzbi-module/src/main/java/com/lzbi/code/domain/DcBaseCoderuleSerialDao.java +++ b/lzbi-module/src/main/java/com/lzbi/code/domain/DcBaseCoderuleSerialDao.java @@ -27,7 +27,7 @@ public class DcBaseCoderuleSerialDao extends BaseModuleEntity{ /** 主键 */ @ApiModelProperty(name = "主键",notes = "") @TableId - private Integer id ; + private Long id ; /** 规则定义的ID */ @ApiModelProperty(name = "规则定义的ID",notes = "") private Long codeRuleId ; diff --git a/lzbi-module/src/main/java/com/lzbi/code/domain/DcBusiCoderuleConfig.java b/lzbi-module/src/main/java/com/lzbi/code/domain/DcBusiCoderuleConfig.java index 95b770d..418b0a3 100644 --- a/lzbi-module/src/main/java/com/lzbi/code/domain/DcBusiCoderuleConfig.java +++ b/lzbi-module/src/main/java/com/lzbi/code/domain/DcBusiCoderuleConfig.java @@ -2,6 +2,7 @@ package com.lzbi.code.domain; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.experimental.Accessors; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import lombok.Data; @@ -15,6 +16,7 @@ import com.lzbi.module.base.BaseModuleEntity; * @date 2023-12-06 */ @Data +@Accessors(chain = true) public class DcBusiCoderuleConfig extends BaseModuleEntity { private static final long serialVersionUID = 1L; diff --git a/lzbi-module/src/main/java/com/lzbi/code/domain/DcBusiCoderuleConfigDao.java b/lzbi-module/src/main/java/com/lzbi/code/domain/DcBusiCoderuleConfigDao.java index 031b4e9..becaa9b 100644 --- a/lzbi-module/src/main/java/com/lzbi/code/domain/DcBusiCoderuleConfigDao.java +++ b/lzbi-module/src/main/java/com/lzbi/code/domain/DcBusiCoderuleConfigDao.java @@ -27,7 +27,7 @@ public class DcBusiCoderuleConfigDao extends BaseModuleEntity{ /** 主键 */ @ApiModelProperty(name = "主键",notes = "") @TableId - private Integer id ; + private Long id ; /** 规则名称 */ @ApiModelProperty(name = "规则名称",notes = "") private String configName ; diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillSub.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillSub.java index 6b2fdb4..8f00cb4 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillSub.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamBillSub.java @@ -30,7 +30,7 @@ public class DcBusiParamBillSub extends BaseModuleEntity{ /** 主键 */ @ApiModelProperty(name = "主键",notes = "") @TableId(type = IdType.AUTO) - private Integer id ; + private Long id ; /** 单据编码 */ @ApiModelProperty(name = "单据编码",notes = "") private String billNo ; diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamDraftDay.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamDraftDay.java index 4825b10..ea7b110 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamDraftDay.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiParamDraftDay.java @@ -5,6 +5,7 @@ import java.util.Date; import lombok.Data; import com.lzbi.common.annotation.Excel; import com.lzbi.module.base.BaseModuleEntity; +import lombok.experimental.Accessors; /** * 参数数据底稿(日)对象 dc_busi_param_draft_day @@ -13,6 +14,7 @@ import com.lzbi.module.base.BaseModuleEntity; * @date 2023-12-06 */ @Data +@Accessors(chain = true) public class DcBusiParamDraftDay extends BaseModuleEntity { private static final long serialVersionUID = 1L; @@ -31,7 +33,7 @@ public class DcBusiParamDraftDay extends BaseModuleEntity /** 主键 */ @Excel(name = "主键") - private String id; + private Long id; /** 公司编码 */ private Integer companyId; 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..c93cff1 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 @@ -6,6 +6,7 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.experimental.Accessors; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import lombok.Data; @@ -21,6 +22,7 @@ import springfox.documentation.annotations.ApiIgnore; */ @ApiModel(value = "DcBusiTargetAdjustDayMasterDao对象", description = "资产指标调整单主表对象") @Data +@Accessors(chain = true) public class DcBusiTargetAdjustDayMasterDao extends BaseModuleEntity { /** * 待审核状态 diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetAdjustDaySubDao.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetAdjustDaySubDao.java index 7530a0b..97e6e3c 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetAdjustDaySubDao.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetAdjustDaySubDao.java @@ -6,6 +6,7 @@ import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.experimental.Accessors; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import lombok.Data; @@ -20,6 +21,7 @@ import com.lzbi.module.base.BaseModuleEntity; */ @ApiModel(value = "DcBusiTargetAdjustDaySubDao对象", description = "资产指标调整单子表对象") @Data +@Accessors(chain = true) public class DcBusiTargetAdjustDaySubDao extends BaseModuleEntity { private static final long serialVersionUID = 1L; diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java index 82bbd85..4e5f7bd 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftDay.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import com.lzbi.common.annotation.Excel; import com.lzbi.module.base.BaseModuleEntity; +import lombok.experimental.Accessors; /** * 指标数据底稿(日)对象 dc_busi_target_draft_day @@ -14,6 +15,7 @@ import com.lzbi.module.base.BaseModuleEntity; * @date 2023-11-28 */ @Data +@Accessors(chain = true) public class DcBusiTargetDraftDay extends BaseModuleEntity { private static final long serialVersionUID = 1L; diff --git a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java index cd1f44f..954e627 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/domain/DcBusiTargetDraftMonth.java @@ -6,6 +6,7 @@ import java.util.Date; import lombok.Data; import com.lzbi.common.annotation.Excel; import com.lzbi.module.base.BaseModuleEntity; +import lombok.experimental.Accessors; /** * 指标数据底稿(月)对象 dc_busi_target_draft_month @@ -14,6 +15,7 @@ import com.lzbi.module.base.BaseModuleEntity; * @date 2023-12-06 */ @Data +@Accessors(chain = true) public class DcBusiTargetDraftMonth extends BaseModuleEntity { private static final long serialVersionUID = 1L; diff --git a/lzbi-module/src/main/java/com/lzbi/module/base/BaseModuleEntity.java b/lzbi-module/src/main/java/com/lzbi/module/base/BaseModuleEntity.java index df79afa..3e8b425 100644 --- a/lzbi-module/src/main/java/com/lzbi/module/base/BaseModuleEntity.java +++ b/lzbi-module/src/main/java/com/lzbi/module/base/BaseModuleEntity.java @@ -1,6 +1,10 @@ package com.lzbi.module.base; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; import java.io.Serializable; @@ -11,134 +15,70 @@ import java.util.Date; * @date 2023/11/16 * BaseModuleEntity */ -public class BaseModuleEntity implements Serializable,Cloneable{ - /** 租户号 */ - @ApiModelProperty(name = "租户号",notes = "") - private String tenantId ; - /** 乐观锁 */ - @ApiModelProperty(name = "乐观锁",notes = "") - private Integer revision ; - /** 创建人 */ - @ApiModelProperty(name = "创建人",notes = "") - private String createdBy ; - /** 创建时间 */ - @ApiModelProperty(name = "创建时间",notes = "") - private Date createdTime ; - /** 更新人 */ - @ApiModelProperty(name = "更新人",notes = "") - private String updatedBy ; - /** 更新时间 */ - @ApiModelProperty(name = "更新时间",notes = "") - private Date updatedTime ; - /** 删除人 */ - @ApiModelProperty(name = "删除人",notes = "") - private String deleteBy ; - /** 删除时间 */ - @ApiModelProperty(name = "删除时间",notes = "") - private Date deleteTime ; +@Data +@Accessors(chain = true) +public class BaseModuleEntity implements Serializable, Cloneable { + + /** + * 主键 + */ + @ApiModelProperty(name = "主键", notes = "") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + /** + * 租户号 + */ + @ApiModelProperty(name = "租户号", notes = "") + private String tenantId; + /** + * 乐观锁 + */ + @ApiModelProperty(name = "乐观锁", notes = "") + private Integer revision; + /** + * 创建人 + */ + @ApiModelProperty(name = "创建人", notes = "") + private String createdBy; + /** + * 创建时间 + */ + @ApiModelProperty(name = "创建时间", notes = "") + private Date createdTime; + /** + * 更新人 + */ + @ApiModelProperty(name = "更新人", notes = "") + private String updatedBy; + /** + * 更新时间 + */ + @ApiModelProperty(name = "更新时间", notes = "") + private Date updatedTime; + /** + * 删除人 + */ + @ApiModelProperty(name = "删除人", notes = "") + private String deleteBy; + /** + * 删除时间 + */ + @ApiModelProperty(name = "删除时间", notes = "") + private Date deleteTime; + + @ApiModelProperty("分页") + private Integer pageNum; + @ApiModelProperty("分页大小") + private Integer pageSize; + /** + * 部门id + */ + @ApiModelProperty(name = "部门id", notes = "") + private Long deptId; + /** + * 用户id + */ + @ApiModelProperty(name = "用户id", notes = "") + private Long userId; - @ApiModelProperty("分页") - private Integer pageNum ; - @ApiModelProperty("分页大小") - private Integer pageSize ; - /** 部门id */ - @ApiModelProperty(name = "部门id",notes = "") - private Long deptId ; - /** 用户id */ - @ApiModelProperty(name = "用户id",notes = "") - private Long userId ; - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public Integer getRevision() { - return revision; - } - - public void setRevision(Integer revision) { - this.revision = revision; - } - - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy; - } - - public Date getCreatedTime() { - return createdTime; - } - - public void setCreatedTime(Date createdTime) { - this.createdTime = createdTime; - } - - public String getUpdatedBy() { - return updatedBy; - } - - public void setUpdatedBy(String updatedBy) { - this.updatedBy = updatedBy; - } - - public Date getUpdatedTime() { - return updatedTime; - } - - public void setUpdatedTime(Date updatedTime) { - this.updatedTime = updatedTime; - } - - public String getDeleteBy() { - return deleteBy; - } - - public void setDeleteBy(String deleteBy) { - this.deleteBy = deleteBy; - } - - public Date getDeleteTime() { - return deleteTime; - } - - public void setDeleteTime(Date deleteTime) { - this.deleteTime = deleteTime; - } - - public Integer getPageNum() { - return pageNum; - } - - public void setPageNum(Integer pageNum) { - this.pageNum = pageNum; - } - - public Integer getPageSize() { - return pageSize; - } - - public void setPageSize(Integer pageSize) { - this.pageSize = pageSize; - } - public Long getDeptId() { - return deptId; - } - - public void setDeptId(Long deptId) { - this.deptId = deptId; - } - - public Long getUserId() { - return userId; - } - - public void setUserId(Long userId) { - this.userId = userId; - } } diff --git a/lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecial.java b/lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecial.java index 9ba942a..93c2ae1 100644 --- a/lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecial.java +++ b/lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecial.java @@ -4,6 +4,8 @@ import java.util.Date; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.experimental.Accessors; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.lzbi.common.annotation.Excel; @@ -15,6 +17,8 @@ import com.lzbi.module.base.BaseModuleEntity; * @author win * @date 2023-11-28 */ +@Data +@Accessors(chain = true) public class DcBaseWorkSpecial extends BaseModuleEntity { private static final long serialVersionUID = 1L; @@ -55,120 +59,4 @@ public class DcBaseWorkSpecial extends BaseModuleEntity @Excel(name = "专业名称") private String specialName; - public void setTenantId(String tenantId) - { - this.tenantId = tenantId; - } - - public String getTenantId() - { - return tenantId; - } - public void setREVISION(Long REVISION) - { - this.REVISION = REVISION; - } - - public Long getREVISION() - { - return REVISION; - } - public void setCreatedBy(String createdBy) - { - this.createdBy = createdBy; - } - - public String getCreatedBy() - { - return createdBy; - } - public void setCreatedTime(Date createdTime) - { - this.createdTime = createdTime; - } - - public Date getCreatedTime() - { - return createdTime; - } - public void setUpdatedBy(String updatedBy) - { - this.updatedBy = updatedBy; - } - - public String getUpdatedBy() - { - return updatedBy; - } - public void setUpdatedTime(Date updatedTime) - { - this.updatedTime = updatedTime; - } - - public Date getUpdatedTime() - { - return updatedTime; - } - public void setDeleteBy(String deleteBy) - { - this.deleteBy = deleteBy; - } - - public String getDeleteBy() - { - return deleteBy; - } - public void setDeleteTime(Date deleteTime) - { - this.deleteTime = deleteTime; - } - - public Date getDeleteTime() - { - return deleteTime; - } - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - public void setSpecialCode(String specialCode) - { - this.specialCode = specialCode; - } - - public String getSpecialCode() - { - return specialCode; - } - public void setSpecialName(String specialName) - { - this.specialName = specialName; - } - - public String getSpecialName() - { - return specialName; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("tenantId", getTenantId()) - .append("REVISION", getREVISION()) - .append("createdBy", getCreatedBy()) - .append("createdTime", getCreatedTime()) - .append("updatedBy", getUpdatedBy()) - .append("updatedTime", getUpdatedTime()) - .append("deleteBy", getDeleteBy()) - .append("deleteTime", getDeleteTime()) - .append("id", getId()) - .append("specialCode", getSpecialCode()) - .append("specialName", getSpecialName()) - .toString(); - } } diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseAssetTargetController.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseAssetTargetController.java index 54cd131..867d91e 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseAssetTargetController.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseAssetTargetController.java @@ -2,6 +2,7 @@ package com.lzbi.targetFolder.controller; 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; diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseTargetModelController.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseTargetModelController.java index 0bd1def..a891afd 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseTargetModelController.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseTargetModelController.java @@ -1,7 +1,18 @@ package com.lzbi.targetFolder.controller; +import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import com.lzbi.common.utils.DateUtils; +import com.lzbi.targetFolder.domain.DcBaseTargetModel; +import com.lzbi.targetFolder.service.DcBaseTargetModelService; +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; @@ -16,16 +27,15 @@ 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.targetFolder.domain.DcBaseTargetModelDao; -import com.lzbi.targetFolder.service.DcBaseTargetModelService; import com.lzbi.common.utils.poi.ExcelUtil; import com.lzbi.common.core.page.TableDataInfo; + /** * 指标模版配置Controller - * + * * @author Lu.JL - * @date 2023-11-29 + * @date 2023-12-07 */ @RestController @RequestMapping("/target/targetModel") @@ -37,81 +47,156 @@ public class DcBaseTargetModelController extends BaseController /** * 查询指标模版配置列表 */ + @ApiOperation("查询指标模版配置列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBaseTargetModel", value = "", dataType = "DcBaseTargetModel", dataTypeClass = DcBaseTargetModel.class), + }) @PreAuthorize("@ss.hasPermi('target:targetModel:list')") @GetMapping("/list") - public TableDataInfo list(DcBaseTargetModelDao dcBaseTargetModelDao) + public TableDataInfo list(DcBaseTargetModel DcBaseTargetModel) { startPage(); - List list = dcBaseTargetModelService.selectDcBaseTargetModelDaoList(dcBaseTargetModelDao); + List< DcBaseTargetModel> list = dcBaseTargetModelService.selectDcBaseTargetModelList(DcBaseTargetModel); return getDataTable(list); } /** * 导出指标模版配置列表 */ + @ApiOperation("导出指标模版配置列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBaseTargetModel", value = "", dataType = "DcBaseTargetModel", dataTypeClass = DcBaseTargetModel.class), + }) @PreAuthorize("@ss.hasPermi('target:targetModel:export')") @Log(title = "指标模版配置", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, DcBaseTargetModelDao dcBaseTargetModelDao) + public void export(HttpServletResponse response,DcBaseTargetModel DcBaseTargetModel) { - List list = dcBaseTargetModelService.selectDcBaseTargetModelDaoList(dcBaseTargetModelDao); - ExcelUtil util = new ExcelUtil(DcBaseTargetModelDao.class); + List list = dcBaseTargetModelService.selectDcBaseTargetModelList(DcBaseTargetModel); + ExcelUtil util = new ExcelUtil(DcBaseTargetModel.class); util.exportExcel(response, list, "指标模版配置数据"); } /** * 获取指标模版配置详细信息 */ + @ApiOperation("获取指标模版配置详细信息") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class), + }) @PreAuthorize("@ss.hasPermi('target:targetModel:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { - return success(dcBaseTargetModelService.selectDcBaseTargetModelDaoById(id)); + return success(dcBaseTargetModelService.selectDcBaseTargetModelById(id)); } /** * 新增指标模版配置 */ + @ApiOperation("新增指标模版配置") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBaseTargetModel", value = "", dataType = "DcBaseTargetModel", dataTypeClass = DcBaseTargetModel.class), + }) @PreAuthorize("@ss.hasPermi('target:targetModel:add')") @Log(title = "指标模版配置", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody DcBaseTargetModelDao dcBaseTargetModelDao) + public AjaxResult add(@RequestBody DcBaseTargetModel DcBaseTargetModel) { - return toAjax(dcBaseTargetModelService.insertDcBaseTargetModelDao(dcBaseTargetModelDao)); + return toAjax(dcBaseTargetModelService.insertDcBaseTargetModel(DcBaseTargetModel)); } /** * 修改指标模版配置 */ + + @ApiOperation("修改指标模版配置") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBaseTargetModel", value = "", dataType = "DcBaseTargetModel", dataTypeClass = DcBaseTargetModel.class), + }) @PreAuthorize("@ss.hasPermi('target:targetModel:edit')") @Log(title = "指标模版配置", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody DcBaseTargetModelDao dcBaseTargetModelDao) + public AjaxResult edit(@RequestBody DcBaseTargetModel DcBaseTargetModel) { - return toAjax(dcBaseTargetModelService.updateDcBaseTargetModelDao(dcBaseTargetModelDao)); + return toAjax(dcBaseTargetModelService.updateDcBaseTargetModel(DcBaseTargetModel)); } /** * 删除指标模版配置 */ + @ApiOperation("删除指标模版配置") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class), + }) @PreAuthorize("@ss.hasPermi('target:targetModel:remove')") @Log(title = "指标模版配置", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") + @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { - return toAjax(dcBaseTargetModelService.deleteDcBaseTargetModelDaoByIds(ids)); + return toAjax(dcBaseTargetModelService.deleteDcBaseTargetModelByIds(ids)); } + /** - * 查询指标模版配置列表 + * 新增指标模版配置 */ - @PreAuthorize("@ss.hasPermi('target:targetModel:list')") - @GetMapping("/listNoPage") - public AjaxResult listNoPage(DcBaseTargetModelDao dcBaseTargetModelDao) + @PreAuthorize("@ss.hasPermi('target:targetModel:add')") + @Log(title = "指标模版配置", businessType = BusinessType.INSERT) + @PostMapping("/addBatch") + public AjaxResult addBatch(@RequestBody JSONArray jsonArray) { - List list = dcBaseTargetModelService.selectDcBaseTargetModelDaoList(dcBaseTargetModelDao); - return AjaxResult.success(list); + if (jsonArray == null) { + throw new IllegalArgumentException("未能接收任何参数!"); + } + List beanList = new ArrayList<>(); + try { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject beanObject = jsonArray.getJSONObject(i); + // 移除ID属性 + beanObject.remove("id"); + DcBaseTargetModel dcBaseTargetModel = JSON.toJavaObject(beanObject, DcBaseTargetModel.class); + dcBaseTargetModel.setCreatedTime(DateUtils.getNowDate()); + dcBaseTargetModel.setDeptId(getDeptId()); + dcBaseTargetModel.setUserId(getUserId()); + dcBaseTargetModel.setCreatedBy(String.valueOf(getUserId())); + dcBaseTargetModel.setCreatedTime(DateUtils.getNowDate()); + beanList.add(dcBaseTargetModel); + } + } catch (Exception e) { + throw new IllegalArgumentException("解析list对象异常!"); + } + return toAjax(dcBaseTargetModelService.saveBatch(beanList)); } + /** + * 修改指标模版配置 + */ + @PreAuthorize("@ss.hasPermi('target:targetModel:edit')") + @Log(title = "指标模版配置", businessType = BusinessType.UPDATE) + @PutMapping("editBatch") + public AjaxResult editBatch(@RequestBody JSONArray jsonArray) + { + if (jsonArray == null) { + throw new IllegalArgumentException("未能接收任何参数!"); + } + List dcBaseWorkSpecialList = new ArrayList<>(); + try { + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject beanObject = jsonArray.getJSONObject(i); + DcBaseTargetModel dcBaseTargetModel = JSON.toJavaObject(beanObject, DcBaseTargetModel.class); + dcBaseTargetModel.setUpdatedBy(String.valueOf(getUserId())); + dcBaseTargetModel.setUpdatedTime(DateUtils.getNowDate()); + dcBaseWorkSpecialList.add(dcBaseTargetModel); + } + } catch (Exception e) { + throw new IllegalArgumentException("解析list对象异常!"); + } + return toAjax(dcBaseTargetModelService.updateBatchById(dcBaseWorkSpecialList)); + } + + + + } diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java index 4d2cbeb..e2dbe51 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java @@ -5,6 +5,7 @@ import java.util.Date; import lombok.Data; import com.lzbi.common.annotation.Excel; import com.lzbi.module.base.BaseModuleEntity; +import lombok.experimental.Accessors; /** * 资产指标配置对象 dc_base_asset_target @@ -13,6 +14,7 @@ import com.lzbi.module.base.BaseModuleEntity; * @date 2023-11-30 */ @Data + @Accessors(chain = true) public class DcBaseAssetTargetDao extends BaseModuleEntity { private static final long serialVersionUID = 1L; diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseTargetModelDao.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseTargetModel.java similarity index 75% rename from lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseTargetModelDao.java rename to lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseTargetModel.java index 8945f97..d58d612 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseTargetModelDao.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseTargetModel.java @@ -1,5 +1,9 @@ package com.lzbi.targetFolder.domain; +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 com.lzbi.common.annotation.Excel; import com.lzbi.module.base.BaseModuleEntity; @@ -8,16 +12,13 @@ import com.lzbi.module.base.BaseModuleEntity; * 指标模版配置对象 dc_base_target_model * * @author Lu.JL - * @date 2023-11-29 + * @date 2023-12-07 */ - @Data -public class DcBaseTargetModelDao extends BaseModuleEntity +@Data +public class DcBaseTargetModel extends BaseModuleEntity { private static final long serialVersionUID = 1L; - /** 主键 */ - private Long id; - /** 指标模版编码 */ @Excel(name = "指标模版编码") private String targetModelCode; @@ -38,6 +39,4 @@ public class DcBaseTargetModelDao extends BaseModuleEntity @Excel(name = "指标等级") private Long targetModelLevel; - - } diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseTargetModelMapper.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseTargetModelMapper.java index 4cf5c38..5a3e3ac 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseTargetModelMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseTargetModelMapper.java @@ -1,63 +1,65 @@ package com.lzbi.targetFolder.mapper; -import java.util.List; -import com.lzbi.targetFolder.domain.DcBaseTargetModelDao; + import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lzbi.targetFolder.domain.DcBaseTargetModel; + +import java.util.List; /** * 指标模版配置Mapper接口 - * + * * @author Lu.JL - * @date 2023-11-29 + * @date 2023-12-07 */ -public interface DcBaseTargetModelMapper extends BaseMapper +public interface DcBaseTargetModelMapper extends BaseMapper { /** * 查询指标模版配置 - * + * * @param id 指标模版配置主键 * @return 指标模版配置 */ - public DcBaseTargetModelDao selectDcBaseTargetModelDaoById(Long id); + public DcBaseTargetModel selectDcBaseTargetModelById(Long id); /** * 查询指标模版配置列表 - * - * @param dcBaseTargetModelDao 指标模版配置 + * + * @param dcBaseTargetModel 指标模版配置 * @return 指标模版配置集合 */ - public List selectDcBaseTargetModelDaoList(DcBaseTargetModelDao dcBaseTargetModelDao); + public List selectDcBaseTargetModelList(DcBaseTargetModel dcBaseTargetModel); /** * 新增指标模版配置 - * - * @param dcBaseTargetModelDao 指标模版配置 + * + * @param dcBaseTargetModel 指标模版配置 * @return 结果 */ - public int insertDcBaseTargetModelDao(DcBaseTargetModelDao dcBaseTargetModelDao); + public int insertDcBaseTargetModel(DcBaseTargetModel dcBaseTargetModel); /** * 修改指标模版配置 - * + * * @param dcBaseTargetModel 指标模版配置 * @return 结果 */ - public int updateDcBaseTargetModelDao(DcBaseTargetModelDao dcBaseTargetModelDao); + public int updateDcBaseTargetModel(DcBaseTargetModel dcBaseTargetModel); /** * 删除指标模版配置 - * + * * @param id 指标模版配置主键 * @return 结果 */ - public int deleteDcBaseTargetModelDaoById(Long id); + public int deleteDcBaseTargetModelById(Long id); /** * 批量删除指标模版配置 - * + * * @param ids 需要删除的数据主键集合 * @return 结果 */ - public int deleteDcBaseTargetModelDaoByIds(Long[] ids); + public int deleteDcBaseTargetModelByIds(Long[] ids); } diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseTargetModelService.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseTargetModelService.java index dd91986..041926e 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseTargetModelService.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseTargetModelService.java @@ -2,91 +2,91 @@ package com.lzbi.targetFolder.service; import java.util.List; -import com.lzbi.common.utils.DateUtils; -import org.springframework.stereotype.Service; -import com.lzbi.targetFolder.domain.DcBaseTargetModelDao; -import com.lzbi.targetFolder.mapper.DcBaseTargetModelMapper; import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lzbi.common.utils.DateUtils; +import com.lzbi.targetFolder.domain.DcBaseTargetModel; +import com.lzbi.targetFolder.mapper.DcBaseTargetModelMapper; +import org.springframework.stereotype.Service; /** * 指标模版配置Service业务层处理 - * + * * @author Lu.JL - * @date 2023-11-29 + * @date 2023-12-07 */ @Service -public class DcBaseTargetModelService extends ServiceImpl implements IService +public class DcBaseTargetModelService extends ServiceImpl implements IService { /** * 查询指标模版配置 - * + * * @param id 指标模版配置主键 * @return 指标模版配置 */ - public DcBaseTargetModelDao selectDcBaseTargetModelDaoById(Long id) + public DcBaseTargetModel selectDcBaseTargetModelById(Long id) { - return baseMapper.selectDcBaseTargetModelDaoById(id); + return baseMapper.selectDcBaseTargetModelById(id); } /** * 查询指标模版配置列表 - * - * @param dcBaseTargetModelDao 指标模版配置 + * + * @param dcBaseTargetModel 指标模版配置 * @return 指标模版配置 */ - public List selectDcBaseTargetModelDaoList(DcBaseTargetModelDao dcBaseTargetModelDao) + public List selectDcBaseTargetModelList(DcBaseTargetModel dcBaseTargetModel) { - return baseMapper.selectDcBaseTargetModelDaoList(dcBaseTargetModelDao); + return baseMapper.selectDcBaseTargetModelList(dcBaseTargetModel); } /** * 新增指标模版配置 - * - * @param dcBaseTargetModelDao 指标模版配置 + * + * @param dcBaseTargetModel 指标模版配置 * @return 结果 */ - public int insertDcBaseTargetModelDao(DcBaseTargetModelDao dcBaseTargetModelDao) + public int insertDcBaseTargetModel(DcBaseTargetModel dcBaseTargetModel) { - dcBaseTargetModelDao.setCreatedTime(DateUtils.getNowDate()); - return baseMapper.insertDcBaseTargetModelDao(dcBaseTargetModelDao); + dcBaseTargetModel.setCreatedTime(DateUtils.getNowDate()); + return baseMapper.insertDcBaseTargetModel(dcBaseTargetModel); } /** * 修改指标模版配置 - * - * @param dcBaseTargetModelDao 指标模版配置 + * + * @param dcBaseTargetModel 指标模版配置 * @return 结果 */ - public int updateDcBaseTargetModelDao(DcBaseTargetModelDao dcBaseTargetModelDao) + public int updateDcBaseTargetModel(DcBaseTargetModel dcBaseTargetModel) { - dcBaseTargetModelDao.setUpdatedTime(DateUtils.getNowDate()); - return baseMapper.updateDcBaseTargetModelDao(dcBaseTargetModelDao); + dcBaseTargetModel.setUpdatedTime(DateUtils.getNowDate()); + return baseMapper.updateDcBaseTargetModel(dcBaseTargetModel); } /** * 批量删除指标模版配置 - * + * * @param ids 需要删除的指标模版配置主键 * @return 结果 */ - public int deleteDcBaseTargetModelDaoByIds(Long[] ids) + public int deleteDcBaseTargetModelByIds(Long[] ids) { - return baseMapper.deleteDcBaseTargetModelDaoByIds(ids); + return baseMapper.deleteDcBaseTargetModelByIds(ids); } /** * 删除指标模版配置信息 - * + * * @param id 指标模版配置主键 * @return 结果 */ - public int deleteDcBaseTargetModelDaoById(Long id) + public int deleteDcBaseTargetModelById(Long id) { - return baseMapper.deleteDcBaseTargetModelDaoById(id); + return baseMapper.deleteDcBaseTargetModelById(id); } } diff --git a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml index a8d4434..010385e 100644 --- a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml +++ b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml @@ -1,11 +1,12 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + @@ -18,7 +19,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - @@ -35,17 +35,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - + insert into dc_base_asset_target + asset_code, asset_id, target_model_code, target_name, @@ -70,7 +77,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" flag_avg, flag_sum, flag_compute, - sort, tenant_id, revision, created_by, @@ -79,8 +85,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" updated_time, delete_by, delete_time, - + + #{assetCode}, #{assetId}, #{targetModelCode}, #{targetName}, @@ -92,7 +99,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{flagAvg}, #{flagSum}, #{flagCompute}, - #{sort}, #{tenantId}, #{revision}, #{createdBy}, @@ -101,12 +107,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updatedTime}, #{deleteBy}, #{deleteTime}, - + update dc_base_asset_target + asset_code = #{assetCode}, asset_id = #{assetId}, target_model_code = #{targetModelCode}, target_name = #{targetName}, @@ -118,7 +125,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" flag_avg = #{flagAvg}, flag_sum = #{flagSum}, flag_compute = #{flagCompute}, - sort = #{sort}, tenant_id = #{tenantId}, revision = #{revision}, created_by = #{createdBy}, @@ -136,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from dc_base_asset_target where id in + delete from dc_base_asset_target where id in #{id} diff --git a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseTargetModelMapper.xml b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseTargetModelMapper.xml index ec3eef2..1cdc40a 100644 --- a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseTargetModelMapper.xml +++ b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseTargetModelMapper.xml @@ -1,10 +1,10 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - + + @@ -19,15 +19,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + - select id, target_model_code, target_model_name, target_model_type, target_model_field, target_model_level, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_base_target_model + select id, target_model_code, target_model_name, target_model_type, target_model_field, target_model_level, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, dept_id, user_id from dc_base_target_model - - + and target_model_code = #{targetModelCode} and target_model_name like concat('%', #{targetModelName}, '%') and target_model_type = #{targetModelType} @@ -35,13 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and target_model_level = #{targetModelLevel} - - where id = #{id} - - + + insert into dc_base_target_model target_model_code, @@ -57,7 +59,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" updated_time, delete_by, delete_time, - + dept_id, + user_id, + #{targetModelCode}, #{targetModelName}, @@ -72,10 +76,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updatedTime}, #{deleteBy}, #{deleteTime}, - + #{deptId}, + #{userId}, + - + update dc_base_target_model target_model_code = #{targetModelCode}, @@ -91,16 +97,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" updated_time = #{updatedTime}, delete_by = #{deleteBy}, delete_time = #{deleteTime}, + dept_id = #{deptId}, + user_id = #{userId}, where id = #{id} - + delete from dc_base_target_model where id = #{id} - - delete from dc_base_target_model where id in + + delete from dc_base_target_model where id in #{id} From dae841def8abdd1e54913b1a6a9cdd4dfcf314cb Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Thu, 7 Dec 2023 19:11:44 +0800 Subject: [PATCH 3/3] =?UTF-8?q?@Accessors(chain=20=3D=20true)=E6=B3=A8?= =?UTF-8?q?=E8=A7=A3=E6=B7=BB=E5=8A=A0=20;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/lzbi/bill/domain/DcBusiPlanTargetMonth.java | 2 ++ .../java/com/lzbi/targetFolder/domain/DcBaseTargetModel.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanTargetMonth.java b/lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanTargetMonth.java index 3ca8f6f..636eada 100644 --- a/lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanTargetMonth.java +++ b/lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanTargetMonth.java @@ -3,6 +3,7 @@ package com.lzbi.bill.domain; import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.experimental.Accessors; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import lombok.Data; @@ -16,6 +17,7 @@ import com.lzbi.module.base.BaseModuleEntity; * @date 2023-12-06 */ @Data +@Accessors(chain = true) public class DcBusiPlanTargetMonth extends BaseModuleEntity { private static final long serialVersionUID = 1L; diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseTargetModel.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseTargetModel.java index d58d612..bc25936 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseTargetModel.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseTargetModel.java @@ -2,6 +2,7 @@ package com.lzbi.targetFolder.domain; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.experimental.Accessors; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import lombok.Data; @@ -15,6 +16,7 @@ import com.lzbi.module.base.BaseModuleEntity; * @date 2023-12-07 */ @Data +@Accessors(chain = true) public class DcBaseTargetModel extends BaseModuleEntity { private static final long serialVersionUID = 1L;