仓库管理修改

master
wusiyu 1 day ago
parent 4861106feb
commit cd38e5ee17
  1. 5
      blade-service-api/blade-wms-api/src/main/java/org/springblade/wms/feign/WmsTaskClient.java
  2. 1
      blade-service-api/blade-wms-api/src/main/java/org/springblade/wms/pojo/entity/StOtherOutRecord.java
  3. 5
      blade-service/blade-wms/src/main/java/org/springblade/wms/feign/WmsTaskClientImpl.java
  4. 3
      blade-service/blade-wms/src/main/java/org/springblade/wms/mapper/StOtherOutRecordMapper.java
  5. 12
      blade-service/blade-wms/src/main/java/org/springblade/wms/mapper/StOtherOutRecordMapper.xml
  6. 2
      blade-service/blade-wms/src/main/java/org/springblade/wms/service/IStOtherOutRecordService.java
  7. 26
      blade-service/blade-wms/src/main/java/org/springblade/wms/service/impl/StOtherOutRecordServiceImpl.java

@ -49,6 +49,8 @@ public interface WmsTaskClient {
String OTHER_OUT_RECORD_DETAIL = API_PREFIX + "/otherOutRecordDetail"; String OTHER_OUT_RECORD_DETAIL = API_PREFIX + "/otherOutRecordDetail";
String SUB_OUT_RECORD = API_PREFIX + "/subOutRecord";
/** /**
* 物料状态监控同步erp * 物料状态监控同步erp
*/ */
@ -102,4 +104,7 @@ public interface WmsTaskClient {
@PostMapping(OTHER_OUT_RECORD_DETAIL) @PostMapping(OTHER_OUT_RECORD_DETAIL)
StOtherOutRecordVO otherOutRecordDetail(@RequestParam Long id); StOtherOutRecordVO otherOutRecordDetail(@RequestParam Long id);
@PostMapping(SUB_OUT_RECORD)
void subOutRecord(@RequestParam String goodsCode, @RequestParam String piNo, @RequestParam Long userId);
} }

