Merge remote-tracking branch 'origin/dev' into dev

yun-zuoyi
wei.peng 7 years ago
commit 79ee50684e

@ -3,8 +3,6 @@ package cn.estsh.i3plus.pojo.base.bean;
import cn.estsh.i3plus.pojo.base.common.Pager; import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.Getter;
import lombok.Setter;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -108,31 +106,4 @@ public class BaseResultBean<Obj> {
return rs; return rs;
} }
public BaseResultBean setResultList(List<Obj> resultList) {
this.resultList = resultList;
return this;
}
public BaseResultBean setResultObject(Obj resultObject) {
this.resultObject = resultObject;
return this;
}
public BaseResultBean setResultMap(Map<String, Object> resultMap) {
this.resultMap = resultMap;
return this;
}
public BaseResultBean setPager(Pager pager) {
this.pager = pager;
return this;
}
public BaseResultBean setListPager(ListPager<Obj> listPager) {
this.listPager = listPager;
this.setPager(listPager.getObjectPager());
this.setResultList(listPager.getObjectList());
return this;
}
} }

@ -21,17 +21,17 @@ public class CommonEnumUtil {
WMS(3, "i3wms", "仓库管理软件"), WMS(3, "i3wms", "仓库管理软件"),
MES(4, "i3mes", "生产管理软件"), MES(4, "i3mes", "生产管理软件"),
QMS(5, "i3qms", "质量管理软件"), QMS(5, "i3qms", "质量管理软件"),
FORM(80,"block-form","智能表单"), FORM(20,"block-form","智能表单"),
REPORT(81,"block-report","智能报表"), REPORT(21,"block-report","智能报表"),
WORKFLOW(82,"block-workflow","智能工作流"), WORKFLOW(22,"block-workflow","智能工作流"),
JOBFLOW(83,"block-jobflow","智能作业流"), JOBFLOW(23,"block-jobflow","智能作业流"),
SOFTSWITCH(84,"block-softswitch","智能软件适配器"), SOFTSWITCH(24,"block-softswitch","智能软件适配器"),
HARDSWITCH(85,"block-hardswitch","智能硬件适配器"), HARDSWITCH(25,"block-hardswitch","智能硬件适配器"),
CONSOLE(95,"impp-console","服务监控台"), CENTER(99,"icloud-server","注册中心"),
GATEWAY(96,"impp-gateway","服务网关"),
CLOUD(97,"i3cloud","微服务"),
SURFACE(98,"i3surface","对外服务"), SURFACE(98,"i3surface","对外服务"),
CENTER(99,"icloud-server","注册中心"); CLOUD(97,"i3cloud","微服务"),
GATEWAY(96,"impp-gateway","服务网关"),
CONSOLE(95,"impp-console","服务监控台");
private int value; private int value;
private String code; private String code;
@ -382,7 +382,7 @@ public class CommonEnumUtil {
@JsonFormat(shape = JsonFormat.Shape.OBJECT) @JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum DATA_STATUS { public enum DATA_STATUS {
ENABLE(1, "启用", "fa fa-success cell-fa fa-check"), ENABLE(1, "启用", "fa fa-success cell-fa fa-check"),
DISABLE(2, "禁", "fa fa-disabled cell-fa fa-times-circle"), DISABLE(2, "禁", "fa fa-disabled cell-fa fa-times-circle"),
LOCKING(3, "锁定", "fa cell-fa fa-lock"); LOCKING(3, "锁定", "fa cell-fa fa-lock");
private int value; private int value;

@ -1265,7 +1265,7 @@ public class WmsEnumUtil {
*/ */
@JsonFormat(shape = JsonFormat.Shape.OBJECT) @JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum QC_INFO_STATUS { public enum QC_INFO_STATUS {
CREATE(1, "建"), CREATE(1, "建"),
FINISH(5, "待处理"), FINISH(5, "待处理"),
FAIL(10, "已完成"), FAIL(10, "已完成"),
CLOSE(90, "已关闭"), CLOSE(90, "已关闭"),

@ -252,4 +252,19 @@ public interface BaseRepository <T, ID extends Serializable> extends JpaReposito
public boolean isExitBySql(String sql); public boolean isExitBySql(String sql);
public double findSumByProperty(String sumPropertyName,String groupByName,String propertyName, Object value);
public double findSumByProperties(String sumPropertyName,String groupByName,String[] paramName,Object[] paramValue);
public double findAvgByProperty(String sumPropertyName,String groupByName,String propertyName, Object value);
public double findAvgByProperties(String sumPropertyName,String groupByName,String[] paramName,Object[] paramValue);
public double findMaxByProperty(String sumPropertyName,String groupByName,String propertyName, Object value);
public double findMaxByProperties(String sumPropertyName,String groupByName,String[] paramName,Object[] paramValue);
public double findMinByProperty(String sumPropertyName,String groupByName,String propertyName, Object value);
public double findMinByProperties(String sumPropertyName,String groupByName,String[] paramName,Object[] paramValue);
} }

@ -1018,4 +1018,100 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
public boolean isExitBySql(String sql) { public boolean isExitBySql(String sql) {
return findBySqlCount(sql) > 0; return findBySqlCount(sql) > 0;
} }
@Override
public double findSumByProperty(String sumPropertyName, String groupByName, String propertyName, Object value) {
return findSumByProperties(sumPropertyName,groupByName,new String[]{propertyName},new Object[]{value});
}
@Override
public double findSumByProperties(String sumPropertyName, String groupByName, String[] paramName, Object[] paramValue) {
if ((paramName != null) && (paramName.length > 0) && (paramValue != null) && (paramValue.length > 0)) {
StringBuffer sb = new StringBuffer("select sum(:"+sumPropertyName+") from " + persistentClass.getName() + " model where 1=1 ");
appendQL(sb,paramName,paramValue);
sb.append(" group by :groupByName");
Query query = entityManager.createQuery(sb.toString());
query.setParameter(":sumPropertyName", sumPropertyName);
setParameter(query,paramName,paramValue);
query.setParameter(":groupByName", groupByName);
Double sumResult = entityManager.createQuery(query.toString(),Double.class).getSingleResult();
return sumResult == null ? 0.0 : sumResult.doubleValue();
}else{
throw new IllegalArgumentException("sum查询错误!paramName:" + paramName + ",paramValue:" + paramValue);
}
}
@Override
public double findAvgByProperty(String sumPropertyName, String groupByName, String propertyName, Object value) {
return findAvgByProperties(sumPropertyName,groupByName,new String[]{propertyName},new Object[]{value});
}
@Override
public double findAvgByProperties(String sumPropertyName, String groupByName, String[] paramName, Object[] paramValue) {
if ((paramName != null) && (paramName.length > 0) && (paramValue != null) && (paramValue.length > 0)) {
StringBuffer sb = new StringBuffer("select avg(:"+sumPropertyName+") from " + persistentClass.getName() + " model where 1=1 ");
appendQL(sb,paramName,paramValue);
sb.append(" group by :groupByName");
Query query = entityManager.createQuery(sb.toString());
query.setParameter(":sumPropertyName", sumPropertyName);
setParameter(query,paramName,paramValue);
query.setParameter(":groupByName", groupByName);
Double sumResult = entityManager.createQuery(query.toString(),Double.class).getSingleResult();
return sumResult == null ? 0.0 : sumResult.doubleValue();
}else{
throw new IllegalArgumentException("sum查询错误!paramName:" + paramName + ",paramValue:" + paramValue);
}
}
@Override
public double findMaxByProperty(String sumPropertyName, String groupByName, String propertyName, Object value) {
return findMaxByProperties(sumPropertyName,groupByName,new String[]{propertyName},new Object[]{value});
}
@Override
public double findMaxByProperties(String sumPropertyName, String groupByName, String[] paramName, Object[] paramValue) {
if ((paramName != null) && (paramName.length > 0) && (paramValue != null) && (paramValue.length > 0)) {
StringBuffer sb = new StringBuffer("select max(:"+sumPropertyName+") from " + persistentClass.getName() + " model where 1=1 ");
appendQL(sb,paramName,paramValue);
sb.append(" group by :groupByName");
Query query = entityManager.createQuery(sb.toString());
query.setParameter(":sumPropertyName", sumPropertyName);
setParameter(query,paramName,paramValue);
query.setParameter(":groupByName", groupByName);
Double sumResult = entityManager.createQuery(query.toString(),Double.class).getSingleResult();
return sumResult == null ? 0.0 : sumResult.doubleValue();
}else{
throw new IllegalArgumentException("sum查询错误!paramName:" + paramName + ",paramValue:" + paramValue);
}
}
@Override
public double findMinByProperty(String sumPropertyName, String groupByName, String propertyName, Object value) {
return findMinByProperties(sumPropertyName,groupByName,new String[]{propertyName},new Object[]{value});
}
@Override
public double findMinByProperties(String sumPropertyName, String groupByName, String[] paramName, Object[] paramValue) {
if ((paramName != null) && (paramName.length > 0) && (paramValue != null) && (paramValue.length > 0)) {
StringBuffer sb = new StringBuffer("select min(:"+sumPropertyName+") from " + persistentClass.getName() + " model where 1=1 ");
appendQL(sb,paramName,paramValue);
sb.append(" group by :groupByName");
Query query = entityManager.createQuery(sb.toString());
query.setParameter(":sumPropertyName", sumPropertyName);
setParameter(query,paramName,paramValue);
query.setParameter(":groupByName", groupByName);
Double sumResult = entityManager.createQuery(query.toString(),Double.class).getSingleResult();
return sumResult == null ? 0.0 : sumResult.doubleValue();
}else{
throw new IllegalArgumentException("sum查询错误!paramName:" + paramName + ",paramValue:" + paramValue);
}
}
} }

@ -16,5 +16,5 @@ public class OptionModel {
private String name; private String name;
private Boolean value; private Integer value;
} }

@ -1,4 +1,4 @@
package cn.estsh.i3plus.pojo.platform.bean; package cn.estsh.i3plus.pojo.platform.platbean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean; import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;

@ -1,4 +1,4 @@
package cn.estsh.i3plus.pojo.platform.bean; package cn.estsh.i3plus.pojo.platform.platbean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean; import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil; import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;

@ -1,4 +1,4 @@
package cn.estsh.i3plus.pojo.platform.bean; package cn.estsh.i3plus.pojo.platform.platbean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean; import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@ -1,7 +1,7 @@
package cn.estsh.i3plus.pojo.platform.repositorymongo; package cn.estsh.i3plus.pojo.platform.platrepositorymongo;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseMongoRepository; import cn.estsh.i3plus.pojo.base.jpa.dao.BaseMongoRepository;
import cn.estsh.i3plus.pojo.platform.bean.SysLogException; import cn.estsh.i3plus.pojo.platform.platbean.SysLogException;
/** /**
* @Description : (使Mongodb) * @Description : (使Mongodb)

@ -1,7 +1,7 @@
package cn.estsh.i3plus.pojo.platform.repositorymongo; package cn.estsh.i3plus.pojo.platform.platrepositorymongo;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseMongoRepository; import cn.estsh.i3plus.pojo.base.jpa.dao.BaseMongoRepository;
import cn.estsh.i3plus.pojo.platform.bean.SysLogOperate; import cn.estsh.i3plus.pojo.platform.platbean.SysLogOperate;
/** /**
* @Description : (使Mongodb) * @Description : (使Mongodb)

@ -1,7 +1,7 @@
package cn.estsh.i3plus.pojo.platform.repositorymongo; package cn.estsh.i3plus.pojo.platform.platrepositorymongo;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseMongoRepository; import cn.estsh.i3plus.pojo.base.jpa.dao.BaseMongoRepository;
import cn.estsh.i3plus.pojo.platform.bean.SysLogSystem; import cn.estsh.i3plus.pojo.platform.platbean.SysLogSystem;
/** /**
* @Description : * @Description :

@ -1,9 +1,9 @@
package cn.estsh.i3plus.pojo.platform.sqlpack; package cn.estsh.i3plus.pojo.platform.sqlpack;
import cn.estsh.i3plus.pojo.base.tool.BsonPackTool; import cn.estsh.i3plus.pojo.base.tool.BsonPackTool;
import cn.estsh.i3plus.pojo.platform.bean.SysLogException; import cn.estsh.i3plus.pojo.platform.platbean.SysLogException;
import cn.estsh.i3plus.pojo.platform.bean.SysLogOperate; import cn.estsh.i3plus.pojo.platform.platbean.SysLogOperate;
import cn.estsh.i3plus.pojo.platform.bean.SysLogSystem; import cn.estsh.i3plus.pojo.platform.platbean.SysLogSystem;
import com.mongodb.BasicDBObject; import com.mongodb.BasicDBObject;
import org.bson.conversions.Bson; import org.bson.conversions.Bson;

@ -27,7 +27,7 @@ import java.util.Map;
public class WmsActionResponseBean<Obj> { public class WmsActionResponseBean<Obj> {
@ApiParam("进度") @ApiParam("进度")
public Double percent; public String percent;
@ApiParam("当前步骤") @ApiParam("当前步骤")
public Integer currentStep; public Integer currentStep;
@ -73,7 +73,7 @@ public class WmsActionResponseBean<Obj> {
this.message = message; this.message = message;
} }
public WmsActionResponseBean(Double percent, String message, List<String> informations, Obj details, Boolean codeStatus) { public WmsActionResponseBean(String percent, String message, List<String> informations, Obj details, Boolean codeStatus) {
this.percent = percent; this.percent = percent;
this.message = message; this.message = message;
this.informations = informations; this.informations = informations;

@ -1,6 +1,7 @@
package cn.estsh.i3plus.pojo.wms.bean; package cn.estsh.i3plus.pojo.wms.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean; import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.model.wms.OptionModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.Data; import lombok.Data;
@ -22,7 +23,7 @@ public class WmsOperationBean extends BaseBean {
public String barCode; public String barCode;
@ApiParam("可选项的值") @ApiParam("可选项的值")
public List<String> options; public List<OptionModel> options;
@ApiParam("设备编号") @ApiParam("设备编号")
public String fixNo; public String fixNo;

@ -42,10 +42,10 @@ public class WmsQCMaster extends BaseBean {
public Integer orderType; public Integer orderType;
/** /**
* :0=,5=,10=,90=,91= * :1=,5=,10=,90=,91=
*/ */
@Column(name="ORDER_STATUS") @Column(name="ORDER_STATUS")
@ApiParam(value = "状态", example = "0") @ApiParam(value = "状态", example = "1")
public Integer orderStatus; public Integer orderStatus;
@Column(name="REMARK") @Column(name="REMARK")

@ -37,10 +37,10 @@ public class WmsQCTrans extends BaseBean {
public String item; public String item;
/** /**
* :0=,10= * :1=,10=
*/ */
@Column(name="ITEM_STATUS") @Column(name="ITEM_STATUS")
@ApiParam(value = "状态", example = "0") @ApiParam(value = "状态", example = "1")
public Integer itemStatus; public Integer itemStatus;
@Column(name="REMARK") @Column(name="REMARK")

@ -832,6 +832,7 @@ public class WmsHqlPack {
HqlPack.getStringEqualPack(wmsMoveMaster.getOrderNo(), "orderNo", result); HqlPack.getStringEqualPack(wmsMoveMaster.getOrderNo(), "orderNo", result);
HqlPack.getNumEqualPack(wmsMoveMaster.getOrderStatus(),"orderStatus",result); HqlPack.getNumEqualPack(wmsMoveMaster.getOrderStatus(),"orderStatus",result);
HqlPack.getStringEqualPack(wmsMoveMaster.getTransTypeCode(), "transTypeCode", result);
getStringBuilderPack(wmsMoveMaster, result); getStringBuilderPack(wmsMoveMaster, result);
return result.toString(); return result.toString();

Loading…
Cancel
Save