Merge branch 'dev' of http://git.estsh.com/i3-IMPP/i3plus-pojo into dev
commit
ada46c9626
@ -0,0 +1,88 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.ptl.sqlpack;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
||||||
|
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
|
||||||
|
import cn.estsh.i3plus.pojo.ptl.bean.PtlPrinterConfigure;
|
||||||
|
import cn.estsh.i3plus.pojo.ptl.bean.PtlPrintingQueue;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.google.common.base.Strings;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : PTL对象封装
|
||||||
|
* @Reference :
|
||||||
|
* @Author : silliter.yuan
|
||||||
|
* @CreateDate : 2020-02-28 10:45
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public class PtlHqlPack {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 封装公用查询参数
|
||||||
|
*
|
||||||
|
* @param bean 实体对象
|
||||||
|
* @param hqlStr 查询语句
|
||||||
|
* @return 封装完成的查询语句
|
||||||
|
*/
|
||||||
|
public static DdlPackBean getStringBuilderPack(BaseBean bean, DdlPackBean hqlStr) {
|
||||||
|
|
||||||
|
// 判断工厂代码是否为空
|
||||||
|
if (StringUtils.isNotBlank(bean.getOrganizeCode())) {
|
||||||
|
DdlPreparedPack.getStringEqualPack(bean.getOrganizeCode(), "organizeCode", hqlStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DdlPreparedPack.getStringEqualPack(bean.getCreateUser(), "createUser", hqlStr);
|
||||||
|
if (StringUtils.isNotBlank(bean.getCreateDateTimeStart()) && StringUtils.isNotBlank(bean.getCreateDateTimeEnd())) {
|
||||||
|
DdlPreparedPack.timeBuilder(bean.getCreateDateTimeStart(), bean.getCreateDateTimeEnd(), "createDatetime", hqlStr, true);
|
||||||
|
}
|
||||||
|
// 封装有效状态、删除状态、创建人和创建时间
|
||||||
|
DdlPreparedPack.getNumEqualPack(bean.getIsValid(), "isValid", hqlStr);
|
||||||
|
DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", hqlStr);
|
||||||
|
|
||||||
|
return hqlStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打印机管理信息分页查询条件
|
||||||
|
*
|
||||||
|
* @param ptlPrinterConfigure
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static DdlPackBean packHqlPtlPrinterConfigure(PtlPrinterConfigure ptlPrinterConfigure) {
|
||||||
|
DdlPackBean result = new DdlPackBean();
|
||||||
|
|
||||||
|
DdlPreparedPack.getStringLikerPack(ptlPrinterConfigure.getPrinterNo(), "printerNo", result);
|
||||||
|
DdlPreparedPack.getStringLikerPack(ptlPrinterConfigure.getIp(), "ip", result);
|
||||||
|
|
||||||
|
getStringBuilderPack(ptlPrinterConfigure, result);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待打印队列信息分页查询条件
|
||||||
|
*
|
||||||
|
* @param ptlPrintingQueue
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static DdlPackBean packHqlPtlPrintingQueueByPrintNo(PtlPrintingQueue ptlPrintingQueue) {
|
||||||
|
DdlPackBean result = new DdlPackBean();
|
||||||
|
|
||||||
|
DdlPreparedPack.getNumEqualPack(WmsEnumUtil.ETC_PRINT_STATUS.NOT_HIT.getValue(), "printStatus", result);
|
||||||
|
DdlPreparedPack.getStringLikerPack(ptlPrintingQueue.getPrintNo(), "printNo", result);
|
||||||
|
DdlPreparedPack.getNumEqualPack(WmsEnumUtil.PRINT_TYPE.SN.getValue(), "printType", result);
|
||||||
|
|
||||||
|
getStringBuilderPack(ptlPrintingQueue, result);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue