|
|
@@ -12,6 +12,7 @@ import com.goafanti.admin.service.DepartmentService;
|
|
|
import com.goafanti.common.dao.*;
|
|
|
import com.goafanti.common.model.InvoiceLog;
|
|
|
import com.goafanti.order.bo.*;
|
|
|
+import com.goafanti.organization.bo.OrganizationListOut;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -54,11 +55,31 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
|
|
|
//前端直接会直接调取上一个发起数据给新开票,防止前一个数据为审核后
|
|
|
if (o.getApproval()==2)o.setApproval(1);
|
|
|
if (o.getStatus()!=1)o.setStatus(1);
|
|
|
+ pushOrderInvoiceExamine(o);
|
|
|
Integer i=tOrderInvoiceMapper.insertSelective(o);
|
|
|
addInvoiceLog(o.getId(),0);
|
|
|
return i;
|
|
|
}
|
|
|
|
|
|
+ private void pushOrderInvoiceExamine(TOrderInvoice o) {
|
|
|
+ if (o.getType()==0){
|
|
|
+ if (o.getApproval()==0){
|
|
|
+ TOrderNewBo ton = tOrderNewMapper.getSaleIdByOno(o.getOrderNo());
|
|
|
+ OrganizationListOut dep = departmentMapper.selectAllById(ton.getOrderDep());
|
|
|
+ o.setExamineName(dep.getFinanceName());
|
|
|
+ }else {
|
|
|
+ StringBuffer str=new StringBuffer();
|
|
|
+ List<Admin> admins = adminMapper.getAdminRoleTypeList(AFTConstants.FINANCE_ADMIN);
|
|
|
+ for (Admin a : admins) {
|
|
|
+ str=str.append(a.getName()).append(",");
|
|
|
+ }
|
|
|
+ if (str.length()>0)o.setExamineName(str.substring(0,str.length()-1));
|
|
|
+ }
|
|
|
+ }else if (o.getType()==1){
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
* @param id 开票编号
|