Commit cd75515e authored by chenzhao's avatar chenzhao

修改使用登记表 通过业务类型填充登记类型

parent 745928f1
package com.yeejoin.amos.boot.module.jg.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum RegistrationTypeEnum {
新设备首次启用("新设备首次启用","DJ_SY"),
历史无证设备登记("历史无证设备登记","SP_TT");
private String name;
private String code;
public static String getNameByType(String code) {
String name = null;
for (RegistrationTypeEnum enumOne : RegistrationTypeEnum.values()) {
if (enumOne.getCode().equals(code)) {
name = enumOne.getName();
break;
}
}
return name;
}
}
...@@ -2234,6 +2234,10 @@ public class CommonServiceImpl implements ICommonService { ...@@ -2234,6 +2234,10 @@ public class CommonServiceImpl implements ICommonService {
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
Pattern timePattern = Pattern.compile("\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"); Pattern timePattern = Pattern.compile("\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}");
//登记类型
if (jsonObject.containsKey("type")){
formData.put("registrationType",RegistrationTypeEnum.getNameByType(jsonObject.getString("type")));
}
for (String key : formData.keySet()) { for (String key : formData.keySet()) {
if (key.contains("Date") && timePattern.matcher(formData.getString(key)).matches()){ if (key.contains("Date") && timePattern.matcher(formData.getString(key)).matches()){
// 解析原始日期时间字符串 // 解析原始日期时间字符串
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment