|
|
@@ -83,6 +83,8 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
@Resource
|
|
|
private ParkConfig parkConfig;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ SmartVisitorParentsConfigService smartVisitorParentsConfigService;
|
|
|
|
|
|
/**
|
|
|
* 新增访客预约
|
|
|
@@ -209,7 +211,7 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
sv.setPeerNum(par.getPeerNum());
|
|
|
sv.setCarNum(par.getCarNum());
|
|
|
sv.setVisitReason(par.getVisitReason());
|
|
|
- sv.setStatu(eApproveStatu.Audit.getValue());
|
|
|
+// sv.setStatu(eApproveStatu.Audit.getValue());
|
|
|
sv.setVisitorTime(TimeExchange.StringToDate(par.getVisitorTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
sv.setVisitorDeadline(TimeExchange.StringToDate(TimeExchange.AddTimeDesH(sv.getVisitorTime(), 4), "yyyy-MM-dd HH:mm:ss"));
|
|
|
sv.setRespondent(student.getId());
|
|
|
@@ -218,9 +220,36 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
|
|
|
//将第一个受访学生的部门ID带过去
|
|
|
sv.setDepartmentId(student.getDepartmentId());
|
|
|
sv.setVisitorType(eVisitorType.Parent.getValue());
|
|
|
+
|
|
|
+ // 获取受访者id
|
|
|
+ Integer respondent = sv.getRespondent();
|
|
|
+ SmartUser smartUser = smartUserService.getById(respondent);
|
|
|
+ Integer schoolClass = smartUser.getSchoolClass();
|
|
|
+ SmartVisitorParentsConfig svpc = smartVisitorParentsConfigService.getById(schoolClass);
|
|
|
+ Integer appAuditConfig = svpc.getAppAuditConfig();
|
|
|
+ if (1==appAuditConfig) {//需要审核
|
|
|
+ sv.setStatu(1);
|
|
|
+ }else {//不需要审核
|
|
|
+ Integer appPushConfig = svpc.getAppPushConfig();
|
|
|
+// 判断是否需要推送
|
|
|
+ if (5==appPushConfig) {//需要推送
|
|
|
+ String content = sv.getRespondentName() + "你的家长将于" + TimeExchange.chineseDateTime(sv.getVisitorTime()) + "到校!";
|
|
|
+ //将预约信息推送到希沃班牌
|
|
|
+ CommonResult seewo = pushInfo(sv.getUserPhone(), sv.getResponcode(), content);
|
|
|
+ }
|
|
|
+// 核销
|
|
|
+ Integer appCancelConfig = svpc.getAppCancelConfig();
|
|
|
+ if (6==appCancelConfig) {//需要核销
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
svs.add(sv);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
boolean result = smartVisitorService.insertVisitorBatch(svs);
|
|
|
|
|
|
return result ? CommonResult.ok("预约成功,等待审批通过") : CommonResult.fail("预约失败");
|