修改设备任务ID为雪花ID(自增同步会有问题)

dev2.0
anthonywj 2 years ago
parent d28b4f1699
commit 1931ece8a3

@ -118,7 +118,7 @@ public class DeviceInspectTakeController {
@Resource
SyncDataSetService syncDataSetService;
void UploadDeviceTake(Integer id, Integer type) {
void UploadDeviceTake(Long id, Integer type) {
//提交上传到自助
//查询任务表
// DeviceInspectTaskEntity deviceInspectTaskEntity = deviceInspectTaskService.getById(id);

@ -4,15 +4,17 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
@Data
@TableName(value = "device_inspect_task_detail")
public class DeviceInspectTaskDetailEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
private Integer id;
private Long id;
/**
*
@ -66,4 +68,4 @@ public class DeviceInspectTaskDetailEntity implements Serializable {
private String inspectName;
private static final long serialVersionUID = 1L;
}
}

@ -11,9 +11,9 @@ import java.util.Date;
@Data
@TableName(value = "device_inspect_task")
public class DeviceInspectTaskEntity{
public class DeviceInspectTaskEntity {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Long id;
/**
*

@ -1,5 +1,6 @@
package com.glxp.api.service.inv;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.glxp.api.dao.inv.DeviceInspectTaskMapper;
import com.glxp.api.entity.inv.DeviceInspectPlanDelectEntity;
@ -19,13 +20,16 @@ public class DeviceInspectTaskDetailService extends ServiceImpl<DeviceInspectTas
@Resource
private DeviceInspectTaskDetailMapper deviceInspectTaskDetailMapper;
public Boolean addDeviceInspectTaskDelect(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity){
public Boolean addDeviceInspectTaskDelect(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
deviceInspectTaskDetailEntity.setUpdateTime(new Date());
if (deviceInspectTaskDetailEntity.getId() == null) {
deviceInspectTaskDetailEntity.setId(IdUtil.getSnowflakeNextId());
}
deviceInspectTaskDetailMapper.insert(deviceInspectTaskDetailEntity);
return true;
}
public Boolean addDeviceInspectTaskDelectList(List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList){
public Boolean addDeviceInspectTaskDelectList(List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList) {
deviceInspectTaskDetailMapper.insertBatch(deviceInspectTaskDetailEntityList);
return true;
}
@ -34,27 +38,26 @@ public class DeviceInspectTaskDetailService extends ServiceImpl<DeviceInspectTas
public List<DeviceInspectTaskDetailEntity> selectDeviceInspectTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
QueryWrapper<DeviceInspectTaskDetailEntity> ew = new QueryWrapper<>();
if(deviceInspectTaskDetailEntity.getProjectCode() != null){
ew.eq("projectCode",deviceInspectTaskDetailEntity.getProjectCode());
if (deviceInspectTaskDetailEntity.getProjectCode() != null) {
ew.eq("projectCode", deviceInspectTaskDetailEntity.getProjectCode());
}
if(deviceInspectTaskDetailEntity.getId() != null){
ew.eq("id",deviceInspectTaskDetailEntity.getId());
if (deviceInspectTaskDetailEntity.getId() != null) {
ew.eq("id", deviceInspectTaskDetailEntity.getId());
}
if(deviceInspectTaskDetailEntity.getTaskOrderIdFk() != null){
ew.eq("taskOrderIdFk",deviceInspectTaskDetailEntity.getTaskOrderIdFk());
if (deviceInspectTaskDetailEntity.getTaskOrderIdFk() != null) {
ew.eq("taskOrderIdFk", deviceInspectTaskDetailEntity.getTaskOrderIdFk());
}
if(deviceInspectTaskDetailEntity.getStatus() != null){
ew.like("status",deviceInspectTaskDetailEntity.getStatus());
if (deviceInspectTaskDetailEntity.getStatus() != null) {
ew.like("status", deviceInspectTaskDetailEntity.getStatus());
}
ew.select("*, ( SELECT `employeeName` FROM auth_user WHERE id = device_inspect_task_detail.inspectUser ) inspectName");
List<DeviceInspectTaskDetailEntity> deviceInspectPlanDelectEntities=deviceInspectTaskDetailMapper.selectList(ew);
List<DeviceInspectTaskDetailEntity> deviceInspectPlanDelectEntities = deviceInspectTaskDetailMapper.selectList(ew);
return deviceInspectPlanDelectEntities;
}
public Boolean uploadDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntityList){
return deviceInspectTaskDetailMapper.updateById(deviceInspectTaskDetailEntityList) > 0 ? true : false;
public Boolean uploadDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntityList) {
return deviceInspectTaskDetailMapper.updateById(deviceInspectTaskDetailEntityList) > 0 ? true : false;
}
}

@ -1,5 +1,6 @@
package com.glxp.api.service.inv;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.inv.DeviceInspectTaskMapper;
@ -19,19 +20,21 @@ public class DeviceInspectTaskService extends ServiceImpl<DeviceInspectTaskMappe
@Resource
private DeviceInspectTaskMapper deviceInspectTaskMapper;
public Boolean addDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity){
deviceInspectTaskEntity.setUpdateTime(new Date());
deviceInspectTaskMapper.insert(deviceInspectTaskEntity);
return true;
public Boolean addDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity) {
deviceInspectTaskEntity.setUpdateTime(new Date());
if (deviceInspectTaskEntity.getId() == null) {
deviceInspectTaskEntity.setId(IdUtil.getSnowflakeNextId());
}
deviceInspectTaskMapper.insert(deviceInspectTaskEntity);
return true;
}
public Boolean delectDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity){
public Boolean delectDeviceInspectTask(DeviceInspectTaskEntity deviceInspectTaskEntity) {
deviceInspectTaskMapper.deleteById(deviceInspectTaskEntity);
return true;
}
public List<DeviceInspectTakeResponse> filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest) {
if (null == filterDeviceInspectTakeRequest) {
return Collections.emptyList();

@ -153,7 +153,7 @@ CREATE TABLE IF NOT EXISTS `device_repair_order_detail`
ROW_FORMAT = Dynamic;
CREATE TABLE IF NOT EXISTS `device_inspect_plan_delect`
CREATE TABLE IF NOT EXISTS `device_inspect_plan_delect`
(
`id` bigint(0) NOT NULL,
`orderIdFk` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
@ -170,6 +170,10 @@ CREATE TABLE IF NOT EXISTS `device_inspect_plan_delect`
ROW_FORMAT = Dynamic;
CALL Pro_Temp_ColumnWork('device_inspect_task', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('device_inspect_task_detail', 'id', 'bigint', 2);
# INSERT ignore INTO `auth_menu`(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2000, '我的申购单 ', 1674, 2, 'purchase/purApply/pureApplyMySearch', 'purchase/purApply/pureApplyMySearch', NULL, 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-07-20 17:08:38', NULL, NULL, NULL);
# INSERT ignore INTO `udi_wms_wmd`.`auth_menu`(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2001, '我的领用单', 1685, 1, 'inout/receive/receiveMySearch', 'inout/receive/receiveMySearch', NULL, 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-08-14 10:35:30', NULL, NULL, NULL);
#

Loading…
Cancel
Save