|
@@ -371,7 +371,7 @@ public class WmUserSignServiceImpl extends ServiceImpl<WmUserSignMapper, WmUserS
|
|
|
private void checkByRule(String taskTypeId, WmUserSign wmUserSign, String relatedServiceEntId) {
|
|
|
// 校验药店打卡
|
|
|
if ("33".equals(taskTypeId)) {
|
|
|
- checkPharmacySign(wmUserSign);
|
|
|
+ checkPharmacySign(relatedServiceEntId, wmUserSign);
|
|
|
}
|
|
|
// 医院拜访
|
|
|
else if ("5".equals(taskTypeId)) {
|
|
@@ -388,22 +388,11 @@ public class WmUserSignServiceImpl extends ServiceImpl<WmUserSignMapper, WmUserS
|
|
|
/**
|
|
|
* 校验药店打卡
|
|
|
*
|
|
|
- * @param wmUserSign 签到信息
|
|
|
+ * @param relatedServiceEntId 关联企业
|
|
|
+ * @param wmUserSign 签到信息
|
|
|
*/
|
|
|
- private void checkPharmacySign(WmUserSign wmUserSign) {
|
|
|
- // 一个用户,在同一打卡地点,4小时内只能打卡一次
|
|
|
- int total = this.count(Wrappers.<WmUserSign>lambdaQuery()
|
|
|
- .eq(WmUserSign::getSignUserid, wmUserSign.getSignUserid())
|
|
|
- .eq(WmUserSign::getSignEntId, wmUserSign.getSignEntId())
|
|
|
- .gt(WmUserSign::getSignDate, LocalDateTime.now().minus(4, ChronoUnit.HOURS)));
|
|
|
- // 一个用户,半小时内只能打卡一次
|
|
|
- int halfHourTotal = this.count(Wrappers.<WmUserSign>lambdaQuery()
|
|
|
- .eq(WmUserSign::getSignUserid, wmUserSign.getSignUserid())
|
|
|
- .gt(WmUserSign::getSignDate, LocalDateTime.now().minus(30, ChronoUnit.MINUTES)));
|
|
|
- if (total != 0 || halfHourTotal != 0) {
|
|
|
- log.warn("打卡间隔过短:{} {}", wmUserSign.getSignUserid(), wmUserSign.getSignEntName());
|
|
|
- throw new BizException("打卡间隔过短");
|
|
|
- }
|
|
|
+ private void checkPharmacySign(String relatedServiceEntId, WmUserSign wmUserSign) {
|
|
|
+ checkCommonSign("33", relatedServiceEntId, wmUserSign);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -536,13 +525,13 @@ public class WmUserSignServiceImpl extends ServiceImpl<WmUserSignMapper, WmUserS
|
|
|
List<WmUserSign> availSigned = signs.stream().filter(sign -> {
|
|
|
String contId = signIdAndContentIdMap.get(sign.getId().toString());
|
|
|
|
|
|
- if (StrUtil.isNotBlank(contId)){
|
|
|
+ if (StrUtil.isNotBlank(contId)) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
WmTask wmTask = taskMap.get(contId);
|
|
|
|
|
|
- if (wmTask == null){
|
|
|
+ if (wmTask == null) {
|
|
|
return false;
|
|
|
}
|
|
|
|