|
|
@@ -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;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|