瀏覽代碼

小程序消息推送开发

anderx 4 年之前
父節點
當前提交
ff130ca702
共有 27 個文件被更改,包括 1631 次插入721 次删除
  1. 1 1
      GeneratorConfig.xml
  2. 60 0
      src/main/java/com/goafanti/admin/bo/InputPublicDtails.java
  3. 66 0
      src/main/java/com/goafanti/admin/bo/InputPublicStatistics.java
  4. 55 0
      src/main/java/com/goafanti/admin/bo/OutPublicDtails.java
  5. 62 0
      src/main/java/com/goafanti/admin/bo/OutPublicRelease.java
  6. 42 0
      src/main/java/com/goafanti/admin/bo/OutPublicStatistics.java
  7. 2 0
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  8. 40 2
      src/main/java/com/goafanti/admin/controller/AdminReleaseApiController.java
  9. 9 0
      src/main/java/com/goafanti/admin/service/PublicReleaseService.java
  10. 77 8
      src/main/java/com/goafanti/admin/service/impl/PublicReleaseServiceImpl.java
  11. 10 4
      src/main/java/com/goafanti/common/controller/PublicController.java
  12. 55 0
      src/main/java/com/goafanti/common/dao/PublicReleaseCountMapper.java
  13. 44 55
      src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java
  14. 4 0
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml
  15. 164 0
      src/main/java/com/goafanti/common/mapper/PublicReleaseCountMapper.xml
  16. 130 15
      src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml
  17. 1 2
      src/main/java/com/goafanti/common/model/Admin.java
  18. 477 602
      src/main/java/com/goafanti/common/model/PublicRelease.java
  19. 269 0
      src/main/java/com/goafanti/common/model/PublicReleaseCount.java
  20. 49 26
      src/main/java/com/goafanti/common/utils/AsyncUtils.java
  21. 2 0
      src/main/java/com/goafanti/common/utils/DateUtils.java
  22. 3 2
      src/main/java/com/goafanti/core/shiro/session/CustomSessionManager.java
  23. 1 1
      src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java
  24. 1 1
      src/main/java/com/goafanti/customer/service/CustomerService.java
  25. 2 2
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  26. 2 0
      src/main/resources/props/config_local.properties
  27. 3 0
      src/main/resources/props/config_test.properties

+ 1 - 1
GeneratorConfig.xml

@@ -43,7 +43,7 @@
     <property name="enableSubPackages" value="false"/>
      <property name="nullCatalogMeansCurrent" value="true"/>
     </javaClientGenerator>
-    <table schema="aft" tableName="public_release_log"
+    <table schema="aft" tableName="public_release"
 	enableCountByExample="false" enableUpdateByExample="false"
 	enableDeleteByExample="false" enableSelectByExample="false"
 	selectByExampleQueryId="false" enableSelectByPrimaryKey="true"

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

@@ -0,0 +1,60 @@
+package com.goafanti.admin.bo;
+
+public class InputPublicDtails {
+	
+	private String releaseStart;
+	private String releaseEnd;
+	private String aid;
+	private String uid;
+	private Integer status;
+	private Integer pageSize;
+	private Integer pageNo;
+	
+	
+	
+
+	public String getAid() {
+		return aid;
+	}
+	public void setAid(String aid) {
+		this.aid = aid;
+	}
+	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 String getUid() {
+		return uid;
+	}
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+	public Integer getStatus() {
+		return status;
+	}
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+	public String getReleaseStart() {
+		return releaseStart;
+	}
+	public void setReleaseStart(String releaseStart) {
+		this.releaseStart = releaseStart;
+	}
+	public String getReleaseEnd() {
+		return releaseEnd;
+	}
+	public void setReleaseEnd(String releaseEnd) {
+		this.releaseEnd = releaseEnd;
+	}
+	
+	
+}

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

@@ -0,0 +1,66 @@
+package com.goafanti.admin.bo;
+
+public class InputPublicStatistics {
+	
+	private String clockStart;
+	private String clockEnd;
+	private String createStart;
+	private String createEnd;
+	private String aid;
+	private String depId;
+	private Integer pageSize;
+	private Integer pageNo;
+	
+	
+	
+	public String getClockStart() {
+		return clockStart;
+	}
+	public void setClockStart(String clockStart) {
+		this.clockStart = clockStart;
+	}
+	public String getClockEnd() {
+		return clockEnd;
+	}
+	public void setClockEnd(String clockEnd) {
+		this.clockEnd = clockEnd;
+	}
+	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;
+	}
+	public String getAid() {
+		return aid;
+	}
+	public void setAid(String aid) {
+		this.aid = aid;
+	}
+	public String getDepId() {
+		return depId;
+	}
+	public void setDepId(String depId) {
+		this.depId = depId;
+	}
+	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;
+	}
+	
+	
+}

+ 55 - 0
src/main/java/com/goafanti/admin/bo/OutPublicDtails.java

@@ -0,0 +1,55 @@
+package com.goafanti.admin.bo;
+
+public class OutPublicDtails {
+
+	private String nickname;
+	private String userName;
+	private String aname;
+	private String duration;
+	private String status;
+	private String releaseStarts;
+	private String releaseEnds;
+	public String getNickname() {
+		return nickname;
+	}
+	public void setNickname(String nickname) {
+		this.nickname = nickname;
+	}
+	public String getUserName() {
+		return userName;
+	}
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+	public String getAname() {
+		return aname;
+	}
+	public void setAname(String aname) {
+		this.aname = aname;
+	}
+	public String getDuration() {
+		return duration;
+	}
+	public void setDuration(String duration) {
+		this.duration = duration;
+	}
+	public String getStatus() {
+		return status;
+	}
+	public void setStatus(String status) {
+		this.status = status;
+	}
+	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;
+	}
+
+}

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

