package doumeemes.core.utils;
|
|
import com.alibaba.fastjson.JSONObject;
|
import doumeemes.dao.business.model.Plans;
|
import doumeemes.dao.business.model.WorkPlans;
|
import doumeemes.dao.ext.vo.CompanyExtListVO;
|
import doumeemes.dao.ext.vo.WorkorderExtListVO;
|
import jdk.nashorn.internal.ir.LexicalContext;
|
import org.apache.commons.lang3.StringUtils;
|
|
import java.math.BigDecimal;
|
import java.text.DecimalFormat;
|
|
public class Constants {
|
|
|
public static final String LINGYANG_USERNUM_LIMIT = "LINGYANG_USERNUM_LIMIT";
|
// public static String REDIS_VERSION="alks_";
|
public static String REDIS_VERSION="dm_";
|
public static final int ZERO = 0 ;
|
public static final int ONE = 1 ;
|
public static final int TWO = 2 ;
|
public static final int THREE = 3 ;
|
|
public static final String WORKORDER_SOURCE ="WORKORDER_SOURCE";
|
public static final String WORKORDER_SOURCE_PLAN="WORKORDER_SOURCE_PLAN";
|
public static final String WORKORDER_SOURCE_MANUAL="WORKORDER_SOURCE_MANUAL";
|
public static final String ACCESS_ID="ACCESS_ID";
|
public static final String BUCKETNAME = "BUCKETNAME";
|
public static final String OSS = "OSS";
|
public static final String WX_CONFIG = "WX_CONFIG";
|
public static final String APPID = "APPID";
|
public static final String APPSECRET = "APPSECRET";
|
public static final String MINIAPPID = "MINIAPPID";
|
public static final String MINIAPPSECRET = "MINIAPPSECRET";
|
public static final String WX_TOKEN = "WX_TOKEN";
|
|
|
public static final String OPENID_WX = "wx_";
|
public static final String OPENID_MINI = "mini_";
|
|
public static final String ACCESS_KEY = "ACCESS_KEY";
|
public static final String ENDPOINT = "ENDPOINT";
|
public static final String RESOURCE_PATH = "RESOURCE_PATH";
|
public static final String DEFAULT = "DEFAULT";
|
public static final String USER_PWD = "USER_PWD";
|
public static final String MENU_IMG ="MENU_IMG" ;
|
public static final String ROUTE_CONFIG ="ROUTE_CONFIG" ;
|
// public static final String OUT_TYPE_URL = "OUT_TYPE";
|
// public static final String IN_TYPE_URL = "IN_TYPE";
|
// public static final String WOUT_IN_URL = "WOUT_IN_URL";
|
// public static final String WOUT_OUT_URL = "WOUT_OUT_URL";
|
// public static final String FINISH_TYPE_URL = "FINISH_TYPE";
|
public static final String SYSTEM_APPLIANCE_TYPE ="SYSTEM_APPLIANCE_TYPE" ;
|
public static final String TEMPL_NAME_RUE = "instance_tmp_${type}_#{factotyId}";
|
public static final String LINGYANG_PARAM = "LINGYANG_PARAM";
|
public static final String LINGYANG_AESKEY = "LINGYANG_AESKEY";
|
public static final String LINGYANG_APPKEY = "LINGYANG_APPKEY";
|
public static final String LINGYANG_SECRET = "LINGYANG_SECRET";
|
public static final String LINGYANG_DEMO_USER = "LINGYANG_DEMO_USER";
|
public static final String COMPANY_FILE_PATH = "COMPANY_FILE_PATH";
|
|
public static final String EDGP_PARAM = "EDGP_PARAM";
|
public static final String EDGP_AESKEY = "EDGP_AESKEY";
|
public static final String EDGP_APPKEY = "EDGP_APPKEY";
|
public static final String EDGP_SECRET = "EDGP_SECRET";
|
public static final String EDGP_SERVER_URL = "EDGP_SERVER_URL";
|
public static final String LINGYANG_DEMO_COMPANY ="LINGYANG_DEMO_COMPANY" ;
|
public static final String EDGP_DEMO_COMPANY = "EDGP_DEMO_COMPANY";
|
public static final String EDGP_DEMO_USER = "EDGP_DEMO_USER";
|
public static final String EDGP_ACCESSTOKEN ="EDGP_ACCESSTOKEN" ;
|
public static final String SYSTEM_URL ="SYSTEM_URL" ;
|
|
/**
|
* 获取企业钉钉信息
|
* @param company
|
* @param key
|
* @return
|
*/
|
public static String getNoticeUrl(CompanyExtListVO company, String key) {
|
try {
|
String ddInfo = company.getDingdingInfo();
|
JSONObject j = JSONObject.parseObject(ddInfo);
|
return j.getString(key);
|
}catch (Exception e){
|
|
}
|
return null;
|
|
}
|
|
public interface DINGDING_NOTICE_URL {
|
String in = "in_type";
|
String out = "out_type";
|
String finish = "finish_type";
|
String woutOut = "wout_out_url";
|
String woutIn = "wout_in_url";
|
}
|
//数据来源 0认证数据1OCR数据2手工输入 3羚羊平台 4EDGP平台
|
public interface COMPANY_ORIGIN {
|
int auth = 0;
|
int ocr = 1;
|
int plat = 2;
|
int lingyang = 3;
|
int edgp = 4;
|
}
|
public interface USER_LOGIN_ORIGIN {
|
int pc = 0;
|
int dingding = 1;
|
int lingyang = 2;
|
int edgp = 3;
|
}
|
|
/**
|
* mq tag
|
*/
|
public interface MQ_TAG{
|
public static final String statistics = "statistics";
|
}
|
/**
|
* bom物料生产投料方式 0推式 1拉式
|
*/
|
public interface BOM_TYPE{
|
public static final int push = 0;
|
public static final int pull = 1;
|
}
|
|
public interface RELOBJ_TYPE{
|
public static final int workorder = 0;
|
public static final int change = 1;
|
}
|
/**
|
* 统计数量,key信息
|
*/
|
public interface STATISTIC{
|
public static final String distribute = "distribute";
|
public static final String unqulified = "unqulified";
|
public static final String qulified = "qulified";
|
public static final String done = "done";
|
public static final String distributeNoDone = "distributeNoDone";
|
}
|
/**
|
* 检验类型 0巡线、1巡检、2终检
|
*/
|
public interface WORKORDER_CHECKTYPE{
|
public static final int line = 0;
|
public static final int check = 1;
|
public static final int done = 2;
|
}
|
/**
|
* 通知类型 0车间领料-待发货
|
* 1车间领料-待入库
|
* 2机台备料-待发货
|
* 3机台备料-待入库
|
* 4完工入库-待接收
|
* 5库存转库-待发货
|
* 6库存转库-待入库
|
* 7申请审批
|
* 8客退/返品回厂检验
|
*/
|
public interface NOTICE_TYPE{
|
public static final int materialSend = 0;
|
public static final int materialStock = 1;
|
public static final int readySend = 2;
|
public static final int readyStock = 3;
|
public static final int doneRecieve = 4;
|
public static final int transferSend = 5;
|
public static final int transferStock = 6;
|
public static final int applyTask = 7;
|
public static final int backCheck = 8;
|
}
|
/**
|
* 集计划来源 0人工创建、1Excel导入、2计划程序生成
|
*/
|
public interface PLAS_ORIGIN{
|
public static final int user = 0;
|
public static final int imports = 1;
|
public static final int auto = 2;
|
}
|
/**
|
* 出入库单据状态 0已生成、1已处理、2已取消
|
*/
|
public interface WOUTBOUND_STATUS{
|
public static final int create = 0;
|
public static final int dealed = 1;
|
public static final int cancel = 2;
|
}
|
|
|
/**
|
* 车间领料 - 1
|
* 机台备料 - 2
|
* 计划领料 - 3
|
* 完工入库 - 4
|
* 车间转库 - 5
|
* 外协领料转库 - 6
|
* 外协完工转库 - 7
|
* 成品入库 - 8
|
* 成品转库 - 9
|
* 让步放行入库 - 10
|
* 让步放行转库 - 11
|
* 客返品返修领料 -12
|
* 客返品返修入库 -13
|
* 跨组织转库 -14
|
* 工序报废 -15
|
* 客退品返修领料 - 16
|
* 客退品返修入库 - 17
|
* 销售出库 - 18
|
* 让步销售 - 19
|
* 工单投料 - 20
|
* 仓库报废 - 21
|
* 客退品检验领料 - 22
|
* 客返品检验领料 - 23
|
* 工单产出 - 24
|
* 采购入库 - 25
|
* 客退品检验入库 - 26
|
* 客返品检验入库 - 27
|
* 库存调整 - 28
|
*/
|
public interface WOUTBOUND_BILLTYPE{
|
public static final int workshopIn = 1;
|
public static final int finish = 4;
|
public static final int workerOrderOut = 20;
|
public static final int workerOrderIn = 24;
|
}
|
|
|
/**
|
* 出入库类型 0出库单 1入库单
|
*/
|
public interface WOUTBOUND_TYPE{
|
public static final int in = 1;
|
public static final int out = 0;
|
}
|
/**
|
* 工装器具位置类型 0仓库1.车间
|
*/
|
public interface APPLIANCES_POSITION{
|
public static final int warehouse = 0;
|
public static final int workshop = 1;
|
}
|
|
/**
|
* 工装器具状态 0.合格 1不良 2报废 3混合
|
*/
|
public interface APPLIANCES_TYPE_LABLE{
|
public static final String qualified = "APPLIANCE_ONTEST";
|
public static final String rejects = "APPLIANCE_OFFTEST";
|
public static final String scrap= "APPLIANCE_USELESS";
|
public static final String mix = "APPLIANCE_MIX";
|
}
|
/**
|
* 工装器具状态 0.报废、1.空、2.部分、3.满
|
*/
|
public interface APPLIANCES_STATUS{
|
public static final int scrap = 0;
|
public static final int empty = 1;
|
public static final int part = 2;
|
public static final int full = 3;
|
}
|
/**
|
* 工单类型(0正常、1异常、2返工返修)
|
*/
|
public interface WORKORDER_TYPE{
|
public static final int normal = 0;
|
public static final int unnormal = 1;
|
public static final int repair = 2;
|
}
|
/**
|
* 工单状态 0已创建、1已备料、2已完工、3已检验、4已报工、5已入库、6已取消"
|
*/
|
public interface WORKORDER_STATUS{
|
public static final int create = 0;
|
public static final int material = 1;
|
public static final int done = 2;
|
public static final int check = 3;
|
public static final int baogong= 4;
|
public static final int instock = 5;
|
public static final int cancel = 6;
|
public static final int producing = 7;
|
static String getTitleByStatus(WorkorderExtListVO p, int status) {
|
String title = "";
|
switch (status){
|
case create:
|
title="创建工单";
|
break;
|
case material:
|
title="工单已备料";
|
break;
|
case done:
|
title="工单完工检";
|
break;
|
case check:
|
title="工单已检验";
|
break;
|
case baogong:
|
title="工单报工";
|
break;
|
case instock:
|
title="工单已入库";
|
break;
|
case cancel:
|
title="工单取消";
|
break;
|
case producing:
|
title="工单生产中";
|
break;
|
default:
|
break;
|
}
|
return title;
|
}
|
static String getInfoByStatus(WorkorderExtListVO p, int status) {
|
String title = "";
|
switch (status){
|
case create:
|
title="创建工单";
|
break;
|
case material:
|
title="工单已备料";
|
break;
|
case done:
|
title="工单完工";
|
break;
|
case check:
|
title="工单已检验";
|
break;
|
case baogong:
|
title="工单已报工";
|
break;
|
case instock:
|
title="工单已入库";
|
break;
|
case cancel:
|
title="工单取消";
|
break;
|
case producing:
|
title="工单生产中";
|
break;
|
default:
|
break;
|
}
|
return title;
|
}
|
}
|
/**
|
* 返工审批状态 0待审批 1审批通过 2审批未通过 3审批终止
|
*/
|
public interface BACKORDER_STATUS{
|
public static final int ing = 0;
|
public static final int yes = 1;
|
public static final int no = 2;
|
public static final int stop = 3;
|
}
|
|
//产品质量属性 0合格 1不良 2报废
|
/* public interface QUALITY_TYPE{
|
public static final int qualified = 0;
|
public static final int rejects = 1;
|
public static final int scrap = 2;
|
}*/
|
/**
|
* mq tag
|
*/
|
public interface QUALITIY_TYPE{
|
public static final int normal = 0;
|
public static final int unqulified = 1;
|
public static final int scrap = 2;
|
}
|
/**
|
* 返工类型 0不良返工 1客退 2客返 3报废申请
|
*/
|
public interface BACKORDER_TYPE{
|
public static final int unqualified = 0;
|
public static final int customer_return = 1;
|
public static final int customer_back = 2;
|
public static final int scrap = 3;
|
static String getTitleByType(int type) {
|
String title = "";
|
switch (type){
|
case unqualified:
|
title="工序返工申请";
|
break;
|
case customer_return:
|
title="客退返修申请";
|
break;
|
case customer_back:
|
title="客返返修申请";
|
break;
|
case scrap:
|
title="报废申请";
|
break;
|
default:
|
break;
|
}
|
return title;
|
}
|
}
|
/**
|
* 工单状态 0已创建、1已投料、2已完工、3已检验、4已报工、5已入库、6已暂停、7已取消、8已关闭 9已恢复 10更换人员 11 已备料 12 产出 13生成中"
|
*/
|
public interface WORKORDER_HISTORY_STATUS{
|
public static final int create = 0;
|
public static final int material = 1;
|
public static final int done = 2;
|
public static final int check = 3;
|
public static final int baogong= 4;
|
public static final int instock = 5;
|
public static final int pause = 6;
|
public static final int cancel = 7;
|
public static final int close = 8;
|
public static final int reagain = 9;
|
public static final int redistribute = 10;
|
public static final int readyMaterial = 11;
|
public static final int produce = 12;
|
public static final int producing = 13;
|
static String getTitleByStatus(WorkorderExtListVO p, int status) {
|
String title = "";
|
switch (status){
|
case create:
|
title="创建工单";
|
break;
|
case material:
|
title="工单已投料";
|
break;
|
case done:
|
title="工单完工";
|
break;
|
case check:
|
title="工单已检验";
|
break;
|
case baogong:
|
title="工单报工";
|
break;
|
case instock:
|
title="工单已入库";
|
break;
|
case pause:
|
title="工单暂停";
|
break;
|
case cancel:
|
title="工单取消";
|
break;
|
case close:
|
title="工单关闭";
|
break;
|
case reagain:
|
title="工单恢复";
|
break;
|
case redistribute:
|
title="工单重新分配";
|
break;
|
case readyMaterial:
|
title="工单已备料";
|
break;
|
case produce:
|
title="工单产出";
|
break;
|
case producing:
|
title="工单生成中国";
|
break;
|
default:
|
break;
|
}
|
return title;
|
}
|
static String getInfoByStatus(WorkorderExtListVO p, int status) {
|
String title = "";
|
switch (status){
|
case create:
|
title="创建工单";
|
break;
|
case material:
|
title="工单已领料";
|
break;
|
case done:
|
title="工单完工";
|
break;
|
case check:
|
title="工单已检验";
|
break;
|
case baogong:
|
title="工单已报工";
|
break;
|
case instock:
|
title="工单已入库";
|
break;
|
case pause:
|
title="工单暂停";
|
break;
|
case cancel:
|
title="工单取消";
|
break;
|
case close:
|
title="工单关闭";
|
break;
|
case reagain:
|
title="工单恢复";
|
break;
|
case redistribute:
|
title="工单重新分配";
|
break;
|
case readyMaterial:
|
title="工单已备料";
|
break;
|
case produce:
|
title="工单产出";
|
break;
|
case producing:
|
title="工单生产中";
|
break;
|
default:
|
break;
|
}
|
return title;
|
}
|
}
|
/**
|
* 计划历史 操作类型 0创建 1发布 2撤回 3取消 4分配 5暂停 6完工 7入库 8关闭 9恢复
|
*/
|
public interface PLANHISTORY_TYPE{
|
public static final int create = 0;
|
public static final int publish = 1;
|
public static final int back = 2;
|
public static final int cancel = 3;
|
public static final int distribute= 4;
|
public static final int pause = 5;
|
public static final int done = 6;
|
public static final int instock = 7;
|
public static final int close = 8;
|
public static final int reagain = 9;
|
public static final int delete = 10;
|
static String getTitleByStatus(Plans p, int status) {
|
String title = "";
|
switch (status){
|
case create:
|
title="创建计划";
|
break;
|
case publish:
|
title="发布计划";
|
break;
|
case back:
|
title="撤回计划";
|
break;
|
case cancel:
|
title="取消计划";
|
break;
|
case distribute:
|
title="分配计划";
|
break;
|
case pause:
|
title="暂停计划";
|
break;
|
case done:
|
title="计划已完成";
|
break;
|
case instock:
|
title="产品已入库";
|
break;
|
case close:
|
title="关闭计划";
|
break;
|
case reagain:
|
title="计划恢复";
|
break;
|
case delete:
|
title="计划删除";
|
break;
|
default:
|
break;
|
}
|
return title;
|
}
|
static String getInfoByStatus(Plans p, int status) {
|
String title = "";
|
switch (status){
|
case create:
|
title="创建计划";
|
break;
|
case publish:
|
title="发布计划";
|
break;
|
case back:
|
title="撤回计划";
|
break;
|
case cancel:
|
title="取消计划";
|
break;
|
case distribute:
|
title="分配计划";
|
break;
|
case pause:
|
title="暂停计划";
|
break;
|
case done:
|
title="计划已完成";
|
break;
|
case instock:
|
title="产品已入库";
|
break;
|
case close:
|
title="关闭计划";
|
break;
|
case reagain:
|
title="计划恢复";
|
break;
|
case delete:
|
title="计划删除";
|
break;
|
default:
|
break;
|
}
|
return title;
|
}
|
}
|
|
|
|
public interface WORKPLANHISTORY_TYPE{
|
public static final int create = 0;
|
public static final int publish = 1;
|
public static final int back = 2;
|
public static final int cancel = 3;
|
public static final int distribute= 4;
|
public static final int pause = 5;
|
public static final int done = 6;
|
public static final int instock = 7;
|
public static final int close = 8;
|
public static final int reagain = 9;
|
public static final int delete = 10;
|
static String getTitleByStatus(WorkPlans p, int status) {
|
String title = "";
|
switch (status){
|
case create:
|
title="创建计划";
|
break;
|
case publish:
|
title="发布计划";
|
break;
|
case back:
|
title="撤回计划";
|
break;
|
case cancel:
|
title="取消计划";
|
break;
|
case distribute:
|
title="分配计划";
|
break;
|
case pause:
|
title="暂停计划";
|
break;
|
case done:
|
title="计划已完成";
|
break;
|
case instock:
|
title="产品已入库";
|
break;
|
case close:
|
title="关闭计划";
|
break;
|
case reagain:
|
title="计划恢复";
|
break;
|
case delete:
|
title="计划删除";
|
break;
|
default:
|
break;
|
}
|
return title;
|
}
|
static String getInfoByStatus(WorkPlans p, int status) {
|
String title = "";
|
switch (status){
|
case create:
|
title="创建计划";
|
break;
|
case publish:
|
title="发布计划";
|
break;
|
case back:
|
title="撤回计划";
|
break;
|
case cancel:
|
title="取消计划";
|
break;
|
case distribute:
|
title="分配计划";
|
break;
|
case pause:
|
title="暂停计划";
|
break;
|
case done:
|
title="计划已完成";
|
break;
|
case instock:
|
title="产品已入库";
|
break;
|
case close:
|
title="关闭计划";
|
break;
|
case reagain:
|
title="计划恢复";
|
break;
|
case delete:
|
title="计划删除";
|
break;
|
default:
|
break;
|
}
|
return title;
|
}
|
}
|
|
|
/**
|
* 计划状态 0已生成、1已发布、2已撤回、3已取消、4已分配、5已暂停、6已完工、7已入库、8已关闭
|
*/
|
public interface PLAN_STATUS{
|
public static final int create = 0;
|
public static final int publish = 1;
|
public static final int back = 2;
|
public static final int cancel = 3;
|
public static final int distribute= 4;
|
public static final int pause = 5;
|
public static final int done = 6;
|
public static final int instock = 7;
|
public static final int close = 8;
|
|
}
|
/**
|
* 计划类型 0正常 1异常 2返工
|
*/
|
public interface PLAN_TYPE{
|
public static final int normal = 0;
|
public static final int unnormal = 1;
|
public static final int back = 2;
|
}
|
/**
|
* 工单记录类型 0投料 1产出
|
*/
|
public interface WORKORDER_RECORD_TYPE{
|
public static final int materail = 0;
|
public static final int produce = 1;
|
}
|
/**
|
* 权限类型 0全部 1所属部门及下属部门 2所属部门及其子部门 3仅所属部门
|
*/
|
public interface DATAPERMISSION_TYPE{
|
public static final int all = 0;
|
public static final int departAndChild = 1;
|
public static final int departAndLeaf = 2;
|
public static final int depart = 3;
|
public static final int custom = 4;
|
public static final int self = -1;
|
}
|
/**
|
* 组织类型 0公司 1工厂 2部门 3班组 4平台组织
|
*/
|
public interface DEPART_TYPE{
|
public static final int com = 0;
|
public static final int factory = 1;
|
public static final int depart = 2;
|
public static final int group = 3;
|
public static final int plat = 4;
|
}
|
/**
|
* 角色类型 0平台角色 1企业默认角色 2企业自定义角色
|
*/
|
public interface ROLETYPE{
|
public static final int plat = 0;
|
public static final int com_def = 1;
|
public static final int com = 2;
|
}
|
public interface PlatType{
|
public static final int admin = 0;
|
public static final int company = 1;
|
public static final int companyH5 =2 ;
|
}
|
|
/**
|
* Redis存储数据key值
|
*/
|
public interface RedisKeys {
|
public static final String PLAT_DEPART_TREE_KEY = REDIS_VERSION+"plattree_";
|
public static final String COM_DEPART_TREE_KEY = REDIS_VERSION+"cdtree_";
|
public static final String COM_DEPART_LIST_KEY = REDIS_VERSION+"cdlist_";
|
public static final String COM_OUTBOUND_IN_KEY = REDIS_VERSION+"obin_";
|
public static final String COM_WORK_PLAN_KEY =REDIS_VERSION+ "workplan_";
|
public static final String COM_OUTBOUND_OUT_KEY = REDIS_VERSION+"obout_";
|
public static final String COM_TRANSFER_KEY =REDIS_VERSION+ "transfer_";
|
public static final String COM_PLANS_CODE_KEY = REDIS_VERSION+"pcode_";
|
public static final String COM_CHECK_CODE_KEY = REDIS_VERSION+"ccode_";
|
public static final String COM_APPLIANCECHANGER_CODE_KEY = REDIS_VERSION+"acode_";
|
public static final String COM_WORKORDER_CODE_KEY = REDIS_VERSION+"wcode_";
|
public static final String COM_BACKORDER_CODE_KEY = REDIS_VERSION+"wback_";
|
public static final String COM_PLAN_BATCH_KEY = REDIS_VERSION+"wpbatch_";
|
public static final String COM_INFO_KEY =REDIS_VERSION+ "ci_";
|
public static final String COM_BARCODE_KEY = REDIS_VERSION+"bc_";
|
public static final String COM_PROCEDURE_KEY =REDIS_VERSION+ "procedure_";
|
public static final String COM_DINGDING_TOKEN = REDIS_VERSION+"ddtoken_";
|
public static final String COM_DINGDING_JSAPITIKCKT= REDIS_VERSION+"ddticket_";
|
public static final String COM_CATEGORY_KEY=REDIS_VERSION+ "cate_";
|
public static final String COM_WOUTBOUND_WTRANSFER_KEY= REDIS_VERSION+"transfer_woutbound_";
|
public static final String COM_WOUTBOUND_KEY= REDIS_VERSION+"woutbound_";
|
public static final String COM_ENDCHECK_KEY = REDIS_VERSION+"endcheck_";
|
public static final String COM_DEVICE_CHECK_KEY = REDIS_VERSION+"devicecheck_";
|
|
public static final String COM_WAREHOUSE_CHECK_KEY = REDIS_VERSION+"warehouse_";
|
public static final String COM_LOCATION_CHECK_KEY = REDIS_VERSION+"location_";
|
public static final String COM_DEVIECE_CHECK_KEY = REDIS_VERSION+"device_";
|
public static final String COM_MATERIAL_CHECK_KEY = REDIS_VERSION+"material_";
|
public static final String COM_CATEGORY_CHECK_KEY = REDIS_VERSION+"category_";
|
public static final String COM_PROCEDURES_CHECK_KEY = REDIS_VERSION+"procedures_";
|
public static final String COM_ROUTE_CHECK_KEY = REDIS_VERSION+"route_";
|
|
}
|
/**
|
* 前缀类型类型0物料、1仓库、2货位、3工单、4篮筐(工装器具)、5设备、6员工、7转库单、8、出库单、9、入库单
|
*/
|
public interface BARCODEPARAM_TYPE {
|
public static final int material = 0;
|
public static final int warehouse = 1;
|
public static final int localtion = 2;
|
public static final int workorder = 3;
|
public static final int appliance = 4;
|
public static final int device = 5;
|
public static final int user = 6;
|
public static final int transfer = 7;
|
public static final int out = 8;
|
public static final int in = 9;
|
}
|
/**
|
* 用户类型
|
*/
|
public interface USERTYPE {
|
public static final int PLAT =0;
|
public static final int COM =1;
|
}
|
|
/**
|
* 消息队列TOPIC类型
|
*/
|
public interface MqTopicKeys {
|
public static final String TOPIC_TEST = "cl_test";
|
public static final String TOPIC_STATISTIC_NUM = "cl_statistic_num";
|
public static final String MQ_TOPIC = "cl_mq_topic";
|
}
|
public interface RabbitMqQueue{
|
public static final String TEST = "queue_topic1";
|
public static final String QUEUE_STATISTIC = "queue_statistic_topic";
|
}
|
|
|
/**
|
* 出入库单据 来源单据类型 0采购订单、1生产工单、2销售订单、3转库单、4盘点单
|
*/
|
public interface WOUTBOUND_ORIGIN_TYPE{
|
public static final int purchase = 0;
|
public static final int produce = 1;
|
public static final int sale = 2;
|
public static final int transfer = 3;
|
public static final int stocktaking = 4;
|
}
|
|
|
// 0车间领料-待发货 1车间领料-待入库 2机台备料-待发货 3机台备料-待入库 4完工入库-待接收 5库存转库-待发货 6库存转库-待入库 7申请审批 8客退/返品回厂检验
|
public enum Notices_Type{
|
workShopOut("车间领料-待发货", 0, "需要您进行出库操作,请及时前往处理",""), //"车间领料-待发货"
|
workShopIn("车间领料-待入库", 1, "需要您进行入库操作,请及时前往处理",""), //车间领料-待入库
|
transferWaitOut("机台备料-待发货", 2, "需要您进行备料出库操作,请及时前往处理",""), //机台备料-待发货
|
transferWaitIn("机台备料-待入库", 3, "需要您进行备料接收操作,请及时前往处理",""), //机台备料-待入库
|
finishIn("完工入库-待接收", 4, "需要您进行完工交接入库操作,请及时前往处理",""), //完工入库-待接收
|
wStockTransferOut("库存转库-待发货", 5, "需要您进行出库操作,请及时前往处理",""), //库存转库-待发货
|
wStockTransferIn("库存转库-待入库", 6, "需要您进行入库操作,请及时前往处理",""), //库存转库-待入库
|
applicationApproval("", 7, "",""),
|
backInspect("", 8, "","");
|
|
String title;
|
int type;
|
String content;
|
String url;
|
|
Notices_Type(String title, int type ,String content,String url) {
|
this.title = title;
|
this.type = type;
|
this.content = content;
|
this.url = content;
|
}
|
|
public String getTitle() {
|
return title;
|
}
|
public int getType() {
|
return type;
|
}
|
public String getContent() {
|
return content;
|
}
|
public String getUrl() {
|
return url;
|
}
|
|
|
public static Notices_Type checkEnum(Integer number){
|
for (Notices_Type noticesType:Notices_Type.values()) {
|
if(noticesType.getType() == number){
|
return noticesType;
|
}
|
}
|
return null;
|
}
|
}
|
|
public enum Notices_Type_Transfer{
|
title1("车间领料", "需要您进行{optType}操作,请及时前往处理",1 ,0,1),
|
title2("计划领料", "需要您进行{optType}操作,请及时前往处理",2 ,0,1),
|
title3("机台备料", "需要您进行备料{optType}操作,请及时前往处理",3 ,2,3),
|
title4("完工入库", "需要您进行完工交接{optType}操作,请及时前往处理",4 ,0,4),
|
title5("车间转库", "需要您进行{optType}操作,请及时前往处理",5,0,1),
|
title6("外协领料转库", "需要您进行{optType}操作,请及时前往处理",6,0,1),
|
title7("外协完工转库","需要您进行{optType}操作,请及时前往处理", 7,0,1),
|
title8("成品入库", "需要您进行{optType}操作,请及时前往处理",8,0,1),
|
title9("成品转库", "需要您进行{optType}操作,请及时前往处理",9,0,1),
|
title10("让步放行", "需要您进行{optType}操作,请及时前往处理",10,0,1),
|
title11("让步放行转库", "需要您进行{optType}操作,请及时前往处理",11,0,1),
|
title12("客返品返修领料", "需要您进行{optType}操作,请及时前往处理",12,0,1),
|
title13("客返品返修入库", "需要您进行{optType}操作,请及时前往处理",13,0,1),
|
title14("跨组织转库", "需要您进行{optType}操作,请及时前往处理",14,0,1),
|
title15("工序报废", "需要您进行{optType}操作,请及时前往处理",15,0,1),
|
title16("客退品返修领料", "需要您进行{optType}操作,请及时前往处理",16,0,1),
|
title17("客退品返修入库", "需要您进行{optType}操作,请及时前往处理",17,0,1),
|
title21("仓库报废", "需要您进行{optType}操作,请及时前往处理",21,8,1),
|
title22("客退检验领料", "需要您进行{optType}操作,请及时前往处理",22,8,1),
|
title23("客返检验领料", "需要您进行{optType}操作,请及时前往处理",23,8,1),
|
title28("库存调整", "需要您进行{optType}操作,请及时前往处理",28,8,9),
|
title30("废品入库", "需要您进行{optType}操作,请及时前往处理",30,0,1);
|
String title;
|
String content;
|
int type;
|
int noticeOutType;
|
int noticeInType;
|
|
Notices_Type_Transfer(String title, String content ,int type ,int noticeOutType,int noticeInType) {
|
this.title = title;
|
this.content = content;
|
this.type = type;
|
this.noticeOutType = noticeOutType;
|
this.noticeInType = noticeInType;
|
}
|
|
public String getTitle() {
|
return title;
|
}
|
public String getContent() {
|
return content;
|
}
|
public int getType() {
|
return type;
|
}
|
public int getNoticeOutType() {
|
return noticeOutType;
|
}
|
public int getNoticeInType() {
|
return noticeInType;
|
}
|
|
|
public static Notices_Type_Transfer checkEnum(Integer number){
|
for (Notices_Type_Transfer notices_type_transfer:Notices_Type_Transfer.values()) {
|
if(notices_type_transfer.getType() == number){
|
return notices_type_transfer;
|
}
|
}
|
return null;
|
}
|
}
|
|
|
public static Double formatDouble2Num(Double balance) {
|
if (balance == null) {
|
return 0d;
|
}
|
try {
|
double temp = (new BigDecimal(balance).setScale(2, BigDecimal.ROUND_HALF_UP)).doubleValue();
|
return temp;
|
} catch (Exception e) {
|
return 0.0;
|
}
|
}
|
|
public static double add(Double v1, Double v2) {
|
if (v1 == null) {
|
v1 = 0d;
|
}
|
if (v2 == null) {
|
v2 = 0d;
|
}
|
BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
return b1.add(b2).doubleValue();
|
}
|
|
/**
|
* 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 定精度,以后的数字四舍五入。
|
*
|
* @param v1 被除数
|
* @param v2 除数
|
* @param scale 表示表示需要精确到小数点以后几位。
|
* @return 两个参数的商
|
*/
|
public static double div(Double v1, Double v2, Integer scale) {
|
if (v1 == null) {
|
v1 = 0d;
|
}
|
if (v2 == null) {
|
v2 = 0d;
|
}
|
if (scale == null) {
|
scale = 0;
|
}
|
if (v2 == 0) {
|
throw new IllegalArgumentException("除数不能为0");
|
}
|
if (scale < 0) {
|
throw new IllegalArgumentException("精确度必须为0或者正整数");
|
}
|
BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
return b1.divide(b2, scale, BigDecimal.ROUND_HALF_UP).doubleValue();
|
}
|
|
|
public static int formatIntegerNum(Integer d) {
|
if (d == null) {
|
d = 0;
|
}
|
return d.intValue();
|
}
|
|
/**
|
* 质量属性和字典属性类型对应关系
|
* (1)合格:APPLIANCE_ONTEST; 对应可以放入的质量属性 0合格
|
* (2)不良:APPLIANCE_OFFTEST;对应可以放入的质量属性 1不良
|
* (3)报废:APPLIANCE_USELESS;对应可以放入的质量属性 2报废
|
* @param qualityType
|
* @param dicCode
|
* @return
|
*/
|
public static boolean isQualityTypeValid(Integer qualityType,String dicCode) {
|
if(Constants.equalsInteger(qualityType, QUALITIY_TYPE.unqulified)){
|
//如果是不良
|
if(StringUtils.equals(dicCode,APPLIANCES_TYPE_LABLE.rejects)){
|
return true;
|
}
|
}else if(Constants.equalsInteger(qualityType, QUALITIY_TYPE.scrap)){
|
//如果是报废
|
if(StringUtils.equals(dicCode,APPLIANCES_TYPE_LABLE.scrap)){
|
return true;
|
}
|
}else if(Constants.equalsInteger(qualityType, QUALITIY_TYPE.normal)){
|
//如果是合格
|
if(StringUtils.equals(dicCode,APPLIANCES_TYPE_LABLE.qualified)){
|
return true;
|
}
|
}
|
return false;
|
}
|
public static BigDecimal formatBigdecimal(BigDecimal d) {
|
if (d == null) {
|
d = new BigDecimal(0.0);
|
}
|
//保留两位小数且四舍五入
|
// d = d.setScale(2, BigDecimal.ROUND_HALF_UP);
|
return d;
|
}
|
public static BigDecimal formatBigdecimal4Float(BigDecimal d) {
|
if (d == null) {
|
d = new BigDecimal(0.0);
|
}
|
//保留两位小数且四舍五入
|
d = d.setScale(4, BigDecimal.ROUND_HALF_UP);
|
return d;
|
}
|
public static BigDecimal formatBigdecimalFloat(BigDecimal d,int scale) {
|
if (d == null) {
|
d = new BigDecimal(0.0);
|
}
|
//保留两位小数且四舍五入
|
d = d.setScale(scale, BigDecimal.ROUND_HALF_UP);
|
return d;
|
}
|
public static String formatCodeStr(String code) {
|
if (code == null) {
|
return "";
|
}
|
DecimalFormat df = new DecimalFormat("0000");
|
int c = 0;
|
try{
|
c= Integer.parseInt(code);
|
}catch (Exception e){
|
|
}
|
return df.format(c);
|
}
|
|
|
public static boolean equalsInteger(Integer a, Integer b) {
|
if (formatIntegerNum(a) == formatIntegerNum(b)) {
|
return true;
|
}
|
return false;
|
}
|
|
|
public enum wareHouse_QualityType{
|
onTest("APPLIANCE_ONTEST", 0),
|
offTest("APPLIANCE_OFFTEST", 1),
|
useLess("APPLIANCE_USELESS", 2),
|
mix("APPLIANCE_MIX", 3);
|
|
String code;
|
Integer type;
|
|
wareHouse_QualityType(String code, int type) {
|
this.code = code;
|
this.type = type;
|
}
|
|
public String getCode() {
|
return code;
|
}
|
public Integer getType() {
|
return type;
|
}
|
|
public static wareHouse_QualityType checkEnum(String code){
|
for (wareHouse_QualityType wareHouseQualityType:wareHouse_QualityType.values()) {
|
if(wareHouseQualityType.getCode().equals(code)){
|
return wareHouseQualityType;
|
}
|
}
|
return null;
|
}
|
}
|
|
public enum CompanyUpdateType{
|
|
UPDATE_ENABLE((byte)1,"启动"),
|
UPDATE_DISABLE((byte)2,"禁用"),
|
UPDATE_VAIL_DATE((byte)3,"调整有效期"),
|
UPDATE_CONTENT((byte)4,"数据内容调整-编辑")
|
;
|
|
|
private Byte key;
|
|
private String desc;
|
|
private String info;
|
|
CompanyUpdateType(Byte key, String desc) {
|
this.key = key;
|
this.desc = desc;
|
|
}
|
|
public Byte getKey() {
|
return key;
|
}
|
|
public void setKey(Byte key) {
|
this.key = key;
|
}
|
|
public String getDesc() {
|
return desc;
|
}
|
|
public void setDesc(String desc) {
|
this.desc = desc;
|
}
|
}
|
|
|
|
public static void main(String[] args) {
|
String outPut = " * \n *** \n ***** \n";
|
String newOutPut = "";
|
if(StringUtils.isNotBlank(outPut)){
|
String[] ostrs = outPut.split("\n");
|
for(String str : ostrs){
|
String text = str.replace("\n","").replaceAll("\\s+$", "");
|
newOutPut += text+"\n";
|
}
|
}
|
System.out.println(newOutPut);
|
|
}
|
}
|