| | |
| | | package org.springblade.modules.task.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.itextpdf.text.log.Logger; |
| | | import com.itextpdf.text.log.LoggerFactory; |
| | | import com.xxl.job.core.enums.taskHandlerEnum; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springblade.common.constant.CommonConstant; |
| | | import org.springblade.common.constant.DictConstant; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.category.entity.CategoryEntity; |
| | | import org.springblade.modules.category.service.ICategoryService; |
| | | import org.springblade.modules.threeColorTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.grid.entity.GridEntity; |
| | | import org.springblade.modules.grid.entity.GridWorkLogEntity; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean createTaskJob(String param) { |
| | | // 解析参数 |
| | | JSONObject jsonParam = JSON.parseObject(param); |
| | | CustomTaskEntity customTaskEntity = JSON.parseObject(param, CustomTaskEntity.class); |
| | | // CustomTaskEntity customTaskEntity = new CustomTaskEntity(); |
| | | // String params = jsonParam.getString("params"); |
| | | boolean flag = false; |
| | | // boolean flag = false; |
| | | // 校园安全自查任务生成 |
| | | // createCampusReportingTask(); |
| | | // 打金店/二手车/二手手机任务生成 |
| | |
| | | // 旅馆安全自查任务生成 |
| | | // createHotelReportingTask(); |
| | | // 人员类-肇事肇祸精神障碍患者走访任务生成 |
| | | createGridWordTask(); |
| | | // createGridWordTask(); |
| | | // 返回 |
| | | return flag; |
| | | TaskHandle handler = (TaskHandle) SpringUtils.getBean(Objects.requireNonNull(taskHandlerEnum.getNameByCode(customTaskEntity.getTaskType()))); |
| | | handler.taskHandle(customTaskEntity); |
| | | return true; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | } else if (task.getReportType().equals(CommonConstant.REPORT_TYPE_NO_FRAUD)) { |
| | | // 如果报告类型为无诈,尝试更新无诈报告状态 |
| | | ITaskNoFraudReportingService bean = SpringUtils.getBean(ITaskNoFraudReportingService.class); |
| | | ITaskNoFraudReportingService noFraudReportingService = SpringUtils.getBean(ITaskNoFraudReportingService.class); |
| | | LambdaUpdateWrapper<TaskNoFraudReportingEntity> objectLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
| | | if (StringUtils.isNotBlank(task.getHouseCode())) { |
| | | objectLambdaUpdateWrapper.set(TaskNoFraudReportingEntity::getHouseCode, task.getHouseCode()); |
| | |
| | | objectLambdaUpdateWrapper.set(TaskNoFraudReportingEntity::getStatus, task.getStatus()); |
| | | objectLambdaUpdateWrapper.set(TaskNoFraudReportingEntity::getRemark, task.getRemark()); |
| | | objectLambdaUpdateWrapper.eq(TaskNoFraudReportingEntity::getTaskId, task.getId()); |
| | | return bean.update(objectLambdaUpdateWrapper); |
| | | return noFraudReportingService.update(objectLambdaUpdateWrapper); |
| | | } |
| | | // 如果没有匹配的报告类型,返回false |
| | | return false; |