|
|
|
@ -13,12 +13,8 @@ import com.glxp.api.constant.ConstantType;
|
|
|
|
|
import com.glxp.api.entity.basic.BasicProductsEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderEntity;
|
|
|
|
|
import com.glxp.api.entity.purchase.PurApplyEntity;
|
|
|
|
|
import com.glxp.api.entity.purchase.PurDeliveryDetailEntity;
|
|
|
|
|
import com.glxp.api.entity.purchase.PurDeliveryEntity;
|
|
|
|
|
import com.glxp.api.req.purchase.PostPurDeliveryRequest;
|
|
|
|
|
import com.glxp.api.req.purchase.PurDeliveryRequest;
|
|
|
|
|
import com.glxp.api.req.purchase.PurOrderDetailRequest;
|
|
|
|
|
import com.glxp.api.entity.purchase.*;
|
|
|
|
|
import com.glxp.api.req.purchase.*;
|
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
|
import com.glxp.api.res.purchase.PurDeliveryDetailResponse;
|
|
|
|
|
import com.glxp.api.res.purchase.PurDeliveryResponse;
|
|
|
|
@ -27,20 +23,19 @@ import com.glxp.api.service.inout.IoOrderDetailBizService;
|
|
|
|
|
import com.glxp.api.service.inout.IoOrderService;
|
|
|
|
|
import com.glxp.api.service.purchase.PurDeliveryDetailService;
|
|
|
|
|
import com.glxp.api.service.purchase.PurDeliveryService;
|
|
|
|
|
import com.glxp.api.service.purchase.PurOrderDetailService;
|
|
|
|
|
import com.glxp.api.util.CustomUtil;
|
|
|
|
|
import com.glxp.api.util.GennerOrderUtils;
|
|
|
|
|
import com.glxp.api.util.OrderNoTypeBean;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.validation.constraints.NotEmpty;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Validated
|
|
|
|
@ -138,7 +133,7 @@ public class PurDeliveryController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 审核采购订单
|
|
|
|
|
* 审核送货单
|
|
|
|
|
*/
|
|
|
|
|
@RepeatSubmit()
|
|
|
|
|
@PostMapping("/purchase/delivery/auditOrder")
|
|
|
|
@ -300,4 +295,57 @@ public class PurDeliveryController {
|
|
|
|
|
return ResultVOUtils.success("删除成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
PurOrderDetailService purOrderDetailService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 添加采购订单至送货单
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/purchase/delivery/addPlanDetailAndOrder")
|
|
|
|
|
public BaseResponse addPlanDetailAndOrder(@RequestBody PurDeliveryRequest purDeliveryRequest) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// List<PurOrderDetailEntity> purOrderDetailEntities = purOrderDetailService.findByOrderId(purOrderEntity.getBillNo());
|
|
|
|
|
//
|
|
|
|
|
// List<PurDeliveryDetailEntity> purDeliveryDetailEntities = purOrderDetailEntities.stream()
|
|
|
|
|
// .map(e -> {
|
|
|
|
|
// PurDeliveryDetailEntity d = new PurDeliveryDetailEntity();
|
|
|
|
|
// BeanUtils.copyProperties(e, d);
|
|
|
|
|
// return d;
|
|
|
|
|
// })
|
|
|
|
|
// .collect(Collectors.toList());
|
|
|
|
|
//
|
|
|
|
|
// for (PurDeliveryDetailEntity obj : purDeliveryDetailEntities) {
|
|
|
|
|
// obj.setOrderIdFk(purOrderEntity.getId() + "");
|
|
|
|
|
// }
|
|
|
|
|
// //获取详情表信息
|
|
|
|
|
// List<PurOrderDetailEntity> exitsDetails = purDeliveryDetailService.findByOrderId();
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// List<Long> ids = new ArrayList<>();
|
|
|
|
|
// for (PurOrderDetailEntity obj : purOrderDetailEntities) {
|
|
|
|
|
// for (PurOrderDetailEntity obj1 : purOrderDetailEntityList) {
|
|
|
|
|
// if (obj.getProductId().equals(obj1.getProductId())) {
|
|
|
|
|
// //获取存在在详情表和申购单里面一样的产品
|
|
|
|
|
// ids.add(obj.getId().longValue());
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// //删除存在的产品
|
|
|
|
|
// if (ids.size() > 0) {
|
|
|
|
|
// purOrderDetailService.deleteByIds(ids);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// boolean falg = purOrderDetailService.insertPurOrderDetailEntity(purOrderDetailEntityList);
|
|
|
|
|
// if (falg) {
|
|
|
|
|
// //查询申购单
|
|
|
|
|
// return ResultVOUtils.success("添加成功");
|
|
|
|
|
//
|
|
|
|
|
// } else {
|
|
|
|
|
// return ResultVOUtils.success("添加失败");
|
|
|
|
|
// }
|
|
|
|
|
return ResultVOUtils.success("添加失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|