|
@@ -173,6 +173,9 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getOrderName())) {
|
|
if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getOrderName())) {
|
|
queryWrapper.like("bo.order_name", bizAppointmentRecordPageParam.getOrderName());
|
|
queryWrapper.like("bo.order_name", bizAppointmentRecordPageParam.getOrderName());
|
|
}
|
|
}
|
|
|
|
+ if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getOtherNumber())) {
|
|
|
|
+ queryWrapper.like("bar.other_number", bizAppointmentRecordPageParam.getOtherNumber());
|
|
|
|
+ }
|
|
if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getOrderNumber())) {
|
|
if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getOrderNumber())) {
|
|
queryWrapper.like("bo.order_number", bizAppointmentRecordPageParam.getOrderNumber());
|
|
queryWrapper.like("bo.order_number", bizAppointmentRecordPageParam.getOrderNumber());
|
|
}
|
|
}
|
|
@@ -207,8 +210,8 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
queryWrapper.like("bla.load_number", bizAppointmentRecordPageParam.getLoadNumber());
|
|
queryWrapper.like("bla.load_number", bizAppointmentRecordPageParam.getLoadNumber());
|
|
}
|
|
}
|
|
//管桩计划单号
|
|
//管桩计划单号
|
|
- if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getPlanNumber())){
|
|
|
|
- queryWrapper.like("bpp.plan_number",bizAppointmentRecordPageParam.getPlanNumber());
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getPlanNumber())) {
|
|
|
|
+ queryWrapper.like("bpp.plan_number", bizAppointmentRecordPageParam.getPlanNumber());
|
|
}
|
|
}
|
|
queryWrapper.eq("bar.delete_flag", "NOT_DELETE");
|
|
queryWrapper.eq("bar.delete_flag", "NOT_DELETE");
|
|
queryWrapper.orderByDesc("bar.create_time");
|
|
queryWrapper.orderByDesc("bar.create_time");
|
|
@@ -1291,7 +1294,6 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
public void getLoadTimeCount(BizAppointmentRecordEditParam bizAppointmentRecordEditParam, BizAppointmentRecord bizAppointmentRecord) {
|
|
public void getLoadTimeCount(BizAppointmentRecordEditParam bizAppointmentRecordEditParam, BizAppointmentRecord bizAppointmentRecord) {
|
|
lock.lock();
|
|
lock.lock();
|
|
try {
|
|
try {
|
|
@@ -1353,7 +1355,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
|
|
|
//修改管桩计划状态
|
|
//修改管桩计划状态
|
|
BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordAddParam.getOrderId());
|
|
BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordAddParam.getOrderId());
|
|
- if(ObjectUtil.isNotNull(pipePlan)){
|
|
|
|
|
|
+ if (ObjectUtil.isNotNull(pipePlan)) {
|
|
pipePlan.setStatus("2");
|
|
pipePlan.setStatus("2");
|
|
pipePlan.setPlanAlreadyCount(pipePlan.getPlanAlreadyCount() + 1);
|
|
pipePlan.setPlanAlreadyCount(pipePlan.getPlanAlreadyCount() + 1);
|
|
bizPipePlanService.updateById(pipePlan);
|
|
bizPipePlanService.updateById(pipePlan);
|
|
@@ -1398,8 +1400,8 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
//判断管桩计划次数是否满足
|
|
//判断管桩计划次数是否满足
|
|
if (ObjectUtil.isNotEmpty(bizAppointmentRecordAddParam.getOrderId())) {
|
|
if (ObjectUtil.isNotEmpty(bizAppointmentRecordAddParam.getOrderId())) {
|
|
BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordAddParam.getOrderId());
|
|
BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordAddParam.getOrderId());
|
|
- if(ObjectUtil.isNotNull(pipePlan)){
|
|
|
|
- if(pipePlan.getPlanCount() - pipePlan.getPlanAlreadyCount() <= 0){
|
|
|
|
|
|
+ if (ObjectUtil.isNotNull(pipePlan)) {
|
|
|
|
+ if (pipePlan.getPlanCount() - pipePlan.getPlanAlreadyCount() <= 0) {
|
|
throw new CommonException("当前管桩计划单预约次数已满");
|
|
throw new CommonException("当前管桩计划单预约次数已满");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1477,15 +1479,15 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- public void getPipeTimeCount(BizAppointmentRecordEditParam bizAppointmentRecordEditParam,BizAppointmentRecord bizAppointmentRecord) {
|
|
|
|
|
|
+ public void getPipeTimeCount(BizAppointmentRecordEditParam bizAppointmentRecordEditParam, BizAppointmentRecord bizAppointmentRecord) {
|
|
lock.lock();
|
|
lock.lock();
|
|
try {
|
|
try {
|
|
//判断管桩计划次数是否满足
|
|
//判断管桩计划次数是否满足
|
|
if (ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getOrderId())) {
|
|
if (ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getOrderId())) {
|
|
- if(!StringUtils.equals(bizAppointmentRecordEditParam.getOrderId(),bizAppointmentRecord.getOrderId())){
|
|
|
|
|
|
+ if (!StringUtils.equals(bizAppointmentRecordEditParam.getOrderId(), bizAppointmentRecord.getOrderId())) {
|
|
BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordEditParam.getOrderId());
|
|
BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordEditParam.getOrderId());
|
|
- if(ObjectUtil.isNotNull(pipePlan)){
|
|
|
|
- if(pipePlan.getPlanCount() - pipePlan.getPlanAlreadyCount() <= 0){
|
|
|
|
|
|
+ if (ObjectUtil.isNotNull(pipePlan)) {
|
|
|
|
+ if (pipePlan.getPlanCount() - pipePlan.getPlanAlreadyCount() <= 0) {
|
|
throw new CommonException("当前管桩计划单预约次数已满");
|
|
throw new CommonException("当前管桩计划单预约次数已满");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1514,7 +1516,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
|
|
|
//修改管桩计划单已约数量
|
|
//修改管桩计划单已约数量
|
|
BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecord.getOrderId());
|
|
BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecord.getOrderId());
|
|
- if(ObjectUtil.isNotNull(pipePlan)){
|
|
|
|
|
|
+ if (ObjectUtil.isNotNull(pipePlan)) {
|
|
pipePlan.setPlanAlreadyCount(pipePlan.getPlanAlreadyCount() - 1);
|
|
pipePlan.setPlanAlreadyCount(pipePlan.getPlanAlreadyCount() - 1);
|
|
bizPipePlanService.updateById(pipePlan);
|
|
bizPipePlanService.updateById(pipePlan);
|
|
}
|
|
}
|
|
@@ -1532,6 +1534,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
bizAppointmentRecord.setDriverName(bizUser.getName());
|
|
bizAppointmentRecord.setDriverName(bizUser.getName());
|
|
bizAppointmentRecord.setDriverMobile(bizUser.getPhone());
|
|
bizAppointmentRecord.setDriverMobile(bizUser.getPhone());
|
|
}
|
|
}
|
|
|
|
+ bizAppointmentRecord.setOtherNumber(getNumber("QT", "6"));
|
|
//默认赋值待入场状态
|
|
//默认赋值待入场状态
|
|
bizAppointmentRecord.setStatus("4");
|
|
bizAppointmentRecord.setStatus("4");
|
|
bizAppointmentRecord.setAppointmentType("6");
|
|
bizAppointmentRecord.setAppointmentType("6");
|
|
@@ -1590,7 +1593,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
@Override
|
|
@Override
|
|
public void bizOtherAppointmentExit(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
|
|
public void bizOtherAppointmentExit(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
|
|
- if("10".equals(bizAppointmentRecord.getStatus())){
|
|
|
|
|
|
+ if ("10".equals(bizAppointmentRecord.getStatus())) {
|
|
throw new CommonException("当前流程已经强制结束,不可重复操作!");
|
|
throw new CommonException("当前流程已经强制结束,不可重复操作!");
|
|
}
|
|
}
|
|
//强制结束,将状态改成已出场,同时记录操作人以及操作时间
|
|
//强制结束,将状态改成已出场,同时记录操作人以及操作时间
|
|
@@ -1601,10 +1604,11 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
bizAppointmentRecord.setStatus("10");
|
|
bizAppointmentRecord.setStatus("10");
|
|
this.updateById(bizAppointmentRecord);
|
|
this.updateById(bizAppointmentRecord);
|
|
}
|
|
}
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void bizOtherAppointmentAuthorize(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
|
|
public void bizOtherAppointmentAuthorize(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
|
|
- if("9".equals(bizAppointmentRecord.getStatus())){
|
|
|
|
|
|
+ if ("9".equals(bizAppointmentRecord.getStatus())) {
|
|
throw new CommonException("当前流程已经授权离场,不可重复操作!");
|
|
throw new CommonException("当前流程已经授权离场,不可重复操作!");
|
|
}
|
|
}
|
|
//强制结束,将状态改成已出场,同时记录操作人以及操作时间
|
|
//强制结束,将状态改成已出场,同时记录操作人以及操作时间
|
|
@@ -1617,7 +1621,6 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public void bizOtherAppointmentExport(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException {
|
|
public void bizOtherAppointmentExport(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException {
|
|
QueryWrapper<BizAppointmentRecord> queryWrapper = getQueryWrapper(bizAppointmentRecordPageParam);
|
|
QueryWrapper<BizAppointmentRecord> queryWrapper = getQueryWrapper(bizAppointmentRecordPageParam);
|
|
@@ -1635,4 +1638,27 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
CommonExportUtil.export(fileName, BizOtherAppointmentExportResult.class, list, response, "其他预约报表");
|
|
CommonExportUtil.export(fileName, BizOtherAppointmentExportResult.class, list, response, "其他预约报表");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ public String getNumber(String startPrefix, String appointmentType) {
|
|
|
|
+ lock.lock();
|
|
|
|
+ try {
|
|
|
|
+ String format = new SimpleDateFormat("yyyyMMdd").format(new Date());
|
|
|
|
+ String time = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
|
|
|
|
+ long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda()
|
|
|
|
+ .eq(BizAppointmentRecord::getAppointmentType, appointmentType)
|
|
|
|
+ .between(BizAppointmentRecord::getCreateTime,
|
|
|
|
+ time + " 00:00:00", time + " 23:59:59"));
|
|
|
|
+ String settleNo = startPrefix + format + generateCode((int) count);
|
|
|
|
+ return settleNo;
|
|
|
|
+ } finally {
|
|
|
|
+ lock.unlock(); // 释放锁
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static String generateCode(Integer counter) {
|
|
|
|
+ counter++;
|
|
|
|
+ return String.format("%03d", counter);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|