| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | |
| | |
| | | this.repairInfoDao = repairInfoDao; |
| | | } |
| | | |
| | | @Transactional |
| | | public int save(QueryVo params) { |
| | | long workId = Long.parseLong(params.workId); |
| | | StaAssemblyWorkLast workLast = assemblyWorkLastDao.selectByPrimaryKey(workId); |
| | | if (workLast == null) { |
| | | throw new RuntimeException("系统中没有该条登录信息");//工单不存在 |
| | | } |
| | | //fancy 2024/6/27 是不是可以不用检查任务与设备码... |
| | | PrAssemblyPlan plan = assemblyPlanDao.selectByPrimaryKey(workLast.getPlanId()); |
| | | // 验证并处理设备号和物料号 |
| | | Set<String> deviceSet = new HashSet<>(Arrays.asList(params.deviceNo.split(","))); |
| | |
| | | record.status = getStatus(params.status,node.isEnd); |
| | | return record; |
| | | } |
| | | private int saveSnEx(StaAssemblyWorkLast workLast, List<String> deviceList,List<String> materialList, PrAssemblyPlan plan){ |
| | | private void saveSnEx(StaAssemblyWorkLast workLast, List<String> deviceList,List<String> materialList, PrAssemblyPlan plan){ |
| | | for (String material:materialList) { |
| | | StaWipSnEx snEx = new StaWipSnEx(); |
| | | snEx.deviceNo = deviceList.get(0); |
| | | snEx.productNo = plan.batchNo; |
| | | snEx.deviceNo = materialList.get(0); |
| | | snEx.productId = plan.process.proId; |
| | | snEx.productNo = material; |
| | | snEx.createTime = workLast.startTime; |
| | | snEx.createBy = workLast.userId; |
| | | snEx.productName = plan.proName; |
| | | return wipSnExDao.insertSelective(snEx); |
| | | wipSnExDao.insertSelective(snEx); |
| | | } |
| | | } |
| | | /** |
| | | * 状态: 1:组装中,2:完成,3:维修,4:报废 |