|
|
@@ -5,6 +5,7 @@ import java.util.*;
|
|
|
|
|
|
import com.goafanti.admin.service.DepartmentService;
|
|
|
import com.goafanti.common.dao.*;
|
|
|
+import com.goafanti.common.model.*;
|
|
|
import com.goafanti.order.service.OrderService;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -17,12 +18,6 @@ import com.goafanti.common.bo.EmailBo;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
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;
|
|
|
import com.goafanti.common.utils.AsyncUtils;
|
|
|
import com.goafanti.common.utils.DateUtils;
|
|
|
import com.goafanti.common.utils.SendEmailUtil;
|
|
|
@@ -55,7 +50,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
@Autowired
|
|
|
private CustomerService customerService;
|
|
|
@Autowired
|
|
|
- private OrderService orderService;
|
|
|
+ private PublicReleaseDetailsMapper publicReleaseDetailsMapper;
|
|
|
@Autowired
|
|
|
private WeChatUtils weChatUtils;
|
|
|
@Autowired
|
|
|
@@ -80,22 +75,34 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
in.setCreateTime(date);
|
|
|
in.setStatus(1);
|
|
|
in.setAid(TokenManager.getAdminId());
|
|
|
- in.setNewUser(0);
|
|
|
- User u=userMapper.selectByPrimaryKey(in.getUid());
|
|
|
- if (u!=null&&u.getShareType()==2){
|
|
|
- in.setNewUser(1);
|
|
|
- }
|
|
|
- if (u==null||StringUtils.isEmpty(u.getAid())||u.getAid().equals(TokenManager.getAdminId())){
|
|
|
- in.setMainStatus(1);
|
|
|
- }
|
|
|
AdminListBo my = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
|
|
|
if (in.getAssist()==1){
|
|
|
in.setAssistAidName(getAssistAidName(in.getAssistAid()));
|
|
|
in.setMainName(my.getName());
|
|
|
}
|
|
|
publicReleaseMapper.insertSelective(in);
|
|
|
+ List<PublicReleaseDetails> prdList=new ArrayList<>();
|
|
|
+ StringBuffer str =new StringBuffer();
|
|
|
+ if (in.getUids()!=null){
|
|
|
+ List<String> split = Arrays.asList(in.getUids().split(","));
|
|
|
+ for (String s : split) {
|
|
|
+ PublicReleaseDetails prd=new PublicReleaseDetails();
|
|
|
+ User u=userMapper.selectByPrimaryKey(in.getUid());
|
|
|
+ str.append(u.getNickname()).append(",");
|
|
|
+ if (u!=null&&u.getShareType()==2){
|
|
|
+ prd.setNewUser(1);
|
|
|
+ }else {
|
|
|
+ prd.setNewUser(0);
|
|
|
+ }
|
|
|
+ prd.setPrid(in.getId());
|
|
|
+ prd.setUid(s);
|
|
|
+ prd.setSignSum(0);
|
|
|
+ prdList.add(prd);
|
|
|
+ }
|
|
|
+ publicReleaseDetailsMapper.insertBatch(prdList);
|
|
|
+ }
|
|
|
addpublicLog(in.getId(), PublicReleaseLog.states.fq.getCode(), "发起外出申请");
|
|
|
- Map<String, Object> map=addPublicReleaseLog(my, in,u.getNickname(),date);
|
|
|
+ Map<String, Object> map=addPublicReleaseLog(my, in,str.substring(0,str.length()-1),date);
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
@@ -501,18 +508,22 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
p.setClockInTime(new Date());
|
|
|
String str="";
|
|
|
if (use.getClockIn()==0) {
|
|
|
- FollowBusinessBo fbb=new FollowBusinessBo();
|
|
|
- fbb.setUid(use.getUid());
|
|
|
- fbb.setContactType("5");
|
|
|
- fbb.setResult(use.getRemarks());
|
|
|
- OrganizationContactBook ub=organizationContactBookMapper.getMajor(use.getUid(),aid);
|
|
|
- if (ub !=null) {
|
|
|
- fbb.setOcbId(ub.getId());
|
|
|
+ //获取列表
|
|
|
+ List<PublicReleaseDetails> prdList = publicReleaseDetailsMapper.selectByPCid(id);
|
|
|
+ for (PublicReleaseDetails prd : prdList) {
|
|
|
+ FollowBusinessBo fbb=new FollowBusinessBo();
|
|
|
+ fbb.setUid(prd.getUid());
|
|
|
+ fbb.setContactType("5");
|
|
|
+ fbb.setResult(use.getRemarks());
|
|
|
+ OrganizationContactBook ub=organizationContactBookMapper.getMajor(prd.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);
|
|
|
+ customerService.addFollow(fbb,ufid,use.getMainStatus());
|
|
|
}
|
|
|
- fbb.setFollowTime(DateUtils.formatDate(p.getClockInTime(), AFTConstants.YYYYMMDDHHMMSS));
|
|
|
- String ufid=UUID.randomUUID().toString();
|
|
|
- p.setUfid(ufid);
|
|
|
- customerService.addFollow(fbb,ufid,use.getMainStatus());
|
|
|
if (clockIn==1)str="公出人员打卡";
|
|
|
else if(clockIn==2)str="公出人员异常打卡";
|
|
|
}else {
|