bug修复
This commit is contained in:
parent
05d16d109e
commit
230e2e234c
|
|
@ -535,8 +535,16 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
*/
|
||||
@Override
|
||||
public AjaxResult getDetailsReceiveList(BackApplyInfo record) {
|
||||
// 是否完成退料的标识
|
||||
Boolean isFinish = false;
|
||||
BackApplyInfo backApplyInfo = new BackApplyInfo();
|
||||
List<BackApplyInfo> backApplyInfos = backReceiveMapper.getbackReceiveList(record);
|
||||
// 根据任务id查询任务状态
|
||||
int taskStatus = backReceiveMapper.selectTaskStatus(record.getTaskId());
|
||||
// 完成退料
|
||||
if (taskStatus == 40) {
|
||||
isFinish = true;
|
||||
}
|
||||
List<TypeTreeNode> useTypeTree = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(backApplyInfos)) {
|
||||
backApplyInfos.get(0).setProjectId(Long.valueOf(backApplyInfos.get(0).getLotId()));
|
||||
|
|
@ -548,89 +556,51 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
}
|
||||
List<BackApplyInfo> backApplyInfoList = receiveView(record);
|
||||
List<String> maCodeList = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(backApplyInfoList) && !CollectionUtils.isEmpty(useTypeTree)) {
|
||||
for (TypeTreeNode typeTreeNode : useTypeTree) {
|
||||
for (BackApplyInfo applyInfo : backApplyInfoList) {
|
||||
if (String.valueOf(typeTreeNode.getTypeId()).equals(applyInfo.getModelId())) {
|
||||
BackApplyInfo dto = new BackApplyInfo();
|
||||
dto.setTypeId(String.valueOf(typeTreeNode.getTypeId()));
|
||||
dto.setParentId(backApplyInfos.get(0).getId());
|
||||
applyInfo.setUnitNames(typeTreeNode.getUnitNames());
|
||||
applyInfo.setTypeId(String.valueOf(typeTreeNode.getTypeId()));
|
||||
applyInfo.setUseNum(typeTreeNode.getNum());
|
||||
applyInfo.setBackNum(applyInfo.getPreNum());
|
||||
// 查询设备合格及维修数量及详情
|
||||
List<MaCodeDto> numList = new ArrayList<>();
|
||||
List<BackApplyInfo> hgList = backReceiveMapper.getHgList(dto);
|
||||
if (!CollectionUtils.isEmpty(hgList)) {
|
||||
if (StringUtils.isNotBlank(hgList.get(0).getMaCode())) {
|
||||
List<MaCodeDto> list = new ArrayList<>();
|
||||
applyInfo.setPassNum(hgList.size());
|
||||
for (BackApplyInfo info : hgList) {
|
||||
if (!"16".equals(info.getMaStatus())) {
|
||||
maCodeList.add(info.getMaCode());
|
||||
continue;
|
||||
}
|
||||
MaCodeDto maCodeDto = new MaCodeDto();
|
||||
maCodeDto.setMaId(info.getMaId());
|
||||
maCodeDto.setMaCode(info.getMaCode());
|
||||
maCodeDto.setMaStatus(info.getMaStatus());
|
||||
maCodeDto.setTypeId(info.getTypeId());
|
||||
maCodeDto.setMaterialType(info.getMaterialType());
|
||||
maCodeDto.setMaterialName(info.getMaterialName());
|
||||
maCodeDto.setTypeName(info.getTypeName());
|
||||
list.add(maCodeDto);
|
||||
}
|
||||
applyInfo.setPassMaCodeDtoList(list);
|
||||
numList.addAll(list);
|
||||
} else {
|
||||
applyInfo.setPassNum(hgList.get(0).getBackNum());
|
||||
}
|
||||
}
|
||||
// 查询维修数量及详情
|
||||
List<BackApplyInfo> wxList = backReceiveMapper.getWxList(dto);
|
||||
if (!CollectionUtils.isEmpty(wxList)) {
|
||||
if (StringUtils.isNotBlank(wxList.get(0).getMaCode())) {
|
||||
List<MaCodeDto> list = new ArrayList<>();
|
||||
applyInfo.setMaintenanceNum(wxList.size());
|
||||
for (BackApplyInfo info : wxList) {
|
||||
if (!"16".equals(info.getMaStatus())) {
|
||||
maCodeList.add(info.getMaCode());
|
||||
continue;
|
||||
}
|
||||
MaCodeDto maCodeDto = new MaCodeDto();
|
||||
maCodeDto.setMaId(info.getMaId());
|
||||
maCodeDto.setMaCode(info.getMaCode());
|
||||
maCodeDto.setMaStatus(info.getMaStatus());
|
||||
maCodeDto.setTypeId(info.getTypeId());
|
||||
maCodeDto.setMaterialType(info.getMaterialType());
|
||||
maCodeDto.setMaterialName(info.getMaterialName());
|
||||
maCodeDto.setTypeName(info.getTypeName());
|
||||
list.add(maCodeDto);
|
||||
}
|
||||
applyInfo.setRepairMaCodeDtoList(list);
|
||||
numList.addAll(list);
|
||||
} else {
|
||||
applyInfo.setMaintenanceNum(wxList.get(0).getBackNum());
|
||||
}
|
||||
}
|
||||
// 查询是否存在附件
|
||||
dto.setDicId(36L);
|
||||
List<FileInfo> fileInfoList = backReceiveMapper.selectFileInfoList(dto);
|
||||
if (!CollectionUtils.isEmpty(fileInfoList)) {
|
||||
applyInfo.setFileList(fileInfoList);
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(numList)) {
|
||||
applyInfo.setNumList(numList);
|
||||
if (!CollectionUtils.isEmpty(backApplyInfoList)) {
|
||||
for (BackApplyInfo applyInfo : backApplyInfoList) {
|
||||
boolean foundMatch = false;
|
||||
BackApplyInfo dto = new BackApplyInfo();
|
||||
if (!CollectionUtils.isEmpty(useTypeTree)) {
|
||||
for (TypeTreeNode typeTreeNode : useTypeTree) {
|
||||
if (String.valueOf(typeTreeNode.getTypeId()).equals(applyInfo.getModelId())) {
|
||||
dto.setTypeId(String.valueOf(typeTreeNode.getTypeId()));
|
||||
dto.setParentId(backApplyInfos.get(0).getId());
|
||||
applyInfo.setUnitNames(typeTreeNode.getUnitNames());
|
||||
applyInfo.setTypeId(String.valueOf(typeTreeNode.getTypeId()));
|
||||
applyInfo.setUseNum(typeTreeNode.getNum());
|
||||
applyInfo.setBackNum(applyInfo.getPreNum());
|
||||
foundMatch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!foundMatch) {
|
||||
dto.setTypeId(applyInfo.getModelId());
|
||||
dto.setParentId(backApplyInfos.get(0).getId());
|
||||
applyInfo.setUnitNames(StringUtils.isNotBlank(applyInfo.getUnitName()) ? applyInfo.getUnitName() : " ");
|
||||
applyInfo.setTypeId(applyInfo.getModelId());
|
||||
applyInfo.setUseNum("0");
|
||||
applyInfo.setBackNum(applyInfo.getPreNum());
|
||||
}
|
||||
// 查询设备合格及维修数量及详情
|
||||
List<MaCodeDto> numList = getHgMaCodeDtos(isFinish, maCodeList, applyInfo, dto);
|
||||
// 查询维修数量及详情
|
||||
getWxMaCodeDtos(isFinish, maCodeList, applyInfo, dto, numList);
|
||||
// 查询是否存在附件
|
||||
dto.setDicId(36L);
|
||||
List<FileInfo> fileInfoList = backReceiveMapper.selectFileInfoList(dto);
|
||||
if (!CollectionUtils.isEmpty(fileInfoList)) {
|
||||
applyInfo.setFileList(fileInfoList);
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(numList)) {
|
||||
applyInfo.setNumList(numList);
|
||||
}
|
||||
}
|
||||
backApplyInfo.setBackApplyDetails(backApplyInfoList);
|
||||
}
|
||||
backApplyInfo.setBackApplyDetails(backApplyInfoList);
|
||||
AjaxResult ajaxResult = AjaxResult.success();
|
||||
ajaxResult.put("data", backApplyInfo);
|
||||
if (!CollectionUtils.isEmpty(maCodeList)) {
|
||||
ajaxResult.put("data",backApplyInfo);
|
||||
if(!CollectionUtils.isEmpty(maCodeList)) {
|
||||
// 拼接消息内容
|
||||
StringBuffer msgBuilder = new StringBuffer("您所选择的编码设备编号 +");
|
||||
for (int i = 0; i < maCodeList.size(); i++) {
|
||||
|
|
@ -642,12 +612,85 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
}
|
||||
msgBuilder.append("+已被他人完成退料,请注意查看!");
|
||||
String msg = msgBuilder.toString();
|
||||
msg = msg.replaceAll("\n","");
|
||||
msg = msg.replaceAll("\n", "");
|
||||
ajaxResult.put("msg", msg);
|
||||
}
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
private void getWxMaCodeDtos(Boolean isFinish, List<String> maCodeList, BackApplyInfo applyInfo, BackApplyInfo dto, List<MaCodeDto> numList) {
|
||||
List<BackApplyInfo> wxList = backReceiveMapper.getWxList(dto);
|
||||
if (!CollectionUtils.isEmpty(wxList)) {
|
||||
if (StringUtils.isNotBlank(wxList.get(0).getMaCode())) {
|
||||
List<MaCodeDto> list = new ArrayList<>();
|
||||
applyInfo.setMaintenanceNum(wxList.size());
|
||||
for (BackApplyInfo info : wxList) {
|
||||
if (!isFinish) {
|
||||
if (!"16".equals(info.getMaStatus())) {
|
||||
maCodeList.add(info.getMaCode());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
MaCodeDto maCodeDto = new MaCodeDto();
|
||||
maCodeDto.setMaId(info.getMaId());
|
||||
maCodeDto.setMaCode(info.getMaCode());
|
||||
maCodeDto.setMaStatus(info.getMaStatus());
|
||||
maCodeDto.setTypeId(info.getTypeId());
|
||||
maCodeDto.setMaterialType(info.getMaterialType());
|
||||
maCodeDto.setMaterialName(info.getMaterialName());
|
||||
maCodeDto.setTypeName(info.getTypeName());
|
||||
list.add(maCodeDto);
|
||||
}
|
||||
applyInfo.setRepairMaCodeDtoList(list);
|
||||
numList.addAll(list);
|
||||
} else {
|
||||
applyInfo.setMaintenanceNum(wxList.get(0).getBackNum());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取合格退料详情数据
|
||||
* @param isFinish
|
||||
* @param maCodeList
|
||||
* @param applyInfo
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
private List<MaCodeDto> getHgMaCodeDtos(Boolean isFinish, List<String> maCodeList, BackApplyInfo applyInfo, BackApplyInfo dto) {
|
||||
List<MaCodeDto> numList = new ArrayList<>();
|
||||
List<BackApplyInfo> hgList = backReceiveMapper.getHgList(dto);
|
||||
if (!CollectionUtils.isEmpty(hgList)) {
|
||||
if (StringUtils.isNotBlank(hgList.get(0).getMaCode())) {
|
||||
List<MaCodeDto> list = new ArrayList<>();
|
||||
applyInfo.setPassNum(hgList.size());
|
||||
for (BackApplyInfo info : hgList) {
|
||||
if (!isFinish) {
|
||||
if (!"16".equals(info.getMaStatus())) {
|
||||
maCodeList.add(info.getMaCode());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
MaCodeDto maCodeDto = new MaCodeDto();
|
||||
maCodeDto.setMaId(info.getMaId());
|
||||
maCodeDto.setMaCode(info.getMaCode());
|
||||
maCodeDto.setMaStatus(info.getMaStatus());
|
||||
maCodeDto.setTypeId(info.getTypeId());
|
||||
maCodeDto.setMaterialType(info.getMaterialType());
|
||||
maCodeDto.setMaterialName(info.getMaterialName());
|
||||
maCodeDto.setTypeName(info.getTypeName());
|
||||
list.add(maCodeDto);
|
||||
}
|
||||
applyInfo.setPassMaCodeDtoList(list);
|
||||
numList.addAll(list);
|
||||
} else {
|
||||
applyInfo.setPassNum(hgList.get(0).getBackNum());
|
||||
}
|
||||
}
|
||||
return numList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getPreAuditNum(BackApplyInfo record) {
|
||||
return backApplyMapper.getPreAuditNum(record);
|
||||
|
|
|
|||
|
|
@ -910,7 +910,7 @@
|
|||
WHERE
|
||||
bcd.parent_id=#{parentId}
|
||||
and bcd.type_id=#{typeId}
|
||||
and bcd.back_status='1' and (bcd.is_finished is null or bcd.is_finished != 1)
|
||||
and bcd.back_status='1'
|
||||
</select>
|
||||
|
||||
<select id="getWxList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
|
|
@ -944,7 +944,7 @@
|
|||
WHERE
|
||||
bcd.parent_id=#{parentId}
|
||||
and bcd.type_id=#{typeId}
|
||||
and bcd.back_status='2' and (bcd.is_finished is null or bcd.is_finished != 1)
|
||||
and bcd.back_status='2'
|
||||
</select>
|
||||
|
||||
<select id="getBfList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
|
|
|
|||
Loading…
Reference in New Issue