|
|
@@ -6,49 +6,45 @@ import com.dk.common.exception.BaseBusinessException;
|
|
|
import com.dk.common.infrastructure.annotaiton.Pagination;
|
|
|
import com.dk.common.infrastructure.constant.Constant;
|
|
|
import com.dk.common.infrastructure.enums.ErrorCodeEnum;
|
|
|
+import com.dk.common.mapper.BaseMapper;
|
|
|
import com.dk.common.model.pojo.PageList;
|
|
|
import com.dk.common.response.ResponseCodeEnum;
|
|
|
import com.dk.common.response.ResponseResultUtil;
|
|
|
import com.dk.common.response.ResponseResultVO;
|
|
|
+import com.dk.common.service.BaseService;
|
|
|
import com.dk.mdm.infrastructure.convert.ivt.InboundConvert;
|
|
|
import com.dk.mdm.infrastructure.convert.ivt.InboundItemConvert;
|
|
|
import com.dk.mdm.infrastructure.convert.pur.PurChaseConvert;
|
|
|
import com.dk.mdm.infrastructure.convert.pur.PurChaseItemConvert;
|
|
|
+import com.dk.mdm.infrastructure.util.AuthUtils;
|
|
|
import com.dk.mdm.mapper.common.CommonMapper;
|
|
|
import com.dk.mdm.mapper.ivt.InboundItemMapper;
|
|
|
import com.dk.mdm.mapper.ivt.InboundMapper;
|
|
|
-import com.dk.mdm.mapper.ivt.InventoryMapper;
|
|
|
import com.dk.mdm.mapper.mst.GoodsSkuMapper;
|
|
|
import com.dk.mdm.mapper.pur.PurchaseItemMapper;
|
|
|
-import com.dk.mdm.model.pojo.mst.GoodsSku;
|
|
|
-import com.dk.mdm.model.pojo.pur.Purchase;
|
|
|
import com.dk.mdm.mapper.pur.PurchaseMapper;
|
|
|
-import com.dk.common.service.BaseService;
|
|
|
-import com.dk.common.mapper.BaseMapper;
|
|
|
+import com.dk.mdm.model.pojo.pur.Purchase;
|
|
|
import com.dk.mdm.model.pojo.pur.PurchaseItem;
|
|
|
-import com.dk.mdm.model.pojo.sale.Order;
|
|
|
import com.dk.mdm.model.query.ivt.InboundItemQuery;
|
|
|
-import com.dk.mdm.model.query.ivt.InventoryQuery;
|
|
|
+import com.dk.mdm.model.query.ivt.InboundQuery;
|
|
|
+import com.dk.mdm.model.query.ivt.OutboundQuery;
|
|
|
import com.dk.mdm.model.query.pur.PurchaseItemQuery;
|
|
|
import com.dk.mdm.model.query.pur.PurchaseQuery;
|
|
|
-import com.dk.mdm.model.response.ivt.InboundItemResponse;
|
|
|
-import com.dk.mdm.model.response.ivt.InventoryResponse;
|
|
|
+import com.dk.mdm.model.response.ivt.InboundResponse;
|
|
|
+import com.dk.mdm.model.response.ivt.OutboundResponse;
|
|
|
import com.dk.mdm.model.response.mst.GoodsSkuResponse;
|
|
|
import com.dk.mdm.model.response.pur.PurchaseItemResponse;
|
|
|
import com.dk.mdm.model.response.pur.PurchaseResponse;
|
|
|
import com.dk.mdm.model.vo.ivt.InboundItemVO;
|
|
|
import com.dk.mdm.model.vo.ivt.InboundVO;
|
|
|
-import com.dk.mdm.model.vo.ivt.OutboundItemVO;
|
|
|
-import com.dk.mdm.model.vo.ivt.OutboundVO;
|
|
|
import com.dk.mdm.model.vo.pur.PurchaseItemVO;
|
|
|
import com.dk.mdm.model.vo.pur.PurchaseVO;
|
|
|
import com.dk.mdm.service.common.CommonService;
|
|
|
import com.dk.mdm.service.ivt.inbound.InboundItemService;
|
|
|
-import com.dk.mdm.service.ivt.inbound.InboundPurchaseReturnService;
|
|
|
import com.dk.mdm.service.ivt.inbound.InboundPurchaseService;
|
|
|
import com.dk.mdm.service.ivt.inbound.InboundService;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
@@ -112,6 +108,12 @@ public class PurchaseService extends BaseService<Purchase> {
|
|
|
@Autowired
|
|
|
private InboundItemMapper inboundItemMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AuthUtils authUtils;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private InboundMapper inboundMapper;
|
|
|
+
|
|
|
/**
|
|
|
* @desc : 条件查询
|
|
|
* @author : 常皓宁
|
|
|
@@ -388,8 +390,29 @@ public class PurchaseService extends BaseService<Purchase> {
|
|
|
purchaseItemService.updataById(purchaseItem);
|
|
|
}
|
|
|
}
|
|
|
- return ResponseResultUtil.success(super.update(purchase, new UpdateWrapper<Purchase>().lambda().eq(Purchase::getPurId,
|
|
|
- UUID.fromString(purchase.getPurId ()))));
|
|
|
+ super.update(purchase, new UpdateWrapper<Purchase>().lambda().eq(Purchase::getPurId,
|
|
|
+ UUID.fromString(purchase.getPurId ())));
|
|
|
+
|
|
|
+ //region采购订单转入库编辑
|
|
|
+ String gradeCode = authUtils.getStaff().getGradeCode();
|
|
|
+ if (Constant.GradeCode.STD.getName().equals(gradeCode)) {
|
|
|
+ //自动入库
|
|
|
+ if (purchasevo.getInboundProcessingFlag() != null && purchasevo.getInboundProcessingFlag()) {
|
|
|
+ //标准版 只有一个入库单 所以get0 就可以 且 编辑采购订单得时候 一定是有入库单的
|
|
|
+ List<InboundResponse> inboundResponseList = inboundMapper.selectByCond(new InboundQuery().setFromId(purchasevo.getPurId()));
|
|
|
+ //存在入库单
|
|
|
+ if(inboundResponseList!=null && inboundResponseList.size()>0){
|
|
|
+ InboundResponse inboundResponse = inboundResponseList.get(0);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //endregion
|
|
|
+
|
|
|
+
|
|
|
+ return ResponseResultUtil.success();
|
|
|
}
|
|
|
|
|
|
/**
|