审核逻辑修改前项目保存
This commit is contained in:
7
pom.xml
7
pom.xml
@@ -44,6 +44,7 @@
|
||||
<rfidreader.version>1.0.0</rfidreader.version>
|
||||
<zmprinter.version>4.4.7</zmprinter.version>
|
||||
<mybatis-plus.version>3.5.5</mybatis-plus.version>
|
||||
<minio.version>8.5.4</minio.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -210,6 +211,12 @@
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
</dependency>
|
||||
<!--MinIo-->
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>${minio.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.zg;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
@@ -10,6 +11,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
* @author zg
|
||||
*/
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
@EnableScheduling
|
||||
public class SmartApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
|
||||
32
src/main/java/com/zg/common/utils/EntityFillUtils.java
Normal file
32
src/main/java/com/zg/common/utils/EntityFillUtils.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package com.zg.common.utils;
|
||||
|
||||
import com.zg.framework.web.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class EntityFillUtils {
|
||||
|
||||
/**
|
||||
* 设置新增操作的公共字段(创建人、创建时间、修改人、修改时间、逻辑删除)
|
||||
*/
|
||||
public static void fillCreateFields(BaseEntity entity) {
|
||||
String username = SecurityUtils.getUsername();
|
||||
Date now = new Date();
|
||||
|
||||
entity.setCreateBy(username);
|
||||
entity.setCreateTime(now);
|
||||
entity.setUpdateBy(username);
|
||||
entity.setUpdateTime(now);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置修改操作的公共字段(修改人、修改时间)
|
||||
*/
|
||||
public static void fillUpdateFields(BaseEntity entity) {
|
||||
String username = SecurityUtils.getUsername();
|
||||
Date now = new Date();
|
||||
|
||||
entity.setUpdateBy(username);
|
||||
entity.setUpdateTime(now);
|
||||
}
|
||||
}
|
||||
60
src/main/java/com/zg/common/utils/MinioUtil.java
Normal file
60
src/main/java/com/zg/common/utils/MinioUtil.java
Normal file
@@ -0,0 +1,60 @@
|
||||
package com.zg.common.utils;
|
||||
|
||||
import io.minio.*;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.UUID;
|
||||
|
||||
@Component
|
||||
public class MinioUtil {
|
||||
|
||||
@Value("${minio.endpoint}")
|
||||
private String endpoint;
|
||||
|
||||
@Value("${minio.accessKey}")
|
||||
private String accessKey;
|
||||
|
||||
@Value("${minio.secretKey}")
|
||||
private String secretKey;
|
||||
|
||||
@Value("${minio.bucketName}")
|
||||
private String bucketName;
|
||||
|
||||
/**
|
||||
* 上传文件到 MinIO,自动根据日期生成路径
|
||||
* 如:2025/07/10/uuid-xxx.jpg
|
||||
*/
|
||||
public String uploadFile(MultipartFile file) throws Exception {
|
||||
MinioClient client = MinioClient.builder()
|
||||
.endpoint(endpoint)
|
||||
.credentials(accessKey, secretKey)
|
||||
.build();
|
||||
|
||||
// 检查桶是否存在,不存在则创建
|
||||
boolean found = client.bucketExists(BucketExistsArgs.builder().bucket(bucketName).build());
|
||||
if (!found) {
|
||||
client.makeBucket(MakeBucketArgs.builder().bucket(bucketName).build());
|
||||
}
|
||||
|
||||
String originalFilename = file.getOriginalFilename();
|
||||
String datePath = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy/MM/dd"));
|
||||
String objectName = datePath + "/" + UUID.randomUUID().toString() + "-" + originalFilename;
|
||||
|
||||
try (InputStream inputStream = file.getInputStream()) {
|
||||
client.putObject(PutObjectArgs.builder()
|
||||
.bucket(bucketName)
|
||||
.object(objectName)
|
||||
.stream(inputStream, file.getSize(), -1)
|
||||
.contentType(file.getContentType())
|
||||
.build());
|
||||
}
|
||||
|
||||
// 返回完整可访问 URL(前端可直接使用)
|
||||
return endpoint + "/" + bucketName + "/" + objectName;
|
||||
}
|
||||
}
|
||||
@@ -120,6 +120,7 @@ public class SecurityConfig
|
||||
"/ws/**",
|
||||
"/information/device/**",
|
||||
"/MatchScan/**",
|
||||
"/wisdom/task/**",
|
||||
// "/wisdom/stock/**",
|
||||
// "/information/materialtype/**",
|
||||
// "/information/warehousingtype/**",
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.zg.framework.websocket.config;
|
||||
|
||||
import javax.websocket.Session;
|
||||
|
||||
public class DeviceSession {
|
||||
private Session session;
|
||||
private long lastActiveTime;
|
||||
|
||||
public DeviceSession(Session session) {
|
||||
this.session = session;
|
||||
this.lastActiveTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public Session getSession() {
|
||||
return session;
|
||||
}
|
||||
|
||||
public long getLastActiveTime() {
|
||||
return lastActiveTime;
|
||||
}
|
||||
|
||||
public void refreshTime() {
|
||||
this.lastActiveTime = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.zg.framework.websocket.config;
|
||||
|
||||
import com.zg.project.Inventory.AutoInventory.service.IRfidService;
|
||||
import com.zg.project.Inventory.AutoInventory.utils.SpringContextUtils;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.websocket.Session;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class DeviceSessionCleaner {
|
||||
|
||||
private static final long TIMEOUT = 30 * 1000; // 30秒无响应视为失联
|
||||
|
||||
@Scheduled(fixedDelay = 10000) // 每10秒检查一次
|
||||
public void checkTimeoutSessions() {
|
||||
Iterator<Map.Entry<String, DeviceSession>> iterator = WebSocketServer.deviceSessionMap.entrySet().iterator();
|
||||
|
||||
IRfidService rfidService = SpringContextUtils.getBean(IRfidService.class);
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<String, DeviceSession> entry = iterator.next();
|
||||
String deviceId = entry.getKey();
|
||||
DeviceSession deviceSession = entry.getValue();
|
||||
long lastActive = deviceSession.getLastActiveTime();
|
||||
|
||||
if (System.currentTimeMillis() - lastActive > TIMEOUT) {
|
||||
try {
|
||||
Session session = deviceSession.getSession();
|
||||
if (session != null && session.isOpen()) {
|
||||
session.close(); // 主动断开连接
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
rfidService.disconnect(deviceId); // 释放设备连接
|
||||
iterator.remove(); // 移除超时设备
|
||||
WebSocketServer.sessionMap.remove(deviceId); // 保持一致性
|
||||
|
||||
System.out.println("🛑 超时释放设备连接 deviceId=" + deviceId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,9 @@ public class WebSocketServer {
|
||||
|
||||
public static final ConcurrentHashMap<String, Session> sessionMap = new ConcurrentHashMap<>();
|
||||
private static final ConcurrentHashMap<Session, String> sessionToDeviceMap = new ConcurrentHashMap<>();
|
||||
// 新增:用于记录设备连接状态和最后活跃时间
|
||||
public static final ConcurrentHashMap<String, DeviceSession> deviceSessionMap = new ConcurrentHashMap<>();
|
||||
|
||||
|
||||
// rfidService 不在构造方法中注入!
|
||||
private IRfidService rfidService;
|
||||
@@ -43,6 +46,7 @@ public class WebSocketServer {
|
||||
String ip = json.getString("ip");
|
||||
int port = json.getIntValue("port");
|
||||
|
||||
deviceSessionMap.put(deviceId, new DeviceSession(session));
|
||||
sessionMap.put(deviceId, session);
|
||||
sessionToDeviceMap.put(session, deviceId);
|
||||
|
||||
|
||||
@@ -3,10 +3,11 @@ package com.zg.project.Inventory.AutoInventory.controller;
|
||||
import com.zg.framework.web.controller.BaseController;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.project.Inventory.AutoInventory.service.InventoryMatchScanService;
|
||||
import com.zg.project.Inventory.domain.dto.SodQueryDTO;
|
||||
import com.zg.project.Inventory.domain.dto.QueryDTO;
|
||||
import com.zg.project.Inventory.domain.vo.ChartDataVO;
|
||||
import com.zg.project.Inventory.AutoInventory.service.IRfidService;
|
||||
import com.zg.project.Inventory.AutoInventory.service.ISodService;
|
||||
import com.zg.project.wisdom.service.IRkInfoService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -21,6 +22,9 @@ public class AutoInventoryController extends BaseController {
|
||||
@Autowired
|
||||
private ISodService sodService;
|
||||
|
||||
@Autowired
|
||||
private IRkInfoService rkInfoService;
|
||||
|
||||
@Autowired
|
||||
private IRfidService rfidService;
|
||||
|
||||
@@ -33,7 +37,7 @@ public class AutoInventoryController extends BaseController {
|
||||
}
|
||||
@PostMapping("/sodQuery")
|
||||
@ApiOperation("条件查询库存数据")
|
||||
public AjaxResult query(@RequestBody SodQueryDTO dto) {
|
||||
public AjaxResult query(@RequestBody QueryDTO dto) {
|
||||
return AjaxResult.success(sodService.selectByPcdeList(dto));
|
||||
}
|
||||
|
||||
@@ -66,17 +70,15 @@ public class AutoInventoryController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/match")
|
||||
@ApiOperation("开始匹配")
|
||||
public AjaxResult match(@RequestBody SodQueryDTO dto) {
|
||||
//停止标签盘点
|
||||
public AjaxResult match(@RequestBody QueryDTO dto) {
|
||||
// 停止盘点
|
||||
rfidService.stopScan(dto.getDeviceId());
|
||||
|
||||
dto.setScanType(1);
|
||||
|
||||
// 调用服务层的方法
|
||||
Map<String, Object> resultMap = sodService.matchWithStatus(dto);
|
||||
rkInfoService.matchWithStatus(dto);
|
||||
|
||||
// 返回包含分页数据的 Map
|
||||
return AjaxResult.success(resultMap);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,8 +86,8 @@ public class AutoInventoryController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/chart")
|
||||
@ApiOperation("匹配后图表统计")
|
||||
public AjaxResult chart(@RequestBody SodQueryDTO dto) {
|
||||
ChartDataVO vo = sodService.matchWithAll(dto);
|
||||
public AjaxResult chart(@RequestBody QueryDTO dto) {
|
||||
ChartDataVO vo = rkInfoService.matchWithAll(dto);
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
package com.zg.project.Inventory.AutoInventory.controller;
|
||||
|
||||
import com.zg.common.utils.poi.ExcelUtil;
|
||||
import com.zg.framework.web.controller.BaseController;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
import com.zg.project.Inventory.AutoInventory.service.InventoryMatchScanService;
|
||||
import com.zg.project.Inventory.domain.dto.MatchScanPageDTO;
|
||||
import com.zg.project.Inventory.domain.entity.InventoryMatchScan;
|
||||
import com.zg.project.Inventory.domain.entity.InventoryTask;
|
||||
import com.zg.project.Inventory.domain.vo.InventoryMatchScanSimpleVO;
|
||||
import com.zg.project.Inventory.domain.vo.InventoryMatchScanVO;
|
||||
import com.zg.project.Inventory.domain.vo.RkInfoMatchVO;
|
||||
import com.zg.project.wisdom.domain.RkInfo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
import static com.zg.common.utils.PageUtils.startPage;
|
||||
@@ -20,19 +28,40 @@ public class InventoryMatchScanController extends BaseController {
|
||||
@Autowired
|
||||
private InventoryMatchScanService inventoryMatchScanService;
|
||||
|
||||
/**
|
||||
* 分页查询盘点结果
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/historyList")
|
||||
@ApiOperation("分页查询盘点结果")
|
||||
public AjaxResult getHistoryList(@RequestBody MatchScanPageDTO dto) {
|
||||
return AjaxResult.success(inventoryMatchScanService.getHistoryList(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询盘点结果
|
||||
* @param matchScan
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(InventoryMatchScan matchScan) {
|
||||
startPage();
|
||||
List<InventoryMatchScan> list = inventoryMatchScanService.selectInventoryMatchScanList(matchScan);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, InventoryMatchScan criteria) {
|
||||
List<InventoryMatchScan> list = inventoryMatchScanService.selectInventoryMatchScanList(criteria);
|
||||
ExcelUtil<InventoryMatchScan> util = new ExcelUtil<>(InventoryMatchScan.class);
|
||||
util.exportExcel(response, list, "盘点匹配结果");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据盘点任务id查看盘点结果
|
||||
* @param matchScan
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/countList")
|
||||
public TableDataInfo countList(InventoryMatchScan matchScan) {
|
||||
startPage();
|
||||
List<RkInfoMatchVO> list = inventoryMatchScanService.selectMatchScanCountList(matchScan);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务名称分页查询盘点结果
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.zg.project.Inventory.domain.entity.InventoryMatchScan;
|
||||
import com.zg.project.Inventory.domain.entity.Sod;
|
||||
import com.zg.project.Inventory.domain.vo.InventoryMatchScanSimpleVO;
|
||||
import com.zg.project.Inventory.domain.vo.InventoryMatchScanVO;
|
||||
import com.zg.project.Inventory.domain.vo.RkInfoMatchVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -27,4 +28,9 @@ public interface InventoryMatchScanMapper {
|
||||
|
||||
List<InventoryMatchScanVO> getByTaskName(MatchScanPageDTO dto);
|
||||
|
||||
List<InventoryMatchScan> selectInventoryMatchScanList(InventoryMatchScan matchScan);
|
||||
|
||||
List<RkInfoMatchVO> selectOnlyFromMatchScan(InventoryMatchScan param);
|
||||
|
||||
List<RkInfoMatchVO> selectJoinRkInfo(InventoryMatchScan param);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.zg.project.Inventory.AutoInventory.mapper;
|
||||
|
||||
import com.zg.project.Inventory.domain.dto.SodQueryDTO;
|
||||
import com.zg.project.Inventory.domain.dto.QueryDTO;
|
||||
import com.zg.project.Inventory.domain.entity.Sod;
|
||||
import com.zg.project.Inventory.domain.vo.PcdeCntVO;
|
||||
import com.zg.project.Inventory.domain.vo.SodVO;
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SodMapper {
|
||||
List<SodVO> selectByPcdeList(@Param("query") SodQueryDTO query);
|
||||
List<SodVO> selectByPcdeList(@Param("query") QueryDTO query);
|
||||
|
||||
List<Sod> getAll();
|
||||
|
||||
@@ -21,5 +21,4 @@ public interface SodMapper {
|
||||
|
||||
boolean existsByFycde1(String id);
|
||||
|
||||
List<PcdeCntVO> selectPcdeCntByFycde1(List<String> ids);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.zg.project.Inventory.AutoInventory.service;
|
||||
|
||||
import com.zg.project.Inventory.domain.dto.SodQueryDTO;
|
||||
import com.zg.project.Inventory.domain.dto.QueryDTO;
|
||||
import com.zg.project.Inventory.domain.vo.ChartDataVO;
|
||||
import com.zg.project.Inventory.domain.vo.SodVO;
|
||||
|
||||
@@ -8,12 +8,11 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISodService {
|
||||
List<SodVO> selectByPcdeList(SodQueryDTO dto);
|
||||
List<SodVO> selectByPcdeList(QueryDTO dto);
|
||||
|
||||
|
||||
Map<String, Object> matchWithStatus(SodQueryDTO dto);
|
||||
Map<String, Object> matchWithStatus(QueryDTO dto);
|
||||
|
||||
ChartDataVO matchWithAll(SodQueryDTO dto);
|
||||
|
||||
Map<String, Object> getAll();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.zg.project.Inventory.AutoInventory.service;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
import com.zg.project.Inventory.domain.dto.MatchScanPageDTO;
|
||||
import com.zg.project.Inventory.domain.entity.InventoryMatchScan;
|
||||
import com.zg.project.Inventory.domain.vo.InventoryMatchScanSimpleVO;
|
||||
import com.zg.project.Inventory.domain.vo.InventoryMatchScanVO;
|
||||
import com.zg.project.Inventory.domain.vo.RkInfoMatchVO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -15,8 +17,9 @@ public interface InventoryMatchScanService {
|
||||
|
||||
Map<String, Object> getAll();
|
||||
|
||||
TableDataInfo getHistoryList(MatchScanPageDTO dto);
|
||||
|
||||
List<InventoryMatchScanVO> getByTaskName(MatchScanPageDTO dto);
|
||||
|
||||
List<InventoryMatchScan> selectInventoryMatchScanList(InventoryMatchScan matchScan);
|
||||
|
||||
List<RkInfoMatchVO> selectMatchScanCountList(InventoryMatchScan matchScan);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package com.zg.project.Inventory.AutoInventory.service.impl;
|
||||
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
import com.zg.project.Inventory.Task.mapper.InventoryTaskMapper;
|
||||
import com.zg.project.Inventory.domain.dto.MatchScanPageDTO;
|
||||
import com.zg.project.Inventory.domain.entity.InventoryMatchScan;
|
||||
import com.zg.project.Inventory.AutoInventory.mapper.InventoryMatchScanMapper;
|
||||
import com.zg.project.Inventory.AutoInventory.service.InventoryMatchScanService;
|
||||
import com.zg.project.Inventory.domain.vo.InventoryMatchScanSimpleVO;
|
||||
import com.zg.project.Inventory.domain.vo.InventoryMatchScanVO;
|
||||
import com.zg.project.Inventory.domain.vo.RkInfoMatchVO;
|
||||
import com.zg.project.wisdom.mapper.RkInfoMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -20,6 +23,12 @@ public class InventoryMatchScanServiceImpl implements InventoryMatchScanService
|
||||
@Autowired
|
||||
private InventoryMatchScanMapper mapper;
|
||||
|
||||
@Autowired
|
||||
private InventoryTaskMapper taskMapper;
|
||||
|
||||
@Autowired
|
||||
private RkInfoMapper rkInfoMapper;
|
||||
|
||||
@Override
|
||||
public void saveBatch(List<InventoryMatchScan> list) {
|
||||
mapper.insertBatch(list);
|
||||
@@ -39,21 +48,26 @@ public class InventoryMatchScanServiceImpl implements InventoryMatchScanService
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo getHistoryList(MatchScanPageDTO dto) {
|
||||
int pageNum = dto.getPageNum() == null ? 1 : dto.getPageNum();
|
||||
int pageSize = dto.getPageSize() == null ? 10 : dto.getPageSize();
|
||||
int offset = (pageNum - 1) * pageSize;
|
||||
|
||||
int total = mapper.countGroupedHistory(dto);
|
||||
List<InventoryMatchScanSimpleVO> pageList = mapper.getGroupedHistoryList(dto, offset, pageSize);
|
||||
|
||||
return new TableDataInfo(pageList, total);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InventoryMatchScanVO> getByTaskName(MatchScanPageDTO dto) {
|
||||
return mapper.getByTaskName(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InventoryMatchScan> selectInventoryMatchScanList(InventoryMatchScan matchScan) {
|
||||
return mapper.selectInventoryMatchScanList(matchScan);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RkInfoMatchVO> selectMatchScanCountList(InventoryMatchScan param) {
|
||||
if ("2".equals(param.getStatus())) {
|
||||
return mapper.selectOnlyFromMatchScan(param);
|
||||
} else if ("1".equals(param.getStatus())) {
|
||||
String wh = taskMapper.getWhByTaskId(param.getTaskId());
|
||||
return rkInfoMapper.getUnscannedPcodeByWh(wh, param.getTaskId());
|
||||
} else {
|
||||
return mapper.selectJoinRkInfo(param);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.zg.project.Inventory.AutoInventory.service.impl;
|
||||
|
||||
import com.zg.common.utils.PageUtils;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
import com.zg.project.Inventory.domain.dto.SodQueryDTO;
|
||||
import com.zg.project.Inventory.domain.dto.QueryDTO;
|
||||
import com.zg.project.Inventory.domain.entity.InventoryMatchScan;
|
||||
import com.zg.project.Inventory.domain.entity.Sod;
|
||||
import com.zg.project.Inventory.domain.vo.ChartDataVO;
|
||||
@@ -31,12 +31,12 @@ public class SodServiceImpl implements ISodService {
|
||||
private InventoryMatchScanMapper matchScanMapper;
|
||||
|
||||
@Override
|
||||
public List<SodVO> selectByPcdeList(SodQueryDTO dto) {
|
||||
public List<SodVO> selectByPcdeList(QueryDTO dto) {
|
||||
return sodMapper.selectByPcdeList(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> matchWithStatus(SodQueryDTO dto) {
|
||||
public Map<String, Object> matchWithStatus(QueryDTO dto) {
|
||||
int pageNum = dto.getPageNum();
|
||||
int pageSize = dto.getPageSize();
|
||||
List<String> pcdeIds = dto.getIds();
|
||||
@@ -67,13 +67,13 @@ public class SodServiceImpl implements ISodService {
|
||||
|
||||
List<InventoryMatchScan> toSave = new ArrayList<>();
|
||||
matchedAll.forEach(sod ->
|
||||
toSave.add(buildScanRecord(dto.getTaskName(),sod.getFycde1(), "0", deviceId, tmeStr, nowStr, scanType)));
|
||||
toSave.add(buildScanRecord(dto.getTaskId(),sod.getFycde1(), "0", deviceId, tmeStr, nowStr, scanType)));
|
||||
|
||||
missedAll.forEach(sod ->
|
||||
toSave.add(buildScanRecord(dto.getTaskName(),sod.getFycde1(), "1", deviceId, tmeStr, nowStr, scanType)));
|
||||
toSave.add(buildScanRecord(dto.getTaskId(),sod.getFycde1(), "1", deviceId, tmeStr, nowStr, scanType)));
|
||||
|
||||
errorAll.forEach(sod ->
|
||||
toSave.add(buildScanRecord(dto.getTaskName(),sod.getFycde1(), "2", deviceId, tmeStr, nowStr, scanType)));
|
||||
toSave.add(buildScanRecord(dto.getTaskId(),sod.getFycde1(), "2", deviceId, tmeStr, nowStr, scanType)));
|
||||
|
||||
if (!toSave.isEmpty()) {
|
||||
matchScanMapper.insertBatch(toSave);
|
||||
@@ -111,45 +111,18 @@ public class SodServiceImpl implements ISodService {
|
||||
|
||||
}
|
||||
|
||||
private InventoryMatchScan buildScanRecord(String taskName,String pcde, String status,
|
||||
private InventoryMatchScan buildScanRecord(String taskId,String pcode, String status,
|
||||
String deviceId, String tme, String createdAt, int scanType) {
|
||||
InventoryMatchScan record = new InventoryMatchScan();
|
||||
record.setPcde(pcde);
|
||||
record.setTaskName(taskName);
|
||||
record.setPcode(pcode);
|
||||
record.setTaskId(taskId);
|
||||
record.setStatus(status);
|
||||
record.setDeviceId(deviceId);
|
||||
record.setTme(tme);
|
||||
record.setScanType(scanType);
|
||||
record.setCreatedAt(createdAt);
|
||||
return record;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChartDataVO matchWithAll(SodQueryDTO dto) {
|
||||
|
||||
List<String> ids = dto.getIds();
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
// 没传扫描 ID,直接返回空
|
||||
return new ChartDataVO(Collections.emptyList(),
|
||||
Collections.emptyList(),
|
||||
0L);
|
||||
}
|
||||
|
||||
// ① 查询统计结果
|
||||
List<PcdeCntVO> rows = sodMapper.selectPcdeCntByFycde1(ids);
|
||||
|
||||
// ② 组装前端需要的数组
|
||||
List<String> pcdeList = new ArrayList<>(rows.size());
|
||||
List<Long> fycdeCntList = new ArrayList<>(rows.size());
|
||||
|
||||
for (PcdeCntVO r : rows) {
|
||||
pcdeList.add(r.getPcde());
|
||||
fycdeCntList.add(r.getCnt());
|
||||
}
|
||||
|
||||
return new ChartDataVO(pcdeList, fycdeCntList, (long) rows.size());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getAll() {
|
||||
List<Sod> sodList = sodMapper.getAll();
|
||||
|
||||
@@ -2,7 +2,8 @@ package com.zg.project.Inventory.HdInventory;
|
||||
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.project.Inventory.AutoInventory.service.ISodService;
|
||||
import com.zg.project.Inventory.domain.dto.SodQueryDTO;
|
||||
import com.zg.project.Inventory.domain.dto.QueryDTO;
|
||||
import com.zg.project.wisdom.service.IRkInfoService;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -15,19 +16,20 @@ import java.util.Map;
|
||||
@RestController
|
||||
@RequestMapping("/HdInventory")
|
||||
public class HdInventoryController {
|
||||
|
||||
@Autowired
|
||||
private ISodService sodService;
|
||||
private IRkInfoService rkInfoService;
|
||||
|
||||
@ApiModelProperty("盘点对比")
|
||||
@PostMapping("/match")
|
||||
public AjaxResult match(@RequestBody SodQueryDTO dto) {
|
||||
public AjaxResult match(@RequestBody QueryDTO dto) {
|
||||
|
||||
dto.setScanType(0);
|
||||
|
||||
Map<String, Object> resultMap = sodService.matchWithStatus(dto);
|
||||
// dto.setDeviceId("0");
|
||||
|
||||
return AjaxResult.success(resultMap);
|
||||
rkInfoService.matchWithStatus(dto);
|
||||
|
||||
return AjaxResult.success();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,19 @@ public class InventoryTaskController extends BaseController
|
||||
@Autowired
|
||||
private IInventoryTaskService inventoryTaskService;
|
||||
|
||||
/**
|
||||
* 根据当前登录用户数统计待执行盘点任务数
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('Inventory:task:list')")
|
||||
@GetMapping("/count")
|
||||
public AjaxResult countPending()
|
||||
{
|
||||
Long userId = getUserId();
|
||||
int count = inventoryTaskService.countPendingTaskByUserId(userId);
|
||||
return success(count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询盘点任务列表
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.zg.project.Inventory.Task.controller;
|
||||
|
||||
import com.zg.framework.aspectj.lang.annotation.Log;
|
||||
import com.zg.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.zg.framework.web.controller.BaseController;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.project.Inventory.Task.service.IInventoryTaskService;
|
||||
import com.zg.project.wisdom.service.IRkInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/statistics")
|
||||
public class StatisticsController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IInventoryTaskService taskService;
|
||||
|
||||
@Autowired
|
||||
private IRkInfoService rkInfoService;
|
||||
|
||||
/**
|
||||
* 统计盘点任务对应仓库的待盘点数量
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/count")
|
||||
public AjaxResult conuntGetByTaskId(@RequestParam("taskId") String taskId)
|
||||
{
|
||||
|
||||
String warehouse = taskService.getWhByTaskId(taskId);
|
||||
|
||||
int count = rkInfoService.countGetByWh(warehouse);
|
||||
|
||||
return AjaxResult.success(count);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.zg.project.Inventory.Task.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zg.project.Inventory.domain.entity.InventoryTask;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 盘点任务Mapper接口
|
||||
@@ -58,4 +59,25 @@ public interface InventoryTaskMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInventoryTaskByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 查询用户待处理的任务数量
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int countPendingTaskByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据任务ID查询仓库ID
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
String getWhByTaskId(String taskId);
|
||||
|
||||
/**
|
||||
* 更新任务状态
|
||||
* @param taskId
|
||||
* @param status
|
||||
*/
|
||||
void updateStatus(@Param("taskId") String taskId, @Param("status") String status);
|
||||
}
|
||||
|
||||
@@ -58,4 +58,18 @@ public interface IInventoryTaskService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInventoryTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 统计用户待处理的盘点任务数量
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int countPendingTaskByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据盘点任务id获取仓库id
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
String getWhByTaskId(String taskId);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.zg.project.Inventory.Task.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zg.common.utils.DateUtils;
|
||||
import com.zg.common.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zg.project.Inventory.Task.mapper.InventoryTaskMapper;
|
||||
@@ -50,8 +53,11 @@ public class InventoryTaskServiceImpl implements IInventoryTaskService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertInventoryTask(InventoryTask inventoryTask)
|
||||
{
|
||||
public int insertInventoryTask(InventoryTask inventoryTask) {
|
||||
inventoryTask.setCreatedBy(SecurityUtils.getUsername());
|
||||
inventoryTask.setCreatedAt(DateUtils.getTime());
|
||||
inventoryTask.setIsDelete("0");
|
||||
inventoryTask.setStatus("0");
|
||||
return inventoryTaskMapper.insertInventoryTask(inventoryTask);
|
||||
}
|
||||
|
||||
@@ -90,4 +96,19 @@ public class InventoryTaskServiceImpl implements IInventoryTaskService
|
||||
{
|
||||
return inventoryTaskMapper.deleteInventoryTaskById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int countPendingTaskByUserId(Long userId) {
|
||||
return inventoryTaskMapper.countPendingTaskByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据任务ID获取仓库
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getWhByTaskId(String taskId) {
|
||||
return inventoryTaskMapper.getWhByTaskId(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class MatchScanPageDTO {
|
||||
/**
|
||||
* 盘点任务名称
|
||||
*/
|
||||
private String taskName;
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 库位码
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("库存查询参数")
|
||||
public class SodQueryDTO {
|
||||
public class QueryDTO {
|
||||
|
||||
@ApiModelProperty("系统入库时间,格式 yyyy-MM-dd")
|
||||
private String tme;
|
||||
@@ -36,8 +36,8 @@ public class SodQueryDTO {
|
||||
@ApiModelProperty("盘点类型(0=手动盘点,1=自动盘点)")
|
||||
private Integer scanType;
|
||||
|
||||
@ApiModelProperty("盘点任务名称")
|
||||
private String taskName;
|
||||
@ApiModelProperty("盘点任务ID")
|
||||
private String taskId;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,52 +1,140 @@
|
||||
package com.zg.project.Inventory.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.zg.framework.aspectj.lang.annotation.Excel;
|
||||
import com.zg.framework.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("inventory_match_scan")
|
||||
@ApiModel(value = "InventoryMatchScan对象", description = "盘点匹配数据记录表")
|
||||
public class InventoryMatchScan implements Serializable {
|
||||
/**
|
||||
* 盘点匹配数据记录表 InventoryMatchScan
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-06-24
|
||||
*/
|
||||
public class InventoryMatchScan extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
@TableId(value = "Id", type = IdType.AUTO)
|
||||
private Long Id;
|
||||
/** 主键ID */
|
||||
@Excel(name = "主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("设备ID")
|
||||
@TableField("device_id")
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
@ApiModelProperty("设备ID")
|
||||
@TableField("task_name")
|
||||
private String taskName;
|
||||
/** 盘点任务ID */
|
||||
@Excel(name = "盘点任务ID")
|
||||
private String taskId;
|
||||
|
||||
@ApiModelProperty("扫描到的标签ID(货品码ID)")
|
||||
@TableField("pcde")
|
||||
private String pcde;
|
||||
/** 扫描标签ID(货品码ID) */
|
||||
@Excel(name = "扫描标签ID")
|
||||
private String pcode;
|
||||
|
||||
@ApiModelProperty("系统入库时间")
|
||||
@TableField("tme")
|
||||
/** 系统入库时间 */
|
||||
@Excel(name = "系统入库时间")
|
||||
private String tme;
|
||||
|
||||
@ApiModelProperty("盘点类型(0=手动盘点,1=自动盘点)")
|
||||
@TableField("scan_type")
|
||||
/** 盘点类型(0=手动盘点,1=自动盘点) */
|
||||
@Excel(name = "盘点类型", readConverterExp = "0=手动盘点,1=自动盘点")
|
||||
private Integer scanType;
|
||||
|
||||
@ApiModelProperty("匹配状态(0=正常, 1=未扫到, 2=误扫)")
|
||||
@TableField("status")
|
||||
/** 匹配状态(0=正常, 1=未扫到, 2=误扫) */
|
||||
@Excel(name = "匹配状态", readConverterExp = "0=正常,1=未扫到,2=误扫")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField(value = "created_at", fill = FieldFill.INSERT)
|
||||
private String createdAt;
|
||||
/** 匹配到的真实货品码 */
|
||||
@Excel(name = "库位号")
|
||||
private String rkPcode;
|
||||
|
||||
@Excel(name = "盘点任务名称")
|
||||
private String taskName;
|
||||
|
||||
// ---------- Getter/Setter ----------
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setTaskId(String taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public String getPcode() {
|
||||
return pcode;
|
||||
}
|
||||
|
||||
public void setPcode(String pcode) {
|
||||
this.pcode = pcode;
|
||||
}
|
||||
|
||||
public String getTme() {
|
||||
return tme;
|
||||
}
|
||||
|
||||
public void setTme(String tme) {
|
||||
this.tme = tme;
|
||||
}
|
||||
|
||||
public Integer getScanType() {
|
||||
return scanType;
|
||||
}
|
||||
|
||||
public void setScanType(Integer scanType) {
|
||||
this.scanType = scanType;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getRkPcode() {
|
||||
return rkPcode;
|
||||
}
|
||||
|
||||
public void setRkPcode(String rkPcode) {
|
||||
this.rkPcode = rkPcode;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("taskId", getTaskId())
|
||||
.append("pcode", getPcode())
|
||||
.append("tme", getTme())
|
||||
.append("scanType", getScanType())
|
||||
.append("status", getStatus())
|
||||
.append("rkPcode", getRkPcode())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,11 @@ import com.zg.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 盘点任务对象 inventory_task
|
||||
*
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-06-16
|
||||
*/
|
||||
public class InventoryTask extends BaseEntity
|
||||
{
|
||||
public class InventoryTask extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
@@ -66,153 +65,85 @@ public class InventoryTask extends BaseEntity
|
||||
@Excel(name = "逻辑删除标志", readConverterExp = "0=正常,1=删除")
|
||||
private String isDelete;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
/** 执行人姓名(扩展字段) */
|
||||
private String userName;
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
/** 仓库名称(扩展字段) */
|
||||
private String warehouseName;
|
||||
|
||||
public void setTaskName(String taskName)
|
||||
{
|
||||
this.taskName = taskName;
|
||||
}
|
||||
/** 场景名称(扩展字段) */
|
||||
private String sceneName;
|
||||
|
||||
public String getTaskName()
|
||||
{
|
||||
return taskName;
|
||||
}
|
||||
// ---------- getter/setter ----------
|
||||
|
||||
public void setWarehouseId(String warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
|
||||
public String getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
public String getTaskName() { return taskName; }
|
||||
public void setTaskName(String taskName) { this.taskName = taskName; }
|
||||
|
||||
public void setSceneId(String sceneId)
|
||||
{
|
||||
this.sceneId = sceneId;
|
||||
}
|
||||
public String getWarehouseId() { return warehouseId; }
|
||||
public void setWarehouseId(String warehouseId) { this.warehouseId = warehouseId; }
|
||||
|
||||
public String getSceneId()
|
||||
{
|
||||
return sceneId;
|
||||
}
|
||||
public String getSceneId() { return sceneId; }
|
||||
public void setSceneId(String sceneId) { this.sceneId = sceneId; }
|
||||
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
public Long getUserId() { return userId; }
|
||||
public void setUserId(Long userId) { this.userId = userId; }
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public String getRequireTime() { return requireTime; }
|
||||
public void setRequireTime(String requireTime) { this.requireTime = requireTime; }
|
||||
|
||||
public void setRequireTime(String requireTime)
|
||||
{
|
||||
this.requireTime = requireTime;
|
||||
}
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public String getRequireTime()
|
||||
{
|
||||
return requireTime;
|
||||
}
|
||||
public String getTaskType() { return taskType; }
|
||||
public void setTaskType(String taskType) { this.taskType = taskType; }
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
public String getCreatedBy() { return createdBy; }
|
||||
public void setCreatedBy(String createdBy) { this.createdBy = createdBy; }
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public String getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(String createdAt) { this.createdAt = createdAt; }
|
||||
|
||||
public void setTaskType(String taskType)
|
||||
{
|
||||
this.taskType = taskType;
|
||||
}
|
||||
public String getUpdatedBy() { return updatedBy; }
|
||||
public void setUpdatedBy(String updatedBy) { this.updatedBy = updatedBy; }
|
||||
|
||||
public String getTaskType()
|
||||
{
|
||||
return taskType;
|
||||
}
|
||||
public String getUpdatedAt() { return updatedAt; }
|
||||
public void setUpdatedAt(String updatedAt) { this.updatedAt = updatedAt; }
|
||||
|
||||
public void setCreatedBy(String createdBy)
|
||||
{
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
public String getIsDelete() { return isDelete; }
|
||||
public void setIsDelete(String isDelete) { this.isDelete = isDelete; }
|
||||
|
||||
public String getCreatedBy()
|
||||
{
|
||||
return createdBy;
|
||||
}
|
||||
public String getUserName() { return userName; }
|
||||
public void setUserName(String userName) { this.userName = userName; }
|
||||
|
||||
public void setCreatedAt(String createdAt)
|
||||
{
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
public String getWarehouseName() { return warehouseName; }
|
||||
public void setWarehouseName(String warehouseName) { this.warehouseName = warehouseName; }
|
||||
|
||||
public String getCreatedAt()
|
||||
{
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setUpdatedBy(String updatedBy)
|
||||
{
|
||||
this.updatedBy = updatedBy;
|
||||
}
|
||||
|
||||
public String getUpdatedBy()
|
||||
{
|
||||
return updatedBy;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(String updatedAt)
|
||||
{
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public String getUpdatedAt()
|
||||
{
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
public String getSceneName() { return sceneName; }
|
||||
public void setSceneName(String sceneName) { this.sceneName = sceneName; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("taskName", getTaskName())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("sceneId", getSceneId())
|
||||
.append("userId", getUserId())
|
||||
.append("requireTime", getRequireTime())
|
||||
.append("status", getStatus())
|
||||
.append("taskType", getTaskType())
|
||||
.append("remark", getRemark())
|
||||
.append("createdBy", getCreatedBy())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedBy", getUpdatedBy())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("taskName", getTaskName())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("warehouseName", getWarehouseName())
|
||||
.append("sceneId", getSceneId())
|
||||
.append("sceneName", getSceneName())
|
||||
.append("userId", getUserId())
|
||||
.append("userName", getUserName())
|
||||
.append("requireTime", getRequireTime())
|
||||
.append("status", getStatus())
|
||||
.append("taskType", getTaskType())
|
||||
.append("remark", getRemark())
|
||||
.append("createdBy", getCreatedBy())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedBy", getUpdatedBy())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.zg.project.Inventory.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RkInfoMatchVO {
|
||||
|
||||
@ApiModelProperty("入库表中的pcode")
|
||||
private String rkPcode;
|
||||
|
||||
@ApiModelProperty("实际入库数量")
|
||||
private Integer realQty;
|
||||
}
|
||||
@@ -7,12 +7,11 @@ import com.zg.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 设备信息对象 device_info
|
||||
*
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
public class DeviceInfo extends BaseEntity
|
||||
{
|
||||
public class DeviceInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 设备ID */
|
||||
@@ -27,75 +26,105 @@ public class DeviceInfo extends BaseEntity
|
||||
private Long port;
|
||||
|
||||
/** 所属仓库ID */
|
||||
@Excel(name = "所属仓库ID")
|
||||
private Long warehouseId;
|
||||
// @Excel(name = "所属仓库ID")
|
||||
private String warehouseId;
|
||||
|
||||
/** 所属场景ID */
|
||||
// @Excel(name = "所属场景ID")
|
||||
private String sceneId;
|
||||
|
||||
/** 仓库名称(非数据库字段) */
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
/** 场景名称(非数据库字段) */
|
||||
@Excel(name = "场景名称")
|
||||
private String sceneName;
|
||||
|
||||
/** 是否删除(0否 1是) */
|
||||
@Excel(name = "是否删除", readConverterExp = "0=否,1=是")
|
||||
private String isDelete;
|
||||
|
||||
public void setDeviceId(Long deviceId)
|
||||
{
|
||||
// Getter & Setter
|
||||
public void setDeviceId(Long deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public Long getDeviceId()
|
||||
{
|
||||
public Long getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setIpAddress(String ipAddress)
|
||||
{
|
||||
public void setIpAddress(String ipAddress) {
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
public String getIpAddress()
|
||||
{
|
||||
public String getIpAddress() {
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
public void setPort(Long port)
|
||||
{
|
||||
public void setPort(Long port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public Long getPort()
|
||||
{
|
||||
public Long getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setWarehouseId(Long warehouseId)
|
||||
{
|
||||
public void setWarehouseId(String warehouseId) {
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public Long getWarehouseId()
|
||||
{
|
||||
public String getWarehouseId() {
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete)
|
||||
{
|
||||
public void setSceneId(String sceneId) {
|
||||
this.sceneId = sceneId;
|
||||
}
|
||||
|
||||
public String getSceneId() {
|
||||
return sceneId;
|
||||
}
|
||||
|
||||
public void setWarehouseName(String warehouseName) {
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public String getWarehouseName() {
|
||||
return warehouseName;
|
||||
}
|
||||
|
||||
public void setSceneName(String sceneName) {
|
||||
this.sceneName = sceneName;
|
||||
}
|
||||
|
||||
public String getSceneName() {
|
||||
return sceneName;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getIsDelete()
|
||||
{
|
||||
public String getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("ipAddress", getIpAddress())
|
||||
.append("port", getPort())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("deviceId", getDeviceId())
|
||||
.append("ipAddress", getIpAddress())
|
||||
.append("port", getPort())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("sceneId", getSceneId())
|
||||
.append("warehouseName", getWarehouseName())
|
||||
.append("sceneName", getSceneName())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class PcdeDetail extends BaseEntity
|
||||
|
||||
/** 库位编号 */
|
||||
@Excel(name = "库位编号")
|
||||
private String locationCode;
|
||||
private String pcode;
|
||||
|
||||
/** 所属场景 */
|
||||
private String scene;
|
||||
@@ -74,14 +74,11 @@ public class PcdeDetail extends BaseEntity
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setLocationCode(String locationCode)
|
||||
{
|
||||
this.locationCode = locationCode;
|
||||
public String getPcode() {
|
||||
return pcode;
|
||||
}
|
||||
|
||||
public String getLocationCode()
|
||||
{
|
||||
return locationCode;
|
||||
public void setPcode(String pcode) {
|
||||
this.pcode = pcode;
|
||||
}
|
||||
|
||||
public void setScene(String scene)
|
||||
@@ -198,7 +195,7 @@ public class PcdeDetail extends BaseEntity
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("locationCode", getLocationCode())
|
||||
.append("pcode", getPcode())
|
||||
.append("scene", getScene())
|
||||
.append("sceneName", getSceneName())
|
||||
.append("warehouse", getWarehouse())
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zg.project.information.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.zg.common.utils.DateUtils;
|
||||
import com.zg.common.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zg.project.information.mapper.DeviceInfoMapper;
|
||||
@@ -53,10 +54,10 @@ public class DeviceInfoServiceImpl implements IDeviceInfoService
|
||||
@Override
|
||||
public int insertDeviceInfo(DeviceInfo deviceInfo)
|
||||
{
|
||||
deviceInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
deviceInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return deviceInfoMapper.insertDeviceInfo(deviceInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备信息
|
||||
*
|
||||
|
||||
@@ -64,7 +64,7 @@ public class PcdeDetailServiceImpl implements IPcdeDetailService
|
||||
@Override
|
||||
public int insertPcdeDetail(PcdeDetail pcdeDetail) {
|
||||
// 原始 locationCode
|
||||
String locationCode = pcdeDetail.getLocationCode();
|
||||
String locationCode = pcdeDetail.getPcode();
|
||||
|
||||
// 将 locationCode 转换为十六进制字符串
|
||||
StringBuilder hex = new StringBuilder();
|
||||
@@ -108,7 +108,7 @@ public class PcdeDetailServiceImpl implements IPcdeDetailService
|
||||
}
|
||||
|
||||
// 获取库位编号
|
||||
String locationCode = pcdeDetail.getLocationCode();
|
||||
String locationCode = pcdeDetail.getPcode();
|
||||
|
||||
// 检查该库位是否仍有关联货物
|
||||
int count = rkInfoMapper.countRkInfoByLocationCode(locationCode);
|
||||
@@ -137,7 +137,7 @@ public class PcdeDetailServiceImpl implements IPcdeDetailService
|
||||
}
|
||||
|
||||
// 获取库位编号
|
||||
String locationCode = pcdeDetail.getLocationCode();
|
||||
String locationCode = pcdeDetail.getPcode();
|
||||
|
||||
// 查询该库位上是否存在库存
|
||||
int count = rkInfoMapper.countRkInfoByLocationCode(locationCode);
|
||||
@@ -161,7 +161,7 @@ public class PcdeDetailServiceImpl implements IPcdeDetailService
|
||||
|
||||
for (PcdeDetail detail : pcdeList) {
|
||||
try {
|
||||
PcdeDetail exist = pcdeDetailMapper.selectByLocationCode(detail.getLocationCode());
|
||||
PcdeDetail exist = pcdeDetailMapper.selectByLocationCode(detail.getPcode());
|
||||
if (exist == null) {
|
||||
detail.setCreateBy(operName);
|
||||
detail.setCreateTime(DateUtils.getNowDate());
|
||||
@@ -169,11 +169,11 @@ public class PcdeDetailServiceImpl implements IPcdeDetailService
|
||||
successNum++;
|
||||
} else {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>库位编号 ").append(detail.getLocationCode()).append(" 已存在");
|
||||
failureMsg.append("<br/>库位编号 ").append(detail.getPcode()).append(" 已存在");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>库位编号 ").append(detail.getLocationCode()).append(" 导入失败:").append(e.getMessage());
|
||||
failureMsg.append("<br/>库位编号 ").append(detail.getPcode()).append(" 导入失败:").append(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ public class PcdeDetailServiceImpl implements IPcdeDetailService
|
||||
|
||||
// 过滤掉已使用的
|
||||
List<PcdeDetail> availableList = pcdeList.stream()
|
||||
.filter(p -> !usedPcodeList.contains(p.getLocationCode()))
|
||||
.filter(p -> !usedPcodeList.contains(p.getPcode()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return availableList;
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.zg.project.wisdom.controller;
|
||||
|
||||
import com.zg.framework.web.controller.BaseController;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
import com.zg.project.wisdom.domain.AgvTaskResult;
|
||||
import com.zg.project.wisdom.domain.dto.AgvDTO;
|
||||
import com.zg.project.wisdom.service.IAgvTaskResultService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/wisdom/agv")
|
||||
public class AgvTaskResultController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IAgvTaskResultService agvTaskResultService;
|
||||
|
||||
/**
|
||||
* 查询AGV任务结果列表(分页)
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AgvTaskResult agvTaskResult) {
|
||||
startPage();
|
||||
List<AgvTaskResult> list = agvTaskResultService.selectAgvTaskResultList(agvTaskResult);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询单个AGV任务结果
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(agvTaskResultService.selectAgvTaskResultById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增AGV任务执行结果
|
||||
*/
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AgvTaskResult agvTaskResult) {
|
||||
return toAjax(agvTaskResultService.insertAgvTaskResult(agvTaskResult));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改AGV任务执行结果
|
||||
*/
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AgvTaskResult agvTaskResult) {
|
||||
return toAjax(agvTaskResultService.updateAgvTaskResult(agvTaskResult));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除AGV任务执行结果
|
||||
*/
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(agvTaskResultService.deleteAgvTaskResultByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* AGV任务执行结果回调
|
||||
*/
|
||||
@PostMapping("/callback")
|
||||
public AjaxResult receiveCallback(@RequestBody AgvDTO dto) {
|
||||
agvTaskResultService.handleAgvCallback(dto);
|
||||
return AjaxResult.success("AGV回调接收成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查AGV任务执行结果状态
|
||||
*/
|
||||
@PostMapping("/checkStatus")
|
||||
public AjaxResult checkAgvTaskStatus(@RequestBody AgvDTO dto) {
|
||||
boolean exists = agvTaskResultService.existsByRequestIdAndStatus(dto.getRequestId(), dto.getStatus());
|
||||
if (exists) {
|
||||
return AjaxResult.success("已达到指定状态:" + dto.getStatus());
|
||||
} else {
|
||||
return AjaxResult.error("未达到指定状态:" + dto.getStatus());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.zg.project.wisdom.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zg.common.utils.poi.ExcelUtil;
|
||||
import com.zg.framework.aspectj.lang.annotation.Log;
|
||||
import com.zg.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.zg.framework.web.controller.BaseController;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
import com.zg.project.wisdom.domain.DdTask;
|
||||
import com.zg.project.wisdom.domain.vo.TaskExecuteResultVO;
|
||||
import com.zg.project.wisdom.service.IDdTaskService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
/**
|
||||
* 调度任务 Controller
|
||||
*
|
||||
* @author zg
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wisdom/task")
|
||||
public class DdTaskController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IDdTaskService ddTaskService;
|
||||
|
||||
/**
|
||||
* 查询调度任务列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:task:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DdTask ddTask) {
|
||||
startPage();
|
||||
List<DdTask> list = ddTaskService.selectDdTaskList(ddTask);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出调度任务列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:task:export')")
|
||||
@Log(title = "调度任务", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public AjaxResult export(DdTask ddTask) {
|
||||
List<DdTask> list = ddTaskService.selectDdTaskList(ddTask);
|
||||
ExcelUtil<DdTask> util = new ExcelUtil<>(DdTask.class);
|
||||
return util.exportExcel(list, "调度任务数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取调度任务详情
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:task:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(ddTaskService.selectDdTaskById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增调度任务
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:task:add')")
|
||||
@Log(title = "调度任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody DdTask ddTask) {
|
||||
return toAjax(ddTaskService.insertDdTask(ddTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改调度任务
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:task:edit')")
|
||||
@Log(title = "调度任务", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DdTask ddTask) {
|
||||
return toAjax(ddTaskService.updateDdTask(ddTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除调度任务
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:task:remove')")
|
||||
@Log(title = "调度任务", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(ddTaskService.deleteDdTaskByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:task:execute')")
|
||||
@PostMapping("/execute")
|
||||
public AjaxResult execute(@RequestParam Long id) {
|
||||
TaskExecuteResultVO vo = ddTaskService.executeTask(id);
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.zg.project.wisdom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zg.framework.aspectj.lang.annotation.Log;
|
||||
import com.zg.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.zg.common.utils.poi.ExcelUtil;
|
||||
import com.zg.framework.web.controller.BaseController;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
|
||||
import com.zg.project.wisdom.domain.MoveRecord;
|
||||
import com.zg.project.wisdom.domain.dto.MoveRequestDTO;
|
||||
import com.zg.project.wisdom.service.IMoveRecordService;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 移库记录Controller
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-06-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/inventory/move")
|
||||
public class MoveRecordController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMoveRecordService moveRecordService;
|
||||
|
||||
|
||||
/**
|
||||
* 新增移库记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('inventory:move:add')")
|
||||
@Log(title = "移库记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult processMove(@RequestBody MoveRequestDTO dto) {
|
||||
moveRecordService.processMove(dto);
|
||||
return AjaxResult.success("移库成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询移库记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('inventory:move:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MoveRecord moveRecord)
|
||||
{
|
||||
startPage();
|
||||
List<MoveRecord> list = moveRecordService.selectMoveRecordList(moveRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出移库记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('inventory:move:export')")
|
||||
@Log(title = "移库记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MoveRecord moveRecord)
|
||||
{
|
||||
List<MoveRecord> list = moveRecordService.selectMoveRecordList(moveRecord);
|
||||
ExcelUtil<MoveRecord> util = new ExcelUtil<>(MoveRecord.class);
|
||||
util.exportExcel(response, list, "移库记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取移库记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('inventory:move:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(moveRecordService.selectMoveRecordById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改移库记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('inventory:move:edit')")
|
||||
@Log(title = "移库记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MoveRecord moveRecord)
|
||||
{
|
||||
return toAjax(moveRecordService.updateMoveRecord(moveRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除移库记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('inventory:move:remove')")
|
||||
@Log(title = "移库记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(moveRecordService.deleteMoveRecordByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zg.project.wisdom.domain.dto.PcRkInfoBatchDTO;
|
||||
import com.zg.project.wisdom.domain.dto.RefundRequestDTO;
|
||||
import com.zg.project.wisdom.domain.dto.RkInfoBatchDTO;
|
||||
import com.zg.project.wisdom.domain.dto.StockOutDTO;
|
||||
import com.zg.project.wisdom.service.IGysJhService;
|
||||
@@ -45,7 +46,6 @@ public class RkInfoController extends BaseController
|
||||
* 查询库存单据主列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:list')")
|
||||
// @GetMapping("/details/list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RkInfo rkInfo)
|
||||
{
|
||||
@@ -154,4 +154,16 @@ public class RkInfoController extends BaseController
|
||||
public AjaxResult doOutStock(@RequestBody StockOutDTO dto) {
|
||||
return toAjax(rkInfoService.batchOutStock(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 还料入库
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Log(title = "还料入库", businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:outbound:add')")
|
||||
@PostMapping("/refund")
|
||||
public AjaxResult refundMaterial(@RequestBody RefundRequestDTO dto) {
|
||||
return toAjax(rkInfoService.refundMaterial(dto));
|
||||
}
|
||||
}
|
||||
|
||||
224
src/main/java/com/zg/project/wisdom/domain/AgvTaskResult.java
Normal file
224
src/main/java/com/zg/project/wisdom/domain/AgvTaskResult.java
Normal file
@@ -0,0 +1,224 @@
|
||||
package com.zg.project.wisdom.domain;
|
||||
|
||||
import com.zg.framework.aspectj.lang.annotation.Excel;
|
||||
import com.zg.framework.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* AGV任务执行结果实体类
|
||||
*
|
||||
* 表名:agv_task_result
|
||||
* 用于记录AGV回调的执行结果
|
||||
*
|
||||
* @author zg
|
||||
*/
|
||||
public class AgvTaskResult extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 请求ID(唯一标识任务请求) */
|
||||
@Excel(name = "请求ID")
|
||||
private String requestId;
|
||||
|
||||
/** 任务编号(可关联调度任务) */
|
||||
@Excel(name = "任务编号")
|
||||
private String taskNo;
|
||||
|
||||
/** 任务ID(AGV侧) */
|
||||
@Excel(name = "任务ID")
|
||||
private String jobId;
|
||||
|
||||
/** 所属系统 */
|
||||
@Excel(name = "所属系统")
|
||||
private String owner;
|
||||
|
||||
/** 任务类型 */
|
||||
@Excel(name = "任务类型")
|
||||
private String type;
|
||||
|
||||
/** 优先级 */
|
||||
@Excel(name = "优先级")
|
||||
private String priority;
|
||||
|
||||
/** 起点位置 */
|
||||
@Excel(name = "起点位置")
|
||||
private String sourceName;
|
||||
|
||||
/** 终点位置 */
|
||||
@Excel(name = "终点位置")
|
||||
private String targetName;
|
||||
|
||||
/** AGV任务创建时间 */
|
||||
@Excel(name = "AGV创建时间")
|
||||
private String createdAt;
|
||||
|
||||
/** AGV任务更新时间 */
|
||||
@Excel(name = "AGV更新时间")
|
||||
private String updatedAt;
|
||||
|
||||
/** 执行状态(如END_ARRIVE等) */
|
||||
/**
|
||||
* 执行状态(AGV任务阶段):
|
||||
* CREATED - 创建任务;
|
||||
* ALLOCATED - 分配资源;
|
||||
* WAITING_PICK_UP - 等待取货;
|
||||
* PICK_UP_COMPLETED - 取货完成;
|
||||
* WAITING_TAKE_DOWN - 等待卸货;
|
||||
* END_ARRIVE - 到达终点;
|
||||
* TAKE_DOWN_COMPLETED - 卸货完成;
|
||||
* FINISHED - 任务完成;
|
||||
* FAILURE - 执行失败;
|
||||
* PROCESSING - 任务执行中。
|
||||
*/
|
||||
@Excel(name = "执行状态")
|
||||
private String status;
|
||||
|
||||
/** 执行信息说明 */
|
||||
@Excel(name = "执行信息")
|
||||
private String msg;
|
||||
|
||||
/** 是否删除(0正常 1删除) */
|
||||
private String isDelete;
|
||||
|
||||
// getter/setter
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getRequestId() {
|
||||
return requestId;
|
||||
}
|
||||
|
||||
public void setRequestId(String requestId) {
|
||||
this.requestId = requestId;
|
||||
}
|
||||
|
||||
public String getTaskNo() {
|
||||
return taskNo;
|
||||
}
|
||||
|
||||
public void setTaskNo(String taskNo) {
|
||||
this.taskNo = taskNo;
|
||||
}
|
||||
|
||||
public String getJobId() {
|
||||
return jobId;
|
||||
}
|
||||
|
||||
public void setJobId(String jobId) {
|
||||
this.jobId = jobId;
|
||||
}
|
||||
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(String owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
public void setPriority(String priority) {
|
||||
this.priority = priority;
|
||||
}
|
||||
|
||||
public String getSourceName() {
|
||||
return sourceName;
|
||||
}
|
||||
|
||||
public void setSourceName(String sourceName) {
|
||||
this.sourceName = sourceName;
|
||||
}
|
||||
|
||||
public String getTargetName() {
|
||||
return targetName;
|
||||
}
|
||||
|
||||
public void setTargetName(String targetName) {
|
||||
this.targetName = targetName;
|
||||
}
|
||||
|
||||
public String getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(String createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public String getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(String updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getIsDelete() {
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete) {
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("requestId", getRequestId())
|
||||
.append("taskNo", getTaskNo())
|
||||
.append("jobId", getJobId())
|
||||
.append("owner", getOwner())
|
||||
.append("type", getType())
|
||||
.append("priority", getPriority())
|
||||
.append("sourceName", getSourceName())
|
||||
.append("targetName", getTargetName())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.append("status", getStatus())
|
||||
.append("msg", getMsg())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
166
src/main/java/com/zg/project/wisdom/domain/DdTask.java
Normal file
166
src/main/java/com/zg/project/wisdom/domain/DdTask.java
Normal file
@@ -0,0 +1,166 @@
|
||||
package com.zg.project.wisdom.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.zg.framework.web.domain.BaseEntity;
|
||||
import com.zg.framework.aspectj.lang.annotation.Excel;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 调度任务实体类
|
||||
*
|
||||
* @author zg
|
||||
*/
|
||||
public class DdTask extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 任务编号 */
|
||||
@Excel(name = "任务编号")
|
||||
private String taskNo;
|
||||
|
||||
/** 任务详情 */
|
||||
@Excel(name = "任务详情")
|
||||
private String taskDtl;
|
||||
|
||||
/** 任务类型(0入库,1出库,2移库) */
|
||||
@Excel(name = "任务类型")
|
||||
private String taskType;
|
||||
|
||||
/** 任务状态(0待建,1完成,-1取消) */
|
||||
@Excel(name = "任务状态")
|
||||
private Integer taskStatus;
|
||||
|
||||
/** 物料状态(0空托,1有货) */
|
||||
@Excel(name = "物料状态")
|
||||
private Integer midStatus;
|
||||
|
||||
/** 物料编码 */
|
||||
@Excel(name = "物料编码")
|
||||
private String mid;
|
||||
|
||||
/** 物料数量 */
|
||||
@Excel(name = "物料数量")
|
||||
private Integer num;
|
||||
|
||||
/** 物资状态(合格品/不合格品/样品等) */
|
||||
@Excel(name = "物资状态")
|
||||
private String midType;
|
||||
|
||||
/** 起始位置 */
|
||||
@Excel(name = "起始位置")
|
||||
private String sourceName;
|
||||
|
||||
/** 目标位置 */
|
||||
@Excel(name = "目标位置")
|
||||
private String targetName;
|
||||
|
||||
/** 操作员 */
|
||||
@Excel(name = "操作员")
|
||||
private String operator;
|
||||
|
||||
/** 审核员 */
|
||||
@Excel(name = "审核员")
|
||||
private String approver;
|
||||
|
||||
/** 单据创建时间(原始单据时间) */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "单据创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date rcptim;
|
||||
|
||||
/** 绑定单据ID */
|
||||
@Excel(name = "rcp id")
|
||||
private String rid;
|
||||
|
||||
/** 执行次数 */
|
||||
@Excel(name = "执行次数")
|
||||
private Integer doCount;
|
||||
|
||||
/** 封签码或订单号 */
|
||||
@Excel(name = "封签码/订单号")
|
||||
private String prf;
|
||||
|
||||
/** 是否删除(0正常 1删除) */
|
||||
private String isDelete;
|
||||
|
||||
// getter/setter
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
|
||||
public String getTaskNo() { return taskNo; }
|
||||
public void setTaskNo(String taskNo) { this.taskNo = taskNo; }
|
||||
|
||||
public String getTaskDtl() { return taskDtl; }
|
||||
public void setTaskDtl(String taskDtl) { this.taskDtl = taskDtl; }
|
||||
|
||||
public String getTaskType() { return taskType; }
|
||||
public void setTaskType(String taskType) { this.taskType = taskType; }
|
||||
|
||||
public Integer getTaskStatus() { return taskStatus; }
|
||||
public void setTaskStatus(Integer taskStatus) { this.taskStatus = taskStatus; }
|
||||
|
||||
public Integer getMidStatus() { return midStatus; }
|
||||
public void setMidStatus(Integer midStatus) { this.midStatus = midStatus; }
|
||||
|
||||
public String getMid() { return mid; }
|
||||
public void setMid(String mid) { this.mid = mid; }
|
||||
|
||||
public Integer getNum() { return num; }
|
||||
public void setNum(Integer num) { this.num = num; }
|
||||
|
||||
public String getMidType() { return midType; }
|
||||
public void setMidType(String midType) { this.midType = midType; }
|
||||
|
||||
public String getSourceName() { return sourceName; }
|
||||
public void setSourceName(String sourceName) { this.sourceName = sourceName; }
|
||||
|
||||
public String getTargetName() { return targetName; }
|
||||
public void setTargetName(String targetName) { this.targetName = targetName; }
|
||||
|
||||
public String getOperator() { return operator; }
|
||||
public void setOperator(String operator) { this.operator = operator; }
|
||||
|
||||
public String getApprover() { return approver; }
|
||||
public void setApprover(String approver) { this.approver = approver; }
|
||||
|
||||
public Date getRcptim() { return rcptim; }
|
||||
public void setRcptim(Date rcptim) { this.rcptim = rcptim; }
|
||||
|
||||
public String getRid() { return rid; }
|
||||
public void setRid(String rid) { this.rid = rid; }
|
||||
|
||||
public Integer getDoCount() { return doCount; }
|
||||
public void setDoCount(Integer doCount) { this.doCount = doCount; }
|
||||
|
||||
public String getPrf() { return prf; }
|
||||
public void setPrf(String prf) { this.prf = prf; }
|
||||
|
||||
public String getIsDelete() { return isDelete; }
|
||||
public void setIsDelete(String isDelete) { this.isDelete = isDelete; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DdTask{" +
|
||||
"id=" + id +
|
||||
", taskNo='" + taskNo + '\'' +
|
||||
", taskDtl='" + taskDtl + '\'' +
|
||||
", taskType='" + taskType + '\'' +
|
||||
", taskStatus=" + taskStatus +
|
||||
", midStatus=" + midStatus +
|
||||
", mid='" + mid + '\'' +
|
||||
", num=" + num +
|
||||
", midType='" + midType + '\'' +
|
||||
", sourceName='" + sourceName + '\'' +
|
||||
", targetName='" + targetName + '\'' +
|
||||
", operator='" + operator + '\'' +
|
||||
", approver='" + approver + '\'' +
|
||||
", rcptim=" + rcptim +
|
||||
", rid='" + rid + '\'' +
|
||||
", doCount=" + doCount +
|
||||
", prf='" + prf + '\'' +
|
||||
", isDelete='" + isDelete + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
191
src/main/java/com/zg/project/wisdom/domain/MoveRecord.java
Normal file
191
src/main/java/com/zg/project/wisdom/domain/MoveRecord.java
Normal file
@@ -0,0 +1,191 @@
|
||||
package com.zg.project.wisdom.domain;
|
||||
|
||||
import com.zg.framework.web.domain.BaseEntity;
|
||||
import com.zg.framework.aspectj.lang.annotation.Excel;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 移库记录对象 move_record
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-06-20
|
||||
*/
|
||||
public class MoveRecord extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 关联的库存单据ID */
|
||||
@Excel(name = "库存单据ID")
|
||||
private Long rkId;
|
||||
|
||||
/** 实物ID */
|
||||
@Excel(name = "实物ID")
|
||||
private String entityId;
|
||||
|
||||
/** 原仓库 */
|
||||
@Excel(name = "原仓库")
|
||||
private String fromCangku;
|
||||
|
||||
/** 原库位码 */
|
||||
@Excel(name = "原库位码")
|
||||
private String fromPcode;
|
||||
|
||||
/** 原托盘码 */
|
||||
@Excel(name = "原托盘码")
|
||||
private String fromTrayCode;
|
||||
|
||||
/** 目标仓库 */
|
||||
@Excel(name = "目标仓库")
|
||||
private String toCangku;
|
||||
|
||||
/** 目标库位码 */
|
||||
@Excel(name = "目标库位码")
|
||||
private String toPcode;
|
||||
|
||||
/** 目标托盘码 */
|
||||
@Excel(name = "目标托盘码")
|
||||
private String toTrayCode;
|
||||
|
||||
/** 移库原因 */
|
||||
@Excel(name = "移库原因")
|
||||
private String moveReason;
|
||||
|
||||
/** 操作人 */
|
||||
private String movedBy;
|
||||
|
||||
@Excel(name = "操作人名称")
|
||||
private String movedByName;
|
||||
|
||||
/** 操作时间(移库时间) */
|
||||
@Excel(name = "操作时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date movedAt;
|
||||
|
||||
/** 是否删除(0正常 1删除) */
|
||||
@Excel(name = "是否删除", readConverterExp = "0=正常,1=删除")
|
||||
private String isDelete;
|
||||
|
||||
/** 原仓库名称 */
|
||||
@Excel(name = "原仓库名称")
|
||||
private String fromCangkuName;
|
||||
|
||||
/** 目标仓库名称 */
|
||||
@Excel(name = "目标仓库名称")
|
||||
private String toCangkuName;
|
||||
|
||||
/** 项目号 */
|
||||
@Excel(name = "项目号")
|
||||
private String xmNo;
|
||||
|
||||
/** 项目描述 */
|
||||
@Excel(name = "项目描述")
|
||||
private String xmMs;
|
||||
|
||||
/** 物料描述 */
|
||||
@Excel(name = "物料描述")
|
||||
private String wlMs;
|
||||
|
||||
/** 供应商名称 */
|
||||
@Excel(name = "供应商名称")
|
||||
private String gysMc;
|
||||
|
||||
// Getters and Setters
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
|
||||
public Long getRkId() { return rkId; }
|
||||
public void setRkId(Long rkId) { this.rkId = rkId; }
|
||||
|
||||
public String getEntityId() { return entityId; }
|
||||
public void setEntityId(String entityId) { this.entityId = entityId; }
|
||||
|
||||
public String getFromCangku() { return fromCangku; }
|
||||
public void setFromCangku(String fromCangku) { this.fromCangku = fromCangku; }
|
||||
|
||||
public String getFromPcode() { return fromPcode; }
|
||||
public void setFromPcode(String fromPcode) { this.fromPcode = fromPcode; }
|
||||
|
||||
public String getFromTrayCode() { return fromTrayCode; }
|
||||
public void setFromTrayCode(String fromTrayCode) { this.fromTrayCode = fromTrayCode; }
|
||||
|
||||
public String getToCangku() { return toCangku; }
|
||||
public void setToCangku(String toCangku) { this.toCangku = toCangku; }
|
||||
|
||||
public String getToPcode() { return toPcode; }
|
||||
public void setToPcode(String toPcode) { this.toPcode = toPcode; }
|
||||
|
||||
public String getToTrayCode() { return toTrayCode; }
|
||||
public void setToTrayCode(String toTrayCode) { this.toTrayCode = toTrayCode; }
|
||||
|
||||
public String getMoveReason() { return moveReason; }
|
||||
public void setMoveReason(String moveReason) { this.moveReason = moveReason; }
|
||||
|
||||
public String getMovedBy() { return movedBy; }
|
||||
public void setMovedBy(String movedBy) { this.movedBy = movedBy; }
|
||||
public String getMovedByName() {
|
||||
return movedByName;
|
||||
}
|
||||
public void setMovedByName(String movedByName) {
|
||||
this.movedByName = movedByName;
|
||||
}
|
||||
|
||||
public Date getMovedAt() { return movedAt; }
|
||||
public void setMovedAt(Date movedAt) { this.movedAt = movedAt; }
|
||||
|
||||
public String getIsDelete() { return isDelete; }
|
||||
public void setIsDelete(String isDelete) { this.isDelete = isDelete; }
|
||||
|
||||
public String getFromCangkuName() { return fromCangkuName; }
|
||||
public void setFromCangkuName(String fromCangkuName) { this.fromCangkuName = fromCangkuName; }
|
||||
|
||||
public String getToCangkuName() { return toCangkuName; }
|
||||
public void setToCangkuName(String toCangkuName) { this.toCangkuName = toCangkuName; }
|
||||
|
||||
public String getXmNo() { return xmNo; }
|
||||
public void setXmNo(String xmNo) { this.xmNo = xmNo; }
|
||||
|
||||
public String getXmMs() { return xmMs; }
|
||||
public void setXmMs(String xmMs) { this.xmMs = xmMs; }
|
||||
|
||||
public String getWlMs() { return wlMs; }
|
||||
public void setWlMs(String wlMs) { this.wlMs = wlMs; }
|
||||
|
||||
public String getGysMc() { return gysMc; }
|
||||
public void setGysMc(String gysMc) { this.gysMc = gysMc; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("rkId", getRkId())
|
||||
.append("entityId", getEntityId())
|
||||
.append("fromCangku", getFromCangku())
|
||||
.append("fromPcode", getFromPcode())
|
||||
.append("fromTrayCode", getFromTrayCode())
|
||||
.append("toCangku", getToCangku())
|
||||
.append("toPcode", getToPcode())
|
||||
.append("toTrayCode", getToTrayCode())
|
||||
.append("moveReason", getMoveReason())
|
||||
.append("movedBy", getMovedBy())
|
||||
.append("movedByName", getMovedByName())
|
||||
.append("movedAt", getMovedAt())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("isDelete", getIsDelete())
|
||||
.append("fromCangkuName", getFromCangkuName())
|
||||
.append("toCangkuName", getToCangkuName())
|
||||
.append("xmNo", getXmNo())
|
||||
.append("xmMs", getXmMs())
|
||||
.append("wlMs", getWlMs())
|
||||
.append("gysMc", getGysMc())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.zg.project.wisdom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
@@ -10,7 +12,7 @@ import com.zg.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 库存单据主对象 rk_info
|
||||
*
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-28
|
||||
*/
|
||||
@@ -28,15 +30,12 @@ public class RkInfo extends BaseEntity
|
||||
private Long stockAge;
|
||||
|
||||
/** 入库类型 */
|
||||
// @Excel(name = "入库类型")
|
||||
private String rkType;
|
||||
|
||||
/** 物资类型 */
|
||||
// @Excel(name = "物资类型")
|
||||
private String wlType;
|
||||
|
||||
/** 所属仓库 */
|
||||
// @Excel(name = "所属仓库")
|
||||
private String cangku;
|
||||
|
||||
/** 入库类型名称(联查显示用,导出专用) */
|
||||
@@ -55,6 +54,16 @@ public class RkInfo extends BaseEntity
|
||||
@Excel(name = "入库时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date rkTime;
|
||||
|
||||
/** 借用时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "借用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date borrowTime;
|
||||
|
||||
/** 归还时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "归还时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date returnTime;
|
||||
|
||||
/** 理货员 */
|
||||
@Excel(name = "理货员")
|
||||
private String lihuoY;
|
||||
@@ -76,13 +85,19 @@ public class RkInfo extends BaseEntity
|
||||
private String xj;
|
||||
|
||||
/** 项目号 */
|
||||
@Excel(name = "项目号")
|
||||
@Excel(name = "库存项目号")
|
||||
private String xmNo;
|
||||
|
||||
/** 项目描述 */
|
||||
@Excel(name = "项目描述")
|
||||
@Excel(name = "库存项目描述")
|
||||
private String xmMs;
|
||||
|
||||
@Excel(name = "领取方项目号")
|
||||
private String xmNoCk;
|
||||
|
||||
@Excel(name = "领取方项目描述")
|
||||
private String xmMsCk;
|
||||
|
||||
/** 物料号 */
|
||||
@Excel(name = "物料号")
|
||||
private String wlNo;
|
||||
@@ -129,7 +144,7 @@ public class RkInfo extends BaseEntity
|
||||
|
||||
/** 实际入库数量 */
|
||||
@Excel(name = "实际入库数量")
|
||||
private Long realQty;
|
||||
private BigDecimal realQty;
|
||||
|
||||
/** 库位码 */
|
||||
@Excel(name = "库位码")
|
||||
@@ -150,449 +165,238 @@ public class RkInfo extends BaseEntity
|
||||
@Excel(name = "出库理货员")
|
||||
private String ckLihuoY;
|
||||
|
||||
// @Excel(name = "出库类型编号")
|
||||
private String ckType;
|
||||
|
||||
@Excel(name = "出库类型名称")
|
||||
private String ckTypeName;
|
||||
|
||||
// @Excel(name = "施工队编号")
|
||||
private String teamCode;
|
||||
|
||||
@Excel(name = "施工队名称")
|
||||
private String teamName;
|
||||
// 出库时间
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "领用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lyTime;
|
||||
|
||||
@Excel(name = "出库备注")
|
||||
private String ckRemark;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String status;
|
||||
|
||||
/** 是否移库过(0否 1是) */
|
||||
@Excel(name = "是否移库过")
|
||||
private String hasMoved;
|
||||
|
||||
/** 是否借料(0否 1是) */
|
||||
@Excel(name = "是否借料", readConverterExp = "0=否,1=是")
|
||||
private String isBorrowed;
|
||||
|
||||
/** 入库开始时间 */
|
||||
private Date startTime;
|
||||
|
||||
/** 入库结束时间*/
|
||||
private Date endTime;
|
||||
|
||||
/** 是否删除(0 表示正常,1 表示已删除) */
|
||||
// @Excel(name = "是否删除", readConverterExp = "0=,表=示正常,1,表=示已删除")
|
||||
private String isDelete;
|
||||
|
||||
public String getKeyword() {
|
||||
return keyword;
|
||||
}
|
||||
|
||||
public void setKeyword(String keyword) {
|
||||
this.keyword = keyword;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setRkType(String rkType)
|
||||
{
|
||||
this.rkType = rkType;
|
||||
}
|
||||
|
||||
public String getRkType()
|
||||
{
|
||||
return rkType;
|
||||
}
|
||||
|
||||
public Long getStockAge() {
|
||||
return stockAge;
|
||||
}
|
||||
|
||||
public void setStockAge(Long stockAge) {
|
||||
this.stockAge = stockAge;
|
||||
}
|
||||
|
||||
public void setWlType(String wlType)
|
||||
{
|
||||
this.wlType = wlType;
|
||||
}
|
||||
|
||||
public String getWlType()
|
||||
{
|
||||
return wlType;
|
||||
}
|
||||
|
||||
public void setCangku(String cangku)
|
||||
{
|
||||
this.cangku = cangku;
|
||||
}
|
||||
|
||||
public String getCangku()
|
||||
{
|
||||
return cangku;
|
||||
}
|
||||
|
||||
public String getRkTypeName() {
|
||||
return rkTypeName;
|
||||
}
|
||||
public void setRkTypeName(String rkTypeName) {
|
||||
this.rkTypeName = rkTypeName;
|
||||
}
|
||||
|
||||
public String getWlTypeName() {
|
||||
return wlTypeName;
|
||||
}
|
||||
public void setWlTypeName(String wlTypeName) {
|
||||
this.wlTypeName = wlTypeName;
|
||||
}
|
||||
|
||||
public String getCangkuName() {
|
||||
return cangkuName;
|
||||
}
|
||||
public void setCangkuName(String cangkuName) {
|
||||
this.cangkuName = cangkuName;
|
||||
}
|
||||
|
||||
public void setRkTime(Date rkTime)
|
||||
{
|
||||
this.rkTime = rkTime;
|
||||
}
|
||||
|
||||
public Date getRkTime()
|
||||
{
|
||||
return rkTime;
|
||||
}
|
||||
|
||||
public void setLihuoY(String lihuoY)
|
||||
{
|
||||
this.lihuoY = lihuoY;
|
||||
}
|
||||
|
||||
public String getLihuoY()
|
||||
{
|
||||
return lihuoY;
|
||||
}
|
||||
|
||||
public void setIsChuku(String isChuku)
|
||||
{
|
||||
this.isChuku = isChuku;
|
||||
}
|
||||
|
||||
public String getIsChuku()
|
||||
{
|
||||
return isChuku;
|
||||
}
|
||||
|
||||
public String getBillNo() {
|
||||
return billNo;
|
||||
}
|
||||
|
||||
public String getBillNoCk() {
|
||||
return billNoCk;
|
||||
}
|
||||
|
||||
public void setBillNoCk(String billNoCk) {
|
||||
this.billNoCk = billNoCk;
|
||||
}
|
||||
|
||||
public void setBillNo(String billNo) {
|
||||
this.billNo = billNo;
|
||||
}
|
||||
|
||||
public void setXj(String xj)
|
||||
{
|
||||
this.xj = xj;
|
||||
}
|
||||
|
||||
public String getXj()
|
||||
{
|
||||
return xj;
|
||||
}
|
||||
|
||||
public void setXmNo(String xmNo)
|
||||
{
|
||||
this.xmNo = xmNo;
|
||||
}
|
||||
|
||||
public String getXmNo()
|
||||
{
|
||||
return xmNo;
|
||||
}
|
||||
|
||||
public void setXmMs(String xmMs)
|
||||
{
|
||||
this.xmMs = xmMs;
|
||||
}
|
||||
|
||||
public String getXmMs()
|
||||
{
|
||||
return xmMs;
|
||||
}
|
||||
|
||||
public void setWlNo(String wlNo)
|
||||
{
|
||||
this.wlNo = wlNo;
|
||||
}
|
||||
|
||||
public String getWlNo()
|
||||
{
|
||||
return wlNo;
|
||||
}
|
||||
|
||||
public void setWlMs(String wlMs)
|
||||
{
|
||||
this.wlMs = wlMs;
|
||||
}
|
||||
|
||||
public String getWlMs()
|
||||
{
|
||||
return wlMs;
|
||||
}
|
||||
|
||||
public void setGysNo(String gysNo)
|
||||
{
|
||||
this.gysNo = gysNo;
|
||||
}
|
||||
|
||||
public String getGysNo()
|
||||
{
|
||||
return gysNo;
|
||||
}
|
||||
|
||||
public void setGysMc(String gysMc)
|
||||
{
|
||||
this.gysMc = gysMc;
|
||||
}
|
||||
|
||||
public String getGysMc()
|
||||
{
|
||||
return gysMc;
|
||||
}
|
||||
|
||||
public void setJhAmt(BigDecimal jhAmt)
|
||||
{
|
||||
this.jhAmt = jhAmt;
|
||||
}
|
||||
|
||||
public BigDecimal getJhAmt()
|
||||
{
|
||||
return jhAmt;
|
||||
}
|
||||
|
||||
public void setHtDj(BigDecimal htDj)
|
||||
{
|
||||
this.htDj = htDj;
|
||||
}
|
||||
|
||||
public BigDecimal getHtDj()
|
||||
{
|
||||
return htDj;
|
||||
}
|
||||
|
||||
public void setSapNo(String sapNo)
|
||||
{
|
||||
this.sapNo = sapNo;
|
||||
}
|
||||
|
||||
public String getSapNo()
|
||||
{
|
||||
return sapNo;
|
||||
}
|
||||
|
||||
public void setXh(String xh)
|
||||
{
|
||||
this.xh = xh;
|
||||
}
|
||||
|
||||
public String getXh()
|
||||
{
|
||||
return xh;
|
||||
}
|
||||
|
||||
public void setJhQty(Long jhQty)
|
||||
{
|
||||
this.jhQty = jhQty;
|
||||
}
|
||||
|
||||
public Long getJhQty()
|
||||
{
|
||||
return jhQty;
|
||||
}
|
||||
|
||||
public void setHtQty(Long htQty)
|
||||
{
|
||||
this.htQty = htQty;
|
||||
}
|
||||
|
||||
public Long getHtQty()
|
||||
{
|
||||
return htQty;
|
||||
}
|
||||
|
||||
public void setDw(String dw)
|
||||
{
|
||||
this.dw = dw;
|
||||
}
|
||||
|
||||
public String getDw()
|
||||
{
|
||||
return dw;
|
||||
}
|
||||
|
||||
public void setRealQty(Long realQty)
|
||||
{
|
||||
this.realQty = realQty;
|
||||
}
|
||||
|
||||
public Long getRealQty()
|
||||
{
|
||||
return realQty;
|
||||
}
|
||||
|
||||
public void setPcode(String pcode)
|
||||
{
|
||||
this.pcode = pcode;
|
||||
}
|
||||
|
||||
public String getPcode()
|
||||
{
|
||||
return pcode;
|
||||
}
|
||||
|
||||
public void setPcodeId(String pcodeId) {
|
||||
this.pcodeId = pcodeId;
|
||||
}
|
||||
|
||||
public String getPcodeId() {
|
||||
return pcodeId;
|
||||
}
|
||||
|
||||
public void setTrayCode(String trayCode)
|
||||
{
|
||||
this.trayCode = trayCode;
|
||||
}
|
||||
|
||||
public String getTrayCode()
|
||||
{
|
||||
return trayCode;
|
||||
}
|
||||
|
||||
public void setEntityId(String entityId)
|
||||
{
|
||||
this.entityId = entityId;
|
||||
}
|
||||
|
||||
public String getEntityId()
|
||||
{
|
||||
return entityId;
|
||||
}
|
||||
|
||||
public String getCkLihuoY() {
|
||||
return ckLihuoY;
|
||||
}
|
||||
|
||||
public void setCkLihuoY(String ckLihuoY) {
|
||||
this.ckLihuoY = ckLihuoY;
|
||||
}
|
||||
|
||||
public String getCkType() {
|
||||
return ckType;
|
||||
}
|
||||
|
||||
public void setCkType(String ckType) {
|
||||
this.ckType = ckType;
|
||||
}
|
||||
|
||||
public String getCkTypeName() {
|
||||
return ckTypeName;
|
||||
}
|
||||
|
||||
public void setCkTypeName(String ckTypeName) {
|
||||
this.ckTypeName = ckTypeName;
|
||||
}
|
||||
|
||||
public String getTeamCode() {
|
||||
return teamCode;
|
||||
}
|
||||
|
||||
public void setTeamCode(String teamCode) {
|
||||
this.teamCode = teamCode;
|
||||
}
|
||||
|
||||
public String getTeamName() {
|
||||
return teamName;
|
||||
}
|
||||
|
||||
public void setTeamName(String teamName) {
|
||||
this.teamName = teamName;
|
||||
}
|
||||
|
||||
public String getCkRemark() {
|
||||
return ckRemark;
|
||||
}
|
||||
|
||||
public void setCkRemark(String ckRemark) {
|
||||
this.ckRemark = ckRemark;
|
||||
}
|
||||
|
||||
public Date getLyTime() {
|
||||
return lyTime;
|
||||
}
|
||||
|
||||
public void setLyTime(Date lyTime) {
|
||||
this.lyTime = lyTime;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
// Getter 和 Setter 方法
|
||||
public String getKeyword() { return keyword; }
|
||||
public void setKeyword(String keyword) { this.keyword = keyword; }
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getStockAge() { return stockAge; }
|
||||
public void setStockAge(Long stockAge) { this.stockAge = stockAge; }
|
||||
public String getRkType() { return rkType; }
|
||||
public void setRkType(String rkType) { this.rkType = rkType; }
|
||||
public String getWlType() { return wlType; }
|
||||
public void setWlType(String wlType) { this.wlType = wlType; }
|
||||
public String getCangku() { return cangku; }
|
||||
public void setCangku(String cangku) { this.cangku = cangku; }
|
||||
public String getRkTypeName() { return rkTypeName; }
|
||||
public void setRkTypeName(String rkTypeName) { this.rkTypeName = rkTypeName; }
|
||||
public String getWlTypeName() { return wlTypeName; }
|
||||
public void setWlTypeName(String wlTypeName) { this.wlTypeName = wlTypeName; }
|
||||
public String getCangkuName() { return cangkuName; }
|
||||
public void setCangkuName(String cangkuName) { this.cangkuName = cangkuName; }
|
||||
public Date getRkTime() { return rkTime; }
|
||||
public void setRkTime(Date rkTime) { this.rkTime = rkTime; }
|
||||
public Date getBorrowTime() {
|
||||
return borrowTime;
|
||||
}
|
||||
public void setBorrowTime(Date borrowTime) {
|
||||
this.borrowTime = borrowTime;
|
||||
}
|
||||
|
||||
public Date getReturnTime() {
|
||||
return returnTime;
|
||||
}
|
||||
public void setReturnTime(Date returnTime) {
|
||||
this.returnTime = returnTime;
|
||||
}
|
||||
|
||||
public String getLihuoY() { return lihuoY; }
|
||||
public void setLihuoY(String lihuoY) { this.lihuoY = lihuoY; }
|
||||
public String getIsChuku() { return isChuku; }
|
||||
public void setIsChuku(String isChuku) { this.isChuku = isChuku; }
|
||||
public String getBillNo() { return billNo; }
|
||||
public void setBillNo(String billNo) { this.billNo = billNo; }
|
||||
public String getBillNoCk() { return billNoCk; }
|
||||
public void setBillNoCk(String billNoCk) { this.billNoCk = billNoCk; }
|
||||
public String getXj() { return xj; }
|
||||
public void setXj(String xj) { this.xj = xj; }
|
||||
public String getXmNo() { return xmNo; }
|
||||
public void setXmNo(String xmNo) { this.xmNo = xmNo; }
|
||||
public String getXmMs() { return xmMs; }
|
||||
public void setXmMs(String xmMs) { this.xmMs = xmMs; }
|
||||
public String getWlNo() { return wlNo; }
|
||||
public void setWlNo(String wlNo) { this.wlNo = wlNo; }
|
||||
public String getWlMs() { return wlMs; }
|
||||
public void setWlMs(String wlMs) { this.wlMs = wlMs; }
|
||||
public String getGysNo() { return gysNo; }
|
||||
public void setGysNo(String gysNo) { this.gysNo = gysNo; }
|
||||
public String getGysMc() { return gysMc; }
|
||||
public void setGysMc(String gysMc) { this.gysMc = gysMc; }
|
||||
public BigDecimal getJhAmt() { return jhAmt; }
|
||||
public void setJhAmt(BigDecimal jhAmt) { this.jhAmt = jhAmt; }
|
||||
public BigDecimal getHtDj() { return htDj; }
|
||||
public void setHtDj(BigDecimal htDj) { this.htDj = htDj; }
|
||||
public String getSapNo() { return sapNo; }
|
||||
public void setSapNo(String sapNo) { this.sapNo = sapNo; }
|
||||
public String getXh() { return xh; }
|
||||
public void setXh(String xh) { this.xh = xh; }
|
||||
public Long getJhQty() { return jhQty; }
|
||||
public void setJhQty(Long jhQty) { this.jhQty = jhQty; }
|
||||
public Long getHtQty() { return htQty; }
|
||||
public void setHtQty(Long htQty) { this.htQty = htQty; }
|
||||
public String getDw() { return dw; }
|
||||
public void setDw(String dw) { this.dw = dw; }
|
||||
public BigDecimal getRealQty() { return realQty; }
|
||||
public void setRealQty(BigDecimal realQty) { this.realQty = realQty; }
|
||||
public String getPcode() { return pcode; }
|
||||
public void setPcode(String pcode) { this.pcode = pcode; }
|
||||
public String getPcodeId() { return pcodeId; }
|
||||
public void setPcodeId(String pcodeId) { this.pcodeId = pcodeId; }
|
||||
public String getTrayCode() { return trayCode; }
|
||||
public void setTrayCode(String trayCode) { this.trayCode = trayCode; }
|
||||
public String getEntityId() { return entityId; }
|
||||
public void setEntityId(String entityId) { this.entityId = entityId; }
|
||||
public String getCkLihuoY() { return ckLihuoY; }
|
||||
public void setCkLihuoY(String ckLihuoY) { this.ckLihuoY = ckLihuoY; }
|
||||
public String getCkType() { return ckType; }
|
||||
public void setCkType(String ckType) { this.ckType = ckType; }
|
||||
public String getCkTypeName() { return ckTypeName; }
|
||||
public void setCkTypeName(String ckTypeName) { this.ckTypeName = ckTypeName; }
|
||||
public String getTeamCode() { return teamCode; }
|
||||
public void setTeamCode(String teamCode) { this.teamCode = teamCode; }
|
||||
public String getTeamName() { return teamName; }
|
||||
public void setTeamName(String teamName) { this.teamName = teamName; }
|
||||
public Date getLyTime() { return lyTime; }
|
||||
public void setLyTime(Date lyTime) { this.lyTime = lyTime; }
|
||||
public String getCkRemark() { return ckRemark; }
|
||||
public void setCkRemark(String ckRemark) { this.ckRemark = ckRemark; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public String getHasMoved() { return hasMoved; }
|
||||
public void setHasMoved(String hasMoved) { this.hasMoved = hasMoved; }
|
||||
public String getXmNoCk() {
|
||||
return xmNoCk;
|
||||
}
|
||||
|
||||
public void setXmNoCk(String xmNoCk) {
|
||||
this.xmNoCk = xmNoCk;
|
||||
}
|
||||
|
||||
public String getXmMsCk() {
|
||||
return xmMsCk;
|
||||
}
|
||||
|
||||
public void setXmMsCk(String xmMsCk) {
|
||||
this.xmMsCk = xmMsCk;
|
||||
}
|
||||
|
||||
public Date getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(Date startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public Date getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Date endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getIsBorrowed() {
|
||||
return isBorrowed;
|
||||
}
|
||||
|
||||
public void setIsBorrowed(String isBorrowed) {
|
||||
this.isBorrowed = isBorrowed;
|
||||
}
|
||||
|
||||
public String getIsDelete() { return isDelete; }
|
||||
public void setIsDelete(String isDelete) { this.isDelete = isDelete; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("rkType", getRkType())
|
||||
.append("wlType", getWlType())
|
||||
.append("cangku", getCangku())
|
||||
.append("rkTime", getRkTime())
|
||||
.append("lihuoY", getLihuoY())
|
||||
.append("isChuku", getIsChuku())
|
||||
.append("billNo", getBillNo())
|
||||
.append("billNoCk", getBillNoCk())
|
||||
.append("remark", getRemark())
|
||||
.append("xj", getXj())
|
||||
.append("xmNo", getXmNo())
|
||||
.append("xmMs", getXmMs())
|
||||
.append("wlNo", getWlNo())
|
||||
.append("wlMs", getWlMs())
|
||||
.append("gysNo", getGysNo())
|
||||
.append("gysMc", getGysMc())
|
||||
.append("jhAmt", getJhAmt())
|
||||
.append("htDj", getHtDj())
|
||||
.append("sapNo", getSapNo())
|
||||
.append("xh", getXh())
|
||||
.append("jhQty", getJhQty())
|
||||
.append("htQty", getHtQty())
|
||||
.append("dw", getDw())
|
||||
.append("realQty", getRealQty())
|
||||
.append("pcode", getPcode())
|
||||
.append("pcodeId", getPcodeId())
|
||||
.append("trayCode", getTrayCode())
|
||||
.append("entityId", getEntityId())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("ckLihuoY", getCkLihuoY())
|
||||
.append("ckType", getCkType())
|
||||
.append("ckTypeName", getCkTypeName())
|
||||
.append("teamCode", getTeamCode())
|
||||
.append("teamName", getTeamName())
|
||||
.append("lyTime", getLyTime())
|
||||
.append("ckRemark", getCkRemark())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
.append("id", getId())
|
||||
.append("rkType", getRkType())
|
||||
.append("wlType", getWlType())
|
||||
.append("cangku", getCangku())
|
||||
.append("rkTime", getRkTime())
|
||||
.append("borrowTime", getBorrowTime())
|
||||
.append("returnTime", getReturnTime())
|
||||
.append("lihuoY", getLihuoY())
|
||||
.append("isChuku", getIsChuku())
|
||||
.append("billNo", getBillNo())
|
||||
.append("billNoCk", getBillNoCk())
|
||||
.append("remark", getRemark())
|
||||
.append("xj", getXj())
|
||||
.append("xmNo", getXmNo())
|
||||
.append("xmMs", getXmMs())
|
||||
.append("wlNo", getWlNo())
|
||||
.append("wlMs", getWlMs())
|
||||
.append("gysNo", getGysNo())
|
||||
.append("gysMc", getGysMc())
|
||||
.append("jhAmt", getJhAmt())
|
||||
.append("htDj", getHtDj())
|
||||
.append("sapNo", getSapNo())
|
||||
.append("xh", getXh())
|
||||
.append("jhQty", getJhQty())
|
||||
.append("htQty", getHtQty())
|
||||
.append("dw", getDw())
|
||||
.append("realQty", getRealQty())
|
||||
.append("pcode", getPcode())
|
||||
.append("pcodeId", getPcodeId())
|
||||
.append("trayCode", getTrayCode())
|
||||
.append("entityId", getEntityId())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("ckLihuoY", getCkLihuoY())
|
||||
.append("ckType", getCkType())
|
||||
.append("ckTypeName", getCkTypeName())
|
||||
.append("teamCode", getTeamCode())
|
||||
.append("teamName", getTeamName())
|
||||
.append("lyTime", getLyTime())
|
||||
.append("ckRemark", getCkRemark())
|
||||
.append("status", getStatus())
|
||||
.append("hasMoved", getHasMoved())
|
||||
.append("xmNoCk", getXmNoCk())
|
||||
.append("xmMsCk", getXmMsCk())
|
||||
.append("startTime", getStartTime())
|
||||
.append("endTime", getEndTime())
|
||||
.append("isBorrowed", getIsBorrowed())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
18
src/main/java/com/zg/project/wisdom/domain/dto/AgvDTO.java
Normal file
18
src/main/java/com/zg/project/wisdom/domain/dto/AgvDTO.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.zg.project.wisdom.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AgvDTO {
|
||||
private String requestId;
|
||||
private String jobId;
|
||||
private String owner;
|
||||
private String type;
|
||||
private String priority;
|
||||
private String sourceName;
|
||||
private String targetName;
|
||||
private String createdAt;
|
||||
private String updatedAt;
|
||||
private String status;
|
||||
private String msg;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.zg.project.wisdom.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("移库请求对象")
|
||||
public class MoveRequestDTO {
|
||||
|
||||
@ApiModelProperty("原库存ID")
|
||||
private Long fromRkId;
|
||||
|
||||
@ApiModelProperty("移库原因")
|
||||
private String moveReason;
|
||||
|
||||
@ApiModelProperty("操作人")
|
||||
private String movedBy;
|
||||
|
||||
@ApiModelProperty("操作时间")
|
||||
private String movedAt;
|
||||
|
||||
@ApiModelProperty("目标列表")
|
||||
private List<MoveTargetItem> targets;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zg.project.wisdom.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@ApiModel("目标位置项")
|
||||
public class MoveTargetItem {
|
||||
|
||||
@ApiModelProperty("目标仓库")
|
||||
private String toCangku;
|
||||
|
||||
@ApiModelProperty("目标库位码")
|
||||
private String toPcode;
|
||||
|
||||
@ApiModelProperty("目标托盘码")
|
||||
private String toTrayCode;
|
||||
|
||||
@ApiModelProperty("实际移动数量")
|
||||
private BigDecimal realQty;
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class PcRkInfoItemDTO {
|
||||
private BigDecimal htDj;
|
||||
|
||||
/** 实际入库数量 */
|
||||
private Long realQty;
|
||||
private BigDecimal realQty;
|
||||
|
||||
/** 库位码 */
|
||||
private String pcode;
|
||||
@@ -203,11 +203,11 @@ public class PcRkInfoItemDTO {
|
||||
this.htDj = htDj;
|
||||
}
|
||||
|
||||
public Long getRealQty() {
|
||||
public BigDecimal getRealQty() {
|
||||
return realQty;
|
||||
}
|
||||
|
||||
public void setRealQty(Long realQty) {
|
||||
public void setRealQty(BigDecimal realQty) {
|
||||
this.realQty = realQty;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.zg.project.wisdom.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 还料入库请求 DTO
|
||||
*/
|
||||
@Data
|
||||
public class RefundRequestDTO {
|
||||
|
||||
/** 原出库记录ID */
|
||||
private Long originalId;
|
||||
|
||||
/** 新库位码 */
|
||||
private String pcode;
|
||||
|
||||
/** 入库类型 */
|
||||
private String rkType;
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.zg.project.wisdom.domain.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class RkInfoScanDTO {
|
||||
|
||||
/** 库位码 */
|
||||
@@ -12,7 +14,7 @@ public class RkInfoScanDTO {
|
||||
private String trayCode;
|
||||
|
||||
/** 实际数量 */
|
||||
private Long realQty;
|
||||
private BigDecimal realQty;
|
||||
|
||||
/** 实物 ID */
|
||||
private String entityId;
|
||||
@@ -44,11 +46,11 @@ public class RkInfoScanDTO {
|
||||
this.trayCode = trayCode;
|
||||
}
|
||||
|
||||
public Long getRealQty() {
|
||||
public BigDecimal getRealQty() {
|
||||
return realQty;
|
||||
}
|
||||
|
||||
public void setRealQty(Long realQty) {
|
||||
public void setRealQty(BigDecimal realQty) {
|
||||
this.realQty = realQty;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,12 @@ public class StockOutDTO {
|
||||
/** 领用时间(出库时间) */
|
||||
private Date lyTime;
|
||||
|
||||
/** 借用时间 */
|
||||
private Date borrowTime;
|
||||
|
||||
/** 归还时间 */
|
||||
private Date returnTime;
|
||||
|
||||
/** 施工队编码 */
|
||||
private String teamCode;
|
||||
|
||||
@@ -24,6 +30,12 @@ public class StockOutDTO {
|
||||
/** 出库理货员 */
|
||||
private String ckLihuoY;
|
||||
|
||||
/** 领取项目编号 */
|
||||
private String xmNoCk;
|
||||
|
||||
/** 领取项目描述*/
|
||||
private String xmMsCk;
|
||||
|
||||
/** 出库列表 */
|
||||
private List<StockOutItemDTO> ckList;
|
||||
|
||||
|
||||
@@ -13,4 +13,5 @@ public class StockOutItemDTO {
|
||||
|
||||
/** 出库备注 */
|
||||
private String ckRemark;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.zg.project.wisdom.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TaskExecuteResultVO {
|
||||
|
||||
/** 请求ID(taskNo + AGV) */
|
||||
private String requestId;
|
||||
|
||||
/** AGV接口返回码 */
|
||||
private Integer code;
|
||||
|
||||
/** AGV接口返回信息 */
|
||||
private String msg;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.zg.project.wisdom.mapper;
|
||||
|
||||
import com.zg.project.wisdom.domain.AgvTaskResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AgvTaskResultMapper {
|
||||
|
||||
AgvTaskResult selectAgvTaskResultById(Long id);
|
||||
|
||||
List<AgvTaskResult> selectAgvTaskResultList(AgvTaskResult agvTaskResult);
|
||||
|
||||
int insertAgvTaskResult(AgvTaskResult agvTaskResult);
|
||||
|
||||
int updateAgvTaskResult(AgvTaskResult agvTaskResult);
|
||||
|
||||
int deleteAgvTaskResultById(Long id);
|
||||
|
||||
int deleteAgvTaskResultByIds(Long[] ids);
|
||||
|
||||
int selectCountByRequestIdAndStatus(String requestId, String status);
|
||||
}
|
||||
42
src/main/java/com/zg/project/wisdom/mapper/DdTaskMapper.java
Normal file
42
src/main/java/com/zg/project/wisdom/mapper/DdTaskMapper.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package com.zg.project.wisdom.mapper;
|
||||
|
||||
import com.zg.project.wisdom.domain.DdTask;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 调度任务 Mapper 接口
|
||||
*
|
||||
* @author zg
|
||||
*/
|
||||
public interface DdTaskMapper {
|
||||
|
||||
/**
|
||||
* 查询调度任务列表
|
||||
*/
|
||||
List<DdTask> selectDdTaskList(DdTask ddTask);
|
||||
|
||||
/**
|
||||
* 查询单个调度任务
|
||||
*/
|
||||
DdTask selectDdTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 新增调度任务
|
||||
*/
|
||||
int insertDdTask(DdTask ddTask);
|
||||
|
||||
/**
|
||||
* 修改调度任务
|
||||
*/
|
||||
int updateDdTask(DdTask ddTask);
|
||||
|
||||
/**
|
||||
* 批量删除调度任务
|
||||
*/
|
||||
int deleteDdTaskByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除单个调度任务
|
||||
*/
|
||||
int deleteDdTaskById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zg.project.wisdom.mapper;
|
||||
|
||||
import com.zg.project.wisdom.domain.MoveRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 移库记录Mapper接口
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-06-20
|
||||
*/
|
||||
public interface MoveRecordMapper
|
||||
{
|
||||
/**
|
||||
* 查询移库记录
|
||||
*
|
||||
* @param id 移库记录主键
|
||||
* @return 移库记录
|
||||
*/
|
||||
public MoveRecord selectMoveRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 查询移库记录列表
|
||||
*
|
||||
* @param moveRecord 查询条件
|
||||
* @return 移库记录集合
|
||||
*/
|
||||
public List<MoveRecord> selectMoveRecordList(MoveRecord moveRecord);
|
||||
|
||||
/**
|
||||
* 修改移库记录
|
||||
*
|
||||
* @param moveRecord 移库记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMoveRecord(MoveRecord moveRecord);
|
||||
|
||||
/**
|
||||
* 删除移库记录
|
||||
*
|
||||
* @param id 移库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMoveRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除移库记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMoveRecordByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 新增移库记录
|
||||
*
|
||||
* @param moveRecord 移库记录
|
||||
* @return 结果
|
||||
*/
|
||||
void insertMoveRecord(MoveRecord moveRecord);
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.zg.project.wisdom.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zg.project.Inventory.domain.vo.PcdeCntVO;
|
||||
import com.zg.project.Inventory.domain.vo.RkInfoMatchVO;
|
||||
import com.zg.project.wisdom.domain.RkInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -118,4 +121,53 @@ public interface RkInfoMapper
|
||||
* @param billNoCk
|
||||
*/
|
||||
int cancelStockOut(String billNoCk);
|
||||
|
||||
/**
|
||||
* 查看盘点扫描正常数据
|
||||
* @param pcdeIds
|
||||
* @return
|
||||
*/
|
||||
List<RkInfo> getByPcodeIdList(List<String> pcdeIds);
|
||||
|
||||
/**
|
||||
* 盘点扫描未正常数据
|
||||
* @param pcdeIds
|
||||
* @return
|
||||
*/
|
||||
List<RkInfo> getMissedPcodeIds(List<String> pcdeIds);
|
||||
|
||||
/**
|
||||
* 判断盘点扫描的id是否存在
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int existsByPcodeId(String id);
|
||||
|
||||
/**
|
||||
* 获取指定仓库的盘点数据
|
||||
* @param warehouse
|
||||
* @return
|
||||
*/
|
||||
int countGetByWh(@Param("warehouse") String warehouse);
|
||||
|
||||
/**
|
||||
* 根据所属仓库查询所有的库位号和库位对应的货物数量
|
||||
* @param wh
|
||||
* @return
|
||||
*/
|
||||
List<RkInfoMatchVO> getUnscannedPcodeByWh(@Param("wh") String wh, @Param("taskId") String taskId);
|
||||
|
||||
/**
|
||||
* 图表统计:每个库位有多少个货物
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<PcdeCntVO> selectPcdeCntFromRkInfo(List<String> ids);
|
||||
|
||||
/**
|
||||
* 还料入库
|
||||
* @param newEntry
|
||||
* @return
|
||||
*/
|
||||
int insertRkInfo(RkInfo newEntry);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zg.project.wisdom.service;
|
||||
|
||||
import com.zg.project.wisdom.domain.AgvTaskResult;
|
||||
import com.zg.project.wisdom.domain.dto.AgvDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IAgvTaskResultService {
|
||||
/** 根据主键查询AGV任务结果 */
|
||||
AgvTaskResult selectAgvTaskResultById(Long id);
|
||||
|
||||
/** 查询AGV任务结果列表 */
|
||||
List<AgvTaskResult> selectAgvTaskResultList(AgvTaskResult agvTaskResult);
|
||||
|
||||
/** 插入新的AGV任务结果记录 */
|
||||
int insertAgvTaskResult(AgvTaskResult agvTaskResult);
|
||||
|
||||
/** 更新AGV任务结果记录 */
|
||||
int updateAgvTaskResult(AgvTaskResult agvTaskResult);
|
||||
|
||||
/** 根据主键删除AGV任务结果 */
|
||||
int deleteAgvTaskResultById(Long id);
|
||||
|
||||
/** 根据主键数组批量删除AGV任务结果 */
|
||||
int deleteAgvTaskResultByIds(Long[] ids);
|
||||
|
||||
/** 处理AGV回调 */
|
||||
void handleAgvCallback(AgvDTO dto);
|
||||
|
||||
/** 根据请求ID和状态判断AGV任务结果是否存在 */
|
||||
boolean existsByRequestIdAndStatus(String requestId, String status);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.zg.project.wisdom.service;
|
||||
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.project.wisdom.domain.DdTask;
|
||||
import com.zg.project.wisdom.domain.vo.TaskExecuteResultVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 调度任务 Service 接口
|
||||
*
|
||||
* @author zg
|
||||
*/
|
||||
public interface IDdTaskService {
|
||||
|
||||
/**
|
||||
* 查询调度任务列表
|
||||
*/
|
||||
List<DdTask> selectDdTaskList(DdTask ddTask);
|
||||
|
||||
/**
|
||||
* 查询单个调度任务
|
||||
*/
|
||||
DdTask selectDdTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 新增调度任务
|
||||
*/
|
||||
int insertDdTask(DdTask ddTask);
|
||||
|
||||
/**
|
||||
* 修改调度任务
|
||||
*/
|
||||
int updateDdTask(DdTask ddTask);
|
||||
|
||||
/**
|
||||
* 批量删除调度任务
|
||||
*/
|
||||
int deleteDdTaskByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除单个调度任务
|
||||
*/
|
||||
int deleteDdTaskById(Long id);
|
||||
|
||||
/**
|
||||
* 执行任务
|
||||
*/
|
||||
TaskExecuteResultVO executeTask(Long id);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.zg.project.wisdom.service;
|
||||
|
||||
import com.zg.project.wisdom.domain.MoveRecord;
|
||||
import com.zg.project.wisdom.domain.dto.MoveRequestDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 移库记录Service接口
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-06-20
|
||||
*/
|
||||
public interface IMoveRecordService
|
||||
{
|
||||
/**
|
||||
* 查询移库记录
|
||||
*
|
||||
* @param id 移库记录主键
|
||||
* @return 移库记录
|
||||
*/
|
||||
public MoveRecord selectMoveRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 查询移库记录列表
|
||||
*
|
||||
* @param moveRecord 查询条件
|
||||
* @return 移库记录集合
|
||||
*/
|
||||
public List<MoveRecord> selectMoveRecordList(MoveRecord moveRecord);
|
||||
|
||||
|
||||
/**
|
||||
* 修改移库记录
|
||||
*
|
||||
* @param moveRecord 移库记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMoveRecord(MoveRecord moveRecord);
|
||||
|
||||
/**
|
||||
* 批量删除移库记录
|
||||
*
|
||||
* @param ids 移库记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMoveRecordByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除移库记录
|
||||
*
|
||||
* @param id 移库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMoveRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 批量处理移库
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
void processMove(MoveRequestDTO dto);
|
||||
}
|
||||
@@ -3,8 +3,11 @@ package com.zg.project.wisdom.service;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zg.project.Inventory.domain.dto.QueryDTO;
|
||||
import com.zg.project.Inventory.domain.vo.ChartDataVO;
|
||||
import com.zg.project.wisdom.domain.RkInfo;
|
||||
import com.zg.project.wisdom.domain.dto.PcRkInfoBatchDTO;
|
||||
import com.zg.project.wisdom.domain.dto.RefundRequestDTO;
|
||||
import com.zg.project.wisdom.domain.dto.RkInfoBatchDTO;
|
||||
import com.zg.project.wisdom.domain.dto.StockOutDTO;
|
||||
|
||||
@@ -102,4 +105,32 @@ public interface IRkInfoService
|
||||
* @param
|
||||
*/
|
||||
int deleteByCkBillNo(String billNoCk);
|
||||
|
||||
/**
|
||||
* 盘点开始匹配
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
void matchWithStatus(QueryDTO dto);
|
||||
|
||||
/**
|
||||
* 统计指定仓库的库存数量
|
||||
* @param warehouse
|
||||
* @return
|
||||
*/
|
||||
int countGetByWh(String warehouse);
|
||||
|
||||
/**
|
||||
* 图表统计:每个库位有多少个货物
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
ChartDataVO matchWithAll(QueryDTO dto);
|
||||
|
||||
/**
|
||||
* 还料入库
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int refundMaterial(RefundRequestDTO dto);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.zg.project.wisdom.service.impl;
|
||||
|
||||
import com.zg.common.utils.DateUtils;
|
||||
import com.zg.common.utils.SecurityUtils;
|
||||
import com.zg.project.wisdom.domain.AgvTaskResult;
|
||||
import com.zg.project.wisdom.domain.dto.AgvDTO;
|
||||
import com.zg.project.wisdom.mapper.AgvTaskResultMapper;
|
||||
import com.zg.project.wisdom.service.IAgvTaskResultService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class AgvTaskResultServiceImpl implements IAgvTaskResultService {
|
||||
|
||||
@Autowired
|
||||
private AgvTaskResultMapper agvTaskResultMapper;
|
||||
|
||||
@Override
|
||||
public AgvTaskResult selectAgvTaskResultById(Long id) {
|
||||
return agvTaskResultMapper.selectAgvTaskResultById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AgvTaskResult> selectAgvTaskResultList(AgvTaskResult agvTaskResult) {
|
||||
return agvTaskResultMapper.selectAgvTaskResultList(agvTaskResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertAgvTaskResult(AgvTaskResult agvTaskResult) {
|
||||
agvTaskResult.setCreateBy(SecurityUtils.getUserId().toString());
|
||||
return agvTaskResultMapper.insertAgvTaskResult(agvTaskResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAgvTaskResult(AgvTaskResult agvTaskResult) {
|
||||
agvTaskResult.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||
return agvTaskResultMapper.updateAgvTaskResult(agvTaskResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAgvTaskResultById(Long id) {
|
||||
return agvTaskResultMapper.deleteAgvTaskResultById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAgvTaskResultByIds(Long[] ids) {
|
||||
return agvTaskResultMapper.deleteAgvTaskResultByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleAgvCallback(AgvDTO dto) {
|
||||
String requestId = dto.getRequestId();
|
||||
String taskNo = requestId != null && requestId.length() > 2
|
||||
? requestId.substring(0, requestId.length() - 2)
|
||||
: requestId;
|
||||
|
||||
AgvTaskResult result = new AgvTaskResult();
|
||||
result.setRequestId(requestId);
|
||||
result.setTaskNo(taskNo);
|
||||
result.setJobId(dto.getJobId());
|
||||
result.setOwner(dto.getOwner());
|
||||
result.setType(dto.getType());
|
||||
result.setPriority(dto.getPriority());
|
||||
result.setSourceName(dto.getSourceName());
|
||||
result.setTargetName(dto.getTargetName());
|
||||
result.setCreatedAt(dto.getCreatedAt());
|
||||
result.setUpdatedAt(dto.getUpdatedAt());
|
||||
result.setStatus(dto.getStatus());
|
||||
result.setMsg(dto.getMsg());
|
||||
result.setCreateBy("agv");
|
||||
result.setCreateTime(DateUtils.getNowDate());
|
||||
result.setIsDelete("0");
|
||||
|
||||
agvTaskResultMapper.insertAgvTaskResult(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean existsByRequestIdAndStatus(String requestId, String status) {
|
||||
return agvTaskResultMapper.selectCountByRequestIdAndStatus(requestId, status) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.zg.project.wisdom.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.zg.common.exception.ServiceException;
|
||||
import com.zg.common.utils.DateUtils;
|
||||
import com.zg.common.utils.SecurityUtils;
|
||||
import com.zg.common.utils.StringUtils;
|
||||
import com.zg.common.utils.http.HttpUtils;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.project.wisdom.domain.DdTask;
|
||||
import com.zg.project.wisdom.domain.vo.TaskExecuteResultVO;
|
||||
import com.zg.project.wisdom.mapper.DdTaskMapper;
|
||||
import com.zg.project.wisdom.service.IDdTaskService;
|
||||
import org.apache.commons.lang3.RandomUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 调度任务 Service 实现类
|
||||
*
|
||||
* @author zg
|
||||
*/
|
||||
@Service
|
||||
public class DdTaskServiceImpl implements IDdTaskService {
|
||||
|
||||
@Autowired
|
||||
private DdTaskMapper ddTaskMapper;
|
||||
|
||||
@Value("${agv.job.create-url}")
|
||||
private String agvJobCreateUrl;
|
||||
|
||||
@Override
|
||||
public List<DdTask> selectDdTaskList(DdTask ddTask) {
|
||||
return ddTaskMapper.selectDdTaskList(ddTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DdTask selectDdTaskById(Long id) {
|
||||
return ddTaskMapper.selectDdTaskById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertDdTask(DdTask ddTask) {
|
||||
// 1. 生成任务编号(如 DD20250701143059001)
|
||||
String taskNo = "DD" + DateUtils.dateTimeNow("yyyyMMddHHmmssSSS");
|
||||
ddTask.setTaskNo(taskNo);
|
||||
|
||||
// 2. 判断 mid 是否为空,设置 midStatus(0空托盘,1有货)
|
||||
if (ddTask.getMid() == null || ddTask.getMid().trim().isEmpty()) {
|
||||
ddTask.setMidStatus(0);
|
||||
} else {
|
||||
ddTask.setMidStatus(1);
|
||||
}
|
||||
|
||||
// 3. 设置任务初始状态为待建(0)
|
||||
ddTask.setTaskStatus(0);
|
||||
|
||||
// 4. 设置操作员和审核员(从当前登录用户上下文中获取)
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
ddTask.setOperator(userId.toString());
|
||||
ddTask.setApprover(userId.toString());
|
||||
|
||||
// 5. 设置接收时间 rcptim 和初始化字段
|
||||
ddTask.setRcptim(DateUtils.getNowDate());
|
||||
ddTask.setRid("");
|
||||
ddTask.setDoCount(0);
|
||||
|
||||
// 6. 设置通用字段
|
||||
ddTask.setCreateBy(userId.toString());
|
||||
ddTask.setCreateTime(DateUtils.getNowDate());
|
||||
ddTask.setUpdateBy(userId.toString());
|
||||
ddTask.setUpdateTime(DateUtils.getNowDate());
|
||||
ddTask.setIsDelete("0");
|
||||
|
||||
return ddTaskMapper.insertDdTask(ddTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateDdTask(DdTask ddTask) {
|
||||
return ddTaskMapper.updateDdTask(ddTask);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteDdTaskByIds(Long[] ids) {
|
||||
return ddTaskMapper.deleteDdTaskByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteDdTaskById(Long id) {
|
||||
return ddTaskMapper.deleteDdTaskById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TaskExecuteResultVO executeTask(Long id) {
|
||||
// 1. 查询任务
|
||||
DdTask task = ddTaskMapper.selectDdTaskById(id);
|
||||
if (task == null) {
|
||||
throw new ServiceException("任务不存在,ID = " + id);
|
||||
}
|
||||
if (task.getTaskStatus() == null || task.getTaskStatus() != 0) {
|
||||
throw new ServiceException("任务状态不是待执行,当前状态为:" + task.getTaskStatus());
|
||||
}
|
||||
|
||||
// 2. 构造 requestId
|
||||
String requestId;
|
||||
if (StringUtils.isBlank(task.getTaskNo())) {
|
||||
String timeStr = LocalDateTime.now().format(DateTimeFormatter.ofPattern("MMddHHmmss"));
|
||||
int rand = new Random().nextInt(900) + 100;
|
||||
requestId = timeStr + rand;
|
||||
int num = Optional.ofNullable(task.getNum()).orElse(0);
|
||||
requestId += String.format("%02d", num);
|
||||
} else {
|
||||
requestId = task.getTaskNo();
|
||||
}
|
||||
requestId += "1"; // AGV 固定值
|
||||
int type = NumberUtils.toInt(task.getTaskType(), 0);
|
||||
requestId += (type + 1); // 1上架、2下架、3移库
|
||||
|
||||
// 3. 构造 AGV 参数
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("requestId", requestId);
|
||||
param.put("taskNo", task.getTaskNo());
|
||||
param.put("owner", "wms");
|
||||
param.put("type", type);
|
||||
param.put("priority", 1);
|
||||
param.put("sourceName", task.getSourceName());
|
||||
param.put("targetName", task.getTargetName());
|
||||
|
||||
// 4. 调用 AGV 接口
|
||||
String result = HttpUtils.sendPost(agvJobCreateUrl, param.toJSONString());
|
||||
if (StringUtils.isBlank(result)) {
|
||||
throw new ServiceException("AGV接口无响应");
|
||||
}
|
||||
|
||||
Integer code;
|
||||
String msg;
|
||||
try {
|
||||
JSONObject json = JSON.parseObject(result);
|
||||
code = json.getInteger("code");
|
||||
msg = json.getString("msg");
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("AGV响应解析失败:" + result);
|
||||
}
|
||||
|
||||
if (!Objects.equals(code, 0)) {
|
||||
throw new ServiceException("AGV调用失败:" + msg);
|
||||
}
|
||||
|
||||
// 5. 更新任务状态
|
||||
task.setTaskStatus(1);
|
||||
task.setDoCount(task.getDoCount() != null ? task.getDoCount() + 1 : 1);
|
||||
task.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||
task.setUpdateTime(DateUtils.getNowDate());
|
||||
ddTaskMapper.updateDdTask(task);
|
||||
|
||||
// 6. 返回结果
|
||||
TaskExecuteResultVO resultVO = new TaskExecuteResultVO();
|
||||
resultVO.setRequestId(requestId);
|
||||
resultVO.setCode(code);
|
||||
resultVO.setMsg(msg);
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
package com.zg.project.wisdom.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.zg.common.exception.ServiceException;
|
||||
import com.zg.common.utils.DateUtils;
|
||||
import com.zg.common.utils.EntityFillUtils;
|
||||
import com.zg.common.utils.SecurityUtils;
|
||||
import com.zg.project.wisdom.domain.RkInfo;
|
||||
import com.zg.project.wisdom.domain.dto.MoveRequestDTO;
|
||||
import com.zg.project.wisdom.domain.dto.MoveTargetItem;
|
||||
import com.zg.project.wisdom.mapper.MoveRecordMapper;
|
||||
import com.zg.project.wisdom.domain.MoveRecord;
|
||||
import com.zg.project.wisdom.mapper.RkInfoMapper;
|
||||
import com.zg.project.wisdom.service.IMoveRecordService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 移库记录Service业务层处理
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-06-20
|
||||
*/
|
||||
@Service
|
||||
public class MoveRecordServiceImpl implements IMoveRecordService
|
||||
{
|
||||
@Autowired
|
||||
private MoveRecordMapper moveRecordMapper;
|
||||
|
||||
@Autowired
|
||||
private RkInfoMapper rkInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询移库记录
|
||||
*
|
||||
* @param id 移库记录主键
|
||||
* @return 移库记录
|
||||
*/
|
||||
@Override
|
||||
public MoveRecord selectMoveRecordById(Long id)
|
||||
{
|
||||
return moveRecordMapper.selectMoveRecordById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询移库记录列表
|
||||
*
|
||||
* @param moveRecord 查询条件
|
||||
* @return 移库记录
|
||||
*/
|
||||
@Override
|
||||
public List<MoveRecord> selectMoveRecordList(MoveRecord moveRecord)
|
||||
{
|
||||
return moveRecordMapper.selectMoveRecordList(moveRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增移库记录
|
||||
*
|
||||
* @param moveRecord 移库记录
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
/**
|
||||
* 修改移库记录
|
||||
*
|
||||
* @param moveRecord 移库记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMoveRecord(MoveRecord moveRecord)
|
||||
{
|
||||
return moveRecordMapper.updateMoveRecord(moveRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除移库记录
|
||||
*
|
||||
* @param ids 需要删除的移库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMoveRecordByIds(Long[] ids)
|
||||
{
|
||||
return moveRecordMapper.deleteMoveRecordByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除移库记录信息
|
||||
*
|
||||
* @param id 移库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMoveRecordById(Long id)
|
||||
{
|
||||
return moveRecordMapper.deleteMoveRecordById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理库存移库操作
|
||||
*
|
||||
* @param dto 移库请求参数(包含原库存ID、移库目标列表等)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void processMove(MoveRequestDTO dto) {
|
||||
// 查询原始库存记录
|
||||
RkInfo original = rkInfoMapper.selectRkInfoById(dto.getFromRkId());
|
||||
if (original == null || "1".equals(original.getIsDelete())) {
|
||||
throw new ServiceException("原库存不存在或已删除");
|
||||
}
|
||||
|
||||
// 计算目标总数量
|
||||
BigDecimal totalQty = dto.getTargets().stream()
|
||||
.map(MoveTargetItem::getRealQty)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
// 原始库存数量
|
||||
BigDecimal realQty = original.getRealQty();
|
||||
if (realQty == null) {
|
||||
throw new ServiceException("原库存数量为空,无法进行比较");
|
||||
}
|
||||
|
||||
if (totalQty.compareTo(realQty) > 0) {
|
||||
throw new ServiceException("拆分总数量不能大于原库存数量");
|
||||
}
|
||||
|
||||
// 操作信息
|
||||
String username = dto.getMovedBy();
|
||||
Date now = DateUtils.parseDate(dto.getMovedAt());
|
||||
|
||||
// 情况一:整库移库(目标总数量 = 原库存,且仅一个目标)
|
||||
if (dto.getTargets().size() == 1 && totalQty.compareTo(realQty) == 0) {
|
||||
MoveTargetItem target = dto.getTargets().get(0);
|
||||
|
||||
RkInfo info = new RkInfo();
|
||||
BeanUtils.copyProperties(original, info);
|
||||
|
||||
original.setCangku(target.getToCangku());
|
||||
original.setPcode(target.getToPcode());
|
||||
original.setTrayCode(target.getToTrayCode());
|
||||
original.setHasMoved("1");
|
||||
original.setUpdateBy(username);
|
||||
original.setUpdateTime(now);
|
||||
rkInfoMapper.updateRkInfo(original);
|
||||
|
||||
// 记录移库日志
|
||||
moveRecordMapper.insertMoveRecord(createMoveRecord(info, target, dto));
|
||||
return;
|
||||
}
|
||||
|
||||
// 情况二 & 三:需要新建多条库存记录
|
||||
List<RkInfo> insertList = new ArrayList<>();
|
||||
|
||||
// 情况三:部分移库(目标总量 < 原库存)
|
||||
if (totalQty.compareTo(realQty) < 0) {
|
||||
// 原库存数量减少
|
||||
original.setRealQty(realQty.subtract(totalQty));
|
||||
original.setUpdateBy(username);
|
||||
original.setUpdateTime(now);
|
||||
rkInfoMapper.updateRkInfo(original);
|
||||
} else {
|
||||
// 情况二:原库存刚好用完(但目标多个) → 删除原库存
|
||||
rkInfoMapper.deleteRkInfoById(original.getId());
|
||||
}
|
||||
|
||||
// 新增多条目标库存
|
||||
for (MoveTargetItem target : dto.getTargets()) {
|
||||
RkInfo newInfo = new RkInfo();
|
||||
BeanUtils.copyProperties(original, newInfo, "id");
|
||||
|
||||
newInfo.setCangku(target.getToCangku());
|
||||
newInfo.setPcode(target.getToPcode());
|
||||
newInfo.setTrayCode(target.getToTrayCode());
|
||||
newInfo.setRealQty(target.getRealQty());
|
||||
newInfo.setHasMoved("1");
|
||||
|
||||
newInfo.setCreateBy(username);
|
||||
newInfo.setCreateTime(now);
|
||||
newInfo.setUpdateBy(username);
|
||||
newInfo.setUpdateTime(now);
|
||||
|
||||
insertList.add(newInfo);
|
||||
|
||||
// 移库记录
|
||||
moveRecordMapper.insertMoveRecord(createMoveRecord(original, target, dto));
|
||||
}
|
||||
|
||||
if (!insertList.isEmpty()) {
|
||||
rkInfoMapper.batchInsertRkInfo(insertList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建移库记录对象
|
||||
*
|
||||
* @param info 原库存记录
|
||||
* @param target 目标位置数据
|
||||
* @param dto 请求参数
|
||||
* @return 构建后的移库记录
|
||||
*/
|
||||
private MoveRecord createMoveRecord(RkInfo info, MoveTargetItem target, MoveRequestDTO dto) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
MoveRecord record = new MoveRecord();
|
||||
record.setRkId(info.getId());
|
||||
record.setEntityId(info.getEntityId());
|
||||
record.setFromCangku(info.getCangku());
|
||||
record.setFromPcode(info.getPcode());
|
||||
record.setFromTrayCode(info.getTrayCode());
|
||||
record.setToCangku(target.getToCangku());
|
||||
record.setToPcode(target.getToPcode());
|
||||
record.setToTrayCode(target.getToTrayCode());
|
||||
record.setMoveReason(dto.getMoveReason());
|
||||
record.setMovedBy(userId.toString());
|
||||
record.setMovedAt(DateUtils.getNowDate());
|
||||
|
||||
record.setIsDelete("0");
|
||||
record.setCreateBy(userId.toString());
|
||||
record.setUpdateBy(userId.toString());
|
||||
record.setCreateTime(DateUtils.getNowDate());
|
||||
record.setUpdateTime(DateUtils.getNowDate());
|
||||
|
||||
return record;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +1,32 @@
|
||||
package com.zg.project.wisdom.service.impl;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.zg.common.exception.ServiceException;
|
||||
import com.zg.common.utils.DateUtils;
|
||||
import com.zg.common.utils.PageUtils;
|
||||
import com.zg.common.utils.SecurityUtils;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
import com.zg.project.Inventory.AutoInventory.mapper.InventoryMatchScanMapper;
|
||||
import com.zg.project.Inventory.Task.mapper.InventoryTaskMapper;
|
||||
import com.zg.project.Inventory.domain.dto.QueryDTO;
|
||||
import com.zg.project.Inventory.domain.entity.InventoryMatchScan;
|
||||
import com.zg.project.Inventory.domain.vo.ChartDataVO;
|
||||
import com.zg.project.Inventory.domain.vo.PcdeCntVO;
|
||||
import com.zg.project.wisdom.domain.RkBill;
|
||||
import com.zg.project.wisdom.domain.dto.*;
|
||||
import com.zg.project.wisdom.mapper.GysJhMapper;
|
||||
import com.zg.project.wisdom.mapper.RkBillMapper;
|
||||
import com.zg.project.wisdom.utils.BillNoUtil;
|
||||
import com.zg.project.wisdom.utils.CodeConvertUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zg.project.wisdom.mapper.RkInfoMapper;
|
||||
@@ -29,7 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
* @date 2025-05-28
|
||||
*/
|
||||
@Service
|
||||
public class RkInfoServiceImpl implements IRkInfoService
|
||||
public class RkInfoServiceImpl implements IRkInfoService
|
||||
{
|
||||
|
||||
@Autowired
|
||||
@@ -41,9 +53,15 @@ public class RkInfoServiceImpl implements IRkInfoService
|
||||
@Autowired
|
||||
private RkBillMapper rkBillMapper;
|
||||
|
||||
@Autowired
|
||||
private InventoryMatchScanMapper matchScanMapper;
|
||||
|
||||
@Autowired
|
||||
private InventoryTaskMapper taskMapper;
|
||||
|
||||
/**
|
||||
* 查询库存单据主
|
||||
*
|
||||
*
|
||||
* @param id 库存单据主主键
|
||||
* @return 库存单据主
|
||||
*/
|
||||
@@ -55,7 +73,7 @@ public class RkInfoServiceImpl implements IRkInfoService
|
||||
|
||||
/**
|
||||
* 查询库存单据主列表
|
||||
*
|
||||
*
|
||||
* @param rkInfo 库存单据主
|
||||
* @return 库存单据主
|
||||
*/
|
||||
@@ -80,7 +98,7 @@ public class RkInfoServiceImpl implements IRkInfoService
|
||||
|
||||
/**
|
||||
* 修改库存单据主
|
||||
*
|
||||
*
|
||||
* @param rkInfo 库存单据主
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -93,7 +111,7 @@ public class RkInfoServiceImpl implements IRkInfoService
|
||||
|
||||
/**
|
||||
* 批量删除库存单据主
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的库存单据主主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -105,7 +123,7 @@ public class RkInfoServiceImpl implements IRkInfoService
|
||||
|
||||
/**
|
||||
* 删除库存单据主信息
|
||||
*
|
||||
*
|
||||
* @param id 库存单据主主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -183,6 +201,7 @@ public class RkInfoServiceImpl implements IRkInfoService
|
||||
|
||||
// 系统字段
|
||||
entity.setIsChuku("0");
|
||||
entity.setIsBorrowed("0");
|
||||
entity.setIsDelete("0");
|
||||
entity.setRkTime(now);
|
||||
entity.setCreateBy(username);
|
||||
@@ -360,40 +379,176 @@ public class RkInfoServiceImpl implements IRkInfoService
|
||||
// Step 1: 提前生成出库单据号(如 CK202406100001)
|
||||
String billNo = BillNoUtil.generateTodayBillNo("CK");
|
||||
|
||||
// Step 2: 构造出库主单 rk_bill
|
||||
// RkBill bill = new RkBill();
|
||||
// bill.setBillNo(billNo);
|
||||
// bill.setCkType(dto.getCkType());
|
||||
// bill.setCkTime(dto.getLyTime());
|
||||
// bill.setCkLihuoY(dto.getCkLihuoY());
|
||||
// bill.setTeamCode(dto.getTeamCode());
|
||||
// bill.setIsChuku("1");
|
||||
// bill.setIsDelete("0");
|
||||
// bill.setCreateBy(username);
|
||||
// bill.setCreateTime(now);
|
||||
// bill.setUpdateBy(username);
|
||||
// bill.setUpdateTime(now);
|
||||
//
|
||||
// rkBillMapper.insertRkBill(bill);
|
||||
|
||||
// Step 3: 批量更新 rk_info(出库状态 + 单号 + 单据ID)
|
||||
// Step 2: 批量更新 rk_info(出库状态 + 单号 + 单据ID)
|
||||
for (StockOutItemDTO item : dto.getCkList()) {
|
||||
RkInfo update = new RkInfo();
|
||||
update.setId(item.getId());
|
||||
update.setBillNoCk(billNo);
|
||||
update.setIsChuku("1");
|
||||
if ("JLCK".equals(dto.getCkType())) {
|
||||
update.setIsBorrowed("1");
|
||||
update.setBorrowTime(dto.getBorrowTime());
|
||||
update.setReturnTime(dto.getReturnTime());
|
||||
}
|
||||
update.setCkType(dto.getCkType());
|
||||
update.setLyTime(dto.getLyTime());
|
||||
update.setCkLihuoY(dto.getCkLihuoY());
|
||||
update.setTeamCode(dto.getTeamCode());
|
||||
update.setCkRemark(item.getCkRemark());
|
||||
update.setXmNoCk(dto.getXmNoCk());
|
||||
update.setXmMsCk(dto.getXmMsCk());
|
||||
update.setUpdateBy(username);
|
||||
update.setUpdateTime(now);
|
||||
|
||||
rkInfoMapper.updateById(update);
|
||||
}
|
||||
|
||||
return dto.getCkList().size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void matchWithStatus(QueryDTO dto) {
|
||||
List<String> pcdeIds = dto.getIds();
|
||||
if (pcdeIds == null || pcdeIds.isEmpty()) return;
|
||||
|
||||
// 一、三类匹配数据
|
||||
List<RkInfo> matchedAll = rkInfoMapper.getByPcodeIdList(pcdeIds);
|
||||
matchedAll.forEach(r -> r.setStatus("0"));
|
||||
|
||||
List<RkInfo> missedAll = rkInfoMapper.getMissedPcodeIds(pcdeIds);
|
||||
missedAll.forEach(r -> r.setStatus("1"));
|
||||
|
||||
List<String> errorIds = pcdeIds.stream()
|
||||
.filter(id -> rkInfoMapper.existsByPcodeId(id) == 0)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<RkInfo> errorAll = errorIds.stream()
|
||||
.map(id -> {
|
||||
RkInfo r = new RkInfo();
|
||||
r.setPcodeId(id);
|
||||
r.setStatus("2");
|
||||
return r;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 二、封装入库记录
|
||||
String tmeStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
||||
String deviceId = dto.getDeviceId();
|
||||
int scanType = dto.getScanType() != null ? dto.getScanType() : 0;
|
||||
String taskId = dto.getTaskId();
|
||||
|
||||
if (scanType == 1 && (deviceId == null || deviceId.trim().isEmpty())) {
|
||||
throw new ServiceException("自动盘点必须传递设备ID");
|
||||
}
|
||||
|
||||
List<InventoryMatchScan> toSave = new ArrayList<>();
|
||||
for (RkInfo r : matchedAll) {
|
||||
toSave.add(buildScanRecord(taskId, r.getPcodeId(), "0", deviceId, tmeStr, scanType));
|
||||
}
|
||||
for (RkInfo r : missedAll) {
|
||||
toSave.add(buildScanRecord(taskId, r.getPcodeId(), "1", deviceId, tmeStr, scanType));
|
||||
}
|
||||
for (RkInfo r : errorAll) {
|
||||
toSave.add(buildScanRecord(taskId, r.getPcodeId(), "2", deviceId, tmeStr, scanType));
|
||||
}
|
||||
|
||||
if (!toSave.isEmpty()) {
|
||||
matchScanMapper.insertBatch(toSave);
|
||||
}
|
||||
|
||||
taskMapper.updateStatus(taskId, "1");
|
||||
}
|
||||
|
||||
private InventoryMatchScan buildScanRecord(String taskId, String pcode, String status,
|
||||
String deviceId, String tme, int scanType) {
|
||||
InventoryMatchScan record = new InventoryMatchScan();
|
||||
record.setPcode(pcode);
|
||||
record.setTaskId(taskId);
|
||||
record.setStatus(status);
|
||||
|
||||
if (scanType == 1 && deviceId != null) {
|
||||
record.setDeviceId(deviceId);
|
||||
}
|
||||
|
||||
record.setTme(tme);
|
||||
record.setScanType(scanType);
|
||||
return record;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int countGetByWh(String warehouse) {
|
||||
return rkInfoMapper.countGetByWh(warehouse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 图表统计:每个库位有多少个货物
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ChartDataVO matchWithAll(QueryDTO dto) {
|
||||
List<String> ids = dto.getIds();
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return new ChartDataVO(Collections.emptyList(),
|
||||
Collections.emptyList(),
|
||||
0L);
|
||||
}
|
||||
|
||||
List<PcdeCntVO> rows = rkInfoMapper.selectPcdeCntFromRkInfo(ids);
|
||||
|
||||
List<String> pcdeList = new ArrayList<>(rows.size());
|
||||
List<Long> fycdeCntList = new ArrayList<>(rows.size());
|
||||
|
||||
for (PcdeCntVO r : rows) {
|
||||
pcdeList.add(r.getPcde());
|
||||
fycdeCntList.add(r.getCnt());
|
||||
}
|
||||
|
||||
return new ChartDataVO(pcdeList, fycdeCntList, (long) rows.size());
|
||||
}
|
||||
|
||||
/**
|
||||
* 还料入库
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int refundMaterial(RefundRequestDTO dto) {
|
||||
Long originalId = dto.getOriginalId();
|
||||
String newPcode = dto.getPcode();
|
||||
|
||||
// 1. 查原出库记录
|
||||
RkInfo original = rkInfoMapper.selectRkInfoById(originalId);
|
||||
if (original == null || "1".equals(original.getIsDelete())) {
|
||||
throw new ServiceException("原出库记录不存在或已删除");
|
||||
}
|
||||
|
||||
// 2. 构造新的入库记录
|
||||
RkInfo newEntry = new RkInfo();
|
||||
BeanUtils.copyProperties(original, newEntry);
|
||||
newEntry.setId(null);
|
||||
newEntry.setIsChuku("0");
|
||||
newEntry.setPcode(newPcode);
|
||||
newEntry.setRkType(dto.getRkType());
|
||||
newEntry.setReturnTime(DateUtils.getNowDate());
|
||||
newEntry.setBillNo(BillNoUtil.generateTodayBillNo("RK"));
|
||||
newEntry.setCreateBy(SecurityUtils.getUserId().toString());
|
||||
newEntry.setCreateTime(DateUtils.getNowDate());
|
||||
newEntry.setUpdateBy(null);
|
||||
newEntry.setUpdateTime(null);
|
||||
newEntry.setIsBorrowed("0");
|
||||
|
||||
// 3. 插入新入库记录
|
||||
int rows = rkInfoMapper.insertRkInfo(newEntry);
|
||||
|
||||
// ✅ 4. 更新原记录的 is_borrowed = '0'
|
||||
RkInfo update = new RkInfo();
|
||||
update.setId(originalId);
|
||||
update.setIsBorrowed("0");
|
||||
update.setUpdateBy(SecurityUtils.getUsername());
|
||||
update.setUpdateTime(DateUtils.getNowDate());
|
||||
rkInfoMapper.updateById(update);
|
||||
|
||||
return rows;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,6 +142,16 @@ gen:
|
||||
# 是否允许生成文件覆盖到本地(自定义路径),默认不允许
|
||||
allowOverwrite: false
|
||||
|
||||
agv:
|
||||
job:
|
||||
create-url: http://192.168.1.155:1880/api/job/create
|
||||
|
||||
#rfid:
|
||||
# device:
|
||||
# conn-id: 192.168.1.88:9090
|
||||
|
||||
minio:
|
||||
endpoint: http://192.168.1.20:9000
|
||||
accessKey: admin
|
||||
secretKey: admin123
|
||||
bucketName: jaz
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
<mapper namespace="com.zg.project.Inventory.AutoInventory.mapper.InventoryMatchScanMapper">
|
||||
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO inventory_match_scan (task_name,device_id, pcde, tme, scan_type, status, created_at)
|
||||
INSERT INTO inventory_match_scan (task_id, device_id, pcode, tme, scan_type, status)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.taskName},#{item.deviceId}, #{item.pcde}, #{item.tme}, #{item.scanType}, #{item.status}, NOW())
|
||||
(#{item.taskId}, #{item.deviceId}, #{item.pcode}, #{item.tme}, #{item.scanType}, #{item.status})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
|
||||
<select id="getAllSod" resultType="com.zg.project.Inventory.domain.entity.Sod">
|
||||
SELECT * FROM inventory_match_scan i
|
||||
|
||||
LEFT JOIN sod s ON i.pcde = s.fycde_1
|
||||
|
||||
LEFT JOIN sod s ON i.pcde = s.fycde_1
|
||||
WHERE s.rmn > 0
|
||||
</select>
|
||||
|
||||
@@ -45,61 +43,10 @@
|
||||
GROUP BY s.pcde
|
||||
</select>
|
||||
|
||||
<!-- <select id="getByTaskName" resultType="com.zg.project.Inventory.domain.vo.InventoryMatchScanVO">-->
|
||||
<!-- SELECT-->
|
||||
<!-- i.id,-->
|
||||
<!-- i.device_id AS deviceId,-->
|
||||
<!-- i.task_name AS taskName,-->
|
||||
<!-- s.pcde,-->
|
||||
<!-- i.tme,-->
|
||||
<!-- i.scan_type AS scanType,-->
|
||||
<!-- i.status,-->
|
||||
<!-- i.created_at AS createdAt,-->
|
||||
<!-- s.mid,-->
|
||||
<!-- s.des_mat AS desMat,-->
|
||||
<!-- s.rmn,-->
|
||||
<!-- s.unt,-->
|
||||
<!-- s.des_pro AS desPro,-->
|
||||
<!-- s.bnum,-->
|
||||
<!-- s.tcde-->
|
||||
<!-- FROM-->
|
||||
<!-- inventory_match_scan i-->
|
||||
<!-- JOIN-->
|
||||
<!-- sod s ON i.pcde = s.fycde_1-->
|
||||
<!-- WHERE-->
|
||||
<!-- i.pcde IS NOT NULL-->
|
||||
<!-- AND s.rmn > 0-->
|
||||
<!-- <if test="taskName != null and taskName != ''">-->
|
||||
<!-- AND i.task_name LIKE CONCAT('%', #{taskName}, '%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="status != null and status != ''">-->
|
||||
<!-- AND i.status = #{status}-->
|
||||
<!-- </if>-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <select id="getByTaskName" resultType="com.zg.project.Inventory.domain.vo.InventoryMatchScanVO">-->
|
||||
<!-- SELECT-->
|
||||
<!-- id,-->
|
||||
<!-- device_id AS deviceId,-->
|
||||
<!-- task_name AS taskName,-->
|
||||
<!-- pcde,-->
|
||||
<!-- tme,-->
|
||||
<!-- scan_type AS scanType,-->
|
||||
<!-- status,-->
|
||||
<!-- created_at AS createdAt-->
|
||||
<!-- FROM-->
|
||||
<!-- inventory_match_scan-->
|
||||
<!-- WHERE-->
|
||||
<!-- task_name LIKE CONCAT('%', #{taskName}, '%')-->
|
||||
<!-- AND pcde IS NOT NULL-->
|
||||
<!-- <if test="status != null">-->
|
||||
<!-- AND status = #{status}-->
|
||||
<!-- </if>-->
|
||||
<!-- </select>-->
|
||||
<select id="getGroupedHistoryList" resultType="com.zg.project.Inventory.domain.vo.InventoryMatchScanSimpleVO">
|
||||
SELECT
|
||||
task_name AS taskName,
|
||||
MAX(created_at) AS createdAt,
|
||||
MAX(tme) AS tme,
|
||||
MAX(scan_type) AS scanType
|
||||
FROM inventory_match_scan
|
||||
<where>
|
||||
@@ -113,21 +60,18 @@
|
||||
AND pcde = #{dto.pcde}
|
||||
</if>
|
||||
<if test="dto.tme != null and dto.tme.size() == 2">
|
||||
AND DATE(created_at) <![CDATA[ >= ]]> #{dto.tme[0]}
|
||||
AND DATE(created_at) <![CDATA[ <= ]]> #{dto.tme[1]}
|
||||
AND DATE(tme) <![CDATA[ >= ]]> #{dto.tme[0]}
|
||||
AND DATE(tme) <![CDATA[ <= ]]> #{dto.tme[1]}
|
||||
</if>
|
||||
<if test="dto.scanType != null">
|
||||
AND scan_type = #{dto.scanType}
|
||||
</if>
|
||||
<if test="dto.createdAt != null and dto.createdAt != ''">
|
||||
AND created_at = #{dto.createdAt}
|
||||
</if>
|
||||
<if test="dto.status != null">
|
||||
AND status = #{dto.status}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY task_name
|
||||
ORDER BY MAX(created_at) DESC
|
||||
ORDER BY MAX(tme) DESC
|
||||
LIMIT #{limit} OFFSET #{offset}
|
||||
</select>
|
||||
|
||||
@@ -145,15 +89,12 @@
|
||||
AND pcde = #{dto.pcde}
|
||||
</if>
|
||||
<if test="dto.tme != null and dto.tme.size() == 2">
|
||||
AND DATE(created_at) <![CDATA[ >= ]]> #{dto.tme[0]}
|
||||
AND DATE(created_at) <![CDATA[ <= ]]> #{dto.tme[1]}
|
||||
AND DATE(tme) <![CDATA[ >= ]]> #{dto.tme[0]}
|
||||
AND DATE(tme) <![CDATA[ <= ]]> #{dto.tme[1]}
|
||||
</if>
|
||||
<if test="dto.scanType != null">
|
||||
AND scan_type = #{dto.scanType}
|
||||
</if>
|
||||
<if test="dto.createdAt != null and dto.createdAt != ''">
|
||||
AND created_at = #{dto.createdAt}
|
||||
</if>
|
||||
<if test="dto.status != null">
|
||||
AND status = #{dto.status}
|
||||
</if>
|
||||
@@ -170,7 +111,6 @@
|
||||
i.tme,
|
||||
i.scan_type AS scanType,
|
||||
i.status,
|
||||
i.created_at AS createdAt,
|
||||
s.mid,
|
||||
s.des_mat AS desMat,
|
||||
s.rmn,
|
||||
@@ -178,12 +118,9 @@
|
||||
s.des_pro AS desPro,
|
||||
s.bnum,
|
||||
s.tcde
|
||||
FROM
|
||||
inventory_match_scan i
|
||||
LEFT JOIN
|
||||
sod s ON i.pcde = s.fycde_1
|
||||
WHERE
|
||||
i.pcde IS NOT NULL
|
||||
FROM inventory_match_scan i
|
||||
LEFT JOIN sod s ON i.pcde = s.fycde_1
|
||||
WHERE i.pcde IS NOT NULL
|
||||
<if test="taskName != null and taskName != ''">
|
||||
AND i.task_name LIKE CONCAT('%', #{taskName}, '%')
|
||||
</if>
|
||||
@@ -195,4 +132,86 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectInventoryMatchScanList"
|
||||
resultType="com.zg.project.Inventory.domain.entity.InventoryMatchScan"
|
||||
parameterType="com.zg.project.Inventory.domain.entity.InventoryMatchScan">
|
||||
SELECT
|
||||
i.id AS id,
|
||||
i.task_id AS taskId,
|
||||
i.device_id AS deviceId,
|
||||
i.pcode AS pcode,
|
||||
i.tme AS tme,
|
||||
i.scan_type AS scanType,
|
||||
i.status AS status,
|
||||
r.pcode AS rkPcode,
|
||||
t.task_name AS taskName
|
||||
FROM inventory_match_scan i
|
||||
LEFT JOIN rk_info r ON i.pcode = r.pcode_id
|
||||
LEFT JOIN inventory_task t ON i.task_id = t.id
|
||||
<where>
|
||||
<if test="taskId != null and taskId != ''">
|
||||
AND i.task_id = #{taskId}
|
||||
</if>
|
||||
<if test="deviceId != null and deviceId != ''">
|
||||
AND i.device_id = #{deviceId}
|
||||
</if>
|
||||
<if test="pcode != null and pcode != ''">
|
||||
AND i.pcode LIKE CONCAT('%', #{pcode}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND i.status = #{status}
|
||||
</if>
|
||||
<if test="scanType != null">
|
||||
AND i.scan_type = #{scanType}
|
||||
</if>
|
||||
<if test="tme != null">
|
||||
AND i.tme >= #{tme}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY i.tme DESC
|
||||
</select>
|
||||
|
||||
<select id="selectOnlyFromMatchScan"
|
||||
parameterType="InventoryMatchScan"
|
||||
resultType="com.zg.project.Inventory.domain.vo.RkInfoMatchVO">
|
||||
SELECT
|
||||
i.pcode AS rkPcode,
|
||||
NULL AS realQty
|
||||
FROM inventory_match_scan i
|
||||
<where>
|
||||
<if test="taskId != null and taskId != ''">
|
||||
AND i.task_id = #{taskId}
|
||||
</if>
|
||||
<if test="deviceId != null and deviceId != ''">
|
||||
AND i.device_id = #{deviceId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND i.status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY i.tme DESC
|
||||
</select>
|
||||
|
||||
<select id="selectJoinRkInfo"
|
||||
parameterType="InventoryMatchScan"
|
||||
resultType="com.zg.project.Inventory.domain.vo.RkInfoMatchVO">
|
||||
SELECT
|
||||
r.pcode AS rkPcode,
|
||||
r.real_qty AS realQty
|
||||
FROM inventory_match_scan i
|
||||
LEFT JOIN rk_info r ON i.pcode = r.pcode_id
|
||||
<where>
|
||||
<if test="taskId != null and taskId != ''">
|
||||
AND i.task_id = #{taskId}
|
||||
</if>
|
||||
<if test="deviceId != null and deviceId != ''">
|
||||
AND i.device_id = #{deviceId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND i.status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY i.tme DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -88,16 +88,5 @@
|
||||
AND rmn != 0
|
||||
</select>
|
||||
|
||||
<select id="selectPcdeCntByFycde1" resultType="com.zg.project.Inventory.domain.vo.PcdeCntVO">
|
||||
SELECT pcde,
|
||||
COUNT(*) AS cnt
|
||||
FROM sod
|
||||
WHERE fycde_1 IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
GROUP BY pcde
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,51 +1,88 @@
|
||||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zg.project.Inventory.Task.mapper.InventoryTaskMapper">
|
||||
|
||||
|
||||
<resultMap type="InventoryTask" id="InventoryTaskResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="taskName" column="task_name" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="sceneId" column="scene_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="requireTime" column="require_time" />
|
||||
<result property="status" column="status" />
|
||||
<result property="taskType" column="task_type" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createdBy" column="created_by" />
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="updatedBy" column="updated_by" />
|
||||
<result property="updatedAt" column="updated_at" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="id" column="id"/>
|
||||
<result property="taskName" column="task_name"/>
|
||||
<result property="warehouseId" column="warehouse_id"/>
|
||||
<result property="warehouseName" column="warehouse_name"/>
|
||||
<result property="sceneId" column="scene_id"/>
|
||||
<result property="sceneName" column="scene_name"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="userName" column="user_name"/>
|
||||
<result property="requireTime" column="require_time"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="taskType" column="task_type"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createdBy" column="created_by"/>
|
||||
<result property="createdAt" column="created_at"/>
|
||||
<result property="updatedBy" column="updated_by"/>
|
||||
<result property="updatedAt" column="updated_at"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectInventoryTaskVo">
|
||||
select id, task_name, warehouse_id, scene_id, user_id, require_time, status, task_type, remark, created_by, created_at, updated_by, updated_at, is_delete from inventory_task
|
||||
SELECT
|
||||
t.id,
|
||||
t.task_name,
|
||||
t.warehouse_id,
|
||||
w.warehouse_name AS warehouse_name,
|
||||
t.scene_id,
|
||||
s.scene_name AS scene_name,
|
||||
t.user_id,
|
||||
u.nick_name AS user_name,
|
||||
t.require_time,
|
||||
t.status,
|
||||
t.task_type,
|
||||
t.remark,
|
||||
t.created_by,
|
||||
t.created_at,
|
||||
t.updated_by,
|
||||
t.updated_at,
|
||||
t.is_delete
|
||||
FROM inventory_task t
|
||||
LEFT JOIN warehouse_info w ON t.warehouse_id = w.warehouse_code
|
||||
LEFT JOIN scene_mapping s ON t.scene_id = s.scene_code
|
||||
LEFT JOIN sys_user u ON t.user_id = u.user_id
|
||||
</sql>
|
||||
|
||||
<select id="selectInventoryTaskList" parameterType="InventoryTask" resultMap="InventoryTaskResult">
|
||||
<include refid="selectInventoryTaskVo"/>
|
||||
<where>
|
||||
<if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
|
||||
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="sceneId != null "> and scene_id = #{sceneId}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="requireTime != null and requireTime != ''"> and require_time = #{requireTime}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="taskType != null and taskType != ''"> and task_type = #{taskType}</if>
|
||||
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
|
||||
<if test="createdAt != null and createdAt != ''"> and created_at = #{createdAt}</if>
|
||||
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
|
||||
<if test="updatedAt != null and updatedAt != ''"> and updated_at = #{updatedAt}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
<where>
|
||||
<if test="taskName != null and taskName != ''"> AND t.task_name LIKE concat('%', #{taskName}, '%')</if>
|
||||
<if test="warehouseId != null"> AND t.warehouse_id = #{warehouseId}</if>
|
||||
<if test="sceneId != null"> AND t.scene_id = #{sceneId}</if>
|
||||
<if test="userId != null"> AND t.user_id = #{userId}</if>
|
||||
<if test="requireTime != null and requireTime != ''"> AND t.require_time = #{requireTime}</if>
|
||||
<if test="status != null and status != ''"> AND t.status = #{status}</if>
|
||||
<if test="taskType != null and taskType != ''"> AND t.task_type = #{taskType}</if>
|
||||
<if test="createdBy != null and createdBy != ''"> AND t.created_by = #{createdBy}</if>
|
||||
<if test="createdAt != null and createdAt != ''"> AND t.created_at = #{createdAt}</if>
|
||||
<if test="updatedBy != null and updatedBy != ''"> AND t.updated_by = #{updatedBy}</if>
|
||||
<if test="updatedAt != null and updatedAt != ''"> AND t.updated_at = #{updatedAt}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> AND t.is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
order by t.created_at desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectInventoryTaskById" parameterType="Long" resultMap="InventoryTaskResult">
|
||||
<include refid="selectInventoryTaskVo"/>
|
||||
where id = #{id}
|
||||
WHERE t.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="countPendingTaskByUserId" resultType="java.lang.Integer" parameterType="java.lang.Long">
|
||||
select count(*) from inventory_task
|
||||
where user_id = #{userId}
|
||||
and status = '0'
|
||||
and is_delete = '0'
|
||||
</select>
|
||||
|
||||
<select id="getWhByTaskId" resultType="java.lang.String" parameterType="java.lang.String">
|
||||
select warehouse_id from inventory_task
|
||||
where id = #{taskId}
|
||||
</select>
|
||||
|
||||
<insert id="insertInventoryTask" parameterType="InventoryTask" useGeneratedKeys="true" keyProperty="id">
|
||||
@@ -64,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updatedBy != null">updated_by,</if>
|
||||
<if test="updatedAt != null">updated_at,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskName != null and taskName != ''">#{taskName},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
@@ -79,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="updatedBy != null">#{updatedBy},</if>
|
||||
<if test="updatedAt != null">#{updatedAt},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateInventoryTask" parameterType="InventoryTask">
|
||||
@@ -102,12 +139,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateStatus" parameterType="map">
|
||||
UPDATE inventory_task
|
||||
SET status = #{status},
|
||||
updated_at = NOW()
|
||||
WHERE id = #{taskId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteInventoryTaskById" parameterType="Long">
|
||||
delete from inventory_task where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteInventoryTaskByIds" parameterType="String">
|
||||
delete from inventory_task where id in
|
||||
delete from inventory_task where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
@@ -1,38 +1,57 @@
|
||||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zg.project.information.mapper.DeviceInfoMapper">
|
||||
|
||||
|
||||
<resultMap type="DeviceInfo" id="DeviceInfoResult">
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="ipAddress" column="ip_address" />
|
||||
<result property="port" column="port" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="ipAddress" column="ip_address" />
|
||||
<result property="port" column="port" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="sceneId" column="scene_id" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
<result property="sceneName" column="scene_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeviceInfoVo">
|
||||
select device_id, ip_address, port, warehouse_id, create_by, create_time, update_by, update_time, is_delete from device_info
|
||||
SELECT
|
||||
d.device_id,
|
||||
d.ip_address,
|
||||
d.port,
|
||||
d.warehouse_id,
|
||||
d.scene_id,
|
||||
w.warehouse_name AS warehouse_name,
|
||||
s.scene_name AS scene_name,
|
||||
d.create_by,
|
||||
d.create_time,
|
||||
d.update_by,
|
||||
d.update_time,
|
||||
d.is_delete
|
||||
FROM device_info d
|
||||
LEFT JOIN warehouse_info w ON d.warehouse_id = w.warehouse_code
|
||||
LEFT JOIN scene_mapping s ON d.scene_id = s.scene_code
|
||||
</sql>
|
||||
|
||||
<select id="selectDeviceInfoList" parameterType="DeviceInfo" resultMap="DeviceInfoResult">
|
||||
<include refid="selectDeviceInfoVo"/>
|
||||
<where>
|
||||
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
|
||||
<if test="port != null "> and port = #{port}</if>
|
||||
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
<where>
|
||||
<if test="ipAddress != null and ipAddress != ''"> and d.ip_address = #{ipAddress}</if>
|
||||
<if test="port != null "> and d.port = #{port}</if>
|
||||
<if test="warehouseId != null "> and d.warehouse_id = #{warehouseId}</if>
|
||||
<if test="sceneId != null "> and d.scene_id = #{sceneId}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and d.is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDeviceInfoByDeviceId" parameterType="Long" resultMap="DeviceInfoResult">
|
||||
<include refid="selectDeviceInfoVo"/>
|
||||
where device_id = #{deviceId}
|
||||
WHERE d.device_id = #{deviceId}
|
||||
</select>
|
||||
|
||||
<insert id="insertDeviceInfo" parameterType="DeviceInfo">
|
||||
@@ -42,23 +61,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="ipAddress != null">ip_address,</if>
|
||||
<if test="port != null">port,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="sceneId != null">scene_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="isDelete != null">is_delete,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="ipAddress != null">#{ipAddress},</if>
|
||||
<if test="port != null">#{port},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="sceneId != null">#{sceneId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="isDelete != null">#{isDelete},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDeviceInfo" parameterType="DeviceInfo">
|
||||
@@ -67,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="ipAddress != null">ip_address = #{ipAddress},</if>
|
||||
<if test="port != null">port = #{port},</if>
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="sceneId != null">scene_id = #{sceneId},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
@@ -81,9 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDeviceInfoByDeviceIds" parameterType="String">
|
||||
delete from device_info where device_id in
|
||||
delete from device_info where device_id in
|
||||
<foreach item="deviceId" collection="array" open="(" separator="," close=")">
|
||||
#{deviceId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zg.project.information.mapper.PcdeDetailMapper">
|
||||
|
||||
|
||||
<resultMap type="PcdeDetail" id="PcdeDetailResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="locationCode" column="location_code" />
|
||||
<result property="scene" column="scene" />
|
||||
<result property="sceneName" column="scene_name" />
|
||||
<result property="warehouse" column="warehouse" />
|
||||
<result property="encodedId" column="encoded_id" />
|
||||
<result property="tag" column="tag" />
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="createdBy" column="created_by" />
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="updatedBy" column="updated_by" />
|
||||
<result property="updatedAt" column="updated_at" />
|
||||
<result property="id" column="id"/>
|
||||
<result property="pcode" column="pcode"/>
|
||||
<result property="scene" column="scene"/>
|
||||
<result property="sceneName" column="scene_name"/>
|
||||
<result property="warehouse" column="warehouse"/>
|
||||
<result property="encodedId" column="encoded_id"/>
|
||||
<result property="tag" column="tag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
<result property="createdBy" column="created_by"/>
|
||||
<result property="createdAt" column="created_at"/>
|
||||
<result property="updatedBy" column="updated_by"/>
|
||||
<result property="updatedAt" column="updated_at"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPcdeDetailVo">
|
||||
select d.id, d.location_code, d.scene, m.scene_name, d.warehouse,
|
||||
select d.id, d.pcode, d.scene, m.scene_name, d.warehouse,
|
||||
d.encoded_id, d.tag, d.remark, d.is_delete,
|
||||
d.created_by, d.created_at, d.updated_by, d.updated_at
|
||||
from pcde_detail d
|
||||
@@ -31,16 +31,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectPcdeDetailList" parameterType="PcdeDetail" resultMap="PcdeDetailResult">
|
||||
<include refid="selectPcdeDetailVo"/>
|
||||
<where>
|
||||
<if test="locationCode != null and locationCode != ''"> and d.location_code = #{locationCode}</if>
|
||||
<if test="scene != null and scene != ''"> and d.scene = #{scene}</if>
|
||||
<if test="warehouse != null and warehouse != ''"> and d.warehouse = #{warehouse}</if>
|
||||
<if test="encodedId != null and encodedId != ''"> and d.encoded_id = #{encodedId}</if>
|
||||
<if test="tag != null and tag != ''"> and d.tag = #{tag}</if>
|
||||
<if test="isDelete != null "> and d.is_delete = #{isDelete}</if>
|
||||
<if test="createdBy != null and createdBy != ''"> and d.created_by = #{createdBy}</if>
|
||||
<if test="createdAt != null "> and d.created_at = #{createdAt}</if>
|
||||
<if test="updatedBy != null and updatedBy != ''"> and d.updated_by = #{updatedBy}</if>
|
||||
<if test="updatedAt != null "> and d.updated_at = #{updatedAt}</if>
|
||||
<if test="pcode != null and pcode != ''">and d.pcode = #{pcode}</if>
|
||||
<if test="scene != null and scene != ''">and d.scene = #{scene}</if>
|
||||
<if test="warehouse != null and warehouse != ''">and d.warehouse = #{warehouse}</if>
|
||||
<if test="encodedId != null and encodedId != ''">and d.encoded_id = #{encodedId}</if>
|
||||
<if test="tag != null and tag != ''">and d.tag = #{tag}</if>
|
||||
<if test="isDelete != null">and d.is_delete = #{isDelete}</if>
|
||||
<if test="createdBy != null and createdBy != ''">and d.created_by = #{createdBy}</if>
|
||||
<if test="createdAt != null">and d.created_at = #{createdAt}</if>
|
||||
<if test="updatedBy != null and updatedBy != ''">and d.updated_by = #{updatedBy}</if>
|
||||
<if test="updatedAt != null">and d.updated_at = #{updatedAt}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -49,18 +49,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where d.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectByLocationCode" resultType="com.zg.project.information.domain.PcdeDetail"
|
||||
<select id="selectByPcode" resultType="com.zg.project.information.domain.PcdeDetail"
|
||||
parameterType="java.lang.String">
|
||||
select id, location_code, scene, warehouse, encoded_id, tag, is_delete,
|
||||
select id, pcode, scene, warehouse, encoded_id, tag, is_delete,
|
||||
created_by, created_at, updated_by, updated_at, remark
|
||||
from pcde_detail
|
||||
where location_code = #{locationCode}
|
||||
where pcode = #{pcode}
|
||||
</select>
|
||||
|
||||
<insert id="insertPcdeDetail" parameterType="PcdeDetail" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into pcde_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="locationCode != null and locationCode != ''">location_code,</if>
|
||||
<if test="pcode != null and pcode != ''">pcode,</if>
|
||||
<if test="scene != null and scene != ''">scene,</if>
|
||||
<if test="warehouse != null and warehouse != ''">warehouse,</if>
|
||||
<if test="encodedId != null">encoded_id,</if>
|
||||
@@ -71,9 +71,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createdAt != null">created_at,</if>
|
||||
<if test="updatedBy != null">updated_by,</if>
|
||||
<if test="updatedAt != null">updated_at,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="locationCode != null and locationCode != ''">#{locationCode},</if>
|
||||
<if test="pcode != null and pcode != ''">#{pcode},</if>
|
||||
<if test="scene != null and scene != ''">#{scene},</if>
|
||||
<if test="warehouse != null and warehouse != ''">#{warehouse},</if>
|
||||
<if test="encodedId != null">#{encodedId},</if>
|
||||
@@ -84,13 +84,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createdAt != null">#{createdAt},</if>
|
||||
<if test="updatedBy != null">#{updatedBy},</if>
|
||||
<if test="updatedAt != null">#{updatedAt},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePcdeDetail" parameterType="PcdeDetail">
|
||||
update pcde_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
|
||||
<if test="pcode != null and pcode != ''">pcode = #{pcode},</if>
|
||||
<if test="scene != null and scene != ''">scene = #{scene},</if>
|
||||
<if test="warehouse != null and warehouse != ''">warehouse = #{warehouse},</if>
|
||||
<if test="encodedId != null">encoded_id = #{encodedId},</if>
|
||||
@@ -110,9 +110,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deletePcdeDetailByIds" parameterType="String">
|
||||
delete from pcde_detail where id in
|
||||
delete from pcde_detail where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
91
src/main/resources/mybatis/wisdom/AgvTaskResultMapper.xml
Normal file
91
src/main/resources/mybatis/wisdom/AgvTaskResultMapper.xml
Normal file
@@ -0,0 +1,91 @@
|
||||
<?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="com.zg.project.wisdom.mapper.AgvTaskResultMapper">
|
||||
|
||||
<resultMap id="AgvTaskResultResultMap" type="AgvTaskResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="requestId" column="request_id"/>
|
||||
<result property="taskNo" column="task_no"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="msg" column="msg"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAgvTaskResultVo">
|
||||
id, request_id, task_no, status, msg, create_by, create_time, update_by, update_time, is_delete
|
||||
</sql>
|
||||
|
||||
<select id="selectAgvTaskResultById" resultMap="AgvTaskResultResultMap">
|
||||
SELECT <include refid="selectAgvTaskResultVo"/> FROM agv_task_result WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectAgvTaskResultList" resultMap="AgvTaskResultResultMap">
|
||||
SELECT <include refid="selectAgvTaskResultVo"/> FROM agv_task_result
|
||||
<where>
|
||||
<if test="taskNo != null and taskNo != ''">AND task_no = #{taskNo}</if>
|
||||
<if test="status != null">AND status = #{status}</if>
|
||||
AND is_delete = '0'
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCountByRequestIdAndStatus" resultType="int">
|
||||
SELECT COUNT(1)
|
||||
FROM agv_task_result
|
||||
WHERE request_id = #{requestId}
|
||||
AND status = #{status}
|
||||
AND is_delete = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertAgvTaskResult" parameterType="AgvTaskResult" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO agv_task_result
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="requestId != null">request_id,</if>
|
||||
<if test="taskNo != null">task_no,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="msg != null">msg,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
create_time,
|
||||
is_delete
|
||||
</trim>
|
||||
VALUES
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="requestId != null">#{requestId},</if>
|
||||
<if test="taskNo != null">#{taskNo},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="msg != null">#{msg},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
NOW(),
|
||||
'0'
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAgvTaskResult" parameterType="AgvTaskResult">
|
||||
UPDATE agv_task_result SET
|
||||
request_id = #{requestId},
|
||||
task_no = #{taskNo},
|
||||
status = #{status},
|
||||
msg = #{msg},
|
||||
update_by = #{updateBy},
|
||||
update_time = NOW()
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAgvTaskResultById">
|
||||
DELETE FROM agv_task_result WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAgvTaskResultByIds">
|
||||
DELETE FROM agv_task_result WHERE id IN
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
100
src/main/resources/mybatis/wisdom/DdTaskMapper.xml
Normal file
100
src/main/resources/mybatis/wisdom/DdTaskMapper.xml
Normal file
@@ -0,0 +1,100 @@
|
||||
<?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="com.zg.project.wisdom.mapper.DdTaskMapper">
|
||||
|
||||
<resultMap id="DdTaskResult" type="com.zg.project.wisdom.domain.DdTask">
|
||||
<result property="id" column="id" />
|
||||
<result property="taskNo" column="task_no" />
|
||||
<result property="taskDtl" column="task_dtl" />
|
||||
<result property="taskType" column="task_type" />
|
||||
<result property="taskStatus" column="task_status" />
|
||||
<result property="midStatus" column="mid_status" />
|
||||
<result property="mid" column="mid" />
|
||||
<result property="num" column="num" />
|
||||
<result property="midType" column="mid_type" />
|
||||
<result property="sourceName" column="source_name" />
|
||||
<result property="targetName" column="target_name" />
|
||||
<result property="operator" column="operator" />
|
||||
<result property="approver" column="approver" />
|
||||
<result property="rcptim" column="rcptim" />
|
||||
<result property="rid" column="rid" />
|
||||
<result property="doCount" column="do_count" />
|
||||
<result property="prf" column="prf" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectDdTaskList" resultMap="DdTaskResult">
|
||||
SELECT * FROM dd_task
|
||||
<where>
|
||||
<if test="taskNo != null and taskNo != ''">
|
||||
AND task_no = #{taskNo}
|
||||
</if>
|
||||
<if test="taskType != null and taskType != ''">
|
||||
AND task_type = #{taskType}
|
||||
</if>
|
||||
<if test="taskStatus != null">
|
||||
AND task_status = #{taskStatus}
|
||||
</if>
|
||||
<if test="isDelete != null">
|
||||
AND is_delete = #{isDelete}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
<select id="selectDdTaskById" resultMap="DdTaskResult">
|
||||
SELECT * FROM dd_task WHERE id = #{id} AND is_delete = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertDdTask" parameterType="DdTask">
|
||||
INSERT INTO dd_task (
|
||||
task_no, task_dtl, task_type, task_status, mid_status, mid, num, mid_type, source_name,
|
||||
target_name, operator, approver, rcptim, rid, do_count, prf,
|
||||
create_by, create_time, update_by, update_time, is_delete
|
||||
) VALUES (
|
||||
#{taskNo}, #{taskDtl}, #{taskType}, #{taskStatus}, #{midStatus}, #{mid}, #{num}, #{midType}, #{sourceName},
|
||||
#{targetName}, #{operator}, #{approver}, #{rcptim}, #{rid}, #{doCount}, #{prf},
|
||||
#{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{isDelete}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDdTask" parameterType="DdTask">
|
||||
UPDATE dd_task
|
||||
SET task_no = #{taskNo},
|
||||
task_dtl = #{taskDtl},
|
||||
task_type = #{taskType},
|
||||
task_status = #{taskStatus},
|
||||
mid_status = #{midStatus},
|
||||
mid = #{mid},
|
||||
num = #{num},
|
||||
mid_type = #{midType},
|
||||
source_name = #{sourceName},
|
||||
target_name = #{targetName},
|
||||
operator = #{operator},
|
||||
approver = #{approver},
|
||||
rcptim = #{rcptim},
|
||||
rid = #{rid},
|
||||
do_count = #{doCount},
|
||||
prf = #{prf},
|
||||
update_by = #{updateBy},
|
||||
update_time = #{updateTime},
|
||||
is_delete = #{isDelete}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDdTaskByIds">
|
||||
DELETE FROM dd_task WHERE id IN
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDdTaskById">
|
||||
DELETE FROM dd_task WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
151
src/main/resources/mybatis/wisdom/MoveRecordMapper.xml
Normal file
151
src/main/resources/mybatis/wisdom/MoveRecordMapper.xml
Normal file
@@ -0,0 +1,151 @@
|
||||
<?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="com.zg.project.wisdom.mapper.MoveRecordMapper">
|
||||
|
||||
<!-- 实体字段映射 -->
|
||||
<resultMap type="com.zg.project.wisdom.domain.MoveRecord" id="MoveRecordResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="rkId" column="rk_id"/>
|
||||
<result property="entityId" column="entity_id"/>
|
||||
<result property="fromCangku" column="from_cangku"/>
|
||||
<result property="fromPcode" column="from_pcode"/>
|
||||
<result property="fromTrayCode" column="from_tray_code"/>
|
||||
<result property="toCangku" column="to_cangku"/>
|
||||
<result property="toPcode" column="to_pcode"/>
|
||||
<result property="toTrayCode" column="to_tray_code"/>
|
||||
<result property="moveReason" column="move_reason"/>
|
||||
<result property="movedBy" column="moved_by"/>
|
||||
<result property="movedByName" column="moved_by_name"/>
|
||||
<result property="movedAt" column="moved_at"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
<result property="fromCangkuName" column="from_cangku_name"/>
|
||||
<result property="toCangkuName" column="to_cangku_name"/>
|
||||
<result property="xmNo" column="xm_no"/>
|
||||
<result property="xmMs" column="xm_ms"/>
|
||||
<result property="wlMs" column="wl_ms"/>
|
||||
<result property="gysMc" column="gys_mc"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMoveRecordVo">
|
||||
SELECT id, rk_id, entity_id, from_cangku, from_pcode, from_tray_code,
|
||||
to_cangku, to_pcode, to_tray_code, move_reason, moved_by, moved_at,
|
||||
create_by, create_time, update_by, update_time, is_delete
|
||||
FROM move_record
|
||||
</sql>
|
||||
|
||||
<insert id="insertMoveRecord" parameterType="com.zg.project.wisdom.domain.MoveRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO move_record (
|
||||
rk_id,
|
||||
entity_id,
|
||||
from_cangku,
|
||||
from_pcode,
|
||||
from_tray_code,
|
||||
to_cangku,
|
||||
to_pcode,
|
||||
to_tray_code,
|
||||
move_reason,
|
||||
moved_by,
|
||||
moved_at,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
is_delete
|
||||
) VALUES (
|
||||
#{rkId},
|
||||
#{entityId},
|
||||
#{fromCangku},
|
||||
#{fromPcode},
|
||||
#{fromTrayCode},
|
||||
#{toCangku},
|
||||
#{toPcode},
|
||||
#{toTrayCode},
|
||||
#{moveReason},
|
||||
#{movedBy},
|
||||
#{movedAt},
|
||||
#{createBy},
|
||||
#{createTime},
|
||||
#{updateBy},
|
||||
#{updateTime},
|
||||
#{isDelete}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 分页列表 -->
|
||||
<select id="selectMoveRecordList" resultMap="MoveRecordResult">
|
||||
SELECT
|
||||
mr.*,
|
||||
su.user_name AS moved_by_name,
|
||||
rk.xm_no,
|
||||
rk.xm_ms,
|
||||
rk.wl_ms,
|
||||
rk.gys_mc,
|
||||
wi1.warehouse_name AS from_cangku_name,
|
||||
wi2.warehouse_name AS to_cangku_name
|
||||
FROM move_record mr
|
||||
LEFT JOIN sys_user su ON mr.moved_by = su.user_id
|
||||
LEFT JOIN rk_info rk ON mr.rk_id = rk.id
|
||||
LEFT JOIN warehouse_info wi1 ON mr.from_cangku = wi1.warehouse_code
|
||||
LEFT JOIN warehouse_info wi2 ON mr.to_cangku = wi2.warehouse_code
|
||||
<where>
|
||||
<if test="entityId != null and entityId != ''">
|
||||
AND mr.entity_id = #{entityId}
|
||||
</if>
|
||||
<if test="moveReason != null and moveReason != ''">
|
||||
AND mr.move_reason LIKE concat('%', #{moveReason}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY mr.create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询详情 -->
|
||||
<select id="selectMoveRecordById" parameterType="Long" resultMap="MoveRecordResult">
|
||||
<include refid="selectMoveRecordVo"/>
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="updateMoveRecord" parameterType="MoveRecord">
|
||||
UPDATE move_record
|
||||
<set>
|
||||
<if test="rkId != null">rk_id = #{rkId},</if>
|
||||
<if test="entityId != null">entity_id = #{entityId},</if>
|
||||
<if test="fromCangku != null">from_cangku = #{fromCangku},</if>
|
||||
<if test="fromPcode != null">from_pcode = #{fromPcode},</if>
|
||||
<if test="fromTrayCode != null">from_tray_code = #{fromTrayCode},</if>
|
||||
<if test="toCangku != null">to_cangku = #{toCangku},</if>
|
||||
<if test="toPcode != null">to_pcode = #{toPcode},</if>
|
||||
<if test="toTrayCode != null">to_tray_code = #{toTrayCode},</if>
|
||||
<if test="moveReason != null">move_reason = #{moveReason},</if>
|
||||
<if test="movedBy != null">moved_by = #{movedBy},</if>
|
||||
<if test="movedAt != null">moved_at = #{movedAt},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete}</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 删除单个 -->
|
||||
<delete id="deleteMoveRecordById" parameterType="Long">
|
||||
DELETE FROM move_record WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<!-- 批量删除 -->
|
||||
<delete id="deleteMoveRecordByIds" parameterType="Long">
|
||||
DELETE FROM move_record
|
||||
WHERE id IN
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zg.project.wisdom.mapper.RkInfoMapper">
|
||||
|
||||
|
||||
<resultMap type="RkInfo" id="RkInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="rkType" column="rk_type" />
|
||||
@@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="rkTime" column="rk_time" />
|
||||
<result property="lihuoY" column="lihuo_y" />
|
||||
<result property="isChuku" column="is_chuku" />
|
||||
<result property="isBorrowed" column="is_borrowed"/>
|
||||
<result property="billNo" column="bill_no"/>
|
||||
<result property="billNoCk" column="bill_no_ck"/>
|
||||
<result property="rkTypeName" column="rk_type_name"/>
|
||||
@@ -21,6 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="xj" column="xj" />
|
||||
<result property="xmNo" column="xm_no" />
|
||||
<result property="xmMs" column="xm_ms" />
|
||||
<result property="xmNoCk" column="xm_no_ck"/>
|
||||
<result property="xmMsCk" column="xm_ms_ck"/>
|
||||
<result property="wlNo" column="wl_no" />
|
||||
<result property="wlMs" column="wl_ms" />
|
||||
<result property="gysNo" column="gys_no" />
|
||||
@@ -43,12 +46,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="teamCode" column="team_code"/>
|
||||
<result property="teamName" column="team_name"/>
|
||||
<result property="lyTime" column="ly_time"/>
|
||||
<result property="borrowTime" column="borrow_time"/>
|
||||
<result property="returnTime" column="return_time"/>
|
||||
<result property="ckRemark" column="ck_remark"/>
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="isDelete" column="is_delete" />
|
||||
<result property="hasMoved" column="has_moved"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRkInfoVo">
|
||||
@@ -59,12 +65,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
ri.rk_type, st.type_name AS rk_type_name,
|
||||
ri.wl_type, mt.type_name AS wl_type_name,
|
||||
ri.cangku, wh.warehouse_name AS cangku_name,
|
||||
ri.rk_time, ri.lihuo_y, ri.is_chuku, ri.remark,
|
||||
ri.rk_time, ri.lihuo_y, ri.is_chuku, ri.is_borrowed,ri.remark,
|
||||
ri.ck_lihuo_y, ri.ck_type, sot.type_name AS ck_type_name,
|
||||
ri.team_code, ct.team_name,
|
||||
ri.ck_remark,
|
||||
ri.ly_time,
|
||||
ri.xj, ri.xm_no, ri.xm_ms, ri.wl_no, ri.wl_ms,
|
||||
ri.borrow_time, ri.return_time,
|
||||
ri.xj, ri.xm_no, ri.xm_ms, ri.wl_no, ri.wl_ms,ri.xm_no_ck, ri.xm_ms_ck,
|
||||
ri.gys_no, ri.gys_mc, ri.jh_amt, ri.ht_dj, ri.sap_no, ri.xh,
|
||||
ri.jh_qty, ri.ht_qty, ri.dw, ri.real_qty,
|
||||
ri.pcode, ri.pcode_id, ri.tray_code, ri.entity_id,
|
||||
@@ -78,26 +85,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</sql>
|
||||
|
||||
<insert id="batchInsertRkInfo" parameterType="java.util.List">
|
||||
insert into rk_info (
|
||||
INSERT INTO rk_info (
|
||||
bill_no,
|
||||
rk_type, wl_type, cangku, lihuo_y, rk_time,
|
||||
wl_no, wl_ms, xm_no, xm_ms, xj, sap_no, gys_no, gys_mc,
|
||||
wl_no, wl_ms, xm_no, xm_ms,
|
||||
xm_no_ck, xm_ms_ck, xj, sap_no, gys_no, gys_mc,
|
||||
jh_qty, ht_qty, jh_amt, ht_dj, dw,
|
||||
borrow_time, return_time,
|
||||
pcode, pcode_id, tray_code, real_qty, entity_id,
|
||||
remark, is_chuku, is_delete, create_by, create_time
|
||||
remark, is_chuku,is_borrowed, is_delete, create_by, create_time
|
||||
)
|
||||
values
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.billNo},
|
||||
#{item.rkType}, #{item.wlType}, #{item.cangku}, #{item.lihuoY}, #{item.rkTime},
|
||||
#{item.wlNo}, #{item.wlMs}, #{item.xmNo}, #{item.xmMs}, #{item.xj}, #{item.sapNo}, #{item.gysNo}, #{item.gysMc},
|
||||
#{item.wlNo}, #{item.wlMs}, #{item.xmNo}, #{item.xmMs},
|
||||
#{item.xmNoCk}, #{item.xmMsCk}, #{item.xj}, #{item.sapNo}, #{item.gysNo}, #{item.gysMc},
|
||||
#{item.jhQty}, #{item.htQty}, #{item.jhAmt}, #{item.htDj}, #{item.dw},
|
||||
#{item.borrowTime}, #{item.returnTime},
|
||||
#{item.pcode}, #{item.pcodeId}, #{item.trayCode}, #{item.realQty}, #{item.entityId},
|
||||
#{item.remark}, #{item.isChuku}, #{item.isDelete}, #{item.createBy}, #{item.createTime}
|
||||
#{item.remark}, #{item.isChuku}, #{item.isBorrowed},#{item.isDelete}, #{item.createBy}, #{item.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<!--还料入库-->
|
||||
<insert id="insertRkInfo" parameterType="RkInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO rk_info (
|
||||
rk_type, wl_type, cangku, rk_time, lihuo_y,
|
||||
is_chuku, remark, bill_no, xj, xm_no, xm_ms,is_borrowed,
|
||||
wl_no, wl_ms, gys_no, gys_mc, jh_amt, ht_dj,
|
||||
sap_no, xh, jh_qty, ht_qty, dw, real_qty,
|
||||
pcode, tray_code, entity_id,
|
||||
ck_lihuo_y, ck_type, team_code, ck_remark,
|
||||
ly_time, bill_no_ck, has_moved,
|
||||
create_by, create_time, update_by, update_time, is_delete
|
||||
) VALUES (
|
||||
#{rkType}, #{wlType}, #{cangku}, #{rkTime}, #{lihuoY},
|
||||
#{isChuku}, #{remark}, #{billNo}, #{xj}, #{xmNo}, #{xmMs},#{isBorrowed},
|
||||
#{wlNo}, #{wlMs}, #{gysNo}, #{gysMc}, #{jhAmt}, #{htDj},
|
||||
#{sapNo}, #{xh}, #{jhQty}, #{htQty}, #{dw}, #{realQty},
|
||||
#{pcode}, #{trayCode}, #{entityId},
|
||||
#{ckLihuoY}, #{ckType}, #{teamCode}, #{ckRemark},
|
||||
#{lyTime}, #{billNoCk}, #{hasMoved},
|
||||
#{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{isDelete}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByBillNo">
|
||||
DELETE FROM rk_info WHERE bill_no = #{billNo}
|
||||
@@ -113,6 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
team_code = NULL,
|
||||
ly_time = NULL,
|
||||
ck_remark = NULL,
|
||||
is_borrowed = NULL,
|
||||
update_time = NOW()
|
||||
WHERE bill_no_ck = #{billNoCk}
|
||||
</update>
|
||||
@@ -120,7 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectRkInfoList" parameterType="RkInfo" resultMap="RkInfoResult">
|
||||
<include refid="selectRkInfoVo"/>
|
||||
<where>
|
||||
|
||||
<!-- and is_chuku = '0' -->
|
||||
<if test="isChuku != null and isChuku != ''">
|
||||
and is_chuku = #{isChuku}
|
||||
</if>
|
||||
@@ -141,7 +175,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="rkType != null and rkType != ''"> and rk_type = #{rkType}</if>
|
||||
<if test="wlType != null and wlType != ''"> and wl_type = #{wlType}</if>
|
||||
<if test="cangku != null and cangku != ''"> and cangku = #{cangku}</if>
|
||||
<if test="rkTime != null "> and rk_time = #{rkTime}</if>
|
||||
<if test="startTime != null">
|
||||
<![CDATA[ and rk_time >= #{startTime} ]]>
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
<![CDATA[ and rk_time <= #{endTime} ]]>
|
||||
</if>
|
||||
<if test="lihuoY != null and lihuoY != ''"> and lihuo_y = #{lihuoY}</if>
|
||||
<if test="xj != null and xj != ''"> and xj = #{xj}</if>
|
||||
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
|
||||
@@ -161,6 +200,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="realQty != null "> and real_qty = #{realQty}</if>
|
||||
<if test="pcode != null and pcode != ''"> and pcode = #{pcode}</if>
|
||||
<if test="lyTime != null"> and ri.ly_time = #{lyTime}</if>
|
||||
<if test="returnTime != null"> and ri.return_time = #{returnTime}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="entityId != null and entityId != ''"> and entity_id = #{entityId}</if>
|
||||
<if test="ckType != null and ckType != ''"> and ck_type = #{ckType}</if>
|
||||
@@ -200,7 +240,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="countOverdueStock" resultType="int">
|
||||
SELECT COUNT(*) FROM rk_info
|
||||
WHERE ri.is_delete = 0 AND ri.is_chuku = 0
|
||||
WHERE is_delete = 0 AND is_chuku = 0
|
||||
<![CDATA[
|
||||
AND DATE(rk_time) <= DATE_SUB(CURDATE(), INTERVAL 20 DAY)
|
||||
]]>
|
||||
@@ -208,7 +248,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectTopOverdueStock" resultMap="RkInfoResult">
|
||||
SELECT * FROM rk_info
|
||||
WHERE ri.is_delete = 0 AND ri.is_chuku = 0
|
||||
WHERE is_delete = 0 AND is_chuku = 0
|
||||
<![CDATA[
|
||||
AND DATE(rk_time) <= DATE_SUB(CURDATE(), INTERVAL 20 DAY)
|
||||
]]>
|
||||
@@ -220,6 +260,84 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
WHERE bill_no = #{billNo} AND sap_no IS NOT NULL
|
||||
</select>
|
||||
|
||||
<select id="getByPcodeIdList" parameterType="list" resultMap="RkInfoResult">
|
||||
SELECT
|
||||
ri.id, ri.rk_type, ri.wl_type, ri.cangku, ri.rk_time, ri.lihuo_y,
|
||||
ri.is_chuku, ri.bill_no, ri.bill_no_ck,
|
||||
ri.remark, ri.xj, ri.xm_no, ri.xm_ms, ri.wl_no, ri.wl_ms,ri.is_borrowed,
|
||||
ri.gys_no, ri.gys_mc, ri.jh_amt, ri.ht_dj, ri.sap_no, ri.xh,
|
||||
ri.jh_qty, ri.ht_qty, ri.dw, ri.real_qty,ri.borrow_time, ri.return_time,
|
||||
ri.pcode, ri.pcode_id, ri.tray_code, ri.entity_id,
|
||||
ri.ck_lihuo_y, ri.ck_type, ri.team_code, ri.ly_time, ri.ck_remark,
|
||||
ri.create_by, ri.create_time, ri.update_by, ri.update_time, ri.is_delete
|
||||
FROM rk_info ri
|
||||
WHERE ri.is_delete = '0'
|
||||
AND ri.pcode_id IN
|
||||
<foreach collection="list" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getMissedPcodeIds" parameterType="list" resultMap="RkInfoResult">
|
||||
SELECT
|
||||
id, rk_type, wl_type, cangku, rk_time, lihuo_y,
|
||||
is_chuku, bill_no, bill_no_ck,
|
||||
remark, xj, xm_no, xm_ms, wl_no, wl_ms,is_borrowed,
|
||||
gys_no, gys_mc, jh_amt, ht_dj, sap_no, xh,
|
||||
jh_qty, ht_qty, dw, real_qty,
|
||||
pcode, pcode_id, tray_code, entity_id,
|
||||
ck_lihuo_y, ck_type, team_code, ly_time, ck_remark,
|
||||
create_by, create_time, update_by, update_time, is_delete
|
||||
FROM rk_info
|
||||
WHERE is_delete = '0'
|
||||
<if test="list != null and list.size() > 0">
|
||||
AND pcode_id NOT IN
|
||||
<foreach collection="list" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="existsByPcodeId" parameterType="string" resultType="java.lang.Integer">
|
||||
SELECT COUNT(1)
|
||||
FROM rk_info
|
||||
WHERE is_delete = '0'
|
||||
AND pcode_id = #{pcodeId}
|
||||
</select>
|
||||
|
||||
<select id="countGetByWh" resultType="java.lang.Integer" parameterType="java.lang.String">
|
||||
SELECT COUNT(1) FROM rk_info
|
||||
WHERE is_delete = '0'
|
||||
AND cangku = #{warehouse}
|
||||
AND is_chuku = '0'
|
||||
</select>
|
||||
|
||||
<select id="getUnscannedPcodeByWh" resultType="com.zg.project.Inventory.domain.vo.RkInfoMatchVO">
|
||||
SELECT
|
||||
r.pcode AS rkPcode,
|
||||
r.real_qty AS realQty
|
||||
FROM rk_info r
|
||||
WHERE r.cangku = #{wh}
|
||||
AND r.pcode_id NOT IN (
|
||||
SELECT i.pcode
|
||||
FROM inventory_match_scan i
|
||||
WHERE i.task_id = #{taskId}
|
||||
AND i.status = '0' <!-- 过滤掉扫描成功的 -->
|
||||
)
|
||||
ORDER BY r.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectPcdeCntFromRkInfo" resultType="com.zg.project.Inventory.domain.vo.PcdeCntVO">
|
||||
SELECT pcode AS pcde,
|
||||
COUNT(*) AS cnt
|
||||
FROM rk_info
|
||||
WHERE pcode_id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
GROUP BY pcode
|
||||
</select>
|
||||
|
||||
<update id="updateRkInfo" parameterType="RkInfo">
|
||||
update rk_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
@@ -229,11 +347,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="rkTime != null">rk_time = #{rkTime},</if>
|
||||
<if test="lihuoY != null">lihuo_y = #{lihuoY},</if>
|
||||
<if test="isChuku != null">is_chuku = #{isChuku},</if>
|
||||
<if test="isBorrowed != null">is_borrowed = #{isBorrowed},</if>
|
||||
<if test="billNo != null">bill_no = #{billNo},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="xj != null">xj = #{xj},</if>
|
||||
<if test="xmNo != null">xm_no = #{xmNo},</if>
|
||||
<if test="xmMs != null">xm_ms = #{xmMs},</if>
|
||||
<if test="xmNoCk != null">xm_no_ck = #{xmNoCk},</if>
|
||||
<if test="xmMsCk != null">xm_ms_ck = #{xmMsCk},</if>
|
||||
<if test="wlNo != null">wl_no = #{wlNo},</if>
|
||||
<if test="wlMs != null">wl_ms = #{wlMs},</if>
|
||||
<if test="gysNo != null">gys_no = #{gysNo},</if>
|
||||
@@ -251,12 +372,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="entityId != null">entity_id = #{entityId},</if>
|
||||
<if test="ckLihuoY != null">ck_lihuo_y = #{ckLihuoY},</if>
|
||||
<if test="ckType != null">ck_type = #{ckType},</if>
|
||||
<if test="sgdCode != null">sgd_code = #{sgdCode},</if>
|
||||
<if test="sgdName != null">sgd_name = #{sgdName},</if>
|
||||
<if test="lyTime != null">ly_time = #{lyTime},</if>
|
||||
<if test="borrowTime != null">borrow_time = #{borrowTime},</if>
|
||||
<if test="returnTime != null">return_time = #{returnTime},</if>
|
||||
<if test="ckRemark != null">ck_remark = #{ckRemark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="hasMoved != null">has_moved = #{hasMoved},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
@@ -266,31 +386,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<update id="deleteRkInfoById" parameterType="Long">
|
||||
update rk_info
|
||||
set is_delete = 1
|
||||
<set>
|
||||
is_delete = 1
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteRkInfoByIds" parameterType="String">
|
||||
<update id="deleteRkInfoByIds" parameterType="java.util.List">
|
||||
update rk_info
|
||||
set ri.is_delete = 1
|
||||
set is_delete = 1
|
||||
where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateById" parameterType="RkInfo">
|
||||
<update id="updateById" parameterType="com.zg.project.wisdom.domain.RkInfo">
|
||||
UPDATE rk_info
|
||||
<set>
|
||||
<if test="isChuku != null">is_chuku = #{isChuku},</if>
|
||||
<if test="ckRemark != null">ck_remark = #{ckRemark},</if>
|
||||
<if test="isBorrowed != null">is_borrowed = #{isBorrowed},</if>
|
||||
<if test="billNoCk != null">bill_no_ck = #{billNoCk},</if>
|
||||
<if test="ckType != null">ck_type = #{ckType},</if>
|
||||
<if test="lyTime != null">ly_time = #{lyTime},</if>
|
||||
<if test="ckLihuoY != null">ck_lihuo_y = #{ckLihuoY},</if>
|
||||
<if test="teamCode != null">team_code = #{teamCode},</if>
|
||||
<if test="billNoCk != null">bill_no_ck = #{billNoCk},</if>
|
||||
<if test="ckRemark != null">ck_remark = #{ckRemark},</if>
|
||||
<if test="xmNoCk != null">xm_no_ck = #{xmNoCk},</if>
|
||||
<if test="xmMsCk != null">xm_ms_ck = #{xmMsCk},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime}</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="lyTime != null">ly_time = #{lyTime},</if>
|
||||
<if test="borrowTime != null">borrow_time = #{borrowTime},</if>
|
||||
<if test="returnTime != null">return_time = #{returnTime},</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
Reference in New Issue
Block a user