he2802 2 лет назад
Родитель
Сommit
59ef5df8a9
14 измененных файлов с 531 добавлено и 13 удалено
  1. 91 0
      zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/financial/TopCostInstTpController.java
  2. 6 12
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/alioss/OssController.java
  3. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/alioss/bo/OssRequest.java
  4. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/alioss/service/impl/OssServiceImpl.java
  5. 39 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/bo/TopCostInstTpAddBo.java
  6. 44 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/bo/TopCostInstTpEditBo.java
  7. 51 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/bo/TopCostInstTpQueryBo.java
  8. 43 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/domain/TopCostInstTp.java
  9. 14 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/mapper/TopCostInstTpMapper.java
  10. 53 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/service/ITopCostInstTpService.java
  11. 103 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/service/impl/TopCostInstTpServiceImpl.java
  12. 43 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/vo/TopCostInstTpVo.java
  13. 22 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/impl/TopInstCategoryServiceImpl.java
  14. 18 0
      zhongzheng-system/src/main/resources/mapper/modules/top/TopCostInstTpMapper.xml

+ 91 - 0
zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/financial/TopCostInstTpController.java

@@ -0,0 +1,91 @@
+package com.zhongzheng.controller.financial;
+
+import java.util.List;
+import java.util.Arrays;
+
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpAddBo;
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpEditBo;
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpQueryBo;
+import com.zhongzheng.modules.top.financial.service.ITopCostInstTpService;
+import com.zhongzheng.modules.top.financial.vo.TopCostInstTpVo;
+import lombok.RequiredArgsConstructor;
+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.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.poi.ExcelUtil;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 供应商成本模板Controller
+ *
+ * @author hjl
+ * @date 2023-07-21
+ */
+@Api(value = "供应商成本模板控制器", tags = {"供应商成本模板管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/top/cost/inst/tp")
+public class TopCostInstTpController extends BaseController {
+
+    private final ITopCostInstTpService iTopCostInstTpService;
+
+    /**
+     * 查询供应商成本模板列表
+     */
+    @ApiOperation("查询供应商成本模板列表")
+    @PreAuthorize("@ss.hasPermi('system:tp:list')")
+    @GetMapping("/list")
+    public TableDataInfo<TopCostInstTpVo> list(TopCostInstTpQueryBo bo) {
+        startPage();
+        List<TopCostInstTpVo> list = iTopCostInstTpService.queryList(bo);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 获取供应商成本模板详细信息
+     */
+    @ApiOperation("获取供应商成本模板详细信息")
+    @PreAuthorize("@ss.hasPermi('system:tp:query')")
+    @GetMapping("/{tpId}")
+    public AjaxResult<TopCostInstTpVo> getInfo(@PathVariable("tpId" ) Long tpId) {
+        return AjaxResult.success(iTopCostInstTpService.queryById(tpId));
+    }
+
+    /**
+     * 新增供应商成本模板
+     */
+    @ApiOperation("新增供应商成本模板")
+    @PreAuthorize("@ss.hasPermi('system:tp:add')")
+    @Log(title = "供应商成本模板", businessType = BusinessType.INSERT)
+    @PostMapping()
+    public AjaxResult<Void> add(@RequestBody TopCostInstTpAddBo bo) {
+        return toAjax(iTopCostInstTpService.insertByAddBo(bo) ? 1 : 0);
+    }
+
+    /**
+     * 修改供应商成本模板
+     */
+    @ApiOperation("修改供应商成本模板")
+    @PreAuthorize("@ss.hasPermi('system:tp:edit')")
+    @Log(title = "供应商成本模板", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult<Void> edit(@RequestBody TopCostInstTpEditBo bo) {
+        return toAjax(iTopCostInstTpService.updateByEditBo(bo) ? 1 : 0);
+    }
+
+
+}

+ 6 - 12
zhongzheng-admin/src/main/java/com/zhongzheng/controller/alioss/OssController.java

@@ -72,18 +72,12 @@ public class OssController extends BaseController {
         return AjaxResult.success("返回图片路径",result);
     }
 
-    @ApiOperation("上传file图片")
-    @PostMapping("/uploadTest")
-    public AjaxResult<String> uploadTest() throws Exception {
-        InputStream in = ossService.getStreamByObject("oss/images/avatar/114/1315/1686203595404_1371903125");
-        FileOutputStream fos = new FileOutputStream("D:\\testfile\\b.jpg");
-        byte[] b = new byte[1024];
-        while ((in.read(b)) != -1) {
-            fos.write(b);// 写入数据
-        }
-        in.close();
-        fos.close();// 保存数据
-        return AjaxResult.success("返回图片路径","");
+    @ApiOperation("上传file图片带路径")
+    @PostMapping("/uploadPath")
+    public AjaxResult<String> uploadPath(OssRequest file) throws Exception {
+        String result = ossService.uploadWithPath(file,file.getPath());
+        log.info("服务端生成签名:{}",result);
+        return AjaxResult.success("返回图片路径",result);
     }
 
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/alioss/bo/OssRequest.java

@@ -33,4 +33,7 @@ public class OssRequest{
 
     @ApiModelProperty("班级ID")
     private Long gradeId;
+
+    @ApiModelProperty("图片路径")
+    private String path;
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/alioss/service/impl/OssServiceImpl.java

@@ -267,7 +267,7 @@ public class OssServiceImpl implements OssService {
             //获取上传文件输入流
             InputStream inputStream = base.getFile().getInputStream();
             String originalFilename = base.getFile().getOriginalFilename();
-            
+
             PutObjectResult putObjectResult = ossClient.putObject(ALIYUN_OSS_BUCKET_NAME, path, inputStream);
             // 关闭OSSClient。
             //ossClient.shutdown();

+ 39 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/bo/TopCostInstTpAddBo.java

@@ -0,0 +1,39 @@
+package com.zhongzheng.modules.top.financial.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+
+/**
+ * 供应商成本模板添加对象 top_cost_inst_tp
+ *
+ * @author hjl
+ * @date 2023-07-21
+ */
+@Data
+@ApiModel("供应商成本模板添加对象")
+public class TopCostInstTpAddBo {
+
+    /** 模板名称 */
+    @ApiModelProperty("模板名称")
+    private String tpName;
+    /** 0 禁用 1启用 */
+    @ApiModelProperty("0 禁用 1启用")
+    private Integer status;
+    /** 添加时间 */
+    @ApiModelProperty("添加时间")
+    private Long createTime;
+    /** 修改时间 */
+    @ApiModelProperty("修改时间")
+    private Long updateTime;
+    /** 默认选择状态 1选中 0非选中 */
+    @ApiModelProperty("默认选择状态 1选中 0非选中")
+    private Integer defaultStatus;
+    /** 供应商ID */
+    @ApiModelProperty("供应商ID")
+    private Long instId;
+}

+ 44 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/bo/TopCostInstTpEditBo.java

@@ -0,0 +1,44 @@
+package com.zhongzheng.modules.top.financial.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+/**
+ * 供应商成本模板编辑对象 top_cost_inst_tp
+ *
+ * @author hjl
+ * @date 2023-07-21
+ */
+@Data
+@ApiModel("供应商成本模板编辑对象")
+public class TopCostInstTpEditBo {
+
+    /** $column.columnComment */
+    @ApiModelProperty("$column.columnComment")
+    private Long tpId;
+
+    /** 模板名称 */
+    @ApiModelProperty("模板名称")
+    private String tpName;
+
+    /** 0 禁用 1启用 */
+    @ApiModelProperty("0 禁用 1启用")
+    private Integer status;
+
+    /** 修改时间 */
+    @ApiModelProperty("修改时间")
+    private Long updateTime;
+
+    /** 默认选择状态 1选中 0非选中 */
+    @ApiModelProperty("默认选择状态 1选中 0非选中")
+    private Integer defaultStatus;
+
+    /** 供应商ID */
+    @ApiModelProperty("供应商ID")
+    private Long instId;
+
+}

+ 51 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/bo/TopCostInstTpQueryBo.java

@@ -0,0 +1,51 @@
+package com.zhongzheng.modules.top.financial.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.HashMap;
+
+import com.zhongzheng.common.core.domain.BaseEntity;
+
+/**
+ * 供应商成本模板分页查询对象 top_cost_inst_tp
+ *
+ * @author hjl
+ * @date 2023-07-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel("供应商成本模板分页查询对象")
+public class TopCostInstTpQueryBo extends BaseEntity {
+
+	/** 分页大小 */
+	@ApiModelProperty("分页大小")
+	private Integer pageSize;
+	/** 当前页数 */
+	@ApiModelProperty("当前页数")
+	private Integer pageNum;
+	/** 排序列 */
+	@ApiModelProperty("排序列")
+	private String orderByColumn;
+	/** 排序的方向desc或者asc */
+	@ApiModelProperty(value = "排序的方向", example = "asc,desc")
+	private String isAsc;
+
+
+	/** 模板名称 */
+	@ApiModelProperty("模板名称")
+	private String tpName;
+	/** 0 禁用 1启用 */
+	@ApiModelProperty("0 禁用 1启用")
+	private Integer status;
+	/** 默认选择状态 1选中 0非选中 */
+	@ApiModelProperty("默认选择状态 1选中 0非选中")
+	private Integer defaultStatus;
+	/** 供应商ID */
+	@ApiModelProperty("供应商ID")
+	private Long instId;
+}

+ 43 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/domain/TopCostInstTp.java

@@ -0,0 +1,43 @@
+package com.zhongzheng.modules.top.financial.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.zhongzheng.common.annotation.Excel;
+
+/**
+ * 供应商成本模板对象 top_cost_inst_tp
+ *
+ * @author hjl
+ * @date 2023-07-21
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("top_cost_inst_tp")
+public class TopCostInstTp implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+    /** $column.columnComment */
+    @TableId(value = "tp_id")
+    private Long tpId;
+    /** 模板名称 */
+    private String tpName;
+    /** 0 禁用 1启用 */
+    private Integer status;
+    /** 添加时间 */
+    @TableField(fill = FieldFill.INSERT)
+    private Long createTime;
+    /** 修改时间 */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Long updateTime;
+    /** 默认选择状态 1选中 0非选中 */
+    private Integer defaultStatus;
+    /** 供应商ID */
+    private Long instId;
+}

+ 14 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/mapper/TopCostInstTpMapper.java

@@ -0,0 +1,14 @@
+package com.zhongzheng.modules.top.financial.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.top.financial.domain.TopCostInstTp;
+
+/**
+ * 供应商成本模板Mapper接口
+ *
+ * @author hjl
+ * @date 2023-07-21
+ */
+public interface TopCostInstTpMapper extends BaseMapper<TopCostInstTp> {
+
+}

+ 53 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/service/ITopCostInstTpService.java

@@ -0,0 +1,53 @@
+package com.zhongzheng.modules.top.financial.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpAddBo;
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpEditBo;
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpQueryBo;
+import com.zhongzheng.modules.top.financial.domain.TopCostInstTp;
+import com.zhongzheng.modules.top.financial.vo.TopCostInstTpVo;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 供应商成本模板Service接口
+ *
+ * @author hjl
+ * @date 2023-07-21
+ */
+public interface ITopCostInstTpService extends IService<TopCostInstTp> {
+	/**
+	 * 查询单个
+	 * @return
+	 */
+	TopCostInstTpVo queryById(Long tpId);
+
+	/**
+	 * 查询列表
+	 */
+	List<TopCostInstTpVo> queryList(TopCostInstTpQueryBo bo);
+
+	/**
+	 * 根据新增业务对象插入供应商成本模板
+	 * @param bo 供应商成本模板新增业务对象
+	 * @return
+	 */
+	Boolean insertByAddBo(TopCostInstTpAddBo bo);
+
+	/**
+	 * 根据编辑业务对象修改供应商成本模板
+	 * @param bo 供应商成本模板编辑业务对象
+	 * @return
+	 */
+	Boolean updateByEditBo(TopCostInstTpEditBo bo);
+
+	/**
+	 * 校验并删除数据
+	 * @param ids 主键集合
+	 * @param isValid 是否校验,true-删除前校验,false-不校验
+	 * @return
+	 */
+	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+}

+ 103 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/service/impl/TopCostInstTpServiceImpl.java

@@ -0,0 +1,103 @@
+package com.zhongzheng.modules.top.financial.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
+import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpAddBo;
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpEditBo;
+import com.zhongzheng.modules.top.financial.bo.TopCostInstTpQueryBo;
+import com.zhongzheng.modules.top.financial.domain.TopCostInstTp;
+import com.zhongzheng.modules.top.financial.mapper.TopCostInstTpMapper;
+import com.zhongzheng.modules.top.financial.service.ITopCostInstTpService;
+import com.zhongzheng.modules.top.financial.vo.TopCostInstTpVo;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.pagehelper.Page;
+
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 供应商成本模板Service业务层处理
+ *
+ * @author hjl
+ * @date 2023-07-21
+ */
+@Service
+public class TopCostInstTpServiceImpl extends ServiceImpl<TopCostInstTpMapper, TopCostInstTp> implements ITopCostInstTpService {
+
+    @Override
+    public TopCostInstTpVo queryById(Long tpId){
+        TopCostInstTp db = this.baseMapper.selectById(tpId);
+        return BeanUtil.toBean(db, TopCostInstTpVo.class);
+    }
+
+    @Override
+    public List<TopCostInstTpVo> queryList(TopCostInstTpQueryBo bo) {
+        LambdaQueryWrapper<TopCostInstTp> lqw = Wrappers.lambdaQuery();
+        lqw.like(StrUtil.isNotBlank(bo.getTpName()), TopCostInstTp::getTpName, bo.getTpName());
+        lqw.eq(bo.getStatus() != null, TopCostInstTp::getStatus, bo.getStatus());
+        lqw.eq(bo.getDefaultStatus() != null, TopCostInstTp::getDefaultStatus, bo.getDefaultStatus());
+        lqw.eq(bo.getInstId() != null, TopCostInstTp::getInstId, bo.getInstId());
+        return entity2Vo(this.list(lqw));
+    }
+
+    /**
+    * 实体类转化成视图对象
+    *
+    * @param collection 实体类集合
+    * @return
+    */
+    private List<TopCostInstTpVo> entity2Vo(Collection<TopCostInstTp> collection) {
+        List<TopCostInstTpVo> voList = collection.stream()
+                .map(any -> BeanUtil.toBean(any, TopCostInstTpVo.class))
+                .collect(Collectors.toList());
+        if (collection instanceof Page) {
+            Page<TopCostInstTp> page = (Page<TopCostInstTp>)collection;
+            Page<TopCostInstTpVo> pageVo = new Page<>();
+            BeanUtil.copyProperties(page,pageVo);
+            pageVo.addAll(voList);
+            voList = pageVo;
+        }
+        return voList;
+    }
+
+    @Override
+    public Boolean insertByAddBo(TopCostInstTpAddBo bo) {
+        TopCostInstTp add = BeanUtil.toBean(bo, TopCostInstTp.class);
+        validEntityBeforeSave(add);
+        add.setCreateTime(DateUtils.getNowTime());
+        add.setUpdateTime(DateUtils.getNowTime());
+        return this.save(add);
+    }
+
+    @Override
+    public Boolean updateByEditBo(TopCostInstTpEditBo bo) {
+        TopCostInstTp update = BeanUtil.toBean(bo, TopCostInstTp.class);
+        validEntityBeforeSave(update);
+        update.setUpdateTime(DateUtils.getNowTime());
+        return this.updateById(update);
+    }
+
+    /**
+     * 保存前的数据校验
+     *
+     * @param entity 实体类数据
+     */
+    private void validEntityBeforeSave(TopCostInstTp entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return this.removeByIds(ids);
+    }
+}

+ 43 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/financial/vo/TopCostInstTpVo.java

@@ -0,0 +1,43 @@
+package com.zhongzheng.modules.top.financial.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.Date;
+
+
+
+/**
+ * 供应商成本模板视图对象 mall_package
+ *
+ * @author hjl
+ * @date 2023-07-21
+ */
+@Data
+@ApiModel("供应商成本模板视图对象")
+public class TopCostInstTpVo {
+	private static final long serialVersionUID = 1L;
+
+	/** $pkColumn.columnComment */
+	@ApiModelProperty("$pkColumn.columnComment")
+	private Long tpId;
+
+	/** 模板名称 */
+	@Excel(name = "模板名称")
+	@ApiModelProperty("模板名称")
+	private String tpName;
+	/** 0 禁用 1启用 */
+	@Excel(name = "0 禁用 1启用")
+	@ApiModelProperty("0 禁用 1启用")
+	private Integer status;
+	/** 默认选择状态 1选中 0非选中 */
+	@Excel(name = "默认选择状态 1选中 0非选中")
+	@ApiModelProperty("默认选择状态 1选中 0非选中")
+	private Integer defaultStatus;
+	/** 供应商ID */
+	@Excel(name = "供应商ID")
+	@ApiModelProperty("供应商ID")
+	private Long instId;
+}

+ 22 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/impl/TopInstCategoryServiceImpl.java

@@ -1,12 +1,15 @@
 package com.zhongzheng.modules.top.system.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.top.system.bo.TopInstCategoryAddBo;
 import com.zhongzheng.modules.top.system.bo.TopInstCategoryEditBo;
 import com.zhongzheng.modules.top.system.bo.TopInstCategoryQueryBo;
 import com.zhongzheng.modules.top.system.domain.TopInstCategory;
+import com.zhongzheng.modules.top.system.domain.TopInstitution;
 import com.zhongzheng.modules.top.system.mapper.TopInstCategoryMapper;
 import com.zhongzheng.modules.top.system.service.ITopInstCategoryService;
 import com.zhongzheng.modules.top.system.vo.TopInstCategoryVo;
@@ -88,6 +91,9 @@ public class TopInstCategoryServiceImpl extends ServiceImpl<TopInstCategoryMappe
      */
     private void validEntityBeforeSave(TopInstCategory entity){
         //TODO 做一些数据校验,如唯一约束
+        if(checkNameUnique(entity)){
+            throw new CustomException("名称重复");
+        }
     }
 
     @Override
@@ -97,4 +103,20 @@ public class TopInstCategoryServiceImpl extends ServiceImpl<TopInstCategoryMappe
         }
         return this.removeByIds(ids);
     }
+
+    private boolean checkNameUnique(TopInstCategory entity) {
+        TopInstCategory info = getOne(new LambdaQueryWrapper<TopInstCategory>()
+                .eq(TopInstCategory::getCategoryName,entity.getCategoryName()).ne(TopInstCategory::getStatus,-1)
+                .last("limit 1"));
+        if (Validator.isNotNull(info)) {
+            if(Validator.isNotEmpty(entity.getCostCatId())){
+                if(entity.getCostCatId().longValue() != info.getCostCatId().longValue()){
+                    return true;
+                }
+            }else{
+                return true;
+            }
+        }
+        return false;
+    }
 }

+ 18 - 0
zhongzheng-system/src/main/resources/mapper/modules/top/TopCostInstTpMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zhongzheng.modules.top.financial.mapper.TopCostInstTpMapper">
+
+    <resultMap type="com.zhongzheng.modules.top.financial.domain.TopCostInstTp" id="TopCostInstTpResult">
+        <result property="tpId" column="tp_id"/>
+        <result property="tpName" column="tp_name"/>
+        <result property="status" column="status"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="defaultStatus" column="default_status"/>
+        <result property="instId" column="inst_id"/>
+    </resultMap>
+
+
+</mapper>