Compare commits
No commits in common. "ff2c600ae7b9f2d4055b1867658dd2c456c05ef8" and "b155c216109d250617629a8b89f8116468ac2448" have entirely different histories.
ff2c600ae7
...
b155c21610
|
|
@ -1,163 +0,0 @@
|
|||
package com.njzscloud.common.core.utils;
|
||||
|
||||
import com.njzscloud.common.core.ex.Exceptions;
|
||||
|
||||
import javax.imageio.IIOImage;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.ImageWriteParam;
|
||||
import javax.imageio.ImageWriter;
|
||||
import javax.imageio.stream.ImageOutputStream;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class ImgUtil {
|
||||
|
||||
// 最小缩放比例(防止无限缩小,可根据需求调整)
|
||||
private static final double MIN_SCALE = 0.1;
|
||||
// 最低质量压缩值(防止质量过低导致图片损坏)
|
||||
private static final float MIN_QUALITY = 0.1f;
|
||||
// 压缩衰减系数(每次递归压缩时,缩放/质量的衰减幅度)
|
||||
private static final double COMPRESS_ATTENUATION = 0.8;
|
||||
|
||||
/**
|
||||
* 按质量压缩图片(返回字节流)
|
||||
*/
|
||||
public static ByteArrayOutputStream compressByQuality(InputStream in, float quality, String format) throws IOException {
|
||||
BufferedImage bufferedImage = ImageIO.read(in);
|
||||
if (bufferedImage == null) {
|
||||
throw new IOException("读取图片流失败,图片格式不支持或流已关闭");
|
||||
}
|
||||
|
||||
Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName(format);
|
||||
if (!writers.hasNext()) {
|
||||
throw new IOException("不支持的图片格式:" + format);
|
||||
}
|
||||
ImageWriter writer = writers.next();
|
||||
|
||||
ImageWriteParam param = writer.getDefaultWriteParam();
|
||||
if (param.canWriteCompressed()) {
|
||||
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
|
||||
// 确保质量不低于最小值
|
||||
param.setCompressionQuality(Math.max(quality, MIN_QUALITY));
|
||||
}
|
||||
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
try (ImageOutputStream ios = ImageIO.createImageOutputStream(out)) {
|
||||
writer.setOutput(ios);
|
||||
writer.write(null, new IIOImage(bufferedImage, null, null), param);
|
||||
return out;
|
||||
} finally {
|
||||
writer.dispose();
|
||||
// 关闭输入流,避免内存泄漏
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 按尺寸缩放图片(返回字节流)
|
||||
*/
|
||||
public static ByteArrayOutputStream compressByScale(InputStream in, double scale, String format) throws IOException {
|
||||
BufferedImage srcImage = ImageIO.read(in);
|
||||
if (srcImage == null) {
|
||||
throw new IOException("读取图片流失败,图片格式不支持或流已关闭");
|
||||
}
|
||||
|
||||
// 确保缩放比例不低于最小值
|
||||
double actualScale = Math.max(scale, MIN_SCALE);
|
||||
int newWidth = Math.max(1, (int) (srcImage.getWidth() * actualScale));
|
||||
int newHeight = Math.max(1, (int) (srcImage.getHeight() * actualScale));
|
||||
|
||||
BufferedImage destImage = new BufferedImage(newWidth, newHeight, srcImage.getType());
|
||||
Graphics2D g = destImage.createGraphics();
|
||||
g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
|
||||
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
g.drawImage(srcImage, 0, 0, newWidth, newHeight, null);
|
||||
g.dispose();
|
||||
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
ImageIO.write(destImage, format, out);
|
||||
// 关闭输入流
|
||||
in.close();
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归压缩图片:先校验大小,满足阈值直接返回;否则递归压缩直到满足阈值
|
||||
*
|
||||
* @param in 原始图片输入流
|
||||
* @param initialScale 初始压缩比例(尺寸+质量)
|
||||
* @param format 图片格式(jpg/png等)
|
||||
* @param sizeThreshold 体积阈值(例如:1024*100 表示100KB)
|
||||
* @return 压缩后的字节流
|
||||
*/
|
||||
public static ByteArrayOutputStream compress(InputStream in, double initialScale, String format, long sizeThreshold) {
|
||||
try {
|
||||
// ========== 核心新增:第一步先校验原始图片大小 ==========
|
||||
byte[] originalBytes = readBytes(in);
|
||||
// 若原始体积已满足阈值,直接返回字节流,不执行任何压缩
|
||||
if (originalBytes.length <= sizeThreshold) {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
out.write(originalBytes);
|
||||
return out;
|
||||
}
|
||||
|
||||
// 原始体积不满足阈值,执行第一次组合压缩(质量+尺寸)
|
||||
ByteArrayOutputStream qualityOut = compressByQuality(
|
||||
new ByteArrayInputStream(originalBytes),
|
||||
(float) initialScale,
|
||||
format
|
||||
);
|
||||
ByteArrayOutputStream scaleOut = compressByScale(
|
||||
new ByteArrayInputStream(qualityOut.toByteArray()),
|
||||
initialScale,
|
||||
format
|
||||
);
|
||||
|
||||
// 校验压缩后的体积是否满足阈值
|
||||
long currentSize = scaleOut.size();
|
||||
if (currentSize <= sizeThreshold) {
|
||||
return scaleOut; // 满足阈值,直接返回
|
||||
}
|
||||
|
||||
// 计算下一次压缩的比例(衰减)
|
||||
double nextScale = initialScale * COMPRESS_ATTENUATION;
|
||||
|
||||
// 边界校验:防止无限递归
|
||||
if (nextScale < MIN_SCALE) {
|
||||
// 已达到最小压缩比例,返回当前结果(避免图片失效)
|
||||
return scaleOut;
|
||||
}
|
||||
|
||||
// 递归调用:使用衰减后的比例继续压缩
|
||||
return compress(
|
||||
new ByteArrayInputStream(scaleOut.toByteArray()),
|
||||
nextScale,
|
||||
format,
|
||||
sizeThreshold
|
||||
);
|
||||
|
||||
} catch (IOException e) {
|
||||
throw Exceptions.error(e, "图片压缩失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 辅助方法:读取输入流的所有字节(避免流复用导致的问题)
|
||||
*/
|
||||
private static byte[] readBytes(InputStream in) throws IOException {
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
||||
byte[] temp = new byte[1024];
|
||||
int len;
|
||||
while ((len = in.read(temp)) != -1) {
|
||||
buffer.write(temp, 0, len);
|
||||
}
|
||||
in.close();
|
||||
return buffer.toByteArray();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -25,9 +25,6 @@ public class CompositeInterceptor implements RequestInterceptor, ResponseInterce
|
|||
|
||||
@Override
|
||||
public Object process(RequestInfo requestInfo, ResponseInfo responseInfo, Type responseType) {
|
||||
if (requestInfo.contentType != null && requestInfo.contentType.contains("multipart/form-data")) {
|
||||
log.info("响应拦截器: {}、{}、{}", Jackson.toJsonStr(requestInfo), new String(responseInfo.body), responseType);
|
||||
}
|
||||
log.info("响应拦截器: {}、{}、{}", Jackson.toJsonStr(requestInfo), new String(responseInfo.body), responseType);
|
||||
Object data = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -108,17 +108,4 @@ public class BizDriverController {
|
|||
bizDriverService.cancel(id);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换公司
|
||||
*
|
||||
* @param companyId Id
|
||||
*/
|
||||
@GetMapping("/change_company")
|
||||
public R<?> changeCompany(@RequestParam Long id,
|
||||
@RequestParam Long companyId
|
||||
) {
|
||||
bizDriverService.changeCompany(id, companyId);
|
||||
return R.success();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,17 +115,4 @@ public class BizTruckController {
|
|||
bizTruckService.cancel(id);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换公司
|
||||
*
|
||||
* @param companyId Id
|
||||
*/
|
||||
@GetMapping("/change_company")
|
||||
public R<?> changeCompany(@RequestParam Long id,
|
||||
@RequestParam Long companyId
|
||||
) {
|
||||
bizTruckService.changeCompany(id, companyId);
|
||||
return R.success();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ public class BizCompanyEntity {
|
|||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
private Integer stationType;
|
||||
/**
|
||||
* 归属用户
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ public class ModifyBizCompanyParam {
|
|||
*/
|
||||
private Long userId;
|
||||
|
||||
private Integer stationType;
|
||||
/**
|
||||
* 业务对象; 字典代码:biz_obj
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -223,11 +223,4 @@ public class BizDriverService extends ServiceImpl<BizDriverMapper, BizDriverEnti
|
|||
.eq(BizDriverEntity::getId, id)
|
||||
);
|
||||
}
|
||||
|
||||
public void changeCompany(Long id, Long companyId) {
|
||||
this.updateById(new BizDriverEntity()
|
||||
.setId(id)
|
||||
.setCompanyId(companyId)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import com.njzscloud.supervisory.sys.dict.pojo.DictItemEntity;
|
|||
import com.njzscloud.supervisory.sys.dict.service.DictItemService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -45,7 +46,8 @@ import java.util.stream.Collectors;
|
|||
@RequiredArgsConstructor
|
||||
public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity> implements IService<BizTruckEntity> {
|
||||
private final DeviceLocalizerService deviceLocalizerService;
|
||||
private final DictItemService dictItemService;
|
||||
@Autowired
|
||||
private DictItemService dictItemService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
|
|
@ -73,7 +75,7 @@ public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity>
|
|||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param modifyBizTruckParam 数据
|
||||
* @param bizTruckEntity 数据
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void modify(ModifyBizTruckParam modifyBizTruckParam) {
|
||||
|
|
@ -229,11 +231,4 @@ public class BizTruckService extends ServiceImpl<BizTruckMapper, BizTruckEntity>
|
|||
.eq(BizTruckEntity::getId, id)
|
||||
);
|
||||
}
|
||||
|
||||
public void changeCompany(Long id, Long companyId) {
|
||||
this.updateById(new BizTruckEntity()
|
||||
.setId(id)
|
||||
.setCompanyId(companyId)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -438,10 +438,6 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
|
|||
.build();
|
||||
}
|
||||
log.info("进道闸转出道闸,订单号:{}", orderInfoSn);
|
||||
if (orderInfo.getCheckStatus() == CheckStatus.WeiKanLiao) {
|
||||
// 播语音
|
||||
playVoice(sn, cid, "{}未看料", licensePlate);
|
||||
}
|
||||
boolean b = orderInfoService.truckLeaving(new TruckLeavingOrderParam()
|
||||
.setOrderId(orderId)
|
||||
.setWeight(weight)
|
||||
|
|
@ -479,10 +475,6 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
|
|||
if (SettlementWay.CASH.getTxt().equals(settlementWay)) {
|
||||
playVoice(sn, cid, "{}请先支付", licensePlate);
|
||||
}
|
||||
if (orderInfo.getCheckStatus() == CheckStatus.WeiKanLiao) {
|
||||
// 播语音
|
||||
playVoice(sn, cid, "{}未看料", licensePlate);
|
||||
}
|
||||
boolean b = orderInfoService.truckLeaving(new TruckLeavingOrderParam()
|
||||
.setOrderId(orderId)
|
||||
.setWeight(weight)
|
||||
|
|
|
|||
|
|
@ -4,10 +4,12 @@ import cn.hutool.core.util.StrUtil;
|
|||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.njzscloud.common.http.HttpClientDecorator;
|
||||
import com.njzscloud.supervisory.config.AppProperties;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.*;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.LoginParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushVehicleTrajectoryParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.RefreshTokenParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.TokenParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.LoginResult;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.UploadResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
|
@ -19,10 +21,10 @@ public class Hsoa {
|
|||
private static final ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock();
|
||||
private static final ReentrantReadWriteLock.ReadLock rlock = rwLock.readLock();
|
||||
private static final ReentrantReadWriteLock.WriteLock wlock = rwLock.writeLock();
|
||||
private static final AppProperties appProperties;
|
||||
private static String refTnt = "";
|
||||
private static String tnt = "";
|
||||
private static long lastLoginTime = 0;
|
||||
private static AppProperties appProperties;
|
||||
|
||||
static {
|
||||
HttpClientDecorator httpClientDecorator = SpringUtil.getBean(HttpClientDecorator.class);
|
||||
|
|
@ -49,33 +51,6 @@ public class Hsoa {
|
|||
}
|
||||
}
|
||||
|
||||
public static HsoaResult<?> pushProvincial(PushProvincialSaveParam param) {
|
||||
login();
|
||||
try {
|
||||
rlock.lock();
|
||||
if (StrUtil.isBlank(tnt) || StrUtil.isBlank(refTnt)) {
|
||||
return new HsoaResult<>()
|
||||
.setSuccess(false);
|
||||
}
|
||||
return API.pushProvincial(param, new TokenParam().setTnt(tnt).setRefTnt(refTnt));
|
||||
} finally {
|
||||
rlock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public static UploadResult upload(PushProvincialUploadParam param) {
|
||||
login();
|
||||
try {
|
||||
rlock.lock();
|
||||
if (StrUtil.isBlank(tnt) || StrUtil.isBlank(refTnt)) {
|
||||
return new UploadResult();
|
||||
}
|
||||
return API.upload(param, new TokenParam().setTnt(tnt).setRefTnt(refTnt));
|
||||
} finally {
|
||||
rlock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public static void login() {
|
||||
try {
|
||||
wlock.lock();
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.njzscloud.supervisory.hsoa;
|
||||
|
||||
import com.njzscloud.common.http.annotation.*;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.*;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.LoginParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushVehicleTrajectoryParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.RefreshTokenParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.TokenParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.LoginResult;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.UploadResult;
|
||||
|
||||
@RemoteServer(value = "${hsoa.base-url}")
|
||||
public interface HsoaApi {
|
||||
|
|
@ -12,30 +14,17 @@ public interface HsoaApi {
|
|||
* 登录
|
||||
*/
|
||||
@PostEndpoint("/garbage/mLoginApi/login")
|
||||
HsoaResult<LoginResult> login(@FormBodyParam LoginParam param);
|
||||
HsoaResult<LoginResult> login(@FormBodyParam LoginParam apram);
|
||||
|
||||
/**
|
||||
* 刷新 TOKEN
|
||||
*/
|
||||
@GetEndpoint("/garbage/mLoginApi/refreshToken")
|
||||
HsoaResult<LoginResult> refreshToken(@QueryParam RefreshTokenParam param);
|
||||
HsoaResult<LoginResult> refreshToken(@QueryParam RefreshTokenParam apram);
|
||||
|
||||
/**
|
||||
* 发送定位数据
|
||||
*/
|
||||
@PostEndpoint("/garbage/commonApi/pushVehicleTrajectory")
|
||||
HsoaResult<Object> pushVehicleTrajectory(@JsonBodyParam PushVehicleTrajectoryParam param, @QueryParam TokenParam tokenParam);
|
||||
|
||||
/**
|
||||
* 电子联单数据
|
||||
*/
|
||||
@PostEndpoint("/garbage/api/pushProvincial/save")
|
||||
HsoaResult<Object> pushProvincial(@JsonBodyParam PushProvincialSaveParam param, @QueryParam TokenParam tokenParam);
|
||||
|
||||
/**
|
||||
* 上传附件
|
||||
*/
|
||||
@PostEndpoint("/garbage/api/pushProvincial/upload")
|
||||
UploadResult upload(@MultiBodyParam PushProvincialUploadParam param, @QueryParam TokenParam tokenParam);
|
||||
|
||||
HsoaResult<Object> pushVehicleTrajectory(@JsonBodyParam PushVehicleTrajectoryParam apram, @QueryParam TokenParam tokenParam);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.njzscloud.supervisory.hsoa.controller;
|
|||
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.supervisory.hsoa.Hsoa;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushProvincialSaveParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushVehicleTrajectoryParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
||||
import com.njzscloud.supervisory.hsoa.service.HsoaService;
|
||||
|
|
@ -16,16 +15,17 @@ public class HsoaController {
|
|||
|
||||
private final HsoaService hsoaService;
|
||||
|
||||
@PostMapping("/push_vehicle_trajectory")
|
||||
public R<?> pushVehicleTrajectory(@RequestBody PushVehicleTrajectoryParam pushVehicleTrajectoryParam) {
|
||||
@PostMapping("/push")
|
||||
public R<?> push(@RequestBody PushVehicleTrajectoryParam pushVehicleTrajectoryParam) {
|
||||
HsoaResult<?> objectHsoaResult = Hsoa.pushVehicleTrajectory(pushVehicleTrajectoryParam);
|
||||
return R.success(objectHsoaResult);
|
||||
if (objectHsoaResult.isSuccess()) {
|
||||
return R.success(objectHsoaResult);
|
||||
}
|
||||
return R.failed();
|
||||
}
|
||||
|
||||
@PostMapping("/push_provincial")
|
||||
public R<?> pushProvincial(@RequestParam PushProvincialSaveParam param) {
|
||||
HsoaResult<?> hsoaResult = Hsoa.pushProvincial(param);
|
||||
return R.success(hsoaResult);
|
||||
@GetMapping("/push_order")
|
||||
public R<?> pushOrder(@RequestParam Long orderId, @RequestParam Integer count) {
|
||||
return R.success(hsoaService.pushOrder(orderId, count));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,653 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa.pojo.param;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* 建筑垃圾处置运输订单主实体
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class PushProvincialSaveParam {
|
||||
|
||||
/**
|
||||
* 处置场接收信息DTO
|
||||
*/
|
||||
@JsonProperty("handleInfoDTO")
|
||||
private HandleInfo handleInfo;
|
||||
|
||||
/**
|
||||
* 审批信息DTO
|
||||
*/
|
||||
@JsonProperty("reviewInfoDTO")
|
||||
private ReviewInfo reviewInfo;
|
||||
|
||||
/**
|
||||
* 运输订单基础信息DTO
|
||||
*/
|
||||
@JsonProperty("transportOrderDTO")
|
||||
private TransportOrder transportOrder;
|
||||
|
||||
/**
|
||||
* 运输订单记录DTO
|
||||
*/
|
||||
@JsonProperty("transportOrderRecordDTO")
|
||||
private TransportOrderRecord transportOrderRecord;
|
||||
|
||||
/**
|
||||
* 处置场接收信息DTO
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public static class HandleInfo {
|
||||
|
||||
/**
|
||||
* 核准日期
|
||||
*/
|
||||
private String approveDate;
|
||||
|
||||
/**
|
||||
* 核准人姓名
|
||||
*/
|
||||
private String approveUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createrName;
|
||||
|
||||
/**
|
||||
* 处置场编码
|
||||
*/
|
||||
private String disposalSiteCode;
|
||||
|
||||
/**
|
||||
* 处置场名称
|
||||
*/
|
||||
private String disposalSiteName;
|
||||
|
||||
/**
|
||||
* 处置工艺
|
||||
*/
|
||||
private String handleCraft;
|
||||
|
||||
/**
|
||||
* 处置许可证名称
|
||||
*/
|
||||
private String handleLicenseName;
|
||||
|
||||
/**
|
||||
* 处置许可证编码
|
||||
*/
|
||||
private String handleLicenseNum;
|
||||
|
||||
/**
|
||||
* 处置方式(回填、填埋、资源化利用、焚烧、其他)
|
||||
*/
|
||||
private String handleMethod;
|
||||
|
||||
/**
|
||||
* 处置场纬度
|
||||
*/
|
||||
private String latitude;
|
||||
|
||||
/**
|
||||
* 终端处置场处置许可证附件路径
|
||||
*/
|
||||
@JsonProperty("HANDLE_LICENSE_FILE")
|
||||
private String handleLicenseFile;
|
||||
|
||||
/**
|
||||
* 处置许可证结束有效期
|
||||
*/
|
||||
private String licenseValidEndDate;
|
||||
|
||||
/**
|
||||
* 处置许可证开始有效期
|
||||
*/
|
||||
private String licenseValidStartDate;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String linkPhone;
|
||||
|
||||
/**
|
||||
* 处置场经度
|
||||
*/
|
||||
private String longitude;
|
||||
|
||||
/**
|
||||
* 批准(监督)单位名称
|
||||
*/
|
||||
private String superviseUnitName;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updaterName;
|
||||
|
||||
/**
|
||||
* 终端处置场处置凭证附件路径(勘料照片)
|
||||
*/
|
||||
|
||||
@JsonProperty("HANDLE_VOUCHER_FILE")
|
||||
private String handleVoucherFile;
|
||||
|
||||
/**
|
||||
* 重量(单位: 吨)
|
||||
*/
|
||||
private String weight;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审批信息DTO
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public static class ReviewInfo {
|
||||
|
||||
/**
|
||||
* 城管部门所属区域名称
|
||||
*/
|
||||
private String cgAreaName;
|
||||
|
||||
/**
|
||||
* 城管部门审批意见
|
||||
*/
|
||||
private String cgReviewOpinion;
|
||||
|
||||
/**
|
||||
* 城管部门审批时间
|
||||
*/
|
||||
private LocalDateTime cgReviewTime;
|
||||
|
||||
/**
|
||||
* 城管部门审批人所属部门编码
|
||||
*/
|
||||
private String cgUnitCode;
|
||||
|
||||
/**
|
||||
* 城管部门审批人所属部门名称
|
||||
*/
|
||||
private String cgUnitName;
|
||||
|
||||
/**
|
||||
* 城管部门审批人id
|
||||
*/
|
||||
private String cgUserId;
|
||||
|
||||
/**
|
||||
* 城管部门审批人名称
|
||||
*/
|
||||
private String cgUserName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createrName;
|
||||
|
||||
/**
|
||||
* 交通部门所属区域名称
|
||||
*/
|
||||
private String jtAreaName;
|
||||
|
||||
/**
|
||||
* 交通部门审批意见
|
||||
*/
|
||||
private String jtReviewOpinion;
|
||||
|
||||
/**
|
||||
* 交通部门审批时间
|
||||
*/
|
||||
private String jtReviewTime;
|
||||
|
||||
/**
|
||||
* 交通部门审批人所属部门编码
|
||||
*/
|
||||
private String jtUnitCode;
|
||||
|
||||
/**
|
||||
* 交通部门审批人所属部门名称
|
||||
*/
|
||||
private String jtUnitName;
|
||||
|
||||
/**
|
||||
* 交通部门审批人id
|
||||
*/
|
||||
private String jtUserId;
|
||||
|
||||
/**
|
||||
* 交通部门审批人名称
|
||||
*/
|
||||
private String jtUserName;
|
||||
|
||||
/**
|
||||
* 交通部门审批附件路径
|
||||
*/
|
||||
@JsonProperty("JT_REVIEW_FILE")
|
||||
private String jtReviewFile;
|
||||
|
||||
/**
|
||||
* 城管部门审批附件路径
|
||||
*/
|
||||
@JsonProperty("CG_REVIEW_FILE")
|
||||
private String cgReviewFile;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updaterName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 运输订单基础信息DTO
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public static class TransportOrder {
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 预约结束日期(yyyy-mm-dd)
|
||||
*/
|
||||
private String appointmentEndDate;
|
||||
|
||||
/**
|
||||
* 预约结束时间(hh: mm)
|
||||
*/
|
||||
private String appointmentEndTime;
|
||||
|
||||
/**
|
||||
* 预约开始日期(yyyy-mm-dd)
|
||||
*/
|
||||
private String appointmentStartDate;
|
||||
|
||||
/**
|
||||
* 预约开始时间(hh: mm)
|
||||
*/
|
||||
private String appointmentStartTime;
|
||||
|
||||
/**
|
||||
* 所属区编码
|
||||
*/
|
||||
private String areaCode;
|
||||
|
||||
/**
|
||||
* 所属区名称
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 所属市编码
|
||||
*/
|
||||
private String cityCode;
|
||||
|
||||
/**
|
||||
* 所属市名称
|
||||
*/
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 建设工程(用地)规划许可证号
|
||||
*/
|
||||
private String constructionLandLicenseNum;
|
||||
|
||||
/**
|
||||
* 建设单位统一社会信用代码
|
||||
*/
|
||||
private String constructionUnitCreditCode;
|
||||
|
||||
/**
|
||||
* 建设单位负责人
|
||||
*/
|
||||
private String constructionUnitDirector;
|
||||
|
||||
/**
|
||||
* 建设单位名称
|
||||
*/
|
||||
private String constructionUnitName;
|
||||
|
||||
/**
|
||||
* 建设单位联系电话
|
||||
*/
|
||||
private String constructionUnitPhone;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createrName;
|
||||
|
||||
/**
|
||||
* 排放源(产废单位)
|
||||
*/
|
||||
private String emissionSource;
|
||||
|
||||
/**
|
||||
* 清运企业联系人
|
||||
*/
|
||||
private String enterpriseHead;
|
||||
|
||||
/**
|
||||
* 预估重量(单位: 吨)
|
||||
*/
|
||||
private String estimateWeight;
|
||||
|
||||
/**
|
||||
* 垃圾产出的许可证名称
|
||||
*/
|
||||
private String garbageProductionLicenseName;
|
||||
|
||||
/**
|
||||
* 垃圾产出的许可证编号
|
||||
*/
|
||||
private String garbageProductionLicenseNum;
|
||||
|
||||
/**
|
||||
* 垃圾现场照片路径(多个路径用逗号分隔)
|
||||
*/
|
||||
@JsonProperty("GARBAGE_SCENE_FILE")
|
||||
private String garbageSceneFile;
|
||||
|
||||
/**
|
||||
* 清运企业联系人电话
|
||||
*/
|
||||
private String headContact;
|
||||
|
||||
/**
|
||||
* 纬度(产废单位)
|
||||
*/
|
||||
private String latitude;
|
||||
|
||||
/**
|
||||
* 经度(产废单位)
|
||||
*/
|
||||
private String longitude;
|
||||
|
||||
/**
|
||||
* 订单编号(新的编号方式)
|
||||
*/
|
||||
private String orderNumber;
|
||||
|
||||
/**
|
||||
* 订单状态(90: 已处置(终端处置场提交处置表单,整个流程结束))
|
||||
*/
|
||||
private Integer orderStatus;
|
||||
|
||||
/**
|
||||
* 订单类型(1: 个人居民 2: 居委物业 3: 沿街商铺 4: 建筑工地)
|
||||
*/
|
||||
private Integer orderType;
|
||||
|
||||
/**
|
||||
* 工程名称(项目名称)
|
||||
*/
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 清运企业注册地址
|
||||
*/
|
||||
private String registerAddress;
|
||||
|
||||
/**
|
||||
* 建筑工地清运预约现场联系人
|
||||
*/
|
||||
private String sceneLinkName;
|
||||
|
||||
/**
|
||||
* 建筑工地清运预约现场联系电话
|
||||
*/
|
||||
private String sceneLinkPhone;
|
||||
|
||||
/**
|
||||
* 所属街道编码
|
||||
*/
|
||||
private String streetCode;
|
||||
|
||||
/**
|
||||
* 所属街道名称
|
||||
*/
|
||||
private String streetName;
|
||||
|
||||
/**
|
||||
* 清运企业id
|
||||
*/
|
||||
private String transportationEnterpriseId;
|
||||
|
||||
/**
|
||||
* 清运企业名称
|
||||
*/
|
||||
private String transportationEnterpriseName;
|
||||
|
||||
/**
|
||||
* 垃圾类型编码(1: 工程渣土 2: 工程泥浆 3: 工程垃圾 4: 拆除垃圾 5: 装修垃圾)
|
||||
*/
|
||||
private String wasteTypeCode;
|
||||
|
||||
/**
|
||||
* 垃圾类型名称(1: 工程渣土 2: 工程泥浆 3: 工程垃圾 4: 拆除垃圾 5: 装修垃圾)
|
||||
*/
|
||||
private String wasteTypeName;
|
||||
|
||||
/**
|
||||
* 施工单位统一社会信用代码
|
||||
*/
|
||||
private String workUnitCreditCode;
|
||||
|
||||
/**
|
||||
* 施工单位负责人
|
||||
*/
|
||||
private String workUnitDirector;
|
||||
|
||||
/**
|
||||
* 施工单位名称
|
||||
*/
|
||||
private String workUnitName;
|
||||
|
||||
/**
|
||||
* 施工单位联系电话
|
||||
*/
|
||||
private String workUnitPhone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 运输订单记录DTO
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public static class TransportOrderRecord {
|
||||
|
||||
/**
|
||||
* 消纳单位名称
|
||||
*/
|
||||
private String absorptionUnitName;
|
||||
|
||||
/**
|
||||
* 审批状态(3: 已审批)
|
||||
*/
|
||||
private Integer auditStatus;
|
||||
|
||||
/**
|
||||
* 运输车辆车牌号
|
||||
*/
|
||||
private String carNo;
|
||||
|
||||
/**
|
||||
* 消纳单位类型(1: 中转站 3: 资源利用企业 4: 消纳场)
|
||||
*/
|
||||
private String absorptionUnitType;
|
||||
|
||||
/**
|
||||
* 消纳单位编码
|
||||
*/
|
||||
private String absorptionUnitCode;
|
||||
|
||||
/**
|
||||
* 创建时间(yyyy-MM-dd HH: mm: ss)
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 运输司机驾驶证号
|
||||
*/
|
||||
private String driverLicense;
|
||||
|
||||
/**
|
||||
* 企业联系人
|
||||
*/
|
||||
private String enterpriseHead;
|
||||
|
||||
/**
|
||||
* 企业运输的许可证名称
|
||||
*/
|
||||
private String enterpriseTransportLicenseName;
|
||||
|
||||
/**
|
||||
* 企业运输的许可证编号
|
||||
*/
|
||||
private String enterpriseTransportLicenseNum;
|
||||
|
||||
/**
|
||||
* 预估重量(单位: 吨)
|
||||
*/
|
||||
private String estimateWeight;
|
||||
|
||||
/**
|
||||
* 司机实际结束运输时间
|
||||
*/
|
||||
private LocalDateTime haulageEndTimeStr;
|
||||
|
||||
/**
|
||||
* 司机实际开始运输时间
|
||||
*/
|
||||
private LocalDateTime haulageStartTimeStr;
|
||||
|
||||
/**
|
||||
* 联系人电话
|
||||
*/
|
||||
private String headContact;
|
||||
|
||||
/**
|
||||
* 运输许可证照片路径
|
||||
*/
|
||||
@JsonProperty("TRANS_LICENSE_FILE")
|
||||
private String transLicenseFile;
|
||||
|
||||
/**
|
||||
* 垃圾装车前附件路径
|
||||
*/
|
||||
@JsonProperty("GARBAGE_LOAD_BEFORE_FILE")
|
||||
private String garbageLoadBeforeFile;
|
||||
|
||||
/**
|
||||
* 垃圾装车后附件路径
|
||||
*/
|
||||
@JsonProperty("GARBAGE_LOAD_AFTER_FILE")
|
||||
private String garbageLoadAfterFile;
|
||||
|
||||
/**
|
||||
* 运输许可证有效期起止(格式:yyyy-MM-dd-yyyy-MM-dd)
|
||||
*/
|
||||
private String licenseValidityPeriodDateRange;
|
||||
|
||||
/**
|
||||
* 企业运输的许可证结束有效期
|
||||
*/
|
||||
private String licenseValidityPeriodEndDate;
|
||||
|
||||
/**
|
||||
* 企业运输的许可证开始有效期
|
||||
*/
|
||||
private String licenseValidityPeriodStartDate;
|
||||
|
||||
/**
|
||||
* 运输路线
|
||||
*/
|
||||
private String route;
|
||||
|
||||
/**
|
||||
* 批准(监督)单位名称
|
||||
*/
|
||||
private String superviseUnitName;
|
||||
|
||||
/**
|
||||
* 运输日期范围(格式:yyyy-MM-dd-yyyy-MM-dd)
|
||||
*/
|
||||
private String transportDateRange;
|
||||
|
||||
/**
|
||||
* 运输结束日期
|
||||
*/
|
||||
private String transportEndDate;
|
||||
|
||||
/**
|
||||
* 运输开始日期
|
||||
*/
|
||||
private String transportStartDate;
|
||||
|
||||
/**
|
||||
* 清运企业id
|
||||
*/
|
||||
private String transportationEnterpriseId;
|
||||
|
||||
/**
|
||||
* 清运企业名称
|
||||
*/
|
||||
private String transportationEnterpriseName;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 修改人名称
|
||||
*/
|
||||
private String updaterName;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa.pojo.param;
|
||||
|
||||
import com.njzscloud.common.http.annotation.MultiBodyParam;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class PushProvincialUploadParam {
|
||||
// 垃圾现场照片
|
||||
public static final String GARBAGE_SCENE_FILE = "GARBAGE_SCENE_FILE";
|
||||
// 垃圾产出的许可证照片
|
||||
public static final String LICENSE_FILE = "LICENSE_FILE";
|
||||
// 垃圾运输的许可证照片
|
||||
public static final String TRANS_LICENSE_FILE = "TRANS_LICENSE_FILE";
|
||||
// 委托书照片
|
||||
public static final String PROXY_STATEMENT_FILE = "PROXY_STATEMENT_FILE";
|
||||
// 建筑工地
|
||||
public static final String CONS_SITE_FILE = "CONS_SITE_FILE";
|
||||
// 居民小区
|
||||
public static final String RES_AREA_FILE = "RES_AREA_FILE";
|
||||
// 沿街商铺
|
||||
public static final String STREET_SHOP_FILE = "STREET_SHOP_FILE";
|
||||
// 运输企业
|
||||
public static final String TRANS_ENTER_FILE = "TRANS_ENTER_FILE";
|
||||
// 运输车辆
|
||||
public static final String TRANS_VEHICLE_FILE = "TRANS_VEHICLE_FILE";
|
||||
// 驾驶员
|
||||
public static final String TRANS_DRIVER_FILE = "TRANS_DRIVER_FILE";
|
||||
// 垃圾中转站
|
||||
public static final String TRANS_STA_FILE = "TRANS_STA_FILE";
|
||||
// 垃圾存放点
|
||||
public static final String STO_POINT_FILE = "STO_POINT_FILE";
|
||||
// 资源利用企业
|
||||
public static final String RES_UTIL_FILE = "RES_UTIL_FILE";
|
||||
// 垃圾消纳场所
|
||||
public static final String CONS_PLACE_FILE = "CONS_PLACE_FILE";
|
||||
// 垃圾回填场所
|
||||
public static final String BACKFILL_PLACE_FILE = "BACKFILL_PLACE_FILE";
|
||||
// 我的意见
|
||||
public static final String MY_OPINION_FILE = "MY_OPINION_FILE";
|
||||
// 主管部门审批附件
|
||||
public static final String ZG_REVIEW_FILE = "ZG_REVIEW_FILE";
|
||||
// 交通部门审批附件
|
||||
public static final String JT_REVIEW_FILE = "JT_REVIEW_FILE";
|
||||
// 城管部门审批附件
|
||||
public static final String CG_REVIEW_FILE = "CG_REVIEW_FILE";
|
||||
// 消息资讯附件
|
||||
public static final String NEWS_INFO_FILE = "NEWS_INFO_FILE";
|
||||
// 垃圾运输附件
|
||||
public static final String GARBAGE_TRANS_FILE = "GARBAGE_TRANS_FILE";
|
||||
// 终端处置场处置许可证附件
|
||||
public static final String HANDLE_LICENSE_FILE = "HANDLE_LICENSE_FILE";
|
||||
// 终端处置场处置凭证附件
|
||||
public static final String HANDLE_VOUCHER_FILE = "HANDLE_VOUCHER_FILE";
|
||||
// 无人机巡检案件附件/手机端上报案件附件
|
||||
public static final String INSPECTION_EVENT_FILE = "INSPECTION_EVENT_FILE";
|
||||
// 垃圾装车前附件
|
||||
public static final String GARBAGE_LOAD_BEFORE_FILE = "GARBAGE_LOAD_BEFORE_FILE";
|
||||
// 垃圾装车后附件
|
||||
public static final String GARBAGE_LOAD_AFTER_FILE = "GARBAGE_LOAD_AFTER_FILE";
|
||||
// 无人机巡检/手机端案件处置附件
|
||||
public static final String DISPOSAL_EVENT_FILE = "DISPOSAL_EVENT_FILE";
|
||||
|
||||
/**
|
||||
* 文件
|
||||
*/
|
||||
@MultiBodyParam
|
||||
private InputStream file;
|
||||
|
||||
/**
|
||||
* 路径,参照下方附件上传接口 路径字典值
|
||||
*/
|
||||
@MultiBodyParam
|
||||
private String uploadPath;
|
||||
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
package com.njzscloud.supervisory.hsoa.pojo.result;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class UploadResult {
|
||||
private String msg;
|
||||
private String flag;
|
||||
private String id;
|
||||
private String url;
|
||||
|
||||
public boolean isSuccess() {
|
||||
return "success".equals(flag);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,28 +1,36 @@
|
|||
package com.njzscloud.supervisory.hsoa.service;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njzscloud.common.core.jackson.Jackson;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.map.MapBuilder;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.njzscloud.common.core.ex.Exceptions;
|
||||
import com.njzscloud.supervisory.biz.pojo.entity.TruckLocationTrackEntity;
|
||||
import com.njzscloud.supervisory.biz.service.TruckLocationTrackService;
|
||||
import com.njzscloud.supervisory.hsoa.Hsoa;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushProvincialSaveParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushVehicleTrajectoryParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
||||
import com.njzscloud.supervisory.order.service.OrderInfoService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
import static com.njzscloud.supervisory.hsoa.pojo.param.PushProvincialUploadParam.*;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class HsoaService {
|
||||
// private final OrderInfoService orderInfoService;
|
||||
/* private final TruckLocationTrackService truckLocationTrackService;
|
||||
private final OrderInfoService orderInfoService;
|
||||
private final TruckLocationTrackService truckLocationTrackService;
|
||||
private final AtomicBoolean run = new AtomicBoolean(false);
|
||||
private final AtomicInteger succ = new AtomicInteger(0);
|
||||
private final AtomicInteger fail = new AtomicInteger(0);
|
||||
|
|
@ -129,148 +137,5 @@ public class HsoaService {
|
|||
.put("剩余数量", i1 - i2 - i3)
|
||||
.build();
|
||||
|
||||
} */
|
||||
|
||||
public HsoaResult<?> pushProvincialSave(OrderPagingResult detail) {
|
||||
log.info("上传数据:{}", Jackson.toJsonStr(detail));
|
||||
|
||||
PushProvincialSaveParam param = new PushProvincialSaveParam()
|
||||
.setHandleInfo(new PushProvincialSaveParam.HandleInfo()
|
||||
.setApproveDate(detail.getOutTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
||||
.setApproveUserName(detail.getCheckerName())
|
||||
// .setCreateTime(detail.getCreateTime())
|
||||
// .setCreaterName(detail.getContacts())
|
||||
// .setDisposalSiteCode("")
|
||||
.setDisposalSiteName(detail.getStationName())
|
||||
// .setHandleCraft("")
|
||||
// .setHandleLicenseName("")
|
||||
// .setHandleLicenseNum("")
|
||||
.setHandleMethod("资源化利用")
|
||||
.setLongitude(detail.getStationLng().toString())
|
||||
.setLatitude(detail.getStationLat().toString())
|
||||
// .setHANDLE_LICENSE_FILE("")
|
||||
// .setLicenseValidStartDate("")
|
||||
// .setLicenseValidEndDate("")
|
||||
.setLinkPhone(detail.getCheckerPhone())
|
||||
// .setSuperviseUnitName("")
|
||||
// .setUpdateTime("")
|
||||
// .setUpdaterName("")
|
||||
.setHandleVoucherFile(upload(detail.getCheckPhoto(), HANDLE_VOUCHER_FILE))
|
||||
.setWeight(new BigDecimal(detail.getSettleWeight()).divide(new BigDecimal(1000), 2, RoundingMode.HALF_UP).toPlainString())
|
||||
)
|
||||
.setReviewInfo(new PushProvincialSaveParam.ReviewInfo()
|
||||
.setCgAreaName(detail.getProvinceName() + detail.getCityName() + detail.getAreaName())
|
||||
.setCgReviewOpinion(StrUtil.isBlank(detail.getShiAuditMemo()) ? "同意" : detail.getShiAuditMemo())
|
||||
.setCgReviewTime(detail.getShiAuditTime())
|
||||
// .setCgUnitCode("")
|
||||
.setCgUnitName(detail.getAreaName() + "城管")
|
||||
.setCgUserId(detail.getQuAuditUserId() == null ? (detail.getShiAuditUserId() == null ? null : detail.getShiAuditUserId().toString()) : detail.getQuAuditUserId().toString())
|
||||
// .setCgUserName(detail.getQuAuditUserName() == null ? (detail.getShiAuditUserName() == null ? null : detail.getShiAuditUserName()) : detail.getQuAuditUserName())
|
||||
.setCgUserName(detail.getAreaName().contains("琅琊") ? "陶明莉" : (detail.getAreaName().contains("南谯") ? "刘浩" : (detail.getQuAuditUserName() == null ? (detail.getShiAuditUserName() == null ? null : detail.getShiAuditUserName()) : detail.getQuAuditUserName())))
|
||||
// .setCreateTime(detail.getCreateTime())
|
||||
// .setCreaterName(detail.getContacts())
|
||||
// .setCG_REVIEW_FILE("")
|
||||
)
|
||||
.setTransportOrder(new PushProvincialSaveParam.TransportOrder()
|
||||
.setAddress(detail.getAddress())
|
||||
.setAppointmentStartDate(detail.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
||||
.setAppointmentStartTime(detail.getCreateTime().format(DateTimeFormatter.ofPattern("HH:mm")))
|
||||
.setAreaCode(detail.getArea())
|
||||
.setAreaName(detail.getAreaName())
|
||||
.setCityCode(detail.getCity())
|
||||
.setCityName(detail.getCityName())
|
||||
.setConstructionUnitCreditCode(detail.getUscc())
|
||||
.setConstructionUnitName(detail.getCompanyName())
|
||||
.setConstructionUnitDirector(detail.getContacts())
|
||||
.setConstructionUnitPhone(detail.getPhone())
|
||||
.setEmissionSource(detail.getCompanyName() == null ? detail.getContacts() : detail.getCompanyName())
|
||||
.setEstimateWeight(detail.getEstimatedQuantity())
|
||||
.setGarbageSceneFile(upload(detail.getSitePhotos(), GARBAGE_SCENE_FILE))
|
||||
.setEnterpriseHead(detail.getTransContacts())
|
||||
.setHeadContact(detail.getTransPhone())
|
||||
.setLatitude(detail.getLat() == null ? null : detail.getLat().toString())
|
||||
.setLongitude(detail.getLng() == null ? null : detail.getLng().toString())
|
||||
// .setOrderNumber(detail.getArea() + detail.getSn())
|
||||
.setOrderStatus(90)
|
||||
.setOrderType(detail.getCompanyName() == null ? 1 : 4)
|
||||
.setProjectName(detail.getProjectName())
|
||||
.setRegisterAddress(detail.getTransAddress())
|
||||
.setSceneLinkName(detail.getContacts())
|
||||
.setSceneLinkPhone(detail.getPhone())
|
||||
.setStreetCode(detail.getTown())
|
||||
.setStreetName(detail.getTownName())
|
||||
.setTransportationEnterpriseId(detail.getTransCompanyId() == null ? null : detail.getTransCompanyId().toString())
|
||||
.setTransportationEnterpriseName(detail.getTransCompanyName())
|
||||
.setWasteTypeCode(detail.getGoodsName().contains("拆除") ? "4" :
|
||||
(detail.getGoodsName().contains("装修") ? "5" :
|
||||
(detail.getGoodsName().contains("建筑") ? "3" : (detail.getGoodsName().contains("园林") ? "3" : (detail.getGoodsName().contains("拆迁") ? "4" : null)))
|
||||
))
|
||||
.setWasteTypeName(detail.getGoodsName())
|
||||
.setWorkUnitCreditCode(detail.getUscc())
|
||||
.setWorkUnitDirector(detail.getContacts())
|
||||
.setWorkUnitPhone(detail.getPhone())
|
||||
.setWorkUnitName(detail.getCompanyName())
|
||||
)
|
||||
.setTransportOrderRecord(new PushProvincialSaveParam.TransportOrderRecord()
|
||||
.setAbsorptionUnitName(detail.getStationCompanyName())
|
||||
.setAuditStatus(3)
|
||||
.setCarNo(detail.getLicensePlate())
|
||||
.setAbsorptionUnitType("1")
|
||||
.setAbsorptionUnitCode(detail.getStationUscc())
|
||||
.setDriverLicense(detail.getDrivingLicenceNo())
|
||||
.setEnterpriseHead(detail.getDriverName())
|
||||
.setHeadContact(detail.getDriverPhone())
|
||||
// .setEnterpriseTransportLicenseName("")
|
||||
.setEnterpriseTransportLicenseNum(detail.getCertificateSn())
|
||||
.setEstimateWeight(detail.getEstimatedQuantity())
|
||||
.setHaulageStartTimeStr(detail.getTransTime())
|
||||
.setHaulageEndTimeStr(detail.getOutTime())
|
||||
// .setTRANS_LICENSE_FILE("")
|
||||
.setGarbageLoadBeforeFile(upload(detail.getCargoPhoto(), GARBAGE_LOAD_BEFORE_FILE))
|
||||
.setGarbageLoadAfterFile(upload(detail.getCargoPhoto(), GARBAGE_LOAD_AFTER_FILE))
|
||||
.setLicenseValidityPeriodDateRange(detail.getShiAuditTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + "-" + detail.getShiAuditTime().plusHours(24).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
||||
.setLicenseValidityPeriodStartDate(detail.getShiAuditTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
||||
.setLicenseValidityPeriodEndDate(detail.getShiAuditTime().plusHours(24).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
||||
// .setRoute("")
|
||||
.setSuperviseUnitName(detail.getAreaName())
|
||||
.setTransportDateRange(detail.getTransTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + "-" + detail.getOutTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
||||
.setTransportStartDate(detail.getTransTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
||||
.setTransportEndDate(detail.getOutTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")))
|
||||
.setTransportationEnterpriseId(detail.getTransCompanyId() == null ? null : detail.getTransCompanyId().toString())
|
||||
.setTransportationEnterpriseName(detail.getTransCompanyName())
|
||||
);
|
||||
log.info(Jackson.toJsonStr(param));
|
||||
return Hsoa.pushProvincial(param);
|
||||
// return null;
|
||||
}
|
||||
|
||||
private String upload(List<String> urls, String uploadPath) {
|
||||
return null;
|
||||
/* if (CollUtil.isEmpty(urls)) return null;
|
||||
String url = urls.get(0);
|
||||
if (StrUtil.isBlank(url)) return null;
|
||||
url = url.substring(1);
|
||||
String[] split = url.split("/");
|
||||
if (split.length < 2) return null;
|
||||
Tuple2<InputStream, String> tuple2 = AliOSS.obtainFile(split[0], split[1]);
|
||||
InputStream in = tuple2.get_0();
|
||||
try {
|
||||
ByteArrayOutputStream out = ImgUtil.compress(in, 0.5, FileUtil.extName(split[1]), 1024 * 1024);
|
||||
byte[] bytes = out.toByteArray();
|
||||
UploadResult upload = Hsoa.upload(new PushProvincialUploadParam()
|
||||
.setFile(new ByteArrayInputStream(bytes))
|
||||
.setUploadPath(uploadPath)
|
||||
);
|
||||
if (upload.isSuccess()) {
|
||||
log.info("图片:{}、{}", uploadPath, upload.getUrl());
|
||||
return upload.getUrl();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
IoUtil.close(in);
|
||||
} */
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ public enum MoneyChangeCategory implements DictStr {
|
|||
DingDanTiaoZhang("DingDanTiaoZhang", "订单调账"),
|
||||
DingDanKouKuan("DingDanKouKuan", "订单扣款"),
|
||||
DingDanTuiKuan("DingDanTuiKuan", "订单退款"),
|
||||
DuanBoYingShou("DuanBoYingShou", "短驳营收"),
|
||||
;
|
||||
private final String val;
|
||||
private final String txt;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.njzscloud.supervisory.money.pojo.entity;
|
|||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.njzscloud.supervisory.money.contant.BillStatus;
|
||||
import com.njzscloud.supervisory.money.contant.InvoiceStatus;
|
||||
import com.njzscloud.supervisory.order.contant.OrderCategory;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
|
@ -138,9 +137,4 @@ public class MoneyBillEntity {
|
|||
*/
|
||||
private String goodsName;
|
||||
|
||||
/**
|
||||
* 订单类型; 字典代码:order_category
|
||||
*/
|
||||
private String orderCategory;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@ import lombok.experimental.Accessors;
|
|||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author ljw
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
|
|
@ -26,10 +23,6 @@ public class MoneyBillResult {
|
|||
private Long orderId;
|
||||
private BigDecimal discountMoney;
|
||||
private BigDecimal settleMoney;
|
||||
/**
|
||||
* 订单类型; 字典代码:order_category
|
||||
*/
|
||||
private String orderCategory;
|
||||
/**
|
||||
* 净重
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.njzscloud.supervisory.money.quartz;
|
||||
|
||||
import com.njzscloud.supervisory.goods.contant.MoneyStrategy;
|
||||
import com.njzscloud.supervisory.money.mapper.MoneyBillMapper;
|
||||
import com.njzscloud.supervisory.money.pojo.entity.MoneyBillEntity;
|
||||
import com.njzscloud.supervisory.money.pojo.result.MoneyBillResult;
|
||||
|
|
@ -16,9 +17,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author ljw
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
|
|
@ -26,8 +24,8 @@ public class MoneyBillQuartz {
|
|||
|
||||
private final MoneyBillMapper moneyBillMapper;
|
||||
|
||||
// @Scheduled(cron = "0 0/5 * * * ?")//每1分钟一次
|
||||
@Scheduled(cron = "0 0 1 27 * ?")// 每月27号凌晨1点执行
|
||||
// @Scheduled(cron = "0 0/1 * * * ?")//每1分钟一次
|
||||
@Scheduled(cron = "0 0 1 27 * ?")//每月27号凌晨1点执行
|
||||
public void syncAssetsDiscover() {
|
||||
generateMoneyBill();
|
||||
}
|
||||
|
|
@ -35,11 +33,9 @@ public class MoneyBillQuartz {
|
|||
public void generateMoneyBill() {
|
||||
// 计算上个月的时间范围
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 上个月1号0点0分0秒
|
||||
LocalDateTime lastMonthStart = now.minusMonths(1).withDayOfMonth(1).with(LocalTime.MIN);
|
||||
// 上个月月末23点59分59秒
|
||||
LocalDateTime lastMonthStart = now.minusMonths(1).withDayOfMonth(1).with(LocalTime.MIN); // 上个月1号0点0分0秒
|
||||
LocalDateTime lastMonthEnd = now.minusMonths(1).withDayOfMonth(now.minusMonths(1).toLocalDate().lengthOfMonth())
|
||||
.with(LocalTime.MAX);
|
||||
.with(LocalTime.MAX); // 上个月月末23点59分59秒
|
||||
|
||||
// 创建查询条件
|
||||
MoneyBillResult queryCondition = new MoneyBillResult();
|
||||
|
|
@ -48,94 +44,79 @@ public class MoneyBillQuartz {
|
|||
|
||||
// 执行查询
|
||||
List<MoneyBillResult> billResults = moneyBillMapper.selectMoneyBillList(queryCondition);
|
||||
// 仅保留订单类型为 PuTong 或 DuanBoRu 的记录
|
||||
billResults = billResults.stream()
|
||||
.filter(r -> "PuTong".equals(r.getOrderCategory()) || "DuanBoRu".equals(r.getOrderCategory()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
log.info("查询到上个月账单数据 {} 条", billResults.size());
|
||||
|
||||
if (!billResults.isEmpty()) {
|
||||
// 先按transCompanyId、originExpenseItemId、orderCategory三层分组,区分不同订单类型(如 DuanBoRu 与 PuTong)
|
||||
Map<Long, Map<Long, Map<String, List<MoneyBillResult>>>> groupedResults = billResults.stream()
|
||||
if (billResults.size() > 0) {
|
||||
// 先按transCompanyId分组,再按originExpenseItemId分组
|
||||
Map<Long, Map<Long, List<MoneyBillResult>>> groupedResults = billResults.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
MoneyBillResult::getTransCompanyId,
|
||||
Collectors.groupingBy(MoneyBillResult::getOriginExpenseItemId,
|
||||
Collectors.groupingBy(MoneyBillResult::getOrderCategory))
|
||||
Collectors.groupingBy(MoneyBillResult::getOriginExpenseItemId)
|
||||
));
|
||||
|
||||
log.info("按transCompanyId、originExpenseItemId和orderCategory三级分组后共 {} 个公司分组", groupedResults.size());
|
||||
log.info("按transCompanyId和originExpenseItemId二级分组后共 {} 个公司分组", groupedResults.size());
|
||||
|
||||
// 处理每个公司分组的数据
|
||||
List<MoneyBillEntity> entityList = Lists.newArrayList();
|
||||
for (Map.Entry<Long, Map<Long, Map<String, List<MoneyBillResult>>>> companyEntry : groupedResults.entrySet()) {
|
||||
for (Map.Entry<Long, Map<Long, List<MoneyBillResult>>> companyEntry : groupedResults.entrySet()) {
|
||||
Long transCompanyId = companyEntry.getKey();
|
||||
Map<Long, Map<String, List<MoneyBillResult>>> companyGroupResults = companyEntry.getValue();
|
||||
Map<Long, List<MoneyBillResult>> companyGroupResults = companyEntry.getValue();
|
||||
|
||||
log.info("transCompanyId: {}, 该公司包含 {} 个originExpenseItemId分组",
|
||||
transCompanyId, companyGroupResults.size());
|
||||
|
||||
// 处理该公司下的每个originExpenseItemId分组
|
||||
for (Map.Entry<Long, Map<String, List<MoneyBillResult>>> itemEntry : companyGroupResults.entrySet()) {
|
||||
for (Map.Entry<Long, List<MoneyBillResult>> itemEntry : companyGroupResults.entrySet()) {
|
||||
Long originExpenseItemId = itemEntry.getKey();
|
||||
Map<String, List<MoneyBillResult>> categoryGroupMap = itemEntry.getValue();
|
||||
List<MoneyBillResult> itemGroupResults = itemEntry.getValue();
|
||||
|
||||
for (Map.Entry<String, List<MoneyBillResult>> categoryEntry : categoryGroupMap.entrySet()) {
|
||||
String orderCategoryStr = categoryEntry.getKey();
|
||||
List<MoneyBillResult> itemGroupResults = categoryEntry.getValue();
|
||||
log.info("transCompanyId: {}, originExpenseItemId: {}, 该分组包含 {} 条数据",
|
||||
transCompanyId, originExpenseItemId, itemGroupResults.size());
|
||||
|
||||
log.info("transCompanyId: {}, originExpenseItemId: {}, orderCategory: {}, 该分组包含 {} 条数据",
|
||||
transCompanyId, originExpenseItemId, orderCategoryStr, itemGroupResults.size());
|
||||
// 这里可以根据业务需求处理每个分组的数据
|
||||
// 例如:计算总金额、创建MoneyBillEntity等
|
||||
MoneyBillEntity entity = new MoneyBillEntity();
|
||||
entity.setStationId(transCompanyId);
|
||||
entity.setStartTime(lastMonthStart.toLocalDate());
|
||||
entity.setEndTime(lastMonthEnd.toLocalDate());
|
||||
entity.setGoodsId(originExpenseItemId);
|
||||
|
||||
// 创建账单实体并计算汇总字段
|
||||
MoneyBillEntity entity = new MoneyBillEntity();
|
||||
entity.setStationId(transCompanyId);
|
||||
entity.setStartTime(lastMonthStart.toLocalDate());
|
||||
entity.setEndTime(lastMonthEnd.toLocalDate());
|
||||
entity.setGoodsId(originExpenseItemId);
|
||||
// 1. 订单数量:通过orderId分组,条数就是订单数
|
||||
long orderCount = itemGroupResults.stream()
|
||||
.map(MoneyBillResult::getOrderId)
|
||||
.distinct()
|
||||
.count();
|
||||
entity.setOrderCount((int) orderCount);
|
||||
|
||||
// 1. 订单数量:通过orderId分组,条数就是订单数
|
||||
long orderCount = itemGroupResults.stream()
|
||||
.map(MoneyBillResult::getOrderId)
|
||||
.distinct()
|
||||
.count();
|
||||
entity.setOrderCount((int) orderCount);
|
||||
// 2. 车数=订单数
|
||||
entity.setCarCount((int) orderCount);
|
||||
|
||||
// 2. 车数=订单数
|
||||
entity.setCarCount((int) orderCount);
|
||||
// 3. 总质量
|
||||
int totalWeight = itemGroupResults.stream()
|
||||
.mapToInt(MoneyBillResult::getSettleWeight)
|
||||
.sum();
|
||||
entity.setTotalWeight(totalWeight);
|
||||
|
||||
// 3. 总质量
|
||||
int totalWeight = itemGroupResults.stream()
|
||||
.mapToInt(MoneyBillResult::getSettleWeight)
|
||||
.sum();
|
||||
entity.setTotalWeight(totalWeight);
|
||||
// 4. 优惠金额:discountMoney求和,可能是负数
|
||||
BigDecimal totalDiscountMoney = itemGroupResults.stream()
|
||||
.map(MoneyBillResult::getDiscountMoney)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
entity.setDiscountMoney(totalDiscountMoney);
|
||||
|
||||
// 4. 优惠金额:discountMoney求和,可能是负数
|
||||
BigDecimal totalDiscountMoney = itemGroupResults.stream()
|
||||
.map(MoneyBillResult::getDiscountMoney)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
entity.setDiscountMoney(totalDiscountMoney);
|
||||
// 5. 账单金额:settleMoney求和,可能是负数
|
||||
BigDecimal totalSettleMoney = itemGroupResults.stream()
|
||||
.map(MoneyBillResult::getSettleMoney)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
entity.setTotalMoney(totalSettleMoney);
|
||||
|
||||
// 5. 账单金额:settleMoney求和,可能是负数
|
||||
BigDecimal totalSettleMoney = itemGroupResults.stream()
|
||||
.map(MoneyBillResult::getSettleMoney)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
entity.setTotalMoney(totalSettleMoney);
|
||||
|
||||
// 设置其他基本信息(取第一条记录的信息)
|
||||
MoneyBillResult firstResult = itemGroupResults.get(0);
|
||||
entity.setUserId(firstResult.getUserId());
|
||||
entity.setGoodsName(firstResult.getExpenseItemName());
|
||||
|
||||
// 如果存在订单类型字符串,则直接设置(实体中为 String 类型)
|
||||
if (orderCategoryStr != null) {
|
||||
entity.setOrderCategory(orderCategoryStr);
|
||||
}
|
||||
|
||||
entityList.add(entity);
|
||||
log.info("生成账单实体: transCompanyId={}, originExpenseItemId={}, orderCategory={}, 订单数={}, 总质量={}, 车数={}, 优惠金额={}, 账单金额={}",
|
||||
transCompanyId, originExpenseItemId, orderCategoryStr, orderCount, totalWeight, orderCount, totalDiscountMoney, totalSettleMoney);
|
||||
}
|
||||
// 设置其他基本信息(取第一条记录的信息)
|
||||
MoneyBillResult firstResult = itemGroupResults.get(0);
|
||||
entity.setUserId(firstResult.getUserId());
|
||||
entity.setGoodsName(firstResult.getExpenseItemName());
|
||||
entityList.add(entity);
|
||||
log.info("生成账单实体: transCompanyId={}, originExpenseItemId={}, 订单数={}, 总质量={}, 车数={}, 优惠金额={}, 账单金额={}",
|
||||
transCompanyId, originExpenseItemId, orderCount, totalWeight, orderCount, totalDiscountMoney, totalSettleMoney);
|
||||
}
|
||||
}
|
||||
// 账单入库
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.njzscloud.common.mp.support.PageParam;
|
|||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.common.security.util.SecurityUtil;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import com.njzscloud.supervisory.goods.contant.MoneyStrategy;
|
||||
import com.njzscloud.supervisory.money.mapper.MoneyBillMapper;
|
||||
import com.njzscloud.supervisory.money.pojo.entity.MoneyBillEntity;
|
||||
import com.njzscloud.supervisory.money.pojo.result.MoneyBillResult;
|
||||
|
|
@ -30,7 +31,6 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* 对账单
|
||||
* @author ljw
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
|
|
@ -107,10 +107,9 @@ public class MoneyBillService extends ServiceImpl<MoneyBillMapper, MoneyBillEnti
|
|||
queryCondition.setEndTime(endTime);
|
||||
queryCondition.setOriginExpenseItemId(entity.getGoodsId());
|
||||
queryCondition.setTransCompanyId(entity.getStationId());
|
||||
queryCondition.setOrderCategory(entity.getOrderCategory());
|
||||
// 执行查询
|
||||
List<MoneyBillResult> billResults = baseMapper.selectMoneyBillList(queryCondition);
|
||||
if (null != billResults && !billResults.isEmpty()) {
|
||||
if (null != billResults && billResults.size() > 0) {
|
||||
// 1. 订单数量:通过orderId分组,条数就是订单数
|
||||
long orderCount = billResults.stream().
|
||||
map(MoneyBillResult::getOrderId)
|
||||
|
|
|
|||
|
|
@ -263,7 +263,6 @@ public class OrderInfoController {
|
|||
|
||||
/**
|
||||
* 转办
|
||||
*
|
||||
* @param orderId 订单Id
|
||||
*/
|
||||
@GetMapping("/forwarded")
|
||||
|
|
@ -293,9 +292,4 @@ public class OrderInfoController {
|
|||
return R.success();
|
||||
}
|
||||
|
||||
@PostMapping("/hsoa/push_provincial")
|
||||
public R<?> pushProvincial(@RequestBody List<String> orderSns) {
|
||||
return R.success(orderInfoService.pushProvincial(orderSns));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,4 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
|
|||
BizCompanyEntity getTransInfo(@Param("transCompanyId") Long transCompanyId);
|
||||
|
||||
DeviceLocalizerEntity gpsLastOnlineTime(@Param("gpsId") String gpsId);
|
||||
|
||||
List<String> getRoute(@Param("id") Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,22 +104,12 @@ public class OrderInfoEntity {
|
|||
/**
|
||||
* 审核备注
|
||||
*/
|
||||
private String shiAuditMemo;
|
||||
private String auditMemo;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private LocalDateTime shiAuditTime;
|
||||
|
||||
/**
|
||||
* 审核备注
|
||||
*/
|
||||
private String quAuditMemo;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private LocalDateTime quAuditTime;
|
||||
private LocalDateTime auditTime;
|
||||
/**
|
||||
* 审核图片
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ public class OrderPagingResult {
|
|||
* 昵称
|
||||
*/
|
||||
private String nickname;
|
||||
private Integer stationType;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
|
|
@ -113,8 +112,7 @@ public class OrderPagingResult {
|
|||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private LocalDateTime shiAuditTime;
|
||||
private LocalDateTime quAuditTime;
|
||||
private LocalDateTime auditTime;
|
||||
/**
|
||||
* 区审核人
|
||||
*/
|
||||
|
|
@ -145,11 +143,8 @@ public class OrderPagingResult {
|
|||
/**
|
||||
* 审核备注
|
||||
*/
|
||||
private String shiAuditMemo;
|
||||
private String quAuditMemo;
|
||||
private String auditMemo;
|
||||
private String checkerName;
|
||||
private String checkerPhone;
|
||||
|
||||
|
||||
/**
|
||||
* 订单类型; 字典代码:order_category
|
||||
|
|
@ -521,11 +516,6 @@ public class OrderPagingResult {
|
|||
private Double transLat;
|
||||
private String transContacts;
|
||||
private String transPhone;
|
||||
private String transIdcard;
|
||||
private String transIdcardStartTime;
|
||||
private String transIdcardEndTime;
|
||||
private String transIdcardFront;
|
||||
private String transIdcardBack;
|
||||
// endregion
|
||||
// region 站点信息
|
||||
/**
|
||||
|
|
@ -540,8 +530,5 @@ public class OrderPagingResult {
|
|||
private String stationUscc;
|
||||
private String stationContacts;
|
||||
private String stationPhone;
|
||||
private Double stationLng;
|
||||
private Double stationLat;
|
||||
private List<String> route;
|
||||
// endregion
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,6 @@ import lombok.experimental.Accessors;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author ljw
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
|
|
@ -23,7 +20,6 @@ public class PaymentContextResult {
|
|||
private Long companyUserId;
|
||||
private Long companyAccountId;
|
||||
private BigDecimal companyBalance;
|
||||
private BigDecimal revenue;
|
||||
|
||||
private String settlementWay;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ public class TrainBillResult {
|
|||
*/
|
||||
private String nickname;
|
||||
private BizObj bizObj;
|
||||
private Integer stationType;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
|
|
@ -473,11 +472,6 @@ public class TrainBillResult {
|
|||
private Double transLat;
|
||||
private String transContacts;
|
||||
private String transPhone;
|
||||
private String transIdcard;
|
||||
private String transIdcardStartTime;
|
||||
private String transIdcardEndTime;
|
||||
private String transIdcardFront;
|
||||
private String transIdcardBack;
|
||||
// endregion
|
||||
// region 站点信息
|
||||
/**
|
||||
|
|
@ -489,7 +483,5 @@ public class TrainBillResult {
|
|||
private String stationUscc;
|
||||
private String stationContacts;
|
||||
private String stationPhone;
|
||||
private List<String> route;
|
||||
|
||||
// endregion
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ import com.njzscloud.supervisory.goods.contant.MoneyStrategy;
|
|||
import com.njzscloud.supervisory.hsoa.Hsoa;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.param.PushVehicleTrajectoryParam;
|
||||
import com.njzscloud.supervisory.hsoa.pojo.result.HsoaResult;
|
||||
import com.njzscloud.supervisory.hsoa.service.HsoaService;
|
||||
import com.njzscloud.supervisory.money.contant.MoneyChangeCategory;
|
||||
import com.njzscloud.supervisory.money.pojo.entity.MoneyAccountEntity;
|
||||
import com.njzscloud.supervisory.money.pojo.entity.MoneyChangeDetailEntity;
|
||||
|
|
@ -116,7 +115,6 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
private final UserService userService;
|
||||
private final BizTruckService bizTruckService;
|
||||
private final DiscountManageService discountManageService;
|
||||
private final HsoaService hsoaService;
|
||||
private final AtomicBoolean test_thread_running = new AtomicBoolean(false);
|
||||
Thread test_thread = null;
|
||||
@Value("${app.check-gps:false}")
|
||||
|
|
@ -126,10 +124,6 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
* 新增
|
||||
*/
|
||||
public void add(AddOrderInfoParam addOrderInfoParam, String orderSn) {
|
||||
Long stationId = addOrderInfoParam.getStationId();
|
||||
BizCompanyEntity stationInfo = bizCompanyService.getById(stationId);
|
||||
Assert.notNull(stationInfo, () -> Exceptions.clierr("站点信息错误"));
|
||||
Assert.isTrue(Integer.valueOf(1).equals(stationInfo.getStationType()), () -> Exceptions.clierr("系统暂未对接,预约失败"));
|
||||
Assert.isFalse(this.exists(Wrappers.<OrderInfoEntity>lambdaQuery().eq(OrderInfoEntity::getSn, addOrderInfoParam.getSn())), () -> Exceptions.exception("订单创建失败,订单号重复"));
|
||||
AddOrderCargoPlaceParam cargoPlace = addOrderInfoParam.getCargoPlace();
|
||||
long cargoPlaceId = orderCargoPlaceService.add(cargoPlace);
|
||||
|
|
@ -160,6 +154,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
|
||||
Long orderId = orderInfoEntity.getId();
|
||||
if (orderCategory == OrderCategory.DuanBoChu) {
|
||||
Long stationId = addOrderInfoParam.getStationId();
|
||||
Long targetStationId = addOrderInfoParam.getTargetStationId();
|
||||
this.add(addOrderInfoParam.setOrderCategory(OrderCategory.DuanBoRu)
|
||||
.setTargetOrderId(orderId)
|
||||
|
|
@ -213,11 +208,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
* 详情
|
||||
*/
|
||||
public OrderPagingResult detail(Long id) {
|
||||
List<String> routes = baseMapper.getRoute(id);
|
||||
OrderPagingResult orderPagingResult = baseMapper.detail(Wrappers.<OrderPagingResult>query()
|
||||
return baseMapper.detail(Wrappers.<OrderPagingResult>query()
|
||||
.in("a.id", id));
|
||||
orderPagingResult.setRoute(routes);
|
||||
return orderPagingResult;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -533,7 +525,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
ew
|
||||
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
||||
.and(it ->
|
||||
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).in("a.audit_status", AuditStatus.ShiDaiShenHe, AuditStatus.TongGuo))
|
||||
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).eq("a.audit_status", AuditStatus.ShiDaiShenHe))
|
||||
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).eq("a.audit_status", AuditStatus.TongGuo))
|
||||
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList).eq("a.audit_status", AuditStatus.TongGuo))
|
||||
);
|
||||
|
|
@ -560,7 +552,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
ew
|
||||
.in("a.order_status", OrderStatus.YiJieDan, OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
||||
.and(it ->
|
||||
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).in("a.audit_status", AuditStatus.ShiDaiShenHe, AuditStatus.TongGuo))
|
||||
it.or(CollUtil.isNotEmpty(areaList), it0 -> it0.in("b.area", areaList).eq("a.audit_status", AuditStatus.ShiDaiShenHe))
|
||||
.or(CollUtil.isNotEmpty(cityList), it1 -> it1.in("b.area", cityList).in("a.audit_status", AuditStatus.TongGuo, AuditStatus.BoHui))
|
||||
.or(CollUtil.isNotEmpty(cityAreaList), it2 -> it2.in("b.area", cityAreaList).in("a.audit_status", AuditStatus.TongGuo, AuditStatus.BoHui))
|
||||
);
|
||||
|
|
@ -605,16 +597,10 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
Long shiAuditUserId = null;
|
||||
String quAuditPicture = null;
|
||||
String shiAuditPicture = null;
|
||||
String shiAuditMemo = null;
|
||||
LocalDateTime shiAuditTime = null;
|
||||
String quAuditMemo = null;
|
||||
LocalDateTime quAuditTime = null;
|
||||
if (auditStatus == AuditStatus.QuDaiShenHe) {
|
||||
if (StrUtil.isNotBlank(areaRole) && roles.contains(areaRole)) {
|
||||
quAuditUserId = SecurityUtil.currentUserId();
|
||||
quAuditPicture = auditOrderParam.getAuditPicture();
|
||||
quAuditMemo = auditOrderParam.getAuditMemo();
|
||||
quAuditTime = LocalDateTime.now();
|
||||
auditStatus = newAuditStatus == AuditStatus.TongGuo ? AuditStatus.ShiDaiShenHe : newAuditStatus;
|
||||
} else {
|
||||
throw Exceptions.clierr("您没有权限审核该订单");
|
||||
|
|
@ -623,8 +609,6 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
if (StrUtil.isNotBlank(cityRole) && roles.contains(cityRole)) {
|
||||
shiAuditUserId = SecurityUtil.currentUserId();
|
||||
shiAuditPicture = auditOrderParam.getAuditPicture();
|
||||
shiAuditMemo = auditOrderParam.getAuditMemo();
|
||||
shiAuditTime = LocalDateTime.now();
|
||||
auditStatus = newAuditStatus;
|
||||
} else {
|
||||
throw Exceptions.clierr("您没有权限审核该订单");
|
||||
|
|
@ -634,10 +618,6 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
shiAuditUserId = SecurityUtil.currentUserId();
|
||||
quAuditPicture = auditOrderParam.getAuditPicture();
|
||||
shiAuditPicture = auditOrderParam.getAuditPicture();
|
||||
quAuditMemo = auditOrderParam.getAuditMemo();
|
||||
quAuditTime = LocalDateTime.now();
|
||||
shiAuditMemo = auditOrderParam.getAuditMemo();
|
||||
shiAuditTime = LocalDateTime.now();
|
||||
auditStatus = newAuditStatus;
|
||||
}
|
||||
|
||||
|
|
@ -657,12 +637,10 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
.setShiAuditUserId(shiAuditUserId)
|
||||
.setQuAuditPicture(quAuditPicture)
|
||||
.setShiAuditPicture(shiAuditPicture)
|
||||
.setShiAuditTime(shiAuditTime)
|
||||
.setShiAuditMemo(shiAuditMemo)
|
||||
.setQuAuditTime(quAuditTime)
|
||||
.setQuAuditMemo(quAuditMemo)
|
||||
.setCertificateSn(certificateSn)
|
||||
.setAuditTime(LocalDateTime.now())
|
||||
.setCheckStatus(checkStatus)
|
||||
.setAuditMemo(auditOrderParam.getAuditMemo())
|
||||
);
|
||||
OrderCategory orderCategory = detail.getOrderCategory();
|
||||
if (orderCategory == OrderCategory.DuanBoRu) return;
|
||||
|
|
@ -901,7 +879,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
OrderGoodsEntity entity = orderGoodsService.getById(orderInfo.getGoodsId());
|
||||
Assert.notNull(entity, () -> Exceptions.clierr("产品不存在"));
|
||||
|
||||
if (MoneyWay.IN.getVal().equals(entity.getMoneyWay()) && OrderCategory.PuTong.equals(orderInfo.getOrderCategory())) {
|
||||
if (MoneyWay.IN.getVal().equals(entity.getMoneyWay())) {
|
||||
// 入场付费无称重,不需要更新付费项
|
||||
// 处理公司支付
|
||||
handleCompanyPay(orderInfo, Boolean.TRUE, new BigDecimal("0"), Boolean.FALSE);
|
||||
|
|
@ -957,46 +935,15 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
payMoney = changeMoney;
|
||||
}
|
||||
if (payMoney != null && payMoney.compareTo(BigDecimal.ZERO) > 0) {
|
||||
if (OrderCategory.PuTong.equals(orderInfo.getOrderCategory())) {
|
||||
if (!SettlementWay.CASH.getVal().equals(ctx.getSettlementWay())) {
|
||||
String way = SettlementWay.BALANCE.getVal().equals(ctx.getSettlementWay()) ?
|
||||
SettlementWay.BALANCE.getTxt() : SettlementWay.MONTH.getTxt();
|
||||
BigDecimal oldBalance = ctx.getCompanyBalance();
|
||||
BigDecimal newBalance = oldBalance.subtract(payMoney);
|
||||
// 更新账户余额(支持负数余额)
|
||||
MoneyAccountEntity companyAccount = new MoneyAccountEntity()
|
||||
.setId(ctx.getCompanyAccountId())
|
||||
.setMoney(newBalance);
|
||||
moneyAccountService.updateById(companyAccount);
|
||||
|
||||
// 记录资金变动明细
|
||||
MoneyChangeDetailEntity changeDetail = new MoneyChangeDetailEntity()
|
||||
.setCompanyId(ctx.getTransCompanyId())
|
||||
.setOrderId(orderInfo.getId())
|
||||
.setMoneyAccountId(companyAccount.getId())
|
||||
.setOldMoney(oldBalance)
|
||||
// 扣减为负数
|
||||
.setDelta(payMoney.negate())
|
||||
.setNewMoney(newBalance)
|
||||
.setMoneyChangeCategory(MoneyChangeCategory.DingDanKouKuan)
|
||||
.setMemo("订单支付扣款,订单号:" + orderInfo.getSn() + ",结算方式:" + way);
|
||||
|
||||
moneyChangeDetailService.save(changeDetail);
|
||||
|
||||
log.info("公司账户扣减成功,用户ID:{},扣减金额:{},余额:{} -> {},结算方式:{}",
|
||||
ctx.getCompanyUserId(), payMoney, oldBalance, newBalance, ctx.getSettlementWay());
|
||||
|
||||
// 更新订单支付状态为已支付
|
||||
return updateOrderPaymentStatus(orderInfo, ctx, isIn);
|
||||
}
|
||||
} else if (OrderCategory.DuanBoRu.equals(orderInfo.getOrderCategory())) {
|
||||
// 短驳入订单,增加营收
|
||||
BigDecimal oldRevenue = ctx.getRevenue();
|
||||
BigDecimal newRevenue = oldRevenue.add(payMoney);
|
||||
// 更新账户营收
|
||||
if (!SettlementWay.CASH.getVal().equals(ctx.getSettlementWay())) {
|
||||
String way = SettlementWay.BALANCE.getVal().equals(ctx.getSettlementWay()) ?
|
||||
SettlementWay.BALANCE.getTxt() : SettlementWay.MONTH.getTxt();
|
||||
BigDecimal oldBalance = ctx.getCompanyBalance();
|
||||
BigDecimal newBalance = oldBalance.subtract(payMoney);
|
||||
// 更新账户余额(支持负数余额)
|
||||
MoneyAccountEntity companyAccount = new MoneyAccountEntity()
|
||||
.setId(ctx.getCompanyAccountId())
|
||||
.setRevenue(newRevenue);
|
||||
.setMoney(newBalance);
|
||||
moneyAccountService.updateById(companyAccount);
|
||||
|
||||
// 记录资金变动明细
|
||||
|
|
@ -1004,50 +951,57 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
.setCompanyId(ctx.getTransCompanyId())
|
||||
.setOrderId(orderInfo.getId())
|
||||
.setMoneyAccountId(companyAccount.getId())
|
||||
.setOldMoney(oldRevenue)
|
||||
// 扣减为负数
|
||||
.setDelta(payMoney)
|
||||
.setNewMoney(newRevenue)
|
||||
.setMoneyChangeCategory(MoneyChangeCategory.DuanBoYingShou)
|
||||
.setMemo("短驳营收,订单号:" + orderInfo.getSn());
|
||||
.setOldMoney(oldBalance)
|
||||
.setDelta(payMoney.negate()) // 扣减为负数
|
||||
.setNewMoney(newBalance)
|
||||
.setMoneyChangeCategory(MoneyChangeCategory.DingDanKouKuan)
|
||||
.setMemo("订单支付扣款,订单号:" + orderInfo.getSn() + ",结算方式:" + way);
|
||||
|
||||
moneyChangeDetailService.save(changeDetail);
|
||||
|
||||
log.info("公司营收增加成功,用户ID:{},扣减金额:{},余额:{} -> {}",
|
||||
ctx.getCompanyUserId(), payMoney, oldRevenue, newRevenue);
|
||||
log.info("公司账户扣减成功,用户ID:{},扣减金额:{},余额:{} -> {},结算方式:{}",
|
||||
ctx.getCompanyUserId(), payMoney, oldBalance, newBalance, ctx.getSettlementWay());
|
||||
|
||||
// 更新订单支付状态为已支付
|
||||
return updateOrderPaymentStatus(orderInfo, ctx, isIn);
|
||||
OrderInfoEntity entity = new OrderInfoEntity();
|
||||
entity.setId(orderInfo.getId());
|
||||
entity.setPaymentStatus(PaymentStatus.YiZhiFu);
|
||||
entity.setSettlementWay(ctx.getSettlementWay());
|
||||
entity.setPayTime(LocalDateTime.now());
|
||||
if (!isIn) {
|
||||
entity.setOrderStatus(OrderStatus.YiWanCheng);
|
||||
this.updateById(entity);
|
||||
return true;
|
||||
} else {
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
// 如果支付金额为0,则直接改状态
|
||||
// 更新订单支付状态为已支付
|
||||
return updateOrderPaymentStatus(orderInfo, ctx, isIn);
|
||||
OrderInfoEntity entity = new OrderInfoEntity();
|
||||
entity.setId(orderInfo.getId());
|
||||
entity.setSettlementWay(ctx.getSettlementWay());
|
||||
entity.setPaymentStatus(PaymentStatus.YiZhiFu);
|
||||
entity.setPayTime(LocalDateTime.now());
|
||||
if (!isIn) {
|
||||
entity.setOrderStatus(OrderStatus.YiWanCheng);
|
||||
this.updateById(entity);
|
||||
return true;
|
||||
} else {
|
||||
this.updateById(entity);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean updateOrderPaymentStatus(OrderInfoEntity orderInfo, PaymentContextResult ctx, Boolean isIn) {
|
||||
OrderInfoEntity entity = new OrderInfoEntity();
|
||||
entity.setId(orderInfo.getId());
|
||||
entity.setPaymentStatus(PaymentStatus.YiZhiFu);
|
||||
entity.setSettlementWay(ctx.getSettlementWay());
|
||||
entity.setPayTime(LocalDateTime.now());
|
||||
if (!isIn) {
|
||||
entity.setOrderStatus(OrderStatus.YiWanCheng);
|
||||
this.updateById(entity);
|
||||
return true;
|
||||
} else {
|
||||
this.updateById(entity);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void orderTimeOut() {
|
||||
log.info("检查超时订单");
|
||||
List<OrderInfoEntity> timeOutOrderList = this.list(Wrappers.<OrderInfoEntity>lambdaQuery()
|
||||
.isNotNull(OrderInfoEntity::getShiAuditTime)
|
||||
.le(OrderInfoEntity::getShiAuditTime, LocalDateTime.now().minusHours(12))
|
||||
.isNotNull(OrderInfoEntity::getAuditTime)
|
||||
.le(OrderInfoEntity::getAuditTime, LocalDateTime.now().minusHours(12))
|
||||
.notIn(OrderInfoEntity::getOrderStatus, OrderStatus.YiJinChang, OrderStatus.YiChuChang, OrderStatus.YiWanCheng)
|
||||
);
|
||||
if (CollUtil.isEmpty(timeOutOrderList)) return;
|
||||
|
|
@ -1285,17 +1239,20 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
.setShiAuditUserId(orderInfoEntity.getShiAuditUserId())
|
||||
.setQuAuditPicture(orderInfoEntity.getQuAuditPicture())
|
||||
.setShiAuditPicture(orderInfoEntity.getShiAuditPicture())
|
||||
.setShiAuditTime(orderInfoEntity.getShiAuditTime())
|
||||
.setShiAuditMemo(orderInfoEntity.getShiAuditMemo())
|
||||
.setQuAuditTime(orderInfoEntity.getQuAuditTime())
|
||||
.setQuAuditMemo(orderInfoEntity.getQuAuditMemo())
|
||||
.setCertificateSn(orderInfoEntity.getCertificateSn())
|
||||
.setAuditTime(orderInfoEntity.getAuditTime())
|
||||
.setCheckStatus(CheckStatus.WeiKanLiao)
|
||||
.setAuditMemo(orderInfoEntity.getAuditMemo())
|
||||
// 开始清运
|
||||
.setCargoPhoto(orderInfoEntity.getCargoPhoto())
|
||||
.setOrderStatus(OrderStatus.QingYunZhong)
|
||||
.setTransTime(orderInfoEntity.getTransTime())
|
||||
);
|
||||
if (MoneyWay.IN.getVal().equals(entity.getMoneyWay())) {
|
||||
// 入场付费无称重,不需要更新付费项
|
||||
// 处理公司支付
|
||||
handleCompanyPay(this.getById(targetOrderId), Boolean.TRUE, new BigDecimal("0"), Boolean.FALSE);
|
||||
}
|
||||
} else {
|
||||
baseMapper.busyDriver(orderInfoEntity.getDriverId(), Boolean.FALSE);
|
||||
baseMapper.busyTruck(orderInfoEntity.getTruckId(), Boolean.FALSE);
|
||||
|
|
@ -1317,27 +1274,12 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
log.error("订单状态改变事件发布失败,订单{},状态{}", orderInfoEntity_.getSn(), newOrderStatus, e);
|
||||
return null;
|
||||
});
|
||||
/* CompletableFuture.runAsync(() -> {
|
||||
OrderPagingResult detail = this.detail(orderId);
|
||||
HsoaResult<?> result = hsoaService.pushProvincialSave(detail);
|
||||
|
||||
if (result == null || !result.isSuccess()) {
|
||||
Hsoa.relogin();
|
||||
log.error("推送订单数据失败,数据Id:{}", entity.getId());
|
||||
}
|
||||
}).exceptionally(e -> {
|
||||
log.error("推送订单数据失败,数据Id:{}", entity.getId(), e);
|
||||
return null;
|
||||
}); */
|
||||
|
||||
// 出厂付费
|
||||
if (OrderCategory.PuTong.equals(orderInfoEntity.getOrderCategory()) && MoneyWay.OUT.getVal().equals(entity.getMoneyWay())) {
|
||||
if (MoneyWay.OUT.getVal().equals(entity.getMoneyWay())) {
|
||||
// 计算费用,出厂付费可能需要称重,需要更新付费项
|
||||
// updateOrderItems(orderInfoEntity.getId(), settleWeight, Boolean.FALSE);
|
||||
|
||||
// 扣费
|
||||
return handleCompanyPay(orderInfoEntity, Boolean.FALSE, new BigDecimal("0"), Boolean.FALSE);
|
||||
} else if (OrderCategory.DuanBoRu.equals(orderInfoEntity.getOrderCategory())) {
|
||||
// 扣费
|
||||
return handleCompanyPay(orderInfoEntity, Boolean.FALSE, new BigDecimal("0"), Boolean.FALSE);
|
||||
}
|
||||
|
|
@ -1754,7 +1696,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
ew.like(StrUtil.isNotBlank(searchParam.getLicensePlate()), "d.license_plate", searchParam.getLicensePlate());
|
||||
ew.like(StrUtil.isNotBlank(searchParam.getPhone()), "a.phone", searchParam.getPhone());
|
||||
ew.like(StrUtil.isNotBlank(searchParam.getNickname()), "a.contacts", searchParam.getNickname());
|
||||
ew.like(StrUtil.isNotBlank(transCompanyName), "g.company_name", transCompanyName);
|
||||
ew.like(StrUtil.isNotBlank(transCompanyName), "g.company_name",transCompanyName);
|
||||
ew.like(StrUtil.isNotBlank(driverName), "f.driver_name", driverName);
|
||||
ew.ge(startTime != null, "a.create_time", startTime);
|
||||
ew.le(endTime != null, "a.create_time", endTime);
|
||||
|
|
@ -2178,28 +2120,4 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
throw Exceptions.clierr("装货地址不存在");
|
||||
}
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> pushProvincial(List<String> orderSns) {
|
||||
List<Map<String, Object>> list = new ArrayList<>(orderSns.size());
|
||||
for (String orderSn : orderSns) {
|
||||
try {
|
||||
OrderInfoEntity orderInfo = this.getOne(Wrappers.<OrderInfoEntity>lambdaQuery().eq(OrderInfoEntity::getSn, orderSn));
|
||||
Long orderId = orderInfo.getId();
|
||||
OrderPagingResult detail = this.detail(orderId);
|
||||
HsoaResult<?> hsoaResult = hsoaService.pushProvincialSave(detail);
|
||||
list.add(MapUtil.<String, Object>builder()
|
||||
.put("result", hsoaResult)
|
||||
.put("id", orderId)
|
||||
.put("sn", orderSn)
|
||||
.build());
|
||||
} catch (Exception e) {
|
||||
list.add(MapUtil.<String, Object>builder()
|
||||
.put("result", "失败")
|
||||
.put("sn", orderSn)
|
||||
.build());
|
||||
log.error("单号:{}", orderSn, e);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,8 +27,7 @@
|
|||
u.nickname,
|
||||
bc.company_name as companyName,
|
||||
mb.goods_name as goodsName,
|
||||
mb.car_count,
|
||||
mb.order_category
|
||||
mb.car_count
|
||||
FROM money_bill mb
|
||||
LEFT JOIN sys_user u ON mb.user_id = u.id
|
||||
LEFT JOIN biz_company bc ON mb.station_id = bc.id
|
||||
|
|
@ -60,9 +59,6 @@
|
|||
<if test="entity.goodsName != null and entity.goodsName != ''">
|
||||
AND mb.goods_name LIKE CONCAT('%', #{entity.goodsName}, '%')
|
||||
</if>
|
||||
<if test="entity.orderCategory != null">
|
||||
AND mb.order_category = #{entity.orderCategory}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY mb.modify_time DESC
|
||||
</select>
|
||||
|
|
@ -70,16 +66,12 @@
|
|||
<select id="selectMoneyBillList" resultType="com.njzscloud.supervisory.money.pojo.result.MoneyBillResult">
|
||||
SELECT
|
||||
oi.trans_company_id,
|
||||
oi.order_category,
|
||||
bc.user_id,
|
||||
bc.company_name,
|
||||
su.nickname,
|
||||
oei.expense_item_name,
|
||||
oei.money_strategy,
|
||||
CASE
|
||||
WHEN oei.expense_item_category = 'ChanPin' THEN gi.id
|
||||
ELSE oei.origin_expense_item_id
|
||||
END AS origin_expense_item_id,
|
||||
oei.origin_expense_item_id,
|
||||
oei.order_id,
|
||||
oei.discount_money,
|
||||
oei.settle_money,
|
||||
|
|
@ -87,8 +79,6 @@
|
|||
FROM
|
||||
order_expense_items oei
|
||||
LEFT JOIN order_info oi ON oi.id = oei.order_id
|
||||
LEFT JOIN order_goods og on og.id = oi.goods_id
|
||||
LEFT JOIN goods_info gi on gi.id = og.origin_goods_id
|
||||
LEFT JOIN biz_company bc ON oi.trans_company_id = bc.id
|
||||
LEFT JOIN sys_user su ON bc.user_id = su.id
|
||||
LEFT JOIN order_car_in_out ocio ON ocio.id = oi.car_in_out_id
|
||||
|
|
@ -104,10 +94,7 @@
|
|||
AND oi.trans_company_id = #{entity.transCompanyId}
|
||||
</if>
|
||||
<if test="entity.originExpenseItemId != null">
|
||||
AND (CASE WHEN oei.expense_item_category = 'ChanPin' THEN gi.id ELSE oei.origin_expense_item_id END) = #{entity.originExpenseItemId}
|
||||
</if>
|
||||
<if test="entity.orderCategory != null">
|
||||
AND oi.order_category = #{entity.orderCategory}
|
||||
AND oei.origin_expense_item_id = #{entity.originExpenseItemId}
|
||||
</if>
|
||||
order by oei.create_time desc
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -24,10 +24,8 @@
|
|||
a.audit_status,
|
||||
a.qu_audit_picture,
|
||||
a.shi_audit_picture,
|
||||
a.shi_audit_memo,
|
||||
a.shi_audit_time,
|
||||
a.qu_audit_memo,
|
||||
a.qu_audit_time,
|
||||
a.audit_memo,
|
||||
a.audit_time,
|
||||
a.qu_audit_user_id,
|
||||
a.shi_audit_user_id,
|
||||
n.nickname qu_audit_user_name,
|
||||
|
|
@ -126,28 +124,19 @@
|
|||
g.lat trans_lat,
|
||||
g.contacts trans_contacts,
|
||||
g.phone trans_phone,
|
||||
g.idcard trans_idcard,
|
||||
g.idcard_start_time trans_idcard_start_time,
|
||||
g.idcard_end_time trans_idcard_end_time,
|
||||
g.idcard_front trans_idcard_front,
|
||||
g.idcard_back trans_idcard_back,
|
||||
h.nickname,
|
||||
h.biz_obj,
|
||||
h.phone user_phone,
|
||||
j.company_name,
|
||||
j.uscc,
|
||||
k.nickname checker_name,
|
||||
k.phone checker_phone,
|
||||
l.project_name,
|
||||
m.station_name,
|
||||
m.station_type,
|
||||
m.company_name station_company_name,
|
||||
m.address station_address,
|
||||
m.uscc station_uscc,
|
||||
m.contacts station_contacts,
|
||||
m.phone station_phone,
|
||||
m.lng station_lng,
|
||||
m.lat station_lat,
|
||||
a.contacts,
|
||||
a.check_time,
|
||||
a.assignment_trans_time,
|
||||
|
|
@ -329,7 +318,6 @@
|
|||
bc.user_id AS companyUserId,
|
||||
ma1.id AS companyAccountId,
|
||||
ma1.money AS companyBalance,
|
||||
ma1.revenue,
|
||||
bc.settlement_way,
|
||||
sua.wechat_openid,
|
||||
a.refund_money,
|
||||
|
|
@ -358,13 +346,4 @@
|
|||
where terminal_id = #{gpsId}
|
||||
and deleted = 0
|
||||
</select>
|
||||
<select id="getRoute" resultType="java.lang.String">
|
||||
SELECT b.name route_name
|
||||
FROM order_route a
|
||||
INNER JOIN order_route_detail b ON a.id = b.order_route_id
|
||||
WHERE a.order_id = #{id}
|
||||
AND b.name IS NOT NULL
|
||||
AND TRIM(b.name) != ''
|
||||
ORDER BY b.sort, b.create_time, b.id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue