|
|
|
|
@ -7,13 +7,16 @@ import cn.hutool.core.util.StrUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import jakarta.annotation.Resource; |
|
|
|
|
import org.springblade.common.exception.BusinessException; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.desk.dashboard.feign.IPartClient; |
|
|
|
|
import org.springblade.desk.dashboard.pojo.entity.DsPartEntity; |
|
|
|
|
import org.springblade.desk.order.pojo.entity.YieldOrder; |
|
|
|
|
import org.springblade.desk.produce.pojo.entity.WorkOrder; |
|
|
|
|
import org.springblade.system.feign.IUserClient; |
|
|
|
|
import org.springblade.wms.excel.StOtherReceiptRecordExcel; |
|
|
|
|
import org.springblade.wms.mapper.StOtherReceiptRecordMapper; |
|
|
|
|
import org.springblade.wms.pojo.dto.InitStockDTO; |
|
|
|
|
@ -52,6 +55,8 @@ public class StOtherReceiptRecordServiceImpl extends BaseServiceImpl<StOtherRece |
|
|
|
|
IStStockInoutRecordService stStockInoutRecordService; |
|
|
|
|
@Resource |
|
|
|
|
IPartClient partClient; |
|
|
|
|
@Resource |
|
|
|
|
IUserClient userClient; |
|
|
|
|
|
|
|
|
|
// private static IPartClient getPartClient() {
|
|
|
|
|
// if (partClient == null) {
|
|
|
|
|
@ -336,6 +341,39 @@ public class StOtherReceiptRecordServiceImpl extends BaseServiceImpl<StOtherRece |
|
|
|
|
return inoutRecord; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void saveSubOrderWarehousing(String goodsCode, String batchNo, Double quantity, Long shId, Long slId, Date date, Long userId) throws Exception { |
|
|
|
|
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
StOtherReceiptRecord otherReceiptRecord = new StOtherReceiptRecord(); |
|
|
|
|
//入库信息
|
|
|
|
|
otherReceiptRecord.setWarehousingReason(StOtherReceiptRecord.REASON_PRODUCE); |
|
|
|
|
otherReceiptRecord.setShId(shId); |
|
|
|
|
otherReceiptRecord.setSlId(slId); |
|
|
|
|
otherReceiptRecord.setCreateUser(userId); |
|
|
|
|
//如果物料信息不存在,则同步
|
|
|
|
|
StGoods goods = stGoodsService.queryByCode(goodsCode); |
|
|
|
|
if (goods == null) { |
|
|
|
|
throw new ServiceException("物料【" + goodsCode + "】不存在,无法执行入库操作"); |
|
|
|
|
} |
|
|
|
|
otherReceiptRecord.setGoodsId(goods.getId()); |
|
|
|
|
|
|
|
|
|
List<StStockInoutRecord> inoutList = new ArrayList<>(); |
|
|
|
|
StStockInoutRecord stockInoutRecord = new StStockInoutRecord(); |
|
|
|
|
stockInoutRecord.setGoodsId(goods.getId()); |
|
|
|
|
stockInoutRecord.setPiNo(batchNo); |
|
|
|
|
stockInoutRecord.setQuantity(quantity); |
|
|
|
|
stockInoutRecord.setShId(shId); |
|
|
|
|
stockInoutRecord.setSlId(slId); |
|
|
|
|
stockInoutRecord.setInOutDate(date); |
|
|
|
|
stockInoutRecord.setCreateUser(userId); |
|
|
|
|
inoutList.add(stockInoutRecord); |
|
|
|
|
|
|
|
|
|
otherReceiptRecord.setInoutList(inoutList); |
|
|
|
|
|
|
|
|
|
this.otherWarehousing(otherReceiptRecord, user); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<StOtherReceiptRecordExcel> exportStOtherReceiptRecord(Wrapper<StOtherReceiptRecord> queryWrapper) { |
|
|
|
|
List<StOtherReceiptRecordExcel> stOtherReceiptRecordList = baseMapper.exportStOtherReceiptRecord(queryWrapper); |
|
|
|
|
|