BusinessMergeNoticeController.java 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. package com.chinaitop.depot.business.controller;
  2. import java.util.HashMap;
  3. import java.util.List;
  4. import java.util.Map;
  5. import javax.annotation.Resource;
  6. import org.springframework.http.MediaType;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.bind.annotation.RequestMethod;
  9. import org.springframework.web.bind.annotation.RestController;
  10. import com.chinaitop.depot.business.model.BusinessMergeNotice;
  11. import com.chinaitop.depot.business.model.BusinessMergeNoticeDetail;
  12. import com.chinaitop.depot.business.service.BusinessMergeNoticeService;
  13. import com.github.pagehelper.PageHelper;
  14. import com.github.pagehelper.PageInfo;
  15. import io.swagger.annotations.Api;
  16. import io.swagger.annotations.ApiImplicitParam;
  17. import io.swagger.annotations.ApiImplicitParams;
  18. import io.swagger.annotations.ApiOperation;
  19. @RestController
  20. @RequestMapping(value="/depot/business/businessMergeNotice")
  21. @Api(value= "BusinessMergeNoticeController", description = "合并通知单管理")
  22. public class BusinessMergeNoticeController {
  23. @Resource
  24. private BusinessMergeNoticeService businessMergeNoticeService;
  25. @RequestMapping(value="/findByHtbhCondition",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
  26. @ApiOperation(value="根据合同编号获取通知单数据列表", notes = "")
  27. @ApiImplicitParams({
  28. @ApiImplicitParam(name = "htbh", value = "合同编号", required=true, paramType = "query"),
  29. @ApiImplicitParam(name = "orgId", value = "库ID", required=true, paramType = "query")
  30. })
  31. public List<BusinessMergeNoticeDetail> findByHtbhCondition(String htbh, Integer orgId) {
  32. List<BusinessMergeNoticeDetail> list = null;
  33. try {
  34. list = businessMergeNoticeService.findByHtbhCondition(htbh, orgId);
  35. } catch (Exception e) {
  36. e.printStackTrace();
  37. }
  38. return list;
  39. }
  40. @RequestMapping(value="/save",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.POST)
  41. @ApiOperation(value="保存", notes = "")
  42. @ApiImplicitParams({
  43. @ApiImplicitParam(name = "x_arr", value = "目标通知单对象", required=true, paramType = "form"),
  44. @ApiImplicitParam(name = "y_arr", value = "原通知单对象", required=true, paramType = "form")
  45. })
  46. public Map<String, String> save(String x_arr, String y_arr) {
  47. Map<String, String> map = new HashMap<>();
  48. try {
  49. businessMergeNoticeService.save(x_arr, y_arr);
  50. map.put("status", "200");
  51. map.put("msg", "操作成功");
  52. } catch (Exception e) {
  53. map.put("status", "500");
  54. map.put("msg", e.getMessage());
  55. e.printStackTrace();
  56. }
  57. return map;
  58. }
  59. @RequestMapping(value="/findByIdList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
  60. @ApiOperation(value="查看详情", notes = "")
  61. @ApiImplicitParams({
  62. @ApiImplicitParam(name = "id", value = "主表ID", required=true, paramType = "query")
  63. })
  64. public Map<String, Object> findByIdList(String id) {
  65. Map<String, Object> map = new HashMap<>();
  66. try {
  67. map = businessMergeNoticeService.findByIdList(id);
  68. map.put("status", 200);
  69. } catch (Exception e) {
  70. map.put("status", "500");
  71. map.put("msg", e.getMessage());
  72. e.printStackTrace();
  73. }
  74. return map;
  75. }
  76. @RequestMapping(value="/findByPageList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
  77. @ApiOperation(value="合并通知单列表查询", notes = "")
  78. @ApiImplicitParams({
  79. @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
  80. @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
  81. @ApiImplicitParam(name = "htbh", value = "客户编号", paramType = "query"),
  82. @ApiImplicitParam(name = "khmc", value = "客户名称", paramType = "query"),
  83. @ApiImplicitParam(name = "ch", value = "仓房ID", paramType = "query"),
  84. @ApiImplicitParam(name = "orgId", value = "库ID", required=true, paramType = "query")
  85. })
  86. public PageInfo<BusinessMergeNotice> findByPageList(Integer pageNum, Integer pageSize, String htbh, String khmc, Integer ch, Integer orgId) {
  87. PageInfo<BusinessMergeNotice> pageInfo = null;
  88. try {
  89. if (null != pageNum && null != pageSize) {
  90. PageHelper.startPage(pageNum, pageSize);
  91. }
  92. List<BusinessMergeNotice> list = businessMergeNoticeService.findByList(orgId, htbh, khmc, ch);
  93. pageInfo = new PageInfo<>(list);
  94. } catch (Exception e) {
  95. e.printStackTrace();
  96. }
  97. return pageInfo;
  98. }
  99. @RequestMapping(value="/findByTzdidQueryList",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
  100. @ApiOperation(value="按照通知单ID查询通知单合并记录", notes = "")
  101. @ApiImplicitParams({
  102. @ApiImplicitParam(name = "tzdid", value = "通知单ID", required=true, paramType = "query")
  103. })
  104. public List<BusinessMergeNoticeDetail> findByTzdidQueryList(String tzdid) {
  105. List<BusinessMergeNoticeDetail> list = null;
  106. try {
  107. list = businessMergeNoticeService.findByTzdidQueryList(tzdid);
  108. } catch (Exception e) {
  109. e.printStackTrace();
  110. }
  111. return list;
  112. }
  113. }