From edbb63ae650020aba43fb32459c675a8026f660c Mon Sep 17 00:00:00 2001 From: zhousq Date: Mon, 18 Dec 2023 18:49:33 +0800 Subject: [PATCH 1/4] =?UTF-8?q?2023-12-18=20=E5=8F=82=E6=95=B0=E9=87=87?= =?UTF-8?q?=E9=9B=86=E5=8D=95=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lzbi-admin/src/main/resources/application.yml | 2 +- .../core/controller/BaseController.java | 1 + .../lzbi/code/service/CodeNoGenerater.java | 8 +- .../DcBusiParamBillMasterController.java | 111 ++++++++---------- .../mapper/DcBusiParamBillMasterMapper.java | 3 +- .../service/DcBusiParamBillMasterService.java | 14 +-- .../mapper/asset/DcBaseAssetInfoMapper.xml | 2 +- .../mapper/asset/DcBaseWorkSpecialMapper.xml | 2 +- .../asset/DcBusiParamBillMasterMapper.xml | 27 ++++- .../mapper/asset/DcBusiParamBillSubMapper.xml | 15 ++- 10 files changed, 104 insertions(+), 81 deletions(-) diff --git a/lzbi-admin/src/main/resources/application.yml b/lzbi-admin/src/main/resources/application.yml index 95f25c2..81e0beb 100644 --- a/lzbi-admin/src/main/resources/application.yml +++ b/lzbi-admin/src/main/resources/application.yml @@ -100,7 +100,7 @@ pagehelper: # Swagger配置 swagger: # 是否开启swagger - enabled: true + enabled: false # 请求前缀 pathMapping: / diff --git a/lzbi-common/src/main/java/com/lzbi/common/core/controller/BaseController.java b/lzbi-common/src/main/java/com/lzbi/common/core/controller/BaseController.java index dcd2135..89b6b3f 100644 --- a/lzbi-common/src/main/java/com/lzbi/common/core/controller/BaseController.java +++ b/lzbi-common/src/main/java/com/lzbi/common/core/controller/BaseController.java @@ -26,6 +26,7 @@ import com.lzbi.common.utils.sql.SqlUtil; * * @author ruoyi */ + public class BaseController { protected final Logger logger = LoggerFactory.getLogger(this.getClass()); diff --git a/lzbi-module/src/main/java/com/lzbi/code/service/CodeNoGenerater.java b/lzbi-module/src/main/java/com/lzbi/code/service/CodeNoGenerater.java index abad783..5904bd0 100644 --- a/lzbi-module/src/main/java/com/lzbi/code/service/CodeNoGenerater.java +++ b/lzbi-module/src/main/java/com/lzbi/code/service/CodeNoGenerater.java @@ -36,7 +36,13 @@ public class CodeNoGenerater { // String spitChar= Optional.ofNullable(ruleDao.getCodeSplitFlag()).orElse(""); spitChar=spitChar.equals("*")?"":spitChar; - codeBuffer.append(ruleDao.getCodeHeader()).append(spitChar).append(getBody(ruleDao)).append(spitChar).append(StringUtils.leftPad(serial,serialLen,'0')); + String body=getBody(ruleDao); + codeBuffer.append(ruleDao.getCodeHeader()); + if(!"".equals(body)){ + codeBuffer.append(spitChar); + codeBuffer.append(body); + } + codeBuffer.append(spitChar).append(StringUtils.leftPad(serial,serialLen,'0')); return codeBuffer.toString(); } diff --git a/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamBillMasterController.java b/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamBillMasterController.java index 587af03..4108948 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamBillMasterController.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamBillMasterController.java @@ -1,24 +1,25 @@ package com.lzbi.draft.controller; import java.util.List; -import javax.servlet.http.HttpServletResponse; + +import com.lzbi.common.utils.DateUtils; +import com.lzbi.common.utils.SecurityUtils; +import com.lzbi.draft.domain.DcBusiParamBillSub; +import com.lzbi.draft.service.DcBusiParamBillSubService; +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.draft.domain.DcBusiParamBillMaster; import com.lzbi.draft.service.DcBusiParamBillMasterService; -import com.lzbi.common.utils.poi.ExcelUtil; import com.lzbi.common.core.page.TableDataInfo; /** @@ -29,15 +30,21 @@ import com.lzbi.common.core.page.TableDataInfo; */ @RestController @RequestMapping("/draft/paramInBill") + public class DcBusiParamBillMasterController extends BaseController { @Autowired private DcBusiParamBillMasterService dcBusiParamBillMasterService; - + @Autowired + private DcBusiParamBillSubService dcBusiParamBillSubService; /** * 查询参数采集(录入)单据主列表 */ - @PreAuthorize("@ss.hasPermi('param:paramData:list')") + //@PreAuthorize("@ss.hasPermi('param:paramData:list')") + @ApiOperation("参数采集单详情") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBusiParamBillMaster", value = "", dataType = "DcBusiParamBillMaster", dataTypeClass = DcBusiParamBillMaster.class), + }) @GetMapping("/list") public TableDataInfo list(DcBusiParamBillMaster dcBusiParamBillMasterDao) { @@ -46,59 +53,43 @@ public class DcBusiParamBillMasterController extends BaseController return getDataTable(list); } - /** - * 导出参数采集(录入)单据主列表 - */ - @PreAuthorize("@ss.hasPermi('param:paramData:export')") - @Log(title = "参数采集(录入)单据主", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, DcBusiParamBillMaster dcBusiParamBillMasterDao) - { - List list = dcBusiParamBillMasterService.selectDcBusiParamBillMasterDaoList(dcBusiParamBillMasterDao); - ExcelUtil util = new ExcelUtil(DcBusiParamBillMaster.class); - util.exportExcel(response, list, "参数采集(录入)单据主数据"); + @ApiOperation("参数采集单详情") + @ApiImplicitParams({ + @ApiImplicitParam(name = "billNo", value = "", dataType = "String", dataTypeClass = String.class), + }) + @GetMapping("/detail/{billNo}") + public AjaxResult getParamInBillDetail(@PathVariable String billNo){ + DcBusiParamBillSub sub=new DcBusiParamBillSub(); + sub.setBillNo(billNo); + List list = dcBusiParamBillSubService.selectByVo(sub); + return AjaxResult.success(list); } - - /** - * 获取参数采集(录入)单据主详细信息 - */ - @PreAuthorize("@ss.hasPermi('param:paramData:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(dcBusiParamBillMasterService.selectDcBusiParamBillMasterDaoById(id)); + @ApiOperation("采集单驳回") + @ApiImplicitParams({ + @ApiImplicitParam(name = "billNo", value = "", dataType = "String", dataTypeClass = String.class), + }) + @GetMapping("/checkBack/{billNo}") + public AjaxResult checkParamInBillBack(@PathVariable String billNo){ + DcBusiParamBillMaster master=new DcBusiParamBillMaster(); + master.setBillNo(billNo); + master.setUpdatedBy(SecurityUtils.getUsername()); + master.setCreatedTime(DateUtils.getNowDate()); + master.setCheckStatus("9"); + return AjaxResult.success(dcBusiParamBillMasterService.checkBill(master)); } - /** - * 新增参数采集(录入)单据主 - */ - @PreAuthorize("@ss.hasPermi('param:paramData:add')") - @Log(title = "参数采集(录入)单据主", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody DcBusiParamBillMaster dcBusiParamBillMasterDao) - { - return toAjax(dcBusiParamBillMasterService.insertDcBusiParamBillMasterDao(dcBusiParamBillMasterDao)); - } - - /** - * 修改参数采集(录入)单据主 - */ - @PreAuthorize("@ss.hasPermi('param:paramData:edit')") - @Log(title = "参数采集(录入)单据主", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody DcBusiParamBillMaster dcBusiParamBillMasterDao) - { - return toAjax(dcBusiParamBillMasterService.updateDcBusiParamBillMasterDao(dcBusiParamBillMasterDao)); + @ApiOperation("采集单审核") + @ApiImplicitParams({ + @ApiImplicitParam(name = "billNo", value = "", dataType = "String", dataTypeClass = String.class), + }) + @GetMapping("/check/{billNo}") + public AjaxResult checkParamInBill(@PathVariable String billNo){ + DcBusiParamBillMaster master=new DcBusiParamBillMaster(); + master.setUpdatedBy(SecurityUtils.getUsername()); + master.setCreatedTime(DateUtils.getNowDate()); + master.setBillNo(billNo); + master.setCheckStatus("1"); + return AjaxResult.success(dcBusiParamBillMasterService.checkBill(master)); } - /** - * 删除参数采集(录入)单据主 - */ - @PreAuthorize("@ss.hasPermi('param:paramData:remove')") - @Log(title = "参数采集(录入)单据主", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(dcBusiParamBillMasterService.deleteDcBusiParamBillMasterDaoByIds(ids)); - } } diff --git a/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiParamBillMasterMapper.java b/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiParamBillMasterMapper.java index 1dc92a6..40c56e7 100644 --- a/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiParamBillMasterMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiParamBillMasterMapper.java @@ -46,6 +46,7 @@ public interface DcBusiParamBillMasterMapper extends BaseMapper - + diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml index 6fa61b2..14e469a 100644 --- a/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml +++ b/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml @@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillMasterMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillMasterMapper.xml index c1f9098..733cf82 100644 --- a/lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillMasterMapper.xml +++ b/lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillMasterMapper.xml @@ -63,6 +63,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and bill_type = #{billType} and check_type = #{checkType} and check_status = #{checkStatus} + and CREATED_BY = #{createdBy} + and company_id = #{companyId} + and company_name like concat('%', #{companyName}, '%') + and organize_name like concat('%', #{organizeName}, '%') + and oragnize_id = #{oragnizeId} + @@ -135,7 +141,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - + + update dc_busi_param_bill_master + + TENANT_ID = #{tenantId}, + REVISION = #{revision}, + CREATED_BY = #{createdBy}, + CREATED_TIME = #{createdTime}, + UPDATED_BY = #{updatedBy}, + UPDATED_TIME = #{updatedTime}, + DELETE_BY = #{deleteBy}, + DELETE_TIME = #{deleteTime}, + bill_income_date = #{billIncomeDate}, + bill_type = #{billType}, + check_type = #{checkType}, + check_status = #{checkStatus}, + + where bill_no = #{billNo} + delete from dc_busi_param_bill_master where id = #{id} @@ -154,7 +177,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + delete from dc_busi_param_bill_sub where bill_no = #{billNo} diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillSubMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillSubMapper.xml index d4332c6..0a6c769 100644 --- a/lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillSubMapper.xml +++ b/lzbi-module/src/main/resources/mapper/asset/DcBusiParamBillSubMapper.xml @@ -14,7 +14,8 @@ - + + @@ -50,7 +51,8 @@ bill_no, asset_code, asset_name, - field_type, + field_code, + field_name, param_name, param_code, param_uint, @@ -74,7 +76,8 @@ and bill_no = #{billNo} and asset_code = #{assetCode} and asset_name = #{assetName} - and field_type = #{fieldType} + and field_code = #{fieldCode} + and field_name = #{fieldName} and param_name = #{paramName} and param_code = #{paramCode} and param_uint = #{paramUint} @@ -99,7 +102,8 @@ bill_no, asset_code, asset_name, - field_type, + field_code, + field_name, param_name, param_code, param_uint, @@ -120,7 +124,8 @@ #{billNo}, #{assetCode}, #{assetName}, - #{fieldType}, + #{fieldCode}, + #{fieldName}, #{paramName}, #{paramCode}, #{paramUint}, From b5d19e17427472419fca45f4a03a107124d638d9 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Tue, 19 Dec 2023 10:24:46 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lzbi/common/SelectOptionsControl.java | 4 +- .../domain/DcBaseAssetTarget.java | 40 +++++++++++--- .../targetFolder/DcBaseAssetTargetMapper.xml | 53 +++++++++++++------ 3 files changed, 72 insertions(+), 25 deletions(-) diff --git a/lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java b/lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java index 077f92f..33a6049 100644 --- a/lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java +++ b/lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java @@ -116,7 +116,7 @@ public class SelectOptionsControl extends BaseController { { DcBaseAssetTarget dcBaseAssetTarget=new DcBaseAssetTarget(); dcBaseAssetTarget.setAssetCode(assetQueryParams.getAssetCode()); - dcBaseAssetTarget.setTargetField(assetQueryParams.getFieldCode()); + dcBaseAssetTarget.setFieldCode(assetQueryParams.getFieldCode()); dcBaseAssetTarget.setColumnType("T"); //dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId()); return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetList(dcBaseAssetTarget)); @@ -126,7 +126,7 @@ public class SelectOptionsControl extends BaseController { { DcBaseAssetTarget dcBaseAssetTarget=new DcBaseAssetTarget(); dcBaseAssetTarget.setAssetCode(assetQueryParams.getAssetCode()); - dcBaseAssetTarget.setTargetField(assetQueryParams.getFieldCode()); + dcBaseAssetTarget.setFieldCode(assetQueryParams.getFieldCode()); dcBaseAssetTarget.setColumnType("P"); //dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId()); return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetList(dcBaseAssetTarget)); diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTarget.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTarget.java index 427f0e9..ed42093 100644 --- a/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTarget.java +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTarget.java @@ -2,8 +2,9 @@ package com.lzbi.targetFolder.domain; import java.math.BigDecimal; import java.util.Date; -import lombok.experimental.Accessors; import lombok.Data; +import io.swagger.annotations.ApiModelProperty; +import lombok.experimental.Accessors; import com.lzbi.common.annotation.Excel; import com.lzbi.module.base.BaseModuleEntity; @@ -11,7 +12,7 @@ import com.lzbi.module.base.BaseModuleEntity; * 资产指标配置对象 dc_base_asset_target * * @author Lu.JL - * @date 2023-12-14 + * @date 2023-12-19 */ @Data @Accessors(chain = true) @@ -21,70 +22,97 @@ public class DcBaseAssetTarget extends BaseModuleEntity /** 统计单元编码 */ @Excel(name = "统计单元编码") + @ApiModelProperty(name = "统计单元编码",notes = "assetCode") private String assetCode; /** 统计单元ID */ @Excel(name = "统计单元ID") + @ApiModelProperty(name = "统计单元ID",notes = "assetId") private Long assetId; /** 指标模型编码 */ @Excel(name = "指标模型编码") + @ApiModelProperty(name = "指标模型编码",notes = "targetModelCode") private String targetModelCode; /** 指标名称 */ @Excel(name = "指标名称") + @ApiModelProperty(name = "指标名称",notes = "targetName") private String targetName; /** 指标别名 */ @Excel(name = "指标别名") + @ApiModelProperty(name = "指标别名",notes = "targetNameAlias") private String targetNameAlias; /** 指标编码 */ @Excel(name = "指标编码") + @ApiModelProperty(name = "指标编码",notes = "targetCode") private String targetCode; /** 所属专业 */ @Excel(name = "所属专业") - private String targetField; + @ApiModelProperty(name = "所属专业",notes = "fieldCode") + private String fieldCode; /** 上限 */ @Excel(name = "上限") + @ApiModelProperty(name = "上限",notes = "limitUp") private BigDecimal limitUp; /** 下限 */ @Excel(name = "下限") + @ApiModelProperty(name = "下限",notes = "limitDown") private BigDecimal limitDown; /** 值 */ @Excel(name = "值") + @ApiModelProperty(name = "值",notes = "valueBase") private BigDecimal valueBase; /** 是否均值 */ @Excel(name = "是否均值") + @ApiModelProperty(name = "是否均值",notes = "flagAvg") private String flagAvg; /** 是否汇总 */ @Excel(name = "是否汇总") + @ApiModelProperty(name = "是否汇总",notes = "flagSum") private String flagSum; /** 是否积算 */ @Excel(name = "是否积算") + @ApiModelProperty(name = "是否积算",notes = "flagCompute") private String flagCompute; - /** $column.columnComment */ - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + /** */ + @Excel(name = "") + @ApiModelProperty(name = "",notes = "sort") private String sort; /** 所属专业名称 */ @Excel(name = "所属专业名称") - private String targetFieldName; + @ApiModelProperty(name = "所属专业名称",notes = "fieldName") + private String fieldName; /** T指标P参数 */ @Excel(name = "T指标P参数") + @ApiModelProperty(name = "T指标P参数",notes = "columnType") private String columnType; /** 单位 */ @Excel(name = "单位") + @ApiModelProperty(name = "单位",notes = "fieldUnit") private String fieldUnit; + /** 部门id */ + @Excel(name = "部门id") + @ApiModelProperty(name = "部门id",notes = "deptId") + private Long deptId; + + /** 用户id */ + @Excel(name = "用户id") + @ApiModelProperty(name = "用户id",notes = "userId") + private Long userId; + } diff --git a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml index cfc5b45..3a80772 100644 --- a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml +++ b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml @@ -1,7 +1,7 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> @@ -12,7 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + @@ -28,29 +28,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + + - select id, asset_code, asset_id, target_model_code, target_name, target_name_alias, target_code, target_field, limit_up, limit_down, value_base, flag_avg, flag_sum, flag_compute, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, sort, target_field_name, column_type, field_unit from dc_base_asset_target + select id, asset_code, asset_id, target_model_code, target_name, target_name_alias, target_code, field_code, limit_up, limit_down, value_base, flag_avg, flag_sum, flag_compute, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, sort, field_name, column_type, field_unit, dept_id, user_id from dc_base_asset_target - @@ -182,9 +182,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into dc_busi_param_bill_sub( TENANT_ID, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, DELETE_BY, DELETE_TIME, id, bill_no, asset_code,asset_name, field_code, field_name, param_code, param_value,count_date,count_hour) values + insert into dc_busi_param_bill_sub( TENANT_ID, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, DELETE_BY, DELETE_TIME, id, bill_no, asset_code,asset_name, field_code, field_name, param_code, param_value,count_date,count_hour,param_name) values - ( #{item.tenantId}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}, #{item.deleteBy}, #{item.deleteTime}, #{item.id}, #{item.billNo}, #{item.assetCode}, #{item.assetName}, #{item.fieldCode}, #{item.fieldName},#{item.paramCode}, #{item.paramValue}, #{item.countDate}, #{item.countHour}) + ( #{item.tenantId}, #{item.createdBy}, #{item.createdTime}, #{item.updatedBy}, #{item.updatedTime}, #{item.deleteBy}, #{item.deleteTime}, #{item.id}, #{item.billNo}, #{item.assetCode}, #{item.assetName}, #{item.fieldCode}, #{item.fieldName},#{item.paramCode}, #{item.paramValue}, #{item.countDate}, #{item.countHour},#{item.paramName}) \ No newline at end of file diff --git a/lzbi-module/src/main/resources/mapper/draft/DcBusiBillModelMasterMapper.xml b/lzbi-module/src/main/resources/mapper/draft/DcBusiBillModelMasterMapper.xml index 4a4a3ed..923954b 100644 --- a/lzbi-module/src/main/resources/mapper/draft/DcBusiBillModelMasterMapper.xml +++ b/lzbi-module/src/main/resources/mapper/draft/DcBusiBillModelMasterMapper.xml @@ -74,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + and bill_no = #{billNo} + and target_name like concat('%', #{targetName}, '%') + and target_code = #{targetCode} + and target_uint = #{targetUint} + and target_value = #{targetValue} + and count_date = #{countDate} + and count_day = #{countDay} + and field_code = #{fieldCode} + and field_name like concat('%', #{fieldName}, '%') + and asset_code = #{assetCode} + and asset_name like concat('%', #{assetName}, '%') + + + + + + + insert into dc_busi_target_bill_sub + + bill_no, + target_name, + target_code, + target_uint, + target_value, + count_date, + count_day, + field_code, + field_name, + asset_code, + asset_name, + tenant_id, + revision, + created_by, + created_time, + updated_by, + updated_time, + delete_by, + delete_time, + + + #{billNo}, + #{targetName}, + #{targetCode}, + #{targetUint}, + #{targetValue}, + #{countDate}, + #{countDay}, + #{fieldCode}, + #{fieldName}, + #{assetCode}, + #{assetName}, + #{tenantId}, + #{revision}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, + #{deleteBy}, + #{deleteTime}, + + + + + update dc_busi_target_bill_sub + + bill_no = #{billNo}, + target_name = #{targetName}, + target_code = #{targetCode}, + target_uint = #{targetUint}, + target_value = #{targetValue}, + count_date = #{countDate}, + count_day = #{countDay}, + field_code = #{fieldCode}, + field_name = #{fieldName}, + asset_code = #{assetCode}, + asset_name = #{assetName}, + 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_target_bill_sub where id = #{id} + + + + delete from dc_busi_target_bill_sub where id in + + #{id} + + + \ No newline at end of file From bd09d7dc3a0a600868ad337f0c12a20c26ab634e Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Wed, 20 Dec 2023 10:26:15 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9C=80=E6=96=B0=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcBaseAssetInfoController.java | 9 +++++++-- .../controller/DcBaseParamModelController.java | 10 ++++------ .../com/lzbi/asset/domain/DcBaseParamModel.java | 3 --- .../controller/DcBaseAssetTargetController.java | 9 +++++++-- .../controller/DcBaseTargetModelController.java | 17 +++++++++++------ .../mapper/asset/DcBaseAssetInfoMapper.xml | 7 ++++--- .../mapper/asset/DcBaseParamModelMapper.xml | 1 + .../targetFolder/DcBaseAssetTargetMapper.xml | 1 + .../targetFolder/DcBaseTargetModelMapper.xml | 1 + 9 files changed, 36 insertions(+), 22 deletions(-) diff --git a/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseAssetInfoController.java b/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseAssetInfoController.java index bdfceb5..243f3aa 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseAssetInfoController.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBaseAssetInfoController.java @@ -79,6 +79,10 @@ public class DcBaseAssetInfoController extends BaseController { @Log(title = "资产信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcBaseAssetInfo dcBaseAssetInfo) { + dcBaseAssetInfo.setCreatedTime(DateUtils.getNowDate()); + dcBaseAssetInfo.setCreatedBy(String.valueOf(getUserId())); + dcBaseAssetInfo.setDeptId(getDeptId()); + dcBaseAssetInfo.setUserId(getUserId()); return toAjax(dcBaseAssetInfoService.insertDcBaseAssetInfo(dcBaseAssetInfo)); } @@ -89,6 +93,8 @@ public class DcBaseAssetInfoController extends BaseController { @Log(title = "资产信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcBaseAssetInfo dcBaseAssetInfo) { + dcBaseAssetInfo.setUpdatedBy(getUsername()); + dcBaseAssetInfo.setUpdatedTime(DateUtils.getNowDate()); return toAjax(dcBaseAssetInfoService.updateDcBaseAssetInfo(dcBaseAssetInfo)); } @@ -122,10 +128,9 @@ public class DcBaseAssetInfoController extends BaseController { beanObject.remove("id"); DcBaseAssetInfo dcBaseAssetInfo = JSON.toJavaObject(beanObject, DcBaseAssetInfo.class); dcBaseAssetInfo.setCreatedTime(DateUtils.getNowDate()); + dcBaseAssetInfo.setCreatedBy(String.valueOf(getUserId())); dcBaseAssetInfo.setDeptId(getDeptId()); dcBaseAssetInfo.setUserId(getUserId()); - dcBaseAssetInfo.setCreatedBy(String.valueOf(getUserId())); - dcBaseAssetInfo.setCreatedTime(DateUtils.getNowDate()); beanList.add(dcBaseAssetInfo); } } catch (Exception e) { 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 fcbf22b..004f976 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 @@ -72,11 +72,10 @@ public class DcBaseParamModelController extends BaseController @PostMapping public AjaxResult add(@Valid @RequestBody DcBaseParamModel dcBaseParamModel) { //BeanValidators.validateWithException(validator, dcBaseParamModel); - dcBaseParamModel.setCreatedBy(getUsername()); dcBaseParamModel.setCreatedTime(DateUtils.getNowDate()); - dcBaseParamModel.setTenantId("0"); - dcBaseParamModel.setUpdatedBy(getUsername()); - dcBaseParamModel.setUpdatedTime(DateUtils.getNowDate()); + dcBaseParamModel.setCreatedBy(String.valueOf(getUserId())); + dcBaseParamModel.setDeptId(getDeptId()); + dcBaseParamModel.setUserId(getUserId()); return toAjax(dcBaseParamModelService.insertByVo(dcBaseParamModel)); } /** @@ -154,10 +153,9 @@ public class DcBaseParamModelController extends BaseController beanObject.remove("id"); DcBaseParamModel dcBaseParamModel = JSON.toJavaObject(beanObject, DcBaseParamModel.class); dcBaseParamModel.setCreatedTime(DateUtils.getNowDate()); + dcBaseParamModel.setCreatedBy(String.valueOf(getUserId())); dcBaseParamModel.setDeptId(getDeptId()); dcBaseParamModel.setUserId(getUserId()); - dcBaseParamModel.setCreatedBy(String.valueOf(getUserId())); - dcBaseParamModel.setCreatedTime(DateUtils.getNowDate()); dcBaseParamModelList.add(dcBaseParamModel); } } catch (Exception e) { 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 a2aa9ba..0fdb568 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 @@ -22,9 +22,6 @@ import com.lzbi.module.base.BaseModuleEntity; @TableName("dc_base_param_model") public class DcBaseParamModel extends BaseModuleEntity{ - /** 主键 */ - @ApiModelProperty(name = "主键",notes = "") - private Long id ; /** 参数模型编码 */ @ApiModelProperty(name = "参数模型编码",notes = "") private String paramModelCode ; 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 a715896..93a793e 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 @@ -83,6 +83,10 @@ public class DcBaseAssetTargetController extends BaseController @PostMapping public AjaxResult add(@RequestBody DcBaseAssetTarget dcBaseAssetTarget) { + dcBaseAssetTarget.setCreatedTime(DateUtils.getNowDate()); + dcBaseAssetTarget.setCreatedBy(String.valueOf(getUserId())); + dcBaseAssetTarget.setDeptId(getDeptId()); + dcBaseAssetTarget.setUserId(getUserId()); return toAjax(dcBaseAssetTargetService.insertDcBaseAssetTarget(dcBaseAssetTarget)); } @@ -94,6 +98,8 @@ public class DcBaseAssetTargetController extends BaseController @PutMapping public AjaxResult edit(@RequestBody DcBaseAssetTarget dcBaseAssetTarget) { + dcBaseAssetTarget.setUpdatedTime(DateUtils.getNowDate()); + dcBaseAssetTarget.setUpdatedBy(String.valueOf(getUserId())); return toAjax(dcBaseAssetTargetService.updateDcBaseAssetTarget(dcBaseAssetTarget)); } @@ -140,10 +146,9 @@ public class DcBaseAssetTargetController extends BaseController beanObject.remove("id"); DcBaseAssetTarget dcBaseAssetTarget = JSON.toJavaObject(beanObject, DcBaseAssetTarget.class); dcBaseAssetTarget.setCreatedTime(DateUtils.getNowDate()); + dcBaseAssetTarget.setCreatedBy(String.valueOf(getUserId())); dcBaseAssetTarget.setDeptId(getDeptId()); dcBaseAssetTarget.setUserId(getUserId()); - dcBaseAssetTarget.setCreatedBy(String.valueOf(getUserId())); - dcBaseAssetTarget.setCreatedTime(DateUtils.getNowDate()); beanList.add(dcBaseAssetTarget); } } catch (Exception e) { 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 c8a348e..047170f 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 @@ -101,9 +101,13 @@ public class DcBaseTargetModelController extends BaseController @PreAuthorize("@ss.hasPermi('target:targetModel:add')") @Log(title = "指标模版配置", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody DcBaseTargetModel DcBaseTargetModel) + public AjaxResult add(@RequestBody DcBaseTargetModel dcBaseTargetModel) { - return toAjax(dcBaseTargetModelService.insertDcBaseTargetModel(DcBaseTargetModel)); + dcBaseTargetModel.setCreatedTime(DateUtils.getNowDate()); + dcBaseTargetModel.setCreatedBy(String.valueOf(getUserId())); + dcBaseTargetModel.setDeptId(getDeptId()); + dcBaseTargetModel.setUserId(getUserId()); + return toAjax(dcBaseTargetModelService.insertDcBaseTargetModel(dcBaseTargetModel)); } /** @@ -117,9 +121,11 @@ public class DcBaseTargetModelController extends BaseController @PreAuthorize("@ss.hasPermi('target:targetModel:edit')") @Log(title = "指标模版配置", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody DcBaseTargetModel DcBaseTargetModel) + public AjaxResult edit(@RequestBody DcBaseTargetModel dcBaseTargetModel) { - return toAjax(dcBaseTargetModelService.updateDcBaseTargetModel(DcBaseTargetModel)); + dcBaseTargetModel.setUpdatedTime(DateUtils.getNowDate()); + dcBaseTargetModel.setUpdatedBy(String.valueOf(getUserId())); + return toAjax(dcBaseTargetModelService.updateDcBaseTargetModel(dcBaseTargetModel)); } /** @@ -157,10 +163,9 @@ public class DcBaseTargetModelController extends BaseController beanObject.remove("id"); DcBaseTargetModel dcBaseTargetModel = JSON.toJavaObject(beanObject, DcBaseTargetModel.class); dcBaseTargetModel.setCreatedTime(DateUtils.getNowDate()); + dcBaseTargetModel.setCreatedBy(String.valueOf(getUserId())); dcBaseTargetModel.setDeptId(getDeptId()); dcBaseTargetModel.setUserId(getUserId()); - dcBaseTargetModel.setCreatedBy(String.valueOf(getUserId())); - dcBaseTargetModel.setCreatedTime(DateUtils.getNowDate()); beanList.add(dcBaseTargetModel); } } catch (Exception e) { diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml index dd97119..317cec1 100644 --- a/lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml +++ b/lzbi-module/src/main/resources/mapper/asset/DcBaseAssetInfoMapper.xml @@ -65,6 +65,7 @@ and comany_id = #{comanyId} and dept_id = #{deptId} + ORDER BY COALESCE(updated_time, created_time) DESC insert into dc_base_param_model diff --git a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml index 3a80772..8efca09 100644 --- a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml +++ b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml @@ -62,6 +62,7 @@ and dept_id = #{deptId} and user_id = #{userId} + ORDER BY COALESCE(updated_time, created_time) DESC