|
@@ -12,6 +12,7 @@ import cn.hutool.json.JSONUtil;
|
|
|
import com.jpsoft.shinestar.modules.base.dao.*;
|
|
|
import com.jpsoft.shinestar.modules.base.entity.*;
|
|
|
import com.jpsoft.shinestar.modules.base.service.CanteenDiningRecordService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.ValueOperations;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -20,6 +21,7 @@ import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.shinestar.modules.common.dto.Sort;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
|
+@Slf4j
|
|
|
@Transactional
|
|
|
@Component(value="canteenDiningRecordService")
|
|
|
public class CanteenDiningRecordServiceImpl implements CanteenDiningRecordService {
|
|
@@ -171,22 +173,18 @@ public class CanteenDiningRecordServiceImpl implements CanteenDiningRecordServic
|
|
|
|
|
|
@Override
|
|
|
public boolean punchIn(String deviceNo, Long personId, Date recordTime) throws ParseException {
|
|
|
-
|
|
|
- //1分钟之内只通知一次
|
|
|
- boolean absent = valueOperations.setIfAbsent("canteen_" + personId, true, 1, TimeUnit.MINUTES);
|
|
|
boolean result = false;
|
|
|
|
|
|
- if (absent) {
|
|
|
-
|
|
|
+ try {
|
|
|
+ //1分钟之内只通知一次
|
|
|
+// boolean absent = valueOperations.setIfAbsent("canteen_" + personId, true, 1, TimeUnit.MINUTES);
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
String recordDate = sdf.format(recordTime);
|
|
|
|
|
|
Date now = new Date();
|
|
|
-
|
|
|
PersonInfo personInfo = personInfoDAO.get(personId);
|
|
|
-
|
|
|
CompanyInfo companyInfo = companyInfoDAO.get(personInfo.getCompanyId());
|
|
|
|
|
|
Boolean isOutsourcer = false;
|
|
@@ -196,6 +194,7 @@ public class CanteenDiningRecordServiceImpl implements CanteenDiningRecordServic
|
|
|
}
|
|
|
|
|
|
DeviceInfo deviceInfo = deviceInfoDAO.findByDeviceNo(deviceNo);
|
|
|
+
|
|
|
if (deviceInfo != null) {
|
|
|
CanteenDevice canteenDevice = canteenDeviceDAO.findByDeviceId(deviceInfo.getId());
|
|
|
if (canteenDevice != null) {
|
|
@@ -253,6 +252,7 @@ public class CanteenDiningRecordServiceImpl implements CanteenDiningRecordServic
|
|
|
// canteenDiningRecord.setCategoryAmount(canteenDining.getDiningFee());
|
|
|
// }
|
|
|
}
|
|
|
+
|
|
|
int count = canteenDiningRecordDAO.insert(canteenDiningRecord);
|
|
|
|
|
|
if (count > 0) {
|
|
@@ -276,6 +276,11 @@ public class CanteenDiningRecordServiceImpl implements CanteenDiningRecordServic
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ log.warn("食堂就餐打卡PersonId={},result={}", personId, result);
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ log.error(ex.getMessage(), ex);
|
|
|
}
|
|
|
|
|
|
return result;
|