领料管理页面展示bug

This commit is contained in:
liang.chao 2024-04-17 10:26:01 +08:00
parent 9deec6f550
commit 9a7e4f0dc2
7 changed files with 69 additions and 19 deletions

View File

@ -8,6 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* Description:
@ -58,6 +59,8 @@ public class LeaseApplyDetails implements Serializable {
@ApiModelProperty(value = "预领料数")
private Double preNum;
private List<MachinePart> maTypeDetails;
/**
* 已领数量
*/

View File

@ -0,0 +1,15 @@
package com.bonus.sgzb.app.domain;
import lombok.Data;
/**
* @Author梁超
* @date2024/4/17 - 9:04
*/
@Data
public class MachinePart {
private String typeModelName;
private String unitName;
private String typeName;
private Integer partNum;
}

View File

@ -257,6 +257,7 @@ public class TmTask implements Serializable {
private String maId;
private String maStatus;
private String typeId;
private Integer partNum;
@ApiModelProperty(value = "预计领料时间(重庆)")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

View File

@ -2,6 +2,7 @@ package com.bonus.sgzb.app.mapper;
import com.bonus.sgzb.app.domain.LeaseApplyDetails;
import com.bonus.sgzb.app.domain.LeaseApplyInfo;
import com.bonus.sgzb.app.domain.MachinePart;
import com.bonus.sgzb.app.domain.TmTask;
import com.bonus.sgzb.base.domain.MaintenanceGang;
import org.apache.ibatis.annotations.Mapper;
@ -115,5 +116,7 @@ public interface TmTaskMapper {
List<TmTask> getLeaseDetailByParentId(TmTask record);
List<TmTask> getMaTypeDetails(List<LeaseApplyDetails> leaseApplyDetails);
List<TmTask> getMaTypeDetails(LeaseApplyDetails leaseApplyDetails);
MachinePart getMachineParts(TmTask typeId);
}

View File

@ -3,6 +3,7 @@ package com.bonus.sgzb.app.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.bonus.sgzb.app.domain.LeaseApplyDetails;
import com.bonus.sgzb.app.domain.LeaseApplyInfo;
import com.bonus.sgzb.app.domain.MachinePart;
import com.bonus.sgzb.app.domain.TmTask;
import com.bonus.sgzb.app.mapper.LeaseApplyDetailsMapper;
import com.bonus.sgzb.app.mapper.LeaseApplyInfoMapper;
@ -546,7 +547,16 @@ public class TmTaskServiceImpl implements TmTaskService {
// 去查询领料任务详情表
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyDetailsCq(leaseApplyInfo);
if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) {
// tmTaskMapper.getMaTypeDetails(leaseApplyDetails);
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
List<MachinePart> machineParts = new ArrayList<>();
List<TmTask> typeIds = tmTaskMapper.getMaTypeDetails(leaseApplyDetail);
for (TmTask typeId : typeIds) {
MachinePart machinePart = tmTaskMapper.getMachineParts(typeId);
machinePart.setPartNum(typeId.getPartNum());
machineParts.add(machinePart);
}
leaseApplyDetail.setMaTypeDetails(machineParts);
}
listLeaseDetails.addAll(leaseApplyDetails);
}
}
@ -618,13 +628,13 @@ public class TmTaskServiceImpl implements TmTaskService {
// 去查询任务分单表
List<LeaseApplyInfo> collect = tmTaskMapper.getAuditManageListByLeaseInfo(tmTask);
//没有companyId的用户可以看到所有数据
if (companyId == null) {
if (companyId == null || roles.contains("fgs")) {
// 对领料任务集合查询具体详情
for (LeaseApplyInfo leaseApplyInfo : collect) {
if (leaseApplyInfo != null) {
// 去查询领料任务详情表
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyManageDetails(leaseApplyInfo);
if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) {
if (leaseApplyDetails.size() > 0) {
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
if (leaseApplyDetail != null && leaseApplyDetail.getPreNum() != null) {
// 统计预领数量
@ -633,13 +643,13 @@ public class TmTaskServiceImpl implements TmTaskService {
}
// 塞入领料任务详情的集合中
leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
}
}
}
// 存入领料任务实体集合
tmTask.setLeaseApplyInfoList(collect);
tmTask.setRemark(collect.get(0).getRemark());
}
}
}
}
//施管部只能看到机具分公司101的数据
if ((roles.contains("jjfgs") || roles.contains("sgb")) && companyId != null) {
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() == companyId.intValue()).collect(Collectors.toList());
@ -649,7 +659,7 @@ public class TmTaskServiceImpl implements TmTaskService {
if (leaseApplyInfo != null) {
// 去查询领料任务详情表
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyManageDetails(leaseApplyInfo);
if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) {
if (leaseApplyDetails.size() > 0) {
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
if (leaseApplyDetail != null && leaseApplyDetail.getPreNum() != null) {
// 统计预领数量
@ -658,14 +668,14 @@ public class TmTaskServiceImpl implements TmTaskService {
}
// 塞入领料任务详情的集合中
leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
}
}
}
// 存入领料任务实体集合
tmTask.setLeaseApplyInfoList(auditListByLeaseInfo);
tmTask.setRemark(collect.get(0).getRemark());
}
}
}
}
}
//安监部只能看到设备分公司102的数据
if ((roles.contains("tsfgs") || roles.contains("ajb")) && companyId != null) {
List<LeaseApplyInfo> auditListByLeaseInfo = collect.stream().filter(t -> t.getCompanyId() == companyId.intValue()).collect(Collectors.toList());
@ -675,7 +685,7 @@ public class TmTaskServiceImpl implements TmTaskService {
if (leaseApplyInfo != null) {
// 去查询领料任务详情表
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyManageDetails(leaseApplyInfo);
if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) {
if (leaseApplyDetails.size() > 0) {
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
if (leaseApplyDetail != null) {
// 统计预领数量
@ -684,14 +694,14 @@ public class TmTaskServiceImpl implements TmTaskService {
}
// 塞入领料任务详情的集合中
leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
}
}
}
// 存入领料任务实体集合
tmTask.setLeaseApplyInfoList(auditListByLeaseInfo);
tmTask.setRemark(collect.get(0).getRemark());
}
}
}
}
}
// 塞入预领的合计数量
tmTask.setPreCountNum(count);
}

