仓库管理修改

liweidong
wusiyu 5 days ago
parent 9f5b730a35
commit 5094adf69b
  1. 13
      blade-service-api/blade-erpdata-api/src/main/java/org/springblade/erpdata/feign/IErpDataWmsClient.java
  2. 3
      blade-service-api/blade-erpdata-api/src/main/java/org/springblade/erpdata/feign/IErpDataWmsClientFallback.java
  3. 5
      blade-service-api/blade-wms-api/src/main/java/org/springblade/wms/pojo/vo/StRealtimeStockVO.java
  4. 5
      blade-service/blade-wms/src/main/java/org/springblade/wms/controller/StStorageLocationController.java
  5. 2
      blade-service/blade-wms/src/main/java/org/springblade/wms/controller/StStorehouseController.java
  6. 15
      blade-service/blade-wms/src/main/java/org/springblade/wms/mapper/StExpireRecordMapper.xml
  7. 4
      blade-service/blade-wms/src/main/java/org/springblade/wms/mapper/StExpireSubmissionMapper.xml
  8. 4
      blade-service/blade-wms/src/main/java/org/springblade/wms/mapper/StOtherOutRecordMapper.xml
  9. 1
      blade-service/blade-wms/src/main/java/org/springblade/wms/mapper/StRealtimeStockMapper.xml
  10. 2
      blade-service/blade-wms/src/main/resources/application-dev.yml

