瀏覽代碼

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

anderx 4 年之前
父節點
當前提交
ee3ed465ff
共有 36 個文件被更改,包括 412 次插入194 次删除
  1. 0 36
      src/main/java/com/goafanti/admin/bo/InputPublicReleaseList.java
  2. 0 1
      src/main/java/com/goafanti/app/controller/AppUserController.java
  3. 0 1
      src/main/java/com/goafanti/business/service/impl/BusinessProjectServiceImpl.java
  4. 0 1
      src/main/java/com/goafanti/common/controller/PublicController.java
  5. 2 0
      src/main/java/com/goafanti/common/dao/OrganizationContactBookMapper.java
  6. 1 1
      src/main/java/com/goafanti/common/dao/PublicReleaseLogMapper.java
  7. 1 1
      src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java
  8. 1 1
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml
  9. 6 0
      src/main/java/com/goafanti/common/mapper/OrganizationContactBookMapper.xml
  10. 6 0
      src/main/java/com/goafanti/common/mapper/PatentNewMapper.xml
  11. 1 1
      src/main/java/com/goafanti/common/mapper/PublicReleaseLogMapper.xml
  12. 30 5
      src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml
  13. 1 1
      src/main/java/com/goafanti/common/mapper/UserMapperExt.xml
  14. 98 82
      src/main/java/com/goafanti/common/task/OrderDunTask.java
  15. 11 9
      src/main/java/com/goafanti/common/task/PatentTask.java
  16. 4 4
      src/main/java/com/goafanti/common/task/ReleaseUserTask.java
  17. 2 0
      src/main/java/com/goafanti/common/utils/DecimalCalculate.java
  18. 5 1
      src/main/java/com/goafanti/common/utils/WeChatUtils.java
  19. 1 0
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  20. 2 0
      src/main/java/com/goafanti/order/bo/outOrderDunListBo.java
  21. 14 0
      src/main/java/com/goafanti/patent/bo/PatentNewBo.java
  22. 2 1
      src/main/java/com/goafanti/patent/service/impl/PatentNewServiceImpl.java
  23. 1 1
      src/main/java/com/goafanti/admin/bo/InputPublicDtails.java
  24. 1 1
      src/main/java/com/goafanti/admin/bo/InputPublicRelease.java
  25. 75 0
      src/main/java/com/goafanti/weChat/bo/InputPublicReleaseList.java
  26. 1 1
      src/main/java/com/goafanti/admin/bo/InputPublicStatistics.java
  27. 9 1
      src/main/java/com/goafanti/admin/bo/OutPublicDtails.java
  28. 1 1
      src/main/java/com/goafanti/admin/bo/OutPublicRelease.java
  29. 1 1
      src/main/java/com/goafanti/admin/bo/OutPublicReleaseList.java
  30. 9 2
      src/main/java/com/goafanti/admin/bo/OutPublicStatistics.java
  31. 1 1
      src/main/java/com/goafanti/admin/bo/outPublicReleaseLog.java
  32. 34 6
      src/main/java/com/goafanti/admin/controller/AdminReleaseApiController.java
  33. 13 7
      src/main/java/com/goafanti/admin/service/PublicReleaseService.java
  34. 65 19
      src/main/java/com/goafanti/admin/service/impl/PublicReleaseServiceImpl.java
  35. 9 6
      src/main/resources/props/config_local.properties
  36. 4 1
      src/main/resources/props/config_test.properties

+ 0 - 36
src/main/java/com/goafanti/admin/bo/InputPublicReleaseList.java

@@ -1,36 +0,0 @@
-package com.goafanti.admin.bo;
-
-public class InputPublicReleaseList {
-	
-	private Integer pageSize;
-	private Integer pageNo;
-	private Integer type;
-	private String clockTime;
-	public Integer getPageSize() {
-		return pageSize;
-	}
-	public void setPageSize(Integer pageSize) {
-		this.pageSize = pageSize;
-	}
-	public Integer getPageNo() {
-		return pageNo;
-	}
-	public void setPageNo(Integer pageNo) {
-		this.pageNo = pageNo;
-	}
-	public Integer getType() {
-		return type;
-	}
-	public void setType(Integer type) {
-		this.type = type;
-	}
-	
-	public String getClockTime() {
-		return clockTime;
-	}
-	public void setClockTime(String clockTime) {
-		this.clockTime = clockTime;
-	}
-	
-
-}

+ 0 - 1
src/main/java/com/goafanti/app/controller/AppUserController.java

@@ -275,7 +275,6 @@ public class AppUserController extends BaseApiController {
         	keyword.add(keyword3);
 		}
         String[] keywords=(String[])keyword.toArray(new String[keyword.size()]);
-        System.out.println(StringUtils.join(keywords,","));
         ia.setKeyword(StringUtils.join(keywords,","));
         if (bindingResult.hasErrors()) {
             res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),

+ 0 - 1
src/main/java/com/goafanti/business/service/impl/BusinessProjectServiceImpl.java

@@ -275,7 +275,6 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
 	public int updateOrgProjectSize(BusinessProjectModel ps) {
 		BusinessProjectModel psz=projectSizeMapper.selectByPrimaryKey(ps.getId());
 		projectSizeConfiguration(ps, psz);
-		System.out.println(psz);
 		return projectSizeMapper.updateByPrimaryKeySelective(psz);
 	}
 	private void projectSizeConfiguration(BusinessProjectModel ps, BusinessProjectModel psz) {

+ 0 - 1
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -628,7 +628,6 @@ public class PublicController extends CertifyApiController {
           }
           }
           }
