配送单据接口开发
配送单据附件接口开发
This commit is contained in:
159
src/main/java/com/delivery/common/utils/MinioUtil.java
Normal file
159
src/main/java/com/delivery/common/utils/MinioUtil.java
Normal file
@@ -0,0 +1,159 @@
|
||||
package com.delivery.common.utils;
|
||||
|
||||
import com.delivery.common.exception.ServiceException;
|
||||
import com.delivery.common.utils.uuid.UUID;
|
||||
import io.minio.*;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* MinIO 工具(封装日期目录、路径清洗、单/多文件上传)
|
||||
*/
|
||||
@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 defaultBucket;
|
||||
|
||||
/** 初始化或首次使用时是否将桶设为公共读(生产建议 false) */
|
||||
@Value("${minio.public-read:false}")
|
||||
private boolean publicRead;
|
||||
|
||||
private MinioClient minioClient;
|
||||
|
||||
@PostConstruct
|
||||
public void init() throws Exception {
|
||||
minioClient = MinioClient.builder()
|
||||
.endpoint(endpoint)
|
||||
.credentials(accessKey, secretKey)
|
||||
.build();
|
||||
ensureBucketAndPolicyIfNeeded(defaultBucket);
|
||||
}
|
||||
|
||||
private void ensureBucketAndPolicyIfNeeded(String bucket) throws Exception {
|
||||
boolean exists = minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucket).build());
|
||||
if (!exists) {
|
||||
minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucket).build());
|
||||
}
|
||||
if (publicRead) {
|
||||
String policyJson = "{\n" +
|
||||
" \"Version\":\"2012-10-17\",\n" +
|
||||
" \"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":[\"s3:GetObject\"],\"Resource\":[\"arn:aws:s3:::" + bucket + "/*\"]}]\n" +
|
||||
"}";
|
||||
minioClient.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucket).config(policyJson).build());
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================= 路径/目录封装 ========================= */
|
||||
|
||||
/** yyyy-MM-dd */
|
||||
public String dateFolder() {
|
||||
return DateUtils.parseDateToStr("yyyy-MM-dd", DateUtils.getNowDate());
|
||||
}
|
||||
|
||||
/** 组装按天目录: base/yyyy-MM-dd[/sub],同时做子路径清洗 */
|
||||
public String buildDateFolder(String base, String sub) {
|
||||
String baseNorm = normalizePath(base);
|
||||
String day = dateFolder();
|
||||
if (sub == null || sub.isEmpty()) {
|
||||
return baseNorm + "/" + day;
|
||||
}
|
||||
String subNorm = normalizePath(sub);
|
||||
return baseNorm + "/" + day + "/" + subNorm;
|
||||
}
|
||||
|
||||
/** 规范化路径:去反斜杠、折叠 //、去首尾 /、禁止 .. */
|
||||
public String normalizePath(String folder) {
|
||||
if (folder == null || folder.isEmpty()) return "";
|
||||
String s = folder.replace("\\", "/").replaceAll("/+", "/").trim();
|
||||
if (s.startsWith("/")) s = s.substring(1);
|
||||
if (s.endsWith("/")) s = s.substring(0, s.length() - 1);
|
||||
if (s.contains("..")) throw new ServiceException("非法路径");
|
||||
return s;
|
||||
}
|
||||
|
||||
/* ========================= 上传封装 ========================= */
|
||||
|
||||
/** 单文件上传到指定桶/目录,返回可访问 URL */
|
||||
public String upload(MultipartFile file, String bucketName, String folder) throws Exception {
|
||||
if (file == null || file.isEmpty()) throw new IllegalArgumentException("file is empty");
|
||||
|
||||
String contentType = file.getContentType();
|
||||
long size = file.getSize();
|
||||
if (size <= 0) throw new IllegalArgumentException("illegal size");
|
||||
// 简单白名单:图片或 PDF
|
||||
if (contentType == null || !(contentType.startsWith("image/") || contentType.equals("application/pdf"))) {
|
||||
throw new IllegalArgumentException("unsupported contentType: " + contentType);
|
||||
}
|
||||
|
||||
String originalName = file.getOriginalFilename();
|
||||
String ext = (originalName != null && originalName.contains(".")) ? originalName.substring(originalName.lastIndexOf(".")) : "";
|
||||
String path = normalizePath(folder);
|
||||
String objectName = (path.isEmpty() ? "" : path + "/") + UUID.randomUUID().toString(true) + ext;
|
||||
|
||||
try (InputStream in = file.getInputStream()) {
|
||||
minioClient.putObject(
|
||||
PutObjectArgs.builder()
|
||||
.bucket(bucketName)
|
||||
.object(objectName)
|
||||
.stream(in, size, -1)
|
||||
.contentType(contentType)
|
||||
.build()
|
||||
);
|
||||
}
|
||||
return endpoint + "/" + bucketName + "/" + objectName;
|
||||
}
|
||||
|
||||
/** 多文件上传(批量),返回 URL 列表 */
|
||||
public List<String> uploadBatch(MultipartFile[] files, String bucketName, String folder) throws Exception {
|
||||
if (files == null || files.length == 0) throw new IllegalArgumentException("files empty");
|
||||
List<String> urls = new ArrayList<>(files.length);
|
||||
for (MultipartFile f : files) {
|
||||
urls.add(upload(f, bucketName, folder));
|
||||
}
|
||||
return urls;
|
||||
}
|
||||
|
||||
/** 便捷:上传到默认桶 + 指定 base/sub 的按天目录 */
|
||||
public List<String> uploadBatchToDateFolder(MultipartFile[] files, String base, String sub) throws Exception {
|
||||
String folder = buildDateFolder(base, sub);
|
||||
return uploadBatch(files, defaultBucket, folder);
|
||||
}
|
||||
|
||||
/* ===== 可选:Base64 上传(保留你之前的能力,按需使用) ===== */
|
||||
|
||||
public String uploadBase64(String dataUrl, String bucketName, String folder) throws Exception {
|
||||
if (dataUrl == null) throw new IllegalArgumentException("dataUrl empty");
|
||||
String mime = "image/png", ext = ".png";
|
||||
if (dataUrl.startsWith("data:image/jpeg")) { mime = "image/jpeg"; ext = ".jpg"; }
|
||||
else if (dataUrl.startsWith("data:image/png")) { mime = "image/png"; ext = ".png"; }
|
||||
else if (dataUrl.startsWith("data:image/webp")) { mime = "image/webp"; ext = ".webp"; }
|
||||
|
||||
String base64 = dataUrl.replaceFirst("^data:[^,]+,", "");
|
||||
byte[] bytes = Base64.getDecoder().decode(base64);
|
||||
|
||||
String path = normalizePath(folder);
|
||||
String objectName = (path.isEmpty() ? "" : path + "/") + UUID.randomUUID().toString(true) + ext;
|
||||
|
||||
try (InputStream in = new java.io.ByteArrayInputStream(bytes)) {
|
||||
minioClient.putObject(
|
||||
PutObjectArgs.builder()
|
||||
.bucket(bucketName)
|
||||
.object(objectName)
|
||||
.stream(in, bytes.length, -1)
|
||||
.contentType(mime)
|
||||
.build()
|
||||
);
|
||||
}
|
||||
return endpoint + "/" + bucketName + "/" + objectName;
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,14 @@ public class SecurityConfig
|
||||
.authorizeHttpRequests((requests) -> {
|
||||
permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll());
|
||||
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
||||
requests.antMatchers("/login", "/register", "/captchaImage").permitAll()
|
||||
requests.antMatchers(
|
||||
"/login",
|
||||
"/register",
|
||||
"/document/info/**",
|
||||
"/document/attachment/**",
|
||||
"/document/order/**",
|
||||
// "/document/info/bill/groups",
|
||||
"/captchaImage").permitAll()
|
||||
// 静态资源,可匿名访问
|
||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
package com.delivery.project.document.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.delivery.common.exception.ServiceException;
|
||||
import com.delivery.common.utils.MinioUtil;
|
||||
import com.delivery.common.utils.uuid.IdUtils;
|
||||
import com.delivery.project.document.domain.dto.DeliveryAttachUploadDTO;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.delivery.framework.aspectj.lang.annotation.Log;
|
||||
import com.delivery.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.delivery.project.document.domain.DeliveryAttachment;
|
||||
import com.delivery.project.document.service.IDeliveryAttachmentService;
|
||||
import com.delivery.framework.web.controller.BaseController;
|
||||
import com.delivery.framework.web.domain.AjaxResult;
|
||||
import com.delivery.common.utils.poi.ExcelUtil;
|
||||
import com.delivery.framework.web.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 配送附件Controller
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/document/attachment")
|
||||
public class DeliveryAttachmentController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDeliveryAttachmentService deliveryAttachmentService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private MinioUtil minioUtil;
|
||||
|
||||
@Value("${minio.bucketName}")
|
||||
private String bucketName;
|
||||
|
||||
/**
|
||||
* 查询配送附件列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:attachment:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DeliveryAttachment deliveryAttachment)
|
||||
{
|
||||
startPage();
|
||||
List<DeliveryAttachment> list = deliveryAttachmentService.selectDeliveryAttachmentList(deliveryAttachment);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配送附件列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:attachment:export')")
|
||||
@Log(title = "配送附件", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeliveryAttachment deliveryAttachment)
|
||||
{
|
||||
List<DeliveryAttachment> list = deliveryAttachmentService.selectDeliveryAttachmentList(deliveryAttachment);
|
||||
ExcelUtil<DeliveryAttachment> util = new ExcelUtil<DeliveryAttachment>(DeliveryAttachment.class);
|
||||
util.exportExcel(response, list, "配送附件数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配送附件详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:attachment:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(deliveryAttachmentService.selectDeliveryAttachmentById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配送附件
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:attachment:add')")
|
||||
@Log(title = "配送附件", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DeliveryAttachment deliveryAttachment)
|
||||
{
|
||||
return toAjax(deliveryAttachmentService.insertDeliveryAttachment(deliveryAttachment));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配送附件
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:attachment:edit')")
|
||||
@Log(title = "配送附件", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DeliveryAttachment deliveryAttachment)
|
||||
{
|
||||
return toAjax(deliveryAttachmentService.updateDeliveryAttachment(deliveryAttachment));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配送附件
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:attachment:remove')")
|
||||
@Log(title = "配送附件", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(deliveryAttachmentService.deleteDeliveryAttachmentByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件到 MinIO,仅返回 URL,不入库
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('document:attachment:add')")
|
||||
// @Log(title = "配送附件-上传(仅MinIO)", businessType = BusinessType.OTHER)
|
||||
@PostMapping(value = "/upload", consumes = {"multipart/form-data"})
|
||||
public AjaxResult upload(@RequestPart("files") MultipartFile[] files,
|
||||
@Validated @ModelAttribute DeliveryAttachUploadDTO dto) {
|
||||
try {
|
||||
// 用 scene + bizType 自动当作子目录(可空)
|
||||
String scene = dto.getScene();
|
||||
String bizType = dto.getBizType();
|
||||
String sub = "";
|
||||
if (scene != null && !scene.isEmpty() && bizType != null && !bizType.isEmpty()) {
|
||||
sub = scene.toLowerCase(Locale.ROOT) + "/" + bizType.toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
List<String> urls = minioUtil.uploadBatch(
|
||||
files,
|
||||
bucketName,
|
||||
minioUtil.buildDateFolder("delivery", sub) // delivery/yyyy-MM-dd[/scene/bizType]
|
||||
);
|
||||
return AjaxResult.success("urls", urls);
|
||||
} catch (ServiceException se) {
|
||||
return AjaxResult.error(se.getMessage());
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("上传失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.delivery.project.document.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.delivery.project.document.domain.dto.DeliveryOrderSaveDTO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.delivery.framework.aspectj.lang.annotation.Log;
|
||||
import com.delivery.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.delivery.project.document.domain.DeliveryOrder;
|
||||
import com.delivery.project.document.service.IDeliveryOrderService;
|
||||
import com.delivery.framework.web.controller.BaseController;
|
||||
import com.delivery.framework.web.domain.AjaxResult;
|
||||
import com.delivery.common.utils.poi.ExcelUtil;
|
||||
import com.delivery.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 配送单据主Controller
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/document/order")
|
||||
public class DeliveryOrderController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDeliveryOrderService deliveryOrderService;
|
||||
|
||||
/**
|
||||
* 查询配送单据主列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:order:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DeliveryOrder deliveryOrder)
|
||||
{
|
||||
startPage();
|
||||
List<DeliveryOrder> list = deliveryOrderService.selectDeliveryOrderList(deliveryOrder);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配送单据主列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:order:export')")
|
||||
@Log(title = "配送单据主", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DeliveryOrder deliveryOrder)
|
||||
{
|
||||
List<DeliveryOrder> list = deliveryOrderService.selectDeliveryOrderList(deliveryOrder);
|
||||
ExcelUtil<DeliveryOrder> util = new ExcelUtil<DeliveryOrder>(DeliveryOrder.class);
|
||||
util.exportExcel(response, list, "配送单据主数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配送单据主详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:order:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(deliveryOrderService.selectDeliveryOrderById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配送单据主
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:order:add')")
|
||||
@Log(title = "配送单据主", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DeliveryOrder deliveryOrder)
|
||||
{
|
||||
return toAjax(deliveryOrderService.insertDeliveryOrder(deliveryOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配送单据主
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:order:edit')")
|
||||
@Log(title = "配送单据主", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DeliveryOrder deliveryOrder)
|
||||
{
|
||||
return toAjax(deliveryOrderService.updateDeliveryOrder(deliveryOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配送单据主
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:order:remove')")
|
||||
@Log(title = "配送单据主", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(deliveryOrderService.deleteDeliveryOrderByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
// @PreAuthorize("@ss.hasPermi('document:order:add')")
|
||||
// @Log(title = "配送单据主-保存(含附件)", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/save")
|
||||
public AjaxResult save(@RequestBody DeliveryOrderSaveDTO dto) {
|
||||
String username = "大爷的!";
|
||||
int rows = deliveryOrderService.saveOrderWithAttachments(dto, username);
|
||||
return toAjax(rows);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.delivery.project.document.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.delivery.project.document.domain.dto.RkInfoQueryDTO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.delivery.framework.aspectj.lang.annotation.Log;
|
||||
import com.delivery.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.delivery.project.document.domain.RkInfo;
|
||||
import com.delivery.project.document.service.IRkInfoService;
|
||||
import com.delivery.framework.web.controller.BaseController;
|
||||
import com.delivery.framework.web.domain.AjaxResult;
|
||||
import com.delivery.common.utils.poi.ExcelUtil;
|
||||
import com.delivery.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 库存单据明细Controller
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/document/info")
|
||||
public class RkInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRkInfoService rkInfoService;
|
||||
|
||||
/**
|
||||
* 查询库存单据明细列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RkInfo rkInfo) {
|
||||
List<RkInfo> list = rkInfoService.selectRkInfoList(rkInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
/**
|
||||
* 导出库存单据明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:info:export')")
|
||||
@Log(title = "库存单据明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RkInfo rkInfo)
|
||||
{
|
||||
List<RkInfo> list = rkInfoService.selectRkInfoList(rkInfo);
|
||||
ExcelUtil<RkInfo> util = new ExcelUtil<RkInfo>(RkInfo.class);
|
||||
util.exportExcel(response, list, "库存单据明细数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取库存单据明细详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rkInfoService.selectRkInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库存单据明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:info:add')")
|
||||
@Log(title = "库存单据明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RkInfo rkInfo)
|
||||
{
|
||||
return toAjax(rkInfoService.insertRkInfo(rkInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存单据明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:info:edit')")
|
||||
@Log(title = "库存单据明细", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RkInfo rkInfo)
|
||||
{
|
||||
return toAjax(rkInfoService.updateRkInfo(rkInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库存单据明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('document:info:remove')")
|
||||
@Log(title = "库存单据明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rkInfoService.deleteRkInfoByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单据分组
|
||||
*/
|
||||
@GetMapping("/bill/groups")
|
||||
public TableDataInfo billGroups(RkInfo rkInfo) {
|
||||
if (rkInfo == null)
|
||||
rkInfo.setIsChuku("1");
|
||||
rkInfo.setIsDelivery("1");
|
||||
List<RkInfo> rows = rkInfoService.selectGroupedByBill(rkInfo);
|
||||
return getDataTable(rows);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package com.delivery.project.document.domain;
|
||||
|
||||
import com.delivery.framework.aspectj.lang.annotation.Excel;
|
||||
import com.delivery.framework.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 配送附件对象 delivery_attachment
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-15
|
||||
*/
|
||||
public class DeliveryAttachment extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 关联的配送单ID */
|
||||
@Excel(name = "关联的配送单ID")
|
||||
private Long orderId;
|
||||
|
||||
|
||||
/** 场景(ORIGIN起点、DEST终点) */
|
||||
@Excel(name = "场景", readConverterExp = "O=RIGIN起点、DEST终点")
|
||||
private String scene;
|
||||
|
||||
/** 类型(SIGN_DRIVER司机签名照、SIGN_COURIER配送人员签字、SIGN_RECEIVER接收人签字照、PHOTO_SITE现场照片、PHOTO_BILL配送单据照片) */
|
||||
@Excel(name = "类型", readConverterExp = "S=IGN_DRIVER司机签名照、SIGN_COURIER配送人员签字、SIGN_RECEIVER接收人签字照、PHOTO_SITE现场照片、PHOTO_BILL配送单据照片")
|
||||
private String bizType;
|
||||
|
||||
/** 图片路径 */
|
||||
@Excel(name = "图片路径")
|
||||
private String url;
|
||||
|
||||
/** 0临时 1已绑定 */
|
||||
@Excel(name = "0临时 1已绑定")
|
||||
private String status;
|
||||
|
||||
/** 排序号 */
|
||||
@Excel(name = "排序号")
|
||||
private Long sortNo;
|
||||
|
||||
/** 是否删除(0正常 1已删除) */
|
||||
@Excel(name = "是否删除", readConverterExp = "0=正常,1=已删除")
|
||||
private String isDelete;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setScene(String scene)
|
||||
{
|
||||
this.scene = scene;
|
||||
}
|
||||
|
||||
public String getScene()
|
||||
{
|
||||
return scene;
|
||||
}
|
||||
|
||||
public void setBizType(String bizType)
|
||||
{
|
||||
this.bizType = bizType;
|
||||
}
|
||||
|
||||
public String getBizType()
|
||||
{
|
||||
return bizType;
|
||||
}
|
||||
|
||||
public void setUrl(String url)
|
||||
{
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getUrl()
|
||||
{
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setSortNo(Long sortNo)
|
||||
{
|
||||
this.sortNo = sortNo;
|
||||
}
|
||||
|
||||
public Long getSortNo()
|
||||
{
|
||||
return sortNo;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("scene", getScene())
|
||||
.append("bizType", getBizType())
|
||||
.append("url", getUrl())
|
||||
.append("status", getStatus())
|
||||
.append("sortNo", getSortNo())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,392 @@
|
||||
package com.delivery.project.document.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.delivery.framework.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.delivery.framework.aspectj.lang.annotation.Excel;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 配送单据主对象 delivery_order
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-15
|
||||
*/
|
||||
public class DeliveryOrder extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 项目描述 */
|
||||
@Excel(name = "项目描述")
|
||||
private String xmMs;
|
||||
|
||||
/** 项目号 */
|
||||
@Excel(name = "项目号")
|
||||
private String xmNo;
|
||||
|
||||
/** 物料号 */
|
||||
@Excel(name = "物料号")
|
||||
private String wlNo;
|
||||
|
||||
/** 物料描述 */
|
||||
@Excel(name = "物料描述")
|
||||
private String wlMs;
|
||||
|
||||
/** 实际入库数量 */
|
||||
@Excel(name = "实际入库数量")
|
||||
private BigDecimal realQty;
|
||||
|
||||
/** 计量单位 */
|
||||
@Excel(name = "计量单位")
|
||||
private String dw;
|
||||
|
||||
/** SAP订单编号 */
|
||||
@Excel(name = "SAP订单编号")
|
||||
private String sapNo;
|
||||
|
||||
/** 供应商名称 */
|
||||
@Excel(name = "供应商名称")
|
||||
private String gysMc;
|
||||
|
||||
/** 起始地点名称 */
|
||||
@Excel(name = "起始地点名称")
|
||||
private String originName;
|
||||
|
||||
/** 起始地点经度 */
|
||||
@Excel(name = "起始地点经度")
|
||||
private BigDecimal originLng;
|
||||
|
||||
/** 起始地点纬度 */
|
||||
@Excel(name = "起始地点纬度")
|
||||
private BigDecimal originLat;
|
||||
|
||||
/** 目的地点名称 */
|
||||
@Excel(name = "目的地点名称")
|
||||
private String destName;
|
||||
|
||||
/** 目的地点经度 */
|
||||
@Excel(name = "目的地点经度")
|
||||
private BigDecimal destLng;
|
||||
|
||||
/** 目的地点纬度 */
|
||||
@Excel(name = "目的地点纬度")
|
||||
private BigDecimal destLat;
|
||||
|
||||
/** 配送日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "配送日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date deliveryDate;
|
||||
|
||||
/** 配送车牌 */
|
||||
@Excel(name = "配送车牌")
|
||||
private String vehiclePlate;
|
||||
|
||||
/** 发货人姓名 */
|
||||
@Excel(name = "发货人姓名")
|
||||
private String shipperName;
|
||||
|
||||
/** 发货人联系方式 */
|
||||
@Excel(name = "发货人联系方式")
|
||||
private String shipperPhone;
|
||||
|
||||
/** 接收人姓名 */
|
||||
@Excel(name = "接收人姓名")
|
||||
private String receiverName;
|
||||
|
||||
/** 接收人联系方式 */
|
||||
@Excel(name = "接收人联系方式")
|
||||
private String receiverPhone;
|
||||
|
||||
/** 接收单位名称 */
|
||||
@Excel(name = "接收单位名称")
|
||||
private String receiverOrgName;
|
||||
|
||||
/** 配送吨位 */
|
||||
@Excel(name = "配送吨位")
|
||||
private BigDecimal deliveryTon;
|
||||
|
||||
/** 是否删除(0正常 1已删除) */
|
||||
@Excel(name = "是否删除", readConverterExp = "0=正常,1=已删除")
|
||||
private String isDelete;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setXmMs(String xmMs)
|
||||
{
|
||||
this.xmMs = xmMs;
|
||||
}
|
||||
|
||||
public String getXmMs()
|
||||
{
|
||||
return xmMs;
|
||||
}
|
||||
|
||||
public void setXmNo(String xmNo)
|
||||
{
|
||||
this.xmNo = xmNo;
|
||||
}
|
||||
|
||||
public String getXmNo()
|
||||
{
|
||||
return xmNo;
|
||||
}
|
||||
|
||||
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 setRealQty(BigDecimal realQty)
|
||||
{
|
||||
this.realQty = realQty;
|
||||
}
|
||||
|
||||
public BigDecimal getRealQty()
|
||||
{
|
||||
return realQty;
|
||||
}
|
||||
|
||||
public void setDw(String dw)
|
||||
{
|
||||
this.dw = dw;
|
||||
}
|
||||
|
||||
public String getDw()
|
||||
{
|
||||
return dw;
|
||||
}
|
||||
|
||||
public void setSapNo(String sapNo)
|
||||
{
|
||||
this.sapNo = sapNo;
|
||||
}
|
||||
|
||||
public String getSapNo()
|
||||
{
|
||||
return sapNo;
|
||||
}
|
||||
|
||||
public void setGysMc(String gysMc)
|
||||
{
|
||||
this.gysMc = gysMc;
|
||||
}
|
||||
|
||||
public String getGysMc()
|
||||
{
|
||||
return gysMc;
|
||||
}
|
||||
|
||||
public void setOriginName(String originName)
|
||||
{
|
||||
this.originName = originName;
|
||||
}
|
||||
|
||||
public String getOriginName()
|
||||
{
|
||||
return originName;
|
||||
}
|
||||
|
||||
public void setOriginLng(BigDecimal originLng)
|
||||
{
|
||||
this.originLng = originLng;
|
||||
}
|
||||
|
||||
public BigDecimal getOriginLng()
|
||||
{
|
||||
return originLng;
|
||||
}
|
||||
|
||||
public void setOriginLat(BigDecimal originLat)
|
||||
{
|
||||
this.originLat = originLat;
|
||||
}
|
||||
|
||||
public BigDecimal getOriginLat()
|
||||
{
|
||||
return originLat;
|
||||
}
|
||||
|
||||
public void setDestName(String destName)
|
||||
{
|
||||
this.destName = destName;
|
||||
}
|
||||
|
||||
public String getDestName()
|
||||
{
|
||||
return destName;
|
||||
}
|
||||
|
||||
public void setDestLng(BigDecimal destLng)
|
||||
{
|
||||
this.destLng = destLng;
|
||||
}
|
||||
|
||||
public BigDecimal getDestLng()
|
||||
{
|
||||
return destLng;
|
||||
}
|
||||
|
||||
public void setDestLat(BigDecimal destLat)
|
||||
{
|
||||
this.destLat = destLat;
|
||||
}
|
||||
|
||||
public BigDecimal getDestLat()
|
||||
{
|
||||
return destLat;
|
||||
}
|
||||
|
||||
public void setDeliveryDate(Date deliveryDate)
|
||||
{
|
||||
this.deliveryDate = deliveryDate;
|
||||
}
|
||||
|
||||
public Date getDeliveryDate()
|
||||
{
|
||||
return deliveryDate;
|
||||
}
|
||||
|
||||
public void setVehiclePlate(String vehiclePlate)
|
||||
{
|
||||
this.vehiclePlate = vehiclePlate;
|
||||
}
|
||||
|
||||
public String getVehiclePlate()
|
||||
{
|
||||
return vehiclePlate;
|
||||
}
|
||||
|
||||
public void setShipperName(String shipperName)
|
||||
{
|
||||
this.shipperName = shipperName;
|
||||
}
|
||||
|
||||
public String getShipperName()
|
||||
{
|
||||
return shipperName;
|
||||
}
|
||||
|
||||
public void setShipperPhone(String shipperPhone)
|
||||
{
|
||||
this.shipperPhone = shipperPhone;
|
||||
}
|
||||
|
||||
public String getShipperPhone()
|
||||
{
|
||||
return shipperPhone;
|
||||
}
|
||||
|
||||
public void setReceiverName(String receiverName)
|
||||
{
|
||||
this.receiverName = receiverName;
|
||||
}
|
||||
|
||||
public String getReceiverName()
|
||||
{
|
||||
return receiverName;
|
||||
}
|
||||
|
||||
public void setReceiverPhone(String receiverPhone)
|
||||
{
|
||||
this.receiverPhone = receiverPhone;
|
||||
}
|
||||
|
||||
public String getReceiverPhone()
|
||||
{
|
||||
return receiverPhone;
|
||||
}
|
||||
|
||||
public void setReceiverOrgName(String receiverOrgName)
|
||||
{
|
||||
this.receiverOrgName = receiverOrgName;
|
||||
}
|
||||
|
||||
public String getReceiverOrgName()
|
||||
{
|
||||
return receiverOrgName;
|
||||
}
|
||||
|
||||
public void setDeliveryTon(BigDecimal deliveryTon)
|
||||
{
|
||||
this.deliveryTon = deliveryTon;
|
||||
}
|
||||
|
||||
public BigDecimal getDeliveryTon()
|
||||
{
|
||||
return deliveryTon;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("xmMs", getXmMs())
|
||||
.append("xmNo", getXmNo())
|
||||
.append("wlNo", getWlNo())
|
||||
.append("wlMs", getWlMs())
|
||||
.append("realQty", getRealQty())
|
||||
.append("dw", getDw())
|
||||
.append("sapNo", getSapNo())
|
||||
.append("gysMc", getGysMc())
|
||||
.append("remark", getRemark())
|
||||
.append("originName", getOriginName())
|
||||
.append("originLng", getOriginLng())
|
||||
.append("originLat", getOriginLat())
|
||||
.append("destName", getDestName())
|
||||
.append("destLng", getDestLng())
|
||||
.append("destLat", getDestLat())
|
||||
.append("deliveryDate", getDeliveryDate())
|
||||
.append("vehiclePlate", getVehiclePlate())
|
||||
.append("shipperName", getShipperName())
|
||||
.append("shipperPhone", getShipperPhone())
|
||||
.append("receiverName", getReceiverName())
|
||||
.append("receiverPhone", getReceiverPhone())
|
||||
.append("receiverOrgName", getReceiverOrgName())
|
||||
.append("deliveryTon", getDeliveryTon())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("isDelete", getIsDelete())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
390
src/main/java/com/delivery/project/document/domain/RkInfo.java
Normal file
390
src/main/java/com/delivery/project/document/domain/RkInfo.java
Normal file
@@ -0,0 +1,390 @@
|
||||
package com.delivery.project.document.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.delivery.framework.aspectj.lang.annotation.Excel;
|
||||
import com.delivery.framework.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 库存单据明细对象 rk_info
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
public class RkInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// ===================== 基本标识 =====================
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 单据号(入库/库存单据编号) */
|
||||
@Excel(name = "单据号")
|
||||
private String billNo;
|
||||
|
||||
/** 出库单据号 */
|
||||
@Excel(name = "出库单据号")
|
||||
private String billNoCk;
|
||||
|
||||
// ===================== 类型与归属 =====================
|
||||
/** 入库类型 */
|
||||
@Excel(name = "入库类型")
|
||||
private String rkType;
|
||||
|
||||
/** 物资类型 */
|
||||
@Excel(name = "物资类型")
|
||||
private String wlType;
|
||||
|
||||
/** 所属仓库 */
|
||||
@Excel(name = "所属仓库")
|
||||
private String cangku;
|
||||
|
||||
/** 是否需要配送(0否 1是) */
|
||||
@Excel(name = "是否需要配送", readConverterExp = "0=否,1=是")
|
||||
private String isDelivery;
|
||||
|
||||
// ===================== 状态与流转 =====================
|
||||
/** 出入库状态(0已入库,1已出库,2待审批,3借料出库,4入库撤销,5出库撤销) */
|
||||
@Excel(name = "是否已出库", readConverterExp = "0=已入库,1=已出库,2=待审批,3=借料出库,4=入库撤销,5=出库撤销")
|
||||
private String isChuku;
|
||||
|
||||
/** 审核状态(0入库待审核,1已通过,2已驳回,3出库待审核) */
|
||||
@Excel(name = "审核状态", readConverterExp = "0=入库待审核,1=已通过,2=已驳回,3=出库待审核")
|
||||
private String status;
|
||||
|
||||
/** 是否移库过(0否 1是) */
|
||||
@Excel(name = "是否移库过", readConverterExp = "0=否,1=是")
|
||||
private String hasMoved;
|
||||
|
||||
/** 是否借料(0否,1是,2已归还) */
|
||||
@Excel(name = "是否借料", readConverterExp = "0=否,1=是,2=已归还")
|
||||
private String isBorrowed;
|
||||
|
||||
/** 逻辑删除(0 正常,1 已删除) */
|
||||
@Excel(name = "是否删除", readConverterExp = "0=正常,1=已删除")
|
||||
private String isDelete;
|
||||
|
||||
// ===================== 项目信息 =====================
|
||||
/** 县局 */
|
||||
@Excel(name = "县局")
|
||||
private String xj;
|
||||
|
||||
/** 项目号(入库/来源项目) */
|
||||
@Excel(name = "项目号")
|
||||
private String xmNo;
|
||||
|
||||
/** 项目描述(入库/来源项目) */
|
||||
@Excel(name = "项目描述")
|
||||
private String xmMs;
|
||||
|
||||
/** 出库项目号(领取方项目) */
|
||||
@Excel(name = "出库项目号(领取方项目)")
|
||||
private String xmNoCk;
|
||||
|
||||
/** 出库项目描述(领取方项目) */
|
||||
@Excel(name = "出库项目描述(领取方项目)")
|
||||
private String xmMsCk;
|
||||
|
||||
// ===================== 物料/供应信息 =====================
|
||||
/** 物料号 */
|
||||
@Excel(name = "物料号")
|
||||
private String wlNo;
|
||||
|
||||
/** 物料描述 */
|
||||
@Excel(name = "物料描述")
|
||||
private String wlMs;
|
||||
|
||||
|
||||
/** 供应商编码 */
|
||||
@Excel(name = "供应商编码")
|
||||
private String gysNo;
|
||||
|
||||
/** 供应商名称 */
|
||||
@Excel(name = "供应商名称")
|
||||
private String gysMc;
|
||||
|
||||
/** SAP订单编号 */
|
||||
@Excel(name = "SAP订单编号")
|
||||
private String sapNo;
|
||||
|
||||
/** 行号 */
|
||||
@Excel(name = "行号")
|
||||
private String xh;
|
||||
|
||||
// ===================== 金额/数量 =====================
|
||||
/** 计划交货金额 */
|
||||
@Excel(name = "计划交货金额")
|
||||
private BigDecimal jhAmt;
|
||||
|
||||
/** 合同单价 */
|
||||
@Excel(name = "合同单价")
|
||||
private BigDecimal htDj;
|
||||
|
||||
/** 计划交货数量 */
|
||||
@Excel(name = "计划交货数量")
|
||||
private Long jhQty;
|
||||
|
||||
/** 合同数量 */
|
||||
@Excel(name = "合同数量")
|
||||
private Long htQty;
|
||||
|
||||
/** 计量单位 */
|
||||
@Excel(name = "计量单位")
|
||||
private String dw;
|
||||
|
||||
/** 实际入库数量 */
|
||||
@Excel(name = "实际入库数量")
|
||||
private BigDecimal realQty;
|
||||
|
||||
// ===================== 库位/托盘/实物 =====================
|
||||
/** 库位码 */
|
||||
@Excel(name = "库位码")
|
||||
private String pcode;
|
||||
|
||||
/** 库位16进制编码 */
|
||||
@Excel(name = "库位16进制编码")
|
||||
private String pcodeId;
|
||||
|
||||
/** 托盘码 */
|
||||
@Excel(name = "托盘码")
|
||||
private String trayCode;
|
||||
|
||||
/** 实物ID */
|
||||
@Excel(name = "实物ID")
|
||||
private String entityId;
|
||||
|
||||
// ===================== 人员/出库信息 =====================
|
||||
/** 理货员 */
|
||||
@Excel(name = "理货员")
|
||||
private String lihuoY;
|
||||
|
||||
/** 出库理货员 */
|
||||
@Excel(name = "出库理货员")
|
||||
private String ckLihuoY;
|
||||
|
||||
/** 施工队 */
|
||||
@Excel(name = "施工队")
|
||||
private String teamCode;
|
||||
|
||||
/** 出库类型 */
|
||||
@Excel(name = "出库类型")
|
||||
private String ckType;
|
||||
|
||||
/** 出库备注 */
|
||||
@Excel(name = "出库备注")
|
||||
private String ckRemark;
|
||||
|
||||
// ===================== 关键时间 =====================
|
||||
/** 入库时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "入库时间", width = 30, 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 lyTime;
|
||||
|
||||
/** 借用时间 */
|
||||
@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;
|
||||
|
||||
// ===================== 关联外键 =====================
|
||||
/** 供应计划ID(对应供应计划表主键) */
|
||||
@Excel(name = "供应计划ID")
|
||||
private Long gysJhId;
|
||||
|
||||
// ===================== Getter / Setter =====================
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
|
||||
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 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 getIsDelivery() { return isDelivery; }
|
||||
public void setIsDelivery(String isDelivery) { this.isDelivery = isDelivery; }
|
||||
|
||||
public String getIsChuku() { return isChuku; }
|
||||
public void setIsChuku(String isChuku) { this.isChuku = isChuku; }
|
||||
|
||||
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 getIsBorrowed() { return isBorrowed; }
|
||||
public void setIsBorrowed(String isBorrowed) { this.isBorrowed = isBorrowed; }
|
||||
|
||||
public String getIsDelete() { return isDelete; }
|
||||
public void setIsDelete(String isDelete) { this.isDelete = isDelete; }
|
||||
|
||||
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 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 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 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 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 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 getLihuoY() { return lihuoY; }
|
||||
public void setLihuoY(String lihuoY) { this.lihuoY = lihuoY; }
|
||||
|
||||
public String getCkLihuoY() { return ckLihuoY; }
|
||||
public void setCkLihuoY(String ckLihuoY) { this.ckLihuoY = ckLihuoY; }
|
||||
|
||||
public String getTeamCode() { return teamCode; }
|
||||
public void setTeamCode(String teamCode) { this.teamCode = teamCode; }
|
||||
|
||||
public String getCkType() { return ckType; }
|
||||
public void setCkType(String ckType) { this.ckType = ckType; }
|
||||
|
||||
public String getCkRemark() { return ckRemark; }
|
||||
public void setCkRemark(String ckRemark) { this.ckRemark = ckRemark; }
|
||||
|
||||
public Date getRkTime() { return rkTime; }
|
||||
public void setRkTime(Date rkTime) { this.rkTime = rkTime; }
|
||||
|
||||
public Date getLyTime() { return lyTime; }
|
||||
public void setLyTime(Date lyTime) { this.lyTime = lyTime; }
|
||||
|
||||
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 Long getGysJhId() { return gysJhId; }
|
||||
public void setGysJhId(Long gysJhId) { this.gysJhId = gysJhId; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("billNo", getBillNo())
|
||||
.append("billNoCk", getBillNoCk())
|
||||
.append("rkType", getRkType())
|
||||
.append("wlType", getWlType())
|
||||
.append("cangku", getCangku())
|
||||
.append("isDelivery", getIsDelivery())
|
||||
.append("isChuku", getIsChuku())
|
||||
.append("status", getStatus())
|
||||
.append("hasMoved", getHasMoved())
|
||||
.append("isBorrowed", getIsBorrowed())
|
||||
.append("isDelete", getIsDelete())
|
||||
.append("xj", getXj())
|
||||
.append("xmNo", getXmNo())
|
||||
.append("xmMs", getXmMs())
|
||||
.append("xmNoCk", getXmNoCk())
|
||||
.append("xmMsCk", getXmMsCk())
|
||||
.append("wlNo", getWlNo())
|
||||
.append("wlMs", getWlMs())
|
||||
.append("gysNo", getGysNo())
|
||||
.append("gysMc", getGysMc())
|
||||
.append("sapNo", getSapNo())
|
||||
.append("xh", getXh())
|
||||
.append("jhAmt", getJhAmt())
|
||||
.append("htDj", getHtDj())
|
||||
.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("lihuoY", getLihuoY())
|
||||
.append("ckLihuoY", getCkLihuoY())
|
||||
.append("teamCode", getTeamCode())
|
||||
.append("ckType", getCkType())
|
||||
.append("ckRemark", getCkRemark())
|
||||
.append("rkTime", getRkTime())
|
||||
.append("lyTime", getLyTime())
|
||||
.append("borrowTime", getBorrowTime())
|
||||
.append("returnTime", getReturnTime())
|
||||
.append("gysJhId", getGysJhId())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.delivery.project.document.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/** 配送附件上传入参(除文件外的元数据) */
|
||||
@Data
|
||||
public class DeliveryAttachUploadDTO {
|
||||
|
||||
/** 场景:ORIGIN/DEST */
|
||||
@NotBlank(message = "scene不能为空")
|
||||
private String scene;
|
||||
|
||||
/** 业务类型:SIGN_DRIVER / SIGN_COURIER / SIGN_RECEIVER / PHOTO_SITE / PHOTO_BILL */
|
||||
@NotBlank(message = "bizType不能为空")
|
||||
private String bizType;
|
||||
|
||||
/** 排序号(可空) */
|
||||
private Long sortNo;
|
||||
|
||||
/** 备注(可空) */
|
||||
private String remark;
|
||||
|
||||
/** 图片URL(保存时传入) */
|
||||
private String url;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.delivery.project.document.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DeliveryOrderSaveDTO {
|
||||
private String xmMs;
|
||||
private String xmNo;
|
||||
private String wlNo;
|
||||
private String wlMs;
|
||||
private BigDecimal realQty;
|
||||
private String dw;
|
||||
private String sapNo;
|
||||
private String gysMc;
|
||||
private String originName;
|
||||
private BigDecimal originLng;
|
||||
private BigDecimal originLat;
|
||||
private String destName;
|
||||
private BigDecimal destLng;
|
||||
private BigDecimal destLat;
|
||||
private Date deliveryDate;
|
||||
private String vehiclePlate;
|
||||
private String shipperName;
|
||||
private String shipperPhone;
|
||||
private String receiverName;
|
||||
private String receiverPhone;
|
||||
private String receiverOrgName;
|
||||
private BigDecimal deliveryTon;
|
||||
|
||||
/** 附件列表(前端从上传接口获取的URL传入) */
|
||||
private List<DeliveryAttachUploadDTO> attachments;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.delivery.project.document.domain.dto;
|
||||
|
||||
import com.delivery.project.document.domain.RkInfo;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 库存单据分页查询 DTO
|
||||
* 继承 RkInfo,额外加分页参数
|
||||
*/
|
||||
@Data
|
||||
public class RkInfoQueryDTO extends RkInfo {
|
||||
|
||||
/** 页码 */
|
||||
private Integer pageNum;
|
||||
|
||||
/** 每页条数 */
|
||||
private Integer pageSize;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.delivery.project.document.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.delivery.project.document.domain.DeliveryAttachment;
|
||||
|
||||
/**
|
||||
* 配送附件Mapper接口
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-15
|
||||
*/
|
||||
public interface DeliveryAttachmentMapper
|
||||
{
|
||||
/**
|
||||
* 查询配送附件
|
||||
*
|
||||
* @param id 配送附件主键
|
||||
* @return 配送附件
|
||||
*/
|
||||
public DeliveryAttachment selectDeliveryAttachmentById(Long id);
|
||||
|
||||
/**
|
||||
* 查询配送附件列表
|
||||
*
|
||||
* @param deliveryAttachment 配送附件
|
||||
* @return 配送附件集合
|
||||
*/
|
||||
public List<DeliveryAttachment> selectDeliveryAttachmentList(DeliveryAttachment deliveryAttachment);
|
||||
|
||||
/**
|
||||
* 新增配送附件
|
||||
*
|
||||
* @param deliveryAttachment 配送附件
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDeliveryAttachment(DeliveryAttachment deliveryAttachment);
|
||||
|
||||
/**
|
||||
* 修改配送附件
|
||||
*
|
||||
* @param deliveryAttachment 配送附件
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDeliveryAttachment(DeliveryAttachment deliveryAttachment);
|
||||
|
||||
/**
|
||||
* 删除配送附件
|
||||
*
|
||||
* @param id 配送附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeliveryAttachmentById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除配送附件
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeliveryAttachmentByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.delivery.project.document.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.delivery.project.document.domain.DeliveryOrder;
|
||||
|
||||
/**
|
||||
* 配送单据主Mapper接口
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-15
|
||||
*/
|
||||
public interface DeliveryOrderMapper
|
||||
{
|
||||
/**
|
||||
* 查询配送单据主
|
||||
*
|
||||
* @param id 配送单据主主键
|
||||
* @return 配送单据主
|
||||
*/
|
||||
public DeliveryOrder selectDeliveryOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 查询配送单据主列表
|
||||
*
|
||||
* @param deliveryOrder 配送单据主
|
||||
* @return 配送单据主集合
|
||||
*/
|
||||
public List<DeliveryOrder> selectDeliveryOrderList(DeliveryOrder deliveryOrder);
|
||||
|
||||
/**
|
||||
* 新增配送单据主
|
||||
*
|
||||
* @param deliveryOrder 配送单据主
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDeliveryOrder(DeliveryOrder deliveryOrder);
|
||||
|
||||
/**
|
||||
* 修改配送单据主
|
||||
*
|
||||
* @param deliveryOrder 配送单据主
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDeliveryOrder(DeliveryOrder deliveryOrder);
|
||||
|
||||
/**
|
||||
* 删除配送单据主
|
||||
*
|
||||
* @param id 配送单据主主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeliveryOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除配送单据主
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeliveryOrderByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.delivery.project.document.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.delivery.project.document.domain.RkInfo;
|
||||
import com.delivery.project.document.domain.dto.RkInfoQueryDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 库存单据明细Mapper接口
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
public interface RkInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询库存单据明细
|
||||
*
|
||||
* @param id 库存单据明细主键
|
||||
* @return 库存单据明细
|
||||
*/
|
||||
public RkInfo selectRkInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询库存单据明细列表
|
||||
*
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 库存单据明细集合
|
||||
*/
|
||||
public List<RkInfo> selectRkInfoList(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 新增库存单据明细
|
||||
*
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRkInfo(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 修改库存单据明细
|
||||
*
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRkInfo(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 删除库存单据明细
|
||||
*
|
||||
* @param id 库存单据明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除库存单据明细
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 使用 selectRkInfoVo 作为子查询,外层按 bill_no 分组聚合
|
||||
* 不新增 resultMap / VO,直接用 RkInfoResult 映射需要的字段
|
||||
*/
|
||||
List<RkInfo> selectGroupedByBill(@Param("q") RkInfo rkInfo);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.delivery.project.document.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.delivery.project.document.domain.DeliveryAttachment;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 配送附件Service接口
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-15
|
||||
*/
|
||||
public interface IDeliveryAttachmentService
|
||||
{
|
||||
/**
|
||||
* 查询配送附件
|
||||
*
|
||||
* @param id 配送附件主键
|
||||
* @return 配送附件
|
||||
*/
|
||||
public DeliveryAttachment selectDeliveryAttachmentById(Long id);
|
||||
|
||||
/**
|
||||
* 查询配送附件列表
|
||||
*
|
||||
* @param deliveryAttachment 配送附件
|
||||
* @return 配送附件集合
|
||||
*/
|
||||
public List<DeliveryAttachment> selectDeliveryAttachmentList(DeliveryAttachment deliveryAttachment);
|
||||
|
||||
/**
|
||||
* 新增配送附件
|
||||
*
|
||||
* @param deliveryAttachment 配送附件
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDeliveryAttachment(DeliveryAttachment deliveryAttachment);
|
||||
|
||||
/**
|
||||
* 修改配送附件
|
||||
*
|
||||
* @param deliveryAttachment 配送附件
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDeliveryAttachment(DeliveryAttachment deliveryAttachment);
|
||||
|
||||
/**
|
||||
* 批量删除配送附件
|
||||
*
|
||||
* @param ids 需要删除的配送附件主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeliveryAttachmentByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除配送附件信息
|
||||
*
|
||||
* @param id 配送附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeliveryAttachmentById(Long id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.delivery.project.document.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.delivery.project.document.domain.DeliveryOrder;
|
||||
import com.delivery.project.document.domain.dto.DeliveryOrderSaveDTO;
|
||||
|
||||
/**
|
||||
* 配送单据主Service接口
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-15
|
||||
*/
|
||||
public interface IDeliveryOrderService
|
||||
{
|
||||
/**
|
||||
* 查询配送单据主
|
||||
*
|
||||
* @param id 配送单据主主键
|
||||
* @return 配送单据主
|
||||
*/
|
||||
public DeliveryOrder selectDeliveryOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 查询配送单据主列表
|
||||
*
|
||||
* @param deliveryOrder 配送单据主
|
||||
* @return 配送单据主集合
|
||||
*/
|
||||
public List<DeliveryOrder> selectDeliveryOrderList(DeliveryOrder deliveryOrder);
|
||||
|
||||
/**
|
||||
* 新增配送单据主
|
||||
*
|
||||
* @param deliveryOrder 配送单据主
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDeliveryOrder(DeliveryOrder deliveryOrder);
|
||||
|
||||
/**
|
||||
* 修改配送单据主
|
||||
*
|
||||
* @param deliveryOrder 配送单据主
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDeliveryOrder(DeliveryOrder deliveryOrder);
|
||||
|
||||
/**
|
||||
* 批量删除配送单据主
|
||||
*
|
||||
* @param ids 需要删除的配送单据主主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeliveryOrderByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除配送单据主信息
|
||||
*
|
||||
* @param id 配送单据主主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDeliveryOrderById(Long id);
|
||||
|
||||
/**
|
||||
* 保存配送单据,并保存附件
|
||||
*
|
||||
* @param dto
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
int saveOrderWithAttachments(DeliveryOrderSaveDTO dto, String username);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.delivery.project.document.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.delivery.project.document.domain.RkInfo;
|
||||
import com.delivery.project.document.domain.dto.RkInfoQueryDTO;
|
||||
|
||||
/**
|
||||
* 库存单据明细Service接口
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
public interface IRkInfoService
|
||||
{
|
||||
/**
|
||||
* 查询库存单据明细
|
||||
*
|
||||
* @param id 库存单据明细主键
|
||||
* @return 库存单据明细
|
||||
*/
|
||||
public RkInfo selectRkInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询库存单据明细列表
|
||||
*
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 库存单据明细集合
|
||||
*/
|
||||
public List<RkInfo> selectRkInfoList(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 新增库存单据明细
|
||||
*
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRkInfo(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 修改库存单据明细
|
||||
*
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRkInfo(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 批量删除库存单据明细
|
||||
*
|
||||
* @param ids 需要删除的库存单据明细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除库存单据明细信息
|
||||
*
|
||||
* @param id 库存单据明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 按 bill_no 分组返回单据列表(复用 selectRkInfoVo,SQL 外层分组聚合)
|
||||
* @param query 与 /list 相同的查询条件
|
||||
*/
|
||||
List<RkInfo> selectGroupedByBill(RkInfo rkInfo);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.delivery.project.document.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.delivery.common.exception.ServiceException;
|
||||
import com.delivery.common.utils.DateUtils;
|
||||
import com.delivery.common.utils.MinioUtil;
|
||||
import com.delivery.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.delivery.project.document.mapper.DeliveryAttachmentMapper;
|
||||
import com.delivery.project.document.domain.DeliveryAttachment;
|
||||
import com.delivery.project.document.service.IDeliveryAttachmentService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 配送附件Service业务层处理
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class DeliveryAttachmentServiceImpl implements IDeliveryAttachmentService
|
||||
{
|
||||
@Autowired
|
||||
private DeliveryAttachmentMapper deliveryAttachmentMapper;
|
||||
|
||||
/**
|
||||
* 查询配送附件
|
||||
*
|
||||
* @param id 配送附件主键
|
||||
* @return 配送附件
|
||||
*/
|
||||
@Override
|
||||
public DeliveryAttachment selectDeliveryAttachmentById(Long id)
|
||||
{
|
||||
return deliveryAttachmentMapper.selectDeliveryAttachmentById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配送附件列表
|
||||
*
|
||||
* @param deliveryAttachment 配送附件
|
||||
* @return 配送附件
|
||||
*/
|
||||
@Override
|
||||
public List<DeliveryAttachment> selectDeliveryAttachmentList(DeliveryAttachment deliveryAttachment)
|
||||
{
|
||||
return deliveryAttachmentMapper.selectDeliveryAttachmentList(deliveryAttachment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配送附件
|
||||
*
|
||||
* @param deliveryAttachment 配送附件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDeliveryAttachment(DeliveryAttachment deliveryAttachment)
|
||||
{
|
||||
deliveryAttachment.setCreateTime(DateUtils.getNowDate());
|
||||
return deliveryAttachmentMapper.insertDeliveryAttachment(deliveryAttachment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配送附件
|
||||
*
|
||||
* @param deliveryAttachment 配送附件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDeliveryAttachment(DeliveryAttachment deliveryAttachment)
|
||||
{
|
||||
deliveryAttachment.setUpdateTime(DateUtils.getNowDate());
|
||||
return deliveryAttachmentMapper.updateDeliveryAttachment(deliveryAttachment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除配送附件
|
||||
*
|
||||
* @param ids 需要删除的配送附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDeliveryAttachmentByIds(Long[] ids)
|
||||
{
|
||||
return deliveryAttachmentMapper.deleteDeliveryAttachmentByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配送附件信息
|
||||
*
|
||||
* @param id 配送附件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDeliveryAttachmentById(Long id)
|
||||
{
|
||||
return deliveryAttachmentMapper.deleteDeliveryAttachmentById(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.delivery.project.document.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.delivery.common.exception.ServiceException;
|
||||
import com.delivery.common.utils.DateUtils;
|
||||
import com.delivery.project.document.domain.DeliveryAttachment;
|
||||
import com.delivery.project.document.domain.dto.DeliveryAttachUploadDTO;
|
||||
import com.delivery.project.document.domain.dto.DeliveryOrderSaveDTO;
|
||||
import com.delivery.project.document.mapper.DeliveryAttachmentMapper;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.delivery.project.document.mapper.DeliveryOrderMapper;
|
||||
import com.delivery.project.document.domain.DeliveryOrder;
|
||||
import com.delivery.project.document.service.IDeliveryOrderService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 配送单据主Service业务层处理
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class DeliveryOrderServiceImpl implements IDeliveryOrderService
|
||||
{
|
||||
@Autowired
|
||||
private DeliveryOrderMapper deliveryOrderMapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
private DeliveryAttachmentMapper deliveryAttachmentMapper;
|
||||
|
||||
/**
|
||||
* 查询配送单据主
|
||||
*
|
||||
* @param id 配送单据主主键
|
||||
* @return 配送单据主
|
||||
*/
|
||||
@Override
|
||||
public DeliveryOrder selectDeliveryOrderById(Long id)
|
||||
{
|
||||
return deliveryOrderMapper.selectDeliveryOrderById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配送单据主列表
|
||||
*
|
||||
* @param deliveryOrder 配送单据主
|
||||
* @return 配送单据主
|
||||
*/
|
||||
@Override
|
||||
public List<DeliveryOrder> selectDeliveryOrderList(DeliveryOrder deliveryOrder)
|
||||
{
|
||||
return deliveryOrderMapper.selectDeliveryOrderList(deliveryOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配送单据主
|
||||
*
|
||||
* @param deliveryOrder 配送单据主
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDeliveryOrder(DeliveryOrder deliveryOrder)
|
||||
{
|
||||
deliveryOrder.setCreateTime(DateUtils.getNowDate());
|
||||
return deliveryOrderMapper.insertDeliveryOrder(deliveryOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配送单据主
|
||||
*
|
||||
* @param deliveryOrder 配送单据主
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDeliveryOrder(DeliveryOrder deliveryOrder)
|
||||
{
|
||||
deliveryOrder.setUpdateTime(DateUtils.getNowDate());
|
||||
return deliveryOrderMapper.updateDeliveryOrder(deliveryOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除配送单据主
|
||||
*
|
||||
* @param ids 需要删除的配送单据主主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDeliveryOrderByIds(Long[] ids)
|
||||
{
|
||||
return deliveryOrderMapper.deleteDeliveryOrderByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配送单据主信息
|
||||
*
|
||||
* @param id 配送单据主主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDeliveryOrderById(Long id)
|
||||
{
|
||||
return deliveryOrderMapper.deleteDeliveryOrderById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int saveOrderWithAttachments(DeliveryOrderSaveDTO dto, String operator) {
|
||||
// 1. 保存主单
|
||||
DeliveryOrder order = new DeliveryOrder();
|
||||
BeanUtils.copyProperties(dto, order);
|
||||
order.setIsDelete("0");
|
||||
order.setCreateBy(operator);
|
||||
order.setCreateTime(DateUtils.getNowDate());
|
||||
deliveryOrderMapper.insertDeliveryOrder(order);
|
||||
|
||||
Long orderId = order.getId();
|
||||
int affected = 1;
|
||||
|
||||
// 2. 保存附件
|
||||
if (dto.getAttachments() != null && !dto.getAttachments().isEmpty()) {
|
||||
Date now = DateUtils.getNowDate();
|
||||
for (DeliveryAttachUploadDTO item : dto.getAttachments()) {
|
||||
|
||||
if (item.getUrl() == null || item.getUrl().trim().isEmpty()) {
|
||||
throw new ServiceException("附件URL不能为空,请检查上传结果!");
|
||||
}
|
||||
|
||||
DeliveryAttachment att = new DeliveryAttachment();
|
||||
att.setOrderId(orderId);
|
||||
att.setScene(item.getScene());
|
||||
att.setBizType(item.getBizType());
|
||||
att.setUrl(item.getUrl());
|
||||
att.setStatus("1"); // 已绑定
|
||||
att.setSortNo(item.getSortNo());
|
||||
att.setRemark(item.getRemark());
|
||||
att.setIsDelete("0");
|
||||
att.setCreateBy(operator);
|
||||
att.setCreateTime(now);
|
||||
att.setUpdateBy(operator);
|
||||
att.setUpdateTime(now);
|
||||
deliveryAttachmentMapper.insertDeliveryAttachment(att);
|
||||
affected++;
|
||||
}
|
||||
}
|
||||
|
||||
return affected;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.delivery.project.document.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.delivery.common.utils.DateUtils;
|
||||
import com.delivery.project.document.domain.dto.RkInfoQueryDTO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.delivery.project.document.mapper.RkInfoMapper;
|
||||
import com.delivery.project.document.domain.RkInfo;
|
||||
import com.delivery.project.document.service.IRkInfoService;
|
||||
|
||||
/**
|
||||
* 库存单据明细Service业务层处理
|
||||
*
|
||||
* @author delivery
|
||||
* @date 2025-10-14
|
||||
*/
|
||||
@Service
|
||||
public class RkInfoServiceImpl implements IRkInfoService
|
||||
{
|
||||
@Autowired
|
||||
private RkInfoMapper rkInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询库存单据明细
|
||||
*
|
||||
* @param id 库存单据明细主键
|
||||
* @return 库存单据明细
|
||||
*/
|
||||
@Override
|
||||
public RkInfo selectRkInfoById(Long id)
|
||||
{
|
||||
return rkInfoMapper.selectRkInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询库存单据明细列表
|
||||
*
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 库存单据明细
|
||||
*/
|
||||
@Override
|
||||
public List<RkInfo> selectRkInfoList(RkInfo rkInfo)
|
||||
{
|
||||
return rkInfoMapper.selectRkInfoList(rkInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库存单据明细
|
||||
*
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRkInfo(RkInfo rkInfo)
|
||||
{
|
||||
rkInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return rkInfoMapper.insertRkInfo(rkInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存单据明细
|
||||
*
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRkInfo(RkInfo rkInfo)
|
||||
{
|
||||
rkInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return rkInfoMapper.updateRkInfo(rkInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除库存单据明细
|
||||
*
|
||||
* @param ids 需要删除的库存单据明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRkInfoByIds(Long[] ids)
|
||||
{
|
||||
return rkInfoMapper.deleteRkInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库存单据明细信息
|
||||
*
|
||||
* @param id 库存单据明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRkInfoById(Long id)
|
||||
{
|
||||
return rkInfoMapper.deleteRkInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RkInfo> selectGroupedByBill(RkInfo rkInfo) {
|
||||
return rkInfoMapper.selectGroupedByBill(rkInfo);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user