Commit fbe70d06 authored by libin's avatar libin

Merge remote-tracking branch 'origin/master' into master-member-feture-count

parents 4ddd5aef b332abe2
...@@ -16,6 +16,7 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO; ...@@ -16,6 +16,7 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.xxfc.platform.vehicle.entity.BranchCompany; import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.feign.VehicleFeign; import com.xxfc.platform.vehicle.feign.VehicleFeign;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -41,6 +42,7 @@ import java.util.stream.Collectors; ...@@ -41,6 +42,7 @@ import java.util.stream.Collectors;
@Transactional @Transactional
@DependsOn("appUserPositionBiz") @DependsOn("appUserPositionBiz")
@Service @Service
@Slf4j
public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, AppUserPositionTemp> implements InitializingBean { public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, AppUserPositionTemp> implements InitializingBean {
@Autowired @Autowired
...@@ -299,4 +301,38 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A ...@@ -299,4 +301,38 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
} }
public void setPostionIdByPhone(String phone){
try {
Example example = new Example(AppUserPositionTemp.class);
example.createCriteria().andEqualTo("phone", phone).andEqualTo("isDel", 0);
List<AppUserPositionTemp> list = selectByExample(example);
if (CollectionUtils.isEmpty(list)){
log.info("----用户无身份----phone==="+phone);
return;
}
AppUserPositionTemp positionTemp=list.get(0);
if (positionTemp.getUserId()>0){
log.info("----用户已存在身份----phone==="+phone);
return;
}
//根据手机号查询userId
AppUserLogin userLogin = loginBiz.checkeUserLogin(phone);
if (userLogin==null) {
log.info("----用户不存在----phone==="+phone);
return;
}
Integer userId=userLogin.getId();
positionTemp.setUserId(userId);
int num=updateSelectiveByIdRe(positionTemp);
if (num>0){
Integer postionId=positionTemp.getPositionId();
log.info("----用户---postionId===="+postionId+"----phone==="+phone);
detailBiz.updateUserPositionByUserId(userId, postionId);
}
}catch (Exception e){
e.printStackTrace();
}
}
} }
...@@ -111,6 +111,9 @@ public class AppPermissionService { ...@@ -111,6 +111,9 @@ public class AppPermissionService {
@Autowired @Autowired
private AppUserPhoneNotesBiz notesBiz; private AppUserPhoneNotesBiz notesBiz;
@Autowired
private AppUserPositionTempBiz positionTempBiz;
public AppUserInfo validate(String username, String password) { public AppUserInfo validate(String username, String password) {
AppUserInfo info = new AppUserInfo(); AppUserInfo info = new AppUserInfo();
...@@ -331,6 +334,8 @@ public class AppPermissionService { ...@@ -331,6 +334,8 @@ public class AppPermissionService {
//创建钱包 //创建钱包
walletBiz.createWalletByUserId(appUserLogin.getId()); walletBiz.createWalletByUserId(appUserLogin.getId());
log.info("注册:创建钱包: " + userid+"---time===="+System.currentTimeMillis()/1000L); log.info("注册:创建钱包: " + userid+"---time===="+System.currentTimeMillis()/1000L);
//临时身份绑定
positionTempBiz.setPostionIdByPhone(username);
// 登录结果要做做统一处理 // 登录结果要做做统一处理
JSONObject data = autoLogin(userid, username, headimgurl, nickname,code,activityCode,1); JSONObject data = autoLogin(userid, username, headimgurl, nickname,code,activityCode,1);
...@@ -967,6 +972,8 @@ public class AppPermissionService { ...@@ -967,6 +972,8 @@ public class AppPermissionService {
log.error("注册:新增用户详情: " + userid); log.error("注册:新增用户详情: " + userid);
//创建钱包 //创建钱包
walletBiz.createWalletByUserId(appUserLogin.getId()); walletBiz.createWalletByUserId(appUserLogin.getId());
//临时身份绑定
positionTempBiz.setPostionIdByPhone(username);
//临时会员绑定 //临时会员绑定
insertUserMemberByUserIdAndPhone(userid, username); insertUserMemberByUserIdAndPhone(userid, username);
//上线绑定 //上线绑定
......
...@@ -159,7 +159,7 @@ public class DailyMembersOrderStatisticsBiz extends BaseBiz<DailyMembersOrderSta ...@@ -159,7 +159,7 @@ public class DailyMembersOrderStatisticsBiz extends BaseBiz<DailyMembersOrderSta
} }
public OrderStatistics findAll(List<Integer> companyIds) { public OrderStatistics findAll(List<Integer> companyIds) {
return mapper.monthOrderTotal(companyIds); return mapper.monthOrderTotal(companyIds);
} }
/** /**
......
...@@ -46,12 +46,14 @@ public class OrderStatisticsBiz extends BaseBiz<OrderStatisticsMapper, OrderStat ...@@ -46,12 +46,14 @@ public class OrderStatisticsBiz extends BaseBiz<OrderStatisticsMapper, OrderStat
@Autowired @Autowired
private DailyMembersOrderStatisticsBiz membersStatisticsBiz; private DailyMembersOrderStatisticsBiz membersStatisticsBiz;
public HomePageOrderData getTotalOrder(List<Integer> companyIds) { public HomePageOrderData getTotalOrder(List<Integer> companyIds, Integer dataAll) {
HomePageOrderData result = new HomePageOrderData(); HomePageOrderData result = new HomePageOrderData();
ArrayList<HomePageOrderData> list = new ArrayList<>(); ArrayList<HomePageOrderData> list = new ArrayList<>();
list.add(getVehicleHomePageOrderData(companyIds)); list.add(getVehicleHomePageOrderData(companyIds));
list.add(getTourHomePageOrderData(companyIds)); list.add(getTourHomePageOrderData(companyIds));
list.add(getMemberHomePageOrderData(companyIds)); if (1==dataAll) {
list.add(getMemberHomePageOrderData(companyIds));
}
result.setTotalOrders(list.stream().map(HomePageOrderData::getTotalOrders).reduce(BigDecimal.ZERO, BigDecimal::add)); result.setTotalOrders(list.stream().map(HomePageOrderData::getTotalOrders).reduce(BigDecimal.ZERO, BigDecimal::add));
result.setTotalOutstandingDeposit(list.stream().map(HomePageOrderData::getTotalOutstandingDeposit).reduce(BigDecimal.ZERO, BigDecimal::add)); result.setTotalOutstandingDeposit(list.stream().map(HomePageOrderData::getTotalOutstandingDeposit).reduce(BigDecimal.ZERO, BigDecimal::add));
result.setAdditionalIndemnity(list.stream().map(HomePageOrderData::getAdditionalIndemnity).reduce(BigDecimal.ZERO, BigDecimal::add)); result.setAdditionalIndemnity(list.stream().map(HomePageOrderData::getAdditionalIndemnity).reduce(BigDecimal.ZERO, BigDecimal::add));
......
...@@ -18,7 +18,7 @@ public interface DailyMembersOrderStatisticsMapper extends Mapper<DailyMembersOr ...@@ -18,7 +18,7 @@ public interface DailyMembersOrderStatisticsMapper extends Mapper<DailyMembersOr
Map<String, Object> getTravelGmv(@Param("day") Integer day); Map<String, Object> getTravelGmv(@Param("day") Integer day);
OrderStatistics monthOrderTotal(List<Integer> companyIds); OrderStatistics monthOrderTotal(List<Integer> list);
......
...@@ -19,5 +19,5 @@ public interface DailyTravelOrderStatisticsMapper extends Mapper<DailyTravelOrde ...@@ -19,5 +19,5 @@ public interface DailyTravelOrderStatisticsMapper extends Mapper<DailyTravelOrde
List<DailyTravelOrderStatistics> getTravelPenalSum(@Param("day") Integer day); List<DailyTravelOrderStatistics> getTravelPenalSum(@Param("day") Integer day);
OrderStatistics monthOrderTotal(List<Integer> companyIds); OrderStatistics monthOrderTotal(List<Integer> list);
} }
...@@ -25,5 +25,5 @@ public interface DailyVehicleOrderStatisticsMapper extends Mapper<DailyVehicleOr ...@@ -25,5 +25,5 @@ public interface DailyVehicleOrderStatisticsMapper extends Mapper<DailyVehicleOr
List<DailyVehicleOrderStatistics> getViolationMoney(@Param("day") Integer day); List<DailyVehicleOrderStatistics> getViolationMoney(@Param("day") Integer day);
OrderStatistics monthOrderTotal(List<Integer> companyIds); OrderStatistics monthOrderTotal(@Param("list") List<Integer> list);
} }
...@@ -100,7 +100,7 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz ...@@ -100,7 +100,7 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz
UserDTO user = userDTOObjectRestResponse.getData(); UserDTO user = userDTOObjectRestResponse.getData();
List<Integer> companyIds = null; List<Integer> companyIds = null;
if (!DATA_AUTHORITY.equals(user.getDataAll())) { if (!DATA_AUTHORITY.equals(user.getDataAll())) {
companyIds = vehicleFeign.getCompanyIds().getData(); companyIds = vehicleFeign.getCompanyIds(user.getDataZone(), user.getDataCompany()).getData();
} }
//只统计租车订单 //只统计租车订单
if (TYPE_VEHICLE.equals(type)) { if (TYPE_VEHICLE.equals(type)) {
...@@ -111,12 +111,12 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz ...@@ -111,12 +111,12 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz
return ObjectRestResponse.succ(baseBiz.getTourHomePageOrderData(companyIds)); return ObjectRestResponse.succ(baseBiz.getTourHomePageOrderData(companyIds));
} }
//只统计会员订单 //只统计会员订单
if (TYPE_MEMBER.equals(type)) { if (TYPE_MEMBER.equals(type)||DATA_AUTHORITY.equals(user.getDataAll())) {
return ObjectRestResponse.succ(baseBiz.getMemberHomePageOrderData(companyIds)); return ObjectRestResponse.succ(baseBiz.getMemberHomePageOrderData(companyIds));
} }
//所有订单 //所有订单
if (TYPE_TOTAL.equals(type)) { if (TYPE_TOTAL.equals(type)) {
return ObjectRestResponse.succ(baseBiz.getTotalOrder(companyIds)); return ObjectRestResponse.succ(baseBiz.getTotalOrder(companyIds,user.getDataAll()));
} }
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "参数错误!"); return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "参数错误!");
} catch (Exception e) { } catch (Exception e) {
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
daily_members_order_statistics daily_members_order_statistics
WHERE WHERE
1=1 1=1
<if test="companyIds != null and companyIds.size()!=0"> <if test="list != null and list.size()!=0">
and branch_company_id in and branch_company_id in
<foreach collection="companyIds" index="index" item="companyId" open="(" separator="," close=")" > <foreach collection="list" index="index" item="companyId" open="(" separator="," close=")" >
#{companyId} #{companyId}
</foreach> </foreach>
</if> </if>
......
...@@ -58,9 +58,9 @@ ...@@ -58,9 +58,9 @@
daily_travel_order_statistics daily_travel_order_statistics
WHERE WHERE
1=1 1=1
<if test="companyIds != null and companyIds.size()!=0"> <if test="list != null and list.size()!=0">
and branch_company_id in and branch_company_id in
<foreach collection="companyIds" index="index" item="companyId" open="(" separator="," close=")" > <foreach collection="list" index="index" item="companyId" open="(" separator="," close=")" >
#{companyId} #{companyId}
</foreach> </foreach>
</if> </if>
......
...@@ -94,9 +94,9 @@ ...@@ -94,9 +94,9 @@
daily_vehicle_order_statistics daily_vehicle_order_statistics
WHERE WHERE
1=1 1=1
<if test="companyIds != null and companyIds.size()!=0"> <if test="list != null and list.size()!=0">
and branch_company_id in and branch_company_id in
<foreach collection="companyIds" index="index" item="companyId" open="(" separator="," close=")" > <foreach collection="list" index="index" item="companyId" open="(" separator="," close=")" >
#{companyId} #{companyId}
</foreach> </foreach>
</if> </if>
......
...@@ -182,4 +182,8 @@ public class VehicleModel implements Serializable { ...@@ -182,4 +182,8 @@ public class VehicleModel implements Serializable {
@Column(name = "img_desc") @Column(name = "img_desc")
@ApiModelProperty("seo*html标签优化") @ApiModelProperty("seo*html标签优化")
private String imgDesc; private String imgDesc;
@Column(name = "app_show")
@ApiModelProperty("是否在App展示")
private Integer appShow;
} }
package com.xxfc.platform.vehicle.feign; package com.xxfc.platform.vehicle.feign;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.GoodDataVO; import com.github.wxiaoqi.security.common.vo.GoodDataVO;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
...@@ -171,8 +172,8 @@ public interface VehicleFeign { ...@@ -171,8 +172,8 @@ public interface VehicleFeign {
@RequestMapping(value = "/vehicleInfo/bookRecord/update", method = RequestMethod.POST) @RequestMapping(value = "/vehicleInfo/bookRecord/update", method = RequestMethod.POST)
public ObjectRestResponse update(@RequestBody BookRecordUpdateLog bookRecordUpdateLog); public ObjectRestResponse update(@RequestBody BookRecordUpdateLog bookRecordUpdateLog);
@RequestMapping(value ="/branchCompany/app/unauth/getCompanyIds",method = RequestMethod.GET) @GetMapping(value ="/branchCompany/getCompanyIds")
RestResponse<List<Integer>> getCompanyIds(); RestResponse<List<Integer>> getCompanyIds(@RequestParam(value = "dataZone")String dataZone ,@RequestParam(value = "dataCompany")String dataCompany);
@GetMapping(value = "/bookRecord/get") @GetMapping(value = "/bookRecord/get")
public ObjectRestResponse<List<BookRecordUpdateLog>> get(@RequestParam(value = "bookRecordId")Long bookRecordId); public ObjectRestResponse<List<BookRecordUpdateLog>> get(@RequestParam(value = "bookRecordId")Long bookRecordId);
......
...@@ -413,8 +413,7 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany ...@@ -413,8 +413,7 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
return ObjectRestResponse.succ(list); return ObjectRestResponse.succ(list);
} }
public List<Integer> getCompanyIds() { public List<Integer> getCompanyIds(String dataZone ,String dataCompany) {
UserDTO userDTO = getAdminUserInfo(); return vehicleBiz.dataCompany(dataZone, dataCompany);
return vehicleBiz.dataCompany(userDTO.getDataZone(), userDTO.getDataCompany());
} }
} }
...@@ -62,10 +62,12 @@ public class VehicleActiveService { ...@@ -62,10 +62,12 @@ public class VehicleActiveService {
log.info("出车参数: departureVo = {}", departureVo.toString()); log.info("出车参数: departureVo = {}", departureVo.toString());
Vehicle vehicle = vehicleBiz.selectById(departureVo.getVehicleId()); Vehicle vehicle = vehicleBiz.selectById(departureVo.getVehicleId());
if (vehicle == null) { if (vehicle == null) {
log.info("出车异常,车辆不存在!");
throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc(), throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getDesc(),
ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode()); ResCode.VEHICLE_DEPARTURE_VEHICLE_UNEXIST.getCode());
} }
if (StringUtils.isBlank(departureVo.getCheckMan()) || StringUtils.isBlank(departureVo.getCheckManTel())) { if (StringUtils.isBlank(departureVo.getCheckMan()) || StringUtils.isBlank(departureVo.getCheckManTel())) {
log.error("出车 核销人姓名不能为空!");
throw new BaseException(ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getDesc(), throw new BaseException(ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getDesc(),
ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getCode()); ResCode.CHECKUSER_AND_PHONE_NOT_NULL.getCode());
} }
...@@ -74,7 +76,11 @@ public class VehicleActiveService { ...@@ -74,7 +76,11 @@ public class VehicleActiveService {
ResCode.VEHICLE_STATUS_IS_NOT_NORMAL.getCode()); ResCode.VEHICLE_STATUS_IS_NOT_NORMAL.getCode());
} }
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态 //添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
checkDateInvalid(departureVo); try {
checkDateInvalid(departureVo);
} catch (BaseException b) {
throw new BaseException(b.getMessage(), b.getStatus());
}
Integer MileageLift = vehicle.getMileageLastUpdate(); Integer MileageLift = vehicle.getMileageLastUpdate();
Integer MileageLift1 = departureVo.getMileage(); Integer MileageLift1 = departureVo.getMileage();
if (MileageLift1 == null) { if (MileageLift1 == null) {
...@@ -215,10 +221,6 @@ public class VehicleActiveService { ...@@ -215,10 +221,6 @@ public class VehicleActiveService {
} }
// 写入车辆公里数,还车分公司id // 写入车辆公里数,还车分公司id
vehicle.setMileageLastUpdate(MileageRest1); vehicle.setMileageLastUpdate(MileageRest1);
if (vehicleBookRecord != null) {
vehicle.setParkBranchCompanyId(vehicleBookRecord.getRetCompany());
}
// 出车记录 // 出车记录
VehicleDepartureLogVo departureLogVo = vehicleDepartureLogMapper.selectByBookRecordId(arrivalVo.getBookRecordId()); VehicleDepartureLogVo departureLogVo = vehicleDepartureLogMapper.selectByBookRecordId(arrivalVo.getBookRecordId());
...@@ -263,7 +265,7 @@ public class VehicleActiveService { ...@@ -263,7 +265,7 @@ public class VehicleActiveService {
throw new BaseException(ResCode.VEHICLE_UNBOOK_FAIL.getDesc(), ResCode.VEHICLE_UNBOOK_FAIL.getCode()); throw new BaseException(ResCode.VEHICLE_UNBOOK_FAIL.getDesc(), ResCode.VEHICLE_UNBOOK_FAIL.getCode());
} }
} catch (Exception e) { } catch (Exception e) {
log.info("提前还车失败,bookVehicleVo = {}", bookVehicleVo.toString()); log.error("提前还车失败,bookVehicleVo = {}", bookVehicleVo.toString());
e.printStackTrace(); e.printStackTrace();
} }
} else if (actualArrivalDate.compareTo(arrivalDate) > 0) {//实际还车时间大于预计还车时间 } else if (actualArrivalDate.compareTo(arrivalDate) > 0) {//实际还车时间大于预计还车时间
...@@ -343,6 +345,7 @@ public class VehicleActiveService { ...@@ -343,6 +345,7 @@ public class VehicleActiveService {
} }
} }
if (!(startDate.minusDays(1).compareTo(DateTime.now()) <= 0 && DateTime.now().compareTo(endDate) <= 0 && vehicleBookRecord.getStatus() == VehicleBookRecordStatus.APPROVE.getCode() && (list == null || list.size() <= 0))) { if (!(startDate.minusDays(1).compareTo(DateTime.now()) <= 0 && DateTime.now().compareTo(endDate) <= 0 && vehicleBookRecord.getStatus() == VehicleBookRecordStatus.APPROVE.getCode() && (list == null || list.size() <= 0))) {
log.error("出车过滤,有正常未还车记录,请按照预定的日期出车");
throw new BaseException(ResCode.VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED.getDesc(), throw new BaseException(ResCode.VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED.getDesc(),
ResCode.VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED.getCode()); ResCode.VEHICLE_DEPARTURE_DATE_IS_NOT_ABLED.getCode());
} }
......
...@@ -83,6 +83,9 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -83,6 +83,9 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
@Autowired @Autowired
VehicleActiveService vehicleActiveService; VehicleActiveService vehicleActiveService;
@Autowired
VehicleBiz vehicleBiz;
@Override @Override
public UserFeign getUserFeign() { public UserFeign getUserFeign() {
return userFeign; return userFeign;
...@@ -252,6 +255,15 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic ...@@ -252,6 +255,15 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
if(a <= 0) { if(a <= 0) {
return ObjectRestResponse.createDefaultFail(); return ObjectRestResponse.createDefaultFail();
} }
//出行中才修改车辆停靠分公司
VehicleDepartureLogVo vehicleDepartureLogVo = vehicleDepartureService.getByRecordId(vehicleBookRecord.getId());
if (vehicleDepartureLogVo != null && vehicleDepartureLogVo.getState() == 0) {
Vehicle vehicle = vehicleBiz.selectById(vehicleBookRecord.getVehicleId());
if (vehicle != null) {
vehicle.setParkBranchCompanyId(vehicleBookRecord.getRetCompany());
vehicleBiz.updateSelectiveByIdRe(vehicle);
}
}
return bookRecordUpdateLogBiz.save(bookRecordUpdateLog); return bookRecordUpdateLogBiz.save(bookRecordUpdateLog);
} else { } else {
return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_BOOK_RECORD_IS_NOT_EXIST.getCode(), ResCode.VEHICLE_BOOK_RECORD_IS_NOT_EXIST.getDesc()); return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_BOOK_RECORD_IS_NOT_EXIST.getCode(), ResCode.VEHICLE_BOOK_RECORD_IS_NOT_EXIST.getDesc());
......
...@@ -221,10 +221,10 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> { ...@@ -221,10 +221,10 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
return baseBiz.branchCompans(); return baseBiz.branchCompans();
} }
@RequestMapping(value ="/app/unauth/getCompanyIds",method = RequestMethod.GET)
public RestResponse<List<Integer>> getCompanyIds() {
return RestResponse.suc(baseBiz.getCompanyIds());
@GetMapping(value ="/getCompanyIds")
public RestResponse<List<Integer>> getCompanyIds(@RequestParam(value = "dataZone",defaultValue ="")String dataZone ,@RequestParam(value = "dataCompany")String dataCompany) {
return RestResponse.suc(baseBiz.getCompanyIds(dataZone,dataCompany));
} }
} }
...@@ -78,6 +78,9 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use ...@@ -78,6 +78,9 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
@Autowired @Autowired
BookRecordUpdateLogBiz bookRecordUpdateLogBiz; BookRecordUpdateLogBiz bookRecordUpdateLogBiz;
@Autowired
VehicleDepartureService vehicleDepartureService;
public UserFeign getUserFeign() { public UserFeign getUserFeign() {
return userFeign; return userFeign;
...@@ -335,6 +338,14 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use ...@@ -335,6 +338,14 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
bookRecordUpdateLog.setOperaterId(userDTO.getId()); bookRecordUpdateLog.setOperaterId(userDTO.getId());
bookRecordUpdateLog.setOperaterName(userDTO.getName()); bookRecordUpdateLog.setOperaterName(userDTO.getName());
bookRecordUpdateLog.setCreateTime(new Date()); bookRecordUpdateLog.setCreateTime(new Date());
VehicleDepartureLogVo vehicleDepartureLogVo = vehicleDepartureService.getByRecordId(oldValue.getId());
if (vehicleDepartureLogVo != null && vehicleDepartureLogVo.getState() == 0) {
Vehicle vehicle = vehicleBiz.selectById(oldValue.getVehicleId());
if (vehicle != null) {
vehicle.setParkBranchCompanyId(oldValue.getRetCompany());
vehicleBiz.updateSelectiveByIdRe(vehicle);
}
}
vehicleBookRecordBiz.updateSelectiveByIdRe(vehicleBookRecord); vehicleBookRecordBiz.updateSelectiveByIdRe(vehicleBookRecord);
return bookRecordUpdateLogBiz.save(bookRecordUpdateLog); return bookRecordUpdateLogBiz.save(bookRecordUpdateLog);
} else { } else {
......
...@@ -18,6 +18,7 @@ import com.xxfc.platform.vehicle.biz.VehicleCataBiz; ...@@ -18,6 +18,7 @@ import com.xxfc.platform.vehicle.biz.VehicleCataBiz;
import com.xxfc.platform.vehicle.biz.VehicleModelBiz; import com.xxfc.platform.vehicle.biz.VehicleModelBiz;
import com.xxfc.platform.vehicle.biz.VehiclePlatCataBiz; import com.xxfc.platform.vehicle.biz.VehiclePlatCataBiz;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.entity.VehicleCata; import com.xxfc.platform.vehicle.entity.VehicleCata;
import com.xxfc.platform.vehicle.entity.VehicleModel; import com.xxfc.platform.vehicle.entity.VehicleModel;
import com.xxfc.platform.vehicle.pojo.VModelDetailVO; import com.xxfc.platform.vehicle.pojo.VModelDetailVO;
...@@ -292,7 +293,20 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi ...@@ -292,7 +293,20 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
} }
} }
@ApiOperation("是否在App展示")
@PostMapping(value = "/bg/updateAppShow")
public ObjectRestResponse<VehicleModel> updateAppShow(@RequestBody VehicleModel vehicleModel) {
if (vehicleModel == null || vehicleModel.getId() == null) {
return ObjectRestResponse.paramIsEmpty();
}
VehicleModel oldValue = vehicleModelBiz.selectById(vehicleModel.getId());
if (oldValue == null) {
return ObjectRestResponse.createFailedResult(ResCode.FIND_DATA_NOT_EXIST.getCode(), ResCode.FIND_DATA_NOT_EXIST.getDesc());
}
oldValue.setAppShow(vehicleModel.getAppShow());
vehicleModelBiz.updateByPrimaryKeySelective(oldValue);
return ObjectRestResponse.succ();
}
@ApiOperation("删除") @ApiOperation("删除")
@DeleteMapping(value = "/app/{id}") @DeleteMapping(value = "/app/{id}")
......
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