Browse Source

Merge remote-tracking branch 'origin/test02' into test02

# Conflicts:
#	src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
#	src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
anderx 3 years ago
parent
commit
cc2da8b6b8
68 changed files with 1108 additions and 665 deletions
  1. 12 12
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  2. 0 14
      src/main/java/com/goafanti/admin/controller/AdminDepartmentApiController.java
  3. 1 1
      src/main/java/com/goafanti/admin/service/AdminService.java
  4. 9 9
      src/main/java/com/goafanti/admin/service/DepartmentService.java
  5. 5 3
      src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java
  6. 44 67
      src/main/java/com/goafanti/admin/service/impl/DepartmentServiceImpl.java
  7. 13 3
      src/main/java/com/goafanti/common/dao/DepartmentMapper.java
  8. 1 1
      src/main/java/com/goafanti/common/dao/TOrderNewMapper.java
  9. 2 2
      src/main/java/com/goafanti/common/dao/UserMapper.java
  10. 10 4
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml
  11. 23 14
      src/main/java/com/goafanti/common/mapper/DepartmentMapper.xml
  12. 4 4
      src/main/java/com/goafanti/common/mapper/NewOrderChangeMapper.xml
  13. 14 8
      src/main/java/com/goafanti/common/mapper/PatentNewMapper.xml
  14. 6 12
      src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml
  15. 11 5
      src/main/java/com/goafanti/common/mapper/TOrderBillNewMapper.xml
  16. 46 31
      src/main/java/com/goafanti/common/mapper/TOrderBonusMapper.xml
  17. 4 4
      src/main/java/com/goafanti/common/mapper/TOrderInvoiceMapper.xml
  18. 10 16
      src/main/java/com/goafanti/common/mapper/TOrderMidMapper.xml
  19. 42 39
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
  20. 14 8
      src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml
  21. 89 65
      src/main/java/com/goafanti/common/mapper/TemporaryReceivablesMapper.xml
  22. 4 4
      src/main/java/com/goafanti/common/mapper/UserFollowMapper.xml
  23. 10 4
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  24. 4 4
      src/main/java/com/goafanti/common/mapper/UserMidMapper.xml
  25. 9 2
      src/main/java/com/goafanti/common/model/Department.java
  26. 22 22
      src/main/java/com/goafanti/common/model/TOrderBillNew.java
  27. 15 11
      src/main/java/com/goafanti/order/bo/InputArrearsDunListBo.java
  28. 7 5
      src/main/java/com/goafanti/order/bo/InputMemberList.java
  29. 9 5
      src/main/java/com/goafanti/order/bo/InputOrderInvoiceBo.java
  30. 5 5
      src/main/java/com/goafanti/order/bo/InputOrderListBo.java
  31. 188 0
      src/main/java/com/goafanti/order/bo/InputOrderNewListBo.java
  32. 23 0
      src/main/java/com/goafanti/order/bo/InputOrderSalesSource.java
  33. 11 9
      src/main/java/com/goafanti/order/bo/InputProjectCheck.java
  34. 7 5
      src/main/java/com/goafanti/order/bo/InputSignStatistics.java
  35. 11 7
      src/main/java/com/goafanti/order/bo/OrderListBo.java
  36. 29 29
      src/main/java/com/goafanti/order/bo/TOrderBonusBo.java
  37. 7 29
      src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java
  38. 8 6
      src/main/java/com/goafanti/order/controller/AdminOrderReceivablesApiController.java
  39. 9 9
      src/main/java/com/goafanti/order/controller/OrderChangeApiController.java
  40. 2 2
      src/main/java/com/goafanti/order/service/OrderChangeService.java
  41. 3 11
      src/main/java/com/goafanti/order/service/OrderNewService.java
  42. 3 3
      src/main/java/com/goafanti/order/service/OrderReceivablesService.java
  43. 5 3
      src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java
  44. 14 2
      src/main/java/com/goafanti/order/service/impl/LegalAffairsServiceImpl.java
  45. 9 3
      src/main/java/com/goafanti/order/service/impl/OrderBillServiceImpl.java
  46. 19 13
      src/main/java/com/goafanti/order/service/impl/OrderBonusServiceImpl.java
  47. 10 8
      src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java
  48. 2 2
      src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java
  49. 7 3
      src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java
  50. 23 20
      src/main/java/com/goafanti/order/service/impl/OrderReceivablesServiceImpl.java
  51. 2 2
      src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java
  52. 5 0
      src/main/java/com/goafanti/order/service/impl/OrderStatisticsServiceImpl.java
  53. 2 7
      src/main/java/com/goafanti/order/service/impl/UserStatisticsServiceImpl.java
  54. 56 0
      src/main/java/com/goafanti/organization/bo/DepOut.java
  55. 22 14
      src/main/java/com/goafanti/organization/bo/InputPaymentList.java
  56. 11 0
      src/main/java/com/goafanti/organization/bo/OrganizationListOut.java
  57. 28 10
      src/main/java/com/goafanti/organization/controller/AdminOrganizationController.java
  58. 9 3
      src/main/java/com/goafanti/organization/service/OrganizationService.java
  59. 60 23
      src/main/java/com/goafanti/organization/service/impl/OrganizationServiceImpl.java
  60. 2 2
      src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java
  61. 12 10
      src/main/java/com/goafanti/patent/bo/PatentNewBo.java
  62. 3 3
      src/main/java/com/goafanti/patent/service/impl/PatentNewServiceImpl.java
  63. 14 14
      src/main/java/com/goafanti/report/controller/ReportApiController.java
  64. 22 15
      src/main/java/com/goafanti/report/service/SalesReportServiceImpl.java
  65. 7 5
      src/main/java/com/goafanti/user/bo/InputUserFollowList.java
  66. 2 2
      src/main/java/com/goafanti/user/service/impl/UserFollowServiceImpl.java
  67. 5 5
      src/main/java/com/goafanti/weChat/bo/InputPublicDtails.java
  68. 11 2
      src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

