| | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.jcdm.common.exception.ServiceException; |
| | | import com.jcdm.main.bs.modelNumber.domain.BsModelNumber; |
| | | import com.jcdm.main.bs.modelNumber.service.IBsModelNumberService; |
| | | import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling; |
| | |
| | | String dateTimeRule = omProductionOrdeInfo.getDateTimeRule(); |
| | | |
| | | Long[] id=omProductionOrdeInfo.getIdNums(); |
| | | OmProductionOrdeInfo ProductionOrde; |
| | | OmProductionOrdeInfo ProductionOrde = new OmProductionOrdeInfo(); |
| | | for (int a=0;a<id.length;a++){ |
| | | ProductionOrde=omProductionOrdeInfoService.selectOmProductionOrdeInfoById(id[a]); |
| | | Integer planQty = Math.toIntExact(ProductionOrde.getPlanQty());//计划数量 |
| | | String engineNo = ""; |
| | | if(planQty>0) { |
| | | for (int i = 0; i < planQty; i++) { |
| | | engineNo = omProductionOrdeInfo.getTypeZ() + " " + dateTimeRule + StringUtils.leftPad(String.valueOf(startCode), 3, "0"); |
| | | String engineNo = omProductionOrdeInfo.getTypeZ() + " " + dateTimeRule + StringUtils.leftPad(String.valueOf(startCode), 3, "0"); |
| | | BsOrderScheduling bsOrderScheduling = new BsOrderScheduling(); |
| | | bsOrderScheduling.setOrderNo(ProductionOrde.getWorkOrderNo()); |
| | | bsOrderScheduling.setWorkingHours(String.valueOf(i+1)); |
| | | bsOrderScheduling.setModel(ProductionOrde.getTypeZ()); |
| | | bsOrderScheduling.setEngineNo(engineNo); |
| | | bsOrderScheduling.setProductionStatus("1"); |
| | |
| | | @GetMapping("/getProductionNotice") |
| | | public AjaxResult getProductionNotice(OmProductionOrdeInfo omProductionOrdeInfo) |
| | | { |
| | | String factory = omProductionOrdeInfo.getWorkshopCode(); |
| | | String productionNotice = omProductionOrdeInfo.getProductionNotice(); |
| | | if (StrUtil.isBlank(productionNotice)){ |
| | | throw new ServiceException("请输入生产通知单号"); |
| | | } |
| | | if (StrUtil.isBlank(factory)){ |
| | | throw new ServiceException("请选择工厂编号"); |
| | | } |
| | | List<OmProductionOrdeInfo> omProductionOrdeInfos = omProductionOrdeInfoService.selectOmProductionOrdeInfoList(omProductionOrdeInfo); |
| | | if(omProductionOrdeInfos.size() == 0){ |
| | | try { |
| | | ReceivingServices.insertWebserviceData(productionNotice); |
| | | ReceivingServices.insertWebserviceData(factory,productionNotice); |
| | | } catch (Exception e) { |
| | | return error("接收失败!请检查通知单号"); |
| | | } |