|
@@ -48,6 +48,8 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
|
|
|
private BillPcrMapper billPcrMapper;
|
|
|
@Autowired
|
|
|
private BillGoodsInventoryMapper inventoryMapper;
|
|
|
+ @Autowired
|
|
|
+ private SysAccountMultilevelMapper multilevelMapper;
|
|
|
|
|
|
@Override
|
|
|
public Result listPersonalPcr(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
@@ -623,6 +625,52 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
|
|
|
}
|
|
|
pcrMapper.insert(billClean);
|
|
|
baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
|
|
|
+ //下发人脸门禁白名单
|
|
|
+ if (billPcr.getVistitType() == 0) {
|
|
|
+ //人员隔离中心流程
|
|
|
+ if (billPcr.getMidId() == 16 || billPcr.getMidId() == 29 || billPcr.getMidId() == 41 || billPcr.getMidId() == 53) {
|
|
|
+ DeviceList deviceList = deviceListMapper.selectOne(new QueryWrapper<DeviceList>().eq("farm_id", "2"));
|
|
|
+ PeopleList peopleList = new PeopleList();
|
|
|
+ peopleList.setFarmId("2");
|
|
|
+ peopleList.setDeviceCode(deviceList.getDeviceCode());
|
|
|
+ peopleList.setUserId(billPcr.getProcessId().toString());
|
|
|
+ peopleList.setUserName(billPcr.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, 2);
|
|
|
+ Date date1 = calendar.getTime();
|
|
|
+ peopleList.setOutTime(date1);
|
|
|
+ SysAccountMultilevel sysAccountMultilevel = multilevelMapper.selectById(billPcr.getAdmissionUserId());
|
|
|
+ peopleList.setImgUrl(sysAccountMultilevel.getImgUrl());
|
|
|
+ peopleListMapper.insert(peopleList);
|
|
|
+ }
|
|
|
+ //人员基地外围
|
|
|
+ if (billPcr.getMidId() == 17 || billPcr.getMidId() == 30 || billPcr.getMidId() == 42 || billPcr.getMidId() == 54) {
|
|
|
+ DeviceList deviceList = deviceListMapper.selectOne(new QueryWrapper<DeviceList>().eq("farm_id", billPcr.getFarmId()));
|
|
|
+ PeopleList peopleList = new PeopleList();
|
|
|
+ peopleList.setFarmId(billPcr.getFarmId().toString());
|
|
|
+ peopleList.setDeviceCode(deviceList.getDeviceCode());
|
|
|
+ UUID uuid = UUID.randomUUID();
|
|
|
+ peopleList.setUserId(uuid.toString());
|
|
|
+ peopleList.setUserName(billPcr.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, 2);
|
|
|
+ Date date1 = calendar.getTime();
|
|
|
+ peopleList.setOutTime(date1);
|
|
|
+ SysAccountMultilevel sysAccountMultilevel = multilevelMapper.selectById(billPcr.getAdmissionUserId());
|
|
|
+ peopleList.setImgUrl(sysAccountMultilevel.getImgUrl());
|
|
|
+ peopleListMapper.insert(peopleList);
|
|
|
+ }
|
|
|
+ }
|
|
|
} else if (nextId == 3) {
|
|
|
//新增洗澡
|
|
|
BillClean billClean = (BillClean) newObject;
|
|
@@ -689,71 +737,7 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
|
|
|
inventoryMapper.insert(before);
|
|
|
baseProcess.setCurrentFlowId(baseProcess.getCurrentFlowId() + "," + nextId);
|
|
|
}
|
|
|
-// //通过生成门禁白名单
|
|
|
-// QueryWrapper<DeviceList> deviceListQueryWrapper = new QueryWrapper<>();
|
|
|
-// deviceListQueryWrapper.eq("farm_id", billPcr.getFarmId()).eq("location_id", baseLocation.getId());
|
|
|
-// List<DeviceList> deviceLists = deviceListMapper.selectList(deviceListQueryWrapper);
|
|
|
-// //找到对应的入场申请表
|
|
|
-// QueryWrapper<BillPersonnelAdmission> queryWrapper1 = new QueryWrapper<>();
|
|
|
-// queryWrapper1.eq("farm_id", billPcr.getFarmId()).eq("process_id", baseProcess.getId());
|
|
|
-// BillPersonnelAdmission billPersonnelAdmission = personnelAdmissionMapper.selectOne(queryWrapper1);
|
|
|
-// if (deviceLists.size() > 0) {
|
|
|
-// for (DeviceList deviceList : deviceLists) {
|
|
|
-// //通过生成门禁白名单
|
|
|
-// PeopleList peopleList = new PeopleList();
|
|
|
-// peopleList.setFarmId(billPcr.getFarmId().toString());
|
|
|
-// peopleList.setDeviceCode(deviceList.getDeviceCode());
|
|
|
-// peopleList.setUserId(billPcr.getAdmissionUserId());
|
|
|
-// peopleList.setUserName(billPcr.getAdmissionUserName());
|
|
|
-// peopleList.setPassword("123456");
|
|
|
-// peopleList.setType(0);
|
|
|
-// peopleList.setCreateTime(new Date());
|
|
|
-// Date date2 = new Date();
|
|
|
-// Calendar calendar = Calendar.getInstance();
|
|
|
-// calendar.setTime(date2);
|
|
|
-// 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://39.173.90.137:8040/addDeviceUser")
|
|
|
-// .header(Header.CONTENT_TYPE, "multipart/form-data")
|
|
|
-// .form(jsonObject)
|
|
|
-// .timeout(30 * 1000).execute().body();
|
|
|
-// System.out.println(post);
|
|
|
-// }
|
|
|
-// }
|
|
|
+
|
|
|
baseProcess.setUpdateDate(baseProcess.getUpdateDate() + "," + sdf.format(new Date()));
|
|
|
baseProcess.setCurrentLocation(baseProcess.getCurrentLocation() + "," + baseLocation.getLocationName());
|
|
|
baseProcess.setCurrentLocationId(baseProcess.getCurrentLocationId() + "," + baseLocation.getId());
|
|
@@ -789,13 +773,9 @@ public class BillPcrServiceImpl extends ServiceImpl<BillPcrMapper, BillPcr> impl
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
- String s = "0,1,0,2,0";
|
|
|
- String a = "0,1,0,2,0";
|
|
|
- String s1 = "1";
|
|
|
- int i = s.indexOf(s1);
|
|
|
- StringBuilder sb = new StringBuilder(a);
|
|
|
- sb.setCharAt(i, '3');
|
|
|
- System.out.println(sb);
|
|
|
+ Random random = new Random();
|
|
|
+ int randomNum = random.nextInt(90000000) + 1000;
|
|
|
+ System.out.println(randomNum);
|
|
|
|
|
|
// String s3 = a.substring(0, s.indexOf(s1) + 3);
|
|
|
//// System.out.println(s.indexOf(s1));
|