-          System.out.println(list.toString());
           return res;
           }
           public static void checkFile(MultipartFile file) throws IOException{

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

@@ -90,4 +90,6 @@ public interface OrganizationContactBookMapper {
 	void insertBatch(List<InputUserChannel> list);
 
 	void updateByUids(@Param("list")List<String> list, @Param("aid")String aid);
+
+	OrganizationContactBook getMajor(@Param("uid")String uid, @Param("aid")String aid);
 }

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

@@ -4,8 +4,8 @@ import java.util.List;
 
 import org.apache.ibatis.annotations.Param;
 
-import com.goafanti.admin.bo.outPublicReleaseLog;
 import com.goafanti.common.model.PublicReleaseLog;
+import com.goafanti.weChat.bo.outPublicReleaseLog;
 
 public interface PublicReleaseLogMapper {
 

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

@@ -4,8 +4,8 @@ import java.util.Date;
 
 import org.apache.ibatis.annotations.Param;
 
-import com.goafanti.admin.bo.OutPublicRelease;
 import com.goafanti.common.model.PublicRelease;
+import com.goafanti.weChat.bo.OutPublicRelease;
 
 public interface PublicReleaseMapper {
     /**

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

@@ -990,7 +990,7 @@
   </select>
   <!-- 获得当前登录人的名字和部门名 -->
   <select id="getDeptNameByAid" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminListBo">
-  	select a.id,a.name, d.name as departmentName,a.department_id departmentId,a.email,a.superior_id superiorId 
+  	select a.id,a.name, d.name as departmentName,a.department_id departmentId,a.email,a.superior_id superiorId,a.open_id openId 
    from admin a left join department d on a.department_id = d.id
   		where a.id = #{_parameter,jdbcType=VARCHAR}
   </select>

+ 6 - 0
src/main/java/com/goafanti/common/mapper/OrganizationContactBookMapper.xml

@@ -484,4 +484,10 @@
     </foreach>
       )
   </update>
+  <select id="getMajor"  resultType="com.goafanti.common.model.OrganizationContactBook">
+  select 
+    <include refid="Base_Column_List" />
+    from organization_contact_book
+    where uid = #{uid} and aid= #{aid}
+  </select>
 </mapper>

+ 6 - 0
src/main/java/com/goafanti/common/mapper/PatentNewMapper.xml

@@ -313,6 +313,9 @@
      <if test="startDate != null and endDate != null">
      and a.apply_date between  #{startDate} and  #{endDate}
      </if>
+     <if test="createStart != null and createEnd != null">
+     and a.create_time between  #{createStart} and  #{createEnd}
+     </if>
      <if test="name != null">
      and a.applicant  like concat('%',#{name},'%')
      </if>
@@ -353,6 +356,9 @@
      <if test="startDate != null and endDate != null">
      and a.apply_date between  #{startDate} and  #{endDate}
      </if>
+     <if test="createStart != null and createEnd != null">
+     and a.create_time between  #{createStart} and  #{createEnd}
+     </if>
      <if test="name != null">
      and a.applicant  like concat('%',#{name},'%')
      </if>

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

@@ -185,7 +185,7 @@
       create_time = #{createTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=INTEGER}
   </update>
-  <select id="listPublicReleaseLog" resultType="com.goafanti.admin.bo.outPublicReleaseLog">
+  <select id="listPublicReleaseLog" resultType="com.goafanti.weChat.bo.outPublicReleaseLog">
   select a.id,a.aid ,a.prid ,a.remarks ,a.status ,b.name aname,a.photo_url photoUrl,
 	date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes
 	from public_release_log a left join admin b on a.aid =b.id

+ 30 - 5
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -481,7 +481,7 @@
     </selectKey>
   </insert>
   
-  <select id="listPublicRelease" resultType="com.goafanti.admin.bo.OutPublicReleaseList">
+  <select id="listPublicRelease" resultType="com.goafanti.weChat.bo.OutPublicReleaseList">
 select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
 date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
 a.latitude ,a.longitude ,a.clock_in clockIn 
@@ -496,6 +496,18 @@ from public_release a left join `user` b on a.uid =b.id left join admin c on a.a
 	<if test="clockTime !=null">
 	and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
 	</if>
+	<if test="releaseStarts != null and publicEnd != null">
+	and a.release_start  BETWEEN #{releaseStarts} and #{publicEnd}
+	</if>
+	<if test="userName !=null">
+	and b.nickname like CONCAT('%',#{userName},'%')
+	</if>
+	<if test="status !=null">
+	and a.status = #{status}
+	</if>
+	<if test="clockIn !=null">
+	and a.clock_in = #{clockIn}
+	</if>
 	ORDER BY (case when a.status=1 then 1 else 2 end),a.status ,a.create_time 
   	<if test="page_sql!=null">
 			${page_sql}
@@ -503,7 +515,8 @@ from public_release a left join `user` b on a.uid =b.id left join admin c on a.a
   </select>
   <select id="countPublicRelease" resultType="java.lang.Integer">
   select  count(*)
-	from public_release a  left join admin c on a.aid =c.id
+	from public_release a left join `user` b on a.uid =b.id 
+	left join admin c on a.aid =c.id
 	where 1=1
 	<if test="type==0">
 	and a.aid= #{aid} 
@@ -514,9 +527,21 @@ from public_release a left join `user` b on a.uid =b.id left join admin c on a.a
 	<if test="clockTime !=null">
 	and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
 	</if>
+	<if test="releaseStarts != null and publicEnd != null">
+	and a.release_start  BETWEEN #{releaseStarts} and #{publicEnd}
+	</if>
+	<if test="userName !=null">
+	and b.nickname like CONCAT('%',#{userName},'%')
+	</if>
+	<if test="status !=null">
+	and a.status = #{status}
+	</if>
+	<if test="clockIn !=null">
+	and a.clock_in = #{clockIn}
+	</if>
   </select>
   
-  <select id="selectDtails" resultType="com.goafanti.admin.bo.OutPublicRelease">
+  <select id="selectDtails" resultType="com.goafanti.weChat.bo.OutPublicRelease">
   		select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
 date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
 a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,a.longitude ,a.aid ,c.superior_id suprId,a.uid
@@ -531,7 +556,7 @@ a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,
 	
   </select>
   
-  <select id="listPublicStatistics" resultType="com.goafanti.admin.bo.OutPublicStatistics">
+  <select id="listPublicStatistics" resultType="com.goafanti.weChat.bo.OutPublicStatistics">
   	select y.aid,y.bh,y.wsh,y.tg,y.duration,c.name from(select x.aid ,sum(x.bh)bh,sum(x.wsh)wsh,sum(x.tg)tg,sum(x.duration)duration 
 	from (select if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,a.aid 
   	,if(a.status=2,a.duration,0)duration    from  public_release a  left join admin b on a.aid=b.id
@@ -573,7 +598,7 @@ a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,
 	group by aid)x
   </select>
   
-  <select id="listPublicDtails" resultType="com.goafanti.admin.bo.OutPublicDtails">
+  <select id="listPublicDtails" resultType="com.goafanti.weChat.bo.OutPublicDtails">
   select b.nickname ,a.user_name userName,c.name aname,a.duration ,a.status,a.annex_url annexUrl,a.photo_url photoUrl,
 	date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds
 	from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id

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

@@ -783,7 +783,7 @@
 	</select>
 	
 	<select id="selectFollowHistoryList" resultType="com.goafanti.customer.bo.FollowListBo">
-		select a.id as followId, a.aid, a.create_time as followTime, a.contact_type as contactType,
+		select a.id as followId, a.aid,date_format( a.create_time,'%Y-%m-%d %H:%i:%S') as followTime, a.contact_type as contactType,
 			a.result,a.guidance, b.identify_name as identifyName, c.name as contacts, c.mobile as contactMobile,
 			d.name as adminName,date_format(a.guidance_time,'%Y-%m-%d %H:%i:%S') as guidanceTime
 		<if test="businessProjectId != null and businessProjectId != ''"><!--  客户甲项目A所有的跟进记录 -->

+ 98 - 82
src/main/java/com/goafanti/common/task/OrderDunTask.java

@@ -13,6 +13,7 @@ import javax.mail.MessagingException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Controller;
@@ -63,6 +64,8 @@ public class OrderDunTask {
 	private PaymentNodeMapper	paymentNodeMapper;
 	@Autowired
 	private OrderProjectService	orderProjectService;
+	@Value(value = "${dev.name}")
+	private String devName=null;
 	@Autowired
 	private AsyncUtils	asyncUtils;
 	Logger							logger	= LoggerFactory.getLogger(OrderDunTask.class);
@@ -78,6 +81,8 @@ public class OrderDunTask {
 		updateNewOrderDun();
 		Thread.sleep(2000);
 		updateorderDun();
+		Thread.sleep(2000);
+		updatePaymentNode();
 	}
 	
 	/**
@@ -124,9 +129,7 @@ public class OrderDunTask {
   	  	  			Thread.sleep(2000);
   				}
   			}
-  			System.out.println(o.getId()+"\n"+o.getCustomizeTime()+"\n"+o.getDunType());
   	  		if (o.getDunType()==0) {
-  	  			System.out.println("======================================");
   	  		calendar2.setTime(o.getCustomizeTime());
   	  		CalendarTimeCleared(calendar);
   	  			if (calendar.equals(calendar2)) {
@@ -136,7 +139,29 @@ public class OrderDunTask {
 				
 			}
 		}
-  		LoggerUtils.debug(logger, "======================催款任务结束,付款催款开始===================");
+  		
+  		} catch (Exception e) {
+  			EmailBo emailBo = new EmailBo( "催款处理失败",  AFTConstants.ADMIN_EMAIL,  "超管", "平台",  "系统", devName+"催款处理失败");
+			try {
+				asyncUtils.send(emailBo);
+			} catch (UnsupportedEncodingException | MessagingException e1) {
+				e1.printStackTrace();
+			}
+  			LoggerUtils.error(getClass(), "=============================================");
+			LoggerUtils.error(getClass(), "新催款的信息处理失败", e);
+			LoggerUtils.error(getClass(), "=============================================");
+		}
+  	}
+	
+	
+	/**
+	 * 处理付款催款
+	 */
+	private void updatePaymentNode() {
+		LoggerUtils.debug(logger, "======================催款任务结束,付款催款开始===================");
+		Calendar calendar=Calendar.getInstance();   
+  		Calendar calendar2=Calendar.getInstance();
+  		try {
   		List<OutPaymentNode> list2=paymentNodeMapper.selectByStatus(0);
   		for (OutPaymentNode pn : list2) {
   			calendar2.setTime(pn.getCreateTime());
@@ -145,7 +170,7 @@ public class OrderDunTask {
   				CalendarTimeCleared(calendar2);
   				if (calendar.getTimeInMillis() > calendar2.getTimeInMillis()) {//当前时间大于计算后时间则触发
   					updatePaymentNode(pn);
-  	  	  			Thread.sleep(2000);
+						Thread.sleep(2000);
   				}
   			}
   			if(pn.getProjectType()==OrderDunProjectType.CS.getCode()&&pn.getDunType()==2) {
@@ -169,68 +194,11 @@ public class OrderDunTask {
   	  				updatePaymentNode(pn);
 	  	  			Thread.sleep(2000);
 				}
-				
-			}
+  	  		}
+  		}
+  		} catch (InterruptedException e) {
+  			LoggerUtils.error(getClass(), "===========================付款催款失败==========================", e);
 		}
-  		} catch (Exception e) {
-  			EmailBo emailBo = new EmailBo( "催款处理失败",  AFTConstants.ADMIN_EMAIL,  "超管", "平台",  "系统", "催款处理失败");
-			try {
-				asyncUtils.send(emailBo);
-			} catch (UnsupportedEncodingException | MessagingException e1) {
-				e1.printStackTrace();
-			}
-  			LoggerUtils.error(getClass(), "=============================================");
-			LoggerUtils.error(getClass(), "新催款的信息处理失败", e);
-			LoggerUtils.error(getClass(), "=============================================");
-		}
-  	
-  		//处理旧催款
-  		updateorderDun();
-  		
-  	}
-	
-	
-	private void updatePaymentNode(OutPaymentNode pn) {
-		PaymentNode p=new PaymentNode();
-		p.setId(pn.getId());
-		p.setDunStatus(1);
-		p.setStartTime(new Date());
-		paymentNodeMapper.updateByPrimaryKeySelective(p);
-		orderProjectService.addNoticAndEmail(pn,NoticeStatus.PAYMENT_DUN.getCode());
-	}
-	
-	
-
-
-	private void CalendarTimeCleared(Calendar calendar) {
-		calendar.set(Calendar.HOUR_OF_DAY, 0);
-	    calendar.set(Calendar.MINUTE, 0);
-	    calendar.set(Calendar.SECOND, 0);
-	    calendar.set(Calendar.MILLISECOND, 0);
-	}
-
-
-	private void updateOrderDun(OutNewOrderDunBo t) throws UnsupportedEncodingException, MessagingException {
-		InputNewOrderDunBo o=new InputNewOrderDunBo();
-		o.setId(t.getId());
-		o.setStatus(1);
-		o.setStartTime(new Date());
-		newOrderDunService.updateDun(o);
-		tOrderMidMapper.addOrderReceivables(t.getOrderNo(),t.getMoney());
-		TOrderMid tm=tOrderMidMapper.selectByOrderNo(t.getOrderNo());
-			TArrearsDun td=new TArrearsDun();
-			td.setOrderArrears(tm.getOrderArrears());
-			td.setOrderReceivables(tm.getOrderReceivables());
-			if (tArrearsDunMapper.checkOrderNo(t.getOrderNo(),null)<1) {
-				td.setOrderNo(t.getOrderNo());
-				tArrearsDunMapper.insertSelective(td);
-			}else if(tArrearsDunMapper.checkOrderNo(t.getOrderNo(),0)>0){
-				Integer i=tArrearsDunMapper.selectByStatus(t.getOrderNo(), 0);
-				td.setId(i);
-				tArrearsDunMapper.updateByPrimaryKeySelective(td);
-			}
-		TOrderNew t2=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());
-		orderNewService.addTimingTaskNewDunNoticAndSendEmail(t2, t);
 	}
 	
 	/**
@@ -313,26 +281,10 @@ public class OrderDunTask {
 		}
 	}
 	
-	
-	private void addNotic(String orderNo, TArrearsDun td, Integer code) throws UnsupportedEncodingException, MessagingException {
-		TOrderNewBo b  = tOrderNewMapper.getSaleIdByOno(orderNo);
-			String str=NoticeStatus.getValueByCode(code)+": 订单编号 -"+orderNo+", 操作人: 平台超管中心 - yxy。";
-			Notice n =new Notice();
-			n.setId(UUID.randomUUID().toString());
-			n.setAid(b.getSalesmanId());
-			n.setNoticeType(code);
-			n.setContent(str);
-			n.setReaded(0);//未读
-			asyncUtils.addNotice(n);
-	}
-
-
 	/**
-	*
+	*	旧催款处理
 	*
 	*/
