消费改造-餐盘监测设备

This commit is contained in:
zc
2026-02-06 15:46:59 +08:00
parent 8a51bd9ed7
commit 0e1a3404dc
3 changed files with 46 additions and 31 deletions

View File

@@ -1,5 +1,8 @@
package io.renren.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayApiException;
@@ -21,10 +24,7 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.math.BigInteger;
import java.security.MessageDigest;
@@ -825,6 +825,7 @@ public class CardController {
paramMap.put("recordDateTime", sdf1.format(startDate));
paramMap.put("code", people.getId());//认证人员员工号
paramMap.put("consumeInterval", timeType);
paramMap.put("dev_id", devId);
//请求当天的消费信息
JSONObject jsons1 = queryPeopleDay(paramMap);
if (!"0".equals(jsons1.get("code") + "")) {
@@ -1235,6 +1236,21 @@ public class CardController {
public JSONObject queryPeopleDay(Map<String, Object> paramMap) {
JSONObject obj = new JSONObject();
String devId = (String) paramMap.get("dev_id");
if (StrUtil.equals("8", devId) || StrUtil.equals("9", devId)) {
Object data = redisUtils.get("xf:heartbeat:" + paramMap.get("dev_id"));
if (ObjectUtil.isNull(data)) {
obj.put("code", "1");
obj.put("msg", "网络异常");
return obj;
}
if (StrUtil.equals("0000", data.toString())) {
obj.put("code", "1");
obj.put("msg", "请添加餐盘");
return obj;
}
}
ConsumePeopleDay consumePeopleDay = new ConsumePeopleDay();
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
@@ -1246,20 +1262,19 @@ public class CardController {
consumePeopleDay.setAccountId(paramMap.get("code") + "");
consumePeopleDay.setConsumeInterval(paramMap.get("consumeInterval") + "");
List<ConsumePeopleDay> list = peopleDayService.selectConsumePeopleDayList(consumePeopleDay);
if(list.size()>0){
if (CollUtil.isNotEmpty(list)) {
ConsumePeopleDay consumePeople = list.get(0);
if ("1".equals(consumePeople.getIsConsume())) {
obj.put("code", "2");
obj.put("msg", consumePeople.getAccountName() + "重复就餐");
return obj;
} else {
obj.put("code", "0");
obj.put("msg", consumePeople.getAccountName() + "核验通过");
consumePeople.setIsConsume("1");
consumePeople.setUpdateTime(new Date());
peopleDayService.updateConsumePeopleDay(consumePeople);
return obj;
}
return obj;
} else {
obj.put("code", "1");
obj.put("msg", "未报餐");
@@ -1422,6 +1437,7 @@ public class CardController {
paramMap.put("recordDateTime", sdf1.format(startDate));
paramMap.put("code", people.getId());//认证人员员工号
paramMap.put("consumeInterval", timeType);
paramMap.put("dev_id", devId);
//请求当天的消费信息
JSONObject jsons1 = queryPeopleDay(paramMap);
if (!"0".equals(jsons1.get("code") + "")) {

View File

@@ -2,15 +2,9 @@ spring:
datasource:
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
#url: jdbc:mysql://127.0.0.1:3306/fk_cloud?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
#username: root
#password: 111111
url: jdbc:mysql://192.168.124.185:3306/taihe_cloud?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
url: jdbc:mysql://127.0.0.1:3306/xa_cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: SQLsql123
#url: jdbc:mysql://127.0.0.1:8123/chungu?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
#username: root
#password: 3dxz2023
password: root
initial-size: 10
max-active: 100
min-idle: 10

View File

@@ -25,6 +25,7 @@ spring:
# 环境 dev|test|prod
profiles:
active: prod
# active: dev
messages:
encoding: UTF-8
basename: i18n/messages
@@ -45,6 +46,10 @@ spring:
host: 127.0.0.1
port: 6379
password: # 密码(默认为空)
# host: 192.168.2.30
# password: redis2025
# database: 5
# port: 6379
timeout: 6000ms # 连接超时时长(毫秒)
jedis:
pool: