|
|
@ -15,8 +15,10 @@ import org.springframework.stereotype.Service; |
|
|
import com.srq.modules.base.utils.HttpClientUtil; |
|
|
import com.srq.modules.base.utils.HttpClientUtil; |
|
|
import com.srq.modules.base.utils.ResponseData; |
|
|
import com.srq.modules.base.utils.ResponseData; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
@ -233,4 +235,27 @@ public class IssureNotifyServiceImpl implements IssureNotifyService { |
|
|
pickOrderCancelReservationResponse.getMsg()); |
|
|
pickOrderCancelReservationResponse.getMsg()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void pickDetailIssued(List<PickDetail> pickDetailList) { |
|
|
|
|
|
// 后台处理状态为已下发 |
|
|
|
|
|
for (PickDetail detail : pickDetailList) { |
|
|
|
|
|
if (StringUtils.isEmpty(detail.getIssueQty()) || "0".equals(detail.getIssueQty())) { |
|
|
|
|
|
throw new RuntimeException("零件"+detail.getRmPartDesc()+"下发数量不能为零"); |
|
|
|
|
|
} |
|
|
|
|
|
detail.setStatus("已下发"); |
|
|
|
|
|
} |
|
|
|
|
|
String api = apiUrl + "/order/issuePickOrderDetailMerge"; |
|
|
|
|
|
List<PickDetail> errorList = new ArrayList<>(); |
|
|
|
|
|
// 开始发送请求 |
|
|
|
|
|
for (PickDetail detail : pickDetailList) { |
|
|
|
|
|
ResponseData result = HttpClientUtil.doPostByRawWithSRQ(api,detail); |
|
|
|
|
|
if (!"200".equals(result.getCode())) { |
|
|
|
|
|
errorList.add(detail); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (!errorList.isEmpty()){ |
|
|
|
|
|
throw new RuntimeException("零件\""+errorList.stream().map(PickDetail::getRmPartDesc).collect(Collectors.joining(";"))+"\"下发失败"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |