diff --git a/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBusiWorkReadConfigController.java b/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBusiWorkReadConfigController.java index 35fbcf0..6c61552 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBusiWorkReadConfigController.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/controller/DcBusiWorkReadConfigController.java @@ -1,77 +1,77 @@ package com.lzbi.asset.controller; -import java.util.List; -import java.util.Optional; -import javax.servlet.http.HttpServletResponse; - -import com.fasterxml.jackson.databind.ext.OptionalHandlerFactory; +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; import com.github.pagehelper.PageHelper; +import com.lzbi.asset.domain.DcBusiWorkReadConfig; +import com.lzbi.asset.service.DcBusiWorkReadConfigService; +import com.lzbi.asset.service.IDcBaseAssetInfoService; import com.lzbi.common.AssetQueryParams; -import com.lzbi.common.core.page.PageDomain; -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.core.page.TableDataInfo; import com.lzbi.common.enums.BusinessType; -import com.lzbi.asset.domain.DcBusiWorkReadConfig; -import com.lzbi.asset.service.DcBusiWorkReadConfigService; +import com.lzbi.common.utils.StringUtils; import com.lzbi.common.utils.poi.ExcelUtil; -import com.lzbi.common.core.page.TableDataInfo; +import com.lzbi.special.service.DcBaseWorkSpecialService; +import com.lzbi.system.service.ISysDeptService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; -import static com.lzbi.common.core.page.TableSupport.getPageDomain; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; /** * 互联参数读取数据对照Controller - * + * * @author zhousq * @date 2023-12-04 */ @RestController @RequestMapping("/asset/assetExtConfig") -public class DcBusiWorkReadConfigController extends BaseController -{ +public class DcBusiWorkReadConfigController extends BaseController { @Autowired private DcBusiWorkReadConfigService dcBusiWorkReadConfigService; + @Autowired + private ISysDeptService deptService; + @Autowired + private DcBaseWorkSpecialService specialService; + @Autowired + private IDcBaseAssetInfoService assetInfoService; /** * 查询互联参数读取数据对照列表 */ @PostMapping("/list") - public TableDataInfo list(@RequestBody AssetQueryParams assetQueryParams) - { + public TableDataInfo list(@RequestBody AssetQueryParams assetQueryParams) { //startPage(); PageHelper.startPage(assetQueryParams.getPageNum(), assetQueryParams.getPageSize()); List list = dcBusiWorkReadConfigService.selectDcBusiWorkReadConfigMainList(assetQueryParams); return getDataTable(list); } + @PostMapping("/detail/list") - public TableDataInfo list(@RequestBody DcBusiWorkReadConfig dcBusiWorkReadConfig) - { + public TableDataInfo list(@RequestBody DcBusiWorkReadConfig dcBusiWorkReadConfig) { //startPage(); dcBusiWorkReadConfig.setAssetCode(Optional.ofNullable(dcBusiWorkReadConfig.getAssetCode()).orElse("*")); dcBusiWorkReadConfig.setAssetName(Optional.ofNullable(dcBusiWorkReadConfig.getAssetName()).orElse("")); List list = dcBusiWorkReadConfigService.selectDcBusiWorkReadConfigList(dcBusiWorkReadConfig); return getDataTable(list); } + /** * 导出互联参数读取数据对照列表 */ //@PreAuthorize("@ss.hasPermi('asset:assetExtConfig:export')") @Log(title = "互联参数读取数据对照", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, DcBusiWorkReadConfig DcBusiWorkReadConfig) - { - List list = dcBusiWorkReadConfigService.selectDcBusiWorkReadConfigList(DcBusiWorkReadConfig); + public void export(HttpServletResponse response, DcBusiWorkReadConfig dcBusiWorkReadConfig) { + List list = dcBusiWorkReadConfigService.selectDcBusiWorkReadConfigList(dcBusiWorkReadConfig); ExcelUtil util = new ExcelUtil(DcBusiWorkReadConfig.class); util.exportExcel(response, list, "互联参数读取数据对照数据"); } @@ -81,8 +81,7 @@ public class DcBusiWorkReadConfigController extends BaseController */ //@PreAuthorize("@ss.hasPermi('asset:assetExtConfig:query')") @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { + public AjaxResult getInfo(@PathVariable("id") Long id) { return success(dcBusiWorkReadConfigService.selectDcBusiWorkReadConfigById(id)); } @@ -92,9 +91,26 @@ public class DcBusiWorkReadConfigController extends BaseController ///@PreAuthorize("@ss.hasPermi('asset:assetExtConfig:add')") @Log(title = "互联参数读取数据对照", businessType = BusinessType.INSERT) @PostMapping("/add") - public AjaxResult add(@RequestBody DcBusiWorkReadConfig DcBusiWorkReadConfig) - { - return toAjax(dcBusiWorkReadConfigService.insertDcBusiWorkReadConfig(DcBusiWorkReadConfig)); + public AjaxResult add(@RequestBody JSONObject jParam) { + Long companyId = jParam.getLong("companyId"); + Long organizeId = jParam.getLong("oragnizeId"); + String assetFieldCode = jParam.getString("assetFieldCode"); + String assetCode = jParam.getString("assetCode"); + if (StringUtils.isNull(companyId)) { + return AjaxResult.error("请选择公司!"); + } + if (StringUtils.isNull(organizeId)) { + return AjaxResult.error("请选择组织结构!"); + } + if (StringUtils.isNull(assetFieldCode)) { + return AjaxResult.error("请选择专业!"); + } + if (StringUtils.isNull(assetCode)) { + return AjaxResult.error("请选择统计单元!"); + } + JSONArray data=JSONArray.parseArray(jParam.getString("sub")); + List list=getDataList(companyId ,organizeId, assetFieldCode ,assetCode,data,"id"); + return AjaxResult.success(dcBusiWorkReadConfigService.saveBatch(list)); } /** @@ -103,19 +119,57 @@ public class DcBusiWorkReadConfigController extends BaseController //@PreAuthorize("@ss.hasPermi('asset:assetExtConfig:edit')") @Log(title = "互联参数读取数据对照", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody DcBusiWorkReadConfig DcBusiWorkReadConfig) - { - return toAjax(dcBusiWorkReadConfigService.updateDcBusiWorkReadConfig(DcBusiWorkReadConfig)); - } + public AjaxResult edit(@RequestBody JSONObject jParam) { + Long companyId = jParam.getLong("companyId"); + Long organizeId = jParam.getLong("oragnizeId"); + String assetFieldCode = jParam.getString("assetFieldCode"); + String assetCode = jParam.getString("assetCode"); + if (StringUtils.isNull(companyId)) { + return AjaxResult.error("请选择公司!"); + } + if (StringUtils.isNull(organizeId)) { + return AjaxResult.error("请选择组织结构!"); + } + if (StringUtils.isNull(assetFieldCode)) { + return AjaxResult.error("请选择专业!"); + } + if (StringUtils.isNull(assetCode)) { + return AjaxResult.error("请选择统计单元!"); + } + JSONArray data=JSONArray.parseArray(jParam.getString("sub")); + List list=getDataList(companyId ,organizeId, assetFieldCode , assetCode,data,""); + return AjaxResult.success(dcBusiWorkReadConfigService.updateBatchById(list)); + } + private List getDataList( Long companyId , Long organizeId, String assetFieldCode , String assetCode,JSONArray data,String igorenProperties){ + List list = new ArrayList<>(); + String companyName = Optional.ofNullable(deptService.selectDeptById(companyId).getDeptName()).orElse(""); + String organizeName = Optional.ofNullable(deptService.selectDeptById(organizeId).getDeptName()).orElse(""); + String assetName = Optional.ofNullable(assetInfoService.selectDcBaseAssetInfoByCode(assetCode).getAssetName()).orElse(""); + String assetFieldName = Optional.ofNullable(specialService.selectDcBaseWorkSpecialByCode(assetFieldCode).getSpecialName()).orElse(""); + data.forEach(item -> { + String ss = item.toString(); + DcBusiWorkReadConfig ds = new DcBusiWorkReadConfig(); + BeanUtil.copyProperties(JSONObject.parseObject(ss), ds,igorenProperties); + ds.setAssetCode(assetCode); + ds.setCompanyId(companyId); + ds.setOragnizeId(organizeId); + ds.setAssetFieldCode(assetFieldCode); + ds.setAssetName(assetName); + ds.setAssetFieldName(assetFieldName); + ds.setOrganizeName(organizeName); + ds.setCompanyName(companyName); + list.add(ds); + }); + return list; + } /** * 删除互联参数读取数据对照 */ - // @PreAuthorize("@ss.hasPermi('asset:assetExtConfig:remove')") + // @PreAuthorize("@ss.hasPermi('asset:assetExtConfig:remove')") @Log(title = "互联参数读取数据对照", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(dcBusiWorkReadConfigService.deleteDcBusiWorkReadConfigByIds(ids)); } } 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 67ff1ec..d3a1d8e 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 @@ -56,5 +56,15 @@ public class DcBusiParamSource extends BaseModuleEntity{ /** 所属名称 */ @ApiModelProperty(name = "所属名称",notes = "") private String fieldName ; + private String value; + private String label; + public String getValue() { + return this.paramCode; + } + + + public String getLabel() { + return this.paramCode; + } } \ No newline at end of file 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 839a9b7..4416cbe 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 @@ -1,5 +1,7 @@ package com.lzbi.asset.domain; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import lombok.Data; import com.lzbi.common.annotation.Excel; import com.lzbi.module.base.BaseModuleEntity; @@ -16,6 +18,7 @@ public class DcBusiWorkReadConfig extends BaseModuleEntity private static final long serialVersionUID = 1L; /** 主键 */ @Excel(name = "主键") + @TableId(type= IdType.AUTO) private Long id; /** 公司ID */ 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 de06faf..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 @@ -19,7 +19,7 @@ public interface DcBaseAssetInfoMapper { * @return 资产信息 */ public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id); - + public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetcode); /** * 查询资产信息列表 * diff --git a/lzbi-module/src/main/java/com/lzbi/asset/service/IDcBaseAssetInfoService.java b/lzbi-module/src/main/java/com/lzbi/asset/service/IDcBaseAssetInfoService.java index 09ba29e..2c5cbb2 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/service/IDcBaseAssetInfoService.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/service/IDcBaseAssetInfoService.java @@ -19,7 +19,7 @@ public interface IDcBaseAssetInfoService { * @return 资产信息 */ public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id); - + public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetCode); /** * 查询资产信息列表 * diff --git a/lzbi-module/src/main/java/com/lzbi/asset/service/impl/DcBaseAssetInfoServiceImpl.java b/lzbi-module/src/main/java/com/lzbi/asset/service/impl/DcBaseAssetInfoServiceImpl.java index a1cec8e..d7f3335 100644 --- a/lzbi-module/src/main/java/com/lzbi/asset/service/impl/DcBaseAssetInfoServiceImpl.java +++ b/lzbi-module/src/main/java/com/lzbi/asset/service/impl/DcBaseAssetInfoServiceImpl.java @@ -29,7 +29,10 @@ public class DcBaseAssetInfoServiceImpl implements IDcBaseAssetInfoService { public DcBaseAssetInfo selectDcBaseAssetInfoById(Long id) { return dcBaseAssetInfoMapper.selectDcBaseAssetInfoById(id); } - + @Override + public DcBaseAssetInfo selectDcBaseAssetInfoByCode(String assetCode) { + return dcBaseAssetInfoMapper.selectDcBaseAssetInfoByCode(assetCode); + } /** * 查询资产信息列表 * diff --git a/lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiPlanTargetMonthController.java b/lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiPlanTargetMonthController.java new file mode 100644 index 0000000..ef6d3e8 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bill/controller/DcBusiPlanTargetMonthController.java @@ -0,0 +1,131 @@ +package com.lzbi.bill.controller; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.lzbi.common.annotation.Log; +import com.lzbi.common.core.controller.BaseController; +import com.lzbi.common.core.domain.AjaxResult; +import com.lzbi.common.enums.BusinessType; +import com.lzbi.bill.domain. DcBusiPlanTargetMonth; +import com.lzbi.bill.service.DcBusiPlanTargetMonthService; +import com.lzbi.common.utils.poi.ExcelUtil; +import com.lzbi.common.core.page.TableDataInfo; + +/** + * 指标月度计划Controller + * + * @author zhousq + * @date 2023-12-06 + */ +@RestController +@RequestMapping("/asset/targetPlanMonth") +public class DcBusiPlanTargetMonthController extends BaseController +{ + @Autowired + private DcBusiPlanTargetMonthService dcBusiPlanTargetMonthService; + + /** + * 查询指标月度计划列表 + */ + @ApiOperation("查询指标月度计划列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBusiPlanTargetMonth", value = "", dataType = "DcBusiPlanTargetMonth", dataTypeClass = DcBusiPlanTargetMonth.class), + }) + @PreAuthorize("@ss.hasPermi('asset:targetPlanMonth:list')") + @GetMapping("/list") + public TableDataInfo list(DcBusiPlanTargetMonth DcBusiPlanTargetMonth) + { + startPage(); + List< DcBusiPlanTargetMonth> list = dcBusiPlanTargetMonthService.selectDcBusiPlanTargetMonthList(DcBusiPlanTargetMonth); + return getDataTable(list); + } + + /** + * 导出指标月度计划列表 + */ + @ApiOperation("导出指标月度计划列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBusiPlanTargetMonth", value = "", dataType = "DcBusiPlanTargetMonth", dataTypeClass = DcBusiPlanTargetMonth.class), + }) + @PreAuthorize("@ss.hasPermi('asset:targetPlanMonth:export')") + @Log(title = "指标月度计划", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response,DcBusiPlanTargetMonth DcBusiPlanTargetMonth) + { + List list = dcBusiPlanTargetMonthService.selectDcBusiPlanTargetMonthList(DcBusiPlanTargetMonth); + ExcelUtil util = new ExcelUtil(DcBusiPlanTargetMonth.class); + util.exportExcel(response, list, "指标月度计划数据"); + } + + /** + * 获取指标月度计划详细信息 + */ + @ApiOperation("获取指标月度计划详细信息") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class), + }) + @PreAuthorize("@ss.hasPermi('asset:targetPlanMonth:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(dcBusiPlanTargetMonthService.selectDcBusiPlanTargetMonthById(id)); + } + + /** + * 新增指标月度计划 + */ + @ApiOperation("新增指标月度计划") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBusiPlanTargetMonth", value = "", dataType = "DcBusiPlanTargetMonth", dataTypeClass = DcBusiPlanTargetMonth.class), + }) + @PreAuthorize("@ss.hasPermi('asset:targetPlanMonth:add')") + @Log(title = "指标月度计划", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DcBusiPlanTargetMonth DcBusiPlanTargetMonth) + { + return toAjax(dcBusiPlanTargetMonthService.insertDcBusiPlanTargetMonth(DcBusiPlanTargetMonth)); + } + + /** + * 修改指标月度计划 + */ + + @ApiOperation("修改指标月度计划") + @ApiImplicitParams({ + @ApiImplicitParam(name = "DcBusiPlanTargetMonth", value = "", dataType = "DcBusiPlanTargetMonth", dataTypeClass = DcBusiPlanTargetMonth.class), + }) + @PreAuthorize("@ss.hasPermi('asset:targetPlanMonth:edit')") + @Log(title = "指标月度计划", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DcBusiPlanTargetMonth DcBusiPlanTargetMonth) + { + return toAjax(dcBusiPlanTargetMonthService.updateDcBusiPlanTargetMonth(DcBusiPlanTargetMonth)); + } + + /** + * 删除指标月度计划 + */ + @ApiOperation("删除指标月度计划") + @ApiImplicitParams({ + @ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class), + }) + @PreAuthorize("@ss.hasPermi('asset:targetPlanMonth:remove')") + @Log(title = "指标月度计划", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dcBusiPlanTargetMonthService.deleteDcBusiPlanTargetMonthByIds(ids)); + } +} 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 new file mode 100644 index 0000000..3ca8f6f --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bill/domain/DcBusiPlanTargetMonth.java @@ -0,0 +1,96 @@ +package com.lzbi.bill.domain; + +import java.math.BigDecimal; +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; + +/** + * 指标月度计划对象 dc_busi_plan_target_month + * + * @author zhousq + * @date 2023-12-06 + */ +@Data +public class DcBusiPlanTargetMonth extends BaseModuleEntity +{ + private static final long serialVersionUID = 1L; + + /** 创建人 */ + private String createdBy; + + /** 创建时间 */ + private Date createdTime; + + /** 更新人 */ + private String updatedBy; + + /** 更新时间 */ + private Date updatedTime; + + /** 主键 */ + private Long id; + + /** 公司名称 */ + @Excel(name = "公司名称") + private String companyName; + + /** 公司编码 */ + private Long companyId; + + /** 组织机构代码 */ + private Long orgId; + + /** 组织机构名称 */ + @Excel(name = "组织机构名称") + private String orgName; + + /** 统计单元编码 */ + @Excel(name = "统计单元编码") + private String assetCode; + + /** 统计单元名称 */ + @Excel(name = "统计单元名称") + private String assetName; + + /** 所属专业名称 */ + @Excel(name = "所属专业名称") + private String fieldName; + + /** 所属专业编码 */ + @Excel(name = "所属专业编码") + private String fieldCode; + + /** 指标名称 */ + @Excel(name = "指标名称") + private String targetNameDefine; + + /** 指标编码 */ + @Excel(name = "指标编码") + private String targetCode; + + /** 指标单位 */ + @Excel(name = "指标单位") + private String targetUint; + + /** 年 */ + @Excel(name = "年") + private String countYear; + + /** 月 */ + @Excel(name = "月") + private String countMonth; + + /** 指标别名 */ + @Excel(name = "指标别名") + private String targetNameAlias; + + /** 计划值 */ + @Excel(name = "计划值") + private BigDecimal valPlan; + +} diff --git a/lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiPlanTargetMonthMapper.java b/lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiPlanTargetMonthMapper.java new file mode 100644 index 0000000..bf0fda2 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bill/mapper/DcBusiPlanTargetMonthMapper.java @@ -0,0 +1,63 @@ +package com.lzbi.bill.mapper; + +import java.util.List; +import com.lzbi.bill.domain.DcBusiPlanTargetMonth; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 指标月度计划Mapper接口 + * + * @author zhousq + * @date 2023-12-06 + */ + +public interface DcBusiPlanTargetMonthMapper extends BaseMapper +{ + /** + * 查询指标月度计划 + * + * @param id 指标月度计划主键 + * @return 指标月度计划 + */ + public DcBusiPlanTargetMonth selectDcBusiPlanTargetMonthById(Long id); + + /** + * 查询指标月度计划列表 + * + * @param dcBusiPlanTargetMonth 指标月度计划 + * @return 指标月度计划集合 + */ + public List selectDcBusiPlanTargetMonthList(DcBusiPlanTargetMonth dcBusiPlanTargetMonth); + + /** + * 新增指标月度计划 + * + * @param dcBusiPlanTargetMonth 指标月度计划 + * @return 结果 + */ + public int insertDcBusiPlanTargetMonth(DcBusiPlanTargetMonth dcBusiPlanTargetMonth); + + /** + * 修改指标月度计划 + * + * @param dcBusiPlanTargetMonth 指标月度计划 + * @return 结果 + */ + public int updateDcBusiPlanTargetMonth(DcBusiPlanTargetMonth dcBusiPlanTargetMonth); + + /** + * 删除指标月度计划 + * + * @param id 指标月度计划主键 + * @return 结果 + */ + public int deleteDcBusiPlanTargetMonthById(Long id); + + /** + * 批量删除指标月度计划 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDcBusiPlanTargetMonthByIds(Long[] ids); +} diff --git a/lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanTargetMonthService.java b/lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanTargetMonthService.java new file mode 100644 index 0000000..1bbde3f --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/bill/service/DcBusiPlanTargetMonthService.java @@ -0,0 +1,91 @@ +package com.lzbi.bill.service; + +import java.util.List; +import com.lzbi.common.utils.DateUtils; +import org.springframework.stereotype.Service; +import com.lzbi.bill.domain.DcBusiPlanTargetMonth; +import com.lzbi.bill.mapper.DcBusiPlanTargetMonthMapper; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +/** + * 指标月度计划Service业务层处理 + * + * @author zhousq + * @date 2023-12-06 + */ +@Service +public class DcBusiPlanTargetMonthService extends ServiceImpl implements IService +{ + + /** + * 查询指标月度计划 + * + * @param id 指标月度计划主键 + * @return 指标月度计划 + */ + public DcBusiPlanTargetMonth selectDcBusiPlanTargetMonthById(Long id) + { + return baseMapper.selectDcBusiPlanTargetMonthById(id); + } + + /** + * 查询指标月度计划列表 + * + * @param dcBusiPlanTargetMonth 指标月度计划 + * @return 指标月度计划 + */ + public List selectDcBusiPlanTargetMonthList(DcBusiPlanTargetMonth dcBusiPlanTargetMonth) + { + return baseMapper.selectDcBusiPlanTargetMonthList(dcBusiPlanTargetMonth); + } + + /** + * 新增指标月度计划 + * + * @param dcBusiPlanTargetMonth 指标月度计划 + * @return 结果 + */ + + public int insertDcBusiPlanTargetMonth(DcBusiPlanTargetMonth dcBusiPlanTargetMonth) + { + dcBusiPlanTargetMonth.setCreatedTime(DateUtils.getNowDate()); + return baseMapper.insertDcBusiPlanTargetMonth(dcBusiPlanTargetMonth); + } + + /** + * 修改指标月度计划 + * + * @param dcBusiPlanTargetMonth 指标月度计划 + * @return 结果 + */ + + public int updateDcBusiPlanTargetMonth(DcBusiPlanTargetMonth dcBusiPlanTargetMonth) + { + dcBusiPlanTargetMonth.setUpdatedTime(DateUtils.getNowDate()); + return baseMapper.updateDcBusiPlanTargetMonth(dcBusiPlanTargetMonth); + } + + /** + * 批量删除指标月度计划 + * + * @param ids 需要删除的指标月度计划主键 + * @return 结果 + */ + + public int deleteDcBusiPlanTargetMonthByIds(Long[] ids) + { + return baseMapper.deleteDcBusiPlanTargetMonthByIds(ids); + } + + /** + * 删除指标月度计划信息 + * + * @param id 指标月度计划主键 + * @return 结果 + */ + + public int deleteDcBusiPlanTargetMonthById(Long id) + { + return baseMapper.deleteDcBusiPlanTargetMonthById(id); + } +} 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 d81a86b..37fa846 100644 --- a/lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java +++ b/lzbi-module/src/main/java/com/lzbi/common/SelectOptionsControl.java @@ -115,9 +115,8 @@ public class SelectOptionsControl extends BaseController { { DcBaseAssetTargetDao dcBaseAssetTargetDao=new DcBaseAssetTargetDao(); dcBaseAssetTargetDao.setAssetCode(assetQueryParams.getAssetCode()); - dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId()); - dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao); - return AjaxResult.success(null); + //dcBaseAssetTargetDao.setAssetId(assetQueryParams.getAssetId()); + return AjaxResult.success(dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao)); } // //获取IOT参数列表 diff --git a/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamCollectBill.java b/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamCollectBill.java new file mode 100644 index 0000000..07c579a --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/draft/controller/DcBusiParamCollectBill.java @@ -0,0 +1,44 @@ +package com.lzbi.draft.controller; + +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.DcBusiParamBillMaster; +import com.lzbi.draft.service.DcBusiParamBillMasterService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 参数采集(录入)单据主Controller + * + * @author win + * @date 2023-11-28 + */ +@RestController +@RequestMapping("/draft/paramCollect") +public class DcBusiParamCollectBill extends BaseController +{ + @Autowired + private DcBusiParamBillMasterService dcBusiParamBillMasterService; + + /** + * 查询参数采集(录入)单据主列表 + */ + @PreAuthorize("@ss.hasPermi('param:paramData:list')") + @GetMapping("/list") + public TableDataInfo list(DcBusiParamBillMaster dcBusiParamBillMasterDao) + { + startPage(); + List list = dcBusiParamBillMasterService.selectDcBusiParamBillMasterDaoList(dcBusiParamBillMasterDao); + return getDataTable(list); + } + + +} diff --git a/lzbi-module/src/main/java/com/lzbi/special/mapper/DcBaseWorkSpecialMapper.java b/lzbi-module/src/main/java/com/lzbi/special/mapper/DcBaseWorkSpecialMapper.java index 1dfc9a0..90815f6 100644 --- a/lzbi-module/src/main/java/com/lzbi/special/mapper/DcBaseWorkSpecialMapper.java +++ b/lzbi-module/src/main/java/com/lzbi/special/mapper/DcBaseWorkSpecialMapper.java @@ -22,6 +22,7 @@ public interface DcBaseWorkSpecialMapper extends BaseMapper * @return 生产专业管理 */ public DcBaseWorkSpecial selectDcBaseWorkSpecialById(Long id); + public DcBaseWorkSpecial selectDcBaseWorkSpecialByCode(String specialCode); /** * 查询生产专业管理列表 diff --git a/lzbi-module/src/main/java/com/lzbi/special/service/DcBaseWorkSpecialService.java b/lzbi-module/src/main/java/com/lzbi/special/service/DcBaseWorkSpecialService.java index 41aa85a..79fda5c 100644 --- a/lzbi-module/src/main/java/com/lzbi/special/service/DcBaseWorkSpecialService.java +++ b/lzbi-module/src/main/java/com/lzbi/special/service/DcBaseWorkSpecialService.java @@ -30,6 +30,10 @@ public class DcBaseWorkSpecialService extends ServiceImpl + insert into dc_base_asset_info diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml index f1096f7..38cfcc3 100644 --- a/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml +++ b/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml @@ -42,7 +42,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - + insert into dc_base_work_special diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBusiPlanTargetMonthMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBusiPlanTargetMonthMapper.xml new file mode 100644 index 0000000..16a78b3 --- /dev/null +++ b/lzbi-module/src/main/resources/mapper/asset/DcBusiPlanTargetMonthMapper.xml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, id, company_name, company_id, org_id, org_name, asset_code, asset_name, field_name, field_code, target_name_define, target_code, target_uint, count_year, count_month, target_name_alias, val_plan from dc_busi_plan_target_month + + + + + + + + insert into dc_busi_plan_target_month + + tenant_id, + revision, + created_by, + created_time, + updated_by, + updated_time, + delete_by, + delete_time, + company_name, + company_id, + org_id, + org_name, + asset_code, + asset_name, + field_name, + field_code, + target_name_define, + target_code, + target_uint, + count_year, + count_month, + target_name_alias, + val_plan, + + + #{tenantId}, + #{revision}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, + #{deleteBy}, + #{deleteTime}, + #{companyName}, + #{companyId}, + #{orgId}, + #{orgName}, + #{assetCode}, + #{assetName}, + #{fieldName}, + #{fieldCode}, + #{targetNameDefine}, + #{targetCode}, + #{targetUint}, + #{countYear}, + #{countMonth}, + #{targetNameAlias}, + #{valPlan}, + + + + + update dc_busi_plan_target_month + + tenant_id = #{tenantId}, + revision = #{revision}, + created_by = #{createdBy}, + created_time = #{createdTime}, + updated_by = #{updatedBy}, + updated_time = #{updatedTime}, + delete_by = #{deleteBy}, + delete_time = #{deleteTime}, + company_name = #{companyName}, + company_id = #{companyId}, + org_id = #{orgId}, + org_name = #{orgName}, + asset_code = #{assetCode}, + asset_name = #{assetName}, + field_name = #{fieldName}, + field_code = #{fieldCode}, + target_name_define = #{targetNameDefine}, + target_code = #{targetCode}, + target_uint = #{targetUint}, + count_year = #{countYear}, + count_month = #{countMonth}, + target_name_alias = #{targetNameAlias}, + val_plan = #{valPlan}, + + where id = #{id} + + + + delete from dc_busi_plan_target_month where id = #{id} + + + + delete from dc_busi_plan_target_month where id in + + #{id} + + + \ No newline at end of file diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBusiWorkReadConfigMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBusiWorkReadConfigMapper.xml index aaa8c81..76703fa 100644 --- a/lzbi-module/src/main/resources/mapper/asset/DcBusiWorkReadConfigMapper.xml +++ b/lzbi-module/src/main/resources/mapper/asset/DcBusiWorkReadConfigMapper.xml @@ -49,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and asset_name like concat('%', #{assetName}, '%') and asset_code = #{assetCode} + order by id desc @@ -40,13 +41,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and target_name like concat('%', #{targetName}, '%') and target_code = #{targetCode} and target_field = #{targetField} - and limit_up = #{limitUp} - and limit_down = #{limitDown} - and value_base = #{valueBase} - and flag_avg = #{flagAvg} - and flag_sum = #{flagSum} - and flag_compute = #{flagCompute} - and sort = #{sort} + and asset_code = #{assetCode} +