Procházet zdrojové kódy

非公出协单开发

anderx před 2 týdny
rodič
revize
77248c01af

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

@@ -1324,7 +1324,9 @@
             and a.type > 4
         </if>
         <if test="contentType!=null">
-            and c.content_type = #{contentType}
+            <foreach item="item" collection="contentType" >
+                and find_in_set(#{item},c.content_type) &gt;  0
+            </foreach>
         </if>
         <if test="aid !=null">
             and a.aid = #{aid}

+ 3 - 3
src/main/java/com/goafanti/weChat/bo/InputListAssist.java

@@ -11,7 +11,7 @@ public class InputListAssist {
     /**
      * 协单内容类型
      */
-    private Integer contentType;
+    private String contentType;
     /**
      * 发起人
      */
@@ -63,11 +63,11 @@ public class InputListAssist {
 
 
 
-    public Integer getContentType() {
+    public String getContentType() {
         return contentType;
     }
 
-    public void setContentType(Integer contentType) {
+    public void setContentType(String contentType) {
         this.contentType = contentType;
     }
 

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

@@ -190,12 +190,6 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		//如果是非公出协单添加协单信息
 		if (in.getType()==5){
 			addPublicAssistType(in);
-			if (StringUtils.isNotBlank(in.getAssistType())){
-				addPublicReleaseType(in.getId(),in.getAssistType());
-			}
-			if (StringUtils.isNotBlank(in.getAssistContent())){
-				addPublicCotentType(in.getId(),in.getAssistContentType());
-			}
 		}
 		if (in.getType()==1&&in.getOrderNo()!=null){
 			TOrderNew tOrderNew = tOrderNewMapper.queryById(in.getOrderNo());
@@ -718,11 +712,16 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 					}
 				}
 				PublicAssistDetails usePd = publicAssistDetailsMapper.selectByPrid(in.getId());
-				if (!in.getAssistType().equals(usePd.getType())){
-					publicReleaseTypeMapper.deleteByPrid(in.getId());
-					if (in.getAssistType().contains(",")){
-						addPublicReleaseType(in.getId(),in.getAssistType());
-					}
+				//如果是非公出协单添加协单信息
+				if (in.getType()==5){
+					PublicAssistDetails publicAssistDetails = publicAssistDetailsMapper.selectById(in.getId());
+					PublicAssistDetails pad=new PublicAssistDetails();
+					pad.setId(publicAssistDetails.getId());
+					pad.setPrid(in.getId());
+					pad.setType(in.getAssistType());
+					pad.setContentType(in.getAssistContentType());
+					pad.setContent(in.getAssistContent());
+					publicAssistDetailsMapper.update(pad);
 				}
 			}else if (in.getAssist()==0){
 				publicReleaseMapper.updateAssist(in);
@@ -1774,11 +1773,14 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		//把参数放入map中
 		 params.put("startTime", in.getStartTime());
 		 params.put("endTime", in.getEndTime());
-		 params.put("contentType", in.getContentType());
+
 		 params.put("aid", in.getAid());
 		 params.put("assistAid", in.getAssistAid());
 		 params.put("uid", in.getUid());
 		 params.put("type", in.getType());
+		 if (in.getContentType() != null){
+			 params.put("contentType", in.getContentType().split(","));
+		 }
 		 if (in.getAssistType()!=null){
 			 params.put("assistType", in.getAssistType().split(","));
 		 }