rev:工单编号字典

This commit is contained in:
zhangzhiqiang
2023-07-19 14:38:34 +08:00
parent 98ef6cf4d4
commit 47c6039853
4 changed files with 11 additions and 55 deletions

View File

@@ -1,45 +0,0 @@
package org.nl.config;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* 自动填充公共字段
*/
@Component
public class MetaDataHandler implements MetaObjectHandler
{
/**
* 插入操作自动填充
*/
@Override
public void insertFill(MetaObject metaObject)
{
//不一定有修改或删除字段,比如交易记录不能删除也不能修改
if(metaObject.hasSetter("is_delete"))
{
metaObject.setValue("is_delete", 0);
}
if(metaObject.hasSetter("update_time"))
{
metaObject.setValue("update_time", new Date());
}
metaObject.setValue("create_time", new Date());
}
/**
* 更新操作自动填充
*/
@Override
public void updateFill(MetaObject metaObject)
{
if(metaObject.hasSetter("update_time"))
{
metaObject.setValue("update_time", new Date());
}
}
}

View File

@@ -13,6 +13,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.TableDataInfo;
import org.nl.common.enums.AcsTaskEnum;
import org.nl.common.enums.StatusEnum;
import org.nl.common.utils.RedissonUtils;

View File

@@ -99,7 +99,6 @@ public class WrapSendEmptyTask extends AbstractAcsTask {
@Override
public String createTask(JSONObject param) {
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
String start_point_code = param.getString("device_code");
if(StrUtil.isEmpty(start_point_code)) {
throw new BadRequestException("起点不能为空!");
@@ -149,7 +148,7 @@ public class WrapSendEmptyTask extends AbstractAcsTask {
task.put("remark", ex.getMessage());
task.put("update_time", DateUtil.now());
task.put("task_status", StatusEnum.TASK_START_ERROR.getCode());
taskTab.update(task);
taskService.updateById(task.toJavaObject(SchBaseTask.class));
}
return taskdtl_id;
}