Browse Source

咨询师管理员列表,部门订单查询列表查询条件更换成部门及所有下属部门

anderx 7 years ago
parent
commit
078fe4dc6f

+ 17 - 4
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1119,7 +1119,11 @@
   	</if>
   	<if test="specially == 1">
   	and a.process_status =1  and a.order_status=1
-  	and c.department_id=(select department_id from admin where  id= #{aid,jdbcType=VARCHAR})
+  	<!-- and c.department_id in (#{deps,jdbcType=VARCHAR}) -->
+  	and c.department_id in
+  	<foreach collection="deps" item="deps" open="(" separator="," close=")">
+	 #{deps.id}
+  	</foreach>
   	</if>
   	<if test="specially == 2">
   	and a.order_status in(3,5) 
@@ -1133,7 +1137,10 @@
   	and a.order_status not in(5,7)
   	</if>
   	<if test="specially == 5">
-  	and c.department_id=(select department_id from admin where  id= #{aid,jdbcType=VARCHAR})
+  	and c.department_id in
+  	<foreach collection="deps" item="deps" open="(" separator="," close=")">
+	 #{deps.id}
+  	</foreach>
   	</if>
   	<if test="distribution == 0">
   	and a.process_status &lt; 5
@@ -1184,7 +1191,10 @@
   	</if>
   	<if test="specially == 1">
   	and a.process_status =1  and a.order_status=1
-  	and c.department_id=(select department_id from admin where  id= #{aid,jdbcType=VARCHAR})
+  	and c.department_id in
+  	<foreach collection="deps" item="deps" open="(" separator="," close=")">
+	 #{deps.id}
+  	</foreach>
   	</if>
   	<if test="specially == 2">
   	and a.order_status in(3,5) 
@@ -1198,7 +1208,10 @@
   	and a.order_status not in(5,7)
   	</if>
   	<if test="specially == 5">
-  	and c.department_id=(select department_id from admin where  id= #{aid,jdbcType=VARCHAR})
+  	and c.department_id in
+  	<foreach collection="deps" item="deps" open="(" separator="," close=")">
+	 #{deps.id}
+  	</foreach>
   	</if>
   	<if test="distribution == 0">
   	and a.process_status &lt; 5

+ 1 - 1
src/main/java/com/goafanti/common/utils/ExportExcelUtil.java

@@ -407,7 +407,7 @@ public class ExportExcelUtil {
 					case "签单金额(万元)": o = ob.getTotalAmount().toString(); break;
 					case "项目状态": o = ProjectNewStage.getValueByCode(ob.getProjectStatus()); break;
 					case "结算状态": o = LiquidationNewState.getValueByCode(ob.getLiquidationStatus()); break;
-					case "已收款": o = ob.getSettlementAmount().toString(); break;
+					case "已收款(万元)": o = ob.getSettlementAmount().toString(); break;
 					case "订单负责人": o =ob.getSalesmanName(); break;
 					case "催收科目": o = getDunSuBubject(ob.getDunSubject()); break;
 					case "催款启动日期": o = ob.getStartDate(); break;

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

@@ -236,6 +236,7 @@ public class AdminNewOrderApiController extends CertifyApiController {
 		return res;
 	}
 	
+	
 	/**
 	 * 订单审核
 	 */

+ 13 - 6
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -42,6 +42,7 @@ import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OrganizationContactBook;
+import com.goafanti.common.model.OrganizationManagement;
 import com.goafanti.common.model.TDunLog;
 import com.goafanti.common.model.TOrderBack;
 import com.goafanti.common.model.TOrderDun;
@@ -73,6 +74,7 @@ import com.goafanti.order.enums.ProjectNewStage;
 import com.goafanti.order.enums.TaskState;
 import com.goafanti.order.enums.refundState;
 import com.goafanti.order.service.OrderNewService;
+import com.goafanti.order.service.OrderService;
 
 @Service
 public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> implements OrderNewService {
@@ -97,6 +99,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Autowired
 	NoticeMapper	noticeMapper;
 	@Autowired
+	OrderService	orderService;
+	@Autowired
 	private UserLockReleaseMapper	userLockReleaseMapper;
 	@Value(value = "${mobileRemindCodeTemplate}")
 	private String					mobileRemindCodeTemplate	= null;
@@ -275,13 +279,16 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if(pageSize==null||pageSize<0)pageSize=10;
 		if(pageNo==null||pageNo<0)pageNo=1;
 		if (specially!=null&&(specially==0||specially==1||specially==2||specially==5)) {
-			params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
-		}else if(specially!=null&&specially==4){
-			params.put("distribution",distribution);
-		}
 			//0 个人 1 营销员管理 2 驳回 3 特批 4 咨询师管理 5部门订单查询
+			if (specially!=3&&specially!=4) {
+				params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
+			}
+			//(咨询师管理列表 0 未分配 1部分   2全部)
+			if(specially==4) params.put("distribution",distribution);
+			// 计算出所有本部门及所属部门的ID
+			if(specially==1||specially==5) params.put("deps", orderService.selectMyDeps());
+		}
 			params.put("specially",specially);
-		
 		if (StringUtils.isNotBlank(name)) params.put("name", name);
 		if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
 		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
@@ -290,7 +297,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		return p;
 	}
 
-
+	
 
 	@Override
 	public int updateOrderNew(String orderNo, Integer orderStatus,String reason) {