AccountBondObjApi.java 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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.account.AccountBondObjDto;
  8. import com.java110.po.account.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, "receivedAmount", "请求报文中未包含receivedAmount");
  56. Assert.hasKeyAndValue(reqJson, "state", "请求报文中未包含state");
  57. AccountBondObjPo accountBondObjPo = BeanConvertUtil.covertBean(reqJson, AccountBondObjPo.class);
  58. return updateAccountBondObjBMOImpl.update(accountBondObjPo);
  59. }
  60. /**
  61. * 微信删除消息模板
  62. * @serviceCode /accountBondObj/deleteAccountBondObj
  63. * @path /app/accountBondObj/deleteAccountBondObj
  64. * @param reqJson
  65. * @return
  66. */
  67. @RequestMapping(value = "/deleteAccountBondObj", method = RequestMethod.POST)
  68. public ResponseEntity<String> deleteAccountBondObj(@RequestBody JSONObject reqJson) {
  69. Assert.hasKeyAndValue(reqJson, "bobjId", "bobjId不能为空");
  70. Assert.hasKeyAndValue(reqJson, "objId", "objId不能为空");
  71. AccountBondObjPo accountBondObjPo = BeanConvertUtil.covertBean(reqJson, AccountBondObjPo.class);
  72. return deleteAccountBondObjBMOImpl.delete(accountBondObjPo);
  73. }
  74. /**
  75. * 微信删除消息模板
  76. * @serviceCode /accountBondObj/queryAccountBondObj
  77. * @path /app/accountBondObj/queryAccountBondObj
  78. * @param
  79. * @return
  80. */
  81. @RequestMapping(value = "/queryAccountBondObj", method = RequestMethod.GET)
  82. public ResponseEntity<String> queryAccountBondObj(@RequestParam(value = "bobjId",required = false) String bobjId,
  83. @RequestParam(value = "state",required = false) String state,
  84. @RequestParam(value = "objId",required = false) String objId,
  85. @RequestParam(value = "page") int page,
  86. @RequestParam(value = "row") int row) {
  87. AccountBondObjDto accountBondObjDto = new AccountBondObjDto();
  88. accountBondObjDto.setPage(page);
  89. accountBondObjDto.setRow(row);
  90. accountBondObjDto.setBobjId(bobjId);
  91. accountBondObjDto.setState(state);
  92. accountBondObjDto.setObjId( objId );
  93. return getAccountBondObjBMOImpl.get(accountBondObjDto);
  94. }
  95. }