Commit cbab933130cbb93aa63ce59d93718994b49011d4

Authored by 房远帅
1 parent dd384c57

楚江ERP:草稿要车单-业务员(合同创建人)可修改

@@ -11,6 +11,8 @@ import com.lframework.starter.web.core.controller.DefaultBaseController; @@ -11,6 +11,8 @@ import com.lframework.starter.web.core.controller.DefaultBaseController;
11 import com.lframework.starter.web.core.utils.PageResultUtil; 11 import com.lframework.starter.web.core.utils.PageResultUtil;
12 import com.lframework.xingyun.sc.bo.shipments.car.GetDraftRequestCarTicketBo; 12 import com.lframework.xingyun.sc.bo.shipments.car.GetDraftRequestCarTicketBo;
13 import com.lframework.xingyun.sc.entity.DraftRequestCarTicket; 13 import com.lframework.xingyun.sc.entity.DraftRequestCarTicket;
  14 +import com.lframework.xingyun.sc.entity.PurchaseOrderInfo;
  15 +import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
14 import com.lframework.xingyun.sc.service.shipments.car.DraftRequestCarTicketService; 16 import com.lframework.xingyun.sc.service.shipments.car.DraftRequestCarTicketService;
15 import com.lframework.xingyun.sc.vo.shipments.car.*; 17 import com.lframework.xingyun.sc.vo.shipments.car.*;
16 import io.swagger.annotations.Api; 18 import io.swagger.annotations.Api;
@@ -20,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -20,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
20 import org.springframework.validation.annotation.Validated; 22 import org.springframework.validation.annotation.Validated;
21 import org.springframework.web.bind.annotation.*; 23 import org.springframework.web.bind.annotation.*;
22 24
  25 +import javax.annotation.Resource;
23 import javax.validation.Valid; 26 import javax.validation.Valid;
24 import javax.validation.constraints.NotBlank; 27 import javax.validation.constraints.NotBlank;
25 import java.util.List; 28 import java.util.List;
@@ -37,7 +40,8 @@ public class DraftRequestCarTicketController extends DefaultBaseController { @@ -37,7 +40,8 @@ public class DraftRequestCarTicketController extends DefaultBaseController {
37 40
38 @Autowired 41 @Autowired
39 private DraftRequestCarTicketService draftRequestCarTicketService; 42 private DraftRequestCarTicketService draftRequestCarTicketService;
40 - 43 + @Resource
  44 + private PurchaseOrderInfoService purchaseOrderInfoService;
41 /** 45 /**
42 * 查询列表 46 * 查询列表
43 */ 47 */
@@ -56,9 +60,10 @@ public class DraftRequestCarTicketController extends DefaultBaseController { @@ -56,9 +60,10 @@ public class DraftRequestCarTicketController extends DefaultBaseController {
56 60
57 results = datas.stream().map(draftRequestCarTicket -> { 61 results = datas.stream().map(draftRequestCarTicket -> {
58 GetDraftRequestCarTicketBo bo = new GetDraftRequestCarTicketBo(draftRequestCarTicket); 62 GetDraftRequestCarTicketBo bo = new GetDraftRequestCarTicketBo(draftRequestCarTicket);
  63 + PurchaseOrderInfo purchaseOrderInfo = purchaseOrderInfoService.findById(draftRequestCarTicket.getPurchaseOrderId());
59 // 判断 createById 是否等于当前用户 ID 64 // 判断 createById 是否等于当前用户 ID
60 boolean isCreateBy = false; 65 boolean isCreateBy = false;
61 - if (currentUserId.equals(draftRequestCarTicket.getCreateById())) { 66 + if (purchaseOrderInfo != null && currentUserId.equals(purchaseOrderInfo.getContractCreateById())) {
62 isCreateBy = true; 67 isCreateBy = true;
63 } 68 }
64 bo.setDraftCreateBy(isCreateBy); 69 bo.setDraftCreateBy(isCreateBy);