From 67d3a30584b649b59c127f79b9cb262f01fdff0f Mon Sep 17 00:00:00 2001 From: zc Date: Fri, 5 Jun 2026 17:22:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E8=B4=B9=E6=94=B9=E9=80=A0-=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E5=90=8C=E6=AD=A5=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/renren/controller/CardController.java | 68 +++++++++++++++---- 1 file changed, 56 insertions(+), 12 deletions(-) diff --git a/renren-api/src/main/java/io/renren/controller/CardController.java b/renren-api/src/main/java/io/renren/controller/CardController.java index b9de252..7f2296e 100644 --- a/renren-api/src/main/java/io/renren/controller/CardController.java +++ b/renren-api/src/main/java/io/renren/controller/CardController.java @@ -98,6 +98,30 @@ public class CardController { equipmentService.updateSysEquipment(e); } } + + + Object queryperson = redisUtils.get("queryperson:" + json.getString("dev_id")); + if (ObjectUtil.isNotEmpty(queryperson)) { + String emp_id = queryperson.toString(); + api.put("api","queryperson"); + Long time = new Date().getTime() / 1000; + api.put("time", time); + String noncestr = UUID.randomUUID().toString(); + api.put("noncestr",noncestr); + api.put("interval","10000"); + String sign = EncodeByMD5(time + noncestr + "FFFFFFFFFFFF"); + api.put("sign",sign); + api.put("transaction_id",json.getString("transaction_id")); + api.put("query_mode","1");//1根据工号查人 + api.put("account_id",""); + api.put("emp_id",emp_id); + api.put("photo",""); + api.put("rec_id",""); + redisUtils.delete("queryperson:" + json.getString("dev_id")); + return api; + } + + //获取设备的参数,只获取一次,当设备更新时再获取一次 if ("0".equals(equipment.getConsumeFlag())){ CardEntity card=new CardEntity(); @@ -439,6 +463,7 @@ public class CardController { card.setWhitelist(whitelist); String cards = gson.toJson(card); api = JSONObject.parseObject(cards); + log.info("增加人员白名单{}", api.toJSONString()); return api; } //删除名单 @@ -446,26 +471,27 @@ public class CardController { delpeople.setDelFlag(2L); delpeople.setEquipmentId(equipment.getId()+""); List delPeopleList=peopleService.selectSysPeopleList(delpeople); - if(delPeopleList!=null&&delPeopleList.size()>0){ + if (delPeopleList != null && delPeopleList.size() > 0) { card.setApi("delperson"); - JSONArray whitelist=new JSONArray(); - for(SysPeople ps:delPeopleList){ - if (StringUtils.isNotEmpty(ps.getEquipmentId())){ - JSONObject objs=new JSONObject(); - objs.put("rec_id",ps.getId()); - objs.put("account_id",ps.getId()); - objs.put("emp_id",ps.getGh()); - objs.put("only_del_photo","0"); + JSONArray whitelist = new JSONArray(); + for (SysPeople ps : delPeopleList) { + if (StringUtils.isNotEmpty(ps.getEquipmentId())) { + JSONObject objs = new JSONObject(); + objs.put("rec_id", ps.getId()); + objs.put("account_id", ps.getId()); + objs.put("emp_id", ps.getGh()); + objs.put("only_del_photo", "0"); whitelist.add(objs); - SysPeopleEquipment spe=new SysPeopleEquipment(); + SysPeopleEquipment spe = new SysPeopleEquipment(); spe.setPeopleId(ps.getId()); spe.setEquipmentId(equipment.getId()); peopleEquipmentService.deleteSysPeopleEquipment(spe); } } card.setWhitelist(whitelist); - String cards=gson.toJson(card); - api=JSONObject.parseObject(cards); + String cards = gson.toJson(card); + api = JSONObject.parseObject(cards); + log.info("删除人员白名单{}", api.toJSONString()); return api; } //发布菜品 @@ -478,6 +504,7 @@ public class CardController { @RequestMapping(value = "addperson",method = RequestMethod.POST) @ApiOperation("设备收到增加名单处理结果接口") public void addperson(@RequestBody JSONObject json){ + log.info("增加名单处理结果接口{}", json.toJSONString()); //如果有记录时则要处理记录后再应答,保存后的id回传给设备,方便设备对记录作标志 cardpwd FFFFFFFFFFFF JSONArray whitelist= JSONArray.parseArray(JSONArray.toJSONString(json.get("whitelist"))); for(Object o:whitelist){ @@ -1711,6 +1738,23 @@ public class CardController { + @RequestMapping(value = "webQueryperson",method = RequestMethod.POST) + @ApiOperation("主动查询消费机人员信息") + public void webQueryperson(@RequestBody JSONObject json){ + String dev_id = json.getString("dev_id"); + String emp_id = json.getString("emp_id"); + redisUtils.set("queryperson:" + dev_id, emp_id, 8); + } + + + + @RequestMapping(value = "queryperson",method = RequestMethod.POST) + @ApiOperation("设备上传查询人员信息") + public void queryperson(@RequestBody JSONObject json){ + log.info("设备上传查询人员信息{}", json.toJSONString()); + } + + /** * 对字符串进行32位MD5加密