|
|
@@ -1190,7 +1190,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public int pushExaminePublicRelease(Integer id, Integer status, String remarks,Integer examineType,Integer evaluateType) {
|
|
|
+ public Object pushExaminePublicRelease(Integer id, Integer status, String remarks,Integer examineType,Integer evaluateType) {
|
|
|
PublicRelease p=new PublicRelease();
|
|
|
Date date =new Date();
|
|
|
String aid=TokenManager.getAdminId();
|
|
|
@@ -1199,7 +1199,18 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
if (use.getStatus()!=1) {
|
|
|
throw new BusinessException("只能修改发起的状态公出");
|
|
|
}
|
|
|
- if((use.getTechStartProcess()==1||use.getTechStartProcess()==3)&&(examineType==0||examineType==1)){
|
|
|
+ //如果订单是协单审核的状态,判定应该走协单审核
|
|
|
+ if (use.getAssistProcess()>0 &&use.getAssistProcess()<5){
|
|
|
+ return updateAssistExamine(id,status,remarks,evaluateType);
|
|
|
+ }
|
|
|
+ return examinePublicRelease(id, status, remarks, examineType, evaluateType, use, aid, p, date);
|
|
|
+ }
|
|
|
+
|
|
|
+ private int examinePublicRelease(Integer id, Integer status, String remarks, Integer examineType, Integer evaluateType,
|
|
|
+ PublicRelease use, String aid, PublicRelease p, Date date) {
|
|
|
+ if((use.getTechStartProcess()==1
|
|
|
+ || use.getTechStartProcess()==3)
|
|
|
+ &&(examineType ==0|| examineType ==1)){
|
|
|
if(use.getTechStartProcess()!=0) throw new BusinessException("技术公出先需营销审核。");
|
|
|
|
|
|
}
|
|
|
@@ -1213,9 +1224,9 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
str=str.append("(").append(ad.getName()).append(")");
|
|
|
StringBuffer content=new StringBuffer().append("[").append(use.getUserNames()).append("]公司的外出申请,");
|
|
|
//上级审核
|
|
|
- if(examineType==0){
|
|
|
+ if(examineType ==0){
|
|
|
p.setStatus(status);
|
|
|
- if (status==0){
|
|
|
+ if (status ==0){
|
|
|
addpublicLog(id, status, remarks);
|
|
|
str=str.append("驳回,");
|
|
|
if (use.getAssist()==2){
|
|
|
@@ -1230,7 +1241,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
inpe.setPrid(use.getId());
|
|
|
publicExamineMapper.updateStatusByPrid(inpe);
|
|
|
}
|
|
|
- }else if(status==2){
|
|
|
+ }else if(status ==2){
|
|
|
//同意区分是1级审核还是二级审核
|
|
|
str=str.append("同意,");
|
|
|
addpublicLog(id, status, remarks);
|
|
|
@@ -1245,7 +1256,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
if (use.getAssist()==1){
|
|
|
pushPublicReleaseAssist(use, p, date, a);
|
|
|
}else if (use.getAssist()==0){
|
|
|
- publicReleaseMapper.updateStatusByMainId(3,use.getId(),null,null);
|
|
|
+ publicReleaseMapper.updateStatusByMainId(3, use.getId(),null,null);
|
|
|
}
|
|
|
addUserMidCount(id);
|
|
|
//添加审核日志,在当前时间加1秒作为显示
|
|
|
@@ -1253,7 +1264,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
date1.setTime(date1.getTime()+1000);
|
|
|
addpublicLog(id, 6, "无需二级审核直接通过",date1);
|
|
|
}else {
|
|
|
- if(use.getProcessStatus()==0||use.getProcessStatus()==1){
|
|
|
+ if(use.getProcessStatus()==0|| use.getProcessStatus()==1){
|
|
|
//一级审核
|
|
|
p.setStatus(1);
|
|
|
p.setProcessStatus(2);
|
|
|
@@ -1262,7 +1273,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
p.setAuditTime(date);
|
|
|
p.setRejectName(ad.getName());
|
|
|
for (AdminPublicReviewerBo e : adminPublicReviewerBos) {
|
|
|
- sendNoticeAndSoucket(e.getReviewerId(),status,content.toString());
|
|
|
+ sendNoticeAndSoucket(e.getReviewerId(), status,content.toString());
|
|
|
}
|
|
|
}else if (use.getProcessStatus()==2){
|
|
|
//二级审核,新增判定是否是审核人
|
|
|
@@ -1281,14 +1292,14 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
if (use.getAssist()==1){
|
|
|
pushPublicReleaseAssist(use, p, date, a);
|
|
|
}else if (use.getAssist()==0){
|
|
|
- publicReleaseMapper.updateStatusByMainId(3,use.getId(),null,null);
|
|
|
+ publicReleaseMapper.updateStatusByMainId(3, use.getId(),null,null);
|
|
|
}
|
|
|
str=str.append(remarks);
|
|
|
p.setAuditInfo(str.toString());
|
|
|
p.setAuditTime(date);
|
|
|
p.setRejectName(ad.getName());
|
|
|
addUserMidCount(id);
|
|
|
- sendNoticeAndSoucket(a.getId(),status,content.toString());
|
|
|
+ sendNoticeAndSoucket(a.getId(), status,content.toString());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1296,16 +1307,16 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
p.setAuditInfo(str.toString());
|
|
|
p.setAuditTime(date);
|
|
|
p.setRejectName(ad.getName());
|
|
|
- sendNoticeAndSoucket(a.getId(),status,content.toString());
|
|
|
+ sendNoticeAndSoucket(a.getId(), status,content.toString());
|
|
|
List<OutPublicReleaseDetails> outPublicReleaseDetails = publicReleaseDetailsMapper.selectByPrid(id);
|
|
|
//添加上级评价
|
|
|
- if (use.getProcessStatus()==1&&evaluateType==1){
|
|
|
+ if (use.getProcessStatus()==1&& evaluateType ==1){
|
|
|
addUserSuperEvaluate(remarks, outPublicReleaseDetails, date);
|
|
|
}
|
|
|
//营销员审核
|
|
|
- }else if (examineType==1){
|
|
|
+ }else if (examineType ==1){
|
|
|
//通知公出人切换成公出人审核人
|
|
|
- if (status==2){
|
|
|
+ if (status ==2){
|
|
|
if (use.getPublicType()!=1){
|
|
|
throw new BusinessException("当前状态不是客户归属人审核,请刷新页面");
|
|
|
}
|
|
|
@@ -1337,10 +1348,10 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
addpublicLog(id, status, str.toString());
|
|
|
//将信息发送给审核人
|
|
|
for (AdminPublicReviewerBo adminPublicReviewerBo : adminPublicReviewerBos) {
|
|
|
- sendNoticeAndSoucket(adminPublicReviewerBo.getReviewerId(),status,content.toString());
|
|
|
+ sendNoticeAndSoucket(adminPublicReviewerBo.getReviewerId(), status,content.toString());
|
|
|
}
|
|
|
|
|
|
- }else if (status==0){//审核驳回
|
|
|
+ }else if (status ==0){//审核驳回
|
|
|
//切换通知人公出负责人
|
|
|
a=publicAdmin;
|
|
|
str=str.append("不同意公出我的企业,").append(remarks);;
|
|
|
@@ -1350,11 +1361,11 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
p.setAuditInfo(str.toString());
|
|
|
p.setRejectName(ad.getName());
|
|
|
addpublicLog(id, 0, str.toString());
|
|
|
- sendNoticeAndSoucket(a.getId(),status,content.toString());
|
|
|
+ sendNoticeAndSoucket(a.getId(), status,content.toString());
|
|
|
}
|
|
|
- }else if (examineType==2){
|
|
|
+ }else if (examineType ==2){
|
|
|
//技术审核
|
|
|
- if (status==2){//审核通过
|
|
|
+ if (status ==2){//审核通过
|
|
|
str=str.append("同意公出我的企业,").append(remarks);
|
|
|
content=content.append("已通过审核,请尽快审核。");
|
|
|
List<PublicExamine> publicExamines = publicExamineMapper.selectByPrid(use.getId());
|
|
|
@@ -1378,11 +1389,11 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
List<AdminPublicReviewerBo> adminPublicReviewerBos = adminPublicReviewerMapper.selectByAid(a.getId());
|
|
|
adminPublicReviewerBos=adminPublicReviewerBos.stream().filter(e -> e.getType() == 0).collect(Collectors.toList());
|
|
|
for (AdminPublicReviewerBo adminPublicReviewerBo : adminPublicReviewerBos) {
|
|
|
- sendNoticeAndSoucket(adminPublicReviewerBo.getReviewerId(),status,content.toString());
|
|
|
+ sendNoticeAndSoucket(adminPublicReviewerBo.getReviewerId(), status,content.toString());
|
|
|
}
|
|
|
}
|
|
|
addpublicLog(id, status, str.toString());
|
|
|
- }else if (status==0){
|
|
|
+ }else if (status ==0){
|
|
|
//审核驳回
|
|
|
//切换通知人公出负责人
|
|
|
a=publicAdmin;
|
|
|
@@ -1393,30 +1404,30 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
p.setAuditInfo(str.toString());
|
|
|
p.setRejectName(ad.getName());
|
|
|
addpublicLog(id, 0, str.toString());
|
|
|
- sendNoticeAndSoucket(a.getId(),status,content.toString());
|
|
|
+ sendNoticeAndSoucket(a.getId(), status,content.toString());
|
|
|
}
|
|
|
}
|
|
|
AdminListBo my = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
|
|
|
- if (p.getStatus()!=null||p.getPublicType()!=null||p.getTechStartProcess()!=null){
|
|
|
+ if (p.getStatus()!=null|| p.getPublicType()!=null|| p.getTechStartProcess()!=null){
|
|
|
publicReleaseMapper.update(p);
|
|
|
}
|
|
|
//驳回业务公出,需要取消标记首次面谈,取消本次面谈项目,取消标记有效面谈
|
|
|
- if(status==0&&use.getType()==0){
|
|
|
+ if(status ==0&& use.getType()==0){
|
|
|
pushPublicInterview(use);
|
|
|
}
|
|
|
|
|
|
if (a.getOpenId()!=null) {
|
|
|
if (remarks.length()>19) {
|
|
|
- remarks=remarks.substring(0, 15)+"...";
|
|
|
+ remarks = remarks.substring(0, 15)+"...";
|
|
|
}
|
|
|
- Integer res=weChatUtils.addNotice(a.getOpenId(),status,p.getId(),date,my.getName(),remarks);
|
|
|
+ Integer res=weChatUtils.addNotice(a.getOpenId(), status, p.getId(), date,my.getName(), remarks);
|
|
|
if (res!=0) {
|
|
|
sendEmail( my, a, status);
|
|
|
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
- return 1;
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
/**
|