包头bug修改
This commit is contained in:
parent
a44068487c
commit
b206d0fb7e
@ -2426,7 +2426,7 @@ public class HikvisionCall {
|
|||||||
HikvisionOrganization hikvisionOrganization = new HikvisionOrganization();
|
HikvisionOrganization hikvisionOrganization = new HikvisionOrganization();
|
||||||
hikvisionOrganization.setClientId(null);
|
hikvisionOrganization.setClientId(null);
|
||||||
hikvisionOrganization.setOrgIndexCode(String.valueOf(teamInfo.getId()));
|
hikvisionOrganization.setOrgIndexCode(String.valueOf(teamInfo.getId()));
|
||||||
hikvisionOrganization.setOrgName(teamInfo.getTeamName());
|
hikvisionOrganization.setOrgName(teamInfo.getTeamName() + Cts.ISC_SYNC_TEAM_SUFFIX);
|
||||||
hikvisionOrganization.setParentIndexCode(StringsUtils.getUniqueEnterpriseId(teamInfo.getEnterpriseId(), project.getProjectSn()));
|
hikvisionOrganization.setParentIndexCode(StringsUtils.getUniqueEnterpriseId(teamInfo.getEnterpriseId(), project.getProjectSn()));
|
||||||
return hikvisionOrganization;
|
return hikvisionOrganization;
|
||||||
}
|
}
|
||||||
@ -2528,7 +2528,7 @@ public class HikvisionCall {
|
|||||||
HikvisionOrganization hikvisionOrganization = new HikvisionOrganization();
|
HikvisionOrganization hikvisionOrganization = new HikvisionOrganization();
|
||||||
hikvisionOrganization.setClientId(null);
|
hikvisionOrganization.setClientId(null);
|
||||||
hikvisionOrganization.setOrgIndexCode(String.valueOf(departmentInfo.getId()));
|
hikvisionOrganization.setOrgIndexCode(String.valueOf(departmentInfo.getId()));
|
||||||
hikvisionOrganization.setOrgName(departmentInfo.getDepartmentName());
|
hikvisionOrganization.setOrgName(departmentInfo.getDepartmentName() + Cts.ISC_SYNC_DEPARTMENT_SUFFIX);
|
||||||
hikvisionOrganization.setParentIndexCode(StringsUtils.getUniqueEnterpriseId(departmentInfo.getEnterpriseId(), project.getProjectSn()));
|
hikvisionOrganization.setParentIndexCode(StringsUtils.getUniqueEnterpriseId(departmentInfo.getEnterpriseId(), project.getProjectSn()));
|
||||||
return hikvisionOrganization;
|
return hikvisionOrganization;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -115,4 +115,10 @@ public interface Cts {
|
|||||||
String LIMIT_1 = "limit 1";
|
String LIMIT_1 = "limit 1";
|
||||||
public static final String MINIO_1 = "minio-1";
|
public static final String MINIO_1 = "minio-1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步isc的班组要加上这个后缀,区分同个单位下同名的部门和班组
|
||||||
|
*/
|
||||||
|
public static final String ISC_SYNC_TEAM_SUFFIX = "(工种)";
|
||||||
|
public static final String ISC_SYNC_DEPARTMENT_SUFFIX = "(岗位)";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -221,6 +221,9 @@ public class WorkerAdmissionDetail implements Serializable {
|
|||||||
@Excel(name = "支部名称Id", width = 15)
|
@Excel(name = "支部名称Id", width = 15)
|
||||||
@ApiModelProperty(value = "支部名称Id")
|
@ApiModelProperty(value = "支部名称Id")
|
||||||
private java.lang.Long branchId;
|
private java.lang.Long branchId;
|
||||||
|
@ApiModelProperty(value = "二级、三级培训证明")
|
||||||
|
private java.lang.String twoTrainProof;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String random;
|
private String random;
|
||||||
|
|
||||||
|
|||||||
@ -550,6 +550,7 @@ public class WorkerAdmissionDetailServiceImpl extends ServiceImpl<WorkerAdmissio
|
|||||||
workerInfo.setNativePlace(detail.getNativePlace());
|
workerInfo.setNativePlace(detail.getNativePlace());
|
||||||
workerInfo.setNation(detail.getNation());
|
workerInfo.setNation(detail.getNation());
|
||||||
workerInfo.setPoliticsStatus(detail.getPoliticsStatus());
|
workerInfo.setPoliticsStatus(detail.getPoliticsStatus());
|
||||||
|
workerInfo.setTwoTrainProof(detail.getTwoTrainProof());
|
||||||
workerInfo.setEducational(Convert.toStr(detail.getEducational()));
|
workerInfo.setEducational(Convert.toStr(detail.getEducational()));
|
||||||
workerInfo.setBranchId(detail.getBranchId());
|
workerInfo.setBranchId(detail.getBranchId());
|
||||||
return workerInfo;
|
return workerInfo;
|
||||||
|
|||||||
@ -291,6 +291,7 @@ public class WorkerAdmissionServiceImpl extends ServiceImpl<WorkerAdmissionMappe
|
|||||||
int edu = edus.indexOf(FlowUtil.getString(m, "field9454332932104"));
|
int edu = edus.indexOf(FlowUtil.getString(m, "field9454332932104"));
|
||||||
detail.setEducational(edu != -1 ? edu + 1 : null);
|
detail.setEducational(edu != -1 ? edu + 1 : null);
|
||||||
detail.setBranchId(FlowUtil.getLongByCascade(m, "field7244036504230"));
|
detail.setBranchId(FlowUtil.getLongByCascade(m, "field7244036504230"));
|
||||||
|
detail.setTwoTrainProof(FlowUtil.getJSONString(m, "field5341273760310"));
|
||||||
if (nums.contains(num)) {
|
if (nums.contains(num)) {
|
||||||
repeatStrs.add(detail.getWorkerName() + "[" + detail.getNum() + "]");
|
repeatStrs.add(detail.getWorkerName() + "[" + detail.getNum() + "]");
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -1,9 +1,14 @@
|
|||||||
package com.zhgd.xmgl.modules.dangerous.controller;
|
package com.zhgd.xmgl.modules.dangerous.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.zhgd.annotation.OperLog;
|
import com.zhgd.annotation.OperLog;
|
||||||
import com.zhgd.jeecg.common.api.vo.Result;
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
|
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||||
|
import com.zhgd.xmgl.modules.dangerous.entity.DangerousEngineeringType;
|
||||||
import com.zhgd.xmgl.modules.dangerous.entity.DangerousEngineeringTypeDescribe;
|
import com.zhgd.xmgl.modules.dangerous.entity.DangerousEngineeringTypeDescribe;
|
||||||
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringTypeDescribeService;
|
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringTypeDescribeService;
|
||||||
|
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringTypeService;
|
||||||
|
import com.zhgd.xmgl.util.ExcelUtils;
|
||||||
import com.zhgd.xmgl.util.MessageUtil;
|
import com.zhgd.xmgl.util.MessageUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@ -12,10 +17,14 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -33,6 +42,9 @@ import java.util.Map;
|
|||||||
public class DangerousEngineeringTypeDescribeController {
|
public class DangerousEngineeringTypeDescribeController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDangerousEngineeringTypeDescribeService dangerousEngineeringTypeDescribeService;
|
private IDangerousEngineeringTypeDescribeService dangerousEngineeringTypeDescribeService;
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private IDangerousEngineeringTypeService dangerousEngineeringTypeService;
|
||||||
|
|
||||||
@OperLog(operModul = "危大工程类别描述管理", operType = "查询", operDesc = "列表查询类别描述")
|
@OperLog(operModul = "危大工程类别描述管理", operType = "查询", operDesc = "列表查询类别描述")
|
||||||
@ApiOperation(value = "列表查询类别描述", notes = "列表查询类别描述", httpMethod = "POST")
|
@ApiOperation(value = "列表查询类别描述", notes = "列表查询类别描述", httpMethod = "POST")
|
||||||
@ -40,12 +52,13 @@ public class DangerousEngineeringTypeDescribeController {
|
|||||||
@ApiImplicitParam(name = "typeId", value = "类别ID", paramType = "body", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "typeId", value = "类别ID", paramType = "body", required = true, dataType = "String"),
|
||||||
})
|
})
|
||||||
@PostMapping(value = "/selectTypeDescribeList")
|
@PostMapping(value = "/selectTypeDescribeList")
|
||||||
public Result<List<DangerousEngineeringTypeDescribe>> selectTypeList(@RequestBody Map<String,Object> map) {
|
public Result<List<DangerousEngineeringTypeDescribe>> selectTypeList(@RequestBody Map<String, Object> map) {
|
||||||
return Result.success(dangerousEngineeringTypeDescribeService.selectTypeDescribeListByTypeId(map));
|
return Result.success(dangerousEngineeringTypeDescribeService.selectTypeDescribeListByTypeId(map));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
|
*
|
||||||
* @param dangerousEngineeringTypeDescribe
|
* @param dangerousEngineeringTypeDescribe
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -65,9 +78,9 @@ public class DangerousEngineeringTypeDescribeController {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
|
*
|
||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -77,12 +90,12 @@ public class DangerousEngineeringTypeDescribeController {
|
|||||||
public Result<DangerousEngineeringTypeDescribe> edit(@RequestBody DangerousEngineeringTypeDescribe dangerousEngineeringTypeDescribe) {
|
public Result<DangerousEngineeringTypeDescribe> edit(@RequestBody DangerousEngineeringTypeDescribe dangerousEngineeringTypeDescribe) {
|
||||||
Result<DangerousEngineeringTypeDescribe> result = new Result<DangerousEngineeringTypeDescribe>();
|
Result<DangerousEngineeringTypeDescribe> result = new Result<DangerousEngineeringTypeDescribe>();
|
||||||
DangerousEngineeringTypeDescribe dangerousEngineeringTypeDescribeEntity = dangerousEngineeringTypeDescribeService.getById(dangerousEngineeringTypeDescribe.getId());
|
DangerousEngineeringTypeDescribe dangerousEngineeringTypeDescribeEntity = dangerousEngineeringTypeDescribeService.getById(dangerousEngineeringTypeDescribe.getId());
|
||||||
if(dangerousEngineeringTypeDescribeEntity==null) {
|
if (dangerousEngineeringTypeDescribeEntity == null) {
|
||||||
result.error500(MessageUtil.get("notFindErr"));
|
result.error500(MessageUtil.get("notFindErr"));
|
||||||
}else {
|
} else {
|
||||||
boolean ok = dangerousEngineeringTypeDescribeService.updateById(dangerousEngineeringTypeDescribe);
|
boolean ok = dangerousEngineeringTypeDescribeService.updateById(dangerousEngineeringTypeDescribe);
|
||||||
|
|
||||||
if(ok) {
|
if (ok) {
|
||||||
result.successMsg(MessageUtil.get("editSucess"));
|
result.successMsg(MessageUtil.get("editSucess"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,8 +106,48 @@ public class DangerousEngineeringTypeDescribeController {
|
|||||||
@ApiOperation(value = "删除危大工程类别描述信息", notes = "删除危大工程类别描述信息", httpMethod = "POST")
|
@ApiOperation(value = "删除危大工程类别描述信息", notes = "删除危大工程类别描述信息", httpMethod = "POST")
|
||||||
@ApiImplicitParam(name = "id", value = "危大工程类别描述ID", paramType = "body", required = true, dataType = "Integer")
|
@ApiImplicitParam(name = "id", value = "危大工程类别描述ID", paramType = "body", required = true, dataType = "Integer")
|
||||||
@PostMapping(value = "/delete")
|
@PostMapping(value = "/delete")
|
||||||
public Result<DangerousEngineeringTypeDescribe> delete(@RequestBody Map<String,Object> map) {
|
public Result<DangerousEngineeringTypeDescribe> delete(@RequestBody Map<String, Object> map) {
|
||||||
dangerousEngineeringTypeDescribeService.deleteTypeDescribe(MapUtils.getString(map,"id"));
|
dangerousEngineeringTypeDescribeService.deleteTypeDescribe(MapUtils.getString(map, "id"));
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 录入危大工程类别和描述数据
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@PostMapping(value = "/importData")
|
||||||
|
public Result importData(@ApiIgnore MultipartFile file) {
|
||||||
|
List<Map<String, String>> list = null;
|
||||||
|
try {
|
||||||
|
list = ExcelUtils.jxlExlToList(file.getInputStream(), 0);
|
||||||
|
if (list == null || list.size() == 0) {
|
||||||
|
throw new OpenAlertException(MessageUtil.get("excelNotDataErr"));
|
||||||
|
}
|
||||||
|
String sn = "2e07f0e2569c43fb835ae2082d1d314f";
|
||||||
|
String one = null;
|
||||||
|
Long top1 = null;
|
||||||
|
for (Map<String, String> map : list) {
|
||||||
|
if (StrUtil.isNotBlank(one = map.get("left"))) {
|
||||||
|
DangerousEngineeringType type = new DangerousEngineeringType();
|
||||||
|
type.setTypeName(one);
|
||||||
|
type.setSn(sn);
|
||||||
|
dangerousEngineeringTypeService.save(type);
|
||||||
|
top1 = type.getId();
|
||||||
|
} else if (StrUtil.isNotBlank(one = map.get("right"))) {
|
||||||
|
DangerousEngineeringTypeDescribe desc = new DangerousEngineeringTypeDescribe();
|
||||||
|
desc.setTypeId(top1);
|
||||||
|
desc.setDescribeName(one);
|
||||||
|
desc.setDangerType(1);
|
||||||
|
dangerousEngineeringTypeDescribeService.save(desc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new OpenAlertException();
|
||||||
|
}
|
||||||
|
return Result.ok();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -375,6 +375,8 @@ public class WorkerInfo implements Serializable {
|
|||||||
@Excel(name = "支部名称Id", width = 15)
|
@Excel(name = "支部名称Id", width = 15)
|
||||||
@ApiModelProperty(value = "支部名称Id")
|
@ApiModelProperty(value = "支部名称Id")
|
||||||
private java.lang.Long branchId;
|
private java.lang.Long branchId;
|
||||||
|
@ApiModelProperty(value = "二级、三级培训证明")
|
||||||
|
private java.lang.String twoTrainProof;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@ApiModelProperty(value = "人脸分数")
|
@ApiModelProperty(value = "人脸分数")
|
||||||
private java.lang.Integer faceScore;
|
private java.lang.Integer faceScore;
|
||||||
|
|||||||
@ -70,13 +70,6 @@ public class XzHikvisionSyncServiceImpl extends ServiceImpl<XzHikvisionSyncMappe
|
|||||||
@Autowired
|
@Autowired
|
||||||
private UfaceDevMapper ufaceDevMapper;
|
private UfaceDevMapper ufaceDevMapper;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
Date val = new Date();
|
|
||||||
ThreadLocalUtil.addInKey("now", val);
|
|
||||||
Date now = ThreadLocalUtil.getNotNull().getDate("now");
|
|
||||||
System.out.println(val == now);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<XzHikvisionSync> queryPageList(HashMap<String, Object> paramMap) {
|
public IPage<XzHikvisionSync> queryPageList(HashMap<String, Object> paramMap) {
|
||||||
QueryWrapper<XzHikvisionSync> queryWrapper = getQueryWrapper(paramMap);
|
QueryWrapper<XzHikvisionSync> queryWrapper = getQueryWrapper(paramMap);
|
||||||
|
|||||||
@ -331,9 +331,11 @@ public class HikvisionTask {
|
|||||||
JSONObject rtJo = HikvisionUtil.getSubOrgListByParentOrg(project, param);
|
JSONObject rtJo = HikvisionUtil.getSubOrgListByParentOrg(project, param);
|
||||||
List<TeamInfo> teamList = teamInfoService.getProjectTeamList(new MapBuilder<String, Object>()
|
List<TeamInfo> teamList = teamInfoService.getProjectTeamList(new MapBuilder<String, Object>()
|
||||||
.put(Cts.PROJECT_SN, project.getProjectSn()).put(Cts.ENTERPRISE_ID, enterpriseId).build());
|
.put(Cts.PROJECT_SN, project.getProjectSn()).put(Cts.ENTERPRISE_ID, enterpriseId).build());
|
||||||
|
teamList.forEach(o -> o.setTeamName(o.getTeamName() + Cts.ISC_SYNC_TEAM_SUFFIX));
|
||||||
log.info("数据校验我们平台的班组列表:{}", JSON.toJSONString(teamList));
|
log.info("数据校验我们平台的班组列表:{}", JSON.toJSONString(teamList));
|
||||||
List<DepartmentInfo> departmentInfoList = departmentInfoMapper.getDepartmentInfoList(new MapBuilder<String, Object>()
|
List<DepartmentInfo> departmentInfoList = departmentInfoMapper.getDepartmentInfoList(new MapBuilder<String, Object>()
|
||||||
.put(Cts.PROJECT_SN, project.getProjectSn()).put(Cts.ENTERPRISE_ID, enterpriseId).build());
|
.put(Cts.PROJECT_SN, project.getProjectSn()).put(Cts.ENTERPRISE_ID, enterpriseId).build());
|
||||||
|
departmentInfoList.forEach(o -> o.setDepartmentName(o.getDepartmentName() + Cts.ISC_SYNC_DEPARTMENT_SUFFIX));
|
||||||
log.info("数据校验我们平台的部门列表:{}", JSON.toJSONString(departmentInfoList));
|
log.info("数据校验我们平台的部门列表:{}", JSON.toJSONString(departmentInfoList));
|
||||||
JSONObject dataJo = HikvisionUtil.getJsonObjectData(rtJo);
|
JSONObject dataJo = HikvisionUtil.getJsonObjectData(rtJo);
|
||||||
JSONArray listJa = dataJo.getJSONArray("list");
|
JSONArray listJa = dataJo.getJSONArray("list");
|
||||||
|
|||||||
@ -30,7 +30,7 @@ public class FlowUtil {
|
|||||||
} else if (o instanceof String) {
|
} else if (o instanceof String) {
|
||||||
return ((Map) (JSON.parseArray(o.toString())).get(0)).get("url").toString();
|
return ((Map) (JSON.parseArray(o.toString())).get(0)).get("url").toString();
|
||||||
} else {
|
} else {
|
||||||
return ((Map) ((List) o).get(0)).get("url").toString();
|
return ((Map) getFirstFromListNotNull(o)).get("url").toString();
|
||||||
}
|
}
|
||||||
}).orElse(null);
|
}).orElse(null);
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ public class FlowUtil {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String getFileUrlWithHost(Map map, String key) {
|
public static String getFileUrlWithHost(Map map, String key) {
|
||||||
return Optional.ofNullable(map.get(key)).map(o -> "".equals(o) ? null : PathUtil.getDomain() + ((Map) ((List) o).get(0)).get("url").toString()).orElse(null);
|
return Optional.ofNullable(map.get(key)).map(o -> "".equals(o) ? null : PathUtil.getDomain() + ((Map) getFirstFromListNotNull(o)).get("url").toString()).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,7 +73,7 @@ public class FlowUtil {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String getFileOriginFileName(Map map, String key) {
|
public static String getFileOriginFileName(Map map, String key) {
|
||||||
return Optional.ofNullable(map.get(key)).map(o -> "".equals(o) ? null : ((Map) ((List) o).get(0)).get("name").toString()).orElse(null);
|
return Optional.ofNullable(map.get(key)).map(o -> "".equals(o) ? null : ((Map) getFirstFromListNotNull(o)).get("name").toString()).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -95,7 +95,7 @@ public class FlowUtil {
|
|||||||
}
|
}
|
||||||
return Long.valueOf(s1);
|
return Long.valueOf(s1);
|
||||||
}
|
}
|
||||||
Object value = ((List) o).get(0);
|
Object value = getFirstFromListNotNull(o);
|
||||||
if (value instanceof Map) {
|
if (value instanceof Map) {
|
||||||
return MapUtils.getLong(((Map) value), "id");
|
return MapUtils.getLong(((Map) value), "id");
|
||||||
} else {
|
} else {
|
||||||
@ -127,7 +127,7 @@ public class FlowUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Date getStartDate(Map<String, Object> map, String key) {
|
public static Date getStartDate(Map<String, Object> map, String key) {
|
||||||
return Optional.ofNullable(map.get(key)).map(o -> "".equals(o) ? null : DateUtil.parse(Convert.toStr(((List) o).get(0)))).orElse(null);
|
return Optional.ofNullable(map.get(key)).map(o -> "".equals(o) ? null : DateUtil.parse(Convert.toStr(getFirstFromListNotNull(o)))).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Date getEndDate(Map<String, Object> map, String key) {
|
public static Date getEndDate(Map<String, Object> map, String key) {
|
||||||
@ -157,11 +157,22 @@ public class FlowUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Integer getPullDownInteger(Map<String, Object> map, String key) {
|
public static Integer getPullDownInteger(Map<String, Object> map, String key) {
|
||||||
return Optional.ofNullable(map.get(key)).map(o -> "".equals(o) ? null : Convert.toInt(((List) o).get(0))).orElse(null);
|
return Optional.ofNullable(map.get(key)).map(o -> "".equals(o) ? null : Convert.toInt(getFirstFromListNotNull(o))).orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取列表的第一个(为null就返回null)
|
||||||
|
*
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Object getFirstFromListNotNull(Object o) {
|
||||||
|
List o1 = (List) o;
|
||||||
|
return CollUtil.isNotEmpty(o1) ? o1.get(0) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getPullDownString(Map<String, Object> map, String key) {
|
public static String getPullDownString(Map<String, Object> map, String key) {
|
||||||
return Optional.ofNullable(map.get(key)).map(o -> "".equals(o) ? null : Convert.toStr(((List) o).get(0))).orElse(null);
|
return Optional.ofNullable(map.get(key)).map(o -> "".equals(o) ? null : Convert.toStr(getFirstFromListNotNull(o))).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getLongitude(Map map, String key) {
|
public static String getLongitude(Map map, String key) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user