Prechádzať zdrojové kódy

07 29 02 fix_add login codes

hr 4 rokov pred
rodič
commit
41f63a8e6f

+ 4 - 1
src/main/java/com/imed/costaccount/model/dto/AccountProductSaveDTO.java

@@ -2,6 +2,7 @@ package com.imed.costaccount.model.dto;
 
 
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import javax.validation.Valid;
@@ -10,12 +11,14 @@ import javax.validation.constraints.NotNull;
 import java.util.List;
 
 @Data
-@ApiModel
+@ApiModel("会计科目、成本对照入参")
 public class AccountProductSaveDTO {
 
+    @ApiModelProperty(name="id",value = "会计科目id")
     @NotNull(message = "会计科目id不能为空")
     private Integer id;
 
+    @ApiModelProperty(name="products",value = "成本项目id列表")
     @NotEmpty(message = "成本项目id不能为空")
     private List<Integer> products;
 }

+ 4 - 4
src/main/java/com/imed/costaccount/model/dto/AccountingEditDTO.java

@@ -8,19 +8,19 @@ import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 
 @Data
-@ApiModel
+@ApiModel("会计科目编辑入参")
 public class AccountingEditDTO {
 
     @NotNull(message = "id不能为空")
-    @ApiModelProperty(name = "",value = "")
+    @ApiModelProperty(name = "id",value = "需要编辑类目的id")
     private Integer id;
 
+    @ApiModelProperty(name = "accountingCode",value = "科目代码")
     @NotEmpty(message = "科目代码不能为空")
     private String accountingCode;
 
+    @ApiModelProperty(name = "accountingName",value = "科目名称")
     @NotEmpty(message = "科目名称不能为空")
     private String accountingName;
 
-//    @NotNull(message = "会计科目类型不能为空")
-//    private Integer accountingType;
 }

+ 7 - 1
src/main/java/com/imed/costaccount/model/dto/AccountingSaveDTO.java

@@ -1,26 +1,32 @@
 package com.imed.costaccount.model.dto;
 
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 
 @Data
-@ApiModel
+@ApiModel("会计科目保存入参")
 public class AccountingSaveDTO {
 
+    @ApiModelProperty(name = "id",value = "父级id,如果需要新增顶级,那么传0")
     @NotNull(message = "层级id不能为空,顶层传0")
     private Integer id;
 
+    @ApiModelProperty(name = "accountingCode",value = "新增科目代码")
     @NotEmpty(message = "新增科目代码不能为空")
     private String accountingCode;
 
+    @ApiModelProperty(name = "accountingName",value = "新增科目名称")
     @NotEmpty(message = "新增科目名称不能为空")
     private String accountingName;
 
+    @ApiModelProperty(name = "accountingType",value = "会计科目类型1,收入,2.支出")
     @NotNull(message = "会计科目类型不能为空")
     private Integer accountingType;
 
+    @ApiModelProperty(name = "isBaseCode",value = "如果是支出,必须选择收入还是支出")
     private Integer isBaseCode;
 }

+ 1 - 1
src/main/java/com/imed/costaccount/model/dto/ResponsibilitySaveDTO.java

