BMOImpl.java 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. package com.java110.api.bmo.activities.impl;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.java110.api.bmo.ApiBaseBMO;
  4. import com.java110.api.bmo.activities.I@@TemplateCode@@BMO;
  5. import com.java110.core.context.DataFlowContext;
  6. import com.java110.core.smo.community.I@@TemplateCode@@InnerServiceSMO;
  7. import com.java110.core.smo.file.IFileInnerServiceSMO;
  8. import com.java110.core.smo.file.IFileRelInnerServiceSMO;
  9. import com.java110.dto.activities.@@TemplateCode@@Dto;
  10. import com.java110.dto.file.FileRelDto;
  11. import com.java110.utils.constant.BusinessTypeConstant;
  12. import com.java110.utils.constant.CommonConstant;
  13. import com.java110.utils.util.Assert;
  14. import com.java110.utils.util.BeanConvertUtil;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.stereotype.Service;
  17. import java.util.List;
  18. @Service("@@templateCode@@BMOImpl")
  19. public class @@TemplateCode@@BMOImpl extends ApiBaseBMO implements I@@TemplateCode@@BMO {
  20. @Autowired
  21. private I@@TemplateCode@@InnerServiceSMO @@templateCode@@InnerServiceSMOImpl;
  22. /**
  23. * 添加小区信息
  24. *
  25. * @param paramInJson 接口调用放传入入参
  26. * @param dataFlowContext 数据上下文
  27. * @return 订单服务能够接受的报文
  28. */
  29. public JSONObject add@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext) {
  30. JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
  31. business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_@@TEMPLATECODE@@);
  32. business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
  33. business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
  34. JSONObject business@@TemplateCode@@ = new JSONObject();
  35. business@@TemplateCode@@.putAll(paramInJson);
  36. business@@TemplateCode@@.put("@@templateKey@@", "-1");
  37. //计算 应收金额
  38. business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("business@@TemplateCode@@", business@@TemplateCode@@);
  39. return business;
  40. }
  41. /**
  42. * 添加活动信息
  43. *
  44. * @param paramInJson 接口调用放传入入参
  45. * @param dataFlowContext 数据上下文
  46. * @return 订单服务能够接受的报文
  47. */
  48. public JSONObject update@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext) {
  49. @@TemplateCode@@Dto @@templateCode@@Dto = new @@TemplateCode@@Dto();
  50. @@templateCode@@Dto.set@@TemplateCode@@Id(paramInJson.getString("@@templateCode@@Id"));
  51. @@templateCode@@Dto.setCommunityId(paramInJson.getString("communityId"));
  52. List<@@TemplateCode@@Dto> @@templateCode@@Dtos = @@templateCode@@InnerServiceSMOImpl.query@@TemplateCode@@s(@@templateCode@@Dto);
  53. Assert.listOnlyOne(@@templateCode@@Dtos, "未找到需要修改的活动 或多条数据");
  54. JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
  55. business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_@@TEMPLATECODE@@);
  56. business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
  57. business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
  58. JSONObject business@@TemplateCode@@ = new JSONObject();
  59. business@@TemplateCode@@.putAll(activitiesDtos.get(0));
  60. business@@TemplateCode@@.putAll(paramInJson);
  61. //计算 应收金额
  62. business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("business@@TemplateCode@@", business@@TemplateCode@@);
  63. return business;
  64. }
  65. /**
  66. * 添加小区信息
  67. *
  68. * @param paramInJson 接口调用放传入入参
  69. * @param dataFlowContext 数据上下文
  70. * @return 订单服务能够接受的报文
  71. */
  72. public JSONObject delete@@TemplateCode@@(JSONObject paramInJson, DataFlowContext dataFlowContext) {
  73. JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
  74. business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_@@TEMPLATECODE@@);
  75. business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
  76. business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
  77. JSONObject business@@TemplateCode@@ = new JSONObject();
  78. business@@TemplateCode@@.putAll(paramInJson);
  79. //计算 应收金额
  80. business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("business@@TemplateCode@@", business@@TemplateCode@@);
  81. return business;
  82. }
  83. }