| New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.HttpRequestLog; |
| | | import com.zy.asrs.service.HttpRequestLogService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class HttpRequestLogController extends BaseController { |
| | | |
| | | @Autowired |
| | | private HttpRequestLogService httpRequestLogService; |
| | | |
| | | @RequestMapping(value = "/httpRequestLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(httpRequestLogService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/httpRequestLog/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<HttpRequestLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(HttpRequestLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | wrapper.orderBy("create_time desc"); |
| | | return R.ok(httpRequestLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/httpRequestLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(HttpRequestLog httpRequestLog) { |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/httpRequestLog/update/auth") |
| | | @ManagerAuth |
| | | public R update(HttpRequestLog httpRequestLog){ |
| | | if (Cools.isEmpty(httpRequestLog) || null==httpRequestLog.getId()){ |
| | | return R.error(); |
| | | } |
| | | httpRequestLogService.updateById(httpRequestLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/httpRequestLog/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | httpRequestLogService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/httpRequestLog/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<HttpRequestLog> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("httpRequestLog")); |
| | | convert(map, wrapper); |
| | | List<HttpRequestLog> list = httpRequestLogService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/httpRequestLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<HttpRequestLog> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<HttpRequestLog> page = httpRequestLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (HttpRequestLog httpRequestLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", httpRequestLog.getId()); |
| | | map.put("value", httpRequestLog.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/httpRequestLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<HttpRequestLog> wrapper = new EntityWrapper<HttpRequestLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != httpRequestLogService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(HttpRequestLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.domain.param.*; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.DeviceConfigService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.utils.NotifyUtils; |
| | | import com.zy.common.annotations.OpenApiLog; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.enums.WrkIoType; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.model.protocol.RgvProtocol; |
| | | import com.zy.core.thread.CrnThread; |
| | | import com.zy.core.thread.RgvThread; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | |
| | |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | @Autowired |
| | | private DeviceConfigService deviceConfigService; |
| | | |
| | | //ç§»åºä»»å¡ |
| | | @PostMapping("/createLocMoveTask") |
| | |
| | | // @OpenApiLog(memo = "è·å设å¤ç¶æ") |
| | | public R getDeviceStatus() { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | // //è·åå°è½¦æ°æ® |
| | | // ArrayList<ShuttleProtocol> shuttleProtocols = new ArrayList<>(); |
| | | // List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | // .eq("device_type", String.valueOf(SlaveType.Shuttle))); |
| | | // for (DeviceConfig device : shuttleList) { |
| | | // ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getDeviceNo()); |
| | | // if (shuttleThread == null) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // ShuttleProtocol shuttleProtocol = shuttleThread.getStatus(); |
| | | // if (shuttleProtocol == null) { |
| | | // continue; |
| | | // } |
| | | // shuttleProtocols.add(shuttleProtocol); |
| | | // } |
| | | // |
| | | // //è·åè´§åæåæºæ°æ® |
| | | // ArrayList<ForkLiftProtocol> forkLiftProtocols = new ArrayList<>(); |
| | | // List<DeviceConfig> forkLiftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | // .eq("device_type", String.valueOf(SlaveType.ForkLift))); |
| | | // for (DeviceConfig device : forkLiftList) { |
| | | // ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, device.getDeviceNo()); |
| | | // if (forkLiftThread == null) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // ForkLiftProtocol forkLiftProtocol = forkLiftThread.getStatus(); |
| | | // if (forkLiftProtocol == null) { |
| | | // continue; |
| | | // } |
| | | // forkLiftProtocols.add(forkLiftProtocol); |
| | | // } |
| | | // |
| | | // //è·åæåæºæ°æ® |
| | | // ArrayList<LiftProtocol> liftProtocols = new ArrayList<>(); |
| | | // List<DeviceConfig> liftList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | // .eq("device_type", String.valueOf(SlaveType.Lift))); |
| | | // for (DeviceConfig device : liftList) { |
| | | // LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, device.getDeviceNo()); |
| | | // if (liftThread == null) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // LiftProtocol liftProtocol = liftThread.getStatus(); |
| | | // if (liftProtocol == null) { |
| | | // continue; |
| | | // } |
| | | // liftProtocols.add(liftProtocol); |
| | | // } |
| | | // |
| | | // map.put("shuttle", shuttleProtocols); |
| | | // map.put("forkLift", forkLiftProtocols); |
| | | // map.put("lift", liftProtocols); |
| | | //è·åå åæºæ°æ® |
| | | ArrayList<CrnProtocol> crnProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> crnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Crn))); |
| | | for (DeviceConfig device : crnList) { |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, device.getDeviceNo()); |
| | | if (crnThread == null) { |
| | | continue; |
| | | } |
| | | |
| | | CrnProtocol crnProtocol = crnThread.getStatus(); |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | crnProtocols.add(crnProtocol); |
| | | } |
| | | |
| | | //è·åRGVæ°æ® |
| | | ArrayList<RgvProtocol> rgvProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> rgvList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Rgv))); |
| | | for (DeviceConfig device : rgvList) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, device.getDeviceNo()); |
| | | if (rgvThread == null) { |
| | | continue; |
| | | } |
| | | |
| | | RgvProtocol rgvProtocol = rgvThread.getStatus(); |
| | | if (rgvProtocol == null) { |
| | | continue; |
| | | } |
| | | rgvProtocols.add(rgvProtocol); |
| | | } |
| | | |
| | | map.put("crn", crnList); |
| | | map.put("rgv", rgvList); |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | |
| | | //wmsä»»å¡å· |
| | | private String taskNo; |
| | | |
| | | //æºç« |
| | | private Integer sourceStaNo; |
| | | |
| | | //ç®æ ç« |
| | | private Integer staNo; |
| | | |
| | | //æºåºä½ |
| | | private String sourceLocNo; |
| | | |
| | | //æ¡ç |
| | | private String barcode; |
| | | //åºåºåºä½ |
| | | private String locNo; |
| | | |
| | | //ä»»å¡ä¼å
级 |
| | | private Integer taskPri; |
| | |
| | | @Repository |
| | | public interface ApiLogMapper extends BaseMapper<ApiLog> { |
| | | |
| | | int clearWeekBefore(); |
| | | |
| | | } |
| | |
| | | |
| | | void save(String namespace, String url, String appkey, String ip, String request, String response, boolean success); |
| | | |
| | | boolean clearWeekBefore(); |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean clearWeekBefore() { |
| | | return this.baseMapper.clearWeekBefore() > 0; |
| | | } |
| | | } |
| | |
| | | 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.enums.NotifyMsgType; |
| | | import com.zy.asrs.entity.LocMast; |
| | |
| | | import com.zy.asrs.service.WrkMastLogService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.utils.NotifyUtils; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.core.enums.LocStsType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.enums.WrkIoType; |
| | | import com.zy.core.enums.WrkStsType; |
| | | 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; |
| | |
| | | |
| | | //䏿¥ |
| | | notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.TASK_COMPLETE, JSON.toJSONString(wrkMast)); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | @Transactional |
| | | public void executeMove(){ |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.COMPLETE_MOVE.sts)); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | // ä¿åå·¥ä½ä¸»æ¡£å岿¡£ |
| | | if (!wrkMastLogService.save(wrkMast.getWrkNo())) { |
| | | log.info("ä¿åå·¥ä½å岿¡£[workNo={}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | // å é¤å·¥ä½ä¸»æ¡£ |
| | | if (!wrkMastService.deleteById(wrkMast)) { |
| | | log.info("å é¤å·¥ä½ä¸»æ¡£[workNo={}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | @Transactional |
| | | public void executeCharge(){ |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.COMPLETE_CHARGE.sts)); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | // ä¿åå·¥ä½ä¸»æ¡£å岿¡£ |
| | | if (!wrkMastLogService.save(wrkMast.getWrkNo())) { |
| | | log.info("ä¿åå·¥ä½å岿¡£[workNo={}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | // å é¤å·¥ä½ä¸»æ¡£ |
| | | if (!wrkMastService.deleteById(wrkMast)) { |
| | | log.info("å é¤å·¥ä½ä¸»æ¡£[workNo={}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | |
| | | //䏿¥ |
| | | notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.TASK_CHARGE_COMPLETE, JSON.toJSONString(wrkMast)); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.Arith; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.CrnModeType; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.thread.CrnThread; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Arrays; |
| | | import java.util.Comparator; |
| | | import java.util.HashSet; |
| | | import java.util.Set; |
| | | |
| | | public class Utils { |
| | | |
| | |
| | | } |
| | | return defaultTime; |
| | | } |
| | | |
| | | //è·åå
¥åºä»»å¡å¯ç¨æ |
| | | public static List<Integer> getInTaskEnableRow() { |
| | | List<Integer> list = new ArrayList<>(); |
| | | try { |
| | | RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class); |
| | | WrkMastService wrkMastService = SpringUtils.getBean(WrkMastService.class); |
| | | BasCrnpService basCrnpService = SpringUtils.getBean(BasCrnpService.class); |
| | | |
| | | Integer currentCircleTaskCrnNo = null; |
| | | Object object = redisUtil.get(RedisKeyType.CURRENT_CIRCLE_TASK_CRN_NO.key); |
| | | if (object != null) { |
| | | currentCircleTaskCrnNo = Integer.parseInt(String.valueOf(object)); |
| | | } |
| | | |
| | | Wrapper<BasCrnp> wrapper = new EntityWrapper<BasCrnp>() |
| | | .eq("in_enable", "Y") |
| | | .eq("status", 1); |
| | | |
| | | if (currentCircleTaskCrnNo != null) { |
| | | currentCircleTaskCrnNo = currentCircleTaskCrnNo + 1; |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", currentCircleTaskCrnNo)); |
| | | List<WrkMast> currentCrnTask = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no", currentCircleTaskCrnNo)); |
| | | if (currentCrnTask.size() <= 1) { |
| | | if (basCrnp != null) { |
| | | String controlRowsStr = basCrnp.getControlRows(); |
| | | if(!Cools.isEmpty(controlRowsStr)){ |
| | | List<Integer> rows = JSON.parseArray(controlRowsStr, Integer.class); |
| | | list.addAll(rows); |
| | | wrapper.ne("crn_no", currentCircleTaskCrnNo); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | HashMap<Integer, Integer> map = new HashMap<>(); |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(wrapper); |
| | | |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | Integer crnNo = wrkMast.getCrnNo(); |
| | | map.put(crnNo, map.getOrDefault(crnNo, 0) + 1); |
| | | } |
| | | |
| | | List<BasCrnp> enabledCrnps = new ArrayList<>(); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, basCrnp.getCrnNo()); |
| | | if (crnThread == null) { |
| | | continue; |
| | | } |
| | | CrnProtocol crnProtocol = crnThread.getStatus(); |
| | | if (crnProtocol.getMode() != CrnModeType.AUTO.id) { |
| | | continue; |
| | | } |
| | | enabledCrnps.add(basCrnp); |
| | | } |
| | | |
| | | enabledCrnps.sort(Comparator.comparingInt(o -> map.getOrDefault(o.getCrnNo(), 0))); |
| | | |
| | | for (BasCrnp basCrnp : enabledCrnps) { |
| | | String controlRowsStr = basCrnp.getControlRows(); |
| | | if (Cools.isEmpty(controlRowsStr)) { |
| | | continue; |
| | | } |
| | | List<Integer> rows = JSON.parseArray(controlRowsStr, Integer.class); |
| | | list.addAll(rows); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | |
| | | generator.url="127.0.0.1:3306/wcs"; |
| | | generator.username="root"; |
| | | generator.password="root"; |
| | | generator.table="asr_bas_station_opt"; |
| | | generator.table="sys_http_request_log"; |
| | | // sqlserver |
| | | // generator.sqlOsType = SqlOsType.SQL_SERVER; |
| | | // generator.url="127.0.0.1:1433;databasename=tzskasrs"; |
| | |
| | | |
| | | private String locNo; |
| | | |
| | | private Integer workNo; |
| | | private Integer taskNo; |
| | | |
| | | private Integer taskPri; |
| | | |
| | |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.NavigateNode; |
| | | import com.zy.common.utils.NavigateUtils; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.News; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import com.zy.core.enums.WrkIoType; |
| | | import com.zy.core.enums.WrkStsType; |
| | | import com.zy.core.model.StationObjModel; |
| | |
| | | private NavigateUtils navigateUtils; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | /** |
| | | * çæå·¥ä½å· |
| | |
| | | wrkMast.setWrkSts(WrkStsType.COMPLETE_INBOUND.sts); |
| | | }else if (wrkMast.getIoType() == WrkIoType.OUT.id) { |
| | | wrkMast.setWrkSts(WrkStsType.COMPLETE_OUTBOUND.sts); |
| | | } else if (wrkMast.getIoType() == WrkIoType.SHUTTLE_MOVE.id) { |
| | | wrkMast.setWrkSts(WrkStsType.COMPLETE_MOVE.sts); |
| | | } else if (wrkMast.getIoType() == WrkIoType.SHUTTLE_CHARGE.id) { |
| | | wrkMast.setWrkSts(WrkStsType.COMPLETE_CHARGE.sts); |
| | | } else if (wrkMast.getIoType() == WrkIoType.LOC_MOVE.id) { |
| | | wrkMast.setWrkSts(WrkStsType.COMPLETE_LOC_MOVE.sts); |
| | | } |
| | |
| | | ioPri = param.getTaskPri().doubleValue(); |
| | | } |
| | | |
| | | Integer sourceCrnNo = commonService.findCrnNoByLocNo(sourceLocMast.getLocNo()); |
| | | if (sourceCrnNo == null) { |
| | | throw new CoolException("æªæ¾å°å¯¹åºå åæº"); |
| | | } |
| | | |
| | | Integer crnNo = commonService.findCrnNoByLocNo(locMast.getLocNo()); |
| | | if (crnNo == null) { |
| | | throw new CoolException("æªæ¾å°å¯¹åºå åæº"); |
| | | } |
| | | |
| | | if (!sourceCrnNo.equals(crnNo)) { |
| | | throw new CoolException("æºåºä½åç®æ åºä½ä¸å¨åä¸å··é"); |
| | | } |
| | | |
| | | // è·åå·¥ä½å· |
| | | int workNo = getWorkNo(WrkIoType.LOC_MOVE.id); |
| | | // ä¿å工使¡£ |
| | |
| | | wrkMast.setIoPri(ioPri); |
| | | wrkMast.setSourceLocNo(param.getSourceLocNo()); |
| | | wrkMast.setLocNo(param.getLocNo()); // ç®æ åºä½ |
| | | wrkMast.setCrnNo(crnNo); |
| | | wrkMast.setWmsWrkNo(param.getTaskNo()); |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiTime(now); |
| | |
| | | locMast.setModiTime(new Date()); |
| | | locMastService.updateById(locMast); |
| | | |
| | | //ç¼åè®°å½å½åå½ä»¤å åæºç¼å· |
| | | redisUtil.set(RedisKeyType.CURRENT_CIRCLE_TASK_CRN_NO.key, crnNo, 60 * 60 * 24); |
| | | return true; |
| | | } |
| | | |
| | | //åºåºä»»å¡ |
| | | public boolean createOutTask(CreateOutTaskParam param) { |
| | | Date now = new Date(); |
| | | LocMast locMast = locMastService.queryByLoc(param.getSourceLocNo()); |
| | | LocMast locMast = locMastService.queryByLoc(param.getLocNo()); |
| | | if (null == locMast) { |
| | | throw new CoolException("æºåºä½ä¸åå¨"); |
| | | } |
| | |
| | | throw new CoolException("æªæ¾å°å¯¹åºå åæº"); |
| | | } |
| | | |
| | | Integer sourceStationId = commonService.findOutStationId(crnNo, param.getStaNo()); |
| | | if (sourceStationId == null) { |
| | | throw new CoolException("æªæ¾å°è¾éç®æ ç«ç¹å¯èµ°è¡è·¯å¾"); |
| | | } |
| | | |
| | | // è·åå·¥ä½å· |
| | | int workNo = getWorkNo(WrkIoType.OUT.id); |
| | | // ä¿å工使¡£ |
| | |
| | | wrkMast.setWrkSts(WrkStsType.NEW_OUTBOUND.sts); // å·¥ä½ç¶æï¼101.çæåºåºä»»å¡ |
| | | wrkMast.setIoType(WrkIoType.OUT.id); // å
¥åºåºç¶æï¼ 101.åºåº |
| | | wrkMast.setIoPri(ioPri); |
| | | wrkMast.setSourceLocNo(param.getSourceLocNo()); // æºåºä½ |
| | | wrkMast.setSourceStaNo(param.getSourceStaNo());//æºç« |
| | | wrkMast.setSourceLocNo(locMast.getLocNo()); // æºåºä½ |
| | | wrkMast.setSourceStaNo(sourceStationId);//æºç« |
| | | wrkMast.setStaNo(param.getStaNo());//ç®æ ç« |
| | | wrkMast.setWmsWrkNo(param.getTaskNo()); |
| | | wrkMast.setBarcode(param.getBarcode()); |
| | | wrkMast.setBarcode(locMast.getBarcode()); |
| | | wrkMast.setCrnNo(crnNo); |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiTime(now); |
| | |
| | | |
| | | DEVICE_LOG_KEY("device_log_key_"), |
| | | |
| | | GENERATE_IN_TASK_LIMIT("generate_in_task_limit_"), |
| | | |
| | | GENERATE_FAKE_IN_TASK_LIMIT("generate_fake_in_task_limit_"), |
| | | GENERATE_FAKE_OUT_TASK_LIMIT("generate_fake_out_task_limit_"), |
| | | GENERATE_FAKE_IN_STATION_DATA_LIMIT("generate_fake_in_station_data_limit_"), |
| | | CHECK_OUT_STATION_STAY_TIME_OUT_LIMIT("check_out_station_stay_time_out_limit_"), |
| | | CHECK_IN_STATION_STAY_TIME_OUT_LIMIT("check_in_station_stay_time_out_limit_"), |
| | | |
| | | CURRENT_CIRCLE_TASK_CRN_NO("current_circle_task_crn_no_") |
| | | ; |
| | | |
| | | public String key; |
| | |
| | | |
| | | IN(1, "å
¥åº"), |
| | | OUT(101, "åºåº"), |
| | | SHUTTLE_MOVE(200, "å°è½¦ç§»å¨"), |
| | | LOC_MOVE(201, "ç§»åºä»»å¡"), |
| | | SHUTTLE_CHARGE(300, "å°è½¦å
çµ"), |
| | | PREVIEW_LIFT_MOVE(98, "æåæºé¢è°åº¦ç§»å¨ä»»å¡"), |
| | | MANUAL(99, "æå¨ä»»å¡"), |
| | | ; |
| | |
| | | COMPLETE_OUTBOUND(109, "åºåºå®æ"), |
| | | SETTLE_OUTBOUND(110, "åºåºåºåæ´æ°"), |
| | | |
| | | NEW_CHARGE(201, "çæå
çµä»»å¡"), |
| | | CHARGE_SHUTTLE_RUN(202, "å°è½¦åå¾å
çµæ¡©"), |
| | | CHARGE_SHUTTLE_RUN_COMPLETE(203, "å°è½¦å°è¾¾å
çµæ¡©"), |
| | | CHARGE_SHUTTLE_START_CHARGING(204, "å°è½¦å¼å¯å
çµä¸"), |
| | | CHARGE_SHUTTLE_CHARGING(205, "å°è½¦å
çµä¸"), |
| | | CHARGE_SHUTTLE_CHARGING_COMPLETE(206, "å°è½¦å
çµå®æ"), |
| | | COMPLETE_CHARGE(210, "å
çµä»»å¡å®æ"), |
| | | |
| | | NEW_MOVE(301, "çæè¿ç§»ä»»å¡"), |
| | | MOVE_NEARBY(302, "å°è½¦ç§»å¨è³è¿ç¹ä¸"), |
| | | MOVE_NEARBY_COMPLETE(303, "å°è½¦ç§»å¨è³è¿ç¹å®æ"), |
| | | MOVE_IN_LIFT(304, "å°è½¦è¿å
¥æåæºä¸"), |
| | | MOVE_IN_LIFT_COMPLETE(305, "å°è½¦è¿å
¥æåæºå®æ"), |
| | | MOVE_LIFT_RUN(306, "æåæºæ¬è¿ä¸"), |
| | | MOVE_LIFT_RUN_COMPLETE(307, "æåæºæ¬è¿å®æ"), |
| | | MOVE_OUT_LIFT(308, "å°è½¦è¿åºæåæºä¸"), |
| | | MOVE_OUT_LIFT_COMPLETE(309, "å°è½¦è¿åºæåæºå®æ"), |
| | | MOVE_SHUTTLE(310, "å°è½¦ç§»å¨ä¸"), |
| | | COMPLETE_MOVE(311, "å°è½¦ç§»å¨å®æ"), |
| | | |
| | | NEW_MANUAL(401, "çææå¨ä»»å¡"), |
| | | ANALYZE_MANUAL(402, "æå¨ä»»å¡è§£æ"), |
| | | EXECUTE_MANUAL(403, "æ§è¡æå¨ä»»å¡"), |
| | | COMPLETE_MANUAL(410, "æå¨ä»»å¡å®æ"), |
| | | |
| | | NEW_LOC_MOVE(501, "çæç§»åºä»»å¡"), |
| | | LOC_MOVE_SHUTTLE_RUN(502, "å°è½¦æ¬è¿ä¸"), |
| | | LOC_MOVE_RUN(502, "è®¾å¤æ¬è¿ä¸"), |
| | | LOC_MOVE_RUN_COMPLETE(503, "è®¾å¤æ¬è¿å®æ"), |
| | | COMPLETE_LOC_MOVE(509, "ç§»åºå®æ"), |
| | | ; |
| | | |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.domain.param.CreateInTaskParam; |
| | | import com.zy.asrs.domain.param.CreateOutTaskParam; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.HttpHandler; |
| | |
| | | |
| | | private static Map<Integer,Long> stationStayTimeMap = new HashMap<>(); |
| | | private static String enableFake = "N"; |
| | | private static String fakeRealTaskRequestWms = "N"; |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | |
| | | private CrnOperateProcessUtils crnOperateUtils; |
| | | @Autowired |
| | | private StationOperateProcessUtils stationOperateProcessUtils; |
| | | @Autowired |
| | | private HttpRequestLogService httpRequestLogService; |
| | | |
| | | @Override |
| | | public void run() { |
| | | Config enableFakeConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | if (enableFakeConfig != null) { |
| | | enableFake = enableFakeConfig.getValue(); |
| | | } |
| | | |
| | | Config fakeRealTaskRequestWmsConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "fakeRealTaskRequestWms")); |
| | | if (fakeRealTaskRequestWmsConfig != null) { |
| | | fakeRealTaskRequestWms = fakeRealTaskRequestWmsConfig.getValue(); |
| | | } |
| | | |
| | | //æ£æµå
¥åºç«æ¯å¦æä»»å¡çæï¼å¹¶ä»¿ççææ¨¡æå
¥åºç«ç¹æ°æ® |
| | |
| | | return; |
| | | } |
| | | |
| | | if (fakeRealTaskRequestWms.equals("Y")) { |
| | | return; |
| | | } |
| | | |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | |
| | | return; |
| | | } |
| | | |
| | | if (fakeRealTaskRequestWms.equals("Y")) { |
| | | return; |
| | | } |
| | | |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | |
| | | continue; |
| | | } |
| | | |
| | | Integer sourceStationId = commonService.findOutStationId(crnNo, stationId); |
| | | if (sourceStationId == null) { |
| | | continue; |
| | | } |
| | | |
| | | CreateOutTaskParam taskParam = new CreateOutTaskParam(); |
| | | taskParam.setTaskNo(String.valueOf(commonService.getWorkNo(WrkIoType.OUT.id))); |
| | | taskParam.setSourceStaNo(sourceStationId); |
| | | taskParam.setStaNo(stationId); |
| | | taskParam.setSourceLocNo(locMast.getLocNo()); |
| | | taskParam.setBarcode(locMast.getBarcode()); |
| | | taskParam.setLocNo(locMast.getLocNo()); |
| | | boolean result = commonService.createOutTask(taskParam); |
| | | redisUtil.set(RedisKeyType.GENERATE_FAKE_OUT_TASK_LIMIT.key + stationId, "lock", 15); |
| | | } |
| | |
| | | * å
¥åºç«ï¼æ ¹æ®æ¡ç æ«æçæå
¥åºå·¥ä½æ¡£ |
| | | */ |
| | | public synchronized void generateStoreWrkFile() { |
| | | if (fakeRealTaskRequestWms.equals("N")) { |
| | | return; |
| | | } |
| | | |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | HashMap<String, Object> param = new HashMap<>(); |
| | | param.put("barcode", stationProtocol.getBarcode()); |
| | | param.put("ioType", 1); |
| | | param.put("sourceStaNo", stationProtocol.getStationId()); |
| | | param.put("locType1", stationProtocol.getPalletHeight()); |
| | | Object lock = redisUtil.get(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId); |
| | | if (lock != null) { |
| | | continue; |
| | | } |
| | | |
| | | String response = new HttpHandler.Builder() |
| | | HashMap<String, Object> requestParam = new HashMap<>(); |
| | | String response = null; |
| | | try { |
| | | requestParam.put("barcode", stationProtocol.getBarcode()); |
| | | requestParam.put("sourceStaNo", stationProtocol.getStationId()); |
| | | requestParam.put("locType1", stationProtocol.getPalletHeight()); |
| | | requestParam.put("row", Utils.getInTaskEnableRow()); |
| | | |
| | | response = new HttpHandler.Builder() |
| | | .setUri(wmsUrl) |
| | | .setPath(wmsSystemInUrl) |
| | | .setJson(JSON.toJSONString(param)) |
| | | .setJson(JSON.toJSONString(requestParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | |
| | | StartupDto dto = jsonObject.getObject("data", StartupDto.class); |
| | | |
| | | CreateInTaskParam taskParam = new CreateInTaskParam(); |
| | | taskParam.setTaskNo(String.valueOf(dto.getWorkNo())); |
| | | taskParam.setTaskNo(String.valueOf(dto.getTaskNo())); |
| | | taskParam.setLocNo(dto.getLocNo()); |
| | | taskParam.setTaskPri(dto.getTaskPri()); |
| | | taskParam.setBarcode(stationProtocol.getBarcode()); |
| | | boolean result = commonService.createInTask(taskParam); |
| | | |
| | | News.info("请æ±WMSæ¥å£æåï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response); |
| | | } else { |
| | | News.error("请æ±WMSæ¥å£å¤±è´¥ï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); |
| | | News.error("请æ±WMSæ¥å£å¤±è´¥ï¼ï¼ï¼urlï¼{}ï¼requestï¼{}ï¼responseï¼{}", wmsUrl + wmsSystemInUrl, JSON.toJSONString(requestParam), response); |
| | | } |
| | | |
| | | redisUtil.set(RedisKeyType.GENERATE_IN_TASK_LIMIT.key + stationId, "lock", 10); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | HttpRequestLog httpRequestLog = new HttpRequestLog(); |
| | | httpRequestLog.setName(wmsUrl + wmsSystemInUrl); |
| | | httpRequestLog.setRequest(JSON.toJSONString(requestParam)); |
| | | httpRequestLog.setResponse(response); |
| | | httpRequestLog.setCreateTime(new Date()); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // æ°æ®æ¸²æ |
| | | tableIns = table.render({ |
| | | elem: '#httpRequestLog', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/httpRequestLog/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'id', align: 'center',title: '#ID'} |
| | | ,{field: 'name', align: 'center',title: 'URL'} |
| | | ,{field: 'request', align: 'center',title: '请æ±åæ°'} |
| | | ,{field: 'response', align: 'center',title: 'ååºåæ°'} |
| | | ,{field: 'createTime$', align: 'center',title: 'è¯·æ±æ¶é´'} |
| | | |
| | | ,{fixed: 'right', title:'æä½', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // ç嬿åºäºä»¶ |
| | | table.on('sort(httpRequestLog)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // çå¬å¤´å·¥å
·æ äºä»¶ |
| | | table.on('toolbar(httpRequestLog)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('è¯·éæ©è¦å é¤çæ°æ®', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('ç¡®å®å¯¼åºExcelå', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'httpRequestLog': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/httpRequestLog/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // çå¬è¡å·¥å
·äºä»¶ |
| | | table.on('tool(httpRequestLog)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.id]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* å¼¹çª - æ°å¢ãä¿®æ¹ */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? 'ä¿®æ¹' : 'æ·»å ') + '订åç¶æ', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/httpRequestLog/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* å é¤ */ |
| | | function del(ids) { |
| | | layer.confirm('ç¡®å®è¦å é¤é䏿°æ®åï¼', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/httpRequestLog/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // æç´¢ |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // éç½® |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // æ¶é´éæ©å¨ |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | layDate.render({ |
| | | elem: '#createTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['createTime\\$']:null |
| | | }); |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // å
³éå¨ä½ |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar" id="search-box"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="ç¼å·" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="èµ·å§æ¶é´ - ç»æ¢æ¶é´" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请è¾å
¥" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>æç´¢ |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>éç½® |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table class="layui-hide" id="httpRequestLog" lay-filter="httpRequestLog"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <!-- <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">æ°å¢</button>--> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">å é¤</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导åº</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">ä¿®æ¹</a>--> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">å é¤</a> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/httpRequestLog/httpRequestLog.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表åå¼¹çª --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> |
| | | <input name="id" type="hidden"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="name" placeholder="请è¾å
¥"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="request" placeholder="请è¾å
¥"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="response" placeholder="请è¾å
¥"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="createTime" id="createTime$" placeholder="请è¾å
¥"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">ä¿å</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">åæ¶</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | </html> |
| | | |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 详æ
--> |
| | | <div id="data-detail" class="layer_self_wrap"> |
| | | <form id="detail" class="layui-form"> |
| | | <!-- |
| | | <div class="layui-inline" style="display: none"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>ç¼ããå·ï¼</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="id" class="layui-input" type="text" placeholder="ç¼å·"> |
| | | </div> |
| | | </div> |
| | | --> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">ï¼</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="name" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">ï¼</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="request" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">ï¼</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="response" class="layui-input" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">ï¼</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="createTime$" class="layui-input" type="text" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <hr class="layui-bg-gray"> |
| | | |
| | | <div id="data-detail-btn" class="layui-btn-container layui-form-item"> |
| | | <div id="data-detail-submit-save" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="save">ä¿å</div> |
| | | <div id="data-detail-submit-edit" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="edit">ä¿®æ¹</div> |
| | | <div id="data-detail-close" type="button" class="layui-btn" lay-submit lay-filter="close">å
³é</div> |
| | | </div> |
| | | |
| | | <div id="prompt"> |
| | | 温馨æç¤ºï¼è¯·ä»ç»å¡«åç¸å
³ä¿¡æ¯ï¼<span class="extrude"><span class="not-null">*</span> 为å¿
å¡«é项ã</span> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/httpRequestLog/httpRequestLog.js" charset="utf-8"></script> |
| | | </html> |
| | | |