功能优化

This commit is contained in:
hongchao 2025-04-01 19:34:50 +08:00
parent d73cdbff1c
commit 1722345034
34 changed files with 488 additions and 10 deletions

View File

@ -57,6 +57,10 @@ public class SysDept extends BaseEntity
@ApiModelProperty(value = "部门状态:0正常,1停用") @ApiModelProperty(value = "部门状态:0正常,1停用")
private String status; private String status;
/** 查看全量数据状态:0是,1否 */
@ApiModelProperty(value = "查看全量数据状态:0是,1否")
private String isView;
/** 删除标志0代表存在 2代表删除 */ /** 删除标志0代表存在 2代表删除 */
@ApiModelProperty(value = "删除标志0代表存在 2代表删除") @ApiModelProperty(value = "删除标志0代表存在 2代表删除")
private String delFlag; private String delFlag;
@ -211,6 +215,16 @@ public class SysDept extends BaseEntity
this.status = status; this.status = status;
} }
public String getIsView()
{
return isView;
}
public void setIsView(String isView)
{
this.isView = isView;
}
public String getDelFlag() public String getDelFlag()
{ {
return delFlag; return delFlag;
@ -253,6 +267,7 @@ public class SysDept extends BaseEntity
.append("phone", getPhone()) .append("phone", getPhone())
.append("email", getEmail()) .append("email", getEmail())
.append("status", getStatus()) .append("status", getStatus())
.append("isView", getIsView())
.append("delFlag", getDelFlag()) .append("delFlag", getDelFlag())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())

View File

@ -37,6 +37,12 @@ public class LeaseApplyDetails implements Serializable {
@ApiModelProperty(value = "任务ID") @ApiModelProperty(value = "任务ID")
private Integer parenntId; private Integer parenntId;
/**
* 二级id
*/
@ApiModelProperty(value = "二级id")
private Integer levelTwoId;
@ApiModelProperty(value = "任务ID") @ApiModelProperty(value = "任务ID")
private Long taskId; private Long taskId;

View File

@ -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_";
}

View File

@ -55,6 +55,15 @@ public class SelectController {
return service.getMaTypeDataById(dto); return service.getMaTypeDataById(dto);
} }
/**
* 根据二级查四级
*/
@ApiOperation(value = "机具类型下拉选")
@PostMapping("getMaTypeDataByIdTwo")
public AjaxResult getMaTypeDataByIdTwo(@RequestBody SelectDto dto){
return service.getMaTypeDataByIdTwo(dto);
}
/** /**
* 根据三级查四级在用下拉数据 * 根据三级查四级在用下拉数据
* @param dto * @param dto

View File

@ -62,7 +62,7 @@ public class SltAgreementInfoController extends BaseController {
/** /**
* 根据条件获取协议结算列表 * 根据条件获取协议结算列表
*/ */
@RequiresPermissions("cost:settlement:list") // @RequiresPermissions("cost:settlement:list")
@ApiOperation(value = "根据条件获取协议结算列表") @ApiOperation(value = "根据条件获取协议结算列表")
@GetMapping("/getSltAgreementInfo") @GetMapping("/getSltAgreementInfo")
public TableDataInfo getSltAgreementInfo(AgreementInfo bean) { public TableDataInfo getSltAgreementInfo(AgreementInfo bean) {

View File

@ -161,4 +161,16 @@ public class AgreementInfo extends BaseEntity {
@ApiModelProperty(value = "往来单位ids") @ApiModelProperty(value = "往来单位ids")
private int[] unitIds; private int[] unitIds;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
private Integer deptId;
/**
* 是否显示
*/
@ApiModelProperty(value = "是否显示")
private String isView;
} }

View File

@ -183,4 +183,15 @@ public class BackRecord {
@ApiModelProperty(value = "实时库存") @ApiModelProperty(value = "实时库存")
private Integer num; private Integer num;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
private Integer deptId;
/**
* 是否显示
*/
@ApiModelProperty(value = "是否显示")
private String isView;
} }

View File

@ -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;
}

View File

@ -187,4 +187,16 @@ public class LeaseRecord{
@ApiModelProperty(value = "是否推送到智慧工程01:是") @ApiModelProperty(value = "是否推送到智慧工程01:是")
private Integer pushNotifications; private Integer pushNotifications;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
private Integer deptId;
/**
* 是否显示
*/
@ApiModelProperty(value = "是否显示")
private String isView;
} }

