Browse Source

订单开票信息推送与邮件推送

anderx 6 years ago
parent
commit
4a14649045

+ 7 - 3
src/main/java/com/goafanti/common/enums/NoticeStatus.java

@@ -29,9 +29,13 @@ public enum NoticeStatus {
 	ORDER_CHANGE_START(19,"订单变更发起"),
 	ORDER_CHANGE_YES(20,"订单变更通过"),
 	ORDER_CHANGE_NO(21,"订单变更驳回"),
-	ORDER_INVPICE_START(22,"订单开票发起"),
-	ORDER_INVPICE_YES(23,"订单变更通过"),
-	ORDER_INVPICE_NO(24,"订单变更驳回"),
+	ORDER_CHANGE_END(22,"订单变更完成"),
+	ORDER_INVPICE_START(23,"订单开票发起"),
+	ORDER_INVPICE_YES(24,"订单开票通过"),
+	ORDER_INVPICE_NO(25,"订单开票驳回"),
+	ORDER_INVPICE_APPROVA_YES(26,"订单开票特批通过"),
+	ORDER_INVPICE_APPROVA_NO(27,"订单开票特批驳回"),
+	ORDER_INVPICE_END(28,"订单开票完成"),
 	OTHER(0, "其他");
 
 	private NoticeStatus(Integer code, String desc) {

+ 6 - 0
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -289,6 +289,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			}
 			break;
 		case 7:
+			
 			for (Admin admin : adminMapper.getAdminRoleList("总裁")) {
 				alist.add(admin.getId());
 			}
@@ -435,7 +436,12 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	@Override
 	public int pushCompleteOrderChange(NewOrderChangeBo nb) {
 		changgeAdopt(nb);
+		List<String> alist = new ArrayList<>();
+		TOrderNew o=tOrderNewMapper.selectByPrimaryKey(nb.getOrderNo());
+		alist.add(o.getSalesmanId());
 		newOrderChangeMapper.updateByPrimaryKeySelective(nb);
+		AdminListBo a = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
+		orderNewService.generalSendNoticeAndEmail(alist,NoticeStatus.ORDER_CHANGE_END.getCode(), o.getOrderNo(), a.getId());
 		return 1;
 	}
 	@Override

+ 28 - 9
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -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);
 	}
 

+ 4 - 4
src/main/resources/props/config_local.properties

@@ -60,12 +60,12 @@ template.cacheable=false
 portal.host=//sf.jishutao.com/portal/2.0.6
 avatar.upload.host=//sb.jishutao.com/upload
 #连接开发
-static.host=//sb.jishutao.com/1.1.24
-avatar.host=//sb.jishutao.com
+#static.host=//sb.jishutao.com/1.1.24
+#avatar.host=//sb.jishutao.com
 
 #连测试
-#avatar.host=//static.jishutao.com
-#static.host=//static.jishutao.com/1.1.24
+avatar.host=//static.jishutao.com
+static.host=//static.jishutao.com/1.1.24
 
 upload.path=F:/data/public/upload
 upload.private.path=F:/data/private/upload