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