Commit eafcb3dc authored by tank.li@mushiny.com's avatar tank.li@mushiny.com

南沙wms临时初始化地址

parent 0fc96f85
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mushiny.wms</groupId>
<artifactId>wms-midea-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>wms-midea-server</name>
<description>wms</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.registry>192.168.1.240:5000</project.registry>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<jgrapht.core.version>1.0.1</jgrapht.core.version>
</properties>
<dependencies>
<!-- Spring Boot -->
<!--<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<exclusions>
<exclusion>
<artifactId>tools</artifactId>
<groupId>com.sun</groupId>
</exclusion>
</exclusions>
</dependency>-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.19</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-java8</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-json-org</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot</artifactId>
<version>1.4.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<!--<dependency>
<groupId>com.googlecode.log4jdbc</groupId>
<artifactId>log4jdbc</artifactId>
<version>1.2</version>
</dependency>-->
<dependency>
<groupId>org.lazyluke</groupId>
<artifactId>log4jdbc-remix</artifactId>
<version>0.2.7</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.15</version>
</dependency>
<dependency>
<groupId>org.jgrapht</groupId>
<artifactId>jgrapht-core</artifactId>
<version>${jgrapht.core.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>1.3.1.RELEASE</version>
</dependency>
<!-- junit 测试依赖 开始 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>16.0.3</version>
</dependency>
<!-- junit 测试依赖 结束 -->
</dependencies>
<!-- Package as an executable jar -->
<build>
<defaultGoal>spring-boot:run</defaultGoal>
<finalName>wms-midea-server</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--<configuration>
<executable>true</executable>
<fork>true</fork>
</configuration>-->
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.10</version>
<configuration>
<imageName>${docker.registry}/${project.groupId}/${project.artifactId}:${project.version}</imageName>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<configuration>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
</plugins>
</pluginManagement>
</build>
</project>
FROM java:8
MAINTAINER "hanjianmin"<jianmin.han@mushiny.com>
VOLUME /tmp
ADD wms-midea-service-v8-1.0-SNAPSHOT.jar app.jar
RUN sh -c 'touch /app.jar'
EXPOSE 12003
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
\ No newline at end of file
package com.mushiny;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
@SpringBootApplication
@EnableJpaRepositories(basePackages = {"com.mushiny.wms"}
)
public class ServerApplication{
public static void main(String[] args) {
SpringApplication.run(ServerApplication.class, args);
}
}
package com.mushiny;
import com.mushiny.wms.common.utils.JSONUtil;
import java.util.HashMap;
import java.util.Map;
/**
* 电梯配置
*/
public class TestJson {
public static void main1(String[] args) {
Map data = new HashMap();
data.put("aa","aav");
Map data1 = new HashMap();
data1.put("bb","bbv");
data.put("data1",data1);
String json = JSONUtil.mapToJSon(data);
Map resData = JSONUtil.jsonToMap(json);
System.out.println(resData);
}
}
package com.mushiny.interceptor;
import com.mushiny.wms.common.utils.JSONUtil;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
/*
* @author:
* @Description: Created by wjw on 2017/8/20.
*/
@Aspect
@Component
public class ControlerParamAspect {
private final static Logger LOGGER = LoggerFactory.getLogger(ControlerParamAspect.class);
public static final String POINT = "execution(* com.mushiny.wms.*.web.*.*(..)))";
@Around(POINT)
public Object timeAround(ProceedingJoinPoint joinPoint) throws Throwable {
// 定义返回对象、得到方法需要的参数
Object obj = null;
Object[] args = joinPoint.getArgs();
StringBuffer sb=new StringBuffer();
for(Object arg:args)
{
sb.append(arg);
}
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
String methodName = signature.getDeclaringTypeName() + "." + signature.getName();
LOGGER.info("web请求,方法名{} 参数{}",methodName,sb.toString());
try {
obj = joinPoint.proceed(args);
}
catch (Throwable e)
{
LOGGER.error(e.getMessage(),e);
throw e;
}
// 获取执行的方法名
LOGGER.info("web请求,方法名{} 返回{}",methodName, JSONUtil.toJSon(obj));
return obj;
}
}
package com.mushiny.interceptor;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
/*
* @author:
* @Description: Created by wjw on 2017/8/20.
*/
@Aspect
@Component
public class RepositoryMethodAspect {
private final static Logger LOGGER = LoggerFactory.getLogger(RepositoryMethodAspect.class);
public static final String POINT = "execution(* com.mushiny.wms.application.repository.*.*(..))";
private static final long ONE_MINUTE = 10;
@Around(POINT)
public Object timeAround(ProceedingJoinPoint joinPoint) {
// 定义返回对象、得到方法需要的参数
Object obj = null;
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
String methodName = signature.getDeclaringTypeName() + "." + signature.getName();
LOGGER.info("开始执行查询["+methodName+"]");
try {
obj = joinPoint.proceed();
} catch (Throwable e) {
LOGGER.error("统计某方法执行耗时环绕通知出错", e);
}
return obj;
}
}
package com.mushiny.wms;
import com.mushiny.wms.common.context.ApplicationBeanContextAware;
import com.mushiny.wms.common.context.ApplicationContext;
import com.mushiny.wms.common.exception.BaseException;
import com.mushiny.wms.common.exception.ExceptionEntity;
import com.mushiny.wms.common.exception.ExceptionEnum;
import com.mushiny.wms.common.utils.ConversionUtil;
import com.mushiny.wms.common.utils.JSONUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
@ControllerAdvice
public class ServerApplicationExceptionHandler {
private static final Logger LOG = LoggerFactory.getLogger(ServerApplicationExceptionHandler.class);
// 默认拦截所有异常
@ExceptionHandler({Exception.class})
public ResponseEntity<String> handleException(HttpServletRequest request, Throwable ex) {
HttpStatus httpStatus = getStatus(request);
String uri = request.getRequestURI();
if (request.getQueryString() != null) {
uri += '?' + request.getQueryString();
}
String url = String.format("%s %s", request.getMethod(), uri);
ApplicationContext applicationContext = ApplicationBeanContextAware.getBean(ApplicationContext.class);
Message me=new Message();
me.setCode("0");
me.setMessage("fail");
//me.setDescribe(ex.getCause().getMessage());
me.setDescribe(ex.toString()+ex.getMessage());
String message = JSONUtil.toJSon(me);
/* if (ex.getClass().getName().contains(BaseException.class.getName())) {
message = ex.getMessage();
} else {
ApplicationContext applicationContext = ApplicationBeanContextAware.getBean(ApplicationContext.class);
ExceptionEntity exceptionEntity = new ExceptionEntity();
exceptionEntity.setKey(ExceptionEnum.EX_SERVER_ERROR.toString());
message = applicationContext.getErrorMessage(ExceptionEnum.EX_SERVER_ERROR.toString());
exceptionEntity.setMessage(message);
exceptionEntity.setValues(new ArrayList<>());
message = ConversionUtil.toJson(exceptionEntity);
}*/
LOG.error("##############################Start##############################");
LOG.error(url);
LOG.error(message, ex);
LOG.error("###############################End###############################");
return new ResponseEntity<>(message, httpStatus);
}
private HttpStatus getStatus(HttpServletRequest request) {
Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code");
if (statusCode == null) {
return HttpStatus.INTERNAL_SERVER_ERROR;
}
return HttpStatus.valueOf(statusCode);
}
private class Message{
private String code;
private String message;
private Object data;
private String describe;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDescribe() {
return describe;
}
public void setDescribe(String describe) {
this.describe = describe;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
}
\ No newline at end of file
package com.mushiny.wms.application.business.common;
import com.mushiny.wms.application.domain.*;
import com.mushiny.wms.application.domain.enums.TripState;
import com.mushiny.wms.application.domain.enums.TripType;
import com.mushiny.wms.application.repository.TripRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
@Component
@Transactional
public class BuildEntityBusiness {
private static final Logger LOGGER = LoggerFactory.getLogger(BuildEntityBusiness.class);
@Autowired
private TripRepository tripRepository;
/**
* 构建调度单
*/
public Trip buildTrip(Pod pod,
MdStationnodeposition workStation,Object instruct,TripType tripType){
LOGGER.debug("生成调度单{} pod {} MdStationnodeposition {} instruct {} tripType {}",pod.getPodIndex(), workStation,instruct,tripType);
// 生成POD的调度单
String instructDefault="";
String stationId="";
String stationNodePositionId="";
if(!ObjectUtils.isEmpty(workStation))
{
stationId=workStation.getStationnode().getId();
stationNodePositionId=workStation.getId();
}
if(!ObjectUtils.isEmpty(instruct)&&instruct instanceof InboundInstruct)
{
instructDefault=(((InboundInstruct) instruct)).getId();
}else if(!ObjectUtils.isEmpty(instruct)&&instruct instanceof OutboundInstruct)
{
instructDefault=(((OutboundInstruct) instruct)).getId();
}else{
instructDefault="";
}
Trip trip = new Trip();
trip.setTripType(tripType.getName());
trip.setTripState(TripState.NEW.getName());
trip.setPodId(pod.getId());
trip.setInstruct(instructDefault);
trip.setWorkStationId(stationId);
trip.setMdNodePosition(stationNodePositionId);
trip.setSectionId(pod.getSectionId());
trip.setWarehouseId(pod.getWarehouseId());
// 保存调度单
trip=tripRepository.saveAndFlush(trip);
LOGGER.debug("生成指令{} pod {} workStation {} Stationnodeposition {}trip {}",instructDefault,pod.getPodIndex(), stationId,stationNodePositionId,trip.getId());
return trip;
}
/**
* //生成slam的调度单
* @param pod
* @param workStation
* @param instruct
* @param tripType
* @return
*/
public Trip buildSlamTrip(Pod pod, MdStationnodeposition workStation,Object instruct,TripType tripType) {
// 生成POD的调度单
String instructDefault="";
String stationId="";
String stationNodePositionId="";
if(!ObjectUtils.isEmpty(workStation))
{
stationId=workStation.getStationnode().getId();
stationNodePositionId=workStation.getId();
}
if(!ObjectUtils.isEmpty(instruct)&&instruct instanceof InboundInstruct)
{
instructDefault=(((InboundInstruct) instruct)).getId();
}else if(!ObjectUtils.isEmpty(instruct)&&instruct instanceof OutboundInstruct)
{
instructDefault=(((OutboundInstruct) instruct)).getId();
}else{
instructDefault="";
}
Trip trip = new Trip();
trip.setTripType(tripType.getName());
trip.setTripState(TripState.NEW.getName());
trip.setPodId(pod.getId());
trip.setInstruct(instructDefault);
trip.setWorkStationId(stationId);
trip.setMdNodePosition(stationNodePositionId);
trip.setSectionId(pod.getSectionId());
trip.setWarehouseId(pod.getWarehouseId());
// 保存调度单 任务如果执行完成 通过Instruct查询Slam目标工位,再发送指令
trip=tripRepository.saveAndFlush(trip);
LOGGER.debug("生成指令{} pod {} workStation {} Stationnodeposition {}trip {}",instructDefault,pod.getPodIndex(), stationId,stationNodePositionId,trip.getId());
return trip;
}
}
package com.mushiny.wms.application.business.common;
import com.mushiny.wms.application.domain.InboundInstruct;
import com.mushiny.wms.application.repository.InboundInstructRepository;
import com.mushiny.wms.common.Constant;
import com.mushiny.wms.common.utils.CommonUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Created by Administrator on 2018/7/6.
*/
@Component
public class InboundInstructBusiness {
private Logger LOG = LoggerFactory.getLogger(InboundInstructBusiness.class.getName());
private final InboundInstructRepository inboundInstructRepository;
@Autowired
public InboundInstructBusiness(InboundInstructRepository inboundInstructRepository) {
this.inboundInstructRepository = inboundInstructRepository;
}
/**
* 保存入库单
* 修改人: mingchun.mu@mushiny.com
* @param inboundInstruct
* @return 0 失败 -- 未插入数据; 1 成功 -- 插入数据
*/
public Integer saveInboundInstruct(InboundInstruct inboundInstruct){
//先查找在更新
if(!CommonUtil.isPositiveInteger(inboundInstructRepository.countInboundInstruct(inboundInstruct))){
inboundInstructRepository.save(inboundInstruct);
return Constant.SUCCESS_FLAG;
}
return Constant.FAIL_FLAG;
}
public Integer saveInboundInstruct2(InboundInstruct inboundInstruct){
Integer result=Constant.SUCCESS_FLAG;
//先查找在更新
try{
inboundInstructRepository.save(inboundInstruct);
}catch (Exception e)
{
result=Constant.FAIL_FLAG;
LOG.error(e.getMessage(),e);
throw e;
}
return result;
}
}
package com.mushiny.wms.application.business.common;
import com.mushiny.wms.application.config.RestTempConfig;
import com.mushiny.wms.application.domain.InvMitemLabel;
import com.mushiny.wms.application.domain.SfcMitem;
import com.mushiny.wms.application.repository.InvMitemLabelRepository;
import com.mushiny.wms.application.repository.SfcMitemRepository;
import com.mushiny.wms.common.utils.CommonUtil;
import com.mushiny.wms.common.utils.DateTimeUtil;
import com.mushiny.wms.common.utils.JSONUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.client.RestTemplate;
import java.util.*;
/**
* Created by Administrator on 2018/7/6.
*/
@Component
@Transactional
public class InvMitemLabelBusiness {
private Logger LOG = LoggerFactory.getLogger(InvMitemLabelBusiness.class.getName());
@Autowired
private RestTempConfig restTempConfig;
private final InvMitemLabelRepository invMitemLabelRepository;
@Value("${midea.webApi.INV_CODE}")
private String INV_CODE;
@Value("${midea.webApi.INV_ORG_ID}")
private String INV_ORG_ID;
@Autowired
public InvMitemLabelBusiness(InvMitemLabelRepository invMitemLabelRepository) {
this.invMitemLabelRepository = invMitemLabelRepository;
}
public List<InvMitemLabel> saveSfcMitem(List<InvMitemLabel> invMitemLabels)
{
invMitemLabels = CommonUtil.removeSameItem(invMitemLabels, invMitemLabelRepository.findAll()); // 去重
List<InvMitemLabel> result=invMitemLabelRepository.save(invMitemLabels);
return result;
}
public List<InvMitemLabel> receive(String param)
{
Map tt= JSONUtil.jsonToMap(param);
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("LAST_UPDATE_DATE", tt.get("LAST_UPDATE_DATE"));
paramMap.put("INV_ORG_ID", INV_ORG_ID);
paramMap.put("INV_CODE", INV_CODE);
String result=restTempConfig.invMitemLabelSyn(paramMap);
Map<String,Object> resultMap1=JSONUtil.jsonToMap(result);
List<Map> resultMap=(List<Map>)resultMap1.get("ListData");
List<InvMitemLabel> sfcMitems=new ArrayList<>();
for(Map t:resultMap)
{
InvMitemLabel t2= JSONUtil.mapToBean(t,new InvMitemLabel() );
sfcMitems.add(t2);
}
return saveSfcMitem(sfcMitems);
}
@Scheduled(fixedDelay=1000*60*60, initialDelay = 2000)
@Async
public void execute()
{
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("INV_ORG_ID", INV_ORG_ID);
paramMap.put("INV_CODE",INV_CODE);
Date date=invMitemLabelRepository.getLastUpdateDate();
String ss="2018-07-01";
if(!ObjectUtils.isEmpty(date))
{
ss=DateTimeUtil.getDateFormat(date,"yyyy-MM-dd HH:mm:ss");
}
paramMap.put("LAST_UPDATE_DATE",ss);
String result=restTempConfig.invMitemLabelSyn(paramMap);
Map<String,Object> resultMap1=JSONUtil.jsonToMap(result);
List<Map> resultMap=(List<Map>)resultMap1.get("ListData");
List<InvMitemLabel> sfcMitems=new ArrayList<>();
if(!CollectionUtils.isEmpty(resultMap))
{
for(Map t:resultMap)
{
InvMitemLabel t2= JSONUtil.mapToBean(t,new InvMitemLabel() );
sfcMitems.add(t2);
break;
}
List<InvMitemLabel> lml=saveSfcMitem(sfcMitems);
if (LOG.isDebugEnabled())
{
LOG.debug("Mo信息同步成功\n{}",JSONUtil.toJSon(lml));
}
}else{
LOG.error("Mo信息同步失败,返回信息\n{}",JSONUtil.toJSon(result));
}
}
}
package com.mushiny.wms.application.business.common;
import com.mushiny.wms.application.domain.OutboundInstruct;
import com.mushiny.wms.application.repository.OutboundInstructRepository;
import com.mushiny.wms.common.Constant;
import com.mushiny.wms.common.utils.CommonUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/**
* Created by Administrator on 2018/7/6.
*/
@Component
public class OutboundInstructBusiness {
private Logger LOG = LoggerFactory.getLogger(OutboundInstructBusiness.class.getName());
private final OutboundInstructRepository outboundInstructRepository;
public OutboundInstructBusiness(OutboundInstructRepository outboundInstructRepository) {
this.outboundInstructRepository = outboundInstructRepository;
}
public Integer saveOutboundInstruct(OutboundInstruct outboundInstruct)
{
//先查找在更新
if(!CommonUtil.isPositiveInteger(outboundInstructRepository.countOutboundInstruct(outboundInstruct))){
outboundInstructRepository.save(outboundInstruct);
return Constant.SUCCESS_FLAG;
}
return Constant.FAIL_FLAG;
}
public Integer saveOutboundInstruct2(OutboundInstruct outboundInstruct)
{
Integer result=Constant.SUCCESS_FLAG;
try{
outboundInstructRepository.save(outboundInstruct);
}catch (Exception e)
{
result=Constant.FAIL_FLAG;
LOG.error(e.getMessage(),e);
}
return result;
}
}
package com.mushiny.wms.application.business.common;
import com.mushiny.wms.application.domain.Pod;
import com.mushiny.wms.application.domain.enums.PodStateEnum;
import com.mushiny.wms.application.repository.PodRepository;
import com.mushiny.wms.common.utils.JSONUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/**
* Created by Administrator on 2018/7/7.
*/
@Component
@Transactional
public class PodReserveUtil {
private static final Logger LOGGER = LoggerFactory.getLogger(PodReserveUtil.class);
private final PodRepository podRepository;
@Autowired
public PodReserveUtil(PodRepository podRepository) {
this.podRepository = podRepository;
}
public synchronized boolean reservePod(Pod pod) {
boolean result=false;
if(pod.getState().equalsIgnoreCase(PodStateEnum.AVAILABLE.getName())) {
pod.setState(PodStateEnum.RESERVED.getName());
pod=podRepository.saveAndFlush(pod);
result=true;
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("reserved pod {} 成功\n{}", pod.getId(), JSONUtil.toJSon(pod));
}
}
return result;
}
}
package com.mushiny.wms.application.business.common;
import com.mushiny.wms.application.config.RestTempConfig;
import com.mushiny.wms.application.domain.SfcMitem;
import com.mushiny.wms.application.repository.SfcMitemRepository;
import com.mushiny.wms.common.Constant;
import com.mushiny.wms.common.utils.CommonUtil;
import com.mushiny.wms.common.utils.DateTimeUtil;
import com.mushiny.wms.common.utils.JSONUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
import java.util.*;
import java.util.function.Consumer;
/**
* Created by Administrator on 2018/7/6.
*/
@Component
@Transactional
public class SfcMitemBusiness {
private Logger LOG = LoggerFactory.getLogger(SfcMitemBusiness.class.getName());
private RestTemplate restTemplate ;
@Autowired
private RestTempConfig restTempConfig;
private final SfcMitemRepository sfcMitemRepository;
@Value("${midea.webApi.INV_ORG_ID}")
private String INV_ORG_ID;
@Autowired
public SfcMitemBusiness(SfcMitemRepository sfcMitemRepository) {
this.restTemplate = new RestTemplate();
this.sfcMitemRepository = sfcMitemRepository;
}
public List<SfcMitem> receive(String param)
{
Map tt=JSONUtil.jsonToMap(param);
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("LAST_UPDATE_DATE", tt.get("LAST_UPDATE_DATE"));
paramMap.put("INV_ORG_ID", INV_ORG_ID);
String result=restTempConfig.sfcMitemSyn(paramMap);
Map<String,Object> resultMap1=JSONUtil.jsonToMap(result);
List<Map> resultMap=(List<Map>)resultMap1.get("ListData");
List<SfcMitem> sfcMitems=new ArrayList<>();
for(Map t:resultMap)
{
SfcMitem t2= JSONUtil.mapToBean(t,new SfcMitem() );
sfcMitems.add(t2);
}
return saveSfcMitem(sfcMitems);
}
@Scheduled(fixedDelay=1000*60*60, initialDelay = 2000)
@Async
public void execute(){
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("INV_ORG_ID", INV_ORG_ID);
Date date=sfcMitemRepository.getLastUpdateDate();
String ss="2018-06-01";
if(!ObjectUtils.isEmpty(date))
{
ss=DateTimeUtil.getDateFormat(date,"yyyy-MM-dd HH:mm:ss");
}
paramMap.put("LAST_UPDATE_DATE",ss);
String result=restTempConfig.sfcMitemSyn(paramMap);
Map<String,Object> resultMap1=JSONUtil.jsonToMap(result);
List<Map> resultMap=(List<Map>)resultMap1.get("ListData");
List<SfcMitem> sfcMitems=new ArrayList<>();
for(Map t:resultMap)
{
SfcMitem t2= JSONUtil.mapToBean(t,new SfcMitem() );
sfcMitems.add(t2);
}
List<SfcMitem> resultSfcMitem=saveSfcMitem(sfcMitems);
if (LOG.isDebugEnabled())
{
LOG.debug("物料信息同步成功\n{}",JSONUtil.toJSon(resultSfcMitem));
}
}
/* @Scheduled(fixedDelay=4000, initialDelay = 2000)
@RequestMapping("getForEntity/" + Constant.MIDEA_MITEM_SUBFIX)
@Async*/
public void mItems() {
try {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("LAST_UPDATE_DATE", Constant.LAST_UPDATE_DATE);
paramMap.put("INV_ORG_ID", Constant.INV_ORG_ID);
ResponseEntity<String> responseEntity = restTemplate.getForEntity(Constant.MIDEA_MITEM_URL+"?LAST_UPDATE_DATE="+Constant.LAST_UPDATE_DATE+"&INV_ORG_ID="+Constant.INV_ORG_ID, String.class, "");
String jsonString = responseEntity.getBody();
LOG.info(" < < < - - - 物料信息同步请求反馈结果(请求最后更新时间:"+ CommonUtil.dateFormat(new Date(Constant.LAST_UPDATE_DATE)) +")。。。\n " + jsonString);
Class<SfcMitem> sfcMitemClass = SfcMitem.class;
List<SfcMitem> sfcMitems = CommonUtil.mideaListParamJsonModify(jsonString, SfcMitem.class);
saveSfcMitem(sfcMitems);
LOG.info(" 物料信息同步成功(请求最后更新时间:"+ CommonUtil.dateFormat(new Date(Constant.LAST_UPDATE_DATE)) +")。。。 ");
} catch (RestClientException e) {
e.printStackTrace();
LOG.info(" 物料信息同步失败。。。 ", e);
}
}
public List<SfcMitem> saveSfcMitem(List<SfcMitem> sfcMitems){
sfcMitems = CommonUtil.removeSameItem(sfcMitems, sfcMitemRepository.findAll()); // 去重
List<SfcMitem> result=sfcMitemRepository.save(sfcMitems);
return result;
}
public Integer saveSfcMitem(SfcMitem sfcMitem){
sfcMitemRepository.save(sfcMitem);
return 1;
}
}
package com.mushiny.wms.application.business.common;
import com.mushiny.wms.application.domain.Stationnode;
import com.mushiny.wms.application.repository.StationnodeRepository;
import com.mushiny.wms.common.utils.CommonUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
import java.util.function.Consumer;
/**
* Created by Administrator on 2018/7/6.
*/
@Component
public class StationNodeBusiness {
private Logger LOG = LoggerFactory.getLogger(StationNodeBusiness.class.getName());
private final StationnodeRepository stationnodeRepository;
private List<Stationnode> allStationNode;
private final Map<String, Stationnode> nameMappingStation = new HashMap<>();
private final Map<Integer, Stationnode> addressMappingStation = new HashMap<>();
private final Map<Integer,LinkedHashMap<Integer, Stationnode>> typeMappingStation = new HashMap<>();
@Autowired
public StationNodeBusiness(StationnodeRepository stationnodeRepository) {
this.stationnodeRepository = stationnodeRepository;
initStationNode();
}
/***
* 有数据库更改,调用此接口更新系统缓存
* @Author: mingchun.mu@mushiy.com
*/
public void initStationNode(){
// setAllStationNode(this.stationnodeRepository.getAllStationNode());
// initMappingStation();
}
public void initMappingStation(){
allStationNode.forEach(new Consumer<Stationnode>() {
@Override
public void accept(Stationnode stationnode) {
nameMappingStation.put(stationnode.getName(), stationnode);
List<Integer> addrList = CommonUtil.string2List("");
if(typeMappingStation.containsKey(stationnode.getType()))
{
if(addrList != null){
addrList.forEach(new Consumer<Integer>() {
@Override
public void accept(Integer addr) {
addressMappingStation.put(addr, stationnode);
typeMappingStation.get(stationnode.getType()).put(addr, stationnode);
}
});
}
}else{
typeMappingStation.put(stationnode.getType(),new LinkedHashMap<>());
if(addrList != null){
addrList.forEach(new Consumer<Integer>() {
@Override
public void accept(Integer addr) {
addressMappingStation.put(addr, stationnode);
typeMappingStation.get(stationnode.getType()).put(addr, stationnode);
}
});
}
}
}
});
}
public List<Stationnode> getAllStationNode() {
return allStationNode;
}
public void setAllStationNode(List<Stationnode> allStationNode) {
this.allStationNode = allStationNode;
}
public LinkedHashMap getTypeStation(Integer type)
{
return typeMappingStation.get(type);
}
public Stationnode getStationNode(String name){
return nameMappingStation.get(name);
}
public Stationnode getStationNode(Integer addr){
return nameMappingStation.get(addr);
}
public Map<String, Stationnode> getNameMappingStation() {
return nameMappingStation;
}
public Map<Integer, Stationnode> getAddressMappingStation() {
return addressMappingStation;
}
}
package com.mushiny.wms.application.business.common;
import com.mushiny.wms.application.domain.SystemProperty;
import com.mushiny.wms.application.domain.enums.SystemPropertyKeyEnum;
import com.mushiny.wms.application.repository.SystemPropertyRepository;
import com.mushiny.wms.common.exception.ApiException;
import com.mushiny.wms.common.exception.CustomException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class SystemPropertyBusiness {
private final SystemPropertyRepository systemPropertyRepository;
@Autowired
public SystemPropertyBusiness(SystemPropertyRepository systemPropertyRepository) {
this.systemPropertyRepository = systemPropertyRepository;
}
public int getStowPodStationMaxPod(String warehouseId){
SystemProperty systemProperty = getSystemProperty(
SystemPropertyKeyEnum.STOW_POD_STATION_MAX_POD.getName(), warehouseId);
String systemValue = systemProperty.getSystemValue();
return Integer.valueOf(systemValue);
}
public int getDriveChargerFullValue(String warehouseId) {
SystemProperty systemProperty = getSystemProperty(
SystemPropertyKeyEnum.DRIVE_CHARGER_Full_VALUE.getName(), warehouseId);
String systemValue = systemProperty.getSystemValue();
return Integer.valueOf(systemValue);
}
public int getRobotVoltageMinValue(String warehouseId) {
SystemProperty systemProperty = getSystemProperty(
SystemPropertyKeyEnum.Robot_Voltage_MinValue.getName(), warehouseId);
String systemValue = systemProperty.getSystemValue();
return Integer.valueOf(systemValue);
}
public int getRobotVoltageMaxValue(String warehouseId) {
SystemProperty systemProperty = getSystemProperty(
SystemPropertyKeyEnum.Robot_Voltage_MaxValue.getName(), warehouseId);
String systemValue = systemProperty.getSystemValue();
return Integer.valueOf(systemValue);
}
public int getDriveOutChargerMinValue(String warehouseId) {
SystemProperty systemProperty = getSystemProperty(
SystemPropertyKeyEnum.DRIVE_OUT_CHARGER_MIN_VALUE.getName(), warehouseId);
String systemValue = systemProperty.getSystemValue();
return Integer.valueOf(systemValue);
}
public int getDriveInChargerMinValue(String warehouseId) {
SystemProperty systemProperty = getSystemProperty(
SystemPropertyKeyEnum.DRIVE_IN_CHARGER_MIN_VALUE.getName(), warehouseId);
String systemValue = systemProperty.getSystemValue();
return Integer.valueOf(systemValue);
}
public int getDriveChargerConstant(String warehouseId) {
SystemProperty systemProperty = getSystemProperty(
SystemPropertyKeyEnum.DRIVE_CHARGER_CONSTANT.getName(), warehouseId);
String systemValue = systemProperty.getSystemValue();
return Integer.valueOf(systemValue);
}
private SystemProperty getSystemProperty(String systemKey, String warehouseId) {
SystemProperty systemProperty = systemPropertyRepository.getBySystemKey(systemKey, warehouseId);
if (systemProperty == null) {
throw new ApiException(CustomException.EX_SPS_SYSTEM_PROPERTY_NOT_FOUND.toString(), systemKey);
}
return systemProperty;
}
}
package com.mushiny.wms.application.business.dto;
import java.io.Serializable;
import java.math.BigDecimal;
public class CommonDrivePodScore implements Serializable {
private static final long serialVersionUID = 1L;
private String podId;
private String driveId;
private BigDecimal score;
private MixTrip mixTrip;
public MixTrip getMixTrip() {
return mixTrip;
}
public void setMixTrip(MixTrip mixTrip) {
this.mixTrip = mixTrip;
}
public String getPodId() {
return podId;
}
public void setPodId(String podId) {
this.podId = podId;
}
public String getDriveId() {
return driveId;
}
public void setDriveId(String driveId) {
this.driveId = driveId;
}
public BigDecimal getScore() {
return score;
}
public void setScore(BigDecimal score) {
this.score = score;
}
}
package com.mushiny.wms.application.business.dto;
import java.io.Serializable;
import java.math.BigDecimal;
public class DrivePodScore implements Serializable {
private static final long serialVersionUID = 1L;
private String podId;
private String driveId;
private BigDecimal score;
private String tripId;
public String getTripId() {
return tripId;
}
public void setTripId(String tripId) {
this.tripId = tripId;
}
public String getPodId() {
return podId;
}
public void setPodId(String podId) {
this.podId = podId;
}
public String getDriveId() {
return driveId;
}
public void setDriveId(String driveId) {
this.driveId = driveId;
}
public BigDecimal getScore() {
return score;
}
public void setScore(BigDecimal score) {
this.score = score;
}
}
package com.mushiny.wms.application.business.dto;
import com.mushiny.wms.application.domain.Trip;
/**
* @author:
* @Description: Created by Laptop-8 on 2017/10/18.
*/
public class MixTrip {
private Trip preTrip;
private Trip currentTrip;
private String outSizeAddrcoed;
public String getOutSizeAddrcoed() {
return outSizeAddrcoed;
}
public void setOutSizeAddrcoed(String outSizeAddrcoed) {
this.outSizeAddrcoed = outSizeAddrcoed;
}
public Trip getPreTrip() {
return preTrip;
}
public void setPreTrip(Trip preTrip) {
this.preTrip = preTrip;
}
public Trip getCurrentTrip() {
return currentTrip;
}
public void setCurrentTrip(Trip currentTrip) {
this.currentTrip = currentTrip;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof MixTrip)) return false;
MixTrip mixTrip = (MixTrip) o;
return currentTrip != null ? currentTrip.getId().equals(mixTrip.currentTrip.getId()) : mixTrip.currentTrip == null;
}
@Override
public int hashCode() {
int result = preTrip != null ? preTrip.getId().hashCode() : 0;
result = 31 * result + (currentTrip != null ? currentTrip.getId().hashCode() : 0);
return result;
}
}
package com.mushiny.wms.application.business.dto;
import com.mushiny.wms.application.domain.Charger;
import com.mushiny.wms.application.domain.WCSRobot;
import java.io.Serializable;
import java.math.BigDecimal;
public class RobotChargerScore implements Serializable {
private static final long serialVersionUID = 1L;
private BigDecimal score;
private WCSRobot robot;
private Charger charger;
public BigDecimal getScore() {
return score;
}
public void setScore(BigDecimal score) {
this.score = score;
}
public WCSRobot getRobot() {
return robot;
}
public void setRobot(WCSRobot robot) {
this.robot = robot;
}
public Charger getCharger() {
return charger;
}
public void setCharger(Charger charger) {
this.charger = charger;
}
}
package com.mushiny.wms.application.business.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.mushiny.wms.application.domain.Map;
import com.mushiny.wms.application.domain.MapNode;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* @author:
* @Description: Created by Laptop-8 on 2017/10/17.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SectionMapNode {
private com.mushiny.wms.application.domain.Map map;
private MapNode currentMapNode;
private boolean isInAddress = false;
private List<MapNode> outSizeMapNodes = new ArrayList<>();
private List<MapNode> inSizeMapNodes = new ArrayList<>();
public Map getMap() {
return map;
}
public void setMap(Map map) {
this.map = map;
}
public MapNode getCurrentMapNode() {
return currentMapNode;
}
public void setCurrentMapNode(MapNode currentMapNode) {
this.currentMapNode = currentMapNode;
}
public boolean isInAddress() {
return isInAddress;
}
public void setInAddress(boolean inAddress) {
isInAddress = inAddress;
}
public List<MapNode> getOutSizeMapNodes() {
return Collections.unmodifiableList(outSizeMapNodes);
}
public void setOutSizeMapNodes(List<MapNode> outSizeMapNodes) {
this.outSizeMapNodes.addAll(outSizeMapNodes);
}
public List<MapNode> getInSizeMapNodes() {
return Collections.unmodifiableList(inSizeMapNodes);
}
public void setInSizeMapNodes(List<MapNode> inSizeMapNodes) {
this.inSizeMapNodes.addAll(inSizeMapNodes);
}
}
package com.mushiny.wms.application.business.score;
import com.mushiny.wms.application.business.common.CommonBusiness;
import com.mushiny.wms.application.business.dto.DrivePodScore;
import com.mushiny.wms.application.business.dto.MixTrip;
import com.mushiny.wms.application.domain.MapNode;
import com.mushiny.wms.application.domain.Pod;
import com.mushiny.wms.application.domain.Trip;
import com.mushiny.wms.application.domain.WCSRobot;
import com.mushiny.wms.application.domain.enums.TripType;
import com.mushiny.wms.application.repository.PodRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.*;
@Component
public class DrivePodScoreBusiness {
private final PodRepository podRepository;
private final EnRouteWorkBusiness enRouteWorkBusiness;
private final CommonBusiness commonBusiness;
@Autowired
public DrivePodScoreBusiness(PodRepository podRepository,
EnRouteWorkBusiness enRouteWorkBusiness,CommonBusiness commonBusiness) {
this.podRepository = podRepository;
this.enRouteWorkBusiness = enRouteWorkBusiness;
this.commonBusiness=commonBusiness;
}
public List<DrivePodScore> getDrivePodScores(List<Trip> trips,
List<WCSRobot> robots) {
List<DrivePodScore> drivePodScores = new ArrayList<>();
for (Trip trip : trips) {
Pod pod = podRepository.findOne(trip.getPodId());
Duration duration = Duration.between(LocalDateTime.now(), trip.getCreatedDate());
BigDecimal podWaitTime = BigDecimal.valueOf(Math.abs(duration.getSeconds()));
BigDecimal enRouteWork;
if (trip.getTripType().equalsIgnoreCase(TripType.PICK_POD.getName())) {
enRouteWork = enRouteWorkBusiness.getPickTripEnRouteWork(trip.getWorkStationId());
} else if (trip.getTripType().equalsIgnoreCase(TripType.STOW_POD.getName())) {
enRouteWork = enRouteWorkBusiness.getStowTripEnRouteWork(trip.getWarehouseId());
} else if (trip.getTripType().equalsIgnoreCase(TripType.IBP_POD.getName())
|| trip.getTripType().equalsIgnoreCase(TripType.OBP_POD.getName())
|| trip.getTripType().equalsIgnoreCase(TripType.ICQA_POD.getName())) {
enRouteWork = enRouteWorkBusiness.getPQATripEnRouteWork(trip.getPodId());
} else {
continue;
}
for (WCSRobot robot : robots) {
BigDecimal fetch = BigDecimal.valueOf(
Math.abs(robot.getxPosition() - pod.getxPos())
+ Math.abs(robot.getyPosition() - pod.getyPos()));
BigDecimal score = fetch.add(enRouteWork).subtract(podWaitTime);
DrivePodScore drivePodScore = new DrivePodScore();
drivePodScore.setDriveId(robot.getRobotId());
drivePodScore.setPodId(trip.getPodId());
drivePodScore.setScore(score);
drivePodScore.setTripId(trip.getId());
drivePodScores.add(drivePodScore);
}
drivePodScores.sort(Comparator.comparing(DrivePodScore::getScore));
}
return drivePodScores;
}
public List<DrivePodScore> getDrivePodScores(Trip trip,
List<WCSRobot> robots) {
List<DrivePodScore> drivePodScores = new ArrayList<>();
Pod pod = podRepository.findOne(trip.getPodId());
if(pod ==null || pod.getPlaceMark()==null || Objects.equals(pod.getPlaceMark(),0)){
return drivePodScores;
}
//必须是非空的
MapNode podNode=commonBusiness.findMapNodeBySectionId(pod.getSectionId(),pod.getPlaceMark());
Duration duration = Duration.between(LocalDateTime.now(), trip.getCreatedDate());
BigDecimal podWaitTime = BigDecimal.valueOf(Math.abs(duration.getSeconds()));
BigDecimal enRouteWork = new BigDecimal(0);
/*if (trip.getTripType().equalsIgnoreCase(TripType.PICK_POD.getName())) {
enRouteWork = enRouteWorkBusiness.getPickTripEnRouteWork(trip.getWorkStationId());
} else if (trip.getTripType().equalsIgnoreCase(TripType.STOW_POD.getName())) {
enRouteWork = enRouteWorkBusiness.getStowTripEnRouteWork(trip.getWarehouseId());
} else if (trip.getTripType().equalsIgnoreCase(TripType.IBP_POD.getName())
|| trip.getTripType().equalsIgnoreCase(TripType.OBP_POD.getName())
|| trip.getTripType().equalsIgnoreCase(TripType.ICQA_POD.getName())) {
enRouteWork = enRouteWorkBusiness.getPQATripEnRouteWork(trip.getPodId());
}*/
for (WCSRobot robot : robots) {
BigDecimal fetch = BigDecimal.valueOf(
Math.abs(robot.getxPosition() - podNode.getxPosition())
+ Math.abs(robot.getyPosition() - podNode.getyPosition()));
BigDecimal score = fetch.add(enRouteWork).subtract(podWaitTime);
DrivePodScore drivePodScore = new DrivePodScore();
drivePodScore.setDriveId(robot.getRobotId());
drivePodScore.setPodId(trip.getPodId());
drivePodScore.setScore(score);
drivePodScore.setTripId(trip.getId());
drivePodScores.add(drivePodScore);
}
drivePodScores.sort(Comparator.comparing(DrivePodScore::getScore));
return drivePodScores;
}
public Map<MixTrip, List<DrivePodScore>> getDrivePodScores2(List<MixTrip> mixTrips,
List<WCSRobot> robots) {
Map<MixTrip, List<DrivePodScore>> result = new HashMap<>();
for (MixTrip mixTrip : mixTrips) {
List<DrivePodScore> drivePodScores = new ArrayList<>();
Trip trip = mixTrip.getCurrentTrip();
Pod pod = podRepository.findOne(trip.getPodId());
Duration duration = Duration.between(LocalDateTime.now(), trip.getCreatedDate());
BigDecimal podWaitTime = BigDecimal.valueOf(Math.abs(duration.getSeconds()));
BigDecimal enRouteWork;
if (trip.getTripType().equalsIgnoreCase(TripType.PICK_POD.getName())) {
enRouteWork = enRouteWorkBusiness.getPickTripEnRouteWork(trip.getWorkStationId());
} else if (trip.getTripType().equalsIgnoreCase(TripType.STOW_POD.getName())) {
enRouteWork = enRouteWorkBusiness.getStowTripEnRouteWork(trip.getWarehouseId());
} else if (trip.getTripType().equalsIgnoreCase(TripType.IBP_POD.getName())
|| trip.getTripType().equalsIgnoreCase(TripType.OBP_POD.getName())
|| trip.getTripType().equalsIgnoreCase(TripType.ICQA_POD.getName())) {
enRouteWork = enRouteWorkBusiness.getPQATripEnRouteWork(trip.getPodId());
} else {
continue;
}
for (WCSRobot robot : robots) {
BigDecimal fetch = BigDecimal.valueOf(
Math.abs(robot.getxPosition() - pod.getxPos())
+ Math.abs(robot.getyPosition() - pod.getyPos()));
BigDecimal score = fetch.add(enRouteWork).subtract(podWaitTime);
DrivePodScore drivePodScore = new DrivePodScore();
drivePodScore.setDriveId(robot.getRobotId());
drivePodScore.setPodId(trip.getPodId());
drivePodScore.setScore(score);
drivePodScore.setTripId(trip.getId());
drivePodScores.add(drivePodScore);
}
drivePodScores.sort(Comparator.comparing(DrivePodScore::getScore));
result.put(mixTrip, drivePodScores);
}
return result;
}
}
package com.mushiny.wms.application.business.score;
import com.mushiny.wms.application.domain.enums.TripState;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import java.math.BigDecimal;
import java.util.List;
@Component
public class EnRouteWorkBusiness {
@PersistenceContext
private EntityManager entityManager;
public BigDecimal getStowTripEnRouteWork(String warehouseId) {
String sql = "SELECT S.SYSTEM_VALUE FROM SYS_SYSTEMPROPERTY S " +
" WHERE S.SYSTEM_KEY = 'StowPodEnRouteWorkValue' AND S.WAREHOUSE_ID = :warehouseId";
Query query = entityManager.createNativeQuery(sql);
query.setParameter("warehouseId", warehouseId);
Object result = query.getSingleResult();
if (result == null) {
return BigDecimal.ZERO;
} else {
return new BigDecimal(String.valueOf(result));
}
}
public BigDecimal getPQATripEnRouteWork(String podId) {
String sql = "SELECT P.WORKLOAD FROM PQA_ENROUTEPOD P WHERE POD_ID = :podId";
Query query = entityManager.createNativeQuery(sql);
query.setParameter("podId", podId);
List result = query.getResultList();
if(CollectionUtils.isEmpty(result))
{
return BigDecimal.ZERO;
}else{
return (BigDecimal) result.get(0);
}
}
public BigDecimal getPickTripEnRouteWork(String workStationId) {
BigDecimal enRouteWork = BigDecimal.ZERO;
List<String> podIds = getPickPods(workStationId);
if (!podIds.isEmpty()) {
for (String podId : podIds) {
BigDecimal podEnRouteWork = sumPodScore(podId);
enRouteWork = enRouteWork.add(podEnRouteWork);
}
}
return enRouteWork;
}
private List<String> getPickPods(String workStationId) {
String sql = "SELECT t.POD_ID FROM RCS_TRIP t " +
" WHERE t.WORKSTATION_ID = :workStationId " +
" AND t.TRIP_STATE = :tripState " +
" AND t.POD_ID != NULL " +
" AND t.POD_ID != (" +
" SELECT p.ID FROM MD_POD p " +
" WHERE p.PLACEMARK = (" +
" SELECT w.PLACEMARK " +
" FROM MD_WORKSTATION w " +
" WHERE w.ID = :workStationId))";
Query query = entityManager.createNativeQuery(sql);
query.setParameter("tripState", TripState.PROCESS.getName());
query.setParameter("workStationId", workStationId);
return query.getResultList();
}
private BigDecimal sumPodScore(String podId) {
String sql = "SELECT SUM(POP.AMOUNT*(3600/PP.TARGET_PICK_RATE)) " +
" FROM OB_PICKINGORDERPOSITION POP " +
" LEFT JOIN OB_PICKINGORDER PO ON PO.ID = POP.PICKINGORDER_ID " +
" LEFT JOIN OB_PROCESSPATH PP ON PP.ID = PO.PROCESSPATH_ID " +
" WHERE POP.POD_ID = :podId";
Query query = entityManager.createNativeQuery(sql, BigDecimal.class);
query.setParameter("podId", podId);
List result = query.getResultList();
if(CollectionUtils.isEmpty(result))
{
return BigDecimal.ZERO;
}else{
return (BigDecimal) result.get(0);
}
}
}
package com.mushiny.wms.application.business.score;
import com.mushiny.wms.application.business.common.CommonBusiness;
import com.mushiny.wms.application.business.common.SystemPropertyBusiness;
import com.mushiny.wms.application.business.dto.RobotChargerScore;
import com.mushiny.wms.application.domain.Charger;
import com.mushiny.wms.application.domain.MapNode;
import com.mushiny.wms.application.domain.WCSRobot;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@Component
public class RobotChargerScoreBusiness {
private final CommonBusiness commonBusiness;
private final SystemPropertyBusiness systemPropertyBusiness;
@Autowired
public RobotChargerScoreBusiness(CommonBusiness commonBusiness,
SystemPropertyBusiness systemPropertyBusiness) {
this.commonBusiness = commonBusiness;
this.systemPropertyBusiness = systemPropertyBusiness;
}
public List<RobotChargerScore> getScores(List<Charger> chargers,
List<WCSRobot> robots,
String warehouseId) {
List<RobotChargerScore> robotChargerScores = new ArrayList<>();
BigDecimal chargerConstant = BigDecimal.valueOf(systemPropertyBusiness.getDriveChargerConstant(warehouseId));
for (Charger charger : chargers) {
MapNode mapNode = commonBusiness.getChargerNode(charger);
for (WCSRobot robot : robots) {
BigDecimal fetch = BigDecimal.valueOf(
Math.abs(robot.getxPosition() - mapNode.getxPosition())
+ Math.abs(robot.getyPosition() - mapNode.getyPosition()));
BigDecimal laveBattery = BigDecimal.valueOf(100 - robot.getLaveBattery());
BigDecimal score = fetch.subtract((chargerConstant.multiply(laveBattery)));
RobotChargerScore robotChargerScore = new RobotChargerScore();
robotChargerScore.setCharger(charger);
robotChargerScore.setRobot(robot);
robotChargerScore.setScore(score);
robotChargerScores.add(robotChargerScore);
}
}
return robotChargerScores;
}
}
package com.mushiny.wms.application.business.score;
import com.mushiny.wms.application.domain.MdStationnodeposition;
import com.mushiny.wms.application.domain.Pod;
/**
* Created by Administrator on 2018/7/12.
*/
public class StationPodScore {
private Pod pod;
private MdStationnodeposition stationnodeposition;
private Integer score=0;
public Pod getPod() {
return pod;
}
public void setPod(Pod pod) {
this.pod = pod;
}
public MdStationnodeposition getStationnodeposition() {
return stationnodeposition;
}
public void setStationnodeposition(MdStationnodeposition stationnodeposition) {
this.stationnodeposition = stationnodeposition;
}
public Integer getScore() {
return score;
}
public void setScore(Integer score) {
this.score = score;
}
}
package com.mushiny.wms.application.business.trip;
import com.mushiny.wms.common.context.ApplicationBeanContextAware;
import org.springframework.stereotype.Component;
/**
* @author:
* @Description: Created by wangjianwei on 2017/10/23.
*/
@Component
public class ApplicationTripHandlerFactory {
private ApplicationTripHandlerFactory() {
}
private static class TripHandlerHolder {
private static TripHandler tripHandler;
static {
PodRunTripHandler podRunTripHandler = ApplicationBeanContextAware.getBean(PodRunTripHandler.class);
CommonTripHandler commonTripHandler = ApplicationBeanContextAware.getBean(CommonTripHandler.class);
PodSanTripHandler podSanTripHandler = ApplicationBeanContextAware.getBean(PodSanTripHandler.class);
ChargerDriveTripHandler chargerDriveTripHandler = ApplicationBeanContextAware.getBean(ChargerDriveTripHandler.class);
chargerDriveTripHandler.setHandler(podSanTripHandler);
commonTripHandler.setHandler(chargerDriveTripHandler);
podRunTripHandler.setHandler(commonTripHandler);
tripHandler = podRunTripHandler;
}
}
public static TripHandler getInstance() {
return TripHandlerHolder.tripHandler;
}
}
package com.mushiny.wms.application.business.trip;
import com.mushiny.wms.application.business.common.CommonBusiness;
import com.mushiny.wms.application.business.common.SystemPropertyBusiness;
import com.mushiny.wms.application.business.score.DrivePodScoreBusiness;
import com.mushiny.wms.application.domain.Charger;
import com.mushiny.wms.application.domain.Section;
import com.mushiny.wms.application.domain.Trip;
import com.mushiny.wms.application.domain.WCSRobot;
import com.mushiny.wms.application.domain.enums.TripState;
import com.mushiny.wms.application.domain.enums.TripType;
import com.mushiny.wms.application.repository.ChargerRepository;
import com.mushiny.wms.application.repository.TripRepository;
import com.mushiny.wms.application.repository.WCSRobotRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author:
* @Description: Created by Laptop-8 on 2017/11/8.
*/
@Component
public class ChargerDriveTripHandler extends TripHandler {
private static final String[] chargerDrive = new String[]{TripType.CHARGER_DRIVE.getName()};
private static final Logger LOGGER = LoggerFactory.getLogger(ChargerDriveTripHandler.class);
private final SystemPropertyBusiness systemPropertyBusiness;
private final WCSRobotRepository wcsRobotRepository;
private final ChargerRepository chargerRepository;
public ChargerDriveTripHandler(CommonBusiness commonBusiness, TripRepository tripRepository, DrivePodScoreBusiness drivePodScoreBusiness, SystemPropertyBusiness systemPropertyBusiness, WCSRobotRepository wcsRobotRepository, ChargerRepository chargerRepository) {
super(commonBusiness, tripRepository, drivePodScoreBusiness);
this.systemPropertyBusiness = systemPropertyBusiness;
this.wcsRobotRepository = wcsRobotRepository;
this.chargerRepository = chargerRepository;
}
@Override
public List<Trip> filterTrip(List<Trip> trips) {
return filterHandlerTrip(trips, chargerDrive);
}
/**
* 生成小车移动到指定位置的调度单
*/
private void buildMoveRobotTrip(Charger charger, WCSRobot wcsRobot) {
// 生成调度单把充电桩前的小车开走
Integer moveTargetAddress = commonBusiness.getMoveDriveTargetAddress(charger);
if (moveTargetAddress == null) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("section {} 无可用的休息区---小车{}", wcsRobot.getSectionId(), wcsRobot.getRobotId());
}
return;
}
// 给该充电桩绑定新的小车充电任务,生成调度单
Trip moveTrip = new Trip();
moveTrip.setTripType(TripType.MOVE_DRIVE.getName());
moveTrip.setTripState(TripState.AVAILABLE.getName());
moveTrip.setDriveId(wcsRobot.getRobotId());
moveTrip.setEndAddress(moveTargetAddress);
moveTrip.setSectionId(charger.getSectionId());
moveTrip.setWarehouseId(charger.getWarehouseId());
tripRepository.saveAndFlush(moveTrip);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("生成小车 {} 调走的调度单{}成功", wcsRobot.getRobotId(), moveTrip.getId());
}
}
@Override
public void handleTrip(List<Trip> trips, Section section) {
/* int driveChargerFull = systemPropertyBusiness
.getDriveChargerFullValue(section.getWarehouseId());
*/
for (Trip trip : trips) {
trip.setTripState(TripState.AVAILABLE.getName());
tripRepository.saveAndFlush(trip);
}
/* List<WCSRobot> chargeRobots=wcsRobotRepository.getWCSRobotByCharger(section.getId());
if(!CollectionUtils.isEmpty(chargeRobots))
{
for(WCSRobot robot:chargeRobots)
{
Charger availableCharger=chargerRepository.getChargersByPlaceMark(section.getId(),robot.getAddressCodeId());
// 判断小车电量是否达到系统最大值
if(ObjectUtils.isEmpty(availableCharger)){
if(LOGGER.isDebugEnabled())
{
LOGGER.debug("跟据小车{}的位置{}获取充电桩失败",robot.getRobotId(),robot.getAddressCodeId());
}
continue;
}
if(LOGGER.isDebugEnabled())
{
LOGGER.debug("小车 {} 在充电桩{}充电, 当前电量{}, 要求最大电量{} ",robot.getRobotId(),availableCharger.getName(),robot.getLaveBattery(),driveChargerFull);
}
if (robot.getLaveBattery() >= driveChargerFull) {
// 生成把当前位置小车开走的调度单调度单
buildMoveRobotTrip(availableCharger, robot);
}
}
}*/
}
}
package com.mushiny.wms.application.business.trip;
import com.mushiny.wms.application.business.common.CommonBusiness;
import com.mushiny.wms.application.business.score.DrivePodScoreBusiness;
import com.mushiny.wms.application.domain.Section;
import com.mushiny.wms.application.domain.Trip;
import com.mushiny.wms.application.domain.WCSRobot;
import com.mushiny.wms.application.domain.enums.TripType;
import com.mushiny.wms.application.repository.TripRepository;
import com.mushiny.wms.common.utils.JSONUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author:
* @Description: Created by Laptop-8 on 2017/11/8.
*/
@Component
public class PodRunTripHandler extends TripHandler {
private static final String[] podRunType = new String[]{TripType.POD_RUN.getName(),TripType.ANNTO_MVIN.getName(),TripType.ANNTOMVOUT.getName(),TripType.CARRY_POD.getName(),TripType.FINISHESWAREHOUSING.getName(),TripType.LMGETMATERIAL.getName()};
private static final Logger LOGGER = LoggerFactory.getLogger(PodRunTripHandler.class);
public PodRunTripHandler(CommonBusiness commonBusiness, TripRepository tripRepository, DrivePodScoreBusiness drivePodScoreBusiness) {
super(commonBusiness, tripRepository, drivePodScoreBusiness);
}
@Override
public List<Trip> filterTrip(List<Trip> trips) {
return filterHandlerTrip(trips, podRunType);
}
@Override
public void handleTrip(List<Trip> trips, Section section) {
List<WCSRobot> roboots = getAvailableDrives(section.getId());
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("开始处理podRun调度单,当前可用的车为{}", JSONUtil.toJSon(roboots));
}
if (roboots.isEmpty()) {
return;
}
for (Trip trip : trips) {
saveTrip(trip, roboots);
}
}
}
package com.mushiny.wms.application.business.trip;
import com.mushiny.wms.application.business.common.CommonBusiness;
import com.mushiny.wms.application.business.score.DrivePodScoreBusiness;
import com.mushiny.wms.application.config.MapNodeConfig;
import com.mushiny.wms.application.domain.*;
import com.mushiny.wms.application.domain.enums.TripType;
import com.mushiny.wms.application.repository.TripRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.List;
/**
* @author:
* @Description: Created by wangjianwei on 2017/10/21.
*/
@Component
public class PodSanTripHandler extends TripHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(PodSanTripHandler.class);
private static final String[] podScanType = new String[]{TripType.POD_SCAN.getName()
};
@Autowired
public PodSanTripHandler(CommonBusiness commonBusiness, TripRepository tripRepository, DrivePodScoreBusiness drivePodScoreBusiness) {
super(commonBusiness, tripRepository, drivePodScoreBusiness);
}
@Override
public List<Trip> filterTrip(List<Trip> trips) {
return filterHandlerTrip(trips, podScanType);
}
@Override
public void handleTrip(List<Trip> trips, Section section) {
if (CollectionUtils.isEmpty(getAvailableDrives(section.getId()))) {
for (Trip trip : trips) {
String paths = trip.getPodScanpath();
Assert.isNull(paths, "trip " + trip.getId() + " scanPath 不能为空");
String[] pathsTemp = paths.split(",");
if (!StringUtils.isEmpty(pathsTemp[0])) {
MapNode mapNode = MapNodeConfig.findSectionMapNode(Integer.parseInt(pathsTemp[0]), trip.getSectionId()).getCurrentMapNode();
WCSRobot temp = getMoveDriveTargetAddress(mapNode, getAvailableDrives(section.getId()));
if (!allocated.contains(temp.getRobotId())) {
trip.setDriveId(temp.getRobotId());
tripRepository.saveAndFlush(trip);
allocated.add(temp.getRobotId());
}
} else {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("trip {} scanPath 不和法---{}", trip.getId(), paths);
}
}
}
}
}
/**
* 获取小车停放位置
*/
public WCSRobot getMoveDriveTargetAddress(MapNode baseMapNode, List<WCSRobot> WCSRobots) {
WCSRobot minWCSRobot = null;
boolean flag = true;
for (WCSRobot wcsRobot : WCSRobots) {
if (flag) {
flag = false;
minWCSRobot = wcsRobot;
continue;
}
int nodeValue = Math.abs(wcsRobot.getxPosition() - baseMapNode.getxPosition())
+ Math.abs(wcsRobot.getyPosition() - baseMapNode.getyPosition());
int minValue = Math.abs(minWCSRobot.getxPosition() - baseMapNode.getxPosition())
+ Math.abs(minWCSRobot.getyPosition() - baseMapNode.getyPosition());
if (nodeValue < minValue) {
minWCSRobot = wcsRobot;
}
}
return minWCSRobot;
}
}
package com.mushiny.wms.application.business.trip;
import com.mushiny.wms.application.business.common.CommonBusiness;
import com.mushiny.wms.application.business.dto.DrivePodScore;
import com.mushiny.wms.application.business.score.DrivePodScoreBusiness;
import com.mushiny.wms.application.domain.Section;
import com.mushiny.wms.application.domain.Trip;
import com.mushiny.wms.application.domain.WCSRobot;
import com.mushiny.wms.application.domain.enums.TripState;
import com.mushiny.wms.application.repository.TripRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.ObjectUtils;
import java.util.*;
/**
* @author:
* @Description: Created by wangjianwei on 2017/10/21.
*/
public abstract class TripHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(TripHandler.class);
public final CommonBusiness commonBusiness;
public final TripRepository tripRepository;
public final DrivePodScoreBusiness drivePodScoreBusiness;
protected TripHandler handler = null;
public static List<String> allocated = new ArrayList<>();
public TripHandler(CommonBusiness commonBusiness, TripRepository tripRepository, DrivePodScoreBusiness drivePodScoreBusiness) {
this.commonBusiness = commonBusiness;
this.tripRepository = tripRepository;
this.drivePodScoreBusiness = drivePodScoreBusiness;
}
public List<WCSRobot> getAvailableDrives(String sectionId) {
List<WCSRobot> robots = commonBusiness.getAvailableDrives(sectionId);
return robots;
}
public List<DrivePodScore> getDrivePodScores(Trip trip,
List<WCSRobot> robots) {
List<DrivePodScore> podScores = drivePodScoreBusiness.getDrivePodScores(trip, robots);
return podScores;
}
public boolean saveTrip(Trip trip, List<WCSRobot> robots) {
boolean result = false;
//新增加
/* List<Trip> countworkStation=commonBusiness.checkingDriveCanUse(trip);
if(!CollectionUtils.isEmpty(countworkStation)&&countworkStation.size()>5)
{
return false;
}*/
///////
List<DrivePodScore> drivePodScores = drivePodScoreBusiness.getDrivePodScores(trip, robots);
if(drivePodScores.isEmpty()){
return result;
}
int driverSize = robots.size();
for (int m = 0; m < driverSize; m++) {
final String driverId = drivePodScores.get(m).getDriveId();
try {
boolean driveCanUse = commonBusiness.checkingDriveCanUse(driverId, trip);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("可以给调度单{} 分配小车 {} {} ", trip.getId(), driverId, driveCanUse);
}
if (driveCanUse && !allocated.contains(driverId)) {
trip.setDriveId(driverId);
trip.setTripState(TripState.AVAILABLE.getName());
tripRepository.saveAndFlush(trip);
result = true;
allocated.add(driverId);
break;
}
}catch (Exception e)
{
LOGGER.error("给调度单"+trip.getId()+"分配车"+driverId+"失败"+e.getMessage(),e);
throw e;
}
}
return result;
}
public List<Trip> filterHandlerTrip(List<Trip> trips, String... tripTypes) {
List<Trip> result = new ArrayList();
List<String> tripTypeTemp = Arrays.asList(tripTypes);
for (Trip trip : trips) {
if (tripTypeTemp.contains(trip.getTripType())) {
result.add(trip);
}
}
return result;
}
public abstract List<Trip> filterTrip(List<Trip> trips);
public abstract void handleTrip(List<Trip> trips, Section section);
public TripHandler getHandler() {
return handler;
}
public void setHandler(TripHandler handler) {
this.handler = handler;
}
public void execute(List<Trip> trips, Section section) {
List<Trip> allTrips = new ArrayList<>();
allTrips.addAll(trips);
List<Trip> canAllocationTrips = filterTrip(allTrips);
allTrips.removeAll(canAllocationTrips);
handleTrip(canAllocationTrips, section);
if (!ObjectUtils.isEmpty(getHandler())) {
getHandler().execute(allTrips, section);
}
}
}
package com.mushiny.wms.application.config;
import com.alibaba.druid.pool.DruidDataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import javax.sql.DataSource;
/**
* @author:
* @Description: Created by Laptop-8 on 2018/1/18.
*/
@Configuration
@ConditionalOnBean(Environment.class)
public class DataSourceConfig{
private static final Logger LOGGER = LoggerFactory.getLogger(DataSourceConfig.class);
@Autowired
private Environment env;
@Bean
public DataSource createDataSource(){
DruidDataSource dataSource = new DruidDataSource();
dataSource.setUrl(env.getProperty("spring.datasource.url"));
dataSource.setUsername(env.getProperty("spring.datasource.username"));//用户名
dataSource.setPassword(env.getProperty("spring.datasource.password"));//密码
dataSource.setInitialSize(2);
dataSource.setMaxActive(20);
dataSource.setMinIdle(0);
dataSource.setMaxWait(60000);
dataSource.setValidationQuery("SELECT 1");
dataSource.setTestOnBorrow(false);
dataSource.setTestWhileIdle(true);
dataSource.setPoolPreparedStatements(false);
StringBuilder sb=new StringBuilder();
LOGGER.info("数据库" +
"的连接信息为\n"+dataSource.getProperties());
return dataSource;
}
}
package com.mushiny.wms.application.config;
import com.mushiny.wms.application.service.DriveAllocationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author:
* @Description: Created by Laptop-8 on 2017/10/18.
*/
//@Component
public class DriveAllocationRunnable implements Runnable {
private static final Logger LOGGER = LoggerFactory.getLogger(DriveAllocationRunnable.class);
@Autowired
private DriveAllocationService driveAllocationService;
@Override
public void run() {
try {
driveAllocationService.runDriveAllocation();
} catch (Exception e) {
LOGGER.error(e.getMessage(),e);
}
}
}
/*
package com.mushiny.wcs.application.config;
import com.mushiny.wcs.common.context.ApplicationBeanContextAware;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.data.jpa.repository.support.SimpleJpaRepository;
import org.springframework.stereotype.Component;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
*/
/**
* @author:
* @Description: Created by Laptop-8 on 2017/10/17.
*//*
@Component
@Order(2)
public class DriverAllocationScheduled implements CommandLineRunner {
private static final Logger LOGGER = LoggerFactory.getLogger(DriverAllocationScheduled.class);
@Autowired
private DriveAllocationRunnable driveAllocationRunnable;
private ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();
@Override
public void run(String... args) {
LOGGER.debug("开始启动线程分配小车");
try{
service.scheduleAtFixedRate(driveAllocationRunnable, 5, 7, TimeUnit.SECONDS);
}catch (Exception e)
{
driveAllocationRunnable= ApplicationBeanContextAware.getBean(DriveAllocationRunnable.class);
service.scheduleAtFixedRate(driveAllocationRunnable, 5, 7, TimeUnit.SECONDS);
LOGGER.error(e.getMessage(),e);
}
}
}
*/
package com.mushiny.wms.application.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
/**
* Created by Administrator on 2018/5/7.
*/
@Configuration
@EnableAsync
@EnableScheduling
public class ExecutorConfig {
@Bean
public Executor myAsync() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(20);
executor.setMaxPoolSize(50);
executor.setQueueCapacity(100);
executor.setThreadNamePrefix("MyExecutor-");
// rejection-policy:当pool已经达到max size的时候,如何处理新任务
// CALLER_RUNS:不在新线程中执行任务,而是有调用者所在的线程来执行
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
executor.initialize();
return executor;
}
}
package com.mushiny.wms.application.config;
import com.mushiny.wms.application.business.dto.SectionMapNode;
import com.mushiny.wms.application.domain.MapNode;
import com.mushiny.wms.application.domain.enums.MapNodeClassValue;
import com.mushiny.wms.application.repository.MapNodeRepository;
import com.mushiny.wms.application.repository.MapRepository;
import com.mushiny.wms.common.exception.ApiException;
import com.mushiny.wms.common.exception.ExceptionEnum;
import com.mushiny.wms.common.utils.JSONUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.*;
/**
* @author:
* @Description: Created by Laptop-8 on 2017/10/17.
*/
@Component
@Order(1)
public class MapNodeConfig implements CommandLineRunner {
private static final Logger LOGGER = LoggerFactory.getLogger(MapNodeConfig.class);
public static Map<String, List<SectionMapNode>> sectionMapNodes = new HashMap<>();
@Autowired
private MapNodeRepository mapNodeRepository;
@Autowired
private MapRepository mapRepository;
private void init(List<SectionMapNode> sectionMapNodes, com.mushiny.wms.application.domain.Map map, MapNode mapNode, List<MapNode> mapNodes) {
SectionMapNode sectionMapNode = new SectionMapNode();
sectionMapNode.setCurrentMapNode(mapNode);
sectionMapNode.setMap(map);
final String classGroup = mapNode.getClassGroup();
final String mapId = map.getId();
if (!StringUtils.isEmpty(classGroup)) {
final int classValue = mapNode.getClassValue();
if (classValue == MapNodeClassValue.INSIZE) {
sectionMapNode.setInAddress(true);
sectionMapNode.setOutSizeMapNodes(searchOutsizeMapNode(mapId, mapNodes, classGroup, MapNodeClassValue.OUTSIZE));
} else if (classValue == MapNodeClassValue.OUTSIZE) {
sectionMapNode.setInAddress(false);
sectionMapNode.setInSizeMapNodes(searchOutsizeMapNode(mapId, mapNodes, classGroup, MapNodeClassValue.INSIZE));
} else {
throw new ApiException(ExceptionEnum.EX_MAP_CLASSVALUE_NOT_LEGAL.name());
}
}
sectionMapNodes.add(sectionMapNode);
}
private List<MapNode> searchOutsizeMapNode(String mapId, List<MapNode> mapNodes, String classGroup, int classValue) {
List<MapNode> result = new ArrayList<>();
for (MapNode temp : mapNodes) {
if ((!StringUtils.isEmpty(temp.getClassGroup())) &&
temp.getClassGroup().equals(classGroup) &&
temp.getClassValue() == classValue &&
temp.getMapId().equals(mapId))
{
result.add(temp);
break;
}
}
return result;
}
@Override
public void run(String... args) throws Exception {
LOGGER.debug("开始加载地图.....");
List<MapNode> mapNodes = mapNodeRepository.findAll();
List<com.mushiny.wms.application.domain.Map> maps = mapRepository.findAllMap();
for (com.mushiny.wms.application.domain.Map map : maps) {
for (MapNode mapNode : mapNodes) {
final String mapId = map.getId();
final String mapNodeMapId = mapNode.getMapId();
final String sectionId = map.getSectionId();
if (mapId.equals(mapNodeMapId)) {
if (!sectionMapNodes.containsKey(sectionId)) {
List<SectionMapNode> sectionMapNodeTemp = new ArrayList<>();
init(sectionMapNodeTemp, map, mapNode, mapNodes);
sectionMapNodes.put(sectionId, sectionMapNodeTemp);
} else {
init(sectionMapNodes.get(sectionId), map, mapNode, mapNodes);
}
}
}
}
LOGGER.debug("地图信息\n{}", JSONUtil.toJSon(sectionMapNodes));
}
public static SectionMapNode findSectionMapNode(int addrCode, String sectionId) {
SectionMapNode result = null;
List<SectionMapNode> sectionMapNodesTemp = sectionMapNodes.get(sectionId);
if (!CollectionUtils.isEmpty(sectionMapNodes) && !CollectionUtils.isEmpty(sectionMapNodesTemp)) {
for (SectionMapNode sectionMapNode : sectionMapNodesTemp)
{
if (sectionMapNode.getCurrentMapNode().getAddressCodeId() == addrCode) {
result = sectionMapNode;
break;
}
}
}
return result;
}
}
package com.mushiny.wms.application.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.core.env.Environment;
/**
* Created by Tank.li on 2017/7/3.
*/
@Configuration
@ConditionalOnBean(Environment.class)
public class RabbitConfig {
private static Logger LOGGER = LoggerFactory.getLogger(RabbitConfig.class);
@Autowired
private Environment environment;
@Bean
public ConnectionFactory connectionFactory() {
CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
connectionFactory.setAddresses(environment.getProperty("spring.rabbitmq.host"));
connectionFactory.setPort(Integer.parseInt(environment.getProperty("spring.rabbitmq.port")));
connectionFactory.setUsername(environment.getProperty("spring.rabbitmq.username"));
connectionFactory.setPassword(environment.getProperty("spring.rabbitmq.password"));
connectionFactory.setVirtualHost(environment.getProperty("spring.rabbitmq.virtualhost"));
connectionFactory.setPublisherConfirms(true); //必须要设置
StringBuilder sb=new StringBuilder();
sb.append("地址:"+environment.getProperty("spring.rabbitmq.host"));
sb.append("端口:"+environment.getProperty("spring.rabbitmq.port"));
sb.append("用户:"+environment.getProperty("spring.rabbitmq.username"));
sb.append("virtualhost:"+environment.getProperty("spring.rabbitmq.virtualhost"));
LOGGER.info("rabbit mq 的连接信息为\n"+sb.toString());
return connectionFactory;
}
@Bean
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
//必须是prototype类型
public RabbitTemplate rabbitTemplate() {
RabbitTemplate template = new RabbitTemplate(connectionFactory());
return template;
}
}
package com.mushiny.wms.application.config;
import com.mushiny.wms.application.domain.InboundInstruct;
import com.mushiny.wms.application.domain.OutboundInstruct;
import com.mushiny.wms.application.domain.Pod;
import com.mushiny.wms.application.domain.enums.InstructStatus;
import com.mushiny.wms.application.repository.InboundInstructRepository;
import com.mushiny.wms.application.repository.OutboundInstructRepository;
import com.mushiny.wms.application.service.EmptyPodCarryService;
import com.mushiny.wms.common.utils.DateTimeUtil;
import com.mushiny.wms.common.utils.EntityManagerUtil;
import com.mushiny.wms.common.utils.JSONUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.ObjectUtils;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Administrator on 2018/7/9.
*/
@Configuration
public class RestTempConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(RestTempConfig.class);
@Value("${midea.webApi.instructIn.callBack}")
private String instructInCallBack;
@Value("${midea.webApi.instructOut.callBack}")
private String instructOutCallBack;
@Value("${midea.webApi.RFID.callBack}")
private String rFIDCallBack;
@Value("${midea.webApi.invMitemLabelSyn}")
private String invMitemLabelSyn;
@Value("${midea.webApi.sfcMitemSyn}")
private String sfcMitemSyn;
@Value("${mushiny.debug}")
private Boolean debug=false;
@Autowired
private RestTemplate restTemplate;
@Autowired
private EntityManagerUtil entityManagerUtil;
@Bean
public RestTemplate createRestTemplate()
{
RestTemplateBuilder rb=new RestTemplateBuilder();
return rb.build();
}
public String sfcMitemSyn(Map param){
LOGGER.debug("请求地址{} 参数{}",sfcMitemSyn,JSONUtil.mapToJSon(param));
String respose=restTemplate.getForObject(sfcMitemSyn,String.class,param);
LOGGER.debug("请求地址{} 参数{} 返回{}",sfcMitemSyn,JSONUtil.mapToJSon(param),respose);
return respose;
}
public String invMitemLabelSyn(Map param){
long begain=System.currentTimeMillis();
LOGGER.debug("请求地址{} 参数{}",invMitemLabelSyn,JSONUtil.mapToJSon(param));
String respose=restTemplate.getForObject(invMitemLabelSyn,String.class,param);
long end =System.currentTimeMillis();
int time=(int)((end-begain)/1000);
LOGGER.debug("返回用时 {}",time,invMitemLabelSyn,JSONUtil.mapToJSon(param),respose);
return respose;
}
public Map inBoundBindPodAck(Map param)
{
LOGGER.debug("请求地址{} 参数{}",rFIDCallBack,JSONUtil.mapToJSon(param));
Map respose=null;
if(!debug)
{
try {
respose= restTemplate.getForObject(rFIDCallBack,Map.class,param);
} catch (RestClientException e) {
LOGGER.error("调用第三方接口出错:"+rFIDCallBack,e);
respose=new HashMap();
respose.put("IsSucess",false);
respose.put("ErrorCode",1);
respose.put("ErrorMessage","调用第三方接口出错");
}
}else{
respose=new HashMap();
respose.put("IsSucess",true);
respose.put("ErrorCode",0);
respose.put("ErrorMessage",null);
}
LOGGER.debug("请求地址{} 返回{}",rFIDCallBack,JSONUtil.mapToJSon(respose));
return respose;
}
public Map inBoundAck(Map data)
{
LOGGER.debug("请求地址{} 参数{}",instructInCallBack,JSONUtil.mapToJSon(data));
Map respose=null;
if(!debug)
{
try {
respose=restTemplate.getForObject(instructInCallBack,Map.class,data);
} catch (Exception e) {
LOGGER.error("调用第三方接口出错:"+instructInCallBack,e);
respose=new HashMap();
respose.put("IsSucess",false);
respose.put("ErrorCode",1);
respose.put("ErrorMessage","调用第三方接口出错");
}
}else{
respose=new HashMap();
respose.put("IsSucess",true);
respose.put("ErrorCode",0);
respose.put("ErrorMessage",null);
}
if(LOGGER.isDebugEnabled())
{
LOGGER.debug("调用入库指令回传接口{} \n参数{} \n返回结果{}",instructInCallBack, JSONUtil.mapToJSon(data),JSONUtil.mapToJSon(respose));
}
return respose;
}
public Map outBoundAck(Map data)
{
LOGGER.debug("请求地址{} 参数{}",instructOutCallBack,JSONUtil.mapToJSon(data));
Map respose=null;
if(!debug)
{
try {
respose=restTemplate.getForObject(instructOutCallBack,Map.class,data);
} catch (RestClientException e) {
LOGGER.error("调用第三方接口出错:"+instructOutCallBack,e);
respose=new HashMap();
respose.put("IsSucess",false);
respose.put("ErrorCode",1);
respose.put("ErrorMessage","调用第三方接口出错");
}
}else{
respose=new HashMap();
respose.put("IsSucess",true);
respose.put("ErrorCode",0);
respose.put("ErrorMessage",null);
}
if(LOGGER.isDebugEnabled())
{
LOGGER.debug("调用出库指令回传接口{} \n参数{} \n返回结果{}",instructOutCallBack, JSONUtil.mapToJSon(data),JSONUtil.mapToJSon(respose));
}
return respose;
}
}
package com.mushiny.wms.application.domain;
import com.mushiny.wms.common.entity.BaseEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "MD_CHARGER")
public class Charger extends BaseEntity {
private static final long serialVersionUID = 1L;
@Column(name = "NAME")
private String name;
@Column(name = "PLACEMARK")
private Integer placeMark;
@Column(name = "STATE")
private String state;
@Column(name = "CHARGER_TYPE")
private int chargerType;
@Column(name = "SECTION_ID")
private String sectionId;
@Column(name = "WAREHOUSE_ID")
private String warehouseId;
public int getChargerType() {
return chargerType;
}
public void setChargerType(int chargerType) {
this.chargerType = chargerType;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getWarehouseId() {
return warehouseId;
}
public void setWarehouseId(String warehouseId) {
this.warehouseId = warehouseId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getPlaceMark() {
return placeMark;
}
public void setPlaceMark(Integer placeMark) {
this.placeMark = placeMark;
}
public String getSectionId() {
return sectionId;
}
public void setSectionId(String sectionId) {
this.sectionId = sectionId;
}
}
package com.mushiny.wms.application.domain;
/**
* Created by Administrator on 2018/7/9.
*/
public class Constance {
public static final Integer delete=2;
public static final Integer avable=0;
public static final Integer stockInUnit=0;
public static final Integer stockOutUnit=100;
}
package com.mushiny.wms.application.domain;
public interface IRemoveDuplication {
String getRemovingColumn();
}
package com.mushiny.wms.application.domain;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.mushiny.wms.common.entity.BaseEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;
/**
* Created by Administrator on 2018/7/6.
*/
@Entity
@Table(name = "WMS_INBOUND_INSTRUCT")
public class InboundInstruct extends BaseEntity {
@Column(name = "MES_ID")
private String MES_ID;
/*
库存组织
*/
@Column(name = "INV_ORG_ID")
private String INV_ORG_ID;
/*
单据类型
*/
@Column(name = "BILL_TYPE")
private String BILL_TYPE;
/*
指令单号
*/
@Column(name = "BILL_NO")
private String BILL_NO;
/*
配送卡号
*/
@Column(name = "LABEL_NO")
private String LABEL_NO;
/*
完工子库
*/
@Column(name = "INV_CODE")
private String INV_CODE;
/*
自制工单
*/
@Column(name = "MO_NAME")
private String MO_NAME;
/*
上级工单
*/
@Column(name = "ASS_MO_NAME")
private String ASS_MO_NAME;
/*
上线工单上线时间
*/
@Column(name = "DATE_REQ")
private Date DATE_REQ;
/*
物料编码
*/
@Column(name = "MITEM_CODE")
private String MITEM_CODE;
/*
物料描述
*/
@Column(name = "MITEM_DESC")
private String MITEM_DESC;
/*
单位
*/
@Column(name = "UOM")
private String UOM;
/*
可用数量
*/
@Column(name = "QTY")
private BigDecimal QTY;
/*
优先级
*/
@Column(name = "PRIORITY")
private BigDecimal PRIORITY;
/*
来源子库
*/
@Column(name = "TARGET_INV_ID")
private String TARGET_INV_ID;
/*
来源货位
*/
@Column(name = "TARGET_LOC_ID")
private String TARGET_LOC_ID;
/*
出入库数量
*/
@Column(name = "STOCK_QTY")
private BigDecimal STOCK_QTY;
/*
料架条码L
*/
@Column(name = "STORAGE_NO_L")
private String STORAGE_NO_L;
/*
料架条码R
*/
@Column(name = "STORAGE_NO_R")
private String STORAGE_NO_R;
/*
工站条码
*/
@Column(name = "WORKCENTER_CODE")
private String WORKCENTER_CODE;
@JsonProperty(value = "ID")
public String getMES_ID() {
return MES_ID;
}
public void setMES_ID(String MES_ID) {
this.MES_ID = MES_ID;
}
@JsonProperty( "INV_ORG_ID")
public String getINV_ORG_ID() {
return INV_ORG_ID;
}
public void setINV_ORG_ID(String INV_ORG_ID) {
this.INV_ORG_ID = INV_ORG_ID;
}
@JsonProperty("BILL_TYPE")
public String getBILL_TYPE() {
return BILL_TYPE;
}
public void setBILL_TYPE(String BILL_TYPE) {
this.BILL_TYPE = BILL_TYPE;
}
@JsonProperty("BILL_NO")
public String getBILL_NO() {
return BILL_NO;
}
public void setBILL_NO(String BILL_NO) {
this.BILL_NO = BILL_NO;
}
@JsonProperty("LABEL_NO")
public String getLABEL_NO() {
return LABEL_NO;
}
public void setLABEL_NO(String LABEL_NO) {
this.LABEL_NO = LABEL_NO;
}
@JsonProperty("INV_CODE")
public String getINV_CODE() {
return INV_CODE;
}
public void setINV_CODE(String INV_CODE) {
this.INV_CODE = INV_CODE;
}
@JsonProperty("MO_NAME")
public String getMO_NAME() {
return MO_NAME;
}
public void setMO_NAME(String MO_NAME) {
this.MO_NAME = MO_NAME;
}
@JsonProperty("ASS_MO_NAME")
public String getASS_MO_NAME() {
return ASS_MO_NAME;
}
public void setASS_MO_NAME(String ASS_MO_NAME) {
this.ASS_MO_NAME = ASS_MO_NAME;
}
@JsonProperty("DATE_REQ")
public Date getDATE_REQ() {
return DATE_REQ;
}
public void setDATE_REQ(Date DATE_REQ) {
this.DATE_REQ = DATE_REQ;
}
@JsonProperty("MITEM_CODE")
public String getMITEM_CODE() {
return MITEM_CODE;
}
public void setMITEM_CODE(String MITEM_CODE) {
this.MITEM_CODE = MITEM_CODE;
}
@JsonProperty("MITEM_DESC")
public String getMITEM_DESC() {
return MITEM_DESC;
}
public void setMITEM_DESC(String MITEM_DESC) {
this.MITEM_DESC = MITEM_DESC;
}
@JsonProperty("UOM")
public String getUOM() {
return UOM;
}
public void setUOM(String UOM) {
this.UOM = UOM;
}
@JsonProperty("QTY")
public BigDecimal getQTY() {
return QTY;
}
public void setQTY(BigDecimal QTY) {
this.QTY = QTY;
}
@JsonProperty("PRIORITY")
public BigDecimal getPRIORITY() {
return PRIORITY;
}
public void setPRIORITY(BigDecimal PRIORITY) {
this.PRIORITY = PRIORITY;
}
@JsonProperty("TARGET_INV_ID")
public String getTARGET_INV_ID() {
return TARGET_INV_ID;
}
public void setTARGET_INV_ID(String TARGET_INV_ID) {
this.TARGET_INV_ID = TARGET_INV_ID;
}
@JsonProperty("TARGET_LOC_ID")
public String getTARGET_LOC_ID() {
return TARGET_LOC_ID;
}
public void setTARGET_LOC_ID(String TARGET_LOC_ID) {
this.TARGET_LOC_ID = TARGET_LOC_ID;
}
@JsonProperty("STOCK_QTY")
public BigDecimal getSTOCK_QTY() {
return STOCK_QTY;
}
public void setSTOCK_QTY(BigDecimal STOCK_QTY) {
this.STOCK_QTY = STOCK_QTY;
}
@JsonProperty("STORAGE_NO_L")
public String getSTORAGE_NO_L() {
return STORAGE_NO_L;
}
public void setSTORAGE_NO_L(String STORAGE_NO_L) {
this.STORAGE_NO_L = STORAGE_NO_L;
}
@JsonProperty("STORAGE_NO_R")
public String getSTORAGE_NO_R() {
return STORAGE_NO_R;
}
public void setSTORAGE_NO_R(String STORAGE_NO_R) {
this.STORAGE_NO_R = STORAGE_NO_R;
}
@JsonProperty("WORKCENTER_CODE")
public String getWORKCENTER_CODE() {
return WORKCENTER_CODE;
}
public void setWORKCENTER_CODE(String WORKCENTER_CODE) {
this.WORKCENTER_CODE = WORKCENTER_CODE;
}
@Override
public String toString() {
return "InboundInstruct{" +
"MES_ID='" + MES_ID + '\'' +
", INV_ORG_ID='" + INV_ORG_ID + '\'' +
", BILL_TYPE='" + BILL_TYPE + '\'' +
", BILL_NO='" + BILL_NO + '\'' +
", LABEL_NO='" + LABEL_NO + '\'' +
", INV_CODE='" + INV_CODE + '\'' +
", MO_NAME='" + MO_NAME + '\'' +
", ASS_MO_NAME='" + ASS_MO_NAME + '\'' +
", DATE_REQ=" + DATE_REQ +
", MITEM_CODE='" + MITEM_CODE + '\'' +
", MITEM_DESC='" + MITEM_DESC + '\'' +
", UOM='" + UOM + '\'' +
", QTY=" + QTY +
", PRIORITY=" + PRIORITY +
", TARGET_INV_ID='" + TARGET_INV_ID + '\'' +
", TARGET_LOC_ID='" + TARGET_LOC_ID + '\'' +
", STOCK_QTY=" + STOCK_QTY +
", STORAGE_NO_L='" + STORAGE_NO_L + '\'' +
", STORAGE_NO_R='" + STORAGE_NO_R + '\'' +
", WORKCENTER_CODE='" + WORKCENTER_CODE + '\'' +
'}';
}
}
package com.mushiny.wms.application.domain;
import com.mushiny.wms.common.entity.BaseEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;
/**
* Created by Administrator on 2018/7/6.
*/
@Entity
@Table(name = "WMS_INV_MITEM_LABEL")
public class InvMitemLabel extends BaseEntity implements IRemoveDuplication {
/*
库存组织
*/
@Column(name = "INV_ORG_ID")
private Integer INV_ORG_ID;
/*
配送卡号
*/
@Column(name = "LABEL_NO")
private String LABEL_NO;
/*
完工子库
*/
@Column(name = "INV_CODE")
private String INV_CODE;
/*
自制工单
*/
@Column(name = "MO_NAME")
private String MO_NAME;
/*
总装工单
*/
@Column(name = "ASS_MO_NAME")
private String ASS_MO_NAME;
/*
总装车间
*/
@Column(name = "WORKSHOP_CODE")
private String WORKSHOP_CODE;
/*
总装产线
*/
@Column(name = "LINE_CODE")
private String LINE_CODE;
/*
总装工单上线时间
*/
@Column(name = "DATE_REQ")
private Date DATE_REQ;
/*
物料编码
*/
@Column(name = "MITEM_CODE")
private String MITEM_CODE;
/*
物料描述
*/
@Column(name = "MITEM_DESC")
private String MITEM_DESC;
/*
单位
*/
@Column(name = "UOM")
private String UOM;
/*
可用数量
*/
@Column(name = "QTY")
private BigDecimal QTY;
/*
标签状态
*/
@Column(name = "LABEL_STATE")
private String LABEL_STATE;
/*
最后更新时间
*/
@Column(name = "LAST_UPDATE_DATE")
private Date LAST_UPDATE_DATE;
public Integer getINV_ORG_ID() {
return INV_ORG_ID;
}
public void setINV_ORG_ID(Integer INV_ORG_ID) {
this.INV_ORG_ID = INV_ORG_ID;
}
public String getLABEL_NO() {
return LABEL_NO;
}
public void setLABEL_NO(String LABEL_NO) {
this.LABEL_NO = LABEL_NO;
}
public String getINV_CODE() {
return INV_CODE;
}
public void setINV_CODE(String INV_CODE) {
this.INV_CODE = INV_CODE;
}
public String getMO_NAME() {
return MO_NAME;
}
public void setMO_NAME(String MO_NAME) {
this.MO_NAME = MO_NAME;
}
public String getASS_MO_NAME() {
return ASS_MO_NAME;
}
public void setASS_MO_NAME(String ASS_MO_NAME) {
this.ASS_MO_NAME = ASS_MO_NAME;
}
public String getWORKSHOP_CODE() {
return WORKSHOP_CODE;
}
public void setWORKSHOP_CODE(String WORKSHOP_CODE) {
this.WORKSHOP_CODE = WORKSHOP_CODE;
}
public String getLINE_CODE() {
return LINE_CODE;
}
public void setLINE_CODE(String LINE_CODE) {
this.LINE_CODE = LINE_CODE;
}
public Date getDATE_REQ() {
return DATE_REQ;
}
public void setDATE_REQ(Date DATE_REQ) {
this.DATE_REQ = DATE_REQ;
}
public String getMITEM_CODE() {
return MITEM_CODE;
}
public void setMITEM_CODE(String MITEM_CODE) {
this.MITEM_CODE = MITEM_CODE;
}
public String getMITEM_DESC() {
return MITEM_DESC;
}
public void setMITEM_DESC(String MITEM_DESC) {
this.MITEM_DESC = MITEM_DESC;
}
public String getUOM() {
return UOM;
}
public void setUOM(String UOM) {
this.UOM = UOM;
}
public BigDecimal getQTY() {
return QTY;
}
public void setQTY(BigDecimal QTY) {
this.QTY = QTY;
}
public String getLABEL_STATE() {
return LABEL_STATE;
}
public void setLABEL_STATE(String LABEL_STATE) {
this.LABEL_STATE = LABEL_STATE;
}
public Date getLAST_UPDATE_DATE() {
return LAST_UPDATE_DATE;
}
public void setLAST_UPDATE_DATE(Date LAST_UPDATE_DATE) {
this.LAST_UPDATE_DATE = LAST_UPDATE_DATE;
}
@Override
public String getRemovingColumn() {
return this.MITEM_CODE;
}
}
package com.mushiny.wms.application.domain;
import com.mushiny.wms.common.entity.BaseEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
/**
* Created by Administrator on 2018/7/7 0007.
*/
@Entity
@Table(name = "WMS_INV_STOCKUNIT" )
public class InvStockunit extends BaseEntity {
@Column(name = "AMOUNT")
private BigDecimal amount;
@Column(name = "RESERVED_AMOUNT")
private BigDecimal reservedAmount;
@Column(name = "STATE")
private String state;
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public BigDecimal getReservedAmount() {
return reservedAmount;
}
public void setReservedAmount(BigDecimal reservedAmount) {
this.reservedAmount = reservedAmount;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
}
package com.mushiny.wms.application.domain;
import com.mushiny.wms.common.entity.BaseEntity;
import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
/**
* Created by Administrator on 2018/7/7 0007.
*/
@Entity
@Table(name = "WMS_INV_UNITLOAD")
public class InvUnitload extends BaseEntity {
@Column(name = "POD_INDEX")
private String podIndex;
@Column(name = "WEIGHT")
private BigDecimal weight;
@Column(name = "WEIGHT_CALCULATED")
private BigDecimal weightCalculated;
@Column(name = "WEIGHT_MEASURE")
private BigDecimal weightMeasure;
@Column(name = "STATION_NAME")
private String stationName;
@Column(name = "INBOUND_INSTRUCT_ID")
private String inboundInstructId;
public String getPodIndex() {
return podIndex;
}
public void setPodIndex(String podIndex) {
this.podIndex = podIndex;
}
public BigDecimal getWeight() {
return weight;
}
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
public BigDecimal getWeightCalculated() {
return weightCalculated;
}
public void setWeightCalculated(BigDecimal weightCalculated) {
this.weightCalculated = weightCalculated;
}
public BigDecimal getWeightMeasure() {
return weightMeasure;
}
public void setWeightMeasure(BigDecimal weightMeasure) {
this.weightMeasure = weightMeasure;
}
public String getStationName() {
return stationName;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public String getInboundInstructId() {
return inboundInstructId;
}
public void setInboundInstructId(String inboundInstructId) {
this.inboundInstructId = inboundInstructId;
}
}
package com.mushiny.wms.application.domain;
import com.mushiny.wms.common.entity.BaseEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "WD_MAP")
public class Map extends BaseEntity {
private static final long serialVersionUID = 1L;
@Column(name = "NAME")
private String name;
@Column(name = "NODESIZE")
private Integer nodeSize;
@Column(name = "NUMBEROFCOLUMNS")
private Integer numberOfColumns;
@Column(name = "NUMBEROFROWS")
private Integer numberOfRows;
@Column(name = "SECTION_ID")
private String sectionId;
@Column(name = "ACTIVE")
private boolean active;
@Column(name = "WAREHOUSE_ID")
private String warehouseId;
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getNodeSize() {
return nodeSize;
}
public void setNodeSize(int nodeSize) {
this.nodeSize = nodeSize;
}
public int getNumberOfColumns() {
return numberOfColumns;
}
public void setNumberOfColumns(int numberOfColumns) {
this.numberOfColumns = numberOfColumns;
}
public int getNumberOfRows() {
return numberOfRows;
}
public void setNumberOfRows(int numberOfRows) {
this.numberOfRows = numberOfRows;
}
public String getSectionId() {
return sectionId;
}
public void setSectionId(String sectionId) {
this.sectionId = sectionId;
}
public String getWarehouseId() {
return warehouseId;
}
public void setWarehouseId(String warehouseId) {
this.warehouseId = warehouseId;
}
}
package com.mushiny.wms.application.domain;
import com.mushiny.wms.common.entity.BaseEntity;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import javax.persistence.*;
@Entity
@Table(name = "WD_NEIGHBOR")
public class MapNeighbor extends BaseEntity {
private static final long serialVersionUID = 1L;
@ManyToOne
@Fetch(FetchMode.JOIN)
@JoinColumn(name = "IN_ID")
private MapNode inNode;
@ManyToOne
@Fetch(FetchMode.JOIN)
@JoinColumn(name = "OUT_ID")
private MapNode outNode;
@Column(name = "CARRYINGCOST")
private Integer carryingCost;
@Column(name = "COST")
private Integer cost;
@Column(name = "NEW_COST")
private Integer newCost;
@Column(name = "COSTTYPE")
private String costType;
@Column(name = "BLOCKED")
private boolean blocked;
@Column(name = "MAP_ID")
private String mapId;
@Column(name = "WAREHOUSE_ID")
private String warehouseId;
public void setCarryingCost(Integer carryingCost) {
this.carryingCost = carryingCost;
}
public void setCost(Integer cost) {
this.cost = cost;
}
public Integer getNewCost() {
return newCost;
}
public void setNewCost(Integer newCost) {
this.newCost = newCost;
}
public int getCarryingCost() {
return carryingCost;
}
public void setCarryingCost(int carryingCost) {
this.carryingCost = carryingCost;
}
public MapNode getInNode() {
return inNode;
}
public void setInNode(MapNode inNode) {
this.inNode = inNode;
}
public MapNode getOutNode() {
return outNode;
}
public void setOutNode(MapNode outNode) {
this.outNode = outNode;
}
public int getCost() {
return cost;
}
public void setCost(int cost) {
this.cost = cost;
}
public String getCostType() {
return costType;
}
public void setCostType(String costType) {
this.costType = costType;
}
public boolean isBlocked() {
return blocked;
}
public void setBlocked(boolean blocked) {
this.blocked = blocked;
}
public String getMapId() {
return mapId;
}
public void setMapId(String mapId) {
this.mapId = mapId;
}
public String getWarehouseId() {
return warehouseId;
}
public void setWarehouseId(String warehouseId) {
this.warehouseId = warehouseId;
}
}
package com.mushiny.wms.application.domain;
import com.mushiny.wms.common.entity.BaseEntity;
import org.springframework.util.ObjectUtils;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "WD_NODE")
public class MapNode extends BaseEntity {
private static final long serialVersionUID = 1L;
@Column(name = "NAME")
private String name;
@Column(name = "XPOSITION")
private Integer xPosition;
@Column(name = "YPOSITION")
private Integer yPosition;
@Column(name = "TYPE")
private Integer type;
@Column(name = "BLOCKED")
private boolean blocked;
@Column(name = "ADDRESSCODEID")
private Integer addressCodeId;
@Column(name = "STATION_ID")
private String stationId;
@Column(name = "CLASSGROUP")
private String classGroup;
@Column(name = "TURNAREA_ID")
private String turnAreaId;
@Column(name = "CHARGER_ID")
private String chargerId;
@Column(name = "CLIENT_ID")
private String clientId;
@Column(name = "ZONE_ID")
private String zoneId;
@Column(name = "MAP_ID")
private String mapId;
@Column(name = "AGVTYPE")
private Integer agvType = 0;
@Column(name = "CLASSVALUE")
private Integer classValue = -1;
@Column(name = "WAREHOUSE_ID")
private String warehouseId;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getClassGroup() {
return classGroup;
}
public void setClassGroup(String classGroup) {
this.classGroup = classGroup;
}
public int getxPosition() {
return xPosition;
}
public void setxPosition(int xPosition) {
this.xPosition = xPosition;
}
public int getyPosition() {
return yPosition;
}
public void setyPosition(int yPosition) {
this.yPosition = yPosition;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public boolean isBlocked() {
return blocked;
}
public void setBlocked(boolean blocked) {
this.blocked = blocked;
}
public int getAddressCodeId() {
return addressCodeId;
}
public void setAddressCodeId(int addressCodeId) {
this.addressCodeId = addressCodeId;
}
public String getStationId() {
return stationId;
}
public void setStationId(String stationId) {
this.stationId = stationId;
}
public String getTurnAreaId() {
return turnAreaId;
}
public void setTurnAreaId(String turnAreaId) {
this.turnAreaId = turnAreaId;
}
public String getChargerId() {
return chargerId;
}
public void setChargerId(String chargerId) {
this.chargerId = chargerId;
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getZoneId() {
return zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public String getMapId() {
return mapId;
}
public void setMapId(String mapId) {
this.mapId = mapId;
}
public int getAgvType() {
if (ObjectUtils.isEmpty(agvType))
agvType = -1;
return agvType;
}
public void setAgvType(int agvType) {
this.agvType = agvType;
}
public int getClassValue() {
if (ObjectUtils.isEmpty(classValue))
classValue = 2;
return classValue;
}
public void setClassValue(int classValue) {
this.classValue = classValue;
}
public String getWarehouseId() {
return warehouseId;
}
public void setWarehouseId(String warehouseId) {
this.warehouseId = warehouseId;
}
}
package com.mushiny.wms.application.domain;
import com.mushiny.wms.common.entity.BaseEntity;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Created by Administrator on 2018/7/12.
*/
@Entity
@Table(name = "MD_STATIONNODEPOSITION")
public class MdStationnodeposition extends BaseEntity{
@ManyToOne
@Fetch(FetchMode.JOIN)
@JoinColumn(name = "STATIONNODE_ID")
private Stationnode stationnode;
@ManyToOne
@Fetch(FetchMode.JOIN)
@JoinColumn(name = "NODE_ID")
private MapNode node;
@Column(name="NODE_TYPE")
private Integer nodeType;
@Column(name="DIRECTION")
private String direction;
public String getDirection() {
return direction;
}
public void setDirection(String direction) {
this.direction = direction;
}
public Stationnode getStationnode() {
return stationnode;
}
public void setStationnode(Stationnode stationnode) {
this.stationnode = stationnode;
}
public MapNode getNode() {
return node;
}
public void setNode(MapNode node) {
this.node = node;
}
public Integer getNodeType() {
return nodeType;
}
public void setNodeType(Integer nodeType) {
this.nodeType = nodeType;
}
}
package com.mushiny.wms.application.domain;
/**
* Created by Administrator on 2018/7/6.
*/
public class MushinyMessage {
private Object code;
private String message;
private Object data;
private String describe;
public String getDescribe() {
return describe;
}
public void setDescribe(String describe) {
this.describe = describe;
}
public Object getCode() {
return code;
}
public void setCode(Object code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
package com.mushiny.wms.application.domain;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.mushiny.wms.common.entity.BaseEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;
/**
* Created by Administrator on 2018/7/6.
*/
@Entity
@Table(name = "WMS_OUTBOUND_INSTRUCT")
public class OutboundInstruct extends BaseEntity {
@Column(name = "MES_ID")
private String MES_ID;
/*
库存组织
*/
@Column(name = "INV_ORG_ID")
private String INV_ORG_ID;
/*
单据类型
*/
@Column(name = "BILL_TYPE")
private String BILL_TYPE;
/*
指令单号
*/
@Column(name = "BILL_NO")
private String BILL_NO;
/*
配送卡号
*/
@Column(name = "LABEL_NO")
private String LABEL_NO;
/*
完工子库
*/
@Column(name = "INV_CODE")
private String INV_CODE;
/*
自制工单
*/
@Column(name = "MO_NAME")
private String MO_NAME;
/*
父级工单
*/
@Column(name = "ASS_MO_NAME")
private String ASS_MO_NAME;
/*
总装产线
*/
@Column(name = "LINE_CODE")
private String LINE_CODE;
/*
物料到达时间
*/
@Column(name = "DATE_REQ")
private Date DATE_REQ;
/*
物料编码
*/
@Column(name = "MITEM_CODE")
private String MITEM_CODE;
/*
物料描述
*/
@Column(name = "MITEM_DESC")
private String MITEM_DESC;
/*
单位
*/
@Column(name = "UOM")
private String UOM;
/*
可用数量
*/
@Column(name = "QTY")
private BigDecimal QTY;
/*
优先级
*/
@Column(name = "PRIORITY")
private BigDecimal PRIORITY;
/*
目标工站条码
*/
@Column(name = "WORKCENTER_CODE")
private String WORKCENTER_CODE;
@JsonProperty(value = "ID")
public String getMES_ID() {
return MES_ID;
}
public void setMES_ID(String MES_ID) {
this.MES_ID = MES_ID;
}
@JsonProperty(value = "INV_ORG_ID")
public String getINV_ORG_ID() {
return INV_ORG_ID;
}
public void setINV_ORG_ID(String INV_ORG_ID) {
this.INV_ORG_ID = INV_ORG_ID;
}
@JsonProperty(value = "BILL_TYPE")
public String getBILL_TYPE() {
return BILL_TYPE;
}
public void setBILL_TYPE(String BILL_TYPE) {
this.BILL_TYPE = BILL_TYPE;
}
@JsonProperty(value = "BILL_NO")
public String getBILL_NO() {
return BILL_NO;
}
public void setBILL_NO(String BILL_NO) {
this.BILL_NO = BILL_NO;
}
@JsonProperty(value = "LABEL_NO")
public String getLABEL_NO() {
return LABEL_NO;
}
public void setLABEL_NO(String LABEL_NO) {
this.LABEL_NO = LABEL_NO;
}
@JsonProperty(value = "INV_CODE")
public String getINV_CODE() {
return INV_CODE;
}
public void setINV_CODE(String INV_CODE) {
this.INV_CODE = INV_CODE;
}
@JsonProperty(value = "MO_NAME")
public String getMO_NAME() {
return MO_NAME;
}
public void setMO_NAME(String MO_NAME) {
this.MO_NAME = MO_NAME;
}
@JsonProperty(value = "ASS_MO_NAME")
public String getASS_MO_NAME() {
return ASS_MO_NAME;
}
public void setASS_MO_NAME(String ASS_MO_NAME) {
this.ASS_MO_NAME = ASS_MO_NAME;
}
@JsonProperty(value = "LINE_CODE")
public String getLINE_CODE() {
return LINE_CODE;
}
public void setLINE_CODE(String LINE_CODE) {
this.LINE_CODE = LINE_CODE;
}
@JsonProperty(value = "DATE_REQ")
public Date getDATE_REQ() {
return DATE_REQ;
}
public void setDATE_REQ(Date DATE_REQ) {
this.DATE_REQ = DATE_REQ;
}
@JsonProperty(value = "MITEM_CODE")
public String getMITEM_CODE() {
return MITEM_CODE;
}
public void setMITEM_CODE(String MITEM_CODE) {
this.MITEM_CODE = MITEM_CODE;
}
@JsonProperty(value = "MITEM_DESC")
public String getMITEM_DESC() {
return MITEM_DESC;
}
public void setMITEM_DESC(String MITEM_DESC) {
this.MITEM_DESC = MITEM_DESC;
}
@JsonProperty(value = "UOM")
public String getUOM() {
return UOM;
}
public void setUOM(String UOM) {
this.UOM = UOM;
}
@JsonProperty(value = "QTY")
public BigDecimal getQTY() {
return QTY;
}
public void setQTY(BigDecimal QTY) {
this.QTY = QTY;
}
@JsonProperty(value = "PRIORITY")
public BigDecimal getPRIORITY() {
return PRIORITY;
}
public void setPRIORITY(BigDecimal PRIORITY) {
this.PRIORITY = PRIORITY;
}
@JsonProperty(value = "WORKCENTER_CODE")
public String getWORKCENTER_CODE() {
return WORKCENTER_CODE;
}
public void setWORKCENTER_CODE(String WORKCENTER_CODE) {
this.WORKCENTER_CODE = WORKCENTER_CODE;
}
@Override
public String toString() {
return "OutboundInstruct{" +
"MES_ID='" + MES_ID + '\'' +
", INV_ORG_ID='" + INV_ORG_ID + '\'' +
", BILL_TYPE='" + BILL_TYPE + '\'' +
", BILL_NO='" + BILL_NO + '\'' +
", LABEL_NO='" + LABEL_NO + '\'' +
", INV_CODE='" + INV_CODE + '\'' +
", MO_NAME='" + MO_NAME + '\'' +
", ASS_MO_NAME='" + ASS_MO_NAME + '\'' +
", LINE_CODE='" + LINE_CODE + '\'' +
", DATE_REQ=" + DATE_REQ +
", MITEM_CODE='" + MITEM_CODE + '\'' +
", MITEM_DESC='" + MITEM_DESC + '\'' +
", UOM='" + UOM + '\'' +
", QTY=" + QTY +
", PRIORITY=" + PRIORITY +
", WORKCENTER_CODE='" + WORKCENTER_CODE + '\'' +
'}';
}
}
package com.mushiny.wms.application.domain;
import com.mushiny.wms.common.entity.BaseEntity;
import javax.persistence.*;
@Entity
@Table(name = "MD_POD")
public class Pod extends BaseEntity {
private static final long serialVersionUID = 1L;
@Column(name = "NAME")
private String name;
@Column(name = "SECTION_ID")
private String sectionId;
@Column(name = "DESCRIPTION")
private String description;
@Column(name = "POD_INDEX")
private Integer podIndex = 0;
@Column(name = "ADDRCODEID_TAR")
private String tarAddrcodeId;
@Column(name = "PODTYPE_ID")
private String podTypeId;
@Column(name = "ZONE_ID")
private String zoneId;
@Column(name = "PLACEMARK")
private Integer placeMark;
@Column(name = "XPOS")
private Integer xPos;
@Column(name = "STATE")
private String state;
@Column(name = "TOWARD")
private Integer toward;
public Integer getToward() {
return toward;
}
public void setToward(Integer toward) {
this.toward = toward;
}
public String getSectionId() {
return sectionId;
}
public void setSectionId(String sectionId) {
this.sectionId = sectionId;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
@Column(name = "YPOS")
private Integer yPos;
@Column(name = "SELLING_DEGREE")
private String sellingDegree;
@Column(name = "CLIENT_ID")
private String clientId;
@Column(name = "WAREHOUSE_ID")
private String warehouseId;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getTarAddrcodeId() {
return tarAddrcodeId;
}
public void setTarAddrcodeId(String tarAddrcodeId) {
this.tarAddrcodeId = tarAddrcodeId;
}
public Integer getPodIndex() {
return podIndex;
}
public void setPodIndex(Integer podIndex) {
this.podIndex = podIndex;
}
public String getPodTypeId() {
return podTypeId;
}
public void setPodTypeId(String podTypeId) {
this.podTypeId = podTypeId;
}
public String getZoneId() {
return zoneId;
}
public void setZoneId(String zoneId) {
this.zoneId = zoneId;
}
public Integer getPlaceMark() {
return placeMark;
}
public void setPlaceMark(Integer placeMark) {
this.placeMark = placeMark;
}
public Integer getxPos() {
return xPos;
}
public void setxPos(Integer xPos) {
this.xPos = xPos;
}
public Integer getyPos() {
return yPos;
}
public void setyPos(Integer yPos) {
this.yPos = yPos;
}
public String getSellingDegree() {
return sellingDegree;
}
public void setSellingDegree(String sellingDegree) {
this.sellingDegree = sellingDegree;
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getWarehouseId() {
return warehouseId;
}
public void setWarehouseId(String warehouseId) {
this.warehouseId = warehouseId;
}
}
package com.mushiny.wms.application.domain;
import com.mushiny.wms.common.entity.BaseEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "WD_SECTION")
public class Section extends BaseEntity {
private static final long serialVersionUID = 1L;
@Column(name = "NAME")
private String name;
@Column(name = "WAREHOUSE_ID")
private String warehouseId;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getWarehouseId() {
return warehouseId;
}
public void setWarehouseId(String warehouseId) {
this.warehouseId = warehouseId;
}
}
package com.mushiny.wms.application.domain;
import com.mushiny.wms.common.entity.BaseEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;
/**
* Created by Administrator on 2018/7/6.
*/
@Entity
@Table(name = "WMS_SFC_MITEM")
public class SfcMitem extends BaseEntity implements IRemoveDuplication {
/*
库存组织
*/
@Column(name = "INV_ORG_ID")
private Integer INV_ORG_ID;
/*
物料编码
*/
@Column(name = "MITEM_CODE")
private String MITEM_CODE;
/*
物料名称
*/
@Column(name = "MITEM_DESC")
private String MITEM_DESC;
/*
单位
*/
@Column(name = "UOM")
private String UOM;
/*
物料状态
*/
@Column(name = "MITEM_STATUS")
private String MITEM_STATUS;
/*
物料类型
*/
@Column(name = "MITEM_TYPE")
private String MITEM_TYPE;
/*
*/
@Column(name = "LENGHT")
private BigDecimal LENGHT;
/*
*/
@Column(name = "WIDTH")
private BigDecimal WIDTH;
/*
*/
@Column(name = "HEIGHT")
private BigDecimal HEIGHT;
/*
重量
*/
@Column(name = "WEIGHT")
private BigDecimal WEIGHT;
/*
状态
*/
@Column(name = "STATE")
private String STATE;
/*
最后更新时间
*/
@Column(name = "LAST_UPDATE_DATE")
private Date LAST_UPDATE_DATE;
public Integer getINV_ORG_ID() {
return INV_ORG_ID;
}
public void setINV_ORG_ID(Integer INV_ORG_ID) {
this.INV_ORG_ID = INV_ORG_ID;
}
public String getMITEM_CODE() {
return MITEM_CODE;
}
public void setMITEM_CODE(String MITEM_CODE) {
this.MITEM_CODE = MITEM_CODE;
}
public String getMITEM_DESC() {
return MITEM_DESC;
}
public void setMITEM_DESC(String MITEM_DESC) {
this.MITEM_DESC = MITEM_DESC;
}
public String getUOM() {
return UOM;
}
public void setUOM(String UOM) {
this.UOM = UOM;
}
public String getMITEM_STATUS() {
return MITEM_STATUS;
}
public void setMITEM_STATUS(String MITEM_STATUS) {
this.MITEM_STATUS = MITEM_STATUS;
}
public String getMITEM_TYPE() {
return MITEM_TYPE;
}
public void setMITEM_TYPE(String MITEM_TYPE) {
this.MITEM_TYPE = MITEM_TYPE;
}
public BigDecimal getLENGHT() {
return LENGHT;
}
public void setLENGHT(BigDecimal LENGHT) {
this.LENGHT = LENGHT;
}
public BigDecimal getWIDTH() {
return WIDTH;
}
public void setWIDTH(BigDecimal WIDTH) {
this.WIDTH = WIDTH;
}
public BigDecimal getHEIGHT() {
return HEIGHT;
}
public void setHEIGHT(BigDecimal HEIGHT) {
this.HEIGHT = HEIGHT;
}
public BigDecimal getWEIGHT() {
return WEIGHT;
}
public void setWEIGHT(BigDecimal WEIGHT) {
this.WEIGHT = WEIGHT;
}
public String getSTATE() {
return STATE;
}
public void setSTATE(String STATE) {
this.STATE = STATE;
}
public Date getLAST_UPDATE_DATE() {
return LAST_UPDATE_DATE;
}
public void setLAST_UPDATE_DATE(Date LAST_UPDATE_DATE) {
this.LAST_UPDATE_DATE = LAST_UPDATE_DATE;
}
@Override
public String getRemovingColumn() {
return this.MITEM_CODE;
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment