|
|
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.template.annotation.DESRespondSecret;
|
|
|
import com.template.api.SmartVisitorParentsConfigControllerAPI;
|
|
|
import com.template.mapper.SmartVisitorParentsConfigMapper;
|
|
|
+import com.template.model.dto.SvpcDto;
|
|
|
import com.template.model.pojo.SmartAskForLeaveConfig;
|
|
|
import com.template.model.pojo.SmartDuties;
|
|
|
import com.template.model.pojo.SmartUser;
|
|
|
@@ -31,7 +32,7 @@ import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
- * 前端控制器
|
|
|
+ * 前端控制器
|
|
|
* </p>
|
|
|
*
|
|
|
* @author ceshi
|
|
|
@@ -52,32 +53,16 @@ public class SmartVisitorParentsConfigController implements SmartVisitorParentsC
|
|
|
|
|
|
@Override
|
|
|
@DESRespondSecret(validated = true)
|
|
|
- public CommonResult getClassId(Integer page,Integer size, Integer classId,Integer gradeId) {
|
|
|
- PageUtils<SmartVisitorParentsConfigVo> smartVisitorParentsConfig=smartVisitorParentsConfigService.getClassIdPage(page,size,classId,gradeId);
|
|
|
+ public CommonResult getClassId(Integer page, Integer size, Integer classId, Integer gradeId) {
|
|
|
+ PageUtils<SmartVisitorParentsConfigVo> smartVisitorParentsConfig = smartVisitorParentsConfigService.getClassIdPage(page, size, classId, gradeId);
|
|
|
return CommonResult.ok(smartVisitorParentsConfig);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@DESRespondSecret(validated = true)
|
|
|
- public CommonResult update(List<SmartVisitorParentsConfig> smartVisitorParentsConfigs) {
|
|
|
+ public CommonResult update(SmartVisitorParentsConfig smartVisitorParentsConfig) {
|
|
|
|
|
|
- ArrayList<SmartVisitorParentsConfig> svpcs = new ArrayList<>();
|
|
|
- for (SmartVisitorParentsConfig smartVisitorParentsConfig : smartVisitorParentsConfigs) {
|
|
|
- Integer classId = smartVisitorParentsConfig.getClassId();
|
|
|
- SmartVisitorParentsConfig svpc=smartVisitorParentsConfigService.getByClassId(classId);
|
|
|
- svpc.setAppAuditConfig(smartVisitorParentsConfig.getAppAuditConfig());
|
|
|
- svpc.setAppPushConfig(smartVisitorParentsConfig.getAppPushConfig());
|
|
|
- svpc.setAppCancelConfig(smartVisitorParentsConfig.getAppCancelConfig());
|
|
|
- svpc.setScreenAuditConfig(smartVisitorParentsConfig.getScreenAuditConfig());
|
|
|
- svpc.setScreenPushConfig(smartVisitorParentsConfig.getScreenPushConfig());
|
|
|
- svpc.setScreenCancelConfig(smartVisitorParentsConfig.getScreenCancelConfig());
|
|
|
- svpc.setAccessConfig(smartVisitorParentsConfig.getAccessConfig());
|
|
|
- svpc.setCarConfig(smartVisitorParentsConfig.getCarConfig());
|
|
|
- svpcs.add(svpc);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- boolean update = smartVisitorParentsConfigService.updateBatchById(svpcs);
|
|
|
+ boolean update = smartVisitorParentsConfigService.updateById(smartVisitorParentsConfig);
|
|
|
|
|
|
if (update) {
|
|
|
return CommonResult.ok();
|
|
|
@@ -107,10 +92,40 @@ public class SmartVisitorParentsConfigController implements SmartVisitorParentsC
|
|
|
|
|
|
Integer schoolClass = smartById.getSchoolClass();
|
|
|
|
|
|
- SmartVisitorParentsConfigVo smartVisitorParentsConfigVo=smartVisitorParentsConfigService.getClassId(schoolClass);
|
|
|
+ SmartVisitorParentsConfigVo smartVisitorParentsConfigVo = smartVisitorParentsConfigService.getClassId(schoolClass);
|
|
|
|
|
|
return CommonResult.ok(smartVisitorParentsConfigVo);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public CommonResult updates(SvpcDto svpcDto) {
|
|
|
+ List<Integer> classIds = svpcDto.getClassIds();
|
|
|
+ if (ObjectUtils.isEmpty(classIds) || classIds.size() == 0) {
|
|
|
+ return CommonResult.fail("参数异常");
|
|
|
+ }
|
|
|
+ ArrayList<SmartVisitorParentsConfig> svpcs = new ArrayList<>();
|
|
|
+ for (Integer classId : classIds) {
|
|
|
+ SmartVisitorParentsConfig svpc = smartVisitorParentsConfigService.getByClassId(classId);
|
|
|
+ if (ObjectUtils.isNotEmpty(svpc)) {
|
|
|
+ svpc.setAppAuditConfig(svpcDto.getAppAuditConfig());
|
|
|
+ svpc.setAppPushConfig(svpcDto.getAppPushConfig());
|
|
|
+ svpc.setAppCancelConfig(svpcDto.getAppCancelConfig());
|
|
|
+ svpc.setScreenAuditConfig(svpcDto.getScreenAuditConfig());
|
|
|
+ svpc.setScreenPushConfig(svpcDto.getScreenPushConfig());
|
|
|
+ svpc.setScreenCancelConfig(svpcDto.getScreenCancelConfig());
|
|
|
+ svpc.setAccessConfig(svpcDto.getAccessConfig());
|
|
|
+ svpc.setCarConfig(svpcDto.getCarConfig());
|
|
|
+ svpcs.add(svpc);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ boolean update = smartVisitorParentsConfigService.updateBatchById(svpcs);
|
|
|
+
|
|
|
+ if (update) {
|
|
|
+ return CommonResult.ok();
|
|
|
+ }
|
|
|
+ return CommonResult.fail();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|