From 1722345034230fca56e7c815b9a061ec154da7ce Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Tue, 1 Apr 2025 19:34:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/sgzb/system/api/domain/SysDept.java | 15 ++++ .../sgzb/app/domain/LeaseApplyDetails.java | 6 ++ .../material/config/MaterialConstants.java | 86 +++++++++++++++++++ .../material/controller/SelectController.java | 9 ++ .../SltAgreementInfoController.java | 2 +- .../sgzb/material/domain/AgreementInfo.java | 12 +++ .../sgzb/material/domain/BackRecord.java | 11 +++ .../bonus/sgzb/material/domain/DeptVo.java | 43 ++++++++++ .../sgzb/material/domain/LeaseRecord.java | 12 +++ .../bonus/sgzb/material/domain/OutRecord.java | 11 +++ .../sgzb/material/domain/ProjUsingRecord.java | 11 +++ .../sgzb/material/domain/RepairRecord.java | 12 +++ .../sgzb/material/domain/ScrapRecord.java | 11 +++ .../material/mapper/LeaseRecordMapper.java | 7 ++ .../sgzb/material/mapper/SelectMapper.java | 7 ++ .../sgzb/material/service/SelectService.java | 7 ++ .../service/impl/BackRecordServiceImpl.java | 16 +++- .../service/impl/InputRecordServiceImpl.java | 17 +++- .../service/impl/LeaseRecordServiceImpl.java | 33 +++++++ .../impl/ProjUsingRecordServiceImpl.java | 17 +++- .../service/impl/RepairRecordServiceImpl.java | 17 +++- .../service/impl/ScrapRecordServiceImpl.java | 17 +++- .../service/impl/SelectServiceImpl.java | 11 +++ .../impl/SltAgreementInfoServiceImpl.java | 16 ++++ .../resources/mapper/app/TmTaskMapper.xml | 3 +- .../mapper/material/BackRecordMapper.xml | 3 + .../mapper/material/InputRecordMapper.xml | 3 + .../mapper/material/LeaseRecordMapper.xml | 20 +++++ .../mapper/material/ProjUsingRecordMapper.xml | 7 ++ .../mapper/material/RepairRecordMapper.xml | 3 + .../mapper/material/ScrapRecordMapper.xml | 7 +- .../mapper/material/SelectMapper.xml | 35 ++++++++ .../material/SltAgreementInfoMapper.xml | 3 + .../resources/mapper/system/SysDeptMapper.xml | 8 +- 34 files changed, 488 insertions(+), 10 deletions(-) create mode 100644 sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/config/MaterialConstants.java create mode 100644 sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/DeptVo.java diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/SysDept.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/SysDept.java index d35793e..54e4130 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/SysDept.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/SysDept.java @@ -57,6 +57,10 @@ public class SysDept extends BaseEntity @ApiModelProperty(value = "部门状态:0正常,1停用") private String status; + /** 查看全量数据状态:0是,1否 */ + @ApiModelProperty(value = "查看全量数据状态:0是,1否") + private String isView; + /** 删除标志(0代表存在 2代表删除) */ @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)") private String delFlag; @@ -211,6 +215,16 @@ public class SysDept extends BaseEntity this.status = status; } + public String getIsView() + { + return isView; + } + + public void setIsView(String isView) + { + this.isView = isView; + } + public String getDelFlag() { return delFlag; @@ -253,6 +267,7 @@ public class SysDept extends BaseEntity .append("phone", getPhone()) .append("email", getEmail()) .append("status", getStatus()) + .append("isView", getIsView()) .append("delFlag", getDelFlag()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/domain/LeaseApplyDetails.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/domain/LeaseApplyDetails.java index 6079f64..b5400b7 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/domain/LeaseApplyDetails.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/domain/LeaseApplyDetails.java @@ -37,6 +37,12 @@ public class LeaseApplyDetails implements Serializable { @ApiModelProperty(value = "任务ID") private Integer parenntId; + /** + * 二级id + */ + @ApiModelProperty(value = "二级id") + private Integer levelTwoId; + @ApiModelProperty(value = "任务ID") private Long taskId; diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/config/MaterialConstants.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/config/MaterialConstants.java new file mode 100644 index 0000000..0f2e8e3 --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/config/MaterialConstants.java @@ -0,0 +1,86 @@ +package com.bonus.sgzb.material.config; + +/** + * 仓储通用常量信息 + * + * @author bonus + */ +public class MaterialConstants { + + private MaterialConstants() { + + } + + /** + * UTF-8 字符集 + */ + public static final String UTF8 = "UTF-8"; + + // 树的根节点ID + public static final Long TREE_ROOT_ID = 0L; + + /** + * XLS + */ + public static final String XLS = "xls"; + + /** + * XLSX + */ + public static final String XLSX = "xlsx"; + + /** + * 身份证正则表达式 + */ + public static final String CREDENTIALS_CODE_PATTERN = "^[1-9]\\d{5}[1-9]\\d{3}((0[1-9])|(1[0-2]))(0[1-9]|([1|2][0-9])|3[0-1])((\\d{4})|\\d{3}X)$"; + + /** + * 经度正则表达式 + */ + public static final String LONGITUDE_PATTERN = "^(-?(180(\\.0+)?|1[0-7][0-9](\\.\\d{1,6})?|[1-9]?\\d(\\.\\d{1,6})?))$"; + + /** + * 纬度正则表达式 + */ + public static final String LATITUDE_PATTERN = "^(-?(90(\\.0+)?|[1-8]?\\d(\\.\\d{1,6})?))$"; + + public final static String STRING_ADMIN = "admin"; + + /** 协议号的开头字母 */ + public static final String AGREEMENT_PREFIX = "H"; + + /** 领料单号的开头字母 */ + public static final String LEASE_TASK_TYPE_LABEL = "L"; + + /** 维修单号的开头字母 */ + public static final String REPAIR_TASK_TYPE_LABEL = "WX"; + + public static final String INNER_PROTOCAL = "1"; //内部单位协议 + + public static final String OUTER_PROTOCAL = "2"; //外部单位协议 + + /** 文件类型:设备附件 */ + public static final Integer MATERIAL_FILE_TYPE_CODE = 17; //move to TmTaskTypeEnum + + /** 文件类型:租赁需求附件 */ + public static final Integer LEASE_FILE_TYPE_CODE = 18; //move to TmTaskTypeEnum + + /** 文件类型:退租检修图片类型 */ + //public static final Integer LEASE_REPAIR_RECORD_TABLE_NAME = 19; //move to TmTaskTypeEnum + + /** 文件类型:合同照片 */ + public static final Integer APPENDICES_OF_CONTRACT = 20; //move to TmTaskTypeEnum + + public static final String CACHE_MATERIAL_MALL_MESSAGE = "material-mall-message:"; + public static final String MESSAGE_FROM = "FROM:"; + public static final String MESSAGE_TO = "TO:"; + public static final Long CACHE_MATERIAL_MALL_MESSAGE_HOURS = 24L; + + public static final String DICT_TYPE_ORDER_STATUS = "order_status"; + + /** + * 存储redis中的订单取件码前缀 + */ + public static final String DICT_TYPE_ORDER_PICKUP_CODE = "order_code_"; + +} diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SelectController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SelectController.java index 28b13f9..cfd24f1 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SelectController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SelectController.java @@ -55,6 +55,15 @@ public class SelectController { return service.getMaTypeDataById(dto); } + /** + * 根据二级查四级 + */ + @ApiOperation(value = "机具类型下拉选") + @PostMapping("getMaTypeDataByIdTwo") + public AjaxResult getMaTypeDataByIdTwo(@RequestBody SelectDto dto){ + return service.getMaTypeDataByIdTwo(dto); + } + /** * 根据三级查四级在用下拉数据 * @param dto diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java index 4928cbc..59838e0 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java @@ -62,7 +62,7 @@ public class SltAgreementInfoController extends BaseController { /** * 根据条件获取协议结算列表 */ - @RequiresPermissions("cost:settlement:list") +// @RequiresPermissions("cost:settlement:list") @ApiOperation(value = "根据条件获取协议结算列表") @GetMapping("/getSltAgreementInfo") public TableDataInfo getSltAgreementInfo(AgreementInfo bean) { diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/AgreementInfo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/AgreementInfo.java index fae546a..b8403b0 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/AgreementInfo.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/AgreementInfo.java @@ -161,4 +161,16 @@ public class AgreementInfo extends BaseEntity { @ApiModelProperty(value = "往来单位ids") private int[] unitIds; + + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + private Integer deptId; + + /** + * 是否显示 + */ + @ApiModelProperty(value = "是否显示") + private String isView; } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackRecord.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackRecord.java index d748cd4..0497bb7 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackRecord.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackRecord.java @@ -183,4 +183,15 @@ public class BackRecord { @ApiModelProperty(value = "实时库存") private Integer num; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + private Integer deptId; + + /** + * 是否显示 + */ + @ApiModelProperty(value = "是否显示") + private String isView; } \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/DeptVo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/DeptVo.java new file mode 100644 index 0000000..b6c8dd6 --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/DeptVo.java @@ -0,0 +1,43 @@ +package com.bonus.sgzb.material.domain; + +import com.bonus.sgzb.common.core.annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** +* @description 部门实体类 +* @author hay +* @date 2024/2/26 14:51 +*/ +@ApiModel(description = "部门实体类") +@Data +public class DeptVo { + + private static final long serialVersionUID = 2227217051604273598L; + + @ApiModelProperty(value = "部门id") + private int deptId; + + @ApiModelProperty(value = "父级id") + private int parentId; + + /** + * 祖级 + */ + @ApiModelProperty(value = "祖级") + private String ancestors; + + /** + * 是否显示 + */ + @ApiModelProperty(value = "是否显示") + private String isView; + + + +} \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseRecord.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseRecord.java index 505b3f0..afdb317 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseRecord.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseRecord.java @@ -187,4 +187,16 @@ public class LeaseRecord{ @ApiModelProperty(value = "是否推送到智慧工程0:否,1:是") private Integer pushNotifications; + + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + private Integer deptId; + + /** + * 是否显示 + */ + @ApiModelProperty(value = "是否显示") + private String isView; } \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/OutRecord.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/OutRecord.java index 8416385..e1f1ff8 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/OutRecord.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/OutRecord.java @@ -77,4 +77,15 @@ public class OutRecord { @ApiModelProperty(value = "关键字") private String keyWord; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + private Integer deptId; + + /** + * 是否显示 + */ + @ApiModelProperty(value = "是否显示") + private String isView; } \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ProjUsingRecord.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ProjUsingRecord.java index e6e790c..3a98ab1 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ProjUsingRecord.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ProjUsingRecord.java @@ -216,4 +216,15 @@ public class ProjUsingRecord { @ApiModelProperty(value = "在用标识") private Integer useFlag; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + private Integer deptId; + + /** + * 是否显示 + */ + @ApiModelProperty(value = "是否显示") + private String isView; } \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/RepairRecord.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/RepairRecord.java index 11f1242..1fc745f 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/RepairRecord.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/RepairRecord.java @@ -189,4 +189,16 @@ public class RepairRecord implements Serializable { */ @ApiModelProperty(value = "proId") private Integer proId; + + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + private Integer deptId; + + /** + * 是否显示 + */ + @ApiModelProperty(value = "是否显示") + private String isView; } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ScrapRecord.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ScrapRecord.java index 99f1bb1..aa64639 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ScrapRecord.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ScrapRecord.java @@ -206,4 +206,15 @@ public class ScrapRecord { @ApiModelProperty(value = "实时库存") private Integer num; + /** + * 部门id + */ + @ApiModelProperty(value = "部门id") + private Integer deptId; + + /** + * 是否显示 + */ + @ApiModelProperty(value = "是否显示") + private String isView; } \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/LeaseRecordMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/LeaseRecordMapper.java index 0037781..1c9bce4 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/LeaseRecordMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/LeaseRecordMapper.java @@ -4,6 +4,7 @@ import com.bonus.sgzb.app.domain.LeaseApplyDetails; import com.bonus.sgzb.base.api.domain.LeaseOutDetails; import com.bonus.sgzb.base.api.domain.MaType; import com.bonus.sgzb.base.api.domain.SltAgreementInfo; +import com.bonus.sgzb.material.domain.DeptVo; import com.bonus.sgzb.material.domain.LeaseRecord; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -45,4 +46,10 @@ public interface LeaseRecordMapper { * @return */ List getMaTypeKeepList(LeaseApplyDetails leaseApplyDetails); + + int getDeptId(Long userId); + + DeptVo getAnsetors(int deptId); + + DeptVo getAnsetorsByParentId(int parentId); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SelectMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SelectMapper.java index ba9507a..47f664b 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SelectMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SelectMapper.java @@ -205,5 +205,12 @@ public interface SelectMapper { */ List getMaTypeDataById(SelectDto dto); + /** + * 机具类型下拉选 + * @param dto + * @return + */ + List getMaTypeDataByIdTwo(SelectDto dto); + List getFourMaTypeList(SelectDto dto); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SelectService.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SelectService.java index d1159ed..4814227 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SelectService.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SelectService.java @@ -190,6 +190,13 @@ public interface SelectService { */ AjaxResult getMaTypeDataById(SelectDto dto); + /** + * 机具类型下拉选 根据二级查四级 + * @param dto + * @return + */ + AjaxResult getMaTypeDataByIdTwo(SelectDto dto); + /** * 根据三级查四级在用下拉数据 * @param dto diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackRecordServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackRecordServiceImpl.java index a053dee..1cb941f 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackRecordServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackRecordServiceImpl.java @@ -1,6 +1,8 @@ package com.bonus.sgzb.material.service.impl; +import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.material.domain.BackRecord; +import com.bonus.sgzb.material.domain.DeptVo; import com.bonus.sgzb.material.domain.LeaseRecord; import com.bonus.sgzb.material.mapper.BackRecordMapper; import com.bonus.sgzb.material.mapper.LeaseRecordMapper; @@ -9,6 +11,7 @@ import com.bonus.sgzb.material.service.LeaseRecordService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Arrays; import java.util.List; /** @@ -21,9 +24,20 @@ public class BackRecordServiceImpl implements BackRecordService { @Autowired private BackRecordMapper backRecordMapper; - + @Autowired + private LeaseRecordMapper leaseRecordMapper; @Override public List getBackRecordList(BackRecord bean) { + Long userId = SecurityUtils.getUserId(); + int deptId = leaseRecordMapper.getDeptId(userId); + if (deptId != 1000){ + DeptVo deptVo = leaseRecordMapper.getAnsetors(deptId); + String isView = deptVo.getIsView(); + bean.setDeptId(deptId); + bean.setIsView(isView); + }else{ + bean.setIsView(null); + } return backRecordMapper.getBackRecordList(bean); } } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/InputRecordServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/InputRecordServiceImpl.java index 54b7397..056516e 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/InputRecordServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/InputRecordServiceImpl.java @@ -1,9 +1,12 @@ package com.bonus.sgzb.material.service.impl; +import com.bonus.sgzb.common.security.utils.SecurityUtils; +import com.bonus.sgzb.material.domain.DeptVo; import com.bonus.sgzb.material.domain.InputRecord; import com.bonus.sgzb.material.domain.OutRecord; import com.bonus.sgzb.material.domain.ScrapRecord; import com.bonus.sgzb.material.mapper.InputRecordMapper; +import com.bonus.sgzb.material.mapper.LeaseRecordMapper; import com.bonus.sgzb.material.mapper.ScrapRecordMapper; import com.bonus.sgzb.material.service.InputRecordService; import com.bonus.sgzb.material.service.ScrapRecordService; @@ -22,7 +25,8 @@ public class InputRecordServiceImpl implements InputRecordService { @Autowired private InputRecordMapper inputRecordMapper; - + @Autowired + private LeaseRecordMapper leaseRecordMapper; @Override public List getInputRecordList(InputRecord bean) { return inputRecordMapper.getInputRecordList(bean); @@ -30,6 +34,17 @@ public class InputRecordServiceImpl implements InputRecordService { @Override public List getOutputRecordList(OutRecord bean) { + Long userId = SecurityUtils.getUserId(); + int deptId = leaseRecordMapper.getDeptId(userId); + if (deptId != 1000){ + DeptVo deptVo = leaseRecordMapper.getAnsetors(deptId); + String isView = deptVo.getIsView(); + + bean.setDeptId(deptId); + bean.setIsView(isView); + }else{ + bean.setIsView(null); + } return inputRecordMapper.getOutputRecordList(bean); } } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/LeaseRecordServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/LeaseRecordServiceImpl.java index 92c0650..29440dc 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/LeaseRecordServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/LeaseRecordServiceImpl.java @@ -3,6 +3,8 @@ package com.bonus.sgzb.material.service.impl; import com.bonus.sgzb.base.api.domain.MaMachine; import com.bonus.sgzb.base.domain.vo.IotRecordVo; import com.bonus.sgzb.base.mapper.BaseIotMachineMapper; +import com.bonus.sgzb.common.security.utils.SecurityUtils; +import com.bonus.sgzb.material.domain.DeptVo; import com.bonus.sgzb.material.domain.LeaseRecord; import com.bonus.sgzb.material.mapper.LeaseRecordMapper; import com.bonus.sgzb.material.service.LeaseRecordService; @@ -11,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.Arrays; import java.util.List; /** @@ -27,6 +30,36 @@ public class LeaseRecordServiceImpl implements LeaseRecordService { private BaseIotMachineMapper baseIotMachineMapper; @Override public List getLeaseRecordList(LeaseRecord bean) { + + Long userId = SecurityUtils.getUserId(); + int deptId = leaseRecordMapper.getDeptId(userId); + if (deptId != 1000){ + DeptVo deptVo = leaseRecordMapper.getAnsetors(deptId); +// DeptVo deptVoTwo = new DeptVo(); +// int[] ansetorsArray = Arrays.stream(deptVo.getAncestors().split(",")) +// .mapToInt(Integer::parseInt) +// .toArray(); +// int parentId = deptVo.getParentId(); + String isView = deptVo.getIsView(); +// while (ansetorsArray.length != 1) { +// // 获取当前部门的父级ID +// deptVoTwo = leaseRecordMapper.getAnsetorsByParentId(parentId); +// if (deptVoTwo == null) { +// break; // 如果没有父级,退出循环 +// } +// // 查询父级的ancestors +// ansetorsArray = Arrays.stream(deptVoTwo.getAncestors().split(",")) +// .mapToInt(Integer::parseInt) +// .toArray(); +// parentId = deptVoTwo.getParentId(); +// deptId = deptVoTwo.getDeptId(); +// isView = deptVoTwo.getIsView(); +// } + bean.setDeptId(deptId); + bean.setIsView(isView); + }else{ + bean.setIsView(null); + } List listMaMachine =leaseRecordMapper.getLeaseRecordList(bean); if (listMaMachine.size() > 0){ for (LeaseRecord leaseRecord : listMaMachine) { diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ProjUsingRecordServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ProjUsingRecordServiceImpl.java index bee4a8b..f84d7c2 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ProjUsingRecordServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ProjUsingRecordServiceImpl.java @@ -1,8 +1,11 @@ package com.bonus.sgzb.material.service.impl; +import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.material.domain.BackRecord; +import com.bonus.sgzb.material.domain.DeptVo; import com.bonus.sgzb.material.domain.ProjUsingRecord; import com.bonus.sgzb.material.mapper.BackRecordMapper; +import com.bonus.sgzb.material.mapper.LeaseRecordMapper; import com.bonus.sgzb.material.mapper.ProjUsingRecordMapper; import com.bonus.sgzb.material.service.BackRecordService; import com.bonus.sgzb.material.service.ProjUsingRecordService; @@ -21,9 +24,21 @@ public class ProjUsingRecordServiceImpl implements ProjUsingRecordService { @Autowired private ProjUsingRecordMapper projUsingRecordMapper; - + @Autowired + private LeaseRecordMapper leaseRecordMapper; @Override public List getProjUsingRecordList(ProjUsingRecord bean) { + Long userId = SecurityUtils.getUserId(); + int deptId = leaseRecordMapper.getDeptId(userId); + if (deptId != 1000){ + DeptVo deptVo = leaseRecordMapper.getAnsetors(deptId); + String isView = deptVo.getIsView(); + + bean.setDeptId(deptId); + bean.setIsView(isView); + }else{ + bean.setIsView(null); + } return projUsingRecordMapper.getProjUsingRecordList(bean); } } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairRecordServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairRecordServiceImpl.java index 1f79b31..0c92310 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairRecordServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/RepairRecordServiceImpl.java @@ -1,8 +1,11 @@ package com.bonus.sgzb.material.service.impl; +import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.material.domain.BackRecord; +import com.bonus.sgzb.material.domain.DeptVo; import com.bonus.sgzb.material.domain.RepairRecord; import com.bonus.sgzb.material.mapper.BackRecordMapper; +import com.bonus.sgzb.material.mapper.LeaseRecordMapper; import com.bonus.sgzb.material.mapper.RepairRecordMapper; import com.bonus.sgzb.material.service.BackRecordService; import com.bonus.sgzb.material.service.RepairRecordService; @@ -21,9 +24,21 @@ public class RepairRecordServiceImpl implements RepairRecordService { @Autowired private RepairRecordMapper repairRecordMapper; - + @Autowired + private LeaseRecordMapper leaseRecordMapper; @Override public List getRepairRecordList(RepairRecord bean) { + Long userId = SecurityUtils.getUserId(); + int deptId = leaseRecordMapper.getDeptId(userId); + if (deptId != 1000){ + DeptVo deptVo = leaseRecordMapper.getAnsetors(deptId); + String isView = deptVo.getIsView(); + + bean.setDeptId(deptId); + bean.setIsView(isView); + }else{ + bean.setIsView(null); + } return repairRecordMapper.getRepairRecordList(bean); } } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapRecordServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapRecordServiceImpl.java index 8a237fb..60833e7 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapRecordServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/ScrapRecordServiceImpl.java @@ -1,8 +1,11 @@ package com.bonus.sgzb.material.service.impl; +import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.material.domain.BackRecord; +import com.bonus.sgzb.material.domain.DeptVo; import com.bonus.sgzb.material.domain.ScrapRecord; import com.bonus.sgzb.material.mapper.BackRecordMapper; +import com.bonus.sgzb.material.mapper.LeaseRecordMapper; import com.bonus.sgzb.material.mapper.ScrapRecordMapper; import com.bonus.sgzb.material.service.BackRecordService; import com.bonus.sgzb.material.service.ScrapRecordService; @@ -21,9 +24,21 @@ public class ScrapRecordServiceImpl implements ScrapRecordService { @Autowired private ScrapRecordMapper scrapRecordMapper; - + @Autowired + private LeaseRecordMapper leaseRecordMapper; @Override public List getScrapRecordList(ScrapRecord bean) { + Long userId = SecurityUtils.getUserId(); + int deptId = leaseRecordMapper.getDeptId(userId); + if (deptId != 1000){ + DeptVo deptVo = leaseRecordMapper.getAnsetors(deptId); + String isView = deptVo.getIsView(); + + bean.setDeptId(deptId); + bean.setIsView(isView); + }else{ + bean.setIsView(null); + } return scrapRecordMapper.getScrapRecordList(bean); } } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SelectServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SelectServiceImpl.java index c08036e..7b56f3a 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SelectServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SelectServiceImpl.java @@ -86,6 +86,17 @@ public class SelectServiceImpl implements SelectService { return AjaxResult.success(list); } + @Override + public AjaxResult getMaTypeDataByIdTwo(SelectDto dto) { + List list = new ArrayList<>(); + try { + list = mapper.getMaTypeDataByIdTwo(dto); + } catch (Exception e) { + log.error("机具类型-查询失败", e); + } + return AjaxResult.success(list); + } + /** * 四级机具类型下拉选 * @param dto diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java index e480a89..fdc3144 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java @@ -10,14 +10,17 @@ import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.material.domain.AgreementInfo; +import com.bonus.sgzb.material.domain.DeptVo; import com.bonus.sgzb.material.domain.TmTask; import com.bonus.sgzb.material.mapper.CalMonthlyMapper; +import com.bonus.sgzb.material.mapper.LeaseRecordMapper; import com.bonus.sgzb.material.mapper.SltAgreementInfoMapper; import com.bonus.sgzb.material.service.SltAgreementInfoService; import com.bonus.sgzb.material.vo.GlobalContants; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -41,8 +44,21 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { @Resource private CalMonthlyMapper calMonthlyMapper; + @Autowired + private LeaseRecordMapper leaseRecordMapper; @Override public List getSltAgreementInfo(AgreementInfo bean) { + Long userId = SecurityUtils.getUserId(); + int deptId = leaseRecordMapper.getDeptId(userId); + if (deptId != 1000){ + DeptVo deptVo = leaseRecordMapper.getAnsetors(deptId); + String isView = deptVo.getIsView(); + + bean.setDeptId(deptId); + bean.setIsView(isView); + }else{ + bean.setIsView(null); + } return sltAgreementInfoMapper.getSltAgreementInfo(bean); } diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/TmTaskMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/TmTaskMapper.xml index f3dbe0f..f1ac746 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/TmTaskMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/TmTaskMapper.xml @@ -964,7 +964,7 @@ \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/LeaseRecordMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/LeaseRecordMapper.xml index 2a7191d..f407a42 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/LeaseRecordMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/LeaseRecordMapper.xml @@ -65,6 +65,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') + + and bui.dept_id = #{deptId} + + + + + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ProjUsingRecordMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ProjUsingRecordMapper.xml index 7c413eb..5c78429 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ProjUsingRecordMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ProjUsingRecordMapper.xml @@ -72,6 +72,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') + + and bui.dept_id = #{deptId} + GROUP BY bai.agreement_id, mt.type_id) AS subquery1 LEFT JOIN (SELECT bai.agreement_id, @@ -119,11 +122,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bcd.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') + + and bui.dept_id = #{deptId} + GROUP BY bai.agreement_id, mt.type_id) AS subquery2 ON subquery1.type_id = subquery2.type_id AND subquery1.agreement_id = subquery2.agreement_id WHERE IFNULL(subquery1.outNum, 0) - IFNULL(subquery2.backNum, 0) > 0 + \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairRecordMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairRecordMapper.xml index e6f540f..fb346e8 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairRecordMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairRecordMapper.xml @@ -55,5 +55,8 @@ and bpl.lot_id = #{proId} + + and bui.dept_id = #{deptId} + \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapRecordMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapRecordMapper.xml index 06d510e..1bc52aa 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapRecordMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapRecordMapper.xml @@ -55,7 +55,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND sad.audit_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') - + + and unit.dept_id = #{deptId} + UNION ALL SELECT sad.id, @@ -108,5 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND sad.audit_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') + + and unit.dept_id = #{deptId} + \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SelectMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SelectMapper.xml index 60f3088..0ed3eb3 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SelectMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SelectMapper.xml @@ -85,6 +85,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND mt.parent_id = #{id} and mt.level = '4' + + diff --git a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SysDeptMapper.xml b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SysDeptMapper.xml index 262601d..b6db0bf 100644 --- a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -21,11 +21,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time, - d.remark + d.remark,d.is_view from sys_dept d @@ -98,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" phone, email, status, + is_view, create_by, create_time )values( @@ -110,7 +112,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{phone}, #{email}, #{status}, - #{createBy}, + #{isView}, + #{createBy}, sysdate() ) @@ -126,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" phone = #{phone}, email = #{email}, status = #{status}, + is_view = #{isView}, update_by = #{updateBy}, update_time = sysdate()