Commit 8bf130a9 by levphon

工单日志

1 parent c32b67d1
package cn.com.glsx.stdinterface.modules.entity;
import com.glsx.plat.mybatis.base.BaseEntity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Table;
@Data
@Table(name = "t_workorder_log")
public class WorkOrderLog extends BaseEntity {
/**
* 关联工单id
*/
@Column(name = "workorder_id")
private Long workOrderId;
/**
* 操作内容
*/
@Column(name = "operate_content")
private String operateContent;
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.stdinterface.modules.mapper;
import cn.com.glsx.stdinterface.modules.entity.WorkOrderLog;
import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface WorkOrderLogMapper extends CommonBaseMapper<WorkOrderLog> {
}
\ No newline at end of file \ No newline at end of file
...@@ -55,6 +55,9 @@ public class WorkOrderService { ...@@ -55,6 +55,9 @@ public class WorkOrderService {
private WorkOrderDocsMapper workOrderDocsMapper; private WorkOrderDocsMapper workOrderDocsMapper;
@Resource @Resource
private WorkOrderLogMapper workOrderLogMapper;
@Resource
private VehicleMapper vehicleMapper; private VehicleMapper vehicleMapper;
@Resource @Resource
...@@ -285,6 +288,7 @@ public class WorkOrderService { ...@@ -285,6 +288,7 @@ public class WorkOrderService {
list.add(workOrder); list.add(workOrder);
}); });
recordLogs(list, "新增工单");
} }
return list; return list;
} }
...@@ -522,6 +526,9 @@ public class WorkOrderService { ...@@ -522,6 +526,9 @@ public class WorkOrderService {
// 2021/12/6 同步到包活干 // 2021/12/6 同步到包活干
bhgBizService.syncInstallWorkOrder(workOrder, woVehicle, true); bhgBizService.syncInstallWorkOrder(workOrder, woVehicle, true);
//操作日志
recordLogs(Lists.newArrayList(workOrder), "更新工单");
} }
/** /**
...@@ -737,6 +744,10 @@ public class WorkOrderService { ...@@ -737,6 +744,10 @@ public class WorkOrderService {
} }
// TODO: 2021/12/22 通知e盾库 // TODO: 2021/12/22 通知e盾库
//操作日志
recordLogs(Lists.newArrayList(workOrder), "激活工单");
return activatedDevices; return activatedDevices;
} }
...@@ -759,4 +770,19 @@ public class WorkOrderService { ...@@ -759,4 +770,19 @@ public class WorkOrderService {
return vehicle; return vehicle;
} }
public void recordLogs(List<WorkOrder> orderList, String operateContent) {
if (CollectionUtils.isNotEmpty(orderList)) {
List<WorkOrderLog> logs = Lists.newArrayList();
orderList.forEach(order -> {
WorkOrderLog oLog = new WorkOrderLog();
oLog.setWorkOrderId(order.getId());
oLog.setOperateContent(operateContent);
oLog.setCreatedDate(new Date());
oLog.setCreatedBy(order.getCreatedBy());
logs.add(oLog);
});
workOrderLogMapper.insertList(logs);
}
}
} }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.glsx.stdinterface.modules.mapper.WorkOrderLogMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.stdinterface.modules.entity.WorkOrderLog">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="workorder_id" jdbcType="INTEGER" property="workOrderId"/>
<result column="operator_id" jdbcType="INTEGER" property="operatorId"/>
<result column="operator" jdbcType="VARCHAR" property="operator"/>
<result column="operate_time" jdbcType="TIMESTAMP" property="operateTime"/>
<result column="operate_content" jdbcType="VARCHAR" property="operateContent"/>
<result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
<result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
<result column="created_by" jdbcType="INTEGER" property="createdBy"/>
<result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
<result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
-->
id, workorder_id, operator_id, `operator`, operate_time, operate_content, del_flag,
created_date, created_by, updated_date, updated_by
</sql>
</mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!