|
|
@@ -4,6 +4,7 @@ import cn.jiguang.common.utils.StringUtils;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.goafanti.admin.bo.AdminListBo;
|
|
|
import com.goafanti.admin.service.DepartmentService;
|
|
|
+import com.goafanti.business.bo.InputRestrictProject;
|
|
|
import com.goafanti.common.bo.EmailBo;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.dao.*;
|
|
|
@@ -71,6 +72,9 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
@Autowired
|
|
|
private TOrderPublicReleaseCountMapper tOrderPublicReleaseCountMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RestrictProjectMapper restrictProjectMapper;
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public Map<String, Object> addPublicRelease(InputPublicRelease in) {
|
|
|
@@ -217,27 +221,30 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
//默认上级审核
|
|
|
AtomicReference<Integer> status= new AtomicReference<>(1);
|
|
|
String formatDate = DateUtils.formatDate(in.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
|
|
|
- //不是业务员
|
|
|
+ //业务公出
|
|
|
if (in.getType()==0){
|
|
|
+ //不是业务员
|
|
|
if (my.getPublicPurview()==0){
|
|
|
for (User u : users) {
|
|
|
+ //不是自己的客户
|
|
|
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) {
|
|
|
- //不是自己的企业则需要审核并设置非自己客户待审核
|
|
|
- //新增限定项目逻辑,如果是我的限定项目,则可以公出,不是则需要审核
|
|
|
- int countRestrictProject = userMapper.getCountRestrictProject(u.getId(), my.getId());
|
|
|
- if (countRestrictProject==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);
|
|
|
+ List<RestrictProject> list = restrictProjectMapper.selectListByParam(new InputRestrictProject(u.getId(), my.getId()));
|
|
|
+ StringBuffer str2 = new StringBuffer();
|
|
|
+ if (!list.isEmpty()){
|
|
|
+ String start = DateUtils.formatDate(in.getReleaseStart(), AFTConstants.MMDDHHMM);
|
|
|
+ String end = DateUtils.formatDate(in.getReleaseEnd(), AFTConstants.MMDDHHMM);
|
|
|
+ str2 = str2.append("限定项目所属人营销员").append(my.getName()).append("于")
|
|
|
+ .append(start).append("至").append(end).append("公出你的企业[").append(u.getNickname()).append("]请悉知!");
|
|
|
+ }else {
|
|
|
+ str2 = str2.append(my.getName()).append("(需审核),准备公出您的企业")
|
|
|
+ .append("[").append(u.getNickname()).append("]。");
|
|
|
+ Admin admin = adminMapper.selectByPrimaryKey(u.getAid());
|
|
|
+ addPublicExamine(in.getId(), admin);
|
|
|
+ pushNoticeAndSoucketAndEmail(my, in, date, admin, str, map);
|
|
|
+ if (in.getPublicType() == null || in.getPublicType() == 0) in.setPublicType(1);
|
|
|
+ }
|
|
|
+ sendEmailAndNoticeAndSoucket(u.getAid(), 3, str2.toString());
|
|
|
+ status.set(0);
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
@@ -411,6 +418,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
List<String> split = Arrays.asList(in.getUids().split(","));
|
|
|
List<OutPublicReleaseDetails> prList = publicReleaseDetailsMapper.selectByPrid(in.getId());
|
|
|
uses=pushPublicReleaseDetails(split,prList,use,in);
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
in.setStatus(1);
|
|
|
log.setStatus(PublicReleaseLog.states.xg.getCode());
|