Browse Source

新增撤销取消面谈项目,修改发起逻辑修改

anderx 8 months ago
parent
commit
e1ebbae4db

+ 1 - 0
src/main/java/com/goafanti/common/dao/UserArchivesInterviewMapper.java

@@ -83,5 +83,6 @@ public interface UserArchivesInterviewMapper {
     List<UserArchivesInterview> selectByIds(String[] split1);
 
     UserArchivesInterview selectByPrdid(Integer prdid);
+
 }
 

+ 1 - 1
src/main/java/com/goafanti/common/dao/UserInterviewProjectMapper.java

@@ -82,7 +82,7 @@ public interface UserInterviewProjectMapper {
 
     List<UserInterviewProjectBo> selectByAid(@Param("aid") String aid, @Param("uid") String uid);
 
-    void updateByPrdId(Integer id);
+    void updateByPrdId(@Param("id") Integer id, @Param("status") Integer status);
 
     List<UserInterviewProjectBo> selectByPrdId(Integer prdId);
 }

+ 3 - 0
src/main/java/com/goafanti/common/mapper/UserArchivesInterviewMapper.xml

@@ -118,6 +118,7 @@
         where id = #{id}
     </update>
 
+
     <!--查询指定行数据-->
     <select id="findUserArchivesInterviewList" resultMap="UserArchivesInterviewMap">
         select
@@ -271,5 +272,7 @@
         from user_archives_interview
         where prdid = #{prdid}
     </select>
+
+
 </mapper>
 

+ 3 - 4
src/main/java/com/goafanti/common/mapper/UserInterviewProjectMapper.xml

@@ -127,7 +127,6 @@
         b.bname name
         from user_interview_project a left join business_project b on a.pid=b.id
         <where>
-            and a.status=0
             <if test="id != null">
                 and id = #{id}
             </if>
@@ -219,7 +218,7 @@
     <select id="selectByAid" resultMap="ListMap">
         select
             a.id, a.uid, a.aid, a.pid, a.examine_status, a.examine_status_other, a.buy_status, a.buy_status_other,a.type,
-            b.bname name
+            b.bname name,a.status
         from user_interview_project a left join business_project b on a.pid=b.id
         <where>
             <if test="aid != null and aid != ''">
@@ -240,8 +239,8 @@
 
     <update id="updateByPrdId">
         update user_interview_project
-        set type=1,status=0
-        where prdid=#{prdid}
+        set status= #{status}
+        where prdid=#{id}
     </update>
 
 </mapper>

+ 28 - 3
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -172,7 +172,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 					}
 					//根据客户判定出来本次公出,如果有则标记有效
 					List<UserInterviewProjectBo> userInterviewProjectBos = userInterviewProjectMapper.selectByAid(null, e.getUid());
-					List<UserInterviewProjectBo> collect = userInterviewProjectBos.stream().filter(e2 -> e2.getType() == 0).collect(Collectors.toList());
+					List<UserInterviewProjectBo> collect = userInterviewProjectBos.stream().filter(e2 -> e2.getType() == 0&&e2.getStatus()==0).collect(Collectors.toList());
 					if (!collect.isEmpty()){
 						OutPublicReleaseDetails newPRD=new OutPublicReleaseDetails();
 						newPRD.setId(e.getId());
@@ -547,6 +547,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			}else {
 				in.setTechStartProcess(0);
 			}
+
 			if (in.getAssist()==1){
 				in.setAssistProcess(1);
 				//在有协单的情况下,新增是审核完成才新增,修改是审核完成才修改。
@@ -577,6 +578,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			}
 			//处理修改公出
 			pushUpdatePublic(in, uses, use, log, userNames, date, checkOrderNo);
+			//处理修改发起,将面谈信息与项目恢复
+			pushUpdatePublicInterviewAndProject( use);
 		}else {
 			List<PublicRelease> list = publicReleaseMapper.selectByMainId(in.getId(),3,null);
 			List<PublicRelease> list2 = publicReleaseMapper.selectByMainId(in.getId(),4,null);
@@ -604,6 +607,15 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		return 1;
 	}
 
+	private void pushUpdatePublicInterviewAndProject(PublicRelease use) {
+		List<PublicRelease> publicReleases = publicReleaseMapper.selectByMainId(use.getId(), null, null);
+		publicReleases.forEach(e->{
+			userInterviewProjectMapper.updateByPrdId(use.getId(), 0);
+		});
+
+
+	}
+
 	private void pushUpdatePublic(InputPublicRelease in, List<User> uses, PublicRelease use, PublicReleaseLog log, String userNames, Date date, Map checkOrderNo) {
 		if (in.getUids()!=null){
 			List<String> split = Arrays.asList(in.getUids().split(","));
@@ -1153,8 +1165,21 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	private void pushPublicInterview(PublicRelease use) {
 		List<OutPublicReleaseDetails> outPublicReleaseDetails = publicReleaseDetailsMapper.selectByPrid(use.getId());
 		for (OutPublicReleaseDetails e : outPublicReleaseDetails) {
-			//撤销后取消面谈项目
-			userInterviewProjectMapper.updateByPrdId(e.getId());
+			//撤销后取消面谈项目,如果项目已存在则不恢复,不存在则恢复
+			List<UserInterviewProjectBo> prdList = userInterviewProjectMapper.selectByPrdId(e.getId());
+			List<UserInterviewProjectBo> userList = userInterviewProjectMapper.selectByAid(use.getAid(), e.getUid());
+			if (!userList.isEmpty()&& !prdList.isEmpty()){
+				prdList.forEach(e1 -> {
+					boolean flag=false;
+					userList.forEach(e2 -> {
+						//如果不是同一个面谈项目
+						if (e1.getPid().equals(e2.getPid())){
+							//是一个公出则恢复,不是则不恢复并且去掉有效
+
+						}
+					});
+				});
+			}
 			//将有效面谈去掉
 			PublicReleaseDetails p=new PublicReleaseDetails();
 			p.setInterviewStatus(0);