消费改造-餐盘监测设备
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
package io.renren.controller;
|
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.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.alipay.api.AlipayApiException;
|
import com.alipay.api.AlipayApiException;
|
||||||
@@ -21,10 +24,7 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
@@ -825,6 +825,7 @@ public class CardController {
|
|||||||
paramMap.put("recordDateTime", sdf1.format(startDate));
|
paramMap.put("recordDateTime", sdf1.format(startDate));
|
||||||
paramMap.put("code", people.getId());//认证人员员工号
|
paramMap.put("code", people.getId());//认证人员员工号
|
||||||
paramMap.put("consumeInterval", timeType);
|
paramMap.put("consumeInterval", timeType);
|
||||||
|
paramMap.put("dev_id", devId);
|
||||||
//请求当天的消费信息
|
//请求当天的消费信息
|
||||||
JSONObject jsons1 = queryPeopleDay(paramMap);
|
JSONObject jsons1 = queryPeopleDay(paramMap);
|
||||||
if (!"0".equals(jsons1.get("code") + "")) {
|
if (!"0".equals(jsons1.get("code") + "")) {
|
||||||
@@ -1235,6 +1236,21 @@ public class CardController {
|
|||||||
|
|
||||||
public JSONObject queryPeopleDay(Map<String, Object> paramMap) {
|
public JSONObject queryPeopleDay(Map<String, Object> paramMap) {
|
||||||
JSONObject obj = new JSONObject();
|
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();
|
ConsumePeopleDay consumePeopleDay = new ConsumePeopleDay();
|
||||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
try {
|
try {
|
||||||
@@ -1246,20 +1262,19 @@ public class CardController {
|
|||||||
consumePeopleDay.setAccountId(paramMap.get("code") + "");
|
consumePeopleDay.setAccountId(paramMap.get("code") + "");
|
||||||
consumePeopleDay.setConsumeInterval(paramMap.get("consumeInterval") + "");
|
consumePeopleDay.setConsumeInterval(paramMap.get("consumeInterval") + "");
|
||||||
List<ConsumePeopleDay> list = peopleDayService.selectConsumePeopleDayList(consumePeopleDay);
|
List<ConsumePeopleDay> list = peopleDayService.selectConsumePeopleDayList(consumePeopleDay);
|
||||||
if(list.size()>0){
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
ConsumePeopleDay consumePeople = list.get(0);
|
ConsumePeopleDay consumePeople = list.get(0);
|
||||||
if ("1".equals(consumePeople.getIsConsume())) {
|
if ("1".equals(consumePeople.getIsConsume())) {
|
||||||
obj.put("code", "2");
|
obj.put("code", "2");
|
||||||
obj.put("msg", consumePeople.getAccountName() + "重复就餐");
|
obj.put("msg", consumePeople.getAccountName() + "重复就餐");
|
||||||
return obj;
|
|
||||||
} else {
|
} else {
|
||||||
obj.put("code", "0");
|
obj.put("code", "0");
|
||||||
obj.put("msg", consumePeople.getAccountName() + "核验通过");
|
obj.put("msg", consumePeople.getAccountName() + "核验通过");
|
||||||
consumePeople.setIsConsume("1");
|
consumePeople.setIsConsume("1");
|
||||||
consumePeople.setUpdateTime(new Date());
|
consumePeople.setUpdateTime(new Date());
|
||||||
peopleDayService.updateConsumePeopleDay(consumePeople);
|
peopleDayService.updateConsumePeopleDay(consumePeople);
|
||||||
return obj;
|
|
||||||
}
|
}
|
||||||
|
return obj;
|
||||||
} else {
|
} else {
|
||||||
obj.put("code", "1");
|
obj.put("code", "1");
|
||||||
obj.put("msg", "未报餐");
|
obj.put("msg", "未报餐");
|
||||||
@@ -1422,6 +1437,7 @@ public class CardController {
|
|||||||
paramMap.put("recordDateTime", sdf1.format(startDate));
|
paramMap.put("recordDateTime", sdf1.format(startDate));
|
||||||
paramMap.put("code", people.getId());//认证人员员工号
|
paramMap.put("code", people.getId());//认证人员员工号
|
||||||
paramMap.put("consumeInterval", timeType);
|
paramMap.put("consumeInterval", timeType);
|
||||||
|
paramMap.put("dev_id", devId);
|
||||||
//请求当天的消费信息
|
//请求当天的消费信息
|
||||||
JSONObject jsons1 = queryPeopleDay(paramMap);
|
JSONObject jsons1 = queryPeopleDay(paramMap);
|
||||||
if (!"0".equals(jsons1.get("code") + "")) {
|
if (!"0".equals(jsons1.get("code") + "")) {
|
||||||
|
|||||||
@@ -2,15 +2,9 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
druid:
|
druid:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
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
|
url: jdbc:mysql://127.0.0.1:3306/xa_cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
#username: root
|
|
||||||
#password: 111111
|
|
||||||
url: jdbc:mysql://192.168.124.185:3306/taihe_cloud?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
|
||||||
username: root
|
username: root
|
||||||
password: SQLsql123
|
password: root
|
||||||
#url: jdbc:mysql://127.0.0.1:8123/chungu?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
|
||||||
#username: root
|
|
||||||
#password: 3dxz2023
|
|
||||||
initial-size: 10
|
initial-size: 10
|
||||||
max-active: 100
|
max-active: 100
|
||||||
min-idle: 10
|
min-idle: 10
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ spring:
|
|||||||
# 环境 dev|test|prod
|
# 环境 dev|test|prod
|
||||||
profiles:
|
profiles:
|
||||||
active: prod
|
active: prod
|
||||||
|
# active: dev
|
||||||
messages:
|
messages:
|
||||||
encoding: UTF-8
|
encoding: UTF-8
|
||||||
basename: i18n/messages
|
basename: i18n/messages
|
||||||
@@ -45,6 +46,10 @@ spring:
|
|||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 6379
|
port: 6379
|
||||||
password: # 密码(默认为空)
|
password: # 密码(默认为空)
|
||||||
|
# host: 192.168.2.30
|
||||||
|
# password: redis2025
|
||||||
|
# database: 5
|
||||||
|
# port: 6379
|
||||||
timeout: 6000ms # 连接超时时长(毫秒)
|
timeout: 6000ms # 连接超时时长(毫秒)
|
||||||
jedis:
|
jedis:
|
||||||
pool:
|
pool:
|
||||||
|
|||||||
Reference in New Issue
Block a user