更新代码

This commit is contained in:
付庆吉
2021-03-02 18:39:16 +08:00
parent e62a21cf29
commit 30bb9e9752

View File

@ -1,9 +1,12 @@
package com.chinaunicom.mall.ebtp.extend.bizbidsharedrecord.controller;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseCacheUser;
import com.chinaunicom.mall.ebtp.common.base.entity.BasePageResponse;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.common.base.service.IBaseCacheUserService;
import com.chinaunicom.mall.ebtp.common.util.PropertyUtils;
import com.chinaunicom.mall.ebtp.extend.bizbidshared.entity.BizBidShared;
import com.chinaunicom.mall.ebtp.extend.bizbidshared.service.IBizBidSharedService;
import com.chinaunicom.mall.ebtp.extend.bizbidsharedrecord.entity.BizBidSharedRecord;
import com.chinaunicom.mall.ebtp.extend.bizbidsharedrecord.entity.BizBidSharedRecordVO;
import com.chinaunicom.mall.ebtp.extend.bizbidsharedrecord.service.IBizBidSharedRecordService;
@ -20,6 +23,8 @@ import javax.validation.Valid;
@RequestMapping("/v1/bizbidsharedrecord")
public class BizBidSharedRecordController {
@Resource
private IBaseCacheUserService iBaseCacheUserService;
@Resource
private IBizBidSharedRecordService ibizBidSharedRecordService;
@ -47,9 +52,14 @@ public class BizBidSharedRecordController {
@PostMapping("/add")
public BaseResponse<Boolean> insert(
@ApiParam(value = "对象数据", required = true) @RequestBody @Valid BizBidShared bizBidShared) {
BaseCacheUser cacheUser = iBaseCacheUserService.getCacheUser();
BizBidSharedRecord bizBidSharedRecord = new BizBidSharedRecord();
bizBidSharedRecord.setId(PropertyUtils.getSnowflakeId());
bizBidSharedRecord.setRecordId(bizBidShared.getId());
bizBidSharedRecord.setRecordAccount(cacheUser.getLoginName());
bizBidSharedRecord.setRecordName(cacheUser.getFullName());
bizBidSharedRecord.setRecordRole(cacheUser.getRoleIds());
bizBidSharedRecord.setRecordStaff(cacheUser.getUserId());
boolean save = ibizBidSharedRecordService.save(bizBidSharedRecord);
return BaseResponse.success(save);
@ -65,7 +75,6 @@ public class BizBidSharedRecordController {
@PutMapping("")
public BaseResponse<Boolean> update(
@ApiParam(value = "对象数据", required = true) @RequestBody BizBidSharedRecord bizBidSharedRecord) {
return BaseResponse.success(ibizBidSharedRecordService.updateById(bizBidSharedRecord));
}