|  |  | 
 |  |  | import com.zy.common.model.DetlDto; | 
 |  |  | import com.zy.common.model.enums.WorkNoType; | 
 |  |  | import com.zy.common.service.CommonService; | 
 |  |  | import com.zy.common.utils.Synchro; | 
 |  |  | import com.zy.common.utils.HttpHandler; | 
 |  |  | import com.zy.nc.service.NccJcQilibcBarcodeflowWmsService; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.beans.factory.annotation.Value; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  |  | 
 |  |  | 
 |  |  | @Slf4j | 
 |  |  | @Service | 
 |  |  | public class MobileServiceImpl implements MobileService { | 
 |  |  |  | 
 |  |  |     @Value("${wcs.url}") | 
 |  |  |     private String wcsUrl; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private MatService matService; | 
 |  |  | 
 |  |  |             throw new CoolException("盘点未完成无法上报"); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public void toOutSta(PalletToOutStaParam param, Long userId) { | 
 |  |  |         WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); | 
 |  |  |         if (wrkMast == null) { | 
 |  |  |             throw new CoolException("工作档不存在"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if (wrkMast.getIoType() != 103) { | 
 |  |  |             throw new CoolException("工作档类型不是拣料出库"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if (wrkMast.getWrkSts() != 14) { | 
 |  |  |             throw new CoolException("工作状态未处于已出库"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         String response = ""; | 
 |  |  |         try { | 
 |  |  |             HashMap<String, Object> map = new HashMap<>(); | 
 |  |  |             map.put("wrkNo", wrkMast.getWrkNo()); | 
 |  |  |             map.put("sourceStaNo", wrkMast.getStaNo()); | 
 |  |  |             map.put("staNo", 1075); | 
 |  |  |  | 
 |  |  |             response = new HttpHandler.Builder() | 
 |  |  |                     .setUri(wcsUrl) | 
 |  |  |                     .setPath("/open/toOutSta") | 
 |  |  |                     .setJson(JSON.toJSONString(map)) | 
 |  |  |                     .build() | 
 |  |  |                     .doPost(); | 
 |  |  |             log.info("toOutSta:{}", response); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             log.error("fail", e); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public void toAllOut(PalletToAllOutParam param, Long userId) { | 
 |  |  |         WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); | 
 |  |  |         if (wrkMast == null) { | 
 |  |  |             throw new CoolException("工作档不存在"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if (wrkMast.getIoType() != 103) { | 
 |  |  |             throw new CoolException("工作档类型不是拣料出库"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if (wrkMast.getWrkSts() != 14) { | 
 |  |  |             throw new CoolException("工作状态未处于已出库"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         wrkMast.setBarcode(param.getNewBarcode()); | 
 |  |  |         wrkMast.setModiTime(new Date()); | 
 |  |  |         wrkMast.setModiUser(userId); | 
 |  |  |         wrkMastService.updateById(wrkMast); | 
 |  |  |  | 
 |  |  |         WrkDetl wrkDetl = new WrkDetl(); | 
 |  |  |         wrkDetl.setZpallet(param.getNewBarcode()); | 
 |  |  |         wrkDetl.setModiTime(new Date()); | 
 |  |  |         wrkDetl.setModiUser(userId); | 
 |  |  |         wrkDetlService.update(wrkDetl, new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); | 
 |  |  |     } | 
 |  |  | } |