|
|
@@ -800,6 +800,28 @@ public class OrderServiceImpl implements OrderService {
|
|
|
throw new IllegalOperatorException("对应的店铺的信息不存在");
|
|
|
}
|
|
|
or.setStoreid(storeid);
|
|
|
+ if (sysConf.getStoreid().equals(storeid)){ //如果是寄售类型的订单
|
|
|
+ if (or.getInvoiceid() != null && or.getInvoicetype() == Type.Bill_NoDeduct.value()){ //发票为普票
|
|
|
+ //将普票类型修改为专票
|
|
|
+ List<Bill> billOne;
|
|
|
+ if (SystemSession.getUser().getEnterprise() != null){
|
|
|
+ billOne = billDao.getBillByUseruuAndEnuuAndKind(SystemSession.getUser().getUserUU(),
|
|
|
+ SystemSession.getUser().getEnterprise().getUu(), Type.Bill_Deduct.value());
|
|
|
+ }else {
|
|
|
+ billOne = billDao.getBillByUseruuAndDissociativeAndKind(SystemSession.getUser().getUserUU(),
|
|
|
+ Type.PERSONAL.value(), Type.Bill_Deduct.value());
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isEmpty(billOne)){
|
|
|
+ throw new IllegalOperatorException("对应专用发票信息不存在,请完善后重试");
|
|
|
+ }else {
|
|
|
+ Bill bill = billOne.get(0);
|
|
|
+ or.setInvoicetype(Type.Bill_Deduct.value());
|
|
|
+ or.setInvoiceid(bill.getId());
|
|
|
+ or.setInvoicetitle(bill.getHead());
|
|
|
+ or.setInvoiceAddress(FastjsonUtils.toJson(bill));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
or.setStoreName(storeIn.getStoreName());
|
|
|
or.setSellerenuu(storeIn.getEnUU());
|
|
|
Enterprise enterprise = enterpriseDao.findByUu(storeIn.getEnUU());
|