功能重构开发0130
This commit is contained in:
@@ -3,6 +3,7 @@ package com.zg.project.wisdom.controller;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.zg.project.wisdom.domain.dto.BorrowReturnDTO;
|
import com.zg.project.wisdom.domain.dto.BorrowReturnDTO;
|
||||||
import com.zg.project.wisdom.domain.dto.RkBillCreateDTO;
|
import com.zg.project.wisdom.domain.dto.RkBillCreateDTO;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@@ -42,8 +43,11 @@ public class RkBillController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('wisdom:bill:list')")
|
@PreAuthorize("@ss.hasPermi('wisdom:bill:list')")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public TableDataInfo list(@RequestBody RkBill rkBill) {
|
public TableDataInfo list(@RequestBody RkBill rkBill) {
|
||||||
startPage();
|
|
||||||
|
PageHelper.startPage(rkBill.getPageNum(), rkBill.getPageSize());
|
||||||
|
|
||||||
List<RkBill> list = rkBillService.selectRkBillList(rkBill);
|
List<RkBill> list = rkBillService.selectRkBillList(rkBill);
|
||||||
|
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,8 @@ public class RkInfoController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/statistic")
|
@PostMapping("/statistic")
|
||||||
public AjaxResult statistic(@RequestBody RkInfo query) {
|
public AjaxResult statistic(@RequestBody RkInfo query) {
|
||||||
return AjaxResult.success(rkInfoService.getStockStatistic(query));
|
StockStatisticVO stockStatistic = rkInfoService.getStockStatistic(query);
|
||||||
|
return AjaxResult.success(stockStatistic);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,12 @@ public class RkBill extends BaseEntity {
|
|||||||
/** 主键ID */
|
/** 主键ID */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/** 当前页 */
|
||||||
|
private Integer pageNum;
|
||||||
|
|
||||||
|
/** 每页条数 */
|
||||||
|
private Integer pageSize;
|
||||||
|
|
||||||
/** 物资类型 */
|
/** 物资类型 */
|
||||||
@Excel(name = "物资类型")
|
@Excel(name = "物资类型")
|
||||||
private String wlType;
|
private String wlType;
|
||||||
@@ -46,7 +52,7 @@ public class RkBill extends BaseEntity {
|
|||||||
@Excel(name = "单据号")
|
@Excel(name = "单据号")
|
||||||
private String billNo;
|
private String billNo;
|
||||||
|
|
||||||
/** 原字段:出入库类型 */
|
/** 出入库类型 */
|
||||||
@Excel(name = "出入库类型")
|
@Excel(name = "出入库类型")
|
||||||
private String operationType;
|
private String operationType;
|
||||||
|
|
||||||
@@ -103,29 +109,14 @@ public class RkBill extends BaseEntity {
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
private Date returnTime;
|
private Date returnTime;
|
||||||
|
|
||||||
/** 借用方项目号(借用方项目) */
|
/** 借用方项目号 */
|
||||||
@Excel(name = "借用方项目号")
|
@Excel(name = "借用方项目号")
|
||||||
private String xmNoCk;
|
private String xmNoCk;
|
||||||
|
|
||||||
/** 借用方项目描述(借用方项目描述) */
|
/** 借用方项目描述 */
|
||||||
@Excel(name = "借用方项目描述")
|
@Excel(name = "借用方项目描述")
|
||||||
private String xmMsCk;
|
private String xmMsCk;
|
||||||
|
|
||||||
|
|
||||||
/** 创建人 */
|
|
||||||
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删除) */
|
/** 是否删除(0正常,1删除) */
|
||||||
private String isDelete;
|
private String isDelete;
|
||||||
|
|
||||||
@@ -143,256 +134,96 @@ public class RkBill extends BaseEntity {
|
|||||||
|
|
||||||
// ================= getter / setter =================
|
// ================= getter / setter =================
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() { return id; }
|
||||||
return id;
|
public void setId(Long id) { this.id = id; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
public Integer getPageNum() { return pageNum; }
|
||||||
this.id = id;
|
public void setPageNum(Integer pageNum) { this.pageNum = pageNum; }
|
||||||
}
|
|
||||||
|
|
||||||
public String getWlType() {
|
public Integer getPageSize() { return pageSize; }
|
||||||
return wlType;
|
public void setPageSize(Integer pageSize) { this.pageSize = pageSize; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setWlType(String wlType) {
|
public String getWlType() { return wlType; }
|
||||||
this.wlType = wlType;
|
public void setWlType(String wlType) { this.wlType = wlType; }
|
||||||
}
|
|
||||||
|
|
||||||
public String getWlTypeName() {
|
public String getWlTypeName() { return wlTypeName; }
|
||||||
return wlTypeName;
|
public void setWlTypeName(String wlTypeName) { this.wlTypeName = wlTypeName; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setWlTypeName(String wlTypeName) {
|
public String getCangku() { return cangku; }
|
||||||
this.wlTypeName = wlTypeName;
|
public void setCangku(String cangku) { this.cangku = cangku; }
|
||||||
}
|
|
||||||
|
|
||||||
public String getCangku() {
|
public String getWarehouseName() { return warehouseName; }
|
||||||
return cangku;
|
public void setWarehouseName(String warehouseName) { this.warehouseName = warehouseName; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setCangku(String cangku) {
|
public String getParentWarehouseName() { return parentWarehouseName; }
|
||||||
this.cangku = cangku;
|
public void setParentWarehouseName(String parentWarehouseName) { this.parentWarehouseName = parentWarehouseName; }
|
||||||
}
|
|
||||||
|
|
||||||
public String getWarehouseName() {
|
public String getBillNo() { return billNo; }
|
||||||
return warehouseName;
|
public void setBillNo(String billNo) { this.billNo = billNo; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setWarehouseName(String warehouseName) {
|
public String getOperationType() { return operationType; }
|
||||||
this.warehouseName = warehouseName;
|
public void setOperationType(String operationType) { this.operationType = operationType; }
|
||||||
}
|
|
||||||
|
|
||||||
public String getParentWarehouseName() {
|
public String getOperationTypeName() { return operationTypeName; }
|
||||||
return parentWarehouseName;
|
public void setOperationTypeName(String operationTypeName) { this.operationTypeName = operationTypeName; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setParentWarehouseName(String parentWarehouseName) {
|
public String getBizType() { return bizType; }
|
||||||
this.parentWarehouseName = parentWarehouseName;
|
public void setBizType(String bizType) { this.bizType = bizType; }
|
||||||
}
|
|
||||||
|
|
||||||
public String getBillNo() {
|
public List<String> getBizTypeList() { return bizTypeList; }
|
||||||
return billNo;
|
public void setBizTypeList(List<String> bizTypeList) { this.bizTypeList = bizTypeList; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setBillNo(String billNo) {
|
public Date getOperationTime() { return operationTime; }
|
||||||
this.billNo = billNo;
|
public void setOperationTime(Date operationTime) { this.operationTime = operationTime; }
|
||||||
}
|
|
||||||
|
|
||||||
public String getOperationType() {
|
public String getExecStatus() { return execStatus; }
|
||||||
return operationType;
|
public void setExecStatus(String execStatus) { this.execStatus = execStatus; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setOperationType(String operationType) {
|
public Integer getOperator() { return operator; }
|
||||||
this.operationType = operationType;
|
public void setOperator(Integer operator) { this.operator = operator; }
|
||||||
}
|
|
||||||
|
|
||||||
public String getOperationTypeName() {
|
public String getOperatorName() { return operatorName; }
|
||||||
return operationTypeName;
|
public void setOperatorName(String operatorName) { this.operatorName = operatorName; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setOperationTypeName(String operationTypeName) {
|
public String getTeamCode() { return teamCode; }
|
||||||
this.operationTypeName = operationTypeName;
|
public void setTeamCode(String teamCode) { this.teamCode = teamCode; }
|
||||||
}
|
|
||||||
|
|
||||||
public String getBizType() {
|
public String getTeamName() { return teamName; }
|
||||||
return bizType;
|
public void setTeamName(String teamName) { this.teamName = teamName; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setBizType(String bizType) {
|
public String getIsDelivery() { return isDelivery; }
|
||||||
this.bizType = bizType;
|
public void setIsDelivery(String isDelivery) { this.isDelivery = isDelivery; }
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getBizTypeList() {
|
public Date getBorrowTime() { return borrowTime; }
|
||||||
return bizTypeList;
|
public void setBorrowTime(Date borrowTime) { this.borrowTime = borrowTime; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setBizTypeList(List<String> bizTypeList) {
|
public Date getReturnTime() { return returnTime; }
|
||||||
this.bizTypeList = bizTypeList;
|
public void setReturnTime(Date returnTime) { this.returnTime = returnTime; }
|
||||||
}
|
|
||||||
|
|
||||||
public Date getOperationTime() {
|
public String getXmNoCk() { return xmNoCk; }
|
||||||
return operationTime;
|
public void setXmNoCk(String xmNoCk) { this.xmNoCk = xmNoCk; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setOperationTime(Date operationTime) {
|
public String getXmMsCk() { return xmMsCk; }
|
||||||
this.operationTime = operationTime;
|
public void setXmMsCk(String xmMsCk) { this.xmMsCk = xmMsCk; }
|
||||||
}
|
|
||||||
|
|
||||||
public String getExecStatus() {
|
public String getIsDelete() { return isDelete; }
|
||||||
return execStatus;
|
public void setIsDelete(String isDelete) { this.isDelete = isDelete; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setExecStatus(String execStatus) {
|
public Date getStartDate() { return startDate; }
|
||||||
this.execStatus = execStatus;
|
public void setStartDate(Date startDate) { this.startDate = startDate; }
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getOperator() {
|
public Date getEndDate() { return endDate; }
|
||||||
return operator;
|
public void setEndDate(Date endDate) { this.endDate = endDate; }
|
||||||
}
|
|
||||||
|
|
||||||
public void setOperator(Integer operator) {
|
public String getRemark() { return remark; }
|
||||||
this.operator = operator;
|
public void setRemark(String remark) { this.remark = remark; }
|
||||||
}
|
|
||||||
|
|
||||||
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 getTeamName() {
|
|
||||||
return teamName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTeamName(String teamName) {
|
|
||||||
this.teamName = teamName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIsDelivery() {
|
|
||||||
return isDelivery;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsDelivery(String isDelivery) {
|
|
||||||
this.isDelivery = isDelivery;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getBorrowTime() {
|
|
||||||
return borrowTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBorrowTime(Date borrowTime) {
|
|
||||||
this.borrowTime = borrowTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getReturnTime() {
|
|
||||||
return returnTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReturnTime(Date returnTime) {
|
|
||||||
this.returnTime = returnTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public 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 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() {
|
|
||||||
return isDelete;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsDelete(String isDelete) {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRemark() {
|
|
||||||
return remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRemark(String remark) {
|
|
||||||
this.remark = remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================= toString =================
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
.append("id", id)
|
.append("id", id)
|
||||||
|
.append("pageNum", pageNum)
|
||||||
|
.append("pageSize", pageSize)
|
||||||
.append("wlType", wlType)
|
.append("wlType", wlType)
|
||||||
.append("wlTypeName", wlTypeName)
|
.append("wlTypeName", wlTypeName)
|
||||||
.append("cangku", cangku)
|
.append("cangku", cangku)
|
||||||
@@ -411,16 +242,11 @@ public class RkBill extends BaseEntity {
|
|||||||
.append("isDelivery", isDelivery)
|
.append("isDelivery", isDelivery)
|
||||||
.append("borrowTime", borrowTime)
|
.append("borrowTime", borrowTime)
|
||||||
.append("returnTime", returnTime)
|
.append("returnTime", returnTime)
|
||||||
.append("xmNoCk", getXmNoCk())
|
.append("xmNoCk", xmNoCk)
|
||||||
.append("xmMsCk", getXmMsCk())
|
.append("xmMsCk", xmMsCk)
|
||||||
.append("createBy", createBy)
|
|
||||||
.append("createTime", createTime)
|
|
||||||
.append("updateBy", updateBy)
|
|
||||||
.append("updateTime", updateTime)
|
|
||||||
.append("isDelete", isDelete)
|
|
||||||
.append("remark", remark)
|
|
||||||
.append("startDate", startDate)
|
.append("startDate", startDate)
|
||||||
.append("endDate", endDate)
|
.append("endDate", endDate)
|
||||||
|
.append("remark", remark)
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ public class RkInfo extends BaseEntity
|
|||||||
private Long sid;
|
private Long sid;
|
||||||
|
|
||||||
/** 是否需要配送(0否,1是,2配送中,3配送完成) */
|
/** 是否需要配送(0否,1是,2配送中,3配送完成) */
|
||||||
|
@Excel(name = "是否需要配送", readConverterExp = "0否,1是,2配送中,3配送完成")
|
||||||
private String isDelivery;
|
private String isDelivery;
|
||||||
|
|
||||||
/** 封样编号1 */
|
/** 封样编号1 */
|
||||||
|
|||||||
@@ -146,4 +146,7 @@ public interface RkRecordMapper
|
|||||||
* 查询某个单据下仍为预入库状态的记录数量
|
* 查询某个单据下仍为预入库状态的记录数量
|
||||||
*/
|
*/
|
||||||
int countPreInRecordByBillNo(@Param("billNo") String billNo);
|
int countPreInRecordByBillNo(@Param("billNo") String billNo);
|
||||||
|
|
||||||
|
int countPreOutRecordByBillNo(@Param("billNo") String billNo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -655,13 +655,13 @@ public class RkRecordServiceImpl implements IRkRecordService
|
|||||||
throw new ServiceException("出库记录ID不能为空");
|
throw new ServiceException("出库记录ID不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================== 1. 查询 rk_record ==================
|
/* ================== 1️⃣ 查询 rk_record ================== */
|
||||||
List<RkRecord> recordList = rkRecordMapper.selectRkRecordByIds(recordIds);
|
List<RkRecord> recordList = rkRecordMapper.selectRkRecordByIds(recordIds);
|
||||||
if (recordList == null || recordList.isEmpty()) {
|
if (recordList == null || recordList.isEmpty()) {
|
||||||
throw new ServiceException("出库记录不存在");
|
throw new ServiceException("出库记录不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================== 2. 只保留「预出库」记录 ==================
|
/* ================== 2️⃣ 仅保留【预出库】记录 ================== */
|
||||||
List<RkRecord> preOutList = recordList.stream()
|
List<RkRecord> preOutList = recordList.stream()
|
||||||
.filter(r -> "1".equals(r.getBizType())) // 出库
|
.filter(r -> "1".equals(r.getBizType())) // 出库
|
||||||
.filter(r -> "0".equals(r.getExecStatus())) // 预出库
|
.filter(r -> "0".equals(r.getExecStatus())) // 预出库
|
||||||
@@ -671,7 +671,7 @@ public class RkRecordServiceImpl implements IRkRecordService
|
|||||||
throw new ServiceException("所选出库记录均已完成出库");
|
throw new ServiceException("所选出库记录均已完成出库");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================== 3. 库存校验 + 扣减 ==================
|
/* ================== 3️⃣ 库存校验 + 扣减 ================== */
|
||||||
for (RkRecord record : preOutList) {
|
for (RkRecord record : preOutList) {
|
||||||
|
|
||||||
Long rkInfoId = record.getRkInfoId();
|
Long rkInfoId = record.getRkInfoId();
|
||||||
@@ -697,24 +697,24 @@ public class RkRecordServiceImpl implements IRkRecordService
|
|||||||
|
|
||||||
BigDecimal newQty = remainQty.subtract(outQty);
|
BigDecimal newQty = remainQty.subtract(outQty);
|
||||||
|
|
||||||
// 扣库存
|
// ① 扣库存数量
|
||||||
rkInfoMapper.updateRealQtyById(rkInfoId, newQty);
|
rkInfoMapper.updateRealQtyById(rkInfoId, newQty);
|
||||||
|
|
||||||
// 同步出库状态
|
// ② 若扣完,同步库存出库状态
|
||||||
if (newQty.compareTo(BigDecimal.ZERO) == 0) {
|
if (newQty.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
rkInfoMapper.updateIsChukuById(rkInfoId, "1");
|
rkInfoMapper.updateIsChukuById(rkInfoId, "1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================== 4. 推进状态 ==================
|
/* ================== 4️⃣ 状态推进 ================== */
|
||||||
|
|
||||||
// ① rk_record.exec_status = 1
|
// ① rk_record.exec_status = 1(仅本次完成的)
|
||||||
List<Long> preOutIds = preOutList.stream()
|
List<Long> finishedRecordIds = preOutList.stream()
|
||||||
.map(RkRecord::getId)
|
.map(RkRecord::getId)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
rkRecordMapper.updateExecStatusByIds(preOutIds, "1");
|
rkRecordMapper.updateExecStatusByIds(finishedRecordIds, "1");
|
||||||
|
|
||||||
// ② rk_info.exec_status = 1
|
// ② rk_info.exec_status = 1(涉及到的库存)
|
||||||
List<Long> rkInfoIds = preOutList.stream()
|
List<Long> rkInfoIds = preOutList.stream()
|
||||||
.map(RkRecord::getRkInfoId)
|
.map(RkRecord::getRkInfoId)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
@@ -724,17 +724,26 @@ public class RkRecordServiceImpl implements IRkRecordService
|
|||||||
rkInfoMapper.updateExecStatusByIds(rkInfoIds, "1");
|
rkInfoMapper.updateExecStatusByIds(rkInfoIds, "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ③ rk_bill.exec_status = 1
|
// 只有当【该单据下不存在任何预出库记录】才允许完成
|
||||||
List<String> billNos = preOutList.stream()
|
List<String> billNos = preOutList.stream()
|
||||||
.map(RkRecord::getBillNo)
|
.map(RkRecord::getBillNo)
|
||||||
.filter(StringUtils::isNotBlank)
|
.filter(StringUtils::isNotBlank)
|
||||||
.distinct()
|
.distinct()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
for (String billNo : billNos) {
|
for (String billNo : billNos) {
|
||||||
|
|
||||||
|
// 判断该出库单下是否还存在预出库记录
|
||||||
|
int preOutCount = rkRecordMapper.countPreOutRecordByBillNo(billNo);
|
||||||
|
if (preOutCount > 0) {
|
||||||
|
// 只要还有一条预出库,整单不能完成
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
rkBillMapper.updateExecStatusByBillNo(billNo, "1");
|
rkBillMapper.updateExecStatusByBillNo(billNo, "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
return preOutIds.size();
|
return finishedRecordIds.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -194,9 +194,9 @@
|
|||||||
resultType="com.zg.project.wisdom.domain.vo.StockStatisticVO">
|
resultType="com.zg.project.wisdom.domain.vo.StockStatisticVO">
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
IFNULL(SUM(ri.real_qty * ri.ht_dj), 0) AS total_amount,
|
IFNULL(SUM(ri.real_qty * ri.ht_dj), 0) AS totalAmount,
|
||||||
COUNT(DISTINCT ri.pcode) AS location_count,
|
COUNT(DISTINCT ri.pcode) AS locationCount,
|
||||||
IFNULL(SUM(ri.real_qty), 0) AS total_quantity
|
IFNULL(SUM(ri.real_qty), 0) AS totalQuantity
|
||||||
FROM rk_info ri
|
FROM rk_info ri
|
||||||
<where>
|
<where>
|
||||||
ri.exec_status = 1
|
ri.exec_status = 1
|
||||||
|
|||||||
@@ -96,9 +96,9 @@
|
|||||||
-- 小仓
|
-- 小仓
|
||||||
wh.warehouse_name AS warehouse_name,
|
wh.warehouse_name AS warehouse_name,
|
||||||
|
|
||||||
-- 大仓
|
-- ✅ 大仓(直接取小仓行里的父仓字段)
|
||||||
pwh.warehouse_code AS parent_warehouse_code,
|
wh.parent_warehouse_code AS parent_warehouse_code,
|
||||||
pwh.warehouse_name AS parent_warehouse_name,
|
wh.parent_warehouse_name AS parent_warehouse_name,
|
||||||
|
|
||||||
ct.team_name AS team_name
|
ct.team_name AS team_name
|
||||||
|
|
||||||
@@ -108,12 +108,8 @@
|
|||||||
LEFT JOIN stock_in_type sit ON rr.operation_type = sit.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 stock_out_type sot ON rr.operation_type = sot.type_code
|
||||||
|
|
||||||
-- 小仓
|
|
||||||
LEFT JOIN warehouse_info wh ON rr.cangku = wh.warehouse_code
|
LEFT JOIN warehouse_info wh ON rr.cangku = wh.warehouse_code
|
||||||
|
|
||||||
-- 大仓
|
|
||||||
LEFT JOIN warehouse_info pwh ON wh.parent_warehouse_code = pwh.warehouse_code
|
|
||||||
|
|
||||||
LEFT JOIN construction_team ct
|
LEFT JOIN construction_team ct
|
||||||
ON rr.team_code = ct.team_code
|
ON rr.team_code = ct.team_code
|
||||||
AND ct.is_delete = '0'
|
AND ct.is_delete = '0'
|
||||||
@@ -670,6 +666,17 @@
|
|||||||
AND is_delete = '0'
|
AND is_delete = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="countPreOutRecordByBillNo"
|
||||||
|
parameterType="java.lang.String"
|
||||||
|
resultType="java.lang.Integer">
|
||||||
|
SELECT COUNT(1)
|
||||||
|
FROM rk_record
|
||||||
|
WHERE bill_no = #{billNo}
|
||||||
|
AND biz_type = '1' <!-- 仅统计出库记录 -->
|
||||||
|
AND exec_status = '0' <!-- 预出库 -->
|
||||||
|
AND is_delete = '0'
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="updateBorrowReturnRecordById">
|
<update id="updateBorrowReturnRecordById">
|
||||||
UPDATE rk_record
|
UPDATE rk_record
|
||||||
SET
|
SET
|
||||||
|
|||||||
Reference in New Issue
Block a user