Browse Source

2026-04-15

启用申请单退仓功能
master
fengyuan_yang 4 months ago
parent
commit
656e6f8fbe
  1. 58
      src/main/java/com/gaotao/modules/productionReturn/controller/ProductionReturnController.java
  2. 12
      src/main/java/com/gaotao/modules/productionReturn/dao/ProductionReturnMapper.java
  3. 14
      src/main/java/com/gaotao/modules/productionReturn/service/ProductionReturnService.java
  4. 16
      src/main/java/com/gaotao/modules/productionReturn/service/impl/ProductionReturnServiceImpl.java
  5. 62
      src/main/resources/mapper/productionReturn/ProductionReturnMapper.xml

58
src/main/java/com/gaotao/modules/productionReturn/controller/ProductionReturnController.java

@ -24,6 +24,57 @@ public class ProductionReturnController extends AbstractController {
@Autowired @Autowired
private ProductionReturnService productionReturnService; private ProductionReturnService productionReturnService;
/**
* 申请单退仓获取列表
*/
@PostMapping("getApplicationReturnList")
public R getApplicationReturnList(@RequestBody Map<String, Object> params) {
try {
String site = (String) params.get("site");
String searchCode = (String) params.get("searchCode");
if (site == null || site.trim().isEmpty()) {
return R.error("站点不能为空");
}
List<Map<String, Object>> resultList = productionReturnService.getApplicationReturnList(site, searchCode);
return R.ok().put("data", resultList);
} catch (Exception e) {
logger.error("获取申请单退仓列表失败", e);
return R.error("获取数据失败: " + e.getMessage());
}
}
/**
* 申请单退仓获取详情
*/
@PostMapping("getApplicationReturnDetails")
public R getApplicationReturnDetails(@RequestBody Map<String, Object> params) {
try {
String site = (String) params.get("site");
String searchCode = (String) params.get("searchCode");
if (site == null || site.trim().isEmpty()) {
return R.error("站点不能为空");
}
if (searchCode == null || searchCode.trim().isEmpty()) {
return R.error("查询条件不能为空");
}
Map<String, Object> result = productionReturnService.getApplicationReturnDetails(site, searchCode);
if (result == null || result.isEmpty()) {
return R.error("未找到详情");
}
return R.ok().put("data", result);
} catch (Exception e) {
logger.error("获取申请单退仓详情失败", e);
return R.error("获取详情失败: " + e.getMessage());
}
}
/** /**
* 获取生产待入库列表 * 获取生产待入库列表
* 数据来源inbound_notification_head表关联SFDC_ROLLS表 * 数据来源inbound_notification_head表关联SFDC_ROLLS表
@ -100,6 +151,11 @@ public class ProductionReturnController extends AbstractController {
String buNo = (String) params.get("buNo"); String buNo = (String) params.get("buNo");
String operationType = (String) params.get("operationType"); // I-添加 D-移除 String operationType = (String) params.get("operationType"); // I-添加 D-移除
String warehouseId = (String) params.get("warehouseId"); // 仓库ID String warehouseId = (String) params.get("warehouseId"); // 仓库ID
String actionType = (String) params.get("actionType"); // 生产退仓 申请单退仓
if (actionType == null || actionType.trim().isEmpty()) {
actionType = "生产退仓";
}
if (labelCode == null || labelCode.trim().isEmpty()) { if (labelCode == null || labelCode.trim().isEmpty()) {
return R.error("标签条码不能为空"); return R.error("标签条码不能为空");
@ -119,7 +175,7 @@ public class ProductionReturnController extends AbstractController {
String userName = getUser().getUsername(); String userName = getUser().getUsername();
Map<String, Object> result = productionReturnService.validateLabelWithInbound( Map<String, Object> result = productionReturnService.validateLabelWithInbound(
site, buNo, inboundNo, labelCode, operationType, userName, warehouseId);
site, buNo, inboundNo, labelCode, operationType, userName, warehouseId, actionType);
return R.ok().put("data", result); return R.ok().put("data", result);
} catch (Exception e) { } catch (Exception e) {
logger.error("生产标签验证失败", e); logger.error("生产标签验证失败", e);

12
src/main/java/com/gaotao/modules/productionReturn/dao/ProductionReturnMapper.java

@ -9,6 +9,18 @@ import java.util.Map;
@Mapper @Mapper
public interface ProductionReturnMapper { public interface ProductionReturnMapper {
/**
* 申请单退仓获取列表
*/
List<Map<String, Object>> getApplicationReturnList(@Param("site") String site,
@Param("searchCode") String searchCode);
/**
* 申请单退仓获取详情
*/
Map<String, Object> getApplicationReturnDetails(@Param("site") String site,
@Param("searchCode") String searchCode);
/** /**
* 获取生产待入库列表 * 获取生产待入库列表
* 数据来源inbound_notification_head表关联SFDC_ROLLS表统计 * 数据来源inbound_notification_head表关联SFDC_ROLLS表统计

14
src/main/java/com/gaotao/modules/productionReturn/service/ProductionReturnService.java

@ -5,6 +5,16 @@ import java.util.Map;
public interface ProductionReturnService { public interface ProductionReturnService {
/**
* 申请单退仓获取列表
*/
List<Map<String, Object>> getApplicationReturnList(String site, String searchCode);
/**
* 申请单退仓获取详情
*/
Map<String, Object> getApplicationReturnDetails(String site, String searchCode);
/** /**
* 获取生产待入库列表 * 获取生产待入库列表
* 数据来源inbound_notification_head表关联SFDC_ROLLS表 * 数据来源inbound_notification_head表关联SFDC_ROLLS表
@ -35,9 +45,11 @@ public interface ProductionReturnService {
* @param labelCode 标签条码 * @param labelCode 标签条码
* @param operationType 操作类型 I-添加 D-移除 * @param operationType 操作类型 I-添加 D-移除
* @param userName 当前登录人 * @param userName 当前登录人
* @param warehouseId 仓库ID
* @param actionType 动作类型生产退仓/申请单退仓
* @return 标签信息 * @return 标签信息
*/ */
Map<String, Object> validateLabelWithInbound(String site, String buNo, String orderNo, String labelCode, String operationType, String userName, String warehouseId);
Map<String, Object> validateLabelWithInbound(String site, String buNo, String orderNo, String labelCode, String operationType, String userName, String warehouseId, String actionType);
/** /**
* 确认生产退仓上架通过存储过程 * 确认生产退仓上架通过存储过程

16
src/main/java/com/gaotao/modules/productionReturn/service/impl/ProductionReturnServiceImpl.java

@ -62,6 +62,16 @@ public class ProductionReturnServiceImpl implements ProductionReturnService {
@Autowired @Autowired
private ErpInterfaceService erpInterfaceService; private ErpInterfaceService erpInterfaceService;
@Override
public List<Map<String, Object>> getApplicationReturnList(String site, String searchCode) {
return productionReturnMapper.getApplicationReturnList(site, searchCode);
}
@Override
public Map<String, Object> getApplicationReturnDetails(String site, String searchCode) {
return productionReturnMapper.getApplicationReturnDetails(site, searchCode);
}
@Override @Override
public List<Map<String, Object>> getQualifiedInboundList(String site, String warehouseId, String searchCode, String status) { public List<Map<String, Object>> getQualifiedInboundList(String site, String warehouseId, String searchCode, String status) {
SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
@ -76,8 +86,8 @@ public class ProductionReturnServiceImpl implements ProductionReturnService {
} }
@Override @Override
public Map<String, Object> validateLabelWithInbound(String site, String buNo, String orderNo, String labelCode, String operationType, String userName, String warehouseId) {
logger.info("开始验证标签,标签条码: {}, 生产订单号: {}, 操作类型: {}, 仓库: {}", labelCode, orderNo, operationType, warehouseId);
public Map<String, Object> validateLabelWithInbound(String site, String buNo, String orderNo, String labelCode, String operationType, String userName, String warehouseId, String actionType) {
logger.info("开始验证标签,标签条码: {}, 生产订单号: {}, 操作类型: {}, 仓库: {}, 动作类型: {}", labelCode, orderNo, operationType, warehouseId, actionType);
// 调用存储过程 GetScanLabelVerification // 调用存储过程 GetScanLabelVerification
List<Object> params = new ArrayList<>(); List<Object> params = new ArrayList<>();
@ -90,7 +100,7 @@ public class ProductionReturnServiceImpl implements ProductionReturnService {
params.add(""); // 参数7: 空字符串 params.add(""); // 参数7: 空字符串
params.add(labelCode); // 参数8: 扫描的标签条码 params.add(labelCode); // 参数8: 扫描的标签条码
params.add(""); // 参数9: 空字符串 params.add(""); // 参数9: 空字符串
params.add("生产退仓"); // 参数10: 生产退仓
params.add(actionType); // 参数10: 生产退仓 申请单退仓
params.add(operationType); // 参数11: I-添加 D-移除 params.add(operationType); // 参数11: I-添加 D-移除
params.add(userName); // 参数12: 当前登陆人 params.add(userName); // 参数12: 当前登陆人
params.add(warehouseId != null ? warehouseId : ""); // 参数13: 仓库ID params.add(warehouseId != null ? warehouseId : ""); // 参数13: 仓库ID

62
src/main/resources/mapper/productionReturn/ProductionReturnMapper.xml

@ -3,6 +3,68 @@
<mapper namespace="com.gaotao.modules.productionReturn.dao.ProductionReturnMapper"> <mapper namespace="com.gaotao.modules.productionReturn.dao.ProductionReturnMapper">
<!-- 申请单退仓:获取列表 -->
<select id="getApplicationReturnList" resultType="map">
SELECT
TOP 10
site,
bu_no as buNo,
transaction_id as transactionId,
COUNT (1) as labelCount,
SUM (roll_qty) as totalQty,
transaction_by as transactionBy,
CAST (transaction_date AS DATE) as transactionDate
FROM
StockTransactionLog
WHERE
SITE = #{site}
AND document_type = '生产领料'
<if test="searchCode != null and searchCode != ''">
AND (
transaction_id LIKE CONCAT('%', #{searchCode}, '%')
OR roll_no LIKE CONCAT('%', #{searchCode}, '%')
)
</if>
GROUP BY
site,
bu_no,
transaction_id,
transaction_by,
transaction_date
ORDER BY
transaction_date DESC
</select>
<!-- 申请单退仓:获取详情 -->
<select id="getApplicationReturnDetails" resultType="map">
SELECT
TOP 1
site,
bu_no as buNo,
transaction_id as transactionId,
COUNT (1) as labelCount,
SUM (roll_qty) as totalQty,
transaction_by as transactionBy,
CAST (transaction_date AS DATE) as transactionDate
FROM
StockTransactionLog
WHERE
SITE = #{site}
AND (
transaction_id = #{searchCode}
OR roll_no = #{searchCode}
)
AND document_type = '生产领料'
GROUP BY
site,
bu_no,
transaction_id,
transaction_by,
transaction_date
ORDER BY
transaction_date DESC
</select>
<!-- 获取生产待入库列表 --> <!-- 获取生产待入库列表 -->
<select id="getQualifiedInboundList" resultType="map"> <select id="getQualifiedInboundList" resultType="map">
select top 30 select top 30

Loading…
Cancel
Save