@ -5,7 +5,8 @@ import org.springblade.common.exception.BusinessException;
import org.springblade.core.tool.api.R;
import org.springblade.wms.pojo.entity.StRealtimeStock;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Date;
@ -36,19 +37,19 @@ public interface IErpDataWmsClient {
/**
* 到期送检发送erp
*/
@GetMapping(SEND_ST_SUBMISSION)
R<String> sendStSubmission(@RequestParam("stRealtimeStock")StRealtimeStock stRealtimeStock, @RequestParam("goodsCode")String goodsCode, @RequestParam("userName")String userName) throws BusinessException;
@PostMapping(SEND_ST_SUBMISSION)
R<String> sendStSubmission(@RequestBody StRealtimeStock stRealtimeStock, @RequestParam("goodsCode")String goodsCode, @RequestParam("userName")String userName) throws BusinessException;
/**
* 仓库提请发送erp
*/
@GetMapping(SEND_ERP_BUY_REQUEST)
@PostMapping(SEND_ERP_BUY_REQUEST)
R<String> sendErpBuyRequest(@RequestParam("extraBill")String extraBill, @RequestParam("qty")Double qty, @RequestParam("ldapName")String ldapName) throws BusinessException;
/**
* 工装计划申报发送erp
*/
@GetMapping(CREATE_MOLD_PLAN)
@PostMapping(CREATE_MOLD_PLAN)
R<String> createMoldPlan(@RequestParam("partCode")String partCode, @RequestParam("moCode")String moCode, @RequestParam("plantype")String plantype, @RequestParam("quantity")Double quantity,
@RequestParam("needDate")Date needDate, @RequestParam("level")String level, @RequestParam("keeper")String keeper, @RequestParam("createMan")String createMan,
@RequestParam("memo")String memo, @RequestParam("urgentType")String urgentType, @RequestParam("erpWoCode")String erpWoCode) throws BusinessException;
@ -56,7 +57,7 @@ public interface IErpDataWmsClient {
/**
* 工装计划申报删除发送erp
*/
@GetMapping(DELETE_MOLD_PLAN)
@PostMapping(DELETE_MOLD_PLAN)
R<String> deleteMoldPlan(@RequestParam("erpWoCode")String erpWoCode) throws BusinessException;
}

@ -3,6 +3,7 @@ package org.springblade.erpdata.feign;
import org.springblade.core.tool.api.R;
import org.springblade.wms.pojo.entity.StRealtimeStock;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Date;
@ -18,7 +19,7 @@ import java.util.Date;
@Component
public class IErpDataWmsClientFallback implements IErpDataWmsClient{
@Override
public R<String> sendStSubmission(@RequestParam("stRealtimeStock") StRealtimeStock stRealtimeStock, @RequestParam("goodsCode")String goodsCode, @RequestParam("userName")String userName) {
public R<String> sendStSubmission(@RequestBody StRealtimeStock stRealtimeStock, @RequestParam("goodsCode")String goodsCode, @RequestParam("userName")String userName) {
return R.fail("获取数据失败");
}

@ -85,6 +85,11 @@ public class StRealtimeStockVO extends StRealtimeStock {
@Schema(description = "出入库数量")
private Double inQuantity;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(description = "入库日期")
private Date inDate;
@TableField(exist = false)
private String deptName;
@TableField(exist = false)

@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.log.annotation.ApiLog;
@ -79,7 +80,9 @@ public class StStorageLocationController extends BladeController {
if (user != null && user.getDeptId() != null) {
wrapper.eq("create_dept", user.getDeptId());
}
if (StringUtils.isBlank(query.getAscs()) && StringUtils.isBlank(query.getDescs())) {
wrapper.orderByDesc("create_time");
}
IPage<StStorageLocation> pages = stStorageLocationService.page(Condition.getPage(query), wrapper);
return R.data(StStorageLocationWrapper.build().pageVO(pages));
}

@ -103,7 +103,7 @@ public class StStorehouseController extends BladeController {
}
if (StringUtils.isBlank(query.getAscs()) && StringUtils.isBlank(query.getDescs())) {
wrapper.orderByAsc("sh_code");
wrapper.orderByDesc("create_time");
}
IPage<StStorehouse> pages = stStorehouseService.page(Condition.getPage(query), wrapper);
// 转换为 VO

@ -39,7 +39,16 @@
r.goods_status,
r.memo,
r.stop_use,
r.scrap_cycle
r.scrap_cycle,
-- 到期状态:1-已到期 0-未到期(当前时间>=过期时间则已到期)
CASE WHEN r.scrap_cycle IS NULL THEN 0 WHEN SYSDATE >= r.scrap_cycle THEN 1 ELSE 0 END AS expireStatus,
-- 核心新增:临期天数(到期时间-当前时间,处理空值/负数)
CASE
-- 到期时间为空 → 临期天数为0
WHEN r.scrap_cycle IS NULL THEN 0
-- 直接计算天数差,TRUNC取整;未过期为正,已过期为负
ELSE TRUNC(r.scrap_cycle - SYSDATE)
END AS expireDays
FROM ST_REALTIME_STOCK r -- 新主表:实时库存表
-- 左关联物料表:库存表goods_id关联物料表主键,过滤已删除数据
LEFT JOIN ST_GOODS g ON r.goods_id = g.id AND g.is_deleted = 0
@ -51,13 +60,14 @@
<where>
r.is_deleted = 0
AND r.is_scrap = 0
<if test="stExpireRecord.goodsCode == null and stExpireRecord.startDueDate = null and stExpireRecord.endDueDate = null and stExpireRecord.expireStatus = null">
<if test="stExpireRecord.goodsCode == null and stExpireRecord.startDueDate == null and stExpireRecord.endDueDate == null and stExpireRecord.expireStatus == null">
AND (
(r.scrap_cycle IS NOT NULL AND TRUNC(r.scrap_cycle - SYSDATE) &lt;= 30)
OR
SYSDATE &gt;= r.scrap_cycle
)
</if>
<!-- 1. 物料编号模糊查询(页面输入框) -->
<if test="stExpireRecord.goodsCode != null and stExpireRecord.goodsCode != ''">
AND g.goods_code LIKE '%' || #{stExpireRecord.goodsCode} || '%'
@ -83,6 +93,7 @@
AND SYSDATE &gt;= r.scrap_cycle
</if>
</where>
ORDER BY expireDays ASC
</select>

@ -19,6 +19,7 @@
<result column="ES_QTY" property="esQty"/>
<result column="ES_TIME" property="esTime"/>
<result column="ES_MAN" property="esMan"/>
<result column="ES_DEPT_ID" property="esDeptId"/>
</resultMap>
@ -65,7 +66,7 @@
-- 左关联库房表(库存表sh_id关联库房表主键,过滤已删除)
LEFT JOIN ST_STOREHOUSE sh ON r.sh_id = sh.id AND sh.is_deleted = 0
-- 左关联部门表(主表esDept关联部门表主键,过滤已删除)
LEFT JOIN BLADE_DEPT dept ON se.es_dept = dept.id AND dept.is_deleted = 0
LEFT JOIN BLADE_DEPT dept ON se.es_dept_id = dept.id AND dept.is_deleted = 0
-- 左关联用户表(主表esMan关联用户表主键,过滤已删除)
LEFT JOIN BLADE_USER u ON se.es_man = u.id AND u.is_deleted = 0
-- 主表过滤条件:未删除
@ -118,6 +119,7 @@
)
</if>
</where>
ORDER BY expireDays ASC
</select>
<select id="sendStSubmission" statementType="CALLABLE" resultType="java.lang.String">

@ -122,7 +122,7 @@
sir.quantity,
sir.pi_no,
sir.stove_pi_no,
c.picker ,
soor.picker ,
-- 库房表:出库仓库名称
sh.sh_name AS shName,
-- 制单人姓名(主表create_by关联用户表)
@ -142,7 +142,7 @@
-- 左关联制单人用户表:主表create_by关联用户表id
LEFT JOIN BLADE_USER cu ON soor.create_user = cu.id
-- 左关联领料人用户表:凭证表picker关联用户表id
LEFT JOIN BLADE_USER pu ON c.picker = pu.id
LEFT JOIN BLADE_USER pu ON soor.picker = pu.id
-- 左关联审批人用户表:主表approver关联用户表id
LEFT JOIN BLADE_USER au ON soor.approver = au.id
WHERE soor.id = #{id}

@ -302,6 +302,7 @@
r.pi_no AS piNo,
r.check_code AS checkCode,
r.quantity AS quantity,
r.create_time AS inDate,
COALESCE(r.quantity, 0) - COALESCE(r.occupy_quantity, 0) AS usableQuantity,
r.scrap_cycle,
io.in_out_date

@ -13,4 +13,4 @@ request:
pdm:
url: http://192.168.119.235:8181
extraPlan:
url: http://192.168.18.121:10002
url: http://192.168.240.10:10011

Loading…
Cancel
Save