@@ -0,0 +1,62 @@
+package com.goafanti.admin.bo;
+
+public class OutPublicRelease {
+	private Integer id;
+	private String nickname;
+	private String aname;
+	private String releaseStarts;
+	private String userName;
+	private String releaseEnds;
+	private String createTimes;
+	private Integer status;
+	public Integer getId() {
+		return id;
+	}
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	public String getNickname() {
+		return nickname;
+	}
+	public void setNickname(String nickname) {
+		this.nickname = nickname;
+	}
+	public String getAname() {
+		return aname;
+	}
+	public void setAname(String aname) {
+		this.aname = aname;
+	}
+	public String getReleaseStarts() {
+		return releaseStarts;
+	}
+	public void setReleaseStarts(String releaseStarts) {
+		this.releaseStarts = releaseStarts;
+	}
+	public String getUserName() {
+		return userName;
+	}
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+	public String getReleaseEnds() {
+		return releaseEnds;
+	}
+	public void setReleaseEnds(String releaseEnds) {
+		this.releaseEnds = releaseEnds;
+	}
+	public String getCreateTimes() {
+		return createTimes;
+	}
+	public void setCreateTimes(String createTimes) {
+		this.createTimes = createTimes;
+	}
+	public Integer getStatus() {
+		return status;
+	}
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+	
+	
+}

+ 42 - 0
src/main/java/com/goafanti/admin/bo/OutPublicStatistics.java

