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

yun-zuoyi
钮海涛 3 years ago
commit 0bde327c6a

@ -32,7 +32,7 @@ public class CommonEnumUtil {
* Mes
*/
MES(4, 8300, 11, 103000000L, "i3mes", "生产管理软件"),
MES_HISTORY(4,8310,11,103000010L,"i3mes-history","生产管理软件历史数据"),
MES_HISTORY(41,8310,11,180000000L,"i3mes-history","生产管理软件历史数据"),
MES_PCN(6, 8350, 12, 107000000L, "i3mes-pcn", "生产管理软件-节点中心"),
/**

@ -2070,7 +2070,7 @@ public class MesEnumUtil {
MES_REPAIR(320, "repairExcelService", "质量数据处理措施,支持编辑"),
MES_EQU_TASK_PLAN(330, "equTaskPlanExcelService", "设备作业周期计划,支持编辑"),
MES_PART_OJBECT(340, "partObjectExcelService", "物料对象"),
MES_PART_EXT_OJBECT(341, "PartObjectExtExcelService", "物料对象Ext"),
MES_PART_EXT_OJBECT(341, "partObjectExtExcelService", "物料对象Ext"),
MES_ROUTE_PROCESS_WORK_CELL(350, "routeProcessWorkCellExcelService", "工序工作单元"),
MES_DATASOURCE(360, "datasourceExcelService", "DB地址清单"),
MES_EQU_TASK_NOTIFY_CFG(370, "equTaskNotifyCfgExcelService", "设备通知配置"),

@ -3924,7 +3924,8 @@ public class WmsEnumUtil {
MOVESTOCK("MOVESTOCK", "移库"),
ASSIST("ASSIST", "辅助"),
NC("NC", "NC"),
CS("CS", "盘点");
CS("CS", "盘点"),
THIRDPARTY("THIRDPARTY", "顺义三方库");
private String value;
private String description;

@ -19,6 +19,10 @@ public class MethodListModel {
private String appName;
@ApiModelProperty(name = "方法的版本号")
private String version;
@ApiModelProperty(name = "方法启用")
private Integer isValid;
@ApiModelProperty(name = "方法名")
private String methodName;
}

@ -49,4 +49,8 @@ public class ExecutorGroupRegistryInfo extends BaseBean implements Serializable
@Column(name = "UPDATE_TIME")
@ApiModelProperty("更新时间")
private Date updateTime;
@Column(name = "SOFT_TYPE")
@ApiModelProperty("应用该类型")
private Integer softType;
}

@ -44,4 +44,8 @@ public class ExecutorRegistryInfo extends BaseBean implements Serializable {
@Column(name = "WEIGHT")
@ApiModelProperty("执行器权重")
private Integer weight;
@Column(name = "HEART_BEAT")
@ApiModelProperty("心跳存活12死掉")
private Integer heartBeat;
}

@ -47,4 +47,8 @@ public class MethodLog extends BaseBean implements Serializable {
@ApiModelProperty("方法是否执行成功")
@Column(name = "SUCCESS")
private Integer success;
@ApiModelProperty("方法所属应用冗余")
@Column(name = "APP_NAME_RDD")
private String appNameRdd;
}

@ -0,0 +1,33 @@
package cn.estsh.i3plus.pojo.bsp.server.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2022/1/15 16:06
* @Modify:
**/
@ApiModel(value = "应用管理")
@Data
public class AppGroupVo {
@ApiModelProperty("所属应用类型")
private Integer softType;
@ApiModelProperty("服务地址")
private String appAddress;
@ApiModelProperty("应用状态")
private Integer isValid;
@ApiModelProperty("注册开始时间")
private String startTime;
@ApiModelProperty("注册结束时间")
private String endTime;
}

@ -0,0 +1,26 @@
package cn.estsh.i3plus.pojo.bsp.server.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2022/1/14 9:48
* @Modify:
**/
@Data
@ApiModel(value = "Dashboard调用成功率")
public class DashboardSuccessRate {
@ApiModelProperty(value = "周环比")
private String weeksFrom;
@ApiModelProperty(value = "日环比")
private String daysFrom;
@ApiModelProperty(value = "日调用成功率")
private String successRate;
}

@ -0,0 +1,25 @@
package cn.estsh.i3plus.pojo.bsp.server.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2022/1/15 17:21
* @Modify:
**/
@Data
@ApiModel("批量修改执行器组开启、禁用")
public class GroupValidVo {
@ApiModelProperty("执行器组的id列表")
private List<Long> idList;
@ApiModelProperty("执行器组的状态")
private Integer isValid;
}

@ -0,0 +1,29 @@
package cn.estsh.i3plus.pojo.bsp.server.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2022/1/15 17:30
* @Modify:
**/
@Data
@ApiModel("实例管理")
public class InstanceVo {
@ApiModelProperty("所属应用类型")
private Integer softType;
@ApiModelProperty("注册时间开始")
private String startTime;
@ApiModelProperty("注册时间结束")
private String endTime;
@ApiModelProperty("心跳状态")
private Integer heartBeat;
}

@ -0,0 +1,21 @@
package cn.estsh.i3plus.pojo.bsp.server.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiParam;
import lombok.Data;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2022/1/14 14:45
* @Modify:
**/
@ApiModel(value = "查询方法组")
@Data
public class MethodGroupVo {
@ApiParam(value = "方法组名称")
private String groupName;
@ApiParam(value = "是否启用")
private Integer valid;
}

@ -0,0 +1,32 @@
package cn.estsh.i3plus.pojo.bsp.server.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2022/1/15 13:36
* @Modify:
**/
@Data
@ApiModel(value = "历史日志查询")
public class MethodLogVo {
@ApiModelProperty(value = "方法名称")
private String methodName;
@ApiModelProperty(value = "所属应用")
private String appName;
// @ApiModelProperty(value = "方法状态")
// private Integer isValid;
@ApiModelProperty(value = "调用方法开始时间")
private String startTime;
@ApiModelProperty(value = "调用方法结束时间")
private String endTime;
}

@ -7,6 +7,7 @@ import io.swagger.annotations.ApiParam;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
/**
@ -51,6 +52,17 @@ public class BsSuitCaseModel implements Serializable {
@ApiParam(value = "分页数据")
private Pager pager;
// 请求ID
@ApiParam(value = "请求ID")
private String requestId;
/**
* id
*/
@ApiParam(value = "业务id列表")
private List<String> busiIdList;
public BsSuitCaseModel() {
}

@ -12,6 +12,7 @@ import io.swagger.annotations.ApiParam;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description :
@ -116,6 +117,19 @@ public class SuitClientModel implements Serializable {
@XStreamCDATA
private Object suitResultMessage;
// 请求ID
private String requestId;
/**
* id
*/
private List<String> busiIdList;
/**
*
*/
private Boolean duplicate;
private boolean isNeedRetry = false;
public SuitClientModel() {
@ -135,6 +149,10 @@ public class SuitClientModel implements Serializable {
this.suitSslKeyResult = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
// 设置默认
this.suitResult = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
this.requestId = suitCaseModel.getRequestId();
this.busiIdList = suitCaseModel.getBusiIdList();
this.duplicate = Boolean.FALSE;
}
public SuitClientModel(Integer requestSource, Integer suitMethodId, BsSuitCaseModel suitCaseModel) {
@ -152,6 +170,11 @@ public class SuitClientModel implements Serializable {
this.suitSslKeyResult = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
// 设置默认
this.suitResult = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
this.requestId = suitCaseModel.getRequestId();
this.busiIdList = suitCaseModel.getBusiIdList();
this.duplicate = Boolean.FALSE;
}
public SuitClientModel(SuitModel suitModel, BsSuitCaseModel suitCaseModel) {
@ -170,6 +193,10 @@ public class SuitClientModel implements Serializable {
this.suitSslKeyResult = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
// 设置默认
this.suitResult = CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue();
this.requestId = suitModel.getRequestId();
this.busiIdList = suitModel.getBusiIdList();
this.duplicate = Boolean.FALSE;
}
}

@ -0,0 +1,29 @@
package cn.estsh.i3plus.pojo.wms.bean.health;
import java.util.Date;
/**
*
*/
public interface IWmsHealthIndexCron {
/**
* CRON
* @param expectDifference ()
* 60 1
* -60 1
*/
boolean verify(int expectDifference);
/**
*
* @return
*/
Date getPreviousDate();
/**
*
*/
Date getNextDate();
}

@ -0,0 +1,26 @@
package cn.estsh.i3plus.pojo.wms.bean.health;
/**
*
* @author link
*/
public enum WmsHealthIndexCalcWay {
/**
*
*/
DATABSE("10"),
/**
*
*/
LOCALMETHOD("20"),
/**
*
*/
SCRIPT("30");
private String value;
private WmsHealthIndexCalcWay(String value){
this.value = value;
}
}

@ -0,0 +1,86 @@
package cn.estsh.i3plus.pojo.wms.bean.health;
import cn.estsh.i3plus.pojo.wms.bean.WmsHealthVariableResult;
import lombok.Getter;
import lombok.Setter;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import java.util.Set;
/**
*
*/
@Getter
@Setter
public class WmsHealthIndexEntity {
/**
* (+)
*/
private final WmsHealthIndexId id;
/**
*
*/
private String name;
/**
*
*/
private String module;
/**
*
*/
private final WmsHealthIndexFormula formula;
/**
*
*/
private WmsHealthIndexValue value;
/**
*
*/
private Boolean refresh;
public WmsHealthIndexEntity(final WmsHealthIndexId id,
final WmsHealthIndexFormula formula){
this.id = id;
this.formula = formula;
};
public static WmsHealthIndexEntity of(final String organizeCode,
final String indicatorCode,
final String calcFormula){
return new WmsHealthIndexEntity(WmsHealthIndexId.of(organizeCode,indicatorCode),
WmsHealthIndexFormula.of(organizeCode,indicatorCode));
}
public boolean isRefresh(){
return Boolean.TRUE.equals(refresh);
}
public void refresh(){
WmsHealthIndexValue value = generateWmsHealthIndexValue();
if(null != value) {
this.setValue(value);
this.setRefresh(true);
}
}
private WmsHealthIndexValue generateWmsHealthIndexValue(){
if(!formula.isEmpty()){
String result = null;
int size = formula.getResults().size();
if(size==1){
WmsHealthIndexVariableValue varValue = formula.getSingleValue();
result = String.valueOf(varValue.getDetail());
}else{
result = String.valueOf(formula.getSpelResult());
}
return new WmsHealthIndexValue(result);
}
return null;
}
}

@ -0,0 +1,131 @@
package cn.estsh.i3plus.pojo.wms.bean.health;
import lombok.Getter;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import java.util.*;
/**
*
*/
@Getter
public class WmsHealthIndexFormula {
/**
*
*/
private final String organizeCode;
/**
* (#VAR202201070002/#VAR456)/(#VAR123/#VAR456)*100%
*/
private final String calcFormula;
/**
*
*/
private Set<WmsHealthIndexVariable> vars = new HashSet<>();
/**
*
*/
private Map<WmsHealthIndexVariable, WmsHealthIndexVariableValue> results =
new HashMap<>();
public WmsHealthIndexFormula(final String organizeCode,final String calcFormula){
this.calcFormula = calcFormula;
this.organizeCode = organizeCode;
checkCode();
initVars();
}
/**
*
*/
private void checkCode(){
}
/**
*
* @return
*/
private void initVars(){
Set<WmsHealthIndexVariable> vars = new HashSet<>();
final String [] varTemp = this.calcFormula.split("#");
for(String varStrItem : varTemp) {
if (!varStrItem.startsWith("VAR")||varStrItem.length()<15) {
continue;
}
String variableCode = varStrItem.substring(0, 15);
vars.add(new WmsHealthIndexVariable(organizeCode,variableCode));
}
this.vars = vars;
}
public void addResult(WmsHealthIndexVariable key, WmsHealthIndexVariableValue result){
if(null!=result) {
this.results.put(key, result);
}
}
public boolean isEmpty(){
return results.isEmpty();
}
/**
*
* @return
*/
public boolean isResultSizeSameWithVarsSize(){
return results.size() == vars.size();
}
/**
*
*/
public WmsHealthIndexVariableValue getSingleValue(){
if(!isEmpty()) {
WmsHealthIndexVariableValue variableValue = com.google.common.collect.Lists
.newArrayList(results.values()).get(0);
return variableValue;
}
return null;
}
/**
* calcFormulaSPEL
* @return
*/
public Integer getSpelResult(){
if(results.isEmpty()) {
return -1;
}
Integer calcResult = 0;
int resultSize = results.size();
StandardEvaluationContext ctx = new StandardEvaluationContext();
ExpressionParser parser = new SpelExpressionParser();
//单个变量,特殊情况特殊处理
if(resultSize == 1){
calcResult = getSingleValue().getValue();
}else{
Set<WmsHealthIndexVariable> varKeys = results.keySet();
for (WmsHealthIndexVariable varKey : varKeys) {
// 取出该变量名称对应的计算结果
WmsHealthIndexVariableValue variableValue = results.get(varKey);
Integer value = variableValue.getValue();
ctx.setVariable(varKey.getId().getVariable(), value);
}
// 存在多个变量则按照SPEL进行运算最后取值
try {
calcResult = (Integer) parser.parseExpression(calcFormula)
.getValue(ctx);
} catch (Exception e) {
calcResult = -1;
}
}
return calcResult;
}
public static WmsHealthIndexFormula of(String organizeCode,String calcFormula){
return new WmsHealthIndexFormula(organizeCode,calcFormula);
}
}

@ -0,0 +1,34 @@
package cn.estsh.i3plus.pojo.wms.bean.health;
import lombok.Getter;
/**
*
*/
@Getter
public class WmsHealthIndexId{
/**
*
*/
private final String organizeCode;
/**
*
*/
private final String indicatorCode;
public WmsHealthIndexId(final String organizeCode,final String indicatorCode){
if(null==indicatorCode){
throw new IllegalArgumentException("indicatorCode can't be null");
}
if(null==organizeCode){
throw new IllegalArgumentException("organizeCode can't be null");
}
this.indicatorCode = indicatorCode;
this.organizeCode = indicatorCode;
}
public static WmsHealthIndexId of(String organizeCode,String indicatorCode){
return new WmsHealthIndexId(organizeCode,indicatorCode);
}
}

@ -0,0 +1,19 @@
package cn.estsh.i3plus.pojo.wms.bean.health;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
/**
*
* @author link
*/
@Builder
@Getter
@Setter
public class WmsHealthIndexQuery{
private Long beginTime;
private Long endTime;
private Integer pageIndex;
private Integer pageSize;
}

@ -0,0 +1,26 @@
package cn.estsh.i3plus.pojo.wms.bean.health;
import lombok.Getter;
import lombok.Setter;
/**
*
* @author link
*/
@Getter
public class WmsHealthIndexValue{
/**
*
*/
private final String result;
@Setter
private Long time;
public WmsHealthIndexValue(final String result){
if(null==result){
throw new IllegalArgumentException("result can't be null");
}
this.result = result;
this.time = System.currentTimeMillis();
}
}

@ -0,0 +1,108 @@
package cn.estsh.i3plus.pojo.wms.bean.health;
import lombok.Getter;
import lombok.Setter;
/**
*
*/
@Getter
public class WmsHealthIndexVariable {
/**
*
*/
private final WmsHealthIndexVariableId id;
/**
*
*/
@Setter
private String name;
/**
*
*/
@Setter
private IWmsHealthIndexCron cycleRange;
/**
*
*/
@Setter
private IWmsHealthIndexCron calcFrequency;
/**
*
*/
@Setter
private WmsHealthIndexCalcWay calcWay;
/**
*
*/
@Setter
private String applyArea;
/**
*
*/
@Setter
private String applyPartGroup;
@Setter
private String sqlStatement;
@Setter
private String className;
@Setter
private String functionName;
@Setter
private String scriptNo;
/**
*
*/
@Setter
private Object value;
/**
* CRON
*/
@Setter
private boolean refresh;
public WmsHealthIndexVariable(String organizeCode,String variable){
this(new WmsHealthIndexVariableId(organizeCode,variable));
}
public WmsHealthIndexVariable(WmsHealthIndexVariableId id){
this.id = id;
}
/**
* CRON
* @param expectDifference
* @return
*/
public boolean isNeedCalc(int expectDifference){
boolean flag = calcFrequency.verify(expectDifference);
flag |= calcFrequency.verify(-expectDifference);
return flag;
}
public boolean checked(){
return null!=value;
}
public void changeCalcFrequency(IWmsHealthIndexCron cron){
setCalcFrequency(cron);
setRefresh(true);
}
public void changeCycleRange(IWmsHealthIndexCron cron){
setCycleRange(cron);
setRefresh(true);
}
}

@ -0,0 +1,23 @@
package cn.estsh.i3plus.pojo.wms.bean.health;
import lombok.Getter;
import lombok.Value;
/**
*
*/
@Getter
@Value
public class WmsHealthIndexVariableId {
/**
*
*/
private final String organizeCode;
/**
*
*/
private final String variable;
}

@ -0,0 +1,27 @@
package cn.estsh.i3plus.pojo.wms.bean.health;
import lombok.Getter;
import lombok.Value;
/**
*
*/
@Getter
@Value
public class WmsHealthIndexVariableValue {
/**
*
*/
private final Integer value;
/**
*
*/
private final Object detail;
public static WmsHealthIndexVariableValue empty(){
return new WmsHealthIndexVariableValue(-1,"");
}
}

@ -0,0 +1,45 @@
package cn.estsh.i3plus.pojo.wms.repository;
import cn.estsh.i3plus.pojo.wms.bean.health.WmsHealthIndexEntity;
import cn.estsh.i3plus.pojo.wms.bean.health.WmsHealthIndexId;
import cn.estsh.i3plus.pojo.wms.bean.health.WmsHealthIndexQuery;
import java.util.List;
import java.util.Optional;
/**
*
*/
public interface IWmsHealthIndexRepository {
/**
*
* @param id
* @return
*/
WmsHealthIndexEntity findAndInit(WmsHealthIndexId id);
/**
*
* @param id
* @return
*/
Optional<WmsHealthIndexEntity> getLastRecord(final WmsHealthIndexId id);
/**
*
* @param wmsHealthIndexEntity
* @param source
*/
void save(final WmsHealthIndexEntity wmsHealthIndexEntity,String source);
/**
*
* @param id
* @param param
* @return
*/
List<WmsHealthIndexEntity> query(final WmsHealthIndexId id,
final WmsHealthIndexQuery param);
}

@ -18,7 +18,6 @@ public interface WmsHealthQueryRecordRepository extends BaseRepository<WmsHealth
int countByOrganizeCodeAndIndicatorCodeAndQueryTimeBetween(String organizeCode,String indicatorCode, Long startTime,
Long endTime);
Optional<WmsHealthQueryRecord> findByOrganizeCodeAndIndicatorCodeOrderByQueryTimeDesc(String organizeCode,String indicatorCode);
Optional<WmsHealthQueryRecord> findFirstByOrganizeCodeAndIndicatorCodeOrderByQueryTimeDesc(String organizeCode,String indicatorCode);
}

Loading…
Cancel
Save