@ -131,6 +131,7 @@ public class StOtherOutRecord extends TenantEntity {
public static final Short OUT_TYPE_RETURN = 6; public static final Short OUT_TYPE_RETURN = 6;
public static final Short OUT_TYPE_TEAM = 8; public static final Short OUT_TYPE_TEAM = 8;
public static final Short OUT_TYPE_UNQUALIFIED = 11; public static final Short OUT_TYPE_UNQUALIFIED = 11;
public static final Short OUT_TYPE_PRODUCTION = 12;
/** /**
* 报废类型到期维护报废 * 报废类型到期维护报废

@ -98,4 +98,9 @@ public class WmsTaskClientImpl implements WmsTaskClient{
public StOtherOutRecordVO otherOutRecordDetail(@RequestParam Long id) { public StOtherOutRecordVO otherOutRecordDetail(@RequestParam Long id) {
return stOtherOutRecordService.getDetail(id); return stOtherOutRecordService.getDetail(id);
} }
@Override
public void subOutRecord(@RequestParam String goodsCode, @RequestParam String piNo, @RequestParam Long userId) {
stOtherOutRecordService.subOutRecord(goodsCode, piNo, userId);
}
} }

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springblade.wms.excel.StOtherOutRecordExcel; import org.springblade.wms.excel.StOtherOutRecordExcel;
import org.springblade.wms.pojo.entity.StOtherOutRecord; import org.springblade.wms.pojo.entity.StOtherOutRecord;
import org.springblade.wms.pojo.entity.StRealtimeStock;
import org.springblade.wms.pojo.vo.StOtherOutRecordVO; import org.springblade.wms.pojo.vo.StOtherOutRecordVO;
import java.util.List; import java.util.List;
@ -42,5 +43,7 @@ public interface StOtherOutRecordMapper extends BaseMapper<StOtherOutRecord> {
StOtherOutRecord getBySirId(Long sirId); StOtherOutRecord getBySirId(Long sirId);
StOtherOutRecordVO getDetail(Long id); StOtherOutRecordVO getDetail(Long id);
StRealtimeStock getStock(String goodsCode, String piNo);
} }

@ -160,6 +160,18 @@
AND soor.is_deleted = 0; AND soor.is_deleted = 0;
</select> </select>
<select id="getStock" resultType="org.springblade.wms.pojo.entity.StRealtimeStock">
SELECT
s.*
FROM st_realtime_stock s
LEFT JOIN st_goods m
ON s.goods_id = m.id AND m.is_deleted = 0 and m.used = 1
WHERE m.goods_code = #{goodsCode}
AND s.pi_no = #{piNo}
AND s.is_deleted = 0
AND s.stop_use = 0
</select>
<select id="exportStOtherOutRecord" resultType="org.springblade.wms.excel.StOtherOutRecordExcel"> <select id="exportStOtherOutRecord" resultType="org.springblade.wms.excel.StOtherOutRecordExcel">
SELECT * FROM ST_OTHER_OUT_RECORD ${ew.customSqlSegment} SELECT * FROM ST_OTHER_OUT_RECORD ${ew.customSqlSegment}
</select> </select>

@ -31,6 +31,8 @@ public interface IStOtherOutRecordService extends BaseService<StOtherOutRecord>
IPage<StOtherOutRecordVO> selectStOtherOutRecordPage(IPage<StOtherOutRecordVO> page, StOtherOutRecordVO stOtherOutRecord); IPage<StOtherOutRecordVO> selectStOtherOutRecordPage(IPage<StOtherOutRecordVO> page, StOtherOutRecordVO stOtherOutRecord);
void subOutRecord(String goodsCode, String piNo, Long userId);
/** /**
* 导出数据 * 导出数据
* *

@ -6,6 +6,7 @@ import jakarta.annotation.Resource;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.desk.common.enums.MesApprovalRecordBizTypeEnum; import org.springblade.desk.common.enums.MesApprovalRecordBizTypeEnum;
import org.springblade.desk.common.feign.IMesApprovalRecordClient; import org.springblade.desk.common.feign.IMesApprovalRecordClient;
import org.springblade.desk.common.pojo.dto.MesApprovalRecordFeignDTO; import org.springblade.desk.common.pojo.dto.MesApprovalRecordFeignDTO;
@ -197,6 +198,7 @@ public class StOtherOutRecordServiceImpl extends BaseServiceImpl<StOtherOutRecor
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void addOtherOutRecord(StOtherOutRecord stOtherOutRecord, List<StRealtimeStock> outList, BladeUser user) { public void addOtherOutRecord(StOtherOutRecord stOtherOutRecord, List<StRealtimeStock> outList, BladeUser user) {
BladeUser user1 = AuthUtil.getUser();
int a = 0, b = 0; int a = 0, b = 0;
for (StRealtimeStock stock : outList) { for (StRealtimeStock stock : outList) {
if (stock.getOutQuantity() == null) { if (stock.getOutQuantity() == null) {
@ -317,6 +319,30 @@ public class StOtherOutRecordServiceImpl extends BaseServiceImpl<StOtherOutRecor
return baseMapper.getBySirId(sirId); return baseMapper.getBySirId(sirId);
} }
@Override
public void subOutRecord(String goodsCode, String piNo, Long userId) {
if (goodsCode == null || goodsCode.trim().isEmpty()) {
throw new RuntimeException("物料编码不能为空");
}
if (piNo == null || piNo.trim().isEmpty()) {
throw new RuntimeException("批次号不能为空");
}
if (userId == null) {
throw new RuntimeException("操作人ID不能为空");
}
StRealtimeStock stock = baseMapper.getStock(goodsCode, piNo);
stock.setOutQuantity(stock.getQuantity());
if (stock == null) {
throw new RuntimeException("未查询到该物料[" + goodsCode + "]批次[" + piNo + "]的库存数据");
}
StOtherOutRecord stOtherOutRecord = new StOtherOutRecord();
stOtherOutRecord.setOutType(StOtherOutRecord.OUT_TYPE_PRODUCTION);
stOtherOutRecord.setPicker(userId);
stOtherOutRecord.setOutQty(stock.getQuantity());
this.addOtherOutRecord(stOtherOutRecord, Collections.singletonList(stock) , AuthUtil.getUser());
}
@Override @Override
public List<StOtherOutRecordExcel> exportStOtherOutRecord(Wrapper<StOtherOutRecord> queryWrapper) { public List<StOtherOutRecordExcel> exportStOtherOutRecord(Wrapper<StOtherOutRecord> queryWrapper) {

Loading…
Cancel
Save