Przeglądaj źródła

查询BUG修改

anderx 3 lat temu
rodzic
commit
ad02c57931

+ 6 - 12
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -738,13 +738,10 @@
     <if test="sid != null">
       and d.id= #{sid}
     </if>
-    <if test="depId != null">
-      and c.department_id = #{depId}
-    </if>
-    <if test="type==1 and deps !=null">
+    <if test="deps !=null">
        and c.department_id in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
       </foreach>
     </if>
 	<if test="uid != null">
@@ -782,13 +779,10 @@
     <if test="sid != null">
       and d.id= #{sid}
     </if>
-    <if test="depId != null">
-      and c.department_id = #{depId}
-    </if>
-    <if test="type==1 and deps !=null">
+    <if test=" deps !=null">
       and c.department_id in
-      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
-        #{deps.id}
+      <foreach close=")" collection="deps" item="dep" open="(" separator=",">
+        #{dep}
       </foreach>
     </if>
     <if test="uid != null">

+ 3 - 3
src/main/java/com/goafanti/order/bo/InputOrderInvoiceBo.java

@@ -3,7 +3,7 @@ package com.goafanti.order.bo;
 import java.util.List;
 
 public class InputOrderInvoiceBo {
-	private List<String> deps;
+	private String deps;
 	private String orderNo;
 	private String name;
 	private Integer type;
@@ -19,11 +19,11 @@ public class InputOrderInvoiceBo {
 		this.all = all;
 	}
 
-	public List<String> getDeps() {
+	public String getDeps() {
 		return deps;
 	}
 
-	public void setDeps(List<String> deps) {
+	public void setDeps(String deps) {
 		this.deps = deps;
 	}
 

+ 2 - 2
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -140,8 +140,8 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 			aDep=adminMapper.selectDepIdWithSpuerId(TokenManager.getAdminId());
 			params.put("aDep", aDep);
 		}
-		if(!o.getDeps().isEmpty()){
-			params.put("deps", o.getDeps());
+		if(o.getDeps()!=null){
+			params.put("deps", departmentService.parseArray(o.getDeps()));
 		}
 		if(o.getType()!=null)params.put("type", o.getType());
 		//营销管理员

+ 5 - 5
src/main/java/com/goafanti/weChat/bo/InputPublicDtails.java

@@ -15,7 +15,7 @@ public class InputPublicDtails {
 	 */
 	private Integer type;
 	private String sid;
-	private String depId;
+	private String deps;
 	/**
 	 * 0业务 1技术 2行政 3协单
 	 */
@@ -55,12 +55,12 @@ public class InputPublicDtails {
 		this.sid = sid;
 	}
 
-	public String getDepId() {
-		return depId;
+	public String getDeps() {
+		return deps;
 	}
 
-	public void setDepId(String depId) {
-		this.depId = depId;
+	public void setDeps(String deps) {
+		this.deps = deps;
 	}
 
 	public Integer getType() {

+ 7 - 2
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -3,6 +3,7 @@ package com.goafanti.weChat.service.impl;
 import java.text.ParseException;
 import java.util.*;
 
+import com.goafanti.admin.service.DepartmentService;
 import com.goafanti.common.dao.*;
 import com.goafanti.order.service.OrderService;
 import org.springframework.beans.BeanUtils;
@@ -69,6 +70,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	private SystemWebSocketHandler	systemWebSocketHandler;
 	@Autowired
 	private TOrderNewMapper tOrderNewMapper;
+	@Autowired
+	private DepartmentService	departmentService;
 
 	@Override
 	public Map<String, Object> addPublicRelease(InputPublicRelease in) {
@@ -606,7 +609,9 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	private void addParams(InputPublicDtails in, Map<String, Object> map) {
 		if(in.getAid()!=null) map.put("aid", in.getAid());
 		if(in.getSid()!=null) map.put("sid", in.getSid());
-		if(in.getDepId()!=null) map.put("depId", in.getDepId());
+		if(in.getDeps()!=null){
+			map.put("deps", departmentService.parseArray(in.getDeps()));
+		}
 		if(in.getReleaseStart()!=null) map.put("releaseStart", in.getReleaseStart());
 		if(in.getReleaseEnd()!=null) map.put("releaseEnd", in.getReleaseEnd()+" 23:59:59");
 		if(in.getCreateStart()!=null) map.put("createStart", in.getCreateStart());
@@ -624,7 +629,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			in.setType(2);
 		}else if(TokenManager.hasRole(AFTConstants.COMPANY_MANAGER)||TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){
 			in.setType(1);
-			map.put("deps", orderService.selectMyDeps());
+			map.put("deps", departmentService.selectMyDeps());
 		}else{
 			in.setType(0);
 			if (in.getAid()==null) map.put("aid",TokenManager.getAdminId());