View File

@ -77,4 +77,15 @@ public class OutRecord {
@ApiModelProperty(value = "关键字") @ApiModelProperty(value = "关键字")
private String keyWord; private String keyWord;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
private Integer deptId;
/**
* 是否显示
*/
@ApiModelProperty(value = "是否显示")
private String isView;
} }

View File

@ -216,4 +216,15 @@ public class ProjUsingRecord {
@ApiModelProperty(value = "在用标识") @ApiModelProperty(value = "在用标识")
private Integer useFlag; private Integer useFlag;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
private Integer deptId;
/**
* 是否显示
*/
@ApiModelProperty(value = "是否显示")
private String isView;
} }

View File

@ -189,4 +189,16 @@ public class RepairRecord implements Serializable {
*/ */
@ApiModelProperty(value = "proId") @ApiModelProperty(value = "proId")
private Integer proId; private Integer proId;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
private Integer deptId;
/**
* 是否显示
*/
@ApiModelProperty(value = "是否显示")
private String isView;
} }

View File

@ -206,4 +206,15 @@ public class ScrapRecord {
@ApiModelProperty(value = "实时库存") @ApiModelProperty(value = "实时库存")
private Integer num; private Integer num;
/**
* 部门id
*/
@ApiModelProperty(value = "部门id")
private Integer deptId;
/**
* 是否显示
*/
@ApiModelProperty(value = "是否显示")
private String isView;
} }

View File

@ -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.LeaseOutDetails;
import com.bonus.sgzb.base.api.domain.MaType; import com.bonus.sgzb.base.api.domain.MaType;
import com.bonus.sgzb.base.api.domain.SltAgreementInfo; import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
import com.bonus.sgzb.material.domain.DeptVo;
import com.bonus.sgzb.material.domain.LeaseRecord; import com.bonus.sgzb.material.domain.LeaseRecord;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -45,4 +46,10 @@ public interface LeaseRecordMapper {
* @return * @return
*/ */
List<LeaseApplyDetails> getMaTypeKeepList(LeaseApplyDetails leaseApplyDetails); List<LeaseApplyDetails> getMaTypeKeepList(LeaseApplyDetails leaseApplyDetails);
int getDeptId(Long userId);
DeptVo getAnsetors(int deptId);
DeptVo getAnsetorsByParentId(int parentId);
} }

View File

@ -205,5 +205,12 @@ public interface SelectMapper {
*/ */
List<SelectVo> getMaTypeDataById(SelectDto dto); List<SelectVo> getMaTypeDataById(SelectDto dto);
/**
* 机具类型下拉选
* @param dto
* @return
*/
List<SelectVo> getMaTypeDataByIdTwo(SelectDto dto);
List<SelectVo> getFourMaTypeList(SelectDto dto); List<SelectVo> getFourMaTypeList(SelectDto dto);
} }

View File

