|
@@ -34,6 +34,7 @@ import org.apache.commons.compress.utils.Lists;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import vip.xiaonuo.auth.core.pojo.SaBaseLoginUser;
|
|
|
import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
|
|
|
import vip.xiaonuo.biz.modular.api.param.WxUserMsgParam;
|
|
|
import vip.xiaonuo.biz.modular.api.service.ApiService;
|
|
@@ -84,6 +85,8 @@ import vip.xiaonuo.common.prop.CommonProperties;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -1323,6 +1326,11 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
checkOtherParam(bizOtherAppointmentEditParam.getLicenseNumber());
|
|
|
}
|
|
|
BizAppointmentRecord bizAppointmentRecordUp = BeanUtil.toBean(bizOtherAppointmentEditParam, BizAppointmentRecord.class);
|
|
|
+ BizUser bizUser = bizUserService.getById(bizOtherAppointmentEditParam.getDriverId());
|
|
|
+ if (bizUser != null) {
|
|
|
+ bizAppointmentRecordUp.setDriverName(bizUser.getName());
|
|
|
+ bizAppointmentRecordUp.setDriverMobile(bizUser.getPhone());
|
|
|
+ }
|
|
|
this.updateById(bizAppointmentRecordUp);
|
|
|
}
|
|
|
|
|
@@ -1346,10 +1354,49 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
@Override
|
|
|
public void bizOtherAppointmentExit(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
|
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
|
|
|
+ if("10".equals(bizAppointmentRecord.getStatus())){
|
|
|
+ throw new CommonException("当前流程已经强制结束,不可重复操作!");
|
|
|
+ }
|
|
|
//强制结束,将状态改成已出场,同时记录操作人以及操作时间
|
|
|
+ SaBaseLoginUser loginUser = StpLoginUserUtil.getLoginUser();
|
|
|
+ bizAppointmentRecord.setExitOperator(loginUser.getName());
|
|
|
+ bizAppointmentRecord.setExitTime(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
|
|
|
+ .format(LocalDateTime.now()));
|
|
|
bizAppointmentRecord.setStatus("10");
|
|
|
this.updateById(bizAppointmentRecord);
|
|
|
}
|
|
|
+ @Override
|
|
|
+ public void bizOtherAppointmentAuthorize(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
|
|
|
+ BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
|
|
|
+ if("9".equals(bizAppointmentRecord.getStatus())){
|
|
|
+ throw new CommonException("当前流程已经授权离场,不可重复操作!");
|
|
|
+ }
|
|
|
+ //强制结束,将状态改成已出场,同时记录操作人以及操作时间
|
|
|
+ SaBaseLoginUser loginUser = StpLoginUserUtil.getLoginUser();
|
|
|
+ bizAppointmentRecord.setAuthorizeOperator(loginUser.getName());
|
|
|
+ bizAppointmentRecord.setAuthorizeTime(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
|
|
|
+ .format(LocalDateTime.now()));
|
|
|
+ bizAppointmentRecord.setStatus("9");
|
|
|
+ this.updateById(bizAppointmentRecord);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void bizOtherAppointmentExport(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException {
|
|
|
+ QueryWrapper<BizAppointmentRecord> queryWrapper = getQueryWrapper(bizAppointmentRecordPageParam);
|
|
|
+ List<BizAppointmentRecord> recordList = this.getBaseMapper().getPage(queryWrapper);
|
|
|
+ String fileName = "其他预约报表.xlsx";
|
|
|
+ List<BizOtherAppointmentExportResult> list = Lists.newArrayList();
|
|
|
+ transService.transBatch(recordList);
|
|
|
+ for (BizAppointmentRecord bizAppointmentRecord : recordList) {
|
|
|
+ BizOtherAppointmentExportResult bizOtherAppointmentExportResult = new BizOtherAppointmentExportResult();
|
|
|
+ BeanUtil.copyProperties(bizAppointmentRecord, bizOtherAppointmentExportResult);
|
|
|
+ bizOtherAppointmentExportResult.setStatusName((String) bizAppointmentRecord.getTransMap().get("statusName"));
|
|
|
+ bizOtherAppointmentExportResult.setIsWeigh((String) bizAppointmentRecord.getTransMap().get("isWeightName"));
|
|
|
+ list.add(bizOtherAppointmentExportResult);
|
|
|
+ }
|
|
|
+ CommonExportUtil.export(fileName, BizOtherAppointmentExportResult.class, list, response, "其他预约报表");
|
|
|
+ }
|
|
|
+
|
|
|
}
|