包头bug修改
This commit is contained in:
parent
a44068487c
commit
b206d0fb7e
@ -2426,7 +2426,7 @@ public class HikvisionCall {
|
||||
HikvisionOrganization hikvisionOrganization = new HikvisionOrganization();
|
||||
hikvisionOrganization.setClientId(null);
|
||||
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()));
|
||||
return hikvisionOrganization;
|
||||
}
|
||||
@ -2528,7 +2528,7 @@ public class HikvisionCall {
|
||||
HikvisionOrganization hikvisionOrganization = new HikvisionOrganization();
|
||||
hikvisionOrganization.setClientId(null);
|
||||
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()));
|
||||
return hikvisionOrganization;
|
||||
}
|
||||
|
||||
@ -115,4 +115,10 @@ public interface Cts {
|
||||
String LIMIT_1 = "limit 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)
|
||||
@ApiModelProperty(value = "支部名称Id")
|
||||
private java.lang.Long branchId;
|
||||
@ApiModelProperty(value = "二级、三级培训证明")
|
||||
private java.lang.String twoTrainProof;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String random;
|
||||
|
||||
|
||||
@ -550,6 +550,7 @@ public class WorkerAdmissionDetailServiceImpl extends ServiceImpl<WorkerAdmissio
|
||||
workerInfo.setNativePlace(detail.getNativePlace());
|
||||
workerInfo.setNation(detail.getNation());
|
||||
workerInfo.setPoliticsStatus(detail.getPoliticsStatus());
|
||||
workerInfo.setTwoTrainProof(detail.getTwoTrainProof());
|
||||
workerInfo.setEducational(Convert.toStr(detail.getEducational()));
|
||||
workerInfo.setBranchId(detail.getBranchId());
|
||||
return workerInfo;
|
||||
|
||||
@ -291,6 +291,7 @@ public class WorkerAdmissionServiceImpl extends ServiceImpl<WorkerAdmissionMappe
|
||||
int edu = edus.indexOf(FlowUtil.getString(m, "field9454332932104"));
|
||||
detail.setEducational(edu != -1 ? edu + 1 : null);
|
||||
detail.setBranchId(FlowUtil.getLongByCascade(m, "field7244036504230"));
|
||||
detail.setTwoTrainProof(FlowUtil.getJSONString(m, "field5341273760310"));
|
||||
if (nums.contains(num)) {
|
||||
repeatStrs.add(detail.getWorkerName() + "[" + detail.getNum() + "]");
|
||||
continue;
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
package com.zhgd.xmgl.modules.dangerous.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
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.service.IDangerousEngineeringTypeDescribeService;
|
||||
import com.zhgd.xmgl.modules.dangerous.service.IDangerousEngineeringTypeService;
|
||||
import com.zhgd.xmgl.util.ExcelUtils;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -12,10 +17,14 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
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.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
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.Map;
|
||||
@ -33,6 +42,9 @@ import java.util.Map;
|
||||
public class DangerousEngineeringTypeDescribeController {
|
||||
@Autowired
|
||||
private IDangerousEngineeringTypeDescribeService dangerousEngineeringTypeDescribeService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IDangerousEngineeringTypeService dangerousEngineeringTypeService;
|
||||
|
||||
@OperLog(operModul = "危大工程类别描述管理", operType = "查询", operDesc = "列表查询类别描述")
|
||||
@ApiOperation(value = "列表查询类别描述", notes = "列表查询类别描述", httpMethod = "POST")
|
||||
@ -46,6 +58,7 @@ public class DangerousEngineeringTypeDescribeController {
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param dangerousEngineeringTypeDescribe
|
||||
* @return
|
||||
*/
|
||||
@ -65,9 +78,9 @@ public class DangerousEngineeringTypeDescribeController {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ -97,4 +110,44 @@ public class DangerousEngineeringTypeDescribeController {
|
||||
dangerousEngineeringTypeDescribeService.deleteTypeDescribe(MapUtils.getString(map, "id"));
|
||||
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)
|
||||
@ApiModelProperty(value = "支部名称Id")
|
||||
private java.lang.Long branchId;
|
||||
@ApiModelProperty(value = "二级、三级培训证明")
|
||||
private java.lang.String twoTrainProof;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "人脸分数")
|
||||
private java.lang.Integer faceScore;
|
||||
|
||||
@ -70,13 +70,6 @@ public class XzHikvisionSyncServiceImpl extends ServiceImpl<XzHikvisionSyncMappe
|
||||
@Autowired
|
||||
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
|
||||
public IPage<XzHikvisionSync> queryPageList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<XzHikvisionSync> queryWrapper = getQueryWrapper(paramMap);
|
||||
|
||||
@ -331,9 +331,11 @@ public class HikvisionTask {
|
||||
JSONObject rtJo = HikvisionUtil.getSubOrgListByParentOrg(project, param);
|
||||
List<TeamInfo> teamList = teamInfoService.getProjectTeamList(new MapBuilder<String, Object>()
|
||||
.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));
|
||||
List<DepartmentInfo> departmentInfoList = departmentInfoMapper.getDepartmentInfoList(new MapBuilder<String, Object>()
|
||||
.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));
|
||||
JSONObject dataJo = HikvisionUtil.getJsonObjectData(rtJo);
|
||||
JSONArray listJa = dataJo.getJSONArray("list");
|
||||
|
||||
@ -30,7 +30,7 @@ public class FlowUtil {
|
||||
} else if (o instanceof String) {
|
||||
return ((Map) (JSON.parseArray(o.toString())).get(0)).get("url").toString();
|
||||
} else {
|
||||
return ((Map) ((List) o).get(0)).get("url").toString();
|
||||
return ((Map) getFirstFromListNotNull(o)).get("url").toString();
|
||||
}
|
||||
}).orElse(null);
|
||||
}
|
||||
@ -62,7 +62,7 @@ public class FlowUtil {
|
||||
* @return
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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);
|
||||
}
|
||||
Object value = ((List) o).get(0);
|
||||
Object value = getFirstFromListNotNull(o);
|
||||
if (value instanceof Map) {
|
||||
return MapUtils.getLong(((Map) value), "id");
|
||||
} else {
|
||||
@ -127,7 +127,7 @@ public class FlowUtil {
|
||||
}
|
||||
|
||||
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) {
|
||||
@ -157,11 +157,22 @@ public class FlowUtil {
|
||||
}
|
||||
|
||||
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) {
|
||||
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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user