| | |
| | | <relativePath/> <!-- lookup parent from repository --> |
| | | </parent> |
| | | <groupId>com.zy</groupId> |
| | | <artifactId>jdzwcs</artifactId> |
| | | <artifactId>ynwcs</artifactId> |
| | | <version>1.0.0</version> |
| | | <packaging>war</packaging> |
| | | |
| | | <properties> |
| | | <java.version>1.8</java.version> |
| | | <cool.version>3.4.5</cool.version> |
| | | <cool.version>3.4.0</cool.version> |
| | | <mysql-driver.version>5.1.47</mysql-driver.version> |
| | | <mybatis-plus.version>2.3.2</mybatis-plus.version> |
| | | <fastjson.version>1.2.58</fastjson.version> |
| | |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <finalName>jdzwcs</finalName> |
| | | <finalName>ynwcs</finalName> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.AppAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.service.*; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Field; |
| | | import java.util.*; |
| | | |
| | | import static org.apache.ibatis.ognl.OgnlRuntime.setFieldValue; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | |
| | | public static final ArrayList<String> APP_KEY_LIST = new ArrayList<String>() {{ |
| | | add("ea1f0459efc02a79f046f982767939ae"); |
| | | }}; |
| | | //agvä»»å¡å®æ |
| | | @PostMapping("/toAgvTaskOver") |
| | | @AppAuth(memo = "agvä»»å¡å®ææ¥å£") |
| | | public R getAgvTaskOver(@RequestHeader String appkey, |
| | | @RequestBody TaskOverParam param, |
| | | HttpServletRequest request){ |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | |
| | | private void auth(String appkey, Object obj, HttpServletRequest request) { |
| | | log.info("{}æ¥å£è¢«è®¿é®ï¼appkey:{}ï¼è¯·æ±æ°æ®ï¼{}", request.getServletPath(), appkey, JSON.toJSONString(obj)); |
| | | request.setAttribute("cache", obj); |
| | | if (Cools.isEmpty(appkey)) { |
| | | throw new CoolException("认è¯å¤±è´¥ï¼è¯·ç¡®è®¤appkeyæ 误ï¼"); |
| | | } |
| | | if (Cools.isEmpty(param.getWharfCode())){ |
| | | return R.error("ç 头[wharfCode]ä¸è½ä¸ºç©º"); |
| | | if (!APP_KEY_LIST.contains(appkey)) { |
| | | throw new CoolException("认è¯å¤±è´¥ï¼è¯·ç¡®è®¤appkeyæ 误ï¼"); |
| | | } |
| | | if (Cools.isEmpty(param.getStatus())){ |
| | | return R.error("宿æ è®°[status]ä¸è½ä¸ºç©º"); |
| | | } |
| | | openService.getAgvTaskOver(param); |
| | | return R.ok(); |
| | | } |
| | | |
| | | //åå»ºä»»å¡ |
| | |
| | | return R.error("æ¡ç [barcode]ä¸è½ä¸ºç©º"); |
| | | } |
| | | String locNo=null; |
| | | if(param.getIoType()==1){ |
| | | locNo=param.getTargetPoint(); |
| | | }else{ |
| | | locNo=param.getStartPoint(); |
| | | if (param.getIoType() == 1) { |
| | | locNo = param.getTargetPoint(); |
| | | } else { |
| | | locNo = param.getStartPoint(); |
| | | } |
| | | try{ |
| | | try { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_no", locNo).ne("loc_sts","X")); |
| | | if (Cools.isEmpty(locMast)){ |
| | | log.error("åºä½å·ä¸åå¨"+locNo); |
| | | return R.error("åºä½å·ä¸åå¨"+locNo).add("åºä½å·ä¸åå¨"+locNo); |
| | | .eq("loc_no", locNo).ne("loc_sts", "X")); |
| | | if (Cools.isEmpty(locMast)) { |
| | | log.error("åºä½å·ä¸åå¨" + locNo); |
| | | return R.error("åºä½å·ä¸åå¨" + locNo).add("åºä½å·ä¸åå¨" + locNo); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("åºä½å·æ£æµç¨åºå¼å¸¸==ãå¼å¸¸ä¿¡æ¯"+e); |
| | | return R.error("åºä½å·æ£æµç¨åºå¼å¸¸").add("åºä½å·æ£æµç¨åºå¼å¸¸==ãå¼å¸¸ä¿¡æ¯"+e); |
| | | } catch (Exception e) { |
| | | log.error("åºä½å·æ£æµç¨åºå¼å¸¸==ãå¼å¸¸ä¿¡æ¯" + e); |
| | | return R.error("åºä½å·æ£æµç¨åºå¼å¸¸").add("åºä½å·æ£æµç¨åºå¼å¸¸==ãå¼å¸¸ä¿¡æ¯" + e); |
| | | } |
| | | LocMast locMast=locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts","F") |
| | | .eq("loc_no",locNo) |
| | | .eq("barcode",param.getBarcode())); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("loc_sts", "F") |
| | | .eq("loc_no", locNo) |
| | | .eq("barcode", param.getBarcode())); |
| | | if(Cools.isEmpty(locMast)){ |
| | | return R.error("该åºä½ä¸æ»¡è¶³åºåºæ¡ä»¶"+param.getTargetPoint()); |
| | | } |
| | |
| | | locNoList.add(locMast.getLocNo()); |
| | | paramList.add(param); |
| | | }else { |
| | | return R.error("该åºä½ä¸è½åæ¶ä¸å两ç¬ä»»å¡"+locMast.getLocNo()); |
| | | return R.error("该åºä½ä¸è½åæ¶ä¸å两ç¬ä»»å¡" + locMast.getLocNo()); |
| | | } |
| | | } |
| | | for (TaskCreateParam param : paramList){ |
| | | openService.taskCreate(param); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("ä»»å¡ä¸åå¼å¸¸"+e); |
| | | return R.error(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | //å建å
¥åºä»»å¡ |
| | | @PostMapping("/taskCreateIn") |
| | | @Transactional |
| | | public R taskCreateIn(@RequestHeader String appkey, |
| | | @RequestBody TaskCreateInParam param, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | try{ |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | if (Cools.isEmpty(param.getTaskNo())) { |
| | | return R.error("ä»»å¡å·[taskNo]ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (Cools.isEmpty(param.getIoType())) { |
| | | return R.error("ä»»å¡ç±»å[ioType]ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("æ¡ç [barcode]ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | openService.taskCreateIn(param); |
| | | }catch (Exception e){ |
| | | log.error("ä»»å¡ä¸åå¼å¸¸"+e); |
| | | return R.error(); |
| | |
| | | return R.ok().add(taskWrk); |
| | | } |
| | | |
| | | //åæ¾è´§ç³è¯· |
| | | @PostMapping("/pick/and/place/v1") |
| | | @AppAuth(memo = "agvåæ¾è´§ç³è¯·") |
| | | public R getAgvPickAndPlaceV1(@RequestHeader String appkey, |
| | | @RequestBody TaskOverParam param, |
| | | HttpServletRequest request){ |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | if (Cools.isEmpty(param.getStaNo())){ |
| | | return R.error("ç 头[staNo]ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (Cools.isEmpty(param.getType())){ |
| | | return R.error("ç±»å[type]ä¸è½ä¸ºç©º"); |
| | | } |
| | | return openService.getAgvPickAndPlaceV1(param); |
| | | } |
| | | |
| | | //åæ¾è´§å®æåé¦ |
| | | @PostMapping("/pick/and/place/v2") |
| | | @AppAuth(memo = "agvåæ¾è´§å®æåé¦") |
| | | public R getAgvPickAndPlaceV2(@RequestHeader String appkey, |
| | | @RequestBody TaskOverParam param, |
| | | HttpServletRequest request){ |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | if (Cools.isEmpty(param.getStaNo())){ |
| | | return R.error("ç 头[staNo]ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (Cools.isEmpty(param.getType())){ |
| | | return R.error("ç±»å[type]ä¸è½ä¸ºç©º"); |
| | | } |
| | | return openService.getAgvPickAndPlaceV2(param); |
| | | } |
| | | |
| | | //æ¥è¯¢ä»»å¡æä»¤éå |
| | | @GetMapping("/queryTaskCommand") |
| | | public R queryTaskCommand(@RequestHeader String appkey, |
| | |
| | | |
| | | List<CommandInfo> commandInfos = commandInfoService.selectByTaskNo(taskNo); |
| | | return R.ok().add(commandInfos); |
| | | } |
| | | |
| | | private void auth(String appkey, Object obj, HttpServletRequest request) { |
| | | log.info("{}æ¥å£è¢«è®¿é®ï¼appkey:{}ï¼è¯·æ±æ°æ®ï¼{}", request.getServletPath(), appkey, JSON.toJSONString(obj)); |
| | | request.setAttribute("cache", obj); |
| | | if (Cools.isEmpty(appkey)) { |
| | | throw new CoolException("认è¯å¤±è´¥ï¼è¯·ç¡®è®¤appkeyæ 误ï¼"); |
| | | } |
| | | if (!APP_KEY_LIST.contains(appkey)) { |
| | | throw new CoolException("认è¯å¤±è´¥ï¼è¯·ç¡®è®¤appkeyæ 误ï¼"); |
| | | } |
| | | } |
| | | |
| | | //AGV请æ±å
¥åºç 头æ¥å£ |
| | | @PostMapping("/targetWharfApply") |
| | | @AppAuth(memo = "AGV请æ±å
¥åºç 头æ¥å£") |
| | | public R targetWharfApply(@RequestHeader String appkey, |
| | | @RequestBody WMSAndAGVInterfaceParam param, |
| | | HttpServletRequest request) throws IOException { |
| | | auth(appkey,param,request); |
| | | |
| | | if (Cools.isEmpty(param)){ |
| | | return R.error("åæ°ä¸ºç©ºï¼"); |
| | | } else if (Cools.isEmpty(param.getTaskNo())){ |
| | | return R.error("å·¥ä½å·ä¸ºç©ºï¼"); |
| | | } else if (Cools.isEmpty(param.getContainerCode())){ |
| | | return R.error("æçç¼ç 为空ï¼"); |
| | | } else if (Cools.isEmpty(param.getWharfSource())){ |
| | | return R.error("æºç 头为空ï¼"); |
| | | } else if (Cools.isEmpty(param.getFreeWharfs()) || param.getFreeWharfs().size()==0){ |
| | | return R.error("空é²çå
¥åºç 头ï¼AGVï¼ä¸ºç©ºï¼"); |
| | | } |
| | | R r = openService.AgvToWCSToWms(param); |
| | | apiLogService.save("AGV请æ±å
¥åºç 头æ¥å£" |
| | | ,request.getRemoteAddr()+request.getRequestURI() |
| | | ,appkey |
| | | ,request.getRemoteAddr() |
| | | ,JSON.toJSONString(param) |
| | | ,r.toString() |
| | | ,true |
| | | ); |
| | | return r; |
| | | } |
| | | |
| | | //AGV请æ±å¨ä½æ¥å£ |
| | | @PostMapping("/agvTaskRequest") |
| | | @AppAuth(memo = "AGV请æ±å¨ä½æ¥å£") |
| | | public R agvTaskRequest(@RequestHeader String appkey, |
| | | @RequestBody WMSAndAGVInterfaceParam param, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)){ |
| | | return R.error("åæ°ä¸ºç©ºï¼"); |
| | | } else if (Cools.isEmpty(param.getRequestType())){ |
| | | return R.error("请æ±ç±»å为空ï¼"); |
| | | } else if (Cools.isEmpty(param.getWharfCode())){ |
| | | return R.error("ç 头ç¼å·ä¸ºç©ºï¼"); |
| | | } |
| | | |
| | | Map<String,Integer> map = new HashMap<>(); |
| | | map.put("J-1102",102);map.put("J-1101",101); |
| | | map.put("J-1103",105);map.put("J-1104",106); |
| | | map.put("J-1105",109);map.put("J-1106",110); |
| | | map.put("J-1107",113);map.put("J-1108",114); |
| | | map.put("J-1109",117);map.put("J-1110",118); |
| | | map.put("J-1111",121);map.put("J-1112",122); |
| | | map.put("H-1102",300);map.put("H-1101",305); |
| | | map.put("G-1102",400);map.put("G-1101",405); |
| | | // StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | // .eq("stn_desc", param.getWharfCode())); |
| | | // |
| | | // if (Cools.isEmpty(staDesc)){ |
| | | // return R.error("ç¨åºæ¥éï¼æªæ¥è¯¢å°ç«ç¹"); |
| | | // } |
| | | if (Cools.isEmpty(map.get(param.getWharfCode()))){ |
| | | return R.error("æªæ¥è¯¢å°ç«ç¹"); |
| | | } |
| | | BasDevp basDevp = basDevpService.selectById(map.get(param.getWharfCode())); |
| | | // BasDevp basDevp = basDevpService.selectById(staDesc.getStnNo()); |
| | | if (basDevp.getAutoing().equals("Y") && (basDevp.getInEnable().equals("Y") || basDevp.getOutEnable().equals("Y"))){ |
| | | apiLogService.save("AGV请æ±å
¥åºç 头æ¥å£" |
| | | ,request.getRemoteAddr()+request.getRequestURI() |
| | | ,appkey |
| | | ,request.getRemoteAddr() |
| | | ,JSON.toJSONString(param) |
| | | ,R.ok().toString() |
| | | ,true |
| | | ); |
| | | return R.ok("å¯å
¥"); |
| | | }else { |
| | | apiLogService.save("AGV请æ±å
¥åºç 头æ¥å£" |
| | | ,request.getRemoteAddr()+request.getRequestURI() |
| | | ,appkey |
| | | ,request.getRemoteAddr() |
| | | ,JSON.toJSONString(param) |
| | | ,R.error("ç«ç¹ç¶æä¸å¯å
¥").toString() |
| | | ,true |
| | | ); |
| | | return R.error("ç«ç¹ç¶æä¸å¯å
¥"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | //ä»»å¡ä¸åæ¥å£ |
| | |
| | | crnStatusParams.add(crnStatusParam); |
| | | } |
| | | return R.ok(crnStatusParams); |
| | | } |
| | | |
| | | public static <T> List<T> convertListMapToListObject(List<HashMap<String, Object>> listMap, Class<T> clazz) throws Exception { |
| | | List<T> list = new ArrayList<>(); |
| | | |
| | | for (Map<String, Object> map : listMap) { |
| | | T obj = clazz.getDeclaredConstructor().newInstance(); |
| | | |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | String key = entry.getKey(); |
| | | Object value = entry.getValue(); |
| | | |
| | | try { |
| | | Field field = clazz.getDeclaredField(key); |
| | | field.setAccessible(true); |
| | | setFieldValue(obj, field, value); |
| | | } catch (NoSuchFieldException e) { |
| | | System.out.println("No such field: " + key + " in class " + clazz.getName()); |
| | | } |
| | | } |
| | | |
| | | list.add(obj); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | private static void setFieldValue(Object obj, Field field, Object value) throws IllegalAccessException { |
| | | Class<?> fieldType = field.getType(); |
| | | |
| | | if (fieldType.isAssignableFrom(value.getClass())) { |
| | | field.set(obj, value); |
| | | } else if (fieldType == int.class || fieldType == Integer.class) { |
| | | field.set(obj, ((Number) value).intValue()); |
| | | } else if (fieldType == long.class || fieldType == Long.class) { |
| | | field.set(obj, ((Number) value).longValue()); |
| | | } else if (fieldType == double.class || fieldType == Double.class) { |
| | | field.set(obj, ((Number) value).doubleValue()); |
| | | } else if (fieldType == float.class || fieldType == Float.class) { |
| | | field.set(obj, ((Number) value).floatValue()); |
| | | } else if (fieldType == boolean.class || fieldType == Boolean.class) { |
| | | field.set(obj, (Boolean) value); |
| | | } else if (fieldType == String.class) { |
| | | field.set(obj, String.valueOf(value)); |
| | | } else { |
| | | System.out.println("Unsupported field type: " + fieldType.getName()); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.dto.NotifyCustomDataDto; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.entity.CommandInfo; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.TaskWrk; |
| | | import com.zy.asrs.entity.param.TaskOverToWms; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.CommandInfoService; |
| | | import com.zy.asrs.service.LocMastService; |
| | |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.utils.NotifyUtils; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | |
| | | @Autowired |
| | | private TaskWrkService taskWrkService; |
| | | |
| | | @Autowired |
| | | private CommandInfoService commandInfoService; |
| | | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @Value("${wms.TaskExecCallback}") |
| | | private String TaskExecCallback; |
| | | |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private NotifyUtils notifyUtils; |
| | | |
| | | @RequestMapping(value = "/taskWrk/{wrkNo}/auth") |
| | | @ManagerAuth |
| | |
| | | if (Cools.isEmpty(taskWrk) || taskWrk.getStatus()>=3){ |
| | | return R.error("å·²å®ç»æå·²åæ¶") ; |
| | | } |
| | | LocMast locMast=new LocMast(); |
| | | LocMast locMast = new LocMast(); |
| | | if(taskWrk.getIoType()==1){//å
¥åºä»»å¡å®æåºä½ä¸ºF |
| | | locMast=locMastService.selectByLocNo(taskWrk.getTargetPoint()); |
| | | locMast = locMastService.selectByLocNo(taskWrk.getTargetPoint()); |
| | | if(Cools.isEmpty(locMast)){ |
| | | R.error("æ²¡ææ¾å°è¯¥åºä½") ; |
| | | } |
| | |
| | | locMast.setModiTime(new Date()); |
| | | locMast.setBarcode(taskWrk.getBarcode()); |
| | | }else if(taskWrk.getIoType()==2){//åºåºä»»å¡å®æåºä½ä¸ºO |
| | | locMast=locMastService.selectByLocNo(taskWrk.getStartPoint()); |
| | | locMast = locMastService.selectByLocNo(taskWrk.getStartPoint()); |
| | | if(Cools.isEmpty(locMast)){ |
| | | R.error("æ²¡ææ¾å°è¯¥åºä½") ; |
| | | } |
| | | locMast.setLocSts("O"); |
| | | locMast.setModiTime(new Date()); |
| | | }else if(taskWrk.getIoType()==3){ |
| | | locMast=locMastService.selectByLocNo(taskWrk.getStartPoint()); |
| | | locMast = locMastService.selectByLocNo(taskWrk.getStartPoint()); |
| | | if(Cools.isEmpty(locMast)){ |
| | | R.error("æ²¡ææ¾å°è¯¥åºä½") ; |
| | | } |
| | |
| | | locMast.setBarcode(taskWrk.getBarcode()); |
| | | |
| | | } |
| | | String response=""; |
| | | try{ |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("TaskNo",taskWrk.getTaskNo()); |
| | | headParam.put("Result",1); |
| | | // headParam.put("reportTime",new Date()); |
| | | log.info("wcsæå¨å®æä»»å¡ä¸æ¥wms={}", taskWrk); |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(TaskExecCallback) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | apiLogService.save("wcsæå¨å®æä»»å¡ä¸æ¥wms" |
| | | ,wmsUrl+TaskExecCallback |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(headParam) |
| | | ,response |
| | | ,true |
| | | ); |
| | | }catch (Exception e){ |
| | | log.error("wcsæå¨å®æä»»å¡ä¸æ¥wms失{},è¿åå¼={}", taskWrk,response); |
| | | // throw new CoolException(e); |
| | | } |
| | | locMastService.updateById(locMast); |
| | | taskWrk.setStatus(7);//æå¨å®æä»»å¡ |
| | | taskWrk.setModiTime(new Date()); |
| | |
| | | }catch (Exception e){ |
| | | taskWrk.setModiUser(9999L);//æä½å |
| | | } |
| | | String response=""; |
| | | try{ |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("TaskNo",taskWrk.getTaskNo()); |
| | | headParam.put("Result",0); |
| | | // headParam.put("reportTime",new Date()); |
| | | |
| | | log.info("wcsæå¨åæ¶ä»»å¡ä¸æ¥wm={}", taskWrk); |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(TaskExecCallback) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | apiLogService.save("wcsæå¨åæ¶ä»»å¡ä¸æ¥wms" |
| | | ,wmsUrl+TaskExecCallback |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(headParam) |
| | | ,response |
| | | ,true |
| | | ); |
| | | }catch (Exception e){ |
| | | log.error("wcsæå¨åæ¶ä»»å¡ä¸æ¥wms失败={},è¿åå¼={}", taskWrk,response); |
| | | // throw new CoolException(e); |
| | | } |
| | | taskWrk.setCompleteTime(now);//å®ç»æ¶é´ |
| | | taskWrkService.updateById(taskWrk); |
| | | return R.ok(); |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.service.WorkService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private WorkService workService; |
| | | |
| | | @RequestMapping("/hand/control/wrkMast") |
| | | @ManagerAuth(memo = "æå¨å¤ç工使¡£") |
| | | public R handControlWrkMast(@RequestParam String workNo, |
| | | @RequestParam Integer type){ |
| | | if (type == 1) { |
| | | workService.completeWrkMast(workNo, getUserId()); |
| | | return R.ok("ä»»å¡å·²å®æ"); |
| | | } else if (type == 2) { |
| | | workService.cancelWrkMast(workNo, getUserId()); |
| | | return R.ok("ä»»å¡å·²åæ¶"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class NotifyCustomDataDto { |
| | | |
| | | private String uri; |
| | | |
| | | private String path; |
| | | |
| | | private String data; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class NotifyDto { |
| | | |
| | | private Long id; |
| | | |
| | | //éç¥ç±»å |
| | | private String notifyType; |
| | | |
| | | //设å¤å· |
| | | private Integer device; |
| | | |
| | | //å·¥ä½å· |
| | | private String taskNo; |
| | | |
| | | //ä¸çº§ç³»ç»å·¥ä½å· |
| | | private String superTaskNo; |
| | | |
| | | //æ¶æ¯ç±»å |
| | | private String msgType; |
| | | |
| | | //æ¶æ¯æè¿° |
| | | private String msgDesc; |
| | | |
| | | //æ¶æ¯æ°æ® |
| | | private String data; |
| | | |
| | | //åéèªå®ä¹æ¶æ¯æ°æ®ï¼é»è®¤æ åæ ¼å¼ |
| | | private Boolean sendCustomData = false; |
| | | |
| | | //èªå®ä¹æ¶æ¯æ°æ®æ ¼å¼ |
| | | private NotifyCustomDataDto customData; |
| | | |
| | | //失败éè¯æ¬¡æ° |
| | | private Integer failTimes = 3; |
| | | |
| | | //éè¯æ¬¡æ° |
| | | private Integer retryTimes = 0; |
| | | |
| | | //éè¯é´éé»è®¤30s |
| | | private Integer retryTime = 30; |
| | | |
| | | //䏿¬¡éè¯æ¶é´ |
| | | private Long lastRetryTime = 0L; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.enums; |
| | | |
| | | public enum NotifyMsgType { |
| | | //ä»»å¡ |
| | | TASK_COMPLETE("task_complete", "ä»»å¡å®æ"), |
| | | TASK_CANCEL("task_cancel", "ä»»å¡åæ¶"), |
| | | ; |
| | | |
| | | public String flag; |
| | | public String desc; |
| | | |
| | | NotifyMsgType(String flag, String desc) { |
| | | this.flag = flag; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public static NotifyMsgType get(String flag) { |
| | | if (null == flag) { |
| | | return null; |
| | | } |
| | | for (NotifyMsgType type : NotifyMsgType.values()) { |
| | | if (type.flag.equals(flag)) { |
| | | return type; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static NotifyMsgType get(NotifyMsgType type) { |
| | | if (null == type) { |
| | | return null; |
| | | } |
| | | for (NotifyMsgType type2 : NotifyMsgType.values()) { |
| | | if (type2 == type) { |
| | | return type2; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.enums; |
| | | |
| | | public enum RedisKeyType { |
| | | |
| | | QUEUE_TASK("queue_task_"), |
| | | ; |
| | | |
| | | public String key; |
| | | |
| | | RedisKeyType(String key) { |
| | | this.key = key; |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class TaskCreateInParam { |
| | | |
| | | //ä»»å¡å· |
| | | private String taskNo; |
| | | |
| | | //ä»»å¡ç±»å |
| | | private Integer ioType; |
| | | |
| | | //ä¼å
级 |
| | | private Integer taskPriority; |
| | | |
| | | //ç»ç¹ |
| | | private String targetPoint; |
| | | |
| | | //æ¯å¦ç©ºæç Y:æ¯ Nï¼å¦ |
| | | private String emptyContainer; |
| | | |
| | | //æ¡ç |
| | | private String barcode; |
| | | |
| | | //夿³¨ |
| | | private String memo; |
| | | |
| | | //å åæº |
| | | private Integer crn; |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.param.TaskOverParam; |
| | | import com.zy.asrs.entity.param.WMSAndAGVInterfaceParam; |
| | | import com.zy.asrs.entity.param.TaskCreateInParam; |
| | | import com.zy.asrs.entity.param.TaskCreateParam; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | |
| | | public interface OpenService { |
| | |
| | | //åå»ºä»»å¡ |
| | | HashMap<String,Object> taskCreate(TaskCreateParam param); |
| | | |
| | | R AgvToWCSToWms(WMSAndAGVInterfaceParam param) throws IOException; |
| | | HashMap<String,Object> taskCreateIn(TaskCreateInParam param); |
| | | |
| | | void getAgvTaskOver(TaskOverParam param); |
| | | |
| | | R getAgvPickAndPlaceV1(TaskOverParam param); |
| | | R getAgvPickAndPlaceV2(TaskOverParam param); |
| | | } |
| | |
| | | |
| | | public interface WorkService { |
| | | |
| | | /** |
| | | * æå¨å®æå·¥ä½æ¡£ |
| | | */ |
| | | void completeWrkMast(String workNo, Long userId); |
| | | |
| | | /** |
| | | * æå¨åæ¶å·¥ä½æ¡£ |
| | | */ |
| | | void cancelWrkMast(String workNo, Long userId); |
| | | |
| | | } |
| | |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.controller.CrnController; |
| | | import com.zy.asrs.controller.OpenController; |
| | | import com.zy.asrs.controller.SiteController; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.domain.enums.WorkNoType; |
| | |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.Result; |
| | | import com.zy.asrs.entity.param.StorageEscalationParam; |
| | | import com.zy.asrs.entity.param.TaskOverToWms; |
| | | import com.zy.asrs.mapper.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.CommandUtils; |
| | |
| | | import com.zy.core.model.CrnSlave; |
| | | import com.zy.core.model.DevpSlave; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.CommandPackage; |
| | | import com.zy.core.model.command.CrnCommand; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.BarcodeThread; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import lombok.Synchronized; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.concurrent.CompletableFuture; |
| | | |
| | | /** |
| | | * ç«ä½ä»åºWCSç³»ç»ä¸»æµç¨ä¸å¡ |
| | |
| | | private CrnController crnController; |
| | | @Autowired |
| | | private SiteController siteController; |
| | | @Synchronized |
| | | public void shiftTargetToCyclePoint() throws IOException, InterruptedException { |
| | | try { |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | for (DevpSlave.Sta outSta : devp.getOutSta()) { |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | if (devpThread == null) { |
| | | continue; |
| | | } |
| | | |
| | | StaProtocol staProtocol = getClonedStation(devpThread, outSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } |
| | | |
| | | // è·åå
¶ä»ç¸å
³ç«ç¹ |
| | | StaProtocol staProtocol1 = getClonedStation(devpThread, 1001); |
| | | StaProtocol staProtocol2 = getClonedStation(devpThread, 1002); |
| | | StaProtocol staProtocol3 = getClonedStation(devpThread, 1003); |
| | | StaProtocol staProtocol4 = getClonedStation(devpThread, 1004); |
| | | StaProtocol staProtocol6 = getClonedStation(devpThread, 111); |
| | | |
| | | boolean result = false; |
| | | switch (outSta.getStaNo()) { |
| | | case 105: |
| | | result = (staProtocol1 != null && staProtocol1.isLoading() && staProtocol.isLoading() && staProtocol.getStaNo() == 105); |
| | | break; |
| | | case 107: |
| | | result = (staProtocol2 != null && staProtocol2.isLoading()); |
| | | break; |
| | | case 109: |
| | | result = (staProtocol3 != null && staProtocol3.isLoading()); |
| | | break; |
| | | case 110: |
| | | result = ((staProtocol4 != null && staProtocol4.isLoading() && staProtocol.isLoading() && staProtocol.getStaNo() == 110) || |
| | | (staProtocol6 != null && staProtocol6.isLoading() && staProtocol.isLoading() && staProtocol.getStaNo() == 111)); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | if (result) { |
| | | if (staProtocol.getSiteId() == 107 || staProtocol.getSiteId() == 109) { |
| | | StaProtocol staProtocol5 = getClonedStation(devpThread, staProtocol.getSiteId() - 1); |
| | | if (staProtocol5 != null && (staProtocol5.isLoading() && (staProtocol5.getStaNo() == 107 || staProtocol5.getStaNo() == 109))) { |
| | | short workNo = staProtocol5.getWorkNo(); |
| | | staProtocol5.setWorkNo(workNo); |
| | | staProtocol5.setStaNo((short) 112); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(4, staProtocol5)); |
| | | } |
| | | } else { |
| | | if(staProtocol.isLoading() && (staProtocol.getStaNo() == 105 || staProtocol.getStaNo() == 110 || staProtocol.getStaNo() == 111)){ |
| | | short workNo = staProtocol.getWorkNo(); |
| | | staProtocol.setWorkNo(workNo); |
| | | staProtocol.setStaNo((short) 112); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(4, staProtocol)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("shiftTargetToCyclePoint error", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åç«ç¹å¹¶å
é |
| | | */ |
| | | private StaProtocol getClonedStation(DevpThread devpThread, int staNo) { |
| | | StaProtocol staProtocol = devpThread.getStation().get(staNo); |
| | | return (staProtocol != null) ? staProtocol.clone() : null; |
| | | } |
| | | |
| | | // 112循ç¯ç«ç¹è³åºåºç« |
| | | public synchronized void shiftCyclePointToTarget() throws IOException, InterruptedException { |
| | | try { |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | if (devpThread == null) { |
| | | continue; |
| | | } |
| | | |
| | | StaProtocol staProtocol = devpThread.getStation().get(112); |
| | | if (staProtocol.getStaNo() != 112 || staProtocol.getWorkNo() == 0 || !staProtocol.isLoading() || staProtocol.getWorkNo() > 9000 || staProtocol.getWorkNo() < 6000) { |
| | | continue; |
| | | } |
| | | // æ¥è¯¢ä»»å¡ä¿¡æ¯ |
| | | TaskWrk taskWrk = taskWrkMapper.selectStaWorking(Integer.valueOf(staProtocol.getWorkNo())); |
| | | if (taskWrk == null || taskWrk.getWrkNo() < 6001 || taskWrk.getWrkNo() > 9000) { |
| | | continue; |
| | | } |
| | | |
| | | short workNo = staProtocol.getWorkNo(); |
| | | // ååå
¥ç®æ ç«ç¹ |
| | | staProtocol.setWorkNo(workNo); |
| | | staProtocol.setStaNo(Short.valueOf(taskWrk.getTargetPoint())); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(4, staProtocol)); |
| | | Thread.sleep(200); |
| | | |
| | | log.info("Shifted from cycle station 112 to target {}, workNo: {}", taskWrk.getTargetPoint(), workNo); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("shiftCyclePointToTarget error", e); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public synchronized void generateStoreWrkFile1() throws IOException, InterruptedException { |
| | | try { |
| | |
| | | // } |
| | | // } |
| | | |
| | | //agvåæ¾è´§ä»»å¡å®æ |
| | | public synchronized void autoCompleteAGV() { |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | try { |
| | | Thread.sleep(500); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | |
| | | for (BasDevp basDevp : basDevps) { |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol = devpThread.getStation().get(basDevp.getDevNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | if (basDevp.getWrkNo() != 0) { |
| | | if (basDevp.getAgvTargetPick() != 0) {//åè´§ |
| | | staProtocol.setAgvTypeSign((short) 0); |
| | | staProtocol.setStaNo(basDevp.getDevNo().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, 1, new Task(4, staProtocol)); |
| | | } |
| | | boolean sign = true; |
| | | if (basDevp.getAgvTargetPlace() != 0) { |
| | | sign = false; |
| | | basDevp.setAgvTargetPlace(0); |
| | | basDevpService.updateById(basDevp); |
| | | staProtocol.setAgvTypeSign((short) 3);//1 |
| | | staProtocol.setStaNo(basDevp.getDevNo().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, 1, new Task(4, staProtocol)); |
| | | } |
| | | } else { |
| | | if (basDevp.getAgvTargetPlace() != 0) { |
| | | if (basDevp.getLoading().equals("Y")) { |
| | | staProtocol.setAgvTypeSign((short) 1); |
| | | staProtocol.setStaNo(basDevp.getDevNo().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, 1, new Task(4, staProtocol)); |
| | | } else { |
| | | log.error("AGVæ¾è´§å®æä½è¾é线æ ç©ï¼å¤ä½ä¿¡å· ===>> [staNo:{}] [basDevp:{}]", basDevp.getDevNo(), basDevp); |
| | | basDevp.setAgvTargetPlace(0); |
| | | basDevpService.updateById(basDevp); |
| | | staProtocol.setAgvTypeSign((short) 3);//1 |
| | | staProtocol.setStaNo(basDevp.getDevNo().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, 1, new Task(4, staProtocol)); |
| | | } |
| | | |
| | | } |
| | | if (basDevp.getAgvTargetPick() != 0) { |
| | | basDevp.setAgvTargetPick(0); |
| | | basDevpService.updateById(basDevp); |
| | | staProtocol.setAgvTypeSign((short) 2);//0 |
| | | staProtocol.setStaNo(basDevp.getDevNo().shortValue()); |
| | | MessageQueue.offer(SlaveType.Devp, 1, new Task(4, staProtocol)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public synchronized void autoCompleteTask() { |
| | | List<TaskWrk> taskWrks = taskWrkMapper.selectWorkingTask(); |
| | | for (TaskWrk taskWrk : taskWrks) { |
| | |
| | | locMastService.updateById(locMast); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public synchronized String CrnStartRunning(TaskWrk taskWrk) { |
| | | String tasktype = null; |
| | | switch (taskWrk.getIoType()) { |
| | | case 1: |
| | | tasktype = "RK"; |
| | | break; |
| | | case 2: |
| | | tasktype = "CK"; |
| | | break; |
| | | case 3: |
| | | tasktype = "YK"; |
| | | break; |
| | | default: |
| | | tasktype = "æªç¥"; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("x-api-key", "7a15b5db-29b6-552c-8cff-0cfec3756da2"); |
| | | TaskOverToWms taskOverToWms = new TaskOverToWms(); |
| | | taskOverToWms.setFeedbackFrom("WCS"); //æ¥æº |
| | | taskOverToWms.setWarehouseId("1688469798893297665"); //ä»åºæ è¯ |
| | | taskOverToWms.setTaskNo(taskWrk.getTaskNo()); //ä»»å¡å· |
| | | taskOverToWms.setTaskType(tasktype); // ä»»å¡ç±»å |
| | | taskOverToWms.setContainerCode(taskWrk.getBarcode()); // 容å¨ç¼ç |
| | | if (taskWrk.getIoType() == 1 || taskWrk.getIoType() == 3) { |
| | | taskOverToWms.setEquipmentCode(String.valueOf(taskWrk.getCrnNo())); //设å¤ç¼ç |
| | | taskOverToWms.setTargetLocationCode(taskWrk.getOriginTargetPoint()); //ç®æ åºä½ |
| | | } else if (taskWrk.getIoType() == 2) { |
| | | Map<Integer, String> map1 = new HashMap<>(); |
| | | map1.put(102, "J-1101"); |
| | | map1.put(106, "J-1103"); |
| | | map1.put(110, "J-1105"); |
| | | map1.put(114, "J-1107"); |
| | | map1.put(118, "J-1109"); |
| | | map1.put(122, "J-1111"); |
| | | map1.put(305, "H-1101"); |
| | | map1.put(405, "G-1101"); |
| | | taskOverToWms.setEquipmentCode(map1.get(taskWrk.getTargetPoint())); //设å¤ç¼ç |
| | | taskOverToWms.setSourceLocationCode(taskWrk.getOriginStartPoint()); //æºåºä½ |
| | | } |
| | | |
| | | taskOverToWms.setTaskStatus("executing"); //ä»»å¡ç¶æ |
| | | String response = null; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setHeaders(map) |
| | | .setUri(wmsUrl) |
| | | .setPath("wcsManager/wcsInterface/taskStatusFeedback") |
| | | .setJson(JSON.toJSONString(taskOverToWms)) |
| | | .build() |
| | | .doPost(); |
| | | } catch (Exception e) { |
| | | log.error("å åæºä»»å¡å®æï¼è¯·æ±wmsä»»å¡å®ææ¥å£å¤±è´¥"); |
| | | } |
| | | apiLogService.save("å åæºå¼å§è¿è¡" |
| | | , wmsUrl + "wcsManager/wcsInterface/taskStatusFeedback" |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(taskOverToWms) |
| | | , response |
| | | , true |
| | | ); |
| | | return response; |
| | | } |
| | | |
| | | private TaskWrk createTask1(Result result, String barcode) { |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.domain.enums.WorkNoType; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.TaskOverParam; |
| | | import com.zy.asrs.entity.param.WMSAndAGVInterfaceParam; |
| | | import com.zy.asrs.entity.param.TaskCreateInParam; |
| | | import com.zy.asrs.entity.param.TaskCreateParam; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.DevpSlave; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | |
| | | @Autowired |
| | | private TaskWrkService taskWrkService; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | public ArrayList<String> wharfCode1 = new ArrayList<String>() {{ |
| | | add("J-1101"); |
| | | add("J-1103"); |
| | | add("J-1105"); |
| | | add("J-1107"); |
| | | add("J-1109"); |
| | | add("J-1111"); |
| | | add("H-1101"); |
| | | add("G-1101"); |
| | | }}; |
| | | |
| | | |
| | | @Override |
| | | public HashMap<String, Object> taskCreate(TaskCreateParam param) { |
| | |
| | | if (param.getIoType() == 1) { |
| | | taskWrk.setWrkSts(1); |
| | | if (!Cools.isEmpty(param.getTargetPoint())) { |
| | | taskWrk.setTargetPoint(Utils.getWcsLocNo(param.getTargetPoint()));//ç»ç¹ |
| | | taskWrk.setTargetPoint(param.getTargetPoint());//ç»ç¹ |
| | | taskWrk.setOriginTargetPoint(param.getTargetPoint()); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R AgvToWCSToWms(WMSAndAGVInterfaceParam param) throws IOException { |
| | | ToWmsDTO toWmsDTO = new ToWmsDTO(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("x-api-key", "7a15b5db-29b6-552c-8cff-0cfec3756da2"); |
| | | List<Integer> list = new ArrayList<>(); |
| | | if (param.getWharfSource().contains("J")) { |
| | | list = getInEnableRoadway(); |
| | | } else { |
| | | list = getInEnableRoadway2(); |
| | | public HashMap<String, Object> taskCreateIn(TaskCreateInParam param) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo()); |
| | | if (taskWrk != null) { |
| | | map.put("Code","0"); |
| | | map.put("Msg", param.getTaskNo() + "ä»»å¡å·²ç»çæï¼"); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | //TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo()); |
| | | toWmsDTO.setWarehouseId("1688469798893297665"); |
| | | toWmsDTO.setContainerCode(param.getContainerCode()); |
| | | toWmsDTO.setApplyType("TUNNEL"); |
| | | toWmsDTO.setWharfSource(null); |
| | | toWmsDTO.setCanInboundTunnels(list); |
| | | String response = null; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setHeaders(map) |
| | | .setUri(wmsUrl) |
| | | .setPath("wcsManager/wcsInterface/inboundTaskApply") |
| | | .setJson(JSON.toJSONString(toWmsDTO)) |
| | | .build() |
| | | .doPost(); |
| | | } catch (Exception e) { |
| | | return R.error("wmsè¿æ¥å¤±è´¥" + e.getMessage()); |
| | | Date now = new Date(); |
| | | taskWrk = new TaskWrk(); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", param.getTargetPoint())); |
| | | int workNo1 = commonService.getWorkNo(WorkNoType.PAKIN.type);//è·åå
¥åºå·¥ä½å· |
| | | taskWrk.setTaskNo(param.getTaskNo());//ä»»å¡å· |
| | | taskWrk.setWrkNo(workNo1); |
| | | taskWrk.setStatus(TaskStatusType.RECEIVE.id);//ä»»å¡ç¶æï¼æ¥æ¶ |
| | | taskWrk.setCreateTime(now); |
| | | taskWrk.setIoType(param.getIoType());//ä»»å¡ç±»å |
| | | taskWrk.setIoPri(param.getTaskPriority());//ä¼å
级 |
| | | taskWrk.setBarcode(param.getBarcode());//æ¡ç |
| | | taskWrk.setCrnNo(locMast.getCrnNo()); |
| | | taskWrk.setWrkSts(1); |
| | | taskWrk.setTargetPoint(param.getTargetPoint());//ç»ç¹ |
| | | taskWrk.setOriginTargetPoint(param.getTargetPoint()); |
| | | if (!Cools.isEmpty(param.getMemo())) { |
| | | taskWrk.setMemo(param.getMemo());//夿³¨ |
| | | } |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | |
| | | apiLogService.save("wms请æ±å
¥åºç 头æ¥å£" |
| | | , wmsUrl + "wcsManager/wcsInterface/inboundTaskApply" |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(toWmsDTO) |
| | | , response |
| | | , true |
| | | ); |
| | | |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | //è§£æ |
| | | List<WMSAndAGVInterfaceParam> params = new ArrayList<>(); |
| | | params.add(param); |
| | | WMSAndAGVInterfaceParam data = JSONObject.parseObject(jsonObject.get("data").toString(), WMSAndAGVInterfaceParam.class); |
| | | String msg = null; |
| | | try { |
| | | taskCreate(new TaskCreateParam(data)); |
| | | } catch (Exception e) { |
| | | msg = e.getMessage(); |
| | | } |
| | | if (msg != null) { |
| | | return R.error(msg); |
| | | } |
| | | Map<String, String> map1 = new HashMap<>(); |
| | | StaDesc staDesc = new StaDesc(); |
| | | if (param.getWharfSource().contains("J")) { |
| | | staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no", data.getTaskTunnel()) |
| | | .eq("type_no", 1) |
| | | .lt("stn_no", 200)); |
| | | } else if (param.getWharfSource().contains("H")) { |
| | | staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no", data.getTaskTunnel()) |
| | | .eq("type_no", 1) |
| | | .lt("stn_no", 400) |
| | | .gt("stn_no", 200)); |
| | | } else { |
| | | staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no", data.getTaskTunnel()) |
| | | .eq("type_no", 1) |
| | | .lt("stn_no", 500) |
| | | .ge("stn_no", 400)); |
| | | } |
| | | map1.put("taskTunnel", staDesc.getStnDesc()); |
| | | //map1.put("taskTunnel", "J-1104"); |
| | | return R.ok(map1); |
| | | if (!taskWrkService.insert(taskWrk)) { |
| | | map.put("Code", "0"); |
| | | map.put("Msg", param.getTaskNo() + "å建任å¡å¤±è´¥ï¼"); |
| | | return map; |
| | | } |
| | | return R.error((String) jsonObject.get("msg")); |
| | | map.put("Code","1"); |
| | | map.put("Msg","ok"); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public void getAgvTaskOver(TaskOverParam param) { |
| | | // æ ¹æ®è¾é线plcéå |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("stn_desc", param.getWharfCode())); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | throw new RuntimeException("æªæ¥è¯¢å°ç«ç¹ä¿¡æ¯"); |
| | | } |
| | | // è·åå
¥åºç«ä¿¡æ¯ |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(staDesc.getStnNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | Short workNo = staProtocol.getWorkNo(); |
| | | if (wharfCode1.contains(param.getWharfCode())) { |
| | | if (!staProtocol.isLoading() && !staProtocol.isCar() && staProtocol.getWorkNo() > 0) { |
| | | //AGVåºåºå®æä»¥å |
| | | staProtocol.setWorkNo((short) 0); |
| | | staProtocol.setStaNo((short) 0); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); |
| | | if (result) { |
| | | |
| | | } else { |
| | | throw new RuntimeException("agvè¿å宿åï¼å½ä»¤ä¸å失败"); |
| | | } |
| | | } |
| | | } else { |
| | | for (DevpSlave.Sta inSta : devp.getInSta()) { |
| | | if (inSta.getBackSta().equals(staDesc.getStnNo())) { |
| | | |
| | | if (staProtocol.isLoading() && !staProtocol.isCar() && workNo == 0) { |
| | | //AGVå
¥åºå®æä»¥å |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo(inSta.getStaNo().shortValue()); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); |
| | | if (result) { |
| | | |
| | | } else { |
| | | throw new RuntimeException("agvè¿å宿åï¼å½ä»¤ä¸å失败"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public R getAgvPickAndPlaceV1(TaskOverParam param) { |
| | | BasDevp basDevp = basDevpService.selectById(param.getStaNo()); |
| | | if (Cools.isEmpty(basDevp)) { |
| | | return R.error("ç«ç¹å·æè¯¯" + param.getStaNo()); |
| | | } |
| | | if (param.getType() == 0 && basDevp.getAgvStartPick() == 1) { |
| | | return R.ok(); |
| | | } else if (param.getType() == 1 && basDevp.getAgvStartPlace() == 1) { |
| | | return R.ok(); |
| | | } else { |
| | | return R.error("ä¸å
许"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public R getAgvPickAndPlaceV2(TaskOverParam param) { |
| | | BasDevp basDevp = basDevpService.selectById(param.getStaNo()); |
| | | if (Cools.isEmpty(basDevp)) { |
| | | return R.error("ç«ç¹å·æè¯¯" + param.getStaNo()); |
| | | } |
| | | if (param.getType() == 0) { |
| | | basDevp.setAgvTargetPick(1); |
| | | basDevpService.updateById(basDevp); |
| | | return R.ok(); |
| | | } else if (param.getType() == 1) { |
| | | basDevp.setAgvTargetPlace(1); |
| | | basDevpService.updateById(basDevp); |
| | | return R.ok(); |
| | | } else { |
| | | return R.error("请æ±ç±»åå¼å¸¸" + param.getType()); |
| | | } |
| | | } |
| | | |
| | | public List<Integer> getInEnableRoadway() { |
| | | int[] roadway = null; |
| | | List<Integer> list = new ArrayList<>(); |
| | | Map<Integer, Integer> map = new HashMap<>(); |
| | | map.put(103, 1); |
| | | map.put(107, 2); |
| | | map.put(111, 3); |
| | | map.put(115, 4); |
| | | map.put(119, 5); |
| | | map.put(123, 6); |
| | | //put(301,7); |
| | | // æ ¹æ®è¾é线plcéå |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // éåå
¥åºå£ |
| | | for (DevpSlave.Sta inSta : devp.getInSta()) { |
| | | // è·åå
¥åºç«ä¿¡æ¯ |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta.getBackSta()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | Short workNo = staProtocol.getWorkNo(); |
| | | if (workNo == 0 && !staProtocol.isLoading()) { |
| | | if (Cools.isEmpty(map.get(inSta.getStaNo()))) { |
| | | continue; |
| | | } |
| | | list.add(map.get(inSta.getStaNo())); |
| | | } |
| | | } |
| | | } |
| | | //roadway = list.stream().mapToInt(Integer::intValue).toArray(); |
| | | return list; |
| | | } |
| | | |
| | | public List<Integer> getInEnableRoadway2() { |
| | | int[] roadway = null; |
| | | List<Integer> list = new ArrayList<>(); |
| | | Map<Integer, Integer> map = new HashMap<>(); |
| | | map.put(205, 1); |
| | | map.put(211, 2); |
| | | map.put(217, 3); |
| | | map.put(223, 4); |
| | | map.put(229, 5); |
| | | map.put(235, 6); |
| | | //put(301,7); |
| | | // æ ¹æ®è¾é线plcéå |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // éåå
¥åºå£ |
| | | for (DevpSlave.Sta inSta : devp.getInSta()) { |
| | | // è·åå
¥åºç«ä¿¡æ¯ |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta.getBackSta()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | Short workNo = staProtocol.getWorkNo(); |
| | | if (workNo == 0 && !staProtocol.isLoading()) { |
| | | if (Cools.isEmpty(map.get(inSta.getStaNo()))) { |
| | | continue; |
| | | } |
| | | list.add(map.get(inSta.getStaNo())); |
| | | } |
| | | } |
| | | } |
| | | //roadway = list.stream().mapToInt(Integer::intValue).toArray(); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.utils.HttpHandler; |
| | | 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; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.concurrent.TimeUnit; |
| | | import com.zy.asrs.service.WorkService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class WorkServiceImpl implements WorkService { |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private WrkMastLogService wrkMastLogService; |
| | | @Autowired |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | @Value("${wms.inboundTaskApplyPath}") |
| | | private String inboundTaskApplyPath; |
| | | @Value("${wms.movePath}") |
| | | private String movePath; |
| | | @Value("${wms.taskStatusFeedbackPath}") |
| | | private String taskStatusFeedbackPath; |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void completeWrkMast(String workNo, Long userId) { |
| | | WrkMast wrkMast = wrkMastService.selectById(workNo); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工使¡£ä¸åå¨"); |
| | | } |
| | | if (wrkMast.getWrkSts() == 4 || wrkMast.getWrkSts() == 14) { |
| | | throw new CoolException("å½å工使¡£å·²å®æ"); |
| | | } |
| | | // å
¥åº + åºä½è½¬ç§» |
| | | if (wrkMast.getWrkSts() < 4 || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType() == 11)) { |
| | | wrkMast.setWrkSts(4L); |
| | | // åºåº |
| | | } else if (wrkMast.getWrkSts() > 10) { |
| | | wrkMast.setWrkSts(14L); |
| | | } |
| | | Date now = new Date(); |
| | | wrkMast.setCrnStrTime(DateUtils.calculate(now, 1L, TimeUnit.SECONDS, true)); |
| | | wrkMast.setCrnEndTime(now); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | // 宿æä½äººåè®°å½ |
| | | wrkMast.setManuType("æå¨å®æ"); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("ä¿®æ¹å·¥ä½æ¡£å¤±è´¥"); |
| | | } |
| | | |
| | | HashMap<String,Object> headParam = new HashMap<>(); |
| | | headParam.put("TaskNo",wrkMast.getTaskNo()); |
| | | headParam.put("Result",0);//宿 |
| | | |
| | | try { |
| | | String response; |
| | | log.error("wcsæå¨å®ç»ä»»å¡ä¸æ¥wms={}", wrkMast); |
| | | |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(taskStatusFeedbackPath) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | apiLogService.save("wcsæå¨å®æä»»å¡ä¸æ¥wms" |
| | | , wmsUrl + taskStatusFeedbackPath |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(headParam) |
| | | , response |
| | | , true |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("wcsæå¨å®ç»ä»»å¡ä¸æ¥wms失败={}", wrkMast); |
| | | log.error("wcsæå¨å®ç»ä»»å¡ä¸æ¥wms失败,æ¥éä¿¡æ¯ï¼", e); |
| | | // throw new CoolException("wcsæ´¾åå
¥åºä»»å¡ä¸æ¥wms失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void cancelWrkMast(String workNo, Long userId) { |
| | | Date now = new Date(); |
| | | WrkMast wrkMast = wrkMastService.selectById(workNo); |
| | | |
| | | String locNo = ""; // å¾
ä¿®æ¹ç®æ åºä½ |
| | | String locSts = ""; // å¾
ä¿®æ¹ç®æ åºä½ç¶æ |
| | | // å
¥åºåæ¶ï¼ä¿®æ¹ç®æ åºä½ï¼ |
| | | if (wrkMast.getWrkSts() < 4) { |
| | | locNo = wrkMast.getLocNo(); |
| | | locSts = "O"; |
| | | |
| | | // åºä½è½¬ç§» |
| | | if (wrkMast.getIoType() == 11) { |
| | | // åºä½è½¬ç§»ï¼æºåºä½ |
| | | LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("åæ¶åºä½è½¬ç§»å¤±è´¥ï¼æºåºä½ä¸åå¨:" + wrkMast.getSourceLocNo()); |
| | | } |
| | | locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F"); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | // åºåºåæ¶ï¼ä¿®æ¹æºåºä½ï¼ |
| | | } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14) { |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | // åºåº ===>> F.å¨åº |
| | | if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 110) { |
| | | locSts = "F"; |
| | | // 空æ¿åºåº ===>> D.空桶/ç©ºæ æ¿ |
| | | } else if (wrkMast.getIoType() == 110) { |
| | | locSts = "D"; |
| | | // åºä½è½¬ç§» ===>> D.空桶/ç©ºæ æ¿ |
| | | } else if (wrkMast.getIoType() == 11) { |
| | | locSts = wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F"; |
| | | // åºä½è½¬ç§»ï¼ç®æ åºä½ |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("åæ¶åºä½è½¬ç§»å¤±è´¥ï¼ç®æ åºä½ä¸åå¨:" + wrkMast.getSourceLocNo()); |
| | | } |
| | | locMast.setLocSts("O"); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | } else { |
| | | throw new CoolException("å½åå·¥ä½ç¶ææ æ³åæ¶"); |
| | | } |
| | | // åæ¶æä½äººåè®°å½ |
| | | wrkMast.setManuType("æå¨åæ¶"); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("åæ¶ä»»å¡å¤±è´¥"); |
| | | } |
| | | // ä¿åå·¥ä½ä¸»æ¡£å岿¡£ |
| | | if (!wrkMastLogService.save(wrkMast.getWrkNo())) { |
| | | throw new CoolException("ä¿åä»»å¡å岿¡£å¤±è´¥, workNo = " + wrkMast.getWrkNo()); |
| | | } |
| | | |
| | | // å é¤å·¥ä½ä¸»æ¡£ |
| | | boolean wrkMastRes = wrkMastService.deleteById(wrkMast); |
| | | |
| | | // ä¿®æ¹åºä½ç¶æ |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("åæ¶ä»»å¡å¤±è´¥ï¼åºä½ä¸åå¨:" + locNo); |
| | | } |
| | | locMast.setLocSts(locSts); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | boolean locMastRes = locMastService.updateById(locMast); |
| | | if (!wrkMastRes || !locMastRes) { |
| | | throw new CoolException("ä¿åæ°æ®å¤±è´¥"); |
| | | } |
| | | HashMap<String,Object> headParam = new HashMap<>(); |
| | | headParam.put("TaskNo",wrkMast.getTaskNo()); |
| | | headParam.put("Result",1);//åæ¶ |
| | | |
| | | try { |
| | | String response; |
| | | log.error("wcsæå¨åæ¶ä»»å¡ä¸æ¥wms={}", wrkMast); |
| | | |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(taskStatusFeedbackPath) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | apiLogService.save("wcsæå¨åæ¶ä»»å¡ä¸æ¥wms" |
| | | , wmsUrl + taskStatusFeedbackPath |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(headParam) |
| | | , response |
| | | , true |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("wcsæå¨åæ¶ä»»å¡ä¸æ¥wms失败={}", wrkMast); |
| | | log.error("wcsæå¨åæ¶ä»»å¡ä¸æ¥wms失败,æ¥éä¿¡æ¯ï¼", e); |
| | | // throw new CoolException("wcsæ´¾åå
¥åºä»»å¡ä¸æ¥wms失败"); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.domain.dto.NotifyCustomDataDto; |
| | | import com.zy.asrs.domain.dto.NotifyDto; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.utils.NotifyUtils; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class NotifyScheduler { |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | | private NotifyUtils notifyUtils; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public synchronized void notifyTask(){ |
| | | notifyMsg("task", 1); |
| | | } |
| | | |
| | | private synchronized void notifyMsg(String notifyType, Integer device) { |
| | | Config notifyEnableConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyEnable")); |
| | | if(notifyEnableConfig == null){ |
| | | return; |
| | | } |
| | | String notifyEnable = notifyEnableConfig.getValue(); |
| | | if (!notifyEnable.equals("Y")) { |
| | | return; |
| | | } |
| | | |
| | | Config notifyUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyUri")); |
| | | if(notifyUriConfig == null){ |
| | | return; |
| | | } |
| | | String notifyUri = notifyUriConfig.getValue(); |
| | | |
| | | Config notifyUriPathConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyUriPath")); |
| | | if(notifyUriPathConfig == null){ |
| | | return; |
| | | } |
| | | String notifyUriPath = notifyUriPathConfig.getValue(); |
| | | |
| | | List<String> keys = notifyUtils.takeKeys(notifyType, device); |
| | | if(keys == null){ |
| | | return; |
| | | } |
| | | |
| | | if (keys.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | for (String key : keys) { |
| | | Object object = redisUtil.get(key); |
| | | if (object == null) { |
| | | continue; |
| | | } |
| | | NotifyDto notifyDto = (NotifyDto) object; |
| | | |
| | | if (System.currentTimeMillis() - notifyDto.getLastRetryTime() < 1000 * notifyDto.getRetryTime()) { |
| | | continue; |
| | | } |
| | | |
| | | ApiLog apiLog = new ApiLog(); |
| | | |
| | | try { |
| | | //触åéç¥ |
| | | String response = null; |
| | | if (notifyDto.getSendCustomData()) { |
| | | //èªå®ä¹æ¶æ¯æ ¼å¼ |
| | | NotifyCustomDataDto customData = notifyDto.getCustomData(); |
| | | response = new HttpHandler.Builder() |
| | | .setUri(customData.getUri()) |
| | | .setPath(customData.getPath()) |
| | | .setJson(customData.getData()) |
| | | .build() |
| | | .doPost(); |
| | | |
| | | apiLog.setUrl(customData.getUri() + customData.getPath()); |
| | | apiLog.setRequest(customData.getData()); |
| | | apiLog.setCreateTime(new Date()); |
| | | }else { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(notifyUri) |
| | | .setPath(notifyUriPath) |
| | | .setJson(JSON.toJSONString(notifyDto)) |
| | | .build() |
| | | .doPost(); |
| | | |
| | | apiLog.setUrl(notifyUri + notifyUriPath); |
| | | apiLog.setRequest(JSON.toJSONString(notifyDto)); |
| | | apiLog.setCreateTime(new Date()); |
| | | } |
| | | |
| | | apiLog.setResponse(response); |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | Integer code = jsonObject.getInteger("code"); |
| | | if(code == 200){ |
| | | //éç¥æå |
| | | redisUtil.del(key); |
| | | |
| | | continue; |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | }finally { |
| | | //ä¿åè®°å½ |
| | | apiLogService.insert(apiLog); |
| | | } |
| | | |
| | | //éç¥å¤±è´¥ |
| | | int times = notifyDto.getRetryTimes() + 1; |
| | | if (times >= notifyDto.getFailTimes()) { |
| | | //è¶
è¿æ¬¡æ° |
| | | redisUtil.del(key); |
| | | continue; |
| | | } |
| | | |
| | | notifyDto.setLastRetryTime(System.currentTimeMillis()); |
| | | notifyDto.setRetryTimes(times); |
| | | redisUtil.set(key, notifyDto); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.dto.NotifyCustomDataDto; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.TaskOverToWms; |
| | | import com.zy.asrs.entity.param.TaskStatusFeedbackParam; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.TaskWrkLogServiceImpl; |
| | | import com.zy.asrs.utils.PostMesDataUtils; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.asrs.utils.NotifyUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 宿¶å°ä»»å¡(宿ãåæ¶)è½¬ææ¥å¿ |
| | |
| | | |
| | | @Autowired |
| | | private TaskWrkService taskWrkService; |
| | | @Autowired |
| | | private CommandInfoService commandInfoService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private TaskWrkLogServiceImpl wrkLogService; |
| | | |
| | |
| | | private String TaskExecCallback; |
| | | @Value("${wms.taskStatusFeedbackPath}") |
| | | private String taskStatusFeedbackPath; |
| | | @Autowired |
| | | private NotifyUtils notifyUtils; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void execute() throws IOException { |
| | | |
| | | for (TaskWrk taskWrk : taskWrkService.selectToBeHistoryData()) { |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("TaskNo", taskWrk.getTaskNo()); |
| | | if (taskWrk.getStatus().equals(TaskStatusType.OVER.id) || taskWrk.getStatus() == 7) {//宿 |
| | | headParam.put("Result", 1); |
| | | headParam.put("Result", 1);//宿 |
| | | } else if (taskWrk.getStatus().equals(TaskStatusType.CANCEL.id)) { |
| | | headParam.put("Result", 2); |
| | | headParam.put("Result", 2);//åæ¶ |
| | | } |
| | | String response = ""; |
| | | Boolean bool = false; |
| | | try { |
| | | headParam.put("TaskNo", taskWrk.getTaskNo()); |
| | | log.info("wcsæå¨å®æä»»å¡ä¸æ¥wms={}", taskWrk); |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(TaskExecCallback) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | TaskWrkLog taskWrkLog = new TaskWrkLog(taskWrk); |
| | | if (!wrkLogService.insert(taskWrkLog)) { |
| | | throw new CoolException("转å岿¡£å¤±è´¥" + taskWrkLog); |
| | | } |
| | | if (!taskWrkService.deleteById(taskWrk)) { |
| | | throw new CoolException("任塿¡£å é¤å¤±è´¥" + taskWrkLog); |
| | | } |
| | | bool = true; |
| | | } catch (Exception e) { |
| | | log.error("wcsæå¨å®æä»»å¡ä¸æ¥wms失败{},è¿åå¼={}", taskWrk, response); |
| | | } finally { |
| | | apiLogService.save("wcs宿æè
åæ¶ä»»å¡ä¸æ¥wms" |
| | | , wmsUrl + TaskExecCallback |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(headParam) |
| | | , response |
| | | , bool |
| | | ); |
| | | |
| | | NotifyCustomDataDto customDataDto = new NotifyCustomDataDto(); |
| | | customDataDto.setUri(wmsUrl); |
| | | customDataDto.setPath(TaskExecCallback); |
| | | customDataDto.setData(JSON.toJSONString(headParam)); |
| | | notifyUtils.notify("task", 1, String.valueOf(taskWrk.getWrkNo()), taskWrk.getTaskNo(), NotifyMsgType.TASK_COMPLETE, JSON.toJSONString(taskWrk), true, customDataDto); |
| | | |
| | | TaskWrkLog taskWrkLog = new TaskWrkLog(taskWrk); |
| | | if (!wrkLogService.insert(taskWrkLog)) { |
| | | throw new CoolException("转å岿¡£å¤±è´¥" + taskWrkLog); |
| | | } |
| | | if (!taskWrkService.deleteById(taskWrk)) { |
| | | throw new CoolException("任塿¡£å é¤å¤±è´¥" + taskWrkLog); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.zy.asrs.domain.dto.NotifyCustomDataDto; |
| | | import com.zy.asrs.domain.dto.NotifyDto; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.domain.enums.RedisKeyType; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | @Component |
| | | public class NotifyUtils { |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | |
| | | public synchronized boolean notify(String notifyType, Integer device, String taskNo, String superTaskNo, NotifyMsgType msgType) { |
| | | return append(notifyType, device, taskNo, superTaskNo, msgType, null, false, null); |
| | | } |
| | | |
| | | public synchronized boolean notify(String notifyType, Integer device, String taskNo, String superTaskNo, NotifyMsgType msgType, String data, Boolean sendCustomData, NotifyCustomDataDto customData) { |
| | | return append(notifyType, device, taskNo, superTaskNo, msgType, data, sendCustomData, customData); |
| | | } |
| | | |
| | | public synchronized List<String> takeKeys(String notifyType, Integer device) { |
| | | String key = getKey(notifyType, device); |
| | | if(key == null){ |
| | | return null; |
| | | } |
| | | |
| | | Set keys = redisUtil.keys(key + "*"); |
| | | if (keys == null) { |
| | | return null; |
| | | } |
| | | |
| | | List<String> list = new ArrayList<>(); |
| | | for (Object object : keys) { |
| | | list.add(object.toString()); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | public String getKey(String notifyType, Integer device) { |
| | | String key = null; |
| | | if (notifyType.equals("task")) { |
| | | key = RedisKeyType.QUEUE_TASK.key + device; |
| | | } else { |
| | | return null; |
| | | } |
| | | |
| | | return key; |
| | | } |
| | | |
| | | private boolean append(String notifyType, Integer device, String taskNo, String superTaskNo, NotifyMsgType msgType, String data, Boolean sendCustomData, NotifyCustomDataDto customData) { |
| | | String key = getKey(notifyType, device); |
| | | if (key == null) { |
| | | return false; |
| | | } |
| | | |
| | | NotifyDto dto = new NotifyDto(); |
| | | dto.setId(snowflakeIdWorker.nextId()); |
| | | dto.setNotifyType(notifyType); |
| | | dto.setDevice(device); |
| | | dto.setMsgType(msgType.flag); |
| | | dto.setMsgDesc(msgType.desc); |
| | | dto.setData(data); |
| | | dto.setTaskNo(taskNo); |
| | | dto.setSuperTaskNo(superTaskNo); |
| | | dto.setSendCustomData(sendCustomData); |
| | | dto.setCustomData(customData); |
| | | |
| | | //éè¯æ¬¡æ° |
| | | Config notifyFailTimesConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyFailTimes")); |
| | | if (notifyFailTimesConfig != null) { |
| | | dto.setFailTimes(Integer.parseInt(notifyFailTimesConfig.getValue())); |
| | | } |
| | | |
| | | //éè¯é´é |
| | | Config notifyRetryTimeConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyRetryTime")); |
| | | if (notifyRetryTimeConfig != null) { |
| | | dto.setRetryTime(Integer.parseInt(notifyRetryTimeConfig.getValue())); |
| | | } |
| | | |
| | | redisUtil.set(key + "_" + dto.getId(), dto); |
| | | return true; |
| | | } |
| | | |
| | | } |
| | |
| | | return crnNo == 1 ? s : 3 - s; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //转æ¢wmsä¼ è¾çåºä½å· |
| | | public static String getWcsLocNo(String locNo){ |
| | | String[] split = locNo.split("-"); |
| | | int[] wcsRow = getWcsRow(split[0]); |
| | | int[] ints = null; |
| | | if (split[3].equals("01")){ |
| | | ints = Arrays.copyOfRange(wcsRow, 0, (wcsRow.length+2-1) / 2); |
| | | if (split[4].equals("01")){ |
| | | if (ints.length<2){ |
| | | |
| | | }else { |
| | | ints = Arrays.copyOfRange(ints, ints.length / 2, ints.length); |
| | | } |
| | | }else { |
| | | if (ints.length<2){ |
| | | |
| | | }else { |
| | | ints = Arrays.copyOfRange(ints, ints.length / 2-1,ints.length-1); |
| | | } |
| | | } |
| | | }else { |
| | | ints = Arrays.copyOfRange(wcsRow, (wcsRow.length+2-1) / 2,wcsRow.length ); |
| | | if (split[4].equals("01")){ |
| | | if (ints.length<2){ |
| | | |
| | | }else { |
| | | ints = Arrays.copyOfRange(ints, ints.length / 2-1,ints.length-1); |
| | | } |
| | | }else { |
| | | if (ints.length<2){ |
| | | |
| | | }else { |
| | | ints = Arrays.copyOfRange(ints, ints.length / 2, ints.length); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | int i = ints[0]; |
| | | String wcsLocNo = ""; |
| | | Integer bay = Integer.parseInt(split[1])+1; |
| | | String bay2 = ""; |
| | | if (bay>9){ |
| | | bay2 = bay.toString(); |
| | | }else { |
| | | bay2 = "0"+bay; |
| | | } |
| | | if (i>9){ |
| | | wcsLocNo = i+"0"+bay2+split[2]; |
| | | }else { |
| | | wcsLocNo = "0"+i+"0"+bay2+split[2]; |
| | | } |
| | | |
| | | |
| | | |
| | | return wcsLocNo; |
| | | } |
| | | public static int[] getWcsRow(String row){ |
| | | int[] array = null; |
| | | switch (row){ |
| | | case "01": |
| | | array= new int[]{1, 2, 3, 4}; |
| | | break; |
| | | case "02": |
| | | array= new int[]{5,6}; |
| | | break; |
| | | case "03": |
| | | array= new int[]{7,8,9,10}; |
| | | break; |
| | | case "04": |
| | | array= new int[]{11,12,13,14}; |
| | | break; |
| | | case "05": |
| | | array= new int[]{15,16,17,18}; |
| | | break; |
| | | case "06": |
| | | array= new int[]{19,20,21}; |
| | | break; |
| | | default: |
| | | |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | public static float scale(Float f){ |
| | | if (f == null || f == 0f || Float.isNaN(f)) { |
| | | return 0f; |
| | |
| | | // slaveProperties.setGroupCount(4); |
| | | // Integer deepRow = getDeepRow(slaveProperties, 6); |
| | | // System.out.println(deepRow); |
| | | String wcsLocNo = getWcsLocNo("01-01-01-01-01"); |
| | | System.out.println(wcsLocNo); |
| | | } |
| | | |
| | | public static Integer StaNoCrnNo(Integer staNo) { |
| | |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import org.springframework.cache.annotation.CachingConfigurerSupport; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.data.redis.connection.RedisConnectionFactory; |
| | | import org.springframework.data.redis.core.*; |
| | | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; |
| | |
| | | * Redisé
置类 |
| | | * Created by vincent on 2019-12-23 |
| | | */ |
| | | //@Configuration |
| | | @Configuration |
| | | //@EnableCaching // å¼å¯æ°æ®ç¼åæºå¶ |
| | | public class RedisConfig extends CachingConfigurerSupport { |
| | | |
| | |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PreDestroy; |
| | | import java.util.ArrayList; |
| | | |
| | | /** |
| | | * WCS主æµç¨ |
| | |
| | | private Thread thread; |
| | | // é¢ç |
| | | private int i = 0; |
| | | |
| | | @Value("${wms.maxCirle}") |
| | | private Integer maxCount; |
| | | |
| | | /** |
| | | * =====>> å¼å§å·¥ä½ |
| | |
| | | |
| | | // å åæºå¼å¸¸ä¿¡æ¯è®°å½ |
| | | mainService.recCrnErr(); |
| | | // å
¥åº ===>> ç©ºæ æ¿åå§åå
¥åº,å车å
¥åºç«æ¾è´§ |
| | | // mainService.storeEmptyPlt(); |
| | | |
| | | // mainService.outOfDevp(); |
| | | |
| | | // å
¶ä» ===>> // å
¥åºåºæ¨¡å¼åæ¢å½æ° |
| | | //ç¯å½¢å¾ªç¯å½æ° |
| | | // mainService.shiftTargetToCyclePoint(); |
| | | // mainService.shiftCyclePointToTarget(); |
| | | i++; |
| | | if (i > 2) { |
| | | //ç¯å½¢å¾ªç¯å½æ° |
| | | mainService.shiftTargetToCyclePoint(); |
| | | mainService.shiftCyclePointToTarget(); |
| | | i = 0; |
| | | } |
| | | |
| | | //èªå¨æ´¾åä»»å¡ |
| | | // mainService.autoDistribute(); |
| | |
| | | name: @pom.build.finalName@ |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | url: jdbc:sqlserver://10.10.10.220:1433;databasename=rywxasrs |
| | | url: jdbc:sqlserver://192.168.4.42:1433;databasename=ynhfasrs |
| | | username: sa |
| | | password: sa@123 |
| | | mvc: |
| | |
| | | # field-strategy: 0 |
| | | |
| | | logging: |
| | | path: /stock/out/@pom.build.finalName@/logs |
| | | path: ./stock/out/@pom.build.finalName@/logs |
| | | |
| | | super: |
| | | pwd: xltys1995 |
| | |
| | | |
| | | #Licenseç¸å
³é
ç½® |
| | | license: |
| | | subject: jdzwcs |
| | | subject: ynhfwcs |
| | | publicAlias: publicCert |
| | | storePass: public_zhongyang_123456789 |
| | | licensePath: license.lic |
| | |
| | | wms: |
| | | #è¾é线æåæ° |
| | | count: 8 |
| | | maxCirle: 3 |
| | | # æ¯å¦å¼å¯ä¸æ¥ |
| | | start: true |
| | | # WMSç³»ç»ip |
| | | #url: 10.32.53.195:8080 |
| | | # WMSç³»ç»ip |
| | | # url: 10.210.157.109:8090 |
| | | url: 10.10.10.222:2410 |
| | | # å
¥åºä»»å¡ç³è¯·æ¥å£ |
| | | #inboundTaskApplyPath: api/InterFace/inboundTaskApply |
| | | inboundTaskApplyPath: api/StereoscopicCallBack/AcceptTaskStatus |
| | | # inboundTaskApplyPath: open/asrs/inboundTaskApply |
| | | # ä»»å¡å¼å§æ¶ï¼WCSåè°WMS |
| | | taskStatusFeedbackPath: api/StereoscopicCallBack/TaskExecCallback |
| | | # ä»»å¡å®æç»ææ¶ï¼WCSåè°WMS |
| | |
| | | var baseUrl = "/jdzwcs"; |
| | | var baseUrl = "/ynwcs"; |
| | | |
| | | // èµå¼ |
| | | function setVal(el, val) { |
| | |
| | | mapInfo = { |
| | | "mapName": "jdzwcs", |
| | | "mapName": "ynhfwcs", |
| | | "rackCount": 13, |
| | | "crnCount": 4, |
| | | "stbCount": 4, |
| | |
| | | var baseUrl = "/jdzwcs"; |
| | | var baseUrl = "/ynwcs"; |
| | | |
| | | // 详æ
çªå£-é«åº¦ |
| | | var detailHeight = '80%'; |