|
|
@@ -28,6 +28,7 @@ import com.goafanti.order.bo.TOrderInvoiceBo;
|
|
|
import com.goafanti.order.bo.TOrderInvoiceDetails;
|
|
|
import com.goafanti.order.service.OrderInvoiceService;
|
|
|
import com.goafanti.order.service.OrderNewService;
|
|
|
+import com.mysql.fabric.xmlrpc.base.Array;
|
|
|
|
|
|
@Service
|
|
|
public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper> implements OrderInvoiceService {
|
|
|
@@ -71,7 +72,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
|
|
|
aids.add(admin.getId());
|
|
|
}
|
|
|
}
|
|
|
- }else if (o.getType()==2) {//省外
|
|
|
+ }else if (o.getType()==1) {//省外
|
|
|
if(o.getApproval()==0) {
|
|
|
aids.addAll(adminMapper.listNameByDepAndName(t.getOrderDep(), "营销管理员"));
|
|
|
}else {
|
|
|
@@ -144,15 +145,19 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
|
|
|
t.setRejectReason(reason);
|
|
|
t.setStatus(examine);
|
|
|
//examine 2通过 3拒绝
|
|
|
+ List<String> aids = new ArrayList<>();
|
|
|
+ TOrderInvoice t2=tOrderInvoiceMapper.selectByPrimaryKey(id);
|
|
|
+ TOrderNew o=tOrderNewMapper.selectByPrimaryKey(t2.getOrderNo());
|
|
|
+ Integer type=null;
|
|
|
if(examine==3){
|
|
|
- List<String> aids = new ArrayList<>();
|
|
|
- TOrderInvoice t2=tOrderInvoiceMapper.selectByPrimaryKey(id);
|
|
|
- TOrderNew o=tOrderNewMapper.selectByPrimaryKey(t2.getOrderNo());
|
|
|
- Integer type=null;
|
|
|
+ if(t2.getApproval()==2)t.setApproval(1);
|
|
|
type=NoticeStatus.ORDER_INVPICE_NO.getCode();
|
|
|
aids.add(o.getSalesmanId());
|
|
|
- orderNewService.generalSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId());
|
|
|
+ }else if(examine==2) {
|
|
|
+ type=NoticeStatus.ORDER_INVPICE_END.getCode();
|
|
|
+ aids.add(o.getSalesmanId());
|
|
|
}
|
|
|
+ orderNewService.generalSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId());
|
|
|
return tOrderInvoiceMapper.updateByPrimaryKeySelective(t);
|
|
|
}
|
|
|
|
|
|
@@ -185,15 +190,29 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
|
|
|
|
|
|
@Override
|
|
|
public int updateapprovalExamine(Integer id, Integer examine, String reason) {
|
|
|
- TOrderInvoice t=new TOrderInvoice();
|
|
|
+ TOrderInvoice t=new TOrderInvoice();
|
|
|
t.setId(id);
|
|
|
t.setRejectReason(reason);
|
|
|
+ List<String> aids=new ArrayList<>();
|
|
|
+ TOrderInvoice o=tOrderInvoiceMapper.selectByPrimaryKey(id);
|
|
|
+ TOrderNew ts=tOrderNewMapper.selectByPrimaryKey(o.getOrderNo());
|
|
|
//examine 2通过 3拒绝
|
|
|
+ Integer type =null;
|
|
|
if(examine==3) {
|
|
|
- t.setStatus(examine);
|
|
|
+ t.setStatus(examine);
|
|
|
+ type= NoticeStatus.ORDER_INVPICE_APPROVA_NO.getCode();
|
|
|
+ aids.add(ts.getSalesmanId());
|
|
|
}else {
|
|
|
- t.setApproval(examine);
|
|
|
+ t.setApproval(examine);
|
|
|
+ type= NoticeStatus.ORDER_INVPICE_APPROVA_YES.getCode();
|
|
|
+ if (o.getType()==0) {
|
|
|
+ aids.add(organizationManagementMapper.selectByPrimaryKey(ts.getOrderDep()).getFinanceId());
|
|
|
+ }else if(o.getType()==1) {
|
|
|
+ aids.addAll(adminMapper.listNameByDepAndName(ts.getOrderDep(), "营销管理员"));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+ orderNewService.generalSendNoticeAndEmail(aids,type,o.getOrderNo(), TokenManager.getAdminId());
|
|
|
return tOrderInvoiceMapper.updateByPrimaryKeySelective(t);
|
|
|
}
|
|
|
|