-//	@RequestMapping(value = "/open/updateOrderDun", method = RequestMethod.GET)
-//	@Scheduled(cron = "0 0 2  * * ?") 
   	@Transactional(rollbackFor=Exception.class)
 	public void updateorderDun(){
   		try {
@@ -358,6 +310,70 @@ public class OrderDunTask {
 		}
   		
   	}
+	
+	
+	
+	private void updatePaymentNode(OutPaymentNode pn) {
+		PaymentNode p=new PaymentNode();
+		p.setId(pn.getId());
+		p.setDunStatus(1);
+		p.setStartTime(new Date());
+		paymentNodeMapper.updateByPrimaryKeySelective(p);
+		orderProjectService.addNoticAndEmail(pn,NoticeStatus.PAYMENT_DUN.getCode());
+	}
+	
+	
+
+
+	private void CalendarTimeCleared(Calendar calendar) {
+		calendar.set(Calendar.HOUR_OF_DAY, 0);
+	    calendar.set(Calendar.MINUTE, 0);
+	    calendar.set(Calendar.SECOND, 0);
+	    calendar.set(Calendar.MILLISECOND, 0);
+	}
+
+
+	private void updateOrderDun(OutNewOrderDunBo t) throws UnsupportedEncodingException, MessagingException {
+		InputNewOrderDunBo o=new InputNewOrderDunBo();
+		o.setId(t.getId());
+		o.setStatus(1);
+		o.setStartTime(new Date());
+		newOrderDunService.updateDun(o);
+		tOrderMidMapper.addOrderReceivables(t.getOrderNo(),t.getMoney());
+		TOrderMid tm=tOrderMidMapper.selectByOrderNo(t.getOrderNo());
+			TArrearsDun td=new TArrearsDun();
+			td.setOrderArrears(tm.getOrderArrears());
+			td.setOrderReceivables(tm.getOrderReceivables());
+			if (tArrearsDunMapper.checkOrderNo(t.getOrderNo(),null)<1) {
+				td.setOrderNo(t.getOrderNo());
+				tArrearsDunMapper.insertSelective(td);
+			}else if(tArrearsDunMapper.checkOrderNo(t.getOrderNo(),0)>0){
+				Integer i=tArrearsDunMapper.selectByStatus(t.getOrderNo(), 0);
+				td.setId(i);
+				tArrearsDunMapper.updateByPrimaryKeySelective(td);
+			}
+		TOrderNew t2=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());
+		orderNewService.addTimingTaskNewDunNoticAndSendEmail(t2, t);
+	}
+	
+	
+	
+	
+	private void addNotic(String orderNo, TArrearsDun td, Integer code) throws UnsupportedEncodingException, MessagingException {
+		TOrderNewBo b  = tOrderNewMapper.getSaleIdByOno(orderNo);
+			String str=NoticeStatus.getValueByCode(code)+": 订单编号 -"+orderNo+", 操作人: "+b.getSalesmanName()+".";
+			LoggerUtils.debug(getClass(), "/n"+str);
+			Notice n =new Notice();
+			n.setId(UUID.randomUUID().toString());
+			n.setAid(b.getSalesmanId());
+			n.setNoticeType(code);
+			n.setContent(str);
+			n.setReaded(0);//未读
+			asyncUtils.addNotice(n);
+	}
+
+
+	
 
 
 	private void updateOrderDun(OrderDunTaskBo t) throws UnsupportedEncodingException, MessagingException {

+ 11 - 9
src/main/java/com/goafanti/common/task/PatentTask.java

@@ -130,16 +130,18 @@ public class PatentTask {
 				}else if (count > 3 && count <= 10&&p.getStatus()!=4) {
 					flag=true;
 					status = 4;
-				}else if (count == 3&&p.getStatus()!=5) {
-					flag=true;
-					status = 5;
-				}else if (count == 2&&p.getStatus()!=6) {
-					flag=true;
-					status = 6;
-				}else if (count == 1&&p.getStatus()!=7) {
-					flag=true;
-					status = 7;
 				}
+				//取消3天,2天,1天提醒
+//				else if (count == 3&&p.getStatus()!=5) {
+//					flag=true;
+//					status = 5;
+//				}else if (count == 2&&p.getStatus()!=6) {
+//					flag=true;
+//					status = 6;
+//				}else if (count == 1&&p.getStatus()!=7) {
+//					flag=true;
+//					status = 7;
+//				}
 				if (flag) {
 					Admin a = adminService.selectByPrimaryKey(p.getAid());
 					StringBuffer str2 = new StringBuffer();

+ 4 - 4
src/main/java/com/goafanti/common/task/ReleaseUserTask.java

@@ -10,6 +10,7 @@ import javax.annotation.Resource;
 import javax.mail.MessagingException;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Controller;
@@ -20,7 +21,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.bo.userDaysBo;
 import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.User;
@@ -40,9 +40,9 @@ public class ReleaseUserTask {
 	private UserService userService;
 	@Autowired
 	private AsyncUtils	asyncUtils;
+	@Value(value = "${dev.name}")
+	private String devName=null;
 	
-	@Autowired
-	private NoticeMapper	noticeMapper;
 
 	int pointsDataLimit = 50;
 
@@ -188,7 +188,7 @@ public class ReleaseUserTask {
 			Notice n = new Notice(UUID.randomUUID().toString(), new Date(), 0, "1",
 					NoticeStatus.TASK_PATENT_ERROR.getCode(), "==============客户释放失败================",null);
 			asyncUtils.addNotice(n);
-			EmailBo emailBo = new EmailBo("释放客户失败", AFTConstants.ADMIN_EMAIL, "超管", "平台", "系统", "释放客户失败");
+			EmailBo emailBo = new EmailBo("释放客户失败", AFTConstants.ADMIN_EMAIL, "超管", "平台", "系统", devName+"释放客户失败");
 			try {
 				asyncUtils.send(emailBo);
 			} catch (UnsupportedEncodingException | MessagingException e1) {

+ 2 - 0
src/main/java/com/goafanti/common/utils/DecimalCalculate.java

@@ -75,6 +75,7 @@ public class DecimalCalculate {
 	 *            表示表示需要精确到小数点以后几位。
 	 * @return 两个参数的商
 	 */
+	@SuppressWarnings("deprecation")
 	public static double div(double v1, double v2, int scale) {
 		if (scale < 0) {
 			throw new IllegalArgumentException("The scale must be a positive integer or zero");
@@ -93,6 +94,7 @@ public class DecimalCalculate {
 	 *            小数点后保留几位
 	 * @return 四舍五入后的结果
 	 */
+	@SuppressWarnings("deprecation")
 	public static double round(double v, int scale) {
 		if (scale < 0) {
 			throw new IllegalArgumentException("The scale must be a positive integer or zero");

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

@@ -22,6 +22,8 @@ public class WeChatUtils {
 	private String appId;
 	@Value(value = "${wx.appSecret}")
 	private String appSecret;
+	@Value(value = "${wx.state}")
+	private String wxState;
 	@Autowired
 	private RedisUtil redisUtil;
 	
@@ -41,12 +43,14 @@ public class WeChatUtils {
 	 * @param string 
 	 * @param date 
 	 */
-	public Integer addNotice(String openid ,Integer type, Date date, String aname,String remarks) {
+	public Integer addNotice(String openid ,Integer type,Integer id, Date date, String aname,String remarks) {
 		Map<String, Object> map=new HashMap<String, Object>();
 		String accessToken=getAccessToken();
 		String url=send_url.replace("ACCESS_TOKEN", accessToken);
 		map.put("access_token", accessToken);
 		map.put("touser", openid);
+		map.put("page", "pages/egressDetails/index?id="+id);
+		map.put("miniprogram_state", wxState);
 		if (type==1) {
 			map.put("template_id", sptz);
 			map.put("data",getData(type,date, aname,remarks));

+ 1 - 0
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -1655,6 +1655,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 				}
 				// 另外一个时间取转换时间
 				s2 = clo.getTransferTime();
+				System.out.println(clo.getName());
 				l1 = DateUtils.parseDate(s1, AFTConstants.YYYYMMDDHHMMSS).getTime();
 				l2 = DateUtils.parseDate(s2, AFTConstants.YYYYMMDDHHMMSS).getTime();
 				if (i == 0) {

+ 2 - 0
src/main/java/com/goafanti/order/bo/outOrderDunListBo.java

@@ -34,7 +34,9 @@ public class outOrderDunListBo {
 		return id;
 	}
 	public String getDunSubject() {
+		//旧催款
 		if(dunSubject!=null)return OrderDunSubject.getValueByCode(Integer.valueOf(dunSubject));
+		//新催款
 		if(getDunType()!=null&&getDunType()!=0&&getProjectType()!=null)return NewOrderDunType.getValueByCode(Integer.valueOf(""+getProjectType()+getDunType()));
 		if(getDunType()!=null&&getDunType()==0&&getProjectType()!=null)return NewOrderDunType.getValueByCode(Integer.valueOf(""+getProjectType()+getDunType()))+getCustomizeName();
 		return dunSubject;

+ 14 - 0
src/main/java/com/goafanti/patent/bo/PatentNewBo.java

@@ -17,6 +17,8 @@ public class PatentNewBo extends PatentNew{
 	private String startDate;
 	private String endDate;
 	private String departmentId;
+	private String createStart;
+	private String createEnd;
 	private String userName;
 	public String getApplyDates() {
 		return applyDates;
@@ -78,4 +80,16 @@ public class PatentNewBo extends PatentNew{
 	public void setUserName(String userName) {
 		this.userName = userName;
 	}
+	public String getCreateStart() {
+		return createStart;
+	}
+	public void setCreateStart(String createStart) {
+		this.createStart = createStart;
+	}
+	public String getCreateEnd() {
+		return createEnd;
+	}
+	public void setCreateEnd(String createEnd) {
+		this.createEnd = createEnd;
+	}
 }

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

@@ -50,6 +50,8 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		if(p.getDepartmentId()!=null)params.put("departmentId", p.getDepartmentId());
 		if(p.getStartDate()!=null)params.put("startDate", p.getStartDate());
 		if(p.getEndDate()!=null)params.put("endDate", p.getEndDate());
+		if(p.getCreateStart()!=null)params.put("createStart", p.getCreateStart());
+		if(p.getCreateEnd()!=null)params.put("createEnd", p.getCreateEnd()+" 23:59:59");
 		if(p.getType()!=null)params.put("type", p.getType());
 		params.put("aid", TokenManager.getAdminId());
 		if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.PATENT_AUDITOR)) {
@@ -59,7 +61,6 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		} else   {
 			params.put("shiro", 0);
 		}
-		System.out.println(params.get("shiro"));
 		return (Pagination<PatentNewBo>) findPage("selectPatentNewList", "selectPatentNewCount", params, pageNo,
 				pageSize);
 	}

+ 1 - 1
src/main/java/com/goafanti/admin/bo/InputPublicDtails.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.bo;
+package com.goafanti.weChat.bo;
 
 public class InputPublicDtails {
 	

+ 1 - 1
src/main/java/com/goafanti/admin/bo/InputPublicRelease.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.bo;
+package com.goafanti.weChat.bo;
 
 import com.goafanti.common.model.PublicRelease;
 

+ 75 - 0
src/main/java/com/goafanti/weChat/bo/InputPublicReleaseList.java

@@ -0,0 +1,75 @@
+package com.goafanti.weChat.bo;
+
+public class InputPublicReleaseList {
+	
+	private Integer pageSize;
+	private Integer pageNo;
+	private Integer type;
+	private String clockTime;
+//	公出时间搜索,按公出名称搜索,按审核状态搜索(审核中、已撤销、已审核),按打卡状态搜索(已打卡、未打卡)
+	private String releaseStarts;
+	private String releaseEnds;
+	private String userName;
+	private String status;
+	private String clockIn;
+	
+	
+	
+	public String getUserName() {
+		return userName;
+	}
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+	public String getStatus() {
+		return status;
+	}
+	public void setStatus(String status) {
+		this.status = status;
+	}
+	public String getClockIn() {
+		return clockIn;
+	}
+	public void setClockIn(String clockIn) {
+		this.clockIn = clockIn;
+	}
+	public Integer getPageSize() {
+		return pageSize;
+	}
+	public void setPageSize(Integer pageSize) {
+		this.pageSize = pageSize;
+	}
+	public Integer getPageNo() {
+		return pageNo;
+	}
+	public void setPageNo(Integer pageNo) {
+		this.pageNo = pageNo;
+	}
+	public Integer getType() {
+		return type;
+	}
+	public void setType(Integer type) {
+		this.type = type;
+	}
+	
+	public String getClockTime() {
+		return clockTime;
+	}
+	public void setClockTime(String clockTime) {
+		this.clockTime = clockTime;
+	}
+	public String getReleaseStarts() {
+		return releaseStarts;
+	}
+	public void setReleaseStarts(String releaseStarts) {
+		this.releaseStarts = releaseStarts;
+	}
+	public String getReleaseEnds() {
+		return releaseEnds;
+	}
+	public void setReleaseEnds(String releaseEnds) {
+		this.releaseEnds = releaseEnds;
+	}
+	
+
+}

+ 1 - 1
src/main/java/com/goafanti/admin/bo/InputPublicStatistics.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.bo;
+package com.goafanti.weChat.bo;
 
 public class InputPublicStatistics {
 	

+ 9 - 1
src/main/java/com/goafanti/admin/bo/OutPublicDtails.java

@@ -1,13 +1,21 @@
-package com.goafanti.admin.bo;
+package com.goafanti.weChat.bo;
+
+import com.goafanti.common.utils.excel.Excel;
 
 public class OutPublicDtails {
 
+	@Excel(name = "客户名称")
 	private String nickname;
 	private String userName;
+	@Excel(name = "公出申请人")
 	private String aname;
+	@Excel(name = "公出时长")
 	private String duration;
+	@Excel(name = "状态" ,readConverterExp = "0=驳回,1=待审核,2=同意,3=撤销")
 	private Integer status;
+	@Excel(name = "公出开始时间")
 	private String releaseStarts;
+	@Excel(name = "公出结束时间")
 	private String releaseEnds;
 	private String annexUrl;
 	private String photoUrl;

+ 1 - 1
src/main/java/com/goafanti/admin/bo/OutPublicRelease.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.bo;
+package com.goafanti.weChat.bo;
 
 import com.goafanti.common.model.PublicRelease;
 

+ 1 - 1
src/main/java/com/goafanti/admin/bo/OutPublicReleaseList.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.bo;
+package com.goafanti.weChat.bo;
 
 public class OutPublicReleaseList {
 	

+ 9 - 2
src/main/java/com/goafanti/admin/bo/OutPublicStatistics.java

@@ -1,13 +1,20 @@
-package com.goafanti.admin.bo;
+package com.goafanti.weChat.bo;
+
+import com.goafanti.common.utils.excel.Excel;
 
 public class OutPublicStatistics {
 
+	@Excel(name = "公出人员")
 	private String name;
 	private String aid;
+	@Excel(name = "公出次数")
 	private Integer tg;
+	@Excel(name = "总时长")
+	private Double duration;
+	@Excel(name = "未审核次数")
 	private Integer wsh;
+	@Excel(name = "驳回次数")
 	private Integer bh;
-	private Double duration;
 	public Integer getBh() {
 		return bh;
 	}

+ 1 - 1
src/main/java/com/goafanti/admin/bo/outPublicReleaseLog.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.bo;
+package com.goafanti.weChat.bo;
 
 import java.util.Date;
 

+ 34 - 6
src/main/java/com/goafanti/admin/controller/AdminReleaseApiController.java

@@ -1,22 +1,28 @@
-package com.goafanti.admin.controller;
+package com.goafanti.weChat.controller;
 
 
+import java.util.List;
+
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.goafanti.admin.bo.InputPublicDtails;
-import com.goafanti.admin.bo.InputPublicRelease;
-import com.goafanti.admin.bo.InputPublicReleaseList;
-import com.goafanti.admin.bo.InputPublicStatistics;
-import com.goafanti.admin.service.PublicReleaseService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.utils.StringUtils;
+import com.goafanti.common.utils.excel.NewExcelUtil;
+import com.goafanti.weChat.bo.InputPublicDtails;
+import com.goafanti.weChat.bo.InputPublicRelease;
+import com.goafanti.weChat.bo.InputPublicReleaseList;
+import com.goafanti.weChat.bo.InputPublicStatistics;
+import com.goafanti.weChat.bo.OutPublicDtails;
+import com.goafanti.weChat.bo.OutPublicStatistics;
+import com.goafanti.weChat.service.PublicReleaseService;
 
 @RestController
 @RequestMapping(value = "/api/admin/release")
@@ -156,6 +162,17 @@ public class AdminReleaseApiController extends CertifyApiController{
 		return res;
 	}
 	
+	/**
+	 * 公出统计导出
+	 * @return
+	 */
+	@RequestMapping(value = "/publicReleaseStatistics/export", method = RequestMethod.GET)
+	public Result publicReleaseStatisticsExport(InputPublicStatistics in,HttpServletResponse response){
+		List<OutPublicStatistics> list =publicReleaseService.publicReleaseStatisticsList(in);
+      	NewExcelUtil<OutPublicStatistics>excel=new NewExcelUtil<>(OutPublicStatistics.class);
+  		 return  excel.exportExcel(list,"公出统计列表",response);
+	}
+	
 	
 	/**
 	 * 公出详情列表
@@ -168,6 +185,17 @@ public class AdminReleaseApiController extends CertifyApiController{
 		return res;
 	}
 	
+	/**
+	 * 公出详情列表
+	 * @return
+	 */
+	@RequestMapping(value = "/publicReleaseDtails/export", method = RequestMethod.GET)
+	public Result publicReleaseListDtailsExport(InputPublicDtails in ,HttpServletResponse response){
+		List<OutPublicDtails> list=publicReleaseService.publicReleaseListDtailsList(in);
+		NewExcelUtil<OutPublicDtails>excel=new NewExcelUtil<>(OutPublicDtails.class);
+ 		 return  excel.exportExcel(list,"公出详细列表",response);
+	}
+	
 	/** 上传图片 **/
 	@RequestMapping(value = "/upload", method = RequestMethod.POST)
 	public Result uploadOrderInvoiceFile(HttpServletRequest req){

+ 13 - 7
src/main/java/com/goafanti/admin/service/PublicReleaseService.java

@@ -1,14 +1,16 @@
-package com.goafanti.admin.service;
+package com.goafanti.weChat.service;
 
 import java.util.List;
 import java.util.Map;
 
-import com.goafanti.admin.bo.InputPublicDtails;
-import com.goafanti.admin.bo.InputPublicRelease;
-import com.goafanti.admin.bo.InputPublicReleaseList;
-import com.goafanti.admin.bo.InputPublicStatistics;
-import com.goafanti.admin.bo.OutPublicRelease;
-import com.goafanti.admin.bo.outPublicReleaseLog;
+import com.goafanti.weChat.bo.InputPublicDtails;
+import com.goafanti.weChat.bo.InputPublicRelease;
+import com.goafanti.weChat.bo.InputPublicReleaseList;
+import com.goafanti.weChat.bo.InputPublicStatistics;
+import com.goafanti.weChat.bo.OutPublicDtails;
+import com.goafanti.weChat.bo.OutPublicRelease;
+import com.goafanti.weChat.bo.OutPublicStatistics;
+import com.goafanti.weChat.bo.outPublicReleaseLog;
 
 public interface PublicReleaseService {
 
@@ -36,4 +38,8 @@ public interface PublicReleaseService {
 
 	boolean checkTime(InputPublicRelease in);
 
+	List<OutPublicStatistics> publicReleaseStatisticsList(InputPublicStatistics in);
+
+	List<OutPublicDtails> publicReleaseListDtailsList(InputPublicDtails in);
+
 }

+ 65 - 19
src/main/java/com/goafanti/admin/service/impl/PublicReleaseServiceImpl.java

@@ -1,4 +1,4 @@
-package com.goafanti.admin.service.impl;
+package com.goafanti.weChat.service.impl;
 
 import java.io.UnsupportedEncodingException;
 import java.text.ParseException;
@@ -15,19 +15,10 @@ import org.springframework.stereotype.Service;
 import org.springframework.web.socket.TextMessage;
 
 import com.goafanti.admin.bo.AdminListBo;
-import com.goafanti.admin.bo.InputPublicDtails;
-import com.goafanti.admin.bo.InputPublicRelease;
-import com.goafanti.admin.bo.InputPublicReleaseList;
-import com.goafanti.admin.bo.InputPublicStatistics;
-import com.goafanti.admin.bo.OutPublicDtails;
-import com.goafanti.admin.bo.OutPublicRelease;
-import com.goafanti.admin.bo.OutPublicReleaseList;
-import com.goafanti.admin.bo.OutPublicStatistics;
-import com.goafanti.admin.bo.outPublicReleaseLog;
-import com.goafanti.admin.service.PublicReleaseService;
 import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
+import com.goafanti.common.dao.OrganizationContactBookMapper;
 import com.goafanti.common.dao.PublicReleaseLogMapper;
 import com.goafanti.common.dao.PublicReleaseMapper;
 import com.goafanti.common.dao.UserMapper;
@@ -35,6 +26,7 @@ import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Notice;
+import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.PublicRelease;
 import com.goafanti.common.model.PublicReleaseLog;
 import com.goafanti.common.model.User;
@@ -47,6 +39,16 @@ import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.FollowBusinessBo;
 import com.goafanti.customer.service.CustomerService;
+import com.goafanti.weChat.bo.InputPublicDtails;
+import com.goafanti.weChat.bo.InputPublicRelease;
+import com.goafanti.weChat.bo.InputPublicReleaseList;
+import com.goafanti.weChat.bo.InputPublicStatistics;
+import com.goafanti.weChat.bo.OutPublicDtails;
+import com.goafanti.weChat.bo.OutPublicRelease;
+import com.goafanti.weChat.bo.OutPublicReleaseList;
+import com.goafanti.weChat.bo.OutPublicStatistics;
+import com.goafanti.weChat.bo.outPublicReleaseLog;
+import com.goafanti.weChat.service.PublicReleaseService;
 import com.goafanti.core.websocket.SystemWebSocketHandler;
 
 import cn.jiguang.common.utils.StringUtils;
@@ -68,6 +70,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	@Autowired
 	private	UserMapper	userMapper;
 	@Autowired
+	private OrganizationContactBookMapper	organizationContactBookMapper;
+	@Autowired
 	private SystemWebSocketHandler	systemWebSocketHandler;
 	
 	@Override
@@ -88,7 +92,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		Map<String, Object>map=new HashMap<String, Object>();
 		map.put("id", in.getId());
 		if (openid!=null) {
-			Integer res= weChatUtils.addNotice(openid, in.getStatus(),date,my.getName(),"["+my.getName()+"]发起外出申请");
+			Integer res= weChatUtils.addNotice(openid, in.getStatus(),in.getId(),date,my.getName(),"["+my.getName()+"]发起外出申请");
 			if (res!=0) {
 				sendEmail(my, a,1);
 			}
@@ -173,9 +177,12 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		Map<String,Object> map =new HashMap<String, Object>();
 		map.put("type", in.getType()==null?0:in.getType());
 		map.put("aid", TokenManager.getAdminId());
-		if (StringUtils.isNotEmpty(in.getClockTime())) {
-			map.put("clockTime", in.getClockTime());	
-		}
+		if (StringUtils.isNotEmpty(in.getClockTime()))	map.put("clockTime", in.getClockTime());	
+		if(StringUtils.isNotEmpty(in.getReleaseStarts()))	map.put("releaseStarts", in.getReleaseStarts());
+		if(StringUtils.isNotEmpty(in.getReleaseEnds()))	map.put("publicEnd", in.getReleaseEnds()+" 23:59:59");
+		if(StringUtils.isNotEmpty(in.getUserName()))	map.put("userName", in.getUserName());
+		if(in.getStatus()!=null)	map.put("status", in.getStatus());
+		if(in.getClockIn()!=null)	map.put("clockIn", in.getClockIn());
 		return (Pagination<OutPublicReleaseList>) findPage("listPublicRelease", "countPublicRelease", map, in.getPageNo(), in.getPageSize());
 	}
 
@@ -199,17 +206,17 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		User u=userMapper.selectByPrimaryKey(use.getUid());
 		if (status==0) {
 			type=NoticeStatus.PUBLIC_RELEASE_NO.getCode();
-			content="["+u.getNickname()+"]的外出申请,未通过审核!";
+			content="["+u.getNickname()+"]公司的外出申请,未通过审核!";
 		}else if(status==2) {
 			type=NoticeStatus.PUBLIC_RELEASE_YES.getCode();
-			content="["+u.getNickname()+"]的外出申请,已通过审核!";
+			content="["+u.getNickname()+"]公司的外出申请,已通过审核!";
 		}
 		sendNoticeAndSoucket(a.getId(),type,content);
 		if (my.getOpenId()!=null) {
 			if (remarks.length()>19) {
 				remarks=remarks.substring(0, 15)+"...";	
 			}
-			Integer res=weChatUtils.addNotice(a.getOpenId(),p.getStatus(),date,my.getName(),remarks);
+			Integer res=weChatUtils.addNotice(a.getOpenId(),p.getStatus(),p.getId(),date,my.getName(),remarks);
 			if (res!=0) {
 				sendEmail( my,  a, status);
 				
@@ -230,6 +237,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	public int pushPublicReleaseClockIn(Integer id,String photoUrl) {
 		PublicRelease p=new PublicRelease();
 		PublicRelease use=publicReleaseMapper.selectByPrimaryKey(id);
+		String aid=TokenManager.getAdminId();
 		p.setId(id);
 		p.setClockIn(1);
 		p.setPhotoUrl(photoUrl);
@@ -240,6 +248,10 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			fbb.setUid(use.getUid());
 			fbb.setContactType("0");
 			fbb.setResult(use.getRemarks());
+			OrganizationContactBook ub=organizationContactBookMapper.getMajor(use.getUid(),aid);
+			if (ub !=null) {
+				fbb.setOcbId(ub.getId());
+			}
 			fbb.setFollowTime(DateUtils.formatDate(p.getClockInTime(), AFTConstants.YYYYMMDDHHMMSS));
 			String ufid=UUID.randomUUID().toString();
 			p.setUfid(ufid);
@@ -248,7 +260,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		}else {
 			str="刷新打卡";
 		}
-		PublicReleaseLog log=new PublicReleaseLog(id,TokenManager.getAdminId(),3,str,new Date());
+		PublicReleaseLog log=new PublicReleaseLog(id,aid,3,str,new Date());
 		log.setPhotoUrl(photoUrl);
 		publicReleaseLogMapper.insertSelective(log);
 		publicReleaseMapper.updateByPrimaryKeySelective(p);
@@ -287,6 +299,21 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		return (Pagination<OutPublicStatistics>) findPage("listPublicStatistics", "countPublicStatistics", map, in.getPageNo(), in.getPageSize());
 	}
 
+	
+
+	@SuppressWarnings("unchecked")
+	@Override
+	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(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());
+		if(in.getCreateEnd()!=null)map.put("createEnd", in.getCreateEnd()+" 23:59:59");
+		return (List<OutPublicStatistics>) findList("listPublicStatistics",map, in.getPageNo(), 99999);
+	}
+
 
 
 
@@ -302,6 +329,18 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		if(in.getStatus()!=null)map.put("status", in.getStatus());
 		return (Pagination<OutPublicDtails>) findPage("listPublicDtails", "countPublicDtails", map, in.getPageNo(), in.getPageSize());
 	}
+	
+	@SuppressWarnings("unchecked")
+	@Override
+	public List<OutPublicDtails> publicReleaseListDtailsList(InputPublicDtails in) {
+		Map<String,Object> map =new HashMap<String, Object>();
+		if(in.getAid()!=null)map.put("aid", in.getAid());
+		if(in.getReleaseStart()!=null)map.put("releaseStart", in.getReleaseStart());
+		if(in.getReleaseEnd()!=null)map.put("releaseEnd", in.getReleaseEnd()+" 23:59:59");
+		if(in.getUid()!=null)map.put("uid", in.getUid());
+		if(in.getStatus()!=null)map.put("status", in.getStatus());
+		return (List<OutPublicDtails>) findList("listPublicDtails", map, in.getPageNo(), 99999);
+	}
 
 
 
@@ -326,6 +365,13 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		return false;
 	}
 
+
+
+
+
+
+
+
 	
 
 	

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

@@ -1,10 +1,11 @@
+dev.name=local
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
-#本地
+#本地
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20210528?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.username=root
 jdbc.password=aftdev
@@ -55,23 +56,25 @@ session.validate.timespan=18000000
 
 app.name=AFT
 template.cacheable=false
-#最大领取客户
+#最大领取客户
 user.receive.max=10
 user.private.max=1000
-#客户提醒剩余天数
+#客户提醒剩余天数
 user_remind_days=15
 
 portal.host=//sf.jishutao.com/portal/2.0.6
 avatar.upload.host=//sb.jishutao.com/upload
-#连接开发
+#连接开发
 #static.host=//172.16.0.253/1.1.74
 #avatar.host=//172.16.0.253
 
 wx.appId=wxff2f5720ed7d7f63
 wx.appSecret=081744369d42405be58fe37f892631f7
+#developer为开发版;trial为体验版;formal为正式版;
+wx.state=trial
 
 
-
+•
 avatar.host=//static.jishutao.com
 static.host=//static.jishutao.com/1.1.75
 

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

@@ -1,3 +1,4 @@
+dev.name=test
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #\u6570\u636e\u5e93\u94fe\u63a5\uff0c
@@ -56,7 +57,7 @@ template.cacheable=false
 
 user.receive.max=10
 user.private.max=1000
-#客户释放提醒
+#客户释放提醒
 user_remind_days=15
 
 static.host=//static.jishutao.com/1.1.75
@@ -66,6 +67,8 @@ avatar.upload.host=//static.jishutao.com/upload
 
 wx.appId=wxff2f5720ed7d7f63
 wx.appSecret=081744369d42405be58fe37f892631f7
+#developer为开发版;trial为体验版;formal为正式版;
+wx.state=trial
 
 upload.path=/data/static/public/upload
 upload.private.path=/data/static/private/upload