shiyj1101
2021-06-29 2f00d7cfaf670c4ded20de9f102e55474afceebf
service-acct/src/main/java/com/java110/acct/api/ShopVipAccountApi.java
@@ -1,12 +1,18 @@
package com.java110.store.api;
package com.java110.acct.api;
import com.alibaba.fastjson.JSONObject;
import com.java110.acct.bmo.shopVipAccount.IDeleteShopVipAccountBMO;
import com.java110.acct.bmo.shopVipAccount.IGetShopVipAccountBMO;
import com.java110.acct.bmo.shopVipAccount.ISaveShopVipAccountBMO;
import com.java110.acct.bmo.shopVipAccount.IUpdateShopVipAccountBMO;
import com.java110.acct.bmo.shopVipAccountDetail.IDeleteShopVipAccountDetailBMO;
import com.java110.acct.bmo.shopVipAccountDetail.IGetShopVipAccountDetailBMO;
import com.java110.acct.bmo.shopVipAccountDetail.ISaveShopVipAccountDetailBMO;
import com.java110.acct.bmo.shopVipAccountDetail.IUpdateShopVipAccountDetailBMO;
import com.java110.dto.shopVipAccount.ShopVipAccountDto;
import com.java110.dto.shopVipAccountDetail.ShopVipAccountDetailDto;
import com.java110.po.shopVipAccount.ShopVipAccountPo;
import com.java110.po.shopVipAccountDetail.ShopVipAccountDetailPo;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +33,16 @@
    @Autowired
    private IGetShopVipAccountBMO getShopVipAccountBMOImpl;
    @Autowired
    private ISaveShopVipAccountDetailBMO saveShopVipAccountDetailBMOImpl;
    @Autowired
    private IUpdateShopVipAccountDetailBMO updateShopVipAccountDetailBMOImpl;
    @Autowired
    private IDeleteShopVipAccountDetailBMO deleteShopVipAccountDetailBMOImpl;
    @Autowired
    private IGetShopVipAccountDetailBMO getShopVipAccountDetailBMOImpl;
    /**
     * 微信保存消息模板
@@ -96,12 +112,92 @@
     */
    @RequestMapping(value = "/queryShopVipAccount", method = RequestMethod.GET)
    public ResponseEntity<String> queryShopVipAccount(@RequestParam(value = "shopId", required = false) String shopId,
                                                      @RequestParam(value = "vipId", required = false) String vipId,
                                                      @RequestParam(value = "page") int page,
                                                      @RequestParam(value = "row") int row) {
        ShopVipAccountDto shopVipAccountDto = new ShopVipAccountDto();
        shopVipAccountDto.setPage(page);
        shopVipAccountDto.setRow(row);
        shopVipAccountDto.setShopId(shopId);
        shopVipAccountDto.setVipId(vipId);
        return getShopVipAccountBMOImpl.get(shopVipAccountDto);
    }
    /**
     * 微信保存消息模板
     *
     * @param reqJson
     * @return
     * @serviceCode /shopVipAccount/saveShopVipAccountDetail
     * @path /app/shopVipAccount/saveShopVipAccountDetail
     */
    @RequestMapping(value = "/saveShopVipAccountDetail", method = RequestMethod.POST)
    public ResponseEntity<String> saveShopVipAccountDetail(@RequestBody JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "vipAcctId", "请求报文中未包含vipAcctId");
        Assert.hasKeyAndValue(reqJson, "amount", "请求报文中未包含amount");
        ShopVipAccountDetailPo shopVipAccountDetailPo = BeanConvertUtil.covertBean(reqJson, ShopVipAccountDetailPo.class);
        return saveShopVipAccountDetailBMOImpl.save(shopVipAccountDetailPo);
    }
    /**
     * 微信修改消息模板
     *
     * @param reqJson
     * @return
     * @serviceCode /shopVipAccount/updateShopVipAccountDetail
     * @path /app/shopVipAccount/updateShopVipAccountDetail
     */
    @RequestMapping(value = "/updateShopVipAccountDetail", method = RequestMethod.POST)
    public ResponseEntity<String> updateShopVipAccountDetail(@RequestBody JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "vipAcctId", "请求报文中未包含vipAcctId");
        Assert.hasKeyAndValue(reqJson, "amount", "请求报文中未包含amount");
        Assert.hasKeyAndValue(reqJson, "detailId", "detailId不能为空");
        ShopVipAccountDetailPo shopVipAccountDetailPo = BeanConvertUtil.covertBean(reqJson, ShopVipAccountDetailPo.class);
        return updateShopVipAccountDetailBMOImpl.update(shopVipAccountDetailPo);
    }
    /**
     * 微信删除消息模板
     *
     * @param reqJson
     * @return
     * @serviceCode /shopVipAccount/deleteShopVipAccountDetail
     * @path /app/shopVipAccount/deleteShopVipAccountDetail
     */
    @RequestMapping(value = "/deleteShopVipAccountDetail", method = RequestMethod.POST)
    public ResponseEntity<String> deleteShopVipAccountDetail(@RequestBody JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
        Assert.hasKeyAndValue(reqJson, "detailId", "detailId不能为空");
        ShopVipAccountDetailPo shopVipAccountDetailPo = BeanConvertUtil.covertBean(reqJson, ShopVipAccountDetailPo.class);
        return deleteShopVipAccountDetailBMOImpl.delete(shopVipAccountDetailPo);
    }
    /**
     * 微信删除消息模板
     *
     * @param shopId 小区ID
     * @return
     * @serviceCode /shopVipAccount/queryShopVipAccountDetail
     * @path /app/shopVipAccount/queryShopVipAccountDetail
     */
    @RequestMapping(value = "/queryShopVipAccountDetail", method = RequestMethod.GET)
    public ResponseEntity<String> queryShopVipAccountDetail(@RequestParam(value = "shopId", required = false) String shopId,
                                                            @RequestParam(value = "page") int page,
                                                            @RequestParam(value = "row") int row) {
        ShopVipAccountDetailDto shopVipAccountDetailDto = new ShopVipAccountDetailDto();
        shopVipAccountDetailDto.setPage(page);
        shopVipAccountDetailDto.setRow(row);
        shopVipAccountDetailDto.setShopId(shopId);
        return getShopVipAccountDetailBMOImpl.get(shopVipAccountDetailDto);
    }
}