|
@@ -116,9 +116,9 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
|
return new Result(10001, "手机号格式错误!", false);
|
|
|
}
|
|
|
if (papersType.equals("0")) {
|
|
|
- if (!IDCardValidator.isValidIDCard(papersCode)) {
|
|
|
- return new Result(10001, "身份证号格式错误!", false);
|
|
|
- }
|
|
|
+// if (!IDCardValidator.isValidIDCard(papersCode)) {
|
|
|
+// return new Result(10001, "身份证号格式错误!", false);
|
|
|
+// }
|
|
|
}
|
|
|
BaseWashoutPoint baseWashoutPoint1 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>().lambda()
|
|
|
.eq(BaseWashoutPoint::getLocationId, departureId).like(BaseWashoutPoint::getFarmIds, farmId)
|
|
@@ -313,9 +313,9 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
|
return new Result(10001, "手机号格式错误!", false);
|
|
|
}
|
|
|
if (papersType.equals("0")) {
|
|
|
- if (!IDCardValidator.isValidIDCard(papersCode)) {
|
|
|
- return new Result(10001, "身份证号格式错误!", false);
|
|
|
- }
|
|
|
+// if (!IDCardValidator.isValidIDCard(papersCode)) {
|
|
|
+// return new Result(10001, "身份证号格式错误!", false);
|
|
|
+// }
|
|
|
}
|
|
|
BaseWashoutPoint baseWashoutPoint1 = baseWashoutPointMapper.selectOne(new QueryWrapper<BaseWashoutPoint>()
|
|
|
.lambda().eq(BaseWashoutPoint::getLocationId, departureId).like(BaseWashoutPoint::getFarmIds, farmId)
|
|
@@ -350,11 +350,12 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
|
billPersonnelAdmission.setPapersType(Integer.parseInt(papersType));
|
|
|
billPersonnelAdmission.setPapersCode(papersCode);
|
|
|
billPersonnelAdmission.setUserImgUrl(sysAccountMultilevel1.getImgUrl());
|
|
|
- if (uploadImage.getImageCom(feedImgUrl).equals("上传失败")) {
|
|
|
+ String ss=uploadImage.getImageCom(feedImgUrl);
|
|
|
+ if (ss.equals("上传失败")) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return new Result(10001, "图片上传失败", false);
|
|
|
}
|
|
|
- billPersonnelAdmission.setFeedImgUrl(uploadImage.getImageCom(feedImgUrl));
|
|
|
+ billPersonnelAdmission.setFeedImgUrl(ss);
|
|
|
billPersonnelAdmission.setResource(resource);
|
|
|
billPersonnelAdmission.setRemark(remark);
|
|
|
billPersonnelAdmission.setCleanId(cleanId);
|
|
@@ -363,11 +364,12 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
|
billPersonnelAdmission.setCarNum(carNum);
|
|
|
}
|
|
|
if (ObjectUtil.isNotEmpty(imgUrl)) {
|
|
|
- if (uploadImage.getImageCom(imgUrl).equals("上传失败")) {
|
|
|
+ String s = uploadImage.getImageCom(imgUrl);
|
|
|
+ if (s.equals("上传失败")) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return new Result(10001, "图片上传失败", false);
|
|
|
}
|
|
|
- billPersonnelAdmission.setImgUrl(uploadImage.getImageCom(imgUrl));
|
|
|
+ billPersonnelAdmission.setImgUrl(s);
|
|
|
}
|
|
|
if (ObjectUtil.isNotEmpty(img)) {
|
|
|
billPersonnelAdmission.setImgUrl(img);
|
|
@@ -573,6 +575,40 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
|
if (billPersonnelAdmission.getBillStatus() != 0) {
|
|
|
return new Result(10001, "该订单已通过,无需再次点击!", false);
|
|
|
}
|
|
|
+ //新增人员转场,不需要流程,入场审批通过后直接下发门禁,流程结束
|
|
|
+ if (billPersonnelAdmission.getMidId()==60||billPersonnelAdmission.getMidId()==61
|
|
|
+ ||billPersonnelAdmission.getMidId()==67||billPersonnelAdmission.getMidId()==68) {
|
|
|
+ DeviceList deviceList = deviceListMapper.selectOne(new QueryWrapper<DeviceList>().eq("farm_id", billPersonnelAdmission.getFarmId()));
|
|
|
+ PeopleList peopleList = new PeopleList();
|
|
|
+ peopleList.setFarmId(billPersonnelAdmission.getFarmId().toString());
|
|
|
+ peopleList.setDeviceCode(deviceList.getDeviceCode());
|
|
|
+ peopleList.setUserId(billPersonnelAdmission.getProcessId().toString());
|
|
|
+ peopleList.setUserName(billPersonnelAdmission.getAdmissionUserName());
|
|
|
+ peopleList.setPassword("123456");
|
|
|
+ peopleList.setType(0);
|
|
|
+ peopleList.setCreateTime(new Date());
|
|
|
+ Date now = new Date();
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTime(now);
|
|
|
+ calendar.add(Calendar.HOUR_OF_DAY, 4);
|
|
|
+ Date date1 = calendar.getTime();
|
|
|
+ peopleList.setOutTime(date1);
|
|
|
+ SysAccountMultilevel sysAccountMultilevel = multilevelMapper.selectById(billPersonnelAdmission.getAdmissionUserId());
|
|
|
+ peopleList.setImgUrl(sysAccountMultilevel.getImgUrl());
|
|
|
+ peopleListMapper.insert(peopleList);
|
|
|
+ billPersonnelAdmission.setBillStatus(2);
|
|
|
+ baseProcess.setProcessType(1);
|
|
|
+ baseProcess.setCurrentStatus("2");
|
|
|
+ String status = baseProcess.getAllLocationStatus();
|
|
|
+ String[] split1 = status.split(",");
|
|
|
+ split1[0] = "3";
|
|
|
+ baseProcess.setAllLocationStatus(split1[0] + status.substring(1));
|
|
|
+ baseProcessMapper.updateById(baseProcess);
|
|
|
+ billPersonnelAdmissionMapper.updateById(billPersonnelAdmission);
|
|
|
+ return Result.SUCCESS();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//通过
|
|
|
billPersonnelAdmission.setBillStatus(1);
|
|
|
|
|
@@ -853,138 +889,6 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
|
baseProcess.setAllLocationStatus("2");
|
|
|
//TODO 紧急入场通过先不处理
|
|
|
}
|
|
|
-
|
|
|
- //通过生成门禁白名单
|
|
|
- /* QueryWrapper<DeviceList> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("farm_id", billPersonnelAdmission.getFarmId()).eq("location_id", billPersonnelAdmission.getDestId());
|
|
|
- DeviceList deviceList = deviceListMapper.selectOne(queryWrapper);
|
|
|
- if (ObjectUtil.isNotEmpty(deviceList)) {
|
|
|
- if (deviceList.getDeviceType() == 0) {
|
|
|
- //通过生成门禁白名单
|
|
|
- PeopleList peopleList = new PeopleList();
|
|
|
- peopleList.setFarmId(billPersonnelAdmission.getFarmId().toString());
|
|
|
- peopleList.setDeviceCode(deviceList.getDeviceCode());
|
|
|
- peopleList.setUserId(billPersonnelAdmission.getAdmissionUserId());
|
|
|
- peopleList.setUserName(billPersonnelAdmission.getAdmissionUserName());
|
|
|
- peopleList.setPassword("123456");
|
|
|
- peopleList.setType(0);
|
|
|
- peopleList.setCreateTime(new Date());
|
|
|
- Date date = new Date();
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
- calendar.setTime(date);
|
|
|
- calendar.add(Calendar.HOUR_OF_DAY, 2);
|
|
|
- Date date1 = calendar.getTime();
|
|
|
- peopleList.setOutTime(date1);
|
|
|
- peopleListMapper.insert(peopleList);
|
|
|
-
|
|
|
- HashMap<String, Object> jsonObject = new HashMap<>();
|
|
|
- jsonObject.put("seq", deviceList.getDeviceCode());
|
|
|
-// String savePath = "D:\\works\\pig_projects\\甜妹.jpg";
|
|
|
- String savePath = "/opt/huatong/test.jpg";
|
|
|
- URL url = new URL(billPersonnelAdmission.getUserImgUrl());
|
|
|
- HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
|
|
- connection.setRequestMethod("GET");
|
|
|
- int resCode = connection.getResponseCode();
|
|
|
- if (resCode == HttpURLConnection.HTTP_OK) {
|
|
|
- InputStream inputStream = connection.getInputStream();
|
|
|
- byte[] buffer = new byte[4096];
|
|
|
- int length;
|
|
|
- //读取数据并写入到文件中
|
|
|
- try (FileOutputStream outStream = new FileOutputStream(savePath)) {
|
|
|
- while ((length = inputStream.read(buffer)) != -1) {
|
|
|
- outStream.write(buffer, 0, length);
|
|
|
- }
|
|
|
- outStream.flush();
|
|
|
- } finally {
|
|
|
- inputStream.close();
|
|
|
- }
|
|
|
- } else {
|
|
|
- System.out.println("文件下载错误码为" + resCode);
|
|
|
- }
|
|
|
-
|
|
|
-// jsonObject.put("face", FileUtil.file("D:\\works\\pig_projects\\甜妹.jpg"));
|
|
|
- jsonObject.put("face", FileUtil.file(savePath));
|
|
|
- jsonObject.put("name", billPersonnelAdmission.getAdmissionUserName());
|
|
|
- jsonObject.put("password", "123456");
|
|
|
- jsonObject.put("timestamp", date1.getTime());
|
|
|
- jsonObject.put("uid", billPersonnelAdmission.getAdmissionUserId());
|
|
|
- String post = HttpRequest.post("http://127.0.0.1:8050/addDeviceUser")
|
|
|
- .header(Header.CONTENT_TYPE, "multipart/form-data")
|
|
|
- .form(jsonObject)
|
|
|
- .timeout(30 * 1000).execute().body();
|
|
|
- System.out.println(post);
|
|
|
- } else {
|
|
|
- //车辆闸机
|
|
|
- PeopleList peopleList = new PeopleList();
|
|
|
- peopleList.setFarmId(billPersonnelAdmission.getFarmId().toString());
|
|
|
- peopleList.setDeviceCode(deviceList.getDeviceCode());
|
|
|
- peopleList.setUserId(billPersonnelAdmission.getAdmissionUserId());
|
|
|
- peopleList.setUserName(billPersonnelAdmission.getAdmissionUserName());
|
|
|
- peopleList.setPassword("123456");
|
|
|
- peopleList.setType(1);
|
|
|
- peopleList.setCreateTime(new Date());
|
|
|
- Date date = new Date();
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
- calendar.setTime(date);
|
|
|
- calendar.add(Calendar.HOUR_OF_DAY, 3);
|
|
|
- Date date1 = calendar.getTime();
|
|
|
- peopleList.setOutTime(date1);
|
|
|
- peopleListMapper.insert(peopleList);
|
|
|
-
|
|
|
- //需要先验证车辆是否存在白名单内,如果车辆已存在于白名单当中,则需要更新白名单,将车牌从白名单中删除后
|
|
|
- //重新进行添加,如果车辆不存在于白名单当中则直接添加入白名单
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("seq", deviceList.getDeviceCode());
|
|
|
- jsonObject.put("isBlack", false);
|
|
|
- String request = HttpRequest.get("http://127.0.0.1:8050/getCarDeviceWoBList")
|
|
|
- .body(jsonObject.toJSONString())
|
|
|
- .header(Header.CONTENT_TYPE, "application/json")
|
|
|
- .timeout(30 * 1000).execute().body();
|
|
|
- JSONObject object = JSON.parseObject(request);
|
|
|
- System.out.println(object);
|
|
|
- JSONArray data = (JSONArray) object.get("data");
|
|
|
- System.out.println(data);
|
|
|
- if (data.size() > 0) {
|
|
|
- for (int i = 0; i < data.size(); i++) {
|
|
|
- JSONObject jsonObject1 = (JSONObject) data.get(i);
|
|
|
- if (jsonObject1.get("plate").equals(billPersonnelAdmission.getCarNum())) {
|
|
|
- JSONObject jsonObject2 = new JSONObject();
|
|
|
- jsonObject2.put("isBlack", false);
|
|
|
- jsonObject2.put("seq", deviceList.getDeviceCode());
|
|
|
- List<Integer> list = new ArrayList<>();
|
|
|
- list.add((Integer) jsonObject1.get("cid"));
|
|
|
- jsonObject2.put("cids", list);
|
|
|
-
|
|
|
- String body = HttpRequest.post(" http://127.0.0.1:8050/delCarDeviceWoBList").header(Header.CONTENT_TYPE, "application/json")
|
|
|
- .body(jsonObject2.toJSONString())
|
|
|
- .timeout(30 * 1000).execute().body();
|
|
|
- System.out.println(body);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- JSONObject jsonObject1 = new JSONObject();
|
|
|
- JSONArray jsonArray = new JSONArray();
|
|
|
- JSONObject object1 = new JSONObject();
|
|
|
- jsonObject1.put("seq", deviceList.getDeviceCode());
|
|
|
- jsonObject1.put("isBlack", false);
|
|
|
-
|
|
|
- object1.put("timestamp", date1.getTime());
|
|
|
- object1.put("name", billPersonnelAdmission.getAdmissionUserName());
|
|
|
- object1.put("plate", billPersonnelAdmission.getCarNum());
|
|
|
-
|
|
|
- jsonArray.add(object1);
|
|
|
- jsonObject1.put("plates", jsonArray);
|
|
|
-
|
|
|
- String post = HttpRequest.post(" http://127.0.0.1:8050/addCarDeviceWoBList")
|
|
|
- .header(Header.CONTENT_TYPE, "application/json")
|
|
|
- .body(jsonObject1.toJSONString())
|
|
|
- .timeout(30 * 1000).execute().body();
|
|
|
- System.out.println(post);
|
|
|
- }
|
|
|
-
|
|
|
- }*/
|
|
|
}
|
|
|
baseProcessMapper.updateById(baseProcess);
|
|
|
billPersonnelAdmissionMapper.updateById(billPersonnelAdmission);
|
|
@@ -1346,9 +1250,9 @@ public class BillPersonnelAdmissionServiceImpl extends ServiceImpl<BillPersonnel
|
|
|
return new Result(10001, "手机号格式错误!", false);
|
|
|
}
|
|
|
if (papersType.equals("0")) {
|
|
|
- if (!IDCardValidator.isValidIDCard(papersCode)) {
|
|
|
- return new Result(10001, "身份证号格式错误!", false);
|
|
|
- }
|
|
|
+// if (!IDCardValidator.isValidIDCard(papersCode)) {
|
|
|
+// return new Result(10001, "身份证号格式错误!", false);
|
|
|
+// }
|
|
|
}
|
|
|
String picUrl = null;
|
|
|
|