ソースを参照

Merge branch 'test' of jishutao/kede-server into prod

anderx 3 年 前
コミット
c77b2ca3c0

+ 1 - 1
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -303,7 +303,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 
 	@Override
 	public List<Admin> getAdminRoleList(String roleName) {
-		return adminMapper.getAdminRoleList(roleName);
+		return adminMapper.getAdminRoleNameList(roleName);
 	}
 
 	@Override

+ 7 - 1
src/main/java/com/goafanti/common/dao/AdminMapper.java

@@ -116,7 +116,11 @@ public interface AdminMapper {
     int getCountById(String id);
     AdminListBo getDeptNameByAid(String id);
 
-    List<Admin> getAdminRoleList(String roleName);
+    List<Admin> getAdminRoleNameList(String roleName);
+    List<Admin> getAdminRoleNamesList(List<String> list);
+
+    List<Admin> getAdminRoleTypesList(List<String> list);
+    List<Admin> getAdminRoleTypeList(String roleType);
 
     int addAdminContacts(AdminContacts a);
 
@@ -144,4 +148,6 @@ public interface AdminMapper {
     List<String> getFinanceDep(String aid);
 
     List<String> getLowerFinanceDep(String aid);
+
+
 }

+ 27 - 1
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -767,12 +767,38 @@
                                inner join user_role ur on a.id=ur.uid
     where a.id= #{_parameter,jdbcType=VARCHAR} and ( a.status != '注销' or a.status is null)
   </select>
-  <select id="getAdminRoleList" parameterType="java.lang.String" resultMap="BaseResultMap">
+  <select id="getAdminRoleNameList" parameterType="java.lang.String" resultMap="BaseResultMap">
     select a.id, a.name from admin a left join user_role b on a.id=b.uid
                                      left join `role` c on b.rid=c.id
     where c.role_name  = #{name,jdbcType=VARCHAR} and a.status='正常'
   </select>
 
+  <select id="getAdminRoleNamesList" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select a.id, a.name from admin a left join user_role b on a.id=b.uid
+                                     left join `role` c on b.rid=c.id
+    where a.status='正常'
+      and  c.role_name  in
+    <foreach close=")" collection="list" item="name" open="(" separator=",">
+      #{name}
+    </foreach>
+  </select>
+
+  <select id="getAdminRoleTypeList" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select a.id, a.name from admin a left join user_role b on a.id=b.uid
+                                     left join `role` c on b.rid=c.id
+    where c.role_type  = #{roleType} and a.status='正常'
+  </select>
+
+  <select id="getAdminRoleTypesList" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select a.id, a.name from admin a left join user_role b on a.id=b.uid
+                                     left join `role` c on b.rid=c.id
+    where a.status='正常'
+    and  c.role_type  in
+    <foreach close=")" collection="list" item="type" open="(" separator=",">
+      #{type}
+    </foreach>
+  </select>
+
 
   <select id="getDeptNameByAid" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
     select a.id,a.name, d.name as departmentName,a.department_id departmentId,a.email,a.superior_id superiorId,a.open_id openId,

+ 75 - 43
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -745,7 +745,7 @@
     o.order_status orderStatus,a.project_type projectType,o.sales_type salesType,o.other ,o.delete_sign deleteSign,
     date_format(a.`final_Receivables_time`, '%Y-%m-%d %H:%i:%s')finalReceivablesTime,a.order_receivables orderReceivables,a.order_arrears orderArrears
 	from t_order_new o left join department d on o.order_dep = d.id left join `user` u on o.buyer_id = u.id left join t_order_mid a on o.order_no=a.order_no
-	left join (select * from  t_order_outsource where type=0) too on o.order_no=too.order_no where delete_sign in(0,2) and approval in(0,1,2)
+	left join (select * from  t_order_outsource where type=0) too on o.order_no=too.order_no where delete_sign in(0,2) and approval in(0,1,2,4,5)
     and outsource=   #{o.outsource,jdbcType=INTEGER}
     <if test="o.processStatus == 3">
       and o.process_status = #{o.processStatus,jdbcType=INTEGER}
@@ -798,11 +798,14 @@
         <if test="o.projectType != null and o.projectType != &quot;&quot;">
           and a.project_type = #{o.projectType}
         </if>
-        <if test="o.approval != null and o.approval &lt; 3">
-          and o.approval = #{o.approval}
-        </if>
+      <if test="o.approval != null and o.approval ==1">
+        and o.approval in (1,4)
+      </if>
+      <if test="o.approval != null and o.approval ==2">
+        and o.approval in (2,5)
+      </if>
         <if test="o.approval != null and o.approval ==4">
-          and o.approval in (1,2)
+          and o.approval in (1,2,4,5)
         </if>
 	  	<if test="o.buyerName != null and o.buyerName != &quot;&quot;">
 	  	<bind name="n" value="'%' + o.buyerName + '%'" />
@@ -878,11 +881,14 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     <if test="o.projectType != null and o.projectType != &quot;&quot;">
       and a.project_type = #{o.projectType}
     </if>
-    <if test="o.approval != null and o.approval &lt; 3">
-      and o.approval = #{o.approval}
+    <if test="o.approval != null and o.approval ==1">
+      and o.approval in (1,4)
+    </if>
+    <if test="o.approval != null and o.approval ==2">
+      and o.approval in (2,5)
     </if>
     <if test="o.approval != null and o.approval ==4">
-      and o.approval in (1,2)
+      and o.approval in (1,2,4,5)
     </if>
 	  	<if test="o.buyerName != null and o.buyerName != &quot;&quot;">
 	  	<bind name="n" value="'%' + o.buyerName + '%'" />
@@ -958,7 +964,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	</if>
   	<if test="specially == 0">
   	  <if test="approval ==null">
-  	  and a.approval in(0,1,2)
+  	  and a.approval in(0,1,2,4,5)
       </if>
   	and a.order_status  in(0,1,2,4)
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
@@ -970,31 +976,44 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	and a.order_status in(3,5)
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
   	</if>
-  	<if test="specially == 3">
-  	 and  a.order_status=2 and a.process_status != 99
-  	<if test="approval ==0">
-  	and a.approval = 0
-  	</if>
-  	<if test="approval ==1">
-  	and a.process_status = 7
-  	and a.approval = 1
-  	</if>
-  	<if test="approval ==2">
-  	and a.approval &gt; 1
-  	</if>
-  	</if>
-  	  <if test="specially !=3">
+    <if test="specially == 3">
+      and  a.order_status=2
+      <if test="approval ==0">
+        and a.process_status in(7)
+        and a.approval = 0
+      </if>
+      <if test="approval ==1">
+        and a.process_status in(7)
+        and a.approval in
+            <if test="manageType ==0">
+            (1)
+            </if>
+          <if test="manageType ==1">
+            (4)
+          </if>
+      </if>
+      <if test="approval ==2">
+        and a.approval in
+        <if test="manageType ==0">
+          (2)
+        </if>
+        <if test="manageType ==1">
+          (5)
+        </if>
+      </if>
+    </if>
+  	  <if test="specially !=3 ">
         <if test="approval ==0">
           and a.approval = 0
         </if>
         <if test="approval ==1">
-          and a.approval =1
+          and a.approval in (1,4)
         </if>
         <if test="approval ==2">
-          and a.approval =2
+          and a.approval in (2,5)
         </if>
         <if test="approval ==4">
-          and a.approval in (1,2)
+          and a.approval in (1,2,4,5)
         </if>
       </if>
   	<if test="specially == 4">
@@ -1104,7 +1123,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	</if>
   	<if test="specially == 0">
       <if test="approval ==null">
-        and a.approval in(0,1,2)
+        and a.approval in(0,1,2,4,5)
       </if>
       and a.order_status  in(0,1,2,4)
       and a.salesman_id = #{aid,jdbcType=VARCHAR}
@@ -1116,31 +1135,44 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	and a.order_status in(3,5)
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
   	</if>
-  	<if test="specially == 3">
-  	 and  a.order_status=2 and a.process_status != 99
-  	<if test="approval ==0">
-  	and a.approval &gt; 0
-  	</if>
-  	<if test="approval ==1">
-  	and a.process_status = 7
-  	and a.approval = 1
-  	</if>
-  	<if test="approval ==2">
-  	and a.approval &gt; 1
-  	</if>
-  	</if>
+     <if test="specially == 3">
+       and  a.order_status=2
+       <if test="approval ==0">
+         and a.process_status in(7)
+         and a.approval = 0
+       </if>
+       <if test="approval ==1">
+         and a.process_status in(7)
+         and a.approval in
+         <if test="manageType ==0">
+           (1)
+         </if>
+         <if test="manageType ==1">
+           (4)
+         </if>
+       </if>
+       <if test="approval ==2">
+         and a.approval in
+         <if test="manageType ==0">
+           (2)
+         </if>
+         <if test="manageType ==1">
+           (5)
+         </if>
+       </if>
+     </if>
      <if test="specially !=3">
        <if test="approval ==0">
          and a.approval = 0
        </if>
        <if test="approval ==1">
-         and a.approval =1
+         and a.approval in (1,4)
        </if>
        <if test="approval ==2">
-         and a.approval =2
+         and a.approval in (2,5)
        </if>
        <if test="approval ==4">
-           and a.approval in (1,2)
+         and a.approval in (1,2,4,5)
        </if>
      </if>
   	<if test="specially == 4">

+ 2 - 1
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -336,7 +336,8 @@
 			a.sign_bills signBills,
 			a.share_type as shareType,
 			a.channel ,
-			a.information_maintainer as mid
+			a.information_maintainer as mid,
+	 		a.new_channel as newChannel
 		from  `user` a
 		left join user_names un on a.id=un.uid
 		left join organization_identity b on a.id = b.uid

+ 17 - 17
src/main/java/com/goafanti/customer/bo/CustomerListIn.java

@@ -8,40 +8,40 @@ public class CustomerListIn {
 	private String id;
 	/** 客户类型  0-个人 1-单位**/
 	private String type;
-	
+
 	/** 客户名称 **/
 	private String name;
-	
+
 	/** 省 **/
 	private String province;
-	
+
 	/** 市 **/
 	private String city;
-	
+
 	/** 区 **/
 	private String area;
-	
+
 	/** 开始时间 **/
 	private String startDate;
-	
+
 	/** 结束时间 **/
 	private String endDate;
-	
+
 	/** 客户状态  0-正常 1-注销 2-锁定**/
 	private String status;
 
 	/** 行业 **/
 	private String industry;
-	
+
 	/** 共享类型 0-私有 1-公共 **/
 	private String shareType;
-	
+
 	/** 营销员 ID **/
 	private String aid;
 
 	/** 社会性质 **/
 	private String societyTag;
-	
+
 	/** 联系人 **/
 	private String contacts;
 	/** 联系人电话 **/
@@ -50,24 +50,24 @@ public class CustomerListIn {
 	 * 创建时间
 	 */
 	private String createTime;
-	
+
 	private String dataGrade;
-	
+
 	private Integer creditRating;
-	
+
 	private String departmentId;
 
 	private Integer level;
-	
+
 	private String follow;
-	
+
 	private String iname;
-	
+
 	/**
 	 * 	排序 0否 1转换倒序 2转换正序
 	 */
 	private Integer sort;
-	/** 渠道 0否 1是 */
+	/** 外联 0否 1是 */
 	private Integer channel;
 
 	private String businessScope;

+ 34 - 24
src/main/java/com/goafanti/customer/bo/CustomerListOut.java

@@ -1,57 +1,57 @@
 package com.goafanti.customer.bo;
 
-public class CustomerListOut extends CustomerListIn{	
+public class CustomerListOut extends CustomerListIn{
 	/** 客户ID **/
 	private String uid;
-	
+
 	/** 联系人 **/
 	private String contacts;
-	
+
 	/** 联系电话 **/
 	private String contactMobile;
-	
+
 	/** 创建时间 **/
 	private String createTime;
-	
+
 	/** 转换时间  **/
 	private String transferTime;
-	
+
 	/** 营销员姓名 **/
 	private String adminName;
-	
+
 	/** 专家发布状态**/
 	private String releaseStatus;
-	
+
 	/** 审核意见**/
 	private String auditOpinion;
-	
+
 	/** 是否为咨询师 **/
 	private String consultant;
-	
+
 	/** 专家审核状态 **/
 	private String expertAudit ;
-	
+
 	/** 最后跟进时间 **/
 	private String lastFollowTime;
-	
+
 	/** 最后签单时间 **/
 	private String lastSignTime;
-	
+
 	/** 剩余私有时间 **/
 	private String surplusFollowTime;
-	
+
 	/** 剩余签单时间 **/
 	private String surplusSignTime;
-	
+
 	/** 资料所属人 **/
 	private String informationMaintainer;
-	
+
 	private String shareType;
-	
+
 	private String mid;
-	
+
 	private Integer level;
-	
+
 	private String aName;
 	/**
 	 * 指导意见 0无 1有
@@ -61,10 +61,20 @@ public class CustomerListOut extends CustomerListIn{
 	 * 签单 0否 1是
 	 */
 	private Integer signBills;
-	
-	/** 渠道 0否 1是 */
+
+	/** 外联 0否 1是 */
 	private Integer channel;
-	
+	/** 渠道 0否 1是 */
+	private Integer newChannel;
+
+	public Integer getNewChannel() {
+		return newChannel;
+	}
+
+	public void setNewChannel(Integer newChannel) {
+		this.newChannel = newChannel;
+	}
+
 	public Integer getChannel() {
 		return channel;
 	}
@@ -240,6 +250,6 @@ public class CustomerListOut extends CustomerListIn{
 		this.signBills = signBills;
 	}
 
-	
 
-}
+
+}

+ 1 - 1
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -476,7 +476,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "订单编号和审批","订单编号和审批"));
 			return res;
 		}
