|
|
@@ -180,34 +180,38 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
//默认上级审核
|
|
|
AtomicReference<Integer> status= new AtomicReference<>(1);
|
|
|
Map<String, Object>map=new HashMap<String, Object>();
|
|
|
- if (my.getPublicPurview()==0){
|
|
|
- users.forEach(u->{
|
|
|
- if (!u.getAid().equals(my.getId())){
|
|
|
- StringBuffer str2=new StringBuffer();
|
|
|
- str2=str2.append(my.getName()).append("(需审核),准备公出您的企业");
|
|
|
- str2=str2.append("[").append(u.getNickname()).append("]!!!。");
|
|
|
- sendEmailAndNoticeAndSoucket(u.getAid(),3,str2.toString());
|
|
|
- Admin admin = adminMapper.selectByPrimaryKey(u.getAid());
|
|
|
- if (in.getType()==0){
|
|
|
- //不是自己的企业则需要审核并设置非自己客户待审核
|
|
|
- addPublicExamine(in.getId(), admin);
|
|
|
- if(in.getPublicType()==null|| in.getPublicType()==0)in.setPublicType(1);
|
|
|
+ //不是业务员
|
|
|
+ if (in.getType()==0){
|
|
|
+ if (my.getPublicPurview()==0){
|
|
|
+ users.forEach(u->{
|
|
|
+ if (!u.getAid().equals(my.getId())){
|
|
|
+ StringBuffer str2=new StringBuffer();
|
|
|
+ str2=str2.append(my.getName()).append("(需审核),准备公出您的企业");
|
|
|
+ str2=str2.append("[").append(u.getNickname()).append("]!!!。");
|
|
|
+ sendEmailAndNoticeAndSoucket(u.getAid(),3,str2.toString());
|
|
|
+ Admin admin = adminMapper.selectByPrimaryKey(u.getAid());
|
|
|
+ if (in.getType()==0){
|
|
|
+ //不是自己的企业则需要审核并设置非自己客户待审核
|
|
|
+ addPublicExamine(in.getId(), admin);
|
|
|
+ if(in.getPublicType()==null|| in.getPublicType()==0)in.setPublicType(1);
|
|
|
+ }
|
|
|
+ pushNoticeAndSoucketAndEmail(my, in, date, admin, str, map);
|
|
|
+ status.set(0);
|
|
|
}
|
|
|
- pushNoticeAndSoucketAndEmail(my, in, date, admin, str, map);
|
|
|
- status.set(0);
|
|
|
- }
|
|
|
- });
|
|
|
- }else {
|
|
|
- users.forEach(u->{
|
|
|
- if (!u.getAid().equals(my.getId())){
|
|
|
- StringBuffer str2=new StringBuffer();
|
|
|
- str2=str2.append("业务员").append(my.getName()).append("(无需审核),准备公出您的企业");
|
|
|
- str2=str2.append("[").append(u.getNickname()).append("]!!!");
|
|
|
- sendNoticeAndSoucket(u.getAid(),3,str2.toString());
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ users.forEach(u->{
|
|
|
+ if (!u.getAid().equals(my.getId())){
|
|
|
+ StringBuffer str2=new StringBuffer();
|
|
|
+ str2=str2.append("业务员").append(my.getName()).append("(无需审核),准备公出您的企业");
|
|
|
+ str2=str2.append("[").append(u.getNickname()).append("]!!!");
|
|
|
+ sendNoticeAndSoucket(u.getAid(),3,str2.toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
if (status.get()==1){
|
|
|
pushNoticeAndSoucketAndEmail(my, in, date, a, str, map);
|
|
|
}
|
|
|
@@ -313,19 +317,26 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
}
|
|
|
List<User> uses=null;
|
|
|
PublicRelease use = publicReleaseMapper.selectByPrimaryKey(in.getId());
|
|
|
- if (in.getUids()!=null){
|
|
|
- List<String> split = Arrays.asList(in.getUids().split(","));
|
|
|
- List<OutPublicReleaseDetails> prList = publicReleaseDetailsMapper.selectByPCid(in.getId());
|
|
|
- uses=pushPublicReleaseDetails(split,prList,use,in);
|
|
|
- }
|
|
|
+
|
|
|
String userNames=publicReleaseDetailsMapper.getNamesByPrid(in.getId());
|
|
|
PublicReleaseLog log=new PublicReleaseLog(in.getId(),TokenManager.getAdminId(),null,in.getReason(),date);
|
|
|
in.setUserNames(userNames);
|
|
|
if(in.getStatus()==null||in.getStatus()!=3) {
|
|
|
+ if (in.getUids()!=null){
|
|
|
+ List<String> split = Arrays.asList(in.getUids().split(","));
|
|
|
+ List<OutPublicReleaseDetails> prList = publicReleaseDetailsMapper.selectByPCid(in.getId());
|
|
|
+ uses=pushPublicReleaseDetails(split,prList,use,in);
|
|
|
+ }
|
|
|
in.setStatus(1);
|
|
|
log.setStatus(PublicReleaseLog.states.xg.getCode());
|
|
|
in.setUpdateStatus(1);
|
|
|
- if(use.getPublicType()==2||use.getPublicType()==3){
|
|
|
+ //如果是业务切公出则撤销营销审核与审核人
|
|
|
+ if(in.getType()==1&&use.getType()==0){
|
|
|
+ in.setPublicType(0);
|
|
|
+ publicExamineMapper.deletePrid(in.getId());
|
|
|
+ }
|
|
|
+ //如果是业务公出,切审核状态为其他,则重置审核
|
|
|
+ if(in.getType()==0&&(use.getPublicType()==2||use.getPublicType()==3)){
|
|
|
in.setPublicType(1);
|
|
|
PublicExamine pe=new PublicExamine();
|
|
|
pe.setPrid(in.getId());
|
|
|
@@ -333,7 +344,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
publicExamineMapper.updatePrid(pe);
|
|
|
}
|
|
|
AdminListBo my = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
|
|
|
- //新增修改日志
|
|
|
+
|
|
|
//重新发起
|
|
|
addPublicReleaseLog(my,in,in.getUserNames(),date,uses);
|
|
|
}else {
|
|
|
@@ -446,7 +457,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
}else {
|
|
|
prd.setDuration(duration);
|
|
|
}
|
|
|
- index++;
|
|
|
+ index++;
|
|
|
if (!use.getAid().equals(u.getAid())){
|
|
|
addPublicExamine(use.getId(), u.getAid());
|
|
|
if (publicType==1)publicType=1;
|
|
|
@@ -469,8 +480,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
}else {
|
|
|
newprd.setDuration(duration);
|
|
|
}
|
|
|
- publicReleaseDetailsMapper.updateByPrimaryKeySelective(newprd);
|
|
|
index++;
|
|
|
+ publicReleaseDetailsMapper.updateByPrimaryKeySelective(newprd);
|
|
|
}
|
|
|
}
|
|
|
StringBuffer str=new StringBuffer();
|