diff --git a/lzbi-common/src/main/java/com/lzbi/common/utils/html/HTMLFilter.java b/lzbi-common/src/main/java/com/lzbi/common/utils/html/HTMLFilter.java index 277b2e9..c69c51f 100644 --- a/lzbi-common/src/main/java/com/lzbi/common/utils/html/HTMLFilter.java +++ b/lzbi-common/src/main/java/com/lzbi/common/utils/html/HTMLFilter.java @@ -106,7 +106,7 @@ public final class HTMLFilter final ArrayList a_atts = new ArrayList<>(); a_atts.add("href"); - a_atts.add("target"); + a_atts.add("targetFolder"); vAllowed.put("a", a_atts); final ArrayList img_atts = new ArrayList<>(); 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 f087fff..2ce56f5 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 @@ -30,7 +30,7 @@ import java.util.List; * @date 2023-11-27 */ @RestController -@RequestMapping("/lzbi/asset_info") +@RequestMapping("/lzbi/assetInfo") public class DcBaseAssetInfoController extends BaseController { @Autowired private IDcBaseAssetInfoService dcBaseAssetInfoService; @@ -38,7 +38,7 @@ public class DcBaseAssetInfoController extends BaseController { /** * 查询资产信息列表 */ - @PreAuthorize("@ss.hasPermi('lzbi:asset_info:list')") + @PreAuthorize("@ss.hasPermi('lzbi:assetInfo:list')") @GetMapping("/list") public TableDataInfo list(DcBaseAssetInfo dcBaseAssetInfo) { startPage(); @@ -49,7 +49,7 @@ public class DcBaseAssetInfoController extends BaseController { /** * 导出资产信息列表 */ - @PreAuthorize("@ss.hasPermi('lzbi:asset_info:export')") + @PreAuthorize("@ss.hasPermi('lzbi:assetInfo:export')") @Log(title = "资产信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcBaseAssetInfo dcBaseAssetInfo) { @@ -61,7 +61,7 @@ public class DcBaseAssetInfoController extends BaseController { /** * 获取资产信息详细信息 */ - @PreAuthorize("@ss.hasPermi('lzbi:asset_info:query')") + @PreAuthorize("@ss.hasPermi('lzbi:assetInfo:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(dcBaseAssetInfoService.selectDcBaseAssetInfoById(id)); @@ -70,7 +70,7 @@ public class DcBaseAssetInfoController extends BaseController { /** * 新增资产信息 */ - @PreAuthorize("@ss.hasPermi('lzbi:asset_info:add')") + @PreAuthorize("@ss.hasPermi('lzbi:assetInfo:add')") @Log(title = "资产信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcBaseAssetInfo dcBaseAssetInfo) { @@ -80,7 +80,7 @@ public class DcBaseAssetInfoController extends BaseController { /** * 修改资产信息 */ - @PreAuthorize("@ss.hasPermi('lzbi:asset_info:edit')") + @PreAuthorize("@ss.hasPermi('lzbi:assetInfo:edit')") @Log(title = "资产信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcBaseAssetInfo dcBaseAssetInfo) { @@ -90,7 +90,7 @@ public class DcBaseAssetInfoController extends BaseController { /** * 删除资产信息 */ - @PreAuthorize("@ss.hasPermi('lzbi:asset_info:remove')") + @PreAuthorize("@ss.hasPermi('lzbi:assetInfo:remove')") @Log(title = "资产信息", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { 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 cfee29c..05ab81b 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 @@ -36,6 +36,12 @@ public class BaseModuleEntity implements Serializable,Cloneable{ /** 删除时间 */ @ApiModelProperty(name = "删除时间",notes = "") private Date deleteTime ; + /** 部门id */ + @ApiModelProperty(name = "部门id",notes = "") + private Long deptId ; + /** 用户id */ + @ApiModelProperty(name = "用户id",notes = "") + private Long userId ; public String getTenantId() { return tenantId; @@ -100,4 +106,20 @@ public class BaseModuleEntity implements Serializable,Cloneable{ public void setDeleteTime(Date deleteTime) { this.deleteTime = deleteTime; } + + 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/controller/DcBaseWorkSpecialController.java b/lzbi-module/src/main/java/com/lzbi/special/controller/DcBaseWorkSpecialController.java index 2ed7651..d02b40f 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,8 +1,15 @@ package com.lzbi.special.controller; +import java.time.LocalDateTime; +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.special.domain.DcBaseWorkSpecial; import com.lzbi.special.service.DcBaseWorkSpecialService; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; @@ -18,7 +25,6 @@ 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.special.domain.DcBaseWorkSpecialDao; import com.lzbi.common.utils.poi.ExcelUtil; import com.lzbi.common.core.page.TableDataInfo; @@ -40,10 +46,10 @@ public class DcBaseWorkSpecialController extends BaseController */ @PreAuthorize("@ss.hasPermi('special:specialManager:list')") @GetMapping("/list") - public TableDataInfo list(DcBaseWorkSpecialDao dcBaseWorkSpecialDao) + public TableDataInfo list(DcBaseWorkSpecial dcBaseWorkSpecial) { startPage(); - List list = dcBaseWorkSpecialService.selectDcBaseWorkSpecialDaoList(dcBaseWorkSpecialDao); + List list = dcBaseWorkSpecialService.selectDcBaseWorkSpecialDaoList(dcBaseWorkSpecial); return getDataTable(list); } @@ -53,10 +59,10 @@ public class DcBaseWorkSpecialController extends BaseController @PreAuthorize("@ss.hasPermi('special:specialManager:export')") @Log(title = "生产专业管理", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, DcBaseWorkSpecialDao dcBaseWorkSpecialDao) + public void export(HttpServletResponse response, DcBaseWorkSpecial dcBaseWorkSpecial) { - List list = dcBaseWorkSpecialService.selectDcBaseWorkSpecialDaoList(dcBaseWorkSpecialDao); - ExcelUtil util = new ExcelUtil(DcBaseWorkSpecialDao.class); + List list = dcBaseWorkSpecialService.selectDcBaseWorkSpecialDaoList(dcBaseWorkSpecial); + ExcelUtil util = new ExcelUtil(DcBaseWorkSpecial.class); util.exportExcel(response, list, "生产专业管理数据"); } @@ -67,7 +73,7 @@ public class DcBaseWorkSpecialController extends BaseController @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { - return success(dcBaseWorkSpecialService.selectDcBaseWorkSpecialDaoById(id)); + return success(dcBaseWorkSpecialService.selectDcBaseWorkSpecialById(id)); } /** @@ -76,9 +82,9 @@ public class DcBaseWorkSpecialController extends BaseController @PreAuthorize("@ss.hasPermi('special:specialManager:add')") @Log(title = "生产专业管理", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody DcBaseWorkSpecialDao dcBaseWorkSpecialDao) + public AjaxResult add(@RequestBody DcBaseWorkSpecial dcBaseWorkSpecial) { - return toAjax(dcBaseWorkSpecialService.insertDcBaseWorkSpecialDao(dcBaseWorkSpecialDao)); + return toAjax(dcBaseWorkSpecialService.insertDcBaseWorkSpecial(dcBaseWorkSpecial)); } /** @@ -87,9 +93,9 @@ public class DcBaseWorkSpecialController extends BaseController @PreAuthorize("@ss.hasPermi('special:specialManager:edit')") @Log(title = "生产专业管理", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody DcBaseWorkSpecialDao dcBaseWorkSpecialDao) + public AjaxResult edit(@RequestBody DcBaseWorkSpecial dcBaseWorkSpecial) { - return toAjax(dcBaseWorkSpecialService.updateDcBaseWorkSpecialDao(dcBaseWorkSpecialDao)); + return toAjax(dcBaseWorkSpecialService.updateDcBaseWorkSpecialDao(dcBaseWorkSpecial)); } /** @@ -100,7 +106,7 @@ public class DcBaseWorkSpecialController extends BaseController @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { - return toAjax(dcBaseWorkSpecialService.deleteDcBaseWorkSpecialDaoByIds(ids)); + return toAjax(dcBaseWorkSpecialService.deleteDcBaseWorkSpecialByIds(ids)); } @@ -109,12 +115,70 @@ public class DcBaseWorkSpecialController extends BaseController */ @PreAuthorize("@ss.hasPermi('special:specialManager:list')") @GetMapping("/listNoPage") - public AjaxResult listNoPage(DcBaseWorkSpecialDao dcBaseWorkSpecialDao) + public AjaxResult listNoPage(DcBaseWorkSpecial dcBaseWorkSpecial) { - List list = dcBaseWorkSpecialService.selectDcBaseWorkSpecialDaoList(dcBaseWorkSpecialDao); + List list = dcBaseWorkSpecialService.selectDcBaseWorkSpecialDaoList(dcBaseWorkSpecial); return AjaxResult.success(list); } + /** + * 新增生产专业管理 + */ + @PreAuthorize("@ss.hasPermi('special:specialManager:add')") + @Log(title = "生产专业管理", businessType = BusinessType.INSERT) + @PostMapping("/addBatch") + public AjaxResult addBatch(@RequestBody JSONArray jsonArray) + { + 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"); + DcBaseWorkSpecial dcBaseWorkSpecial = JSON.toJavaObject(beanObject, DcBaseWorkSpecial.class); + dcBaseWorkSpecial.setCreatedTime(DateUtils.getNowDate()); + dcBaseWorkSpecial.setDeptId(getDeptId()); + dcBaseWorkSpecial.setUserId(getUserId()); + dcBaseWorkSpecial.setCreatedBy(String.valueOf(getUserId())); + dcBaseWorkSpecial.setCreatedTime(DateUtils.getNowDate()); + beanList.add(dcBaseWorkSpecial); + } + } catch (Exception e) { + throw new IllegalArgumentException("解析list对象异常!"); + } + return toAjax(dcBaseWorkSpecialService.saveBatch(beanList)); + } + + + /** + * 修改生产专业管理 + */ + @PreAuthorize("@ss.hasPermi('special:specialManager: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); + DcBaseWorkSpecial dcBaseWorkSpecial = JSON.toJavaObject(beanObject, DcBaseWorkSpecial.class); + dcBaseWorkSpecial.setUpdatedBy(String.valueOf(getUserId())); + dcBaseWorkSpecial.setUpdatedTime(DateUtils.getNowDate()); + dcBaseWorkSpecialList.add(dcBaseWorkSpecial); + } + } catch (Exception e) { + throw new IllegalArgumentException("解析list对象异常!"); + } + return toAjax(dcBaseWorkSpecialService.updateBatchById(dcBaseWorkSpecialList)); + } + } diff --git a/lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecialDao.java b/lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecial.java similarity index 94% rename from lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecialDao.java rename to lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecial.java index abb9030..9ba942a 100644 --- a/lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecialDao.java +++ b/lzbi-module/src/main/java/com/lzbi/special/domain/DcBaseWorkSpecial.java @@ -1,7 +1,9 @@ package com.lzbi.special.domain; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.lzbi.common.annotation.Excel; @@ -13,7 +15,7 @@ import com.lzbi.module.base.BaseModuleEntity; * @author win * @date 2023-11-28 */ -public class DcBaseWorkSpecialDao extends BaseModuleEntity +public class DcBaseWorkSpecial extends BaseModuleEntity { private static final long serialVersionUID = 1L; @@ -41,6 +43,7 @@ public class DcBaseWorkSpecialDao extends BaseModuleEntity /** 删除时间 */ private Date deleteTime; + @TableId(value = "id", type = IdType.AUTO) /** 主键 */ private Long id; 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 e2421e9..12f6b15 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 @@ -3,7 +3,7 @@ package com.lzbi.special.mapper; import java.util.List; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.lzbi.special.domain.DcBaseWorkSpecialDao; +import com.lzbi.special.domain.DcBaseWorkSpecial; /** @@ -13,7 +13,7 @@ import com.lzbi.special.domain.DcBaseWorkSpecialDao; * @date 2023-11-28 */ -public interface DcBaseWorkSpecialMapper extends BaseMapper +public interface DcBaseWorkSpecialMapper extends BaseMapper { /** * 查询生产专业管理 @@ -21,31 +21,31 @@ public interface DcBaseWorkSpecialMapper extends BaseMapper selectDcBaseWorkSpecialDaoList(DcBaseWorkSpecialDao dcBaseWorkSpecialDao); + public List selectDcBaseWorkSpecialList(DcBaseWorkSpecial dcBaseWorkSpecial); /** * 新增生产专业管理 * - * @param dcBaseWorkSpecialDao 生产专业管理 + * @param dcBaseWorkSpecial 生产专业管理 * @return 结果 */ - public int insertDcBaseWorkSpecialDao(DcBaseWorkSpecialDao dcBaseWorkSpecialDao); + public int insertDcBaseWorkSpecial(DcBaseWorkSpecial dcBaseWorkSpecial); /** * 修改生产专业管理 * - * @param dcBaseWorkSpecialDao 生产专业管理 + * @param dcBaseWorkSpecial 生产专业管理 * @return 结果 */ - public int updateDcBaseWorkSpecialDao(DcBaseWorkSpecialDao dcBaseWorkSpecialDao); + public int updateDcBaseWorkSpecial(DcBaseWorkSpecial dcBaseWorkSpecial); /** * 删除生产专业管理 @@ -53,7 +53,7 @@ public interface DcBaseWorkSpecialMapper extends BaseMapper implements IService +public class DcBaseWorkSpecialService extends ServiceImpl implements IService { @@ -26,47 +26,47 @@ public class DcBaseWorkSpecialService extends ServiceImpl selectDcBaseWorkSpecialDaoList(DcBaseWorkSpecialDao dcBaseWorkSpecialDao) + public List selectDcBaseWorkSpecialDaoList(DcBaseWorkSpecial dcBaseWorkSpecial) { - return baseMapper.selectDcBaseWorkSpecialDaoList(dcBaseWorkSpecialDao); + return baseMapper.selectDcBaseWorkSpecialList(dcBaseWorkSpecial); } /** * 新增生产专业管理 * - * @param dcBaseWorkSpecialDao 生产专业管理 + * @param dcBaseWorkSpecial 生产专业管理 * @return 结果 */ - public int insertDcBaseWorkSpecialDao(DcBaseWorkSpecialDao dcBaseWorkSpecialDao) + public int insertDcBaseWorkSpecial(DcBaseWorkSpecial dcBaseWorkSpecial) { - dcBaseWorkSpecialDao.setCreatedTime(DateUtils.getNowDate()); - return baseMapper.insertDcBaseWorkSpecialDao(dcBaseWorkSpecialDao); + dcBaseWorkSpecial.setCreatedTime(DateUtils.getNowDate()); + return baseMapper.insertDcBaseWorkSpecial(dcBaseWorkSpecial); } /** * 修改生产专业管理 * - * @param dcBaseWorkSpecialDao 生产专业管理 + * @param dcBaseWorkSpecial 生产专业管理 * @return 结果 */ - public int updateDcBaseWorkSpecialDao(DcBaseWorkSpecialDao dcBaseWorkSpecialDao) + public int updateDcBaseWorkSpecialDao(DcBaseWorkSpecial dcBaseWorkSpecial) { - dcBaseWorkSpecialDao.setUpdatedTime(DateUtils.getNowDate()); - return baseMapper.updateDcBaseWorkSpecialDao(dcBaseWorkSpecialDao); + dcBaseWorkSpecial.setUpdatedTime(DateUtils.getNowDate()); + return baseMapper.updateDcBaseWorkSpecial(dcBaseWorkSpecial); } /** @@ -76,9 +76,9 @@ public class DcBaseWorkSpecialService extends ServiceImpl list = dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao); + return getDataTable(list); + } + + /** + * 导出资产指标配置列表 + */ + @PreAuthorize("@ss.hasPermi('target:target:export')") + @Log(title = "资产指标配置", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DcBaseAssetTargetDao dcBaseAssetTargetDao) + { + List list = dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao); + ExcelUtil util = new ExcelUtil(DcBaseAssetTargetDao.class); + util.exportExcel(response, list, "资产指标配置数据"); + } + + /** + * 获取资产指标配置详细信息 + */ + @PreAuthorize("@ss.hasPermi('target:target:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(dcBaseAssetTargetService.selectDcBaseAssetTargetDaoById(id)); + } + + /** + * 新增资产指标配置 + */ + @PreAuthorize("@ss.hasPermi('target:target:add')") + @Log(title = "资产指标配置", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DcBaseAssetTargetDao dcBaseAssetTargetDao) + { + return toAjax(dcBaseAssetTargetService.insertDcBaseAssetTargetDao(dcBaseAssetTargetDao)); + } + + /** + * 修改资产指标配置 + */ + @PreAuthorize("@ss.hasPermi('target:target:edit')") + @Log(title = "资产指标配置", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DcBaseAssetTargetDao dcBaseAssetTargetDao) + { + return toAjax(dcBaseAssetTargetService.updateDcBaseAssetTargetDao(dcBaseAssetTargetDao)); + } + + /** + * 删除资产指标配置 + */ + @PreAuthorize("@ss.hasPermi('target:target:remove')") + @Log(title = "资产指标配置", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dcBaseAssetTargetService.deleteDcBaseAssetTargetDaoByIds(ids)); + } + + + /** + * 查询资产指标配置列表 + */ + @PreAuthorize("@ss.hasPermi('target:target:list')") + @GetMapping("/listNoPage") + public AjaxResult listNoPage(DcBaseAssetTargetDao dcBaseAssetTargetDao) + { + List list = dcBaseAssetTargetService.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao); + return AjaxResult.success(list); + } + + +} 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 new file mode 100644 index 0000000..0bd1def --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/controller/DcBaseTargetModelController.java @@ -0,0 +1,117 @@ +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; +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.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 + */ +@RestController +@RequestMapping("/target/targetModel") +public class DcBaseTargetModelController extends BaseController +{ + @Autowired + private DcBaseTargetModelService dcBaseTargetModelService; + + /** + * 查询指标模版配置列表 + */ + @PreAuthorize("@ss.hasPermi('target:targetModel:list')") + @GetMapping("/list") + public TableDataInfo list(DcBaseTargetModelDao dcBaseTargetModelDao) + { + startPage(); + List list = dcBaseTargetModelService.selectDcBaseTargetModelDaoList(dcBaseTargetModelDao); + return getDataTable(list); + } + + /** + * 导出指标模版配置列表 + */ + @PreAuthorize("@ss.hasPermi('target:targetModel:export')") + @Log(title = "指标模版配置", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DcBaseTargetModelDao dcBaseTargetModelDao) + { + List list = dcBaseTargetModelService.selectDcBaseTargetModelDaoList(dcBaseTargetModelDao); + ExcelUtil util = new ExcelUtil(DcBaseTargetModelDao.class); + util.exportExcel(response, list, "指标模版配置数据"); + } + + /** + * 获取指标模版配置详细信息 + */ + @PreAuthorize("@ss.hasPermi('target:targetModel:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(dcBaseTargetModelService.selectDcBaseTargetModelDaoById(id)); + } + + /** + * 新增指标模版配置 + */ + @PreAuthorize("@ss.hasPermi('target:targetModel:add')") + @Log(title = "指标模版配置", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DcBaseTargetModelDao dcBaseTargetModelDao) + { + return toAjax(dcBaseTargetModelService.insertDcBaseTargetModelDao(dcBaseTargetModelDao)); + } + + /** + * 修改指标模版配置 + */ + @PreAuthorize("@ss.hasPermi('target:targetModel:edit')") + @Log(title = "指标模版配置", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DcBaseTargetModelDao dcBaseTargetModelDao) + { + return toAjax(dcBaseTargetModelService.updateDcBaseTargetModelDao(dcBaseTargetModelDao)); + } + + /** + * 删除指标模版配置 + */ + @PreAuthorize("@ss.hasPermi('target:targetModel:remove')") + @Log(title = "指标模版配置", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dcBaseTargetModelService.deleteDcBaseTargetModelDaoByIds(ids)); + } + + /** + * 查询指标模版配置列表 + */ + @PreAuthorize("@ss.hasPermi('target:targetModel:list')") + @GetMapping("/listNoPage") + public AjaxResult listNoPage(DcBaseTargetModelDao dcBaseTargetModelDao) + { + List list = dcBaseTargetModelService.selectDcBaseTargetModelDaoList(dcBaseTargetModelDao); + return AjaxResult.success(list); + } + + +} 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 new file mode 100644 index 0000000..d094645 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseAssetTargetDao.java @@ -0,0 +1,77 @@ +package com.lzbi.targetFolder.domain; + +import java.math.BigDecimal; +import java.util.Date; +import lombok.Data; +import com.lzbi.common.annotation.Excel; +import com.lzbi.module.base.BaseModuleEntity; + +/** + * 资产指标配置对象 dc_base_asset_target + * + * @author Lu.JL + * @date 2023-11-30 + */ + @Data +public class DcBaseAssetTargetDao extends BaseModuleEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 资产ID */ + @Excel(name = "资产ID") + private Long assetId; + + /** 指标模型编码 */ + @Excel(name = "指标模型编码") + private String targetModelCode; + + /** 指标名称 */ + @Excel(name = "指标名称") + private String targetName; + + /** 指标编码 */ + @Excel(name = "指标编码") + private String targetCode; + + /** 所属专业 */ + @Excel(name = "所属专业") + private String targetField; + + /** 上限 */ + @Excel(name = "上限") + private BigDecimal limitUp; + + /** 下限 */ + @Excel(name = "下限") + private BigDecimal limitDown; + + /** 值 */ + @Excel(name = "值") + private BigDecimal valueBase; + + /** 是否均值 */ + @Excel(name = "是否均值") + private String flagAvg; + + /** 是否汇总 */ + @Excel(name = "是否汇总") + private String flagSum; + + /** 是否积算 */ + @Excel(name = "是否积算") + private String flagCompute; + + /** 排序 */ + @Excel(name = "排序") + private String sort; + + /** 统计单元编码 */ + @Excel(name = "统计单元编码") + private String assetCode; + + + +} diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseTargetModelDao.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseTargetModelDao.java new file mode 100644 index 0000000..8945f97 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/domain/DcBaseTargetModelDao.java @@ -0,0 +1,43 @@ +package com.lzbi.targetFolder.domain; + +import lombok.Data; +import com.lzbi.common.annotation.Excel; +import com.lzbi.module.base.BaseModuleEntity; + +/** + * 指标模版配置对象 dc_base_target_model + * + * @author Lu.JL + * @date 2023-11-29 + */ + @Data +public class DcBaseTargetModelDao extends BaseModuleEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 指标模版编码 */ + @Excel(name = "指标模版编码") + private String targetModelCode; + + /** 指标模版名称 */ + @Excel(name = "指标模版名称") + private String targetModelName; + + /** 指标类型;计算型,录入型 */ + @Excel(name = "指标类型;计算型,录入型") + private String targetModelType; + + /** 所属专业 */ + @Excel(name = "所属专业") + private String targetModelField; + + /** 指标等级 */ + @Excel(name = "指标等级") + private Long targetModelLevel; + + + +} diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java new file mode 100644 index 0000000..15eacd4 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseAssetTargetMapper.java @@ -0,0 +1,65 @@ +package com.lzbi.targetFolder.mapper; + +import java.util.List; +import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 资产指标配置Mapper接口 + * + * @author Lu.JL + * @date 2023-11-30 + */ + +@Mapper +public interface DcBaseAssetTargetMapper extends BaseMapper +{ + /** + * 查询资产指标配置 + * + * @param id 资产指标配置主键 + * @return 资产指标配置 + */ + public DcBaseAssetTargetDao selectDcBaseAssetTargetDaoById(Long id); + + /** + * 查询资产指标配置列表 + * + * @param dcBaseAssetTargetDao 资产指标配置 + * @return 资产指标配置集合 + */ + public List selectDcBaseAssetTargetDaoList(DcBaseAssetTargetDao dcBaseAssetTargetDao); + + /** + * 新增资产指标配置 + * + * @param dcBaseAssetTargetDao 资产指标配置 + * @return 结果 + */ + public int insertDcBaseAssetTargetDao(DcBaseAssetTargetDao dcBaseAssetTargetDao); + + /** + * 修改资产指标配置 + * + * @param dcBaseAssetTarget 资产指标配置 + * @return 结果 + */ + public int updateDcBaseAssetTargetDao(DcBaseAssetTargetDao dcBaseAssetTargetDao); + + /** + * 删除资产指标配置 + * + * @param id 资产指标配置主键 + * @return 结果 + */ + public int deleteDcBaseAssetTargetDaoById(Long id); + + /** + * 批量删除资产指标配置 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDcBaseAssetTargetDaoByIds(Long[] ids); +} 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 new file mode 100644 index 0000000..4cf5c38 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/mapper/DcBaseTargetModelMapper.java @@ -0,0 +1,63 @@ +package com.lzbi.targetFolder.mapper; + +import java.util.List; +import com.lzbi.targetFolder.domain.DcBaseTargetModelDao; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 指标模版配置Mapper接口 + * + * @author Lu.JL + * @date 2023-11-29 + */ + +public interface DcBaseTargetModelMapper extends BaseMapper +{ + /** + * 查询指标模版配置 + * + * @param id 指标模版配置主键 + * @return 指标模版配置 + */ + public DcBaseTargetModelDao selectDcBaseTargetModelDaoById(Long id); + + /** + * 查询指标模版配置列表 + * + * @param dcBaseTargetModelDao 指标模版配置 + * @return 指标模版配置集合 + */ + public List selectDcBaseTargetModelDaoList(DcBaseTargetModelDao dcBaseTargetModelDao); + + /** + * 新增指标模版配置 + * + * @param dcBaseTargetModelDao 指标模版配置 + * @return 结果 + */ + public int insertDcBaseTargetModelDao(DcBaseTargetModelDao dcBaseTargetModelDao); + + /** + * 修改指标模版配置 + * + * @param dcBaseTargetModel 指标模版配置 + * @return 结果 + */ + public int updateDcBaseTargetModelDao(DcBaseTargetModelDao dcBaseTargetModelDao); + + /** + * 删除指标模版配置 + * + * @param id 指标模版配置主键 + * @return 结果 + */ + public int deleteDcBaseTargetModelDaoById(Long id); + + /** + * 批量删除指标模版配置 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteDcBaseTargetModelDaoByIds(Long[] ids); +} diff --git a/lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseAssetTargetService.java b/lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseAssetTargetService.java new file mode 100644 index 0000000..287542a --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseAssetTargetService.java @@ -0,0 +1,95 @@ +package com.lzbi.targetFolder.service; + +import java.util.List; + +import com.lzbi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.lzbi.targetFolder.domain.DcBaseAssetTargetDao; +import com.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper; +import com.baomidou.mybatisplus.extension.service.IService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +/** + * 资产指标配置Service业务层处理 + * + * @author Lu.JL + * @date 2023-11-30 + */ +@Service +public class DcBaseAssetTargetService extends ServiceImpl implements IService +{ + @Autowired + private DcBaseAssetTargetMapper dcBaseAssetTargetMapper; + + /** + * 查询资产指标配置 + * + * @param id 资产指标配置主键 + * @return 资产指标配置 + */ + public DcBaseAssetTargetDao selectDcBaseAssetTargetDaoById(Long id) + { + return dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoById(id); + } + + /** + * 查询资产指标配置列表 + * + * @param dcBaseAssetTargetDao 资产指标配置 + * @return 资产指标配置 + */ + public List selectDcBaseAssetTargetDaoList(DcBaseAssetTargetDao dcBaseAssetTargetDao) + { + return dcBaseAssetTargetMapper.selectDcBaseAssetTargetDaoList(dcBaseAssetTargetDao); + } + + /** + * 新增资产指标配置 + * + * @param dcBaseAssetTargetDao 资产指标配置 + * @return 结果 + */ + + public int insertDcBaseAssetTargetDao(DcBaseAssetTargetDao dcBaseAssetTargetDao) + { + dcBaseAssetTargetDao.setCreatedTime(DateUtils.getNowDate()); + return dcBaseAssetTargetMapper.insertDcBaseAssetTargetDao(dcBaseAssetTargetDao); + } + + /** + * 修改资产指标配置 + * + * @param dcBaseAssetTargetDao 资产指标配置 + * @return 结果 + */ + + public int updateDcBaseAssetTargetDao(DcBaseAssetTargetDao dcBaseAssetTargetDao) + { + dcBaseAssetTargetDao.setUpdatedTime(DateUtils.getNowDate()); + return dcBaseAssetTargetMapper.updateDcBaseAssetTargetDao(dcBaseAssetTargetDao); + } + + /** + * 批量删除资产指标配置 + * + * @param ids 需要删除的资产指标配置主键 + * @return 结果 + */ + + public int deleteDcBaseAssetTargetDaoByIds(Long[] ids) + { + return dcBaseAssetTargetMapper.deleteDcBaseAssetTargetDaoByIds(ids); + } + + /** + * 删除资产指标配置信息 + * + * @param id 资产指标配置主键 + * @return 结果 + */ + + public int deleteDcBaseAssetTargetDaoById(Long id) + { + return dcBaseAssetTargetMapper.deleteDcBaseAssetTargetDaoById(id); + } +} 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 new file mode 100644 index 0000000..dd91986 --- /dev/null +++ b/lzbi-module/src/main/java/com/lzbi/targetFolder/service/DcBaseTargetModelService.java @@ -0,0 +1,92 @@ +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; +/** + * 指标模版配置Service业务层处理 + * + * @author Lu.JL + * @date 2023-11-29 + */ +@Service +public class DcBaseTargetModelService extends ServiceImpl implements IService +{ + + /** + * 查询指标模版配置 + * + * @param id 指标模版配置主键 + * @return 指标模版配置 + */ + public DcBaseTargetModelDao selectDcBaseTargetModelDaoById(Long id) + { + return baseMapper.selectDcBaseTargetModelDaoById(id); + } + + /** + * 查询指标模版配置列表 + * + * @param dcBaseTargetModelDao 指标模版配置 + * @return 指标模版配置 + */ + public List selectDcBaseTargetModelDaoList(DcBaseTargetModelDao dcBaseTargetModelDao) + { + return baseMapper.selectDcBaseTargetModelDaoList(dcBaseTargetModelDao); + } + + /** + * 新增指标模版配置 + * + * @param dcBaseTargetModelDao 指标模版配置 + * @return 结果 + */ + + public int insertDcBaseTargetModelDao(DcBaseTargetModelDao dcBaseTargetModelDao) + { + dcBaseTargetModelDao.setCreatedTime(DateUtils.getNowDate()); + return baseMapper.insertDcBaseTargetModelDao(dcBaseTargetModelDao); + } + + /** + * 修改指标模版配置 + * + * @param dcBaseTargetModelDao 指标模版配置 + * @return 结果 + */ + + public int updateDcBaseTargetModelDao(DcBaseTargetModelDao dcBaseTargetModelDao) + { + dcBaseTargetModelDao.setUpdatedTime(DateUtils.getNowDate()); + return baseMapper.updateDcBaseTargetModelDao(dcBaseTargetModelDao); + } + + /** + * 批量删除指标模版配置 + * + * @param ids 需要删除的指标模版配置主键 + * @return 结果 + */ + + public int deleteDcBaseTargetModelDaoByIds(Long[] ids) + { + return baseMapper.deleteDcBaseTargetModelDaoByIds(ids); + } + + /** + * 删除指标模版配置信息 + * + * @param id 指标模版配置主键 + * @return 结果 + */ + + public int deleteDcBaseTargetModelDaoById(Long id) + { + return baseMapper.deleteDcBaseTargetModelDaoById(id); + } +} diff --git a/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml b/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml index d81bbfb..573d9b3 100644 --- a/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml +++ b/lzbi-module/src/main/resources/mapper/asset/DcBaseWorkSpecialMapper.xml @@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -22,20 +22,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select TENANT_ID, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, DELETE_BY, DELETE_TIME, id, special_code, special_name from dc_base_work_special - and special_code = #{specialCode} and special_name like concat('%', #{specialName}, '%') + ORDER BY + CASE + WHEN updated_time IS NOT NULL AND updated_time > created_time THEN updated_time + ELSE created_time + END DESC - where id = #{id} - + insert into dc_base_work_special TENANT_ID, @@ -63,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + update dc_base_work_special TENANT_ID = #{tenantId}, @@ -80,11 +85,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - + delete from dc_base_work_special where id = #{id} - + delete from dc_base_work_special where id in #{id} diff --git a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml new file mode 100644 index 0000000..59d4f33 --- /dev/null +++ b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseAssetTargetMapper.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, asset_id, target_model_code, target_name, target_code, target_field, limit_up, limit_down, value_base, flag_avg, flag_sum, flag_compute, sort, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time from dc_base_asset_target + + + + + + + + insert into dc_base_asset_target + + asset_id, + target_model_code, + target_name, + target_code, + target_field, + limit_up, + limit_down, + value_base, + flag_avg, + flag_sum, + flag_compute, + sort, + tenant_id, + revision, + created_by, + created_time, + updated_by, + updated_time, + delete_by, + delete_time, + + + #{assetId}, + #{targetModelCode}, + #{targetName}, + #{targetCode}, + #{targetField}, + #{limitUp}, + #{limitDown}, + #{valueBase}, + #{flagAvg}, + #{flagSum}, + #{flagCompute}, + #{sort}, + #{tenantId}, + #{revision}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, + #{deleteBy}, + #{deleteTime}, + + + + + update dc_base_asset_target + + asset_id = #{assetId}, + target_model_code = #{targetModelCode}, + target_name = #{targetName}, + target_code = #{targetCode}, + target_field = #{targetField}, + limit_up = #{limitUp}, + limit_down = #{limitDown}, + value_base = #{valueBase}, + flag_avg = #{flagAvg}, + flag_sum = #{flagSum}, + flag_compute = #{flagCompute}, + sort = #{sort}, + 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_base_asset_target where id = #{id} + + + + delete from dc_base_asset_target where id in + + #{id} + + + \ No newline at end of file diff --git a/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseTargetModelMapper.xml b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseTargetModelMapper.xml new file mode 100644 index 0000000..ec3eef2 --- /dev/null +++ b/lzbi-module/src/main/resources/mapper/targetFolder/DcBaseTargetModelMapper.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into dc_base_target_model + + 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, + + + #{targetModelCode}, + #{targetModelName}, + #{targetModelType}, + #{targetModelField}, + #{targetModelLevel}, + #{tenantId}, + #{revision}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}, + #{deleteBy}, + #{deleteTime}, + + + + + update dc_base_target_model + + target_model_code = #{targetModelCode}, + target_model_name = #{targetModelName}, + target_model_type = #{targetModelType}, + target_model_field = #{targetModelField}, + target_model_level = #{targetModelLevel}, + 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_base_target_model where id = #{id} + + + + delete from dc_base_target_model where id in + + #{id} + + + \ No newline at end of file