|
@@ -1,17 +1,21 @@
|
|
package com.persagy.adm.server.delivery.service.impl;
|
|
package com.persagy.adm.server.delivery.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.persagy.adm.server.delivery.entity.BossProjectDeliveryPlan;
|
|
import com.persagy.adm.server.delivery.entity.BossProjectDeliveryPlan;
|
|
import com.persagy.adm.server.delivery.entity.BossSkuDictRel;
|
|
import com.persagy.adm.server.delivery.entity.BossSkuDictRel;
|
|
import com.persagy.adm.server.delivery.service.AdmDeliverPlanService;
|
|
import com.persagy.adm.server.delivery.service.AdmDeliverPlanService;
|
|
import com.persagy.adm.server.delivery.service.BossProjectDeliveryPlanService;
|
|
import com.persagy.adm.server.delivery.service.BossProjectDeliveryPlanService;
|
|
import com.persagy.adm.server.delivery.service.BossSkuDictRelService;
|
|
import com.persagy.adm.server.delivery.service.BossSkuDictRelService;
|
|
|
|
+import com.persagy.adm.steward.client.BossStewardFacade;
|
|
|
|
+import com.persagy.adm.steward.entity.ProductFinishNumReq;
|
|
import com.persagy.adm.steward.entity.ProjectDeliverReq;
|
|
import com.persagy.adm.steward.entity.ProjectDeliverReq;
|
|
import com.persagy.dmp.delivery.client.DigitalObjectTypeCollectFacade;
|
|
import com.persagy.dmp.delivery.client.DigitalObjectTypeCollectFacade;
|
|
import com.persagy.dmp.delivery.dto.DeliveryPlanDTO;
|
|
import com.persagy.dmp.delivery.dto.DeliveryPlanDTO;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -43,6 +47,49 @@ public class AdmDeliverPlanServiceImpl implements AdmDeliverPlanService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 交付完成-测试
|
|
|
|
+ * @param deliveryPlan
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<ProductFinishNumReq> finishDeliverPlan(BossProjectDeliveryPlan deliveryPlan) {
|
|
|
|
+ //组装查询条件
|
|
|
|
+ LambdaQueryWrapper<BossProjectDeliveryPlan> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ if(deliveryPlan.getProjectId()!=null){
|
|
|
|
+ queryWrapper.eq(BossProjectDeliveryPlan::getProjectId,deliveryPlan.getProjectId());
|
|
|
|
+ }
|
|
|
|
+ if(deliveryPlan.getPlanId() != null){
|
|
|
|
+ queryWrapper.eq(BossProjectDeliveryPlan::getPlanId,deliveryPlan.getPlanId());
|
|
|
|
+ }
|
|
|
|
+ if(deliveryPlan.getPlanInfoId() != null){
|
|
|
|
+ queryWrapper.eq(BossProjectDeliveryPlan::getPlanInfoId,deliveryPlan.getPlanInfoId());
|
|
|
|
+ }
|
|
|
|
+ queryWrapper.eq(BossProjectDeliveryPlan::getValid,true);
|
|
|
|
+ //查询BOSS交付任务
|
|
|
|
+ List<BossProjectDeliveryPlan> bossProjectDeliveryPlans = bossDeliveryPlanService.queryByCondition(queryWrapper);
|
|
|
|
+ if(CollUtil.isEmpty(bossProjectDeliveryPlans)){
|
|
|
|
+ return new ArrayList<>();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<ProductFinishNumReq> result = new ArrayList<>();
|
|
|
|
+ //组装BOSS所需参数
|
|
|
|
+ bossProjectDeliveryPlans.forEach(item->{
|
|
|
|
+ ProductFinishNumReq finishNumReq = new ProductFinishNumReq();
|
|
|
|
+ finishNumReq.setPlanInfoId(item.getProjectId());
|
|
|
|
+ Long productNum = item.getProductNum();
|
|
|
|
+ if(productNum == null){
|
|
|
|
+ finishNumReq.setFinishNum(0);
|
|
|
|
+ }else{
|
|
|
|
+ finishNumReq.setFinishNum(item.getProductNum().intValue());
|
|
|
|
+ }
|
|
|
|
+ result.add(finishNumReq);
|
|
|
|
+ });
|
|
|
|
+ //通过FeignClient调用回调接口
|
|
|
|
+ BossStewardFacade.finishDeliverPlan(result);
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 生成项目交付计划
|
|
* 生成项目交付计划
|
|
* @param projectDeliverReq
|
|
* @param projectDeliverReq
|
|
*/
|
|
*/
|
|
@@ -96,7 +143,7 @@ public class AdmDeliverPlanServiceImpl implements AdmDeliverPlanService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//生成项目交付信息
|
|
//生成项目交付信息
|
|
- DigitalObjectTypeCollectFacade.createProjectDelivery(groupCode,"Pj"+ projectId, null, null, result);
|
|
|
|
|
|
+ DigitalObjectTypeCollectFacade.createProjectDelivery("HR","Pj4403050002", null, null, result);
|
|
//存储原BOSS订单信息
|
|
//存储原BOSS订单信息
|
|
bossDeliveryPlanService.insert(bossProjectDeliveryPlan);
|
|
bossDeliveryPlanService.insert(bossProjectDeliveryPlan);
|
|
}
|
|
}
|