Merge remote-tracking branch 'origin/guoshengxiong' into guoshengxiong

This commit is contained in:
guoshengxiong 2024-05-14 18:41:57 +08:00
commit 6a6459e07c
2 changed files with 8 additions and 6 deletions

View File

@ -94,6 +94,7 @@ public class CarInfoController {
@ApiOperation(value = "添加车辆黑白名单管理信息", notes = "添加车辆黑白名单管理信息", httpMethod = "POST") @ApiOperation(value = "添加车辆黑白名单管理信息", notes = "添加车辆黑白名单管理信息", httpMethod = "POST")
@PostMapping(value = "/save") @PostMapping(value = "/save")
public Result<CarInfo> save(@RequestBody Map<String, Object> map) { public Result<CarInfo> save(@RequestBody Map<String, Object> map) {
log.info("开始添加车辆" + map);
Object alarmPushWorkerId = map.get("alarmPushWorkerId"); Object alarmPushWorkerId = map.get("alarmPushWorkerId");
String userId = map.get("enterpriseId").toString(); String userId = map.get("enterpriseId").toString();
Object driverWorkerName = map.get("driverWorkerName"); Object driverWorkerName = map.get("driverWorkerName");

View File

@ -253,6 +253,7 @@ public class XzWorkerInfoAuditRecordController {
} }
workerInfo.add(detailObj); workerInfo.add(detailObj);
} }
log.info("开始人员下发设备解析信息" + workerInfo);
for (Object o : workerInfo) { for (Object o : workerInfo) {
JSONObject object = JSONObject.parseObject(JSON.toJSONString(o)); JSONObject object = JSONObject.parseObject(JSON.toJSONString(o));
String workerId = object.getJSONArray("workerId").get(0).toString(); String workerId = object.getJSONArray("workerId").get(0).toString();
@ -268,21 +269,21 @@ public class XzWorkerInfoAuditRecordController {
workerInsurance.setPhotoUrl(object.getJSONArray("insurance").getJSONObject(0).getString("name") + "*" + object.getJSONArray("insurance").getJSONObject(0).getString("url")); workerInsurance.setPhotoUrl(object.getJSONArray("insurance").getJSONObject(0).getString("name") + "*" + object.getJSONArray("insurance").getJSONObject(0).getString("url"));
insuranceList.add(workerInsurance); insuranceList.add(workerInsurance);
infoAuditRecord.setInsuranceInfo(JSON.toJSONString(insuranceList)); infoAuditRecord.setInsuranceInfo(JSON.toJSONString(insuranceList));
List<WorkerCertificate> certificateList = new ArrayList<>(); List<WorkerCertificate> certificateList = new ArrayList<>();
JSONArray certificate = object.getJSONArray("certificate"); JSONArray certificate = object.getJSONArray("certificate");
if (certificate != null) { if (certificate != null) {
for (int i = 0; i < certificate.size(); i++) { for (int i = 0; i < certificate.size(); i++) {
WorkerCertificate workerCertificate = new WorkerCertificate(); WorkerCertificate workerCertificate = new WorkerCertificate();
JSONObject jsonObject = certificate.getJSONObject(i); JSONObject jsonObject = certificate.getJSONObject(i);
int p = 0;
for (String s : jsonObject.keySet()) { for (String s : jsonObject.keySet()) {
if (p == 0) { Object o1 = jsonObject.getJSONArray(s).get(0);
workerCertificate.setCertificateType(Integer.parseInt(jsonObject.getJSONArray(s).get(0).toString())); if (o1 instanceof JSONObject) {
} else { System.out.println("====json");
workerCertificate.setPhotoUrl(jsonObject.getJSONArray(s).getJSONObject(0).getString("name") + "*" + jsonObject.getJSONArray(s).getJSONObject(0).getString("url")); workerCertificate.setPhotoUrl(jsonObject.getJSONArray(s).getJSONObject(0).getString("name") + "*" + jsonObject.getJSONArray(s).getJSONObject(0).getString("url"));
} else {
System.out.println("====number");
workerCertificate.setCertificateType(Integer.parseInt(jsonObject.getJSONArray(s).get(0).toString()));
} }
p ++;
} }
certificateList.add(workerCertificate); certificateList.add(workerCertificate);
} }