Переглянути джерело

催款与工时BUG修改

Signed-off-by: anderx <312518615@qq.com>
anderx 6 роки тому
батько
коміт
7eed4fa7cb

+ 0 - 3
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -45,9 +45,6 @@ public class AFTConstants {
 	
 	public static final String  FINANCE								= "97";					// 财务专员
 
-	public static final String	SALESMANAGERADMIN					= "";					// 营销经理
-
-	public static final String	SALESMANADMIN						= "";					// 营销员
 
 	public static final String	TECHBROKER							= "";					// 技术经纪人
 

+ 22 - 10
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1370,7 +1370,7 @@ where super_id is null ) e on e.order_no=a.order_no
   </select>
   
   <select id="selectDunOrderNewListByPage" resultType="com.goafanti.order.bo.outOrderDunListBo">
-    	select a.id, b.contract_no contractNo,a.order_no as orderNo,c.nickname as userName,d.name as salesmanName,b.project_status projectStatus,
+    	select a.id, b.contract_no contractNo,a.order_no as orderNo,c.nickname as userName,tm.salesman_name as salesmanName,b.project_status projectStatus,
 	b.total_amount as totalAmount,b.liquidation_status as liquidationStatus,b.settlement_amount as settlementAmount,a.money as accountsReceivable,
 	if((b.total_amount-b.settlement_amount) &lt; 1,0,(b.total_amount-b.settlement_amount)) as uncollectedAmount,b.order_status as orderStatus,
 	date_format(a.start_time, '%Y-%m-%d') as startDate,dep.name as depName,date_format(b.sign_time,'%Y-%m-%d') as signDate,
@@ -1383,19 +1383,25 @@ where super_id is null ) e on e.order_no=a.order_no
 	from new_order_dun a left join t_order_task e on a.tid=e.id 
 	</if>
 	left join t_order_new b on a.order_no=b.order_no left join `user` c on b.buyer_id=c.id 
-	left join admin d on b.salesman_id=d.id left join department dep on d.department_id=dep.id 
+	left join t_order_mid tm on b.order_no=tm.order_no left join department dep on b.order_dep=dep.id
 	where  b.delete_sign != 1
+	<if test="shiroType == 1 and fid !=null">
+  	 and tm.finance_id= #{fid,jdbcType=VARCHAR}
+  	</if>
+  	<if test="shiroType == 2 and fid !=null">
+  	 and tm.finance_id in (select id from admin where superior_id= #{fid,jdbcType=VARCHAR})
+  	</if>
     <if test="name != null">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
   	<if test="adminName != null">
-  	and d.name  like CONCAT('%',#{adminName,jdbcType=VARCHAR},'%')
+  	and tm.salesman_name  like CONCAT('%',#{adminName,jdbcType=VARCHAR},'%')
   	</if>
   	<if test="orderNo != null">
   	and a.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%') 
   	</if>
   	<if test="depId != null">
-  	and dep.id= #{depId,jdbcType=VARCHAR}
+  	and b.order_dep= #{depId,jdbcType=VARCHAR}
   	</if>
   	<if test="aid != null">
   	and b.salesman_id= #{aid,jdbcType=VARCHAR}
@@ -1403,7 +1409,7 @@ where super_id is null ) e on e.order_no=a.order_no
   	<if test="starTime !=null and endTime !=null">
   	and b.sign_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
   	</if>
-  	order by b.sign_time desc
+  	order by b.sign_time desc,b.create_time desc
   	<if test="page_sql!=null">
 			${page_sql}
 	</if>
@@ -1418,20 +1424,26 @@ where super_id is null ) e on e.order_no=a.order_no
 	<if test="newStatus == 1 ">
 	from new_order_dun a left join t_order_task e on a.tid=e.id 
 	</if>
-	 left join t_order_new b on a.order_no=b.order_no
-    left join `user` c on b.buyer_id=c.id 
-    where b.delete_sign != 1
+	left join t_order_new b on a.order_no=b.order_no left join `user` c on b.buyer_id=c.id 
+	left join t_order_mid tm on b.order_no=tm.order_no
+	where  b.delete_sign != 1
+	<if test="shiroType == 1 and fid !=null">
+  	 and tm.finance_id= #{fid,jdbcType=VARCHAR}
+  	</if>
+  	<if test="shiroType == 2 and fid !=null">
+  	 and tm.finance_id in (select id from admin where superior_id= #{fid,jdbcType=VARCHAR})
+  	</if>
     <if test="name != null">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
   	<if test="adminName != null">
-  	and d.name  like CONCAT('%',#{adminName,jdbcType=VARCHAR},'%')
+  	and salesman_name  like CONCAT('%',#{adminName,jdbcType=VARCHAR},'%')
   	</if>
   	<if test="orderNo != null">
   	and a.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%') 
   	</if>
   	<if test="depId != null">
-  	and dep.id= #{depId,jdbcType=VARCHAR}
+  	and b.order_dep= #{depId,jdbcType=VARCHAR}
   	</if>
   	<if test="aid != null">
   	and b.salesman_id= #{aid,jdbcType=VARCHAR}

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

@@ -672,11 +672,24 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		else params.put("newStatus", tOrderDunMapper.selectByOrderNo(orderNo).isEmpty()?1:0);
 		if (StringUtils.isNotBlank(name)) params.put("name", name);
 		if (StringUtils.isNotBlank(depId)) params.put("depId", depId);
-		if(specially!=null&&specially==1) params.put("aid", TokenManager.getAdminId());
 		if (StringUtils.isNotBlank(adminName)) params.put("adminName", adminName);
 		if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
 		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
 		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
+		Integer i=null;
+		if(TokenManager.hasRole(AFTConstants.SALESMAN)) {
+			params.put("aid", TokenManager.getAdminId());
+		} else if (TokenManager.hasRole(AFTConstants.FINANCE)) {
+			i=1;
+			params.put("fid", TokenManager.getAdminId());
+		}else if (TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)) {
+			i=2;
+			params.put("fid", TokenManager.getAdminId());
+		}
+		if (TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)||TokenManager.hasRole(AFTConstants.VICE_CEO)||
+				TokenManager.hasRole(AFTConstants.SUPERADMIN)||TokenManager.hasRole(AFTConstants.CED)||
+				TokenManager.hasRole(AFTConstants.APPROVAL_DECISION))i=3;
+		if(i!=null)params.put("shiroType", i);
 		Pagination<outOrderDunListBo> p = (Pagination<outOrderDunListBo>)findPage("selectDunOrderNewListByPage", "selectDunOrderNewListCount", params, pageNo, pageSize);
 		return p;
 	}