材料站页面优化
This commit is contained in:
parent
97be09380e
commit
c1710f52b8
|
|
@ -50,4 +50,13 @@ public class MaterialLeaseMaCodeDto {
|
|||
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 签名地址
|
||||
*/
|
||||
@ApiModelProperty(value = "签名地址")
|
||||
private String signUrl;
|
||||
|
||||
@ApiModelProperty(value = "签名类型 手写0 和 图片上传1")
|
||||
private int signType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@ import com.bonus.common.core.utils.ServletUtils;
|
|||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.basic.domain.UseStorageInfo;
|
||||
import com.bonus.material.clz.domain.machine.MaterialUseStorageInfo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedTeamTotalVo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedTeamVo;
|
||||
import com.bonus.material.ma.domain.Machine;
|
||||
import com.bonus.material.clz.domain.machine.MaterialStorageInfo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo;
|
||||
|
|
@ -210,4 +211,83 @@ public class MaterialMachineController extends BaseController {
|
|||
return AjaxResult.success(materialMachineService.getToolsDetailsList(bean));
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全工器具预警页面查询
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "安全工器具预警页面查询")
|
||||
@GetMapping("/getSafeDetailsList")
|
||||
public AjaxResult getSafeDetailsList(MaterialRetainedEquipmentInfo bean) {
|
||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||
List<MaterialRetainedEquipmentInfo> list = materialMachineService.getSafeDetailsList(bean);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台班组在用库存查询
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "后台班组在用库存查询")
|
||||
@GetMapping("/getTeamNumList")
|
||||
public AjaxResult getTeamNumList(MaterialRetainedEquipmentInfo bean) {
|
||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||
List<MaterialRetainedTeamTotalVo> list = materialMachineService.getTeamNumList(bean);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出后台班组在用库存查询
|
||||
* @param response
|
||||
* @param bean
|
||||
*/
|
||||
@ApiOperation(value = "综合查询--导出后台班组在用库存查询")
|
||||
@PostMapping("/exportTeamNumList")
|
||||
public void exportTeamNumList(HttpServletResponse response, MaterialRetainedEquipmentInfo bean) {
|
||||
List<MaterialRetainedTeamTotalVo> list = materialMachineService.getTeamNumList(bean);
|
||||
ExcelUtil<MaterialRetainedTeamTotalVo> util = new ExcelUtil<>(MaterialRetainedTeamTotalVo.class);
|
||||
util.exportExcel(response, list, "综合查询--导出后台班组在用库存查询");
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台班组在用库存查询二级页面
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "后台班组在用库存查询二级页面")
|
||||
@GetMapping("/getTeamNumSecondList")
|
||||
public AjaxResult getTeamNumSecondList(MaterialRetainedEquipmentInfo bean) {
|
||||
startPage();
|
||||
List<MaterialRetainedTeamVo> list = materialMachineService.getTeamNumSecondList(bean);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台班组在用库存查询二级页面
|
||||
* @param response
|
||||
* @param bean
|
||||
*/
|
||||
@ApiOperation(value = "综合查询--导出后台班组在用库存查询二级页面")
|
||||
@PostMapping("/exportTeamNumSecondList")
|
||||
public void exportTeamNumSecondList(HttpServletResponse response, MaterialRetainedEquipmentInfo bean) {
|
||||
List<MaterialRetainedTeamVo> list = materialMachineService.getTeamNumSecondList(bean);
|
||||
ExcelUtil<MaterialRetainedTeamVo> util = new ExcelUtil<>(MaterialRetainedTeamVo.class);
|
||||
util.exportExcel(response, list, "综合查询--导出后台班组在用库存查询二级页面");
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台班组在用库存查询三级页面
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "后台班组在用库存查询三级页面")
|
||||
@GetMapping("/getTeamNumThirdList")
|
||||
public AjaxResult getTeamNumThirdList(MaterialRetainedEquipmentInfo bean) {
|
||||
startPage();
|
||||
List<MaterialRetainedEquipmentInfo> list = materialMachineService.getTeamNumThirdList(bean);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ public class MaterialUseStorageInfo {
|
|||
private BigDecimal usNum;
|
||||
|
||||
@ApiModelProperty(value = "购置单价")
|
||||
@Excel(name = "租赁价(元)")
|
||||
private BigDecimal buyPrice;
|
||||
|
||||
@ApiModelProperty(value = "设备编码")
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @description 综合查询--保有设备总量查询
|
||||
|
|
@ -219,4 +220,21 @@ public class MaterialRetainedEquipmentInfo {
|
|||
* i8工程id集合
|
||||
*/
|
||||
private List<String> projectIdList;
|
||||
|
||||
@ApiModelProperty("机具类型(1机具,2安全工器具)")
|
||||
private int jiJuType;
|
||||
|
||||
@ApiModelProperty(value = "协议id集合")
|
||||
private Set<Integer> agreementIdList;
|
||||
|
||||
private Long maId;
|
||||
|
||||
@ApiModelProperty(value = "领料人")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "领料人")
|
||||
private String leasePerson;
|
||||
|
||||
@ApiModelProperty(value = "协议id")
|
||||
private Long agreementId;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.bonus.material.clz.domain.vo;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description 综合查询--保有设备总量查询
|
||||
* @author ma_sh
|
||||
* @date 2024/2/26 14:51
|
||||
*/
|
||||
@ApiModel(description = "保有设备总量查询")
|
||||
@Data
|
||||
public class MaterialRetainedTeamTotalVo {
|
||||
|
||||
private static final long serialVersionUID = 2227217051604273598L;
|
||||
|
||||
@ApiModelProperty(value = "班组id")
|
||||
private String teamId;
|
||||
|
||||
@ApiModelProperty(value = "班组名称")
|
||||
@Excel(name = "班组名称")
|
||||
private String teamName;
|
||||
|
||||
@ApiModelProperty(value = "班组长")
|
||||
@Excel(name = "班组长")
|
||||
private String teamLeaderIdCard;
|
||||
|
||||
@ApiModelProperty(value = "在用数量")
|
||||
@Excel(name = "库存")
|
||||
private BigDecimal usNum;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.bonus.material.clz.domain.vo;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description 综合查询--保有设备总量查询
|
||||
* @author ma_sh
|
||||
* @date 2024/2/26 14:51
|
||||
*/
|
||||
@ApiModel(description = "保有设备总量查询")
|
||||
@Data
|
||||
public class MaterialRetainedTeamVo {
|
||||
|
||||
private static final long serialVersionUID = 2227217051604273598L;
|
||||
|
||||
@ApiModelProperty(value = "班组名称")
|
||||
@Excel(name = "班组名称")
|
||||
private String teamName;
|
||||
|
||||
@ApiModelProperty(value = "领料单号")
|
||||
@Excel(name = "领料单号")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "领料人")
|
||||
@Excel(name = "领料人")
|
||||
private String leasePerson;
|
||||
|
||||
@ApiModelProperty(value = "物资名称")
|
||||
@Excel(name = "机具名称")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "规格ID")
|
||||
private Integer typeId;
|
||||
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
@Excel(name = "规格型号")
|
||||
private String typeModelName;
|
||||
|
||||
@ApiModelProperty(value = "在用数量")
|
||||
@Excel(name = "库存")
|
||||
private BigDecimal usNum;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
@ApiModelProperty(value = "班组id")
|
||||
private String teamId;
|
||||
|
||||
@ApiModelProperty(value = "班组长")
|
||||
private String teamLeaderIdCard;
|
||||
|
||||
private Long maId;
|
||||
|
||||
@ApiModelProperty(value = "协议id")
|
||||
private Long agreementId;
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.clz.domain.vo.lease;
|
||||
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutSign;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyDetails;
|
||||
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo;
|
||||
|
|
@ -39,4 +40,9 @@ public class MaterialLeaseApplyRequestVo extends BaseEntity {
|
|||
|
||||
private int statusFlag;
|
||||
|
||||
/**
|
||||
* 领料出库签名集合
|
||||
*/
|
||||
private LeaseOutSign leaseOutSign;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -349,4 +349,12 @@ public interface MaterialLeaseInfoMapper {
|
|||
* @return
|
||||
*/
|
||||
int updateLeaseOutDetails(@Param("record") LeaseOutDetails leaseOutDetails);
|
||||
|
||||
/**
|
||||
* 根据任务id和工器具id查询工器具领料详情数据
|
||||
* @param id
|
||||
* @param typeId
|
||||
* @return
|
||||
*/
|
||||
List<MaterialLeaseMaCodeDto> getList(@Param("id") Long id, @Param("typeId") Long typeId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.bonus.material.clz.mapper;
|
|||
|
||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||
import com.bonus.material.clz.domain.machine.MaterialUseStorageInfo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedTeamTotalVo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedTeamVo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialSltAgreementInfo;
|
||||
import com.bonus.material.ma.domain.Machine;
|
||||
import com.bonus.material.clz.domain.BmTeam;
|
||||
|
|
@ -121,4 +123,31 @@ public interface MaterialMachineMapper {
|
|||
*/
|
||||
MaterialUseStorageInfo selectUseInFo(MaterialUseStorageInfo useStorageInfo);
|
||||
|
||||
/**
|
||||
* 根据agreementIdList查询工器具台账信息
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<MaterialRetainedEquipmentInfo> getTotalList(MaterialRetainedEquipmentInfo bean);
|
||||
|
||||
/**
|
||||
* 班组库存查询
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<MaterialRetainedTeamTotalVo> getTeamNumList(MaterialRetainedEquipmentInfo bean);
|
||||
|
||||
/**
|
||||
* 班组库存查询二级页面
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<MaterialRetainedTeamVo> getTeamNumSecondList(MaterialRetainedEquipmentInfo bean);
|
||||
|
||||
/**
|
||||
* 班组库存查询三级页面
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<MaterialRetainedEquipmentInfo> getTeamNumThirdList(MaterialRetainedEquipmentInfo bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.material.clz.service;
|
||||
|
||||
import com.bonus.material.clz.domain.machine.MaterialUseStorageInfo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedTeamTotalVo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedTeamVo;
|
||||
import com.bonus.material.ma.domain.Machine;
|
||||
import com.bonus.material.clz.domain.machine.MaterialStorageInfo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo;
|
||||
|
|
@ -75,4 +77,32 @@ public interface MaterialMachineService {
|
|||
* @return
|
||||
*/
|
||||
List<MaterialUseStorageInfo> getUserRecords(MaterialUseStorageInfo bean);
|
||||
|
||||
/**
|
||||
* 安全工器具预警页面查询
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<MaterialRetainedEquipmentInfo> getSafeDetailsList(MaterialRetainedEquipmentInfo bean);
|
||||
|
||||
/**
|
||||
* 后台班组在用库存查询
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<MaterialRetainedTeamTotalVo> getTeamNumList(MaterialRetainedEquipmentInfo bean);
|
||||
|
||||
/**
|
||||
* 后台班组在用库存查询二级页面后台班组在用库存查询二级页面
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<MaterialRetainedTeamVo> getTeamNumSecondList(MaterialRetainedEquipmentInfo bean);
|
||||
|
||||
/**
|
||||
* 后台班组在用库存查询三级页面
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<MaterialRetainedEquipmentInfo> getTeamNumThirdList(MaterialRetainedEquipmentInfo bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.bonus.common.biz.domain.BmFileInfo;
|
|||
import com.bonus.common.biz.domain.TypeTreeBuild;
|
||||
import com.bonus.common.biz.domain.TypeTreeNode;
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutSign;
|
||||
import com.bonus.common.biz.domain.lease.MaterialLeaseMaCodeDto;
|
||||
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||
import com.bonus.common.biz.enums.LeaseTaskStatusEnum;
|
||||
|
|
@ -1505,6 +1506,13 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
|
|||
detail.setMaCodeVoList(maCodeVoList);
|
||||
}
|
||||
}
|
||||
List<MaterialLeaseMaCodeDto> detailsList = materialLeaseInfoMapper.getList(leaseApplyInfo.getId(), details.get(0).getTypeId());
|
||||
if (CollectionUtil.isNotEmpty(detailsList)) {
|
||||
//获取maCodeVoList第一个对象
|
||||
LeaseOutSign leaseOutSign = new LeaseOutSign(detailsList.get(0).getSignType(),
|
||||
"data:image/png;base64," + detailsList.get(0).getSignUrl());
|
||||
leaseApplyRequestVo.setLeaseOutSign(leaseOutSign);
|
||||
}
|
||||
}
|
||||
AjaxResult ajaxResult = AjaxResult.success();
|
||||
ajaxResult.put("data", leaseApplyRequestVo);
|
||||
|
|
|
|||
|
|
@ -4,14 +4,17 @@ import cn.hutool.core.collection.CollectionUtil;
|
|||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.alibaba.nacos.common.utils.StringUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.basic.domain.BmProject;
|
||||
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo;
|
||||
import com.bonus.material.clz.domain.machine.MaterialUseStorageInfo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialSltAgreementInfo;
|
||||
import com.bonus.material.clz.domain.vo.*;
|
||||
import com.bonus.material.clz.mapper.IwsTeamUserMapper;
|
||||
import com.bonus.material.common.domain.dto.SelectDto;
|
||||
import com.bonus.material.common.domain.vo.AgreementVo;
|
||||
import com.bonus.material.common.mapper.SelectMapper;
|
||||
import com.bonus.material.ma.domain.Machine;
|
||||
import com.bonus.material.clz.domain.BmTeam;
|
||||
import com.bonus.material.clz.domain.machine.MaterialStorageInfo;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo;
|
||||
import com.bonus.material.clz.mapper.BmTeamMapper;
|
||||
import com.bonus.material.clz.mapper.MaterialMachineMapper;
|
||||
import com.bonus.material.clz.service.MaterialMachineService;
|
||||
|
|
@ -45,6 +48,9 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
@Resource
|
||||
private SelectMapper mapper;
|
||||
|
||||
@Resource
|
||||
private IwsTeamUserMapper iwsTeamUserMapper;
|
||||
|
||||
/**
|
||||
* 获取机具追溯管理数据
|
||||
* @param machine
|
||||
|
|
@ -708,7 +714,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
}
|
||||
if (StringUtils.isNotBlank(bean.getStatus())) {
|
||||
return list.stream().filter(item -> {
|
||||
return item.getStatus().equals(bean.getStatus());
|
||||
return StringUtils.isNotBlank(item.getStatus()) && item.getStatus().equals(bean.getStatus());
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
@ -755,6 +761,164 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全工器具预警页面查询
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MaterialRetainedEquipmentInfo> getSafeDetailsList(MaterialRetainedEquipmentInfo bean) {
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
List<BmProject> list = mapper.getProjectInfo(new BmProject());
|
||||
Set<Integer> agreementIdList = new HashSet<>();
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
if (CollectionUtils.isNotEmpty(projectIdList)) {
|
||||
// 找出list中projectId与projectIdList中相同的数据
|
||||
list = list.stream().filter(info -> projectIdList.contains(info.getProjectId())).collect(Collectors.toList());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (BmProject project : list) {
|
||||
SelectDto selectDto = new SelectDto();
|
||||
selectDto.setProId(project.getProId());
|
||||
List<AgreementVo> agreementList = mapper.getAgreementInfoBy(selectDto);
|
||||
if (CollectionUtils.isNotEmpty(agreementList)) {
|
||||
for (AgreementVo agreement : agreementList) {
|
||||
agreementIdList.add(agreement.getAgreementId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 根据agreementIdList查询工器具台账信息
|
||||
bean.setAgreementIdList(agreementIdList);
|
||||
List<MaterialRetainedEquipmentInfo> totalList = materialMachineMapper.getTotalList(bean);
|
||||
if (CollectionUtils.isNotEmpty(totalList)) {
|
||||
for (MaterialRetainedEquipmentInfo materialRetainedEquipmentInfo : totalList) {
|
||||
MaterialRetainedEquipmentInfo materialRetainedEquipmentInfo1 = new MaterialRetainedEquipmentInfo();
|
||||
materialRetainedEquipmentInfo1.setMaId(materialRetainedEquipmentInfo.getMaId());
|
||||
List<MaterialRetainedEquipmentInfo> clzList = materialMachineMapper.getTeamUseNumDetailsList(materialRetainedEquipmentInfo1);
|
||||
if (CollectionUtils.isNotEmpty(clzList)) {
|
||||
materialRetainedEquipmentInfo.setTeamName(clzList.get(0).getTeamName());
|
||||
materialRetainedEquipmentInfo.setProName(clzList.get(0).getProName());
|
||||
}
|
||||
}
|
||||
}
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
if (!CollectionUtils.isEmpty(totalList) && deptId != null) {
|
||||
// 删除元素
|
||||
totalList.removeIf(m -> !deptId.toString().equals(m.getImpUnit()));
|
||||
}
|
||||
if (CollectionUtils.isEmpty(totalList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
if (!CollectionUtil.isEmpty(totalList)) {
|
||||
totalList = getMaterialRetainedEquipmentInfos(totalList);
|
||||
for (MaterialRetainedEquipmentInfo info : totalList) {
|
||||
// 处理thisCheckTime
|
||||
if (StringUtils.isNotBlank(info.getThisCheckTime())) {
|
||||
// 提取日期部分(假设格式为"yyyy-MM-dd HH:mm:ss")
|
||||
String[] parts = info.getThisCheckTime().split(" ");
|
||||
if (parts.length > 0) {
|
||||
info.setThisCheckTime(parts[0]);
|
||||
}
|
||||
}
|
||||
// 处理nextCheckTime
|
||||
if (StringUtils.isNotBlank(info.getNextCheckTime())) {
|
||||
String[] parts = info.getNextCheckTime().split(" ");
|
||||
if (parts.length > 0) {
|
||||
info.setNextCheckTime(parts[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(bean.getStatus())) {
|
||||
return totalList.stream().filter(item -> {
|
||||
return StringUtils.isNotBlank(item.getStatus()) && item.getStatus().equals(bean.getStatus());
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
// 如果关键字不为空,进行过滤
|
||||
if (StringUtils.isNotBlank(bean.getKeyWord())) {
|
||||
totalList = totalList.stream()
|
||||
.filter(item -> containsNumKeyword(item, bean.getKeyWord()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
return totalList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 模糊匹配查询
|
||||
* @param item
|
||||
* @param keyWord
|
||||
* @return
|
||||
*/
|
||||
private boolean containsNumKeyword(MaterialRetainedEquipmentInfo item, String keyWord) {
|
||||
return (item.getTypeName() != null && item.getTypeName().contains(keyWord)) ||
|
||||
(item.getTypeModelName() != null && item.getTypeModelName().contains(keyWord)) ||
|
||||
(item.getProName() != null && item.getProName().contains(keyWord)) ||
|
||||
(item.getMaCode() != null && item.getMaCode().contains(keyWord)) ||
|
||||
(item.getTeamName() != null && item.getTeamName().contains(keyWord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台班组在用库存查询
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MaterialRetainedTeamTotalVo> getTeamNumList(MaterialRetainedEquipmentInfo bean) {
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
List<BmProject> list = new ArrayList<>();
|
||||
list = mapper.getProjectInfo(new BmProject());
|
||||
List<MaterialRetainedTeamTotalVo> teamNumList = materialMachineMapper.getTeamNumList(bean);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
if (CollectionUtils.isNotEmpty(projectIdList)) {
|
||||
// 找出list中projectId与projectIdList中相同的数据
|
||||
list = list.stream().filter(info -> projectIdList.contains(info.getProjectId())).collect(Collectors.toList());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
// 获取list中的projectId
|
||||
List<String> collect = list.stream().map(BmProject::getProjectId).distinct().collect(Collectors.toList());
|
||||
// 根据i8工程id查询班组信息
|
||||
List<IwsTeamUserVo> iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(collect);
|
||||
if (CollectionUtil.isNotEmpty(iwsTeamUserVos)) {
|
||||
if (CollectionUtil.isNotEmpty(teamNumList)) {
|
||||
// 筛选出teamNumList中班组名称和iwsTeamUserVos中班组名称相同的数据
|
||||
teamNumList = teamNumList.stream().filter(item -> iwsTeamUserVos.stream().anyMatch(info -> info.getTeamName().equals(item.getTeamName()))).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return teamNumList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台班组在用库存查询二级页面
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MaterialRetainedTeamVo> getTeamNumSecondList(MaterialRetainedEquipmentInfo bean) {
|
||||
return materialMachineMapper.getTeamNumSecondList(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台班组在用库存查询三级页面
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MaterialRetainedEquipmentInfo> getTeamNumThirdList(MaterialRetainedEquipmentInfo bean) {
|
||||
return materialMachineMapper.getTeamNumThirdList(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在用设备模糊匹配
|
||||
* @param item
|
||||
|
|
|
|||
|
|
@ -543,7 +543,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mm.ma_id as maId,
|
||||
mm.ma_code as maCode,
|
||||
'在用' as maStatus,
|
||||
mm.ma_status as status
|
||||
mm.ma_status as status,
|
||||
su.sign_type as signType,
|
||||
su.sign_url as signUrl
|
||||
FROM
|
||||
clz_lease_out_details lod
|
||||
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
|
||||
|
|
@ -551,6 +553,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
LEFT JOIN sys_user su ON lod.create_by = su.nick_name
|
||||
WHERE
|
||||
lod.parent_id = #{id}
|
||||
and mt.type_id = #{typeId}
|
||||
|
|
@ -1180,4 +1183,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
parent_id = #{id}
|
||||
and type_id = #{typeId}
|
||||
</select>
|
||||
<select id="getList" resultType="com.bonus.common.biz.domain.lease.MaterialLeaseMaCodeDto">
|
||||
SELECT
|
||||
mt.type_id AS typeId,
|
||||
mt1.type_name AS materialName,
|
||||
mt.type_name AS materialModel,
|
||||
su.sign_type AS signType,
|
||||
su.sign_url AS signUrl
|
||||
FROM
|
||||
clz_lease_out_details lod
|
||||
LEFT JOIN ma_type mt ON lod.type_id = mt.type_id
|
||||
AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
LEFT JOIN sys_user su ON lod.create_by = su.nick_name
|
||||
WHERE
|
||||
lod.parent_id = #{id}
|
||||
AND mt.type_id = #{typeId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -285,7 +285,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mm.next_check_time AS nextCheckTime,
|
||||
mt.manage_type AS manageType,
|
||||
bp.imp_unit AS impUnit,
|
||||
bt.bzz_idcard AS idCard
|
||||
bt.bzz_idcard AS idCard,
|
||||
bp.pro_name AS proName
|
||||
FROM
|
||||
clz_slt_agreement_info sai
|
||||
LEFT JOIN clz_bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||
|
|
@ -301,6 +302,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="typeId != null">
|
||||
and mt2.type_id = #{typeId}
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
and sai.ma_id = #{maId}
|
||||
</if>
|
||||
<if test="teamId != null and teamId != ''">
|
||||
AND bt.unit_id = #{teamId}
|
||||
</if>
|
||||
|
|
@ -315,6 +319,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
OR mm.ma_code LIKE concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="jiJuType != null">
|
||||
and mt.jiju_type = #{jiJuType}
|
||||
</if>
|
||||
GROUP BY
|
||||
mt.type_name,
|
||||
mt2.type_name,
|
||||
|
|
@ -665,4 +672,118 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="getTotalList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||
SELECT
|
||||
mt2.type_name AS typeName,
|
||||
mt.type_name AS typeModelName,
|
||||
sai.ma_id AS maId,
|
||||
mm.ma_code AS maCode,
|
||||
mm.this_check_time AS thisCheckTime,
|
||||
mm.next_check_time AS nextCheckTime,
|
||||
bp.imp_unit AS impUnit,
|
||||
mt.manage_type AS manageType
|
||||
FROM
|
||||
slt_agreement_info sai
|
||||
LEFT JOIN bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||
LEFT JOIN ma_machine mm ON mm.ma_id = sai.ma_id
|
||||
WHERE
|
||||
sai.`status` = '0'
|
||||
AND mt.jiju_type = 2
|
||||
AND sai.ma_id IS NOT NULL
|
||||
<if test="agreementIdList != null and agreementIdList.size >0">
|
||||
AND sai.agreement_id IN
|
||||
<foreach item="item" collection="agreementIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getTeamNumList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedTeamTotalVo">
|
||||
SELECT
|
||||
bu.unit_id as teamId,
|
||||
bu.unit_name as teamName,
|
||||
bu.link_man as teamLeaderIdCard,
|
||||
SUM( sai.num ) as usNum
|
||||
FROM
|
||||
bm_unit bu
|
||||
LEFT JOIN clz_bm_agreement_info bai ON bu.unit_id = bai.unit_id
|
||||
LEFT JOIN clz_slt_agreement_info sai ON bai.agreement_id = sai.agreement_id
|
||||
WHERE
|
||||
sai.`status` = 0 and bu.type_id = 1731
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
bu.unit_name like concat('%',#{keyWord},'%') or
|
||||
bu.link_man like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY
|
||||
bu.unit_id
|
||||
</select>
|
||||
|
||||
<select id="getTeamNumSecondList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedTeamVo">
|
||||
SELECT
|
||||
mt2.type_name AS typeName,
|
||||
mt.type_name AS typeModelName,
|
||||
SUM(sai.num) AS usNum,
|
||||
bt.unit_name AS teamName,
|
||||
sai.lease_id AS leaseId,
|
||||
sai.type_id AS typeId,
|
||||
lai.code AS code,
|
||||
lai.lease_person AS leasePerson,
|
||||
mt.manage_type AS manageType,
|
||||
sai.agreement_id AS agreementId
|
||||
FROM
|
||||
clz_slt_agreement_info sai
|
||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||
LEFT JOIN ma_machine mm ON mm.ma_id = sai.ma_id
|
||||
LEFT JOIN clz_bm_agreement_info bai ON bai.agreement_id = sai.agreement_id
|
||||
LEFT JOIN bm_unit bt ON bai.unit_id = bt.unit_id
|
||||
LEFT JOIN clz_lease_apply_info lai ON lai.id = sai.lease_id
|
||||
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||
WHERE
|
||||
sai.status = '0'
|
||||
AND bt.unit_id = #{teamId}
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
mt2.type_name like concat('%',#{keyWord},'%') or
|
||||
mt.type_name like concat('%',#{keyWord},'%') or
|
||||
bt.unit_name like concat('%',#{keyWord},'%') or
|
||||
lai.code like concat('%',#{keyWord},'%') or
|
||||
lai.lease_person like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY sai.type_id
|
||||
</select>
|
||||
|
||||
<select id="getTeamNumThirdList" resultType="com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo">
|
||||
SELECT
|
||||
mt2.type_name AS typeName,
|
||||
mt.type_name AS typeModelName,
|
||||
sai.type_id AS typeId,
|
||||
sai.ma_id AS maId,
|
||||
mm.ma_code AS maCode
|
||||
FROM
|
||||
clz_slt_agreement_info sai
|
||||
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||
LEFT JOIN ma_machine mm ON mm.ma_id = sai.ma_id
|
||||
WHERE
|
||||
sai.STATUS = '0'
|
||||
AND sai.agreement_id = #{agreementId}
|
||||
AND sai.type_id = #{typeId}
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
mt2.type_name like concat('%',#{keyWord},'%') or
|
||||
mt.type_name like concat('%',#{keyWord},'%') or
|
||||
mm.ma_code like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY
|
||||
sai.ma_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue