|
|
|
|
@ -44,10 +44,7 @@ import org.springblade.desk.produce.pojo.dto.MesRbRedoRoutDTO; |
|
|
|
|
import org.springblade.desk.produce.pojo.dto.PrMacTooUseSpec; |
|
|
|
|
import org.springblade.desk.produce.pojo.dto.ShiftTransferDTO; |
|
|
|
|
import org.springblade.desk.produce.pojo.entity.*; |
|
|
|
|
import org.springblade.desk.produce.pojo.vo.MacToolUseVO; |
|
|
|
|
import org.springblade.desk.produce.pojo.vo.SjEcBingCardVo; |
|
|
|
|
import org.springblade.desk.produce.pojo.vo.UnBingDeviceVo; |
|
|
|
|
import org.springblade.desk.produce.pojo.vo.UnBingVo; |
|
|
|
|
import org.springblade.desk.produce.pojo.vo.*; |
|
|
|
|
import org.springblade.desk.produce.service.*; |
|
|
|
|
import org.springblade.desk.quality.pojo.entity.InspectionTask; |
|
|
|
|
import org.springblade.desk.quality.pojo.entity.ReviewSheet; |
|
|
|
|
@ -57,6 +54,7 @@ import org.springblade.erpdata.feign.IErpDataProduceClient; |
|
|
|
|
import org.springblade.erpdata.pojo.vo.PpmReportDetailModelVO; |
|
|
|
|
import org.springblade.system.feign.IUserClient; |
|
|
|
|
import org.springblade.system.pojo.entity.User; |
|
|
|
|
import org.springblade.wms.pojo.entity.StClassRequest; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
@ -967,4 +965,89 @@ public class PdaSaveServiceImpl extends BaseServiceImpl<WorkPlanMapper, WorkPlan |
|
|
|
|
epDosingRec.setHandleResult(Long.valueOf(BsDosingRecEntity.HANDLE_RESULT_PDA)); |
|
|
|
|
bsDosingRecService.updateById(epDosingRec); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void saveSubOrder(SaveSubOrderVo subOrder) { |
|
|
|
|
Long wpId = subOrder.getWpId(); |
|
|
|
|
Long shId = subOrder.getWpId(); |
|
|
|
|
Long cslId = subOrder.getWpId(); |
|
|
|
|
if (wpId == null || shId == null || cslId == null) { |
|
|
|
|
throw new ServiceException("参数异常!"); |
|
|
|
|
} |
|
|
|
|
WorkPlan wp = this.getById(wpId); |
|
|
|
|
if (wp == null) { |
|
|
|
|
throw new ServiceException("车间订单不存在!"); |
|
|
|
|
} |
|
|
|
|
//不是最后一道不允许入库
|
|
|
|
|
if (wp.getNextWpId() != null) { |
|
|
|
|
throw new ServiceException("当前工序不是最后一道,不能进行入库操作!"); |
|
|
|
|
} |
|
|
|
|
//工序未报工完成,不允许入库
|
|
|
|
|
if (!Objects.equals(wp.getStatus(), WorkPlan.STATUS_WORK_OK)) { |
|
|
|
|
throw new ServiceException("当前工序未报工完成,不能进行入库操作!"); |
|
|
|
|
} |
|
|
|
|
WorkOrder wo = workOrderService.getById(wp.getWoId()); |
|
|
|
|
YieldOrder yo = yieldOrderService.getById(wo.getYoId()); |
|
|
|
|
//不是子件车间订单不允许从此处入库
|
|
|
|
|
if (yo.getFatherYoId() == null && (StringUtils.isBlank(yo.getMemo()) |
|
|
|
|
|| !yo.getMemo().contains("WO-"))) { |
|
|
|
|
throw new ServiceException("不是子件车间订单,不允许在此入库!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Date nowDate = new Date(); |
|
|
|
|
//进行入库
|
|
|
|
|
// stRealtimeStockWebService.saveSubOrderWarehousing(yo.getPartCode(), wo.getBatchNo(), wo.getMakeQty(), shId, cslId, nowDate, AuthUtil.getUserId());
|
|
|
|
|
//当前工序完工
|
|
|
|
|
wp.setFactEndTime(nowDate); |
|
|
|
|
wp.setStatus(WorkPlan.STATUS_COMPLETE); |
|
|
|
|
this.updateById(wp); |
|
|
|
|
//更改车间订单状态
|
|
|
|
|
workOrderService.updateStatus(Collections.singletonList(wo.getId()), WorkOrder.RUN_STATUS_COMPLETED, AuthUtil.getUserId(), null); |
|
|
|
|
//查询父级订单下的所有子件订单是否已全部完成
|
|
|
|
|
List<YieldOrder> yoList = yieldOrderService.listByFatherYoId(yo.getFatherYoId()); |
|
|
|
|
boolean bool = true; |
|
|
|
|
if (yoList != null && !yoList.isEmpty()) { |
|
|
|
|
for (YieldOrder item : yoList) { |
|
|
|
|
if (item.getStatus() < YieldOrder.CUR_STATUS_COMPLETED) { |
|
|
|
|
bool = false; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//此处标记父级订单已齐套
|
|
|
|
|
if (yo.getFatherYoId() != null) { |
|
|
|
|
YieldOrder fatherYo = yieldOrderService.getById(yo.getFatherYoId()); |
|
|
|
|
if (fatherYo != null) { |
|
|
|
|
if (bool) { |
|
|
|
|
fatherYo.setProduceBool(Boolean.TRUE); |
|
|
|
|
fatherYo.setProduceBoolDate(new Date()); |
|
|
|
|
yieldOrderService.updateById(fatherYo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//获取到订单入库的库存
|
|
|
|
|
// Object[] obj = stRealtimeStockWebService.queryByShIdAndCslId(yo.getPartCode(), yo.getYpQty(), shId, cslId);
|
|
|
|
|
// if (obj != null) {
|
|
|
|
|
// //像仓库发起班组提请
|
|
|
|
|
// List<StClassRequest> list = new ArrayList<>();
|
|
|
|
|
// StClassRequest stClassRequest = new StClassRequest();
|
|
|
|
|
// stClassRequest.setRlsId(Long.valueOf(obj[0].toString()));
|
|
|
|
|
// stClassRequest.setGoodsId(Long.valueOf(obj[1].toString()));
|
|
|
|
|
// stClassRequest.setGoodsCode(obj[2].toString());
|
|
|
|
|
// stClassRequest.setGoodsName(obj[3].toString());
|
|
|
|
|
// stClassRequest.setMemo(wo.getWoCode());
|
|
|
|
|
// stClassRequest.setQuantity(Double.valueOf(wo.getMakeQty()));
|
|
|
|
|
// stClassRequest.setCrCode(stClassRequestService.nextCode(null));
|
|
|
|
|
// stClassRequest.setCrMan(curUserInfo);
|
|
|
|
|
// stClassRequest.setCrDate(new Date());
|
|
|
|
|
// stClassRequest.setPfDepartment(curUserInfo.getPfDepartment());
|
|
|
|
|
// stClassRequest.setApprovalStatus(IFlowBusinessBean.STATUS_CHECKED);
|
|
|
|
|
// stClassRequest.setCreateMan(curUserInfo);
|
|
|
|
|
// stClassRequest.setCreateTime(new Date());
|
|
|
|
|
// stClassRequest.setCurStatus(StClassRequest.CURSTATUS_RELEASED);
|
|
|
|
|
// stClassRequest.setSpecial(Boolean.FALSE);
|
|
|
|
|
// list.add(stClassRequest);
|
|
|
|
|
// stClassRequestService.addOrEdit(list, null, curUserInfo);
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|