提交修改
This commit is contained in:
parent
afbf5de248
commit
eb0beacfc5
@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.heyu.api.data.entity.vv.VvBuyerAddressEntity;
|
import com.heyu.api.data.entity.vv.VvBuyerAddressEntity;
|
||||||
import com.lz.mybatis.plugin.annotations.By;
|
import com.lz.mybatis.plugin.annotations.By;
|
||||||
import com.lz.mybatis.plugin.annotations.Column;
|
import com.lz.mybatis.plugin.annotations.Column;
|
||||||
|
import com.lz.mybatis.plugin.annotations.IF;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@ -48,9 +49,10 @@ public interface VvBuyerAddressDao extends BaseMapper<VvBuyerAddressEntity> {
|
|||||||
|
|
||||||
|
|
||||||
int updateVvBuyerAddressStatusById(@Column(VvBuyerAddressEntity.status_) String status,
|
int updateVvBuyerAddressStatusById(@Column(VvBuyerAddressEntity.status_) String status,
|
||||||
@By @Column(VvBuyerAddressEntity.status_) String status1,
|
@IF @By @Column(VvBuyerAddressEntity.status_) String status1,
|
||||||
@By@Column(VvBuyerAddressEntity.buyer_id) Long buyerId);
|
@By@Column(VvBuyerAddressEntity.buyer_id) Long buyerId);
|
||||||
|
|
||||||
|
|
||||||
|
int updateVvBuyerAddressStatusByBuyerId(@Column(VvBuyerAddressEntity.status_) String status,
|
||||||
|
@By@Column(VvBuyerAddressEntity.buyer_id) Long buyerId);
|
||||||
}
|
}
|
||||||
@ -37,6 +37,7 @@ public class AppBuyerAddressManagerController {
|
|||||||
|
|
||||||
/***
|
/***
|
||||||
* 列表
|
* 列表
|
||||||
|
* /app/buyer/address/list
|
||||||
*/
|
*/
|
||||||
@Describe("买家地址列表")
|
@Describe("买家地址列表")
|
||||||
@RequestMapping("/list")
|
@RequestMapping("/list")
|
||||||
@ -55,19 +56,17 @@ public class AppBuyerAddressManagerController {
|
|||||||
return R.ok().setData(pageUtils);
|
return R.ok().setData(pageUtils);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /app/buyer/address/insertOrUpdate
|
||||||
@Describe("买家地址插入或修改")
|
@Describe("买家地址插入或修改")
|
||||||
@RequestMapping("/insertOrUpdate")
|
@RequestMapping("/insertOrUpdate")
|
||||||
public R inserOrUpdate(@RequestBody VvBuyerAddressEntity vvBuyerAddressEntity) {
|
public R inserOrUpdate(@RequestBody VvBuyerAddressEntity vvBuyerAddressEntity) {
|
||||||
VvBuyerEntity vvBuyerEntity = vvBuyerDao.selectVvBuyerById(vvBuyerAddressEntity.getBuyerId());
|
VvBuyerEntity vvBuyerEntity = vvBuyerDao.selectVvBuyerById(vvBuyerAddressEntity.getBuyerId());
|
||||||
// 如果当前状态是默认地址,
|
// 如果当前状态是默认地址,
|
||||||
if (BuyerAddressEnums.default_address.equals(vvBuyerAddressEntity.getStatus())) {
|
if (BuyerAddressEnums.default_address.getStatus().equals(vvBuyerAddressEntity.getStatus())) {
|
||||||
vvBuyerAddressDao.updateVvBuyerAddressStatusById(BuyerAddressEnums.common.getStatus(),
|
vvBuyerAddressDao.updateVvBuyerAddressStatusById(BuyerAddressEnums.common.getStatus(),
|
||||||
BuyerAddressEnums.default_address.getStatus(),
|
BuyerAddressEnums.default_address.getStatus(),
|
||||||
vvBuyerAddressEntity.getBuyerId());
|
vvBuyerAddressEntity.getBuyerId());
|
||||||
}
|
}
|
||||||
vvBuyerAddressEntity.setBuyerName(vvBuyerEntity.getBuyerName());
|
|
||||||
vvBuyerAddressEntity.setBuyerPhone(vvBuyerEntity.getBuyerPhone());
|
|
||||||
vvBuyerAddressEntity.setBuyerWeixin(vvBuyerEntity.getBuyerWeixin());
|
|
||||||
vvBuyerAddressDao.insertOrUpdateVvBuyerAddress(vvBuyerAddressEntity);
|
vvBuyerAddressDao.insertOrUpdateVvBuyerAddress(vvBuyerAddressEntity);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user