Commit af26028f authored by 周健威's avatar 周健威

添加接口

parent 127cec23
...@@ -126,6 +126,19 @@ public interface UserRestInterface { ...@@ -126,6 +126,19 @@ public interface UserRestInterface {
return null; return null;
} }
default Integer getBusinessUserCompanyId(){
return getBusinessUserCompanyIds() == null? null : getBusinessUserCompanyIds().get(0);
}
default Integer getBgUserCompanyId(){
UserDTO userDTO = getAdminUserInfoV2();
if(userDTO != null && CollUtil.isNotEmpty(userDTO.getCompanyIds())) {
return userDTO.getCompanyIds().get(0);
} else {
return null;
}
}
default UserDTO getBusinessUserByAppUser(){ default UserDTO getBusinessUserByAppUser(){
String currentUserName = BaseContextHandler.getUsername(); String currentUserName = BaseContextHandler.getUsername();
if (StrUtil.isNotBlank(currentUserName)){ if (StrUtil.isNotBlank(currentUserName)){
......
...@@ -93,7 +93,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> { ...@@ -93,7 +93,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
* @param specialRent * @param specialRent
* @param userDTO * @param userDTO
*/ */
public void addRent(@RequestBody SpecialRent specialRent, UserDTO userDTO) { public void addRent(@RequestBody SpecialRent specialRent, UserDTO userDTO, Integer currentCompanyId) {
AssertUtils.isBlank(userDTO); AssertUtils.isBlank(userDTO);
AssertUtils.isBlank(specialRent.getUnitPrice()); AssertUtils.isBlank(specialRent.getUnitPrice());
if(StrUtil.isBlank(specialRent.getVehicleId())) { if(StrUtil.isBlank(specialRent.getVehicleId())) {
...@@ -123,6 +123,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> { ...@@ -123,6 +123,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
specialRent.setCategoryId(vehicle.getCategoryId()); specialRent.setCategoryId(vehicle.getCategoryId());
specialRent.setGoodsType(vehicle.getGoodsType()); specialRent.setGoodsType(vehicle.getGoodsType());
specialRent.setPriceType(vehicle.getPriceType()); specialRent.setPriceType(vehicle.getPriceType());
specialRent.setPublishCompanyId(currentCompanyId);
//缓存商品信息 //缓存商品信息
specialRent.setGoodsJson(JSONUtil.parse(vehicle).toString()); specialRent.setGoodsJson(JSONUtil.parse(vehicle).toString());
......
...@@ -363,7 +363,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -363,7 +363,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
shuntApply.setOrderNo(detail.getOrder().getNo()); shuntApply.setOrderNo(detail.getOrder().getNo());
shuntApply.setOverTime(DateUtil.offsetHour(DateUtil.date(), 1).getTime()); shuntApply.setOverTime(DateUtil.offsetHour(DateUtil.date(), 1).getTime());
shuntApply.setConfirmUserId(userDTO.getId()); shuntApply.setConfirmUserId(userDTO.getId());
shuntApply.setConfirmCompanyId(userDTO.getCompanyId()); shuntApply.setConfirmCompanyId(getBusinessUserCompanyId());
shuntApply.setBookRecordId(detail.getBookRecordId()); shuntApply.setBookRecordId(detail.getBookRecordId());
baseBiz.updateSelectiveByIdRe(shuntApply); baseBiz.updateSelectiveByIdRe(shuntApply);
...@@ -432,7 +432,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp ...@@ -432,7 +432,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
UserDTO userDTO = getBusinessUserByAppUser(); UserDTO userDTO = getBusinessUserByAppUser();
AssertUtils.isBlank(userDTO); AssertUtils.isBlank(userDTO);
PageDataVO<ShuntApplyController.ShuntApplyVO> pages = PageDataVO.pageInfo(dto.initQuery(), () -> baseBiz.selectByWeekend(w -> { PageDataVO<ShuntApplyController.ShuntApplyVO> pages = PageDataVO.pageInfo(dto.initQuery(), () -> baseBiz.selectByWeekend(w -> {
w.andEqualTo(ShuntApply::getConfirmUserId, userDTO.getId()); w.andEqualTo(ShuntApply::getConfirmCompanyId, getBusinessUserCompanyId());
w.andEqualTo(ShuntApply::getIsBizdel, SYS_FALSE); w.andEqualTo(ShuntApply::getIsBizdel, SYS_FALSE);
if(StrUtil.isNotBlank(dto.getMultiStatus())) { if(StrUtil.isNotBlank(dto.getMultiStatus())) {
w.andIn(ShuntApply::getStatus, CollUtil.toList(dto.getMultiStatus().split(","))); w.andIn(ShuntApply::getStatus, CollUtil.toList(dto.getMultiStatus().split(",")));
......
...@@ -68,7 +68,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia ...@@ -68,7 +68,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
public ObjectRestResponse appBusinessAddRent(@RequestBody SpecialRent specialRent) { public ObjectRestResponse appBusinessAddRent(@RequestBody SpecialRent specialRent) {
UserDTO userDTO = getBusinessUserByAppUser(); UserDTO userDTO = getBusinessUserByAppUser();
baseBiz.addRent(specialRent, userDTO); baseBiz.addRent(specialRent, userDTO, getBusinessUserCompanyId());
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
...@@ -152,7 +152,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia ...@@ -152,7 +152,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
Query query = new Query(dto); Query query = new Query(dto);
PageDataVO<SpecialRentVO> pages = PageDataVO.pageInfo(query, () -> baseBiz.selectByWeekend(w -> { PageDataVO<SpecialRentVO> pages = PageDataVO.pageInfo(query, () -> baseBiz.selectByWeekend(w -> {
w.andEqualTo(SpecialRent::getIsDel, SYS_FALSE); w.andEqualTo(SpecialRent::getIsDel, SYS_FALSE);
w.andEqualTo(SpecialRent::getPublishUserId, userDTO.getId()); w.andEqualTo(SpecialRent::getPublishCompanyId, getBusinessUserCompanyId());
return w; return w;
}, " crt_time desc "), SpecialRentVO.class); }, " crt_time desc "), SpecialRentVO.class);
......
...@@ -67,7 +67,7 @@ public class BgSpecialRentController extends BaseController<SpecialRentBiz, Spec ...@@ -67,7 +67,7 @@ public class BgSpecialRentController extends BaseController<SpecialRentBiz, Spec
@ApiOperation(value = "添加特惠租车") @ApiOperation(value = "添加特惠租车")
public ObjectRestResponse businessAddRent(@RequestBody SpecialRent specialRent) { public ObjectRestResponse businessAddRent(@RequestBody SpecialRent specialRent) {
UserDTO userDTO = getAdminUserInfoV2(); UserDTO userDTO = getAdminUserInfoV2();
baseBiz.addRent(specialRent, userDTO); baseBiz.addRent(specialRent, userDTO, getBgUserCompanyId());
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment