瀏覽代碼

月报表周报表增删改查

mengy 3 年之前
父節點
當前提交
98ecfa596e

+ 112 - 0
src/main/java/com/chinaitop/depot/business/controller/ReportMonthlyController.java

@@ -0,0 +1,112 @@
1
+package com.chinaitop.depot.business.controller;
2
+
3
+import com.chinaitop.depot.business.model.ReportMonthly;
4
+import com.chinaitop.depot.business.model.ReportMonthlyExample;
5
+import com.chinaitop.depot.business.service.ReportMonthlyService;
6
+import com.chinaitop.depot.utils.ParameterUtil;
7
+import com.fasterxml.jackson.databind.ObjectMapper;
8
+import com.github.pagehelper.PageHelper;
9
+import com.github.pagehelper.PageInfo;
10
+import io.swagger.annotations.ApiImplicitParam;
11
+import io.swagger.annotations.ApiImplicitParams;
12
+import io.swagger.annotations.ApiOperation;
13
+import org.springframework.http.MediaType;
14
+import org.springframework.web.bind.annotation.RequestMapping;
15
+import org.springframework.web.bind.annotation.RequestMethod;
16
+import org.springframework.web.bind.annotation.RestController;
17
+
18
+import javax.annotation.Resource;
19
+import java.io.IOException;
20
+import java.util.HashMap;
21
+import java.util.List;
22
+import java.util.Map;
23
+
24
+@RestController
25
+@RequestMapping(value="/reportMonthly")
26
+public class ReportMonthlyController {
27
+	
28
+	@Resource
29
+	private ReportMonthlyService reportMonthlyService;
30
+	
31
+	
32
+	/**
33
+	 * 查找信息
34
+	 * @return
35
+	 */
36
+	@RequestMapping(value = "/getReportMonthlyList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
37
+	@ApiOperation(value="查询月报表列表", notes = "查询月报表列表,支持分页")
38
+	@ApiImplicitParams({
39
+			@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
40
+			@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
41
+
42
+	})
43
+	public PageInfo<ReportMonthly> getReportMonthlyList(Integer pageNum, Integer pageSize, Integer houseId, Integer type, String searchStartDate, String searchEndDate){
44
+		ReportMonthlyExample example = new ReportMonthlyExample();
45
+		//ReportMonthlyExample.Criteria criteria = example.createCriteria();
46
+		if (pageNum!=null && pageSize!=null) {
47
+			PageHelper.startPage(pageNum, pageSize);
48
+		}
49
+
50
+		List<ReportMonthly> list = reportMonthlyService.queryByExample(example);
51
+		PageInfo<ReportMonthly> pageInfo = new PageInfo<ReportMonthly>(list);
52
+		return pageInfo;
53
+	}
54
+
55
+	/**
56
+	 * 获取ById
57
+	 * @return
58
+	 */
59
+	@RequestMapping(value = "/getReportMonthlyById" ,produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
60
+	@ApiOperation(value="获取ById", notes = "获取ById")
61
+	@ApiImplicitParams({
62
+			@ApiImplicitParam(name = "id", value = "id", paramType = "query"),
63
+	})
64
+	public ReportMonthly getReportMonthlyById(Integer id){
65
+		return reportMonthlyService.findById(id);
66
+	}
67
+
68
+	/**
69
+	 * 新增
70
+	 * @param reportMonthlyJson
71
+	 * @return
72
+	 */
73
+	@RequestMapping(value = "edit" ,produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
74
+	@ApiOperation(value="新增数据", notes = "新增数据")
75
+	@ApiImplicitParams({
76
+			@ApiImplicitParam(name = "paymentJson", value = "JSON数据对象", paramType = "form"),
77
+			@ApiImplicitParam(name = "orgId", value = "登陆人id", paramType = "orgId"),
78
+	})
79
+	public Map<String,String> edit(String reportMonthlyJson,Integer orgId){
80
+		ObjectMapper mapper = new ObjectMapper();
81
+		try {
82
+			ReportMonthly reportMonthly = (ReportMonthly) mapper.readValue(reportMonthlyJson, ReportMonthly.class);
83
+			reportMonthly.setOrgId(orgId);
84
+			if(ParameterUtil.isnotnull(reportMonthly.getId())){
85
+				reportMonthlyService.update(reportMonthly);
86
+			}else{
87
+				reportMonthlyService.add(reportMonthly);
88
+			}
89
+		} catch (IOException e) {
90
+			e.printStackTrace();
91
+		}
92
+		return null;
93
+	}
94
+
95
+	/**
96
+	 * 移除
97
+	 * @param id
98
+	 * @return
99
+	 */
100
+	@RequestMapping(value = "remove", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
101
+	@ApiOperation(value="按ID删除信息", notes = "按ID删除信息")
102
+	@ApiImplicitParams({
103
+			@ApiImplicitParam(name = "id", value = "数据ID", paramType = "form")
104
+	})
105
+	public Map<String,String> remove(Integer id){
106
+		Map<String,String> map = new HashMap<String, String>();
107
+		reportMonthlyService.remove(id);
108
+		map.put("status","success");
109
+		return map;
110
+	}
111
+
112
+}

+ 112 - 0
src/main/java/com/chinaitop/depot/business/controller/ReportWeeklyController.java

@@ -0,0 +1,112 @@
1
+package com.chinaitop.depot.business.controller;
2
+
3
+import com.chinaitop.depot.business.model.ReportWeekly;
4
+import com.chinaitop.depot.business.model.ReportWeeklyExample;
5
+import com.chinaitop.depot.business.service.ReportWeeklyService;
6
+import com.chinaitop.depot.utils.ParameterUtil;
7
+import com.fasterxml.jackson.databind.ObjectMapper;
8
+import com.github.pagehelper.PageHelper;
9
+import com.github.pagehelper.PageInfo;
10
+import io.swagger.annotations.ApiImplicitParam;
11
+import io.swagger.annotations.ApiImplicitParams;
12
+import io.swagger.annotations.ApiOperation;
13
+import org.springframework.http.MediaType;
14
+import org.springframework.web.bind.annotation.RequestMapping;
15
+import org.springframework.web.bind.annotation.RequestMethod;
16
+import org.springframework.web.bind.annotation.RestController;
17
+
18
+import javax.annotation.Resource;
19
+import java.io.IOException;
20
+import java.util.HashMap;
21
+import java.util.List;
22
+import java.util.Map;
23
+
24
+@RestController
25
+@RequestMapping(value="/reportWeekly")
26
+public class ReportWeeklyController {
27
+	
28
+	@Resource
29
+	private ReportWeeklyService reportWeeklyService;
30
+	
31
+	
32
+	/**
33
+	 * 查找信息
34
+	 * @return
35
+	 */
36
+	@RequestMapping(value = "/getReportWeeklyList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
37
+	@ApiOperation(value="查询周报表列表", notes = "查询周报表列表,支持分页")
38
+	@ApiImplicitParams({
39
+			@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
40
+			@ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query")
41
+
42
+	})
43
+	public PageInfo<ReportWeekly> getReportWeeklyList(Integer pageNum, Integer pageSize, Integer houseId, Integer type, String searchStartDate, String searchEndDate){
44
+		ReportWeeklyExample example = new ReportWeeklyExample();
45
+		//ReportWeeklyExample.Criteria criteria = example.createCriteria();
46
+		if (pageNum!=null && pageSize!=null) {
47
+			PageHelper.startPage(pageNum, pageSize);
48
+		}
49
+
50
+		List<ReportWeekly> list = reportWeeklyService.queryByExample(example);
51
+		PageInfo<ReportWeekly> pageInfo = new PageInfo<ReportWeekly>(list);
52
+		return pageInfo;
53
+	}
54
+
55
+	/**
56
+	 * 获取ById
57
+	 * @return
58
+	 */
59
+	@RequestMapping(value = "/getReportWeeklyById" ,produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
60
+	@ApiOperation(value="获取ById", notes = "获取ById")
61
+	@ApiImplicitParams({
62
+			@ApiImplicitParam(name = "id", value = "id", paramType = "query"),
63
+	})
64
+	public ReportWeekly getReportWeeklyById(Integer id){
65
+		return reportWeeklyService.findById(id);
66
+	}
67
+
68
+	/**
69
+	 * 新增
70
+	 * @param reportWeeklyJson
71
+	 * @return
72
+	 */
73
+	@RequestMapping(value = "edit" ,produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
74
+	@ApiOperation(value="新增数据", notes = "新增数据")
75
+	@ApiImplicitParams({
76
+			@ApiImplicitParam(name = "paymentJson", value = "JSON数据对象", paramType = "form"),
77
+			@ApiImplicitParam(name = "orgId", value = "登陆人id", paramType = "orgId"),
78
+	})
79
+	public Map<String,String> edit(String reportWeeklyJson,Integer orgId){
80
+		ObjectMapper mapper = new ObjectMapper();
81
+		try {
82
+			ReportWeekly reportWeekly = (ReportWeekly) mapper.readValue(reportWeeklyJson, ReportWeekly.class);
83
+			reportWeekly.setOrgId(orgId);
84
+			if(ParameterUtil.isnotnull(reportWeekly.getId())){
85
+				reportWeeklyService.update(reportWeekly);
86
+			}else{
87
+				reportWeeklyService.add(reportWeekly);
88
+			}
89
+		} catch (IOException e) {
90
+			e.printStackTrace();
91
+		}
92
+		return null;
93
+	}
94
+
95
+	/**
96
+	 * 移除
97
+	 * @param id
98
+	 * @return
99
+	 */
100
+	@RequestMapping(value = "remove", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
101
+	@ApiOperation(value="按ID删除信息", notes = "按ID删除信息")
102
+	@ApiImplicitParams({
103
+			@ApiImplicitParam(name = "id", value = "数据ID", paramType = "form")
104
+	})
105
+	public Map<String,String> remove(Integer id){
106
+		Map<String,String> map = new HashMap<String, String>();
107
+		reportWeeklyService.remove(id);
108
+		map.put("status","success");
109
+		return map;
110
+	}
111
+
112
+}

+ 31 - 0
src/main/java/com/chinaitop/depot/business/mapper/ReportMonthlyMapper.java

@@ -0,0 +1,31 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import java.util.List;
4
+
5
+import com.chinaitop.depot.business.model.ReportMonthly;
6
+import com.chinaitop.depot.business.model.ReportMonthlyExample;
7
+import org.apache.ibatis.annotations.Param;
8
+
9
+public interface ReportMonthlyMapper {
10
+    int countByExample(ReportMonthlyExample example);
11
+
12
+    int deleteByExample(ReportMonthlyExample example);
13
+
14
+    int deleteByPrimaryKey(Integer id);
15
+
16
+    int insert(ReportMonthly record);
17
+
18
+    int insertSelective(ReportMonthly record);
19
+
20
+    List<ReportMonthly> selectByExample(ReportMonthlyExample example);
21
+
22
+    ReportMonthly selectByPrimaryKey(Integer id);
23
+
24
+    int updateByExampleSelective(@Param("record") ReportMonthly record, @Param("example") ReportMonthlyExample example);
25
+
26
+    int updateByExample(@Param("record") ReportMonthly record, @Param("example") ReportMonthlyExample example);
27
+
28
+    int updateByPrimaryKeySelective(ReportMonthly record);
29
+
30
+    int updateByPrimaryKey(ReportMonthly record);
31
+}

File diff suppressed because it is too large
+ 1582 - 0
src/main/java/com/chinaitop/depot/business/mapper/ReportMonthlyMapper.xml


+ 31 - 0
src/main/java/com/chinaitop/depot/business/mapper/ReportWeeklyMapper.java

@@ -0,0 +1,31 @@
1
+package com.chinaitop.depot.business.mapper;
2
+
3
+import java.util.List;
4
+
5
+import com.chinaitop.depot.business.model.ReportWeekly;
6
+import com.chinaitop.depot.business.model.ReportWeeklyExample;
7
+import org.apache.ibatis.annotations.Param;
8
+
9
+public interface ReportWeeklyMapper {
10
+    int countByExample(ReportWeeklyExample example);
11
+
12
+    int deleteByExample(ReportWeeklyExample example);
13
+
14
+    int deleteByPrimaryKey(Integer id);
15
+
16
+    int insert(ReportWeekly record);
17
+
18
+    int insertSelective(ReportWeekly record);
19
+
20
+    List<ReportWeekly> selectByExample(ReportWeeklyExample example);
21
+
22
+    ReportWeekly selectByPrimaryKey(Integer id);
23
+
24
+    int updateByExampleSelective(@Param("record") ReportWeekly record, @Param("example") ReportWeeklyExample example);
25
+
26
+    int updateByExample(@Param("record") ReportWeekly record, @Param("example") ReportWeeklyExample example);
27
+
28
+    int updateByPrimaryKeySelective(ReportWeekly record);
29
+
30
+    int updateByPrimaryKey(ReportWeekly record);
31
+}

File diff suppressed because it is too large
+ 1742 - 0
src/main/java/com/chinaitop/depot/business/mapper/ReportWeeklyMapper.xml


File diff suppressed because it is too large
+ 1427 - 0
src/main/java/com/chinaitop/depot/business/model/ReportMonthly.java


File diff suppressed because it is too large
+ 4929 - 0
src/main/java/com/chinaitop/depot/business/model/ReportMonthlyExample.java


File diff suppressed because it is too large
+ 1805 - 0
src/main/java/com/chinaitop/depot/business/model/ReportWeekly.java


File diff suppressed because it is too large
+ 6380 - 0
src/main/java/com/chinaitop/depot/business/model/ReportWeeklyExample.java


+ 42 - 0
src/main/java/com/chinaitop/depot/business/service/ReportMonthlyService.java

@@ -0,0 +1,42 @@
1
+package com.chinaitop.depot.business.service;
2
+
3
+import com.chinaitop.depot.business.model.ReportMonthly;
4
+import com.chinaitop.depot.business.model.ReportMonthlyExample;
5
+
6
+import java.util.List;
7
+
8
+public interface ReportMonthlyService {
9
+	
10
+	/**
11
+	 * 根据条件查询列表
12
+	 * @param example
13
+	 * @return
14
+	 */
15
+	List<ReportMonthly> queryByExample(ReportMonthlyExample example);
16
+	
17
+	/**
18
+	 * 根据编号获取信息
19
+	 * @param Id
20
+	 * @return
21
+	 */
22
+	ReportMonthly findById(Integer Id);
23
+	
24
+	/**
25
+	 * 新增
26
+	 * @param reportMonthly
27
+	 */
28
+	void add(ReportMonthly reportMonthly);
29
+	
30
+	/**
31
+	 * 更新信息
32
+	 * @param reportMonthly
33
+	 */
34
+	void update(ReportMonthly reportMonthly);
35
+	
36
+	/**
37
+	 * 根据编号删除角色信息
38
+	 * @param Id
39
+	 */
40
+	void remove(Integer Id);
41
+
42
+}

+ 42 - 0
src/main/java/com/chinaitop/depot/business/service/ReportWeeklyService.java

@@ -0,0 +1,42 @@
1
+package com.chinaitop.depot.business.service;
2
+
3
+import com.chinaitop.depot.business.model.ReportWeekly;
4
+import com.chinaitop.depot.business.model.ReportWeeklyExample;
5
+
6
+import java.util.List;
7
+
8
+public interface ReportWeeklyService {
9
+	
10
+	/**
11
+	 * 根据条件查询列表
12
+	 * @param example
13
+	 * @return
14
+	 */
15
+	List<ReportWeekly> queryByExample(ReportWeeklyExample example);
16
+	
17
+	/**
18
+	 * 根据编号获取信息
19
+	 * @param Id
20
+	 * @return
21
+	 */
22
+	ReportWeekly findById(Integer Id);
23
+	
24
+	/**
25
+	 * 新增
26
+	 * @param reportWeekly
27
+	 */
28
+	void add(ReportWeekly reportWeekly);
29
+	
30
+	/**
31
+	 * 更新信息
32
+	 * @param reportWeekly
33
+	 */
34
+	void update(ReportWeekly reportWeekly);
35
+	
36
+	/**
37
+	 * 根据编号删除角色信息
38
+	 * @param Id
39
+	 */
40
+	void remove(Integer Id);
41
+
42
+}

+ 48 - 0
src/main/java/com/chinaitop/depot/business/service/impl/ReportMonthlyServiceImpl.java

@@ -0,0 +1,48 @@
1
+package com.chinaitop.depot.business.service.impl;
2
+
3
+import com.chinaitop.depot.business.mapper.ReportMonthlyMapper;
4
+import com.chinaitop.depot.business.model.ReportMonthly;
5
+import com.chinaitop.depot.business.model.ReportMonthlyExample;
6
+import com.chinaitop.depot.business.service.ReportMonthlyService;
7
+import org.springframework.stereotype.Service;
8
+
9
+import javax.annotation.Resource;
10
+import java.util.List;
11
+
12
+@Service
13
+public class ReportMonthlyServiceImpl implements ReportMonthlyService {
14
+	
15
+	@Resource
16
+	private ReportMonthlyMapper reportMonthlyMapper;
17
+
18
+	@Override
19
+	public List<ReportMonthly> queryByExample(ReportMonthlyExample example) {
20
+		// TODO Auto-generated method stub
21
+		return reportMonthlyMapper.selectByExample(example);
22
+	}
23
+
24
+	@Override
25
+	public ReportMonthly findById(Integer Id) {
26
+		// TODO Auto-generated method stub
27
+		return reportMonthlyMapper.selectByPrimaryKey(Id);
28
+	}
29
+
30
+	@Override
31
+	public void add(ReportMonthly reportMonthly) {
32
+		// TODO Auto-generated method stub
33
+		reportMonthlyMapper.insert(reportMonthly);
34
+	}
35
+
36
+	@Override
37
+	public void update(ReportMonthly reportMonthly) {
38
+		// TODO Auto-generated method stub
39
+		reportMonthlyMapper.updateByPrimaryKey(reportMonthly);
40
+	}
41
+
42
+	@Override
43
+	public void remove(Integer Id) {
44
+		// TODO Auto-generated method stub
45
+		reportMonthlyMapper.deleteByPrimaryKey(Id);
46
+	}
47
+
48
+}

+ 48 - 0
src/main/java/com/chinaitop/depot/business/service/impl/ReportWeeklyServiceImpl.java

@@ -0,0 +1,48 @@
1
+package com.chinaitop.depot.business.service.impl;
2
+
3
+import com.chinaitop.depot.business.mapper.ReportWeeklyMapper;
4
+import com.chinaitop.depot.business.model.ReportWeekly;
5
+import com.chinaitop.depot.business.model.ReportWeeklyExample;
6
+import com.chinaitop.depot.business.service.ReportWeeklyService;
7
+import org.springframework.stereotype.Service;
8
+
9
+import javax.annotation.Resource;
10
+import java.util.List;
11
+
12
+@Service
13
+public class ReportWeeklyServiceImpl implements ReportWeeklyService {
14
+	
15
+	@Resource
16
+	private ReportWeeklyMapper reportWeeklyMapper;
17
+
18
+	@Override
19
+	public List<ReportWeekly> queryByExample(ReportWeeklyExample example) {
20
+		// TODO Auto-generated method stub
21
+		return reportWeeklyMapper.selectByExample(example);
22
+	}
23
+
24
+	@Override
25
+	public ReportWeekly findById(Integer Id) {
26
+		// TODO Auto-generated method stub
27
+		return reportWeeklyMapper.selectByPrimaryKey(Id);
28
+	}
29
+
30
+	@Override
31
+	public void add(ReportWeekly reportWeekly) {
32
+		// TODO Auto-generated method stub
33
+		reportWeeklyMapper.insert(reportWeekly);
34
+	}
35
+
36
+	@Override
37
+	public void update(ReportWeekly reportWeekly) {
38
+		// TODO Auto-generated method stub
39
+		reportWeeklyMapper.updateByPrimaryKey(reportWeekly);
40
+	}
41
+
42
+	@Override
43
+	public void remove(Integer Id) {
44
+		// TODO Auto-generated method stub
45
+		reportWeeklyMapper.deleteByPrimaryKey(Id);
46
+	}
47
+
48
+}