Pārlūkot izejas kodu

解决项目bug

lvzhikai 4 gadi atpakaļ
vecāks
revīzija
cc0b2085ee

+ 7 - 4
src/main/java/com/chinaitop/depot/business/controller/BusinessContractPayController.java

@@ -45,7 +45,7 @@ public class BusinessContractPayController {
45 45
 	 * 列表
46 46
 	 * @param pageNum
47 47
 	 * @param pageSize
48
-	 * @param customerBadrecord
48
+	 * @param contractPayRecevice
49 49
 	 * @return
50 50
 	 */
51 51
 	@RequestMapping(value="/getList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
@@ -54,8 +54,9 @@ public class BusinessContractPayController {
54 54
    		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
55 55
    		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
56 56
    	})
57
-	public PageInfo<BusinessContractPayRecevice> getList(Integer pageNum, Integer pageSize,BusinessContractPayRecevice contractPayRecevice) {
58
-		List<BusinessContractPayRecevice> list = contractPayService.queryByExample(pageNum,pageSize,contractPayRecevice);	
57
+	public PageInfo<BusinessContractPayRecevice> getList(HttpServletRequest request, Integer pageNum, Integer pageSize,BusinessContractPayRecevice contractPayRecevice) {
58
+		Integer orgId= (Integer) request.getSession().getAttribute("orgId");
59
+		List<BusinessContractPayRecevice> list = contractPayService.queryByExample(pageNum,pageSize,contractPayRecevice,orgId);
59 60
 		PageInfo<BusinessContractPayRecevice> pageInfo = new PageInfo<BusinessContractPayRecevice>(list);
60 61
 		return pageInfo;
61 62
 	}
@@ -64,7 +65,7 @@ public class BusinessContractPayController {
64 65
 
65 66
 	/**
66 67
 	 * 保存
67
-	 * @param customerJson 业务数据json
68
+	 * @param contractJson 业务数据json
68 69
 	 * @return
69 70
 	 * @throws JsonParseException
70 71
 	 * @throws JsonMappingException
@@ -84,6 +85,8 @@ public class BusinessContractPayController {
84 85
             ObjectMapper mapper = new ObjectMapper();
85 86
             BusinessContractPayRecevice contract = (BusinessContractPayRecevice)mapper.readValue(contractJson, BusinessContractPayRecevice.class);
86 87
             if (contract.getId() == null) {
88
+				Integer orgId= (Integer) request.getSession().getAttribute("orgId");
89
+            	contract.setZid(orgId);
87 90
             	contractPayService.add(contract);
88 91
             } else {
89 92
             	

+ 1 - 6
src/main/java/com/chinaitop/depot/business/service/BusinessContractPayService.java

@@ -9,10 +9,5 @@ public interface BusinessContractPayService {
9 9
 	void add(BusinessContractPayRecevice contract);
10 10
 
11 11
 	List<BusinessContractPayRecevice> queryByExample(Integer pageNum, Integer pageSize,
12
-			BusinessContractPayRecevice contractPayRecevice);
13
-	
14
-	
15
-	
16
-	
17
-	
12
+			BusinessContractPayRecevice contractPayRecevice,Integer orgId);
18 13
 }

+ 2 - 3
src/main/java/com/chinaitop/depot/business/service/impl/BusinessContractPayServiceImpl.java

@@ -25,15 +25,13 @@ public class BusinessContractPayServiceImpl implements BusinessContractPayServic
25 25
 	//增加
26 26
 	@Override
27 27
 	public void add(BusinessContractPayRecevice contract) {
28
-		// TODO Auto-generated method stub
29 28
 		contractPayReceviceMapper.insert(contract);
30 29
 	}
31 30
 
32 31
 	//列表
33 32
 	@Override
34 33
 	public List<BusinessContractPayRecevice> queryByExample(Integer pageNum, Integer pageSize,
35
-			BusinessContractPayRecevice contractPayRecevice) {
36
-		// TODO Auto-generated method stub
34
+			BusinessContractPayRecevice contractPayRecevice,Integer orgId) {
37 35
 		BusinessContractPayReceviceExample example = new BusinessContractPayReceviceExample();
38 36
         Criteria createCriteria = example.createCriteria();
39 37
         example.setOrderByClause("time desc");
@@ -42,6 +40,7 @@ public class BusinessContractPayServiceImpl implements BusinessContractPayServic
42 40
             if (StringUtils.isNotBlank(contractPayRecevice.getContractNum())) {
43 41
                 createCriteria.andContractNumLike("%" + contractPayRecevice.getContractNum() + "%");
44 42
             }
43
+			createCriteria.andZidEqualTo(orgId);
45 44
         }
46 45
         // 分页.
47 46
         PageHelper.startPage(pageNum, pageSize);

+ 4 - 0
src/main/java/com/chinaitop/depot/utils/CustomFilter.java

@@ -32,6 +32,10 @@ public class CustomFilter implements Filter {
32 32
 		if (!orgId.isEmpty()) {
33 33
 			DataPolicyEngine.set(orgId);
34 34
 			arg2.doFilter(arg0, arg1);//放行,通过了当前过滤器,递交给下一个filter进行过滤
35
+		}else if ("/depot/business/plan/audit/getDataByZJId".equals(request.getServletPath())||"/business/uploadNoticeData".equals(request.getServletPath()+request.getPathInfo())
36
+				||"/business/uploadNoticeData".equals(request.getServletPath()+request.getPathInfo())||"/business/uploadContractData".equals(request.getServletPath()+request.getPathInfo())
37
+				||"/business/selectContractData".equals(request.getServletPath()+request.getPathInfo())||"/business/updateChangeStorageHouse".equals(request.getServletPath()+request.getPathInfo())) {
38
+			arg2.doFilter(arg0, arg1);//放行,通过了当前过滤器,递交给下一个filter进行过滤
35 39
 		}
36 40
 		DataPolicyEngine.remove();
37 41
 	}