|
@@ -24,6 +24,7 @@ import com.pj.project.tb_invoice_order.TbInvoiceOrder;
|
|
|
import com.pj.project.tb_invoice_order.TbInvoiceOrderService;
|
|
|
import com.pj.project4sp.admin.SpAdmin;
|
|
|
import com.pj.project4sp.admin.SpAdminService;
|
|
|
+import com.pj.project4sp.global.BusinessException;
|
|
|
import com.pj.utils.so.SoMap;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -103,6 +104,13 @@ public class TbInvoiceInfoService extends ServiceImpl<TbInvoiceInfoMapper, TbInv
|
|
|
String customerId = so.getString("customerId");
|
|
|
String customerName = so.getString("customerName");
|
|
|
|
|
|
+ List<String> orderIdList = Arrays.asList(orderIds.split(","));
|
|
|
+ List<TbInvoiceOrder> orderList = tbInvoiceOrderService.listByIds(orderIdList);
|
|
|
+ List<TbInvoiceOrder> collect = orderList.stream().filter(o -> o.getStatus() != 0).collect(Collectors.toList());
|
|
|
+ if(collect.size() > 0){
|
|
|
+ throw new BusinessException("请选择待申请的订单");
|
|
|
+ }
|
|
|
+
|
|
|
TbEntity entity = tbEntityService.getById(entityId);
|
|
|
TbInvoiceInfo t = new TbInvoiceInfo();
|
|
|
t.setEntityId(entityId).setIsElec(isElec).setTotalMoney(totalMoney)
|
|
@@ -114,8 +122,7 @@ public class TbInvoiceInfoService extends ServiceImpl<TbInvoiceInfoMapper, TbInv
|
|
|
.setBank(entity.getBank()).setBankNo(entity.getBankNo()).setEmail(entity.getEmail()).setPhone(entity.getPhone());
|
|
|
this.save(t);
|
|
|
|
|
|
- List<String> orderIdList = Arrays.asList(orderIds.split(","));
|
|
|
- List<TbInvoiceOrder> orderList = tbInvoiceOrderService.listByIds(orderIdList);
|
|
|
+
|
|
|
for (TbInvoiceOrder invoiceOrder : orderList) {
|
|
|
invoiceOrder.setInfoId(t.getId()).setInfoNo(t.getNo()).setStatus(1);
|
|
|
}
|