This commit is contained in:
mashuai 2025-07-28 15:56:11 +08:00
parent 2338d1c89e
commit e592719669
13 changed files with 281 additions and 156 deletions

View File

@ -7,6 +7,7 @@ import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -119,6 +120,15 @@ public class LeaseOutDetails extends BaseEntity {
@ApiModelProperty(value = "是否退回 (0未退回1退回)") @ApiModelProperty(value = "是否退回 (0未退回1退回)")
private Integer isBack; private Integer isBack;
@ApiModelProperty("机具类型1机具2安全工器具")
private int jiJuType;
@ApiModelProperty(value = "本次检验日期")
private Date thisCheckTime;
@ApiModelProperty(value = "下次检验日期")
private Date nextCheckTime;
/** /**
* 领料出库机具编码集合 * 领料出库机具编码集合
*/ */

View File

@ -10,11 +10,8 @@ import javax.validation.constraints.NotNull;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import com.bonus.common.biz.config.ListPagingUtil; import com.bonus.common.biz.config.ListPagingUtil;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.common.biz.domain.lease.LeasePublishInfo;
import com.bonus.common.core.utils.ServletUtils; import com.bonus.common.core.utils.ServletUtils;
import com.bonus.common.log.enums.OperaType; import com.bonus.common.log.enums.OperaType;
import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.material.archives.service.ArchivesService; import com.bonus.material.archives.service.ArchivesService;
import com.bonus.material.back.domain.BackApplyDetails; import com.bonus.material.back.domain.BackApplyDetails;
import com.bonus.material.back.domain.HandlingOrder; import com.bonus.material.back.domain.HandlingOrder;
@ -72,6 +69,46 @@ public class BackApplyInfoController extends BaseController {
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
} }
/**
* 查询未签字退料任务列表
* @param backApplyInfo
* @return
*/
@ApiOperation(value = "查询未签字退料任务列表")
@GetMapping("/getNoSignList")
public AjaxResult getNoSignList(BackApplyInfo backApplyInfo) {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
List<BackApplyInfo> list = backApplyInfoService.getNoSignList(backApplyInfo);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
/**
* 查询材料员待确认的任务
* @param backApplyInfo
* @return
*/
@ApiOperation(value = "查询材料员待确认的任务")
@GetMapping("/getCompleteBackTaskList")
public AjaxResult getCompleteBackTaskList(BackApplyInfo backApplyInfo) {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
List<BackApplyInfo> list = backApplyInfoService.getCompleteBackTaskList(backApplyInfo);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
/**
* 材料员确认接口
* @param backApplyInfo
* @return
*/
@ApiOperation(value = "材料员确认接口")
@PostMapping("/confirmMaterial")
public AjaxResult confirmMaterial(@RequestBody BackApplyInfo backApplyInfo) {
int confirmResult = backApplyInfoService.confirmMaterial(backApplyInfo);
return confirmResult > 0 ? success("确认成功") : error("确认失败");
}
/** /**
* 上传退料单PDF文件 * 上传退料单PDF文件
*/ */

View File

@ -188,4 +188,19 @@ public class BackApplyInfo implements Serializable {
@ApiModelProperty(value = "一级类型id集合") @ApiModelProperty(value = "一级类型id集合")
private String firstId; private String firstId;
@ApiModelProperty(value = "i8工程id")
private String externalId;
@ApiModelProperty(value = "材料员确认账号")
private String materialMan;
@ApiModelProperty(value = "材料员确认时间")
private String confirmTime;
@ApiModelProperty(value = "是否确认 0不需要确认1未确认 2已确认")
private Integer isConfirm;
@ApiModelProperty(value = "材料员确认备注")
private String confirmRemark;
} }

View File

@ -190,5 +190,27 @@ public interface IBackApplyInfoService {
* @return * @return
*/ */
AjaxResult uploadSort(HandlingOrder bean); AjaxResult uploadSort(HandlingOrder bean);
/**
* 查询未签字退料任务列表
* @param backApplyInfo
* @return
*/
List<BackApplyInfo> getNoSignList(BackApplyInfo backApplyInfo);
/**
* 查询材料员待确认的任务
* @param backApplyInfo
* @return
*/
List<BackApplyInfo> getCompleteBackTaskList(BackApplyInfo backApplyInfo);
/**
* 材料员确认接口
* @param backApplyInfo
* @return
*/
int confirmMaterial(BackApplyInfo backApplyInfo);
} }

