消费改造-人员同步筛选

This commit is contained in:
zc
2026-06-05 17:22:41 +08:00
parent 2d77fb02f7
commit 67d3a30584

View File

@@ -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<SysPeople> 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加密