项目重构,目前已完成入库操作,追加入库等
This commit is contained in:
@@ -122,6 +122,7 @@ public class SecurityConfig
|
||||
"/AutoInventory/**",
|
||||
"/ws/**",
|
||||
"/photo/**",
|
||||
"/wisdom/record/**",
|
||||
"/wisdom/stock/**",
|
||||
"/system/media/**",
|
||||
"/mock/**",
|
||||
|
||||
@@ -56,13 +56,13 @@ public class PcdeDetailController extends BaseController
|
||||
/**
|
||||
* 获取未被入库单据使用的库位列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('information:pcdedetail:list')")
|
||||
@GetMapping("/getAll")
|
||||
public AjaxResult getAll()
|
||||
{
|
||||
List<PcdeDetail> list = pcdeDetailService.getAllPcde();
|
||||
return success(list);
|
||||
}
|
||||
// @PreAuthorize("@ss.hasPermi('information:pcdedetail:list')")
|
||||
// @GetMapping("/getAll")
|
||||
// public AjaxResult getAll()
|
||||
// {
|
||||
// List<PcdeDetail> list = pcdeDetailService.getAllPcde();
|
||||
// return success(list);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 导出库位明细列表
|
||||
@@ -127,11 +127,11 @@ public class PcdeDetailController extends BaseController
|
||||
/**
|
||||
* 删除库位明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('information:pcdedetail:remove')")
|
||||
@Log(title = "库位明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(pcdeDetailService.deletePcdeDetailByIds(ids));
|
||||
}
|
||||
// @PreAuthorize("@ss.hasPermi('information:pcdedetail:remove')")
|
||||
// @Log(title = "库位明细", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public AjaxResult remove(@PathVariable Long[] ids)
|
||||
// {
|
||||
// return toAjax(pcdeDetailService.deletePcdeDetailByIds(ids));
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public interface IPcdeDetailService
|
||||
* @param ids 需要删除的库位明细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePcdeDetailByIds(Long[] ids);
|
||||
// public int deletePcdeDetailByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除库位明细信息
|
||||
@@ -58,7 +58,7 @@ public interface IPcdeDetailService
|
||||
* @param id 库位明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePcdeDetailById(Long id);
|
||||
// public int deletePcdeDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
@@ -72,7 +72,7 @@ public interface IPcdeDetailService
|
||||
* 获取未被入库单据使用的库位列表
|
||||
* @return
|
||||
*/
|
||||
List<PcdeDetail> getAllPcde();
|
||||
// List<PcdeDetail> getAllPcde();
|
||||
|
||||
/**
|
||||
* 根据小仓编码查询库位列表
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
package com.zg.project.information.service.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.zg.common.exception.ServiceException;
|
||||
import com.zg.common.utils.DateUtils;
|
||||
import com.zg.common.utils.StringUtils;
|
||||
import com.zg.framework.manager.AsyncManager;
|
||||
import com.zg.project.wisdom.mapper.RkInfoMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -97,57 +95,57 @@ public class PcdeDetailServiceImpl implements IPcdeDetailService
|
||||
* @param ids 需要删除的库位明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePcdeDetailByIds(Long[] ids)
|
||||
{
|
||||
for (Long id : ids) {
|
||||
// 获取库位信息
|
||||
PcdeDetail pcdeDetail = pcdeDetailMapper.selectPcdeDetailById(id);
|
||||
if (pcdeDetail == null) {
|
||||
throw new ServiceException("ID为 " + id + " 的库位不存在,无法删除");
|
||||
}
|
||||
|
||||
// 获取库位编号
|
||||
String locationCode = pcdeDetail.getPcode();
|
||||
|
||||
// 检查该库位是否仍有关联货物
|
||||
int count = rkInfoMapper.countRkInfoByLocationCode(locationCode);
|
||||
if (count > 0) {
|
||||
throw new ServiceException("库位 [" + locationCode + "] 上还有货物,无法批量删除");
|
||||
}
|
||||
}
|
||||
|
||||
// 全部校验通过后再执行删除
|
||||
return pcdeDetailMapper.deletePcdeDetailByIds(ids);
|
||||
}
|
||||
// @Override
|
||||
// public int deletePcdeDetailByIds(Long[] ids)
|
||||
// {
|
||||
// for (Long id : ids) {
|
||||
// // 获取库位信息
|
||||
// PcdeDetail pcdeDetail = pcdeDetailMapper.selectPcdeDetailById(id);
|
||||
// if (pcdeDetail == null) {
|
||||
// throw new ServiceException("ID为 " + id + " 的库位不存在,无法删除");
|
||||
// }
|
||||
//
|
||||
// // 获取库位编号
|
||||
// String locationCode = pcdeDetail.getPcode();
|
||||
//
|
||||
// // 检查该库位是否仍有关联货物
|
||||
// int count = rkInfoMapper.countRkInfoByLocationCode(locationCode);
|
||||
// if (count > 0) {
|
||||
// throw new ServiceException("库位 [" + locationCode + "] 上还有货物,无法批量删除");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 全部校验通过后再执行删除
|
||||
// return pcdeDetailMapper.deletePcdeDetailByIds(ids);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 删除库位明细信息
|
||||
*
|
||||
* @param id 库位明细主键
|
||||
* @param
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePcdeDetailById(Long id)
|
||||
{
|
||||
// 根据主键获取库位明细
|
||||
PcdeDetail pcdeDetail = pcdeDetailMapper.selectPcdeDetailById(id);
|
||||
if (pcdeDetail == null) {
|
||||
throw new ServiceException("库位信息不存在,无法删除");
|
||||
}
|
||||
|
||||
// 获取库位编号
|
||||
String locationCode = pcdeDetail.getPcode();
|
||||
|
||||
// 查询该库位上是否存在库存
|
||||
int count = rkInfoMapper.countRkInfoByLocationCode(locationCode);
|
||||
if (count > 0) {
|
||||
throw new ServiceException("该库位上还有货物,无法删除");
|
||||
}
|
||||
|
||||
// 删除库位信息
|
||||
return pcdeDetailMapper.deletePcdeDetailById(id);
|
||||
}
|
||||
// @Override
|
||||
// public int deletePcdeDetailById(Long id)
|
||||
// {
|
||||
// // 根据主键获取库位明细
|
||||
// PcdeDetail pcdeDetail = pcdeDetailMapper.selectPcdeDetailById(id);
|
||||
// if (pcdeDetail == null) {
|
||||
// throw new ServiceException("库位信息不存在,无法删除");
|
||||
// }
|
||||
//
|
||||
// // 获取库位编号
|
||||
// String locationCode = pcdeDetail.getPcode();
|
||||
//
|
||||
// // 查询该库位上是否存在库存
|
||||
// int count = rkInfoMapper.countRkInfoByLocationCode(locationCode);
|
||||
// if (count > 0) {
|
||||
// throw new ServiceException("该库位上还有货物,无法删除");
|
||||
// }
|
||||
//
|
||||
// // 删除库位信息
|
||||
// return pcdeDetailMapper.deletePcdeDetailById(id);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public String importPcdeDetail(List<PcdeDetail> pcdeList, String operName) {
|
||||
@@ -215,21 +213,21 @@ public class PcdeDetailServiceImpl implements IPcdeDetailService
|
||||
/**
|
||||
* 获取未被入库单据使用的库位列表
|
||||
*/
|
||||
@Override
|
||||
public List<PcdeDetail> getAllPcde() {
|
||||
// 查询所有库位
|
||||
List<PcdeDetail> pcdeList = pcdeDetailMapper.selectPcdeDetailList(new PcdeDetail());
|
||||
|
||||
// 查询已被使用过的库位码(pcode)
|
||||
List<String> usedPcodeList = rkInfoMapper.selectUsedPcodes();
|
||||
|
||||
// 过滤掉已使用的
|
||||
List<PcdeDetail> availableList = pcdeList.stream()
|
||||
.filter(p -> !usedPcodeList.contains(p.getPcode()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return availableList;
|
||||
}
|
||||
// @Override
|
||||
// public List<PcdeDetail> getAllPcde() {
|
||||
// // 查询所有库位
|
||||
// List<PcdeDetail> pcdeList = pcdeDetailMapper.selectPcdeDetailList(new PcdeDetail());
|
||||
//
|
||||
// // 查询已被使用过的库位码(pcode)
|
||||
// List<String> usedPcodeList = rkInfoMapper.selectUsedPcodes();
|
||||
//
|
||||
// // 过滤掉已使用的
|
||||
// List<PcdeDetail> availableList = pcdeList.stream()
|
||||
// .filter(p -> !usedPcodeList.contains(p.getPcode()))
|
||||
// .collect(Collectors.toList());
|
||||
//
|
||||
// return availableList;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<PcdeDetail> selectByWarehouseCode(String warehouseCode)
|
||||
|
||||
@@ -68,28 +68,28 @@ public class AutoInventoryController extends BaseController {
|
||||
/**
|
||||
* 开始匹配
|
||||
*/
|
||||
@PostMapping("/match")
|
||||
@ApiOperation("开始匹配")
|
||||
public AjaxResult match(@RequestBody QueryDTO dto) {
|
||||
// 停止盘点
|
||||
rfidService.stopScan(dto.getDeviceId());
|
||||
|
||||
dto.setScanType(1);
|
||||
|
||||
rkInfoService.matchWithStatus(dto);
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
// @PostMapping("/match")
|
||||
// @ApiOperation("开始匹配")
|
||||
// public AjaxResult match(@RequestBody QueryDTO dto) {
|
||||
// // 停止盘点
|
||||
// rfidService.stopScan(dto.getDeviceId());
|
||||
//
|
||||
// dto.setScanType(1);
|
||||
//
|
||||
// rkInfoService.matchWithStatus(dto);
|
||||
//
|
||||
// return AjaxResult.success();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 匹配后图表统计
|
||||
*/
|
||||
@PostMapping("/chart")
|
||||
@ApiOperation("匹配后图表统计")
|
||||
public AjaxResult chart(@RequestBody QueryDTO dto) {
|
||||
ChartDataVO vo = rkInfoService.matchWithAll(dto);
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
// @PostMapping("/chart")
|
||||
// @ApiOperation("匹配后图表统计")
|
||||
// public AjaxResult chart(@RequestBody QueryDTO dto) {
|
||||
// ChartDataVO vo = rkInfoService.matchWithAll(dto);
|
||||
// return AjaxResult.success(vo);
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,15 +50,15 @@ public class InventoryMatchScanController extends BaseController {
|
||||
* @param matchScan
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/countList")
|
||||
public TableDataInfo countList(InventoryMatchScan matchScan) {
|
||||
// 开启分页
|
||||
startPage();
|
||||
// 调用 service 层查询数据
|
||||
List<RkInfoMatchVO> list = inventoryMatchScanService.selectMatchScanCountList(matchScan);
|
||||
// 返回分页后的结果
|
||||
return getDataTable(list);
|
||||
}
|
||||
// @GetMapping("/countList")
|
||||
// public TableDataInfo countList(InventoryMatchScan matchScan) {
|
||||
// // 开启分页
|
||||
// startPage();
|
||||
// // 调用 service 层查询数据
|
||||
// List<RkInfoMatchVO> list = inventoryMatchScanService.selectMatchScanCountList(matchScan);
|
||||
// // 返回分页后的结果
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,5 +19,5 @@ public interface InventoryMatchScanService {
|
||||
|
||||
List<InventoryMatchScan> selectInventoryMatchScanList(InventoryMatchScan matchScan);
|
||||
|
||||
List<RkInfoMatchVO> selectMatchScanCountList(InventoryMatchScan matchScan);
|
||||
// List<RkInfoMatchVO> selectMatchScanCountList(InventoryMatchScan matchScan);
|
||||
}
|
||||
|
||||
@@ -56,22 +56,22 @@ public class InventoryMatchScanServiceImpl implements InventoryMatchScanService
|
||||
return mapper.selectInventoryMatchScanList(matchScan);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RkInfoMatchVO> selectMatchScanCountList(InventoryMatchScan param) {
|
||||
// 状态=2:只查扫描表中的数据
|
||||
if ("2".equals(param.getStatus())) {
|
||||
return mapper.selectOnlyFromMatchScan(param);
|
||||
}
|
||||
// 状态=1:查询指定仓库下未被扫描的库位
|
||||
else if ("1".equals(param.getStatus())) {
|
||||
// ✅ 根据任务ID取 sceneId,再按 scene 查询“未被扫描”的库位
|
||||
String sceneId = taskMapper.getSceneByTaskId(param.getTaskId());
|
||||
return rkInfoMapper.getUnscannedPcodeByScene(sceneId, param.getTaskId());
|
||||
}
|
||||
// 其它情况:返回扫描表和库存表的关联数据
|
||||
else {
|
||||
return mapper.selectJoinRkInfo(param);
|
||||
}
|
||||
}
|
||||
// @Override
|
||||
// public List<RkInfoMatchVO> selectMatchScanCountList(InventoryMatchScan param) {
|
||||
// // 状态=2:只查扫描表中的数据
|
||||
// if ("2".equals(param.getStatus())) {
|
||||
// return mapper.selectOnlyFromMatchScan(param);
|
||||
// }
|
||||
// // 状态=1:查询指定仓库下未被扫描的库位
|
||||
// else if ("1".equals(param.getStatus())) {
|
||||
// // ✅ 根据任务ID取 sceneId,再按 scene 查询“未被扫描”的库位
|
||||
// String sceneId = taskMapper.getSceneByTaskId(param.getTaskId());
|
||||
// return rkInfoMapper.getUnscannedPcodeByScene(sceneId, param.getTaskId());
|
||||
// }
|
||||
// // 其它情况:返回扫描表和库存表的关联数据
|
||||
// else {
|
||||
// return mapper.selectJoinRkInfo(param);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -16,18 +16,18 @@ public class HdInventoryController {
|
||||
@Autowired
|
||||
private IRkInfoService rkInfoService;
|
||||
|
||||
@ApiModelProperty("开始匹配")
|
||||
@PostMapping("/match")
|
||||
public AjaxResult match(@RequestBody QueryDTO dto) {
|
||||
// @ApiModelProperty("开始匹配")
|
||||
// @PostMapping("/match")
|
||||
// public AjaxResult match(@RequestBody QueryDTO dto) {
|
||||
//
|
||||
// dto.setScanType(0);
|
||||
//
|
||||
//// dto.setDeviceId("0");
|
||||
//
|
||||
// rkInfoService.matchWithStatus(dto);
|
||||
//
|
||||
// return AjaxResult.success();
|
||||
|
||||
dto.setScanType(0);
|
||||
|
||||
// dto.setDeviceId("0");
|
||||
|
||||
rkInfoService.matchWithStatus(dto);
|
||||
|
||||
return AjaxResult.success();
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -22,14 +22,14 @@ public class StatisticsController extends BaseController {
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/count")
|
||||
public AjaxResult conuntGetByTaskId(@RequestParam("taskId") String taskId)
|
||||
{
|
||||
|
||||
String warehouse = taskService.getWhByTaskId(taskId);
|
||||
|
||||
int count = rkInfoService.countGetByWh(warehouse);
|
||||
|
||||
return AjaxResult.success(count);
|
||||
}
|
||||
// @GetMapping("/count")
|
||||
// public AjaxResult conuntGetByTaskId(@RequestParam("taskId") String taskId)
|
||||
// {
|
||||
//
|
||||
// String warehouse = taskService.getWhByTaskId(taskId);
|
||||
//
|
||||
// int count = rkInfoService.countGetByWh(warehouse);
|
||||
//
|
||||
// return AjaxResult.success(count);
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,166 +1,166 @@
|
||||
package com.zg.project.wisdom.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.zg.common.exception.ServiceException;
|
||||
import com.zg.common.utils.MinioUtil;
|
||||
import com.zg.common.utils.SecurityUtils;
|
||||
import com.zg.project.wisdom.domain.vo.AuditSignatureReviewVO;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.zg.framework.aspectj.lang.annotation.Log;
|
||||
import com.zg.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.zg.project.wisdom.domain.AuditSignature;
|
||||
import com.zg.project.wisdom.service.IAuditSignatureService;
|
||||
import com.zg.framework.web.controller.BaseController;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.common.utils.poi.ExcelUtil;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 审批记录Controller
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wisdom/signature")
|
||||
public class AuditSignatureController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAuditSignatureService auditSignatureService;
|
||||
|
||||
@Autowired
|
||||
private MinioUtil minioUtil;
|
||||
|
||||
/**
|
||||
* 上传签字图片到 MinIO
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
@Log(title = "签字图片上传", businessType = BusinessType.INSERT)
|
||||
public AjaxResult uploadSignature(@RequestParam("file") MultipartFile file) {
|
||||
if (file == null || file.isEmpty()) {
|
||||
return AjaxResult.error("上传文件不能为空");
|
||||
}
|
||||
try {
|
||||
String url = minioUtil.upload(file, "jaz", "signature/");
|
||||
return AjaxResult.success("上传成功").put("url", url);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("上传失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
// 上传图片,接收base64格式 zhangjinbo
|
||||
@PostMapping("/uploadBase64")
|
||||
@Log(title = "签字图片上传", businessType = BusinessType.INSERT)
|
||||
public AjaxResult uploadSignatureBase64(@RequestBody Map<String, String> param) {
|
||||
String imgStr = param.get("imgStr");
|
||||
// return AjaxResult.success("上传成功").put("url", imgStr);
|
||||
if (imgStr == null) {
|
||||
return AjaxResult.error("上传文件不能为空");
|
||||
}
|
||||
String url = minioUtil.uploadBase64(imgStr, "jaz","signature/");
|
||||
return AjaxResult.success("上传成功").put("url", url);
|
||||
|
||||
}
|
||||
/**
|
||||
* 查询待审批记录列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:signature:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AuditSignature auditSignature) {
|
||||
startPage();
|
||||
List<AuditSignatureReviewVO> list = auditSignatureService.selectAuditSignatureReviewList(auditSignature);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询个人提交审批记录
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:signature:list')")
|
||||
@GetMapping("/user/list")
|
||||
public TableDataInfo listMySubmitRecords(AuditSignature auditSignature)
|
||||
{
|
||||
startPage();
|
||||
auditSignature.setSignerId(SecurityUtils.getUserId().toString()); // 当前用户
|
||||
List<AuditSignatureReviewVO> list = auditSignatureService.selectMySubmittedAuditList(auditSignature);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出审批记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:signature:export')")
|
||||
@Log(title = "审批记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AuditSignature auditSignature)
|
||||
{
|
||||
List<AuditSignature> list = auditSignatureService.selectAuditSignatureList(auditSignature);
|
||||
ExcelUtil<AuditSignature> util = new ExcelUtil<AuditSignature>(AuditSignature.class);
|
||||
util.exportExcel(response, list, "审批记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取审批记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:signature:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(auditSignatureService.selectAuditSignatureById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 审批
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:signature:edit')")
|
||||
@Log(title = "审批记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult approve(@RequestBody AuditSignature auditSignature) {
|
||||
return toAjax(auditSignatureService.approveAuditSignature(auditSignature));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除审批记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:signature:remove')")
|
||||
@Log(title = "审批记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(auditSignatureService.deleteAuditSignatureByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前用户待审核列表条数
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/count")
|
||||
public AjaxResult getPending(AuditSignature auditSignat) {
|
||||
String approverId = auditSignat.getApproverId();
|
||||
int total = auditSignatureService.countPendingByUser(approverId);
|
||||
return AjaxResult.success(total);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核操作(通过 / 驳回)
|
||||
*/
|
||||
@PostMapping("/audit")
|
||||
@Log(title = "审批记录", businessType = BusinessType.UPDATE)
|
||||
public AjaxResult audit(@RequestBody AuditSignature audit) {
|
||||
try {
|
||||
auditSignatureService.audit(audit);
|
||||
return AjaxResult.success("审核成功");
|
||||
} catch (ServiceException e) {
|
||||
return AjaxResult.error("审核失败:" + e.getMessage());
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("系统异常,请联系管理员");
|
||||
}
|
||||
}
|
||||
}
|
||||
//package com.zg.project.wisdom.controller;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//import javax.servlet.http.HttpServletResponse;
|
||||
//
|
||||
//import com.alibaba.fastjson2.JSONObject;
|
||||
//import com.zg.common.exception.ServiceException;
|
||||
//import com.zg.common.utils.MinioUtil;
|
||||
//import com.zg.common.utils.SecurityUtils;
|
||||
//import com.zg.project.wisdom.domain.vo.AuditSignatureReviewVO;
|
||||
//import org.springframework.security.access.prepost.PreAuthorize;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//import com.zg.framework.aspectj.lang.annotation.Log;
|
||||
//import com.zg.framework.aspectj.lang.enums.BusinessType;
|
||||
//import com.zg.project.wisdom.domain.AuditSignature;
|
||||
//import com.zg.project.wisdom.service.IAuditSignatureService;
|
||||
//import com.zg.framework.web.controller.BaseController;
|
||||
//import com.zg.framework.web.domain.AjaxResult;
|
||||
//import com.zg.common.utils.poi.ExcelUtil;
|
||||
//import com.zg.framework.web.page.TableDataInfo;
|
||||
//import org.springframework.web.multipart.MultipartFile;
|
||||
//
|
||||
///**
|
||||
// * 审批记录Controller
|
||||
// *
|
||||
// * @author zg
|
||||
// * @date 2025-07-11
|
||||
// */
|
||||
//@RestController
|
||||
//@RequestMapping("/wisdom/signature")
|
||||
//public class AuditSignatureController extends BaseController
|
||||
//{
|
||||
// @Autowired
|
||||
// private IAuditSignatureService auditSignatureService;
|
||||
//
|
||||
// @Autowired
|
||||
// private MinioUtil minioUtil;
|
||||
//
|
||||
// /**
|
||||
// * 上传签字图片到 MinIO
|
||||
// */
|
||||
// @PostMapping("/upload")
|
||||
// @Log(title = "签字图片上传", businessType = BusinessType.INSERT)
|
||||
// public AjaxResult uploadSignature(@RequestParam("file") MultipartFile file) {
|
||||
// if (file == null || file.isEmpty()) {
|
||||
// return AjaxResult.error("上传文件不能为空");
|
||||
// }
|
||||
// try {
|
||||
// String url = minioUtil.upload(file, "jaz", "signature/");
|
||||
// return AjaxResult.success("上传成功").put("url", url);
|
||||
// } catch (Exception e) {
|
||||
// return AjaxResult.error("上传失败: " + e.getMessage());
|
||||
// }
|
||||
// }
|
||||
// // 上传图片,接收base64格式 zhangjinbo
|
||||
// @PostMapping("/uploadBase64")
|
||||
// @Log(title = "签字图片上传", businessType = BusinessType.INSERT)
|
||||
// public AjaxResult uploadSignatureBase64(@RequestBody Map<String, String> param) {
|
||||
// String imgStr = param.get("imgStr");
|
||||
//// return AjaxResult.success("上传成功").put("url", imgStr);
|
||||
// if (imgStr == null) {
|
||||
// return AjaxResult.error("上传文件不能为空");
|
||||
// }
|
||||
// String url = minioUtil.uploadBase64(imgStr, "jaz","signature/");
|
||||
// return AjaxResult.success("上传成功").put("url", url);
|
||||
//
|
||||
// }
|
||||
// /**
|
||||
// * 查询待审批记录列表
|
||||
// */
|
||||
//// @PreAuthorize("@ss.hasPermi('wisdom:signature:list')")
|
||||
// @GetMapping("/list")
|
||||
// public TableDataInfo list(AuditSignature auditSignature) {
|
||||
// startPage();
|
||||
// List<AuditSignatureReviewVO> list = auditSignatureService.selectAuditSignatureReviewList(auditSignature);
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查询个人提交审批记录
|
||||
// */
|
||||
//// @PreAuthorize("@ss.hasPermi('wisdom:signature:list')")
|
||||
// @GetMapping("/user/list")
|
||||
// public TableDataInfo listMySubmitRecords(AuditSignature auditSignature)
|
||||
// {
|
||||
// startPage();
|
||||
// auditSignature.setSignerId(SecurityUtils.getUserId().toString()); // 当前用户
|
||||
// List<AuditSignatureReviewVO> list = auditSignatureService.selectMySubmittedAuditList(auditSignature);
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 导出审批记录列表
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:signature:export')")
|
||||
// @Log(title = "审批记录", businessType = BusinessType.EXPORT)
|
||||
// @PostMapping("/export")
|
||||
// public void export(HttpServletResponse response, AuditSignature auditSignature)
|
||||
// {
|
||||
// List<AuditSignature> list = auditSignatureService.selectAuditSignatureList(auditSignature);
|
||||
// ExcelUtil<AuditSignature> util = new ExcelUtil<AuditSignature>(AuditSignature.class);
|
||||
// util.exportExcel(response, list, "审批记录数据");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取审批记录详细信息
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:signature:query')")
|
||||
// @GetMapping(value = "/{id}")
|
||||
// public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
// {
|
||||
// return success(auditSignatureService.selectAuditSignatureById(id));
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 审批
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:signature:edit')")
|
||||
// @Log(title = "审批记录", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping
|
||||
// public AjaxResult approve(@RequestBody AuditSignature auditSignature) {
|
||||
// return toAjax(auditSignatureService.approveAuditSignature(auditSignature));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除审批记录
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:signature:remove')")
|
||||
// @Log(title = "审批记录", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public AjaxResult remove(@PathVariable Long[] ids)
|
||||
// {
|
||||
// return toAjax(auditSignatureService.deleteAuditSignatureByIds(ids));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 当前用户待审核列表条数
|
||||
// * @return
|
||||
// */
|
||||
// @GetMapping("/count")
|
||||
// public AjaxResult getPending(AuditSignature auditSignat) {
|
||||
// String approverId = auditSignat.getApproverId();
|
||||
// int total = auditSignatureService.countPendingByUser(approverId);
|
||||
// return AjaxResult.success(total);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 审核操作(通过 / 驳回)
|
||||
// */
|
||||
// @PostMapping("/audit")
|
||||
// @Log(title = "审批记录", businessType = BusinessType.UPDATE)
|
||||
// public AjaxResult audit(@RequestBody AuditSignature audit) {
|
||||
// try {
|
||||
// auditSignatureService.audit(audit);
|
||||
// return AjaxResult.success("审核成功");
|
||||
// } catch (ServiceException e) {
|
||||
// return AjaxResult.error("审核失败:" + e.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// return AjaxResult.error("系统异常,请联系管理员");
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -1,88 +1,116 @@
|
||||
package com.zg.project.wisdom.controller;
|
||||
|
||||
import com.zg.common.utils.DateUtils;
|
||||
import com.zg.common.utils.SecurityUtils;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zg.project.wisdom.domain.dto.RkBillCreateDTO;
|
||||
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.zg.framework.aspectj.lang.annotation.Log;
|
||||
import com.zg.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.zg.project.wisdom.domain.RkBill;
|
||||
import com.zg.project.wisdom.service.IRkBillService;
|
||||
import com.zg.framework.web.controller.BaseController;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.project.wisdom.domain.RkBill;
|
||||
import com.zg.common.utils.poi.ExcelUtil;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
import com.zg.project.wisdom.domain.RkInfo;
|
||||
import com.zg.project.wisdom.service.IRkBillService;
|
||||
import com.zg.project.wisdom.service.IRkInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存单据Controller
|
||||
*
|
||||
* @author zg
|
||||
* @date 2026-01-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wisdom/bill")
|
||||
public class RkBillController extends BaseController {
|
||||
|
||||
public class RkBillController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRkBillService rkBillService;
|
||||
|
||||
@Autowired
|
||||
private IRkInfoService rkInfoService;
|
||||
|
||||
/**
|
||||
* 分页查询单据主表
|
||||
* 查询库存单据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:list')")
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:bill:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RkBill rkBill) {
|
||||
public TableDataInfo list(RkBill rkBill)
|
||||
{
|
||||
startPage();
|
||||
List<RkBill> list = rkBillService.selectRkBillList(rkBill);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取详情
|
||||
* 导出库存单据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:query')")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getInfo(@PathVariable Long id) {
|
||||
return AjaxResult.success(rkBillService.selectRkBillById(id));
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:bill:export')")
|
||||
@Log(title = "库存单据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RkBill rkBill)
|
||||
{
|
||||
List<RkBill> list = rkBillService.selectRkBillList(rkBill);
|
||||
ExcelUtil<RkBill> util = new ExcelUtil<RkBill>(RkBill.class);
|
||||
util.exportExcel(response, list, "库存单据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单据主(如未通过入库明细新增)
|
||||
* 获取库存单据详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:add')")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RkBill rkBill) {
|
||||
rkBill.setCreateBy(SecurityUtils.getUsername());
|
||||
rkBill.setCreateTime(DateUtils.getNowDate());
|
||||
return toAjax(rkBillService.insertRkBill(rkBill));
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:bill:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rkBillService.selectRkBillById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改单据主
|
||||
* 新增库存单据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:edit')")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RkBill rkBill) {
|
||||
rkBill.setUpdateBy(SecurityUtils.getUsername());
|
||||
rkBill.setUpdateTime(DateUtils.getNowDate());
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:bill:add')")
|
||||
@Log(title = "库存单据", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody RkBillCreateDTO dto) {
|
||||
return toAjax(rkBillService.insertRkBillAndDetail(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 向已有单据追加物料
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:bill:add')")
|
||||
@Log(title = "库存单据", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/append")
|
||||
public AjaxResult append(@RequestBody RkBillCreateDTO dto) {
|
||||
return toAjax(rkBillService.appendRkBillDetail(dto));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改库存单据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:bill:edit')")
|
||||
@Log(title = "库存单据", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
public AjaxResult edit(@RequestBody RkBill rkBill)
|
||||
{
|
||||
return toAjax(rkBillService.updateRkBill(rkBill));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单据主(逻辑删除)
|
||||
* 删除库存单据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:remove')")
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:bill:remove')")
|
||||
@Log(title = "库存单据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(rkBillService.logicDeleteRkBillByIds(ids));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:query')")
|
||||
@GetMapping("/detailList")
|
||||
public TableDataInfo detailList(@RequestParam String billNo) {
|
||||
RkInfo rkInfo = new RkInfo();
|
||||
rkInfo.setBillNo(billNo);
|
||||
startPage();
|
||||
List<RkInfo> list = rkInfoService.selectRkInfoList(rkInfo);
|
||||
return getDataTable(list);
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rkBillService.deleteRkBillByIds(ids));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
package com.zg.project.wisdom.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.zg.common.utils.StringUtils;
|
||||
import com.zg.project.wisdom.domain.dto.*;
|
||||
import com.zg.project.wisdom.domain.vo.DeliveryBillVO;
|
||||
import com.zg.project.wisdom.service.QwenOcrRemoteService;
|
||||
import com.zg.project.wisdom.service.RkStatisticsService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
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.zg.framework.aspectj.lang.annotation.Log;
|
||||
import com.zg.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.zg.project.wisdom.domain.RkInfo;
|
||||
@@ -22,13 +20,12 @@ import com.zg.framework.web.controller.BaseController;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.common.utils.poi.ExcelUtil;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 库存单据主Controller
|
||||
* 库存单据明细Controller
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-28
|
||||
* @date 2026-01-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wisdom/stock")
|
||||
@@ -37,132 +34,33 @@ public class RkInfoController extends BaseController
|
||||
@Autowired
|
||||
private IRkInfoService rkInfoService;
|
||||
|
||||
@Autowired
|
||||
private QwenOcrRemoteService qwenOcrRemoteService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询出库,借料,待审批,撤销出入库单据主列表
|
||||
* 查询库存单据明细列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:stock:list')")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody RkInfoQueryDTO query) {
|
||||
PageHelper.startPage(
|
||||
query.getPageNum() == null ? 1 : query.getPageNum(),
|
||||
query.getPageSize() == null ? 10 : query.getPageSize()
|
||||
);
|
||||
List<RkInfo> list = rkInfoService.selectRkInfoList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/borrow/list")
|
||||
public TableDataInfo borrowList(@RequestBody RkInfoQueryDTO query) {
|
||||
|
||||
PageHelper.startPage(
|
||||
query.getPageNum() == null ? 1 : query.getPageNum(),
|
||||
query.getPageSize() == null ? 10 : query.getPageSize()
|
||||
);
|
||||
|
||||
List<RkInfo> list = rkInfoService.selectBorrowAndReturnList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存查询
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/pageStatistics")
|
||||
public Map<String, Object> pageStatistics(@RequestBody RkInfoQueryDTO dto) {
|
||||
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
|
||||
List<RkInfo> list = rkInfoService.selectAllRkInfo(dto);
|
||||
|
||||
Map<String, Object> dataInfo = new HashMap<>();
|
||||
dataInfo.put("dataList", getDataTable(list));
|
||||
return dataInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 单据头信息:根据入库单号查询公共字段
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:query')")
|
||||
@GetMapping("/header/{billNo}")
|
||||
public AjaxResult getHeaderByBillNo(@PathVariable String billNo) {
|
||||
RkInfo header = rkInfoService.selectHeaderByBillNo(billNo);
|
||||
return success(header);
|
||||
}
|
||||
|
||||
@GetMapping("/pcode/{pcode}")
|
||||
public AjaxResult listRkInfoByPcode(@PathVariable String pcode) {
|
||||
List<RkInfo> rows = rkInfoService.listRkInfoByPcode(pcode);
|
||||
return AjaxResult.success(rows);
|
||||
}
|
||||
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:stock:list')")
|
||||
// @PostMapping("/bill/groups")
|
||||
// public TableDataInfo billGroups(@RequestBody RkInfoQueryDTO query) {
|
||||
// // 分页
|
||||
// PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||
// // 查询
|
||||
// List<RkInfo> rows = rkInfoService.selectGroupedByBill(query);
|
||||
//
|
||||
// return getDataTable(rows);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取单据列表(轻量级:仅返回单据头公共信息,不聚合明细字段)
|
||||
*/
|
||||
@PostMapping("/bill/groups")
|
||||
public TableDataInfo billHeaderList(@RequestBody RkInfoQueryDTO query) {
|
||||
// 1. 分页
|
||||
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||
|
||||
// 2. 查询
|
||||
List<RkInfo> list = rkInfoService.selectBillHeaderList(query);
|
||||
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出出入库记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:export')")
|
||||
@Log(title = "出入库记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportPageList")
|
||||
public void exportPageList(HttpServletResponse response, RkInfoQueryDTO query)
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RkInfo rkInfo)
|
||||
{
|
||||
List<RkInfo> list = rkInfoService.selectRkInfoPageList(query);
|
||||
ExcelUtil<RkInfo> util = new ExcelUtil<>(RkInfo.class);
|
||||
util.exportExcel(response, list, "出入库记录导出");
|
||||
}
|
||||
|
||||
/**
|
||||
* 出入库查询
|
||||
*/
|
||||
@PostMapping("/pageList")
|
||||
public TableDataInfo pageList(@RequestBody RkInfoQueryDTO dto) {
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
List<RkInfo> list = rkInfoService.selectRkInfoPageList(dto);
|
||||
startPage();
|
||||
List<RkInfo> list = rkInfoService.selectRkInfoList(rkInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出库存单据主列表
|
||||
* 导出库存单据明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:export')")
|
||||
@Log(title = "库存单据主", businessType = BusinessType.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, "数据导出");
|
||||
util.exportExcel(response, list, "库存单据明细数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取库存单据主详细信息
|
||||
* 获取库存单据明细详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@@ -172,240 +70,35 @@ public class RkInfoController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库操作
|
||||
* 新增库存单据明细
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:add')")
|
||||
@Log(title = "库存单据主", businessType = BusinessType.INSERT)
|
||||
public AjaxResult batchAdd(@RequestBody PcRkInfoBatchDTO dto) {
|
||||
rkInfoService.batchInsert(dto);
|
||||
return AjaxResult.success("提交成功");
|
||||
@Log(title = "库存单据明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RkInfo rkInfo)
|
||||
{
|
||||
return toAjax(rkInfoService.insertRkInfo(rkInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存单据主
|
||||
* 修改库存单据明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:edit')")
|
||||
@Log(title = "库存单据主", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
@Log(title = "库存单据明细", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RkInfo rkInfo)
|
||||
{
|
||||
return toAjax(rkInfoService.updateRkInfo(rkInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据出库单据号修改库存单据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:edit')")
|
||||
@Log(title = "库存单据-按出库单号修改", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/updateByBillNoCk")
|
||||
public AjaxResult updateByBillNoCk(@RequestBody RkInfo rkInfo) {
|
||||
if (StringUtils.isBlank(rkInfo.getBillNoCk())) {
|
||||
return AjaxResult.error("出库单据号 billNoCk 不能为空");
|
||||
}
|
||||
return toAjax(rkInfoService.updateRkInfoByBillNoCk(rkInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库存单据主
|
||||
* 删除库存单据明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:remove')")
|
||||
@Log(title = "库存单据主", businessType = BusinessType.DELETE)
|
||||
@Log(title = "库存单据明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rkInfoService.deleteRkInfoByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 库龄超过20天统计
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/warning/stock/over20")
|
||||
public AjaxResult getOverdueStockTopList() {
|
||||
int total = rkInfoService.countOverdueStock();
|
||||
List<RkInfo> list = rkInfoService.selectTopOverdueStock(20);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("total", total);
|
||||
result.put("list", list);
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* App撤销出库
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/deleteByCkBillNo")
|
||||
@Log(title = "库存单据主", businessType = BusinessType.UPDATE)
|
||||
public AjaxResult deleteByCkBillNo(@RequestBody Map<String, String> body) {
|
||||
String billNoCk = body.get("billNoCk");
|
||||
if (billNoCk == null || billNoCk.trim().isEmpty()) {
|
||||
return AjaxResult.error("参数错误,缺少出库单据号(billNoCk)");
|
||||
}
|
||||
|
||||
int result = rkInfoService.deleteByCkBillNo(billNoCk);
|
||||
return result > 0
|
||||
? AjaxResult.success("出库单据: " + billNoCk + " 撤销成功")
|
||||
: AjaxResult.error("撤销失败,出库单据: " + billNoCk + " 不存在或已处理");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键ID撤销入库
|
||||
*/
|
||||
@PostMapping("/cancel")
|
||||
@Log(title = "库存单据主", businessType = BusinessType.UPDATE)
|
||||
public AjaxResult deleteById(@RequestBody RkCancelDTO dto) {
|
||||
rkInfoService.deleteRkInfoById(dto);
|
||||
return AjaxResult.success("撤销成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键ID撤销出库
|
||||
*/
|
||||
@PostMapping("/cancelById/{id}")
|
||||
@Log(title = "库存单据主", businessType = BusinessType.UPDATE)
|
||||
public AjaxResult cancelOutStockById(@PathVariable Long id) {
|
||||
rkInfoService.cancelOutStockById(id);
|
||||
return AjaxResult.success("撤销出库成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键id进行删除
|
||||
* 出入库撤销记录删除
|
||||
*/
|
||||
@PostMapping("/deleteByIds")
|
||||
@Log(title = "库存单据主", businessType = BusinessType.UPDATE)
|
||||
public AjaxResult deleteByIds(@RequestBody Long[] ids) {
|
||||
return AjaxResult.success(rkInfoService.deleteRkInfoByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ids恢复出库或入库
|
||||
*/
|
||||
@PostMapping("/revertByIds")
|
||||
@Log(title = "库存单据主", businessType = BusinessType.UPDATE)
|
||||
public AjaxResult revertByIds(@RequestBody Long[] ids) {
|
||||
rkInfoService.revertByIds(ids);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库操作
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:outbound:add')")
|
||||
@Log(title = "库存单据主", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/outStock")
|
||||
public AjaxResult doOutStock(@RequestBody StockOutDTO dto) {
|
||||
return toAjax(rkInfoService.batchOutStock(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 还料入库
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Log(title = "还料入库", businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:outbound:add')")
|
||||
@PostMapping("/refund")
|
||||
public AjaxResult refundMaterial(@RequestBody RefundRequestDTO dto) {
|
||||
return toAjax(rkInfoService.refundMaterial(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配送出库单据查询
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/delivery/list")
|
||||
public AjaxResult listDelivery(RkInfo query) {
|
||||
query.setIsChuku("1");
|
||||
query.setIsDelivery("1");
|
||||
List<DeliveryBillVO> list = rkInfoService.selectDeliveryBillList(query);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询 rk_info 所有明细
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/page")
|
||||
public TableDataInfo page(@RequestBody(required = false) RkInfoQueryDTO dto) {
|
||||
|
||||
if (dto == null) {
|
||||
dto = new RkInfoQueryDTO();
|
||||
}
|
||||
|
||||
// 使用 PageHelper 分页
|
||||
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
|
||||
|
||||
List<RkInfo> list = rkInfoService.selectAllRkInfo(dto);
|
||||
|
||||
return getDataTable(list);
|
||||
|
||||
}
|
||||
|
||||
// 根据玉田需求,新添加的接口
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:edit')")
|
||||
@PostMapping("/editBill")
|
||||
public AjaxResult editBill(@RequestBody RkInfo rkInfo)
|
||||
{
|
||||
return toAjax(rkInfoService.updateBillInfo(rkInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 相同入库单据号追加入库
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/append")
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:add')")
|
||||
@Log(title = "追加入库", businessType = BusinessType.INSERT)
|
||||
public AjaxResult append(@RequestBody PcRkInfoBatchDTO dto) {
|
||||
rkInfoService.appendToExistingBill(dto);
|
||||
return AjaxResult.success("追加入库成功");
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/updateDeliveryStatus")
|
||||
@Log(title = "更新配送状态", businessType = BusinessType.UPDATE)
|
||||
public AjaxResult updateDeliveryStatus(@RequestBody RkDeliveryUpdateDTO dto) {
|
||||
|
||||
if (dto.getIds() == null || dto.getIds().isEmpty()) {
|
||||
return AjaxResult.error("rk_info 主键ID集合不能为空");
|
||||
}
|
||||
if (dto.getIsDelivery() == null) {
|
||||
return AjaxResult.error("配送状态不能为空");
|
||||
}
|
||||
|
||||
int rows = rkInfoService.updateDeliveryStatus(dto.getIds(), dto.getIsDelivery());
|
||||
return AjaxResult.success(rows);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传图片,识别采购订单号(ERP)
|
||||
*
|
||||
* 前端调用示例(multipart/form-data):
|
||||
* POST /wisdom/ocr/extractErp
|
||||
* file: <图片文件>
|
||||
*/
|
||||
@PostMapping("/extractErp")
|
||||
public AjaxResult extractErp(@RequestParam("file") MultipartFile file) {
|
||||
|
||||
if (file == null || file.isEmpty()) {
|
||||
return AjaxResult.error("上传文件不能为空");
|
||||
}
|
||||
|
||||
String erpOrderNo = qwenOcrRemoteService.extractErpOrderNo(file);
|
||||
|
||||
|
||||
return AjaxResult.success(erpOrderNo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.zg.project.wisdom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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.zg.framework.aspectj.lang.annotation.Log;
|
||||
import com.zg.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.zg.project.wisdom.domain.RkRecord;
|
||||
import com.zg.project.wisdom.service.IRkRecordService;
|
||||
import com.zg.framework.web.controller.BaseController;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.common.utils.poi.ExcelUtil;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 出入库记录Controller
|
||||
*
|
||||
* @author zg
|
||||
* @date 2026-01-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wisdom/record")
|
||||
public class RkRecordController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRkRecordService rkRecordService;
|
||||
|
||||
/**
|
||||
* 查询出入库记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:record:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RkRecord rkRecord)
|
||||
{
|
||||
startPage();
|
||||
List<RkRecord> list = rkRecordService.selectRkRecordList(rkRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单据号查询出入库记录明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:record:list')")
|
||||
@GetMapping("/listByBillNo/{billNo}")
|
||||
public AjaxResult listByBillNo(@PathVariable String billNo)
|
||||
{
|
||||
return success(rkRecordService.selectRkRecordListByBillNo(billNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出出入库记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:record:export')")
|
||||
@Log(title = "出入库记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RkRecord rkRecord)
|
||||
{
|
||||
List<RkRecord> list = rkRecordService.selectRkRecordList(rkRecord);
|
||||
ExcelUtil<RkRecord> util = new ExcelUtil<RkRecord>(RkRecord.class);
|
||||
util.exportExcel(response, list, "出入库记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取出入库记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:record:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rkRecordService.selectRkRecordById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出入库记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:record:add')")
|
||||
@Log(title = "出入库记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RkRecord rkRecord)
|
||||
{
|
||||
return toAjax(rkRecordService.insertRkRecord(rkRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出入库记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:record:edit')")
|
||||
@Log(title = "出入库记录", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
public AjaxResult edit(@RequestBody RkRecord rkRecord)
|
||||
{
|
||||
return toAjax(rkRecordService.updateRkRecord(rkRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出入库记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:record:remove')")
|
||||
@Log(title = "出入库记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rkRecordService.deleteRkRecordByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -180,9 +180,9 @@ public class RkStatisticsController {
|
||||
return AjaxResult.success(rows);
|
||||
}
|
||||
|
||||
@PostMapping("/statistics")
|
||||
public Map<String, Object> statistics(@RequestBody RkInfoQueryDTO dto) {
|
||||
// 调用新的合并查询方法
|
||||
return rkStatisticsService.selectStockStatistics(dto);
|
||||
}
|
||||
// @PostMapping("/statistics")
|
||||
// public Map<String, Object> statistics(@RequestBody RkInfoQueryDTO dto) {
|
||||
// // 调用新的合并查询方法
|
||||
// return rkStatisticsService.selectStockStatistics(dto);
|
||||
// }
|
||||
}
|
||||
@@ -6,8 +6,6 @@ import com.zg.framework.aspectj.lang.enums.BusinessType;
|
||||
import com.zg.framework.web.controller.BaseController;
|
||||
import com.zg.framework.web.domain.AjaxResult;
|
||||
import com.zg.framework.web.page.TableDataInfo;
|
||||
import com.zg.project.wisdom.domain.RkBill;
|
||||
import com.zg.project.wisdom.domain.RkInfo;
|
||||
import com.zg.project.wisdom.domain.dto.RkInfoBatchDTO;
|
||||
import com.zg.project.wisdom.service.IRkBillService;
|
||||
import com.zg.project.wisdom.service.IRkInfoService;
|
||||
@@ -16,9 +14,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 库存单据主Controller
|
||||
@@ -52,15 +48,15 @@ public class AppRkInfoController extends BaseController {
|
||||
/**
|
||||
* 查询库存单据主列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:list')")
|
||||
// @GetMapping("/details/list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RkInfo rkInfo)
|
||||
{
|
||||
startPage();
|
||||
List<RkInfo> list = rkInfoService.selectRkInfoList(rkInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:stock:list')")
|
||||
//// @GetMapping("/details/list")
|
||||
// @GetMapping("/list")
|
||||
// public TableDataInfo list(RkInfo rkInfo)
|
||||
// {
|
||||
// startPage();
|
||||
// List<RkInfo> list = rkInfoService.selectRkInfoList(rkInfo);
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
@@ -68,25 +64,25 @@ public class AppRkInfoController extends BaseController {
|
||||
* @param billNo
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/deleteByBillNo/{billNo}")
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:deleteByBillNo')")
|
||||
public AjaxResult deleteByBillNo(@PathVariable String billNo) {
|
||||
rkInfoService.deleteByBillNo(billNo);
|
||||
return AjaxResult.success("撤销成功");
|
||||
}
|
||||
// @DeleteMapping("/deleteByBillNo/{billNo}")
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:stock:deleteByBillNo')")
|
||||
// public AjaxResult deleteByBillNo(@PathVariable String billNo) {
|
||||
// rkInfoService.deleteByBillNo(billNo);
|
||||
// return AjaxResult.success("撤销成功");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 导出库存单据主列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock: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('wisdom:stock: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, "库存单据主数据");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取库存单据主详细信息
|
||||
@@ -101,23 +97,23 @@ public class AppRkInfoController extends BaseController {
|
||||
/**
|
||||
* 新增库存单据主
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:add')")
|
||||
@Log(title = "库存单据主", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult batchAdd(@RequestBody RkInfoBatchDTO dto) {
|
||||
return toAjax(rkInfoService.batchInsertApp(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存单据主
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('wisdom:stock:edit')")
|
||||
@Log(title = "库存单据主", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RkInfo rkInfo)
|
||||
{
|
||||
return toAjax(rkInfoService.updateRkInfo(rkInfo));
|
||||
}
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:stock:add')")
|
||||
// @Log(title = "库存单据主", businessType = BusinessType.INSERT)
|
||||
// @PostMapping("/add")
|
||||
// public AjaxResult batchAdd(@RequestBody RkInfoBatchDTO dto) {
|
||||
// return toAjax(rkInfoService.batchInsertApp(dto));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改库存单据主
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('wisdom:stock:edit')")
|
||||
// @Log(title = "库存单据主", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping
|
||||
// public AjaxResult edit(@RequestBody RkInfo rkInfo)
|
||||
// {
|
||||
// return toAjax(rkInfoService.updateRkInfo(rkInfo));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 删除库存单据主
|
||||
|
||||
@@ -1,104 +1,120 @@
|
||||
package com.zg.project.wisdom.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.zg.framework.aspectj.lang.annotation.Excel;
|
||||
import com.zg.framework.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zg.framework.aspectj.lang.annotation.Excel;
|
||||
import com.zg.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 入库单据主表对象 rk_bill
|
||||
* 库存单据对象 rk_bill
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-06-06
|
||||
* @date 2026-01-20
|
||||
*/
|
||||
public class RkBill extends BaseEntity
|
||||
{
|
||||
public class RkBill extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 入库类型 */
|
||||
// @Excel(name = "入库类型")
|
||||
private String rkType;
|
||||
|
||||
/** 物资类型 */
|
||||
// @Excel(name = "物资类型")
|
||||
@Excel(name = "物资类型")
|
||||
private String wlType;
|
||||
|
||||
/** 所属仓库 */
|
||||
// @Excel(name = "所属仓库")
|
||||
private String cangku;
|
||||
|
||||
/** 入库类型名称 */
|
||||
@Excel(name = "入库类型名称")
|
||||
private String rkTypeName;
|
||||
|
||||
/** 物资类型名称 */
|
||||
/** 物资类型名称(联表) */
|
||||
@Excel(name = "物资类型名称")
|
||||
private String wlTypeName;
|
||||
|
||||
/** 所属仓库名称 */
|
||||
@Excel(name = "所属仓库名称")
|
||||
private String cangkuName;
|
||||
/** 所属仓库(小仓编码) */
|
||||
@Excel(name = "所属仓库")
|
||||
private String cangku;
|
||||
|
||||
/** 理货员名称 */
|
||||
@Excel(name = "理货员名称")
|
||||
private String lihuoYName;
|
||||
/** 小仓名称(联表) */
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
/** 入库时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date rkTime;
|
||||
|
||||
/** 理货员 */
|
||||
// @Excel(name = "理货员")
|
||||
private String lihuoY;
|
||||
|
||||
|
||||
/** 出库类型 */
|
||||
private String ckType;
|
||||
|
||||
/** 出库类型名称(展示用) */
|
||||
@Excel(name = "出库类型名称")
|
||||
private String ckTypeName;
|
||||
|
||||
/** 出库时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "出库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date ckTime;
|
||||
|
||||
/** 出库理货员 */
|
||||
private String ckLihuoY;
|
||||
|
||||
/** 出库理货员名称(展示用) */
|
||||
@Excel(name = "出库理货员名称")
|
||||
private String ckLihuoYName;
|
||||
|
||||
/** 出库备注 */
|
||||
@Excel(name = "出库备注")
|
||||
private String ckRemark;
|
||||
|
||||
/** 施工队编码 */
|
||||
private String teamCode;
|
||||
|
||||
/** 施工队名称(展示用) */
|
||||
@Excel(name = "施工队名称")
|
||||
private String teamName;
|
||||
/** 大仓名称(联表) */
|
||||
@Excel(name = "大仓名称")
|
||||
private String parentWarehouseName;
|
||||
|
||||
/** 单据号 */
|
||||
@Excel(name = "单据号")
|
||||
private String billNo;
|
||||
|
||||
/** 是否已出库(0未出库,1已出库) */
|
||||
@Excel(name = "是否出库", readConverterExp = "0=未出库,1=已出库")
|
||||
private String isChuku;
|
||||
/** 原字段:出入库类型 */
|
||||
@Excel(name = "出入库类型")
|
||||
private String operationType;
|
||||
|
||||
/** 出入库类型名称(联表) */
|
||||
@Excel(name = "出入库类型名称")
|
||||
private String operationTypeName;
|
||||
|
||||
/**
|
||||
* 业务操作类型
|
||||
* 0 入库
|
||||
* 1 出库
|
||||
* 2 借料出库
|
||||
* 3 还料入库
|
||||
*/
|
||||
@Excel(name = "操作类型", readConverterExp = "0=入库,1=出库,2=借料出库,3=还料入库")
|
||||
private String bizType;
|
||||
|
||||
/** 出入库时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "出入库时间")
|
||||
private Date operationTime;
|
||||
|
||||
/** 执行状态(0预入/预出,1已完成) */
|
||||
@Excel(name = "执行状态", readConverterExp = "0=预入/预出,1=已完成")
|
||||
private String execStatus;
|
||||
|
||||
/** 理货员(用户ID) */
|
||||
// @Excel(name = "理货员")
|
||||
private Integer operator;
|
||||
|
||||
/** 理货员名称(联表) */
|
||||
@Excel(name = "理货员")
|
||||
private String operatorName;
|
||||
|
||||
/** 施工队编码 */
|
||||
@Excel(name = "施工队编码")
|
||||
private String teamCode;
|
||||
|
||||
/** 是否需要配送(0否,1是,2配送中,3配送完成) */
|
||||
@Excel(name = "是否需要配送", readConverterExp = "0=否,1=是,2=配送中,3=配送完成")
|
||||
private String isDelivery;
|
||||
|
||||
/** 创建人 */
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新人 */
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/** 是否删除(0正常,1删除) */
|
||||
private String isDelete;
|
||||
|
||||
/** 入库 / 出库开始时间(查询用) */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startDate;
|
||||
|
||||
/** 入库 / 出库结束时间(查询用) */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endDate;
|
||||
|
||||
// ================= getter / setter =================
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -107,14 +123,6 @@ public class RkBill extends BaseEntity
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getRkType() {
|
||||
return rkType;
|
||||
}
|
||||
|
||||
public void setRkType(String rkType) {
|
||||
this.rkType = rkType;
|
||||
}
|
||||
|
||||
public String getWlType() {
|
||||
return wlType;
|
||||
}
|
||||
@@ -123,6 +131,14 @@ public class RkBill extends BaseEntity
|
||||
this.wlType = wlType;
|
||||
}
|
||||
|
||||
public String getWlTypeName() {
|
||||
return wlTypeName;
|
||||
}
|
||||
|
||||
public void setWlTypeName(String wlTypeName) {
|
||||
this.wlTypeName = wlTypeName;
|
||||
}
|
||||
|
||||
public String getCangku() {
|
||||
return cangku;
|
||||
}
|
||||
@@ -131,94 +147,20 @@ public class RkBill extends BaseEntity
|
||||
this.cangku = cangku;
|
||||
}
|
||||
|
||||
public String getRkTypeName() { return rkTypeName; }
|
||||
public void setRkTypeName(String rkTypeName) { this.rkTypeName = rkTypeName; }
|
||||
|
||||
public String getWlTypeName() { return wlTypeName; }
|
||||
public void setWlTypeName(String wlTypeName) { this.wlTypeName = wlTypeName; }
|
||||
|
||||
public String getCangkuName() { return cangkuName; }
|
||||
public void setCangkuName(String cangkuName) { this.cangkuName = cangkuName; }
|
||||
|
||||
public Date getRkTime() {
|
||||
return rkTime;
|
||||
public String getWarehouseName() {
|
||||
return warehouseName;
|
||||
}
|
||||
|
||||
public void setRkTime(Date rkTime) {
|
||||
this.rkTime = rkTime;
|
||||
public void setWarehouseName(String warehouseName) {
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public String getLihuoY() {
|
||||
return lihuoY;
|
||||
public String getParentWarehouseName() {
|
||||
return parentWarehouseName;
|
||||
}
|
||||
|
||||
public void setLihuoY(String lihuoY) {
|
||||
this.lihuoY = lihuoY;
|
||||
}
|
||||
|
||||
|
||||
public String getCkType() {
|
||||
return ckType;
|
||||
}
|
||||
|
||||
public void setCkType(String ckType) {
|
||||
this.ckType = ckType;
|
||||
}
|
||||
|
||||
public String getCkTypeName() {
|
||||
return ckTypeName;
|
||||
}
|
||||
|
||||
public void setCkTypeName(String ckTypeName) {
|
||||
this.ckTypeName = ckTypeName;
|
||||
}
|
||||
|
||||
public Date getCkTime() {
|
||||
return ckTime;
|
||||
}
|
||||
|
||||
public void setCkTime(Date ckTime) {
|
||||
this.ckTime = ckTime;
|
||||
}
|
||||
|
||||
public String getCkLihuoY() {
|
||||
return ckLihuoY;
|
||||
}
|
||||
|
||||
public void setCkLihuoY(String ckLihuoY) {
|
||||
this.ckLihuoY = ckLihuoY;
|
||||
}
|
||||
|
||||
public String getCkLihuoYName() {
|
||||
return ckLihuoYName;
|
||||
}
|
||||
|
||||
public void setCkLihuoYName(String ckLihuoYName) {
|
||||
this.ckLihuoYName = ckLihuoYName;
|
||||
}
|
||||
|
||||
public String getCkRemark() {
|
||||
return ckRemark;
|
||||
}
|
||||
|
||||
public void setCkRemark(String ckRemark) {
|
||||
this.ckRemark = ckRemark;
|
||||
}
|
||||
|
||||
public String getTeamCode() {
|
||||
return teamCode;
|
||||
}
|
||||
|
||||
public void setTeamCode(String teamCode) {
|
||||
this.teamCode = teamCode;
|
||||
}
|
||||
|
||||
public String getTeamName() {
|
||||
return teamName;
|
||||
}
|
||||
|
||||
public void setTeamName(String teamName) {
|
||||
this.teamName = teamName;
|
||||
public void setParentWarehouseName(String parentWarehouseName) {
|
||||
this.parentWarehouseName = parentWarehouseName;
|
||||
}
|
||||
|
||||
public String getBillNo() {
|
||||
@@ -229,12 +171,108 @@ public class RkBill extends BaseEntity
|
||||
this.billNo = billNo;
|
||||
}
|
||||
|
||||
public String getIsChuku() {
|
||||
return isChuku;
|
||||
public String getOperationType() {
|
||||
return operationType;
|
||||
}
|
||||
|
||||
public void setIsChuku(String isChuku) {
|
||||
this.isChuku = isChuku;
|
||||
public void setOperationType(String operationType) {
|
||||
this.operationType = operationType;
|
||||
}
|
||||
|
||||
public String getOperationTypeName() {
|
||||
return operationTypeName;
|
||||
}
|
||||
|
||||
public void setOperationTypeName(String operationTypeName) {
|
||||
this.operationTypeName = operationTypeName;
|
||||
}
|
||||
|
||||
public String getBizType() {
|
||||
return bizType;
|
||||
}
|
||||
|
||||
public void setBizType(String bizType) {
|
||||
this.bizType = bizType;
|
||||
}
|
||||
|
||||
public Date getOperationTime() {
|
||||
return operationTime;
|
||||
}
|
||||
|
||||
public void setOperationTime(Date operationTime) {
|
||||
this.operationTime = operationTime;
|
||||
}
|
||||
|
||||
public String getExecStatus() {
|
||||
return execStatus;
|
||||
}
|
||||
|
||||
public void setExecStatus(String execStatus) {
|
||||
this.execStatus = execStatus;
|
||||
}
|
||||
|
||||
public Integer getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
public void setOperator(Integer operator) {
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public String getOperatorName() {
|
||||
return operatorName;
|
||||
}
|
||||
|
||||
public void setOperatorName(String operatorName) {
|
||||
this.operatorName = operatorName;
|
||||
}
|
||||
|
||||
public String getTeamCode() {
|
||||
return teamCode;
|
||||
}
|
||||
|
||||
public void setTeamCode(String teamCode) {
|
||||
this.teamCode = teamCode;
|
||||
}
|
||||
|
||||
public String getIsDelivery() {
|
||||
return isDelivery;
|
||||
}
|
||||
|
||||
public void setIsDelivery(String isDelivery) {
|
||||
this.isDelivery = isDelivery;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getIsDelete() {
|
||||
@@ -245,31 +283,51 @@ public class RkBill extends BaseEntity
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public Date getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(Date startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
// ================= toString =================
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("rkType", getRkType())
|
||||
.append("wlType", getWlType())
|
||||
.append("cangku", getCangku())
|
||||
.append("rkTime", getRkTime())
|
||||
.append("lihuoY", getLihuoY())
|
||||
.append("ckType", getCkType())
|
||||
.append("ckTypeName", getCkTypeName())
|
||||
.append("ckTime", getCkTime())
|
||||
.append("ckLihuoY", getCkLihuoY())
|
||||
.append("ckLihuoYName", getCkLihuoYName())
|
||||
.append("ckRemark", getCkRemark())
|
||||
.append("teamCode", getTeamCode())
|
||||
.append("teamName", getTeamName())
|
||||
.append("billNo", getBillNo())
|
||||
.append("isChuku", getIsChuku())
|
||||
.append("isDelete", getIsDelete())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("id", id)
|
||||
.append("wlType", wlType)
|
||||
.append("wlTypeName", wlTypeName)
|
||||
.append("cangku", cangku)
|
||||
.append("warehouseName", warehouseName)
|
||||
.append("parentWarehouseName", parentWarehouseName)
|
||||
.append("billNo", billNo)
|
||||
.append("operationType", operationType)
|
||||
.append("operationTypeName", operationTypeName)
|
||||
.append("bizType", bizType)
|
||||
.append("operationTime", operationTime)
|
||||
.append("execStatus", execStatus)
|
||||
.append("operator", operator)
|
||||
.append("operatorName", operatorName)
|
||||
.append("teamCode", teamCode)
|
||||
.append("isDelivery", isDelivery)
|
||||
.append("createBy", createBy)
|
||||
.append("createTime", createTime)
|
||||
.append("updateBy", updateBy)
|
||||
.append("updateTime", updateTime)
|
||||
.append("isDelete", isDelete)
|
||||
.append("remark", getRemark())
|
||||
.append("startDate", startDate)
|
||||
.append("endDate", endDate)
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
837
src/main/java/com/zg/project/wisdom/domain/RkRecord.java
Normal file
837
src/main/java/com/zg/project/wisdom/domain/RkRecord.java
Normal file
@@ -0,0 +1,837 @@
|
||||
package com.zg.project.wisdom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.zg.framework.aspectj.lang.annotation.Excel;
|
||||
import com.zg.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 出入库记录对象 rk_record
|
||||
*
|
||||
* @author zg
|
||||
* @date 2026-01-20
|
||||
*/
|
||||
public class RkRecord extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 业务类型 */
|
||||
@Excel(name = "业务类型")
|
||||
private String bizType;
|
||||
|
||||
/** 出入库类型 */
|
||||
// @Excel(name = "出入库类型")
|
||||
private String operationType;
|
||||
|
||||
/** 出入库类型名称(联表) */
|
||||
@Excel(name = "出入库类型名称")
|
||||
private String operationTypeName;
|
||||
|
||||
|
||||
/** 执行状态(0预入/预出,1已完成) */
|
||||
@Excel(name = "执行状态", readConverterExp = "0=预入/预出,1=已完成")
|
||||
private String execStatus;
|
||||
|
||||
/** 物资类型 */
|
||||
// @Excel(name = "物资类型")
|
||||
private String wlType;
|
||||
|
||||
/** 物资类型名称(联表) */
|
||||
@Excel(name = "物资类型名称")
|
||||
private String wlTypeName;
|
||||
|
||||
/** 所属仓库 */
|
||||
// @Excel(name = "所属仓库")
|
||||
private String cangku;
|
||||
|
||||
/** 小仓名称 */
|
||||
@Excel(name = "所属仓库")
|
||||
private String warehouseName;
|
||||
|
||||
/** 大仓编码 */
|
||||
private String parentWarehouseCode;
|
||||
|
||||
/** 大仓名称 */
|
||||
@Excel(name = "大仓名称")
|
||||
private String parentWarehouseName;
|
||||
|
||||
/** 出入库时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@Excel(name = "出入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date operationTime;
|
||||
|
||||
/** 出入库理货员 */
|
||||
// @Excel(name = "出入库理货员")
|
||||
private Integer operator;
|
||||
|
||||
/** 出入库理货员 */
|
||||
@Excel(name = "出入库理货员")
|
||||
private String operatorName;
|
||||
|
||||
/** 是否已出库(0已入库,1已出库) */
|
||||
@Excel(name = "是否已出库", readConverterExp = "0=已入库,1已出库")
|
||||
private String isChuku;
|
||||
|
||||
/** 0:入库待审核,1已通过,2已驳回,3出库待审核 */
|
||||
// @Excel(name = "")
|
||||
private String status;
|
||||
|
||||
/** 库龄(天) */
|
||||
@Excel(name = "库龄(天)")
|
||||
private Long stockAge;
|
||||
|
||||
/** 单据号 */
|
||||
@Excel(name = "单据号")
|
||||
private String billNo;
|
||||
|
||||
/** 县局 */
|
||||
@Excel(name = "县局")
|
||||
private String xj;
|
||||
|
||||
/** 项目号 */
|
||||
@Excel(name = "项目号")
|
||||
private String xmNo;
|
||||
|
||||
/** 项目描述 */
|
||||
@Excel(name = "项目描述")
|
||||
private String xmMs;
|
||||
|
||||
/** 出库项目号(借用方项目) */
|
||||
@Excel(name = "出库项目号", readConverterExp = "借=用方项目")
|
||||
private String xmNoCk;
|
||||
|
||||
/** 出库项目描述(借用方项目描述) */
|
||||
@Excel(name = "出库项目描述", readConverterExp = "借=用方项目描述")
|
||||
private String xmMsCk;
|
||||
|
||||
/** 物料号 */
|
||||
@Excel(name = "物料号")
|
||||
private String wlNo;
|
||||
|
||||
/** 物料描述 */
|
||||
@Excel(name = "物料描述")
|
||||
private String wlMs;
|
||||
|
||||
/** 供应商编码 */
|
||||
@Excel(name = "供应商编码")
|
||||
private String gysNo;
|
||||
|
||||
/** 供应商名称 */
|
||||
@Excel(name = "供应商名称")
|
||||
private String gysMc;
|
||||
|
||||
/** 计划交货金额 */
|
||||
@Excel(name = "计划交货金额")
|
||||
private BigDecimal jhAmt;
|
||||
|
||||
/** 合同单价 */
|
||||
@Excel(name = "合同单价")
|
||||
private BigDecimal htDj;
|
||||
|
||||
/** SAP订单编号 */
|
||||
@Excel(name = "SAP订单编号")
|
||||
private String sapNo;
|
||||
|
||||
/** 行号 */
|
||||
@Excel(name = "行号")
|
||||
private String xh;
|
||||
|
||||
/** 计划交货数量 */
|
||||
@Excel(name = "计划交货数量")
|
||||
private BigDecimal jhQty;
|
||||
|
||||
/** 合同数量 */
|
||||
@Excel(name = "合同数量")
|
||||
private BigDecimal 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 teamCode;
|
||||
|
||||
/** 借用时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
// @Excel(name = "借用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date borrowTime;
|
||||
|
||||
/** 归还时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
// @Excel(name = "归还时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date returnTime;
|
||||
|
||||
/** 是否移库过(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;
|
||||
|
||||
/** 供应计划ID(对应供应计划表主键) */
|
||||
// @Excel(name = "供应计划ID", readConverterExp = "对=应供应计划表主键")
|
||||
private Long gysJhId;
|
||||
|
||||
/** $column.columnComment */
|
||||
// @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long rdid;
|
||||
|
||||
/** $column.columnComment */
|
||||
// @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long rdidCk;
|
||||
|
||||
/** $column.columnComment */
|
||||
// @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long sid;
|
||||
|
||||
/** 是否需要配送(0否,1是,2配送中,3配送完成) */
|
||||
// @Excel(name = "是否需要配送(0否,1是,2配送中,3配送完成)")
|
||||
private String isDelivery;
|
||||
|
||||
/** 封样编号1 */
|
||||
// @Excel(name = "封样编号1")
|
||||
private String fycde1;
|
||||
|
||||
/** 封样编号2 */
|
||||
// @Excel(name = "封样编号2")
|
||||
private String fycde2;
|
||||
|
||||
/** 1已更新 */
|
||||
// @Excel(name = "1已更新")
|
||||
private Long isUpdate;
|
||||
|
||||
/** 入库 / 出库开始时间(查询用) */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startDate;
|
||||
|
||||
/** 入库 / 出库结束时间(查询用) */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endDate;
|
||||
|
||||
/** 对应 rk_info 主键ID */
|
||||
private Long rkInfoId;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setBizType(String bizType) {
|
||||
this.bizType = bizType;
|
||||
}
|
||||
|
||||
public String getBizType() {
|
||||
return bizType;
|
||||
}
|
||||
|
||||
public void setOperationType(String operationType)
|
||||
{
|
||||
this.operationType = operationType;
|
||||
}
|
||||
|
||||
public String getOperationType()
|
||||
{
|
||||
return operationType;
|
||||
}
|
||||
|
||||
public String getOperationTypeName() {
|
||||
return operationTypeName;
|
||||
}
|
||||
|
||||
public void setOperationTypeName(String operationTypeName) {
|
||||
this.operationTypeName = operationTypeName;
|
||||
}
|
||||
|
||||
public String getExecStatus() {
|
||||
return execStatus;
|
||||
}
|
||||
|
||||
public void setExecStatus(String execStatus) {
|
||||
this.execStatus = execStatus;
|
||||
}
|
||||
public Long getStockAge() {
|
||||
return stockAge;
|
||||
}
|
||||
|
||||
public void setStockAge(Long stockAge) {
|
||||
this.stockAge = stockAge;
|
||||
}
|
||||
|
||||
public void setWlType(String wlType)
|
||||
{
|
||||
this.wlType = wlType;
|
||||
}
|
||||
|
||||
public String getWlType()
|
||||
{
|
||||
return wlType;
|
||||
}
|
||||
|
||||
public String getWlTypeName() {
|
||||
return wlTypeName;
|
||||
}
|
||||
|
||||
public void setWlTypeName(String wlTypeName) {
|
||||
this.wlTypeName = wlTypeName;
|
||||
}
|
||||
|
||||
public void setCangku(String cangku)
|
||||
{
|
||||
this.cangku = cangku;
|
||||
}
|
||||
|
||||
public String getCangku()
|
||||
{
|
||||
return cangku;
|
||||
}
|
||||
|
||||
public String getWarehouseName() {
|
||||
return warehouseName;
|
||||
}
|
||||
|
||||
public void setWarehouseName(String warehouseName) {
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public String getParentWarehouseCode() {
|
||||
return parentWarehouseCode;
|
||||
}
|
||||
|
||||
public void setParentWarehouseCode(String parentWarehouseCode) {
|
||||
this.parentWarehouseCode = parentWarehouseCode;
|
||||
}
|
||||
|
||||
public String getParentWarehouseName() {
|
||||
return parentWarehouseName;
|
||||
}
|
||||
|
||||
public void setParentWarehouseName(String parentWarehouseName) {
|
||||
this.parentWarehouseName = parentWarehouseName;
|
||||
}
|
||||
|
||||
public void setOperationTime(Date operationTime)
|
||||
{
|
||||
this.operationTime = operationTime;
|
||||
}
|
||||
|
||||
public Date getOperationTime()
|
||||
{
|
||||
return operationTime;
|
||||
}
|
||||
|
||||
public Integer getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
public void setOperator(Integer operator) {
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public String getOperatorName() {
|
||||
return operatorName;
|
||||
}
|
||||
|
||||
public void setOperatorName(String operatorName) {
|
||||
this.operatorName = operatorName;
|
||||
}
|
||||
|
||||
public void setIsChuku(String isChuku)
|
||||
{
|
||||
this.isChuku = isChuku;
|
||||
}
|
||||
|
||||
public String getIsChuku()
|
||||
{
|
||||
return isChuku;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setBillNo(String billNo)
|
||||
{
|
||||
this.billNo = billNo;
|
||||
}
|
||||
|
||||
public String getBillNo()
|
||||
{
|
||||
return billNo;
|
||||
}
|
||||
|
||||
public void setXj(String xj)
|
||||
{
|
||||
this.xj = xj;
|
||||
}
|
||||
|
||||
public String getXj()
|
||||
{
|
||||
return xj;
|
||||
}
|
||||
|
||||
public void setXmNo(String xmNo)
|
||||
{
|
||||
this.xmNo = xmNo;
|
||||
}
|
||||
|
||||
public String getXmNo()
|
||||
{
|
||||
return xmNo;
|
||||
}
|
||||
|
||||
public void setXmMs(String xmMs)
|
||||
{
|
||||
this.xmMs = xmMs;
|
||||
}
|
||||
|
||||
public String getXmMs()
|
||||
{
|
||||
return xmMs;
|
||||
}
|
||||
|
||||
public void setXmNoCk(String xmNoCk)
|
||||
{
|
||||
this.xmNoCk = xmNoCk;
|
||||
}
|
||||
|
||||
public String getXmNoCk()
|
||||
{
|
||||
return xmNoCk;
|
||||
}
|
||||
|
||||
public void setXmMsCk(String xmMsCk)
|
||||
{
|
||||
this.xmMsCk = xmMsCk;
|
||||
}
|
||||
|
||||
public String getXmMsCk()
|
||||
{
|
||||
return xmMsCk;
|
||||
}
|
||||
|
||||
public void setWlNo(String wlNo)
|
||||
{
|
||||
this.wlNo = wlNo;
|
||||
}
|
||||
|
||||
public String getWlNo()
|
||||
{
|
||||
return wlNo;
|
||||
}
|
||||
|
||||
public void setWlMs(String wlMs)
|
||||
{
|
||||
this.wlMs = wlMs;
|
||||
}
|
||||
|
||||
public String getWlMs()
|
||||
{
|
||||
return wlMs;
|
||||
}
|
||||
|
||||
public void setGysNo(String gysNo)
|
||||
{
|
||||
this.gysNo = gysNo;
|
||||
}
|
||||
|
||||
public String getGysNo()
|
||||
{
|
||||
return gysNo;
|
||||
}
|
||||
|
||||
public void setGysMc(String gysMc)
|
||||
{
|
||||
this.gysMc = gysMc;
|
||||
}
|
||||
|
||||
public String getGysMc()
|
||||
{
|
||||
return gysMc;
|
||||
}
|
||||
|
||||
public void setJhAmt(BigDecimal jhAmt)
|
||||
{
|
||||
this.jhAmt = jhAmt;
|
||||
}
|
||||
|
||||
public BigDecimal getJhAmt()
|
||||
{
|
||||
return jhAmt;
|
||||
}
|
||||
|
||||
public void setHtDj(BigDecimal htDj)
|
||||
{
|
||||
this.htDj = htDj;
|
||||
}
|
||||
|
||||
public BigDecimal getHtDj()
|
||||
{
|
||||
return htDj;
|
||||
}
|
||||
|
||||
public void setSapNo(String sapNo)
|
||||
{
|
||||
this.sapNo = sapNo;
|
||||
}
|
||||
|
||||
public String getSapNo()
|
||||
{
|
||||
return sapNo;
|
||||
}
|
||||
|
||||
public void setXh(String xh)
|
||||
{
|
||||
this.xh = xh;
|
||||
}
|
||||
|
||||
public String getXh()
|
||||
{
|
||||
return xh;
|
||||
}
|
||||
|
||||
public void setJhQty(BigDecimal jhQty)
|
||||
{
|
||||
this.jhQty = jhQty;
|
||||
}
|
||||
|
||||
public BigDecimal getJhQty()
|
||||
{
|
||||
return jhQty;
|
||||
}
|
||||
|
||||
public void setHtQty(BigDecimal htQty)
|
||||
{
|
||||
this.htQty = htQty;
|
||||
}
|
||||
|
||||
public BigDecimal getHtQty()
|
||||
{
|
||||
return htQty;
|
||||
}
|
||||
|
||||
public void setDw(String dw)
|
||||
{
|
||||
this.dw = dw;
|
||||
}
|
||||
|
||||
public String getDw()
|
||||
{
|
||||
return dw;
|
||||
}
|
||||
|
||||
public void setRealQty(BigDecimal realQty)
|
||||
{
|
||||
this.realQty = realQty;
|
||||
}
|
||||
|
||||
public BigDecimal getRealQty()
|
||||
{
|
||||
return realQty;
|
||||
}
|
||||
|
||||
public void setPcode(String pcode)
|
||||
{
|
||||
this.pcode = pcode;
|
||||
}
|
||||
|
||||
public String getPcode()
|
||||
{
|
||||
return pcode;
|
||||
}
|
||||
|
||||
public void setPcodeId(String pcodeId)
|
||||
{
|
||||
this.pcodeId = pcodeId;
|
||||
}
|
||||
|
||||
public String getPcodeId()
|
||||
{
|
||||
return pcodeId;
|
||||
}
|
||||
|
||||
public void setTrayCode(String trayCode)
|
||||
{
|
||||
this.trayCode = trayCode;
|
||||
}
|
||||
|
||||
public String getTrayCode()
|
||||
{
|
||||
return trayCode;
|
||||
}
|
||||
|
||||
public void setEntityId(String entityId)
|
||||
{
|
||||
this.entityId = entityId;
|
||||
}
|
||||
|
||||
public String getEntityId()
|
||||
{
|
||||
return entityId;
|
||||
}
|
||||
|
||||
public void setTeamCode(String teamCode)
|
||||
{
|
||||
this.teamCode = teamCode;
|
||||
}
|
||||
|
||||
public String getTeamCode()
|
||||
{
|
||||
return teamCode;
|
||||
}
|
||||
|
||||
public void setBorrowTime(Date borrowTime)
|
||||
{
|
||||
this.borrowTime = borrowTime;
|
||||
}
|
||||
|
||||
public Date getBorrowTime()
|
||||
{
|
||||
return borrowTime;
|
||||
}
|
||||
|
||||
public void setReturnTime(Date returnTime)
|
||||
{
|
||||
this.returnTime = returnTime;
|
||||
}
|
||||
|
||||
public Date getReturnTime()
|
||||
{
|
||||
return returnTime;
|
||||
}
|
||||
|
||||
public void setHasMoved(String hasMoved)
|
||||
{
|
||||
this.hasMoved = hasMoved;
|
||||
}
|
||||
|
||||
public String getHasMoved()
|
||||
{
|
||||
return hasMoved;
|
||||
}
|
||||
|
||||
public void setIsBorrowed(String isBorrowed)
|
||||
{
|
||||
this.isBorrowed = isBorrowed;
|
||||
}
|
||||
|
||||
public String getIsBorrowed()
|
||||
{
|
||||
return isBorrowed;
|
||||
}
|
||||
|
||||
public void setIsDelete(String isDelete)
|
||||
{
|
||||
this.isDelete = isDelete;
|
||||
}
|
||||
|
||||
public String getIsDelete()
|
||||
{
|
||||
return isDelete;
|
||||
}
|
||||
|
||||
public void setGysJhId(Long gysJhId)
|
||||
{
|
||||
this.gysJhId = gysJhId;
|
||||
}
|
||||
|
||||
public Long getGysJhId()
|
||||
{
|
||||
return gysJhId;
|
||||
}
|
||||
|
||||
public void setRdid(Long rdid)
|
||||
{
|
||||
this.rdid = rdid;
|
||||
}
|
||||
|
||||
public Long getRdid()
|
||||
{
|
||||
return rdid;
|
||||
}
|
||||
|
||||
public void setRdidCk(Long rdidCk)
|
||||
{
|
||||
this.rdidCk = rdidCk;
|
||||
}
|
||||
|
||||
public Long getRdidCk()
|
||||
{
|
||||
return rdidCk;
|
||||
}
|
||||
|
||||
public void setSid(Long sid)
|
||||
{
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
public Long getSid()
|
||||
{
|
||||
return sid;
|
||||
}
|
||||
|
||||
public void setIsDelivery(String isDelivery)
|
||||
{
|
||||
this.isDelivery = isDelivery;
|
||||
}
|
||||
|
||||
public String getIsDelivery()
|
||||
{
|
||||
return isDelivery;
|
||||
}
|
||||
|
||||
public void setFycde1(String fycde1)
|
||||
{
|
||||
this.fycde1 = fycde1;
|
||||
}
|
||||
|
||||
public String getFycde1()
|
||||
{
|
||||
return fycde1;
|
||||
}
|
||||
|
||||
public void setFycde2(String fycde2)
|
||||
{
|
||||
this.fycde2 = fycde2;
|
||||
}
|
||||
|
||||
public String getFycde2()
|
||||
{
|
||||
return fycde2;
|
||||
}
|
||||
|
||||
public void setIsUpdate(Long isUpdate)
|
||||
{
|
||||
this.isUpdate = isUpdate;
|
||||
}
|
||||
|
||||
public Long getIsUpdate()
|
||||
{
|
||||
return isUpdate;
|
||||
}
|
||||
|
||||
public Date getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(Date startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public Long getRkInfoId() {
|
||||
return rkInfoId;
|
||||
}
|
||||
|
||||
public void setRkInfoId(Long rkInfoId) {
|
||||
this.rkInfoId = rkInfoId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("bizType", getBizType())
|
||||
.append("operationType", getOperationType())
|
||||
.append("operationTypeName", operationTypeName)
|
||||
.append("execStatus", getExecStatus())
|
||||
.append("stockAge", getStockAge())
|
||||
.append("wlType", getWlType())
|
||||
.append("wlTypeName", wlTypeName)
|
||||
.append("cangku", getCangku())
|
||||
.append("warehouseName", getWarehouseName())
|
||||
.append("parentWarehouseCode", getParentWarehouseCode())
|
||||
.append("parentWarehouseName", getParentWarehouseName())
|
||||
.append("operationTime", getOperationTime())
|
||||
.append("operator", getOperator())
|
||||
.append("operatorName", operatorName)
|
||||
.append("isChuku", getIsChuku())
|
||||
.append("status", getStatus())
|
||||
.append("remark", getRemark())
|
||||
.append("billNo", getBillNo())
|
||||
.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("jhAmt", getJhAmt())
|
||||
.append("htDj", getHtDj())
|
||||
.append("sapNo", getSapNo())
|
||||
.append("xh", getXh())
|
||||
.append("jhQty", getJhQty())
|
||||
.append("htQty", getHtQty())
|
||||
.append("dw", getDw())
|
||||
.append("realQty", getRealQty())
|
||||
.append("pcode", getPcode())
|
||||
.append("pcodeId", getPcodeId())
|
||||
.append("trayCode", getTrayCode())
|
||||
.append("entityId", getEntityId())
|
||||
.append("teamCode", getTeamCode())
|
||||
.append("borrowTime", getBorrowTime())
|
||||
.append("returnTime", getReturnTime())
|
||||
.append("hasMoved", getHasMoved())
|
||||
.append("isBorrowed", getIsBorrowed())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("isDelete", getIsDelete())
|
||||
.append("gysJhId", getGysJhId())
|
||||
.append("rdid", getRdid())
|
||||
.append("rdidCk", getRdidCk())
|
||||
.append("sid", getSid())
|
||||
.append("isDelivery", getIsDelivery())
|
||||
.append("fycde1", getFycde1())
|
||||
.append("fycde2", getFycde2())
|
||||
.append("isUpdate", getIsUpdate())
|
||||
.append("startDate", startDate)
|
||||
.append("endDate", endDate)
|
||||
.append("rkInfoId", getRkInfoId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.zg.project.wisdom.domain.dto;
|
||||
|
||||
import com.zg.project.wisdom.domain.RkBill;
|
||||
import com.zg.project.wisdom.domain.RkInfo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class RkBillCreateDTO {
|
||||
|
||||
/** 单据主信息 */
|
||||
private RkBill rkBill;
|
||||
|
||||
/** 入库明细列表 */
|
||||
private List<RkInfo> rkInfoList;
|
||||
}
|
||||
@@ -1,34 +1,68 @@
|
||||
package com.zg.project.wisdom.mapper;
|
||||
|
||||
import com.zg.project.wisdom.domain.RkBill;
|
||||
import com.zg.project.wisdom.domain.dto.StockOutItemDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public interface RkBillMapper {
|
||||
import com.zg.project.wisdom.domain.RkBill;
|
||||
|
||||
/**
|
||||
* 新增入库单据主表
|
||||
* 库存单据Mapper接口
|
||||
*
|
||||
* @author zg
|
||||
* @date 2026-01-20
|
||||
*/
|
||||
int insertRkBill(RkBill bill);
|
||||
public interface RkBillMapper
|
||||
{
|
||||
/**
|
||||
* 查询库存单据
|
||||
*
|
||||
* @param id 库存单据主键
|
||||
* @return 库存单据
|
||||
*/
|
||||
public RkBill selectRkBillById(Long id);
|
||||
|
||||
/**
|
||||
* 查询入库单据主表列表(可选)
|
||||
* 查询库存单据列表
|
||||
*
|
||||
* @param rkBill 库存单据
|
||||
* @return 库存单据集合
|
||||
*/
|
||||
List<RkBill> selectRkBillList(RkBill bill);
|
||||
public List<RkBill> selectRkBillList(RkBill rkBill);
|
||||
|
||||
/**
|
||||
* 根据单据号查询
|
||||
* 新增库存单据
|
||||
*
|
||||
* @param rkBill 库存单据
|
||||
* @return 结果
|
||||
*/
|
||||
RkBill selectRkBillByBillNo(String billNo);
|
||||
public int insertRkBill(RkBill rkBill);
|
||||
|
||||
RkBill selectRkBillById(Long id);
|
||||
/**
|
||||
* 修改库存单据
|
||||
*
|
||||
* @param rkBill 库存单据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRkBill(RkBill rkBill);
|
||||
|
||||
int updateRkBill(RkBill rkBill);
|
||||
|
||||
int logicDeleteRkBillByIds(@Param("ids") Long[] ids);
|
||||
/**
|
||||
* 删除库存单据
|
||||
*
|
||||
* @param id 库存单据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkBillById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除库存单据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkBillByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据单据编号查询
|
||||
* @param billNo
|
||||
* @return
|
||||
*/
|
||||
RkBill selectByBillNo(String billNo);
|
||||
}
|
||||
|
||||
@@ -1,272 +1,61 @@
|
||||
package com.zg.project.wisdom.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zg.project.inventory.domain.vo.PcdeCntVO;
|
||||
import com.zg.project.inventory.domain.vo.RkInfoMatchVO;
|
||||
import com.zg.project.wisdom.domain.RkInfo;
|
||||
import com.zg.project.wisdom.domain.dto.RkInfoQueryDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 库存单据主Mapper接口
|
||||
* 库存单据明细Mapper接口
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-28
|
||||
* @date 2026-01-20
|
||||
*/
|
||||
public interface RkInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询库存单据主
|
||||
* 查询库存单据明细
|
||||
*
|
||||
* @param id 库存单据主主键
|
||||
* @return 库存单据主
|
||||
* @param id 库存单据明细主键
|
||||
* @return 库存单据明细
|
||||
*/
|
||||
public RkInfo selectRkInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询库存单据主列表
|
||||
* 查询库存单据明细列表
|
||||
*
|
||||
* @param rkInfo 库存单据主
|
||||
* @return 库存单据主集合
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 库存单据明细集合
|
||||
*/
|
||||
public List<RkInfo> selectRkInfoList(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 使用 selectRkInfoVo 作为子查询,外层按 bill_no 分组聚合
|
||||
* 新增库存单据明细
|
||||
*
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 结果
|
||||
*/
|
||||
List<RkInfo> selectGroupedByBill(@Param("q") RkInfoQueryDTO query,
|
||||
@Param("needAudit") Integer needAudit);
|
||||
|
||||
|
||||
List<RkInfo> selectBillHeaderList(@Param("q") RkInfoQueryDTO query,
|
||||
@Param("needAudit") Integer needAudit);
|
||||
public int insertRkInfo(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 修改库存单据主
|
||||
* 修改库存单据明细
|
||||
*
|
||||
* @param rkInfo 库存单据主
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRkInfo(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 根据出库单据号更新库存单据
|
||||
* 删除库存单据明细
|
||||
*
|
||||
* @param rkInfo 库存单据
|
||||
* @return 影响行数
|
||||
*/
|
||||
int updateByBillNoCk(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 删除库存单据主
|
||||
*
|
||||
* @param id 库存单据主主键
|
||||
* @param id 库存单据明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除库存单据主
|
||||
* 批量删除库存单据明细
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 新增入库单据
|
||||
* @param saveList
|
||||
* @return
|
||||
*/
|
||||
int batchInsertRkInfo(List<RkInfo> saveList);
|
||||
|
||||
/**
|
||||
* 根据库位编码查询入库单据
|
||||
* @param locationCode
|
||||
* @return
|
||||
*/
|
||||
int countRkInfoByLocationCode(@Param("locationCode") String locationCode);
|
||||
|
||||
/**
|
||||
* 查询已使用库位
|
||||
* @return
|
||||
*/
|
||||
List<String> selectUsedPcodes();
|
||||
|
||||
/**
|
||||
* 根据单据编号查询SAP单号
|
||||
* @param billNo
|
||||
* @return
|
||||
*/
|
||||
List<String> selectSapNoByBillNo(String billNo);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 统计超期库存
|
||||
* @return
|
||||
*/
|
||||
int countOverdueStock();
|
||||
|
||||
/**
|
||||
* 获取最新20条逾期库存列表
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<RkInfo> selectTopOverdueStock(@Param("limit") int limit);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param update
|
||||
*/
|
||||
void updateById(RkInfo update);
|
||||
|
||||
/**
|
||||
* 根据出库单据号查询订单编号
|
||||
* @param billNo
|
||||
* @return
|
||||
*/
|
||||
List<String> selectSapNoByCkBillNo(String billNo);
|
||||
|
||||
/**
|
||||
* 撤销出库
|
||||
* @param billNoCk
|
||||
*/
|
||||
int cancelStockOut(String billNoCk);
|
||||
|
||||
/**
|
||||
* 查看盘点扫描正常数据(限定场景)
|
||||
*/
|
||||
List<RkInfo> getByPcodeIdList(@Param("list") List<String> pcdeIds,
|
||||
@Param("sceneId") String sceneId);
|
||||
|
||||
/**
|
||||
* 查看盘点扫描未正常数据(限定场景)
|
||||
*/
|
||||
List<RkInfo> getMissedPcodeIds(@Param("list") List<String> pcdeIds,
|
||||
@Param("sceneId") String sceneId);
|
||||
|
||||
/**
|
||||
* 判断盘点扫描的id在场景内是否存在
|
||||
*/
|
||||
int existsByPcodeId(@Param("pcodeId") String pcodeId,
|
||||
@Param("sceneId") String sceneId);
|
||||
|
||||
/**
|
||||
* 获取指定仓库的盘点数据
|
||||
* @param warehouse
|
||||
* @return
|
||||
*/
|
||||
int countGetByWh(@Param("warehouse") String warehouse);
|
||||
|
||||
/**
|
||||
* 根据所属仓库查询所有的库位号和库位对应的货物数量
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<RkInfoMatchVO> getUnscannedPcodeByScene(@Param("sceneId") String sceneId,
|
||||
@Param("taskId") String taskId);
|
||||
|
||||
/**
|
||||
* 图表统计:每个库位有多少个货物
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<PcdeCntVO> selectPcdeCntFromRkInfo(List<String> ids);
|
||||
|
||||
/**
|
||||
* 还料入库
|
||||
* @param newEntry
|
||||
* @return
|
||||
*/
|
||||
int insertRkInfo(RkInfo newEntry);
|
||||
|
||||
/**
|
||||
* 修改入库单据状态
|
||||
*/
|
||||
int updateStatusByBillNo(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 查询每个 billNo 对应的一条入库记录(用于获取公共字段)
|
||||
*/
|
||||
List<RkInfo> selectOneForEachBillNo(@Param("billNos") List<String> billNos);
|
||||
|
||||
/**
|
||||
* 根据入库单据编号查询入库单据
|
||||
*/
|
||||
List<RkInfo> selectRkInfoListByBillNo(String billNo);
|
||||
|
||||
/**
|
||||
* 根据出库单据编号查询入库单据
|
||||
*/
|
||||
List<RkInfo> selectRkInfoListByBillNoCk(String billNo);
|
||||
|
||||
/**
|
||||
* 删除入库单据
|
||||
*/
|
||||
void markDeleteByBillNo(RkInfo rk);
|
||||
|
||||
/**
|
||||
* 删除出库单据
|
||||
*/
|
||||
void markDeleteByBillNoCk(RkInfo rk);
|
||||
|
||||
/**
|
||||
* 删除入库单据
|
||||
*/
|
||||
void deleteByBillNo(String billNo);
|
||||
|
||||
/**
|
||||
* 出库驳回时恢复单据表数据状态
|
||||
*/
|
||||
void revertRkInfoStatusByBillNoCk(RkInfo revert);
|
||||
|
||||
/**
|
||||
* 根据id查询入库单据
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<RkInfo> selectRkInfoByIds(@Param("ids") Long[] ids);
|
||||
|
||||
List<RkInfo> listRkInfoByPcode(String pcode);
|
||||
|
||||
/**
|
||||
* 查询 rk_info 全量明细(仅未删除)
|
||||
*/
|
||||
List<RkInfo> selectAllRkInfo(RkInfo query);
|
||||
|
||||
/**
|
||||
* 出入库明细分页查询(统计页面)
|
||||
*/
|
||||
List<RkInfo> selectRkInfoPageList(RkInfo query);
|
||||
|
||||
int updateBillInfo(RkInfo query);
|
||||
|
||||
/**
|
||||
* 修改出库单据状态
|
||||
*/
|
||||
|
||||
|
||||
int updateDeliveryStatus(@Param("ids") List<Long> ids,
|
||||
@Param("isDelivery") Integer isDelivery);
|
||||
|
||||
/**
|
||||
* 查询出库单据
|
||||
*/
|
||||
List<RkInfo> selectDeliveryCkList(RkInfo query);
|
||||
|
||||
|
||||
/**
|
||||
* 借料 / 还料专用列表查询
|
||||
*/
|
||||
List<RkInfo> selectBorrowAndReturnList(RkInfo rkInfo);
|
||||
|
||||
RkInfo selectHeaderByBillNo(String billNo);
|
||||
|
||||
String selectMaxBillNo(@Param("prefix") String prefix);
|
||||
|
||||
|
||||
Map<String, Object> selectStockStatistics(RkInfoQueryDTO query);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.zg.project.wisdom.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.zg.project.wisdom.domain.RkRecord;
|
||||
|
||||
/**
|
||||
* 出入库记录Mapper接口
|
||||
*
|
||||
* @author zg
|
||||
* @date 2026-01-20
|
||||
*/
|
||||
public interface RkRecordMapper
|
||||
{
|
||||
/**
|
||||
* 查询出入库记录
|
||||
*
|
||||
* @param id 出入库记录主键
|
||||
* @return 出入库记录
|
||||
*/
|
||||
public RkRecord selectRkRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 根据单据号查询出入库记录明细
|
||||
*
|
||||
* @param billNo 单据号
|
||||
* @return 出入库记录明细列表
|
||||
*/
|
||||
List<RkRecord> selectRkRecordListByBillNo(String billNo);
|
||||
|
||||
/**
|
||||
* 查询出入库记录列表
|
||||
*
|
||||
* @param rkRecord 出入库记录
|
||||
* @return 出入库记录集合
|
||||
*/
|
||||
public List<RkRecord> selectRkRecordList(RkRecord rkRecord);
|
||||
|
||||
/**
|
||||
* 新增出入库记录
|
||||
*
|
||||
* @param rkRecord 出入库记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRkRecord(RkRecord rkRecord);
|
||||
|
||||
/**
|
||||
* 修改出入库记录
|
||||
*
|
||||
* @param rkRecord 出入库记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRkRecord(RkRecord rkRecord);
|
||||
|
||||
/**
|
||||
* 删除出入库记录
|
||||
*
|
||||
* @param id 出入库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除出入库记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkRecordByIds(Long[] ids);
|
||||
}
|
||||
@@ -1,91 +1,91 @@
|
||||
package com.zg.project.wisdom.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zg.project.wisdom.domain.AuditSignature;
|
||||
import com.zg.project.wisdom.domain.vo.AuditSignatureReviewVO;
|
||||
|
||||
/**
|
||||
* 审批记录Service接口
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
public interface IAuditSignatureService
|
||||
{
|
||||
/**
|
||||
* 查询审批记录
|
||||
*
|
||||
* @param id 审批记录主键
|
||||
* @return 审批记录
|
||||
*/
|
||||
public AuditSignature selectAuditSignatureById(Long id);
|
||||
|
||||
/**
|
||||
* 查询审批记录列表
|
||||
*
|
||||
* @param auditSignature 审批记录
|
||||
* @return 审批记录集合
|
||||
*/
|
||||
public List<AuditSignature> selectAuditSignatureList(AuditSignature auditSignature);
|
||||
|
||||
|
||||
/**
|
||||
* 修改审批记录
|
||||
*
|
||||
* @param auditSignature 审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAuditSignature(AuditSignature auditSignature);
|
||||
|
||||
/**
|
||||
* 批量删除审批记录
|
||||
*
|
||||
* @param ids 需要删除的审批记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAuditSignatureByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除审批记录信息
|
||||
*
|
||||
* @param id 审批记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAuditSignatureById(Long id);
|
||||
|
||||
/**
|
||||
* 查询待审核的申请
|
||||
* @param approverId
|
||||
* @return
|
||||
*/
|
||||
int countPendingByUser(String approverId);
|
||||
|
||||
/**
|
||||
* 审批申请
|
||||
* @param audit
|
||||
*/
|
||||
void audit(AuditSignature audit);
|
||||
|
||||
/**
|
||||
* 查询审批记录列表
|
||||
*
|
||||
* @param auditSignature 审批记录
|
||||
* @return 审批记录集合
|
||||
*/
|
||||
List<AuditSignatureReviewVO> selectAuditSignatureReviewList(AuditSignature auditSignature);
|
||||
|
||||
/**
|
||||
* 查询我提交的审批列表
|
||||
*
|
||||
* @param auditSignature 审批记录
|
||||
* @return 审批记录集合
|
||||
*/
|
||||
List<AuditSignatureReviewVO> selectMySubmittedAuditList(AuditSignature auditSignature);
|
||||
|
||||
/**
|
||||
* 审批
|
||||
* @param auditSignature
|
||||
* @return
|
||||
*/
|
||||
int approveAuditSignature(AuditSignature auditSignature);
|
||||
}
|
||||
//package com.zg.project.wisdom.service;
|
||||
//
|
||||
//import java.util.List;
|
||||
//import com.zg.project.wisdom.domain.AuditSignature;
|
||||
//import com.zg.project.wisdom.domain.vo.AuditSignatureReviewVO;
|
||||
//
|
||||
///**
|
||||
// * 审批记录Service接口
|
||||
// *
|
||||
// * @author zg
|
||||
// * @date 2025-07-11
|
||||
// */
|
||||
//public interface IAuditSignatureService
|
||||
//{
|
||||
// /**
|
||||
// * 查询审批记录
|
||||
// *
|
||||
// * @param id 审批记录主键
|
||||
// * @return 审批记录
|
||||
// */
|
||||
// public AuditSignature selectAuditSignatureById(Long id);
|
||||
//
|
||||
// /**
|
||||
// * 查询审批记录列表
|
||||
// *
|
||||
// * @param auditSignature 审批记录
|
||||
// * @return 审批记录集合
|
||||
// */
|
||||
// public List<AuditSignature> selectAuditSignatureList(AuditSignature auditSignature);
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 修改审批记录
|
||||
// *
|
||||
// * @param auditSignature 审批记录
|
||||
// * @return 结果
|
||||
// */
|
||||
// public int updateAuditSignature(AuditSignature auditSignature);
|
||||
//
|
||||
// /**
|
||||
// * 批量删除审批记录
|
||||
// *
|
||||
// * @param ids 需要删除的审批记录主键集合
|
||||
// * @return 结果
|
||||
// */
|
||||
// public int deleteAuditSignatureByIds(Long[] ids);
|
||||
//
|
||||
// /**
|
||||
// * 删除审批记录信息
|
||||
// *
|
||||
// * @param id 审批记录主键
|
||||
// * @return 结果
|
||||
// */
|
||||
// public int deleteAuditSignatureById(Long id);
|
||||
//
|
||||
// /**
|
||||
// * 查询待审核的申请
|
||||
// * @param approverId
|
||||
// * @return
|
||||
// */
|
||||
// int countPendingByUser(String approverId);
|
||||
//
|
||||
// /**
|
||||
// * 审批申请
|
||||
// * @param audit
|
||||
// */
|
||||
// void audit(AuditSignature audit);
|
||||
//
|
||||
// /**
|
||||
// * 查询审批记录列表
|
||||
// *
|
||||
// * @param auditSignature 审批记录
|
||||
// * @return 审批记录集合
|
||||
// */
|
||||
// List<AuditSignatureReviewVO> selectAuditSignatureReviewList(AuditSignature auditSignature);
|
||||
//
|
||||
// /**
|
||||
// * 查询我提交的审批列表
|
||||
// *
|
||||
// * @param auditSignature 审批记录
|
||||
// * @return 审批记录集合
|
||||
// */
|
||||
// List<AuditSignatureReviewVO> selectMySubmittedAuditList(AuditSignature auditSignature);
|
||||
//
|
||||
// /**
|
||||
// * 审批
|
||||
// * @param auditSignature
|
||||
// * @return
|
||||
// */
|
||||
// int approveAuditSignature(AuditSignature auditSignature);
|
||||
//}
|
||||
|
||||
@@ -1,13 +1,69 @@
|
||||
package com.zg.project.wisdom.service;
|
||||
|
||||
import com.zg.project.wisdom.domain.RkBill;
|
||||
|
||||
import java.util.List;
|
||||
import com.zg.project.wisdom.domain.RkBill;
|
||||
import com.zg.project.wisdom.domain.dto.RkBillCreateDTO;
|
||||
|
||||
public interface IRkBillService {
|
||||
List<RkBill> selectRkBillList(RkBill rkBill);
|
||||
RkBill selectRkBillById(Long id);
|
||||
int insertRkBill(RkBill rkBill);
|
||||
int updateRkBill(RkBill rkBill);
|
||||
int logicDeleteRkBillByIds(Long[] ids);
|
||||
/**
|
||||
* 库存单据Service接口
|
||||
*
|
||||
* @author zg
|
||||
* @date 2026-01-20
|
||||
*/
|
||||
public interface IRkBillService
|
||||
{
|
||||
/**
|
||||
* 查询库存单据
|
||||
*
|
||||
* @param id 库存单据主键
|
||||
* @return 库存单据
|
||||
*/
|
||||
public RkBill selectRkBillById(Long id);
|
||||
|
||||
/**
|
||||
* 查询库存单据列表
|
||||
*
|
||||
* @param rkBill 库存单据
|
||||
* @return 库存单据集合
|
||||
*/
|
||||
public List<RkBill> selectRkBillList(RkBill rkBill);
|
||||
|
||||
/**
|
||||
* 新增库存单据
|
||||
*
|
||||
* @param rkBill 库存单据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRkBill(RkBill rkBill);
|
||||
|
||||
int insertRkBillAndDetail(RkBillCreateDTO dto);
|
||||
|
||||
/**
|
||||
* 向已有单据追加入库明细
|
||||
*/
|
||||
int appendRkBillDetail(RkBillCreateDTO dto);
|
||||
|
||||
/**
|
||||
* 修改库存单据
|
||||
*
|
||||
* @param rkBill 库存单据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRkBill(RkBill rkBill);
|
||||
|
||||
/**
|
||||
* 批量删除库存单据
|
||||
*
|
||||
* @param ids 需要删除的库存单据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkBillByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除库存单据信息
|
||||
*
|
||||
* @param id 库存单据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkBillById(Long id);
|
||||
}
|
||||
|
||||
@@ -1,210 +1,61 @@
|
||||
package com.zg.project.wisdom.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zg.project.inventory.domain.dto.QueryDTO;
|
||||
import com.zg.project.inventory.domain.vo.ChartDataVO;
|
||||
import com.zg.project.wisdom.domain.RkInfo;
|
||||
import com.zg.project.wisdom.domain.dto.*;
|
||||
import com.zg.project.wisdom.domain.vo.DeliveryBillVO;
|
||||
|
||||
/**
|
||||
* 库存单据主Service接口
|
||||
* 库存单据明细Service接口
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-05-28
|
||||
* @date 2026-01-20
|
||||
*/
|
||||
public interface IRkInfoService
|
||||
{
|
||||
/**
|
||||
* 查询库存单据主
|
||||
* 查询库存单据明细
|
||||
*
|
||||
* @param id 库存单据主主键
|
||||
* @return 库存单据主
|
||||
* @param id 库存单据明细主键
|
||||
* @return 库存单据明细
|
||||
*/
|
||||
public RkInfo selectRkInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询库存单据主列表
|
||||
* 查询库存单据明细列表
|
||||
*
|
||||
* @param rkInfo 库存单据主
|
||||
* @return 库存单据主集合
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 库存单据明细集合
|
||||
*/
|
||||
public List<RkInfo> selectRkInfoList(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 按 bill_no 分组返回单据列表(复用 selectRkInfoVo,SQL 外层分组聚合)
|
||||
* @param query 与 /list 相同的查询条件
|
||||
* 新增库存单据明细
|
||||
*
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 结果
|
||||
*/
|
||||
List<RkInfo> selectGroupedByBill(RkInfoQueryDTO query);
|
||||
|
||||
// 接口
|
||||
List<RkInfo> selectBillHeaderList(RkInfoQueryDTO query);
|
||||
|
||||
public int insertRkInfo(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 修改库存单据主
|
||||
* 修改库存单据明细
|
||||
*
|
||||
* @param rkInfo 库存单据主
|
||||
* @param rkInfo 库存单据明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRkInfo(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 根据出库单据号修改库存单据
|
||||
* 批量删除库存单据明细
|
||||
*
|
||||
* @param rkInfo 库存单据
|
||||
* @return 影响行数
|
||||
*/
|
||||
int updateRkInfoByBillNoCk(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 批量删除库存单据主
|
||||
*
|
||||
* @param ids 需要删除的库存单据主主键集合
|
||||
* @param ids 需要删除的库存单据明细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除库存单据主信息
|
||||
* 删除库存单据明细信息
|
||||
*
|
||||
* @param
|
||||
* @param id 库存单据明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteRkInfoById(RkCancelDTO dto);
|
||||
|
||||
/**
|
||||
* 批量新增入库记录
|
||||
* @param dto 入库数据
|
||||
* @return RkSubmitResultVO 提交结果
|
||||
*/
|
||||
void batchInsert(PcRkInfoBatchDTO dto);
|
||||
|
||||
/**
|
||||
* APP新增入库单据
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int batchInsertApp(RkInfoBatchDTO dto);
|
||||
|
||||
/**
|
||||
* 根据单据编号删除入库单据
|
||||
* @param billNo
|
||||
*/
|
||||
void deleteByBillNo(String billNo);
|
||||
|
||||
/**
|
||||
* 统计逾期库存数量
|
||||
* @return
|
||||
*/
|
||||
int countOverdueStock();
|
||||
|
||||
/**
|
||||
* 获取最新20条逾期库存列表
|
||||
* @param i
|
||||
* @return
|
||||
*/
|
||||
List<RkInfo> selectTopOverdueStock(int i);
|
||||
|
||||
/**
|
||||
* 批量出库
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int batchOutStock(StockOutDTO dto);
|
||||
|
||||
/**
|
||||
* 撤销出库
|
||||
* @param
|
||||
*/
|
||||
int deleteByCkBillNo(String billNoCk);
|
||||
|
||||
/**
|
||||
* 盘点开始匹配
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
void matchWithStatus(QueryDTO dto);
|
||||
|
||||
/**
|
||||
* 统计指定仓库的库存数量
|
||||
* @param warehouse
|
||||
* @return
|
||||
*/
|
||||
int countGetByWh(String warehouse);
|
||||
|
||||
/**
|
||||
* 图表统计:每个库位有多少个货物
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
ChartDataVO matchWithAll(QueryDTO dto);
|
||||
|
||||
/**
|
||||
* 还料入库
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int refundMaterial(RefundRequestDTO dto);
|
||||
|
||||
/**
|
||||
* 撤销出库
|
||||
* @param id
|
||||
*/
|
||||
void cancelOutStockById(Long id);
|
||||
|
||||
/**
|
||||
* 根据ids恢复出库或入库
|
||||
* @param ids
|
||||
*/
|
||||
void revertByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 按库位查询货物数量
|
||||
* @param pcode
|
||||
* @return
|
||||
*/
|
||||
List<RkInfo> listRkInfoByPcode(String pcode);
|
||||
|
||||
/**
|
||||
* 分页查询 rk_info 所有明细(仅未删除)
|
||||
*/
|
||||
List<RkInfo> selectAllRkInfo(RkInfo query);
|
||||
|
||||
/**
|
||||
* 出入库明细分页查询(统计页面)
|
||||
*/
|
||||
List<RkInfo> selectRkInfoPageList(RkInfo query);
|
||||
|
||||
public int updateBillInfo(RkInfo rkInfo);
|
||||
|
||||
/**
|
||||
* 追加入库
|
||||
* @param dto
|
||||
*/
|
||||
void appendToExistingBill(PcRkInfoBatchDTO dto);
|
||||
|
||||
/**
|
||||
* 按 rk_info 主键ID集合修改配送状态
|
||||
* @param ids rk_info.id 集合
|
||||
* @param isDelivery 配送状态
|
||||
*/
|
||||
int updateDeliveryStatus(List<Long> ids, Integer isDelivery);
|
||||
|
||||
/**
|
||||
* 获取指定出库单的配送信息
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<DeliveryBillVO> selectDeliveryBillList(RkInfo query);
|
||||
|
||||
List<RkInfo> selectBorrowAndReturnList(RkInfoQueryDTO query);
|
||||
|
||||
|
||||
/**
|
||||
* 根据入库单号查询单据头公共信息
|
||||
*/
|
||||
RkInfo selectHeaderByBillNo(String billNo);
|
||||
public int deleteRkInfoById(Long id);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.zg.project.wisdom.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.zg.project.wisdom.domain.RkRecord;
|
||||
|
||||
/**
|
||||
* 出入库记录Service接口
|
||||
*
|
||||
* @author zg
|
||||
* @date 2026-01-20
|
||||
*/
|
||||
public interface IRkRecordService
|
||||
{
|
||||
/**
|
||||
* 查询出入库记录
|
||||
*
|
||||
* @param id 出入库记录主键
|
||||
* @return 出入库记录
|
||||
*/
|
||||
public RkRecord selectRkRecordById(Long id);
|
||||
|
||||
/**
|
||||
* 根据单据号查询出入库记录明细
|
||||
*
|
||||
* @param billNo 单据号
|
||||
* @return 出入库记录明细列表
|
||||
*/
|
||||
List<RkRecord> selectRkRecordListByBillNo(String billNo);
|
||||
|
||||
/**
|
||||
* 查询出入库记录列表
|
||||
*
|
||||
* @param rkRecord 出入库记录
|
||||
* @return 出入库记录集合
|
||||
*/
|
||||
public List<RkRecord> selectRkRecordList(RkRecord rkRecord);
|
||||
|
||||
/**
|
||||
* 新增出入库记录
|
||||
*
|
||||
* @param rkRecord 出入库记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRkRecord(RkRecord rkRecord);
|
||||
|
||||
/**
|
||||
* 修改出入库记录
|
||||
*
|
||||
* @param rkRecord 出入库记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRkRecord(RkRecord rkRecord);
|
||||
|
||||
/**
|
||||
* 批量删除出入库记录
|
||||
*
|
||||
* @param ids 需要删除的出入库记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkRecordByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除出入库记录信息
|
||||
*
|
||||
* @param id 出入库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRkRecordById(Long id);
|
||||
}
|
||||
@@ -94,5 +94,5 @@ public interface RkStatisticsService {
|
||||
* @param dto 查询参数
|
||||
* @return { "total": 0, "rows": List<StockStatVO> }
|
||||
*/
|
||||
Map<String, Object> selectStockStatistics(RkInfoQueryDTO dto);
|
||||
// Map<String, Object> selectStockStatistics(RkInfoQueryDTO dto);
|
||||
}
|
||||
|
||||
@@ -1,292 +1,288 @@
|
||||
package com.zg.project.wisdom.service.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.zg.common.exception.ServiceException;
|
||||
import com.zg.common.utils.DateUtils;
|
||||
import com.zg.common.utils.SecurityUtils;
|
||||
import com.zg.common.utils.StringUtils;
|
||||
import com.zg.project.wisdom.domain.RkInfo;
|
||||
import com.zg.project.wisdom.domain.vo.AuditSignatureReviewVO;
|
||||
import com.zg.project.wisdom.domain.vo.AuditSignatureVo;
|
||||
import com.zg.project.wisdom.mapper.GysJhMapper;
|
||||
import com.zg.project.wisdom.mapper.RkInfoMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zg.project.wisdom.mapper.AuditSignatureMapper;
|
||||
import com.zg.project.wisdom.domain.AuditSignature;
|
||||
import com.zg.project.wisdom.service.IAuditSignatureService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import static com.zg.framework.datasource.DynamicDataSourceContextHolder.log;
|
||||
|
||||
/**
|
||||
* 审批记录Service业务层处理
|
||||
*
|
||||
* @author zg
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
@Service
|
||||
public class AuditSignatureServiceImpl implements IAuditSignatureService
|
||||
{
|
||||
@Autowired
|
||||
private AuditSignatureMapper auditSignatureMapper;
|
||||
|
||||
@Autowired
|
||||
private RkInfoMapper rkInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private GysJhMapper gysJhMapper;
|
||||
|
||||
/**
|
||||
* 查询审批记录
|
||||
*
|
||||
* @param id 审批记录主键
|
||||
* @return 审批记录
|
||||
*/
|
||||
@Override
|
||||
public AuditSignature selectAuditSignatureById(Long id)
|
||||
{
|
||||
return auditSignatureMapper.selectAuditSignatureById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询审批记录列表
|
||||
*
|
||||
* @param auditSignature 审批记录
|
||||
* @return 审批记录
|
||||
*/
|
||||
@Override
|
||||
public List<AuditSignature> selectAuditSignatureList(AuditSignature auditSignature)
|
||||
{
|
||||
return auditSignatureMapper.selectAuditSignatureList(auditSignature);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改审批记录
|
||||
*
|
||||
* @param auditSignature 审批记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAuditSignature(AuditSignature auditSignature)
|
||||
{
|
||||
auditSignature.setUpdateTime(DateUtils.getNowDate());
|
||||
return auditSignatureMapper.updateAuditSignature(auditSignature);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除审批记录
|
||||
*
|
||||
* @param ids 需要删除的审批记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAuditSignatureByIds(Long[] ids)
|
||||
{
|
||||
return auditSignatureMapper.deleteAuditSignatureByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除审批记录信息
|
||||
*
|
||||
* @param id 审批记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAuditSignatureById(Long id)
|
||||
{
|
||||
return auditSignatureMapper.deleteAuditSignatureById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询待审核的申请
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int countPendingByUser(String approverId) {
|
||||
return auditSignatureMapper.countPendingByUser(approverId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void audit(AuditSignature audit) {
|
||||
String userId = SecurityUtils.getUserId().toString();
|
||||
|
||||
// 1. 校验记录是否存在
|
||||
AuditSignature db = auditSignatureMapper.selectAuditSignatureById(audit.getId());
|
||||
if (db == null || "1".equals(db.getIsDelete())) {
|
||||
throw new ServiceException("审核记录不存在");
|
||||
}
|
||||
|
||||
// 2. 校验是否已审核
|
||||
if ("0".equals(db.getAuditResult()) || "1".equals(db.getAuditResult())) {
|
||||
throw new ServiceException("该记录已审核,不能重复操作");
|
||||
}
|
||||
|
||||
// 2.1 校验审核结果是否为空
|
||||
if (StringUtils.isBlank(audit.getAuditResult())) {
|
||||
throw new ServiceException("审核结果不能为空");
|
||||
}
|
||||
|
||||
// ✅ 如果是驳回,设置当前记录 is_current = 0
|
||||
if ("0".equals(audit.getAuditResult())) {
|
||||
audit.setIsCurrent("0");
|
||||
}
|
||||
|
||||
// 3. 更新审核记录本身
|
||||
audit.setApproverId(userId);
|
||||
audit.setUpdateBy(userId);
|
||||
audit.setUpdateTime(DateUtils.getNowDate());
|
||||
auditSignatureMapper.updateAuditSignature(audit);
|
||||
|
||||
// 4. 构建更新 rk_info 的状态记录(或删除记录)
|
||||
RkInfo rk = new RkInfo();
|
||||
rk.setUpdateBy(userId);
|
||||
rk.setUpdateTime(DateUtils.getNowDate());
|
||||
|
||||
if ("0".equals(db.getBillType())) {
|
||||
rk.setBillNo(db.getBillNo()); // 入库
|
||||
} else if ("1".equals(db.getBillType())) {
|
||||
rk.setBillNoCk(db.getBillNo()); // 出库
|
||||
}
|
||||
|
||||
// 5. 处理审核结果
|
||||
if ("1".equals(audit.getAuditResult())) {
|
||||
rk.setStatus("1"); // 审核通过
|
||||
if ("0".equals(db.getBillType())) {
|
||||
rk.setIsChuku("0"); // 入库:已入库
|
||||
} else if ("1".equals(db.getBillType())) {
|
||||
rk.setIsChuku("1"); // 出库:已出库
|
||||
}
|
||||
|
||||
// ✅ 如果是入库且通过,更新供应计划状态
|
||||
if ("0".equals(db.getBillType())) {
|
||||
List<RkInfo> rkList = rkInfoMapper.selectRkInfoListByBillNo(audit.getBillNo());
|
||||
Set<Long> jhIdSet = rkList.stream()
|
||||
.map(RkInfo::getGysJhId)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
for (Long jhId : jhIdSet) {
|
||||
gysJhMapper.updateStatusById(jhId,"1");
|
||||
}
|
||||
}
|
||||
|
||||
// ✅ 更新 rk_info 状态
|
||||
rkInfoMapper.updateStatusByBillNo(rk);
|
||||
|
||||
} else if ("0".equals(audit.getAuditResult())) {
|
||||
rk.setStatus("2"); // 审核驳回
|
||||
rk.setIsDelete("1"); // 逻辑删除
|
||||
rk.setUpdateBy(userId);
|
||||
rk.setUpdateTime(DateUtils.getNowDate());
|
||||
|
||||
// ✅ 调用统一逻辑删除方法
|
||||
if ("0".equals(db.getBillType())) {
|
||||
rk.setBillNo(db.getBillNo());
|
||||
rkInfoMapper.markDeleteByBillNo(rk);
|
||||
} else if ("1".equals(db.getBillType())) {
|
||||
rk.setBillNoCk(db.getBillNo());
|
||||
rkInfoMapper.markDeleteByBillNoCk(rk);
|
||||
// ✅ 恢复入库状态
|
||||
RkInfo revert = new RkInfo();
|
||||
revert.setBillNoCk(db.getBillNo()); // 出库单号
|
||||
revert.setStatus("1"); // 入库通过
|
||||
revert.setIsChuku("0"); // 未出库
|
||||
revert.setUpdateBy(userId);
|
||||
revert.setUpdateTime(DateUtils.getNowDate());
|
||||
rkInfoMapper.revertRkInfoStatusByBillNoCk(revert);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<AuditSignatureReviewVO> selectAuditSignatureReviewList(AuditSignature filter) {
|
||||
|
||||
// 1. 查询主记录列表(发起人签字图)
|
||||
List<AuditSignature> mainList = auditSignatureMapper.selectAuditMainList(filter);
|
||||
|
||||
// ✅ 批量提取所有 billNo
|
||||
Set<String> billNoSet = mainList.stream()
|
||||
.map(AuditSignature::getBillNo)
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
// 2. 一次性查询所有 billNo 对应的入库公共字段
|
||||
Map<String, RkInfo> rkInfoMap = new HashMap<>();
|
||||
if (!billNoSet.isEmpty()) {
|
||||
List<RkInfo> rkInfoList = rkInfoMapper.selectOneForEachBillNo(new ArrayList<>(billNoSet));
|
||||
rkInfoMap = rkInfoList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
rk -> StringUtils.isNotBlank(rk.getBillNoCk()) ? rk.getBillNoCk() : rk.getBillNo(),
|
||||
Function.identity(),
|
||||
(a, b) -> a
|
||||
));
|
||||
}
|
||||
|
||||
// 3. 构造返回结果列表
|
||||
List<AuditSignatureReviewVO> resultList = new ArrayList<>();
|
||||
for (AuditSignature main : mainList) {
|
||||
AuditSignatureReviewVO vo = new AuditSignatureReviewVO();
|
||||
BeanUtils.copyProperties(main, vo);
|
||||
|
||||
// 设置入库公共字段(若存在)
|
||||
RkInfo rk = rkInfoMap.get(main.getBillNo());
|
||||
if (rk != null) {
|
||||
vo.setRkTypeName(rk.getRkTypeName());
|
||||
vo.setCangkuName(rk.getCangkuName());
|
||||
vo.setWlTypeName(rk.getWlTypeName());
|
||||
vo.setLihuoYName(rk.getLihuoYName());
|
||||
vo.setCkTypeName(rk.getCkTypeName());
|
||||
vo.setTeamName(rk.getTeamName());
|
||||
vo.setLihuoY(rk.getLihuoY());
|
||||
}
|
||||
|
||||
// 查询该 billNo 下的现场照片 + 入库字段
|
||||
List<AuditSignatureVo> photoList = auditSignatureMapper.selectScenePhotosWithGoodsByBillNo(main.getBillNo());
|
||||
vo.setScenePhotos(photoList);
|
||||
|
||||
resultList.add(vo);
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<AuditSignatureReviewVO> selectMySubmittedAuditList(AuditSignature filter) {
|
||||
// 查询发起人/现场拍照图中主图(image_type = 0)记录
|
||||
List<AuditSignature> mainList = auditSignatureMapper.selectAuditMainListBySubmitter(filter);
|
||||
|
||||
List<AuditSignatureReviewVO> resultList = new ArrayList<>();
|
||||
for (AuditSignature main : mainList) {
|
||||
AuditSignatureReviewVO vo = new AuditSignatureReviewVO();
|
||||
BeanUtils.copyProperties(main, vo);
|
||||
|
||||
// 查询现场图(包含货物信息)
|
||||
String billNo = main.getBillNo();
|
||||
List<AuditSignatureVo> scenePhotos = auditSignatureMapper.selectScenePhotosWithGoodsByBillNo(billNo);
|
||||
vo.setScenePhotos(scenePhotos);
|
||||
|
||||
resultList.add(vo);
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int approveAuditSignature(AuditSignature auditSignature) {
|
||||
auditSignature.setUpdateTime(DateUtils.getNowDate());
|
||||
auditSignature.setSignerRole("1"); // 审核人
|
||||
auditSignature.setIsCurrent("1"); // 当前记录
|
||||
return auditSignatureMapper.approveAuditByBillNo(auditSignature);
|
||||
}
|
||||
}
|
||||
//package com.zg.project.wisdom.service.impl;
|
||||
//
|
||||
//import java.util.*;
|
||||
//import java.util.function.Function;
|
||||
//import java.util.stream.Collectors;
|
||||
//
|
||||
//import com.zg.common.exception.ServiceException;
|
||||
//import com.zg.common.utils.DateUtils;
|
||||
//import com.zg.common.utils.SecurityUtils;
|
||||
//import com.zg.common.utils.StringUtils;
|
||||
//import com.zg.project.wisdom.domain.vo.AuditSignatureReviewVO;
|
||||
//import com.zg.project.wisdom.domain.vo.AuditSignatureVo;
|
||||
//import com.zg.project.wisdom.mapper.GysJhMapper;
|
||||
//import com.zg.project.wisdom.mapper.RkInfoMapper;
|
||||
//import org.springframework.beans.BeanUtils;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//import com.zg.project.wisdom.mapper.AuditSignatureMapper;
|
||||
//import com.zg.project.wisdom.domain.AuditSignature;
|
||||
//import com.zg.project.wisdom.service.IAuditSignatureService;
|
||||
//import org.springframework.transaction.annotation.Transactional;
|
||||
//
|
||||
///**
|
||||
// * 审批记录Service业务层处理
|
||||
// *
|
||||
// * @author zg
|
||||
// * @date 2025-07-11
|
||||
// */
|
||||
//@Service
|
||||
//public class AuditSignatureServiceImpl implements IAuditSignatureService
|
||||
//{
|
||||
// @Autowired
|
||||
// private AuditSignatureMapper auditSignatureMapper;
|
||||
//
|
||||
// @Autowired
|
||||
// private RkInfoMapper rkInfoMapper;
|
||||
//
|
||||
// @Autowired
|
||||
// private GysJhMapper gysJhMapper;
|
||||
//
|
||||
// /**
|
||||
// * 查询审批记录
|
||||
// *
|
||||
// * @param id 审批记录主键
|
||||
// * @return 审批记录
|
||||
// */
|
||||
// @Override
|
||||
// public AuditSignature selectAuditSignatureById(Long id)
|
||||
// {
|
||||
// return auditSignatureMapper.selectAuditSignatureById(id);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查询审批记录列表
|
||||
// *
|
||||
// * @param auditSignature 审批记录
|
||||
// * @return 审批记录
|
||||
// */
|
||||
// @Override
|
||||
// public List<AuditSignature> selectAuditSignatureList(AuditSignature auditSignature)
|
||||
// {
|
||||
// return auditSignatureMapper.selectAuditSignatureList(auditSignature);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 修改审批记录
|
||||
// *
|
||||
// * @param auditSignature 审批记录
|
||||
// * @return 结果
|
||||
// */
|
||||
// @Override
|
||||
// public int updateAuditSignature(AuditSignature auditSignature)
|
||||
// {
|
||||
// auditSignature.setUpdateTime(DateUtils.getNowDate());
|
||||
// return auditSignatureMapper.updateAuditSignature(auditSignature);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 批量删除审批记录
|
||||
// *
|
||||
// * @param ids 需要删除的审批记录主键
|
||||
// * @return 结果
|
||||
// */
|
||||
// @Override
|
||||
// public int deleteAuditSignatureByIds(Long[] ids)
|
||||
// {
|
||||
// return auditSignatureMapper.deleteAuditSignatureByIds(ids);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除审批记录信息
|
||||
// *
|
||||
// * @param id 审批记录主键
|
||||
// * @return 结果
|
||||
// */
|
||||
// @Override
|
||||
// public int deleteAuditSignatureById(Long id)
|
||||
// {
|
||||
// return auditSignatureMapper.deleteAuditSignatureById(id);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查询待审核的申请
|
||||
// * @param
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public int countPendingByUser(String approverId) {
|
||||
// return auditSignatureMapper.countPendingByUser(approverId);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void audit(AuditSignature audit) {
|
||||
// String userId = SecurityUtils.getUserId().toString();
|
||||
//
|
||||
// // 1. 校验记录是否存在
|
||||
// AuditSignature db = auditSignatureMapper.selectAuditSignatureById(audit.getId());
|
||||
// if (db == null || "1".equals(db.getIsDelete())) {
|
||||
// throw new ServiceException("审核记录不存在");
|
||||
// }
|
||||
//
|
||||
// // 2. 校验是否已审核
|
||||
// if ("0".equals(db.getAuditResult()) || "1".equals(db.getAuditResult())) {
|
||||
// throw new ServiceException("该记录已审核,不能重复操作");
|
||||
// }
|
||||
//
|
||||
// // 2.1 校验审核结果是否为空
|
||||
// if (StringUtils.isBlank(audit.getAuditResult())) {
|
||||
// throw new ServiceException("审核结果不能为空");
|
||||
// }
|
||||
//
|
||||
// // ✅ 如果是驳回,设置当前记录 is_current = 0
|
||||
// if ("0".equals(audit.getAuditResult())) {
|
||||
// audit.setIsCurrent("0");
|
||||
// }
|
||||
//
|
||||
// // 3. 更新审核记录本身
|
||||
// audit.setApproverId(userId);
|
||||
// audit.setUpdateBy(userId);
|
||||
// audit.setUpdateTime(DateUtils.getNowDate());
|
||||
// auditSignatureMapper.updateAuditSignature(audit);
|
||||
//
|
||||
// // 4. 构建更新 rk_info 的状态记录(或删除记录)
|
||||
// RkInfo rk = new RkInfo();
|
||||
// rk.setUpdateBy(userId);
|
||||
// rk.setUpdateTime(DateUtils.getNowDate());
|
||||
//
|
||||
// if ("0".equals(db.getBillType())) {
|
||||
// rk.setBillNo(db.getBillNo()); // 入库
|
||||
// } else if ("1".equals(db.getBillType())) {
|
||||
// rk.setBillNoCk(db.getBillNo()); // 出库
|
||||
// }
|
||||
//
|
||||
// // 5. 处理审核结果
|
||||
// if ("1".equals(audit.getAuditResult())) {
|
||||
// rk.setStatus("1"); // 审核通过
|
||||
// if ("0".equals(db.getBillType())) {
|
||||
// rk.setIsChuku("0"); // 入库:已入库
|
||||
// } else if ("1".equals(db.getBillType())) {
|
||||
// rk.setIsChuku("1"); // 出库:已出库
|
||||
// }
|
||||
//
|
||||
// // ✅ 如果是入库且通过,更新供应计划状态
|
||||
// if ("0".equals(db.getBillType())) {
|
||||
// List<RkInfo> rkList = rkInfoMapper.selectRkInfoListByBillNo(audit.getBillNo());
|
||||
// Set<Long> jhIdSet = rkList.stream()
|
||||
// .map(RkInfo::getGysJhId)
|
||||
// .filter(Objects::nonNull)
|
||||
// .collect(Collectors.toSet());
|
||||
//
|
||||
// for (Long jhId : jhIdSet) {
|
||||
// gysJhMapper.updateStatusById(jhId,"1");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // ✅ 更新 rk_info 状态
|
||||
// rkInfoMapper.updateStatusByBillNo(rk);
|
||||
//
|
||||
// } else if ("0".equals(audit.getAuditResult())) {
|
||||
// rk.setStatus("2"); // 审核驳回
|
||||
// rk.setIsDelete("1"); // 逻辑删除
|
||||
// rk.setUpdateBy(userId);
|
||||
// rk.setUpdateTime(DateUtils.getNowDate());
|
||||
//
|
||||
// // ✅ 调用统一逻辑删除方法
|
||||
// if ("0".equals(db.getBillType())) {
|
||||
// rk.setBillNo(db.getBillNo());
|
||||
// rkInfoMapper.markDeleteByBillNo(rk);
|
||||
// } else if ("1".equals(db.getBillType())) {
|
||||
// rk.setBillNoCk(db.getBillNo());
|
||||
// rkInfoMapper.markDeleteByBillNoCk(rk);
|
||||
// // ✅ 恢复入库状态
|
||||
// RkInfo revert = new RkInfo();
|
||||
// revert.setBillNoCk(db.getBillNo()); // 出库单号
|
||||
// revert.setStatus("1"); // 入库通过
|
||||
// revert.setIsChuku("0"); // 未出库
|
||||
// revert.setUpdateBy(userId);
|
||||
// revert.setUpdateTime(DateUtils.getNowDate());
|
||||
// rkInfoMapper.revertRkInfoStatusByBillNoCk(revert);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public List<AuditSignatureReviewVO> selectAuditSignatureReviewList(AuditSignature filter) {
|
||||
//
|
||||
// // 1. 查询主记录列表(发起人签字图)
|
||||
// List<AuditSignature> mainList = auditSignatureMapper.selectAuditMainList(filter);
|
||||
//
|
||||
// // ✅ 批量提取所有 billNo
|
||||
// Set<String> billNoSet = mainList.stream()
|
||||
// .map(AuditSignature::getBillNo)
|
||||
// .filter(StringUtils::isNotBlank)
|
||||
// .collect(Collectors.toSet());
|
||||
//
|
||||
// // 2. 一次性查询所有 billNo 对应的入库公共字段
|
||||
// Map<String, RkInfo> rkInfoMap = new HashMap<>();
|
||||
// if (!billNoSet.isEmpty()) {
|
||||
// List<RkInfo> rkInfoList = rkInfoMapper.selectOneForEachBillNo(new ArrayList<>(billNoSet));
|
||||
// rkInfoMap = rkInfoList.stream()
|
||||
// .collect(Collectors.toMap(
|
||||
// rk -> StringUtils.isNotBlank(rk.getBillNoCk()) ? rk.getBillNoCk() : rk.getBillNo(),
|
||||
// Function.identity(),
|
||||
// (a, b) -> a
|
||||
// ));
|
||||
// }
|
||||
//
|
||||
// // 3. 构造返回结果列表
|
||||
// List<AuditSignatureReviewVO> resultList = new ArrayList<>();
|
||||
// for (AuditSignature main : mainList) {
|
||||
// AuditSignatureReviewVO vo = new AuditSignatureReviewVO();
|
||||
// BeanUtils.copyProperties(main, vo);
|
||||
//
|
||||
// // 设置入库公共字段(若存在)
|
||||
// RkInfo rk = rkInfoMap.get(main.getBillNo());
|
||||
// if (rk != null) {
|
||||
// vo.setRkTypeName(rk.getRkTypeName());
|
||||
// vo.setCangkuName(rk.getCangkuName());
|
||||
// vo.setWlTypeName(rk.getWlTypeName());
|
||||
// vo.setLihuoYName(rk.getLihuoYName());
|
||||
// vo.setCkTypeName(rk.getCkTypeName());
|
||||
// vo.setTeamName(rk.getTeamName());
|
||||
// vo.setLihuoY(rk.getLihuoY());
|
||||
// }
|
||||
//
|
||||
// // 查询该 billNo 下的现场照片 + 入库字段
|
||||
// List<AuditSignatureVo> photoList = auditSignatureMapper.selectScenePhotosWithGoodsByBillNo(main.getBillNo());
|
||||
// vo.setScenePhotos(photoList);
|
||||
//
|
||||
// resultList.add(vo);
|
||||
// }
|
||||
//
|
||||
// return resultList;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public List<AuditSignatureReviewVO> selectMySubmittedAuditList(AuditSignature filter) {
|
||||
// // 查询发起人/现场拍照图中主图(image_type = 0)记录
|
||||
// List<AuditSignature> mainList = auditSignatureMapper.selectAuditMainListBySubmitter(filter);
|
||||
//
|
||||
// List<AuditSignatureReviewVO> resultList = new ArrayList<>();
|
||||
// for (AuditSignature main : mainList) {
|
||||
// AuditSignatureReviewVO vo = new AuditSignatureReviewVO();
|
||||
// BeanUtils.copyProperties(main, vo);
|
||||
//
|
||||
// // 查询现场图(包含货物信息)
|
||||
// String billNo = main.getBillNo();
|
||||
// List<AuditSignatureVo> scenePhotos = auditSignatureMapper.selectScenePhotosWithGoodsByBillNo(billNo);
|
||||
// vo.setScenePhotos(scenePhotos);
|
||||
//
|
||||
// resultList.add(vo);
|
||||
// }
|
||||
//
|
||||
// return resultList;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int approveAuditSignature(AuditSignature auditSignature) {
|
||||
// auditSignature.setUpdateTime(DateUtils.getNowDate());
|
||||
// auditSignature.setSignerRole("1"); // 审核人
|
||||
// auditSignature.setIsCurrent("1"); // 当前记录
|
||||
// return auditSignatureMapper.approveAuditByBillNo(auditSignature);
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.util.List;
|
||||
|
||||
import com.zg.common.exception.ServiceException;
|
||||
import com.zg.common.utils.DateUtils;
|
||||
import com.zg.common.utils.EntityFillUtils;
|
||||
import com.zg.common.utils.SecurityUtils;
|
||||
import com.zg.project.information.domain.PcdeDetail;
|
||||
import com.zg.project.information.mapper.PcdeDetailMapper;
|
||||
@@ -224,9 +223,9 @@ public class MoveRecordServiceImpl implements IMoveRecordService
|
||||
);
|
||||
}
|
||||
|
||||
if (!insertList.isEmpty()) {
|
||||
rkInfoMapper.batchInsertRkInfo(insertList);
|
||||
}
|
||||
// if (!insertList.isEmpty()) {
|
||||
// rkInfoMapper.batchInsertRkInfo(insertList);
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,41 +1,351 @@
|
||||
package com.zg.project.wisdom.service.impl;
|
||||
|
||||
import com.zg.project.wisdom.domain.RkBill;
|
||||
import com.zg.project.wisdom.mapper.RkBillMapper;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.zg.common.utils.DateUtils;
|
||||
import com.zg.common.utils.SecurityUtils;
|
||||
import com.zg.common.utils.StringUtils;
|
||||
import com.zg.project.wisdom.domain.GysJh;
|
||||
import com.zg.project.wisdom.domain.RkInfo;
|
||||
import com.zg.project.wisdom.domain.RkRecord;
|
||||
import com.zg.project.wisdom.domain.dto.RkBillCreateDTO;
|
||||
import com.zg.project.wisdom.mapper.GysJhMapper;
|
||||
import com.zg.project.wisdom.mapper.RkInfoMapper;
|
||||
import com.zg.project.wisdom.mapper.RkRecordMapper;
|
||||
import com.zg.project.wisdom.service.IRkBillService;
|
||||
import com.zg.project.wisdom.utils.BillNoUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zg.project.wisdom.mapper.RkBillMapper;
|
||||
import com.zg.project.wisdom.domain.RkBill;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import static com.zg.common.utils.SecurityUtils.getUserId;
|
||||
|
||||
/**
|
||||
* 库存单据Service业务层处理
|
||||
*
|
||||
* @author zg
|
||||
* @date 2026-01-20
|
||||
*/
|
||||
@Service
|
||||
public class RkBillServiceImpl implements IRkBillService {
|
||||
|
||||
public class RkBillServiceImpl implements IRkBillService
|
||||
{
|
||||
@Autowired
|
||||
private RkBillMapper rkBillMapper;
|
||||
|
||||
@Override
|
||||
public List<RkBill> selectRkBillList(RkBill rkBill) {
|
||||
return rkBillMapper.selectRkBillList(rkBill);
|
||||
}
|
||||
@Autowired
|
||||
private RkInfoMapper rkInfoMapper;
|
||||
|
||||
@Autowired
|
||||
private RkRecordMapper rkRecordMapper;
|
||||
|
||||
@Autowired
|
||||
private GysJhMapper gysJhMapper;
|
||||
|
||||
/**
|
||||
* 查询库存单据
|
||||
*
|
||||
* @param id 库存单据主键
|
||||
* @return 库存单据
|
||||
*/
|
||||
@Override
|
||||
public RkBill selectRkBillById(Long id) {
|
||||
public RkBill selectRkBillById(Long id)
|
||||
{
|
||||
return rkBillMapper.selectRkBillById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询库存单据列表
|
||||
*
|
||||
* @param rkBill 库存单据
|
||||
* @return 库存单据
|
||||
*/
|
||||
@Override
|
||||
public int insertRkBill(RkBill rkBill) {
|
||||
public List<RkBill> selectRkBillList(RkBill rkBill)
|
||||
{
|
||||
return rkBillMapper.selectRkBillList(rkBill);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库存单据
|
||||
*
|
||||
* @param rkBill 库存单据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRkBill(RkBill rkBill)
|
||||
{
|
||||
return rkBillMapper.insertRkBill(rkBill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateRkBill(RkBill rkBill) {
|
||||
return rkBillMapper.updateRkBill(rkBill);
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertRkBillAndDetail(RkBillCreateDTO dto) {
|
||||
|
||||
if (dto == null || dto.getRkInfoList() == null || dto.getRkInfoList().isEmpty()) {
|
||||
throw new RuntimeException("入库明细不能为空");
|
||||
}
|
||||
|
||||
String billNo = BillNoUtil.generateTodayBillNo("RK", null);
|
||||
Date now = DateUtils.getNowDate();
|
||||
String userId = String.valueOf(SecurityUtils.getUserId());
|
||||
|
||||
// ================== 1. 主单 rk_bill ==================
|
||||
RkBill bill = new RkBill();
|
||||
if (dto.getRkBill() != null) {
|
||||
BeanUtils.copyProperties(dto.getRkBill(), bill);
|
||||
}
|
||||
|
||||
bill.setBillNo(billNo);
|
||||
bill.setBizType("0"); // 入库
|
||||
bill.setOperationTime(now);
|
||||
bill.setCreateTime(now);
|
||||
bill.setCreateBy(userId);
|
||||
bill.setIsDelete("0");
|
||||
|
||||
// operator:如果前端没传,默认当前登录人(Integer)
|
||||
if (bill.getOperator() == null) {
|
||||
bill.setOperator(Integer.valueOf(userId));
|
||||
}
|
||||
|
||||
// execStatus:前端优先,默认 1
|
||||
if (StringUtils.isBlank(bill.getExecStatus())) {
|
||||
bill.setExecStatus("1");
|
||||
}
|
||||
|
||||
rkBillMapper.insertRkBill(bill);
|
||||
|
||||
// ================== 2. 明细 + 事件 + 供应计划 ==================
|
||||
for (RkInfo info : dto.getRkInfoList()) {
|
||||
|
||||
// ---------- rk_info ----------
|
||||
info.setBillNo(billNo);
|
||||
info.setBizType(bill.getBizType());
|
||||
info.setOperationType(bill.getOperationType());
|
||||
info.setOperationTime(bill.getOperationTime());
|
||||
info.setOperator(bill.getOperator()); // Integer
|
||||
info.setWlType(bill.getWlType());
|
||||
info.setRemark(bill.getRemark());
|
||||
info.setCangku(bill.getCangku());
|
||||
|
||||
info.setIsChuku("0");
|
||||
info.setHasMoved("0");
|
||||
info.setIsBorrowed("0");
|
||||
info.setExecStatus(bill.getExecStatus());
|
||||
|
||||
info.setCreateTime(now);
|
||||
info.setCreateBy(userId);
|
||||
info.setIsDelete("0");
|
||||
|
||||
rkInfoMapper.insertRkInfo(info);
|
||||
|
||||
// ---------- rk_record ----------
|
||||
RkRecord record = buildInRkRecord(bill, info, now);
|
||||
record.setExecStatus(bill.getExecStatus());
|
||||
|
||||
rkRecordMapper.insertRkRecord(record);
|
||||
|
||||
// ---------- 供应计划 ----------
|
||||
handleGysJhAfterInStock(info);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
private void handleGysJhAfterInStock(RkInfo info) {
|
||||
|
||||
// 1. 未关联供应计划或无实际入库数量,直接跳过
|
||||
if (info.getGysJhId() == null || info.getRealQty() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. 扣减供应计划数量(jh_qty = jh_qty - realQty)
|
||||
gysJhMapper.decreaseJhQtyById(
|
||||
info.getGysJhId(),
|
||||
info.getRealQty()
|
||||
);
|
||||
|
||||
// 3. 查询最新供应计划数据(用于判断剩余数量)
|
||||
GysJh gysJh = gysJhMapper.selectGysJhById(info.getGysJhId());
|
||||
if (gysJh == null) {
|
||||
throw new RuntimeException("供应计划不存在,ID:" + info.getGysJhId());
|
||||
}
|
||||
|
||||
// 4. 根据剩余数量判断状态
|
||||
BigDecimal remainQty = gysJh.getJhQty();
|
||||
|
||||
String status;
|
||||
if (remainQty == null || remainQty.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
status = "1"; // 全部入库
|
||||
} else {
|
||||
status = "2"; // 部分入库
|
||||
}
|
||||
|
||||
// 5. 更新供应计划状态(⚠ 不使用 Map,直接参数)
|
||||
gysJhMapper.updateStatusById(gysJh.getId(), status);
|
||||
}
|
||||
|
||||
private RkRecord buildInRkRecord(RkBill bill, RkInfo info, Date now) {
|
||||
|
||||
RkRecord record = new RkRecord();
|
||||
|
||||
// ① 明细 → 事件快照
|
||||
BeanUtils.copyProperties(info, record);
|
||||
record.setId(null);
|
||||
|
||||
// ② 主单 → 事件上下文
|
||||
record.setBillNo(bill.getBillNo());
|
||||
record.setBizType(bill.getBizType());
|
||||
record.setOperationType(bill.getOperationType());
|
||||
record.setOperationTime(bill.getOperationTime());
|
||||
record.setOperator(bill.getOperator()); // Integer
|
||||
record.setWlType(bill.getWlType());
|
||||
record.setRemark(bill.getRemark());
|
||||
record.setCangku(bill.getCangku());
|
||||
|
||||
// ③ 状态字段
|
||||
record.setIsChuku("0");
|
||||
record.setHasMoved("0");
|
||||
record.setIsBorrowed("0");
|
||||
record.setIsDelete("0");
|
||||
|
||||
// ④ 审计字段
|
||||
record.setCreateTime(now);
|
||||
record.setCreateBy(bill.getCreateBy());
|
||||
|
||||
// ⑤ 关联明细
|
||||
record.setRkInfoId(info.getId());
|
||||
record.setRdid(info.getId());
|
||||
|
||||
return record;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int logicDeleteRkBillByIds(Long[] ids) {
|
||||
return rkBillMapper.logicDeleteRkBillByIds(ids);
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int appendRkBillDetail(RkBillCreateDTO dto) {
|
||||
|
||||
if (dto == null || dto.getRkBill() == null
|
||||
|| StringUtils.isBlank(dto.getRkBill().getBillNo())) {
|
||||
throw new RuntimeException("单据号不能为空");
|
||||
}
|
||||
|
||||
if (dto.getRkInfoList() == null || dto.getRkInfoList().isEmpty()) {
|
||||
throw new RuntimeException("入库明细不能为空");
|
||||
}
|
||||
|
||||
String billNo = dto.getRkBill().getBillNo();
|
||||
Date now = DateUtils.getNowDate();
|
||||
|
||||
// ================== 1. 查主单(存在性校验 + 不可改字段来源) ==================
|
||||
RkBill bill = rkBillMapper.selectByBillNo(billNo);
|
||||
if (bill == null) {
|
||||
throw new RuntimeException("单据不存在:" + billNo);
|
||||
}
|
||||
|
||||
// ================== 2. execStatus 以【前端传入】为准 ==================
|
||||
String execStatus = dto.getRkBill().getExecStatus();
|
||||
if (StringUtils.isBlank(execStatus)) {
|
||||
execStatus = bill.getExecStatus();
|
||||
}
|
||||
|
||||
// ================== 3. 追加明细 ==================
|
||||
for (RkInfo info : dto.getRkInfoList()) {
|
||||
|
||||
// ---------- 基础关联 ----------
|
||||
info.setBillNo(bill.getBillNo());
|
||||
|
||||
// ---------- 类型信息(不可由前端随意改) ----------
|
||||
info.setOperationType(bill.getOperationType());
|
||||
info.setBizType(bill.getBizType());
|
||||
info.setWlType(bill.getWlType());
|
||||
|
||||
// ---------- 仓库 ----------
|
||||
info.setCangku(bill.getCangku());
|
||||
|
||||
// ---------- 操作信息 ----------
|
||||
info.setOperationTime(now);
|
||||
info.setOperator(bill.getOperator());
|
||||
|
||||
// ---------- 执行状态 ----------
|
||||
info.setExecStatus(execStatus);
|
||||
|
||||
// ---------- 库存状态 ----------
|
||||
info.setIsChuku("0");
|
||||
info.setHasMoved("0");
|
||||
info.setIsBorrowed("0");
|
||||
|
||||
// ---------- 备注(关键新增) ----------
|
||||
// 明细备注优先,其次单据备注
|
||||
String finalRemark = info.getRemark();
|
||||
if (StringUtils.isBlank(finalRemark)) {
|
||||
finalRemark = bill.getRemark();
|
||||
}
|
||||
info.setRemark(finalRemark);
|
||||
|
||||
// ---------- 审计字段 ----------
|
||||
info.setCreateTime(now);
|
||||
info.setCreateBy(bill.getCreateBy());
|
||||
info.setIsDelete("0");
|
||||
|
||||
// ---------- 插入 rk_info ----------
|
||||
rkInfoMapper.insertRkInfo(info);
|
||||
|
||||
// ---------- rk_record:事件流水 ----------
|
||||
RkRecord record = buildInRkRecord(bill, info, now);
|
||||
record.setExecStatus(execStatus);
|
||||
record.setRkInfoId(info.getId());
|
||||
|
||||
// ⭐ 同步备注到事件表(非常重要)
|
||||
record.setRemark(finalRemark);
|
||||
|
||||
rkRecordMapper.insertRkRecord(record);
|
||||
|
||||
// ---------- 供应计划处理 ----------
|
||||
handleGysJhAfterInStock(info);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改库存单据
|
||||
*
|
||||
* @param rkBill 库存单据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRkBill(RkBill rkBill)
|
||||
{
|
||||
return rkBillMapper.updateRkBill(rkBill);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除库存单据
|
||||
*
|
||||
* @param ids 需要删除的库存单据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRkBillByIds(Long[] ids)
|
||||
{
|
||||
return rkBillMapper.deleteRkBillByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库存单据信息
|
||||
*
|
||||
* @param id 库存单据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRkBillById(Long id)
|
||||
{
|
||||
return rkBillMapper.deleteRkBillById(id);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,102 @@
|
||||
package com.zg.project.wisdom.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.zg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.zg.project.wisdom.mapper.RkRecordMapper;
|
||||
import com.zg.project.wisdom.domain.RkRecord;
|
||||
import com.zg.project.wisdom.service.IRkRecordService;
|
||||
|
||||
/**
|
||||
* 出入库记录Service业务层处理
|
||||
*
|
||||
* @author zg
|
||||
* @date 2026-01-20
|
||||
*/
|
||||
@Service
|
||||
public class RkRecordServiceImpl implements IRkRecordService
|
||||
{
|
||||
@Autowired
|
||||
private RkRecordMapper rkRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询出入库记录
|
||||
*
|
||||
* @param id 出入库记录主键
|
||||
* @return 出入库记录
|
||||
*/
|
||||
@Override
|
||||
public RkRecord selectRkRecordById(Long id)
|
||||
{
|
||||
return rkRecordMapper.selectRkRecordById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RkRecord> selectRkRecordListByBillNo(String billNo)
|
||||
{
|
||||
return rkRecordMapper.selectRkRecordListByBillNo(billNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出入库记录列表
|
||||
*
|
||||
* @param rkRecord 出入库记录
|
||||
* @return 出入库记录
|
||||
*/
|
||||
@Override
|
||||
public List<RkRecord> selectRkRecordList(RkRecord rkRecord)
|
||||
{
|
||||
return rkRecordMapper.selectRkRecordList(rkRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出入库记录
|
||||
*
|
||||
* @param rkRecord 出入库记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRkRecord(RkRecord rkRecord)
|
||||
{
|
||||
rkRecord.setCreateTime(DateUtils.getNowDate());
|
||||
return rkRecordMapper.insertRkRecord(rkRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出入库记录
|
||||
*
|
||||
* @param rkRecord 出入库记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRkRecord(RkRecord rkRecord)
|
||||
{
|
||||
rkRecord.setUpdateTime(DateUtils.getNowDate());
|
||||
return rkRecordMapper.updateRkRecord(rkRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除出入库记录
|
||||
*
|
||||
* @param ids 需要删除的出入库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRkRecordByIds(Long[] ids)
|
||||
{
|
||||
return rkRecordMapper.deleteRkRecordByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出入库记录信息
|
||||
*
|
||||
* @param id 出入库记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRkRecordById(Long id)
|
||||
{
|
||||
return rkRecordMapper.deleteRkRecordById(id);
|
||||
}
|
||||
}
|
||||
@@ -7,20 +7,16 @@ import com.zg.common.utils.StringUtils;
|
||||
import com.zg.common.utils.poi.ExcelUtil;
|
||||
import com.zg.project.wisdom.domain.dto.RkInfoQueryDTO;
|
||||
import com.zg.project.wisdom.domain.vo.*;
|
||||
import com.zg.project.wisdom.mapper.GysJhMapper;
|
||||
import com.zg.project.wisdom.mapper.RkInfoMapper;
|
||||
import com.zg.project.wisdom.mapper.RkStatisticsMapper;
|
||||
import com.zg.project.wisdom.service.RkStatisticsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.*;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
@@ -433,23 +429,23 @@ public class RkStatisticsServiceImpl implements RkStatisticsService {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectStockStatistics(RkInfoQueryDTO query) {
|
||||
|
||||
if (query.getIsChuku() == null) {
|
||||
query.setIsChuku("0"); // 默认只查在库
|
||||
}
|
||||
|
||||
Map<String, Object> result = rkInfoMapper.selectStockStatistics(query);
|
||||
|
||||
// 处理空值情况,防止前端拿到 null 报错
|
||||
if (result == null) {
|
||||
result = new HashMap<>();
|
||||
}
|
||||
result.putIfAbsent("sumMoney", 0);
|
||||
result.putIfAbsent("sumQty", 0);
|
||||
result.putIfAbsent("pcdeCount", 0);
|
||||
|
||||
return result;
|
||||
}
|
||||
// @Override
|
||||
// public Map<String, Object> selectStockStatistics(RkInfoQueryDTO query) {
|
||||
//
|
||||
// if (query.getIsChuku() == null) {
|
||||
// query.setIsChuku("0"); // 默认只查在库
|
||||
// }
|
||||
//
|
||||
// Map<String, Object> result = rkInfoMapper.selectStockStatistics(query);
|
||||
//
|
||||
// // 处理空值情况,防止前端拿到 null 报错
|
||||
// if (result == null) {
|
||||
// result = new HashMap<>();
|
||||
// }
|
||||
// result.putIfAbsent("sumMoney", 0);
|
||||
// result.putIfAbsent("sumQty", 0);
|
||||
// result.putIfAbsent("pcdeCount", 0);
|
||||
//
|
||||
// return result;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ spring:
|
||||
# 主库数据源
|
||||
master:
|
||||
# url: jdbc:mysql://47.100.212.83:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://192.168.1.28:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://192.168.1.28:3306/wisdomnew?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://192.168.1.28:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://192.168.1.192:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://192.168.1.251:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://localhost:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
|
||||
@@ -1,161 +1,223 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.zg.project.wisdom.mapper.RkBillMapper">
|
||||
|
||||
<!-- 新增单据主表 -->
|
||||
<insert id="insertRkBill" parameterType="com.zg.project.wisdom.domain.RkBill">
|
||||
INSERT INTO rk_bill (
|
||||
rk_type, wl_type, cangku, rk_time, lihuo_y,
|
||||
ck_type, ck_time, ck_lihuo_y, ck_remark, team_code,
|
||||
bill_no, is_chuku, is_delete,
|
||||
created_by, created_at,
|
||||
updated_by, updated_at
|
||||
) VALUES (
|
||||
#{rkType}, #{wlType}, #{cangku}, #{rkTime}, #{lihuoY},
|
||||
#{ckType}, #{ckTime}, #{ckLihuoY}, #{ckRemark}, #{teamCode},
|
||||
#{billNo}, #{isChuku}, #{isDelete},
|
||||
#{createBy}, #{createTime},
|
||||
#{updateBy}, #{updateTime}
|
||||
)
|
||||
</insert>
|
||||
<!-- ==================== ResultMap ==================== -->
|
||||
<resultMap type="RkBill" id="RkBillResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="wlType" column="wl_type"/>
|
||||
<result property="wlTypeName" column="wl_type_name"/>
|
||||
|
||||
<!-- 查询列表(可用于分页或展示) -->
|
||||
<select id="selectRkBillList"
|
||||
parameterType="com.zg.project.wisdom.domain.RkBill"
|
||||
resultType="com.zg.project.wisdom.domain.RkBill">
|
||||
<result property="cangku" column="cangku"/>
|
||||
<result property="warehouseName" column="warehouse_name"/>
|
||||
<result property="parentWarehouseName" column="parent_warehouse_name"/>
|
||||
|
||||
<result property="billNo" column="bill_no"/>
|
||||
|
||||
<result property="operationType" column="operation_type"/>
|
||||
<result property="operationTypeName" column="operation_type_name"/>
|
||||
|
||||
<result property="bizType" column="biz_type"/>
|
||||
<result property="operationTime" column="operation_time"/>
|
||||
<result property="execStatus" column="exec_status"/>
|
||||
|
||||
<result property="operator" column="operator"/>
|
||||
<result property="operatorName" column="operator_name"/>
|
||||
|
||||
<result property="teamCode" column="team_code"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="isDelivery" column="is_delivery"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- ==================== Base Select ==================== -->
|
||||
<sql id="selectRkBillVo">
|
||||
SELECT
|
||||
rb.id,
|
||||
rb.rk_type AS rkType,
|
||||
st.type_name AS rkTypeName,
|
||||
rb.wl_type AS wlType,
|
||||
mt.type_name AS wlTypeName,
|
||||
rb.cangku AS cangku,
|
||||
wh.warehouse_name AS cangkuName,
|
||||
rb.lihuo_y AS lihuoY,
|
||||
rb.rk_time AS rkTime,
|
||||
rb.bill_no AS billNo,
|
||||
rb.is_chuku AS isChuku,
|
||||
rb.wl_type,
|
||||
rb.cangku,
|
||||
rb.bill_no,
|
||||
rb.operation_type,
|
||||
rb.biz_type,
|
||||
rb.operation_time,
|
||||
rb.exec_status,
|
||||
rb.operator,
|
||||
rb.team_code,
|
||||
rb.remark,
|
||||
rb.is_delivery,
|
||||
rb.is_delete,
|
||||
|
||||
-- ✅ 出库相关字段(新增)
|
||||
rb.ck_type AS ckType,
|
||||
sot.ck_type_name AS ckTypeName,
|
||||
rb.ck_time AS ckTime,
|
||||
rb.ck_lihuo_y AS ckLihuoY,
|
||||
rb.ck_remark AS ckRemark,
|
||||
rb.team_code AS teamCode,
|
||||
ct.team_name AS teamName,
|
||||
-- 物资类型
|
||||
mt.type_name AS wl_type_name,
|
||||
|
||||
rb.is_delete AS isDelete,
|
||||
rb.created_by AS createBy,
|
||||
rb.created_at AS createTime,
|
||||
rb.updated_by AS updateBy,
|
||||
rb.updated_at AS updateTime
|
||||
-- 出 / 入库类型名称
|
||||
COALESCE(sit.type_name, sot.type_name) AS operation_type_name,
|
||||
|
||||
-- 操作人
|
||||
su.nick_name AS operator_name,
|
||||
|
||||
-- 小仓
|
||||
wh.warehouse_name AS warehouse_name,
|
||||
|
||||
-- 大仓(冗余字段)
|
||||
wh.parent_warehouse_name AS parent_warehouse_name
|
||||
|
||||
FROM rk_bill rb
|
||||
LEFT JOIN stock_in_type st ON rb.rk_type = st.type_code
|
||||
LEFT JOIN material_type mt ON rb.wl_type = mt.type_code
|
||||
LEFT JOIN warehouse_info wh ON rb.cangku = wh.warehouse_code
|
||||
LEFT JOIN stock_out_type sot ON rb.ck_type = sot.ck_type_code
|
||||
LEFT JOIN construction_team ct ON rb.team_code = ct.team_code
|
||||
WHERE rb.is_delete = '0'
|
||||
<if test="billNo != null and billNo != ''">
|
||||
AND rb.bill_no LIKE CONCAT('%', #{billNo}, '%')
|
||||
|
||||
-- 仓库(小仓)
|
||||
LEFT JOIN warehouse_info wh
|
||||
ON rb.cangku = wh.warehouse_code
|
||||
AND wh.status = 1
|
||||
|
||||
-- 物资类型
|
||||
LEFT JOIN material_type mt
|
||||
ON rb.wl_type = mt.type_code
|
||||
AND mt.status = 1
|
||||
|
||||
-- 入库类型
|
||||
LEFT JOIN stock_in_type sit
|
||||
ON rb.operation_type = sit.type_code
|
||||
AND sit.status = 1
|
||||
|
||||
-- 出库类型
|
||||
LEFT JOIN stock_out_type sot
|
||||
ON rb.operation_type = sot.type_code
|
||||
AND (sot.is_delete = '0' OR sot.is_delete IS NULL)
|
||||
|
||||
-- 操作人
|
||||
LEFT JOIN sys_user su
|
||||
ON rb.operator = su.user_id
|
||||
</sql>
|
||||
|
||||
<!-- ==================== List ==================== -->
|
||||
<select id="selectRkBillList" parameterType="RkBill" resultMap="RkBillResult">
|
||||
<include refid="selectRkBillVo"/>
|
||||
<where>
|
||||
<if test="wlType != null">AND rb.wl_type = #{wlType}</if>
|
||||
<if test="cangku != null and cangku != ''">AND rb.cangku = #{cangku}</if>
|
||||
<if test="billNo != null and billNo != ''">AND rb.bill_no = #{billNo}</if>
|
||||
<if test="operationType != null">AND rb.operation_type = #{operationType}</if>
|
||||
<if test="bizType != null">AND rb.biz_type = #{bizType}</if>
|
||||
<if test="operationTime != null">AND rb.operation_time = #{operationTime}</if>
|
||||
<!-- 时间区间(新增) -->
|
||||
<if test="startDate != null">
|
||||
AND rb.operation_time >= #{startDate}
|
||||
</if>
|
||||
ORDER BY rb.rk_time DESC
|
||||
<if test="endDate != null">
|
||||
AND rb.operation_time <= #{endDate}
|
||||
</if>
|
||||
<if test="execStatus != null">AND rb.exec_status = #{execStatus}</if>
|
||||
<if test="operator != null">AND rb.operator = #{operator}</if>
|
||||
<if test="teamCode != null and teamCode != ''">AND rb.team_code = #{teamCode}</if>
|
||||
<if test="isDelivery != null">AND rb.is_delivery = #{isDelivery}</if>
|
||||
<if test="isDelete != null">AND rb.is_delete = #{isDelete}</if>
|
||||
</where>
|
||||
ORDER BY rb.exec_status ASC, rb.operation_time DESC
|
||||
</select>
|
||||
|
||||
<!-- ==================== Detail ==================== -->
|
||||
<select id="selectRkBillById" parameterType="Long" resultMap="RkBillResult">
|
||||
<include refid="selectRkBillVo"/>
|
||||
WHERE rb.id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 根据单据号查询单条 -->
|
||||
<select id="selectRkBillByBillNo" resultType="com.zg.project.wisdom.domain.RkBill">
|
||||
<select id="selectByBillNo"
|
||||
parameterType="String"
|
||||
resultMap="RkBillResult">
|
||||
SELECT
|
||||
rb.id,
|
||||
rb.rk_type, st.type_name AS rkTypeName,
|
||||
rb.wl_type, mt.type_name AS wlTypeName,
|
||||
rb.cangku, wh.warehouse_name AS cangkuName,
|
||||
rb.rk_time, rb.lihuo_y,
|
||||
|
||||
rb.ck_type, sot.ck_type_name AS ckTypeName,
|
||||
rb.ck_time, rb.ck_lihuo_y,
|
||||
rb.ck_remark, rb.team_code, ct.team_name AS teamName,
|
||||
|
||||
rb.bill_no, rb.is_chuku, rb.is_delete,
|
||||
rb.created_by AS createBy, rb.created_at AS createTime,
|
||||
rb.updated_by AS updateBy, rb.updated_at AS updateTime,
|
||||
rb.remark
|
||||
|
||||
FROM rk_bill rb
|
||||
LEFT JOIN stock_in_type st ON rb.rk_type = st.type_code
|
||||
LEFT JOIN material_type mt ON rb.wl_type = mt.type_code
|
||||
LEFT JOIN warehouse_info wh ON rb.cangku = wh.warehouse_code
|
||||
LEFT JOIN stock_out_type sot ON rb.ck_type = sot.ck_type_code
|
||||
LEFT JOIN construction_team ct ON rb.team_code = ct.team_code
|
||||
|
||||
WHERE rb.bill_no = #{billNo} AND rb.is_delete = '0'
|
||||
id,
|
||||
wl_type,
|
||||
cangku,
|
||||
bill_no,
|
||||
operation_type,
|
||||
biz_type,
|
||||
operation_time,
|
||||
exec_status,
|
||||
operator,
|
||||
team_code,
|
||||
is_delivery,
|
||||
remark,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
is_delete
|
||||
FROM rk_bill
|
||||
WHERE bill_no = #{billNo}
|
||||
AND (is_delete = '0' OR is_delete IS NULL)
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<!-- 查询详情 -->
|
||||
<select id="selectRkBillById" resultType="com.zg.project.wisdom.domain.RkBill">
|
||||
SELECT
|
||||
rb.id,
|
||||
rb.rk_type, st.type_name AS rkTypeName,
|
||||
rb.wl_type, mt.type_name AS wlTypeName,
|
||||
rb.cangku, wh.warehouse_name AS cangkuName,
|
||||
rb.rk_time, rb.lihuo_y,
|
||||
|
||||
rb.ck_type, sot.ck_type_name AS ckTypeName,
|
||||
rb.ck_time, rb.ck_lihuo_y,
|
||||
rb.ck_remark, rb.team_code, ct.team_name AS teamName,
|
||||
<!-- ==================== Insert ==================== -->
|
||||
<insert id="insertRkBill"
|
||||
parameterType="com.zg.project.wisdom.domain.RkBill"
|
||||
useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
INSERT INTO rk_bill (
|
||||
bill_no,
|
||||
biz_type,
|
||||
wl_type,
|
||||
cangku,
|
||||
operation_type,
|
||||
operation_time,
|
||||
operator,
|
||||
exec_status,
|
||||
is_delivery,
|
||||
remark,
|
||||
create_by,
|
||||
create_time,
|
||||
is_delete
|
||||
) VALUES (
|
||||
#{billNo},
|
||||
#{bizType},
|
||||
#{wlType},
|
||||
#{cangku},
|
||||
#{operationType},
|
||||
#{operationTime},
|
||||
#{operator},
|
||||
#{execStatus},
|
||||
#{isDelivery},
|
||||
#{remark},
|
||||
#{createBy},
|
||||
#{createTime},
|
||||
#{isDelete}
|
||||
)
|
||||
</insert>
|
||||
|
||||
rb.bill_no, rb.is_chuku, rb.is_delete,
|
||||
rb.created_by AS createBy, rb.created_at AS createTime,
|
||||
rb.updated_by AS updateBy, rb.updated_at AS updateTime,
|
||||
rb.remark
|
||||
|
||||
FROM rk_bill rb
|
||||
LEFT JOIN stock_in_type st ON rb.rk_type = st.type_code
|
||||
LEFT JOIN material_type mt ON rb.wl_type = mt.type_code
|
||||
LEFT JOIN warehouse_info wh ON rb.cangku = wh.warehouse_code
|
||||
LEFT JOIN stock_out_type sot ON rb.ck_type = sot.ck_type_code
|
||||
LEFT JOIN construction_team ct ON rb.team_code = ct.team_code
|
||||
WHERE rb.id = #{id} AND rb.is_delete = '0'
|
||||
</select>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="updateRkBill" parameterType="com.zg.project.wisdom.domain.RkBill">
|
||||
<!-- ==================== Update ==================== -->
|
||||
<update id="updateRkBill" parameterType="RkBill">
|
||||
UPDATE rk_bill
|
||||
<set>
|
||||
<if test="rkType != null">rk_type = #{rkType},</if>
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<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="ckType != null">ck_type = #{ckType},</if>
|
||||
<if test="ckTime != null">ck_time = #{ckTime},</if>
|
||||
<if test="ckLihuoY != null">ck_lihuo_y = #{ckLihuoY},</if>
|
||||
<if test="ckRemark != null">ck_remark = #{ckRemark},</if>
|
||||
<if test="billNo != null and billNo != ''">bill_no = #{billNo},</if>
|
||||
<if test="operationType != null">operation_type = #{operationType},</if>
|
||||
<if test="bizType != null">biz_type = #{bizType},</if>
|
||||
<if test="operationTime != null">operation_time = #{operationTime},</if>
|
||||
<if test="execStatus != null">exec_status = #{execStatus},</if>
|
||||
<if test="operator != null">operator = #{operator},</if>
|
||||
<if test="teamCode != null">team_code = #{teamCode},</if>
|
||||
|
||||
<if test="billNo != null">bill_no = #{billNo},</if>
|
||||
<if test="isChuku != null">is_chuku = #{isChuku},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null">updated_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">updated_at = #{updateTime},</if>
|
||||
</set>
|
||||
<if test="isDelivery != null">is_delivery = #{isDelivery},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 批量逻辑删除 -->
|
||||
<update id="logicDeleteRkBillByIds">
|
||||
UPDATE rk_bill
|
||||
SET is_delete = '1'
|
||||
<!-- ==================== Delete ==================== -->
|
||||
<delete id="deleteRkBillById" parameterType="Long">
|
||||
DELETE FROM rk_bill WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRkBillByIds">
|
||||
DELETE FROM rk_bill
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
443
src/main/resources/mybatis/wisdom/RkRecordMapper.xml
Normal file
443
src/main/resources/mybatis/wisdom/RkRecordMapper.xml
Normal file
@@ -0,0 +1,443 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zg.project.wisdom.mapper.RkRecordMapper">
|
||||
|
||||
<!-- ===================== resultMap ===================== -->
|
||||
<resultMap type="RkRecord" id="RkRecordResult">
|
||||
<result property="id" column="id"/>
|
||||
|
||||
<!-- ✅ 新增:关联 rk_info 主键 -->
|
||||
<result property="rkInfoId" column="rk_info_id"/>
|
||||
|
||||
<result property="operationType" column="operation_type"/>
|
||||
<result property="operationTypeName" column="operation_type_name"/>
|
||||
|
||||
<result property="bizType" column="biz_type"/>
|
||||
|
||||
<result property="wlType" column="wl_type"/>
|
||||
<result property="wlTypeName" column="wl_type_name"/>
|
||||
|
||||
<result property="cangku" column="cangku"/>
|
||||
<result property="warehouseName" column="warehouse_name"/>
|
||||
<result property="parentWarehouseCode" column="parent_warehouse_code"/>
|
||||
<result property="parentWarehouseName" column="parent_warehouse_name"/>
|
||||
|
||||
<result property="operationTime" column="operation_time"/>
|
||||
<result property="operator" column="operator"/>
|
||||
<result property="operatorName" column="operator_name"/>
|
||||
|
||||
<result property="isChuku" column="is_chuku"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="execStatus" column="exec_status"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="billNo" column="bill_no"/>
|
||||
|
||||
<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="teamCode" column="team_code"/>
|
||||
|
||||
<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="gysJhId" column="gys_jh_id"/>
|
||||
<result property="rdid" column="rdid"/>
|
||||
<result property="rdidCk" column="rdid_ck"/>
|
||||
<result property="sid" column="sid"/>
|
||||
|
||||
<result property="isDelivery" column="is_delivery"/>
|
||||
<result property="fycde1" column="fycde_1"/>
|
||||
<result property="fycde2" column="fycde_2"/>
|
||||
<result property="isUpdate" column="is_update"/>
|
||||
|
||||
<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="selectRkRecordVo">
|
||||
SELECT
|
||||
rr.*,
|
||||
|
||||
/* 理货员姓名 */
|
||||
su.nick_name AS operator_name,
|
||||
|
||||
/* 物资类型名称 */
|
||||
mt.type_name AS wl_type_name,
|
||||
|
||||
/* 出入库类型名称:入库 / 出库 二选一 */
|
||||
COALESCE(sit.type_name, sot.type_name) AS operation_type_name,
|
||||
|
||||
/* 仓库信息:小仓/大仓 */
|
||||
wh.warehouse_name,
|
||||
wh.parent_warehouse_code,
|
||||
wh.parent_warehouse_name
|
||||
FROM rk_record rr
|
||||
LEFT JOIN sys_user su
|
||||
ON rr.operator = su.user_id
|
||||
LEFT JOIN material_type mt
|
||||
ON rr.wl_type = mt.type_code
|
||||
LEFT JOIN stock_in_type sit
|
||||
ON rr.operation_type = sit.type_code
|
||||
LEFT JOIN stock_out_type sot
|
||||
ON rr.operation_type = sot.type_code
|
||||
LEFT JOIN warehouse_info wh
|
||||
ON rr.cangku = wh.warehouse_code
|
||||
</sql>
|
||||
|
||||
<!-- ===================== 查询列表 ===================== -->
|
||||
<select id="selectRkRecordList" parameterType="RkRecord" resultMap="RkRecordResult">
|
||||
<include refid="selectRkRecordVo"/>
|
||||
<where>
|
||||
<if test="operationType != null and operationType != ''">
|
||||
AND rr.operation_type = #{operationType}
|
||||
</if>
|
||||
<if test="bizType != null and bizType != ''">
|
||||
AND rr.biz_type = #{bizType}
|
||||
</if>
|
||||
<if test="pcode != null and pcode != ''">
|
||||
AND rr.pcode = #{pcode}
|
||||
</if>
|
||||
<if test="wlType != null and wlType != ''">
|
||||
AND rr.wl_type = #{wlType}
|
||||
</if>
|
||||
<if test="cangku != null and cangku != ''">
|
||||
AND rr.cangku = #{cangku}
|
||||
</if>
|
||||
<if test="operator != null and operator != ''">
|
||||
AND rr.operator = #{operator}
|
||||
</if>
|
||||
<if test="isChuku != null and isChuku != ''">
|
||||
AND rr.is_chuku = #{isChuku}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND rr.status = #{status}
|
||||
</if>
|
||||
<if test="execStatus != null and execStatus != ''">
|
||||
AND rr.exec_status = #{execStatus}
|
||||
</if>
|
||||
<if test="billNo != null and billNo != ''">
|
||||
AND rr.bill_no = #{billNo}
|
||||
</if>
|
||||
<if test="isDelivery != null and isDelivery != ''">
|
||||
AND rr.is_delivery = #{isDelivery}
|
||||
</if>
|
||||
<!-- 项目号 -->
|
||||
<if test="xmNo != null and xmNo != ''">
|
||||
AND rr.xm_no LIKE concat('%', #{xmNo}, '%')
|
||||
</if>
|
||||
<if test="xmMs != null and xmMs != ''">
|
||||
AND rr.xm_ms LIKE concat('%', #{xmMs}, '%')
|
||||
</if>
|
||||
|
||||
<!-- 订单编号 -->
|
||||
<if test="sapNo != null and sapNo != ''">
|
||||
AND rr.sap_no LIKE concat('%', #{sapNo}, '%')
|
||||
</if>
|
||||
|
||||
<!-- 供应商名称 -->
|
||||
<if test="gysMc != null and gysMc != ''">
|
||||
AND rr.gys_mc LIKE concat('%', #{gysMc}, '%')
|
||||
</if>
|
||||
|
||||
<!-- 所属小仓(warehouseCode 实际就是 cangku) -->
|
||||
<if test="cangku != null and cangku != ''">
|
||||
AND rr.cangku = #{cangku}
|
||||
</if>
|
||||
<if test="wlNo != null and wlNo != ''">
|
||||
AND rr.wl_no LIKE concat('%', #{wlNo}, '%')
|
||||
</if>
|
||||
<!-- 物料描述 -->
|
||||
<if test="wlMs != null and wlMs != ''">
|
||||
AND rr.wl_ms LIKE concat('%', #{wlMs}, '%')
|
||||
</if>
|
||||
|
||||
<!-- 默认不查删除 -->
|
||||
<if test="isDelete == null">
|
||||
AND (rr.is_delete = '0' OR rr.is_delete = 0 OR rr.is_delete IS NULL)
|
||||
</if>
|
||||
<!-- 如果前端明确传 isDelete,则按传入的精确过滤 -->
|
||||
<if test="isDelete != null and isDelete != ''">
|
||||
AND rr.is_delete = #{isDelete}
|
||||
</if>
|
||||
<!-- 出入库时间范围 -->
|
||||
<if test="startDate != null">
|
||||
AND rr.operation_time >= #{startDate}
|
||||
</if>
|
||||
|
||||
<if test="endDate != null">
|
||||
AND rr.operation_time <= #{endDate}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY rr.operation_time DESC
|
||||
</select>
|
||||
|
||||
<!-- ===================== 按 ID 查询 ===================== -->
|
||||
<select id="selectRkRecordById" parameterType="Long" resultMap="RkRecordResult">
|
||||
<include refid="selectRkRecordVo"/>
|
||||
WHERE rr.id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- ===================== 按单号查询(时间正序) ===================== -->
|
||||
<select id="selectRkRecordListByBillNo" parameterType="String" resultMap="RkRecordResult">
|
||||
<include refid="selectRkRecordVo"/>
|
||||
WHERE rr.bill_no = #{billNo}
|
||||
AND (rr.is_delete = '0' OR rr.is_delete = 0 OR rr.is_delete IS NULL)
|
||||
ORDER BY rr.operation_time ASC
|
||||
</select>
|
||||
|
||||
<!-- ===================== 新增 ===================== -->
|
||||
<insert id="insertRkRecord"
|
||||
parameterType="RkRecord"
|
||||
useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
INSERT INTO rk_record (
|
||||
|
||||
<!-- ✅ 新增:关联 rk_info 主键 -->
|
||||
rk_info_id,
|
||||
|
||||
operation_type,
|
||||
biz_type,
|
||||
wl_type,
|
||||
cangku,
|
||||
operation_time,
|
||||
operator,
|
||||
|
||||
is_chuku,
|
||||
status,
|
||||
exec_status,
|
||||
remark,
|
||||
bill_no,
|
||||
|
||||
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,
|
||||
team_code,
|
||||
|
||||
borrow_time,
|
||||
return_time,
|
||||
has_moved,
|
||||
is_borrowed,
|
||||
|
||||
gys_jh_id,
|
||||
rdid,
|
||||
rdid_ck,
|
||||
sid,
|
||||
|
||||
is_delivery,
|
||||
fycde_1,
|
||||
fycde_2,
|
||||
is_update,
|
||||
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
is_delete
|
||||
)
|
||||
VALUES (
|
||||
|
||||
<!-- ✅ 新增:关联 rk_info 主键 -->
|
||||
#{rkInfoId},
|
||||
|
||||
#{operationType},
|
||||
#{bizType},
|
||||
#{wlType},
|
||||
#{cangku},
|
||||
#{operationTime},
|
||||
#{operator},
|
||||
|
||||
#{isChuku},
|
||||
#{status},
|
||||
#{execStatus},
|
||||
#{remark},
|
||||
#{billNo},
|
||||
|
||||
#{xj},
|
||||
#{xmNo},
|
||||
#{xmMs},
|
||||
#{xmNoCk},
|
||||
#{xmMsCk},
|
||||
|
||||
#{wlNo},
|
||||
#{wlMs},
|
||||
|
||||
#{gysNo},
|
||||
#{gysMc},
|
||||
|
||||
#{jhAmt},
|
||||
#{htDj},
|
||||
#{sapNo},
|
||||
#{xh},
|
||||
|
||||
#{jhQty},
|
||||
#{htQty},
|
||||
#{dw},
|
||||
#{realQty},
|
||||
|
||||
#{pcode},
|
||||
#{pcodeId},
|
||||
#{trayCode},
|
||||
#{entityId},
|
||||
#{teamCode},
|
||||
|
||||
#{borrowTime},
|
||||
#{returnTime},
|
||||
#{hasMoved},
|
||||
#{isBorrowed},
|
||||
|
||||
#{gysJhId},
|
||||
#{rdid},
|
||||
#{rdidCk},
|
||||
#{sid},
|
||||
|
||||
#{isDelivery},
|
||||
#{fycde1},
|
||||
#{fycde2},
|
||||
#{isUpdate},
|
||||
|
||||
#{createBy},
|
||||
#{createTime},
|
||||
#{updateBy},
|
||||
#{updateTime},
|
||||
#{isDelete}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- ===================== 更新 ===================== -->
|
||||
<update id="updateRkRecord" parameterType="RkRecord">
|
||||
UPDATE rk_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
||||
<!-- ✅ 新增:支持更新 rk_info_id(不影响你原逻辑,不传就不更新) -->
|
||||
<if test="rkInfoId != null">rk_info_id = #{rkInfoId},</if>
|
||||
|
||||
<if test="operationType != null">operation_type = #{operationType},</if>
|
||||
<if test="bizType != null">biz_type = #{bizType},</if>
|
||||
<if test="wlType != null">wl_type = #{wlType},</if>
|
||||
<if test="cangku != null">cangku = #{cangku},</if>
|
||||
<if test="operationTime != null">operation_time = #{operationTime},</if>
|
||||
<if test="operator != null">operator = #{operator},</if>
|
||||
|
||||
<if test="isChuku != null">is_chuku = #{isChuku},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="execStatus != null">exec_status = #{execStatus},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="billNo != null">bill_no = #{billNo},</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="teamCode != null">team_code = #{teamCode},</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="gysJhId != null">gys_jh_id = #{gysJhId},</if>
|
||||
<if test="rdid != null">rdid = #{rdid},</if>
|
||||
<if test="rdidCk != null">rdid_ck = #{rdidCk},</if>
|
||||
<if test="sid != null">sid = #{sid},</if>
|
||||
|
||||
<if test="isDelivery != null">is_delivery = #{isDelivery},</if>
|
||||
<if test="fycde1 != null">fycde_1 = #{fycde1},</if>
|
||||
<if test="fycde2 != null">fycde_2 = #{fycde2},</if>
|
||||
<if test="isUpdate != null">is_update = #{isUpdate},</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="deleteRkRecordById" parameterType="Long">
|
||||
DELETE FROM rk_record WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRkRecordByIds" parameterType="String">
|
||||
DELETE FROM rk_record WHERE id IN
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user