@ -190,6 +190,13 @@ public interface SelectService {
*/ */
AjaxResult getMaTypeDataById(SelectDto dto); AjaxResult getMaTypeDataById(SelectDto dto);
/**
* 机具类型下拉选 根据二级查四级
* @param dto
* @return
*/
AjaxResult getMaTypeDataByIdTwo(SelectDto dto);
/** /**
* 根据三级查四级在用下拉数据 * 根据三级查四级在用下拉数据
* @param dto * @param dto

View File

@ -1,6 +1,8 @@
package com.bonus.sgzb.material.service.impl; 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.BackRecord;
import com.bonus.sgzb.material.domain.DeptVo;
import com.bonus.sgzb.material.domain.LeaseRecord; import com.bonus.sgzb.material.domain.LeaseRecord;
import com.bonus.sgzb.material.mapper.BackRecordMapper; import com.bonus.sgzb.material.mapper.BackRecordMapper;
import com.bonus.sgzb.material.mapper.LeaseRecordMapper; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
@ -21,9 +24,20 @@ public class BackRecordServiceImpl implements BackRecordService {
@Autowired @Autowired
private BackRecordMapper backRecordMapper; private BackRecordMapper backRecordMapper;
@Autowired
private LeaseRecordMapper leaseRecordMapper;
@Override @Override
public List<BackRecord> getBackRecordList(BackRecord bean) { public List<BackRecord> 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); return backRecordMapper.getBackRecordList(bean);
} }
} }

View File

@ -1,9 +1,12 @@
package com.bonus.sgzb.material.service.impl; 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.InputRecord;
import com.bonus.sgzb.material.domain.OutRecord; import com.bonus.sgzb.material.domain.OutRecord;
import com.bonus.sgzb.material.domain.ScrapRecord; import com.bonus.sgzb.material.domain.ScrapRecord;
import com.bonus.sgzb.material.mapper.InputRecordMapper; 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.mapper.ScrapRecordMapper;
import com.bonus.sgzb.material.service.InputRecordService; import com.bonus.sgzb.material.service.InputRecordService;
import com.bonus.sgzb.material.service.ScrapRecordService; import com.bonus.sgzb.material.service.ScrapRecordService;
@ -22,7 +25,8 @@ public class InputRecordServiceImpl implements InputRecordService {
@Autowired @Autowired
private InputRecordMapper inputRecordMapper; private InputRecordMapper inputRecordMapper;
@Autowired
private LeaseRecordMapper leaseRecordMapper;
@Override @Override
public List<InputRecord> getInputRecordList(InputRecord bean) { public List<InputRecord> getInputRecordList(InputRecord bean) {
return inputRecordMapper.getInputRecordList(bean); return inputRecordMapper.getInputRecordList(bean);
@ -30,6 +34,17 @@ public class InputRecordServiceImpl implements InputRecordService {
@Override @Override
public List<OutRecord> getOutputRecordList(OutRecord bean) { public List<OutRecord> 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); return inputRecordMapper.getOutputRecordList(bean);
} }
} }

View File

@ -3,6 +3,8 @@ package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.base.api.domain.MaMachine; import com.bonus.sgzb.base.api.domain.MaMachine;
import com.bonus.sgzb.base.domain.vo.IotRecordVo; import com.bonus.sgzb.base.domain.vo.IotRecordVo;
import com.bonus.sgzb.base.mapper.BaseIotMachineMapper; 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.domain.LeaseRecord;
import com.bonus.sgzb.material.mapper.LeaseRecordMapper; import com.bonus.sgzb.material.mapper.LeaseRecordMapper;
import com.bonus.sgzb.material.service.LeaseRecordService; import com.bonus.sgzb.material.service.LeaseRecordService;
@ -11,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
@ -27,6 +30,36 @@ public class LeaseRecordServiceImpl implements LeaseRecordService {
private BaseIotMachineMapper baseIotMachineMapper; private BaseIotMachineMapper baseIotMachineMapper;
@Override @Override
public List<LeaseRecord> getLeaseRecordList(LeaseRecord bean) { public List<LeaseRecord> 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<LeaseRecord> listMaMachine =leaseRecordMapper.getLeaseRecordList(bean); List<LeaseRecord> listMaMachine =leaseRecordMapper.getLeaseRecordList(bean);
if (listMaMachine.size() > 0){ if (listMaMachine.size() > 0){
for (LeaseRecord leaseRecord : listMaMachine) { for (LeaseRecord leaseRecord : listMaMachine) {

View File

@ -1,8 +1,11 @@
package com.bonus.sgzb.material.service.impl; 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.BackRecord;
import com.bonus.sgzb.material.domain.DeptVo;
import com.bonus.sgzb.material.domain.ProjUsingRecord; import com.bonus.sgzb.material.domain.ProjUsingRecord;
import com.bonus.sgzb.material.mapper.BackRecordMapper; 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.mapper.ProjUsingRecordMapper;
import com.bonus.sgzb.material.service.BackRecordService; import com.bonus.sgzb.material.service.BackRecordService;
import com.bonus.sgzb.material.service.ProjUsingRecordService; import com.bonus.sgzb.material.service.ProjUsingRecordService;
@ -21,9 +24,21 @@ public class ProjUsingRecordServiceImpl implements ProjUsingRecordService {
@Autowired @Autowired
private ProjUsingRecordMapper projUsingRecordMapper; private ProjUsingRecordMapper projUsingRecordMapper;
@Autowired
private LeaseRecordMapper leaseRecordMapper;
@Override @Override
public List<ProjUsingRecord> getProjUsingRecordList(ProjUsingRecord bean) { public List<ProjUsingRecord> 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); return projUsingRecordMapper.getProjUsingRecordList(bean);
} }
} }

View File

@ -1,8 +1,11 @@
package com.bonus.sgzb.material.service.impl; 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.BackRecord;
import com.bonus.sgzb.material.domain.DeptVo;
import com.bonus.sgzb.material.domain.RepairRecord; import com.bonus.sgzb.material.domain.RepairRecord;
import com.bonus.sgzb.material.mapper.BackRecordMapper; 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.mapper.RepairRecordMapper;
import com.bonus.sgzb.material.service.BackRecordService; import com.bonus.sgzb.material.service.BackRecordService;
import com.bonus.sgzb.material.service.RepairRecordService; import com.bonus.sgzb.material.service.RepairRecordService;
@ -21,9 +24,21 @@ public class RepairRecordServiceImpl implements RepairRecordService {
@Autowired @Autowired
private RepairRecordMapper repairRecordMapper; private RepairRecordMapper repairRecordMapper;
@Autowired
private LeaseRecordMapper leaseRecordMapper;
@Override @Override
public List<RepairRecord> getRepairRecordList(RepairRecord bean) { public List<RepairRecord> 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); return repairRecordMapper.getRepairRecordList(bean);
} }
} }

View File

@ -1,8 +1,11 @@
package com.bonus.sgzb.material.service.impl; 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.BackRecord;
import com.bonus.sgzb.material.domain.DeptVo;
import com.bonus.sgzb.material.domain.ScrapRecord; import com.bonus.sgzb.material.domain.ScrapRecord;
import com.bonus.sgzb.material.mapper.BackRecordMapper; 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.mapper.ScrapRecordMapper;
import com.bonus.sgzb.material.service.BackRecordService; import com.bonus.sgzb.material.service.BackRecordService;
import com.bonus.sgzb.material.service.ScrapRecordService; import com.bonus.sgzb.material.service.ScrapRecordService;
@ -21,9 +24,21 @@ public class ScrapRecordServiceImpl implements ScrapRecordService {
@Autowired @Autowired
private ScrapRecordMapper scrapRecordMapper; private ScrapRecordMapper scrapRecordMapper;
@Autowired
private LeaseRecordMapper leaseRecordMapper;
@Override @Override
public List<ScrapRecord> getScrapRecordList(ScrapRecord bean) { public List<ScrapRecord> 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); return scrapRecordMapper.getScrapRecordList(bean);
} }
} }

View File

@ -86,6 +86,17 @@ public class SelectServiceImpl implements SelectService {
return AjaxResult.success(list); return AjaxResult.success(list);
} }
@Override
public AjaxResult getMaTypeDataByIdTwo(SelectDto dto) {
List<SelectVo> list = new ArrayList<>();
try {
list = mapper.getMaTypeDataByIdTwo(dto);
} catch (Exception e) {
log.error("机具类型-查询失败", e);
}
return AjaxResult.success(list);
}
/** /**
* 四级机具类型下拉选 * 四级机具类型下拉选
* @param dto * @param dto

View File

@ -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.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.material.domain.AgreementInfo; 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.domain.TmTask;
import com.bonus.sgzb.material.mapper.CalMonthlyMapper; 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.mapper.SltAgreementInfoMapper;
import com.bonus.sgzb.material.service.SltAgreementInfoService; import com.bonus.sgzb.material.service.SltAgreementInfoService;
import com.bonus.sgzb.material.vo.GlobalContants; import com.bonus.sgzb.material.vo.GlobalContants;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -41,8 +44,21 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
@Resource @Resource
private CalMonthlyMapper calMonthlyMapper; private CalMonthlyMapper calMonthlyMapper;
@Autowired
private LeaseRecordMapper leaseRecordMapper;
@Override @Override
public List<AgreementInfo> getSltAgreementInfo(AgreementInfo bean) { public List<AgreementInfo> 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); return sltAgreementInfoMapper.getSltAgreementInfo(bean);
} }

View File

@ -964,7 +964,7 @@
</select> </select>
<select id="getLeaseApplyDetailsByApply" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails"> <select id="getLeaseApplyDetailsByApply" resultType="com.bonus.sgzb.app.domain.LeaseApplyDetails">
SELECT SELECT
lad.*, mt.type_name AS typeModelName, lad.replace_type_id as replaceTypeId,mt.is_storage, mt.is_replace as isReplace, mt1.type_id as maTypeId, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType, lad.*,mt2.type_id as levelTwoId, mt.type_name AS typeModelName, lad.replace_type_id as replaceTypeId,mt.is_storage, mt.is_replace as isReplace, mt1.type_id as maTypeId, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType,
case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName, case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName,
CASE mt.manage_type CASE mt.manage_type
WHEN 0 THEN WHEN 0 THEN
@ -977,6 +977,7 @@
lease_apply_details lad lease_apply_details lad
LEFT JOIN ma_type mt ON lad.type_id = mt.type_id LEFT JOIN ma_type mt ON lad.type_id = mt.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id
LEFT JOIN (SELECT mt.type_id, LEFT JOIN (SELECT mt.type_id,
mt2.type_name AS typeName, mt2.type_name AS typeName,
mt.type_name AS typeModelName, mt.type_name AS typeModelName,

View File

@ -142,6 +142,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="agreementCode != null and agreementCode != ''"> <if test="agreementCode != null and agreementCode != ''">
and bai.agreement_code like concat('%',#{agreementCode},'%') and bai.agreement_code like concat('%',#{agreementCode},'%')
</if> </if>
<if test="isView == 1">
and bui.dept_id = #{deptId}
</if>
</select> </select>
<select id="getAllList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo"> <select id="getAllList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
SELECT SELECT

View File

@ -92,6 +92,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.type_name like concat('%',#{keyWord},'%') or mt.type_name like concat('%',#{keyWord},'%') or
mm.ma_code like concat('%',#{keyWord},'%')) mm.ma_code like concat('%',#{keyWord},'%'))
</if> </if>
<if test="isView == 1">
and bui.dept_id = #{deptId}
</if>
order by lod.create_time desc order by lod.create_time desc
</select> </select>
</mapper> </mapper>

View File

@ -65,6 +65,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') AND lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if> </if>
<if test="isView == 1">
and bui.dept_id = #{deptId}
</if>
</select> </select>
<select id="getSltAgreementInfo" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo"> <select id="getSltAgreementInfo" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
SELECT SELECT
@ -128,4 +131,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
su.nick_name; su.nick_name;
</select> </select>
<select id="getDeptId" resultType="int">
select dept_id as deptId
from sys_user as su
where user_id =#{userId} and del_flag = 0
</select>
<select id="getAnsetors" resultType="com.bonus.sgzb.material.domain.DeptVo">
select ancestors as ancestors,dept_id as deptId,parent_id as parentId,is_view as isView
from sys_dept as sd
where dept_id =#{deptId} and del_flag = 0
</select>
<select id="getAnsetorsByParentId" resultType="com.bonus.sgzb.material.domain.DeptVo">
select ancestors as ancestors,dept_id as deptId,parent_id as parentId,is_view as isView
from sys_dept as sd
where dept_id =#{parentId} and del_flag = 0
</select>
</mapper> </mapper>

View File

@ -72,6 +72,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') AND lod.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if> </if>
<if test="isView == 1">
and bui.dept_id = #{deptId}
</if>
GROUP BY bai.agreement_id, GROUP BY bai.agreement_id,
mt.type_id) AS subquery1 mt.type_id) AS subquery1
LEFT JOIN (SELECT bai.agreement_id, LEFT JOIN (SELECT bai.agreement_id,
@ -119,11 +122,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND bcd.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') AND bcd.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if> </if>
<if test="isView == 1">
and bui.dept_id = #{deptId}
</if>
GROUP BY bai.agreement_id, GROUP BY bai.agreement_id,
mt.type_id) AS subquery2 ON subquery1.type_id = subquery2.type_id mt.type_id) AS subquery2 ON subquery1.type_id = subquery2.type_id
AND subquery1.agreement_id = subquery2.agreement_id AND subquery1.agreement_id = subquery2.agreement_id
<if test="useFlag == 1"> <if test="useFlag == 1">
WHERE IFNULL(subquery1.outNum, 0) - IFNULL(subquery2.backNum, 0) > 0 WHERE IFNULL(subquery1.outNum, 0) - IFNULL(subquery2.backNum, 0) > 0
</if> </if>
</select> </select>
</mapper> </mapper>

View File

@ -55,5 +55,8 @@
<if test="proId != null"> <if test="proId != null">
and bpl.lot_id = #{proId} and bpl.lot_id = #{proId}
</if> </if>
<if test="isView == 1">
and bui.dept_id = #{deptId}
</if>
</select> </select>
</mapper> </mapper>

View File

@ -55,7 +55,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND sad.audit_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') AND sad.audit_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if> </if>
<if test="isView == 1">
and unit.dept_id = #{deptId}
</if>
UNION ALL UNION ALL
SELECT sad.id, SELECT sad.id,
@ -108,5 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND sad.audit_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') AND sad.audit_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if> </if>
<if test="isView == 1">
and unit.dept_id = #{deptId}
</if>
</select> </select>
</mapper> </mapper>

View File

@ -85,6 +85,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND mt.parent_id = #{id} AND mt.parent_id = #{id}
and mt.level = '4' and mt.level = '4'
</select> </select>
<select id="getMaTypeDataByIdTwo" resultType="com.bonus.sgzb.material.domain.SelectVo">
SELECT mt.type_id AS id,
mt.type_name AS `name`,
mt.unit_name as unit,
mt.lease_price AS leasePrice,
CASE mt.manage_type
WHEN 0 THEN
IFNULL(subquery0.num, 0)
ELSE
IFNULL(mt.num, 0)
END as num,
mt.is_storage,
mt.is_replace as isReplace
FROM ma_type mt
left join (
SELECT
mt.type_id,
mt2.type_name AS typeName,
mt.type_name AS typeModelName,
count( mm.ma_id ) num
FROM
ma_machine mm
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
WHERE
mm.ma_code IS NOT NULL
AND mm.ma_status IN ( 15 )
GROUP BY
mt.type_id
) AS subquery0 ON subquery0.type_id = mt.type_id
WHERE mt.del_flag = '0'
AND mt.parent_id IN (SELECT type_id FROM ma_type WHERE parent_id = #{id})
and mt.level = '4'
</select>
<!--数据字典下拉选--> <!--数据字典下拉选-->
<select id="getDictByPidCbx" resultType="com.bonus.sgzb.material.domain.SelectVo"> <select id="getDictByPidCbx" resultType="com.bonus.sgzb.material.domain.SelectVo">
SELECT sd2.id,sd2.`name` SELECT sd2.id,sd2.`name`

View File

@ -156,6 +156,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sltStatus != null"> <if test="sltStatus != null">
and bai.is_slt = #{sltStatus} and bai.is_slt = #{sltStatus}
</if> </if>
<if test="isView == 1">
and bui.dept_id = #{deptId}
</if>
ORDER BY bai.agreement_id desc ORDER BY bai.agreement_id desc
</select> </select>

View File

@ -21,11 +21,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="isView" column="is_view" />
</resultMap> </resultMap>
<sql id="selectDeptVo"> <sql id="selectDeptVo">
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, 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 from sys_dept d
</sql> </sql>
@ -98,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phone != null and phone != ''">phone,</if> <if test="phone != null and phone != ''">phone,</if>
<if test="email != null and email != ''">email,</if> <if test="email != null and email != ''">email,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="isView != null">is_view,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
create_time create_time
)values( )values(
@ -110,7 +112,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phone != null and phone != ''">#{phone},</if> <if test="phone != null and phone != ''">#{phone},</if>
<if test="email != null and email != ''">#{email},</if> <if test="email != null and email != ''">#{email},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="isView != null">#{isView},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate() sysdate()
) )
</insert> </insert>
@ -126,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phone != null">phone = #{phone},</if> <if test="phone != null">phone = #{phone},</if>
<if test="email != null">email = #{email},</if> <if test="email != null">email = #{email},</if>
<if test="status != null and status != ''">status = #{status},</if> <if test="status != null and status != ''">status = #{status},</if>
<if test="isView != null ">is_view = #{isView},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate() update_time = sysdate()
</set> </set>