|
@@ -122,6 +122,12 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
|
|
|
public QueryWrapper<BizAppointmentRecord> getQueryWrapper(BizAppointmentRecordPageParam bizAppointmentRecordPageParam){
|
|
public QueryWrapper<BizAppointmentRecord> getQueryWrapper(BizAppointmentRecordPageParam bizAppointmentRecordPageParam){
|
|
QueryWrapper<BizAppointmentRecord> queryWrapper = new QueryWrapper<BizAppointmentRecord>().checkSqlInjection();
|
|
QueryWrapper<BizAppointmentRecord> queryWrapper = new QueryWrapper<BizAppointmentRecord>().checkSqlInjection();
|
|
|
|
+ if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getType())){
|
|
|
|
+ queryWrapper.eq("bar.appointment_type",bizAppointmentRecordPageParam.getType());
|
|
|
|
+ }
|
|
|
|
+ if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getAppointmentClassify())){
|
|
|
|
+ queryWrapper.eq("bar.appointment_classify",bizAppointmentRecordPageParam.getAppointmentClassify());
|
|
|
|
+ }
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getOrderName())){
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getOrderName())){
|
|
queryWrapper.like("bo.order_name",bizAppointmentRecordPageParam.getOrderName());
|
|
queryWrapper.like("bo.order_name",bizAppointmentRecordPageParam.getOrderName());
|
|
}
|
|
}
|
|
@@ -168,6 +174,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
BizConfig bizConfig = bizConfigService.getOne(new QueryWrapper<BizConfig>().lambda().last("limit 1"));
|
|
BizConfig bizConfig = bizConfigService.getOne(new QueryWrapper<BizConfig>().lambda().last("limit 1"));
|
|
BizAppointmentRecord bizAppointmentRecord = BeanUtil.toBean(bizAppointmentRecordAddParam, BizAppointmentRecord.class);
|
|
BizAppointmentRecord bizAppointmentRecord = BeanUtil.toBean(bizAppointmentRecordAddParam, BizAppointmentRecord.class);
|
|
bizAppointmentRecord.setTimeId(bizOrderService.queryEntity(bizAppointmentRecordAddParam.getOrderId()).getDeliveryTimeId());
|
|
bizAppointmentRecord.setTimeId(bizOrderService.queryEntity(bizAppointmentRecordAddParam.getOrderId()).getDeliveryTimeId());
|
|
|
|
+ bizAppointmentRecord.setAppointmentType("1");
|
|
if(ObjectUtil.isNotNull(bizConfig)){
|
|
if(ObjectUtil.isNotNull(bizConfig)){
|
|
if(StringUtils.equals(bizConfig.getAuditSwitch(),"1")){
|
|
if(StringUtils.equals(bizConfig.getAuditSwitch(),"1")){
|
|
//开启审核,设置待审核状态
|
|
//开启审核,设置待审核状态
|
|
@@ -198,6 +205,70 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
}*/
|
|
}*/
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ @Override
|
|
|
|
+ public void addTemp(BizAppointmentRecordAddParam bizAppointmentRecordAddParam) {
|
|
|
|
+ checkTempParam(bizAppointmentRecordAddParam);
|
|
|
|
+ //获取流程配置判断预约是否需要审核
|
|
|
|
+ BizConfig bizConfig = bizConfigService.getOne(new QueryWrapper<BizConfig>().lambda().last("limit 1"));
|
|
|
|
+ BizAppointmentRecord bizAppointmentRecord = BeanUtil.toBean(bizAppointmentRecordAddParam, BizAppointmentRecord.class);
|
|
|
|
+ if(ObjectUtil.isNotNull(bizConfig)){
|
|
|
|
+ if(StringUtils.equals(bizConfig.getTemporaryAuditSwitch(),"1")){
|
|
|
|
+ //开启审核,设置待审核状态
|
|
|
|
+ bizAppointmentRecord.setStatus("1");
|
|
|
|
+ }else{
|
|
|
|
+ //未开启审核,设置待入场状态
|
|
|
|
+ bizAppointmentRecord.setStatus("4");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ bizAppointmentRecord.setAppointmentType("2");
|
|
|
|
+ this.save(bizAppointmentRecord);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //临时预约校验
|
|
|
|
+ public void checkTempParam(BizAppointmentRecordAddParam bizAppointmentRecordAddParam){
|
|
|
|
+ //校验车牌号
|
|
|
|
+ if(ObjectUtil.isNotEmpty(bizAppointmentRecordAddParam.getLicenseNumber())){
|
|
|
|
+ bizAppointmentRecordAddParam.setLicenseNumber(bizAppointmentRecordAddParam.getLicenseNumber().toUpperCase().trim());
|
|
|
|
+ //校验车牌号是否添加过预约,排除11:已签收、 13:销售已审核 、 14:已取消
|
|
|
|
+ long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda().
|
|
|
|
+ eq(BizAppointmentRecord::getLicenseNumber,bizAppointmentRecordAddParam.getLicenseNumber()).
|
|
|
|
+ notIn(BizAppointmentRecord::getStatus, "10","11","12", "13", "14","15"));
|
|
|
|
+ if(count>0){
|
|
|
|
+ throw new CommonException("车牌号:{}已经添加过预约!",bizAppointmentRecordAddParam.getLicenseNumber());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //校验手机号
|
|
|
|
+ if(ObjectUtil.isNotEmpty(bizAppointmentRecordAddParam.getDriverMobile())){
|
|
|
|
+ if(!PhoneUtil.isMobile(bizAppointmentRecordAddParam.getDriverMobile())) {
|
|
|
|
+ throw new CommonException("手机号码:{}格式错误", bizAppointmentRecordAddParam.getDriverMobile());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void checkTempParam(BizAppointmentRecordEditParam bizAppointmentRecordEditParam,BizAppointmentRecord bizAppointmentRecord){
|
|
|
|
+ //校验车牌号
|
|
|
|
+ if(ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getLicenseNumber())){
|
|
|
|
+ bizAppointmentRecordEditParam.setLicenseNumber(bizAppointmentRecordEditParam.getLicenseNumber().toUpperCase().trim());
|
|
|
|
+ if(!StringUtils.equals(bizAppointmentRecordEditParam.getLicenseNumber(),bizAppointmentRecord.getLicenseNumber())){
|
|
|
|
+ //校验车牌号是否添加过预约,排除11:已签收、 13:销售已审核 、 14:已取消
|
|
|
|
+ long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda().
|
|
|
|
+ eq(BizAppointmentRecord::getLicenseNumber,bizAppointmentRecordEditParam.getLicenseNumber()).
|
|
|
|
+ notIn(BizAppointmentRecord::getStatus, "10","11","12", "13", "14","15"));
|
|
|
|
+ if(count>0){
|
|
|
|
+ throw new CommonException("车牌号:{}已经添加过预约!",bizAppointmentRecordEditParam.getLicenseNumber());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ //校验手机号
|
|
|
|
+ if(ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getDriverMobile())){
|
|
|
|
+ if(!PhoneUtil.isMobile(bizAppointmentRecordEditParam.getDriverMobile())) {
|
|
|
|
+ throw new CommonException("手机号码:{}格式错误", bizAppointmentRecordEditParam.getDriverMobile());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public void saveRecord(BizAppointmentRecord bizAppointmentRecord){
|
|
public void saveRecord(BizAppointmentRecord bizAppointmentRecord){
|
|
//排队中
|
|
//排队中
|
|
lock.lock();
|
|
lock.lock();
|
|
@@ -375,6 +446,21 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
this.updateById(bizAppointmentRecord);
|
|
this.updateById(bizAppointmentRecord);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void editTemp(BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
|
|
|
|
+ BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordEditParam.getId());
|
|
|
|
+ if(ObjectUtil.isEmpty(bizAppointmentRecordEditParam.getStatus())){
|
|
|
|
+ bizAppointmentRecordEditParam.setStatus(bizAppointmentRecord.getStatus());
|
|
|
|
+ }
|
|
|
|
+ checkTempParam(bizAppointmentRecordEditParam, bizAppointmentRecord);
|
|
|
|
+ BeanUtil.copyProperties(bizAppointmentRecordEditParam, bizAppointmentRecord);
|
|
|
|
+ if(StringUtils.equals(bizAppointmentRecord.getStatus(),"2")){
|
|
|
|
+ //如果当前状态是审核不通过的状态,修改后重新提交审核
|
|
|
|
+ bizAppointmentRecord.setStatus("1");
|
|
|
|
+ }
|
|
|
|
+ this.updateById(bizAppointmentRecord);
|
|
|
|
+ }
|
|
|
|
+
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
public void delete(List<BizAppointmentRecordIdParam> bizAppointmentRecordIdParamList) {
|
|
public void delete(List<BizAppointmentRecordIdParam> bizAppointmentRecordIdParamList) {
|
|
@@ -434,6 +520,24 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void auditTemp(BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
|
|
|
|
+ BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordEditParam.getId());
|
|
|
|
+ UpdateWrapper<BizAppointmentRecord> updateWrapper = new UpdateWrapper<>();
|
|
|
|
+ updateWrapper.eq("id",bizAppointmentRecord.getId());
|
|
|
|
+ String status = null;
|
|
|
|
+ if(ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getAuditFlag())){
|
|
|
|
+ if(StringUtils.equals(bizAppointmentRecordEditParam.getAuditFlag(),"true")){
|
|
|
|
+ status = "2";
|
|
|
|
+ }else{
|
|
|
|
+ status = "4";
|
|
|
|
+ }
|
|
|
|
+ updateWrapper.set("status",status);
|
|
|
|
+ updateWrapper.set("appointment_reason",bizAppointmentRecordEditParam.getAppointmentReason());
|
|
|
|
+ this.update(updateWrapper);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void exportRecord(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException {
|
|
public void exportRecord(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException {
|
|
QueryWrapper<BizAppointmentRecord> queryWrapper = getQueryWrapper(bizAppointmentRecordPageParam);
|
|
QueryWrapper<BizAppointmentRecord> queryWrapper = getQueryWrapper(bizAppointmentRecordPageParam);
|
|
@@ -464,7 +568,12 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
bizAppointmentRecord = new BizAppointmentRecord();
|
|
bizAppointmentRecord = new BizAppointmentRecord();
|
|
bizAppointmentRecord.setIsFlag("4");
|
|
bizAppointmentRecord.setIsFlag("4");
|
|
}else{
|
|
}else{
|
|
- bizAppointmentRecord = setBizAppointmentRecord(bizAppointmentRecord);
|
|
|
|
|
|
+ if(StringUtils.equals(bizAppointmentRecord.getAppointmentType(),"1")){
|
|
|
|
+ //订单预约
|
|
|
|
+ bizAppointmentRecord = setBizAppointmentRecord(bizAppointmentRecord);
|
|
|
|
+ }else{
|
|
|
|
+ bizAppointmentRecord.setIsFlag("1");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}else if(StringUtils.equals(bizAppointmentRecordPageParam.getStatus(),"5")){
|
|
}else if(StringUtils.equals(bizAppointmentRecordPageParam.getStatus(),"5")){
|
|
//已入场,如果为空,没有已入场的记录,不可一次过磅
|
|
//已入场,如果为空,没有已入场的记录,不可一次过磅
|
|
@@ -472,7 +581,11 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
bizAppointmentRecord = new BizAppointmentRecord();
|
|
bizAppointmentRecord = new BizAppointmentRecord();
|
|
bizAppointmentRecord.setIsFlag("5");
|
|
bizAppointmentRecord.setIsFlag("5");
|
|
}else{
|
|
}else{
|
|
- bizAppointmentRecord = setBizAppointmentRecord(bizAppointmentRecord);
|
|
|
|
|
|
+ if(StringUtils.equals(bizAppointmentRecord.getAppointmentType(),"1")){
|
|
|
|
+ bizAppointmentRecord = setBizAppointmentRecord(bizAppointmentRecord);
|
|
|
|
+ }else{
|
|
|
|
+ bizAppointmentRecord.setIsFlag("5");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}else if(StringUtils.equals(bizAppointmentRecordPageParam.getStatus(),"7")){
|
|
}else if(StringUtils.equals(bizAppointmentRecordPageParam.getStatus(),"7")){
|
|
//完成装货,如果为空,没有完成装货的记录,不可二次过磅
|
|
//完成装货,如果为空,没有完成装货的记录,不可二次过磅
|
|
@@ -480,7 +593,12 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
bizAppointmentRecord = new BizAppointmentRecord();
|
|
bizAppointmentRecord = new BizAppointmentRecord();
|
|
bizAppointmentRecord.setIsFlag("7");
|
|
bizAppointmentRecord.setIsFlag("7");
|
|
}else{
|
|
}else{
|
|
- bizAppointmentRecord = setBizAppointmentRecord(bizAppointmentRecord);
|
|
|
|
|
|
+ if(StringUtils.equals(bizAppointmentRecord.getAppointmentType(),"1")){
|
|
|
|
+ bizAppointmentRecord = setBizAppointmentRecord(bizAppointmentRecord);
|
|
|
|
+ }else{
|
|
|
|
+ bizAppointmentRecord.setIsFlag("7");
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}else if(StringUtils.equals(bizAppointmentRecordPageParam.getStatus(),"9")){
|
|
}else if(StringUtils.equals(bizAppointmentRecordPageParam.getStatus(),"9")){
|
|
//待出场,如果为空,没有待出场的记录,不可出门禁
|
|
//待出场,如果为空,没有待出场的记录,不可出门禁
|
|
@@ -488,7 +606,11 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
bizAppointmentRecord = new BizAppointmentRecord();
|
|
bizAppointmentRecord = new BizAppointmentRecord();
|
|
bizAppointmentRecord.setIsFlag("9");
|
|
bizAppointmentRecord.setIsFlag("9");
|
|
}else{
|
|
}else{
|
|
- bizAppointmentRecord = setBizAppointmentRecord(bizAppointmentRecord);
|
|
|
|
|
|
+ if(StringUtils.equals(bizAppointmentRecord.getAppointmentType(),"1")){
|
|
|
|
+ bizAppointmentRecord = setBizAppointmentRecord(bizAppointmentRecord);
|
|
|
|
+ }else{
|
|
|
|
+ bizAppointmentRecord.setIsFlag("1");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return bizAppointmentRecord;
|
|
return bizAppointmentRecord;
|
|
@@ -623,7 +745,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
BizGoods bizGoods = bizGoodsService.getById(bizOrder.getGoodId());
|
|
BizGoods bizGoods = bizGoodsService.getById(bizOrder.getGoodId());
|
|
if(ObjectUtil.isNotNull(bizGoods)){
|
|
if(ObjectUtil.isNotNull(bizGoods)){
|
|
bizAppointmentRecord.setGoodsName(bizGoods.getGoodsName());
|
|
bizAppointmentRecord.setGoodsName(bizGoods.getGoodsName());
|
|
- bizAppointmentRecord.setGoodsModel(bizGoods.getGoodsModel());
|
|
|
|
|
|
+ bizAppointmentRecord.setGoodsModel(bizGoods.getGoodsCode());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|