AccountBondObjApi.java 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. package com.java110.acct.api;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.java110.acct.bmo.accountBondObj.IDeleteAccountBondObjBMO;
  4. import com.java110.acct.bmo.accountBondObj.IGetAccountBondObjBMO;
  5. import com.java110.acct.bmo.accountBondObj.ISaveAccountBondObjBMO;
  6. import com.java110.acct.bmo.accountBondObj.IUpdateAccountBondObjBMO;
  7. import com.java110.dto.accountBondObj.AccountBondObjDto;
  8. import com.java110.po.accountBondObj.AccountBondObjPo;
  9. import com.java110.utils.util.Assert;
  10. import com.java110.utils.util.BeanConvertUtil;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.http.ResponseEntity;
  13. import org.springframework.web.bind.annotation.*;
  14. @RestController
  15. @RequestMapping(value = "/accountBondObj")
  16. public class AccountBondObjApi {
  17. @Autowired
  18. private ISaveAccountBondObjBMO saveAccountBondObjBMOImpl;
  19. @Autowired
  20. private IUpdateAccountBondObjBMO updateAccountBondObjBMOImpl;
  21. @Autowired
  22. private IDeleteAccountBondObjBMO deleteAccountBondObjBMOImpl;
  23. @Autowired
  24. private IGetAccountBondObjBMO getAccountBondObjBMOImpl;
  25. /**
  26. * 微信保存消息模板
  27. * @serviceCode /accountBondObj/saveAccountBondObj
  28. * @path /app/accountBondObj/saveAccountBondObj
  29. * @param reqJson
  30. * @return
  31. */
  32. @RequestMapping(value = "/saveAccountBondObj", method = RequestMethod.POST)
  33. public ResponseEntity<String> saveAccountBondObj(@RequestBody JSONObject reqJson) {
  34. Assert.hasKeyAndValue(reqJson, "bondId", "请求报文中未包含bondId");
  35. Assert.hasKeyAndValue(reqJson, "objId", "请求报文中未包含objId");
  36. Assert.hasKeyAndValue(reqJson, "bondType", "请求报文中未包含bondType");
  37. Assert.hasKeyAndValue(reqJson, "receivableAmount", "请求报文中未包含receivableAmount");
  38. Assert.hasKeyAndValue(reqJson, "receivedAmount", "请求报文中未包含receivedAmount");
  39. Assert.hasKeyAndValue(reqJson, "state", "请求报文中未包含state");
  40. Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime");
  41. Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime");
  42. AccountBondObjPo accountBondObjPo = BeanConvertUtil.covertBean(reqJson, AccountBondObjPo.class);
  43. return saveAccountBondObjBMOImpl.save(accountBondObjPo);
  44. }
  45. /**
  46. * 微信修改消息模板
  47. * @serviceCode /accountBondObj/updateAccountBondObj
  48. * @path /app/accountBondObj/updateAccountBondObj
  49. * @param reqJson
  50. * @return
  51. */
  52. @RequestMapping(value = "/updateAccountBondObj", method = RequestMethod.POST)
  53. public ResponseEntity<String> updateAccountBondObj(@RequestBody JSONObject reqJson) {
  54. Assert.hasKeyAndValue(reqJson, "bobjId", "bobjId不能为空");
  55. Assert.hasKeyAndValue(reqJson, "objId", "请求报文中未包含objId");
  56. Assert.hasKeyAndValue(reqJson, "receivedAmount", "请求报文中未包含receivedAmount");
  57. Assert.hasKeyAndValue(reqJson, "state", "请求报文中未包含state");
  58. Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime");
  59. Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime");
  60. AccountBondObjPo accountBondObjPo = BeanConvertUtil.covertBean(reqJson, AccountBondObjPo.class);
  61. return updateAccountBondObjBMOImpl.update(accountBondObjPo);
  62. }
  63. /**
  64. * 微信删除消息模板
  65. * @serviceCode /accountBondObj/deleteAccountBondObj
  66. * @path /app/accountBondObj/deleteAccountBondObj
  67. * @param reqJson
  68. * @return
  69. */
  70. @RequestMapping(value = "/deleteAccountBondObj", method = RequestMethod.POST)
  71. public ResponseEntity<String> deleteAccountBondObj(@RequestBody JSONObject reqJson) {
  72. Assert.hasKeyAndValue(reqJson, "bobjId", "bobjId不能为空");
  73. Assert.hasKeyAndValue(reqJson, "objId", "objId不能为空");
  74. AccountBondObjPo accountBondObjPo = BeanConvertUtil.covertBean(reqJson, AccountBondObjPo.class);
  75. return deleteAccountBondObjBMOImpl.delete(accountBondObjPo);
  76. }
  77. /**
  78. * 微信删除消息模板
  79. * @serviceCode /accountBondObj/queryAccountBondObj
  80. * @path /app/accountBondObj/queryAccountBondObj
  81. * @param
  82. * @return
  83. */
  84. @RequestMapping(value = "/queryAccountBondObj", method = RequestMethod.GET)
  85. public ResponseEntity<String> queryAccountBondObj(@RequestParam(value = "bobjId",required = false) String bobjId,
  86. @RequestParam(value = "state",required = false) String state,
  87. @RequestParam(value = "objId",required = false) String objId,
  88. @RequestParam(value = "page") int page,
  89. @RequestParam(value = "row") int row) {
  90. AccountBondObjDto accountBondObjDto = new AccountBondObjDto();
  91. accountBondObjDto.setPage(page);
  92. accountBondObjDto.setRow(row);
  93. accountBondObjDto.setBobjId(bobjId);
  94. accountBondObjDto.setState(state);
  95. accountBondObjDto.setObjId( objId );
  96. return getAccountBondObjBMOImpl.get(accountBondObjDto);
  97. }
  98. }