@@ -0,0 +1,42 @@
+package com.goafanti.admin.bo;
+
+public class OutPublicStatistics {
+
+	private String name;
+	private Integer tg;
+	private Integer wsh;
+	private Integer bh;
+	private Double duration;
+	public Integer getBh() {
+		return bh;
+	}
+	public void setBh(Integer bh) {
+		this.bh = bh;
+	}
+	public Integer getWsh() {
+		return wsh;
+	}
+	public void setWsh(Integer wsh) {
+		this.wsh = wsh;
+	}
+	public Integer getTg() {
+		return tg;
+	}
+	public void setTg(Integer tg) {
+		this.tg = tg;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public Double getDuration() {
+		return duration;
+	}
+	public void setDuration(Double duration) {
+		this.duration = duration;
+	}
+	
+	
+}

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

@@ -114,6 +114,7 @@ import com.goafanti.common.model.UserAbility;
 import com.goafanti.common.model.UserIdentity;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.HttpUtils;
+import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.copyright.bo.CopyrightInfoDetail;
@@ -3057,6 +3058,7 @@ public class AdminApiController extends CertifyApiController {
 		JSONObject json= HttpUtils.httpGet(url);
 		String openid=json.getString("openid");
 		if (StringUtils.isNotBlank(openid)) {
+			LoggerUtils.debug(getClass(), "获取openid"+openid);
 			Admin a=new Admin();
 			a.setId(TokenManager.getAdminId());
 			a.setOpenId(openid);

+ 40 - 2
src/main/java/com/goafanti/admin/controller/AdminReleaseApiController.java

@@ -8,8 +8,10 @@ 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;
@@ -72,7 +74,7 @@ public class AdminReleaseApiController extends CertifyApiController{
 	}
 
 	/**
-	 * 修改外出申请
+	 * 外出打卡
 	 * @return
 	 */
 	@RequestMapping(value = "/publicReleaseClockIn", method = RequestMethod.POST)
@@ -82,6 +84,17 @@ public class AdminReleaseApiController extends CertifyApiController{
 		return res;
 	}
 	/**
+	 * 外出申请详情
+	 * @return
+	 */
+	@RequestMapping(value = "/dtails", method = RequestMethod.GET)
+	public Result publicReleaseDtails(String id){
+		Result res =new Result();
+		res.setData(publicReleaseService.publicReleaseDtails(id));
+		return res;
+	}
+	
+	/**
 	 * 外出申请列表
 	 * @return
 	 */
@@ -112,7 +125,7 @@ public class AdminReleaseApiController extends CertifyApiController{
 	}
 	
 	/**
-	 * 外出审核列表
+	 * 外出审核日志列表
 	 * @return
 	 */
 	@RequestMapping(value = "/listPublicReleaseLog", method = RequestMethod.GET)
@@ -123,6 +136,29 @@ public class AdminReleaseApiController extends CertifyApiController{
 	}
 	
 	
+	/**
+	 * 公出统计
+	 * @return
+	 */
+	@RequestMapping(value = "/publicReleaseStatistics", method = RequestMethod.GET)
+	public Result publicReleaseStatistics(InputPublicStatistics in){
+		Result res =new Result();
+		res.data(publicReleaseService.publicReleaseStatistics(in));
+		return res;
+	}
+	
+	
+	/**
+	 * 公出详情列表
+	 * @return
+	 */
+	@RequestMapping(value = "/publicReleaseDtails", method = RequestMethod.GET)
+	public Result publicReleaseListDtails(InputPublicDtails in){
+		Result res =new Result();
+		res.data(publicReleaseService.publicReleaseListDtails(in));
+		return res;
+	}
+	
 	/** 上传图片 **/
 	@RequestMapping(value = "/upload", method = RequestMethod.POST)
 	public Result uploadOrderInvoiceFile(HttpServletRequest req){
@@ -131,4 +167,6 @@ public class AdminReleaseApiController extends CertifyApiController{
 		return res;
 	}
 	
+	
+	
 }

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

@@ -2,8 +2,11 @@ package com.goafanti.admin.service;
 
 import java.util.List;
 
+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;
 
 public interface PublicReleaseService {
@@ -22,5 +25,11 @@ public interface PublicReleaseService {
 
 	int pushPublicReleaseClockIn(Integer id);
 
+	OutPublicRelease publicReleaseDtails(String id);
+
+	Object publicReleaseStatistics(InputPublicStatistics in);
+
+	Object publicReleaseListDtails(InputPublicDtails in);
+
 
 }

+ 77 - 8
src/main/java/com/goafanti/admin/service/impl/PublicReleaseServiceImpl.java

@@ -1,17 +1,24 @@
 package com.goafanti.admin.service.impl;
 
 import java.text.ParseException;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+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.constant.AFTConstants;
@@ -56,10 +63,20 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		}
 		publicReleaseMapper.insertSelectiveGetId(in);
 		String openid=adminMapper.selectByOpeid(TokenManager.getAdminId());
-		asyncUtils.addWechatNotice(openid);
-		return 1;
+		openid="ogXpy5RoYqThnr-a8_2e0W7dZuF0";
+		if (openid!=null) {
+			asyncUtils.addWechatNotice(openid, 0);
+			return 1;
+		}else {
+			//成功但是对方收不到消息
+			return 2;
+		}
 	}
 	
+
+
+	
+	
 	@Override
 	public int updatePublicRelease(InputPublicRelease in) {
 		try {
@@ -87,12 +104,24 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		PublicRelease p=new PublicRelease();
 		p.setId(id);
 		p.setStatus(status);
+		if (status==2) {
+			PublicRelease use=publicReleaseMapper.selectByPrimaryKey(id);
+			p.setDuration(getduration(use));
+		}
 		publicReleaseMapper.updateByPrimaryKeySelective(p);
 		PublicReleaseLog log=new PublicReleaseLog(id,TokenManager.getAdminId(),status,remarks,new Date());
 		publicReleaseLogMapper.insertSelective(log);
 		return 1;
 	}
 
+	private Double getduration(PublicRelease in) {
+		Calendar start=Calendar.getInstance();
+		Calendar end=Calendar.getInstance();
+		
+		 Integer i=(int) (in.getReleaseEnd().getTime()-in.getReleaseStart().getTime())/(1000*60*30);
+		return i*0.5;
+	}
+	
 	@Override
 	public List<outPublicReleaseLog> listPublicReleaseLog(Integer id) {
 		return publicReleaseLogMapper.listPublicReleaseLog(id);
@@ -105,16 +134,56 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		p.setId(id);
 		p.setClockIn(1);
 		p.setClockInTime(new Date());
+		if (use.getClockIn()==0) {
+			FollowBusinessBo fbb=new FollowBusinessBo();
+			fbb.setUid(use.getUid());
+			fbb.setContactType("0");
+			fbb.setResult(use.getRemarks());
+			fbb.setFollowTime(DateUtils.formatDate(use.getClockInTime(), AFTConstants.YYYYMMDDHHMMSS));
+			String ufid=UUID.randomUUID().toString();
+			p.setUfid(ufid);
+			customerService.addFollow(fbb,ufid);
+		}
 		publicReleaseMapper.updateByPrimaryKeySelective(p);
-		FollowBusinessBo fbb=new FollowBusinessBo();
-		fbb.setUid(use.getUid());
-		fbb.setContactType("0");
-		fbb.setResult(use.getRemarks());
-		fbb.setFollowTime(DateUtils.formatDate(use.getClockInTime(), AFTConstants.YYYYMMDDHHMMSS));
-		customerService.addFollow(fbb);
 		return 1;
 	}
 
+	@Override
+	public OutPublicRelease publicReleaseDtails(String id) {
+		return	publicReleaseMapper.selectByUfid(id); 
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Object publicReleaseStatistics(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 (Pagination<OutPublicStatistics>) findPage("listPublicStatistics", "countPublicStatistics", map, in.getPageNo(), in.getPageSize());
+	}
+
+
+
+
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Object publicReleaseListDtails(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 (Pagination<OutPublicDtails>) findPage("listPublicDtails", "countPublicDtails", map, in.getPageNo(), in.getPageSize());
+	}
+
+	
+
 	
 
 

+ 10 - 4
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -43,6 +43,7 @@ import com.goafanti.common.model.User;
 import com.goafanti.common.service.DistrictGlossoryService;
 import com.goafanti.common.service.FieldGlossoryService;
 import com.goafanti.common.service.IndustryCategoryService;
+import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.MobileMessageUtils;
@@ -57,7 +58,7 @@ import com.goafanti.user.service.UserService;
 @Controller
 @Scope(value = "prototype")
 @RequestMapping("/open")
-public class PublicController extends BaseController {
+public class PublicController extends CertifyApiController {
 	@Value(value = "${accessKey}")
 	private String					accessKey			= null;
 
@@ -101,10 +102,15 @@ public class PublicController extends BaseController {
 
 	@Resource(name = "passwordUtil")
 	private PasswordUtil			passwordUtil;
-	
-	
-	
 
+	
+	/** 上传图片 **/
+	@RequestMapping(value = "/upload", method = RequestMethod.POST)
+	public Result uploadOrderInvoiceFile(HttpServletRequest req){
+		Result res = new Result();
+		res.setData(handleFile(res, "/publicRelease/", false, req, "publicRelease"));
+		return res;
+	}
 
 	/**
 	 * 获取验证码

+ 55 - 0
src/main/java/com/goafanti/common/dao/PublicReleaseCountMapper.java

@@ -0,0 +1,55 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.PublicReleaseCount;
+
+public interface PublicReleaseCountMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table public_release_count
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table public_release_count
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    int insert(PublicReleaseCount record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table public_release_count
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    int insertSelective(PublicReleaseCount record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table public_release_count
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    PublicReleaseCount selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table public_release_count
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    int updateByPrimaryKeySelective(PublicReleaseCount record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table public_release_count
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    int updateByPrimaryKey(PublicReleaseCount record);
+
+	PublicReleaseCount selectByAid(String aid);
+}

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

@@ -1,64 +1,53 @@
 package com.goafanti.common.dao;
 
-import com.goafanti.admin.bo.InputPublicRelease;
+import com.goafanti.admin.bo.OutPublicRelease;
+import com.goafanti.admin.bo.OutPublicReleaseList;
 import com.goafanti.common.model.PublicRelease;
 
 public interface PublicReleaseMapper {
     /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release
-     *
-     * @mbg.generated Tue Jun 01 11:29:31 CST 2021
-     */
-    int deleteByPrimaryKey(Integer id);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release
-     *
-     * @mbg.generated Tue Jun 01 11:29:31 CST 2021
-     */
-    int insert(PublicRelease record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release
-     *
-     * @mbg.generated Tue Jun 01 11:29:31 CST 2021
-     */
-    int insertSelective(PublicRelease record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release
-     *
-     * @mbg.generated Tue Jun 01 11:29:31 CST 2021
-     */
-    PublicRelease selectByPrimaryKey(Integer id);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release
-     *
-     * @mbg.generated Tue Jun 01 11:29:31 CST 2021
-     */
-    int updateByPrimaryKeySelective(PublicRelease record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release
-     *
-     * @mbg.generated Tue Jun 01 11:29:31 CST 2021
-     */
-    int updateByPrimaryKeyWithBLOBs(PublicRelease record);
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table public_release
-     *
-     * @mbg.generated Tue Jun 01 11:29:31 CST 2021
-     */
-    int updateByPrimaryKey(PublicRelease record);
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
+	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 */
+	int deleteByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
+	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 */
+	int insert(PublicRelease record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
+	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 */
+	int insertSelective(PublicRelease record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
+	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 */
+	PublicRelease selectByPrimaryKey(Integer id);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
+	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 */
+	int updateByPrimaryKeySelective(PublicRelease record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
+	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 */
+	int updateByPrimaryKeyWithBLOBs(PublicRelease record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table public_release
+	 * @mbg.generated  Wed Jun 02 14:39:12 CST 2021
+	 */
+	int updateByPrimaryKey(PublicRelease record);
 
 	void insertSelectiveGetId(PublicRelease in);
+
+	OutPublicRelease selectByUfid(String ufid);
 }

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

@@ -476,6 +476,10 @@
       <if test="lastLoginTime != null">
         last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="openId != null">
+        open_id = #{openId},
+      </if>
+      
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>

+ 164 - 0
src/main/java/com/goafanti/common/mapper/PublicReleaseCountMapper.xml

@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.PublicReleaseCountMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.PublicReleaseCount">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Wed Jun 02 11:08:16 CST 2021.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="aid" jdbcType="VARCHAR" property="aid" />
+    <result column="count" jdbcType="INTEGER" property="count" />
+    <result column="hour" jdbcType="DOUBLE" property="hour" />
+    <result column="no_approved" jdbcType="INTEGER" property="noApproved" />
+    <result column="reject" jdbcType="INTEGER" property="reject" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Wed Jun 02 11:08:16 CST 2021.
+    -->
+    id, aid, `count`, `hour`, no_approved, reject, create_time
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Wed Jun 02 11:08:16 CST 2021.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from public_release_count
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Wed Jun 02 11:08:16 CST 2021.
+    -->
+    delete from public_release_count
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.PublicReleaseCount">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Wed Jun 02 11:08:16 CST 2021.
+    -->
+    insert into public_release_count (id, aid, `count`, 
+      `hour`, no_approved, reject, 
+      create_time)
+    values (#{id,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}, #{count,jdbcType=INTEGER}, 
+      #{hour,jdbcType=DOUBLE}, #{noApproved,jdbcType=INTEGER}, #{reject,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.PublicReleaseCount">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Wed Jun 02 11:08:16 CST 2021.
+    -->
+    insert into public_release_count
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="aid != null">
+        aid,
+      </if>
+      <if test="count != null">
+        `count`,
+      </if>
+      <if test="hour != null">
+        `hour`,
+      </if>
+      <if test="noApproved != null">
+        no_approved,
+      </if>
+      <if test="reject != null">
+        reject,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="aid != null">
+        #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="count != null">
+        #{count,jdbcType=INTEGER},
+      </if>
+      <if test="hour != null">
+        #{hour,jdbcType=DOUBLE},
+      </if>
+      <if test="noApproved != null">
+        #{noApproved,jdbcType=INTEGER},
+      </if>
+      <if test="reject != null">
+        #{reject,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicReleaseCount">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Wed Jun 02 11:08:16 CST 2021.
+    -->
+    update public_release_count
+    <set>
+      <if test="aid != null">
+        aid = #{aid,jdbcType=VARCHAR},
+      </if>
+      <if test="count != null">
+        `count` = #{count,jdbcType=INTEGER},
+      </if>
+      <if test="hour != null">
+        `hour` = #{hour,jdbcType=DOUBLE},
+      </if>
+      <if test="noApproved != null">
+        no_approved = #{noApproved,jdbcType=INTEGER},
+      </if>
+      <if test="reject != null">
+        reject = #{reject,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PublicReleaseCount">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Wed Jun 02 11:08:16 CST 2021.
+    -->
+    update public_release_count
+    set aid = #{aid,jdbcType=VARCHAR},
+      `count` = #{count,jdbcType=INTEGER},
+      `hour` = #{hour,jdbcType=DOUBLE},
+      no_approved = #{noApproved,jdbcType=INTEGER},
+      reject = #{reject,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  
+  <select id="selectByAid" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from public_release_count
+    where aid = #{aid}
+  </select>
+</mapper>

+ 130 - 15
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 11:29:31 CST 2021.
+      This element was generated on Wed Jun 02 14:39:12 CST 2021.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="uid" jdbcType="VARCHAR" property="uid" />
@@ -22,12 +22,14 @@
     <result column="clock_in_time" jdbcType="TIMESTAMP" property="clockInTime" />
     <result column="pid" jdbcType="VARCHAR" property="pid" />
     <result column="pname" jdbcType="VARCHAR" property="pname" />
+    <result column="ufid" jdbcType="VARCHAR" property="ufid" />
+    <result column="duration" jdbcType="DOUBLE" property="duration" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.PublicRelease">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 11:29:31 CST 2021.
+      This element was generated on Wed Jun 02 14:39:12 CST 2021.
     -->
     <result column="annex_url" jdbcType="LONGVARCHAR" property="annexUrl" />
     <result column="photo_url" jdbcType="LONGVARCHAR" property="photoUrl" />
@@ -36,16 +38,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 11:29:31 CST 2021.
+      This element was generated on Wed Jun 02 14:39:12 CST 2021.
     -->
     id, `uid`, aid, release_start, release_end, remarks, user_name, longitude, latitude, 
-    `status`, create_time, clock_in, clock_in_time, pid, pname
+    `status`, create_time, clock_in, clock_in_time, pid, pname, ufid, duration
   </sql>
   <sql id="Blob_Column_List">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 11:29:31 CST 2021.
+      This element was generated on Wed Jun 02 14:39:12 CST 2021.
     -->
     annex_url, photo_url
   </sql>
@@ -53,7 +55,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 11:29:31 CST 2021.
+      This element was generated on Wed Jun 02 14:39:12 CST 2021.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -66,7 +68,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 11:29:31 CST 2021.
+      This element was generated on Wed Jun 02 14:39:12 CST 2021.
     -->
     delete from public_release
     where id = #{id,jdbcType=INTEGER}
@@ -75,26 +77,28 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 11:29:31 CST 2021.
+      This element was generated on Wed Jun 02 14:39:12 CST 2021.
     -->
     insert into public_release (id, `uid`, aid, 
       release_start, release_end, remarks, 
       user_name, longitude, latitude, 
       `status`, create_time, clock_in, 
       clock_in_time, pid, pname, 
-      annex_url, photo_url)
+      ufid, duration, annex_url, 
+      photo_url)
     values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, 
       #{releaseStart,jdbcType=TIMESTAMP}, #{releaseEnd,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, 
       #{userName,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, 
       #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{clockIn,jdbcType=INTEGER}, 
       #{clockInTime,jdbcType=TIMESTAMP}, #{pid,jdbcType=VARCHAR}, #{pname,jdbcType=VARCHAR}, 
-      #{annexUrl,jdbcType=LONGVARCHAR}, #{photoUrl,jdbcType=LONGVARCHAR})
+      #{ufid,jdbcType=VARCHAR}, #{duration,jdbcType=DOUBLE}, #{annexUrl,jdbcType=LONGVARCHAR}, 
+      #{photoUrl,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.PublicRelease">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 11:29:31 CST 2021.
+      This element was generated on Wed Jun 02 14:39:12 CST 2021.
     -->
     insert into public_release
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -143,6 +147,12 @@
       <if test="pname != null">
         pname,
       </if>
+      <if test="ufid != null">
+        ufid,
+      </if>
+      <if test="duration != null">
+        duration,
+      </if>
       <if test="annexUrl != null">
         annex_url,
       </if>
@@ -196,6 +206,12 @@
       <if test="pname != null">
         #{pname,jdbcType=VARCHAR},
       </if>
+      <if test="ufid != null">
+        #{ufid,jdbcType=VARCHAR},
+      </if>
+      <if test="duration != null">
+        #{duration,jdbcType=DOUBLE},
+      </if>
       <if test="annexUrl != null">
         #{annexUrl,jdbcType=LONGVARCHAR},
       </if>
@@ -208,7 +224,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 11:29:31 CST 2021.
+      This element was generated on Wed Jun 02 14:39:12 CST 2021.
     -->
     update public_release
     <set>
@@ -254,6 +270,12 @@
       <if test="pname != null">
         pname = #{pname,jdbcType=VARCHAR},
       </if>
+      <if test="ufid != null">
+        ufid = #{ufid,jdbcType=VARCHAR},
+      </if>
+      <if test="duration != null">
+        duration = #{duration,jdbcType=DOUBLE},
+      </if>
       <if test="annexUrl != null">
         annex_url = #{annexUrl,jdbcType=LONGVARCHAR},
       </if>
@@ -267,7 +289,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 11:29:31 CST 2021.
+      This element was generated on Wed Jun 02 14:39:12 CST 2021.
     -->
     update public_release
     set `uid` = #{uid,jdbcType=VARCHAR},
@@ -284,6 +306,8 @@
       clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
       pid = #{pid,jdbcType=VARCHAR},
       pname = #{pname,jdbcType=VARCHAR},
+      ufid = #{ufid,jdbcType=VARCHAR},
+      duration = #{duration,jdbcType=DOUBLE},
       annex_url = #{annexUrl,jdbcType=LONGVARCHAR},
       photo_url = #{photoUrl,jdbcType=LONGVARCHAR}
     where id = #{id,jdbcType=INTEGER}
@@ -292,7 +316,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Tue Jun 01 11:29:31 CST 2021.
+      This element was generated on Wed Jun 02 14:39:12 CST 2021.
     -->
     update public_release
     set `uid` = #{uid,jdbcType=VARCHAR},
@@ -308,7 +332,9 @@
       clock_in = #{clockIn,jdbcType=INTEGER},
       clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
       pid = #{pid,jdbcType=VARCHAR},
-      pname = #{pname,jdbcType=VARCHAR}
+      pname = #{pname,jdbcType=VARCHAR},
+      ufid = #{ufid,jdbcType=VARCHAR},
+      duration = #{duration,jdbcType=DOUBLE}
     where id = #{id,jdbcType=INTEGER}
   </update>
   
@@ -452,4 +478,93 @@ date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create
 	and c.superior_id = #{aid}
 	</if>
   </select>
+  
+  <select id="selectByUfid" resultType="com.goafanti.admin.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
+	from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
+	where a.ufid= #{id}
+  </select>
+  
+  <select id="listPublicStatistics" resultType="com.goafanti.admin.bo.OutPublicStatistics">
+  	select if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,b.name 
+  	,sum(a.duration)duration
+    from  public_release a left join admin b on a.aid =b.id
+	where 1=1
+	<if test="aid != null">
+	and a.aid= #{aid}
+	</if>
+	<if test="clockStart != null and clockEnd != null">
+	and a.clock_in_time  between #{clockStart} and #{clockEnd}
+	</if>
+	<if test="createStart != null and createEnd !=null">
+	and a.create_time  between #{createStart} and #{createEnd}
+	</if>
+	<if test="depId != null">
+	and b.department_id = #{depId}
+	</if>
+	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  
+  <select id="countPublicStatistics" resultType="java.lang.Integer">
+  	select count(*)
+    from  public_release a left join admin b on a.aid =b.id
+	where 1=1
+	<if test="aid != null">
+	and a.aid= #{aid}
+	</if>
+	<if test="clockStart != null and clockEnd != null">
+	and a.clock_in_time  between #{clockStart} and #{clockEnd}
+	</if>
+	<if test="createStart != null and createEnd !=null">
+	and a.create_time  between #{createStart} and #{createEnd}
+	</if>
+	<if test="depId != null">
+	and b.department_id = #{depId}
+	</if>
+  </select>
+  
+  <select id="listPublicDtails" resultType="com.goafanti.admin.bo.OutPublicDtails">
+  select b.nickname ,a.user_name userName,c.name aname,a.duration ,a.status,
+	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
+	where 1=1
+	<if test="aid != null">
+	and a.aid= #{aid}
+	</if>
+	<if test="uid != null">
+	and a.uid = #{uid}
+	</if>
+	<if test="releaseStart != null and releaseEnd != null">
+	and (a.release_start  between #{releaseStart} and #{releaseEnd} or a.release_end  between #{releaseStart} and #{releaseEnd})
+	</if>
+	<if test="status != null">
+	and a.status = #{status}
+	</if>
+	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id="countPublicDtails" resultType="java.lang.Integer">
+  select count(*)
+	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="aid != null">
+	and a.aid= #{aid}
+	</if>
+	<if test="uid != null">
+	and a.uid = #{uid}
+	</if>
+	<if test="releaseStart != null and releaseEnd != null">
+	and (a.release_start  between #{releaseStart} and #{releaseEnd} or a.release_end  between #{releaseStart} and #{releaseEnd})
+	</if>
+	<if test="status != null">
+	and a.status = #{status}
+	</if>
+  </select>
+  
 </mapper>

+ 1 - 2
src/main/java/com/goafanti/common/model/Admin.java

@@ -77,7 +77,6 @@ public class Admin extends BaseModel implements AftUser {
 	/**
 	 * 用户编号
 	 */
-	@SuppressWarnings("unused")
 	private String 				userNo;
 	/**
 	 * 职务
@@ -161,7 +160,7 @@ public class Admin extends BaseModel implements AftUser {
 	}
 
 	public String getUserNo() {
-		return "";
+		return userNo;
 	}
 
 	public void setUserNo(String userNo) {

File diff suppressed because it is too large
+ 477 - 602
src/main/java/com/goafanti/common/model/PublicRelease.java


+ 269 - 0
src/main/java/com/goafanti/common/model/PublicReleaseCount.java

@@ -0,0 +1,269 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class PublicReleaseCount implements Serializable {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column public_release_count.id
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    private Integer id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column public_release_count.aid
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    private String aid;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column public_release_count.count
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    private Integer count;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column public_release_count.hour
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    private Double hour;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column public_release_count.no_approved
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    private Integer noApproved;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column public_release_count.reject
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    private Integer reject;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column public_release_count.create_time
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    private Date createTime;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table public_release_count
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column public_release_count.id
+     *
+     * @return the value of public_release_count.id
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column public_release_count.id
+     *
+     * @param id the value for public_release_count.id
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column public_release_count.aid
+     *
+     * @return the value of public_release_count.aid
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public String getAid() {
+        return aid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column public_release_count.aid
+     *
+     * @param aid the value for public_release_count.aid
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public void setAid(String aid) {
+        this.aid = aid == null ? null : aid.trim();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column public_release_count.count
+     *
+     * @return the value of public_release_count.count
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public Integer getCount() {
+        return count;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column public_release_count.count
+     *
+     * @param count the value for public_release_count.count
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public void setCount(Integer count) {
+        this.count = count;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column public_release_count.hour
+     *
+     * @return the value of public_release_count.hour
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public Double getHour() {
+        return hour;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column public_release_count.hour
+     *
+     * @param hour the value for public_release_count.hour
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public void setHour(Double hour) {
+        this.hour = hour;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column public_release_count.no_approved
+     *
+     * @return the value of public_release_count.no_approved
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public Integer getNoApproved() {
+        return noApproved;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column public_release_count.no_approved
+     *
+     * @param noApproved the value for public_release_count.no_approved
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public void setNoApproved(Integer noApproved) {
+        this.noApproved = noApproved;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column public_release_count.reject
+     *
+     * @return the value of public_release_count.reject
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public Integer getReject() {
+        return reject;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column public_release_count.reject
+     *
+     * @param reject the value for public_release_count.reject
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public void setReject(Integer reject) {
+        this.reject = reject;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column public_release_count.create_time
+     *
+     * @return the value of public_release_count.create_time
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column public_release_count.create_time
+     *
+     * @param createTime the value for public_release_count.create_time
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table public_release_count
+     *
+     * @mbg.generated Wed Jun 02 11:08:16 CST 2021
+     */
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", aid=").append(aid);
+        sb.append(", count=").append(count);
+        sb.append(", hour=").append(hour);
+        sb.append(", noApproved=").append(noApproved);
+        sb.append(", reject=").append(reject);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 49 - 26
src/main/java/com/goafanti/common/utils/AsyncUtils.java

@@ -30,6 +30,10 @@ public class AsyncUtils {
 	private String appId;
 	@Value(value = "${wx.appSecret}")
 	private String appSecret;
+	
+	private static final String sptz="Z630pmux5w-2ryn1MK3x6jZwZbxLV0_jdhOni6Wa_Yg";
+	private static final String jgtz="SLb0P5wDArFZU05iMrrnNEsXZ7H2wArqdY8__4M1NUU";
+	private static final String send_url="https://api.weixin.qq.com/cgi-bin/message/subscribe/send";
 
 	
 	public void patentSend(EmailBo bo) throws UnsupportedEncodingException, MessagingException {
@@ -56,25 +60,42 @@ public class AsyncUtils {
 	}
 
 
-	public void addWechatNotice(String openid) {
+	/**
+	 * 
+	 * @param openid
+	 * @param type 0申请 1通过 2驳回
+	 */
+	public void addWechatNotice(String openid ,Integer type) {
 		Map<String, Object> map=new HashMap<String, Object>();
-//		String accessToken=getAccessToken();
-//		map.put("accessToken", accessToken);
+		String accessToken=getAccessToken();
+		map.put("access_token", accessToken);
 		map.put("touser", openid);
 		Map<String, Object> we=new HashMap<String, Object>();
-		we.put("template_id", "Z630pmux5w-2ryn1MK3x6jZwZbxLV0_jdhOni6Wa_Yg");
-		we.put("page", "/index.html");
-		we.put("form_id", "/index.html");
-		we.put("form_id", "/index.html");
-		we.put("data", "/index.html");
-		we.put("emphasis_keyword", "/index.html");
-		
-		map.put("weapp_template_msg", we);
-		JSONObject json=HttpUtils.httpPost("https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=ACCESS_TOKEN", map);
-		
+		if (type==0) {
+			map.put("template_id", sptz);
+			Map<String, Object> v1=new HashMap<String, Object>();
+			v1.put("value","2019年10月1日");
+			we.put("date2", v1);
+			Map<String, Object> v2=new HashMap<String, Object>();
+			v2.put("value", "测试人");
+			we.put("name5", v2);
+			Map<String, Object> v3=new HashMap<String, Object>();
+			v3.put("value", "我是一个备注");
+			we.put("thing8", v3);
+		}else {
+			map.put("template_id", jgtz);
+			we.put("thing17", new HashMap<>().put("value", "通过"));
+			we.put("thing25", new HashMap<>().put("value", "我是一个备注"));
+		}
+		map.put("data", we);
+		System.out.println(JSONObject.toJSON(map));
+		JSONObject json=HttpUtils.httpPost(send_url, map);
+		System.out.println(JSONObject.toJSONString(json));
 	}
 	
-	  public String getAccessToken() {
+
+	
+	  public  String getAccessToken() {
 	    	String access_token=(String) TokenManager.getVal2Session("access_token");
 	    	String expires_in= (String) TokenManager.getVal2Session("expires_in");
 	    	if (access_token!=null&&expires_in!=null) {
@@ -83,18 +104,20 @@ public class AsyncUtils {
 	    			return access_token;
 				}
 			}
-			String url = String.format(
-					"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appId,
-					appSecret);
-			JSONObject js = HttpUtils.httpGet(url);
-			String errcode =js.getString("errcode");
-			if (errcode!=null) {
-				throw new  BusinessException("获取AccessToekn失败!");
-			}
-			access_token = js.getString("access_token");
-			expires_in = js.getString("expires_in");
-			TokenManager.setVal2Session("access_token", access_token);
-			TokenManager.setVal2Session("expires_in", expires_in);
+				String url = String.format(
+						"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appId,
+						appSecret);
+				JSONObject js = HttpUtils.httpGet(url);
+				String errcode =js.getString("errcode");
+				if (errcode!=null) {
+					throw new  BusinessException("获取AccessToken失败!");
+				}else {
+					LoggerUtils.debug(AsyncUtils.class,"获取AccessToken成功"+js.getString("access_token"));
+				}
+				access_token = js.getString("access_token");
+				expires_in = js.getString("expires_in");
+				TokenManager.setVal2Session("access_token", access_token);
+				TokenManager.setVal2Session("expires_in", expires_in);
 			return access_token;
 	    }
 }

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

@@ -7,6 +7,7 @@ import java.util.Date;
 
 
 import com.goafanti.common.error.BusinessException;
+import com.goafanti.common.model.PublicRelease;
 
 public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 
@@ -482,4 +483,5 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
     }
 
 
+	
 }

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

@@ -31,12 +31,13 @@ public class CustomSessionManager extends DefaultWebSessionManager {
 	@Override
 	protected Serializable getSessionId(ServletRequest request, ServletResponse response) {
 		String sid = request.getParameter("token");
+		HttpServletRequest rq = (HttpServletRequest) request;
+		HttpServletResponse rs = (HttpServletResponse) response;
+		if(sid==null)sid=rq.getHeader("token");
 		System.out.println("请求 token=============="+sid);
 		if (StringUtils.isNotBlank(sid)) {
 			// 是否将sid保存到cookie,浏览器模式下使用此参数。
 			if (WebUtils.isTrue(request, "AFT_SID")) {
-				HttpServletRequest rq = (HttpServletRequest) request;
-				HttpServletResponse rs = (HttpServletResponse) response;
 				Cookie template = getSessionIdCookie();
 				Cookie cookie = new SimpleCookie(template);
 				cookie.setValue(sid);

+ 1 - 1
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -450,7 +450,7 @@ public class AdminCustomerApiController extends BaseApiController{
 		fbb.setResult(result);
 		fbb.setFollowTime(followTime);
 		fbb.setUserBusinessList(list);	
-		customerService.addFollow(fbb);
+		customerService.addFollow(fbb,null);
 		return res;
 	}
 	

+ 1 - 1
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -211,7 +211,7 @@ public interface CustomerService {
 	 * 添加拜访记录
 	 * @param fbb
 	 */
-	int addFollow(FollowBusinessBo fbb) throws BusinessException;
+	int addFollow(FollowBusinessBo fbb,String ufid) throws BusinessException;
 	
 	/**
 	 * 查询拜访记录详情

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

@@ -632,11 +632,11 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 
 	@Override
 	@Transactional
-	public int addFollow(FollowBusinessBo fbb) throws BusinessException {
+	public int addFollow(FollowBusinessBo fbb,String ufid) throws BusinessException {
 		// 更新跟进记录表
 		SimpleDateFormat format = new SimpleDateFormat(AFTConstants.YYYYMMDDHHMMSS);
 		UserFollow userFollow = new UserFollow();
-		String followId = UUID.randomUUID().toString();
+		String followId = ufid==null?UUID.randomUUID().toString():ufid;
 		userFollow.setId(followId);
 		userFollow.setAid(TokenManager.getAdminId());
 		userFollow.setContactType(Integer.parseInt(fbb.getContactType()));

+ 2 - 0
src/main/resources/props/config_local.properties

@@ -69,6 +69,8 @@ avatar.upload.host=//sb.jishutao.com/upload
 
 wx.appId=wxff2f5720ed7d7f63
 wx.appSecret=9c9912bdd381f2a412a23dd560c2f77e
+
+
 avatar.host=//static.jishutao.com
 static.host=//static.jishutao.com/1.1.74

+ 3 - 0
src/main/resources/props/config_test.properties

@@ -64,6 +64,9 @@ portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload
 
+wx.appId=wxff2f5720ed7d7f63
+wx.appSecret=9c9912bdd381f2a412a23dd560c2f77e
+
 upload.path=/data/static/public/upload
 upload.private.path=/data/static/private/upload