+ 12 - 12
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -183,9 +183,9 @@ public class AdminApiController extends CertifyApiController {
 	private CopyrightInfoService			copyrightInfoService;
 	@Resource
 	private OrgCognizanceProportionService	orgCognizanceProportionService;
-	
-	
-	
+
+
+
 	@Value(value = "${wx.appId}")
 	private String appId;
 	@Value(value = "${wx.appSecret}")
@@ -343,7 +343,7 @@ public class AdminApiController extends CertifyApiController {
 		return res;
 	}
 
-	
+
 
 	/**
 	 * 新增用户
@@ -726,7 +726,7 @@ public class AdminApiController extends CertifyApiController {
 
 	/**
 	 * 删除团体人力资源
-	 * 
+	 *
 	 * @return
 	 */
 	@RequestMapping(value = "/deleteHumanResource", method = RequestMethod.POST)
@@ -1568,7 +1568,7 @@ public class AdminApiController extends CertifyApiController {
 
 	/**
 	 * 删除企业年度研究开发费用结构明细记录
-	 * 
+	 *
 	 * @param ids
 	 * @return
 	 */
@@ -2619,8 +2619,8 @@ public class AdminApiController extends CertifyApiController {
 		res.setData(disposeCognizanceStatus());
 		return res;
 	}
-	
-	
+
+
 	/**
 	 * 高企认定流转状态
 	 */
@@ -2991,7 +2991,7 @@ public class AdminApiController extends CertifyApiController {
 		}
 		return res;
 	}
-	
+
 	/**
 	 * 角色列表
 	 */
@@ -3032,9 +3032,9 @@ public class AdminApiController extends CertifyApiController {
 	 * 常用联系人列表
 	 */
 	@RequestMapping(value = "/frequentContactsList", method = RequestMethod.GET)
-	public Result frequentContactsList(String departmentId,String name,String roleName,Integer pageSize,Integer pageNo) {
+	public Result frequentContactsList(String deps,String name,String roleName,Integer pageSize,Integer pageNo) {
 		Result res = new Result();
-		res.setData(adminService.frequentContactsList(departmentId, name,roleName, pageSize, pageNo));
+		res.setData(adminService.frequentContactsList(deps, name,roleName, pageSize, pageNo));
 		return res;
 	}
 	/**
@@ -3069,5 +3069,5 @@ public class AdminApiController extends CertifyApiController {
 		}
 		return res;
 	}
-	
+
 }

+ 0 - 14
src/main/java/com/goafanti/admin/controller/AdminDepartmentApiController.java

@@ -85,18 +85,4 @@ public class AdminDepartmentApiController extends CertifyApiController {
 		res.setData(departmentService.getWorkingHours(depId));
 		return res;
 	}
-
-
-	/**
-	 * 工作时间列表
-	 */
-	@RequestMapping(value = "/selectAllDep", method = RequestMethod.GET)
-	public Result selectAllDep() {
-		Result res = new Result();
-
-		res.setData(departmentService.selectAllDep());
-		return res;
-	}
-
-
 }

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

@@ -76,7 +76,7 @@ public interface AdminService {
 
 	int addFrequentContacts(String id);
 
-	Pagination<AdminListBo>  frequentContactsList(String depId, String name, String roleName, Integer pageSize, Integer pageNo);
+	Pagination<AdminListBo>  frequentContactsList(String deps, String name, String roleName, Integer pageSize, Integer pageNo);
 
 	int deleteFrequentContacts(String id);
 

+ 9 - 9
src/main/java/com/goafanti/admin/service/DepartmentService.java

@@ -25,7 +25,7 @@ public interface DepartmentService {
 	 * 查询分管部门、查询管理部门
 	 * @return
 	 */
-	List<Department> selectMyDeps();
+	List<String> selectMyDeps();
 
 
 
@@ -33,15 +33,15 @@ public interface DepartmentService {
 
 	/**
 	 * 查出部门,及下级部门
-	 * @param subId 部门编号
-	 * @param type	 0=包含本部门,1不包含本部门
-	 * @param myShiro 0=正常,1=只看我相关部门
+	 * @param deps 部门集合
+
 	 */
-	List<Department> selectSubDeps(String subId,Integer type,Integer myShiro);
-	List<Department> selectSubDeps(String subId,Integer type);
-	List<Department> selectSubDeps(String subId);
+	List<String> selectSubDeps(String  deps);
+	List<String> selectSubDeps(List<String>  deps);
+
+
 
-	List<Department> getLowerDep(String depIds);
+	List<Department> selectSubordinateDeps(String depId);
 
-	List<DepartmentComboBox> selectAllDep();
+	List<String>  parseArray(String deps);
 }

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

@@ -331,11 +331,13 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<AdminListBo> frequentContactsList(String depId, String name,String roleName, Integer pageSize, Integer pageNo) {
+	public Pagination<AdminListBo> frequentContactsList(String deps, String name,String roleName, Integer pageSize, Integer pageNo) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
 		if(pageNo==null||pageNo<0)pageNo=1;
-		if (StringUtils.isNotBlank(depId)) params.put("depId", depId);
+		if (StringUtils.isNotBlank(deps)){
+			params.put("depId", departmentService.parseArray(deps));
+		}
 		if (StringUtils.isNotBlank(name)) params.put("name", name);
 		if (StringUtils.isNotBlank(roleName)) params.put("roleName", roleName);
 		params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
@@ -379,7 +381,7 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 			acb.setName(oo.getName());
 			acb.setId(depId);
 			deps=departmentMapper.selectBysuperId(oo.getId());
-			depIds =departmentService.selectSubDeps(depId);
+			depIds =departmentService.selectSubordinateDeps(depId);
 		}
 		List<AdminCustomerBo> list =departmentMapper.AlldepCount(depIds,startTime,  endTime);
 		for (AdminCustomerBo ad : list) {

+ 44 - 67
src/main/java/com/goafanti/admin/service/impl/DepartmentServiceImpl.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
+import com.alibaba.fastjson.JSON;
 import com.goafanti.admin.bo.DepartmentComboBox;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.DepartmentMapper;
@@ -66,89 +67,65 @@ public class DepartmentServiceImpl extends BaseMybatisDao<WorkingHoursMapper> im
 	}
 
 	@Override
-	public List<Department> selectMyDeps() {
-		if(TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.APPROVAL_DECISION))
-			return departmentMapper.selectAllDeps();
-		else
-			return selectCurrentDep(TokenManager.getAdminId());
+	public List<String> selectMyDeps() {
+		return selectCurrentDep(TokenManager.getAdminId());
 	}
-	public List<Department> selectSubDeps(String subId) {
-		return selectSubDeps(subId,0);
+	private List<String> selectCurrentDep(String managerId){
+		List<String> alldep = new ArrayList<>();
+		List<String> superData = departmentMapper.selectCurrentDeps(managerId);
+		if (!superData.isEmpty()){
+			iterationDep(alldep,superData);
+		}
+		return alldep;
 	}
 
-	@Override
-	public List<Department> selectSubDeps(String subId,Integer type) {
-		return selectSubDeps(subId,type,0);
+	private void iterationDep(List<String> alldep, List<String> superData) {
+		for (String dep : superData) {
+			if (!alldep.contains(dep)){
+				alldep.add(dep);
+				List<String> deps2 = departmentMapper.selectSubDeps(dep);
+				if (!deps2.isEmpty())iterationDep(alldep,deps2);
+			}
+
+		}
 	}
 
+
 	@Override
-	public List<Department> selectSubDeps(String subId,Integer type,Integer myShiro) {
-		List<Department>  list =departmentMapper.selectSubDeps(subId);
-		List<Department>  all=new ArrayList<>();
-		if (type==0)all.add(departmentMapper.selectByPrimaryKey(subId));
-		if (!list.isEmpty()){
-			all.addAll(list);
-			for (Department dep : list) {
-				List<Department> l2=selectSubDeps(dep.getId(),1);
-				if(!l2.isEmpty()){
-					all.addAll(l2);
+	public List<String> selectSubDeps(String  deps) {
+		List<String>ls= JSON.parseArray(deps,String.class);
+			List<String> myAll=new ArrayList<>();
+			List<String> my=selectMyDeps();
+			if (ls!=null&&!my.isEmpty()){
+				for (String dep : ls) {
+					for (String dep2 : my) {
+						if (dep.equals(dep2))myAll.add(dep);
+					}
 				}
 			}
-		}
-		if (myShiro==1){
-			List<Department>myAll=new ArrayList<>();
-			List<Department> my=selectMyDeps();
-			for (Department dep : all) {
-				for (Department department : my) {
-					if (dep.getId().equals(department.getId()))myAll.add(dep);
-				}
+		return myAll;
+	}
+	public List<String> selectSubDeps(List<String>  deps) {
+		List<String> myAll=new ArrayList<>();
+		List<String> my=selectMyDeps();
+		for (String dep : deps) {
+			for (String dep2 : my) {
+				if (dep.equals(dep2))myAll.add(dep);
 			}
-			all=myAll;
 		}
-		return all;
+		return myAll;
 	}
 
 	@Override
-	public List<Department> getLowerDep(String depIds) {
-		String[] ss=depIds.split(",");
-		List<Department> ls=new ArrayList<>();
-		Arrays.stream(ss).forEach(e ->{
-			ls.addAll(selectSubDeps(e));
-		});
-		return ls;
-	}
-
-
-	private List<Department> selectCurrentDep(String managerId){
-		List<Department> allData = new ArrayList<Department>();
-		List<Department> superData = departmentMapper.selectCurrentDeps(managerId);
-		if(superData != null && superData.size()>0){
-			allData.addAll(superData);
-		}
-		selectSubDeps(allData,superData);
-		return allData;
-	}
-
-	private List<Department> selectSubDeps(List<Department> allData,List<Department> superData){
-		List<Department> subData = new ArrayList<>();
-		String superIds = "";
-		for(Department om : superData){
-			if(!om.getId().equals(om.getSuperId())){
-				superIds += om.getId() + ",";
-			}
-		}
-		if(StringUtils.isNotBlank(superIds)) subData = departmentMapper.selectSubDeps(superIds.substring(0, superIds.length()-1));
-		if(subData != null && subData.size()>0) {
-			allData.addAll(subData);
-			selectSubDeps(allData,subData);
-		}
-		return allData;
+	public 	List<Department> selectSubordinateDeps(String depId){
+		return departmentMapper.selectSubDepsList(depId);
 	}
 
-
 	@Override
-	public List<DepartmentComboBox> selectAllDep() {
-		return null;
+	public List<String> parseArray(String deps) {
+		System.out.println(deps);
+		return JSON.parseArray(deps,String.class);
 	}
 
+
 }

+ 13 - 3
src/main/java/com/goafanti/common/dao/DepartmentMapper.java

@@ -4,6 +4,7 @@ import com.goafanti.admin.bo.AdminCustomerBo;
 import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.admin.bo.depCountBo;
 import com.goafanti.common.model.Department;
+import com.goafanti.organization.bo.DepOut;
 import com.goafanti.organization.bo.OrganizationListOut;
 import org.apache.ibatis.annotations.Param;
 
@@ -22,7 +23,15 @@ public interface DepartmentMapper {
 
     int updateByPrimaryKey(Department record);
 
-    List<OrganizationListOut> selectSuperId(@Param("hideSign")Integer hideSign);
+
+    /**
+     *
+     * @param hideSign 0不显示 1显示
+     * @param lvl 层级
+     * @param id 上级编号
+     * @return
+     */
+    List<DepOut> selectSuperId(@Param("hideSign")Integer hideSign, @Param("lvl")Integer lvl, @Param("id")String id);
     /**
      * 根据组织名称查组织编号
      */
@@ -75,7 +84,8 @@ public interface DepartmentMapper {
      * @param superIds
      * @return
      */
-    List<Department> selectSubDeps(@Param("superIds")String superIds);
+    List<String> selectSubDeps(@Param("superIds")String superIds);
+    List<Department> selectSubDepsList(@Param("superIds")String superIds);
 
     List<depCountBo> selectBysuperId(String id);
 
@@ -84,7 +94,7 @@ public interface DepartmentMapper {
      * 查询当前集合
      * @return
      */
-    List<Department> selectCurrentDeps(@Param("aid")String aid);
+    List<String> selectCurrentDeps(@Param("aid")String aid);
 
     /**
      * 查询所有部门

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

@@ -40,7 +40,7 @@ public interface TOrderNewMapper {
 
     int updateFinance(@Param("aid")String aid, @Param("orderNos") List<String> orderNos, @Param("newFinance")String newFinance);
     int checkContractNo(String sno);
-    Map<String, Object> countTotalAndActually(@Param("o") OrderListBo o, @Param("fids")List<String> fids);
+    Map<String, Object> countTotalAndActually(@Param("o") OrderListBo o, @Param("fids") List<String> fids, @Param("deps")List<String> listDep);
     TOrderBillNew getLastPayment(String orderNo);
     int updateSalesmanId(@Param("aid")String aid, @Param("transferId")String transferId);
     List<TOrderNewBo> selectUsedOrderByOrder(String orderNo);

+ 2 - 2
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -187,9 +187,9 @@ public interface UserMapper {
 
     void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId);
 
-    List<userDataListBo> userDataStatistics(@Param("depId")String depId);
+    List<userDataListBo> userDataStatistics(@Param("deps")List<String> deps);
 
-    userDataListBo userDataStatisticsCount(@Param("depId")String depId);
+    userDataListBo userDataStatisticsCount(@Param("deps")List<String> deps);
 
     int UserReceiveCount( @Param("aid")String aid);
 

+ 10 - 4
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -802,8 +802,11 @@
     <if test="name != null">
       and b.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
     </if>
-    <if test="depId != null">
-      and b.department_id= #{depId,jdbcType=VARCHAR}
+    <if test="deps != null">
+      and b.department_id in
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
+      </foreach>
     </if>
     <if test="page_sql!=null">
       ${page_sql}
@@ -826,8 +829,11 @@
     <if test="name != null">
       and b.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
     </if>
-    <if test="depId != null">
-      and b.department_id= #{depId,jdbcType=VARCHAR}
+    <if test="deps != null">
+      and b.department_id in
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
+      </foreach>
     </if>
   </select>
 

+ 23 - 14
src/main/java/com/goafanti/common/mapper/DepartmentMapper.xml

@@ -300,17 +300,21 @@
       AND om.dep_no=#{depNo,jdbcType=VARCHAR}
     </if>
   </select>
-  <select id="selectSuperId"  resultType="com.goafanti.organization.bo.OrganizationListOut">
+  <select id="selectSuperId"  resultType="com.goafanti.organization.bo.DepOut">
     select
-    id,name,dep_no as depNo
+    id,name,dep_no as depNo,lvl
     from department
-    where
-    status ='0'
+    where status ='0'
+    <if test="lvl != null ">
+        and lvl= #{lvl}
+    </if>
       <if test="hideSign != null ">
     and hide_sign= #{hideSign}
       </if>
-    order by CONVERT (name USING gbk)
-
+    <if test="id != null ">
+      and super_id= #{id}
+    </if>
+    order by depNo
   </select>
   <insert id="insert1" parameterType="com.goafanti.organization.bo.OrganizationListOut">
     insert into department(
@@ -439,14 +443,19 @@
       department_id=#{id,jdbcType=VARCHAR}
   </select>
   <!-- 查询当前层级 -->
-  <select id="selectCurrentDeps" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select id,name,dep_no,super_id from department where manager_id = #{aid,jdbcType=VARCHAR}
-    union all
-    select id,name,dep_no,super_id from department where id = (select department_id from admin where id = #{aid,jdbcType=VARCHAR})
+  <select id="selectCurrentDeps" parameterType="java.lang.String" resultType="string">
+    select id from department where manager_id = #{aid,jdbcType=VARCHAR}
+    union
+    select id from department where id = (select department_id from admin where id = #{aid,jdbcType=VARCHAR})
   </select>
   <!-- 查询下一层级  -->
-  <select id="selectSubDeps"  parameterType="java.lang.String" resultMap="BaseResultMap">
-    select id,name,dep_no from department where super_id in (#{superIds,jdbcType=VARCHAR})
+  <select id="selectSubDeps"  parameterType="java.lang.String" resultType="string">
+    select id from department where super_id in (#{superIds,jdbcType=VARCHAR})
+  </select>
+
+  <!-- 查询下一层级  -->
+  <select id="selectSubDepsList"  parameterType="java.lang.String" resultType="com.goafanti.common.model.Department">
+    select id from department where super_id in (#{superIds,jdbcType=VARCHAR})
   </select>
 
   <select id="selectBysuperId"  resultType="com.goafanti.admin.bo.depCountBo">
@@ -460,8 +469,8 @@
   </select>
 
   <!-- 查询所有 -->
-  <select id="selectAllDeps" resultMap="BaseResultMap">
-    select id,name,dep_no from department
+  <select id="selectAllDeps" resultType="string">
+    select id from department
   </select>
   <select id="getMaxAbbreviation"  parameterType="java.lang.String" resultType="java.lang.String">
     select max(contract_no) as maxNo from t_order_new

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

@@ -514,8 +514,8 @@ select
 	</if>
 	<if test="deps !=null">
 	and b.order_dep in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
       </foreach>
 	</if>
 	<if test="salesmanName !=null">
@@ -624,8 +624,8 @@ select
 	</if>
     <if test="deps !=null">
       and b.order_dep in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
       </foreach>
     </if>
 	<if test="salesmanName !=null">

+ 14 - 8
src/main/java/com/goafanti/common/mapper/PatentNewMapper.xml

@@ -475,18 +475,21 @@
 			and b.name like concat('%',#{aname},'%')
 		</if>
 		<if test="depName != null">
-			and tm.dep_name  = #{depName}
+			and tm.dep_name  in
+			<foreach close=")" collection="depName" item="deps" open="(" separator=",">
+				#{deps}
+			</foreach>
 		</if>
 		<if test="inputDep != null">
 			and ia.department_id in
 			<foreach close=")" collection="inputDep" item="deps" open="(" separator=",">
-				#{deps.id}
+				#{deps}
 			</foreach>
 		</if>
 		<if test="followDep != null">
 			and b.department_id  in
-			<foreach close=")" collection="followDep" item="f" open="(" separator=",">
-				#{f.id}
+			<foreach close=")" collection="followDep" item="deps" open="(" separator=",">
+				#{deps}
 			</foreach>
 		</if>
 		<if test="salesmanRemind !=null">
@@ -546,18 +549,21 @@
 			and b.name like concat('%',#{aname},'%')
 		</if>
 		<if test="depName != null">
-			and tm.dep_name  = #{depName}
+			and tm.dep_name  in
+			<foreach close=")" collection="depName" item="deps" open="(" separator=",">
+				#{deps}
+			</foreach>
 		</if>
 		<if test="inputDep != null">
 			and ia.department_id in
 			<foreach close=")" collection="inputDep" item="deps" open="(" separator=",">
-				#{deps.id}
+				#{deps}
 			</foreach>
 		</if>
 		<if test="followDep != null">
 			and b.department_id  in
-			<foreach close=")" collection="followDep" item="f" open="(" separator=",">
-				#{f.id}
+			<foreach close=")" collection="followDep" item="deps" open="(" separator=",">
+				#{deps}
 			</foreach>
 		</if>
 		<if test="salesmanRemind !=null">

+ 6 - 12
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -738,13 +738,10 @@
     <if test="sid != null">
       and d.id= #{sid}
     </if>
-    <if test="depId != null">
-      and c.department_id = #{depId}
-    </if>
-    <if test="type==1 and deps !=null">
+    <if test="deps !=null">
        and c.department_id in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
       </foreach>
     </if>
 	<if test="uid != null">
@@ -782,13 +779,10 @@
     <if test="sid != null">
       and d.id= #{sid}
     </if>
-    <if test="depId != null">
-      and c.department_id = #{depId}
-    </if>
-    <if test="type==1 and deps !=null">
+    <if test=" deps !=null">
       and c.department_id in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
       </foreach>
     </if>
     <if test="uid != null">

+ 11 - 5
src/main/java/com/goafanti/common/mapper/TOrderBillNewMapper.xml

@@ -546,8 +546,11 @@
   	<if test="b.orderNo != null and b.orderNo != &quot;&quot;">
   	and b.order_no = #{b.orderNo,jdbcType=VARCHAR}
   	</if>
-  	<if test="b.departmentId != null and b.departmentId != &quot;&quot;">
-	and  o.order_dep = #{b.departmentId,jdbcType=VARCHAR}
+  	<if test="deps !=null">
+	and  o.order_dep in
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
+      </foreach>
 	</if>
   	<if test="b.creater != null and b.creater != &quot;&quot;">
   	and b.creater = #{b.creater,jdbcType=VARCHAR}
@@ -591,9 +594,12 @@
   	<if test="b.creater != null and b.creater != &quot;&quot;">
   	and b.creater = #{b.creater,jdbcType=VARCHAR}
   	</if>
-  	<if test="b.departmentId != null and b.departmentId != &quot;&quot;">
-	and  o.order_dep = #{b.departmentId,jdbcType=VARCHAR}
-	</if>
+    <if test="deps !=null">
+      and  o.order_dep in
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
+      </foreach>
+    </if>
   	<if test="b.payerName != null and b.payerName != &quot;&quot;">
   	<bind name="nn" value="'%' + b.payerName + '%'" />
   	and tm.buyer_name like #{nn,jdbcType=VARCHAR}

+ 46 - 31
src/main/java/com/goafanti/common/mapper/TOrderBonusMapper.xml

@@ -92,7 +92,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
-    id, create_time, order_no, bonus_subject, grant_status, grant_target, grant_by, grant_time, 
+    id, create_time, order_no, bonus_subject, grant_status, grant_target, grant_by, grant_time,
     grant_type, task_id
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderBonusExample" resultMap="BaseResultMap">
@@ -120,7 +120,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
-    select 
+    select
     <include refid="Base_Column_List" />
     from t_order_bonus
     where id = #{id,jdbcType=VARCHAR}
@@ -151,12 +151,12 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Tue Nov 27 11:15:28 CST 2018.
     -->
-    insert into t_order_bonus (id, create_time, order_no, 
-      bonus_subject, grant_status, grant_target, 
+    insert into t_order_bonus (id, create_time, order_no,
+      bonus_subject, grant_status, grant_target,
       grant_by, grant_time, grant_type, task_id
       )
-    values (#{id,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{orderNo,jdbcType=VARCHAR}, 
-      #{bonusSubject,jdbcType=INTEGER}, #{grantStatus,jdbcType=INTEGER}, #{grantTarget,jdbcType=VARCHAR}, 
+    values (#{id,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{orderNo,jdbcType=VARCHAR},
+      #{bonusSubject,jdbcType=INTEGER}, #{grantStatus,jdbcType=INTEGER}, #{grantTarget,jdbcType=VARCHAR},
       #{grantBy,jdbcType=VARCHAR}, #{grantTime,jdbcType=DATE}, #{grantType,jdbcType=INTEGER}, #{taskId,jdbcType=INTEGER}
       )
   </insert>
@@ -365,7 +365,7 @@
   </update>
   <!-- 财务专员统计技术员的奖金 -->
   <select id="technicianBonusList" parameterType="Map" resultType="com.goafanti.order.bo.TOrderBonusBo">
-   select b.id, t.id as tid, b.order_no as orderNo, t.task_receiver as taskReceiver, t.task_status as taskStatus,  
+   select b.id, t.id as tid, b.order_no as orderNo, t.task_receiver as taskReceiver, t.task_status as taskStatus,
   		t.commodity_quantity as commodityQuantity, t.project_status as projectStatus, t.commodity_name as commodityName,
   		accept_time as acceptTime, review_time as reviewTime, licence_time as licenceTime,
   		o.liquidation_status as liquidationStatus, ga.name as byName,
@@ -374,9 +374,9 @@
   		from t_order_bonus b
   		left join t_order_task t on b.task_id = t.id
   		left join t_order_new o on o.order_no = t.order_no
-  		left join admin a on a.id = t.task_receiver 
+  		left join admin a on a.id = t.task_receiver
   		left join admin oa on oa.id = o.salesman_id
-  		left join admin ga on ga.id = b.grant_by 
+  		left join admin ga on ga.id = b.grant_by
   		where  b.grant_type = 1
   		<if test="fids != null and fids.size > 0">
   		and b.grant_by in
@@ -411,7 +411,7 @@
   		<bind name="e1" value="b.endTime1 +' 23:59:59'"/>
   		and b.create_time between #{a1,jdbcType=VARCHAR} and #{e1,jdbcType=VARCHAR}
   		</if>
-  		order by b.grant_status ,b.create_time 
+  		order by b.grant_status ,b.create_time
   		<if test="page_sql != null">
 			${page_sql}
 		</if>
@@ -421,7 +421,7 @@
   from t_order_bonus b
   		left join t_order_task t on b.task_id = t.id
   		left join t_order_new o on o.order_no = t.order_no
-  		left join admin a on a.id = t.task_receiver 
+  		left join admin a on a.id = t.task_receiver
   		left join admin oa on oa.id = o.salesman_id
   		where b.grant_type = 1
   		<if test="fids != null">
@@ -447,7 +447,7 @@
   		<if test='b.orderNo != null and b.orderNo !=""'>
 		and b.order_no = #{b.orderNo,jdbcType=VARCHAR}
 		</if>
-		
+
   		<if test='b.startTime != null and b.startTime != "" and b.endTime != null and b.endTime != ""'>
   		<bind name="a" value="b.startTime +'-01'"/>
   		<bind name="e" value="b.endTime +'-31'"/>
@@ -462,7 +462,7 @@
   <!-- 财务专员统计营销员奖金 -->
   <select id="saleBonusList" parameterType="Map" resultType="com.goafanti.order.bo.TOrderBonusBo">
   select b.id, o.order_no as orderNo, o.salesman_id as salesmanId, o.sign_time as signTime,
-	o.buyer_id as buyerId, u.nickname as buyName, o.total_amount as totalAmount, 
+	o.buyer_id as buyerId, u.nickname as buyName, o.total_amount as totalAmount,
 	o.first_amount as firstAmount, o.settlement_amount as settlementAmount, o.refund_amount as refundAmount,
 	o.order_status as orderStatus, o.project_status as projectStatus, b.bonus_subject as bonusSubject,
 	o.proof_count as proofCount, b.grant_status as grantStatus, a.name as salesName, o.proof_status as proofStatus,
@@ -486,8 +486,11 @@
 	<bind name="sn" value="'%' + b.salesName + '%'" />
 	and a.name like #{sn,jdbcType=VARCHAR}
 	</if>
-	<if test='b.departmentId != null and b.departmentId !=""'>
-	and a.department_id = #{b.departmentId,jdbcType=VARCHAR}
+	<if test='deps !=null'>
+	and a.department_id in
+        <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+            #{depId}
+        </foreach>
 	</if>
 	<if test="b.grantStatus != null">
 	and b.grant_status = #{b.grantStatus,jdbcType=INTEGER}
@@ -512,7 +515,7 @@
   </select>
   <select id="saleBonusCount" parameterType="Map" resultType="java.lang.Integer">
   select count(*)
-	
+
 	from t_order_bonus b
 	left join t_order_new o on o.order_no = b.order_no
 	left join admin a on o.salesman_id = a.id
@@ -525,9 +528,12 @@
 	<bind name="sn" value="'%' + b.salesName + '%'" />
 	and a.name like #{sn,jdbcType=VARCHAR}
 	</if>
-	<if test='b.departmentId != null and b.departmentId !=""'>
-	and a.department_id = #{b.departmentId,jdbcType=VARCHAR}
-	</if>
+      <if test='deps !=null'>
+          and a.department_id in
+          <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+              #{depId}
+          </foreach>
+      </if>
 	<if test="b.grantStatus != null">
 	and b.grant_status = #{b.grantStatus,jdbcType=INTEGER}
 	</if>
@@ -562,9 +568,12 @@
 	<bind name="sn" value="'%' + salesName + '%'" />
 	and a.name like #{sn,jdbcType=VARCHAR}
 	</if>
-	<if test='departmentId != null and departmentId != ""'>
-	and a.department_id = #{departmentId,jdbcType=VARCHAR}
-	</if>
+	<if test='deps !=null '>
+	and a.department_id in
+    <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
+    </foreach>
+    </if>
 	<if test="grantStatus != null">
 	and b.grant_status = #{grantStatus,jdbcType=INTEGER}
 	</if>
@@ -581,7 +590,7 @@
   </select>
   <!-- 获得及技术员奖金数据 -->
   <select id="getBonusData" parameterType="com.goafanti.order.bo.TOrderBonusBo" resultType="com.goafanti.order.bo.TOrderBonusBo">
-  select b.id, t.id as tid, b.order_no as orderNo, t.task_receiver as taskReceiver, t.task_status as taskStatus,  
+  select b.id, t.id as tid, b.order_no as orderNo, t.task_receiver as taskReceiver, t.task_status as taskStatus,
   		t.commodity_quantity as commodityQuantity, t.project_status as projectStatus, t.commodity_name as commodityName,
   		accept_time as acceptTime, review_time as reviewTime, licence_time as licenceTime,
   		o.liquidation_status as liquidationStatus, ga.name as byName,
@@ -590,9 +599,9 @@
   		from t_order_bonus b
   		left join t_order_task t on b.task_id = t.id
   		left join t_order_new o on o.order_no = t.order_no
-  		left join admin a on a.id = t.task_receiver 
+  		left join admin a on a.id = t.task_receiver
   		left join admin oa on oa.id = o.salesman_id
-  		left join admin ga on ga.id = b.grant_by 
+  		left join admin ga on ga.id = b.grant_by
   		where b.grant_type = 1
   		<if test="grantBy != null">
   		and b.grant_by = #{grantBy,jdbcType=VARCHAR}
@@ -626,7 +635,7 @@
   <!-- 查看营销员的奖金数据 -->
   <select id="getSaleBounsList" parameterType="com.goafanti.order.bo.TOrderBonusBo" resultType="com.goafanti.order.bo.TOrderBonusBo">
   select b.id, o.order_no as orderNo, o.salesman_id as salesmanId, o.sign_time as signTime,
-	o.buyer_id as buyerId, u.nickname as buyName, o.total_amount as totalAmount, 
+	o.buyer_id as buyerId, u.nickname as buyName, o.total_amount as totalAmount,
 	o.first_amount as firstAmount, o.settlement_amount as settlementAmount, o.refund_amount as refundAmount,
 	o.order_status as orderStatus, o.project_status as projectStatus, b.bonus_subject as bonusSubject,
 	o.proof_count as proofCount, b.grant_status as grantStatus, a.name as salesName
@@ -643,8 +652,14 @@
 	<bind name="sn" value="'%' + salesName + '%'" />
 	and a.name like #{sn,jdbcType=VARCHAR}
 	</if>
-	<if test='departmentId != null and departmentId !=""'>
-	and a.department_id = #{departmentId,jdbcType=VARCHAR}
+	<if test='deps !=null'>
+	and a.department_id in
+        <if test='deps !=null '>
+            and a.department_id in
+            <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+                #{depId}
+            </foreach>
+        </if>
 	</if>
 	<if test="grantStatus != null">
 	and b.grant_status = #{grantStatus,jdbcType=INTEGER}
@@ -662,7 +677,7 @@
   </select>
   <!-- 根据订单编号和科目和奖金发放人检查这个奖金是否存在 -->
   <select id="checkByOnoAndSub" parameterType="com.goafanti.common.model.TOrderBonus" resultType="java.lang.Integer">
-  	select count(*) from t_order_bonus where order_no = #{orderNo,jdbcType=VARCHAR} and bonus_subject = #{bonusSubject,jdbcType=INTEGER} 
+  	select count(*) from t_order_bonus where order_no = #{orderNo,jdbcType=VARCHAR} and bonus_subject = #{bonusSubject,jdbcType=INTEGER}
   	and grant_target = #{grantTarget,jdbcType=VARCHAR} and grant_type = #{grantType,jdbcType=INTEGER}
   	<if test="taskId != null">
   	and task_id = #{taskId,jdbcType=INTEGER}
@@ -672,8 +687,8 @@
   <select id="checkNoPay" parameterType="com.goafanti.order.bo.TOrderBonusBo" resultType="java.lang.Integer">
   	select bonus_subject from t_order_bonus
 	where id = #{id,jdbcType=VARCHAR} and bonus_subject > (
-	select min(bonus_subject) from t_order_bonus 
+	select min(bonus_subject) from t_order_bonus
 	where order_no = #{orderNo,jdbcType=VARCHAR} and grant_status = 0 and grant_type = 0)
   </select>
-  
+
 </mapper>

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

@@ -668,8 +668,8 @@
 	</if>
 	<if test="deps !=null">
 	and b.order_dep in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
       </foreach>
 	</if>
 	<if test="status !=null">
@@ -717,8 +717,8 @@
 	</if>
     <if test="deps !=null">
       and b.order_dep in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
       </foreach>
     </if>
 	<if test="status !=null">

+ 10 - 16
src/main/java/com/goafanti/common/mapper/TOrderMidMapper.xml

@@ -440,12 +440,6 @@
     <if test="status != null">
       and b.legal_affairs_status = #{status}
     </if>
-    <if test="shiro==1">
-      and a.order_type in
-      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
-        #{dep}
-      </foreach>
-    </if>
     <if test="shiro ==2">
       and  c.superior_id = #{sid}
     </if>
@@ -461,8 +455,11 @@
     <if test="aid != null">
       and b.salesman_id = #{aid}
     </if>
-    <if test="depId != null">
-      and a.order_dep = #{depId}
+    <if test="deps != null">
+      and a.order_dep in
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
+      </foreach>
     </if>
     <if test="type==0">
       <if test="startTime != null and endTime != null">
@@ -496,12 +493,6 @@
     <if test="status != null">
       and b.legal_affairs_status = #{status}
     </if>
-    <if test="shiro==1">
-      and a.order_type in
-      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
-        #{dep}
-      </foreach>
-    </if>
     <if test="shiro ==2">
       and  c.superior_id = #{sid}
     </if>
@@ -517,8 +508,11 @@
     <if test="aid != null">
       and b.salesman_id = #{aid}
     </if>
-    <if test="depId != null">
-      and a.order_dep = #{depId}
+    <if test="deps != null">
+      and a.order_dep in
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
+      </foreach>
     </if>
     <if test="type==0">
       <if test="startTime != null and endTime != null">

+ 42 - 39
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -767,8 +767,8 @@
 	  	</if>
   		<if test="deps !=null">
 	  	and o.order_dep in
-          <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-            #{deps.id}
+          <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+            #{depId}
           </foreach>
 	  	</if>
 	  	<if test="o.contractNo != null and o.contractNo != &quot;&quot;">
@@ -847,8 +847,8 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
 	  	</if>
         <if test="deps !=null">
           and o.order_dep in
-          <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-            #{deps.id}
+          <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+            #{depId}
           </foreach>
         </if>
 	  	<if test="o.contractNo != null and o.contractNo != &quot;&quot;">
@@ -965,10 +965,6 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	</if>
   	<if test="specially == 1">
   	and a.process_status = 1  and a.order_status = 1
-  	and a.order_dep in
-  	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
-	 #{deps.id}
-  	</foreach>
   	</if>
   	<if test="specially == 2">
   	and a.order_status in(3,5)
@@ -1004,6 +1000,12 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	<if test="specially == 4">
   	and a.process_status in (4,5,6,99)
   	and a.order_status  in(1,2,3,4,6)
+  	</if>
+    <if test="deps!=null">
+      and a.order_dep in
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
+      </foreach>
     </if>
   	<if test="distribution == 0">
   	and a.process_status &lt; 5
@@ -1047,13 +1049,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	<if test="amountStatus == 4">
   	and a.total_amount  &gt; 40
   	</if>
-    <if test="deps!=null">
-      and a.order_dep in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
-      </foreach>
-    </if>
-    <if test="starTime !=null and endTime !=null">
+  	<if test="starTime !=null and endTime !=null">
       and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
     </if>
     <if test="contractStart !=null and contractEnd !=null">
@@ -1115,11 +1111,6 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     </if>
   	<if test="specially == 1">
   	and a.process_status = 1  and a.order_status = 1
-  	<!-- and c.department_id in (#{deps,jdbcType=VARCHAR}) -->
-  	and a.order_dep in
-  	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
-	 #{deps.id}
-  	</foreach>
   	</if>
   	<if test="specially == 2">
   	and a.order_status in(3,5)
@@ -1156,6 +1147,12 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	and a.process_status in (4,5,6,99)
   	and a.order_status  in(1,2,3,4,6)
   	</if>
+     <if test="deps!=null">
+       and a.order_dep in
+       <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+         #{dep}
+       </foreach>
+     </if>
   	<if test="distribution == 0">
   	and a.process_status &lt; 5
   	</if>
@@ -1198,12 +1195,6 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	<if test="amountStatus == 4">
   	and a.total_amount  &gt; 40
   	</if>
-     <if test="deps!=null">
-       and a.order_dep in
-       <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-         #{deps.id}
-       </foreach>
-     </if>
   	<if test="starTime !=null and endTime !=null">
   	and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
   	</if>
@@ -1272,8 +1263,11 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     <if test="contractNo != null">
       and b.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
     </if>
-  	<if test="depId != null">
-  	and b.order_dep= #{depId,jdbcType=VARCHAR}
+  	<if test="deps != null">
+  	and b.order_dep in
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
+      </foreach>
   	</if>
 	<if test="dunStatus != null">
     and  a.status= #{dunStatus}
@@ -1344,9 +1338,12 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
      <if test="contractNo != null">
        and b.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
      </if>
-  	<if test="depId != null">
-  	and b.order_dep= #{depId,jdbcType=VARCHAR}
-  	</if>
+     <if test="deps != null">
+       and b.order_dep in
+       <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+         #{depId}
+       </foreach>
+     </if>
      <if test="dunStatus != null">
        and  a.status= #{dunStatus}
      </if>
@@ -1481,8 +1478,11 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     <if test="o.orderStatus != null and o.orderStatus != &quot;&quot;">
       and (o.order_status >=  #{o.orderStatus,jdbcType=INTEGER} or o.back_status=3)
     </if>
-    <if test="o.departmentId != null and o.departmentId != &quot;&quot;">
-      and o.order_dep = #{o.departmentId,jdbcType=INTEGER}
+    <if test="deps !=null">
+      and o.order_dep in
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
+      </foreach>
     </if>
     <if test="o.contractNo != null and o.contractNo != &quot;&quot;">
       and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
@@ -1599,8 +1599,8 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     </if>
     <if test="deps != null">
       and b.order_dep in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
       </foreach>
     </if>
     <if test="shiroType !=3 and aid != null">
@@ -1642,8 +1642,8 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     </if>
     <if test="deps != null">
       and b.order_dep in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
       </foreach>
     </if>
     <if test="shiroType !=3 and aid != null">
@@ -1755,8 +1755,11 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     <if test=" startDate !=null and endDate != null">
       and a.create_time between #{startDate} and #{endDate}
     </if>
-    <if test=" depId !=null">
-      and a.order_dep= #{depId}
+    <if test=" deps !=null">
+      and a.order_dep in
+      <foreach close=")" collection="listDep" item="depId" open="(" separator=",">
+        #{depId}
+      </foreach>
     </if>
     <if test=" province !=null">
       and b.province = #{province}

+ 14 - 8
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -1644,8 +1644,11 @@
     <if test="pname !=null">
       and a.commodity_name like concat('%',#{pname},'%')
     </if>
-    <if test="depId !=null">
-      and b.order_dep = #{depId}
+    <if test="deps !=null">
+      and b.order_dep in
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
+      </foreach>
     </if>
     <if test="page_sql!=null">
       ${page_sql}
@@ -1675,8 +1678,11 @@
     <if test="pname !=null">
       and a.commodity_name like concat('%',#{pname},'%')
     </if>
-    <if test="depId !=null">
-      and b.order_dep = #{depId}
+    <if test="deps !=null">
+      and b.order_dep in
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
+      </foreach>
     </if>
   </select>
   <update id="resstPayment">
@@ -1789,8 +1795,8 @@
       </if>
     <if test="deps != null">
       and b.order_dep in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
       </foreach>
     </if>
     <if test="contractNo != null">
@@ -1856,8 +1862,8 @@
       </if>
       <if test="deps != null">
         and b.order_dep in
-        <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-          #{deps.id}
+        <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+          #{dep}
         </foreach>
       </if>
       <if test="contractNo != null">

+ 89 - 65
src/main/java/com/goafanti/common/mapper/TemporaryReceivablesMapper.xml

@@ -92,7 +92,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Mon Oct 14 11:33:48 CST 2019.
     -->
-    id, order_no, corporate_name, amount, receivables_time, aid, remarks, status, create_time, 
+    id, order_no, corporate_name, amount, receivables_time, aid, remarks, status, create_time,
     financial_pay_no
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.TemporaryReceivablesExample" resultMap="BaseResultMap">
@@ -120,7 +120,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Mon Oct 14 11:33:48 CST 2019.
     -->
-    select 
+    select
     <include refid="Base_Column_List" />
     from temporary_receivables
     where id = #{id,jdbcType=INTEGER}
@@ -151,13 +151,13 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Mon Oct 14 11:33:48 CST 2019.
     -->
-    insert into temporary_receivables (id, order_no, corporate_name, 
-      amount, receivables_time, aid, 
-      remarks, status, create_time, 
+    insert into temporary_receivables (id, order_no, corporate_name,
+      amount, receivables_time, aid,
+      remarks, status, create_time,
       financial_pay_no)
-    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{corporateName,jdbcType=VARCHAR}, 
-      #{amount,jdbcType=DECIMAL}, #{receivablesTime,jdbcType=TIMESTAMP}, #{aid,jdbcType=VARCHAR}, 
-      #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{corporateName,jdbcType=VARCHAR},
+      #{amount,jdbcType=DECIMAL}, #{receivablesTime,jdbcType=TIMESTAMP}, #{aid,jdbcType=VARCHAR},
+      #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
       #{financialPayNo,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TemporaryReceivables">
@@ -363,25 +363,25 @@
       financial_pay_no = #{financialPayNo,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
-  
+
    <delete id="deleteByids" parameterType="java.util.List">
     delete from temporary_receivables
-    where id in 
-	 <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">   
-            #{item}   
+    where id in
+	 <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+            #{item}
          </foreach>
   </delete>
    <delete id="deleteByaid" parameterType="java.lang.String">
     delete from temporary_receivables
-    where aid = #{aid} 
+    where aid = #{aid}
   </delete>
   <delete id="deleteNormalByaid">
   delete from temporary_receivables
     where aid = #{aid} and status &lt; 2
   </delete>
   <select id="selectByaid" resultMap="BaseResultMap">
-  
-    select 
+
+    select
     <include refid="Base_Column_List" />
     from temporary_receivables
     where aid = #{aid,jdbcType=INTEGER}
@@ -391,15 +391,15 @@
     b.total_amount totalAmount,d.name depName,a.status ,b.settlement_amount settlementAmount,
 	a.financial_pay_no financialPayNo,a.amount,date_format(a.receivables_time, '%Y-%m-%d')receivablesTimes,
 	date_format(a.create_time, '%Y-%m-%d %H:%i:%S')createTimes,a.remarks,c.username
-	from temporary_receivables a 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 department d on b.order_dep=d.id left join admin e on b.salesman_id=e.id 
+	from temporary_receivables a 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 department d on b.order_dep=d.id left join admin e on b.salesman_id=e.id
 	where 1=1
 	<if test="aid != null">
 	and  a.aid= #{aid}
 	</if>
 	<if test="contractNo != null">
 	b.contract_no like concat('%',#{contractNo},'%')
-	</if> 
+	</if>
 	<if test="orderNo != null">
 	and a.order_no = #{orderNo}
 	</if>
@@ -412,11 +412,17 @@
 	<if test="corporateName != null">
 	and a.corporate_name like concat('%',#{corporateName},'%')
 	</if>
-	<if test="orderDepId != null">
-	and b.order_dep= #{orderDepId}
+	<if test="orderDeps != null">
+	and b.order_dep in
+        <foreach close=")" collection="orderDeps" item="depId" open="(" separator=",">
+            #{depId}
+        </foreach>
 	</if>
-	<if test="adminDepId != null">
-	and  e.department_id= #{adminDepId}
+	<if test="adminDeps != null">
+	and  e.department_id in
+        <foreach close=")" collection="adminDeps" item="depId" open="(" separator=",">
+            #{depId}
+        </foreach>
 	</if>
 	<if test="status != null">
 	and a.status= #{status}
@@ -428,14 +434,14 @@
   </select>
   <select id="selectReceivablesCount"  resultType="java.lang.Integer">
   	select count(*) from temporary_receivables a 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 department d on b.order_dep=d.id
-	left join admin e on b.salesman_id=e.id 
+	left join admin e on b.salesman_id=e.id
 	where 1=1
 	<if test="aid != null">
 	and  a.aid= #{aid}
 	</if>
 	<if test="contractNo != null">
 	b.contract_no like concat('%',#{contractNo},'%')
-	</if> 
+	</if>
 	<if test="orderNo != null">
 	and a.order_no = #{orderNo}
 	</if>
@@ -448,26 +454,32 @@
 	<if test="corporateName != null">
 	and a.corporate_name like concat('%',#{corporateName},'%')
 	</if>
-	<if test="orderDepId != null">
-	and b.order_dep= #{orderDepId}
-	</if>
-	<if test="adminDepId != null">
-	and  e.department_id= #{adminDepId}
-	</if>
+      <if test="orderDeps != null">
+          and b.order_dep in
+          <foreach close=")" collection="orderDeps" item="depId" open="(" separator=",">
+              #{depId}
+          </foreach>
+      </if>
+      <if test="adminDeps != null">
+          and  e.department_id in
+          <foreach close=")" collection="adminDeps" item="depId" open="(" separator=",">
+              #{depId}
+          </foreach>
+      </if>
 	<if test="status != null">
 	and a.status= #{status}
 	</if>
   </select>
   <select id="getCountlistReceivablesAmount" parameterType="Map" resultType="java.lang.String">
-  select  ifnull(sum(a.amount),0) amount from temporary_receivables a 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 department d on b.order_dep=d.id left join admin e on b.salesman_id=e.id 
+  select  ifnull(sum(a.amount),0) amount from temporary_receivables a 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 department d on b.order_dep=d.id left join admin e on b.salesman_id=e.id
 	where 1=1
 	<if test="aid != null">
 	and  a.aid= #{aid}
 	</if>
 	<if test="contractNo != null">
 	and b.contract_no like concat('%',#{contractNo},'%')
-	</if> 
+	</if>
 	<if test="orderNo != null">
 	and a.order_no = #{orderNo}
 	</if>
@@ -480,28 +492,34 @@
 	<if test="corporateName != null">
 	and a.corporate_name like concat('%',#{corporateName},'%')
 	</if>
-	<if test="orderDepId != null">
-	and b.order_dep= #{orderDepId}
-	</if>
-	<if test="adminDepId != null">
-	and  e.department_id= #{adminDepId}
-	</if>
+      <if test="orderDeps != null">
+          and b.order_dep in
+          <foreach close=")" collection="orderDeps" item="depId" open="(" separator=",">
+              #{depId}
+          </foreach>
+      </if>
+      <if test="adminDeps != null">
+          and  e.department_id in
+          <foreach close=")" collection="adminDeps" item="depId" open="(" separator=",">
+              #{depId}
+          </foreach>
+      </if>
 	<if test="status != null">
 	and a.status= #{status}
 	</if>
 	</select>
-	
+
 	<select id="getCountlistReceivablesTotalAmount" parameterType="Map" resultType="java.lang.String">
-  select ifnull(sum(x.total_amount),0) from (select  b.order_no,b.total_amount  from temporary_receivables a 
-  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 department d on b.order_dep=d.id 
-	left join admin e on b.salesman_id=e.id 
+  select ifnull(sum(x.total_amount),0) from (select  b.order_no,b.total_amount  from temporary_receivables a
+  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 department d on b.order_dep=d.id
+	left join admin e on b.salesman_id=e.id
 	where 1=1
 	<if test="aid != null">
 	and  a.aid= #{aid}
 	</if>
 	<if test="contractNo != null">
 	and b.contract_no like concat('%',#{contractNo},'%')
-	</if> 
+	</if>
 	<if test="orderNo != null">
 	and a.order_no = #{orderNo}
 	</if>
@@ -514,43 +532,49 @@
 	<if test="corporateName != null">
 	and a.corporate_name like concat('%',#{corporateName},'%')
 	</if>
-	<if test="orderDepId != null">
-	and b.order_dep= #{orderDepId}
-	</if>
-	<if test="adminDepId != null">
-	and  e.department_id= #{adminDepId}
-	</if>
+        <if test="orderDeps != null">
+            and b.order_dep in
+            <foreach close=")" collection="orderDeps" item="depId" open="(" separator=",">
+                #{depId}
+            </foreach>
+        </if>
+        <if test="adminDeps != null">
+            and  e.department_id in
+            <foreach close=")" collection="adminDeps" item="depId" open="(" separator=",">
+                #{depId}
+            </foreach>
+        </if>
 	<if test="status != null">
-	and a.status= #{status} 
+	and a.status= #{status}
 	</if>
 	group by b.order_no)x
 	</select>
-  
+
     <insert id="insertBatch" parameterType="com.goafanti.common.model.TemporaryReceivables">
     insert into temporary_receivables (id, order_no, corporate_name, amount, receivables_time,
      aid, remarks, status, create_time, financial_pay_no) values
       <foreach item="item" index="index" collection="list" separator=",">
-      (#{item.id,jdbcType=INTEGER}, #{item.orderNo,jdbcType=VARCHAR}, #{item.corporateName,jdbcType=VARCHAR}, 
-      #{item.amount,jdbcType=DECIMAL}, #{item.receivablesTime,jdbcType=TIMESTAMP}, #{item.aid,jdbcType=VARCHAR}, 
-      #{item.remarks,jdbcType=VARCHAR}, #{item.status,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, 
+      (#{item.id,jdbcType=INTEGER}, #{item.orderNo,jdbcType=VARCHAR}, #{item.corporateName,jdbcType=VARCHAR},
+      #{item.amount,jdbcType=DECIMAL}, #{item.receivablesTime,jdbcType=TIMESTAMP}, #{item.aid,jdbcType=VARCHAR},
+      #{item.remarks,jdbcType=VARCHAR}, #{item.status,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP},
       #{item.financialPayNo,jdbcType=VARCHAR})
     </foreach>
   </insert>
-  
+
   <update id="updateRepeatOrderNo" >
-	update temporary_receivables x ,(select a.order_no,a.amount,a.receivables_time,a.nickname 
-	from (select a.order_no,a.corporate_name,a.amount,a.receivables_time,b.nickname,count(1) counts 
-	from temporary_receivables a left join (select x1.order_no,y1.nickname from t_order_new x1 
-	left join user y1 on x1.buyer_id=y1.id )b on a.order_no=b.order_no where a.corporate_name=b.nickname 
-	group by a.order_no,a.corporate_name,a.amount,a.receivables_time)a where a.counts>1 )y set x.status=1 
-	where x.order_no=y.order_no and x.amount=y.amount and x.receivables_time=y.receivables_time 
+	update temporary_receivables x ,(select a.order_no,a.amount,a.receivables_time,a.nickname
+	from (select a.order_no,a.corporate_name,a.amount,a.receivables_time,b.nickname,count(1) counts
+	from temporary_receivables a left join (select x1.order_no,y1.nickname from t_order_new x1
+	left join user y1 on x1.buyer_id=y1.id )b on a.order_no=b.order_no where a.corporate_name=b.nickname
+	group by a.order_no,a.corporate_name,a.amount,a.receivables_time)a where a.counts>1 )y set x.status=1
+	where x.order_no=y.order_no and x.amount=y.amount and x.receivables_time=y.receivables_time
 	and x.corporate_name=y.nickname and x.aid= #{aid}
   </update>
   <select id="selectReceivablesNumberRepeats"  parameterType="com.goafanti.common.model.TemporaryReceivables" resultType="java.lang.Integer">
    select  count(*) from t_order_bill_new a left join user b on a.payer_id=b.id
-	where a.order_no= #{orderNo} 
+	where a.order_no= #{orderNo}
 	and b.nickname= #{corporateName}
-	and a.transaction_amount= #{amount} 
+	and a.transaction_amount= #{amount}
 	and a.financial_pay_time= #{receivablesTime}
   </select>
-</mapper>
+</mapper>

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

@@ -318,8 +318,8 @@
 		</if>
         <if test="deps != null">
           and d.department_id in
-          <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-            #{deps.id}
+          <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+            #{depId}
           </foreach>
         </if>
 		order by  a.create_time desc
@@ -372,8 +372,8 @@
       </if>
       <if test="deps != null">
         and d.department_id in
-        <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-          #{deps.id}
+        <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+          #{depId}
         </foreach>
       </if>
 	</select>

+ 10 - 4
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -1848,8 +1848,11 @@ inner join(
 				left join user y on x1.uid=y.id where x1.type=1
 				and x1.status=0 and y.integrity=1 group by aid,uid)x group by aid) i on a.id=i.aid
 	where a.status='正常'
-	<if test="depId!=null and depId!=''">
-	and a.department_id=	#{depId,jdbcType=VARCHAR}
+	<if test="deps!=null  and deps.size()>0">
+	and a.department_id in
+		<foreach close=")" collection="deps" item="depId" open="(" separator=",">
+			#{depId}
+		</foreach>
 	</if>
 	</select>
 	<select id="userDataStatisticsCount" resultType="com.goafanti.report.bo.userDataListBo">
@@ -1873,8 +1876,11 @@ inner join(
 				left join user y on x1.uid=y.id where x1.type=1
 				and x1.status=0 and y.integrity=1 group by aid,uid)x group by aid) i on a.id=i.aid
 	where a.status='正常'
-	<if test="depId!=null and depId!=''">
-	and a.department_id=	#{depId,jdbcType=VARCHAR}
+	<if test="deps!=null and deps.size()>0">
+	and a.department_id in
+		<foreach close=")" collection="deps" item="depId" open="(" separator=",">
+			#{depId}
+		</foreach>
 	</if>
 	)z
 	</select>

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

@@ -576,8 +576,8 @@
     </if>
     <if test="deps != null">
       and a.department_id in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
       </foreach>
     </if>
     <if test="amountType != null">
@@ -612,8 +612,8 @@
     </if>
     <if test="deps != null">
       and a.department_id in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
+      <foreach close=")" collection="deps" item="depId" open="(" separator=",">
+        #{depId}
       </foreach>
     </if>
     <if test="amountType != null">

+ 9 - 2
src/main/java/com/goafanti/common/model/Department.java

@@ -5,7 +5,7 @@ import java.util.Date;
 
 /**
  * department
- * @author 
+ * @author
  */
 public class Department implements Serializable {
     /**
@@ -243,4 +243,11 @@ public class Department implements Serializable {
     public void setLvl(Integer lvl) {
         this.lvl = lvl;
     }
-}
+
+    public Department() {}
+    public Department(String id) {
+        this.id = id;
+    }
+
+
+}

+ 22 - 22
src/main/java/com/goafanti/common/model/TOrderBillNew.java

@@ -9,7 +9,7 @@ import com.goafanti.common.utils.excel.Excel;
 
 
 public class TOrderBillNew {
-    
+
 	@Excel(name = "订单编号")
 	private String orderNo;
 	@Excel(name = "合同编号")
@@ -63,16 +63,16 @@ public class TOrderBillNew {
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
 	 */
 	private String payerId;
-	
-	
-	
-	
+
+
+
+
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.transaction_channel
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
 	 */
 	private Integer transactionChannel;
-	
+
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.confirm_sign
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
@@ -83,15 +83,15 @@ public class TOrderBillNew {
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
 	 */
 	private Byte deleteSign;
-	
-	
+
+
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.financial_pay_time
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
 	 */
 	private Date financialPayTime;
-	
-	
+
+
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.delete_time
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
@@ -427,20 +427,20 @@ public class TOrderBillNew {
 		this.refundTime = refundTime;
 	}
 
-	
-    
+
+
     private String createrName;
     private String startTime;
     private String endTime;
-    private String departmentId;
+    private String deps;
     private String saleId;
     private String saleName;
     private String departmentName;
-	
+
 	private String deleteTimes;
 	private String refundTimes;
-	
-    
+
+
     public String getFinancialPayTimes() {
 		return this.financialPayTimes;
 	}
@@ -489,12 +489,12 @@ public class TOrderBillNew {
 		this.endTime = endTime;
 	}
 
-	public String getDepartmentId() {
-		return departmentId;
+	public String getDeps() {
+		return deps;
 	}
 
-	public void setDepartmentId(String departmentId) {
-		this.departmentId = departmentId;
+	public void setDeps(String deps) {
+		this.deps = deps;
 	}
 
 	public String getSaleId() {
@@ -522,7 +522,7 @@ public class TOrderBillNew {
 	}
 
 	public String getCreateTimes() {
-		return this.createTimes; 
+		return this.createTimes;
 	}
 
 	public void setCreateTimes(String createTimes) {
@@ -552,4 +552,4 @@ public class TOrderBillNew {
 	public void setRefundTimes(String refundTimes) {
 		this.refundTimes = refundTimes;
 	}
-}
+}

+ 15 - 11
src/main/java/com/goafanti/order/bo/InputArrearsDunListBo.java

@@ -1,5 +1,7 @@
 package com.goafanti.order.bo;
 
+import java.util.List;
+
 public class InputArrearsDunListBo {
 	private String name;
 	private String  orderNo;
@@ -9,10 +11,18 @@ public class InputArrearsDunListBo {
 	private String  tStarTime;
 	private String  tEndTime;
 	private String  adminName;
-	private String  depId;
+	private String deps;
 	private Integer pageNo;
 	private Integer pageSize;
 
+	public String getDeps() {
+		return deps;
+	}
+
+	public void setDeps(String deps) {
+		this.deps = deps;
+	}
+
 	public String getContractNo() {
 		return contractNo;
 	}
@@ -45,20 +55,14 @@ public class InputArrearsDunListBo {
 	public void setEndTime(String endTime) {
 		this.endTime = endTime;
 	}
-	
+
 	public String getAdminName() {
 		return adminName;
 	}
 	public void setAdminName(String adminName) {
 		this.adminName = adminName;
 	}
-	public String getDepId() {
-		return depId;
-	}
-	public void setDepId(String depId) {
-		this.depId = depId;
-	}
-	
+
 	public Integer getPageNo() {
 		return pageNo;
 	}
@@ -83,7 +87,7 @@ public class InputArrearsDunListBo {
 	public void settEndTime(String tEndTime) {
 		this.tEndTime = tEndTime;
 	}
-	
-	
+
+
 
 }

+ 7 - 5
src/main/java/com/goafanti/order/bo/InputMemberList.java

@@ -1,9 +1,11 @@
 package com.goafanti.order.bo;
 
+import java.util.List;
+
 public class InputMemberList {
     private String orderNo;
     private String userName;
-    private String depId;
+    private String deps;
     private String contractNo;
     private String salesmanId;
     private String projectName;
@@ -44,12 +46,12 @@ public class InputMemberList {
         this.userName = userName;
     }
 
-    public String getDepId() {
-        return depId;
+    public String getDeps() {
+        return deps;
     }
 
-    public void setDepId(String depId) {
-        this.depId = depId;
+    public void setDeps(String deps) {
+        this.deps = deps;
     }
 
     public String getContractNo() {

+ 9 - 5
src/main/java/com/goafanti/order/bo/InputOrderInvoiceBo.java

@@ -1,7 +1,9 @@
 package com.goafanti.order.bo;
 
+import java.util.List;
+
 public class InputOrderInvoiceBo {
-	private String orderDep;
+	private String deps;
 	private String orderNo;
 	private String name;
 	private Integer type;
@@ -17,12 +19,14 @@ public class InputOrderInvoiceBo {
 		this.all = all;
 	}
 
-	public String getOrderDep() {
-		return orderDep;
+	public String getDeps() {
+		return deps;
 	}
-	public void setOrderDep(String orderDep) {
-		this.orderDep = orderDep;
+
+	public void setDeps(String deps) {
+		this.deps = deps;
 	}
+
 	public String getOrderNo() {
 		return orderNo;
 	}

+ 5 - 5
src/main/java/com/goafanti/order/bo/InputOrderListBo.java

@@ -5,7 +5,7 @@ public class InputOrderListBo {
     private Integer legalAffairs;
     private String contractNo;
     private String aid;
-    private String depId;
+    private String deps;
     private String depName;
     private String aName;
     private String startTime;
@@ -98,12 +98,12 @@ public class InputOrderListBo {
         this.aid = aid;
     }
 
-    public String getDepId() {
-        return depId;
+    public String getDeps() {
+        return deps;
     }
 
-    public void setDepId(String depId) {
-        this.depId = depId;
+    public void setDeps(String deps) {
+        this.deps = deps;
     }
 
     public Integer getPageSize() {

+ 188 - 0
src/main/java/com/goafanti/order/bo/InputOrderNewListBo.java

@@ -0,0 +1,188 @@
+package com.goafanti.order.bo;
+
+import java.util.List;
+
+public class InputOrderNewListBo {
+    private String aid;
+    private  String name;
+    private String orderNo;
+    private String starTime;
+    private String endTime;
+    private Integer specially;
+    private Integer approval;
+    private Integer distribution;
+    private String deps;
+    private String contractNo;
+    private Integer outsource;
+    private Integer liquidationStatus;
+    private Integer amountStatus;
+    private String contractStart;
+    private String contractEnd;
+    private String uid;
+    private Integer projectType;
+    private Integer processStatus;
+    private  Integer pageNo;
+    private Integer pageSize;
+
+    public String getDeps() {
+        return deps;
+    }
+
+    public void setDeps(String deps) {
+        this.deps = deps;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public String getStarTime() {
+        return starTime;
+    }
+
+    public void setStarTime(String starTime) {
+        this.starTime = starTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public Integer getSpecially() {
+        return specially;
+    }
+
+    public void setSpecially(Integer specially) {
+        this.specially = specially;
+    }
+
+    public Integer getApproval() {
+        return approval;
+    }
+
+    public void setApproval(Integer approval) {
+        this.approval = approval;
+    }
+
+    public Integer getDistribution() {
+        return distribution;
+    }
+
+    public void setDistribution(Integer distribution) {
+        this.distribution = distribution;
+    }
+
+
+
+    public String getContractNo() {
+        return contractNo;
+    }
+
+    public void setContractNo(String contractNo) {
+        this.contractNo = contractNo;
+    }
+
+    public Integer getOutsource() {
+        return outsource;
+    }
+
+    public void setOutsource(Integer outsource) {
+        this.outsource = outsource;
+    }
+
+    public Integer getLiquidationStatus() {
+        return liquidationStatus;
+    }
+
+    public void setLiquidationStatus(Integer liquidationStatus) {
+        this.liquidationStatus = liquidationStatus;
+    }
+
+    public Integer getAmountStatus() {
+        return amountStatus;
+    }
+
+    public void setAmountStatus(Integer amountStatus) {
+        this.amountStatus = amountStatus;
+    }
+
+    public String getContractStart() {
+        return contractStart;
+    }
+
+    public void setContractStart(String contractStart) {
+        this.contractStart = contractStart;
+    }
+
+    public String getContractEnd() {
+        return contractEnd;
+    }
+
+    public void setContractEnd(String contractEnd) {
+        this.contractEnd = contractEnd;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public Integer getProjectType() {
+        return projectType;
+    }
+
+    public void setProjectType(Integer projectType) {
+        this.projectType = projectType;
+    }
+
+    public Integer getProcessStatus() {
+        return processStatus;
+    }
+
+    public void setProcessStatus(Integer processStatus) {
+        this.processStatus = processStatus;
+    }
+
+    public Integer getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(Integer pageNo) {
+        this.pageNo = pageNo;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+}

+ 23 - 0
src/main/java/com/goafanti/order/bo/InputOrderSalesSource.java

@@ -1,5 +1,7 @@
 package com.goafanti.order.bo;
 
+import java.util.List;
+
 public class InputOrderSalesSource {
 
     private String startDate;
@@ -13,6 +15,27 @@ public class InputOrderSalesSource {
      */
     private Integer sort;
 
+
+    private String deps ;
+
+    private List<String> listDep;
+
+    public List<String> getListDep() {
+        return listDep;
+    }
+
+    public void setListDep(List<String> listDep) {
+        this.listDep = listDep;
+    }
+
+    public String getDeps() {
+        return deps;
+    }
+
+    public void setDeps(String deps) {
+        this.deps = deps;
+    }
+
     public String getDepName() {
         return depName;
     }

+ 11 - 9
src/main/java/com/goafanti/order/bo/InputProjectCheck.java

@@ -5,7 +5,7 @@ public class InputProjectCheck {
 	private String orderNo;
 	private String contractNo;
 	private String pname;
-	private String depId;
+	private String deps;
 	private Integer pageSize;
 	private Integer pageNo;
 	public String getName() {
@@ -27,12 +27,14 @@ public class InputProjectCheck {
 		this.contractNo = contractNo;
 	}
 
-	public String getDepId() {
-		return depId;
+	public String getDeps() {
+		return deps;
 	}
-	public void setDepId(String depId) {
-		this.depId = depId;
+
+	public void setDeps(String deps) {
+		this.deps = deps;
 	}
+
 	public Integer getPageSize() {
 		return pageSize;
 	}
@@ -51,8 +53,8 @@ public class InputProjectCheck {
 	public void setPname(String pname) {
 		this.pname = pname;
 	}
-	
-	
-	
-	
+
+
+
+
 }

+ 7 - 5
src/main/java/com/goafanti/order/bo/InputSignStatistics.java

@@ -1,8 +1,10 @@
 package com.goafanti.order.bo;
 
+import java.util.List;
+
 public class InputSignStatistics {
 
-    private String depId;
+    private List<String> deps;
     private String aid;
     private String uid;
     private Integer amountType;
@@ -29,12 +31,12 @@ public class InputSignStatistics {
         this.orderType = orderType;
     }
 
-    public String getDepId() {
-        return depId;
+    public List<String> getDeps() {
+        return deps;
     }
 
-    public void setDepId(String depId) {
-        this.depId = depId;
+    public void setDeps(List<String> deps) {
+        this.deps = deps;
     }
 
     public String getAid() {

+ 11 - 7
src/main/java/com/goafanti/order/bo/OrderListBo.java

@@ -1,6 +1,7 @@
 package com.goafanti.order.bo;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 import com.goafanti.common.utils.excel.Excel;
 
@@ -97,7 +98,7 @@ public class OrderListBo {
 	/** 收款公司名称 **/
 	private String companyName;
 	/** 部门编号*/
-	private String departmentId;
+	private String deps;
 	/** 外包*/
 	private Integer outsource;
 	/** 外包名称*/
@@ -121,6 +122,14 @@ public class OrderListBo {
 	@Excel(name="销售说明")
 	private String other;
 
+	public String getDeps() {
+		return deps;
+	}
+
+	public void setDeps(String deps) {
+		this.deps = deps;
+	}
+
 	public Integer getSalesType() {
 		return salesType;
 	}
@@ -350,12 +359,7 @@ public class OrderListBo {
 	public void setContractNo(String contractNo) {
 		this.contractNo = contractNo;
 	}
-	public String getDepartmentId() {
-		return departmentId;
-	}
-	public void setDepartmentId(String departmentId) {
-		this.departmentId = departmentId;
-	}
+
 	public Integer getOutsource() {
 		return outsource;
 	}

+ 29 - 29
src/main/java/com/goafanti/order/bo/TOrderBonusBo.java

@@ -5,48 +5,48 @@ import java.math.BigDecimal;
 import com.goafanti.common.model.TOrderBonus;
 
 public class TOrderBonusBo extends TOrderBonus{
-	
+
 	private String targetName; //发放目标(可以是技术员和营销员)
-	
+
 	private String byName; //发放人
-	
+
 	private String salesName;//订单负责人
-	
+
 	private String commodityName;
-	
+
 	private Integer tid; //任务数量
-	
+
 	private Integer commodityQuantity; //任务数量
-	
+
 	private BigDecimal commodityPrice; //价格
-	
+
 	private Integer taskStatus; //任务状态
-	
+
 	private Integer liquidationStatus; //订单结算状态
-	
+
 	private String taskAllocator; //任务分配人
-	
+
 	private String taskReceiver; //任务负责人
-	
+
 	private Integer projectStatus; //项目状态
-	
+
 	private String acceptTime; //受理时间
-	
+
 	private String reviewTime; //评审日期
-	
+
 	private String publicityTime; //公示日期
-	
+
 	private String licenceTime; // 发证日期
-	
+
 	private String signTime; // 签单日期
-	
-	private String departmentId; // 部门id
+
+	private String deps; // 部门id
 	private String departmentName; // 部门名称
 	private String startTime;
 	private String endTime;
 	private String startTime1;
 	private String endTime1;
-	
+
 	private String buyId;
 	private String saleId;
 	private String buyName;
@@ -54,17 +54,17 @@ public class TOrderBonusBo extends TOrderBonus{
 	private BigDecimal firstAmount; //首付
 	private BigDecimal settlementAmount; //已收
 	private BigDecimal refundAmount; //已付
-	
+
 	private Integer orderStatus; //订单状态
 	private Float proofCount; //校对量
 	private Integer proofStatus; //校对状态
-	
-	
+
+
 	private String kejim;
 	private String renzm;
 	private String kejiy;
 	private String renzy;
-	
+
 	private Integer main;
 
 	public String getTargetName() {
@@ -219,12 +219,12 @@ public class TOrderBonusBo extends TOrderBonus{
 		this.salesName = salesName;
 	}
 
-	public String getDepartmentId() {
-		return departmentId;
+	public String getDeps() {
+		return deps;
 	}
 
-	public void setDepartmentId(String departmentId) {
-		this.departmentId = departmentId;
+	public void setDeps(String deps) {
+		this.deps = deps;
 	}
 
 	public String getSignTime() {
@@ -370,5 +370,5 @@ public class TOrderBonusBo extends TOrderBonus{
 	public void setEndTime1(String endTime1) {
 		this.endTime1 = endTime1;
 	}
-	
+
 }

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

@@ -3,8 +3,6 @@ package com.goafanti.order.controller;
 
 
 import java.io.IOException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
@@ -300,35 +298,15 @@ public class AdminNewOrderApiController extends CertifyApiController {
 
 	/**
 	 * 		订单列表
-	 * @param aid
-	 * @param name
-	 * @param orderNo
-	 * @param starTime
-	 * @param endTime
-	 * @param specially 0 个人 1 营销员管理 2 驳回 3 特批 4 咨询师管理 5部门订单查询 6客服查询 7统计签单订单 8客户订单列表 9 复审订单
-	 * @param approval
-	 * @param distribution (咨询师管理列表 0 未分配 1部分 2全部
-	 * @param depId
-	 * @param contractNo
-	 * @param outsource
-	 * @param liquidationStatus
-	 * @param amountStatus  0 10万元以下 1 10万~20万 2 20万~30万 3 30万~40万  4 40万以上
-	 * @param contractStart
-	 * @param contractEnd
-	 * @param uid
-	 * @param projectType
-	 * @param processStatus
-	 * @param pageNo
-	 * @param pageSize
+	 *  specially 0 个人 1 营销员管理 2 驳回 3 特批 4 咨询师管理 5部门订单查询 6客服查询 7统计签单订单 8客户订单列表 9 复审订单
+	 *  distribution (咨询师管理列表 0 未分配 1部分 2全部
+	 *  amountStatus  0 10万元以下 1 10万~20万 2 20万~30万 3 30万~40万  4 40万以上
 	 * @return
 	 */
 	@RequestMapping(value="/orderNewList", method = RequestMethod.GET)
-	public Result orderNewList(String aid,String name,String orderNo,String starTime,String endTime ,Integer specially ,Integer approval,
-			Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus,Integer amountStatus,
-							   String contractStart,String contractEnd,String uid,Integer projectType,Integer processStatus,Integer pageNo,Integer pageSize){
+	public Result orderNewList(InputOrderNewListBo in){
 		Result res=new Result();
-		res.data(orderNewService.orderNewList(aid,name, orderNo, starTime, endTime, specially ,approval, distribution,depId,
-				contractNo,outsource, liquidationStatus,amountStatus,contractStart, contractEnd,uid, projectType,processStatus,pageNo, pageSize));
+		res.data(orderNewService.orderNewList(in));
 		return res;
 	}
 
@@ -375,10 +353,10 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value="/dunOrderNewList", method = RequestMethod.GET)
 	public Result dunOrderNewList(String name,String orderNo,String contractNo,String starTime,String endTime,Integer specially,String aid,
-			String adminName,String depId,Integer newStatus,Integer approval,Integer amountStatus,Integer memberType,
+			String adminName,String deps,Integer newStatus,Integer approval,Integer amountStatus,Integer memberType,
 								  Integer pageNo,Integer pageSize){
 		Result res=new Result();
-		res.data(orderNewService.dunOrderNewList(name, orderNo,contractNo, starTime, endTime,specially,aid,  adminName, depId,newStatus,
+		res.data(orderNewService.dunOrderNewList(name, orderNo,contractNo, starTime, endTime,specially,aid,  adminName, deps,newStatus,
 				approval,amountStatus,memberType,pageNo, pageSize));
 		return res;
 	}

+ 8 - 6
src/main/java/com/goafanti/order/controller/AdminOrderReceivablesApiController.java

@@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -55,6 +56,8 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
 	private OrderInvoiceService	orderInvoiceService;
 	@Resource
 	private FundManageOrderService	fundManageOrderService;
+	@Value(value = "${upload.path}")
+	private String					uploadPath			= null;
 	/**
 	 * 	新增预计回款信息
 	 * @param t
@@ -123,13 +126,13 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
 	}
 
 	@RequestMapping(value ="/listReceivables",method = RequestMethod.GET)
-	public Result listReceivables(ReceivablesListBo rl,Integer status,String adminName,String adminDepId,String orderDepId,Integer pageSize,Integer pageNo){
+	public Result listReceivables(ReceivablesListBo rl,Integer status,String adminName,String adminDeps,String orderDeps,Integer pageSize,Integer pageNo){
 		Result res = new Result();
 		Map<String, Object>map =new HashMap<>();
 		//列表数据
-		map.put("pagination", orderReceivablesService.listReceivables(  rl,status,adminName,  adminDepId, orderDepId, pageSize, pageNo));
+		map.put("pagination", orderReceivablesService.listReceivables(  rl,status,adminName,  adminDeps, orderDeps, pageSize, pageNo));
 		//统计数据
-		map.put("count",orderReceivablesService.getCountlistReceivables(  rl,status,adminName,  adminDepId, orderDepId));
+		map.put("count",orderReceivablesService.getCountlistReceivables(  rl,status,adminName,  adminDeps, orderDeps));
 		res.data(map);
 		return res;
 	}
@@ -202,11 +205,10 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
     /**
 	 * 	导出回款
      *
-     * @param response
      * @return
      */
     @RequestMapping(value = "/exportReceivables" , method = RequestMethod.GET)
-    public Result exportReceivables(HttpServletResponse response,OrderListBo o,Integer pageSize ,Integer pageNo)  {
+    public Result exportReceivables(OrderListBo o,Integer pageSize ,Integer pageNo)  {
     	if (pageSize==null)pageSize=99999;
     	o.setOrderStatus(2);//营销管理员审核通过
     	@SuppressWarnings("unchecked")
@@ -214,7 +216,7 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
 		@SuppressWarnings("unchecked")
 		List<OrderListBo> list=(List<OrderListBo>)p.getList() ;
     	NewExcelUtil<OrderListBo>excel=new NewExcelUtil<>(OrderListBo.class);
-		 return  excel.exportExcel(list,"订单回款列表",response);
+		 return  excel.exportExcel(list,"订单回款列表",uploadPath);
     	}
 
     /**

+ 9 - 9
src/main/java/com/goafanti/order/controller/OrderChangeApiController.java

@@ -21,7 +21,8 @@ import com.goafanti.order.bo.InputTChangeTask;
 import com.goafanti.order.bo.NewOrderChangeBo;
 import com.goafanti.order.service.OrderChangeService;
 
-import java.io.BufferedReader;
+import java.io.IOException;
+import java.util.List;
 
 @RestController
 @RequestMapping(value = "/api/admin/orderChange")
@@ -290,7 +291,6 @@ public class OrderChangeApiController extends CertifyApiController {
 	 * @param timeType
 	 * @param startTime
 	 * @param endTime
-	 * @param depId
 	 * @param salesmanName
 	 * @param complete
 	 * @param orderNo
@@ -301,11 +301,11 @@ public class OrderChangeApiController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value ="/orderChangeList",method = RequestMethod.GET)
-	public Result orderChangeList(String userName,Integer  processState,Integer timeType,String startTime,String endTime,
-			String depId,String salesmanName,Integer complete,String orderNo, String contractNo,Integer type,Integer pageSize, Integer pageNo) {
+	public Result orderChangeList(String userName, Integer  processState, Integer timeType, String startTime, String endTime,
+								  String deps, String salesmanName, Integer complete, String orderNo, String contractNo, Integer type, Integer pageSize, Integer pageNo) {
 		Result res =new Result();
 		res.data(orderChangeService.selectOrderChangeList( userName,  processState, timeType, startTime, endTime,
-				depId, salesmanName, complete, orderNo,  contractNo, type,pageSize,  pageNo));
+				 deps, salesmanName, complete, orderNo,  contractNo, type,pageSize,  pageNo));
 		return res;
 	}
 	/**
@@ -434,12 +434,12 @@ public class OrderChangeApiController extends CertifyApiController {
      */
     @RequestMapping(value = "/exportMyChange" , method = RequestMethod.GET)
     public Result exportMyBill(HttpServletResponse response,String userName,Integer  processState,Integer timeType,String startTime,String endTime,
-			String depId,String salesmanName,Integer complete,String orderNo, String contractNo,Integer type,Integer pageSize, Integer pageNo)  {
+							   String deps,String salesmanName,Integer complete,String orderNo, String contractNo,Integer type,Integer pageSize, Integer pageNo)  {
     	Result res=new Result();
 			try {
-				orderChangeService.exportMyChange( response, userName,  processState, timeType, startTime, endTime,
-						 depId, salesmanName, complete, orderNo,  contractNo, type, pageSize,  pageNo);
-			} catch (Exception e) {
+				orderChangeService.exportMyChange(response,userName,processState,timeType,startTime,endTime,deps,salesmanName,complete,
+				orderNo,contractNo,type,pageSize,pageNo);
+			} catch (IOException e) {
 				res.getError().add(buildError("格式不正确"));
 				e.printStackTrace();
 				return res;

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

@@ -50,7 +50,7 @@ public interface OrderChangeService {
 	 * @return
 	 */
 	Pagination<NewOderCahngeListBo> selectOrderChangeList(String userName,Integer  processState,Integer timeType,String startTime,String endTime,
-			String depId,String salesmanName,Integer complete,String orderNo, String contractNo,Integer type, Integer pageSize, Integer pageNo );
+														  String deps,String salesmanName,Integer complete,String orderNo, String contractNo,Integer type, Integer pageSize, Integer pageNo );
 
 	int updateOrderChange(NewOrderChangeBo t, Integer changeType,String startRemarks);
 
@@ -67,7 +67,7 @@ public interface OrderChangeService {
 	Map<String ,Object> listOrderInvoiceAndBill(String orderNo);
 
 	void exportMyChange(HttpServletResponse response, String userName, Integer processState, Integer timeType,
-			String startTime, String endTime, String depId, String salesmanName, Integer complete,String orderNo, String contractNo,Integer type, Integer pageSize,
+			String startTime, String endTime, String deps, String salesmanName, Integer complete,String orderNo, String contractNo,Integer type, Integer pageSize,
 			Integer pageNo) throws IOException ;
 
 

+ 3 - 11
src/main/java/com/goafanti/order/service/OrderNewService.java

@@ -62,17 +62,8 @@ public interface OrderNewService {
 	int createOrderDun(String orderDun,String orderNo);
 	/**
 	 * 订单列表
-	 * @param name
-	 * @param orderNo
-	 * @param starTime
-	 * @param endTime
-	 * @param pageNo
-	 * @param pageSize
-	 * @param amountStatus
 	 */
-	Pagination<TOrderNewBo> orderNewList(String aid,String name, String orderNo, String starTime, String endTime,Integer specially ,
-										 Integer approval,Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus, Integer amountStatus,
-										 String contractStart, String contractEnd,String uid,Integer projectType,Integer processStatus, Integer pageNo, Integer pageSize);
+	Pagination<TOrderNewBo> orderNewList(InputOrderNewListBo in);
 	/**
 	 * 订单审核
 	 * @param orderNo
@@ -90,7 +81,8 @@ public interface OrderNewService {
 	 * @param pageNo
 	 * @param pageSize
 	 */
-	Pagination<outOrderDunListBo> dunOrderNewList(String name, String orderNo,String contractNo, String starTime, String endTime,Integer specially, String aid,String adminName,String depId,
+	Pagination<outOrderDunListBo> dunOrderNewList(String name, String orderNo,String contractNo, String starTime, String endTime,Integer specially, String aid,
+												  String adminName,String deps,
 			Integer newStatus,Integer approval,Integer amountStatus,Integer memberType,Integer pageNo, Integer pageSize);
 
 	Result exportOrderDunData(String name, String orderNo, String contractNo, String starTime, String endTime, Integer specially, String aid, String adminName,

+ 3 - 3
src/main/java/com/goafanti/order/service/OrderReceivablesService.java

@@ -24,12 +24,12 @@ public interface OrderReceivablesService {
 
 	void batchListReceivables(MultipartFile file);
 
-	Pagination<ReceivablesListBo> listReceivables(ReceivablesListBo rl,Integer status,String adminName, String adminDepId, String orderDepId, Integer pageSize,
+	Pagination<ReceivablesListBo> listReceivables(ReceivablesListBo rl,Integer status,String adminName, String adminDeps, String orderDeps, Integer pageSize,
 			Integer pageNo);
 
 
-	Map<String, Object> getCountlistReceivables(ReceivablesListBo rl, Integer status, String adminName, String adminDepId,
-			String orderDepId);
+	Map<String, Object> getCountlistReceivables(ReceivablesListBo rl, Integer status, String adminName, String adminDeps,
+			String orderDeps);
 
 
 

+ 5 - 3
src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java

@@ -162,12 +162,14 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 		}
 		if (order.getOutsource()==null)order.setOutsource(0);//默认非外包
 		params.put("o", order);
-		if (order.getDepartmentId()!=null){
-			params.put("deps", departmentService.getLowerDep(order.getDepartmentId()));
+		List<String> listDep=null;
+		if (order.getDeps()!=null){
+			listDep=departmentService.parseArray(order.getDeps());
+			params.put("deps", listDep);
 		}
 		Pagination<OrderListBo> data = (Pagination<OrderListBo>)findPage("financeList", "financeCount", params, pageNo, pageSize);
 		result.put("pagination", data);
-		Map<String, Object> count = tOrderNewMapper.countTotalAndActually(order,fids);
+		Map<String, Object> count = tOrderNewMapper.countTotalAndActually(order,fids,listDep);
 		result.put("count", count);
 		return result;
 	}

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

@@ -1,5 +1,6 @@
 package com.goafanti.order.service.impl;
 
+import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.*;
@@ -33,6 +34,8 @@ public class LegalAffairsServiceImpl extends BaseMybatisDao<TOrderMidMapper> imp
     @Autowired
     private TOrderLegalAffairsMapper tOrderLegalAffairsMapper;
     @Autowired
+    private DepartmentService departmentService;
+    @Autowired
     private AdminMapper adminMapper;
     @Value(value = "${upload.path}")
     private String uploadPath = null;
@@ -75,7 +78,11 @@ public class LegalAffairsServiceImpl extends BaseMybatisDao<TOrderMidMapper> imp
             if (TokenManager.hasRole(AFTConstants.FINANCE)){
                 map.put("shiro",1);
                 List<String> deps=adminMapper.getFinanceDep(TokenManager.getAdminId());
-                map.put("deps",deps);
+                if (in.getDeps()==null){
+                    map.put("deps",deps);
+                }else {
+                    map.put("deps",departmentService.selectSubDeps(deps));
+                }
             }else if(TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)){
                 map.put("shiro",2);
                 map.put("sid", TokenManager.getAdminId());
@@ -92,8 +99,13 @@ public class LegalAffairsServiceImpl extends BaseMybatisDao<TOrderMidMapper> imp
             if(in.getAid()!=null) map.put("aid", in.getAid());
             if (in.getStatus()!=null) map.put("status",in.getStatus());
             map.put("type", in.getType());
+
+        }
+        if (!TokenManager.hasRole(AFTConstants.FINANCE)){
+            if(in.getDeps()!=null){
+                map.put("deps", departmentService.parseArray(in.getDeps()));
+            }
         }
-        if(in.getDepId()!=null) map.put("depId", in.getDepId());
         if(in.getUserName()!=null) map.put("userName", in.getUserName());
         if(in.getStartTime()!=null)map.put("startTime", in.getStartTime());
         if(in.getEndTime()!=null)map.put("endTime", in.getEndTime()+" 23:59:59");

+ 9 - 3
src/main/java/com/goafanti/order/service/impl/OrderBillServiceImpl.java

@@ -6,6 +6,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.goafanti.admin.service.DepartmentService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -24,7 +25,7 @@ import com.goafanti.order.service.OrderBillService;
 
 @Service
 public class OrderBillServiceImpl extends BaseMybatisDao<TOrderBillNewMapper> implements OrderBillService {
-	
+
 	@Autowired
 	private TOrderBillNewMapper billNewMapper;
 	@Autowired
@@ -33,6 +34,8 @@ public class OrderBillServiceImpl extends BaseMybatisDao<TOrderBillNewMapper> im
 	private AdminMapper	adminMapper;
 	@Value(value = "${upload.path}")
 	private String	uploadPath = null;
+	@Autowired
+	private DepartmentService	 departmentService;
 
 
 	@SuppressWarnings("unchecked")
@@ -48,11 +51,14 @@ public class OrderBillServiceImpl extends BaseMybatisDao<TOrderBillNewMapper> im
 		}
 		params.put("fids", fids);
 		params.put("b", billNew);
+		if (billNew.getDeps()!=null){
+			params.put("deps", departmentService.parseArray(billNew.getDeps()));
+		}
 		return (Pagination<TOrderBillNew>)findPage("myBillList", "myBillCount", params, pageNo, pageSize);
 	}
 
 
-	
+
 
 
 	@Override
@@ -78,5 +84,5 @@ public class OrderBillServiceImpl extends BaseMybatisDao<TOrderBillNewMapper> im
 		billNewMapper.updateByPrimaryKeySelective(ntbn);
 		return 1;
 	}
-	
+
 }

+ 19 - 13
src/main/java/com/goafanti/order/service/impl/OrderBonusServiceImpl.java

@@ -8,6 +8,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
+import com.goafanti.admin.service.DepartmentService;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -31,7 +32,7 @@ import com.goafanti.order.service.OrderBonusService;
 
 @Service
 public class OrderBonusServiceImpl extends BaseMybatisDao<TOrderBonusMapper> implements OrderBonusService {
-	
+
 	@Autowired
 	private TOrderBonusMapper bonusMapper;
 	@Autowired
@@ -40,7 +41,9 @@ public class OrderBonusServiceImpl extends BaseMybatisDao<TOrderBonusMapper> imp
 	private AdminMapper	adminMapper;
 	@Autowired
 	private TOrderMonthReportMapper orderMonthReportMapper;
-	
+	@Autowired
+	private DepartmentService departmentService;
+
 	@Override
 	public Integer addOrderBouns(TOrderBonus bonus) {
 		// 生成id
@@ -78,27 +81,30 @@ public class OrderBonusServiceImpl extends BaseMybatisDao<TOrderBonusMapper> imp
 		return data;
 	}
 
-	
-	
+
+
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<TOrderBonusBo> saleBonusStatistics(TOrderBonusBo newBo, Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<String, Object>();
-		
+
 		List<String> fids=new ArrayList<>();
 		if (TokenManager.hasRole(AFTConstants.FINANCE)) {
 			newBo.setGrantBy(TokenManager.getAdminId());
 		}else if (TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)) {
 			fids=adminMapper.selectBySuperId(TokenManager.getAdminId());
 		}
+		if (newBo.getDeps()!=null){
+			params.put("deps", departmentService.parseArray(newBo.getDeps()));
+		}
 		params.put("fids", fids);
 		params.put("b", newBo);
 		Pagination<TOrderBonusBo> data = (Pagination<TOrderBonusBo>)findPage("saleBonusList", "saleBonusCount", params, pageNo, pageSize);
-		
+
 		innerData((List<TOrderBonusBo>) data.getList(), newBo);
 		return data;
 	}
-	
+
 	private void innerData(List<TOrderBonusBo> list, TOrderBonusBo newBo){
 		Integer m = null;
 		Integer m1 = null;
@@ -131,7 +137,7 @@ public class OrderBonusServiceImpl extends BaseMybatisDao<TOrderBonusMapper> imp
 					orderListBo.setRenzm(o.getRenzm());
 				}
 			}
-			
+
 			r.setMonth(y);
 			r.setMonth1(y1);
 			//处理年度数据
@@ -157,7 +163,7 @@ public class OrderBonusServiceImpl extends BaseMybatisDao<TOrderBonusMapper> imp
 	@Override
 	public XSSFWorkbook exportTechnicianBonusData(TOrderBonusBo bonusBo) {
 		// 判断导出是否有部门
-		String deptid = bonusBo.getDepartmentId();
+		String deptid = bonusBo.getDeps();
 		Map<String, List<TOrderBonusBo>> map = new HashMap<String, List<TOrderBonusBo>>();
 		if(StringUtils.isBlank(deptid)){
 			//获得所有有数据的部门
@@ -168,8 +174,8 @@ public class OrderBonusServiceImpl extends BaseMybatisDao<TOrderBonusMapper> imp
 			}
 			for (int i = 0; i < dlist.size(); i++) {
 				TOrderBonusBo ob = dlist.get(i);
-				if(null != ob && null!= ob.getDepartmentId()){
-					bonusBo.setDepartmentId(ob.getDepartmentId());
+				if(null != ob && null!= ob.getDeps()){
+//					bonusBo.setDepartmentId(ob.getDepartmentId());
 					map.put(ob.getDepartmentName(), bonusMapper.getBonusData(bonusBo));
 				}
 			}
@@ -183,7 +189,7 @@ public class OrderBonusServiceImpl extends BaseMybatisDao<TOrderBonusMapper> imp
 
 	@Override
 	public XSSFWorkbook exportSaleBonusData(TOrderBonusBo bonusBo) {
-		String deptid = bonusBo.getDepartmentId();
+		String deptid = bonusBo.getDeps();
 		Map<String, List<TOrderBonusBo>> map = new HashMap<String, List<TOrderBonusBo>>();
 		if(StringUtils.isBlank(deptid)){
 			//获得所有有数据的部门
@@ -194,7 +200,7 @@ public class OrderBonusServiceImpl extends BaseMybatisDao<TOrderBonusMapper> imp
 			}
 			for (int i = 0; i < dlist.size(); i++) {
 				TOrderBonusBo ob = dlist.get(i);
-				bonusBo.setDepartmentId(ob.getDepartmentId());
+//				bonusBo.setDepartmentId(ob.getDepartmentId());
 				List<TOrderBonusBo> l =  bonusMapper.getSaleBounsList(bonusBo);
 				innerData(l, bonusBo);
 				map.put(ob.getDepartmentName(), l);

+ 10 - 8
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -8,6 +8,7 @@ import java.util.*;
 
 import javax.servlet.http.HttpServletResponse;
 
+import com.alibaba.fastjson.JSON;
 import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.common.dao.*;
 import com.goafanti.common.enums.UserFields;
@@ -499,7 +500,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<NewOderCahngeListBo> selectOrderChangeList(String userName,Integer  processState,Integer timeType,String startTime,String endTime,
-			String depId,String salesmanName,Integer complete,String orderNo, String contractNo,Integer type,Integer pageSize, Integer pageNo) {
+																 String deps,String salesmanName,Integer complete,String orderNo, String contractNo,Integer type,Integer pageSize, Integer pageNo) {
 		Map<String, Object> parameter=new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
 		if(pageNo==null||pageNo<0)pageNo=1;
@@ -514,9 +515,9 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		if (StringUtils.isNotBlank(startTime)) parameter.put("startTime", startTime);
 		if (StringUtils.isNotBlank(endTime)) parameter.put("endTime", endTime+" 23:59:59");
 		if (processState==1){
-			List<Department> myDep;
-			if (StringUtils.isNotBlank(depId)) {
-				myDep=departmentService.selectSubDeps(depId,0,1);
+			List<String > myDep;
+			if (deps!=null) {
+				myDep=departmentService.selectSubDeps(deps);
 				if (myDep.isEmpty()){
 					return new Pagination(1,10,0);
 				}
@@ -525,8 +526,8 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			}
 			parameter.put("deps",myDep);
 		}else {
-			if (StringUtils.isNotBlank(depId)) {
-				parameter.put("deps",departmentService.getLowerDep(depId));
+			if (deps!=null) {
+				parameter.put("deps",departmentService.parseArray(deps));
 			}
 		}
 		if (StringUtils.isNotBlank(salesmanName)) parameter.put("salesmanName", salesmanName);
@@ -853,10 +854,11 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	@SuppressWarnings("unchecked")
 	@Override
 	public void exportMyChange(HttpServletResponse response, String userName, Integer processState, Integer timeType,
-			String startTime, String endTime, String depId, String salesmanName, Integer complete,String orderNo, String contractNo,Integer type,Integer pageSize,Integer pageNo) throws IOException {
+			String startTime, String endTime, String deps, String salesmanName, Integer complete,String orderNo, String contractNo,
+							   Integer type,Integer pageSize,Integer pageNo) throws IOException {
 		OutputStream out = response.getOutputStream();
 		List<NewOderCahngeListBo>list=(List<NewOderCahngeListBo>) selectOrderChangeList( userName,  processState, timeType, startTime, endTime,
-				 depId, salesmanName, complete, orderNo,  contractNo, type, pageSize,  pageNo).getList();
+				 deps, salesmanName, complete, orderNo,  contractNo, type, pageSize,  pageNo).getList();
 		try {
     		//设计表头  String[] comment = {"合同编号","订单编号","客户名称","订单部门","订单类型","下单时间","订单状态","合同额(万元)","已付额(万元)","欠款(万元)","订单负责人","变更类型","变更审核状态","变更提交时间"}
     		String[] comment = {"合同编号","订单编号","客户名称","订单部门","订单类型","下单时间","订单状态","合同额(万元)","已付额(万元)","欠款(万元)","订单负责人","变更类型","变更审核状态","变更提交时间"};

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

@@ -140,8 +140,8 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 			aDep=adminMapper.selectDepIdWithSpuerId(TokenManager.getAdminId());
 			params.put("aDep", aDep);
 		}
-		if(StringUtils.isNotBlank(o.getOrderDep())){
-			params.put("deps", departmentService.getLowerDep(o.getOrderDep()));
+		if(o.getDeps()!=null){
+			params.put("deps", departmentService.parseArray(o.getDeps()));
 		}
 		if(o.getType()!=null)params.put("type", o.getType());
 		//营销管理员

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

@@ -13,6 +13,7 @@ import java.util.UUID;
 
 import javax.mail.MessagingException;
 
+import com.alibaba.fastjson.JSON;
 import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.common.bo.*;
@@ -1055,7 +1056,9 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		if (in.getOrderNo()!=null) map.put("orderNo", in.getOrderNo());
 		if (in.getContractNo()!=null) map.put("contartNo", in.getContractNo());
 		if (in.getPname()!=null) map.put("pname", in.getPname());
-		if (in.getDepId()!=null) map.put("depId", in.getDepId());
+		if (in.getDeps()!=null) {
+			map.put("deps", departmentService.parseArray(in.getDeps()));
+		}
 		map.put("aid", TokenManager.getAdminId());
 		return (Pagination<OutProjectCheck>)findPage("selectProjectCheck", "countProjectCheck", map, in.getPageNo(), in.getPageSize());
 	}
@@ -1084,8 +1087,9 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	private void addParam(InputMemberList in, HashMap<String, Object> map) {
 		if(in.getOrderNo()!=null) map.put("orderNo", in.getOrderNo());
 		if(in.getUserName()!=null) map.put("userName", in.getUserName());
-		if(in.getDepId()!=null){
-			map.put("deps", departmentService.getLowerDep(in.getDepId()));
+		if(in.getDeps()!=null&&!in.getDeps().isEmpty()){
+			List<String> ls=JSON.parseArray(in.getDeps(),String.class);
+			map.put("deps", ls);
 		}
 		if(in.getContractNo()!=null) map.put("contractNo", in.getContractNo());
 		if(in.getSalesmanId()!=null) map.put("salesmanId", in.getSalesmanId());

+ 23 - 20
src/main/java/com/goafanti/order/service/impl/OrderReceivablesServiceImpl.java

@@ -10,6 +10,7 @@ import java.util.UUID;
 
 import javax.annotation.Resource;
 
+import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.order.bo.*;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.Cell;
@@ -87,6 +88,8 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 
 	@Resource
 	private OrderBillService	orderBillService;
+	@Autowired
+	private DepartmentService	departmentService;
 
 	@Override
 	public int addReceivables(TemporaryReceivablesBo t) {
@@ -273,20 +276,12 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 	}
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<ReceivablesListBo> listReceivables(ReceivablesListBo rl,Integer status,String adminName, String adminDepId, String orderDepId, Integer pageSize,
+	public Pagination<ReceivablesListBo> listReceivables(ReceivablesListBo rl,Integer status,String adminName, String adminDeps, String orderDeps, Integer pageSize,
 			Integer pageNo) {
 		Map<String,Object> parameter=new HashMap<String, Object>();
 		if(pageSize==null||pageSize<1)pageSize=10;
 		if(pageNo==null||pageNo<1)pageNo=1;
-		if(StringUtils.isNotBlank(rl.getContractNo()))parameter.put("contractNo", rl.getContractNo());
-		if(StringUtils.isNotBlank(rl.getOrderNo()))parameter.put("orderNo", rl.getOrderNo());
-		if(StringUtils.isNotBlank(rl.getNickname()))parameter.put("nickname", rl.getNickname());
-		if(StringUtils.isNotBlank(rl.getCorporateName()))parameter.put("corporateName", rl.getCorporateName());
-		if(StringUtils.isNotBlank(adminName))parameter.put("adminName", adminName);
-		if(StringUtils.isNotBlank(adminDepId))parameter.put("adminDepId", adminDepId);
-		if(StringUtils.isNotBlank(orderDepId))parameter.put("orderDepId", orderDepId);
-		if(null!=status)parameter.put("status", status);
-		if(StringUtils.isNotBlank(TokenManager.getAdminId()))parameter.put("aid", TokenManager.getAdminId());
+		addParemeter(rl, status, adminName, adminDeps, orderDeps, parameter);
 		Pagination<ReceivablesListBo> p=(Pagination<ReceivablesListBo>) findPage("selectReceivablesList", "selectReceivablesCount", parameter, pageNo, pageSize);
 		List<ReceivablesListBo> list=(List<ReceivablesListBo>) p.getList();
 
@@ -307,19 +302,27 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 		return p;
 	}
 
+	private void addParemeter(ReceivablesListBo rl, Integer status, String adminName, String adminDeps, String orderDeps, Map<String, Object> parameter) {
+		if(StringUtils.isNotBlank(rl.getContractNo())) parameter.put("contractNo", rl.getContractNo());
+		if(StringUtils.isNotBlank(rl.getOrderNo())) parameter.put("orderNo", rl.getOrderNo());
+		if(StringUtils.isNotBlank(rl.getNickname())) parameter.put("nickname", rl.getNickname());
+		if(StringUtils.isNotBlank(rl.getCorporateName())) parameter.put("corporateName", rl.getCorporateName());
+		if(StringUtils.isNotBlank(adminName)) parameter.put("adminName", adminName);
+		if(StringUtils.isNotBlank(adminDeps)){
+			parameter.put("adminDeps", departmentService.parseArray(adminDeps));
+		}
+		if(StringUtils.isNotBlank(orderDeps)){
+			parameter.put("orderDeps", departmentService.parseArray(orderDeps));
+		}
+		if(null!= status) parameter.put("status", status);
+		if(StringUtils.isNotBlank(TokenManager.getAdminId())) parameter.put("aid", TokenManager.getAdminId());
+	}
+
 	@Override
 	public Map<String, Object> getCountlistReceivables(ReceivablesListBo rl, Integer status, String adminName,
-			String adminDepId, String orderDepId) {
+			String adminDeps, String orderDeps) {
 		Map<String,Object> parameter=new HashMap<String, Object>();
-		if(StringUtils.isNotBlank(rl.getContractNo()))parameter.put("contractNo", rl.getContractNo());
-		if(StringUtils.isNotBlank(rl.getOrderNo()))parameter.put("orderNo", rl.getOrderNo());
-		if(StringUtils.isNotBlank(rl.getNickname()))parameter.put("nickname", rl.getNickname());
-		if(StringUtils.isNotBlank(rl.getCorporateName()))parameter.put("corporateName", rl.getCorporateName());
-		if(StringUtils.isNotBlank(adminName))parameter.put("adminName", adminName);
-		if(StringUtils.isNotBlank(adminDepId))parameter.put("adminDepId", adminDepId);
-		if(StringUtils.isNotBlank(orderDepId))parameter.put("orderDepId", orderDepId);
-		if(null!=status)parameter.put("status", status);
-		if(StringUtils.isNotBlank(TokenManager.getAdminId()))parameter.put("aid", TokenManager.getAdminId());
+		addParemeter(rl, status, adminName, adminDeps, orderDeps, parameter);
 		//计算回收表的订单总金额与当前总收款额。
 		Map<String,Object> map=new HashMap<String, Object>();
 		map.put("totalAmount", new BigDecimal(temporaryReceivablesMapper.getCountlistReceivablesTotalAmount(parameter)).stripTrailingZeros() );

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

@@ -1206,7 +1206,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				superIds += om.getId() + ",";
 			}
 		}
-		if(StringUtils.isNotBlank(superIds)) subData = departmentMapper.selectSubDeps(superIds.substring(0, superIds.length()-1));
+		if(StringUtils.isNotBlank(superIds)) subData = departmentMapper.selectSubDepsList(superIds.substring(0, superIds.length()-1));
 		if(subData != null && subData.size()>0) {
 			allData.addAll(subData);
 			selectSubDeps(allData,subData);
@@ -1216,7 +1216,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 
 	private List<Department> selectCurrentDep(String managerId){
 		List<Department> allData = new ArrayList<Department>();
-		List<Department> superData = departmentMapper.selectCurrentDeps(managerId);
+		List<Department> superData = departmentMapper.selectSubDepsList(managerId);
 		if(superData != null && superData.size()>0){
 			allData.addAll(superData);
 		}

+ 5 - 0
src/main/java/com/goafanti/order/service/impl/OrderStatisticsServiceImpl.java

@@ -1,5 +1,6 @@
 package com.goafanti.order.service.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.order.bo.*;
@@ -20,6 +21,10 @@ public class OrderStatisticsServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 	public List<OutOrderSalesSource> orderSalesSource(InputOrderSalesSource in) {
 		if (in.getSort()==null)in.setSort(0);
 		if(in.getEndDate()!=null)in.setEndDate(in.getEndDate()+" 23:59:59");
+		if (in.getDeps()!=null){
+			List<String> ls= JSON.parseArray(in.getDeps(),String.class);
+			in.setListDep(ls);
+		}
 		return tOrderNewMapper.orderSalesSource(in);
 	}
 

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

@@ -71,13 +71,8 @@ public class UserStatisticsServiceImpl extends BaseMybatisDao<UserMidMapper> imp
 
 
 	private void addsignStatisticsParam(InputSignStatistics in, Map<String, Object> map) {
-		if (in.getDepId()!=null){
-			String[] ss=in.getDepId().split(",");
-			List<Department> ls=new ArrayList<>();
-			Arrays.stream(ss).forEach(e ->{
-				ls.addAll(departmentService.selectSubDeps(e));
-			});
-			map.put("deps",ls);
+		if (!in.getDeps().isEmpty()){
+			map.put("deps",in.getDeps());
 		}
 		if (StringUtils.isNotBlank(in.getAid())) map.put("aid", in.getAid());
 		if (StringUtils.isNotBlank(in.getUid())) map.put("uid", in.getUid());

+ 56 - 0
src/main/java/com/goafanti/organization/bo/DepOut.java

@@ -0,0 +1,56 @@
+package com.goafanti.organization.bo;
+
+import java.util.List;
+
+public class DepOut {
+
+    private String id;
+
+    private String name;
+
+    private String depNo;
+
+    private Integer lvl;
+
+    private List<DepOut> list;
+
+    public String getDepNo() {
+        return depNo;
+    }
+
+    public void setDepNo(String depNo) {
+        this.depNo = depNo;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getLvl() {
+        return lvl;
+    }
+
+    public void setLvl(Integer lvl) {
+        this.lvl = lvl;
+    }
+
+    public List<DepOut> getList() {
+        return list;
+    }
+
+    public void setList(List<DepOut> list) {
+        this.list = list;
+    }
+}

+ 22 - 14
src/main/java/com/goafanti/organization/bo/InputPaymentList.java

@@ -1,18 +1,30 @@
 package com.goafanti.organization.bo;
 
+import java.util.List;
+
 public class InputPaymentList {
 	private String contractNo;
-	private String orderNo; 
+	private String orderNo;
 	private String userName;
-	private String depId;
-	private String aname; 
+	private String deps;
+	private String aname;
 	private String financeName;
-	private String cname; 
-	private String pname; 
+	private String cname;
+	private String pname;
 	private Integer status;
 	private Integer chooseType;
 	private Integer pageSize;
 	private Integer pageNo;
+
+
+	public String getDeps() {
+		return deps;
+	}
+
+	public void setDeps(String deps) {
+		this.deps = deps;
+	}
+
 	public String getContractNo() {
 		return contractNo;
 	}
@@ -25,7 +37,7 @@ public class InputPaymentList {
 	public void setOrderNo(String orderNo) {
 		this.orderNo = orderNo;
 	}
-	
+
 	public String getAname() {
 		return aname;
 	}
@@ -66,7 +78,7 @@ public class InputPaymentList {
 		return pageNo;
 	}
 	public void setPageNo(Integer pageNo) {
-		
+
 		this.pageNo = pageNo;
 	}
 	public String getUserName() {
@@ -75,12 +87,8 @@ public class InputPaymentList {
 	public void setUserName(String userName) {
 		this.userName = userName;
 	}
-	public String getDepId() {
-		return depId;
-	}
-	public void setDepId(String depId) {
-		this.depId = depId;
-	}
+
+
 	public String getPname() {
 		return pname;
 	}
@@ -93,7 +101,7 @@ public class InputPaymentList {
 	public void setChooseType(Integer chooseType) {
 		this.chooseType = chooseType;
 	}
-	
+
 
 
 }

+ 11 - 0
src/main/java/com/goafanti/organization/bo/OrganizationListOut.java

@@ -1,5 +1,7 @@
 package com.goafanti.organization.bo;
 
+import java.util.List;
+
 public class OrganizationListOut {
 	/**登录用户ID**/
 	private String uid;
@@ -43,6 +45,15 @@ public class OrganizationListOut {
 	private Integer workingHoursType;
 	private String workingHoursName;
 	private Integer lvl;
+	private List<OrganizationListOut> list;
+
+	public List<OrganizationListOut> getList() {
+		return list;
+	}
+
+	public void setList(List<OrganizationListOut> list) {
+		this.list = list;
+	}
 
 	public Integer getLvl() {
 		return lvl;

+ 28 - 10
src/main/java/com/goafanti/organization/controller/AdminOrganizationController.java

@@ -22,6 +22,7 @@ public class AdminOrganizationController extends BaseApiController{
 	private OrganizationService organizationService;
 	@Autowired
 	private DepartmentMapper departmentMapper;
+
 	/**部门组织管理列表 **/
 	@RequestMapping(value = "/listOrganizationManagement" , method = RequestMethod.POST)
 	public Result listOrganizationManagement(OrganizationListOut olo, Integer pageNo,
@@ -30,13 +31,22 @@ public class AdminOrganizationController extends BaseApiController{
 		res.setData(organizationService.listOrganizationManagement(olo, pageNo, pageSize));
 		return res;
 	}
-	/**部门组织管理上级组织查询 **/
+	/**获取科德集团以下的部门 **/
+	@RequestMapping(value = "/getAllDep" , method = RequestMethod.GET)
+	public Result getAllDep(Integer hideSign){
+		Result res = new Result();
+		res.setData(organizationService.getAllDep(hideSign));
+		return res;
+	}
+
+	/**获取所有部门 **/
 	@RequestMapping(value = "/selectSuperId" , method = RequestMethod.GET)
-	public Result selectsuperId(Integer hideSign){
+	public Result selectSuperId(Integer hideSign){
 		Result res = new Result();
 		res.setData(organizationService.selectSuperId(hideSign));
 		return res;
 	}
+
 	/**部门组织管理上级组织查询 **/
 	@RequestMapping(value = "/selectSuperIdS" , method = RequestMethod.GET)
 	public Result selectsuperIdS(){
@@ -47,10 +57,10 @@ public class AdminOrganizationController extends BaseApiController{
 	/**部门组织管理新增**/
 	@RequestMapping(value = "/addOrganization" , method = RequestMethod.POST)
 	public Result addOrganization(String name, String managerId, String type, String superId, String remarks,
-								  Integer workingHoursType,Integer hideSign) {
+								  Integer workingHoursType,Integer hideSign,String depNo) {
 		Result res = new Result();
-		if(StringUtils.isBlank(name) || StringUtils.isBlank(type) || StringUtils.isBlank(superId)){
-			res.getError().add(buildError("","组织名称、组织类型、上级组织不能为空"));
+		if(StringUtils.isBlank(name) || StringUtils.isBlank(type) || StringUtils.isBlank(superId)||StringUtils.isBlank(depNo)){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"",""));
 			return res;
 		}
 		String olo=departmentMapper.selectDepNoByName(name);
@@ -58,7 +68,11 @@ public class AdminOrganizationController extends BaseApiController{
 			res.getError().add(buildError("","部门已存在"));
 			return res;
 		}
-		organizationService.addOrganization(name, managerId, type, superId, remarks,workingHoursType,hideSign);
+		if (organizationService.checkDepNo(depNo,0)){
+			res.getError().add(buildError("","部门编号已存在"));
+			return res;
+		}
+		organizationService.addOrganization(name, managerId, type, superId, remarks,workingHoursType,hideSign,depNo);
 
 		return res;
 	}
@@ -79,20 +93,24 @@ public class AdminOrganizationController extends BaseApiController{
 	/**修改信息**/
 	@RequestMapping(value = "/updateOrganization" , method = RequestMethod.POST)
 	public Result updateOrganization(String name, String type, String managerId, String superId, String status,Integer province,
-			String remarks,String id,String abbreviation,String financeId,Integer workingHoursType,Integer hideSign){
+			String remarks,String id,String abbreviation,String financeId,Integer workingHoursType,Integer hideSign,String depNo){
 		Result res = new Result();
 		if(StringUtils.isBlank(name) || StringUtils.isBlank(type)
 				|| StringUtils.isBlank(managerId)|| StringUtils.isBlank(superId)
-				|| StringUtils.isBlank(status)|| StringUtils.isBlank(remarks)){
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,""));
+				|| StringUtils.isBlank(status)|| StringUtils.isBlank(remarks)|| StringUtils.isBlank(depNo)){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"",""));
 			return res;
 		}
 		if (id ==superId){
 			res.getError().add(buildError("不能设置自己为上级"));
 			return res;
 		}
+		if (organizationService.checkDepNo(depNo,1)){
+			res.getError().add(buildError("","部门编号已存在"));
+			return res;
+		}
 		int i=organizationService.updateOrganization(name, type, managerId, superId, status, province,remarks,id,
-				abbreviation,financeId,workingHoursType,hideSign);
+				abbreviation,financeId,workingHoursType,hideSign,depNo);
 		return res.data(i);
 	}
 

+ 9 - 3
src/main/java/com/goafanti/organization/service/OrganizationService.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.organization.bo.DepOut;
 import com.goafanti.organization.bo.OrganizationListOut;
 
 public interface OrganizationService {
@@ -17,7 +18,9 @@ public interface OrganizationService {
 	Pagination<OrganizationListOut>
 	listOrganizationManagement(OrganizationListOut olo,Integer pageNo, Integer pageSize);
 	/**组织名称查上级组织*/
-	List<OrganizationListOut> selectSuperId(Integer hideSign);
+	List<DepOut> selectSuperId(Integer hideSign);
+
+	List<DepOut> getAllDep(Integer hideSign);
 	/**
 	 *
 	 * @param name 组织名称
@@ -28,7 +31,7 @@ public interface OrganizationService {
 	 * @return
 	 */
 	int addOrganization(String name,String managerId,String type,String superId,String desc,
-						Integer workingHoursType,Integer hideSign);
+						Integer workingHoursType,Integer hideSign,String depNo);
 	/**
 	 * 模糊查询负责人名称
 	 * @param name
@@ -41,6 +44,9 @@ public interface OrganizationService {
 	int deleteById(String id);
 
 	int updateOrganization(String name,String type,String managerId,String superId,String status,Integer province,
-			String remarks,String id,String abbreviation,String financeId,Integer workingHoursType,Integer hideSign);
+			String remarks,String id,String abbreviation,String financeId,Integer workingHoursType,Integer hideSign,String depNo);
+
+	boolean checkDepNo(String depNo,Integer type);
+
 
 }

+ 60 - 23
src/main/java/com/goafanti/organization/service/impl/OrganizationServiceImpl.java

@@ -8,6 +8,7 @@ import java.util.UUID;
 
 import com.goafanti.common.dao.DepartmentMapper;
 import com.goafanti.common.model.Department;
+import com.goafanti.organization.bo.DepOut;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -52,7 +53,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 		return params;
 	}
 	@Override
-	public List<OrganizationListOut> selectSuperId(Integer hideSign) {
+	public List<DepOut> selectSuperId(Integer hideSign) {
 		if(hideSign==null){
 			hideSign=1;
 		}
@@ -60,9 +61,43 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 		if (hideSign>1){
 			hideSign=null;
 		}
-		List<OrganizationListOut> depList=departmentMapper.selectSuperId(hideSign);
+		List<DepOut> depList=departmentMapper.selectSuperId(hideSign,null,null);
 		return depList;
 	}
+
+	@Override
+	public List<DepOut> getAllDep(Integer hideSign) {
+		if(hideSign==null){
+			hideSign=1;
+		}
+		//此处理用于前端不批量改接口
+		if (hideSign>1){
+			hideSign=null;
+		}
+		List<DepOut> depList=departmentMapper.selectSuperId(hideSign,3,null);
+		depList.forEach(e ->{
+			List<DepOut> list=getSubordinateDep(1,e.getId());
+			if (!list.isEmpty()){
+				e.setList(list);
+			}
+		});
+		return depList;
+	}
+
+	/**
+	 *
+	 */
+	public List<DepOut> getSubordinateDep(Integer hideSign,String id){
+		List<DepOut> depList=departmentMapper.selectSuperId(hideSign,null,id);
+		depList.forEach(e ->{
+			List<DepOut> list=getSubordinateDep(1,e.getId());
+			if (!list.isEmpty()){
+				e.setList(list);
+			}
+		});
+		return depList;
+	}
+
 	/**
 	 *   XXIn form 提交 ,bo包中
 	 *   xxOut 输出 bo包中
@@ -70,7 +105,8 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 	 *
 	 */
 	@Override
-	public int addOrganization( String name, String managerId, String type, String superId, String remarks,Integer workingHoursType,Integer hideSign) {
+	public int addOrganization( String name, String managerId, String type, String superId, String remarks,
+								Integer workingHoursType,Integer hideSign,String depNo) {
 		Department superDep=departmentMapper.selectByPrimaryKey(superId);
 		String id = UUID.randomUUID().toString();
 		Date now = new Date();
@@ -85,7 +121,6 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 		dep.setLvl(superDep.getLvl()+1);
 		dep.setType(type);
 		dep.setManagerId(managerId);
-		String depNo = getMaxDep(superDep);
 		dep.setDepNo(depNo);
 	//	superId=departmentMapper.selectIdByName(superId);
 		dep.setSuperId(superId);
@@ -135,28 +170,11 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 	}
 	@Override
 	public int updateOrganization(String name, String type, String managerId, String superId, String status,Integer province,
-			String remarks,String id,String abbreviation,String financeId,Integer workingHoursType,Integer hideSign) {
+			String remarks,String id,String abbreviation,String financeId,Integer workingHoursType,Integer hideSign,String depNo) {
 		//获取上级编号
 		Department superDep=departmentMapper.selectByPrimaryKey(superId);
-		Department use =departmentMapper.selectByPrimaryKey(id);
 		Date now=new Date();
 		Department dep=new Department();
-		String deps ="";
-		//如果是修改顶级则不触发下级修改
-		boolean flag=true;
-		if (name.contains("平台超管中心"))flag=false;
-		if (!use.getSuperId().equals(superId)){
-			if(!name.equals("平台超管中心")){
-				deps=getMaxDep(superDep);
-			}else {
-				deps="DP";
-			}
-			dep.setDepNo(deps);
-			dep.setSuperId(superId);
-		}else {
-			flag=false;
-		}
-
 		dep.setLvl(superDep.getLvl()+1);
 		dep.setName(name);
 		dep.setType(type);
@@ -165,6 +183,8 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 		dep.setStatus(status);
 		dep.setRemarks(remarks);
 		dep.setId(id);
+		dep.setSuperId(superId);
+		dep.setDepNo(depNo);
 		dep.setAbbreviation(abbreviation);
 		dep.setFinanceId(financeId);
 		dep.setProvince(province);
@@ -172,10 +192,27 @@ public class OrganizationServiceImpl extends BaseMybatisDao<DepartmentMapper> im
 		dep.setWorkingHoursType(workingHoursType);
 		tOrderMidMapper.updateFinanceId(id,financeId);
 		int x=departmentMapper.updateByPrimaryKeySelective(dep);
-		if(flag)updateLowerLevelNo(dep.getId(),dep.getDepNo(),dep.getLvl());
 		return x;
 	}
 
+	@Override
+	public boolean checkDepNo(String depNo,Integer type) {
+		String useDepNo=departmentMapper.selectIdByDepNo(depNo);
+		if (StringUtils.isNotBlank(useDepNo)){
+			if (type==1){
+				if (!depNo.equals(useDepNo)){
+					return false;
+				}else {
+					return true;
+				}
+			}else {
+				return true;
+			}
+
+		}
+		return false;
+	}
+
 	private String countDepNo(String sdepNo, Integer count) {
 		String dep=null;
 		if(count<10){

+ 2 - 2
src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java

@@ -648,8 +648,8 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 		if (i.getContractNo()!=null)map.put("contractNo", i.getContractNo());
 		if (i.getOrderNo()!=null)map.put("orderNo", i.getOrderNo());
 		if (i.getUserName()!=null)map.put("userName", i.getUserName());
-		if (i.getDepId()!=null){
-			map.put("deps", departmentService.getLowerDep(i.getDepId()));
+		if (i.getDeps()!=null){
+			map.put("deps", departmentService.parseArray(i.getDeps()));
 		}
 		if (i.getAname()!=null)map.put("aname", i.getAname());
 		if (i.getFinanceName()!=null)map.put("financeName", i.getFinanceName());

+ 12 - 10
src/main/java/com/goafanti/patent/bo/PatentNewBo.java

@@ -2,15 +2,16 @@ package com.goafanti.patent.bo;
 
 
 import java.math.BigDecimal;
+import java.util.List;
 
 import com.goafanti.common.model.PatentNew;
 import com.goafanti.common.utils.excel.Excel;
 
 public class PatentNewBo extends PatentNew{
 
-	
+
 	/**
-	 * 
+	 *
 	 */
 	private static final long serialVersionUID = 1L;
 
@@ -70,13 +71,6 @@ public class PatentNewBo extends PatentNew{
 	private String createEnds;
 	private Integer isFollow;
 
-	public String getFollowDep() {
-		return followDep;
-	}
-
-	public void setFollowDep(String followDep) {
-		this.followDep = followDep;
-	}
 	public String getInputDep() {
 		return inputDep;
 	}
@@ -85,6 +79,14 @@ public class PatentNewBo extends PatentNew{
 		this.inputDep = inputDep;
 	}
 
+	public String getFollowDep() {
+		return followDep;
+	}
+
+	public void setFollowDep(String followDep) {
+		this.followDep = followDep;
+	}
+
 	public Integer getCostReduction() {
 		return costReduction;
 	}
@@ -157,7 +159,7 @@ public class PatentNewBo extends PatentNew{
 	public void setEmail(String email) {
 		this.email = email;
 	}
-	
+
 	public String getProjectName() {
 		return projectName;
 	}

+ 3 - 3
src/main/java/com/goafanti/patent/service/impl/PatentNewServiceImpl.java

@@ -227,16 +227,16 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		if(p.getCreateEnds()!=null)params.put("createEnds", p.getCreateEnds()+" 23:59:59");
 		if(p.getType()!=null)params.put("type", p.getType());
 		if(p.getDepName()!=null){
-			params.put("depName",  p.getDepName());
+			params.put("depName",  departmentService.parseArray(p.getDepName()));
 		}
 		if(p.getAnnualFeeStatus()!=null)params.put("annualFeeStatus", p.getAnnualFeeStatus());
 		if(p.getUserName()!=null)params.put("userName", p.getUserName());
 		if(p.getSalesmanRemind()!=null)params.put("salesmanRemind", p.getSalesmanRemind());
 		if(p.getInputDep()!=null){
-			params.put("inputDep", departmentService.getLowerDep(p.getInputDep()));
+			params.put("inputDep", departmentService.parseArray(p.getInputDep()));
 		}
 		if(p.getFollowDep()!=null){
-			params.put("followDep", departmentService.getLowerDep(p.getFollowDep()));
+			params.put("followDep", departmentService.parseArray(p.getInputDep()));
 		}
 
 		if(p.getIsFollow()!=null) {

+ 14 - 14
src/main/java/com/goafanti/report/controller/ReportApiController.java

@@ -118,7 +118,7 @@ public class ReportApiController extends BaseApiController {
 	@RequestMapping(value = "/sales/marketingStatistics", method = RequestMethod.GET)
 	public Result marketingStatistics(String depId,Integer type) {
 		Result res=new Result();
-		
+
 		if (null==type||type>1) {
 			 res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "参数错误", "参数"));
 	            return res;
@@ -138,7 +138,7 @@ public class ReportApiController extends BaseApiController {
 	@RequestMapping(value = "/sales/countMarketingStatistics", method = RequestMethod.GET)
 	public Result countMarketingStatistics(String depId,Integer type) {
 		Result res=new Result();
-		
+
 		if (null==type||type>1) {
 			 res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "参数错误", "参数"));
 	            return res;
@@ -149,7 +149,7 @@ public class ReportApiController extends BaseApiController {
 			return res.data(reportService.countMarketingDepStatistics(depId));
 		}
 	}
-	
+
 	/**
 	 * 客户营销时段统计表
 	 * @param depId
@@ -199,7 +199,7 @@ public class ReportApiController extends BaseApiController {
 	            return res;
 		}
 	  return res.data(reportService.countSometimeMarketingStatistics(depId,timeType,startTime,endTime));
-		
+
 	}
 	/**
 	 * 派单报表统计
@@ -216,28 +216,28 @@ public class ReportApiController extends BaseApiController {
 	            return res;
 		}
 	   return res.data(reportService.technicalDepStatistics(depId,timeType,startTime,endTime,publishStatus,taskStatus));
-		
+
 	}
-	
+
 	/**
 	 * 客户资料统计报表
 	 */
 	@RequestMapping(value="/userDataStatistics" , method=RequestMethod.GET)
-	public Result userDataStatistics(String depId){
+	public Result userDataStatistics(String deps){
 		Result res=new Result();
-		return res.data(reportService.userDataStatistics(depId));
-		
+		return res.data(reportService.userDataStatistics(deps));
+
 	}
-	
+
 	/**
 	 * 客户资料统计报表总计
 	 */
 	@RequestMapping(value="/userDataStatisticsCount" , method=RequestMethod.GET)
-	public Result userDataStatisticsCount(String depId){
+	public Result userDataStatisticsCount(String deps){
 		Result res=new Result();
-		return res.data(reportService.userDataStatisticsCount(depId));
-		
+		return res.data(reportService.userDataStatisticsCount(deps));
+
 	}
-	
+
 
 }

+ 22 - 15
src/main/java/com/goafanti/report/service/SalesReportServiceImpl.java

@@ -1,13 +1,10 @@
 package com.goafanti.report.service;
 
 import java.math.BigDecimal;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+import java.util.*;
 import java.util.stream.Collectors;
+
+import com.goafanti.admin.service.DepartmentService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -38,6 +35,8 @@ public class SalesReportServiceImpl extends BaseMybatisDao<DailySalesReportMappe
 	DailySalesReportMapper dailySalesReportMapper;
 	@Autowired
 	UserMapper userMapper;
+	@Autowired
+	DepartmentService	departmentService;
 
 	public int insertDailyReports(Date startTime, Date endTime) {
 		List<DailySalesReport> list = dailySalesReportMapper.selectAdmins();
@@ -250,12 +249,12 @@ public class SalesReportServiceImpl extends BaseMybatisDao<DailySalesReportMappe
 		}
 	}
 
-	
+
 	public List<marketingESBo> marketingStatistics(String depId) {
 		ReportDate rd = new ReportDate(new Date());
 		List<marketingESBo> list=dailySalesReportMapper.findmarketingStatisticsList(depId,rd.getStringDailyStart(),rd.getStringDailyEnd(),rd.getStringWeeklyStart(),rd.getStringWeeklyEnd(),
 														rd.getStringMonthStart(),rd.getStringMonthEnd(),rd.getStringYearStart(),rd.getStringYearEnd());
-		
+
 			return list;
 	}
 
@@ -264,7 +263,7 @@ public class SalesReportServiceImpl extends BaseMybatisDao<DailySalesReportMappe
 		ReportDate rd = new ReportDate(new Date());
 		List<marketingESBo> list=dailySalesReportMapper.marketingDepStatisticsList(depId,rd.getStringDailyStart(),rd.getStringDailyEnd(),rd.getStringWeeklyStart(),rd.getStringWeeklyEnd(),
 				rd.getStringMonthStart(),rd.getStringMonthEnd(),rd.getStringYearStart(),rd.getStringYearEnd());
-			
+
 		return list;
 	}
 
@@ -279,7 +278,7 @@ public class SalesReportServiceImpl extends BaseMybatisDao<DailySalesReportMappe
 		ReportDate rd = new ReportDate(new Date());
 		CountMarketingStatisticsBo count=dailySalesReportMapper.privateCustomersDepCount(depId,rd.getStringDailyStart(),rd.getStringDailyEnd(),rd.getStringWeeklyStart(),rd.getStringWeeklyEnd(),
 				rd.getStringMonthStart(),rd.getStringMonthEnd(),rd.getStringYearStart(),rd.getStringYearEnd());
-		
+
 		return count;
 	}
 
@@ -388,13 +387,21 @@ public class SalesReportServiceImpl extends BaseMybatisDao<DailySalesReportMappe
 		return null;
 	}
 
-	public List<userDataListBo> userDataStatistics(String depId) {
-		return userMapper.userDataStatistics(depId);
+	public List<userDataListBo> userDataStatistics(String deps) {
+		List<String> listDep=new ArrayList<>();
+		if (deps!=null){
+			listDep=departmentService.parseArray(deps);
+		}
+		return userMapper.userDataStatistics(listDep);
 	}
 
-	public userDataListBo userDataStatisticsCount(String depId) {
-		return userMapper.userDataStatisticsCount(depId);
+	public userDataListBo userDataStatisticsCount(String deps) {
+		List<String> listDep=new ArrayList<>();
+		if (deps!=null){
+			listDep=departmentService.parseArray(deps);
+		}
+		return userMapper.userDataStatisticsCount(listDep);
 	}
-	
+
 
 }

+ 7 - 5
src/main/java/com/goafanti/user/bo/InputUserFollowList.java

@@ -1,5 +1,7 @@
 package com.goafanti.user.bo;
 
+import java.util.List;
+
 public class InputUserFollowList {
 
     private String userName;
@@ -12,7 +14,7 @@ public class InputUserFollowList {
     private String createEndTime;
     private String guidanceStartTime;
     private String guidanceEndTime;
-    private String depId;
+    private String deps;
     /** 0自己 1下级 2全部*/
     private Integer shiroType;
     private String followName;
@@ -83,12 +85,12 @@ public class InputUserFollowList {
         this.guidanceEndTime = guidanceEndTime;
     }
 
-    public String getDepId() {
-        return depId;
+    public String getDeps() {
+        return deps;
     }
 
-    public void setDepId(String depId) {
-        this.depId = depId;
+    public void setDeps(String deps) {
+        this.deps = deps;
     }
 
     public Integer getPageSize() {

+ 2 - 2
src/main/java/com/goafanti/user/service/impl/UserFollowServiceImpl.java

@@ -53,8 +53,8 @@ public class UserFollowServiceImpl extends BaseMybatisDao<UserFollowMapper>  imp
         if (in.getCreateEndTime()!=null) map.put("createEndTime", in.getCreateEndTime()+" 23:59:59");
         if (in.getGuidanceStartTime()!=null) map.put("guidanceStartTime", in.getGuidanceStartTime());
         if (in.getGuidanceEndTime()!=null) map.put("guidanceEndTime", in.getGuidanceEndTime()+" 23:59:59");
-        if (in.getDepId() != null){
-            map.put("deps", departmentService.getLowerDep(in.getDepId()));
+        if (in.getDeps()!=null){
+            map.put("deps", departmentService.parseArray(in.getDeps()));
         }
         if (in.getShiroType()!=null)map.put("shiroType",in.getShiroType());
         else map.put("shiroType",0);

+ 5 - 5
src/main/java/com/goafanti/weChat/bo/InputPublicDtails.java

@@ -15,7 +15,7 @@ public class InputPublicDtails {
 	 */
 	private Integer type;
 	private String sid;
-	private String depId;
+	private String deps;
 	/**
 	 * 0业务 1技术 2行政 3协单
 	 */
@@ -55,12 +55,12 @@ public class InputPublicDtails {
 		this.sid = sid;
 	}
 
-	public String getDepId() {
-		return depId;
+	public String getDeps() {
+		return deps;
 	}
 
-	public void setDepId(String depId) {
-		this.depId = depId;
+	public void setDeps(String deps) {
+		this.deps = deps;
 	}
 
 	public Integer getType() {

+ 11 - 2
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -3,6 +3,7 @@ package com.goafanti.weChat.service.impl;
 import java.text.ParseException;
 import java.util.*;
 
+import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.common.dao.*;
 import com.goafanti.order.service.OrderService;
 import org.springframework.beans.BeanUtils;
@@ -69,6 +70,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	private SystemWebSocketHandler	systemWebSocketHandler;
 	@Autowired
 	private TOrderNewMapper tOrderNewMapper;
+	@Autowired
+	private DepartmentService	departmentService;
 
 	@Override
 	public Map<String, Object> addPublicRelease(InputPublicRelease in) {
@@ -606,7 +609,6 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	private void addParams(InputPublicDtails in, Map<String, Object> map) {
 		if(in.getAid()!=null) map.put("aid", in.getAid());
 		if(in.getSid()!=null) map.put("sid", in.getSid());
-		if(in.getDepId()!=null) map.put("depId", in.getDepId());
 		if(in.getReleaseStart()!=null) map.put("releaseStart", in.getReleaseStart());
 		if(in.getReleaseEnd()!=null) map.put("releaseEnd", in.getReleaseEnd()+" 23:59:59");
 		if(in.getCreateStart()!=null) map.put("createStart", in.getCreateStart());
@@ -624,10 +626,17 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			in.setType(2);
 		}else if(TokenManager.hasRole(AFTConstants.COMPANY_MANAGER)||TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){
 			in.setType(1);
-			map.put("deps", orderService.selectMyDeps());
+			if (in.getDeps()!=null){
+				map.put("deps", departmentService.selectSubDeps(in.getDeps()));
+			}else {
+				map.put("deps",departmentService.selectMyDeps());
+			}
 		}else{
 			in.setType(0);
 			if (in.getAid()==null) map.put("aid",TokenManager.getAdminId());
+			if(in.getDeps()!=null){
+				map.put("deps", departmentService.parseArray(in.getDeps()));
+			}
 		}
 		map.put("type", in.getType());
 	}