|
@@ -32,7 +32,11 @@ import vip.xiaonuo.biz.modular.bizappointmenttime.entity.BizAppointmentTime;
|
|
import vip.xiaonuo.biz.modular.bizappointmenttime.service.BizAppointmentTimeService;
|
|
import vip.xiaonuo.biz.modular.bizappointmenttime.service.BizAppointmentTimeService;
|
|
import vip.xiaonuo.biz.modular.bizconfig.entity.BizConfig;
|
|
import vip.xiaonuo.biz.modular.bizconfig.entity.BizConfig;
|
|
import vip.xiaonuo.biz.modular.bizconfig.service.BizConfigService;
|
|
import vip.xiaonuo.biz.modular.bizconfig.service.BizConfigService;
|
|
|
|
+import vip.xiaonuo.biz.modular.bizorder.entity.BizOrder;
|
|
import vip.xiaonuo.biz.modular.bizorder.param.BizOrderExportResult;
|
|
import vip.xiaonuo.biz.modular.bizorder.param.BizOrderExportResult;
|
|
|
|
+import vip.xiaonuo.biz.modular.bizorder.service.BizOrderService;
|
|
|
|
+import vip.xiaonuo.biz.modular.goods.entity.BizGoods;
|
|
|
|
+import vip.xiaonuo.biz.modular.goods.service.BizGoodsService;
|
|
import vip.xiaonuo.biz.modular.utils.CommonExportUtil;
|
|
import vip.xiaonuo.biz.modular.utils.CommonExportUtil;
|
|
import vip.xiaonuo.common.enums.CommonSortOrderEnum;
|
|
import vip.xiaonuo.common.enums.CommonSortOrderEnum;
|
|
import vip.xiaonuo.common.exception.CommonException;
|
|
import vip.xiaonuo.common.exception.CommonException;
|
|
@@ -60,6 +64,10 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
private BizAppointmentTimeService bizAppointmentTimeService;
|
|
private BizAppointmentTimeService bizAppointmentTimeService;
|
|
@Resource
|
|
@Resource
|
|
private TransService transService;
|
|
private TransService transService;
|
|
|
|
+ @Resource
|
|
|
|
+ private BizOrderService bizOrderService;
|
|
|
|
+ @Resource
|
|
|
|
+ private BizGoodsService bizGoodsService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Page<BizAppointmentRecord> page(BizAppointmentRecordPageParam bizAppointmentRecordPageParam) {
|
|
public Page<BizAppointmentRecord> page(BizAppointmentRecordPageParam bizAppointmentRecordPageParam) {
|
|
@@ -93,6 +101,10 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getStatus())){
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getStatus())){
|
|
queryWrapper.eq("bar.status",bizAppointmentRecordPageParam.getStatus());
|
|
queryWrapper.eq("bar.status",bizAppointmentRecordPageParam.getStatus());
|
|
}
|
|
}
|
|
|
|
+ //车辆排队去除审核状态
|
|
|
|
+ if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getAppointmentFlag())){
|
|
|
|
+ queryWrapper.notIn("bar.status","1","2");
|
|
|
|
+ }
|
|
queryWrapper.eq("bar.delete_flag","NOT_DELETE");
|
|
queryWrapper.eq("bar.delete_flag","NOT_DELETE");
|
|
queryWrapper.orderByDesc("bar.create_time");
|
|
queryWrapper.orderByDesc("bar.create_time");
|
|
return queryWrapper;
|
|
return queryWrapper;
|
|
@@ -118,8 +130,10 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
|
|
|
//更新时间段内已预约数
|
|
//更新时间段内已预约数
|
|
BizAppointmentTime bizAppointmentTime = bizAppointmentTimeService.getById(bizAppointmentRecordAddParam.getTimeId());
|
|
BizAppointmentTime bizAppointmentTime = bizAppointmentTimeService.getById(bizAppointmentRecordAddParam.getTimeId());
|
|
- bizAppointmentTime.setApplyNumberAlready(bizAppointmentTime.getApplyNumberAlready()+1);
|
|
|
|
- bizAppointmentTimeService.updateById(bizAppointmentTime);
|
|
|
|
|
|
+ if(ObjectUtil.isNotNull(bizAppointmentTime)){
|
|
|
|
+ bizAppointmentTime.setApplyNumberAlready(bizAppointmentTime.getApplyNumberAlready()+1);
|
|
|
|
+ bizAppointmentTimeService.updateById(bizAppointmentTime);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public void checkParam(BizAppointmentRecordAddParam bizAppointmentRecordAddParam){
|
|
public void checkParam(BizAppointmentRecordAddParam bizAppointmentRecordAddParam){
|
|
@@ -203,6 +217,17 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
public void edit(BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
|
|
public void edit(BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordEditParam.getId());
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordEditParam.getId());
|
|
checkParam(bizAppointmentRecordEditParam,bizAppointmentRecord);
|
|
checkParam(bizAppointmentRecordEditParam,bizAppointmentRecord);
|
|
|
|
+ if(!StringUtils.equals(bizAppointmentRecord.getTimeId(),bizAppointmentRecordEditParam.getTimeId())){
|
|
|
|
+ //调整了预约时段,释放之前预约时段的预约次数
|
|
|
|
+ BizAppointmentTime bizAppointmentTime = bizAppointmentTimeService.getById(bizAppointmentRecord.getTimeId());
|
|
|
|
+ bizAppointmentTime.setApplyNumberAlready(bizAppointmentTime.getApplyNumberAlready()-1);
|
|
|
|
+ bizAppointmentTimeService.updateById(bizAppointmentTime);
|
|
|
|
+
|
|
|
|
+ //新的预约时段,增加已约次数
|
|
|
|
+ BizAppointmentTime time = bizAppointmentTimeService.getById(bizAppointmentRecordEditParam.getTimeId());
|
|
|
|
+ time.setApplyNumberAlready(time.getApplyNumberAlready()+1);
|
|
|
|
+ bizAppointmentTimeService.updateById(time);
|
|
|
|
+ }
|
|
BeanUtil.copyProperties(bizAppointmentRecordEditParam, bizAppointmentRecord);
|
|
BeanUtil.copyProperties(bizAppointmentRecordEditParam, bizAppointmentRecord);
|
|
if(StringUtils.equals(bizAppointmentRecord.getStatus(),"2")){
|
|
if(StringUtils.equals(bizAppointmentRecord.getStatus(),"2")){
|
|
//如果当前状态是审核不通过的状态,修改后重新提交审核
|
|
//如果当前状态是审核不通过的状态,修改后重新提交审核
|
|
@@ -218,8 +243,10 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
for(BizAppointmentRecordIdParam bizAppointmentRecordIdParam : bizAppointmentRecordIdParamList){
|
|
for(BizAppointmentRecordIdParam bizAppointmentRecordIdParam : bizAppointmentRecordIdParamList){
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
|
|
BizAppointmentTime bizAppointmentTime = bizAppointmentTimeService.getById(bizAppointmentRecord.getTimeId());
|
|
BizAppointmentTime bizAppointmentTime = bizAppointmentTimeService.getById(bizAppointmentRecord.getTimeId());
|
|
- bizAppointmentTime.setApplyNumberAlready(bizAppointmentTime.getApplyNumberAlready()-1);
|
|
|
|
- bizAppointmentTimeService.updateById(bizAppointmentTime);
|
|
|
|
|
|
+ if(ObjectUtil.isNotNull(bizAppointmentTime)){
|
|
|
|
+ bizAppointmentTime.setApplyNumberAlready(bizAppointmentTime.getApplyNumberAlready()-1);
|
|
|
|
+ bizAppointmentTimeService.updateById(bizAppointmentTime);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 执行删除
|
|
// 执行删除
|
|
this.removeByIds(CollStreamUtil.toList(bizAppointmentRecordIdParamList, BizAppointmentRecordIdParam::getId));
|
|
this.removeByIds(CollStreamUtil.toList(bizAppointmentRecordIdParamList, BizAppointmentRecordIdParam::getId));
|
|
@@ -272,7 +299,95 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public BizAppointmentRecord checkAppointmentRecord(BizAppointmentRecordPageParam bizAppointmentRecordPageParam) {
|
|
public BizAppointmentRecord checkAppointmentRecord(BizAppointmentRecordPageParam bizAppointmentRecordPageParam) {
|
|
- return null;
|
|
|
|
|
|
+ //根据车牌号和状态查询
|
|
|
|
+ BizAppointmentRecord bizAppointmentRecord = this.getOne(new QueryWrapper<BizAppointmentRecord>().lambda().
|
|
|
|
+ eq(BizAppointmentRecord::getLicenseNumber, bizAppointmentRecordPageParam.getLicenseNumber()).
|
|
|
|
+ eq(BizAppointmentRecord::getStatus, bizAppointmentRecordPageParam.getStatus()).
|
|
|
|
+ last("limit 1"));
|
|
|
|
+ if(StringUtils.equals(bizAppointmentRecordPageParam.getStatus(),"4")){
|
|
|
|
+ //待入场,如果为空,没有待入场的记录,不可进门禁
|
|
|
|
+ if(ObjectUtil.isNull(bizAppointmentRecord)){
|
|
|
|
+ bizAppointmentRecord = new BizAppointmentRecord();
|
|
|
|
+ bizAppointmentRecord.setIsFlag("4");
|
|
|
|
+ }else{
|
|
|
|
+ bizAppointmentRecord = setBizAppointmentRecord(bizAppointmentRecord);
|
|
|
|
+ }
|
|
|
|
+ }else if(StringUtils.equals(bizAppointmentRecordPageParam.getStatus(),"5")){
|
|
|
|
+ //已入场,如果为空,没有已入场的记录,不可一次过磅
|
|
|
|
+ if(ObjectUtil.isNull(bizAppointmentRecord)){
|
|
|
|
+ bizAppointmentRecord = new BizAppointmentRecord();
|
|
|
|
+ bizAppointmentRecord.setIsFlag("5");
|
|
|
|
+ }else{
|
|
|
|
+ bizAppointmentRecord = setBizAppointmentRecord(bizAppointmentRecord);
|
|
|
|
+ }
|
|
|
|
+ }else if(StringUtils.equals(bizAppointmentRecordPageParam.getStatus(),"7")){
|
|
|
|
+ //完成装货,如果为空,没有完成装货的记录,不可二次过磅
|
|
|
|
+ if(ObjectUtil.isNull(bizAppointmentRecord)){
|
|
|
|
+ bizAppointmentRecord = new BizAppointmentRecord();
|
|
|
|
+ bizAppointmentRecord.setIsFlag("7");
|
|
|
|
+ }else{
|
|
|
|
+ bizAppointmentRecord = setBizAppointmentRecord(bizAppointmentRecord);
|
|
|
|
+ }
|
|
|
|
+ }else if(StringUtils.equals(bizAppointmentRecordPageParam.getStatus(),"9")){
|
|
|
|
+ //待出场,如果为空,没有待出场的记录,不可出门禁
|
|
|
|
+ if(ObjectUtil.isNull(bizAppointmentRecord)){
|
|
|
|
+ bizAppointmentRecord = new BizAppointmentRecord();
|
|
|
|
+ bizAppointmentRecord.setIsFlag("9");
|
|
|
|
+ }else{
|
|
|
|
+ bizAppointmentRecord = setBizAppointmentRecord(bizAppointmentRecord);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return bizAppointmentRecord;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void cancelAppointmentRecord(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
|
|
|
|
+ BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
|
|
|
|
+ //设置已取消
|
|
|
|
+ bizAppointmentRecord.setStatus("14");
|
|
|
|
+ this.updateById(bizAppointmentRecord);
|
|
|
|
+
|
|
|
|
+ //释放预约数
|
|
|
|
+ BizAppointmentTime bizAppointmentTime = bizAppointmentTimeService.getById(bizAppointmentRecord.getTimeId());
|
|
|
|
+ if(ObjectUtil.isNotNull(bizAppointmentTime)){
|
|
|
|
+ bizAppointmentTime.setApplyNumberAlready(bizAppointmentTime.getApplyNumberAlready()-1);
|
|
|
|
+ bizAppointmentTimeService.updateById(bizAppointmentTime);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void adjustOrder(BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
|
|
|
|
+ BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordEditParam.getId());
|
|
|
|
+ if(!StringUtils.equals(bizAppointmentRecord.getOrderId(),bizAppointmentRecordEditParam.getOrderId())){
|
|
|
|
+ //调整过订单
|
|
|
|
+ if(StringUtils.equals(bizAppointmentRecord.getStatus(),"8") || StringUtils.equals(bizAppointmentRecord.getStatus(),"9")){
|
|
|
|
+ //当前状态已完成二次过磅,重量已经添加到订单中,要扣去添加的重量
|
|
|
|
+ BizOrder bizOrder = bizOrderService.getById(bizAppointmentRecord.getOrderId());
|
|
|
|
+ if(ObjectUtil.isNotNull(bizOrder)){
|
|
|
|
+ //bizOrder.setNetWeight(bi);
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ bizAppointmentRecord.setOrderId(bizAppointmentRecordEditParam.getOrderId());
|
|
|
|
+ }
|
|
|
|
+ this.updateById(bizAppointmentRecord);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public BizAppointmentRecord setBizAppointmentRecord(BizAppointmentRecord bizAppointmentRecord){
|
|
|
|
+ bizAppointmentRecord.setIsFlag("1");
|
|
|
|
+ if(ObjectUtil.isNotEmpty(bizAppointmentRecord.getOrderId())){
|
|
|
|
+ BizOrder bizOrder = bizOrderService.getById(bizAppointmentRecord.getOrderId());
|
|
|
|
+ if(ObjectUtil.isNotNull(bizOrder)){
|
|
|
|
+ if(ObjectUtil.isNotEmpty(bizOrder.getGoodId())){
|
|
|
|
+ BizGoods bizGoods = bizGoodsService.getById(bizOrder.getGoodId());
|
|
|
|
+ if(ObjectUtil.isNotNull(bizGoods)){
|
|
|
|
+ bizAppointmentRecord.setGoodsName(bizGoods.getName());
|
|
|
|
+ bizAppointmentRecord.setGoodsModel(bizGoods.getModel());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return bizAppointmentRecord;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|