Merge branch 'dev' of http://git.estsh.com/i3-IMPP/i3plus-pojo into dev
commit
c1cff11c7c
@ -0,0 +1,18 @@
|
||||
package cn.estsh.i3plus.pojo.base.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @Description : XStream 数据转换的CDATA
|
||||
* @Reference :
|
||||
* @Author : wei.peng
|
||||
* @CreateDate : 2019-07-23 下午5:52
|
||||
* @Modify:
|
||||
**/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface XStreamCDATA {
|
||||
}
|
@ -0,0 +1,231 @@
|
||||
package cn.estsh.i3plus.pojo.base.common;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.annotation.XStreamCDATA;
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.core.util.QuickWriter;
|
||||
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
|
||||
import com.thoughtworks.xstream.io.naming.NameCoder;
|
||||
import com.thoughtworks.xstream.io.naming.NoNameCoder;
|
||||
import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
|
||||
import com.thoughtworks.xstream.io.xml.XppDomDriver;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* @Description : Xml 工厂
|
||||
* 官方DOC: https://www.tutorialspoint.com/xstream/xstream_discussion.htm
|
||||
* @Reference :
|
||||
* @Author : wei.peng
|
||||
* @CreateDate : 19-7-23 下午5:58
|
||||
* @Modify:
|
||||
**/
|
||||
public class XStreamFactory {
|
||||
|
||||
private static final XStream xStream = XStreamFactory.getXStream();
|
||||
|
||||
public static final String CDATA_PREFIX = "<![CDATA[";
|
||||
public static final String CDATA_SUFFIX = "]]>";
|
||||
|
||||
public static XStream getXStream() {
|
||||
final NameCoder nameCoder = new NoNameCoder();
|
||||
XStream xStream = new XStream(new XppDomDriver(nameCoder) {
|
||||
@Override
|
||||
public HierarchicalStreamWriter createWriter(Writer out) {
|
||||
return new PrettyPrintWriter(out, nameCoder) {
|
||||
boolean cdataFlag = false;
|
||||
Class<?> targetClass = null;
|
||||
|
||||
@Override
|
||||
public void startNode(String name, Class clazz) {
|
||||
super.startNode(name, clazz);
|
||||
if (targetClass == null) {
|
||||
targetClass = clazz;
|
||||
}
|
||||
cdataFlag = isCDATA(targetClass, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeText(QuickWriter writer, String text) {
|
||||
if (cdataFlag) {
|
||||
writer.write(CDATA_PREFIX);
|
||||
writer.write(text);
|
||||
writer.write(CDATA_SUFFIX);
|
||||
} else {
|
||||
writer.write(text);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
xStream.autodetectAnnotations(true);
|
||||
|
||||
return xStream;
|
||||
}
|
||||
|
||||
|
||||
private static boolean isCDATA(Class<?> clazz, String fieldAlias) {
|
||||
//检查类本身
|
||||
boolean cdataFlag = isExistCDATA(clazz, fieldAlias);
|
||||
if (cdataFlag) {
|
||||
return cdataFlag;
|
||||
}
|
||||
//继续检查父类
|
||||
Class<?> superClazz = clazz.getSuperclass();
|
||||
while (!superClazz.equals(Object.class)) {
|
||||
cdataFlag = isExistCDATA(superClazz, fieldAlias);
|
||||
if (cdataFlag) {
|
||||
return cdataFlag;
|
||||
}
|
||||
superClazz = superClazz.getClass().getSuperclass();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否有 @XStreamCDATA 注解
|
||||
*
|
||||
* @param clazz clazz
|
||||
* @param fieldAlias fieldAlias
|
||||
* @return
|
||||
*/
|
||||
private static boolean isExistCDATA(Class<?> clazz, String fieldAlias) {
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
if (field.getAnnotation(XStreamCDATA.class) != null) {
|
||||
XStreamAlias xStreamAlias = field.getAnnotation(XStreamAlias.class);
|
||||
if (xStreamAlias != null && fieldAlias.equals(xStreamAlias.value())) {
|
||||
return true;
|
||||
} else {
|
||||
if (fieldAlias.equals(field.getName())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Javabean 转XML
|
||||
* @param <T>
|
||||
* @return xml字符串
|
||||
*/
|
||||
public static <T> String toXml(T t) {
|
||||
xStream.processAnnotations(t.getClass());
|
||||
String headLine = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
|
||||
return headLine + xStream.toXML(t);
|
||||
}
|
||||
|
||||
/**
|
||||
* XML字符串转javabean
|
||||
*
|
||||
* @param xmlStr xml字符串
|
||||
* @param <T>
|
||||
* @return Java对象
|
||||
*/
|
||||
public static <T> T toJavaBean(String xmlStr) {
|
||||
return (T) xStream.fromXML(xmlStr);
|
||||
}
|
||||
//
|
||||
// public static void main(String[] args) {
|
||||
// User u = new User(0, "zhangsan0", "zhangsanpwd0");
|
||||
// User u1 = new User(1, "zhangsan1", "zhangsanpwd");
|
||||
// User u2 = new User(2, "zhangsan2", "zhangsanpwd");
|
||||
// User u3 = new User(3, "zhangsan3", "zhangsanpwd");
|
||||
//
|
||||
// Role r1 = new Role(1, "Admin", "Admin1");
|
||||
// Role r2 = new Role(2, "Admin", "Admin2");
|
||||
// Role r3 = new Role(3, "Admin", "Admin3");
|
||||
//
|
||||
// DataAdapter ad = new DataAdapter(10086L,UUID.randomUUID().toString(),"sssfwef",u1);
|
||||
// u1.setRole(r1);
|
||||
//
|
||||
// u2.getRoleList().add(r1);
|
||||
// u2.getRoleList().add(r2);
|
||||
// u2.getRoleList().add(r3);
|
||||
//
|
||||
// u3.setRole(r1);
|
||||
// u3.getRoleList().add(r2);
|
||||
// u3.getRoleList().add(r3);
|
||||
//
|
||||
// System.out.println(toXml(u) + "\n\n ");
|
||||
// System.out.println(toXml(u1) + "\n\n ");
|
||||
// System.out.println(toXml(u2) + "\n\n ");
|
||||
// System.out.println(toXml(u3) + "\n\n ");
|
||||
// System.out.println(toXml(ad) + "\n\n ");
|
||||
//
|
||||
// System.out.println(JSON.toJSONString(toJavaBean(toXml(ad))));
|
||||
//
|
||||
// }
|
||||
}
|
||||
//
|
||||
//@Data
|
||||
//@XStreamAlias("DataAdapter")
|
||||
////对应carInfos元素
|
||||
//class DataAdapter implements Serializable {
|
||||
//
|
||||
// @XStreamAsAttribute
|
||||
// private Long scId;
|
||||
// private String key;
|
||||
// @XStreamCDATA
|
||||
// private String resultData;
|
||||
//
|
||||
// private Object auth;
|
||||
//
|
||||
// public DataAdapter(Long scId, String key, String resultData, Object auth) {
|
||||
// this.scId = scId;
|
||||
// this.key = key;
|
||||
// this.resultData = resultData;
|
||||
// this.auth = auth;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//@Data
|
||||
//@XStreamAlias("user")
|
||||
////对应carInfos元素
|
||||
//class User implements Serializable {
|
||||
// private static final long serialVersionUID = -7554548655397869156L;
|
||||
//
|
||||
// @XStreamAsAttribute
|
||||
// private Integer id;
|
||||
// private String loginName;
|
||||
// private String loginPwd;
|
||||
//
|
||||
// private Role role;
|
||||
// private List<Role> roleList = new ArrayList<Role>();
|
||||
// private List<Role> roleArray;
|
||||
//
|
||||
// public User() {
|
||||
// }
|
||||
//
|
||||
// public User(Integer id, String loginName, String loginPwd) {
|
||||
// this.id = id;
|
||||
// this.loginName = loginName;
|
||||
// this.loginPwd = loginPwd;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//@Data
|
||||
//@XStreamAlias("role")
|
||||
////对应carInfos元素
|
||||
//class Role implements Serializable {
|
||||
// private static final long serialVersionUID = -3134157833696958743L;
|
||||
// @XStreamAsAttribute
|
||||
// private Integer id;
|
||||
// private String roleName;
|
||||
// private String roleCode;
|
||||
//
|
||||
// public Role() {
|
||||
// }
|
||||
//
|
||||
// public Role(Integer id, String roleName, String roleCode) {
|
||||
// this.id = id;
|
||||
// this.roleName = roleName;
|
||||
// this.roleCode = roleCode;
|
||||
// }
|
||||
//}
|
@ -0,0 +1,65 @@
|
||||
package cn.estsh.i3plus.pojo.mes.pcn.bean;
|
||||
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* @Author: Wynne.Lu
|
||||
* @CreateDate: 2019/7/30 9:30 AM
|
||||
* @Description:
|
||||
**/
|
||||
@Data
|
||||
@Entity
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table(name="MES_ESOP")
|
||||
@Api("作业指导书信息表(ODS)")
|
||||
public class MesESOP extends BaseBean {
|
||||
|
||||
@Column(name="PART_NO")
|
||||
@ApiParam("零件号")
|
||||
private String partNo;
|
||||
|
||||
@Column(name="WORK_CENTER_CODE")
|
||||
@ApiParam("工作中心代码")
|
||||
private String workCenterCode;
|
||||
|
||||
@Column(name="WORK_CELL_CODE")
|
||||
@ApiParam("工作单元代码")
|
||||
private String workCellCode;
|
||||
|
||||
@Column(name="ROUTE_CODE")
|
||||
@ApiParam("流程代码")
|
||||
private String routeCode;
|
||||
|
||||
@Column(name="PROCESS_CODE")
|
||||
@ApiParam("工序代码")
|
||||
private String processCode;
|
||||
|
||||
@Column(name = "STEP_CODE")
|
||||
@ApiParam("工步代码")
|
||||
private String stepCode;
|
||||
|
||||
@Column(name = "STEP_SEQ")
|
||||
@ApiParam("工步序号")
|
||||
private Integer stepSeq;
|
||||
|
||||
@Column(name="SOP_NAME")
|
||||
@ApiParam("SOP名称")
|
||||
private String sopName;
|
||||
|
||||
@Column(name="SOP_URL")
|
||||
@ApiParam("SOP_URL")
|
||||
private String sopUrl;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package cn.estsh.i3plus.pojo.mes.pcn.repository;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||
|
||||
import cn.estsh.i3plus.pojo.mes.pcn.bean.MesESOP;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : wynne.lu
|
||||
* @CreateDate : 2019-07-30
|
||||
* @Modify:
|
||||
**/
|
||||
@Repository
|
||||
public interface MesESOPRepository extends BaseRepository<MesESOP, Long> {
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package cn.estsh.i3plus.pojo.mes.bean;
|
||||
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* @Author: Wynne.Lu
|
||||
* @CreateDate: 2019/7/30 9:30 AM
|
||||
* @Description:
|
||||
**/
|
||||
@Data
|
||||
@Entity
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table(name="MES_ESOP")
|
||||
@Api("作业指导书信息表(ODS)")
|
||||
public class MesESOP extends BaseBean {
|
||||
|
||||
@Column(name="PART_NO")
|
||||
@ApiParam("零件号")
|
||||
private String partNo;
|
||||
|
||||
@Column(name="WORK_CENTER_CODE")
|
||||
@ApiParam("工作中心代码")
|
||||
private String workCenterCode;
|
||||
|
||||
@Column(name="WORK_CELL_CODE")
|
||||
@ApiParam("工作单元代码")
|
||||
private String workCellCode;
|
||||
|
||||
@Column(name="ROUTE_CODE")
|
||||
@ApiParam("流程代码")
|
||||
private String routeCode;
|
||||
|
||||
@Column(name="PROCESS_CODE")
|
||||
@ApiParam("工序代码")
|
||||
private String processCode;
|
||||
|
||||
@Column(name = "STEP_CODE")
|
||||
@ApiParam("工步代码")
|
||||
private String stepCode;
|
||||
|
||||
@Column(name = "STEP_SEQ")
|
||||
@ApiParam("工步序号")
|
||||
private Integer stepSeq;
|
||||
|
||||
@Column(name="SOP_NAME")
|
||||
@ApiParam("SOP名称")
|
||||
private String sopName;
|
||||
|
||||
@Column(name="SOP_URL")
|
||||
@ApiParam("SOP_URL")
|
||||
private String sopUrl;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package cn.estsh.i3plus.pojo.mes.repository;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesActionMethod;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesESOP;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : wynne.lu
|
||||
* @CreateDate : 2019-07-30
|
||||
* @Modify:
|
||||
**/
|
||||
@Repository
|
||||
public interface MesESOPRepository extends BaseRepository<MesESOP, Long> {
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package cn.estsh.i3plus.pojo.model.softswitch;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.annotation.XStreamCDATA;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : wei.peng
|
||||
* @CreateDate : 19-7-25 下午3:31
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
@XStreamAlias("auth")
|
||||
public class PojoAuth{
|
||||
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
@XStreamAsAttribute
|
||||
private Integer authType;
|
||||
|
||||
@XStreamImplicit
|
||||
private List<Prop> params;
|
||||
|
||||
private String authPath;
|
||||
private String userName ="登录名称";
|
||||
private String password ="登录名称";
|
||||
private String languageCode ="登录名称";
|
||||
|
||||
// 认证令牌
|
||||
private String token;
|
||||
// // 认证令牌集合(复杂认证令牌)
|
||||
// private List<Prop> tokenList;
|
||||
// 原始认证数据
|
||||
@XStreamCDATA
|
||||
private String result;
|
||||
|
||||
public PojoAuth(Long id, Integer authType,String authPath, List<Prop> params) {
|
||||
this.id = id;
|
||||
this.authType = authType;
|
||||
this.authPath = authPath;
|
||||
this.params = params;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.estsh.i3plus.pojo.model.softswitch;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : wei.peng
|
||||
* @CreateDate : 19-7-25 下午5:18
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
@XStreamAlias("prop")
|
||||
public class Prop {
|
||||
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
private String paramName;
|
||||
private String paramValue;
|
||||
|
||||
public Prop(Long id, String paramName, String paramValue) {
|
||||
this.id = id;
|
||||
this.paramName = paramName;
|
||||
this.paramValue = paramValue;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package cn.estsh.i3plus.pojo.model.softswitch;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.annotation.XStreamCDATA;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : wei.peng
|
||||
* @CreateDate : 19-7-25 下午3:31
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
@XStreamAlias("request")
|
||||
public class Request{
|
||||
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
@XStreamAsAttribute
|
||||
private Integer requestType;
|
||||
private String requestPath;
|
||||
|
||||
@XStreamCDATA
|
||||
private String result;
|
||||
|
||||
public Request(Long id, Integer requestType,String requestPath) {
|
||||
this.id = id;
|
||||
this.requestType = requestType;
|
||||
this.requestPath = requestPath;
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package cn.estsh.i3plus.pojo.model.softswitch;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.annotation.XStreamCDATA;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : wei.peng
|
||||
* @CreateDate : 19-7-25 下午3:29
|
||||
* @Modify:
|
||||
**/
|
||||
@Data
|
||||
@XStreamAlias("model")
|
||||
public class SuitCoreModel {
|
||||
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
@XStreamAsAttribute
|
||||
private Integer caseType;
|
||||
private String suitCaseStatusCode;
|
||||
private String suitCaseMessage;
|
||||
|
||||
private String key;
|
||||
private PojoAuth auth;
|
||||
private Request request;
|
||||
|
||||
@XStreamCDATA
|
||||
private String responseResult;
|
||||
|
||||
public SuitCoreModel(Long id, Integer caseType, String suitCaseStatusCode, String key, PojoAuth auth, Request request) {
|
||||
this.id = id;
|
||||
this.caseType = caseType;
|
||||
this.suitCaseStatusCode = suitCaseStatusCode;
|
||||
this.key = key;
|
||||
this.auth = auth;
|
||||
this.request = request;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,14 +0,0 @@
|
||||
package cn.estsh.i3plus.pojo.platform.platrepositorymongo;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseMongoRepository;
|
||||
import cn.estsh.i3plus.pojo.platform.platbean.WmsActionLogData;
|
||||
|
||||
/**
|
||||
* @Description : 作业日志参数(使用Mongodb)
|
||||
* @Reference :
|
||||
* @Author : siliter
|
||||
* @Date : 2019-04-11 12:03:00
|
||||
* @Modify :
|
||||
**/
|
||||
public interface WmsActionLogDataMongoRepository extends BaseMongoRepository<WmsActionLogData, Long> {
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package cn.estsh.i3plus.pojo.platform.platrepositorymongo;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseMongoRepository;
|
||||
import cn.estsh.i3plus.pojo.platform.platbean.WmsActionLogDetails;
|
||||
|
||||
/**
|
||||
* @Description : 作业日志明细(使用Mongodb)
|
||||
* @Reference :
|
||||
* @Author : siliter
|
||||
* @Date : 2019-04-11 12:03:00
|
||||
* @Modify :
|
||||
**/
|
||||
public interface WmsActionLogDetailsMongoRepository extends BaseMongoRepository<WmsActionLogDetails, Long> {
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package cn.estsh.i3plus.pojo.platform.platrepositorymongo;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseMongoRepository;
|
||||
import cn.estsh.i3plus.pojo.platform.platbean.WmsActionLog;
|
||||
|
||||
/**
|
||||
* @Description : 作业日志(使用Mongodb)
|
||||
* @Reference :
|
||||
* @Author : siliter
|
||||
* @Date : 2019-04-11 12:03:00
|
||||
* @Modify :
|
||||
**/
|
||||
public interface WmsActionLogMongoRepository extends BaseMongoRepository<WmsActionLog, Long> {
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
package cn.estsh.i3plus.pojo.platform.sqlpack;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.tool.BsonPackTool;
|
||||
import cn.estsh.i3plus.pojo.platform.platbean.*;
|
||||
import com.mongodb.BasicDBObject;
|
||||
import org.bson.conversions.Bson;
|
||||
|
||||
/**
|
||||
* @Description : Bson对象封装
|
||||
* @Reference :
|
||||
* @Author : siliter
|
||||
* @CreateDate : 2019-04-11 13:15
|
||||
* @Modify:
|
||||
**/
|
||||
public class WmsBsonPack {
|
||||
|
||||
/**
|
||||
* 作业日志复杂查询
|
||||
*
|
||||
* @param actionLog
|
||||
* @return
|
||||
*/
|
||||
public static Bson packBsonByActionLog(WmsActionLog actionLog) {
|
||||
Bson bson = new BasicDBObject();
|
||||
bson = BsonPackTool.timeBuilder(actionLog.getCreateDatetime(), "createDatetime", bson, false, false);
|
||||
bson = BsonPackTool.getStringEqualPack(actionLog.getOrderNo(), "orderNo", bson);
|
||||
bson = BsonPackTool.getStringEqualPack(actionLog.getTransTypeCode(), "transTypeCode", bson);
|
||||
bson = BsonPackTool.getStringEqualPack(actionLog.getFixId(), "fixId", bson);
|
||||
bson = BsonPackTool.getNumEqualPack(actionLog.getAgId(), "agId", bson);
|
||||
bson = BsonPackTool.getNumEqualPack(actionLog.getActionStatus(), "actionStatus", bson);
|
||||
bson = BsonPackTool.getStringEqualPack(actionLog.getAgNameC(), "agNameC", bson);
|
||||
bson = BsonPackTool.getStringEqualPack(actionLog.getOrganizeCode(), "organizeCode", bson);
|
||||
bson = BsonPackTool.getNumEqualPack(actionLog.getIsValid(), "isValid", bson);
|
||||
bson = BsonPackTool.getNumEqualPack(actionLog.getIsDeleted(), "isDeleted", bson);
|
||||
|
||||
if((actionLog.getStartTimeStart() != null&&actionLog.getStartTimeStart() !="")
|
||||
|| (actionLog.getStartTimeEnd() != null&&actionLog.getStartTimeEnd() != "")){
|
||||
bson = BsonPackTool.timeBuilder(actionLog.getStartTimeStart(), actionLog.getStartTimeEnd(), "startTime", bson, true);
|
||||
}
|
||||
|
||||
if((actionLog.getEndTimeStart() != null&&actionLog.getEndTimeStart() != "")
|
||||
|| (actionLog.getEndTimeEnd() != null&&actionLog.getEndTimeEnd() != "")){
|
||||
bson = BsonPackTool.timeBuilder(actionLog.getEndTimeStart(), actionLog.getEndTimeEnd(), "endTime", bson, true);
|
||||
}
|
||||
|
||||
return bson;
|
||||
}
|
||||
|
||||
/**
|
||||
* 作业日志明细复杂查询
|
||||
*
|
||||
* @param actionLogDetails
|
||||
* @return
|
||||
*/
|
||||
public static Bson packBsonByActionLogDetails(WmsActionLogDetails actionLogDetails) {
|
||||
Bson bson = new BasicDBObject();
|
||||
bson = BsonPackTool.getNumEqualPack(actionLogDetails.getAlId(), "alId", bson);
|
||||
bson = BsonPackTool.getStringEqualPack(actionLogDetails.getOrganizeCode(), "organizeCode", bson);
|
||||
bson = BsonPackTool.getNumEqualPack(actionLogDetails.getValueType(), "valueType", bson);
|
||||
bson = BsonPackTool.getNumEqualPack(actionLogDetails.getSeq(), "seq", bson);
|
||||
bson = BsonPackTool.getNumEqualPack(actionLogDetails.getIsValid(), "isValid", bson);
|
||||
bson = BsonPackTool.getNumEqualPack(actionLogDetails.getIsDeleted(), "isDeleted", bson);
|
||||
return bson;
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用组件日志复杂查询
|
||||
*
|
||||
* @param actionLogData
|
||||
* @return
|
||||
*/
|
||||
public static Bson packBsonByActionLogData(WmsActionLogData actionLogData) {
|
||||
Bson bson = new BasicDBObject();
|
||||
bson = BsonPackTool.getNumEqualPack(actionLogData.getAldId(), "aldId", bson);
|
||||
bson = BsonPackTool.getStringEqualPack(actionLogData.getOrganizeCode(), "organizeCode", bson);
|
||||
bson = BsonPackTool.getNumEqualPack(actionLogData.getIsValid(), "isValid", bson);
|
||||
bson = BsonPackTool.getNumEqualPack(actionLogData.getIsDeleted(), "isDeleted", bson);
|
||||
return bson;
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package cn.estsh.i3plus.pojo.wms.bean;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Index;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* @Description : WMS_设备信息
|
||||
* @Reference :
|
||||
* @author: amy.liu
|
||||
* @date: 2019/7/29 10:39
|
||||
* @Modify:
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table(name = "WMS_FIX")
|
||||
@Api("WMS设备信息")
|
||||
public class WmsFix extends BaseBean{
|
||||
|
||||
@Column(name = "FIX_ID")
|
||||
@ApiParam("设备编号")
|
||||
public String fixId;
|
||||
|
||||
@Column(name = "FIX_MAC")
|
||||
@ApiParam("设备mac地址")
|
||||
public String fixMac;
|
||||
|
||||
@Column(name = "FIX_NAME")
|
||||
@ApiParam("设备名称")
|
||||
public String fixName;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.estsh.i3plus.pojo.wms.repository;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||
import cn.estsh.i3plus.pojo.wms.bean.WmsActionLogData;
|
||||
|
||||
/**
|
||||
* @Description : 作业日志参数(使用Mongodb)
|
||||
* @Reference :
|
||||
* @Author : siliter
|
||||
* @Date : 2019-04-11 12:03:00
|
||||
* @Modify :
|
||||
**/
|
||||
public interface WmsActionLogDataRepository extends BaseRepository<WmsActionLogData, Long> {
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.estsh.i3plus.pojo.wms.repository;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||
import cn.estsh.i3plus.pojo.wms.bean.WmsActionLogDetails;
|
||||
|
||||
/**
|
||||
* @Description : 作业日志明细(使用Mongodb)
|
||||
* @Reference :
|
||||
* @Author : siliter
|
||||
* @Date : 2019-04-11 12:03:00
|
||||
* @Modify :
|
||||
**/
|
||||
public interface WmsActionLogDetailsRepository extends BaseRepository<WmsActionLogDetails, Long> {
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package cn.estsh.i3plus.pojo.wms.repository;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||
import cn.estsh.i3plus.pojo.wms.bean.WmsActionLog;
|
||||
|
||||
/**
|
||||
* @Description : 作业日志(使用Mongodb)
|
||||
* @Reference :
|
||||
* @Author : siliter
|
||||
* @Date : 2019-04-11 12:03:00
|
||||
* @Modify :
|
||||
**/
|
||||
public interface WmsActionLogRepository extends BaseRepository<WmsActionLog, Long> {
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package cn.estsh.i3plus.pojo.wms.repository;
|
||||
|
||||
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||
import cn.estsh.i3plus.pojo.wms.bean.WmsFix;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Description : 设备 对象持久层仓用方法控制
|
||||
* @Reference :
|
||||
* @author: amy.liu
|
||||
* @date: 2019/7/29 10:44
|
||||
* @Modify:
|
||||
*/
|
||||
@Repository
|
||||
public interface WmsFixRepository extends BaseRepository<WmsFix, Long> {
|
||||
}
|
Loading…
Reference in New Issue