Kaynağa Gözat

拉取C端采购发票问题

wanglang 2 hafta önce
ebeveyn
işleme
10e4b504fb

+ 17 - 3
trade-admin/src/main/java/com/trade/admin/trade/purchaseorder/controller/PurchaseInvoiceApiController.java

@@ -7,6 +7,7 @@ import com.trade.common.core.domain.ResponseResult;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -24,13 +25,26 @@ public class PurchaseInvoiceApiController {
     @Resource
     private CustomerUserService customerUserService;
 
-    @PostMapping("/pullInvoiceDetail")
-    public ResponseResult<Boolean> pullInvoiceDetail(@RequestBody List<Long> orderIds) {
-        purchaseInvoiceSchedule.pullInvoiceDetail(orderIds);
+    @PostMapping("/pullInvoiceFile")
+    public ResponseResult<Boolean> pullInvoiceFile(@RequestBody List<String> orderIds) {
+        List<Long> ids = new ArrayList<>();
+        for (String orderId : orderIds) {
+            ids.add(Long.valueOf(orderId));
+        }
+        purchaseInvoiceSchedule.pullInvoiceDetail(ids);
         return ResponseResult.success(true);
     }
+
     @GetMapping("/getCustomerUser")
     public ResponseResult<CustomerUserDto> getCustomerUser(String userId) {
         return customerUserService.getCustomerUser(userId);
     }
+
+    @GetMapping("/pullPurchaseInvoice")
+    public ResponseResult<Boolean> pullPurchaseInvoice(String orderIds, Integer source) {
+        List<Long> ids = new ArrayList<>();
+        ids.add(Long.valueOf(orderIds));
+        purchaseInvoiceSchedule.pullPurchaseInvoice(ids, source);
+        return ResponseResult.success(true);
+    }
 }

+ 1 - 1
trade-service/src/main/java/com/trade/service/trade/salesorder/dto/ReceivePaymentDto.java

@@ -29,7 +29,7 @@ public class ReceivePaymentDto extends ReceivePaymentExtendDto {
     @ApiModelProperty(name = "currencyCode", value = "提示收款金额币种")
     @NotEmpty(message = "提示收款金额币种不能为空")
     private String modifyCurrency = "USD";
-    @ApiModelProperty(name = "fileIds", value = "附件id集合/目前不用了")
+    @ApiModelProperty(name = "fileIds", value = "附件id集合/对应C端收款凭证")
     private List<Long> fileIds;
     @ApiModelProperty(name = "remark", value = "备注")
     private String remark;

+ 3 - 0
trade-service/src/main/java/com/trade/service/trade/salesorder/service/impl/SalesOrderServiceImpl.java

@@ -355,6 +355,9 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
             if (orderIncomeAssociation.getSource() == 2 && StringUtils.isEmpty(e.getVoucherNo())) {
                 throw new ServiceException("销售合同编号" + e.getSalesContractNo() + "凭证号不能为空");
             }
+            if (orderIncomeAssociation.getSource() == 2 && CollectionUtil.isEmpty(e.getFileIds())) {
+                throw new ServiceException("销售合同编号" + e.getSalesContractNo() + "收款凭证不能为空");
+            }
             int flag = 1;
             for (SalesOrderReceiveExtendDto salesOrderReceiveExtendDto : e.getSalesOrderInfo()) {
                 // checkOrderReceivePayment(salesOrderReceiveExtendDto.getSalesOrderId(), e.getSaleContractId(),

+ 1 - 1
trade-service/src/main/resources/mapper/trade/purchaseorder/PurchaseOrderMapper.xml

@@ -167,7 +167,7 @@
     </select>
 
     <select id="selectClientTaxNum" resultMap="VoInvoiceResultMap">
-        SELECT e.tax_no as tax_num, c.xt_uid, e.xt_eid, t.customer_user_id, t.id, t.order_no, t.amount_total
+        SELECT e.tax_no as tax_num, c.xt_uid as xt_user_id, e.xt_eid, t.customer_user_id, t.id, t.order_no, t.amount_total
         FROM purchase_order t
         left join enterprise e on t.customer_user_id = e.customer_id
         left join customer_user c on t.customer_user_id = c.id