@@ -25,7 +25,7 @@ public class ResponsibilitySaveDTO {
     private String responsibilityName;
 
     @NotNull(message = "是否汇总中心不能为空")
-    @ApiModelProperty(name = "isGatherCenter",value = "是否汇总中心(前端校验如果用户责任中心是一级那么必定是汇总中心,反之不是)")
+    @ApiModelProperty(name = "isGatherCenter",value = "是否汇总中心")
     private Integer isGatherCenter;
 
     @NotNull(message = "收益类型 1. 收费中心,2.成本(费用)中心")

+ 9 - 2
src/main/java/com/imed/costaccount/model/vo/AccountProductVO.java

@@ -3,28 +3,35 @@ package com.imed.costaccount.model.vo;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.List;
 
 @Data
-@ApiModel
+@ApiModel("会计科目成本项目对照列表返回对象")
 public class AccountProductVO {
 
+    @ApiModelProperty(name = "id",value = "会计科目主键")
     private Integer id;
 
+    @ApiModelProperty(name = "accountingName",value = "会计科目名称")
     private String accountingName;
 
+    @ApiModelProperty(name = "accountingCode",value = "主键")
     private String accountingCode;
 
+    @ApiModelProperty(name = "parentId",value = "主键")
     @JsonIgnore
     private Integer parentId;
 
-    @JsonInclude(JsonInclude.Include.NON_NULL)
+    @ApiModelProperty(name = "productVOs",value = "主键")
     private List<ProductVO> productVOs;
 
+    @ApiModelProperty(name = "isParent",value = "是否是父节点")
     private Boolean isParent=false;
 
+    @ApiModelProperty(name = "child",value = "子对象")
     @JsonInclude(JsonInclude.Include.NON_NULL)
     private List<AccountProductVO> child;
 }

+ 7 - 0
src/main/java/com/imed/costaccount/model/vo/ProductVO.java

@@ -1,13 +1,20 @@
 package com.imed.costaccount.model.vo;
 
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 @Data
+@ApiModel("成本项目简单对象")
 public class ProductVO {
+
+    @ApiModelProperty(name = "id",value = "成本项目id")
     private Integer id;
 
+    @ApiModelProperty(name = "productCode",value = "成本项目代码")
     private String productCode;
 
+    @ApiModelProperty(name = "productName",value = "成本项目名称")
     private String productName;
 
 }

+ 1 - 1
src/main/java/com/imed/costaccount/service/ResponsibilityService.java

@@ -58,7 +58,7 @@ public interface ResponsibilityService extends IService<Responsibility> {
     List<CommonVO> getParentList(User user);
 
     /**
-     * 获取第二级别的责任中心的代码
+     * 获取可不是汇总中心列表
      * @param hospId
      * @return
      */

+ 0 - 2
src/main/java/com/imed/costaccount/service/impl/AccountingProductServiceImpl.java

@@ -63,8 +63,6 @@ public class AccountingProductServiceImpl extends ServiceImpl<AccountingProductM
             List<AccountProductVO> accountTree = this.getAccountTree(parent, all);
             accountVOS.addAll(accountTree);
         }
-        // 第一不让添加
-        accountVOS.forEach(i -> i.setIsParent(true));
         return accountVOS;
     }
 

+ 6 - 2
src/main/java/com/imed/costaccount/service/impl/ResponsibilityServiceImpl.java

@@ -93,6 +93,10 @@ public class ResponsibilityServiceImpl extends ServiceImpl<ResponsibilityMapper,
         center.setCreateTime(System.currentTimeMillis()).setId(null).setParentId(id).setHospId(user.getHospId()).setResponsibilityLevel(2);
         if (id == 0) {
             center.setResponsibilityLevel(1);
+        }
+
+        // 如果是汇总中心,那么不存在分摊级别
+        if (responsibilitySaveDTO.getIsGatherCenter() == 1) {
             center.setShareLevel(0);
             center.setShareName("");
         }
@@ -276,7 +280,7 @@ public class ResponsibilityServiceImpl extends ServiceImpl<ResponsibilityMapper,
     }
 
     /**
-     * 获取第二级别的责任中心的数据
+     * 获取可不是汇总中心列表
      *
      * @param hospId
      * @return
@@ -285,7 +289,7 @@ public class ResponsibilityServiceImpl extends ServiceImpl<ResponsibilityMapper,
     public List<CostResponsibilityLevelVO> getLevelTwo(Integer hospId) {
         List<Responsibility> responsibilities = baseMapper.selectList(new QueryWrapper<Responsibility>().lambda()
                 .eq(Responsibility::getHospId, hospId)
-                .eq(Responsibility::getResponsibilityLevel, NumberConstant.TWO));
+                .eq(Responsibility::getIsGatherCenter,NumberConstant.TWO));
         List<CostResponsibilityLevelVO> costResponsibilityLevelVOS = BeanUtil.convertList(responsibilities, CostResponsibilityLevelVO.class);
         List<CostShareLevelVO> costShareLevelServiceAll = costShareLevelService.getAll(hospId);
         Map<Integer, List<CostShareLevelVO>> listMap = costShareLevelServiceAll.stream().collect(Collectors.groupingBy(CostShareLevelVO::getId));

+ 1 - 1
src/main/java/com/imed/costaccount/web/ResponsibilityController.java

@@ -41,7 +41,7 @@ public class ResponsibilityController {
     }
 
     @GetMapping("/getLevelTwo")
-    @ApiOperation("获取第二级的责任中心的数据")
+    @ApiOperation("获取可不是汇总中心列表")
     public Result getLevelTwo(){
         User user = (User) SecurityUtils.getSubject().getPrincipal();
         Integer hospId = user.getHospId();