机具编码入库逻辑修改
This commit is contained in:
parent
be12de782c
commit
fc17702ea5
|
|
@ -262,4 +262,6 @@ public interface PurchaseMacodeInfoMapper {
|
|||
* @return List<PurchaseMacodeInfo>
|
||||
*/
|
||||
List<PurchaseMacodeInfo> warehousingEntry(PurchaseMacodeInfo purchaseMacodeInfo);
|
||||
|
||||
List<PurchaseMacodeInfo> selectPutinDetailsAddTypeId(PurchaseMacodeInfo purchaseMacodeInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -270,31 +270,26 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
*/
|
||||
@Override
|
||||
public int modifyManageStatus(MaInputVO maInputVO) {
|
||||
if (maInputVO.getInputRecordList().get(0) != null && maInputVO.getInputRecordList().get(0).getTaskId() != null) {
|
||||
Long taskId = maInputVO.getInputRecordList().get(0).getTaskId();
|
||||
Long taskId = maInputVO.getTaskId();
|
||||
String checkResult = maInputVO.getCheckResult();
|
||||
List<MaInputRecord> inputRecordList = maInputVO.getInputRecordList();
|
||||
for (MaInputRecord maInputRecord : inputRecordList) {
|
||||
PurchaseMacodeInfo purchaseMacodeInfo = new PurchaseMacodeInfo();
|
||||
purchaseMacodeInfo.setTaskId(taskId);
|
||||
List<PurchaseMacodeInfo> purchaseMacodeInfos = selectPutinDetails(purchaseMacodeInfo);
|
||||
Long typeId = maInputRecord.getTypeId();
|
||||
purchaseMacodeInfo.setTypeId(typeId);
|
||||
List<PurchaseMacodeInfo> purchaseMacodeInfos = selectPutinDetailsAddTypeId(purchaseMacodeInfo);
|
||||
for (PurchaseMacodeInfo macodeInfo : purchaseMacodeInfos) {
|
||||
if (macodeInfo.getMaCode() == null) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Long taskId = maInputVO.getTaskId();
|
||||
String checkResult = maInputVO.getCheckResult();
|
||||
List<MaInputRecord> inputRecordList = maInputVO.getInputRecordList();
|
||||
for (MaInputRecord maInputRecord : inputRecordList) {
|
||||
Long typeId = maInputRecord.getTypeId();
|
||||
// 修改机具入库状态
|
||||
MaMachine maMachine = new MaMachine();
|
||||
maMachine.setMaId(maInputRecord.getMaId());
|
||||
maMachine.setMaCode(maInputRecord.getMaCode());
|
||||
|
||||
//修改编码管理表入库状态
|
||||
PurchaseMacodeInfo purchaseMacodeInfo = new PurchaseMacodeInfo();
|
||||
purchaseMacodeInfo.setTaskId(taskId);
|
||||
purchaseMacodeInfo.setTypeId(typeId);
|
||||
purchaseMacodeInfo.setMaCode(maInputRecord.getMaCode());
|
||||
|
||||
// 修改验收任务详细表入库数量
|
||||
|
|
@ -364,6 +359,10 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
return 1;
|
||||
}
|
||||
|
||||
private List<PurchaseMacodeInfo> selectPutinDetailsAddTypeId(PurchaseMacodeInfo purchaseMacodeInfo) {
|
||||
return purchaseMacodeInfoMapper.selectPutinDetailsAddTypeId(purchaseMacodeInfo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据机具编码删除编码
|
||||
|
|
|
|||
|
|
@ -446,6 +446,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
`status` != 0
|
||||
AND `status` !=2
|
||||
</select>
|
||||
<select id="selectPutinDetailsAddTypeId" resultType="com.bonus.sgzb.material.domain.PurchaseMacodeInfo">
|
||||
select pcd.production_time productionTime,
|
||||
mt.type_name specificationType,
|
||||
mt1.type_name typeName,
|
||||
pmi.ma_code maCode,
|
||||
mm.assets_code assetsCode,
|
||||
pmi.fix_code fixCode,
|
||||
pcd.type_id typeId,
|
||||
pcd.task_id taskId,
|
||||
mt.code specsCode,
|
||||
mt1.code typeCode,
|
||||
CASE
|
||||
WHEN pmi.ma_code is null THEN
|
||||
CASE
|
||||
WHEN pcd.status = 4 THEN 1
|
||||
WHEN pcd.status = 5 THEN 2
|
||||
ELSE 0
|
||||
END
|
||||
ELSE pmi.status
|
||||
END AS status,
|
||||
mm.qr_code qrCode,
|
||||
mm.ma_id maId,
|
||||
if(pmi.ma_code is not null, 1, pcd.check_num) checkNum
|
||||
from purchase_check_details pcd
|
||||
left join purchase_macode_info pmi on pmi.task_id = pcd.task_id and pmi.type_id = pcd.type_id
|
||||
left join ma_machine mm on pmi.ma_code = mm.ma_code
|
||||
left join ma_type mt on pcd.type_id = mt.type_id
|
||||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
where pcd.task_id = #{taskId} and mt.type_id #{typeId}
|
||||
and pcd.`status`!=3 and pcd.`status`!=7
|
||||
|
||||
order by status
|
||||
</select>
|
||||
|
||||
<update id="updateTypeByTypeId">
|
||||
update ma_type set num = #{num} where type_id = #{typeId}
|
||||
|
|
|
|||
Loading…
Reference in New Issue