Showing
1 changed file
with
13 additions
and
1 deletions
| @@ -18,6 +18,7 @@ import com.lframework.xingyun.sc.vo.shipments.car.*; | @@ -18,6 +18,7 @@ import com.lframework.xingyun.sc.vo.shipments.car.*; | ||
| 18 | import io.swagger.annotations.Api; | 18 | import io.swagger.annotations.Api; |
| 19 | import io.swagger.annotations.ApiImplicitParam; | 19 | import io.swagger.annotations.ApiImplicitParam; |
| 20 | import io.swagger.annotations.ApiOperation; | 20 | import io.swagger.annotations.ApiOperation; |
| 21 | +import org.apache.commons.lang3.StringUtils; | ||
| 21 | import org.springframework.beans.factory.annotation.Autowired; | 22 | import org.springframework.beans.factory.annotation.Autowired; |
| 22 | import org.springframework.validation.annotation.Validated; | 23 | import org.springframework.validation.annotation.Validated; |
| 23 | import org.springframework.web.bind.annotation.*; | 24 | import org.springframework.web.bind.annotation.*; |
| @@ -60,7 +61,10 @@ public class DraftRequestCarTicketController extends DefaultBaseController { | @@ -60,7 +61,10 @@ public class DraftRequestCarTicketController extends DefaultBaseController { | ||
| 60 | 61 | ||
| 61 | results = datas.stream().map(draftRequestCarTicket -> { | 62 | results = datas.stream().map(draftRequestCarTicket -> { |
| 62 | GetDraftRequestCarTicketBo bo = new GetDraftRequestCarTicketBo(draftRequestCarTicket); | 63 | GetDraftRequestCarTicketBo bo = new GetDraftRequestCarTicketBo(draftRequestCarTicket); |
| 63 | - PurchaseOrderInfo purchaseOrderInfo = purchaseOrderInfoService.findById(draftRequestCarTicket.getPurchaseOrderId()); | 64 | + PurchaseOrderInfo purchaseOrderInfo = null; |
| 65 | + if (StringUtils.isNotEmpty(draftRequestCarTicket.getPurchaseOrderId())) { | ||
| 66 | + purchaseOrderInfo = purchaseOrderInfoService.findById(draftRequestCarTicket.getPurchaseOrderId()); | ||
| 67 | + } | ||
| 64 | // 判断 createById 是否等于当前用户 ID | 68 | // 判断 createById 是否等于当前用户 ID |
| 65 | boolean isCreateBy = false; | 69 | boolean isCreateBy = false; |
| 66 | if (purchaseOrderInfo != null && currentUserId.equals(purchaseOrderInfo.getContractCreateById())) { | 70 | if (purchaseOrderInfo != null && currentUserId.equals(purchaseOrderInfo.getContractCreateById())) { |
| @@ -92,6 +96,14 @@ public class DraftRequestCarTicketController extends DefaultBaseController { | @@ -92,6 +96,14 @@ public class DraftRequestCarTicketController extends DefaultBaseController { | ||
| 92 | } | 96 | } |
| 93 | 97 | ||
| 94 | GetDraftRequestCarTicketBo result = new GetDraftRequestCarTicketBo(data); | 98 | GetDraftRequestCarTicketBo result = new GetDraftRequestCarTicketBo(data); |
| 99 | + result.setDraftCreateBy(false); | ||
| 100 | + if (StringUtils.isNotEmpty(result.getPurchaseOrderId())) { | ||
| 101 | + String currentUserId = SecurityUtil.getCurrentUser().getId(); | ||
| 102 | + PurchaseOrderInfo purchaseOrderInfo = purchaseOrderInfoService.findById(result.getPurchaseOrderId()); | ||
| 103 | + if (purchaseOrderInfo != null && currentUserId.equals(purchaseOrderInfo.getContractCreateById())) { | ||
| 104 | + result.setDraftCreateBy(true); | ||
| 105 | + } | ||
| 106 | + } | ||
| 95 | 107 | ||
| 96 | return InvokeResultBuilder.success(result); | 108 | return InvokeResultBuilder.success(result); |
| 97 | } | 109 | } |