推送地址

This commit is contained in:
sxu 2024-09-04 16:19:52 +08:00
parent 6b69ffcf8b
commit 915ff11be2
4 changed files with 15 additions and 12 deletions

View File

@ -22,19 +22,18 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
/** 下划线 */
private static final char SEPARATOR = '_';
private static final Map<String, String> CAT_MAP;
private static final Map<String, String> CLASS_MAP;
static {
CAT_MAP = new HashMap<>();
CAT_MAP.put("线路施工类", "A");
CAT_MAP.put("变电施工类", "B");
CAT_MAP.put("特种及其他设备", "C");
CAT_MAP.put("检修试验", "D");
CAT_MAP.put("创新装备", "E");
CLASS_MAP = new HashMap<>();
CLASS_MAP.put("线路施工类", "A");
CLASS_MAP.put("变电施工类", "B");
CLASS_MAP.put("特种及其他设备", "C");
CLASS_MAP.put("检修试验", "D");
CLASS_MAP.put("创新装备", "E");
}
/**
* 获取参数不为空值
*
@ -567,13 +566,13 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
}
/** 生成工器具编码: 类似CSG-A101-2024061900001 */
public static String getDeviceCode(String ownerCode, String typeName, String typeId, Date date, String maId) {
public static String getDeviceCode(String ownerCode, String className, String typeName, String typeModelName, String typeId, Date date, String maId) {
int number = Integer.parseInt(maId);
if (number > 30000) {
number = number % 30000;
}
String numberStr = String.format("%05d", number);
String deviceCode = ownerCode + "-" + CAT_MAP.get(typeName) + typeId + "-" + DateUtils.getDateTimeString(date) + numberStr;
String deviceCode = ownerCode + "-" + CLASS_MAP.get(className) + typeId + "-" + DateUtils.getDateTimeString(date) + numberStr;
return deviceCode;
}

View File

@ -254,6 +254,8 @@ public class TmTask implements Serializable {
private String userId;
private String userName;
/**门类码*/
private String className;
private String typeName;
private String typeModelName;

View File

@ -1418,7 +1418,7 @@ public class TmTaskServiceImpl implements TmTaskService {
intelVO.setValidityDate(new Date());
//每个设备不同点的设置
String ownerCode = loginUser.getSysUser().getDept().getEnterpriseOwnershipCode();
intelVO.setDeviceCode(StringUtils.getDeviceCode(ownerCode, subTask.getTypeName(), subTask.getTypeId(), subTask.getCreateTime(), subTask.getMaId()));
intelVO.setDeviceCode(StringUtils.getDeviceCode(ownerCode, subTask.getClassName(), subTask.getTypeName(), subTask.getTypeModelName(), subTask.getTypeId(), subTask.getCreateTime(), subTask.getMaId()));
intelVO.setFactoryDate(subTask.getOutFacTime());
intelVO.setMachineryCode(subTask.getMaId());
intelVO.setTrialDate(subTask.getThisCheckTime());

View File

@ -1184,7 +1184,9 @@
mam.this_check_time as thisCheckTime,
mam.create_time as createTime,
mt.type_id,
mt3.type_name as typeName
mt1.type_name as typeModelName,
mt2.type_name as typeName,
mt3.type_name as className
from lease_out_details lod
left join ma_machine mam on mam.ma_id = lod.ma_id
left join ma_type mt on mam.type_id = mt.type_id