Quellcode durchsuchen

解决项目bug

lvzhikai vor 4 Jahren
Ursprung
Commit
cc0b2085ee

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

@@ -45,7 +45,7 @@ public class BusinessContractPayController {
45
 	 * 列表
45
 	 * 列表
46
 	 * @param pageNum
46
 	 * @param pageNum
47
 	 * @param pageSize
47
 	 * @param pageSize
48
-	 * @param customerBadrecord
48
+	 * @param contractPayRecevice
49
 	 * @return
49
 	 * @return
50
 	 */
50
 	 */
51
 	@RequestMapping(value="/getList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
51
 	@RequestMapping(value="/getList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
@@ -54,8 +54,9 @@ public class BusinessContractPayController {
54
    		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
54
    		@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
55
    		@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
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
 		PageInfo<BusinessContractPayRecevice> pageInfo = new PageInfo<BusinessContractPayRecevice>(list);
60
 		PageInfo<BusinessContractPayRecevice> pageInfo = new PageInfo<BusinessContractPayRecevice>(list);
60
 		return pageInfo;
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
 	 * @return
69
 	 * @return
69
 	 * @throws JsonParseException
70
 	 * @throws JsonParseException
70
 	 * @throws JsonMappingException
71
 	 * @throws JsonMappingException
@@ -84,6 +85,8 @@ public class BusinessContractPayController {
84
             ObjectMapper mapper = new ObjectMapper();
85
             ObjectMapper mapper = new ObjectMapper();
85
             BusinessContractPayRecevice contract = (BusinessContractPayRecevice)mapper.readValue(contractJson, BusinessContractPayRecevice.class);
86
             BusinessContractPayRecevice contract = (BusinessContractPayRecevice)mapper.readValue(contractJson, BusinessContractPayRecevice.class);
86
             if (contract.getId() == null) {
87
             if (contract.getId() == null) {
88
+				Integer orgId= (Integer) request.getSession().getAttribute("orgId");
89
+            	contract.setZid(orgId);
87
             	contractPayService.add(contract);
90
             	contractPayService.add(contract);
88
             } else {
91
             } else {
89
             	
92
             	

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

@@ -9,10 +9,5 @@ public interface BusinessContractPayService {
9
 	void add(BusinessContractPayRecevice contract);
9
 	void add(BusinessContractPayRecevice contract);
10
 
10
 
11
 	List<BusinessContractPayRecevice> queryByExample(Integer pageNum, Integer pageSize,
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
 	@Override
26
 	@Override
27
 	public void add(BusinessContractPayRecevice contract) {
27
 	public void add(BusinessContractPayRecevice contract) {
28
-		// TODO Auto-generated method stub
29
 		contractPayReceviceMapper.insert(contract);
28
 		contractPayReceviceMapper.insert(contract);
30
 	}
29
 	}
31
 
30
 
32
 	//列表
31
 	//列表
33
 	@Override
32
 	@Override
34
 	public List<BusinessContractPayRecevice> queryByExample(Integer pageNum, Integer pageSize,
33
 	public List<BusinessContractPayRecevice> queryByExample(Integer pageNum, Integer pageSize,
35
-			BusinessContractPayRecevice contractPayRecevice) {
36
-		// TODO Auto-generated method stub
34
+			BusinessContractPayRecevice contractPayRecevice,Integer orgId) {
37
 		BusinessContractPayReceviceExample example = new BusinessContractPayReceviceExample();
35
 		BusinessContractPayReceviceExample example = new BusinessContractPayReceviceExample();
38
         Criteria createCriteria = example.createCriteria();
36
         Criteria createCriteria = example.createCriteria();
39
         example.setOrderByClause("time desc");
37
         example.setOrderByClause("time desc");
@@ -42,6 +40,7 @@ public class BusinessContractPayServiceImpl implements BusinessContractPayServic
42
             if (StringUtils.isNotBlank(contractPayRecevice.getContractNum())) {
40
             if (StringUtils.isNotBlank(contractPayRecevice.getContractNum())) {
43
                 createCriteria.andContractNumLike("%" + contractPayRecevice.getContractNum() + "%");
41
                 createCriteria.andContractNumLike("%" + contractPayRecevice.getContractNum() + "%");
44
             }
42
             }
43
+			createCriteria.andZidEqualTo(orgId);
45
         }
44
         }
46
         // 分页.
45
         // 分页.
47
         PageHelper.startPage(pageNum, pageSize);
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
 		if (!orgId.isEmpty()) {
32
 		if (!orgId.isEmpty()) {
33
 			DataPolicyEngine.set(orgId);
33
 			DataPolicyEngine.set(orgId);
34
 			arg2.doFilter(arg0, arg1);//放行,通过了当前过滤器,递交给下一个filter进行过滤
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
 		DataPolicyEngine.remove();
40
 		DataPolicyEngine.remove();
37
 	}
41
 	}