推送地址
This commit is contained in:
parent
71dec25493
commit
a9e12e1527
|
|
@ -1,6 +1,5 @@
|
||||||
package com.bonus.sgzb.common.core.utils;
|
package com.bonus.sgzb.common.core.utils;
|
||||||
|
|
||||||
import java.security.SecureRandom;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import com.bonus.sgzb.common.core.constant.Constants;
|
import com.bonus.sgzb.common.core.constant.Constants;
|
||||||
|
|
@ -22,15 +21,15 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
||||||
/** 下划线 */
|
/** 下划线 */
|
||||||
private static final char SEPARATOR = '_';
|
private static final char SEPARATOR = '_';
|
||||||
|
|
||||||
private static final Map<String, String> CLASS_MAP;
|
private static final Map<String, String> CAT_MAP;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
CLASS_MAP = new HashMap<>();
|
CAT_MAP = new HashMap<>();
|
||||||
CLASS_MAP.put("线路施工类", "A");
|
CAT_MAP.put("线路施工类", "A");
|
||||||
CLASS_MAP.put("变电施工类", "B");
|
CAT_MAP.put("变电施工类", "B");
|
||||||
CLASS_MAP.put("特种及其他设备", "C");
|
CAT_MAP.put("特种及其他设备", "C");
|
||||||
CLASS_MAP.put("检修试验", "D");
|
CAT_MAP.put("检修试验", "D");
|
||||||
CLASS_MAP.put("创新装备", "E");
|
CAT_MAP.put("创新装备", "E");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -607,13 +606,13 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 生成工器具编码: 类似CSG-A101-2024061900001 */
|
/** 生成工器具编码: 类似CSG-A101-2024061900001 */
|
||||||
public static String getDeviceCode(String ownerCode, String className, String typeName, String typeModelName, String typeId, Date date, String maId) {
|
public static String getDeviceCode(String ownerCode, String categoryName, String typeId, Date date, String maId) {
|
||||||
int number = Integer.parseInt(maId);
|
int number = Integer.parseInt(maId);
|
||||||
if (number > 30000) {
|
if (number > 30000) {
|
||||||
number = number % 30000;
|
number = number % 30000;
|
||||||
}
|
}
|
||||||
String numberStr = String.format("%05d", number);
|
String numberStr = String.format("%05d", number);
|
||||||
String deviceCode = ownerCode + "-" + CLASS_MAP.get(className) + typeId + "-" + DateUtils.getDateTimeString(date) + numberStr;
|
String deviceCode = ownerCode + "-" + CAT_MAP.get(categoryName) + typeId + "-" + DateUtils.getDateTimeString(date) + numberStr;
|
||||||
return deviceCode;
|
return deviceCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -254,8 +254,6 @@ public class TmTask implements Serializable {
|
||||||
|
|
||||||
private String userId;
|
private String userId;
|
||||||
private String userName;
|
private String userName;
|
||||||
/**门类码*/
|
|
||||||
private String className;
|
|
||||||
private String typeName;
|
private String typeName;
|
||||||
private String typeModelName;
|
private String typeModelName;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1418,7 +1418,7 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
intelVO.setValidityDate(new Date());
|
intelVO.setValidityDate(new Date());
|
||||||
//每个设备不同点的设置
|
//每个设备不同点的设置
|
||||||
String ownerCode = loginUser.getSysUser().getDept().getEnterpriseOwnershipCode();
|
String ownerCode = loginUser.getSysUser().getDept().getEnterpriseOwnershipCode();
|
||||||
intelVO.setDeviceCode(StringUtils.getDeviceCode(ownerCode, subTask.getClassName(), subTask.getTypeName(), subTask.getTypeModelName(), subTask.getTypeId(), subTask.getCreateTime(), subTask.getMaId()));
|
intelVO.setDeviceCode(StringUtils.getDeviceCode(ownerCode, subTask.getTypeName(), subTask.getTypeId(), subTask.getCreateTime(), subTask.getMaId()));
|
||||||
intelVO.setFactoryDate(subTask.getOutFacTime());
|
intelVO.setFactoryDate(subTask.getOutFacTime());
|
||||||
intelVO.setMachineryCode(subTask.getMaId());
|
intelVO.setMachineryCode(subTask.getMaId());
|
||||||
intelVO.setTrialDate(subTask.getThisCheckTime());
|
intelVO.setTrialDate(subTask.getThisCheckTime());
|
||||||
|
|
|
||||||
|
|
@ -1184,9 +1184,7 @@
|
||||||
mam.this_check_time as thisCheckTime,
|
mam.this_check_time as thisCheckTime,
|
||||||
mam.create_time as createTime,
|
mam.create_time as createTime,
|
||||||
mt.type_id,
|
mt.type_id,
|
||||||
mt1.type_name as typeModelName,
|
mt3.type_name as typeName
|
||||||
mt2.type_name as typeName,
|
|
||||||
mt3.type_name as className
|
|
||||||
from lease_out_details lod
|
from lease_out_details lod
|
||||||
left join ma_machine mam on mam.ma_id = lod.ma_id
|
left join ma_machine mam on mam.ma_id = lod.ma_id
|
||||||
left join ma_type mt on mam.type_id = mt.type_id
|
left join ma_type mt on mam.type_id = mt.type_id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue