|
@@ -49,6 +49,8 @@ import vip.xiaonuo.biz.modular.bizappointmentrecord.entity.BizAppointmentRecord;
|
|
|
import vip.xiaonuo.biz.modular.bizappointmentrecord.service.BizAppointmentRecordService;
|
|
|
import vip.xiaonuo.biz.modular.bizconfig.entity.BizConfig;
|
|
|
import vip.xiaonuo.biz.modular.bizconfig.service.BizConfigService;
|
|
|
+import vip.xiaonuo.biz.modular.bizexcessconfig.entity.BizExcessConfig;
|
|
|
+import vip.xiaonuo.biz.modular.bizexcessconfig.service.BizExcessConfigService;
|
|
|
import vip.xiaonuo.biz.modular.bizorder.entity.BizOrder;
|
|
|
import vip.xiaonuo.biz.modular.bizorder.param.BizOrderEditParam;
|
|
|
import vip.xiaonuo.biz.modular.bizorder.service.BizOrderService;
|
|
@@ -112,6 +114,9 @@ public class BizRecordServiceImpl extends ServiceImpl<BizRecordMapper, BizRecord
|
|
|
@Resource
|
|
|
private CommonProperties commonProperties;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private BizExcessConfigService bizExcessConfigService;
|
|
|
+
|
|
|
@Override
|
|
|
public Page<BizRecord> page(BizRecordPageParam bizRecordPageParam) {
|
|
|
QueryWrapper<BizRecord> queryWrapper = getQueryWrapper(bizRecordPageParam);
|
|
@@ -591,6 +596,18 @@ public class BizRecordServiceImpl extends ServiceImpl<BizRecordMapper, BizRecord
|
|
|
@Override
|
|
|
public void updateDriverSign(BizRecordEditParam bizRecordEditParam) {
|
|
|
BizRecord bizRecord = this.queryEntity(bizRecordEditParam.getId());
|
|
|
+ if(ObjectUtil.isNotEmpty(bizRecord.getAppointmentId())){
|
|
|
+ BizAppointmentRecord appointmentRecord = bizAppointmentRecordService.getById(bizRecord.getAppointmentId());
|
|
|
+ if(ObjectUtil.isNotNull(appointmentRecord) && ObjectUtil.isNotEmpty(appointmentRecord.getOverId())){
|
|
|
+ //查询超限重量
|
|
|
+ BizExcessConfig excessConfig = bizExcessConfigService.getById(appointmentRecord.getOverId());
|
|
|
+ if(ObjectUtil.isNotNull(excessConfig)){
|
|
|
+ if(bizRecord.getGrossWeight().compareTo(excessConfig.getExcessWeight()) > 0){
|
|
|
+ throw new CommonException("当前车辆超限,请先卸货再确认!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if(ObjectUtil.isEmpty(bizRecordEditParam.getDriverSign())){
|
|
|
throw new CommonException("签名不能为空!");
|
|
|
}
|
|
@@ -605,27 +622,6 @@ public class BizRecordServiceImpl extends ServiceImpl<BizRecordMapper, BizRecord
|
|
|
bizRecord.setDriverConfirmTime(new Date());
|
|
|
this.updateById(bizRecord);
|
|
|
|
|
|
- //修改预约记录状态
|
|
|
- BizAppointmentRecord appointmentRecord = bizAppointmentRecordService.getById(bizRecord.getAppointmentId());
|
|
|
- if(ObjectUtil.isNotNull(appointmentRecord)){
|
|
|
- BizConfig bizConfig = bizConfigService.getOne(new QueryWrapper<BizConfig>().lambda().last("limit 1"));
|
|
|
- if(StringUtils.equals(bizConfig.getAccessControlSwitch(),"1")){
|
|
|
- //开启门禁校验
|
|
|
- //司机签名后修改为可出场状态
|
|
|
- appointmentRecord.setStatus("9");
|
|
|
- }else{
|
|
|
- appointmentRecord.setStatus("10");
|
|
|
- }
|
|
|
- bizAppointmentRecordService.updateById(appointmentRecord);
|
|
|
- }
|
|
|
-
|
|
|
- //司机确认后,修改订单
|
|
|
- BizOrder bizOrder = bizOrderService.getById(bizRecord.getOrderId());
|
|
|
- if(ObjectUtil.isNotNull(bizOrder)){
|
|
|
- bizOrder.setNetWeight(bizOrder.getNetWeight().add(bizRecord.getNetWeight()));
|
|
|
- bizOrderService.updateById(bizOrder);
|
|
|
- }
|
|
|
-
|
|
|
Map<String,Object> map = Maps.newHashMap();
|
|
|
map.put("id",bizRecord.getRelationId());
|
|
|
map.put("type","0");
|
|
@@ -635,6 +631,36 @@ public class BizRecordServiceImpl extends ServiceImpl<BizRecordMapper, BizRecord
|
|
|
log.info("司机确认mqtt下发车牌号:"+bizRecord.getLicensePlate());
|
|
|
}
|
|
|
|
|
|
+ @Transactional
|
|
|
+ public void mqttConfirm(BizRecordEditParam bizRecordEditParam){
|
|
|
+ BizRecord bizRecord = this.getOne(new QueryWrapper<BizRecord>().lambda().
|
|
|
+ eq(BizRecord::getRelationId, bizRecordEditParam.getId()).
|
|
|
+ last("limit 1"));
|
|
|
+ if(ObjectUtil.isNotNull(bizRecord)){
|
|
|
+ //修改预约记录状态
|
|
|
+ BizAppointmentRecord appointmentRecord = bizAppointmentRecordService.getById(bizRecord.getAppointmentId());
|
|
|
+ if(ObjectUtil.isNotNull(appointmentRecord)){
|
|
|
+ BizConfig bizConfig = bizConfigService.getOne(new QueryWrapper<BizConfig>().lambda().last("limit 1"));
|
|
|
+ if(StringUtils.equals(bizConfig.getAccessControlSwitch(),"1")){
|
|
|
+ //开启门禁校验
|
|
|
+ //司机签名后修改为可出场状态
|
|
|
+ appointmentRecord.setStatus("9");
|
|
|
+ }else{
|
|
|
+ appointmentRecord.setStatus("10");
|
|
|
+ }
|
|
|
+ bizAppointmentRecordService.updateById(appointmentRecord);
|
|
|
+ }
|
|
|
+
|
|
|
+ //司机确认后,修改订单重量
|
|
|
+ BizOrder bizOrder = bizOrderService.getById(bizRecord.getOrderId());
|
|
|
+ if(ObjectUtil.isNotNull(bizOrder)){
|
|
|
+ bizOrder.setNetWeight(bizOrder.getNetWeight().add(bizRecord.getNetWeight()));
|
|
|
+ bizOrderService.updateById(bizOrder);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public void updateWeight(BizRecordEditParam bizRecordEditParam) {
|