anderx дней назад: 3
Родитель
Сommit
f57c41c0dd

+ 7 - 1
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -727,7 +727,13 @@
         </if>
     </select>
     <sql id="listPublicReleaseSql">
-        <if test="type==0">
+        <if test="type==0 or type==8 or type=9">
+            <if test="type==8">
+                and a.type=0
+            </if>
+            <if test="type==9">
+                and a.type=5
+            </if>
             and a.public_type in (0,1,2,3)
             <if test="assist ==0">
                 and a.assist in(0,1,4)

+ 18 - 1
src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java

@@ -3,11 +3,13 @@ package com.goafanti.weChat.controller;
 
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.OrderPublicReleaseLog;
 import com.goafanti.common.model.PublicConfig;
+import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.weChat.bo.*;
@@ -21,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -54,6 +57,13 @@ public class AdminReleaseApiController extends CertifyApiController{
 			res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"公出地点"));
 			return res;
 		}
+		try {
+			in.setReleaseStart(DateUtils.parseDate(in.getReleaseStarts(), AFTConstants.YYYYMMDDHHMMSS));
+			in.setReleaseEnd(DateUtils.parseDate(in.getReleaseEnds(), AFTConstants.YYYYMMDDHHMMSS));
+		} catch (ParseException e) {
+			e.printStackTrace();
+			throw new BusinessException("转换异常");
+		}
 		//新增5和6非公出协单,不用判断公出时间
 		if (in.getType()<4){
 			int i = publicReleaseService.checkTime(in);
@@ -113,7 +123,14 @@ public class AdminReleaseApiController extends CertifyApiController{
 			res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_EMPTY_ERROR,"编号"));
 			return res;
 		}
-		if (in.getStatus()!=3) {
+		try {
+			in.setReleaseStart(DateUtils.parseDate(in.getReleaseStarts(), AFTConstants.YYYYMMDDHHMMSS));
+			in.setReleaseEnd(DateUtils.parseDate(in.getReleaseEnds(), AFTConstants.YYYYMMDDHHMMSS));
+		} catch (ParseException e) {
+			e.printStackTrace();
+			throw new BusinessException("转换异常");
+		}
+		if (in.getStatus()!=3&&in.getType()<4) {
 			int i = publicReleaseService.checkTime(in);
 			if (i==1) {
 				res.getError().add(buildError("发起人公出时段已经被使用!","发起人公出时段已经被使用!"));

+ 9 - 12
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -156,7 +156,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		}
 		addPRD(in, users, str, prdList);
 		addPublicReleaseDateClock(in);
-		if (in.getType()==0&&in.getUids()!=null){
+		if ((in.getType()==0||in.getType()==5)
+				&&in.getUids()!=null){
 			pushUserArchivesInterview(in);
 		}
 		String userNames=str.substring(0,str.length()-1);
@@ -393,7 +394,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			AtomicReference<Integer> status= new AtomicReference<>(1);
 			String formatDate = DateUtils.formatDate(in.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
 			//业务公出
-			if (in.getType()==0||in.getType()==2){
+			if (in.getType()==0||in.getType()==2||in.getType()==5){
 				//不是业务员
 				if (my.getPublicPurview()==0){
                     for (User u : users) {
@@ -402,7 +403,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 							StringBuilder str2 = new StringBuilder();
 							Admin admin = adminMapper.selectById(u.getAid());
 							//业务公出限定项目直接公出,不是业务项目审核公出
-							if(in.getType()==0){
+							if(in.getType()==0||in.getType()==5){
 									List<RestrictProject> list = restrictProjectMapper.selectListByParam(new InputRestrictProject(u.getId(), my.getId()));
 									if (!list.isEmpty()){
 										String start = DateUtils.formatDate(in.getReleaseStart(), AFTConstants.MMDDHHMM);
@@ -727,7 +728,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		//如果是业务切公出则撤销营销审核与审核人
 		pushUpdateType(in, use);
 		//如果是业务公出,切审核状态为其他,则重置审核
-		if(in.getType()==0&&(use.getPublicType()==2|| use.getPublicType()==3)){
+		if((in.getType()==0||in.getType()==5)
+				&&(use.getPublicType()==2|| use.getPublicType()==3)){
 			in.setPublicType(1);
 			PublicExamine pe=new PublicExamine();
 			pe.setPrid(in.getId());
@@ -938,7 +940,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 
 
 	/**
-	 * in.type 查看类型 0我的公出 1公出审核 2管理员 3协单(技术财税总监看全部) 4 公出企业负责人审核 5 技术公出审核 6=协单审核
+	 * in.type 查看类型 0我的全部 1公出审核 2管理员 3协单(技术财税总监看全部) 4 公出企业负责人审核 5 技术公出审核
+	 * 				6=协单审核 7=最大公出审核 8=我的公出 9=非公出协单(营销) 10=非公出协单(技术)
 	 * @return
 	 */
 	@Override
@@ -2606,13 +2609,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 
 	@Override
 	public int checkTime(InputPublicRelease in) {
-		try {
-			in.setReleaseStart(DateUtils.parseDate(in.getReleaseStarts(), AFTConstants.YYYYMMDDHHMMSS));
-			in.setReleaseEnd(DateUtils.parseDate(in.getReleaseEnds(), AFTConstants.YYYYMMDDHHMMSS));
-		} catch (ParseException e) {
-			e.printStackTrace();
-			throw new BusinessException("转换异常");
-		}
+
 		//如果主协单且一起公出
 		if(in.getAssist()==1){
 			//如果一起公出先判定发起人,再判定协单人,如果只是协单公出则只需要判定协单