View File

@ -9,7 +9,6 @@ import cn.hutool.core.util.PhoneUtil;
import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.common.utils.CollectionUtils;
import com.bonus.common.biz.constant.MaterialConstants; import com.bonus.common.biz.constant.MaterialConstants;
import com.bonus.common.biz.domain.TypeTreeNode; import com.bonus.common.biz.domain.TypeTreeNode;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.common.biz.domain.lease.LeaseOutDetails; import com.bonus.common.biz.domain.lease.LeaseOutDetails;
import com.bonus.common.biz.enums.*; import com.bonus.common.biz.enums.*;
import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.exception.ServiceException;
@ -24,6 +23,7 @@ import com.bonus.material.basic.mapper.BmFileInfoMapper;
import com.bonus.material.common.domain.dto.SelectDto; import com.bonus.material.common.domain.dto.SelectDto;
import com.bonus.material.common.domain.vo.AgreementVo; import com.bonus.material.common.domain.vo.AgreementVo;
import com.bonus.material.common.mapper.SelectMapper; import com.bonus.material.common.mapper.SelectMapper;
import com.bonus.material.lease.mapper.LeaseApplyInfoMapper;
import com.bonus.material.ma.mapper.MachineMapper; import com.bonus.material.ma.mapper.MachineMapper;
import com.bonus.material.purchase.config.RemoteConfig; import com.bonus.material.purchase.config.RemoteConfig;
import com.bonus.material.settlement.domain.SltAgreementInfo; import com.bonus.material.settlement.domain.SltAgreementInfo;
@ -74,6 +74,9 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
@Resource @Resource
private SelectMapper mapper; private SelectMapper mapper;
@Resource
private LeaseApplyInfoMapper leaseApplyInfoMapper;
/** /**
* 查询退料任务 - 性能优化版 * 查询退料任务 - 性能优化版
* *
@ -425,7 +428,6 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
backApplyInfo.setUserId(userId == 0 ? null : userId); backApplyInfo.setUserId(userId == 0 ? null : userId);
} }
list = backApplyInfoMapper.selectBackApplyInfoList(backApplyInfo); list = backApplyInfoMapper.selectBackApplyInfoList(backApplyInfo);
for (BackApplyInfo applyInfo : list) {
if (!CollectionUtils.isEmpty(typeIdList)) { if (!CollectionUtils.isEmpty(typeIdList)) {
// 使用流过滤符合条件的元素 // 使用流过滤符合条件的元素
list = list.stream() list = list.stream()
@ -446,6 +448,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
for (BackApplyInfo applyInfo : list) {
if (StringUtils.isNotBlank(applyInfo.getBackSignUrl())) { if (StringUtils.isNotBlank(applyInfo.getBackSignUrl())) {
applyInfo.setBackSignUrl("data:image/png;base64," + applyInfo.getBackSignUrl()); applyInfo.setBackSignUrl("data:image/png;base64," + applyInfo.getBackSignUrl());
} }
@ -1701,6 +1704,94 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
} }
} }
/**
* 查询未签字退料任务列表
* @param backApplyInfo
* @return
*/
@Override
public List<BackApplyInfo> getNoSignList(BackApplyInfo backApplyInfo) {
backApplyInfo.setIsSign(1);
Long userId = SecurityUtils.getLoginUser().getUserid();
// 首先根据用户名去ma_type_manage表查询是否存在绑定物资信息
List<Long> typeIdList = backApplyInfoMapper.selectTypeIdList(userId);
if (CollectionUtils.isEmpty(typeIdList)) {
backApplyInfo.setUserId(userId == 0 ? null : userId);
}
List<BackApplyInfo> list = backApplyInfoMapper.selectBackApplyInfoList(backApplyInfo);
if (!CollectionUtils.isEmpty(typeIdList)) {
// 使用流过滤符合条件的元素
list = list.stream()
.filter(item -> {
String firstIdStr = item.getFirstId();
if (firstIdStr == null) {
return false;
}
// 将逗号分隔的字符串转为集合
Set<Long> firstIds = Arrays.stream(firstIdStr.split(","))
.map(String::trim)
.filter(s -> !s.isEmpty())
.map(Long::parseLong)
.collect(Collectors.toSet());
// 判断两个集合是否有交集
return firstIds.stream().anyMatch(typeIdList::contains);
})
.collect(Collectors.toList());
}
// 提取关键字
String keyWord = backApplyInfo.getKeyWord();
// 如果关键字不为空进行过滤
if (!StringUtils.isBlank(keyWord)) {
list = list.stream()
.filter(item -> containsKeyword(item, keyWord))
.collect(Collectors.toList());
}
return list;
}
/**
* 查询材料员待确认的任务
* @param backApplyInfo
* @return
*/
@Override
public List<BackApplyInfo> getCompleteBackTaskList(BackApplyInfo backApplyInfo) {
// 查询已签名数据
backApplyInfo.setIsSign(2);
List<BackApplyInfo> list = backApplyInfoMapper.selectBackApplyInfoList(backApplyInfo);
//材料站权限过滤
String username = SecurityUtils.getLoginUser().getUsername();
if(!CollectionUtils.isEmpty(list)) {
list = list.stream()
.filter(info -> {
// 调用 mapper 方法检查是否有符合条件的数据
int count = leaseApplyInfoMapper.checkPermission(info.getExternalId(), username);
return count > 0;
})
.collect(Collectors.toList());
}
// 提取关键字
String keyWord = backApplyInfo.getKeyWord();
// 如果关键字不为空进行过滤
if (!StringUtils.isBlank(keyWord)) {
list = list.stream()
.filter(item -> containsKeyword(item, keyWord))
.collect(Collectors.toList());
}
return list;
}
/**
* 材料员确认接口
* @param backApplyInfo
* @return
*/
@Override
public int confirmMaterial(BackApplyInfo backApplyInfo) {
return backApplyInfoMapper.updateBackApplyInfo(backApplyInfo);
}
/** /**
* 关键字搜索 * 关键字搜索

View File

@ -702,105 +702,27 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
// 获取工器具领料出库详情 // 获取工器具领料出库详情
List<MaterialLeaseApplyDetails> details = materialLeaseInfoMapper.getOutDetailsById(dto); List<MaterialLeaseApplyDetails> details = materialLeaseInfoMapper.getOutDetailsById(dto);
if (!CollectionUtils.isEmpty(details)) { if (!CollectionUtils.isEmpty(details)) {
leaseApplyRequestVo.setLeaseApplyDetailsList(details); // 步骤4.1: 收集所有typeId进行批量查询
for (MaterialLeaseApplyDetails detail : details) { List<Long> typeIds = details.stream()
.map(MaterialLeaseApplyDetails::getTypeId)
.filter(Objects::nonNull)
.distinct()
.collect(Collectors.toList());
SelectDto selectDto = new SelectDto(); SelectDto selectDto = new SelectDto();
selectDto.setProId(info.getProId()); selectDto.setProId(info.getProId());
List<AgreementVo> list = mapper.getAgreementInfoBy(selectDto); List<AgreementVo> agreementList = mapper.getAgreementInfoBy(selectDto);
// 先查第四层类型 Map<Long, BigDecimal> storageNumMap = preCalculateStorageNums(info, agreementList, typeIds);
List<TypeTreeNode> listL4 = new ArrayList<>(); for (MaterialLeaseApplyDetails detail : details) {
List<TypeTreeNode> listL5 = new ArrayList<>(); // 直接从预计算的Map中获取库存数据避免复杂的嵌套循环
List<TypeTreeNode> list7 = new ArrayList<>(); BigDecimal storageNum = storageNumMap.getOrDefault(detail.getTypeId(), BigDecimal.ZERO);
BackApplyInfo backApplyInfo = new BackApplyInfo(); detail.setStorageNum(storageNum);
if (!CollectionUtils.isEmpty(list)) {
for (AgreementVo agreementVo : list) {
backApplyInfo.setAgreementId(Long.valueOf(agreementVo.getAgreementId()));
listL4 = mapper.getUseTypeTreeL4(backApplyInfo);
if (!CollectionUtils.isEmpty(listL4)) {
listL4 = listL4.stream()
.filter(item -> StringUtils.isNotBlank(item.getMaterialName()) && StringUtils.isNotBlank(item.getTypeName()))
.collect(Collectors.toList());
// 将listL5中typeId相同的数据进行num相加
for (TypeTreeNode node : listL4) {
// 根据node中的typeId查询listL5中相同数据,如果在listL5中存在则将num相加,反之将node添加到list5中
TypeTreeNode node1 = listL5.stream()
.filter(item -> item.getTypeId() == (node.getTypeId()))
.findFirst()
.orElse(null);
if (node1 != null) {
node1.setNum(node1.getNum().add(node.getNum()));
}
if (node1 == null) {
listL5.add(node);
}
}
}
}
// 根据工程id去协议表中查询协议id
MaterialLeaseApplyInfo bean = new MaterialLeaseApplyInfo();
bean.setProId(info.getProId());
List<BmAgreementInfo> listAgreement = materialLeaseInfoMapper.getAgreementIdByProId(bean);
if (!CollectionUtils.isEmpty(listAgreement)) {
for (BmAgreementInfo agreementInfo : listAgreement) {
bean.setAgreementId(agreementInfo.getAgreementId());
List<TypeTreeNode> list6 = materialLeaseInfoMapper.getUseTypeTree(bean);
if (!CollectionUtils.isEmpty(list6)) {
for (TypeTreeNode node : list6) {
// 根据node中的typeId查询listL7中相同数据,如果在listL7中存在则将num相加,反之将node添加到list7中
TypeTreeNode node1 = list7.stream()
.filter(item -> item.getTypeId() == (node.getTypeId()))
.findFirst()
.orElse(null);
if (node1 != null) {
node1.setNum(node1.getNum().add(node.getNum()));
}
if (node1 == null) {
list7.add(node);
}
}
}
}
}
// 根据协议id去clz_slt_agreement_info材料站协议表中查询在用设备进行数据筛选去除
if (!CollectionUtils.isEmpty(listL5)) {
if (!CollectionUtils.isEmpty(list7)) {
// 将list5中typeId和list7中相同数据进行num相减并剔除相减后为0的数据
Map<Long, BigDecimal> typeIdToNum = list7.stream()
.collect(Collectors.toMap(
TypeTreeNode::getTypeId,
TypeTreeNode::getNum,
BigDecimal::add
));
Iterator<TypeTreeNode> iterator = listL5.iterator();
while (iterator.hasNext()) {
TypeTreeNode node = iterator.next();
Long typeId = node.getTypeId();
// 获取要减去的值默认值为BigDecimal.ZERO
BigDecimal subtractNum = typeIdToNum.getOrDefault(typeId, BigDecimal.ZERO);
// 计算新值处理num为null的情况若业务允许
BigDecimal currentNum = Optional.ofNullable(node.getNum())
.orElse(BigDecimal.ZERO);
BigDecimal newNum = currentNum.subtract(subtractNum);
if (newNum.compareTo(BigDecimal.ZERO) == 0) {
iterator.remove();
} else {
node.setNum(newNum);
}
}
}
// 根据details中的typeId去list5中获取库存
listL5.stream()
.filter(node -> detail.getTypeId().equals(node.getTypeId()))
.findFirst()
.ifPresent(node -> detail.setStorageNum(node.getNum()));
}
// 获取编码详情 // 获取编码详情
List<MaterialLeaseMaCodeDto> maCodeVoList = materialLeaseInfoMapper.getCodeList(dto.getId(), detail.getTypeId()); List<MaterialLeaseMaCodeDto> maCodeVoList = materialLeaseInfoMapper.getCodeList(dto.getId(), detail.getTypeId());
if (!CollectionUtils.isEmpty(maCodeVoList)) { if (!CollectionUtils.isEmpty(maCodeVoList)) {
detail.setMaCodeList(maCodeVoList); detail.setMaCodeList(maCodeVoList);
} }
} }
} leaseApplyRequestVo.setLeaseApplyDetailsList(details);
} }
}); });
return leaseApplyRequestVo; return leaseApplyRequestVo;
@ -1503,17 +1425,17 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
list.addAll(listL3); list.addAll(listL3);
list.addAll(listL21); list.addAll(listL21);
} }
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) { /*if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) {
// 创建树形结构数据集合作为参数 // 创建树形结构数据集合作为参数
TypeTreeBuild treeBuild = new TypeTreeBuild(list); TypeTreeBuild treeBuild = new TypeTreeBuild(list);
// 原查询结果转换树形结构 // 原查询结果转换树形结构
groupList = treeBuild.buildTree(); groupList = treeBuild.buildTree();
} }*/
} }
} catch (Exception e) { } catch (Exception e) {
AjaxResult.error("类型树-查询失败", e); AjaxResult.error("类型树-查询失败", e);
} }
return AjaxResult.success(groupList); return AjaxResult.success(list);
} }
/** /**

View File

@ -552,6 +552,9 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
if (teamData == null) { if (teamData == null) {
// 根据用户名查询项目部信息 // 根据用户名查询项目部信息
String departId = mapper.getDepartId(username); String departId = mapper.getDepartId(username);
if (StringUtils.isBlank(departId)) {
return new MaterialRetainedEquipmentInfo();
}
// 根据项目部id查询工程信息 // 根据项目部id查询工程信息
List<String> projectIdList = mapper.getProjectId(departId); List<String> projectIdList = mapper.getProjectId(departId);
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) { if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {

View File

@ -586,7 +586,8 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
// 领用数据 // 领用数据
List<LeaseApplyInfo> leaseApplyOutList = leaseApplyInfoMapper.selectPublish(leaseApplyInfo); List<LeaseApplyInfo> leaseApplyOutList = leaseApplyInfoMapper.selectPublish(leaseApplyInfo);
if (!CollectionUtils.isEmpty(leaseApplyOutList)) { if (!CollectionUtils.isEmpty(leaseApplyOutList)) {
for (LeaseApplyInfo applyInfo : leaseApplyOutList) { list.addAll(leaseApplyOutList);
for (LeaseApplyInfo applyInfo : list) {
// 根据id去查询出库数量 // 根据id去查询出库数量
LeaseApplyInfo outList = leaseApplyInfoMapper.getOutList(applyInfo); LeaseApplyInfo outList = leaseApplyInfoMapper.getOutList(applyInfo);
if (outList != null) { if (outList != null) {
@ -599,7 +600,6 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
applyInfo.setIsConfirm(1); applyInfo.setIsConfirm(1);
} }
} }
list.addAll(leaseApplyOutList);
} }
//材料站权限过滤 //材料站权限过滤
String username = SecurityUtils.getLoginUser().getUsername(); String username = SecurityUtils.getLoginUser().getUsername();
@ -686,7 +686,8 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
// 领用数据 // 领用数据
List<LeaseApplyInfo> leaseApplyOutList = leaseApplyInfoMapper.selectPublish(leaseApplyInfo); List<LeaseApplyInfo> leaseApplyOutList = leaseApplyInfoMapper.selectPublish(leaseApplyInfo);
if (!CollectionUtils.isEmpty(leaseApplyOutList)) { if (!CollectionUtils.isEmpty(leaseApplyOutList)) {
for (LeaseApplyInfo applyInfo : leaseApplyOutList) { list.addAll(leaseApplyOutList);
for (LeaseApplyInfo applyInfo : list) {
// 根据id去查询出库数量 // 根据id去查询出库数量
LeaseApplyInfo outList = leaseApplyInfoMapper.getOutList(applyInfo); LeaseApplyInfo outList = leaseApplyInfoMapper.getOutList(applyInfo);
if (outList != null) { if (outList != null) {
@ -699,7 +700,6 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
applyInfo.setIsConfirm(1); applyInfo.setIsConfirm(1);
} }
} }
list.addAll(leaseApplyOutList);
} }
if (leaseApplyInfo.getIsConfirm()!=null) { if (leaseApplyInfo.getIsConfirm()!=null) {

View File

@ -1,6 +1,7 @@
package com.bonus.material.lease.service.impl; package com.bonus.material.lease.service.impl;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import com.bonus.common.biz.constant.MaterialConstants; import com.bonus.common.biz.constant.MaterialConstants;
@ -517,8 +518,17 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
if (res > 0) { if (res > 0) {
// 普通机具减少 (ma_type 设备规格表)的库存数量 // 普通机具减少 (ma_type 设备规格表)的库存数量
res = typeMapper.updateMaTypeStockNum(record); res = typeMapper.updateMaTypeStockNum(record);
if (record.getMaId() != null) {
if (record.getJiJuType() == 1) {
record.setThisCheckTime(DateUtils.getNowDate());
LocalDate currentDate = LocalDate.now();
// 计算下一次检验日期当前日期加一年减一天
LocalDate nextCheckDate = currentDate.plusYears(1).minusDays(1);
record.setNextCheckTime(DateUtils.toDate(nextCheckDate));
}
// 更新 (ma_machine 设备表)的状态 // 更新 (ma_machine 设备表)的状态
machineMapper.updateMaMachineStatus(record, MaMachineStatusEnum.IN_USE.getStatus()); res = machineMapper.updateMaMachineStatus(record, MaMachineStatusEnum.IN_USE.getStatus());
}
} }
} }
return res; return res;

View File

@ -49,7 +49,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP_CONCAT(DISTINCT mt2.type_name) AS typeName, GROUP_CONCAT(DISTINCT mt2.type_name) AS typeName,
bai.`status` AS status, bai.`status` AS status,
bai.print_status as printStatus, bai.print_status as printStatus,
GROUP_CONCAT(DISTINCT mt4.type_id) as firstId GROUP_CONCAT(DISTINCT mt4.type_id) as firstId,
bp.external_id as externalId,
su.nick_name as materialMan,
bai.confirm_time as confirmTime,
bai.is_confirm as isConfirm,
bai.confirm_remark as confirmRemark,
SUM(bad.pre_num) as backNum
FROM FROM
back_apply_info bai back_apply_info bai
LEFT JOIN back_apply_details bad on bad.parent_id = bai.id LEFT JOIN back_apply_details bad on bad.parent_id = bai.id
@ -65,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id AND mt2.del_flag = '0' LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id AND mt2.del_flag = '0'
left join ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = '0' left join ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = '0'
left join ma_type mt4 ON mt3.parent_id = mt4.type_id and mt4.del_flag = '0' left join ma_type mt4 ON mt3.parent_id = mt4.type_id and mt4.del_flag = '0'
left join sys_user su on su.user_id = bai.material_man
<if test="userId != null"> <if test="userId != null">
JOIN ma_type_repair mtr ON mtr.type_id = bad.type_id AND mtr.user_id = #{userId} JOIN ma_type_repair mtr ON mtr.type_id = bad.type_id AND mtr.user_id = #{userId}
</if> </if>
@ -663,6 +670,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">`status` = #{status},</if> <if test="status != null">`status` = #{status},</if>
<if test="directId != null">direct_id = #{directId},</if> <if test="directId != null">direct_id = #{directId},</if>
<if test="printStatus != null">print_status = #{printStatus},</if> <if test="printStatus != null">print_status = #{printStatus},</if>
<if test="material_man != null and material_man != ''">material_man = #{materialMan},</if>
<if test="confirmTime != null and confirmTime != ''">confirm_time = #{confirmTime},</if>
<if test="isConfirm != null">is_confirm = #{isConfirm},</if>
<if test="confirmRemark != null and confirmRemark != ''">confirm_remark = #{confirmRemark},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

View File

@ -552,7 +552,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{typeId} #{typeId}
</foreach> </foreach>
</if> </if>
ORDER BY mt.type_id, mm.ma_code ORDER BY mt.type_id, mm.ma_id
</select> </select>
<!-- 批量查询设备是否已被领料 --> <!-- 批量查询设备是否已被领料 -->

View File

@ -89,17 +89,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
lai.id, lai.code, lai.task_id, lai.lease_person as leasePerson, lai.phone, lai.type, lai.company_audit_by, lai.id, lai.code, lai.task_id, lai.lease_person as leasePerson, lai.phone, lai.type, lai.company_audit_by,
lai.company_audit_time, lai.company_audit_remark, lai.dept_audit_by, lai.dept_audit_time, lai.company_audit_time, lai.company_audit_remark, lai.dept_audit_by, lai.dept_audit_time,
lai.dept_audit_remark, lai.direct_audit_by, lai.direct_audit_time, lai.direct_audit_remark, lai.dept_audit_remark, lai.direct_audit_by, lai.direct_audit_time, lai.direct_audit_remark,
lai.create_by, lai.create_time, lai.update_by, lai.update_time, lai.remark, lai.company_id, lai.create_by, lai.create_time as createTime, lai.update_by, lai.update_time, lai.remark, lai.company_id,
lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url, lai.lease_sign_type, lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url, lai.lease_sign_type,
lai.material_man, lai.confirm_time, lai.is_confirm, lai.confirm_remark, lai.material_man, lai.confirm_time, lai.is_confirm, lai.confirm_remark,
bai.unit_id,bai.project_id,bu.unit_name as unitName, bp.pro_name as projectName,bp.external_id as externalId, bai.agreement_code as agreementCode, tt.task_status as taskStatus, bai.unit_id,bai.project_id,bu.unit_name as unitName, bp.pro_name as projectName,bp.external_id as externalId, bai.agreement_code as agreementCode, tt.task_status as taskStatus,
sda.dict_label as taskStatusName, sda.dict_label as taskStatusName,
IFNULL(sum(lad.pre_num),0) as preCountNum, IFNULL(sum(lad.pre_num),0) as preCountNum,
IFNULL(sum(lod.out_num),0) as alNum, IFNULL(lod.num,0) as alNum,
CASE
WHEN IFNULL(sum(lad.pre_num),0) = SUM(CASE WHEN lod.is_confirm = 2 THEN lod.out_num ELSE 0 END) THEN 2
ELSE 1
END as isConfirm,
GROUP_CONCAT(DISTINCT mt1.type_name) as maTypeNames, GROUP_CONCAT(DISTINCT mt1.type_name) as maTypeNames,
bp.contract_part as contractPart, bp.contract_part as contractPart,
sd.dept_name as impUnitName, sd.dept_name as impUnitName,
@ -108,7 +104,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
lease_apply_info lai lease_apply_info lai
left join tm_task tt on lai.task_id = tt.task_id left join tm_task tt on lai.task_id = tt.task_id
left join lease_apply_details lad on lai.id = lad.parent_id left join lease_apply_details lad on lai.id = lad.parent_id
left join lease_out_details lod on lai.id = lod.parent_id LEFT JOIN (SELECT IFNULL( sum(out_num ), 0) AS num, parent_id, publish_task, is_confirm, confirm_remark, confirm_time, lease_sign_id from lease_out_details
GROUP BY parent_id) lod ON lai.id = lod.parent_id
left join tm_task_agreement tta on lai.task_id = tta.task_id left join tm_task_agreement tta on lai.task_id = tta.task_id
left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id
left join bm_unit bu on bu.unit_id = bai.unit_id left join bm_unit bu on bu.unit_id = bai.unit_id
@ -404,7 +401,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectCompleteOutList" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo"> <select id="selectCompleteOutList" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
<include refid="selectLeaseApplyInfoVoTwo"/> <include refid="selectLeaseApplyInfoVoTwo"/>
where where
lod.out_num >0 and lod.lease_sign_id is not null and bp.external_id is not null lod.num >0 and lod.lease_sign_id is not null and bp.external_id is not null
and tt.task_type = 2 and tt.task_type = 2
<if test="code != null and code != ''"> and lai.code = #{code}</if> <if test="code != null and code != ''"> and lai.code = #{code}</if>
<if test="taskId != null "> and lai.task_id = #{taskId}</if> <if test="taskId != null "> and lai.task_id = #{taskId}</if>
@ -435,7 +432,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="estimateLeaseTime != null "> and lai.estimate_lease_time = #{estimateLeaseTime}</if> <if test="estimateLeaseTime != null "> and lai.estimate_lease_time = #{estimateLeaseTime}</if>
<if test="costBearingParty != null and costBearingParty != ''"> and lai.cost_bearing_party = #{costBearingParty}</if> <if test="costBearingParty != null and costBearingParty != ''"> and lai.cost_bearing_party = #{costBearingParty}</if>
GROUP BY lai.id GROUP BY lai.id
ORDER BY tt.task_status,tt.create_time desc ORDER BY tt.task_status,lai.create_time desc
</select> </select>
<select id="checkPermission" resultType="java.lang.Integer"> <select id="checkPermission" resultType="java.lang.Integer">
SELECT COUNT(1) SELECT COUNT(1)
@ -730,7 +727,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
lod.confirm_remark AS confirmRemark, lod.confirm_remark AS confirmRemark,
mt3.type_id AS firstId, mt3.type_id AS firstId,
lpd.create_time AS releaseTime, lpd.create_time AS releaseTime,
bp.external_id as externalId bp.external_id as externalId,
lai.create_time as createTime
FROM FROM
lease_apply_info lai lease_apply_info lai
LEFT JOIN tm_task tt ON lai.task_id = tt.task_id LEFT JOIN tm_task tt ON lai.task_id = tt.task_id

View File

@ -345,6 +345,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ma_machine ma_machine
SET SET
ma_status = #{status},create_time = NOW() ma_status = #{status},create_time = NOW()
<if test="record.thisCheckTime != null">
,this_check_time = #{record.thisCheckTime}
</if>
<if test="record.nextCheckTime != null">
,next_check_time = #{record.nextCheckTime}
</if>
<where> <where>
type_id = #{record.typeId} type_id = #{record.typeId}
<if test="record.maId != null and record.maId != ''"> <if test="record.maId != null and record.maId != ''">