Commit c418729a sunke

Qisda Init

0 个父辈
正在显示 1000 个修改的文件 包含 4851 行增加0 行删除

要显示的修改太多。

为保证性能只显示 1000 of 1000+ 个文件。

# Created by .ignore support plugin (hsz.mobi)
### Java template
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
/.idea/
/myproject/target/
/myproject/logs/
To get started, please complete the following steps:
1. Download and install a MySQL 5.x database from
http://dev.mysql.com/downloads/mysql/5.0.html#downloads.
2. Install maven 3.x, and configure it.
3. Modify the jdbc property in the pom.xml of myproject, make sure the
jdbc url, username and password is correct.
4. Run "mvn install" to install the parent pom.xml to your local repository.
5. Run "mvn jetty:run" under myproject, and view the application at http://localhost:8080.
It takes long time to download jars at the first time, so be patient.
By the way, there wasn't data in your database, so you need run "mvn dbunit:operation"
to insert the basic data to your DB. Use admin/admin to login the system.
6. If you want to make a war file, just run "mvn package -DskipTests" under myproject,
it will generate a war file under myproject/target.
C:\Windows\system32>mongod --storageEngine=mmapv1 --logappend --directoryperdb --serviceName MongoDB --install
打印机静默打印: Chrome快捷方式增加:--kiosk-printing
--disable-print-preview
###安装Mongodb服务
1、创建 D:\MongoDB 及 D:\MongoDB\data 和 D:\MongoDB\logs 目录
2、执行 mongod --storageEngine=mmapv1 --journal --logpath D:\MongoDB\logs\MongoDB.log --logappend --dbpath D:\MongoDB\data --directoryperdb --serviceName MongoDB --install
移除MongoDB:
sc delete MongoDB
mongod --auth -dbpath D:\MongoDB\data --repair
mac mongo 启动:
sudo mongod -config /usr/local/etc/mongod.conf
Tomcat 8 启动时会出现 webresources.Cache.getResource Unable to add the resource at 的错误,需要在Tomcat的在 /conf/context.xml 的 </Context>前添加以下内容:
<Resources cachingAllowed="true" cacheMaxSize="100000" />
//备份
mongodump -h dbhost -d dbname -o dbdirectory
"C:\Program Files\MongoDB\Server\3.2\bin\mongodump" -d storage -o D:\storage
mongodump -h192.168.3.124 -d storage -o D:\MongoDB\
//还原
mongorestore -h <hostname><:port> -d dbname <path>
##网络
双层线路由(192.168.103.1):
WAN 1 IP: 10.85.160.20
网关: 10.85.160.254
DNS: 10.85.71.1 , 10.85.71.2
包装料2(box21和22)
IP: 10.85.160.181
服务器IP: 10.85.160.25 内网IP: 192.168.101.11
##佳世达接口说明:
1. 皮带线扫码后调用,用于获取尺寸后升起气缸
> 地址:
>>/rest/api/qisda/device/getSize
>
> 参数:
>> - robotIndex=机器人编号,IP为51的机器人为1, 52的机器人为2, 53的机器人为3,
>> - barcode=扫到的条码
>
> 返回:
>>`{"code": 0, "msg":"ok", data:7}`
>>
>> - code: 0为正常,其他为异常;
>> - msg: 消息
>> - data: 料盘直径,=7时升起气缸
2. 料盘流转位置信息更新
>地址:
>>rest/api/qisda/device/updateLocInfo
>
>参数:
>> - barcode=料盘的条码
>> - status=状态信息,移栽=MOVING,流水线=INLINE,皮带线=INBELT
>> - locInfo=位置信息,移栽时为移栽编号,流水线时为托盘号,皮带线时为皮带线编号,机器人时为机器人编号
>
>返回:
>>`{"code": 0, "msg":"ok", "data":""}`
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息, data:为空
3. 放入料架(A,B,C,D)后调用,根据返回值决定当前料架是否放满,以及后续是否还有任务
>地址:
>>/rest/api/qisda/device/putShelfFinished
>
>参数:
>> - barcode=料盘的条码
>> - rfid=料架的RFID信息
>> - rfidLoc=料架的架位信息
>> - robotIndex=机器人编号(非机器人放置时不传此参数),IP为51的机器人为1, 52的机器人为2, 53的机器人为3
>
> 返回:
>>` {"code": 0, "msg":"ok", "data":{"rfid":"xxx","smallEmpty":0,"bigEmpty":0, "packageEmpty":0,"cutPackageTask":0,"packageTask":10,"cutTask":10, "smallTask":5, "bigTask":5}} `
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:为料架和任务信息
>> - rfid: 当前料架的RFID
>> - packageEmpty: 当前料架还可放置的包装料的数量(C料架和A料架有值,其他料架为0)
>> - smallEmpty: 当前料架还可放置的小料盘(7x8)的数量(D料架,其他料架为0)
>> - bigEmpty:当前料架还可放置的大料盘的数量(C料架,其他料架为0)
>> - cutPackageTask:还有多少盘分盘的包装料任务(放到A料架上,转运到分盘区)
>> - packageTask:还有多少盘包装料任务(放到A料架上,并转运到包装线,最终到C料架)
>> - cutTask: 还有多少盘分盘料任务(放置到料串B上,转运到分盘区)
>> - smallTask: 还有多少盘小料任务(放置到双层线的D料架上)
>> - bigTask: 还有多少盘大料任务(放置到C料架上)
4. 机器人获取架位信息时调用
> 地址:
>>/rest/api/qisda/device/getLocation
>
> 参数:
>> - robotIndex=机器人编号,IP为51的机器人为1, 52的机器人为2, 53的机器人为3
>> - rfid=当前双层线上料架的RFID信息
>
> 返回:
>>` {"code": 0, "msg":"ok", "data":{"rfid":"xxx","rfidLoc":3,"w":7,"h":12,"barcode":"xxxxxxx"}} `
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:为料盘对应的位置信息
>> - barcode: 料盘条码信息
>> - w: 料盘直径信息,取料时机器人根据此信息
>> - h: 料盘厚度信息
>> - rfid: 料架RFID
>> - rfidLoc: 料架架位
5. 出库时根据StatusBean返回data中的参数决定料盘流转到哪里
> - urgentReel: true 表示紧急料,需要出到料串上
> - cutReel: true 表示分盘料,需要出到料串上
> - smallReel: true 小料(7x8),放置到小料架上
> - rfid: 分配的料架RFID
> - fidLoc: 料架的架位
>> - 值为-1时,可以自由分配皮带线
>> - 小料时,架位为1-46优先走1/2号皮带线,47-92优先走3/4号皮带线, 70,71,72时只能分配到3/4号皮带线;
>> - 大料时,架位1-6,12优先走1/2号皮带线, 7-11优先走3/4号皮带线
6. 料串或包装料架全部入库完成时调用,清除RFID信息
> 地址
>> /service/store/qisda/clearPutInRfid
>
>参数
>> - rfid: 料串或包装料架的RFID
>
>返回:
>>"OK"
7. 包装料机器人获取取出和放置位置
> 地址
>> /rest/api/qisda/device/getPackageLocation
>
>参数
>> - bigRfid: 大料架的RFID
>> - packageRfid: 包装料架的RFID
>
> 返回:
>>` {"code": 0, "msg":"ok", "data":{"barcode":"xxx","emptyInBig":3,"reelInPackage":7,"packageTask":"3","packageRfid":"xxx"","packageLoc":"1","bigRfid":"xxx","bigLoc":"1"}} `
>>
>> - code: 0为正常,其他为异常
>> - msg:消息,
>> - data:为对应的位置信息
>> - barcode: 料盘条码信息
>> - emptyInBig: 大料架上可放包装料数量(空位置),如果为0,放行大料架
>> - reelInPackage: 包装料架上剩余的包装料数量(包含当前获取的物料),如果为0,说明这个包装料架上的料已取完
>> - packageTask: 剩余的包装料任务, 如果为0,说明已经没有包装料任务,可以放行大料架
>> - packageRfid: 包装料架RFID
>> - packageLoc: 取料位置(包装料架)
>> - bigRfid: 大料架RFID
>> - bigLoc: 放料位置(大料架)
>
>说明: 大料架到达双层线包装料架位置时调用此接口, 将包装料从packageRfid的packageLoc位置取出,放入bigRfid的bigLoc位置
8. 包料料机器人放置包装料完成
>地址:
>>/rest/api/qisda/device/putPackageFinished
>
>参数:
>> - barcode=料盘的条码
>> - packageRfid: 包装料架RFID
>> - packageLoc: 取料位置(包装料架)
>> - bigRfid: 大料架RFID
>> - bigLoc: 放料位置(大料架)
>返回:
>>`{"code": 0, "msg":"ok", "data":""}`
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息, data:为空
9. 获取包装料仓的空闲仓位数
>地址:
>>/rest/api/qisda/device/emptyStoragePosCount
>
>参数:
>> - 无
>
> 返回:
>>` {"code": 0, "msg":"ok", "data":{"packing-19":"19","packing-20":"20","packing-21":"21","packing-22":"22","packing-23":"23","packing-24":"24"}} `
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:为包装料仓的空闲仓位数(key为与客户端一致的料仓标识,value为空闲仓位)
>> - packing-19=19: 表示包装仓19的空闲仓位数是19
>> - packing-20=20: 表示包装仓19的空闲仓位数是20
>> - packing-21=21: 表示包装仓19的空闲仓位数是21
>> - packing-22:22: 表示包装仓19的空闲仓位数是22
>> - packing-23:23: 表示包装仓19的空闲仓位数是23
>> - packing-24:24: 表示包装仓19的空闲仓位数是24
问题点
1 分盘数量
2 CJZ料位置39
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件类型无法预览
此文件的差异被折叠, 点击展开。
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
此文件的差异被折叠, 点击展开。
package com.myproject;
/**
* Constant values used throughout the application.
*
* @author <a href="mailto:matt@raibledesigns.com">Matt Raible</a>
*/
public final class Constants {
private Constants() {
// hide me
}
//~ Static fields/initializers =============================================
/**
* Assets Version constant
*/
public static final String ASSETS_VERSION = "assetsVersion";
/**
* The name of the ResourceBundle used in this application
*/
public static final String BUNDLE_KEY = "ApplicationResources";
/**
* File separator from System properties
*/
public static final String FILE_SEP = System.getProperty("file.separator");
/**
* User home from System properties
*/
public static final String USER_HOME = System.getProperty("user.home") + FILE_SEP;
/**
* The name of the configuration hashmap stored in application scope.
*/
public static final String CONFIG = "appConfig";
/**
* Session scope attribute that holds the locale set by the user. By setting this key
* to the same one that Struts uses, we get synchronization in Struts w/o having
* to do extra work or have two session-level variables.
*/
public static final String PREFERRED_LOCALE_KEY = "PREFERRED_LOCALE";
/**
* The request scope attribute under which an editable user form is stored
*/
public static final String USER_KEY = "userForm";
/**
* The request scope attribute that holds the user list
*/
public static final String USER_LIST = "userList";
/**
* The request scope attribute for indicating a newly-registered user
*/
public static final String REGISTERED = "registered";
/**
* The name of the Administrator role, as specified in web.xml
*/
// public static final String ADMIN_ROLE = "ROLE_ADMIN";
//
// /**
// * The name of the User role, as specified in web.xml
// */
// public static final String USER_ROLE = "ROLE_USER";
/**
* The name of the user's role list, a request-scoped attribute
* when adding/editing a user.
*/
public static final String USER_ROLES = "userRoles";
/**
* The name of the available roles list, a request-scoped attribute
* when adding/editing a user.
*/
public static final String AVAILABLE_ROLES = "availableRoles";
/**
* The name of the CSS Theme setting.
* @deprecated No longer used to set themes.
*/
public static final String CSS_THEME = "csstheme";
}
package com.myproject.api;
import com.myproject.bean.update.DataLog;
/**
* 任务通知接口
* Created by sunke on 2019/8/20.
*/
public interface ITaskNotify {
/**
* 出库任务完成时调用此接口
* @param dataLog
*/
void onOutTaskFinished(DataLog dataLog);
void onOutTaskFailed(String partNumber);
void allTaskEnd();
String getNotifyName();
}
package com.myproject.api;
import com.google.common.collect.Lists;
import jcifs.Config;
import jcifs.smb.NtlmPasswordAuthentication;
import jcifs.smb.SmbFile;
import jcifs.smb.SmbFileInputStream;
import jcifs.smb.SmbFileOutputStream;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.util.Strings;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
/**
* Created by sunke on 2019/8/21.
*/
public class SmbUtil {
protected final static transient Logger log = LogManager.getLogger(SmbUtil.class);
/**
* 列出SMB服务器文件夹中的所有文件名称,如果目录不存在或者访问出错返回null
*/
public static List<String> smbFileNameList(String smbDir){
try {
SmbFile remoteFile = new SmbFile(smbDir);
if (remoteFile.exists() && remoteFile.isDirectory()) {
String[] fileNames = remoteFile.list();
return Lists.newArrayList(fileNames);
} else {
log.info("SMB目录["+smbDir+"]不存在");
}
} catch (Exception e) {
log.error("访问SMB目录["+smbDir+"]出错",e);
}
return null;
}
/**
* @Title smbGet
* @Param shareUrl 共享目录中的文件路径,如smb://132.20.2.33/CIMPublicTest/eg.txt
* @Param localDirectory 本地目录,如tempStore/smb
*/
public static boolean smbGet(String smbFile, String localDirectory){
InputStream in = null;
OutputStream out = null;
try {
Config.registerSmbURLHandler();
SmbFile remoteFile = new SmbFile(smbFile);
if (!remoteFile.exists()) {
log.info("共享文件不存在");
return false;
}
// 有文件的时候再初始化输入输出流
log.info("下载共享目录的文件 "+smbFile+" 到 "+ localDirectory);
String fileName = remoteFile.getName();
File localFile = new File(localDirectory + File.separator + fileName);
File fileParent = localFile.getParentFile();
if (null != fileParent && !fileParent.exists()) {
fileParent.mkdirs();
}
in = new BufferedInputStream(new SmbFileInputStream(remoteFile));
out = new BufferedOutputStream(new FileOutputStream(localFile));
byte[] buffer = new byte[1024];
while (in.read(buffer) != -1) {
out.write(buffer);
buffer = new byte[1024];
}
out.flush(); //刷新缓冲区输出流
return true;
} catch (Exception e) {
log.error("获取 SMB 文件出错",e);
} finally {
close(in,out);
}
return false;
}
private static void close(InputStream in,OutputStream out){
try {
if(in != null){
out.close();
in.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
/**
*
* @Title smbPut
* @Description 向共享目录上传文件
* @Param shareDirectory 共享目录
* @Param localFilePath 本地目录中的文件路径
* @date 2019-01-10 20:16
*/
public static boolean smbPut(String shareDirectory, String localFilePath) {
InputStream in = null;
OutputStream out = null;
String domain = "";
try {
if(!shareDirectory.toLowerCase().startsWith("smb")){
return false;
}
File localFile = new File(localFilePath);
Config.registerSmbURLHandler();
URI uri = new URI(shareDirectory);
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(uri.getUserInfo());
String smbFileName = uri.getScheme() + "://" + uri.getHost() + uri.getPath() + localFile.getName();
SmbFile remoteFile = new SmbFile(smbFileName,auth);
log.info("put " + localFilePath + " to " +remoteFile.getPath());
in = new BufferedInputStream(new FileInputStream(localFile));
out = new BufferedOutputStream(remoteFile.getOutputStream());
byte[] buffer = new byte[1024];
while (in.read(buffer) != -1) {
out.write(buffer);
buffer = new byte[1024];
}
out.flush();
return true;
} catch (Exception e) {
log.error("上传 SMB 文件出错",e);
} finally {
close(in,out);
}
return false;
}
}
package com.myproject.bean;
import org.springframework.security.core.GrantedAuthority;
/**
* 基础权限
* Created by sunke on 17/1/3.
*/
public enum Authority implements GrantedAuthority {
/**
* 默认权限,不会展示
*/
ROLE_DEFAULT("",0),
//物料管理
ROLE_MANAGE_COMPONENT("authority.component.manage", 1),
//Bom 管理
//ROLE_MANAGE_BOM("authority.bom.manage", 2),
//工单管理
//ROLE_MANAGE_WORKORDER("authority.workorder.manage", 3),
//料仓管理
//ROLE_MANAGE_STORAGE("authority.storage.manage", 4),
//条码管理
ROLE_MANAGE_BARCODE("authority.barcode.manage", 5),
//用户管理
ROLE_MANAGE_USER("authority.user.manage", 6),
//角色管理
ROLE_MANAGE_ROLE("authority.role.manage", 7),
//出库
ROLE_MANAGE_STACK_OUT("authority.stockOut",8),
//入库
//ROLE_MANAGE_PUT_IN("authority.putIn",9),
//站位列表
ROLE_MANAGE_FEEDER("authority.feeder",10),
//指定批次
ROLE_MANAGE_SPECIFIEDBATCH("authority.specifiedBatch",11),
//虚拟仓管理
ROLE_MANAGE_VIRTUAL("authority.virtual",12),
// 站位列表查看勾选
ROLE_FEEDER_VIEW("authority.feeder.view",13),
// 贵重物料出库
ROLE_VALUABLE_OUT("authority.valuable.out",14),
/**
* 运行数据
*/
ROLE_MANAGE_DATALOG("authority.dataLog",15),
//超额入库
ROLE_MORE_STACK_IN("authority.stockIn.more",16),
;
private String key;
private int index;
private Authority(String key, int index) {
this.key = key;
this.index = index;
}
/**
* 根据 role 表里面存的 index 查找对应的authority
*/
public static Authority fromIndex(String index) {
if (index != null) {
for (Authority authority : Authority.values()) {
if (index.equals(String.valueOf(authority.getIndex()))) {
return authority;
}
}
}
return null;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
@Override
public String getAuthority() {
return this.name();
}
}
package com.myproject.bean;
import java.io.Serializable;
/**
* Created by kangmor on 2015/9/24.
*/
public class BaseFormBean implements Serializable {
}
package com.myproject.bean;
import com.myproject.util.DateUtil;
import java.util.Date;
/**
* Created by kangmor on 2015/9/14.
*/
public class BaseMongoBean {
private String id;
private Date createDate = new Date();
private Date updateDate;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public Date getUpdateDate() {
if(updateDate == null){
return getCreateDate();
}
return updateDate;
}
public String getUpdateDateStr(){
return DateUtil.toDateTimeString(getUpdateDate());
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
}
package com.myproject.bean;
import com.myproject.bean.update.Barcode;
import com.myproject.util.StorageConstants;
/**
* 用于解析条码
* Created by sunke on 2017/10/10.
*/
public class CodeBean {
/**
* 码类型
*/
private StorageConstants.CODE_TYPE codeType;
/**
* 摄像头位置信息
*/
private int cameraIndex = 0;
//扫描到的二维码的位置信息
private float locationX = -1.0f;
private float locationY = -1.0f;
/**
* 用于显示的照片信息
*/
private String showImg = "";
/**
* 料盘宽度
*/
private int reelWidth = -1;
/**
* 料盘高度
*/
private int reelHeight = -1;
private String codeStr = "";
/**
* 错误消息,正常时为空
*/
private String error;
private Barcode barcode;
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
public Barcode getBarcode() {
return barcode;
}
public void setBarcode(Barcode barcode) {
this.barcode = barcode;
}
public boolean isValid(){
return error == null && barcode != null;
}
/**
* 是否是夹具条码
*/
public boolean isFixtureCode(){
if(isValid()){
return StorageConstants.COMPONENT_TYPE.FIXTURE == barcode.getType();
}
return false;
}
public float getLocationX() {
return locationX;
}
public void setLocationX(float locationX) {
this.locationX = locationX;
}
public float getLocationY() {
return locationY;
}
public void setLocationY(float locationY) {
this.locationY = locationY;
}
public StorageConstants.CODE_TYPE getCodeType() {
return codeType;
}
public void setCodeType(StorageConstants.CODE_TYPE codeType) {
this.codeType = codeType;
}
public String getCodeStr() {
return codeStr;
}
public void setCodeStr(String codeStr) {
this.codeStr = codeStr;
}
public int getCameraIndex() {
return cameraIndex;
}
public void setCameraIndex(int cameraIndex) {
this.cameraIndex = cameraIndex;
}
public int getReelWidth() {
return reelWidth;
}
public void setReelWidth(int reelWidth) {
this.reelWidth = reelWidth;
}
public int getReelHeight() {
return reelHeight;
}
public void setReelHeight(int reelHeight) {
this.reelHeight = reelHeight;
}
public boolean hasReelSizeInfo() {
return reelWidth > 0 && reelHeight > 0;
}
public String getShowImg() {
return showImg;
}
public void setShowImg(String showImg) {
this.showImg = showImg;
}
}
package com.myproject.bean;
import com.myproject.util.StorageConstants;
/**
* 用于展示到界面
* Created by sunke on 2017/10/13.
*/
public class CodeBox {
//显示的位置
private int location = 0;
private String msg = "";
private boolean valid = false;
private String codeType;
public CodeBox(int location, String msg, boolean valid, String codeType) {
this.location = location;
this.msg = msg;
this.valid = valid;
this.codeType = codeType;
}
public CodeBox(CodeBean codeBean) {
this.valid = codeBean.isValid();
if(valid){
msg = codeBean.getBarcode().getBarcode();
}else{
msg = codeBean.getError();
}
StorageConstants.CODE_TYPE type = codeBean.getCodeType();
if(type == null){
type = StorageConstants.CODE_TYPE.FIXTURE;
}
codeType = type.name();
int cameraIndex = codeBean.getCameraIndex();
float locationX = codeBean.getLocationX();
float locationY = codeBean.getLocationY();
if(locationX != 0 && locationY != 0){
if(cameraIndex == 1){
if(locationX < 1400){
location = 1;
}else {
location = 2;
}
}else {
if(locationX < 1000){
location = 4;
}else {
location = 3;
}
}
}
}
public int getLocation() {
return location;
}
public void setLocation(int location) {
this.location = location;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getCodeType() {
return codeType;
}
public void setCodeType(String codeType) {
this.codeType = codeType;
}
public boolean isValid() {
return valid;
}
public void setValid(boolean valid) {
this.valid = valid;
}
}
package com.myproject.bean;
/**
* 基础权限
* Created by sunke on 17/1/3.
*/
public enum Language {
//英语
ENGLISH("en","English"),
//zh_CN 中文
ZH_CN("zh-CN","中文"),
;
private Language(String value, String label) {
this.label = label;
this.value = value;
}
private String label;
private String value;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
package com.myproject.bean;
/**
* Created by kangmor on 2015/9/14.
*/
public class Sequence extends BaseMongoBean{
private Long seq;
public Long getSeq() {
return seq;
}
public void setSeq(Long seq) {
this.seq = seq;
}
}
package com.myproject.bean.excel;
import java.util.Date;
/**
* Created by kangmor on 2015/11/30.
*/
public class BarcodeExcel {
private String barcode;
private String partNumber;
private int amount;
private int plateSize;
private String provider;
private String batch;
private Date expireDate;
public String getBarcode() {
return barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
public String getPartNumber() {
return partNumber;
}
public void setPartNumber(String partNumber) {
this.partNumber = partNumber;
}
public int getAmount() {
return amount;
}
public void setAmount(int amount) {
this.amount = amount;
}
public int getPlateSize() {
return plateSize;
}
public void setPlateSize(int plateSize) {
this.plateSize = plateSize;
}
public String getProvider() {
return provider;
}
public void setProvider(String provider) {
this.provider = provider;
}
public String getBatch() {
return batch;
}
public void setBatch(String batch) {
this.batch = batch;
}
public Date getExpireDate() {
return expireDate;
}
public void setExpireDate(Date expireDate) {
this.expireDate = expireDate;
}
}
package com.myproject.bean.excel;
/**
* Created by kangmor on 2015/11/11.
*/
public class BomExcel {
private String bomName;
private String partNumber;
private String componentName;
private int amount;
public String getBomName() {
return bomName;
}
public void setBomName(String bomName) {
this.bomName = bomName;
}
public String getPartNumber() {
return partNumber;
}
public void setPartNumber(String partNumber) {
this.partNumber = partNumber;
}
public String getComponentName() {
return componentName;
}
public void setComponentName(String componentName) {
this.componentName = componentName;
}
public int getAmount() {
return amount;
}
public void setAmount(int amount) {
this.amount = amount;
}
}
package com.myproject.bean.excel;
import org.displaytag.export.CsvView;
/**
* Created by sunke on 2019/2/26.
*/
public class CNCsvView extends CsvView{
@Override
public String getMimeType() {
return "text/csv";
}
}
package com.myproject.bean.excel;
import java.util.Date;
/**
* Created by kangmor on 2015/11/15.
*/
public class ComponentExcel {
//名称
private String name;
//料号
private String partNumber;
//uid
private String uid;
//物料描述
private String description;
//单耗
private String unitCost;
//"MSL等级"
private String msl;
//"封装"
private String encapsulation;
//"产品类型"
private String productionType;
//"单位"
private String unit;
//"厂商"
private String producer;
//"厂商编号"
private String producerNumber;
private int plateSize;
private int height;
private int amount;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPartNumber() {
return partNumber;
}
public void setPartNumber(String partNumber) {
this.partNumber = partNumber;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getUnitCost() {
return unitCost;
}
public void setUnitCost(String unitCost) {
this.unitCost = unitCost;
}
public String getMsl() {
return msl;
}
public void setMsl(String msl) {
this.msl = msl;
}
public String getEncapsulation() {
return encapsulation;
}
public void setEncapsulation(String encapsulation) {
this.encapsulation = encapsulation;
}
public String getProductionType() {
return productionType;
}
public void setProductionType(String productionType) {
this.productionType = productionType;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getProducer() {
return producer;
}
public void setProducer(String producer) {
this.producer = producer;
}
public String getProducerNumber() {
return producerNumber;
}
public void setProducerNumber(String producerNumber) {
this.producerNumber = producerNumber;
}
public int getPlateSize() {
return plateSize;
}
public void setPlateSize(int plateSize) {
this.plateSize = plateSize;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public int getAmount() {
return amount;
}
public void setAmount(int amount) {
this.amount = amount;
}
}
package com.myproject.bean.excel;
/**
* Created by kangmor on 2015/11/17.
*/
public class StoragePosExcel {
private String posName;
//进料优先级,数字越大优先级越高,例:1-1的优先级为100 仓1-2的优先级200,那么入仓时就会优先进入1-2仓
private double priority = 0f;
//高度
private int h;
//宽度(料盘尺寸)
private int w;
public String getPosName() {
return posName;
}
public void setPosName(String posName) {
this.posName = posName;
}
public int getH() {
return h;
}
public void setH(int h) {
this.h = h;
}
public int getW() {
return w;
}
public void setW(int w) {
this.w = w;
}
public double getPriority() {
return priority;
}
public void setPriority(double priority) {
this.priority = priority;
}
}
package com.myproject.bean.form;
import com.myproject.bean.update.Barcode;
import com.myproject.webapp.controller.storage.BaseUpdateController;
/**
* Created by kangmor on 2016/5/16.
*/
public class BarcodeGenerateForm extends BaseUpdateForm {
private String patternBarcode;
private Barcode barcode;
public BarcodeGenerateForm() {
this.barcode = new Barcode();
this.barcode.setBarcode(System.currentTimeMillis() + "");
}
public String getPatternBarcode() {
return patternBarcode;
}
public void setPatternBarcode(String patternBarcode) {
this.patternBarcode = patternBarcode;
}
public Barcode getBarcode() {
return barcode;
}
public void setBarcode(Barcode barcode) {
this.barcode = barcode;
}
}
package com.myproject.bean.form;
import java.io.Serializable;
/**
* Created by kangmor on 2015/12/6.
*/
public class BaseUpdateForm implements Serializable{
private String operation;
private String opId;
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public String getOpId() {
return opId;
}
public void setOpId(String opId) {
this.opId = opId;
}
}
package com.myproject.bean.form;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import java.io.Serializable;
/**
* Created by kangmor on 2016/6/20.
*/
//@JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property="@id")
public class Message {
private String message;
private String error;
public Message() {
}
public Message(String message, String error) {
this.message = message;
this.error = error;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
}
package com.myproject.bean.form;
import com.myproject.bean.update.Storage;
import com.myproject.bean.update.StoragePos;
import java.util.List;
/**
* Created by kangmor on 2015/12/6.
*/
public class StorageUpdateForm extends BaseUpdateForm {
private Storage storage;
private List<StoragePos> slots;
public Storage getStorage() {
return storage;
}
public void setStorage(Storage storage) {
this.storage = storage;
}
public List<StoragePos> getSlots() {
return slots;
}
public void setSlots(List<StoragePos> slots) {
this.slots = slots;
}
}
package com.myproject.bean.json;
/**
* Created by sunke on 16/9/27.
*/
public class ChartData {
// private String name;
private String partNumber;
private Integer amount;
private Integer count;
// public String getName() {
// return name;
// }
//
// public void setName(String name) {
// this.name = name;
// }
public Integer getAmount() {
return amount;
}
public void setAmount(Integer amount) {
this.amount = amount;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public String getPartNumber() {
return partNumber;
}
public void setPartNumber(String partNumber) {
this.partNumber = partNumber;
}
}
package com.myproject.bean.json;
/**
*
* 图表显示时的一个选项数据 Bean
* Created by sunke on 16/12/5.
*/
public class ChartItem {
private String label;
private int value;
private int value2;
private int value3;
private int value4;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
public int getValue2() {
return value2;
}
public void setValue2(int value2) {
this.value2 = value2;
}
public int getValue3() {
return value3;
}
public void setValue3(int value3) {
this.value3 = value3;
}
public int getValue4() {
return value4;
}
public void setValue4(int value4) {
this.value4 = value4;
}
}
package com.myproject.bean.json;
import java.util.Collection;
/**
* Created by sunke on 2017/12/20.
*/
public class ChartOption {
Collection<String> legend;
Collection<String> xAxis;
Collection<SeriesData> series;
public Collection<String> getLegend() {
return legend;
}
public void setLegend(Collection<String> legend) {
this.legend = legend;
}
public Collection<String> getxAxis() {
return xAxis;
}
public void setxAxis(Collection<String> xAxis) {
this.xAxis = xAxis;
}
public Collection<SeriesData> getSeries() {
return series;
}
public void setSeries(Collection<SeriesData> series) {
this.series = series;
}
}
package com.myproject.bean.json;
import java.io.Serializable;
/**
* Created by kangmor on 2015/11/21.
*/
public class ClientDataParams implements Serializable {
//条码
private String code;
private String temperature;
private String humidity;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getTemperature() {
return temperature;
}
public void setTemperature(String temperature) {
this.temperature = temperature;
}
public String getHumidity() {
return humidity;
}
public void setHumidity(String humidity) {
this.humidity = humidity;
}
}
package com.myproject.bean.json;
import java.util.Collection;
import java.util.List;
/**
* Created by sunke on 17/6/29.
*/
public class HumitureData {
private Collection<String> boxNames;
private Collection<String> times;
private List<SeriesData> humidityData;
private List<SeriesData> temperatureData;
public Collection<String> getBoxNames() {
return boxNames;
}
public void setBoxNames(Collection<String> boxNames) {
this.boxNames = boxNames;
}
public Collection<String> getTimes() {
return times;
}
public void setTimes(Collection<String> times) {
this.times = times;
}
public List<SeriesData> getHumidityData() {
return humidityData;
}
public void setHumidityData(List<SeriesData> humidityData) {
this.humidityData = humidityData;
}
public List<SeriesData> getTemperatureData() {
return temperatureData;
}
public void setTemperatureData(List<SeriesData> temperatureData) {
this.temperatureData = temperatureData;
}
}
package com.myproject.bean.json;
/**
* 库存预警,放入内存中,出入库(上传 Feeder时重新计算)实时更新
* Created by sunke on 17/3/15.
*/
public class InventoryAlarmItem {
/**
* 物编
*/
private String partNumber;
/**
* 剩余所需数量
*/
private int needCount;
/**
* 使用该 partNumber 且未完成的站位数量
*/
private int posNum;
/**
* 所需料盘数,实际上应为:剩余数量/每盘数量(这样算出来的数量通常不是准确的,最多会差 n-1盘,其中 n 为站位的数量)这里从数据库查出来的时候是站位的数量,即n
*/
private int needReel;
/**
* 库存数量
*/
private int stockCount;
/**
* 库存盘数
*/
private int stockReel;
public String getPartNumber() {
return partNumber;
}
public void setPartNumber(String partNumber) {
this.partNumber = partNumber;
}
public int getNeedCount() {
return needCount;
}
public void setNeedCount(int needCount) {
this.needCount = needCount;
}
public int getNeedReel() {
if(needReel < posNum){
return posNum;
}
return needReel;
}
public void setNeedReel(int needReel) {
this.needReel = needReel;
}
public int getStockCount() {
return stockCount;
}
public void setStockCount(int stockCount) {
this.stockCount = stockCount;
}
public int getStockReel() {
return stockReel;
}
public void setStockReel(int stockReel) {
this.stockReel = stockReel;
}
public int getPosNum() {
return posNum;
}
public void setPosNum(int posNum) {
this.posNum = posNum;
}
public void updateNeed(int amount) {
this.needCount = this.needCount + amount;
if(amount > 0){
this.needReel = this.needReel + 1;
}else{
this.needReel = this.needReel - 1;
}
}
/**
* 更新库存信息(数量更新,同时料盘数量根据amount 的正负+1或减1)
*/
public void updateInventory(int amount){
this.stockCount = this.stockCount + amount;
if(amount > 0){
this.stockReel = this.stockReel + 1;
}else {
this.stockReel = this.stockReel - 1;
}
}
}
package com.myproject.bean.json;
/**
* 库存
*/
public class InventoryItem {
/**
* 物编
*/
private String partNumber;
/**
* 库存数量
*/
private int stockCount = 0;
/**
* 锁定的数量
*/
private int lockCount = 0;
/**
* 库存盘数
*/
private int stockReel = 0;
/**
* 锁定的盘数(当加入出库队列时即锁定一盘),出库完成时锁定盘数减一
*/
private int lockReel = 0;
/**
* 过期的盘数
*/
private int expireReel = 0;
/**
* 即将过期的盘数(2个小时内)
*/
private int willExireReel = 0;
public String getPartNumber() {
return partNumber;
}
public void setPartNumber(String partNumber) {
this.partNumber = partNumber;
}
public int getStockCount() {
return stockCount;
}
public void setStockCount(int stockCount) {
this.stockCount = stockCount;
}
public int getStockReel() {
if(stockReel < 0){
stockReel = 0;
}
return stockReel;
}
public void setStockReel(int stockReel) {
this.stockReel = stockReel;
}
/**
* 更新库存信息(数量更新,同时料盘数量根据amount 的正负+1或减1)
*/
public void updateInventory(int amount){
this.stockCount = this.stockCount + amount;
if(amount > 0){
this.stockReel = this.stockReel + 1;
}else {
this.stockReel = this.stockReel - 1;
}
}
public int getLockReel() {
return lockReel;
}
public void setLockReel(int lockReel) {
this.lockReel = lockReel;
}
/**
* 出库完成或取消任务时需要解除库存锁定,返回当前锁定数量
*/
public int unLock(int reelCount){
if(reelCount > 0){
lockReel = lockReel - reelCount;
}
if(lockReel<0){
lockReel = 0;
}
return lockReel;
}
/**
* 加入到出库列表中时需要锁定库存
*/
public boolean lockOne(){
if(stockReel - lockReel > 0){
lockReel++;
return true;
}
return false;
}
public int getExpireReel() {
return expireReel;
}
public void setExpireReel(int expireReel) {
this.expireReel = expireReel;
}
public int getWillExireReel() {
return willExireReel;
}
public void setWillExireReel(int willExireReel) {
this.willExireReel = willExireReel;
}
public int getLockCount() {
return lockCount;
}
public void setLockCount(int lockCount) {
this.lockCount = lockCount;
}
}
package com.myproject.bean.json;
import com.myproject.bean.BaseMongoBean;
import com.myproject.util.StorageConstants;
import org.springframework.data.annotation.Transient;
import java.util.List;
/**
* Created by sunke on 2019/9/23.
*/
public class LiteOrder extends BaseMongoBean {
public LiteOrder() {
}
public LiteOrder(String orderNo, List<LiteOrderItem> orderItems) {
this.orderItems = orderItems;
this.orderNo = orderNo;
}
/**
* 订单号
*/
private String orderNo;
/**
* 当前任务盘数
*/
private int taskReelCount = 0;
/**
* 当前任务已完成盘数
*/
private int finishedReelCount = 0;
/**
* 订单状态
*/
private int status = StorageConstants.LITEORDER_STATUS.NEW;
/**
* 工单来源
*/
private String source = "";
/**
* 任务完成时间(用于关闭页面显示)
*/
@Transient
private long taskFinishedTime = -1;
/**
* 订单的详细信息
*/
@Transient
private List<LiteOrderItem> orderItems;
public List<LiteOrderItem> getOrderItems() {
return orderItems;
}
public void setOrderItems(List<LiteOrderItem> orderItems) {
this.orderItems = orderItems;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
/**
* 结束当前的任务
*/
public void finishedTasks(){
if(isOutOne()){
setStatus(StorageConstants.LITEORDER_STATUS.ONE_FINISHED);
}else if(isOutBom()){
setStatus(StorageConstants.LITEORDER_STATUS.BOM_FINISHED);
}else if(isOutTails()){
setStatus(StorageConstants.LITEORDER_STATUS.TAILS_FINISHED);
}
setTaskFinishedTime(System.currentTimeMillis());
}
/**
* 是否正在出首套料
* @return
*/
public boolean isOutBom(){
return status == StorageConstants.LITEORDER_STATUS.BOM;
}
/**
* 是否是未执行过的工单
*/
public boolean isNew(){
return status == StorageConstants.LITEORDER_STATUS.NEW;
}
public boolean isOutOne(){
return status == StorageConstants.LITEORDER_STATUS.ONE;
}
/**
* 补料任务完成
* @return
*/
public boolean isOutOneFinished(){
return status == StorageConstants.LITEORDER_STATUS.ONE_FINISHED;
}
/**
* 是否正在出尾料
*/
public boolean isOutTails(){
return status == StorageConstants.LITEORDER_STATUS.TAILS;
}
/**
* 任务料盘是否已出完
*/
public boolean isTaskFinished(){
return status == StorageConstants.LITEORDER_STATUS.BOM_FINISHED || status == StorageConstants.LITEORDER_STATUS.TAILS_FINISHED || status == StorageConstants.LITEORDER_STATUS.ONE_FINISHED;
}
public int getFinishedReelCount() {
return finishedReelCount;
}
public void setFinishedReelCount(int finishedReelCount) {
this.finishedReelCount = finishedReelCount;
}
public int getTaskReelCount() {
return taskReelCount;
}
public void setTaskReelCount(int taskReelCount) {
if(taskReelCount < 0) taskReelCount = 0;
this.taskReelCount = taskReelCount;
}
public long getTaskFinishedTime() {
return taskFinishedTime;
}
public void setTaskFinishedTime(long taskFinishedTime) {
this.taskFinishedTime = taskFinishedTime;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
/**
* 是否需要展示(已完成的,过20 秒自动清除)
*/
public boolean needToShow(){
if(isTaskFinished()){
if(taskFinishedTime != -1){
long now = System.currentTimeMillis();
return now - taskFinishedTime <= 20 * 1000;
}
}
return true;
}
}
package com.myproject.bean.json;
import com.myproject.bean.BaseMongoBean;
import org.springframework.data.annotation.Transient;
/**
* 出库订单详情
* Created by sunke on 2019/9/18.
*/
public class LiteOrderItem extends BaseMongoBean {
//物料编号
private String pn;
//需求数量
private int needNum = 0;
//已出数量
private int outNum = 0;
//已出盘数
private int outReelCount = 0;
/**
* 订单信息
*/
private String orderNo = "";
/**
* 站位信息
*/
private String feederInfo = "";
/**
* 库存信息
*/
@Transient
private int inventoryNum = 0;
public int getNeedNum() {
return needNum;
}
public void setNeedNum(int needNum) {
this.needNum = needNum;
}
public String getFeederInfo() {
return feederInfo;
}
public void setFeederInfo(String feederInfo) {
this.feederInfo = feederInfo;
}
public int getOutNum() {
return outNum;
}
public void setOutNum(int outNum) {
this.outNum = outNum;
}
public int getOutReelCount() {
return outReelCount;
}
public void setOutReelCount(int outReelCount) {
this.outReelCount = outReelCount;
}
public String getPn() {
return pn;
}
public void setPn(String pn) {
this.pn = pn;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public int getInventoryNum() {
return inventoryNum;
}
public void setInventoryNum(int inventoryNum) {
this.inventoryNum = inventoryNum;
}
}
package com.myproject.bean.json;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
/**
* Created by sunke on 17/4/17.
*/
public class PanaMaterial {
@JsonProperty("TransactionID")
String transactionID;
@JsonProperty("TowerID")
String towerID;
// String Timestamp = request.getParameter("Timestamp");//Date(2009-02-15T00:00:00Z)
@JsonProperty("JobID")
String jobID;
@JsonProperty("ReelBarcodes")
List<String> ReelBarcodes;
@JsonProperty("TransactionType")
String transactionType;
@JsonProperty("ReelBarcodesReserved")
List<String> reelBarcodesReserved;
public String getTransactionID() {
return transactionID;
}
public void setTransactionID(String transactionID) {
this.transactionID = transactionID;
}
public String getTowerID() {
return towerID;
}
public void setTowerID(String towerID) {
this.towerID = towerID;
}
public String getJobID() {
return jobID;
}
public void setJobID(String jobID) {
this.jobID = jobID;
}
public List<String> getReelBarcodes() {
return ReelBarcodes;
}
public void setReelBarcodes(List<String> reelBarcodes) {
ReelBarcodes = reelBarcodes;
}
public String getTransactionType() {
return transactionType;
}
public void setTransactionType(String transactionType) {
this.transactionType = transactionType;
}
public List<String> getReelBarcodesReserved() {
return reelBarcodesReserved;
}
public void setReelBarcodesReserved(List<String> reelBarcodesReserved) {
this.reelBarcodesReserved = reelBarcodesReserved;
}
}
package com.myproject.bean.json;
import com.myproject.util.PLATE_SIZE;
/**
*
* 料盘尺寸
* Created by sunke on 17/3/27.
*/
public class PlateSizeBean {
private PLATE_SIZE plateSize;
private int count;
public PLATE_SIZE getPlateSize() {
return plateSize;
}
public void setPlateSize(PLATE_SIZE plateSize) {
this.plateSize = plateSize;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public String getSizeStr(){
return plateSize.getSizeStr();
}
}
package com.myproject.bean.json;
import java.util.Collection;
/**
* Created by sunke on 16/9/27.
*/
public class SeriesData {
private String nameKey;
private String name;
private String type = "line";
private Collection<Object> data;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getName() {
return name;
}
public String getNameKey() {
return nameKey;
}
public void setNameKey(String nameKey) {
this.nameKey = nameKey;
}
public void setName(String name) {
this.name = name;
}
public Collection<Object> getData() {
return data;
}
public void setData(Collection<Object> data) {
this.data = data;
}
}
package com.myproject.bean.json;
/**
* Created by sunke on 2017/11/22.
*/
public class SolderInventoryItem {
private String partNumber;
//总库存数量
private int stockNum;
//正在回温数量
private int inWarmNum;
/**
* 快过期数量
*/
private int willExpireNum;
//失效数量
private int expireNum;
//最小存储量
private int minStoreNum;
//最大可存储量
private int maxStoreNum;
public String getPartNumber() {
return partNumber;
}
public void setPartNumber(String partNumber) {
this.partNumber = partNumber;
}
public int getStockNum() {
return stockNum;
}
public void setStockNum(int stockNum) {
this.stockNum = stockNum;
}
public int getInWarmNum() {
return inWarmNum;
}
public void setInWarmNum(int inWarmNum) {
this.inWarmNum = inWarmNum;
}
public int getMinStoreNum() {
return minStoreNum;
}
public void setMinStoreNum(int minStoreNum) {
this.minStoreNum = minStoreNum;
}
public int getMaxStoreNum() {
return maxStoreNum;
}
public void setMaxStoreNum(int maxStoreNum) {
this.maxStoreNum = maxStoreNum;
}
public int getExpireNum() {
return expireNum;
}
public void setExpireNum(int expireNum) {
this.expireNum = expireNum;
}
public int getWillExpireNum() {
return willExpireNum;
}
public void setWillExpireNum(int willExpireNum) {
this.willExpireNum = willExpireNum;
}
}
package com.myproject.bean.json;
import com.myproject.model.User;
import com.myproject.util.StorageConstants;
import java.util.List;
/**
*
* 图表显示时的一个选项数据 Bean
* Created by sunke on 16/12/5.
*/
public class StepBean {
private String cid;
/**
* 当前状态:0=等待刷卡;1=等待开门;2=门已打开,等待关闭;
*/
private int step = StorageConstants.CABINET_STEP.WAIT_CARD;
/**
* 当前操作的库位
*/
private String currentPos = "";
/**
* 当前的用户
*/
private User currentUser;
/**
* 门开期间是否有出入库操作(关门时判断)
*/
private boolean hasOpInDoorOpen = true;
/**
* 上次操作时间,用于判断是否超时
*/
private long lastOpTime = -1;
/**
* 提示消息
*/
private String msg = "";
public String getCid() {
return cid;
}
public void setCid(String cid) {
this.cid = cid;
}
public String getCurrentPos() {
return currentPos;
}
public void setCurrentPos(String currentPos) {
this.currentPos = currentPos;
}
public int getStep() {
return step;
}
public void setStep(int step) {
this.step = step;
}
public User getCurrentUser() {
return currentUser;
}
public void setCurrentUser(User currentUser) {
this.currentUser = currentUser;
}
public boolean isHasOpInDoorOpen() {
return hasOpInDoorOpen;
}
public void setHasOpInDoorOpen(boolean hasOpInDoorOpen) {
this.hasOpInDoorOpen = hasOpInDoorOpen;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public long getLastOpTime() {
return lastOpTime;
}
public void setLastOpTime(long lastOpTime) {
this.lastOpTime = lastOpTime;
}
}
package com.myproject.bean.json;
import java.io.Serializable;
/**
* Created by kangmor on 2015/10/12.
*/
public class StoreData implements Serializable{
private int storageId;
private double height;
public StoreData() {
}
public StoreData(int storageId, double height) {
this.storageId = storageId;
this.height = height;
}
public int getStorageId() {
return storageId;
}
public void setStorageId(int storageId) {
this.storageId = storageId;
}
public double getHeight() {
return height;
}
public void setHeight(double height) {
this.height = height;
}
}
package com.myproject.bean.json;
import com.myproject.bean.BaseMongoBean;
import com.myproject.util.StorageConstants;
/**
* 任务集合
* Created by sunke on 17/3/31.
*/
public abstract class TaskSet extends BaseMongoBean {
/**
* 显示的任务集合名称
*/
private String name;
/**
* 操作出库的站位数量
*/
private int opNum;
/**
* 已完成出库的站位数量
*/
private int finishOpNum;
/**
* 任务创建人
*/
private String creator;
/**
* 状态
*/
private String status = StorageConstants.OP_STATUS.NONE.name();
public abstract StorageConstants.TASK_SOURCE getTaskSource();
public abstract String getTitle();
public String getKey(){
return getTaskSource().name() + getId();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getOpNum() {
return opNum;
}
public void setOpNum(int opNum) {
this.opNum = opNum;
}
public int getFinishOpNum() {
return finishOpNum;
}
public void setFinishOpNum(int finishOpNum) {
this.finishOpNum = finishOpNum;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public boolean isFeeder(){
return StorageConstants.TASK_SOURCE.FEEDER.name().equals(getTaskSource().name());
}
/**
* 是否被取消
*/
public boolean isCancel(){
return StorageConstants.OP_STATUS.CANCEL.name().equals(getStatus());
}
public boolean isEnd(){
return StorageConstants.OP_STATUS.END.name().equals(getStatus());
}
public boolean isExecuting(){
return StorageConstants.OP_STATUS.EXECUTING.name().equals(getStatus());
}
public boolean isFinished(){
return StorageConstants.OP_STATUS.FINISHED.name().equals(getStatus());
}
public boolean isWait(){
return StorageConstants.OP_STATUS.WAIT.name().equals(getStatus());
}
public boolean isPause(){
return StorageConstants.OP_STATUS.PAUSE.name().equals(getStatus());
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
/**
* 没有操作过的才可以删除
*/
public boolean isCanRemove(){
return StorageConstants.OP_STATUS.NONE.name().equals(getStatus()) && getOpNum() == 0 && getFinishOpNum() == 0;
}
@Override
public boolean equals(Object o) {
boolean eq = super.equals(o);
if(!eq && o != null){
if(o instanceof TaskSet){
eq = ((TaskSet)o).getId().equals(this.getId());
}
}
return eq;
}
}
package com.myproject.bean.qisda;
import com.myproject.util.StorageConstants;
import java.util.HashMap;
import java.util.Map;
/**
* 附加信息,用于条码和出入库日志
* Created by sunke on 2019/12/15.
*/
public class AppendInfo {
/**
* 出库时的ItemId
*/
private String outItemId;
/**
* DN单号
*/
private String dnNo;
/**
* facility
*/
private String facility;
/**
* 公司
*/
private String company;
/**
* 动作,用于判断是首盘分盘还是其他操作
*/
private String action;
/**
* 需求单号
*/
private String hSerial;
/**
* 工单
*/
private String so;
/**
* 工单序号
*/
private String soseq;
/**
* 备料单号
*/
private String refno;
/**
* 预绑定slot值
*/
private String preBindSlot;
/**
* 站位信息(预绑定时,不放入slot信息,只有当实际绑定准备出库时再放入slot值)
*/
private String bindSlot;
private String slotStr;
/**
* 站位编号
*/
private int slotIndex;
/**
* 料架顺序
*/
private int rfidIndex;
/**
* 实际使用的RFID编号
*/
private String rfid;
/**
* 放入的RFID位置,如果为-1,需要即时分配位置
*/
private int rfidLoc = -1;
/**
* 分盘信息,key为so@slot,value为qty=L(子盘)或qty=M(母盘)
*/
private Map<String, String> cutMap;
/**
* 是否是纯入库
*/
private boolean cisIn = false;
/**
* 所需料架类型,入库时即可确定使用哪种料架 SHEFL_TYPE = A/B/C/D/E
*/
private String shelfType = "";
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public String getDnNo() {
if(dnNo == null){
return "";
}
return dnNo;
}
public void setDnNo(String dnNo) {
this.dnNo = dnNo;
}
public String getFacility() {
return facility;
}
public void setFacility(String facility) {
this.facility = facility;
}
public String gethSerial() {
if(hSerial == null){
hSerial = "";
}
return hSerial;
}
public void sethSerial(String hSerial) {
this.hSerial = hSerial;
}
public String getRefno() {
return refno;
}
public void setRefno(String refno) {
this.refno = refno;
}
public String getRfid() {
if(rfid == null){
rfid = "";
}
return rfid;
}
public void setRfid(String rfid) {
this.rfid = rfid;
}
public int getRfidLoc() {
return rfidLoc;
}
public void setRfidLoc(int rfidLoc) {
this.rfidLoc = rfidLoc;
}
public String getShelfType() {
return shelfType;
}
public void setShelfType(String shelfType) {
this.shelfType = shelfType;
}
public String getBindSlot() {
return bindSlot;
}
public void setBindSlot(String bindSlot) {
this.bindSlot = bindSlot;
}
public String getSlotStr() {
return slotStr;
}
public void setSlotStr(String slotStr) {
this.slotStr = slotStr;
}
public int getSlotIndex() {
return slotIndex;
}
public void setSlotIndex(int slotIndex) {
this.slotIndex = slotIndex;
}
public String getSo() {
return so;
}
public void setSo(String so) {
this.so = so;
}
/**
* 是否可放入A料架 A 带包装料料架 可放9个包装料
*/
public boolean putAShelf(){
return StorageConstants.SHEFL_TYPE.A.equals(shelfType);
}
/**
* 是否可放入B 料串 分盘料,紧急料,指定料,单独出库, 可放20-30个大小料,由客户端决定是否放满
*/
public boolean putBShelf(){
return StorageConstants.SHEFL_TYPE.B.equals(shelfType);
}
/**
* 是否可放入C 大(11,13,15寸)料盘料架, 可放12个大料,共2列,每列6个
*/
public boolean putCShelf(){
return StorageConstants.SHEFL_TYPE.C.equals(shelfType);
}
/**
* 是否可放入D 小(7寸)料盘料架,可放92个小料,共4列,每列23个
*/
public boolean putDShelf(){
return StorageConstants.SHEFL_TYPE.D.equals(shelfType);
}
public Map<String, String> getCutMap() {
return cutMap;
}
public void setCutMap(Map<String, String> cutMap) {
this.cutMap = cutMap;
}
public String getPreBindSlot() {
return preBindSlot;
}
public void setPreBindSlot(String preBindSlot) {
this.preBindSlot = preBindSlot;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public int getRfidIndex() {
return rfidIndex;
}
public void setRfidIndex(int rfidIndex) {
this.rfidIndex = rfidIndex;
}
/**
* 首盘需求单
*/
public boolean isFirstReelAction(){
if(action == null){
return false;
}
return action.equals("首盘");
}
/**
* 分盘需求单
*/
public boolean isReelCutAction(){
if(action == null){
return false;
}
return action.equals("分盘");
}
/**
* 补料需求单
*/
public boolean isTailAction(){
if(action == null){
return false;
}
return action.equals("补料盘");
}
public String getDnOrFacility(){
if(isFacilityIn()){
return facility;
}
return dnNo;
}
public boolean isFacilityIn(){
return dnNo.startsWith(facility);
}
public boolean isCISIn(){
return cisIn || dnNo == null || dnNo.isEmpty();
}
public String getTempRfid(){
return gethSerial() + "-" + rfidIndex + shelfType;
}
public String getSoseq() {
return soseq;
}
public void setSoseq(String soseq) {
this.soseq = soseq;
}
public String getOutItemId() {
return outItemId;
}
public void setOutItemId(String outItemId) {
this.outItemId = outItemId;
}
public boolean isCisIn() {
return cisIn;
}
public void setCisIn(boolean cisIn) {
this.cisIn = cisIn;
}
@Override
public String toString() {
return "AppendInfo{" +
"company='" + company + '\'' +
", dnNo='" + dnNo + '\'' +
", facility='" + facility + '\'' +
", hSerial='" + hSerial + '\'' +
", so='" + so + '\'' +
", refno='" + refno + '\'' +
", bindSlot='" + bindSlot + '\'' +
", slotIndex=" + slotIndex +
", rfidIndex='" + rfidIndex + '\'' +
", rfid='" + rfid + '\'' +
", rfidLoc=" + rfidLoc +
", cutMap=" + cutMap +
", shelfType='" + shelfType + '\'' +
'}';
}
}
package com.myproject.bean.qisda;
import com.myproject.util.StringHelper;
/**
* Created by sunke on 2019/12/3.
*/
public class AvailableInventoryBean {
private String facility;
private String partNum;
private String company;
private int qty;
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public String getFacility() {
return facility;
}
public void setFacility(String facility) {
this.facility = facility;
}
public String getPartNum() {
return partNum;
}
public void setPartNum(String partNum) {
this.partNum = partNum;
}
public int getQty() {
return qty;
}
public void setQty(int qty) {
this.qty = qty;
}
public String toMapKey(){
return StringHelper.toMapKey(partNum,facility,company);
}
}
package com.myproject.bean.qisda;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* 用于出库请求的JSON转换
* Created by sunke on 2019/12/14.
*/
public class RequestOutItemBean {
/**
* 动作(首盘,分盘,补料盘,急料,指定料,单独出库)
*/
private String action;
/**
* 需求单号
*/
private String hSerial;
/**
* 工单
*/
private String so;
/**
* 工单序号
*/
private String soseq;
/**
* 备料单号
*/
private String refno;
/**
* 建议出仓日期
*/
@JsonProperty("Sdte")
private String sdte;
/**
* 建议出仓日期
*/
private String stme;
/**
* 建议出仓日期
*/
private String mdte;
/**
* 建议出仓日期
*/
private String mtme;
/**
* 料站
*/
private String slot;
/**
* facility
*/
private String facility;
/**
* 是否是分盘料
*/
private String reelcut;
/**
* PN
*/
private String partNum;
@JsonProperty("ReelID")
private String reelID;
@JsonProperty("Location")
private String location;
/**
* 料站序号
*/
@JsonProperty("slotserial")
private int slotlocation;
/**
* 需求单中数量
*/
private int qty;
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getFacility() {
return facility;
}
public void setFacility(String facility) {
this.facility = facility;
}
public String gethSerial() {
return hSerial;
}
public void sethSerial(String hSerial) {
this.hSerial = hSerial;
}
public String getMdte() {
return mdte;
}
public void setMdte(String mdte) {
this.mdte = mdte;
}
public String getMtme() {
return left0Str(mtme);
}
public void setMtme(String mtme) {
this.mtme = mtme;
}
public String getPartNum() {
return partNum;
}
public void setPartNum(String partNum) {
this.partNum = partNum;
}
public int getQty() {
return qty;
}
public void setQty(int qty) {
this.qty = qty;
}
public String getReelcut() {
return reelcut;
}
public void setReelcut(String reelcut) {
this.reelcut = reelcut;
}
public String getRefno() {
return refno;
}
public void setRefno(String refno) {
this.refno = refno;
}
public String getSdte() {
return sdte;
}
public void setSdte(String sdte) {
this.sdte = sdte;
}
public String getSlot() {
return slot;
}
public void setSlot(String slot) {
this.slot = slot;
}
public String getSo() {
return so;
}
public void setSo(String so) {
this.so = so;
}
public String getStme() {
return left0Str(stme);
}
/**
* 不够位数的在前面补0,保留code的长度位数字
* @param code
* @return
*/
private String left0Str(String code) {
if(code == null || code.isEmpty()){
code = "0";
}
// 保留code的位数
return String.format("%06d", Integer.parseInt(code));
}
public void setStme(String stme) {
this.stme = stme;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getReelID() {
return reelID;
}
public void setReelID(String reelID) {
this.reelID = reelID;
}
public String getSoseq() {
return soseq;
}
public void setSoseq(String soseq) {
this.soseq = soseq;
}
public int getSlotlocation() {
return slotlocation;
}
public void setSlotlocation(int slotlocation) {
this.slotlocation = slotlocation;
}
@Override
public String toString() {
return "RequestOutItemBean{" +
"action='" + action + '\'' +
", hSerial='" + hSerial + '\'' +
", so='" + so + '\'' +
", refno='" + refno + '\'' +
", sdte='" + sdte + '\'' +
", stme='" + stme + '\'' +
", mdte='" + mdte + '\'' +
", mtme='" + mtme + '\'' +
", slot='" + slot + '\'' +
", slotlocation='" + slotlocation + '\'' +
", facility='" + facility + '\'' +
", reelcut='" + reelcut + '\'' +
", partNum='" + partNum + '\'' +
", qty=" + qty +
'}';
}
}
package com.myproject.bean.qisda;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* Created by sunke on 2019/12/12.
*/
public class ResultBean {
protected final static Logger log = LogManager.getLogger(ResultBean.class);
public static ResultBean newErrorResult(int code, String msg){
ResultBean result = new ResultBean();
result.setCode(code);
result.setMsg(msg);
log.info(msg);
return result;
}
public static ResultBean newOkResult(Object data){
ResultBean result = new ResultBean();
result.setCode(0);
result.setMsg("ok");
result.setData(data);
return result;
}
/**
* 结果码,0为正常,其他值表示异常
*/
private int code;
/**
* 提示信息
*/
private String msg;
/**
* 数据结果
*/
private Object data;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
package com.myproject.bean.qisda;
import com.myproject.util.StorageConstants;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* 料架
* Created by sunke on 2019/12/15.
*/
public class ShelfInfo {
protected final Logger log = LogManager.getLogger(ShelfInfo.class);
public ShelfInfo(String shelfType, int locCount) {
this.shelfType = shelfType;
this.maxLocCount = locCount;
}
public static ShelfInfo newAShelf(){
return new ShelfInfo(StorageConstants.SHEFL_TYPE.A, 9);
}
public static ShelfInfo newBShelf(){
return new ShelfInfo(StorageConstants.SHEFL_TYPE.B,1000000);
}
public static ShelfInfo newCShelf(){
return new ShelfInfo(StorageConstants.SHEFL_TYPE.C,12);
}
public static ShelfInfo newDShelf(){
return new ShelfInfo(StorageConstants.SHEFL_TYPE.D,92);
}
/**
* 需求单号
*/
private String hSerial;
/**
* 料架出库顺序编号
*/
private int rfidIndex;
/**
* 实际编号
*/
private String rfid;
/**
* 料架类型
*/
private String shelfType;
/**
* 料架的架位数
*/
private int maxLocCount = 0;
/**
* 料架的目标点位
*/
// private String targetPoint = "";
/**
* 架位放置情况, key小于0表示已经放过,key>0为空的库位
*/
private Map<Integer, ShelfLoc> locMap = new ConcurrentHashMap<>();
public Map<Integer, ShelfLoc> getLocMap() {
return locMap;
}
/**
* 库位数
*/
public int getUsedLocCount(){
return locMap.size();
}
public void setLocMap(Map<Integer, ShelfLoc> locMap) {
this.locMap = locMap;
}
public String getRfid() {
return rfid;
}
public void setRfid(String rfid) {
this.rfid = rfid;
}
public int getRfidIndex() {
return rfidIndex;
}
public void setRfidIndex(int rfidIndex) {
this.rfidIndex = rfidIndex;
}
/**
* 添加架位时,验证是否架位已达最大数量
*/
public boolean reachMaxLoc(){
return locMap.size() >= maxLocCount;
}
/**
* 料架是否放满
*/
public boolean isFull(){
for (ShelfLoc loc : locMap.values()) {
if(loc.isEmpty()){
return false;
}
}
return true;
}
/**
* 将料盘放入库位
* @param loc
* @param barcode
*/
public boolean putInLoc(String rfid, int loc, String barcode){
if(this.rfid != null && !this.rfid.isEmpty()){
//已绑定过真实料架,必须一致才能放入
if(!this.rfid.equals(rfid)){
return false;
}
}
if(!rfid.contains(shelfType)){
//未绑定过料架的,需要判断类型是否一致
return false;
}
int lockLocation = -1;
for (ShelfLoc shelfLoc : locMap.values()) {
if(shelfLoc.isLock() && shelfLoc.getBarcode().equals(barcode)){
log.info("找到条码["+barcode+"]锁定的架位["+shelfLoc.getLoc()+"]");
lockLocation = shelfLoc.getLoc();
}
}
if(lockLocation == -1){
log.error("未找到["+barcode+"]锁定的位置信息");
return false;
}
if(lockLocation != loc){
log.error(barcode + "放置位置["+loc+"]与锁定位置["+lockLocation+"]不一致");
return false;
}
this.setRfid(rfid);
ShelfLoc shelfLoc = locMap.get(loc);
if(shelfLoc == null){
log.error("未找到["+loc+"]的位置信息,当前料架位置信息:"+ locMap);
return false;
}
boolean putInResult = shelfLoc.putIn(barcode);
locMap.put(loc, shelfLoc);
return putInResult;
}
public boolean putInLimitLoc(String rfid, int rfidLoc, String barcode){
if(rfid.contains(shelfType)){//不是同一种料架的忽略
ShelfLoc shelfLoc = locMap.get(rfidLoc);
if(shelfLoc.isInThisLoc(barcode)){
shelfLoc.putIn(barcode);
locMap.put(rfidLoc, shelfLoc);
this.setRfid(rfid);
return true;
}
}
return false;
}
/**
* 根据条码获取库位信息
*/
public int getBarcodeLoc(String barcode, String theShelfType){
if(theShelfType.contains(shelfType)) {//不是同一种料架的忽略
//先看看此条码是否已经锁定过
for (ShelfLoc shelfLoc : locMap.values()) {
if (shelfLoc.isLock() && shelfLoc.getBarcode().equals(barcode)) {
return shelfLoc.getLoc();
}
}
}
return -1;
}
/**
* 为不需要按顺序摆放的料盘锁定一个架位,如果已经锁定过,返回对应的架位
*/
public ShelfLoc lockOneEmptyLoc(String barcode, int reelType, String robotIndex){
//if(rfid.contains(shelfType)) {
//不是同一种料架的忽略
//先看看此条码是否已经锁定过
for (ShelfLoc shelfLoc : locMap.values()) {
if(shelfLoc.isLock() && shelfLoc.getBarcode().equals(barcode)){
log.info("找到条码["+barcode+"]锁定的架位["+shelfLoc.getLoc()+"]");
return shelfLoc;
}
}
int usedCount = getUsedLocCount();
//1号机器人从大到小, 2号机器人从小到大,且71,72,73位不分配给2号机器人
if(robotIndex.equals("1")){
for(int i=usedCount; i> 0; i--){
//大料12号位不分配给1号机器人
if(StorageConstants.SHEFL_TYPE.isCShelf(shelfType)){
if(i == 12){
continue;
}
}
ShelfLoc shelfLoc = locMap.get(i);
// if(shelfLoc == null){
// shelfLoc = new ShelfLoc();
// shelfLoc.setLoc(i);
// }
if(shelfLoc != null && shelfLoc.isEmpty() && !shelfLoc.isLock()){
log.info(robotIndex+"号机器人为[" + barcode + "]锁定架位"+tempRfid() + "["+i+"]");
//未放过料,且未锁定
shelfLoc.setBarcode(barcode);
shelfLoc.setReelType(reelType);
locMap.put(i, shelfLoc);
return shelfLoc;
}
}
}else if(robotIndex.equals("2")){
for(int i=1; i<= usedCount; i++){
//小料71,72,73位不分配给2号机器人
if(StorageConstants.SHEFL_TYPE.isCShelf(shelfType)){
if(i == 71 || i==72 || i== 73){
continue;
}
}
ShelfLoc shelfLoc = locMap.get(i);
// if(shelfLoc == null){
// shelfLoc = new ShelfLoc();
// shelfLoc.setLoc(i);
// }
if(shelfLoc != null && shelfLoc.isEmpty() && !shelfLoc.isLock()){
log.info(robotIndex+ "号机器人为[" + barcode + "]锁定架位"+tempRfid() + "["+i+"]");
//未放过料,且未锁定
shelfLoc.setBarcode(barcode);
shelfLoc.setReelType(reelType);
locMap.put(i, shelfLoc);
return shelfLoc;
}
}
}else if(robotIndex.equals("3")){
//3号机器人
for(int i=1; i<= maxLocCount; i++){
}
}
//}
return null;
}
/**
* 添加缺料空位
*/
public int addEmptyLoc(){
return addShelfLoc(null, 0);
}
/**
* 添加一个库位
*/
public int addLimitLoc(String barcode, int reelType){
if(barcode == null){
barcode = "";
}
return addShelfLoc(barcode, reelType);
}
/**
* 添加一个库位,库位固定放某个条码,不限制库位时,设为空字符串,缺料库位设置为null
* @param barcode
*/
private int addShelfLoc(String barcode, int reelType){
for(int i=1; i<= maxLocCount; i++){
ShelfLoc shelfLoc = locMap.get(i);
if(shelfLoc == null){
shelfLoc = new ShelfLoc();
if(barcode == null){
barcode = "no code";
shelfLoc.setEmpty(false);
}
shelfLoc.setLoc(i);
shelfLoc.setBarcode(barcode);
shelfLoc.setReelType(reelType);
locMap.put(i, shelfLoc);
return i;
}
}
return -1;
}
public int getMaxLocCount() {
return maxLocCount;
}
public void setMaxLocCount(int maxLocCount) {
this.maxLocCount = maxLocCount;
}
public String gethSerial() {
if(hSerial == null){
return "";
}
return hSerial;
}
public void sethSerial(String hSerial) {
this.hSerial = hSerial;
}
public String getShelfType() {
return shelfType;
}
public void setShelfType(String shelfType) {
this.shelfType = shelfType;
}
// public String getTargetPoint() {
// return targetPoint;
// }
//
// public void setTargetPoint(String targetPoint) {
// this.targetPoint = targetPoint;
// }
public String tempRfid(){
return gethSerial() + "-" + rfidIndex + shelfType;
}
}
package com.myproject.bean.qisda;
import com.myproject.util.StorageConstants;
/**
* Created by sunke on 2019/12/25.
*/
public class ShelfLoc {
/**
* 料架号
*/
private String rfid;
/**
* 架位号
*/
private int loc;
/**
* 物料编码
*/
private String barcode;
/**
* 物料类型:小料,大料或者包装料
*/
private int reelType;
/**
* 是否为空(即物料是否已经放入)
*/
private boolean empty = true;
public String getBarcode() {
return barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
public boolean isEmpty() {
return empty;
}
public void setEmpty(boolean empty) {
this.empty = empty;
}
public int getLoc() {
return loc;
}
public void setLoc(int loc) {
this.loc = loc;
}
public int getReelType() {
return reelType;
}
public void setReelType(int reelType) {
this.reelType = reelType;
}
public boolean putIn(String barcode){
boolean canPut = false;
//库位未锁定或条码与锁定barcode一样,可放入
if(!isLock()){
canPut = true;
}else if(this.getBarcode().equals(barcode)){
canPut = true;
}
if(canPut){
this.setBarcode(barcode);
setEmpty(false);
}
return canPut;
}
public boolean isCutLoc(){
return reelType == StorageConstants.REEL_TYPE.CUT;
}
/**
* 是否是包装料料格
*/
public boolean isPackageLoc(){
return reelType == StorageConstants.REEL_TYPE.PACKAGE;
}
/**
* 是否是大料料格
*/
public boolean isBigLoc(){
return reelType == StorageConstants.REEL_TYPE.BIG;
}
/**
* 是否是大料料格
*/
public boolean isSmallLoc(){
return reelType == StorageConstants.REEL_TYPE.SMALL;
}
/**
* 库位是否被锁定
*/
public boolean isLock(){
return this.barcode != null && !this.barcode.isEmpty();
}
public String getRfid() {
return rfid;
}
public void setRfid(String rfid) {
this.rfid = rfid;
}
/**
* 判断该架位锁定的条码是否与给定的条码一样
* @param barcode
* @return
*/
public boolean isInThisLoc(String barcode){
if(this.isLock()){
return this.getBarcode().equals(barcode);
}
return false;
}
}
package com.myproject.bean.search;
/**
* Created by kangmor on 2015/12/1.
*/
public class BarcodeSearchCriteria extends BaseSearchCriteria {
private String barcode;
private String partNumber;
public String getBarcode() {
return barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
public String getPartNumber() {
return partNumber;
}
public void setPartNumber(String partNumber) {
this.partNumber = partNumber;
}
}
package com.myproject.bean.search;
import org.displaytag.pagination.PaginatedList;
import org.displaytag.properties.SortOrderEnum;
import java.io.Serializable;
import java.util.List;
/**
* Created by kangmor on 2015/9/24.
*/
public class BaseSearchCriteria {
private PageList pageList;
public PageList getPageList() {
return pageList;
}
public void setPageList(PageList pageList) {
this.pageList = pageList;
}
}
package com.myproject.bean.search;
/**
* Created by kangmor on 2015/10/15.
*/
public class BomSearchCriteria extends BaseSearchCriteria {
private String bomName;
public String getBomName() {
return bomName;
}
public void setBomName(String bomName) {
this.bomName = bomName;
}
}
package com.myproject.bean.search;
import com.myproject.bean.BaseFormBean;
/**
* Created by kangmor on 2015/9/14.
*/
public class ComponentSearchCriteria extends BaseSearchCriteria {
private String componentName;
private String componentPartNumber;
public String getComponentName() {
return componentName;
}
public void setComponentName(String componentName) {
this.componentName = componentName;
}
public String getComponentPartNumber() {
return componentPartNumber;
}
public void setComponentPartNumber(String componentPartNumber) {
this.componentPartNumber = componentPartNumber;
}
}
package com.myproject.bean.search;
public class DataLogSearchCriteria extends BaseSearchCriteria {
private String barcode;
private String partNumber;
public String getBarcode() {
return barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
public String getPartNumber() {
return partNumber;
}
public void setPartNumber(String partNumber) {
this.partNumber = partNumber;
}
}
package com.myproject.bean.search;
import org.displaytag.pagination.PaginatedList;
import org.displaytag.properties.SortOrderEnum;
import java.util.List;
/**
* Created by kangmor on 2015/10/13.
*/
public class PageList implements PaginatedList {
private List list;
private int pageNumber = 1;
private int objectsPerPage = 20;
private int fullListSize;
private String sortCriterion = "id";
private String searchId;
private SortOrderEnum sortDirection = SortOrderEnum.DESCENDING;
@Override
public List getList() {
return list;
}
public void setList(List list) {
this.list = list;
}
@Override
public int getPageNumber() {
return pageNumber;
}
public void setPageNumber(int pageNumber) {
this.pageNumber = pageNumber;
}
public int getObjectsPerPage() {
return objectsPerPage;
}
public void setObjectsPerPage(int objectsPerPage) {
this.objectsPerPage = objectsPerPage;
}
@Override
public int getFullListSize() {
return fullListSize;
}
public void setFullListSize(int fullListSize) {
this.fullListSize = fullListSize;
}
@Override
public String getSortCriterion() {
return sortCriterion;
}
public void setSortCriterion(String sortCriterion) {
this.sortCriterion = sortCriterion;
}
@Override
public String getSearchId() {
return searchId;
}
public void setSearchId(String searchId) {
this.searchId = searchId;
}
@Override
public SortOrderEnum getSortDirection() {
return sortDirection;
}
public void setSortDirection(SortOrderEnum sortDirection) {
this.sortDirection = sortDirection;
}
}
package com.myproject.bean.search;
/**
* Created by kangmor on 2015/12/4.
*/
public class StoragePosFindCriteria extends BaseSearchCriteria {
/**
* 类型
*/
private int type = -1;
private String name;
/**
* 供应商编号
*/
private String providerNumber;
/**
* 唯一编码信息
*/
private String barcode;
public String getBarcode() {
return barcode;
}
public void setBarcode(String barcode) {
this.barcode = barcode;
}
private String storageId;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getProviderNumber() {
return providerNumber;
}
public void setProviderNumber(String providerNumber) {
this.providerNumber = providerNumber;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getStorageId() {
return storageId;
}
public void setStorageId(String storageId) {
this.storageId = storageId;
}
}
package com.myproject.bean.search;
/**
* Created by kangmor on 2015/12/4.
*/
public class StorageSearchCriteria extends BaseSearchCriteria {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package com.myproject.bean.search;
/**
* Created by kangmor on 2016/1/15.
*/
public class WorkOrderSearchCriteria extends BaseSearchCriteria{
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package com.myproject.bean.update;
import com.myproject.bean.BaseMongoBean;
import com.myproject.util.StorageConstants;
import java.util.Date;
/**
* 报警信息类型,内容,详情,Msg
0,消息,"1=原点返回 2=复位",
1,总体错误,"1=急停 2=没有气压信号 3=盘错乱",
2,运动轴错误,"1=第一轴(旋转)2=第二轴(上下轴)3=第三轴(前进轴)4=第四轴(压紧轴),5=上下电缸",
3,IO报警,信号超时,io电器定义(电器定义)
*/
public class AlarmInfo extends BaseMongoBean {
/**
* 料仓名称
*/
private String storageName;
/// <summary>
/// 料仓ID,0表示流水线
/// </summary>
private String boxId;
/// <summary>
/// 报警类型,
/// </summary>
private String alarmType;
/// <summary>
/// 报警详情
/// </summary>
private String alarmDetail;
/// <summary>
/// 报警消息
/// </summary>
private String alarmMsg;
/// <summary>
/// 0,1=入库,2=出库
/// </summary>
private String inOutStatus;
/**
* 开始时间
*/
private Date startTime;
/**
* 结束时间
*/
private Date endTime;
public String getAlarmDetail() {
return alarmDetail;
}
public void setAlarmDetail(String alarmDetail) {
this.alarmDetail = alarmDetail;
}
public String getAlarmMsg() {
return alarmMsg;
}
public void setAlarmMsg(String alarmMsg) {
this.alarmMsg = alarmMsg;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getAlarmTypeMsg(){
return StorageConstants.ALARM_TYPE_MSG.getMsg(alarmType,alarmDetail);
}
public String getKey(){
return storageName + "-"+ boxId + "-" + alarmType+"-" + alarmDetail;
}
public String getStorageName() {
return storageName;
}
public String getBoxId() {
return boxId;
}
public void setBoxId(String boxId) {
this.boxId = boxId;
}
public String getAlarmType() {
return alarmType;
}
public void setAlarmType(String alarmType) {
this.alarmType = alarmType;
}
public String getInOutStatus() {
return inOutStatus;
}
public void setInOutStatus(String inOutStatus) {
this.inOutStatus = inOutStatus;
}
public void setStorageName(String storageName) {
this.storageName = storageName;
}
@Override
public boolean equals(Object o) {
boolean eq = super.equals(o);
if(!eq && o!= null && o instanceof AlarmInfo){
AlarmInfo a = (AlarmInfo)o;
//id 都不存在
if(a.getId() == null && getId() == null){
return a.getKey().equals(getKey());
}
}
return eq;
}
@Override
public int hashCode() {
return super.hashCode();
}
}
package com.myproject.bean.update;
import com.myproject.bean.BaseMongoBean;
import com.myproject.util.StorageConstants;
import org.hibernate.validator.constraints.NotEmpty;
/**
* Created by kangmor on 2015/9/15.
*/
public class Component extends BaseMongoBean {
/**
* 产品类型:0元器件,1锡膏2PCB3其他4夹具
*/
private int type = StorageConstants.COMPONENT_TYPE.COMPONENT;
/**
* 产品型号
*/
private String model;
//元器件型号
private String productionType;
//"封装"/组件型号
private String encapsulation;
/**
* 冰箱存储条件
*/
private int storageCondition;
/**
* 室温最多存储时间
*/
private int maxStorageTime;
/**
* 回温时间
*/
private int warmTime;
/**
* 夹具编号
*/
private String fixtureNumber;
/**
* 名称 用户输入文本
锡膏类型(productionType) 有铅/无铅 选择
型号 文本输入
包装方式(encapsulation) 罐装/管装 选择
冰箱存储条件 默认单位是摄氏度,仅作输入显示
室温最多存储时间 用户输入数字,单位为小时,此时间为锡膏在料仓内最大存储时间,报警提示
回温时间 用户输入数字,单位为小时,达到回温时间按才能出库
开封后可以保存时间 室温最多存储时间-回温时间,第一次出库,就认为是开封
*/
//名称
private String name;
//料号
//@NotEmpty(message = "{component.partNumber.empty}")
@NotEmpty(message = "{component.partNumber.empty}")
private String partNumber;
//uid
private String uid;
//物料描述
private String description;
//单耗
private String unitCost;
//"MSL等级"
private String msl;
//"单位"
private String unit;
//"厂商"
private String producer;
//"厂商编号"
private String producerNumber;
//"供应商"
private String provider;
//"供应商编号"
private String providerNumber;
private int amount;
/**
* 报警值,与贴片机连机时使用,值小于1时为初始数量amount百分比,大于等于1时为数量,小于此值时会根据贴片机信息自动出料
*/
private float alarmValue = 0.5f;
private int plateSize;
private int height;
/**
* 单台料仓可存储此种物料的最大数量
*/
private int maxStoreNum = 999999999;
/**
* 单台料仓存储此种物料的最小数量
*/
private int minStoreNum = 0;
/**
* 出库时是否需要授权
*/
private boolean needAuth = false;
/**
* 展示的图片
*/
private String showImg = "";
/**
* 有效时长(生产日期+此天数为过期日期),设置默认有效期为2年
*/
private int validDay = 730;
public Component() {
//this.height = StorageConstants.DEFAULT_HEIGHT;
//this.plateSize = StorageConstants.PLATE_SIZE_SMALL;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPartNumber() {
return partNumber;
}
public void setPartNumber(String partNumber) {
this.partNumber = partNumber;
}
public String getMsl() {
return msl;
}
public void setMsl(String msl) {
this.msl = msl;
}
public String getEncapsulation() {
return encapsulation;
}
public void setEncapsulation(String encapsulation) {
this.encapsulation = encapsulation;
}
public String getProductionType() {
return productionType;
}
public void setProductionType(String productionType) {
this.productionType = productionType;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getProducer() {
return producer;
}
public void setProducer(String producer) {
this.producer = producer;
}
public String getProducerNumber() {
return producerNumber;
}
public void setProducerNumber(String producerNumber) {
this.producerNumber = producerNumber;
}
public String getProvider() {
return provider;
}
public void setProvider(String provider) {
this.provider = provider;
}
public String getProviderNumber() {
return providerNumber;
}
public void setProviderNumber(String providerNumber) {
this.providerNumber = providerNumber;
}
public int getAmount() {
return amount;
}
public void setAmount(int amount) {
this.amount = amount;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getUnitCost() {
return unitCost;
}
public void setUnitCost(String unitCost) {
this.unitCost = unitCost;
}
public int getPlateSize() {
return plateSize;
}
public void setPlateSize(int plateSize) {
this.plateSize = plateSize;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public void setPSize(String pSize){
}
public String getPSize(){
if(plateSize == 0 || height == 0){
return "";
}
if(type == StorageConstants.COMPONENT_TYPE.FIXTURE){
return plateSize + "x" +height+"x" + partNumber;
}
return plateSize + "x" +height;
}
public boolean isNeedAuth() {
return needAuth;
}
public void setNeedAuth(boolean needAuth) {
this.needAuth = needAuth;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public int getWarmTime() {
return warmTime;
}
public void setWarmTime(int warmTime) {
this.warmTime = warmTime;
}
public int getStorageCondition() {
return storageCondition;
}
public void setStorageCondition(int storageCondition) {
this.storageCondition = storageCondition;
}
public int getMaxStorageTime() {
return maxStorageTime;
}
public void setMaxStorageTime(int maxStorageTime) {
this.maxStorageTime = maxStorageTime;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getFixtureNumber() {
return fixtureNumber;
}
public void setFixtureNumber(String fixtureNumber) {
this.fixtureNumber = fixtureNumber;
}
public int getMaxStoreNum() {
return maxStoreNum;
}
public void setMaxStoreNum(int maxStoreNum) {
this.maxStoreNum = maxStoreNum;
}
public int getMinStoreNum() {
return minStoreNum;
}
public void setMinStoreNum(int minStoreNum) {
this.minStoreNum = minStoreNum;
}
public float getAlarmValue() {
return alarmValue;
}
public void setAlarmValue(float alarmValue) {
this.alarmValue = alarmValue;
}
public int getAlarmAmount(){
if(alarmValue < 1){
return Float.valueOf(getAmount() * alarmValue).intValue();
}else{
return Float.valueOf(alarmValue).intValue();
}
}
public String getShowImg() {
return showImg;
}
public void setShowImg(String showImg) {
this.showImg = showImg;
}
public int getValidDay() {
return validDay;
}
public void setValidDay(int validDay) {
this.validDay = validDay;
}
}
package com.myproject.bean.update;
import com.myproject.bean.BaseMongoBean;
/**
*
*/
public class Humiture extends BaseMongoBean {
/**
* 料仓号
*/
private String cid;
public Integer getBoxId() {
return boxId;
}
public void setBoxId(Integer boxId) {
this.boxId = boxId;
}
/**
* BOX 的 ID
*/
private Integer boxId;
/**
* 温度
*/
private String temperature;
/**
* 湿度
*/
private String humidity;
public String getCid() {
return cid;
}
public void setCid(String cid) {
this.cid = cid;
}
public String getTemperature() {
return temperature;
}
public void setTemperature(String temperature) {
this.temperature = temperature;
}
public String getHumidity() {
return humidity;
}
public void setHumidity(String humidity) {
this.humidity = humidity;
}
public String getBoxKey(){
return cid +"-"+ boxId;
}
}
package com.myproject.bean.update;
import com.myproject.bean.json.TaskSet;
import com.myproject.util.StorageConstants;
/**
* 呆料出库
*/
public class InactionTaskSet extends TaskSet {
public static InactionTaskSet create(String areaId, int day){
InactionTaskSet inactionTaskSet = new InactionTaskSet();
inactionTaskSet.setName(day + "天前呆滞物料出库");
inactionTaskSet.setStatus(StorageConstants.OP_STATUS.WAIT.name());
inactionTaskSet.setId("-1");
inactionTaskSet.setDay(day);
return inactionTaskSet;
}
/**
* 总共的物料数量
*/
private int totalOp;
/**
* 几天前的呆滞料
*/
private int day;
public int getTotalOp() {
return totalOp;
}
/**
* 返回总任务数
* @return
*/
@Override
public int getOpNum() {
return totalOp;
}
public int currentOpNum(){
return super.getOpNum();
}
public void setTotalOp(int totalOp) {
this.totalOp = totalOp;
}
public int getDay() {
return day;
}
public void setDay(int day) {
this.day = day;
}
@Override
public StorageConstants.TASK_SOURCE getTaskSource() {
return StorageConstants.TASK_SOURCE.INACTION;
}
@Override
public String getTitle() {
return getName();
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!