退料问题,竣工问题,盘点问题修复
This commit is contained in:
parent
5c540d2cf1
commit
cf8b5f8204
|
|
@ -225,6 +225,18 @@ public class BackApplyInfoController extends BaseController {
|
|||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据typeId查询领料机具列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "根据typeId查询领料机具列表")
|
||||
@GetMapping("/selectMachineByIdListQrScan")
|
||||
public AjaxResult selectMachineByIdListQrScan(BackApplyInfo dto){
|
||||
List<MaCodeVo> list = backApplyInfoService.selectMachineByIdList(dto);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* app根据设备编码去检索领料详情
|
||||
* @param dto
|
||||
|
|
|
|||
|
|
@ -52,4 +52,10 @@ public class SampleSync extends BaseEntity
|
|||
private String typeNameCode;
|
||||
|
||||
private int parentId;
|
||||
|
||||
//机具名称
|
||||
private String modelName ;
|
||||
|
||||
//规格型号
|
||||
private String typeName ;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ public class MachineServiceImpl implements IMachineService
|
|||
List<SampleSync> notExistList = new ArrayList<>();
|
||||
List<SampleSync> successList = new ArrayList<>(); // 原sueecssList修正拼写
|
||||
List<SampleSync> exceptionList = new ArrayList<>(); // 新增异常列表
|
||||
|
||||
List<SampleSync> noSuccessList = new ArrayList<>();
|
||||
//2.构建bigList的typeNameCode映射表(优化查询效率)
|
||||
Map<String, List<SampleSync>> typeNameCodeMap = new HashMap<>();
|
||||
for (SampleSync bigItem : bigList) {
|
||||
|
|
@ -357,76 +357,53 @@ public class MachineServiceImpl implements IMachineService
|
|||
List<SampleSync> matchedBigItems = typeNameCodeMap.getOrDefault(sampleTypeNameCode, Collections.emptyList());
|
||||
|
||||
if (matchedBigItems.isEmpty()) {
|
||||
//无匹配项
|
||||
// 无匹配项
|
||||
sample.setResult("未发现该机具");
|
||||
sample.setIsSuccess(0);
|
||||
notExistList.add(sample);
|
||||
} else if (matchedBigItems.size() > 1) {
|
||||
//匹配超过1个,存入异常列表
|
||||
// 匹配超过1个,存入异常列表
|
||||
sample.setResult("该机具编码重复");
|
||||
sample.setIsSuccess(0);
|
||||
exceptionList.add(sample);
|
||||
} else {
|
||||
//仅匹配1个,检查maStatus
|
||||
// 仅匹配1个,提取公共属性设置
|
||||
SampleSync matchedItem = matchedBigItems.get(0);
|
||||
sample.setModelName(matchedItem.getModelName());
|
||||
sample.setTypeName(matchedItem.getTypeName());
|
||||
Integer maStatus = matchedItem.getMaStatus();
|
||||
|
||||
if (maStatus != null) {
|
||||
// 根据现有业务逻辑,6/7/8/10代表"报废",18代表"丢失"
|
||||
// 预计算"不合格"状态
|
||||
boolean isUnqualified = "不合格".equals(sample.getResult());
|
||||
|
||||
if (isUnqualified) {
|
||||
// 优先处理不合格状态,减少嵌套判断
|
||||
sample.setResult("不合格");
|
||||
sample.setIsSuccess(0);
|
||||
noSuccessList.add(sample);
|
||||
} else if (maStatus != null) {
|
||||
sample.setIsSuccess(0);
|
||||
// 根据maStatus分类
|
||||
if (maStatus == 6 || maStatus == 7 || maStatus == 8 || maStatus == 10) {
|
||||
sample.setResult("该机具已报废");
|
||||
sample.setIsSuccess(0);
|
||||
scrapList.add(sample);
|
||||
} else if (maStatus == 18) {
|
||||
sample.setResult("该机具已丢失");
|
||||
sample.setIsSuccess(0);
|
||||
lostList.add(sample);
|
||||
} else {
|
||||
// 非报废/丢失状态,标记为成功
|
||||
sample.setIsSuccess(1);
|
||||
// 非报废/丢失状态,暂存入成功列表(可根据实际业务调整)
|
||||
successList.add(sample);
|
||||
}
|
||||
} else {
|
||||
// maStatus为空,视为未匹配
|
||||
sample.setResult("未发现该机具");
|
||||
sample.setIsSuccess(0);
|
||||
notExistList.add(sample);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// //丢失、报废、不存在的编号都为异常,不合格
|
||||
// //1.查询过滤出来报废的机具编码
|
||||
// List lostList = new ArrayList<>();
|
||||
// List scrapList = new ArrayList<>();
|
||||
// List notExistList = new ArrayList<>();
|
||||
// List sueecssList = new ArrayList<>();
|
||||
// SampleSync sampleOne = new SampleSync();
|
||||
// for (int i = 0; i < samples.size(); i++) {
|
||||
// sampleOne = machineMapper.getSampleList(samples.get(i));
|
||||
// if(sampleOne != null && (sampleOne.getMaStatus() == 6 || sampleOne.getMaStatus() == 7 || sampleOne.getMaStatus() == 8 || sampleOne.getMaStatus() == 10)){
|
||||
// samples.get(i).setResult("该机具已报废");
|
||||
// samples.get(i).setIsSuccess(0);
|
||||
// scrapList.add(samples.get(i));
|
||||
// }else if(sampleOne != null && sampleOne.getMaStatus() == 18){
|
||||
// samples.get(i).setResult("该机具已报废");
|
||||
// samples.get(i).setIsSuccess(0);
|
||||
// scrapList.add(samples.get(i));
|
||||
// }else if(sampleOne != null){
|
||||
// samples.get(i).setIsSuccess(1);
|
||||
// sueecssList.add(samples.get(i));
|
||||
// }else{
|
||||
// samples.get(i).setResult("未发现该机具");
|
||||
// samples.get(i).setIsSuccess(0);
|
||||
// notExistList.add(samples.get(i));
|
||||
// }
|
||||
// }
|
||||
//对数据进行汇总
|
||||
List<SampleSync> allList = new ArrayList<>();
|
||||
allList.addAll(lostList);
|
||||
|
|
@ -434,7 +411,7 @@ public class MachineServiceImpl implements IMachineService
|
|||
allList.addAll(notExistList);
|
||||
allList.addAll(successList);
|
||||
allList.addAll(exceptionList);
|
||||
|
||||
allList.addAll(noSuccessList);
|
||||
|
||||
// 使用批量更新
|
||||
if(successList != null && !successList.isEmpty()){
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class WarehousingServiceImpl implements WarehousingService {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult savePutInfo(SavePutInfoDto dto) {
|
||||
log.info("新增入库盘点入参dto:{}", dto);
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
|
|
@ -136,8 +136,8 @@ public class WarehousingServiceImpl implements WarehousingService {
|
|||
|
||||
} catch (Exception e) {
|
||||
log.error("保存入库盘点异常:{}",e.getMessage());
|
||||
// 添加事务回滚逻辑,保证入库全部成功或者全部失败
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
// // 添加事务回滚逻辑,保证入库全部成功或者全部失败
|
||||
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error(ExceptionEnum.SAVE_TO_DATABASE.getCode(), ExceptionEnum.SAVE_TO_DATABASE.getMsg());
|
||||
}
|
||||
return AjaxResult.success(res);
|
||||
|
|
|
|||
|
|
@ -1085,20 +1085,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
<select id="selectSynchDetailList" resultType="com.bonus.material.ma.domain.MachineSynch">
|
||||
select
|
||||
mcd.ma_code as maCode,
|
||||
mcd.check_man as checkMan,
|
||||
DATE_FORMAT(mcd.this_check_time, '%Y-%m-%d') as checkTimeSynch,
|
||||
DATE_FORMAT(mcd.next_check_time, '%Y-%m-%d') as nextCheckTimeSynch,
|
||||
mcd.is_success as isSuccess,
|
||||
mcd.reason as result,
|
||||
mcd.ex_code as reportNum,
|
||||
mt.type_id as typeId,
|
||||
mt2.type_name as typeModelName,
|
||||
mt.type_name as typeName
|
||||
mcd.ma_code as maCode,
|
||||
mcd.check_man as checkMan,
|
||||
DATE_FORMAT(mcd.this_check_time, '%Y-%m-%d') as checkTimeSynch,
|
||||
DATE_FORMAT(mcd.next_check_time, '%Y-%m-%d') as nextCheckTimeSynch,
|
||||
mcd.is_success as isSuccess,
|
||||
mcd.reason as result,
|
||||
mcd.ex_code as reportNum,
|
||||
mcd.model_name as typeModelName,
|
||||
mcd.type_name as typeName
|
||||
from ma_check_details mcd
|
||||
left join ma_machine mm on mcd.ma_code = mm.ma_code
|
||||
left join ma_type mt on mm.type_id = mt.type_id
|
||||
left join ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
where
|
||||
mcd.parent_id = #{parentId}
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
|
|
@ -1106,8 +1102,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mcd.ma_code like concat('%', #{keyWord}, '%')
|
||||
or mcd.reason like concat('%', #{keyWord}, '%')
|
||||
or mcd.ex_code like concat('%', #{keyWord}, '%')
|
||||
or mt2.type_name like concat('%', #{keyWord}, '%')
|
||||
or mt.type_name like concat('%', #{keyWord}, '%')
|
||||
or mcd.model_name like concat('%', #{keyWord}, '%')
|
||||
or mcd.type_name like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
|
@ -1134,6 +1130,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getBigList" resultType="com.bonus.material.ma.domain.vo.SampleSync">
|
||||
select
|
||||
CONCAT_WS('-', mt2.type_name, mm.ma_code) as typeNameCode,
|
||||
mt2.type_name as modelName,
|
||||
mt.type_name as typeName,
|
||||
mm.ma_code as maCode,
|
||||
mm.ma_status as maStatus
|
||||
from ma_machine mm
|
||||
|
|
@ -1152,7 +1150,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
is_success,
|
||||
reason,
|
||||
ex_code,
|
||||
type_name
|
||||
type_name,
|
||||
model_name
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
|
|
@ -1165,6 +1164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item.isSuccess},
|
||||
#{item.result},
|
||||
#{item.reportNum},
|
||||
#{item.typeName},
|
||||
#{item.sampleName}
|
||||
)
|
||||
</foreach>
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join sys_dept sd on bp.imp_unit = sd.dept_id
|
||||
left join ma_type mt on sai.type_id = mt.type_id
|
||||
left join ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
where sai.status = 0 and bp.actual_end_date is not null and bp.actual_end_date is not null and bp.pro_center is not null
|
||||
where sai.status = 0 and sai.is_slt = 0 and sai.end_time is null and bp.actual_end_date is not null and bp.pro_center is not null
|
||||
and mt.jiju_type = 1
|
||||
and mt2.is_statics != 1
|
||||
<if test="deptId != null">
|
||||
|
|
|
|||
Loading…
Reference in New Issue