Browse Source

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

anderx 3 years ago
parent
commit
2797dd1b72

+ 8 - 5
src/main/java/com/goafanti/admin/bo/depCountBo.java

@@ -1,9 +1,10 @@
 package com.goafanti.admin.bo;
 
+import java.util.ArrayList;
 import java.util.List;
 
 public class depCountBo {
-	
+
 	private String id;
 	private String name;
 	private Integer userCount;
@@ -16,7 +17,7 @@ public class depCountBo {
 	private Integer channelCompleteCount;
 	private List<depCountBo> list;
 	private List<AdminCustomerBo> aList;
-	
+
 	public depCountBo() {
 		userCount = 0;
 		receiveCount = 0;
@@ -26,8 +27,10 @@ public class depCountBo {
 		newCount = 0;
 		channelCompleteCount = 0;
 		channelNewCount = 0;
+		list=new ArrayList<>();
+		aList=new ArrayList<>();
 	}
-	
+
 	public Integer getSignCount() {
 		return signCount;
 	}
@@ -102,7 +105,7 @@ public class depCountBo {
 	public void setaList(List<AdminCustomerBo> aList) {
 		this.aList = aList;
 	}
-	
-	
+
+
 
 }

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

@@ -1,7 +1,11 @@
 package com.goafanti.admin.service;
 
+import com.goafanti.common.model.OrganizationManagement;
 import com.goafanti.common.model.WorkingHours;
 
+import java.util.List;
+
+
 public interface DepartmentService {
 
 	int addWorkingHours(WorkingHours in);
@@ -16,4 +20,12 @@ public interface DepartmentService {
 
 	boolean checkDepWorkingHouresType(Integer id);
 
+	/**
+	 * 查询分管部门、查询管理部门
+	 * @return
+	 */
+	List<OrganizationManagement> selectMyDeps();
+
+
+	List<OrganizationManagement> selectSubDeps(String subId);
 }

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

@@ -9,6 +9,9 @@ import java.util.UUID;
 
 import javax.annotation.Resource;
 
+import com.goafanti.admin.service.DepartmentService;
+import com.goafanti.common.model.OrganizationManagement;
+import com.goafanti.order.service.OrderService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.Cacheable;
@@ -53,6 +56,8 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 	private UserBusinessMapper	userBusinessMapper;
 	@Autowired
 	private OrganizationManagementMapper	organizationManagementMapper;
+	@Autowired
+	private DepartmentService departmentService;
 	@Resource(name = "passwordUtil")
 	private PasswordUtil					passwordUtil;
 
@@ -365,79 +370,85 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 	}
 
 	@Override
-	@Cacheable(cacheNames = "selectAllUser#500",key = "'selectAllUser:depId:'+#depId+'startTime:'+#startTime+" +
-			"'endTime:'+#endTime+'aName:'+#aName")
+	@Cacheable(cacheNames = "selectAllUser#500",key = "'selectAllUser:depId:'+#depId+'startTime:'+#startTime+" +"'endTime:'+#endTime+'aName:'+#aName")
 	public depCountBo selectAllUser(String depId, String startTime, String endTime,String aName) {
 		depCountBo acb=new depCountBo();
-		endTime=endTime+" 23:59:59";
+		if (endTime!=null)endTime=endTime+" 23:59:59";
 		List<depCountBo >deps=new ArrayList<>();
+		List<OrganizationManagement> depIds=new ArrayList<>();
 		if (depId==null) {
 			acb.setName("科德集团");
-//			organizationManagementMapper.getDepAll("科德集团",null,startTime,  endTime);
 			deps=organizationManagementMapper.selectBysuperName("科德集团");
-
 		}else {
 			OrganizationListOut oo=organizationManagementMapper.selectAllById(depId);
 			acb.setName(oo.getName());
+			acb.setId(depId);
 			deps=organizationManagementMapper.selectBysuperId(oo.getId());
+			depIds =departmentService.selectSubDeps(depId);
 		}
-		//迭代查出所有层级并计算
-		acb.setList(nestingList(deps,startTime,  endTime,aName));
-		//计算顶层
-		acb.setaList(organizationManagementMapper.getDepAll(depId,aName,startTime,  endTime));
-		sumCount(acb,0);
+		List<AdminCustomerBo> list =organizationManagementMapper.AlldepCount(depIds,startTime,  endTime);
+		for (AdminCustomerBo ad : list) {
+			if (acb.getId().equals(ad.getDepId())){
+				acb.getaList().add(ad);
+			}
+		}
+		for (depCountBo dep : deps) {
+			dep.setList(iterationDeps(dep.getId(),list));
+			for (AdminCustomerBo ad : list) {
+				if (dep.getId().equals(ad.getDepId())){
+					dep.getaList().add(ad);
+				}
+				sumCount(dep);
+			}
+		}
+		acb.setList(deps);
+		sumCount(acb);
 		return acb;
 	}
 
-	private List<depCountBo> nestingList(List<depCountBo>deps,String startTime, String endTime,String name) {
-		List<depCountBo> res=new ArrayList<>();
-		//循环取出其中
-		for (depCountBo ab : deps) {
-			//找出每一个部门的直部门,并嵌套下去,先获取然后将
-			List<depCountBo >deps2=organizationManagementMapper.selectBysuperId(ab.getId());
-			//查找所有部门的人的信息
-			List<AdminCustomerBo> aList=organizationManagementMapper.getDepAll(ab.getId(),name,startTime,  endTime);
-			ab.setList(nestingList(deps2,startTime,  endTime,name));
-			ab.setaList(aList);
-			//计算总数
-			sumCount(ab,1);
-			if (ab.getCompleteCount() != 0 || ab.getReceiveCount() != 0 || ab.getUserCount() != 0
-					|| ab.getSignCount() != 0 || ab.getChannelCount() != 0|| ab.getNewCount() != 0
-					|| ab.getChannelNewCount() != 0|| ab.getChannelCompleteCount() != 0) {
-				res.add(ab);
+	//迭代获取所有部门与部门员工并计算出部门数量
+	private List<depCountBo> iterationDeps(String id,List<AdminCustomerBo> list) {
+		List<depCountBo>  deps =organizationManagementMapper.selectBysuperId(id);
+		for (depCountBo dep : deps) {
+			dep.setList(iterationDeps(dep.getId(),list));
+			for (AdminCustomerBo ad : list) {
+				if (dep.getId().equals(ad.getDepId())){
+					dep.getaList().add(ad);
+				}
 			}
+			sumCount(dep);
 		}
-		return res;
+    	return deps;
 	}
+
 	/**
 	 *
 	 * @param ab
-	 * @param type 0 部门计算 1人员计算
 	 */
-	private void sumCount(depCountBo ab,int type ) {
+	private void sumCount(depCountBo ab) {
 		int completeCount=0,receiveCount=0,userCount=0,signCount=0,channelCount=0,newCount=0,channelNewCount=0,channelCompleteCount=0;
 		if (ab.getList()!=null&&!ab.getList().isEmpty()) {
 			for (depCountBo a : ab.getList()) {
-				if ( a.getCompleteCount()!=0) completeCount+=a.getCompleteCount();
-				if ( a.getReceiveCount()!=0) receiveCount+=a.getReceiveCount();
-				if ( a.getUserCount()!=0) userCount+=a.getUserCount();
-				if ( a.getSignCount()!=0) signCount+=a.getSignCount();
-				if ( a.getChannelCount()!=0) channelCount+=a.getChannelCount();
-				if ( a.getNewCount()!=0) newCount+=a.getNewCount();
-				if ( a.getChannelNewCount()!=0) channelNewCount+=a.getChannelNewCount();
-				if ( a.getChannelCompleteCount()!=0) channelCompleteCount+=a.getChannelCompleteCount();
+				if (a.getCompleteCount()!=null&& a.getCompleteCount()!=0) completeCount+=a.getCompleteCount();
+				if (a.getReceiveCount()!=null&& a.getReceiveCount()!=0) receiveCount+=a.getReceiveCount();
+				if (a.getUserCount()!=null&& a.getUserCount()!=0) userCount+=a.getUserCount();
+				if (a.getSignCount()!=null&& a.getSignCount()!=0) signCount+=a.getSignCount();
+				if (a.getChannelCount()!=null&& a.getChannelCount()!=0) channelCount+=a.getChannelCount();
+				if (a.getNewCount()!=null&& a.getNewCount()!=0) newCount+=a.getNewCount();
+				if (a.getChannelNewCount()!=null&& a.getChannelNewCount()!=0) channelNewCount+=a.getChannelNewCount();
+				if (a.getChannelCompleteCount()!=null&& a.getChannelCompleteCount()!=0) channelCompleteCount+=a.getChannelCompleteCount();
 			}
 		}
 		if (ab.getaList()!=null&&!ab.getaList().isEmpty()) {
 			for (AdminCustomerBo a : ab.getaList()) {
-				if ( a.getCompleteCount()!=0) completeCount+=a.getCompleteCount();
-				if ( a.getReceiveCount()!=0) receiveCount+=a.getReceiveCount();
-				if ( a.getUserCount()!=0) userCount+=a.getUserCount();
-				if ( a.getSignCount()!=0) signCount+=a.getSignCount();
-				if ( a.getChannelCount()!=0) channelCount+=a.getChannelCount();
-				if ( a.getNewCount()!=0) newCount+=a.getNewCount();
-				if ( a.getChannelNewCount()!=0) channelNewCount+=a.getChannelNewCount();
-				if ( a.getChannelCompleteCount()!=0) channelCompleteCount+=a.getChannelCompleteCount();
+				if (a.getCompleteCount()!=null&& a.getCompleteCount()!=0) completeCount+=a.getCompleteCount();
+				if (a.getReceiveCount()!=null&& a.getReceiveCount()!=0) receiveCount+=a.getReceiveCount();
+				if (a.getUserCount()!=null&& a.getUserCount()!=0) userCount+=a.getUserCount();
+				if (a.getSignCount()!=null&& a.getSignCount()!=0) signCount+=a.getSignCount();
+				if (a.getChannelCount()!=null&& a.getChannelCount()!=0) channelCount+=a.getChannelCount();
+				if (a.getNewCount()!=null&& a.getNewCount()!=0) newCount+=a.getNewCount();
+				if (a.getChannelNewCount()!=null&& a.getChannelNewCount()!=0) channelNewCount+=a.getChannelNewCount();
+				if (a.getChannelCompleteCount()!=null&& a.getChannelCompleteCount()!=0) channelCompleteCount+=a.getChannelCompleteCount();
 			}
 		}
 		ab.setCompleteCount(completeCount);

+ 56 - 4
src/main/java/com/goafanti/admin/service/impl/DepartmentServiceImpl.java

@@ -1,7 +1,13 @@
 package com.goafanti.admin.service.impl;
 
+import java.util.ArrayList;
 import java.util.List;
 
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.OrganizationManagementMapper;
+import com.goafanti.common.model.OrganizationManagement;
+import com.goafanti.core.shiro.token.TokenManager;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -15,7 +21,10 @@ public class DepartmentServiceImpl extends BaseMybatisDao<WorkingHoursMapper> im
 
 	@Autowired
 	private WorkingHoursMapper	workingHoursMapper;
-	
+	@Autowired
+	private OrganizationManagementMapper departmentMapper;
+
+
 	@Override
 	public int addWorkingHours(WorkingHours in) {
 		return workingHoursMapper.insertSelective(in);
@@ -53,8 +62,51 @@ public class DepartmentServiceImpl extends BaseMybatisDao<WorkingHoursMapper> im
 		}
 		return false;
 	}
-	
-	
-	
+
+	@Override
+	public List<OrganizationManagement> selectMyDeps() {
+		if(TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.APPROVAL_DECISION))
+			return departmentMapper.selectAllDeps();
+		else
+			return selectCurrentDep(TokenManager.getAdminId());
+	}
+
+	@Override
+	public List<OrganizationManagement> selectSubDeps(String subId) {
+		List<OrganizationManagement>  list =departmentMapper.selectSubDeps(subId);
+		List<OrganizationManagement>  all=new ArrayList<>();
+		all.add(departmentMapper.selectByPrimaryKey(subId));
+		all.addAll(list);
+		for (OrganizationManagement dep : list) {
+			all.addAll(selectSubDeps(dep.getId()));
+		}
+		return all;
+	}
+
+	private List<OrganizationManagement> selectCurrentDep(String managerId){
+		List<OrganizationManagement> allData = new ArrayList<OrganizationManagement>();
+		List<OrganizationManagement> superData = departmentMapper.selectCurrentDeps(managerId);
+		if(superData != null && superData.size()>0){
+			allData.addAll(superData);
+		}
+		selectSubDeps(allData,superData);
+		return allData;
+	}
+
+	private List<OrganizationManagement> selectSubDeps(List<OrganizationManagement> allData,List<OrganizationManagement> superData){
+		List<OrganizationManagement> subData = new ArrayList<>();
+		String superIds = "";
+		for(OrganizationManagement 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;
+	}
 
 }

+ 18 - 17
src/main/java/com/goafanti/common/dao/OrganizationManagementMapper.java

@@ -74,14 +74,14 @@ public interface OrganizationManagementMapper {
 	 * 根据组织名称查组织编号
 	 */
 	String selectDepNoByName(String name);
-	
+
 	/**
 	 * 根据上级组织查组织编号
 	 */
 	String  selectDepNo(String id);
 	/**
-	
-	
+
+
 	/**
 	 * 查询相同上级下编号数量
 	 */
@@ -90,13 +90,13 @@ public interface OrganizationManagementMapper {
 	 * 模糊查询负责人名称
 	 */
 	List<AdminListBo> selectName(String name);
-	
+
 	OrganizationListOut selectAllById(String id);
-	
+
 	int deleteById(String id);
-	
+
 	String selectAdminNameById(String name);
-	
+
 	String selectIdByDepNo(String depNo);
 	/**
 	 * 查询有相同上级组织的信息
@@ -104,26 +104,26 @@ public interface OrganizationManagementMapper {
 	 * @return
 	 */
 	List<OrganizationListOut> selectIDNBySuperId(String superId);
-	
+
 	int updateByNumber(OrganizationListOut olo);
-	
+
 	int selectCountBySuperId(String superId);
-	
+
 	String selectIdByName(String name);
-	
+
 	String selectNameById(String id);
-	
+
 	String selectDepNoById(String id);
-	
+
 	int selectUserById(String id);
-	
+
 	/**
 	 * 查询下级集合
 	 * @param superIds
 	 * @return
 	 */
 	List<OrganizationManagement> selectSubDeps(@Param("superIds")String superIds);
-	
+
 	List<depCountBo> selectBysuperId(String id);
 
 	List<depCountBo> selectBysuperName(String name);
@@ -133,7 +133,7 @@ public interface OrganizationManagementMapper {
 	 * @return
 	 */
 	List<OrganizationManagement> selectCurrentDeps(@Param("aid")String aid);
-	
+
 	/**
 	 * 查询所有部门
 	 * @return
@@ -145,9 +145,10 @@ public interface OrganizationManagementMapper {
 	 * @return
 	 */
 	String getMaxAbbreviation(String abbreviation);
-	
+
 	List<AdminCustomerBo> getDepAll(@Param("depId")String depId,
 			@Param("adminName")String adminName,@Param("startTime")String startTime, @Param("endTime")String endTime);
 
 
+	List<AdminCustomerBo> AlldepCount(@Param("depIds")List<OrganizationManagement> depIds ,@Param("startTime")String startTime, @Param("endTime")String endTime);
 }

+ 33 - 1
src/main/java/com/goafanti/common/mapper/OrganizationManagementMapper.xml

@@ -610,7 +610,7 @@
 
 		<select id="selectBysuperId"  resultType="com.goafanti.admin.bo.depCountBo">
 		select a.id ,a.name ,0 userCount,0 inputCount,0 receiveCount, 0 completeCount, 0 interviewCount
-		from department a left join department b on a.super_id=b.id where b.id= #{id}
+        from department a  where a.super_id= #{id}
 	</select>
 
     <select id="selectBysuperName" resultType="com.goafanti.admin.bo.depCountBo">
@@ -660,5 +660,37 @@
 	and d.id= #{depId}
 	</if>
 	</select>
+    <select id="AlldepCount" resultType="com.goafanti.admin.bo.AdminCustomerBo">
+        select a.id aid,a.name aName ,a.department_id depId,c.name depName,ifnull(userCount,0)userCount,
+        ifnull(channelCount,0)channelCount,ifnull(signCount,0)signCount,ifnull(newCount,0)newCount,
+        ifnull(channelNewCount,0)channelNewCount,ifnull(receiveCount,0)receiveCount,ifnull(completeCount,0)completeCount,
+        ifnull(channelCompleteCount,0)channelCompleteCount
+        from admin a left join (select aid,sum(if( share_type=0 and channel=0,1,0))userCount,
+        sum(if(share_type=3 and  channel=1,1,0))channelCount,
+        sum(if( share_type=2 ,1,0))signCount,
+        sum(if(share_type=0 and source =1  and channel=0,1,0))newCount,
+        sum(if(share_type=0 and source =1  and channel=1,1,0))channelNewCount,
+        sum(if(share_type=0 and source =2  and channel=0,1,0))receiveCount
+        from `user` where `type` =1 and new_channel=0
+            <if test="startTime != null and endTime != null">
+                and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
+            </if>
+            group by aid)b on a.id=b.aid
+        left join (select a.aid,sum(if(b.channel=0,1,0))completeCount,
+        sum(if(b.channel=1,1,0))channelCompleteCount from public_release a left join `user` b on a.uid =b.id
+        where a.clock_in =1
+        <if test="startTime != null and endTime != null">
+            and clock_in_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
+        </if>
+        group by a.aid ) y on a.id=y.aid
+                     left join department c on a.department_id =c.id
+        where  a.status='正常'  and a.type=1
+        <if test="depIds!= null">
+            and a.department_id in
+            <foreach close=")" collection="depIds" item="deps" open="(" separator=",">
+                #{deps.id}
+            </foreach>
+        </if>
+    </select>
 
 </mapper>

+ 12 - 0
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1691,6 +1691,12 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     <if test="salesType !=null ">
       and a.sales_type = #{salesType}
     </if>
+    <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>
     <if test="orderNo != null">
       and a.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
     </if>
@@ -1740,6 +1746,12 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     <if test="salesType !=null ">
       and a.sales_type = #{salesType}
     </if>
+    <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>
     <if test="orderNo != null">
       and a.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
     </if>

+ 1 - 0
src/main/java/com/goafanti/core/cache/serializer/FastJsonRedisSerializer.java

@@ -28,6 +28,7 @@ public class FastJsonRedisSerializer implements RedisSerializer<Object> {
 		pc.addAccept("com.goafanti.order.bo.outProvinceStatisticsList");
 		pc.addAccept("com.goafanti.weChat.bo.OutPublicStatistics");
 		pc.addAccept("com.goafanti.core.mybatis.page.Pagination");
+		pc.addAccept("java.util.Map");
 
 	}
 

+ 1 - 1
src/main/java/com/goafanti/core/shiro/session/CustomSessionManager.java

@@ -37,7 +37,7 @@ public class CustomSessionManager extends DefaultWebSessionManager {
 		System.out.println("请求 token=============="+sid);
 		if (StringUtils.isNotBlank(sid)) {
 			// 是否将sid保存到cookie,浏览器模式下使用此参数。
-			if (WebUtils.isTrue(request, "AFT_SID")) {
+			if (WebUtils.isTrue(request, "KEDE_SID")) {
 				Cookie template = getSessionIdCookie();
 				Cookie cookie = new SimpleCookie(template);
 				cookie.setValue(sid);

+ 27 - 0
src/main/java/com/goafanti/order/bo/InputStatisticsOrderList.java

@@ -6,6 +6,9 @@ public class InputStatisticsOrderList {
     private String orderNo;
     private String name;
     private String contractNo;
+    private String startDate;
+    private String endDate;
+    private String depId;;
 
     private Integer liquidationStatus;
     private Integer approval;
@@ -16,6 +19,30 @@ public class InputStatisticsOrderList {
     private Integer pageNo;
     private Integer pageSize;
 
+    public String getStartDate() {
+        return startDate;
+    }
+
+    public void setStartDate(String startDate) {
+        this.startDate = startDate;
+    }
+
+    public String getEndDate() {
+        return endDate;
+    }
+
+    public void setEndDate(String endDate) {
+        this.endDate = endDate;
+    }
+
+    public String getDepId() {
+        return depId;
+    }
+
+    public void setDepId(String depId) {
+        this.depId = depId;
+    }
+
     public String getOrderNo() {
         return orderNo;
     }

+ 38 - 38
src/main/java/com/goafanti/order/service/OrderService.java

@@ -17,7 +17,7 @@ import com.goafanti.order.bo.C2COrderDetailBo;
 import com.goafanti.order.bo.OrderChangeBo;
 
 public interface OrderService {
-	
+
 	/**
 	 * 查询商品详情
 	 * @param commodityId 商品id
@@ -55,7 +55,7 @@ public interface OrderService {
 	 * @return
 	 */
 	int updateRefundForTest(String orderNo, String refundAmount);
-	
+
 	/**
 	 * 支付尾款
 	 * @param orderNo 订单编号
@@ -66,7 +66,7 @@ public interface OrderService {
 	int updatePayForLast(String orderNo, BigDecimal fundAmount, String remarks);
 
 	/**
-	 * 
+	 *
 	 * @param confirm 是否
 	 * @return
 	 */
@@ -107,9 +107,9 @@ public interface OrderService {
 	 * @return
 	 */
 	int updateConfirmIntention(String orderNo, boolean confirm);
-	
+
 	/**
-	 * 
+	 *
 	 * @param bo
 	 * @param startDate 开始时间
 	 * @param endDate 结束时间
@@ -117,15 +117,15 @@ public interface OrderService {
 	 * @param formal 是否包含正式
 	 * @param depId 部门id
 	 * @param history 是否包含历史
-	 * @param pageNo 
+	 * @param pageNo
 	 * @param pageSize
 	 * @return
 	 */
 	Pagination<OrderListBo> selectServiceOrder(OrderListBo bo,String startDate,String endDate,Integer intention,Integer formal,
 			Integer pageNo, Integer pageSize);
-	
 
-	
+
+
 	/**
 	 * 服务订单详情
 	 * @param orderNo
@@ -145,7 +145,7 @@ public interface OrderService {
 	 */
 	int updateServiceOrder(String orderNo, String signFirstPayment,
 			String signTotalAmount, String contractNo,String orderRemarks,String contractPictureUrl);
-	
+
 	/**
 	 * 签单
 	 * @param orderNo
@@ -180,7 +180,7 @@ public interface OrderService {
 	 */
 	int addOrderCommodity(String orderNo, String commodityId, String commodityName,String commodityMode, Integer commodityQuantity,Integer commodityType,
 			String commodityPrice, String discountPrice,String commodityFirstPayment,String discountFirstPayment, String remarks);
-	
+
 	/**
 	 * 修改商品信息
 	 * @param detailId
@@ -198,15 +198,15 @@ public interface OrderService {
 	 * @return
 	 */
 	int deleteOrderCommodity(String detailId);
-	
+
 	/**
-	 * 查询分管部门
+	 * 查询分管部门、查询管理部门
 	 * @return
 	 */
 	List<OrganizationManagement> selectMyDeps();
-	
+
 	/**
-	 * 
+	 *
 	 * @param bo
 	 * @param startDate 开始时间
 	 * @param endDate 结束时间
@@ -214,21 +214,21 @@ public interface OrderService {
 	 * @param formal 是否包含正式
 	 * @param depIds 部门id
 	 * @param history 是否包含历史
-	 * @param pageNo 
+	 * @param pageNo
 	 * @param pageSize
 	 * @return
 	 */
 	Pagination<OrderListBo> selectDepServiceOrder(OrderListBo bo,String startDate,String endDate,Integer intention,Integer formal,
 			String depIds,Integer pageNo, Integer pageSize);
-	
+
 	/**
-	 * 
+	 *
 	 * @param bo
 	 * @param startDate 开始时间
 	 * @param endDate 结束时间
 	 * @param depIds 部门id
 	 * @param history 是否包含历史
-	 * @param pageNo 
+	 * @param pageNo
 	 * @param pageSize
 	 * @return
 	 */
@@ -242,7 +242,7 @@ public interface OrderService {
 	 * @return
 	 */
 	Pagination<OrderListBo> selectPublicOrder(OrderListBo bo,String startDate,String endDate,Integer pageNo, Integer pageSize);
-	
+
 	/**
 	 * 指定的营销员
 	 * @param orderNo
@@ -250,9 +250,9 @@ public interface OrderService {
 	 * @return
 	 */
 	int updateAppointSalesman(String orderNo,String salesmanId);
-	
+
 	/**
-	 * 
+	 *
 	 * @param orderNo
 	 * @param depId
 	 * @param buyerName
@@ -263,10 +263,10 @@ public interface OrderService {
 	 * @param pageSize
 	 * @return
 	 */
-	Pagination<OrderListBo> selectSettlementList(String orderNo, String depId,String buyerName,String salesmanName,  
+	Pagination<OrderListBo> selectSettlementList(String orderNo, String depId,String buyerName,String salesmanName,
 			String financeId,String financeName,Integer orderStatus,Integer liquidationStatus,Integer approval,Integer isDistributionFinance,
 			String startDate,String endDate,Integer pageNo, Integer pageSize);
-	
+
 	/**
 	 * 我的订单流水(财务负责人课件)
 	 * @param payeeName 收款人
@@ -280,7 +280,7 @@ public interface OrderService {
 	 */
 	Pagination<BillListBo> selectMyBillList(String payeeName,String payerName,String depId,String salesmanName,String orderNo,
 			 Integer confirmSign,Integer deleteSign,Integer pageNo,Integer pageSize);
-	
+
 
 	/**
 	 * 我的订单流水查询(与订单相关的人员可见)
@@ -295,8 +295,8 @@ public interface OrderService {
 	 */
 	Pagination<BillListBo> queryMyBillList(String payeeName,String payerName,String depId,String salesmanName,String orderNo,
 			 Integer confirmSign,Integer deleteSign,Integer pageNo,Integer pageSize);
-	
-	
+
+
 	/**
 	 * 所有订单流水查询
 	 * @param payeeName
@@ -310,7 +310,7 @@ public interface OrderService {
 	 */
 	Pagination<BillListBo> queryAllBillList(String payeeName,String payerName,String depId,String salesmanName,String financeName,String orderNo,
 			 Integer confirmSign,Integer deleteSign,Integer pageNo,Integer pageSize);
-	
+
 	/**
 	 * 查看流水详情
 	 * @param billNo
@@ -326,8 +326,8 @@ public interface OrderService {
 	 * @return
 	 */
 	int updateBill(String billNo, String orderNo, Integer confrim,String financialPayNo,String financialPayTime,String remarks);
-	
-	
+
+
 	/**
 	 * 修改露水订单
 	 * @param billNo
@@ -365,14 +365,14 @@ public interface OrderService {
 	 * @return
 	 */
 	int updateSetUpProject(String orderNo, String signComment);
-	
+
 	/**
 	 * 订单编号
 	 * @param orderNo
 	 * @return
 	 */
 	List<TOrderDetail> selectOrderCommodity(String orderNo);
-	
+
 	/**
 	 * 支付(测试用)
 	 * @param orderNo
@@ -417,7 +417,7 @@ public interface OrderService {
 	 * @return
 	 */
 	int updateConfirmRefund(String orderNo,boolean confirm);
-	
+
 	/**
 	 * 转交订单
 	 * @param orderNo
@@ -426,7 +426,7 @@ public interface OrderService {
 	 * @return
 	 */
 	int updateTransferOrder(String orderNo,String aid,Integer targetType);
-	
+
 	/**
 	 * PC端添加意向
 	 * @param orderNo 订单编号
@@ -438,15 +438,15 @@ public interface OrderService {
 	 * @param remarks 备注
 	 * @return
 	 */
-	int addPurpose(String orderNo, String commodityId, String commodityMode, Integer commodityQuantity,Integer commodityType, 
+	int addPurpose(String orderNo, String commodityId, String commodityMode, Integer commodityQuantity,Integer commodityType,
 			String createTime,String remarks) throws ParseException;
 
 	/**
 	 * 添加变更记录
 	 * @param orderNo
 	 * @param changeComment
-	 * @param dunList 
-	 * @param taskList 
+	 * @param dunList
+	 * @param taskList
 	 * @return
 	 */
 	int addOrderChange(String orderNo, String changeComment, String taskList, String dunList);
@@ -486,7 +486,7 @@ public interface OrderService {
 
 	int addBusinessProjectId(FollowBusinessBo fbb);
 
-	
 
-	
+
+
 }

+ 4 - 0
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -604,6 +604,10 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (in.getLiquidationStatus()!=null)params.put("liquidationStatus",in.getLiquidationStatus());
 		if (in.getApproval()!=null)params.put("approval",in.getApproval());
 		if (in.getAmountStatus()!=null)params.put("amountStatus",in.getAmountStatus());
+		if (in.getStartDate()!=null)params.put("startDate",in.getStartDate());
+		if (in.getEndDate()!=null)params.put("endDate",in.getEndDate()+" 23:59:59");
+		if (in.getDepId()!=null)params.put("depId",in.getDepId());
+
 
 		Pagination<TOrderNewBo> p = (Pagination<TOrderNewBo>)findPage("selectstatisticsOrderListPage",
 				"selectstatisticsOrderListCount", params, in.getPageNo(), in.getPageSize());

+ 32 - 29
src/main/java/com/goafanti/permission/service/impl/PermissionServiceImpl.java

@@ -11,6 +11,7 @@ import java.util.UUID;
 
 import org.apache.commons.beanutils.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.common.constant.AFTConstants;
@@ -77,13 +78,13 @@ public class PermissionServiceImpl extends BaseMybatisDao<PermissionMapper> impl
 			String aut="PM0"+Count;
 			String sid=permissionMapper.selectIdByAutNo(aut);
 			while(sid!=null){
-				Count=Count+1;				
+				Count=Count+1;
 				if(Count>=10){
-					aut="PM"+Count;	
+					aut="PM"+Count;
 				}else{
 					aut="PM0"+Count;
 				}
-				sid=permissionMapper.selectIdByAutNo(aut);			
+				sid=permissionMapper.selectIdByAutNo(aut);
 			}
 			record.setAutNo(aut);
 		}
@@ -91,16 +92,16 @@ public class PermissionServiceImpl extends BaseMybatisDao<PermissionMapper> impl
 			String aut="PM"+Count;
 			String sid=permissionMapper.selectIdByAutNo(aut);
 			while(sid!=null){
-				Count=Count+1;				
+				Count=Count+1;
 				aut="PM"+Count;
-				sid=permissionMapper.selectIdByAutNo(aut);				
+				sid=permissionMapper.selectIdByAutNo(aut);
 			}
 			record.setAutNo(aut);
 		}
 		record.setHierarchies("1");//1第一层
 		record.setStatus("0");//0正常 1解除
 		record.setShowOrder("0");//0
-		record.setSuperId(permissionMapper.selectIdByName("平台超级模块"));//顶级为PM	
+		record.setSuperId(permissionMapper.selectIdByName("平台超级模块"));//顶级为PM
 		permissionMapper.insertn(record);
 		return 1;
 	}
@@ -161,42 +162,42 @@ public class PermissionServiceImpl extends BaseMybatisDao<PermissionMapper> impl
 		//*******下级编号修改
 		int n=0;
 		List<Permission> Nos =permissionMapper.selectIDNBySuperId(record.getId());
-		for(Permission i:Nos){			
+		for(Permission i:Nos){
 			autNo=permissionMapper.selectAutNoByName(i.getSuperId());
 			if(n<10){
-				String aut=autNo+"0"+n;			
+				String aut=autNo+"0"+n;
 				if(n>=10){
-					aut=autNo+n;	
+					aut=autNo+n;
 				}else{
 					aut=autNo+"0"+n;
-				}	
+				}
 				i.setAutNo(aut);
 			}
 			if(n>=10){
-				String aut=autNo+n;			
-				aut=autNo+n;	
+				String aut=autNo+n;
+				aut=autNo+n;
 				i.setAutNo(aut);
 			}
 			permissionMapper.updateByNumber(i);
 			n++;
-			
+
 			//*******下下级编号修改
 			int m=0;
 			List<Permission> Noss =permissionMapper.selectIDNBySuperId(i.getId());
-			for(Permission o:Noss){			
+			for(Permission o:Noss){
 				autNo=permissionMapper.selectAutNoByName(o.getSuperId());
 				if(m<10){
-					String aut=autNo+"0"+m;			
+					String aut=autNo+"0"+m;
 					if(m>=10){
-						aut=autNo+m;	
+						aut=autNo+m;
 					}else{
 						aut=autNo+"0"+m;
-					}	
+					}
 					o.setAutNo(aut);
 				}
 				if(m>=10){
-					String aut=autNo+m;			
-					aut=autNo+m;	
+					String aut=autNo+m;
+					aut=autNo+m;
 					o.setAutNo(aut);
 				}
 				permissionMapper.updateByNumber(o);
@@ -204,35 +205,37 @@ public class PermissionServiceImpl extends BaseMybatisDao<PermissionMapper> impl
 				//*******下下级编号修改
 				int z=0;
 				List<Permission> Nosss =permissionMapper.selectIDNBySuperId(o.getId());
-				for(Permission p:Nosss){			
+				for(Permission p:Nosss){
 					autNo=permissionMapper.selectAutNoByName(p.getSuperId());
 					if(z<10){
-						String aut=autNo+"0"+z;			
+						String aut=autNo+"0"+z;
 						if(z>=10){
-							aut=autNo+z;	
+							aut=autNo+z;
 						}else{
 							aut=autNo+"0"+z;
-						}	
+						}
 						p.setAutNo(aut);
 					}
 					if(z>=10){
-						String aut=autNo+z;			
-						aut=autNo+z;	
+						String aut=autNo+z;
+						aut=autNo+z;
 						p.setAutNo(aut);
 					}
 					permissionMapper.updateByNumber(p);
 					z++;
 				}
 			}
-			
+
 		}
 		return permissionMapper.updateById(record);
 	}
 
 	@Override
+	@Cacheable(value = "findPermissionsAll#500", key = "'all'")
 	public Map<String,Object> findPermissionsAll() {
+		System.out.println("===========================================findPermissionsAll#500");
 		Map<String,Object> params = new HashMap<String, Object>();
-		List<PermissionBo> one=permissionMapper.selectOneAll();	
+		List<PermissionBo> one=permissionMapper.selectOneAll();
 		for (PermissionBo i:one){
 			i.setKey(i.getId());
 			List<PermissionBo> two=permissionMapper.selectAllBySuperId(i.getId());
@@ -242,7 +245,7 @@ public class PermissionServiceImpl extends BaseMybatisDao<PermissionMapper> impl
 				List<PermissionBo> three=permissionMapper.selectAllBySuperId(o.getId());
 				for(PermissionBo p:three){
 					p.setChildren(permissionMapper.selectAllBySuperId(p.getId()));
-					p.setKey(p.getId());					
+					p.setKey(p.getId());
 				}
 				o.setChildren(three);
 			}
@@ -251,7 +254,7 @@ public class PermissionServiceImpl extends BaseMybatisDao<PermissionMapper> impl
 		params.put("one", one);
 		return params;
 	}
-	
+
 	@Override
 	public List<Navigation> selectNavList(){
 		String aid = TokenManager.hasRole(AFTConstants.SUPERADMIN) ? null : TokenManager.getAdminId();

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

@@ -13,21 +13,21 @@ public class OutPublicDtails {
 	private String sname;
 	@Excel(name = "公出申请人")
 	private String aname;
-	@Excel(name = "公出时长")
+	@Excel(name = "公出时长",width = 8)
 	private String duration;
-	@Excel(name = "状态" ,readConverterExp = "0=驳回,1=待审核,2=同意,3=撤销")
+	@Excel(name = "状态" ,readConverterExp = "0=驳回,1=待审核,2=同意,3=撤销",width = 8)
 	private Integer status;
 	@Excel(name = "公出开始时间")
 	private String releaseStarts;
 	@Excel(name = "公出结束时间")
 	private String releaseEnds;
-	@Excel(name = "打卡状态",readConverterExp = "0=未打卡,1=已打卡")
+	@Excel(name = "打卡状态",readConverterExp = "0=未打卡,1=已打卡",width = 8)
 	private Integer clockIn;
 	@Excel(name = "打卡时间" )
 	private String clockInTimes;
 	@Excel(name = "创建时间" )
 	private String createTimes;
-	@Excel(name = "公出类型",readConverterExp = "0=业务,1=技术,2=行政")
+	@Excel(name = "公出类型",readConverterExp = "0=业务,1=技术,2=行政",width = 8)
 	private Integer type;
 	@Excel(name = "公出目标" )
 	private String remarks;
@@ -43,7 +43,7 @@ public class OutPublicDtails {
 	private String auditInfo;
 	private String annexUrl;
 	private String photoUrl;
-	@Excel(name = "修改标识",readConverterExp = "0=否,1=是")
+	@Excel(name = "修改标识",readConverterExp = "0=否,1=是",width = 8)
 	private Integer updateStatus;
 
 	public Integer getUpdateStatus() {

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

@@ -330,7 +330,14 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	public List<OutPublicStatistics> publicReleaseStatisticsList(InputPublicStatistics in) {
 		Map<String,Object> map =new HashMap<String, Object>();
 		if(in.getAid()!=null)map.put("aid", in.getAid());
-		if(in.getDepId()!=null)map.put("depId", in.getDepId());
+		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)|| TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)||
+				TokenManager.hasRole(AFTConstants.CED)|| TokenManager.hasRole(AFTConstants.CED_ASSISTANT)){
+			if(in.getDepId()!=null)map.put("depId", in.getDepId());
+		}else if (TokenManager.hasRole(AFTConstants.COMPANY_MANAGER)||TokenManager.hasRole(AFTConstants.PERSONNEL_AUDITOR)){
+
+
+		}
+
 		if(in.getClockStart()!=null)map.put("clockStart", in.getClockStart());
 		if(in.getClockEnd()!=null)map.put("clockEnd", in.getClockEnd()+" 23:59:59");
 		if(in.getCreateStart()!=null)map.put("createStart", in.getCreateStart());
@@ -362,10 +369,11 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		if(in.getStatus()!=null) map.put("status", in.getStatus());
 		if(in.getClockIn()!=null) map.put("clockIn", in.getClockIn());
 		if(in.getPublicType()!=null)map.put("publicType",in.getPublicType());
+		//type 0私有 1管理权限 2所有权限
 		if(TokenManager.hasRole(AFTConstants.SUPERADMIN)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)
 				||TokenManager.hasRole(AFTConstants.CED_ASSISTANT )||TokenManager.hasRole(AFTConstants.PERSONNEL_AUDITOR)){
 			in.setType(2);}
-		else if(TokenManager.hasRole(AFTConstants.COMPANY_MANAGER)){
+		else if(TokenManager.hasRole(AFTConstants.COMPANY_MANAGER)||TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){
 			in.setType(1);
 			map.put("deps", orderService.selectMyDeps());
 		} else{

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

@@ -1,12 +1,12 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.url=jdbc\:mysql://localhost:3306/aft20220318?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.username=root
-#jdbc.password=123456
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/aft20220318?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
-jdbc.password=aftdev
+jdbc.password=123456
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20
@@ -46,7 +46,7 @@ user_remind_days=15
 user_channel_days=90
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.12
+static.host=//static.jishutao.com/1.2.14
 #avatar.host=//172.16.0.255:3000
 #static.host=//172.16.0.255:3000/1.2.05
 #static.host=http://172.16.1.187/prod/1.2.05

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

@@ -43,7 +43,7 @@ user_remind_days=15
 #提前提醒天数
 user_channel_days=90
 
-static.host=//static.jishutao.com/1.2.12
+static.host=//static.jishutao.com/1.2.14
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload

+ 1 - 1
src/main/resources/spring/spring-shiro.xml

@@ -74,7 +74,7 @@
 
 	<bean id="sessionIdCookie"
 		class="org.apache.shiro.web.servlet.SimpleCookie">
-		<constructor-arg value="AFT_SID" />
+		<constructor-arg value="KEDE_SID" />
 		<property name="httpOnly" value="true" />
 		<property name="maxAge" value="2592000" />
 		<!-- <property name="domain" value=""/> -->