-		if (confirm==ApprovalNewState.BH.getCode()&&StringUtils.isBlank(reason)) {
+		if (confirm==ApprovalNewState.ZCBH.getCode()&&StringUtils.isBlank(reason)) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"驳回原因", "驳回原因"));
 			return res;
 		}

+ 14 - 7
src/main/java/com/goafanti/order/enums/ApprovalNewState.java

@@ -6,15 +6,22 @@ import java.util.Map;
 public enum ApprovalNewState {
 	/** 非特批 **/
 	FTP(0,"非特批"),
-	/** 待审核 **/
-	DSH(1,"待审核"),
-	/** 通过 **/
-	TG(2,"通过"),
-	/** 驳回 **/
-	BH(3,"驳回"),
+	/** 总裁待审核 **/
+	ZCDSH(1,"总裁待审核"),
+	/** 总裁通过 **/
+	ZCTG(2,"总裁通过"),
+	/** 总裁驳回 **/
+	ZCBH(3,"总裁驳回"),
+
+	/** 董事长待审核 **/
+	DSZDSH(4,"董事长待审核"),
+	/** 董事长通过 **/
+	DSZTG(5,"董事长通过"),
+	/** 董事长驳回 **/
+	DSZBH(6,"董事长驳回"),
 	/** 无效 **/
 	INVALID(10, "INVALID");
-	
+
 	private ApprovalNewState(Integer code, String desc) {
 		this.code = code;
 		this.desc = desc;

+ 20 - 6
src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java

@@ -96,7 +96,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 	public Integer updateDistributionFinance(String orderNo, String financeId, Integer approval) {
 		// 先判断订单id和财务专员是否存在或者能够使用
 		//判断是不是特批的数据
-		if(approval != ApprovalNewState.TG.getCode() && approval != ApprovalNewState.FTP.getCode()){//特批未通过 2 0
+		if(approval != ApprovalNewState.ZCTG.getCode() && approval != ApprovalNewState.FTP.getCode()){//特批未通过 2 0
 			return -1;
 		}
 
@@ -488,17 +488,31 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 			t.setBackStatus(0);
 		}
 		List<String> aids = new ArrayList<>();
-		if (new1.getApproval()==ApprovalNewState.DSH.getCode()||
-				new1.getApproval()==ApprovalNewState.BH.getCode()) {
+		if (new1.getApproval()==ApprovalNewState.ZCDSH.getCode()||
+				new1.getApproval()==ApprovalNewState.ZCBH.getCode()) {
 			t.setProcessStatus(ProcessStatus.YPTPSH.getCode());
-			for (Admin admin : adminMapper.getAdminRoleList("总裁")) {
+			List<String> types=new ArrayList<>();
+			//总裁加助理
+			types.add(AFTConstants.CED);
+			types.add(AFTConstants.CED_ASSISTANT);
+			for (Admin admin : adminMapper.getAdminRoleTypesList(types)) {
 				aids.add(admin.getId());
 			}
-		}else {
+		}else if (new1.getApproval()==ApprovalNewState.DSZDSH.getCode()||
+				new1.getApproval()==ApprovalNewState.DSZBH.getCode()) {
+			t.setProcessStatus(ProcessStatus.YPTPSH.getCode());
+			List<String> types=new ArrayList<>();
+			//董事长加助理
+			types.add(AFTConstants.APPROVAL_DECISION);
+			types.add(AFTConstants.APPROVAL_DECISION_AUDITOR);
+			for (Admin admin : adminMapper.getAdminRoleTypesList(types)) {
+				aids.add(admin.getId());
+			}
+		}else  {
 			t.setProcessStatus(ProcessStatus.YPZXSGLY.getCode());
 			OrganizationListOut oo=departmentMapper.selectAllById(new1.getOrderDep());
 			t.setFinanceId(oo.getFinanceId());
-			for (Admin admin : adminMapper.getAdminRoleList("咨询师管理员")) {
+			for (Admin admin : adminMapper.getAdminRoleTypeList(AFTConstants.TECH_ADMIN)) {
 				aids.add(admin.getId());
 			}
 		}

+ 15 - 7
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -277,10 +277,11 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 					}else {
 						if(nb.getProcessState()==7) {
 							nb.setProcessState(nb.getProcessState()+1);
-						}else if(nb.getProcessState()==8) {//董事长项目变更通过
-							nb.setStatus(2);
 						}
 					}
+					if(nb.getProcessState()==8) {//董事长项目变更通过
+						nb.setStatus(2);
+					}
 					//营销管理通过则设置技术管理员通过表
 					if(nb.getProcessState()==1){
 						if (orderExamineMapper.checkCountStatus(orderNo,null,null)<1) {
@@ -291,8 +292,15 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 						nb.setProcessState(nb.getProcessState()+1);
 					}
 					//必须放置在咨询师与咨询师经理前,否则会直接通过不走咨询师管理员
-					if(nb.getProcessState()==4||nb.getProcessState()==5||nb.getProcessState()==6) {
+					if(nb.getProcessState()==4||nb.getProcessState()==5) {
 						nb.setProcessState(nb.getProcessState()+1);
+					}else if (nb.getProcessState()==6){
+						TOrderNew tOrderNew = tOrderNewMapper.selectByPrimaryKey(nb.getOrderNo());
+						if (tOrderNew.getSalesmanId().equals("734092ad-6564-4021-b7ab-aab5af3a1537")){
+							nb.setProcessState(8);
+						} else{
+							nb.setProcessState(7);
+						}
 					}
 					if(nb.getProcessState()==2){//咨询师
 						//找出当时人的审核改为通过
@@ -381,7 +389,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			alist.addAll(tOrderTaskMapper.listNameByDepAndName(o.getOrderNo(),1));
 			break;
 		case 4:
-			for (Admin admin : adminMapper.getAdminRoleList("咨询师管理员")) {
+			for (Admin admin : adminMapper.getAdminRoleTypeList(AFTConstants.TECH_ADMIN)) {
 				alist.add(admin.getId());
 			}
 			break;
@@ -389,7 +397,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			alist.add(o.getFinanceId());
 			break;
 		case 6:
-			for (Admin admin : adminMapper.getAdminRoleList("财务管理员")) {
+			for (Admin admin : adminMapper.getAdminRoleTypeList(AFTConstants.FINANCE_ADMIN)) {
 				alist.add(admin.getId());
 			}
 			break;
@@ -397,7 +405,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			if(nb.getStatus()==2) {
 				alist.add(o.getFinanceId());
 			}else {
-				for (Admin admin : adminMapper.getAdminRoleList("总裁")) {
+				for (Admin admin : adminMapper.getAdminRoleTypeList(AFTConstants.CED)) {
 					alist.add(admin.getId());
 				}
 			}
@@ -406,7 +414,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			if(nb.getStatus()==2) {
 				alist.add(o.getFinanceId());
 			}else {
-				for (Admin admin : adminMapper.getAdminRoleList("运营决策者")) {
+				for (Admin admin : adminMapper.getAdminRoleTypeList(AFTConstants.APPROVAL_DECISION)) {
 					alist.add(admin.getId());
 				}
 			}

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

@@ -89,7 +89,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 				if(o.getApproval()==0) {
 					aids.add(departmentMapper.selectByPrimaryKey(t.getOrderDep()).getFinanceId());
 				}else {
-					for (Admin admin : adminMapper.getAdminRoleList("湖南特批开票")) {
+					for (Admin admin : adminMapper.getAdminRoleNameList("湖南特批开票")) {
 						aids.add(admin.getId());
 					}
 				}

+ 75 - 45
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -421,18 +421,30 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			contactBook.setMobile(t.getContactMobile());
 			organizationContactBookMapper.insertSelective(contactBook);
 		}
+		Admin admin = adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
 		if (StringUtils.isBlank(t.getOrderDep())) {
-			t.setOrderDep(adminMapper.selectByPrimaryKey(TokenManager.getAdminId()).getDepartmentId());
+			t.setOrderDep(admin.getDepartmentId());
 		}
 		if (isSubmit==1) {//订单提交
+			t2.setApproval(t.getApproval());
 			if(t2.getProcessStatus()<ProcessStatus.YPYXGLY.getCode()) {
 				t.setOrderStatus(OrderNewState.QDDS.getCode());
 				t.setProcessStatus(ProcessStatus.YPYXGLY.getCode());
 			}else {
 				t.setOrderStatus(OrderNewState.QDSHTG.getCode());
 			}
-			if (t2.getApproval()==ApprovalNewState.BH.getCode()){
-				t.setApproval(ApprovalNewState.DSH.getCode());
+			//特批逻辑处理
+			if (t2.getApproval()==ApprovalNewState.ZCDSH.getCode()){
+				if (admin.getId().equals("734092ad-6564-4021-b7ab-aab5af3a1537")){
+					t.setApproval(ApprovalNewState.DSZDSH.getCode());
+				}else {
+					t.setApproval(ApprovalNewState.ZCDSH.getCode());
+				}
+			}
+			if (t2.getApproval()==ApprovalNewState.ZCBH.getCode()){
+				t.setApproval(ApprovalNewState.ZCDSH.getCode());
+			}else if (t2.getApproval()==ApprovalNewState.DSZBH.getCode()){
+				t.setApproval(ApprovalNewState.DSZDSH.getCode());
 			}
 			//生成流转
 			TOrderLog tl=new TOrderLog();
@@ -460,7 +472,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			pushGeneralSendNoticeAndEmail(aids, type,order, TokenManager.getAdminId(),t.getApproval());
 
 		}
-		if (t2.getApproval().equals(ApprovalNewState.BH.getCode()) ||
+		if (t2.getApproval().equals(ApprovalNewState.ZCBH.getCode()) ||
+				t2.getApproval().equals(ApprovalNewState.DSZBH.getCode()) ||
 				t2.getOrderStatus().equals(OrderNewState.QDSHJJ.getCode()) ||
 				t2.getOrderStatus().equals(OrderNewState.YBH.getCode())) {
 			t.setCreateTime(new Date());
@@ -675,9 +688,16 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Override
 	public Pagination<TOrderNewBo> orderNewList(InputOrderNewListBo in) {
 		Map<String, Object> params = new HashMap<>();
-		if (in.getSpecially()!=null&&(in.getSpecially()==0||in.getSpecially()==1||in.getSpecially()==2||in.getSpecially()==4||in.getSpecially()==5||in.getSpecially()==7)) {
+		Pagination<TOrderNewBo> x = addParams(in, params);
+		if (x != null) return x;
+		Pagination<TOrderNewBo> p = (Pagination<TOrderNewBo>)findPage("selectOrderNewListByPage", "selectOrderNewListCount", params, in.getPageNo(), in.getPageSize());
+		return p;
+	}
+
+	private Pagination<TOrderNewBo> addParams(InputOrderNewListBo in, Map<String, Object> params) {
+		if (in.getSpecially()!=null&&(in.getSpecially()==0|| in.getSpecially()==1|| in.getSpecially()==2|| in.getSpecially()==4|| in.getSpecially()==5|| in.getSpecially()==7)) {
 			//0 个人 1 营销员管理 2 驳回 3 特批 4 咨询师管理 5部门订单查询
-			if (in.getSpecially()!=3&&in.getSpecially()!=4) {
+			if (in.getSpecially()!=3&& in.getSpecially()!=4) {
 				if (in.getAid() ==null){
 					params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
 				}else{
@@ -686,7 +706,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			}
 			//(咨询师管理列表 0 未分配 1部分   2全部)
 			if(in.getSpecially()==4) {
-				params.put("distribution",in.getDistribution());
+				params.put("distribution", in.getDistribution());
 			}
 		}else if(in.getSpecially()==8){
 			if (StringUtils.isNotBlank(in.getUid())) {
@@ -697,12 +717,21 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				params.put("aid", in.getAid());
 			}
 		}
-			params.put("specially",in.getSpecially());
+		if (in.getSpecially()==3){
+			if (TokenManager.hasRole(AFTConstants.CED)){
+				params.put("manageType",0);
+			}else if (TokenManager.hasRole(AFTConstants.APPROVAL_DECISION_AUDITOR)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)){
+				params.put("manageType",1);
+			}else {
+				params.put("manageType",0);
+			}
+		}
+		params.put("specially", in.getSpecially());
 		if (StringUtils.isNotBlank(in.getName())) {
 			params.put("name", in.getName());
 		}
 		// 计算出所有本部门及所属部门的ID
-		if(in.getSpecially()==1||in.getSpecially()==5) {
+		if(in.getSpecially()==1|| in.getSpecially()==5) {
 			List<String>departmentList=new ArrayList<>();
 			if (in.getDeps()!=null){
 				departmentList=departmentService.selectSubDeps(in.getDeps());
@@ -721,39 +750,38 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (StringUtils.isNotBlank(in.getContractNo())) {
 			params.put("contractNo", in.getContractNo());
 		}
-		if (null!=in.getLiquidationStatus()) {
+		if (null!= in.getLiquidationStatus()) {
 			params.put("liquidationStatus", in.getLiquidationStatus());
 		}
-			if (null !=in.getApproval()) {
-				params.put("approval", in.getApproval());
-			}
-			if(null != in.getAmountStatus()) {
-				params.put("amountStatus", in.getAmountStatus());
-			}
-			if (StringUtils.isNotBlank(in.getOrderNo())) {
-				params.put("orderNo", in.getOrderNo());
-			}
-			if (StringUtils.isNotBlank(in.getStarTime())) {
-				params.put("starTime", in.getStarTime());
-			}
-			if (StringUtils.isNotBlank(in.getEndTime())) {
-				params.put("endTime", in.getEndTime()+" 23:59:59");
-			}
-			if (StringUtils.isNotBlank(in.getContractStart())) {
-				params.put("contractStart", in.getContractStart());
-			}
-			if (StringUtils.isNotBlank(in.getContractEnd())) {
-				params.put("contractEnd", in.getContractEnd()+" 23:59:59");
-			}
-			if(null != in.getProjectType()) {
-				params.put("projectType",in.getProjectType());
-			}
-			if(null != in.getProcessStatus()) {
-				params.put("processStatus",in.getProcessStatus());
-			}
+		if (null != in.getApproval()) {
+			params.put("approval", in.getApproval());
+		}
+		if(null != in.getAmountStatus()) {
+			params.put("amountStatus", in.getAmountStatus());
+		}
+		if (StringUtils.isNotBlank(in.getOrderNo())) {
+			params.put("orderNo", in.getOrderNo());
+		}
+		if (StringUtils.isNotBlank(in.getStarTime())) {
+			params.put("starTime", in.getStarTime());
+		}
+		if (StringUtils.isNotBlank(in.getEndTime())) {
+			params.put("endTime", in.getEndTime()+" 23:59:59");
+		}
+		if (StringUtils.isNotBlank(in.getContractStart())) {
+			params.put("contractStart", in.getContractStart());
+		}
+		if (StringUtils.isNotBlank(in.getContractEnd())) {
+			params.put("contractEnd", in.getContractEnd()+" 23:59:59");
+		}
+		if(null != in.getProjectType()) {
+			params.put("projectType", in.getProjectType());
+		}
+		if(null != in.getProcessStatus()) {
+			params.put("processStatus", in.getProcessStatus());
+		}
 		params.put("outsource", in.getOutsource());
-		Pagination<TOrderNewBo> p = (Pagination<TOrderNewBo>)findPage("selectOrderNewListByPage", "selectOrderNewListCount", params, in.getPageNo(), in.getPageSize());
-		return p;
+		return null;
 	}
 
 
@@ -850,7 +878,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 					//如果是转的暂时不删除外包信息
 					aids.add(departmentMapper.selectByPrimaryKey(t2.getOrderDep()).getFinanceId());
 				} else if(outsource==1) {
-					for (Admin admin : adminMapper.getAdminRoleList("外包审核员")) {
+					for (Admin admin : adminMapper.getAdminRoleNameList("外包审核员")) {
 						aids.add(admin.getId());
 					}
 					t.setProcessStatus(ProcessStatus.YPWBSH.getCode());
@@ -1184,18 +1212,21 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		Integer type=null;
 		TOrderLog tl=new TOrderLog();
 		tl.setOrderNo(orderNo);
+
 		if (confirm==2) {
-			t.setApproval(2);
+			if (t2.getApproval()==ApprovalNewState.ZCDSH.getCode())t.setApproval(ApprovalNewState.ZCTG.getCode());
+			else if (t2.getApproval()==ApprovalNewState.DSZDSH.getCode())t.setApproval(ApprovalNewState.DSZTG.getCode());
 				t.setProcessStatus(ProcessStatus.YPZXSGLY.getCode());
 				OrganizationListOut oo=departmentMapper.selectAllById(t2.getOrderDep());
 				t.setFinanceId(oo.getFinanceId());
-				for (Admin admin : adminMapper.getAdminRoleList("咨询师管理员")) {
+				for (Admin admin : adminMapper.getAdminRoleTypeList(AFTConstants.TECH_ADMIN)) {
 					aids.add(admin.getId());
 				}
 			type=NoticeStatus.ORDER_APPROVA_YES.getCode();
 			tl.setProcess(OrderLogProcess.TP.getCode());
 		} else {
-			t.setApproval(3);
+			if (t2.getApproval()==ApprovalNewState.ZCDSH.getCode())t.setApproval(ApprovalNewState.ZCBH.getCode());
+			else if (t2.getApproval()==ApprovalNewState.DSZDSH.getCode())t.setApproval(ApprovalNewState.DSZBH.getCode());
 			t.setOrderStatus(OrderNewState.YBH.getCode());
 			t.setProcessStatus(ProcessStatus.YPYXY.getCode());
 			addBackOrder(orderNo, reason);
@@ -1207,7 +1238,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		TOrderNewBo order = tOrderNewMapper.getSaleIdByOno(orderNo);
 		pushGeneralSendNoticeAndEmail(aids, type,order, TokenManager.getAdminId(),t2.getApproval());
 		//新增特批催款信息
-
 		return tOrderNewMapper.updateByPrimaryKeySelective(t);
 	}
 
@@ -1590,7 +1620,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		}
 		if (o.getStartType()==0) {
 			List<String> aids = new ArrayList<>();
-			for (Admin admin : adminMapper.getAdminRoleList("外包审核员")) {
+			for (Admin admin : adminMapper.getAdminRoleNameList("外包审核员")) {
 				aids.add(admin.getId());
 			}
 			TOrderNew t2= checkDeleteSign(o.getOrderNo());

+ 2 - 2
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -1275,7 +1275,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 				if (result==1) {
 					admins = MemberEnd(b);
 				}else{
-					admins=adminMapper.getAdminRoleList("总裁");
+					admins=adminMapper.getAdminRoleTypeList(AFTConstants.CED);
 				}
 			} else if(shiroType==1){
 				sb=sb.append("特批已通过。");
@@ -1309,7 +1309,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	 */
 	private List<Admin> MemberEnd(TOrderNewBo b) {
 		List<Admin> admins;
-		admins=adminMapper.getAdminRoleList("咨询师管理员");
+		admins=adminMapper.getAdminRoleTypeList(AFTConstants.TECH_ADMIN);
 		Admin admin = new Admin();
 		admin.setId(b.getSalesmanId());
 		admins.add(admin);

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

@@ -46,7 +46,7 @@ user_remind_days=15
 user_channel_days=90
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.42
+static.host=//static.jishutao.com/1.2.43
 #avatar.host=//172.16.0.255:3000
 #static.host=//172.16.0.255:3000/1.2.27
 #static.host=http://172.16.1.187/prod/1.2.25

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -43,7 +43,7 @@ user_remind_days=15
 #\u63D0\u524D\u63D0\u9192\u5929\u6570
 user_channel_days=90
 
-static.host=//static.jishutao.com/1.2.42
+static.host=//static.jishutao.com/1.2.43
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload