Commit 235c13e02ddc7bb6274a00669c749fb43ed7d30e

Authored by wangqian
1 parent c74f3154

人机材修改

urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/departmentcost/vo/DepartmentCostSaveReqVO.java
... ... @@ -28,6 +28,7 @@ public class DepartmentCostSaveReqVO {
28 28  
29 29 @Schema(description = "部门总额", requiredMode = Schema.RequiredMode.REQUIRED)
30 30 @NotNull(message = "部门总额不能为空")
  31 + @DecimalMax(value = "99999999.99", message = "工资金额最大值为99999999.99")
31 32 private BigDecimal deptTotalCost;
32 33  
33 34 @Schema(description = "归属公司", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
... ... @@ -44,4 +45,4 @@ public class DepartmentCostSaveReqVO {
44 45 @Schema(description = "备注", example = "你猜")
45 46 private String remark;
46 47  
47   -}
48 48 \ No newline at end of file
  49 +}
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/mechanicalcost/vo/MechanicalCostRespVO.java
... ... @@ -99,4 +99,6 @@ public class MechanicalCostRespVO {
99 99  
100 100 private String deptNames;
101 101  
  102 + @ExcelProperty("状态 0:在用 1:报废")
  103 + private Integer status;
102 104 }
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/mechanicalcost/vo/MechanicalCostSaveReqVO.java
... ... @@ -83,4 +83,7 @@ public class MechanicalCostSaveReqVO {
83 83 @ExcelProperty("班组")
84 84 private List<TeamBizdomainRelVo> teamIds;
85 85  
  86 + @ExcelProperty("状态 0:在用 1:报废")
  87 + private Integer status;
  88 +
86 89 }
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/personalcost/vo/PersonalCostSaveReqVO.java
... ... @@ -3,6 +3,7 @@ package com.zteits.urbanops.module.garden.controller.admin.personalcost.vo;
3 3 import cn.idev.excel.annotation.ExcelProperty;
4 4 import com.zteits.urbanops.module.garden.controller.admin.costfee.vo.TeamBizdomainRelVo;
5 5 import io.swagger.v3.oas.annotations.media.Schema;
  6 +import jakarta.validation.constraints.DecimalMax;
6 7 import jakarta.validation.constraints.NotEmpty;
7 8 import jakarta.validation.constraints.NotNull;
8 9 import lombok.Data;
... ... @@ -27,6 +28,7 @@ public class PersonalCostSaveReqVO {
27 28  
28 29 @Schema(description = "工资金额", requiredMode = Schema.RequiredMode.REQUIRED)
29 30 @NotNull(message = "工资金额不能为空")
  31 + @DecimalMax(value = "99999999.99", message = "工资金额最大值为99999999.99")
30 32 private BigDecimal salaryAmount;
31 33  
32 34 @Schema(description = "岗位名称", example = "李四")
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/rentalmechanicalcost/vo/RentalMechanicalCostPageReqVO.java
... ... @@ -36,6 +36,9 @@ public class RentalMechanicalCostPageReqVO extends PageParam {
36 36 @Schema(description = "数量")
37 37 private Integer quantity;
38 38  
  39 + @Schema(description = "所属单位")
  40 + private String companyId;
  41 +
39 42 public static final Map<String, SFunction<RentalMechanicalCostDO, ?>> SORT_FIELD_MAP = Map.of(
40 43 "id", RentalMechanicalCostDO::getId,
41 44 "quantity", RentalMechanicalCostDO::getQuantity,
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/mechanicalcost/MechanicalCostDO.java
... ... @@ -100,6 +100,8 @@ public class MechanicalCostDO extends BaseDO {
100 100 */
101 101 private String remark;
102 102  
  103 + private Integer status;
  104 +
103 105 static final Map<String, SFunction<MechanicalCostDO, ?>> SORT_FIELD_MAP = Map.of(
104 106 "id", MechanicalCostDO::getId,
105 107 "unitPrice", MechanicalCostDO::getUnitPrice,
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/departmentcost/DepartmentCostServiceImpl.java
... ... @@ -14,6 +14,7 @@ import org.springframework.util.CollectionUtils;
14 14 import org.springframework.validation.annotation.Validated;
15 15  
16 16 import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception;
  17 +import static com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getCompanyId;
17 18 import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*;
18 19  
19 20  
... ... @@ -91,6 +92,9 @@ public class DepartmentCostServiceImpl implements DepartmentCostService {
91 92  
92 93 @Override
93 94 public PageResult<DepartmentCostDO> getDepartmentCostPage(DepartmentCostPageReqVO pageReqVO) {
  95 + if (getCompanyId() != 100) {
  96 + pageReqVO.setCompanyId(String.valueOf(getCompanyId()));
  97 + }
94 98 return departmentCostMapper.selectPage(pageReqVO);
95 99 }
96 100  
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/mechanicalcost/MechanicalCostServiceImpl.java
... ... @@ -121,6 +121,9 @@ public class MechanicalCostServiceImpl implements MechanicalCostService {
121 121  
122 122 @Override
123 123 public PageResult<MechanicalCostDO> getMechanicalCostPage(MechanicalCostPageReqVO pageReqVO) {
  124 + if (getCompanyId() != 100) {
  125 + pageReqVO.setCompanyId(String.valueOf(getCompanyId()));
  126 + }
124 127 return mechanicalCostMapper.selectPage(pageReqVO);
125 128 }
126 129  
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/rentalmechanicalcost/RentalMechanicalCostServiceImpl.java
... ... @@ -97,6 +97,9 @@ public class RentalMechanicalCostServiceImpl implements RentalMechanicalCostServ
97 97  
98 98 @Override
99 99 public PageResult<RentalMechanicalCostDO> getRentalMechanicalCostPage(RentalMechanicalCostPageReqVO pageReqVO) {
  100 + if (getCompanyId() != 100) {
  101 + pageReqVO.setCompanyId(String.valueOf(getCompanyId()));
  102 + }
100 103 return rentalMechanicalCostMapper.selectPage(pageReqVO);
101 104 }
102 105  
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/wasterecord/WasteRecordServiceImpl.java
... ... @@ -102,6 +102,9 @@ public class WasteRecordServiceImpl implements WasteRecordService {
102 102  
103 103 @Override
104 104 public PageResult<WasteRecordDO> getWasteRecordPage(WasteRecordPageReqVO pageReqVO) {
  105 + if (getCompanyId() != 100) {
  106 + pageReqVO.setCompanyId(String.valueOf(getCompanyId()));
  107 + }
105 108 return wasteRecordMapper.selectPage(pageReqVO);
106 109 }
107 110  
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/waterfee/WaterFeeServiceImpl.java
... ... @@ -8,6 +8,8 @@ import com.zteits.urbanops.module.garden.controller.admin.waterfee.vo.WaterFeePa
8 8 import com.zteits.urbanops.module.garden.controller.admin.waterfee.vo.WaterFeeSaveReqVO;
9 9 import com.zteits.urbanops.module.garden.dal.dataobject.waterfee.WaterFeeDO;
10 10 import com.zteits.urbanops.module.garden.dal.mysql.waterfee.WaterFeeMapper;
  11 +import com.zteits.urbanops.module.system.api.dept.DeptApi;
  12 +import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO;
11 13 import jakarta.annotation.Resource;
12 14 import org.springframework.stereotype.Service;
13 15 import org.springframework.util.CollectionUtils;
... ... @@ -16,7 +18,10 @@ import org.springframework.validation.annotation.Validated;
16 18 import java.util.List;
17 19 import java.util.stream.Collectors;
18 20  
  21 +import static com.zteits.urbanops.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
19 22 import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception;
  23 +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception0;
  24 +import static com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getCompanyId;
20 25 import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.WATER_FEE_NOT_EXISTS;
21 26  
22 27 /**
... ... @@ -31,6 +36,9 @@ public class WaterFeeServiceImpl implements WaterFeeService {
31 36 @Resource
32 37 private WaterFeeMapper waterFeeMapper;
33 38  
  39 + @Resource
  40 + private DeptApi deptApi;
  41 +
34 42 @Override
35 43 public Long createWaterFee(WaterFeeSaveReqVO createReqVO) {
36 44 // add by wq 删除重复,录入最新记录
... ... @@ -43,8 +51,14 @@ public class WaterFeeServiceImpl implements WaterFeeService {
43 51 waterFeeMapper.deleteByIds(ids);
44 52 }
45 53 // add by wq 删除重复,录入最新记录
  54 + DeptRespDTO deptRespDTO = deptApi.getDept(getCompanyId());
  55 + if(null == deptRespDTO){
  56 + throw exception0(BAD_REQUEST.getCode(), "无效参数-登录人所属单位为空");
  57 + }
46 58 // 插入
47 59 WaterFeeDO waterFee = BeanUtils.toBean(createReqVO, WaterFeeDO.class);
  60 + waterFee.setCompanyId(String.valueOf(deptRespDTO.getId()));
  61 + waterFee.setCompanyName(deptRespDTO.getName());
48 62 waterFeeMapper.insert(waterFee);
49 63  
50 64 // 返回
... ... @@ -88,6 +102,9 @@ public class WaterFeeServiceImpl implements WaterFeeService {
88 102  
89 103 @Override
90 104 public PageResult<WaterFeeDO> getWaterFeePage(WaterFeePageReqVO pageReqVO) {
  105 + if (getCompanyId() != 100) {
  106 + pageReqVO.setCompanyId(String.valueOf(getCompanyId()));
  107 + }
91 108 return waterFeeMapper.selectPage(pageReqVO);
92 109 }
93 110  
... ...