View File

@ -968,9 +968,24 @@
</if>
</select>
<select id="getMaTypeDetails" resultType="com.bonus.sgzb.app.domain.TmTask">
select mt2.type_name as typeName,
mt.type_name as typeModelName
from ma_type mt on lad.type_id = mt.type_id
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
SELECT
mws2.type_id AS typeId,
mws2.part_num AS partNum
FROM
ma_type mt1
LEFT JOIN ma_whole_set mws2 ON mt1.type_id = mws2.parent_id
WHERE
mt1.type_id = #{typeId}
</select>
<select id="getMachineParts" resultType="com.bonus.sgzb.app.domain.MachinePart">
SELECT
mt.type_name AS typeModelName,
mt.unit_name as unitName,
m2.type_name As typeName
FROM
ma_type mt
LEFT JOIN ma_type m2 ON mt.parent_id = m2.type_id
WHERE
mt.type_id = #{typeId}
</select>
</mapper>

View File

@ -12,6 +12,7 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.material.domain.BackApplyInfo;
import com.bonus.sgzb.material.service.BackApplyService;
import io.swagger.annotations.Api;
@ -168,6 +169,7 @@ public class BackApplyController extends BaseController {
bean.setCode(code);
bean.setTaskType(36);
bean.setTaskStatus("37");
bean.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
// 创建任务
boolean addTaskResult = backApplyService.insertSelective(bean) > 0;
if (addTaskResult && bean.getTaskId() != null) {
@ -255,6 +257,7 @@ public class BackApplyController extends BaseController {
bean.setCode(code);
bean.setTaskType(36);
bean.setTaskStatus("38");
bean.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
// 创建任务
boolean addTaskResult = backApplyService.insertSelective(bean) > 0;
if (addTaskResult && bean.getTaskId() != null) {