配送单据接口开发
配送单据附件接口开发
This commit is contained in:
13
pom.xml
13
pom.xml
@@ -39,6 +39,7 @@
|
||||
<logback.version>1.2.13</logback.version>
|
||||
<spring-security.version>5.7.14</spring-security.version>
|
||||
<spring-framework.version>5.3.39</spring-framework.version>
|
||||
<minio.version>7.1.4</minio.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -200,6 +201,13 @@
|
||||
<version>${poi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--MinIo-->
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>${minio.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- velocity代码生成使用模板 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
@@ -231,6 +239,11 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.38</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,8 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://192.168.1.28:3306/delivery?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
# url: jdbc:mysql://192.168.1.28:3306/delivery?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://192.168.1.28:3306/delivery?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://192.168.1.28:3306/delivery?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: shzg
|
||||
# 从库数据源
|
||||
|
||||
@@ -15,7 +15,7 @@ delivery:
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
port: 8080
|
||||
port: 8087
|
||||
servlet:
|
||||
context-path: /
|
||||
tomcat:
|
||||
@@ -49,7 +49,7 @@ spring:
|
||||
max-request-size: 20MB
|
||||
devtools:
|
||||
restart:
|
||||
enabled: true
|
||||
enabled: false
|
||||
redis:
|
||||
host: 192.168.1.28
|
||||
port: 6379
|
||||
@@ -107,3 +107,10 @@ gen:
|
||||
autoRemovePre: false
|
||||
tablePrefix: sys_
|
||||
allowOverwrite: false
|
||||
|
||||
minio:
|
||||
endpoint: http://192.168.1.28:9000
|
||||
accessKey: admin
|
||||
secretKey: admin123
|
||||
bucketName: delivery
|
||||
public-read: true
|
||||
106
src/main/resources/mybatis/document/DeliveryAttachmentMapper.xml
Normal file
106
src/main/resources/mybatis/document/DeliveryAttachmentMapper.xml
Normal file
@@ -0,0 +1,106 @@
|
||||
<?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.delivery.project.document.mapper.DeliveryAttachmentMapper">
|
||||
|
||||
<resultMap type="DeliveryAttachment" id="DeliveryAttachmentResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="scene" column="scene" />
|
||||
<result property="bizType" column="biz_type" />
|
||||
<result property="url" column="url" />
|
||||
<result property="status" column="status" />
|
||||
<result property="sortNo" column="sort_no" />
|
||||
<result property="remark" column="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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeliveryAttachmentVo">
|
||||
select id, order_id, scene, biz_type, url, status, sort_no, remark, create_by, create_time, update_by, update_time, is_delete from delivery_attachment
|
||||
</sql>
|
||||
|
||||
<select id="selectDeliveryAttachmentList" parameterType="DeliveryAttachment" resultMap="DeliveryAttachmentResult">
|
||||
<include refid="selectDeliveryAttachmentVo"/>
|
||||
<where>
|
||||
<if test="orderId != null "> and order_id = #{orderId}</if>
|
||||
<if test="scene != null and scene != ''"> and scene = #{scene}</if>
|
||||
<if test="bizType != null and bizType != ''"> and biz_type = #{bizType}</if>
|
||||
<if test="url != null and url != ''"> and url = #{url}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="sortNo != null "> and sort_no = #{sortNo}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDeliveryAttachmentById" parameterType="Long" resultMap="DeliveryAttachmentResult">
|
||||
<include refid="selectDeliveryAttachmentVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDeliveryAttachment" parameterType="DeliveryAttachment" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into delivery_attachment
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="scene != null">scene,</if>
|
||||
<if test="bizType != null">biz_type,</if>
|
||||
<if test="url != null">url,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="sortNo != null">sort_no,</if>
|
||||
<if test="remark != null">remark,</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 prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
<if test="scene != null">#{scene},</if>
|
||||
<if test="bizType != null">#{bizType},</if>
|
||||
<if test="url != null">#{url},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="sortNo != null">#{sortNo},</if>
|
||||
<if test="remark != null">#{remark},</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>
|
||||
</insert>
|
||||
|
||||
<update id="updateDeliveryAttachment" parameterType="DeliveryAttachment">
|
||||
update delivery_attachment
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="orderId != null">order_id = #{orderId},</if>
|
||||
<if test="scene != null">scene = #{scene},</if>
|
||||
<if test="bizType != null">biz_type = #{bizType},</if>
|
||||
<if test="url != null">url = #{url},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="sortNo != null">sort_no = #{sortNo},</if>
|
||||
<if test="remark != null">remark = #{remark},</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>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeliveryAttachmentById" parameterType="Long">
|
||||
delete from delivery_attachment where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDeliveryAttachmentByIds" parameterType="String">
|
||||
delete from delivery_attachment where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
186
src/main/resources/mybatis/document/DeliveryOrderMapper.xml
Normal file
186
src/main/resources/mybatis/document/DeliveryOrderMapper.xml
Normal file
@@ -0,0 +1,186 @@
|
||||
<?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.delivery.project.document.mapper.DeliveryOrderMapper">
|
||||
|
||||
<resultMap type="DeliveryOrder" id="DeliveryOrderResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="xmMs" column="xm_ms" />
|
||||
<result property="xmNo" column="xm_no" />
|
||||
<result property="wlNo" column="wl_no" />
|
||||
<result property="wlMs" column="wl_ms" />
|
||||
<result property="realQty" column="real_qty" />
|
||||
<result property="dw" column="dw" />
|
||||
<result property="sapNo" column="sap_no" />
|
||||
<result property="gysMc" column="gys_mc" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="originName" column="origin_name" />
|
||||
<result property="originLng" column="origin_lng" />
|
||||
<result property="originLat" column="origin_lat" />
|
||||
<result property="destName" column="dest_name" />
|
||||
<result property="destLng" column="dest_lng" />
|
||||
<result property="destLat" column="dest_lat" />
|
||||
<result property="deliveryDate" column="delivery_date" />
|
||||
<result property="vehiclePlate" column="vehicle_plate" />
|
||||
<result property="shipperName" column="shipper_name" />
|
||||
<result property="shipperPhone" column="shipper_phone" />
|
||||
<result property="receiverName" column="receiver_name" />
|
||||
<result property="receiverPhone" column="receiver_phone" />
|
||||
<result property="receiverOrgName" column="receiver_org_name" />
|
||||
<result property="deliveryTon" column="delivery_ton" />
|
||||
<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="selectDeliveryOrderVo">
|
||||
select id, xm_ms, xm_no, wl_no, wl_ms, real_qty, dw, sap_no, gys_mc, remark, origin_name, origin_lng, origin_lat, dest_name, dest_lng, dest_lat, delivery_date, vehicle_plate, shipper_name, shipper_phone, receiver_name, receiver_phone, receiver_org_name, delivery_ton, create_by, create_time, update_by, update_time, is_delete from delivery_order
|
||||
</sql>
|
||||
|
||||
<select id="selectDeliveryOrderList" parameterType="DeliveryOrder" resultMap="DeliveryOrderResult">
|
||||
<include refid="selectDeliveryOrderVo"/>
|
||||
<where>
|
||||
<if test="xmMs != null and xmMs != ''"> and xm_ms = #{xmMs}</if>
|
||||
<if test="xmNo != null and xmNo != ''"> and xm_no = #{xmNo}</if>
|
||||
<if test="wlNo != null and wlNo != ''"> and wl_no = #{wlNo}</if>
|
||||
<if test="wlMs != null and wlMs != ''"> and wl_ms = #{wlMs}</if>
|
||||
<if test="realQty != null "> and real_qty = #{realQty}</if>
|
||||
<if test="dw != null and dw != ''"> and dw = #{dw}</if>
|
||||
<if test="sapNo != null and sapNo != ''"> and sap_no = #{sapNo}</if>
|
||||
<if test="gysMc != null and gysMc != ''"> and gys_mc = #{gysMc}</if>
|
||||
<if test="originName != null and originName != ''"> and origin_name like concat('%', #{originName}, '%')</if>
|
||||
<if test="originLng != null "> and origin_lng = #{originLng}</if>
|
||||
<if test="originLat != null "> and origin_lat = #{originLat}</if>
|
||||
<if test="destName != null and destName != ''"> and dest_name like concat('%', #{destName}, '%')</if>
|
||||
<if test="destLng != null "> and dest_lng = #{destLng}</if>
|
||||
<if test="destLat != null "> and dest_lat = #{destLat}</if>
|
||||
<if test="deliveryDate != null "> and delivery_date = #{deliveryDate}</if>
|
||||
<if test="vehiclePlate != null and vehiclePlate != ''"> and vehicle_plate = #{vehiclePlate}</if>
|
||||
<if test="shipperName != null and shipperName != ''"> and shipper_name like concat('%', #{shipperName}, '%')</if>
|
||||
<if test="shipperPhone != null and shipperPhone != ''"> and shipper_phone = #{shipperPhone}</if>
|
||||
<if test="receiverName != null and receiverName != ''"> and receiver_name like concat('%', #{receiverName}, '%')</if>
|
||||
<if test="receiverPhone != null and receiverPhone != ''"> and receiver_phone = #{receiverPhone}</if>
|
||||
<if test="receiverOrgName != null and receiverOrgName != ''"> and receiver_org_name like concat('%', #{receiverOrgName}, '%')</if>
|
||||
<if test="deliveryTon != null "> and delivery_ton = #{deliveryTon}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDeliveryOrderById" parameterType="Long" resultMap="DeliveryOrderResult">
|
||||
<include refid="selectDeliveryOrderVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDeliveryOrder" parameterType="DeliveryOrder" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into delivery_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="xmMs != null">xm_ms,</if>
|
||||
<if test="xmNo != null">xm_no,</if>
|
||||
<if test="wlNo != null">wl_no,</if>
|
||||
<if test="wlMs != null">wl_ms,</if>
|
||||
<if test="realQty != null">real_qty,</if>
|
||||
<if test="dw != null">dw,</if>
|
||||
<if test="sapNo != null">sap_no,</if>
|
||||
<if test="gysMc != null">gys_mc,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="originName != null">origin_name,</if>
|
||||
<if test="originLng != null">origin_lng,</if>
|
||||
<if test="originLat != null">origin_lat,</if>
|
||||
<if test="destName != null">dest_name,</if>
|
||||
<if test="destLng != null">dest_lng,</if>
|
||||
<if test="destLat != null">dest_lat,</if>
|
||||
<if test="deliveryDate != null">delivery_date,</if>
|
||||
<if test="vehiclePlate != null">vehicle_plate,</if>
|
||||
<if test="shipperName != null">shipper_name,</if>
|
||||
<if test="shipperPhone != null">shipper_phone,</if>
|
||||
<if test="receiverName != null">receiver_name,</if>
|
||||
<if test="receiverPhone != null">receiver_phone,</if>
|
||||
<if test="receiverOrgName != null">receiver_org_name,</if>
|
||||
<if test="deliveryTon != null">delivery_ton,</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 prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="xmMs != null">#{xmMs},</if>
|
||||
<if test="xmNo != null">#{xmNo},</if>
|
||||
<if test="wlNo != null">#{wlNo},</if>
|
||||
<if test="wlMs != null">#{wlMs},</if>
|
||||
<if test="realQty != null">#{realQty},</if>
|
||||
<if test="dw != null">#{dw},</if>
|
||||
<if test="sapNo != null">#{sapNo},</if>
|
||||
<if test="gysMc != null">#{gysMc},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="originName != null">#{originName},</if>
|
||||
<if test="originLng != null">#{originLng},</if>
|
||||
<if test="originLat != null">#{originLat},</if>
|
||||
<if test="destName != null">#{destName},</if>
|
||||
<if test="destLng != null">#{destLng},</if>
|
||||
<if test="destLat != null">#{destLat},</if>
|
||||
<if test="deliveryDate != null">#{deliveryDate},</if>
|
||||
<if test="vehiclePlate != null">#{vehiclePlate},</if>
|
||||
<if test="shipperName != null">#{shipperName},</if>
|
||||
<if test="shipperPhone != null">#{shipperPhone},</if>
|
||||
<if test="receiverName != null">#{receiverName},</if>
|
||||
<if test="receiverPhone != null">#{receiverPhone},</if>
|
||||
<if test="receiverOrgName != null">#{receiverOrgName},</if>
|
||||
<if test="deliveryTon != null">#{deliveryTon},</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>
|
||||
</insert>
|
||||
|
||||
<update id="updateDeliveryOrder" parameterType="DeliveryOrder">
|
||||
update delivery_order
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="xmMs != null">xm_ms = #{xmMs},</if>
|
||||
<if test="xmNo != null">xm_no = #{xmNo},</if>
|
||||
<if test="wlNo != null">wl_no = #{wlNo},</if>
|
||||
<if test="wlMs != null">wl_ms = #{wlMs},</if>
|
||||
<if test="realQty != null">real_qty = #{realQty},</if>
|
||||
<if test="dw != null">dw = #{dw},</if>
|
||||
<if test="sapNo != null">sap_no = #{sapNo},</if>
|
||||
<if test="gysMc != null">gys_mc = #{gysMc},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="originName != null">origin_name = #{originName},</if>
|
||||
<if test="originLng != null">origin_lng = #{originLng},</if>
|
||||
<if test="originLat != null">origin_lat = #{originLat},</if>
|
||||
<if test="destName != null">dest_name = #{destName},</if>
|
||||
<if test="destLng != null">dest_lng = #{destLng},</if>
|
||||
<if test="destLat != null">dest_lat = #{destLat},</if>
|
||||
<if test="deliveryDate != null">delivery_date = #{deliveryDate},</if>
|
||||
<if test="vehiclePlate != null">vehicle_plate = #{vehiclePlate},</if>
|
||||
<if test="shipperName != null">shipper_name = #{shipperName},</if>
|
||||
<if test="shipperPhone != null">shipper_phone = #{shipperPhone},</if>
|
||||
<if test="receiverName != null">receiver_name = #{receiverName},</if>
|
||||
<if test="receiverPhone != null">receiver_phone = #{receiverPhone},</if>
|
||||
<if test="receiverOrgName != null">receiver_org_name = #{receiverOrgName},</if>
|
||||
<if test="deliveryTon != null">delivery_ton = #{deliveryTon},</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>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeliveryOrderById" parameterType="Long">
|
||||
delete from delivery_order where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDeliveryOrderByIds" parameterType="String">
|
||||
delete from delivery_order where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
453
src/main/resources/mybatis/document/RkInfoMapper.xml
Normal file
453
src/main/resources/mybatis/document/RkInfoMapper.xml
Normal file
@@ -0,0 +1,453 @@
|
||||
<?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.delivery.project.document.mapper.RkInfoMapper">
|
||||
|
||||
<resultMap type="RkInfo" id="RkInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="rkType" column="rk_type" />
|
||||
<result property="wlType" column="wl_type" />
|
||||
<result property="cangku" column="cangku" />
|
||||
<result property="rkTime" column="rk_time" />
|
||||
<result property="lihuoY" column="lihuo_y" />
|
||||
<result property="isChuku" column="is_chuku" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="billNo" column="bill_no" />
|
||||
<result property="isDelivery" column="is_delivery" />
|
||||
<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" />
|
||||
<result property="gysMc" column="gys_mc" />
|
||||
<result property="jhAmt" column="jh_amt" />
|
||||
<result property="htDj" column="ht_dj" />
|
||||
<result property="sapNo" column="sap_no" />
|
||||
<result property="xh" column="xh" />
|
||||
<result property="jhQty" column="jh_qty" />
|
||||
<result property="htQty" column="ht_qty" />
|
||||
<result property="dw" column="dw" />
|
||||
<result property="realQty" column="real_qty" />
|
||||
<result property="pcode" column="pcode" />
|
||||
<result property="pcodeId" column="pcode_id" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
<result property="entityId" column="entity_id" />
|
||||
<result property="ckLihuoY" column="ck_lihuo_y" />
|
||||
<result property="teamCode" column="team_code" />
|
||||
<result property="ckType" column="ck_type" />
|
||||
<result property="ckRemark" column="ck_remark" />
|
||||
<result property="lyTime" column="ly_time" />
|
||||
<result property="billNoCk" column="bill_no_ck" />
|
||||
<result property="borrowTime" column="borrow_time" />
|
||||
<result property="returnTime" column="return_time" />
|
||||
<result property="hasMoved" column="has_moved" />
|
||||
<result property="isBorrowed" column="is_borrowed" />
|
||||
<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="gysJhId" column="gys_jh_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRkInfoVo">
|
||||
select id, rk_type, wl_type, cangku, rk_time, lihuo_y, is_chuku, status, remark, bill_no, is_delivery, xj, xm_no, xm_ms, xm_no_ck, xm_ms_ck, wl_no, wl_ms, 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, team_code, ck_type, ck_remark, ly_time, bill_no_ck, borrow_time, return_time, has_moved, is_borrowed, create_by, create_time, update_by, update_time, is_delete, gys_jh_id from rk_info
|
||||
</sql>
|
||||
|
||||
<select id="selectRkInfoList" parameterType="RkInfo" resultMap="RkInfoResult">
|
||||
<include refid="selectRkInfoVo"/>
|
||||
<where>
|
||||
<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="lihuoY != null and lihuoY != ''"> and lihuo_y = #{lihuoY}</if>
|
||||
<if test="isChuku != null and isChuku != ''"> and is_chuku = #{isChuku}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
|
||||
<if test="isDelivery != null and isDelivery != ''"> and is_delivery = #{isDelivery}</if>
|
||||
<if test="xj != null and xj != ''"> and xj = #{xj}</if>
|
||||
<if test="xmNo != null and xmNo != ''"> and xm_no = #{xmNo}</if>
|
||||
<if test="xmMs != null and xmMs != ''"> and xm_ms = #{xmMs}</if>
|
||||
<if test="xmNoCk != null and xmNoCk != ''"> and xm_no_ck = #{xmNoCk}</if>
|
||||
<if test="xmMsCk != null and xmMsCk != ''"> and xm_ms_ck = #{xmMsCk}</if>
|
||||
<if test="wlNo != null and wlNo != ''"> and wl_no = #{wlNo}</if>
|
||||
<if test="wlMs != null and wlMs != ''"> and wl_ms = #{wlMs}</if>
|
||||
<if test="gysNo != null and gysNo != ''"> and gys_no = #{gysNo}</if>
|
||||
<if test="gysMc != null and gysMc != ''"> and gys_mc = #{gysMc}</if>
|
||||
<if test="jhAmt != null "> and jh_amt = #{jhAmt}</if>
|
||||
<if test="htDj != null "> and ht_dj = #{htDj}</if>
|
||||
<if test="sapNo != null and sapNo != ''"> and sap_no = #{sapNo}</if>
|
||||
<if test="xh != null and xh != ''"> and xh = #{xh}</if>
|
||||
<if test="jhQty != null "> and jh_qty = #{jhQty}</if>
|
||||
<if test="htQty != null "> and ht_qty = #{htQty}</if>
|
||||
<if test="dw != null and dw != ''"> and dw = #{dw}</if>
|
||||
<if test="realQty != null "> and real_qty = #{realQty}</if>
|
||||
<if test="pcode != null and pcode != ''"> and pcode = #{pcode}</if>
|
||||
<if test="pcodeId != null and pcodeId != ''"> and pcode_id = #{pcodeId}</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="ckLihuoY != null and ckLihuoY != ''"> and ck_lihuo_y = #{ckLihuoY}</if>
|
||||
<if test="teamCode != null and teamCode != ''"> and team_code = #{teamCode}</if>
|
||||
<if test="ckType != null and ckType != ''"> and ck_type = #{ckType}</if>
|
||||
<if test="ckRemark != null and ckRemark != ''"> and ck_remark = #{ckRemark}</if>
|
||||
<if test="lyTime != null "> and ly_time = #{lyTime}</if>
|
||||
<if test="billNoCk != null and billNoCk != ''"> and bill_no_ck = #{billNoCk}</if>
|
||||
<if test="borrowTime != null "> and borrow_time = #{borrowTime}</if>
|
||||
<if test="returnTime != null "> and return_time = #{returnTime}</if>
|
||||
<if test="hasMoved != null and hasMoved != ''"> and has_moved = #{hasMoved}</if>
|
||||
<if test="isBorrowed != null and isBorrowed != ''"> and is_borrowed = #{isBorrowed}</if>
|
||||
<if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
|
||||
<if test="gysJhId != null "> and gys_jh_id = #{gysJhId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRkInfoById" parameterType="Long" resultMap="RkInfoResult">
|
||||
<include refid="selectRkInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--
|
||||
按单据分组(bill_no)列表
|
||||
复用 <sql id="selectRkInfoVo"> 作为子查询,外层分组聚合
|
||||
返回字段:bill_no、bill_no_ck + 你指定的通用字段(rk_type、wl_type、cangku、rk_time、lihuo_y、is_chuku、xj、
|
||||
xm_no、xm_ms、xm_no_ck、xm_ms_ck、wl_no、wl_ms、gys_no、sap_no)
|
||||
-->
|
||||
<!-- RkInfoMapper.xml -->
|
||||
<select id="selectGroupedByBill" resultMap="RkInfoResult">
|
||||
SELECT
|
||||
a.id,
|
||||
a.bill_no,
|
||||
a.bill_no_ck,
|
||||
a.rk_type,
|
||||
si.type_name AS rk_type_name,
|
||||
a.wl_type,
|
||||
a.cangku,
|
||||
a.rk_time,
|
||||
a.lihuo_y,
|
||||
a.is_chuku,
|
||||
a.xj,
|
||||
a.xm_no,
|
||||
a.xm_ms,
|
||||
a.xm_no_ck,
|
||||
a.xm_ms_ck,
|
||||
a.gys_mc,
|
||||
a.wl_no,
|
||||
a.wl_ms,
|
||||
a.gys_no,
|
||||
a.sap_no,
|
||||
a.ck_type,
|
||||
so.type_name AS ck_type_name,
|
||||
a.ly_time,
|
||||
a.ck_lihuo_y,
|
||||
u.user_name AS ck_lihuo_y_name
|
||||
FROM (
|
||||
SELECT
|
||||
MIN(t.id) AS id,
|
||||
t.bill_no AS bill_no,
|
||||
MIN(t.bill_no_ck) AS bill_no_ck,
|
||||
MIN(t.rk_type) AS rk_type,
|
||||
MIN(t.wl_type) AS wl_type,
|
||||
MIN(t.cangku) AS cangku,
|
||||
MIN(t.rk_time) AS rk_time,
|
||||
MIN(t.lihuo_y) AS lihuo_y,
|
||||
MAX(t.is_chuku) AS is_chuku,
|
||||
MIN(t.xj) AS xj,
|
||||
MIN(t.xm_no) AS xm_no,
|
||||
MIN(t.xm_ms) AS xm_ms,
|
||||
MIN(t.xm_no_ck) AS xm_no_ck,
|
||||
MIN(t.xm_ms_ck) AS xm_ms_ck,
|
||||
MIN(t.gys_mc) AS gys_mc,
|
||||
MIN(t.wl_no) AS wl_no,
|
||||
MIN(t.wl_ms) AS wl_ms,
|
||||
MIN(t.gys_no) AS gys_no,
|
||||
MIN(t.sap_no) AS sap_no,
|
||||
MIN(t.ck_type) AS ck_type,
|
||||
MAX(t.ly_time) AS ly_time,
|
||||
MIN(t.ck_lihuo_y) AS ck_lihuo_y
|
||||
FROM (
|
||||
<include refid="selectRkInfoVo"/>
|
||||
) t
|
||||
<where>
|
||||
<!-- 仅用 RkInfo 里真实存在的字段做筛选 -->
|
||||
|
||||
<!-- is_chuku:单值 -->
|
||||
<if test="q.isChuku != null and q.isChuku != ''">
|
||||
AND t.is_chuku = #{q.isChuku}
|
||||
</if>
|
||||
|
||||
<!-- 维度筛选 -->
|
||||
<if test="q.rkType != null and q.rkType != ''">
|
||||
AND t.rk_type LIKE concat('%', #{q.rkType}, '%')
|
||||
</if>
|
||||
<if test="q.wlType != null and q.wlType != ''">
|
||||
AND t.wl_type LIKE concat('%', #{q.wlType}, '%')
|
||||
</if>
|
||||
<if test="q.cangku != null and q.cangku != ''">
|
||||
AND t.cangku LIKE concat('%', #{q.cangku}, '%')
|
||||
</if>
|
||||
|
||||
<!-- 其它等值/模糊 -->
|
||||
<if test="q.lihuoY != null and q.lihuoY != ''">
|
||||
AND t.lihuo_y LIKE concat('%', #{q.lihuoY}, '%')
|
||||
</if>
|
||||
<if test="q.xj != null and q.xj != ''">
|
||||
AND t.xj LIKE concat('%', #{q.xj}, '%')
|
||||
</if>
|
||||
<if test="q.billNo != null and q.billNo != ''">
|
||||
AND t.bill_no LIKE concat('%', #{q.billNo}, '%')
|
||||
</if>
|
||||
<if test="q.billNoCk != null and q.billNoCk != ''">
|
||||
AND t.bill_no_ck LIKE concat('%', #{q.billNoCk}, '%')
|
||||
</if>
|
||||
<if test="q.xmNo != null and q.xmNo != ''">
|
||||
AND t.xm_no LIKE concat('%', #{q.xmNo}, '%')
|
||||
</if>
|
||||
<if test="q.xmMs != null and q.xmMs != ''">
|
||||
AND t.xm_ms LIKE concat('%', #{q.xmMs}, '%')
|
||||
</if>
|
||||
<if test="q.wlNo != null and q.wlNo != ''">
|
||||
AND t.wl_no LIKE concat('%', #{q.wlNo}, '%')
|
||||
</if>
|
||||
<if test="q.wlMs != null and q.wlMs != ''">
|
||||
AND t.wl_ms LIKE concat('%', #{q.wlMs}, '%')
|
||||
</if>
|
||||
<if test="q.gysNo != null and q.gysNo != ''">
|
||||
AND t.gys_no LIKE concat('%', #{q.gysNo}, '%')
|
||||
</if>
|
||||
<if test="q.gysMc != null and q.gysMc != ''">
|
||||
AND t.gys_mc LIKE concat('%', #{q.gysMc}, '%')
|
||||
</if>
|
||||
|
||||
<if test="q.jhAmt != null"> AND t.jh_amt = #{q.jhAmt} </if>
|
||||
<if test="q.htDj != null"> AND t.ht_dj = #{q.htDj} </if>
|
||||
|
||||
<if test="q.sapNo != null and q.sapNo != ''">
|
||||
AND t.sap_no LIKE concat('%', #{q.sapNo}, '%')
|
||||
</if>
|
||||
<if test="q.xh != null and q.xh != ''">
|
||||
AND t.xh LIKE concat('%', #{q.xh}, '%')
|
||||
</if>
|
||||
<if test="q.jhQty != null"> AND t.jh_qty = #{q.jhQty} </if>
|
||||
<if test="q.htQty != null"> AND t.ht_qty = #{q.htQty} </if>
|
||||
<if test="q.dw != null and q.dw != ''">
|
||||
AND t.dw LIKE concat('%', #{q.dw}, '%')
|
||||
</if>
|
||||
<if test="q.realQty != null"> AND t.real_qty = #{q.realQty} </if>
|
||||
|
||||
<if test="q.pcode != null and q.pcode != ''">
|
||||
AND t.pcode LIKE concat('%', #{q.pcode}, '%')
|
||||
</if>
|
||||
<if test="q.lyTime != null"> AND t.ly_time = #{q.lyTime} </if>
|
||||
<if test="q.returnTime != null"> AND t.return_time = #{q.returnTime} </if>
|
||||
<if test="q.trayCode != null and q.trayCode != ''">
|
||||
AND t.tray_code LIKE concat('%', #{q.trayCode}, '%')
|
||||
</if>
|
||||
<if test="q.entityId != null and q.entityId != ''">
|
||||
AND t.entity_id LIKE concat('%', #{q.entityId}, '%')
|
||||
</if>
|
||||
<if test="q.ckType != null and q.ckType != ''">
|
||||
AND t.ck_type LIKE concat('%', #{q.ckType}, '%')
|
||||
</if>
|
||||
|
||||
<!-- 若查询“已出库”,则要求已有出库单号 -->
|
||||
<if test="q.isChuku != null and q.isChuku == '1'">
|
||||
AND t.bill_no_ck IS NOT NULL
|
||||
</if>
|
||||
|
||||
<!-- 删除标记,默认为 0 -->
|
||||
<choose>
|
||||
<when test="q.isDelete != null and q.isDelete != ''">
|
||||
AND t.is_delete = #{q.isDelete}
|
||||
</when>
|
||||
<otherwise>
|
||||
AND t.is_delete = 0
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
<!-- 只查需要配送 -->
|
||||
<if test="q.isDelivery != null and q.isDelivery != ''">
|
||||
AND t.is_delivery = #{q.isDelivery}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY t.bill_no
|
||||
) a
|
||||
LEFT JOIN stock_in_type si ON a.rk_type = si.type_code
|
||||
LEFT JOIN stock_out_type so ON a.ck_type = so.type_code
|
||||
LEFT JOIN sys_user u ON a.ck_lihuo_y = u.user_id
|
||||
ORDER BY a.rk_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertRkInfo" parameterType="RkInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rk_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="rkType != null">rk_type,</if>
|
||||
<if test="wlType != null">wl_type,</if>
|
||||
<if test="cangku != null">cangku,</if>
|
||||
<if test="rkTime != null">rk_time,</if>
|
||||
<if test="lihuoY != null">lihuo_y,</if>
|
||||
<if test="isChuku != null">is_chuku,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="billNo != null">bill_no,</if>
|
||||
<if test="isDelivery != null">is_delivery,</if>
|
||||
<if test="xj != null">xj,</if>
|
||||
<if test="xmNo != null">xm_no,</if>
|
||||
<if test="xmMs != null">xm_ms,</if>
|
||||
<if test="xmNoCk != null">xm_no_ck,</if>
|
||||
<if test="xmMsCk != null">xm_ms_ck,</if>
|
||||
<if test="wlNo != null">wl_no,</if>
|
||||
<if test="wlMs != null">wl_ms,</if>
|
||||
<if test="gysNo != null">gys_no,</if>
|
||||
<if test="gysMc != null">gys_mc,</if>
|
||||
<if test="jhAmt != null">jh_amt,</if>
|
||||
<if test="htDj != null">ht_dj,</if>
|
||||
<if test="sapNo != null">sap_no,</if>
|
||||
<if test="xh != null">xh,</if>
|
||||
<if test="jhQty != null">jh_qty,</if>
|
||||
<if test="htQty != null">ht_qty,</if>
|
||||
<if test="dw != null">dw,</if>
|
||||
<if test="realQty != null">real_qty,</if>
|
||||
<if test="pcode != null">pcode,</if>
|
||||
<if test="pcodeId != null">pcode_id,</if>
|
||||
<if test="trayCode != null">tray_code,</if>
|
||||
<if test="entityId != null">entity_id,</if>
|
||||
<if test="ckLihuoY != null">ck_lihuo_y,</if>
|
||||
<if test="teamCode != null">team_code,</if>
|
||||
<if test="ckType != null">ck_type,</if>
|
||||
<if test="ckRemark != null">ck_remark,</if>
|
||||
<if test="lyTime != null">ly_time,</if>
|
||||
<if test="billNoCk != null">bill_no_ck,</if>
|
||||
<if test="borrowTime != null">borrow_time,</if>
|
||||
<if test="returnTime != null">return_time,</if>
|
||||
<if test="hasMoved != null">has_moved,</if>
|
||||
<if test="isBorrowed != null">is_borrowed,</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>
|
||||
<if test="gysJhId != null">gys_jh_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="rkType != null">#{rkType},</if>
|
||||
<if test="wlType != null">#{wlType},</if>
|
||||
<if test="cangku != null">#{cangku},</if>
|
||||
<if test="rkTime != null">#{rkTime},</if>
|
||||
<if test="lihuoY != null">#{lihuoY},</if>
|
||||
<if test="isChuku != null">#{isChuku},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="billNo != null">#{billNo},</if>
|
||||
<if test="isDelivery != null">#{isDelivery},</if>
|
||||
<if test="xj != null">#{xj},</if>
|
||||
<if test="xmNo != null">#{xmNo},</if>
|
||||
<if test="xmMs != null">#{xmMs},</if>
|
||||
<if test="xmNoCk != null">#{xmNoCk},</if>
|
||||
<if test="xmMsCk != null">#{xmMsCk},</if>
|
||||
<if test="wlNo != null">#{wlNo},</if>
|
||||
<if test="wlMs != null">#{wlMs},</if>
|
||||
<if test="gysNo != null">#{gysNo},</if>
|
||||
<if test="gysMc != null">#{gysMc},</if>
|
||||
<if test="jhAmt != null">#{jhAmt},</if>
|
||||
<if test="htDj != null">#{htDj},</if>
|
||||
<if test="sapNo != null">#{sapNo},</if>
|
||||
<if test="xh != null">#{xh},</if>
|
||||
<if test="jhQty != null">#{jhQty},</if>
|
||||
<if test="htQty != null">#{htQty},</if>
|
||||
<if test="dw != null">#{dw},</if>
|
||||
<if test="realQty != null">#{realQty},</if>
|
||||
<if test="pcode != null">#{pcode},</if>
|
||||
<if test="pcodeId != null">#{pcodeId},</if>
|
||||
<if test="trayCode != null">#{trayCode},</if>
|
||||
<if test="entityId != null">#{entityId},</if>
|
||||
<if test="ckLihuoY != null">#{ckLihuoY},</if>
|
||||
<if test="teamCode != null">#{teamCode},</if>
|
||||
<if test="ckType != null">#{ckType},</if>
|
||||
<if test="ckRemark != null">#{ckRemark},</if>
|
||||
<if test="lyTime != null">#{lyTime},</if>
|
||||
<if test="billNoCk != null">#{billNoCk},</if>
|
||||
<if test="borrowTime != null">#{borrowTime},</if>
|
||||
<if test="returnTime != null">#{returnTime},</if>
|
||||
<if test="hasMoved != null">#{hasMoved},</if>
|
||||
<if test="isBorrowed != null">#{isBorrowed},</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>
|
||||
<if test="gysJhId != null">#{gysJhId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRkInfo" parameterType="RkInfo">
|
||||
update rk_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="rkType != null">rk_type = #{rkType},</if>
|
||||
<if test="wlType != null">wl_type = #{wlType},</if>
|
||||
<if test="cangku != null">cangku = #{cangku},</if>
|
||||
<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="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="billNo != null">bill_no = #{billNo},</if>
|
||||
<if test="isDelivery != null">is_delivery = #{isDelivery},</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>
|
||||
<if test="gysMc != null">gys_mc = #{gysMc},</if>
|
||||
<if test="jhAmt != null">jh_amt = #{jhAmt},</if>
|
||||
<if test="htDj != null">ht_dj = #{htDj},</if>
|
||||
<if test="sapNo != null">sap_no = #{sapNo},</if>
|
||||
<if test="xh != null">xh = #{xh},</if>
|
||||
<if test="jhQty != null">jh_qty = #{jhQty},</if>
|
||||
<if test="htQty != null">ht_qty = #{htQty},</if>
|
||||
<if test="dw != null">dw = #{dw},</if>
|
||||
<if test="realQty != null">real_qty = #{realQty},</if>
|
||||
<if test="pcode != null">pcode = #{pcode},</if>
|
||||
<if test="pcodeId != null">pcode_id = #{pcodeId},</if>
|
||||
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
||||
<if test="entityId != null">entity_id = #{entityId},</if>
|
||||
<if test="ckLihuoY != null">ck_lihuo_y = #{ckLihuoY},</if>
|
||||
<if test="teamCode != null">team_code = #{teamCode},</if>
|
||||
<if test="ckType != null">ck_type = #{ckType},</if>
|
||||
<if test="ckRemark != null">ck_remark = #{ckRemark},</if>
|
||||
<if test="lyTime != null">ly_time = #{lyTime},</if>
|
||||
<if test="billNoCk != null">bill_no_ck = #{billNoCk},</if>
|
||||
<if test="borrowTime != null">borrow_time = #{borrowTime},</if>
|
||||
<if test="returnTime != null">return_time = #{returnTime},</if>
|
||||
<if test="hasMoved != null">has_moved = #{hasMoved},</if>
|
||||
<if test="isBorrowed != null">is_borrowed = #{isBorrowed},</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>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="gysJhId != null">gys_jh_id = #{gysJhId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRkInfoById" parameterType="Long">
|
||||
delete from rk_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRkInfoByIds" parameterType="String">
|
||||
delete from rk_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user