人员下发修改

This commit is contained in:
pengjie 2024-05-10 02:48:59 +08:00
parent 82306238dc
commit 8091c272b0
3 changed files with 74 additions and 9 deletions

View File

@ -86,9 +86,12 @@
<if test="param.isExamPass!=null"> <if test="param.isExamPass!=null">
and a.is_exam_pass=#{param.isExamPass} and a.is_exam_pass=#{param.isExamPass}
</if> </if>
AND contract_info IS NOT NULL <if test="param.workerId!=null">
AND special_certificate_info IS NOT NULL and a.id=#{param.workerId}
AND insurance_info IS NOT NULL </if>
-- AND contract_info IS NOT NULL
-- AND special_certificate_info IS NOT NULL
-- AND insurance_info IS NOT NULL
order by a.id desc order by a.id desc
</select> </select>

View File

@ -1,17 +1,17 @@
package com.zhgd.xmgl.modules.xz.controller; package com.zhgd.xmgl.modules.xz.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.sun.corba.se.pept.transport.ContactInfo;
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.mybatis.EntityMap; import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.entity.vo.SafeEducationQuestionAnswerDataVo; import com.zhgd.xmgl.entity.vo.SafeEducationQuestionAnswerDataVo;
import com.zhgd.xmgl.modules.edu.service.ISafeEducationQuestionAnswerService; import com.zhgd.xmgl.modules.edu.service.ISafeEducationQuestionAnswerService;
import com.zhgd.xmgl.modules.worker.entity.UfaceDev; import com.zhgd.xmgl.modules.worker.entity.*;
import com.zhgd.xmgl.modules.worker.entity.WorkerInfoAuditRecord;
import com.zhgd.xmgl.modules.worker.entity.WorkerSafeEducationWorker;
import com.zhgd.xmgl.modules.worker.service.IUfaceDevService; import com.zhgd.xmgl.modules.worker.service.IUfaceDevService;
import com.zhgd.xmgl.modules.worker.service.IWorkerInfoAuditRecordService; import com.zhgd.xmgl.modules.worker.service.IWorkerInfoAuditRecordService;
import com.zhgd.xmgl.util.MessageUtil; import com.zhgd.xmgl.util.MessageUtil;
@ -224,13 +224,74 @@ public class XzWorkerInfoAuditRecordController {
@ApiImplicitParam(name = "ufaceDevId", value = "人脸设备表ID", paramType = "body", required = false, dataType = "String"), @ApiImplicitParam(name = "ufaceDevId", value = "人脸设备表ID", paramType = "body", required = false, dataType = "String"),
}) })
@PostMapping(value = "/adoptWorkerInfo") @PostMapping(value = "/adoptWorkerInfo")
public Result<WorkerInfoAuditRecord> adoptWorkerInfo(@RequestBody Map<String, Object> paramMap) { public Result<WorkerInfoAuditRecord> adoptWorkerInfo(@RequestBody JSONObject paramMap) {
List<String> ids = (List<String>) paramMap.get("id"); // List<String> ids = (List<String>) paramMap.get("id");
// List<String> ufaceDevId = ufaceDevService.list(Wrappers.<UfaceDev>lambdaQuery().eq(UfaceDev::getProjectSn, paramMap.get("projectSn").toString()))
// .stream().map(d -> d.getId().toString()).collect(Collectors.toList());
// if (ufaceDevId.size() > 0) {
// String ufaceDevIds = ufaceDevId.stream().collect(Collectors.joining(","));
// for (String id : ids) {
// paramMap.put("id", id);
// paramMap.put("ufaceDevId", ufaceDevIds);
// paramMap.put("accountType", 2);
// paramMap.put("registerType", 2);
// workerInfoAuditRecordService.adoptWorkerInfo(paramMap);
// }
// }
List<String> workerIds = new ArrayList<>();
JSONArray ids = paramMap.getJSONArray("id");
JSONArray workerInfo = new JSONArray();
String [] param = {"workerId", "enterpriseName", "teamName", "personType", "idCard", "contract", "insurance", "certificate"};
for (int i = 0; i < ids.size(); i++) {
JSONObject detailObj = new JSONObject();
JSONObject j = ids.getJSONObject(i);
int k = 0;
for (String s : j.keySet()) {
detailObj.put(param[k], j.get(s));
k++;
}
workerInfo.add(detailObj);
}
for (Object o : workerInfo) {
JSONObject object = JSONObject.parseObject(JSON.toJSONString(o));
String workerId = object.getJSONArray("workerId").get(0).toString();
workerIds.add(workerId);
WorkerInfoAuditRecord infoAuditRecord = workerInfoAuditRecordService.getById(workerId);
List<WorkerContract> contractList = new ArrayList<>();
WorkerContract workerContract = new WorkerContract();
workerContract.setImageUrl(object.getJSONArray("contract").getJSONObject(0).getString("url"));
contractList.add(workerContract);
infoAuditRecord.setContractInfo(JSON.toJSONString(contractList));
List<WorkerInsurance> insuranceList = new ArrayList<>();
WorkerInsurance workerInsurance = new WorkerInsurance();
workerInsurance.setPhotoUrl(object.getJSONArray("insurance").getJSONObject(0).getString("url"));
insuranceList.add(workerInsurance);
infoAuditRecord.setInsuranceInfo(JSON.toJSONString(workerInsurance));
List<WorkerCertificate> certificateList = new ArrayList<>();
JSONArray certificate = object.getJSONArray("certificate");
for (int i = 0; i < certificate.size(); i++) {
WorkerCertificate workerCertificate = new WorkerCertificate();
JSONObject jsonObject = certificate.getJSONObject(i);
int p = 0;
for (String s : jsonObject.keySet()) {
if (p == 0) {
workerCertificate.setCertificateType(Integer.parseInt(jsonObject.getJSONArray(s).get(0).toString()));
} else {
workerCertificate.setPhotoUrl(jsonObject.getJSONArray(s).getJSONObject(0).getString("url"));
}
p ++;
}
certificateList.add(workerCertificate);
}
infoAuditRecord.setSpecialCertificateInfo(JSON.toJSONString(certificateList));
}
List<String> ufaceDevId = ufaceDevService.list(Wrappers.<UfaceDev>lambdaQuery().eq(UfaceDev::getProjectSn, paramMap.get("projectSn").toString())) List<String> ufaceDevId = ufaceDevService.list(Wrappers.<UfaceDev>lambdaQuery().eq(UfaceDev::getProjectSn, paramMap.get("projectSn").toString()))
.stream().map(d -> d.getId().toString()).collect(Collectors.toList()); .stream().map(d -> d.getId().toString()).collect(Collectors.toList());
if (ufaceDevId.size() > 0) { if (ufaceDevId.size() > 0) {
String ufaceDevIds = ufaceDevId.stream().collect(Collectors.joining(",")); String ufaceDevIds = ufaceDevId.stream().collect(Collectors.joining(","));
for (String id : ids) { for (String id : workerIds) {
paramMap.put("id", id); paramMap.put("id", id);
paramMap.put("ufaceDevId", ufaceDevIds); paramMap.put("ufaceDevId", ufaceDevIds);
paramMap.put("accountType", 2); paramMap.put("accountType", 2);

View File

@ -366,6 +366,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/xmgl/carInfo/save").permitAll() .antMatchers("/xmgl/carInfo/save").permitAll()
.antMatchers("/xmgl/xzElectrical/**").permitAll() .antMatchers("/xmgl/xzElectrical/**").permitAll()
.antMatchers("/xmgl/xzVisitorManageRecord/save").permitAll() .antMatchers("/xmgl/xzVisitorManageRecord/save").permitAll()
.antMatchers("/xmgl/xzWorkerInfoAuditRecord/viewWorkerInfoDetail").permitAll()
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous() .antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
.anyRequest().authenticated() // 剩下所有的验证都需要验证. .anyRequest().authenticated() // 剩下所有的验证都需要验证.
.and() .and()