Merge remote-tracking branch 'origin/lfdasrs-sxkVersion' into lfdasrs-sxkVersion
# Conflicts:
# src/main/java/com/zy/asrs/controller/TVController.java
| | |
| | | import com.core.common.Arith; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.mapper.ReportQueryMapper; |
| | | import com.zy.common.service.CommonService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | import com.core.common.Arith; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.domain.dto.AxisBean; |
| | | import com.zy.asrs.domain.dto.WorkChartAxis; |
| | | import com.zy.asrs.domain.vo.LocChartPie; |
| | | import com.zy.asrs.mapper.ReportQueryMapper; |
| | | import com.zy.common.model.annotations.RateLimit; |
| | | import com.zy.common.properties.SlaveProperties; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.LedSlave; |
| | | import com.zy.core.model.command.LedCommand; |
| | | import com.zy.core.model.protocol.CrnProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.LedThread; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | @Autowired |
| | | private ReportQueryMapper reportQueryMapper; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | |
| | | /** |
| | | * 获取当前时间 |
| | |
| | | Cools.add("xSpeed", Arith.multiplys(1, 0, 1)) // 行走速度 |
| | | .add("ySpeed", Arith.multiplys(1, 60, 1)) // 升降速度 |
| | | .add("zSpeed", Arith.multiplys(1, 30, 1)) // 叉牙速度 |
| | | .add("forkPos", 30) // 叉牙速度 |
| | | .add("forkPos", 25) // 叉牙速度 |
| | | .add("xDistance", Arith.multiplys(1, 0, 1)) // 累计走行距离km |
| | | .add("yDistance", Arith.multiplys(1, 3, 1)) // 累计升降距离km |
| | | .add("yDistance", Arith.multiplys(1, 5, 1)) // 累计升降距离km |
| | | .add("xDuration", Arith.multiplys(1, 0, 1)) // 累计走行时长h |
| | | .add("yDuration", Arith.multiplys(1, 1, 1)) // 累计升降时长h |
| | | .add("isShow", !Cools.isEmpty(200)) // 是否显示内容 |
| | | .add("content", 200) // 显示内容 |
| | | .add("yDuration", Arith.multiplys(1, 2, 1)) // 累计升降时长h |
| | | .add("isShow", !Cools.isEmpty(1)) // 是否显示内容 |
| | | .add("content", 1) // 显示内容 |
| | | ); |
| | | } |
| | | |
| | |
| | | */ |
| | | @GetMapping("/led") |
| | | public R monitorLed(@RequestParam("ledId") Integer ledId) { |
| | | String ledContent = ""; |
| | | List<LedCommand> commandList = null; |
| | | for (LedSlave slave : slaveProperties.getLed()) { |
| | | if (slave.getStaArr().contains(ledId)) { |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, slave.getId()); |
| | | if (null != ledThread) { |
| | | ledContent = ledThread.getStringBuffer().toString(); |
| | | commandList = ledThread.getCommandList(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok().add(commandList); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping("/led/error") |
| | | public R monitorLedError(@RequestParam("ledId") Integer ledId) { |
| | | String errorMsg = ""; |
| | | for (LedSlave slave : slaveProperties.getLed()) { |
| | | if (slave.getStaArr().contains(ledId)) { |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, slave.getId()); |
| | | if (null != ledThread) { |
| | | errorMsg = ledThread.getErrorMsg().toString(); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok().add(errorMsg); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * x轴单位转换 |
| | | * |
| | | * @param dot y轴数值保留小数位 |
| | | */ |
| | | private List<Map<String, Object>> convert(List<Map<String, Object>> list, StatsType statsType, int dot){ |
| | |
| | | int id; |
| | | int start; |
| | | int end; |
| | | |
| | | StatsType(int id, int start, int end) { |
| | | this.id = id; |
| | | this.start = start; |
| | | this.end = end; |
| | | } |
| | | |
| | | static StatsType get(int id) { |
| | | StatsType[] values = StatsType.values(); |
| | | for (StatsType statsType : values){ |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.zy.asrs.domain.dto; |
| | | |
| | | /** |
| | | * 曲线图表json键 |
| | | * @author admin |
| | | * |
| | | */ |
| | | public class AxisBean { |
| | | private String name; |
| | | private Integer[] data; |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | public Integer[] getData() { |
| | | return data; |
| | | } |
| | | public void setData(Integer[] data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.dto; |
| | | |
| | | /** |
| | | * 入出库统计曲线图 |
| | | * @author admin |
| | | * @date 2018年12月12日 |
| | | */ |
| | | public class WorkChartAxis { |
| | | private String ymd; |
| | | private int inqty; |
| | | private int outqty; |
| | | |
| | | public String getYmd() { |
| | | return ymd; |
| | | } |
| | | public void setYmd(String ymd) { |
| | | this.ymd = ymd; |
| | | } |
| | | public int getInqty() { |
| | | return inqty; |
| | | } |
| | | public void setInqty(int inqty) { |
| | | this.inqty = inqty; |
| | | } |
| | | public int getOutqty() { |
| | | return outqty; |
| | | } |
| | | public void setOutqty(int outqty) { |
| | | this.outqty = outqty; |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.enums; |
| | | |
| | | /** |
| | | * 堆垛机状态枚举 |
| | | */ |
| | | public enum CrnStatusType { |
| | | |
| | | // 入库 |
| | | MACHINE_PAKIN("入库"), |
| | | // 出库 |
| | | MACHINE_PAKOUT("出库"), |
| | | // 库到库 |
| | | MACHINE_STOCK_MOVE("库到库"), |
| | | // 站到站 |
| | | MACHINE_SITE_MOVE("站到站"), |
| | | // p to p |
| | | MACHINE_P_MOVE("PToP"), |
| | | // 异常 |
| | | MACHINE_ERROR("异常"), |
| | | // 自动 |
| | | MACHINE_AUTO("自动"), |
| | | // 非自动/手动 |
| | | MACHINE_UN_AUTO("非自动"), |
| | | ; |
| | | |
| | | private String desc; |
| | | CrnStatusType(String desc){ |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String getDesc() { |
| | | return desc; |
| | | } |
| | | |
| | | public void setDesc(String desc) { |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public static CrnStatusType process(Integer ioType){ |
| | | if (ioType>100) { |
| | | return MACHINE_PAKOUT; |
| | | } else if (ioType < 100 && ioType!=3 && ioType!=6 && ioType!=11) { |
| | | return MACHINE_PAKIN; |
| | | } else if (ioType == 3) { |
| | | return MACHINE_SITE_MOVE; |
| | | } else if (ioType == 11) { |
| | | return MACHINE_STOCK_MOVE; |
| | | } else { |
| | | return MACHINE_ERROR; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.enums; |
| | | |
| | | |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | |
| | | /** |
| | | * 站点状态枚举 |
| | | */ |
| | | public enum SiteStatusType { |
| | | |
| | | // 自动 |
| | | SITE_AUTO, |
| | | // 非自动 |
| | | SITE_UNAUTO, |
| | | // 自动+有物+ID |
| | | SITE_AUTO_RUN_ID, |
| | | // 自动+有物 |
| | | SITE_AUTO_RUN, |
| | | // 自动+ID |
| | | SITE_AUTO_ID, |
| | | |
| | | ; |
| | | |
| | | public static SiteStatusType process(StaProtocol staProtocol){ |
| | | if (staProtocol == null) { |
| | | return null; |
| | | } |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() > 0) { |
| | | return SITE_AUTO_RUN_ID; |
| | | } |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading()) { |
| | | return SITE_AUTO_RUN; |
| | | } |
| | | if (staProtocol.isAutoing() && staProtocol.getWorkNo() > 0) { |
| | | return SITE_AUTO_ID; |
| | | } |
| | | if (staProtocol.isAutoing()) { |
| | | return SITE_AUTO; |
| | | } |
| | | if (!staProtocol.isAutoing()) { |
| | | return SITE_UNAUTO; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.enums; |
| | | |
| | | import com.core.exception.CoolException; |
| | | |
| | | /** |
| | | * 工作号排序规则 |
| | | */ |
| | | public enum WorkNoType { |
| | | |
| | | PAKIN(0), |
| | | PICK(1), |
| | | PAKOUT(2), |
| | | OTHER(3), |
| | | ; |
| | | |
| | | public Integer type; |
| | | |
| | | WorkNoType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public static Integer getWorkNoType(Integer ioType) { |
| | | switch (ioType) { |
| | | case 1: |
| | | return PAKIN.type; |
| | | case 10: |
| | | return PAKIN.type; |
| | | case 11: |
| | | return PICK.type; |
| | | case 53: |
| | | case 54: |
| | | case 57: |
| | | return PICK.type; |
| | | case 101: |
| | | return PAKOUT.type; |
| | | case 103: |
| | | case 104: |
| | | case 107: |
| | | return PICK.type; |
| | | case 110: |
| | | return PAKOUT.type; |
| | | default: |
| | | break; |
| | | } |
| | | throw new CoolException(ioType + "的任务类型无法生成工作号"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 堆垛机演示操作入参 |
| | | * Created by vincent on 2020-06-03 |
| | | */ |
| | | @Data |
| | | public class CrnDemoParam { |
| | | |
| | | // 操作类型 1: 打开; 0: 关闭 |
| | | private Integer crnId; |
| | | |
| | | // 密码口令 |
| | | private String password; |
| | | |
| | | private Boolean opt; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class CrnOperatorParam { |
| | | |
| | | // 堆垛机号 |
| | | private Integer crnNo; |
| | | |
| | | // 源站 |
| | | private Short sourceStaNo; |
| | | |
| | | // 源库位-排 |
| | | private Short sourceRow; |
| | | |
| | | // 源库位-列 |
| | | private Short sourceBay; |
| | | |
| | | // 源库位-层 |
| | | private Short sourceLev; |
| | | |
| | | // 目标站 |
| | | private Short staNo; |
| | | |
| | | // 目标库位-排 |
| | | private Short row; |
| | | |
| | | // 目标库位-列 |
| | | private Short bay; |
| | | |
| | | // 目标库位-层 |
| | | private Short lev; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.param; |
| | | |
| | | /** |
| | | * 系统运行状态操作入参 |
| | | * Created by vincent on 2020-06-03 |
| | | */ |
| | | public class SystemSwitchParam { |
| | | |
| | | // 操作类型 1: 打开; 0: 关闭 |
| | | private Integer operatorType; |
| | | |
| | | // 密码口令 |
| | | private String password; |
| | | |
| | | public Integer getOperatorType() { |
| | | return operatorType; |
| | | } |
| | | |
| | | public void setOperatorType(Integer operatorType) { |
| | | this.operatorType = operatorType; |
| | | } |
| | | |
| | | public String getPassword() { |
| | | return password; |
| | | } |
| | | |
| | | public void setPassword(String password) { |
| | | this.password = password; |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 扫码器实时数据视图对象 |
| | | * Created by vincent on 2020-06-03 |
| | | */ |
| | | @Data |
| | | public class BarcodeDataVo { |
| | | |
| | | // 扫码器编号 |
| | | private Integer barcodeId; |
| | | |
| | | // 扫码器内容 |
| | | private String codeValue; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class CommandLogVo { |
| | | |
| | | // 堆垛机编号 |
| | | private Integer crnNo; |
| | | |
| | | // 状态 |
| | | private Integer status; |
| | | |
| | | // 命令报文 |
| | | private String command; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 堆垛机详情视图对象 |
| | | * Created by vincent on 2020-06-03 |
| | | */ |
| | | @Data |
| | | public class CrnDetailVo { |
| | | |
| | | // 堆垛机号 |
| | | private Integer crnNo; |
| | | |
| | | // 工作号 |
| | | private Short workNo; |
| | | |
| | | // 源站 |
| | | private String sourceStaNo = ""; |
| | | |
| | | // 目标站 |
| | | private String staNo = ""; |
| | | |
| | | // 工作状态 |
| | | private String wrkSts = ""; |
| | | |
| | | // 出入类型 |
| | | private String ioType = ""; |
| | | |
| | | // 源库位 |
| | | private String sourceLocNo = ""; |
| | | |
| | | // 目标库位 |
| | | private String locNo = ""; |
| | | |
| | | // 堆垛机状态 |
| | | private String crnStatus = ""; |
| | | |
| | | // 异常 |
| | | private String error = ""; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import com.zy.asrs.domain.enums.CrnStatusType; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 堆垛机最新数据视图对象 |
| | | * Created by vincent on 2020-06-01 |
| | | */ |
| | | @Data |
| | | public class CrnLatestDataVo { |
| | | |
| | | // 堆垛机编号 |
| | | private Integer crnId; |
| | | |
| | | // 偏移量 |
| | | private Double offset; |
| | | |
| | | // 当前列 |
| | | private Short bay; |
| | | |
| | | private CrnStatusType crnStatus; |
| | | |
| | | public String getCrnStatus(){ |
| | | return crnStatus.toString().toLowerCase().replaceAll("_", "-"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import com.zy.asrs.utils.Utils; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class CrnMsgTableVo { |
| | | |
| | | // 堆垛机号 |
| | | private Integer crnNo; |
| | | |
| | | // 工作号 |
| | | private Short workNo = 0; |
| | | |
| | | // 状态 |
| | | private String status = "-"; |
| | | |
| | | // 源站 |
| | | private String sourceStaNo = "-"; |
| | | |
| | | // 目标站 |
| | | private String staNo = "-"; |
| | | |
| | | // 源库位 |
| | | private String sourceLocNo = "-"; |
| | | |
| | | // 目标库位 |
| | | private String locNo = "-"; |
| | | |
| | | // 异常 |
| | | private String error = ""; |
| | | |
| | | // 原点 |
| | | private String origin = ""; |
| | | |
| | | // 命令 |
| | | private String command = ""; |
| | | |
| | | // 走行速度(m/min) |
| | | private Float xspeed = 0.0F; |
| | | |
| | | // 升降速度(m/min) |
| | | private Float yspeed = 0.0F; |
| | | |
| | | // 叉牙速度(m/min) |
| | | private Float zspeed = 0.0F; |
| | | |
| | | // 走行距离(Km) |
| | | private Float xdistance = 0.0F; |
| | | |
| | | // 升降距离(Km) |
| | | private Float ydistance = 0.0F; |
| | | |
| | | // 走行时长(H) |
| | | private Float xduration = 0.0F; |
| | | |
| | | // 升降时长(H) |
| | | private Float yduration = 0.0F; |
| | | |
| | | public void setXspeed(Float xspeed) { |
| | | this.xspeed = Utils.scale(xspeed); |
| | | } |
| | | |
| | | public void setYspeed(Float yspeed) { |
| | | this.yspeed = Utils.scale(yspeed); |
| | | } |
| | | |
| | | public void setZspeed(Float zspeed) { |
| | | this.zspeed = Utils.scale(zspeed); |
| | | } |
| | | |
| | | public void setXdistance(Float xdistance) { |
| | | this.xdistance = Utils.scale(xdistance); |
| | | } |
| | | |
| | | public void setYdistance(Float ydistance) { |
| | | this.ydistance = Utils.scale(ydistance); |
| | | } |
| | | |
| | | public void setXduration(Float xduration) { |
| | | this.xduration = Utils.scale(xduration); |
| | | } |
| | | |
| | | public void setYduration(Float yduration) { |
| | | this.yduration = Utils.scale(yduration); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class CrnStateTableVo { |
| | | |
| | | // 堆垛机号 |
| | | private Integer crnNo; |
| | | |
| | | // 模式 |
| | | private String statusType = "-"; |
| | | |
| | | // 有物 |
| | | private String loading = "-"; |
| | | |
| | | // 列 |
| | | private Short bay; |
| | | |
| | | // 层 |
| | | private Short lev; |
| | | |
| | | // 走行原点 |
| | | private String xOrigin = "-"; |
| | | |
| | | // 升降原点 |
| | | private String yOrigin = "-"; |
| | | |
| | | // 货叉位置 |
| | | private String forkOffset = "-"; |
| | | |
| | | // 载货台位置 |
| | | private String liftPos = "-"; |
| | | |
| | | // 走行定位 |
| | | private String walkPos = "-"; |
| | | |
| | | // 急停 |
| | | private String stop = "-"; |
| | | |
| | | // 列坐标 |
| | | private String bayCoor = "-"; |
| | | |
| | | // 层坐标 |
| | | private String levCoor = "-"; |
| | | |
| | | // 完成 |
| | | private String complete = "-"; |
| | | |
| | | // 任务号 |
| | | private Short workNo = 0; |
| | | |
| | | // 状态 |
| | | private String status = "-"; |
| | | |
| | | // 异常码 |
| | | private String warnCode = "-"; |
| | | |
| | | // 垂直故障码 |
| | | private String alarm = "-"; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | /** |
| | | * 库位占用百分比 |
| | | * @author admin |
| | | * @date 2018年12月12日 |
| | | */ |
| | | public class LocChartPie { |
| | | private int fqty; |
| | | private int oqty; |
| | | private int uqty; |
| | | private int xqty; |
| | | public int getFqty() { |
| | | return fqty; |
| | | } |
| | | public void setFqty(int fqty) { |
| | | this.fqty = fqty; |
| | | } |
| | | public int getOqty() { |
| | | return oqty; |
| | | } |
| | | public void setOqty(int oqty) { |
| | | this.oqty = oqty; |
| | | } |
| | | public int getUqty() { |
| | | return uqty; |
| | | } |
| | | public void setUqty(int uqty) { |
| | | this.uqty = uqty; |
| | | } |
| | | public int getXqty() { |
| | | return xqty; |
| | | } |
| | | public void setXqty(int xqty) { |
| | | this.xqty = xqty; |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class PlcErrorTableVo { |
| | | |
| | | // 序号 |
| | | private Integer no; |
| | | |
| | | // plc异常描述 |
| | | private String plcDesc; |
| | | |
| | | // 异常 |
| | | private String error; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 磅秤实时数据视图对象 |
| | | * Created by vincent on 2020-06-03 |
| | | */ |
| | | @Data |
| | | public class ScaleDataVo { |
| | | |
| | | // 磅秤编号 |
| | | private Integer scaleId; |
| | | |
| | | // 磅秤内容 |
| | | private String value; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 输送设备详情视图对象 |
| | | * Created by vincent on 2020-06-03 |
| | | */ |
| | | @Data |
| | | public class SiteDetailVo { |
| | | |
| | | // 站点编号 |
| | | private Integer siteId; |
| | | |
| | | // 工作号 |
| | | private Short workNo; |
| | | |
| | | // 工作状态 |
| | | private String wrkSts = ""; |
| | | |
| | | // 自动 |
| | | private String autoing; |
| | | |
| | | // 有物 |
| | | private String loading; |
| | | |
| | | // 能入 |
| | | private String canining; |
| | | |
| | | // 能出 |
| | | private String canouting; |
| | | |
| | | // 出入类型 |
| | | private String ioType = ""; |
| | | |
| | | // 源站 |
| | | private String sourceStaNo = ""; |
| | | |
| | | // 目标站 |
| | | private String staNo = ""; |
| | | |
| | | // 源库位 |
| | | private String sourceLocNo = ""; |
| | | |
| | | // 目标库位 |
| | | private String locNo = ""; |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import com.zy.asrs.domain.enums.SiteStatusType; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 站点最新数据视图对象 |
| | | * Created by vincent on 2020-06-01 |
| | | */ |
| | | @Data |
| | | public class SiteLatestDataVo { |
| | | |
| | | // 站点编号 |
| | | private String siteId; |
| | | |
| | | // 工作号 |
| | | private Short workNo; |
| | | |
| | | // 站点状态 |
| | | private SiteStatusType siteStatus; |
| | | |
| | | // 隔壁站点(台车特性) |
| | | private String nearbySta; |
| | | |
| | | public String getSiteStatus() { |
| | | return siteStatus.toString().toLowerCase().replaceAll("_", "-"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020-06-02 |
| | | */ |
| | | @Data |
| | | public class SiteTableVo { |
| | | |
| | | // 站号 |
| | | private Integer devNo; |
| | | |
| | | // 工作号 |
| | | private Short workNo = 0; |
| | | |
| | | // 自动 |
| | | private String autoing = "-"; |
| | | |
| | | // 有物 |
| | | private String loading = "-"; |
| | | |
| | | // 可入 |
| | | private String inEnable = "-"; |
| | | |
| | | // 可出 |
| | | private String outEnable = "-"; |
| | | |
| | | // 需求1 |
| | | private String pakMk = "-"; |
| | | |
| | | // 空板信号 |
| | | private String emptyMk = "-"; |
| | | |
| | | // 目标站 |
| | | private Short staNo = 0; |
| | | |
| | | //高低库位 |
| | | private String locType1 = "-"; |
| | | } |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.domain.dto.WorkChartAxis; |
| | | import com.zy.asrs.domain.vo.LocChartPie; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface ReportQueryMapper { |
| | | |
| | | //分页查询库位使用率 |
| | | List<ViewStockUseBean> queryViewStockUseList(ViewStockUseBean viewStockUse); |
| | | int getViewStockUseCount(ViewStockUseBean viewStockUse); |
| | | List<ViewStockUseBean> getViewStockUseAll(ViewStockUseBean viewStockUse); |
| | | |
| | | //分页查询库存滞留时间 |
| | | public List<ViewStayTimeBean> queryViewStayTimeList(ViewStayTimeBean viewStayTime); |
| | | public int getViewStayTimeCount(ViewStayTimeBean viewStayTime); |
| | | //不分页查询所有信息,用于excel导出 |
| | | public List<ViewStayTimeBean> getViewStayTimeAll(ViewStayTimeBean viewStayTime); |
| | | @Select("select \n" + |
| | | "Min(wm.io_time) as node,\n" + |
| | | "isnull(count(1), 0) as val\n" + |
| | | "from asr_wrk_mast_log wm\n" + |
| | | "where wm.wrk_sts = 5 \n" + |
| | | "and (wm.io_type = 1 OR wm.io_type = 54)\n" + |
| | | "and datediff(d, wm.io_time, getdate())<=7 \n" + |
| | | "group by datediff(day,wm.io_time,getdate())\n" + |
| | | "order by Min(wm.io_time) asc\n") |
| | | List<Map<String, Object>> queryPakinRep(); |
| | | |
| | | // // 库位Map |
| | | @Select("select distinct row1 from asr_loc_mast order by row1 asc") |
| | | List<Integer> getViewLocRowTotal(); |
| | | @Select("select\n" + |
| | | "Min(wm.io_time) as node,\n" + |
| | | "isnull(count(1), 0) as val\n" + |
| | | "from asr_wrk_mast_log wm\n" + |
| | | "where 1=1\n" + |
| | | "and ((wm.wrk_sts = 15 AND wm.io_type = 101) OR (wm.wrk_sts = 14 AND wm.io_type = 103))\n" + |
| | | "and datediff(d, wm.io_time, getdate())<=7\n" + |
| | | "group by datediff(day,wm.io_time,getdate())\n" + |
| | | "order by Min(wm.io_time) asc") |
| | | List<Map<String, Object>> queryPakOutRep(); |
| | | |
| | | @Select("select distinct lev1 from asr_loc_mast where row1=#{row1} order by lev1 desc") |
| | | public List<String> getViewLocLevCount(@Param("row1") int row1); |
| | | // |
| | | @Select("select loc_no as locNo, bay1,loc_sts as locSts from asr_loc_mast where row1=#{row1} and lev1=#{lev1} order by bay1") |
| | | public List<ViewLocMapDto> getViewLocBays(@Param("row1") int row1, @Param("lev1") int lev1); |
| | | |
| | | // 库位Map |
| | | @Select("select distinct bay1 from asr_loc_mast where row1=#{row1} order by bay1") |
| | | public List<String> getViewLocBayCount(@Param("row1") int row1); |
| | | |
| | | @Select("select lev1,loc_sts as locSts from asr_loc_mast where row1=#{row1} and bay1=#{bay1} order by bay1") |
| | | public List<ViewLocMapDto> getViewLocLevs(@Param("row1") int row1, @Param("bay1") int bay1); |
| | | |
| | | |
| | | //分页查询站点入出库次数统计 |
| | | public List<ViewInOutBean> queryViewInOutList(ViewInOutBean viewInOut); |
| | | public int getViewInOutCount(ViewInOutBean viewInOut); |
| | | //不分页查询所有信息,用于excel导出 |
| | | public List<ViewInOutBean> getViewInOutAll(ViewInOutBean viewInOut); |
| | | |
| | | //分页查询日入库记录 |
| | | public List<ViewWorkInBean> queryViewWorkInList(ViewWorkInBean viewWorkIn); |
| | | public int getViewWorkInCount(ViewWorkInBean viewWorkIn); |
| | | //不分页查询所有信息,用于excel导出 |
| | | public List<ViewWorkInBean> getViewWorkInAll(ViewWorkInBean viewWorkIn); |
| | | |
| | | //分页查询日出库记录 |
| | | public List<ViewWorkInBean> queryViewWorkOutList(ViewWorkInBean viewWorkOut); |
| | | public int getViewWorkOutCount(ViewWorkInBean viewWorkOut); |
| | | //不分页查询所有信息,用于excel导出 |
| | | public List<ViewWorkInBean> getViewWorkOutAll(ViewWorkInBean viewWorkOut); |
| | | |
| | | |
| | | // ------图表 |
| | | //饼状图 |
| | | @Select("select * from asr_loc_use_view") |
| | | public LocChartPie getLocUseRate(); |
| | | //曲线图 |
| | | @Select("select ymd,SUM(sto_qty) inqty,SUM(ret_qty) outqty from asr_sta_inout_view " |
| | | + "where ymd>CONVERT(char(10), DATEADD(DAY,-12,GETDATE()), 120) group by ymd order by ymd") |
| | | public List<WorkChartAxis> getChartAxis(); |
| | | |
| | | List<ViewWorkCountInView> selectWorkCountIn(@Param("curr") Integer curr, @Param("limit") Integer limit, @Param("matnr")String matnr, @Param("start") String startTime, @Param("end") String endTime); |
| | | @Select("select * from asr_loc_use_view") |
| | | LocChartPie getLocUseRate(); |
| | | |
| | | Integer selectWorkCountInTotal(String matnr, @Param("start") String startTime, @Param("end") String endTime); |
| | | @Select("select count(1) as totalWrk from asr_wrk_mast_log where crn_no = #{crnNo}") |
| | | Integer getTotalWrkByCrnId(Integer crnNo); |
| | | |
| | | List<ViewWorkCountInView> selectWorkCountOut(@Param("curr") Integer pageNumber, @Param("limit") Integer pageSize, String matnr, @Param("start") String startTime, @Param("end") String endTime); |
| | | @Select("select count(1) as totalLoc from asr_loc_mast") |
| | | Integer getTotalLocByCrnId(); |
| | | |
| | | Integer selectWorkCountOutTotal(String matnr, @Param("start") String startTime, @Param("end") String endTime); |
| | | |
| | | Integer selectWorkCountInSum(String matnr, @Param("start") String startTime, @Param("end") String endTime); |
| | | |
| | | Integer selectWorkCountOutSum(String matnr, @Param("start") String startTime, @Param("end") String endTime); |
| | | } |
New file |
| | |
| | | package com.zy.common.model.annotations; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | //接口频率限制 |
| | | @Target({ElementType.TYPE, ElementType.METHOD}) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface RateLimit { |
| | | |
| | | int value();//接口频率 |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.common.model.annotations; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 标识注解类 |
| | | * @author vincent |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target({ElementType.FIELD,ElementType.TYPE,ElementType.METHOD}) |
| | | public @interface bit { |
| | | int value(); |
| | | } |
New file |
| | |
| | | package com.zy.common.model.annotations; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 标识注解类 |
| | | * @author vincent |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target({ElementType.FIELD,ElementType.TYPE,ElementType.METHOD}) |
| | | public @interface expr { |
| | | String value(); |
| | | } |
New file |
| | |
| | | package com.zy.common.model.annotations; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 标识注解类 |
| | | * @author vincent |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target({ElementType.FIELD,ElementType.TYPE,ElementType.METHOD}) |
| | | public @interface flag { |
| | | String value(); |
| | | } |
New file |
| | |
| | | package com.zy.common.model.annotations; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 小端模式注解类 |
| | | * @author vincent |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target({ElementType.FIELD,ElementType.TYPE,ElementType.METHOD}) |
| | | public @interface little {} |
New file |
| | |
| | | package com.zy.common.model.annotations; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * 标识注解类 |
| | | * @author vincent |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target({ElementType.FIELD,ElementType.TYPE,ElementType.METHOD}) |
| | | public @interface size { |
| | | int value(); |
| | | } |
| | |
| | | int type=Cools.isEmpty(waitPakins.get(0).getBeBatch())?1:waitPakins.get(0).getBeBatch(); |
| | | // 检索库位 |
| | | locMast1 =commonService.getLocNo2(waitPakins.get(0),arr,0,type,1); |
| | | |
| | | int mbz=devpNo*10+Integer.valueOf(locMast1.getLocNo().substring(6)); |
| | | //正常入库 |
| | | workNo = commonService.getWorkNo(0); |
| | | Date now = new Date(); |
| | |
| | | wrkMast.setIoType(1); // 入出库状态:1.入库 |
| | | wrkMast.setIoPri(13D); // 优先级 |
| | | wrkMast.setSourceStaNo(devpNo); |
| | | wrkMast.setStaNo(mbz); |
| | | wrkMast.setLocNo(locMast1.getLocNo()); |
| | | wrkMast.setBarcode(barcode); // 托盘码 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |