| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.excel.util.DateUtils; |
| | | import com.alibaba.excel.util.StringUtils; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.mes.*; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.rcs.*; |
| | | import com.zy.asrs.mapper.AgvInfoMapper; |
| | | import com.zy.asrs.mapper.MatItemBarcodeMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.OrderInAndOutUtil; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.model.enums.WorkNoType; |
| | | import com.zy.common.service.CommonService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import javax.annotation.Resource; |
| | | import java.text.ParseException; |
| | | import java.util.*; |
| | | import java.util.concurrent.ExecutionException; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class MesServiceImpl implements MesService { |
| | | |
| | | @Value("${mes.url}") |
| | | public String MES_URL; |
| | | |
| | | // 海康RCS地址 |
| | | @Value("${hik.url}") |
| | | private String HIK_URL; |
| | | |
| | | // 华晓RCS地址 |
| | | @Value("${hx.url}") |
| | | private String HX_URL; |
| | | |
| | | @Value("${wms.currentName}") |
| | | public String WMS_CURRENT_NAME; |
| | | @Value("${wms.wmsTransStartStation1}") |
| | |
| | | OrderPakin orderPakin = new OrderPakin(); |
| | | orderPakin.setUuid(String.valueOf(snowflakeIdWorker.nextId())); |
| | | orderPakin.setOrderNo(entry.getKey()); |
| | | orderPakin.setOrderTime(com.core.common.DateUtils.convert(now)); |
| | | orderPakin.setOrderTime(DateUtils.convert(now)); |
| | | orderPakin.setDocType(docType); |
| | | orderPakin.setSettle(1L); |
| | | orderPakin.setStatus(1); |
| | |
| | | OrderPakin orderPakin = new OrderPakin(); |
| | | orderPakin.setUuid(String.valueOf(snowflakeIdWorker.nextId())); |
| | | orderPakin.setOrderNo(mesInApply.getOrderNo()); |
| | | orderPakin.setOrderTime(com.core.common.DateUtils.convert(now)); |
| | | orderPakin.setOrderTime(DateUtils.convert(now)); |
| | | orderPakin.setDocType(docType); |
| | | orderPakin.setSettle(settle); |
| | | orderPakin.setStatus(1); |
| | |
| | | OrderPakout orderPakout = new OrderPakout(); |
| | | orderPakout.setUuid(String.valueOf(snowflakeIdWorker.nextId())); |
| | | orderPakout.setOrderNo(mesCallOutApply.getOrderNo()); |
| | | orderPakout.setOrderTime(com.core.common.DateUtils.convert(now)); |
| | | orderPakout.setOrderTime(DateUtils.convert(now)); |
| | | orderPakout.setDocType(docType.getDocId()); |
| | | orderPakout.setSettle(settle); |
| | | orderPakout.setStatus(1); |
| | |
| | | OrderPakin orderPakin = new OrderPakin(); |
| | | orderPakin.setUuid(String.valueOf(snowflakeIdWorker.nextId())); |
| | | orderPakin.setOrderNo(mesCallOutApply.getOrderNo()); |
| | | orderPakin.setOrderTime(com.core.common.DateUtils.convert(now)); |
| | | orderPakin.setOrderTime(DateUtils.convert(now)); |
| | | orderPakin.setDocType(docType.getDocId()); |
| | | orderPakin.setSettle(1L); |
| | | orderPakin.setStatus(1); |
| | |
| | | return mesReturn; |
| | | } |
| | | |
| | | @Override |
| | | public int AGVPause(JSONObject params, int AGVType){ |
| | | MesReturn mesReturn = new MesReturn(); |
| | | |
| | | String hik_url = "api/robot/controller/zone/pause"; |
| | | String hx_url = ""; |
| | | String URL = ""; |
| | | if (AGVType == 1){ |
| | | URL = HIK_URL + hik_url; |
| | | }else { |
| | | URL = HX_URL + hx_url; |
| | | } |
| | | |
| | | String response = RcsServiceImpl.sendPost(URL, JSONObject.toJSONString(params)); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (!StringUtils.isEmpty(response) && jsonObject.getString("code").equals("SUCCESS")) { |
| | | return 1; |
| | | }else |
| | | return 2; |
| | | } |
| | | |
| | | // endregion |
| | | |
| | | /** |