| | |
| | | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | | import com.matrix.system.shopXcx.bean.ShopReceiveAddress; |
| | | import com.matrix.system.shopXcx.dao.ShopReceiveAddressDao; |
| | | import com.matrix.system.common.init.UserCacheManager; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.shopXcx.api.pojo.AddressUntilsPOJO; |
| | | import com.matrix.system.shopXcx.api.tools.AddressUntils; |
| | | import com.matrix.system.shopXcx.bean.ShopReceiveAddress; |
| | | import com.matrix.system.shopXcx.dao.ShopReceiveAddressDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private ShopReceiveAddressDao shopReceiveAddressDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | private UserCacheManager userCacheManager; |
| | | /** |
| | | * 接收保存收货地址 |
| | | */ |
| | | @PostMapping(value = "/saveReceiveAddress") |
| | | public @ResponseBody |
| | | AjaxResult saveReceiveAddress(@RequestBody ShopReceiveAddress receiveAddress) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | receiveAddress.setCreateBy(loginUser.getOpenId()); |
| | | receiveAddress.setUpdateBy(loginUser.getOpenId()); |
| | | receiveAddress.setAddrUserid(loginUser.getOpenId()); |
| | |
| | | @PostMapping("/findReceiveAddress") |
| | | @ResponseBody |
| | | public AjaxResult getByAddrUserId(@RequestBody ShopReceiveAddress receiveAddress) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | String userId = loginUser.getOpenId(); |
| | | receiveAddress.setAddrUserid(userId); |
| | | List<ShopReceiveAddress> list = shopReceiveAddressDao.selectByModel(receiveAddress); |
| | |
| | | @PostMapping("/findAddrByAddrId/{addrId}") |
| | | @ResponseBody |
| | | public AjaxResult getByAddrId(@PathVariable("addrId") Integer addrId) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | String userId = loginUser.getOpenId(); |
| | | ShopReceiveAddress params = new ShopReceiveAddress(); |
| | | params.setAddrUserid(userId); |
| | |
| | | @PostMapping(value = "/updateReceiveAddress") |
| | | public @ResponseBody |
| | | AjaxResult updateReceiveAddress(@RequestBody ShopReceiveAddress receiveAddress) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo loginUser = userCacheManager.getLoginUser(); |
| | | receiveAddress.setCreateBy(loginUser.getOpenId()); |
| | | receiveAddress.setUpdateBy(loginUser.getOpenId()); |
| | | receiveAddress.setAddrUserid(loginUser.getOpenId()); |