|
|
@@ -92,6 +92,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
private UserArchivesMapper userArchivesMapper;
|
|
|
@Autowired
|
|
|
private OrganizationIdentityMapper organizationIdentityMapper;
|
|
|
+ @Autowired
|
|
|
+ private UserSuperEvaluateMapper userSuperEvaluateMapper;
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
@@ -917,10 +919,12 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
p.setAuditTime(date);
|
|
|
p.setRejectName(ad.getName());
|
|
|
sendNoticeAndSoucket(a.getId(),status,content.toString());
|
|
|
+ List<OutPublicReleaseDetails> outPublicReleaseDetails = publicReleaseDetailsMapper.selectByPrid(id);
|
|
|
+ //添加上级评价
|
|
|
+ addUserSuperEvaluate(remarks, outPublicReleaseDetails, date);
|
|
|
//营销员审核
|
|
|
}else if (examineType==1){
|
|
|
//通知公出人切换成公出人审核人
|
|
|
-
|
|
|
if (status==2){
|
|
|
List<AdminPublicReviewerBo> adminPublicReviewerBos = adminPublicReviewerMapper.selectByAid(a.getId());
|
|
|
adminPublicReviewerBos=adminPublicReviewerBos.stream().filter(e -> e.getType() == 0).collect(Collectors.toList());
|
|
|
@@ -1026,6 +1030,25 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 添加上级评价
|
|
|
+ * @param remarks
|
|
|
+ * @param outPublicReleaseDetails
|
|
|
+ * @param date
|
|
|
+ */
|
|
|
+ private void addUserSuperEvaluate(String remarks, List<OutPublicReleaseDetails> outPublicReleaseDetails, Date date) {
|
|
|
+ List<UserSuperEvaluate> addLsit=new ArrayList<>();
|
|
|
+ for (OutPublicReleaseDetails e : outPublicReleaseDetails) {
|
|
|
+ UserSuperEvaluate addUSE=new UserSuperEvaluate();
|
|
|
+ addUSE.setAid(TokenManager.getAdminId());
|
|
|
+ addUSE.setUid(e.getUid());
|
|
|
+ addUSE.setContent(remarks);
|
|
|
+ addUSE.setCreateTime(date);
|
|
|
+ addLsit.add(addUSE);
|
|
|
+ }
|
|
|
+ userSuperEvaluateMapper.insertBatch(addLsit);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public Object updateAssistExamine(Integer id, Integer status, String remarks) {
|
|
|
@@ -1080,6 +1103,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
publicReleaseMapper.update(newPublic2);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@@ -1661,19 +1685,18 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
for (AdminPublicReviewerBo e2 : collect2) {
|
|
|
if (e2.getReviewerId().equals(aid)){
|
|
|
flag=false;
|
|
|
- flag2=true;
|
|
|
+// flag2=true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}else if(out.getType()==3){
|
|
|
- //如果是协单,如果是审核人则可以查看
|
|
|
+ //如果是协单,如果是审核人则不可以查看
|
|
|
if (adminPublicReviewerBos==null)adminPublicReviewerBos = adminPublicReviewerMapper.selectByAid(out.getAid());
|
|
|
List<AdminPublicReviewerBo> collect = adminPublicReviewerBos.stream().filter(e -> e.getType() == 1).collect(Collectors.toList());
|
|
|
for (AdminPublicReviewerBo e : collect) {
|
|
|
if (e.getReviewerId().equals(aid)){
|
|
|
flag=false;
|
|
|
- flag2=true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -1935,7 +1958,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public boolean checkTime(InputPublicRelease in) {
|
|
|
+ public int checkTime(InputPublicRelease in) {
|
|
|
try {
|
|
|
in.setReleaseStart(DateUtils.parseDate(in.getReleaseStarts(), AFTConstants.YYYYMMDDHHMMSS));
|
|
|
in.setReleaseEnd(DateUtils.parseDate(in.getReleaseEnds(), AFTConstants.YYYYMMDDHHMMSS));
|
|
|
@@ -1943,7 +1966,51 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
e.printStackTrace();
|
|
|
throw new BusinessException("转换异常");
|
|
|
}
|
|
|
- List<Integer> is=publicReleaseMapper.checkTime(TokenManager.getAdminId(),in.getReleaseStart(),in.getReleaseEnd());
|
|
|
+ //如果主协单且一起公出
|
|
|
+ if(in.getAssist()==1&&in.getAlone()==1){
|
|
|
+ //判定当前发起人能发起不
|
|
|
+ if(checkPublicTime(TokenManager.getAdminId(), in)){
|
|
|
+ //第一种,发起人时间重复
|
|
|
+ return 1;
|
|
|
+// return true;
|
|
|
+ }
|
|
|
+ String[] split = in.getAssistAid().split(",");
|
|
|
+ for (String s : split) {
|
|
|
+ if(checkPublicTime(s, in)){
|
|
|
+ //第二种,协单人时间重复
|
|
|
+ return 2;
|
|
|
+// return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if(in.getAssist()==1&&in.getAlone()==2){
|
|
|
+ String[] split = in.getAssistAid().split(",");
|
|
|
+ for (String s : split) {
|
|
|
+ if(checkPublicTime(s, in)){
|
|
|
+ //第二种,协单人时间重复
|
|
|
+ return 2;
|
|
|
+// return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //判定当前发起人能发起不
|
|
|
+ if(checkPublicTime(TokenManager.getAdminId(), in)){
|
|
|
+ //第一种,发起人时间重复
|
|
|
+ return 1;
|
|
|
+// return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param aid
|
|
|
+ * @param in
|
|
|
+ * @return true 已经发起 false 未发起
|
|
|
+ */
|
|
|
+ private boolean checkPublicTime(String aid, InputPublicRelease in) {
|
|
|
+ List<Integer> is=publicReleaseMapper.checkTime(aid,in.getReleaseStart(),in.getReleaseEnd());
|
|
|
if (is.size()>1) {
|
|
|
return true;
|
|
|
}else if(is.size()==1){
|
|
|
@@ -1984,15 +2051,20 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
long nowTime=System.currentTimeMillis();
|
|
|
long time = Math.abs(nowTime-e.getReleaseStart().getTime())/(1000*60);
|
|
|
long time2 = Math.abs(e.getReleaseEnd().getTime()-nowTime)/(1000*60);
|
|
|
+
|
|
|
//距离当前时间近的开始时间,不大于当前时间
|
|
|
if (time<count&&e.getReleaseStart().getTime()<nowTime){
|
|
|
- count=time;
|
|
|
- id=e.getId();
|
|
|
+ if (e.getAlone()!=1 && e.getAssist()!=1){
|
|
|
+ count=time;
|
|
|
+ id=e.getId();
|
|
|
+ }
|
|
|
}
|
|
|
//距离当前时间近的结束时间,不小于当前时间
|
|
|
if (time2<count&&e.getReleaseEnd().getTime()>nowTime){
|
|
|
- count=time2;
|
|
|
- id=e.getId();
|
|
|
+ if (e.getAlone()!=1 && e.getAssist()!=1){
|
|
|
+ count=time2;
|
|
|
+ id=e.getId();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (id==null)id=myPublic.get(0).getId();
|