localizer
parent
41337d5db1
commit
f50e9c4c5f
|
|
@ -74,6 +74,7 @@ public class Mqtt implements BeanPostProcessor {
|
|||
String jsonStr = null;
|
||||
try {
|
||||
jsonStr = Jackson.toJsonStr(msg);
|
||||
log.info("mqtt 发布消息:{} {} {}", topic, qos, jsonStr);
|
||||
MqttMessage message = new MqttMessage(jsonStr.getBytes());
|
||||
message.setQos(qos);
|
||||
client.publish(topic, message);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
package com.njzscloud.common.mqtt.util;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.njzscloud.common.mqtt.support.Mqtt;
|
||||
import com.njzscloud.common.mqtt.support.MqttMsg;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public final class MqttUtil {
|
||||
private static final Mqtt mqtt;
|
||||
|
||||
static {
|
||||
mqtt = SpringUtil.getBean(Mqtt.class);
|
||||
}
|
||||
|
||||
public static void subscribe(String topic, int qos, Consumer<MqttMsg> handler) {
|
||||
mqtt.subscribe(topic, qos, handler);
|
||||
}
|
||||
|
||||
public static void subscribe(String topic, Consumer<MqttMsg> handler) {
|
||||
mqtt.subscribe(topic, handler);
|
||||
}
|
||||
|
||||
public static void subscribe(String topic, int qos) {
|
||||
mqtt.subscribe(topic, qos);
|
||||
}
|
||||
|
||||
public static void subscribe(String topic) {
|
||||
mqtt.subscribe(topic);
|
||||
}
|
||||
|
||||
|
||||
public static void publish(String topic, Object msg) {
|
||||
mqtt.publish(topic, msg);
|
||||
}
|
||||
|
||||
public static void publish(String topic, int qos, Object msg) {
|
||||
mqtt.publish(topic, qos, msg);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +1,13 @@
|
|||
package com.njzscloud.supervisory.biz.pojo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.njzscloud.common.mp.support.handler.j.JsonTypeHandler;
|
||||
import com.njzscloud.supervisory.biz.contant.AuditStatus;
|
||||
import com.njzscloud.supervisory.biz.contant.BizObj;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业信息
|
||||
|
|
@ -28,50 +25,39 @@ public class BizCompanyEntity {
|
|||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户 Id; sys_user.id
|
||||
* 归属用户
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 业务对象; 字典代码:biz_obj
|
||||
*/
|
||||
private BizObj bizObj;
|
||||
/**
|
||||
* 是否站点
|
||||
* 是否为站点; 0-->否、1-->是
|
||||
*/
|
||||
private Boolean station;
|
||||
|
||||
/**
|
||||
* 统一社会信用代码; biz_company.uscc
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
private String uscc;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
* 公司名称
|
||||
*/
|
||||
private String companyName;
|
||||
|
||||
/**
|
||||
* 营业执照; 图片
|
||||
* 营业执照
|
||||
*/
|
||||
private String businessLicense;
|
||||
|
||||
/**
|
||||
* 资质证明; 图片
|
||||
*/
|
||||
private String certification;
|
||||
|
||||
/**
|
||||
* 营业执照有效期; [开始日期,结束日期]
|
||||
* 营业执照有效期
|
||||
*/
|
||||
private LocalDate licenseStartTime;
|
||||
private LocalDate licenseEndTime;
|
||||
|
||||
/**
|
||||
* 资质证明有效期; [开始日期,结束日期]
|
||||
* 营业执照有效期
|
||||
*/
|
||||
@TableField(value = "certification_date", typeHandler = JsonTypeHandler.class)
|
||||
private List<String> certificationDate;
|
||||
private LocalDate licenseEndTime;
|
||||
|
||||
/**
|
||||
* 法人名称
|
||||
|
|
@ -79,24 +65,44 @@ public class BizCompanyEntity {
|
|||
private String legalRepresentative;
|
||||
|
||||
/**
|
||||
* 省; 名称
|
||||
* 省; 代码
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市; 名称
|
||||
* 市; 代码
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 区; 名称
|
||||
* 区县; 代码
|
||||
*/
|
||||
private String county;
|
||||
private String area;
|
||||
|
||||
/**
|
||||
* 街道; 名称
|
||||
* 乡镇街道; 代码
|
||||
*/
|
||||
private String street;
|
||||
private String town;
|
||||
|
||||
/**
|
||||
* 省; 名称
|
||||
*/
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 市; 名称
|
||||
*/
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 区县; 名称
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 乡镇街道; 名称
|
||||
*/
|
||||
private String townName;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
|
|
@ -112,6 +118,7 @@ public class BizCompanyEntity {
|
|||
* 纬度
|
||||
*/
|
||||
private Double lat;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
|
|
@ -121,16 +128,15 @@ public class BizCompanyEntity {
|
|||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 审核状态; 字典代码:audit_status
|
||||
* 审核状态
|
||||
*/
|
||||
private AuditStatus auditStatus;
|
||||
|
||||
/**
|
||||
* 审核备注
|
||||
*/
|
||||
private String auditMemo;
|
||||
|
||||
/**
|
||||
* 创建人 Id; sys_user.id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
package com.njzscloud.supervisory.biz.pojo.param;
|
||||
|
||||
import com.njzscloud.supervisory.biz.contant.BizObj;
|
||||
import com.njzscloud.supervisory.biz.contant.AuditStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业信息
|
||||
|
|
@ -19,45 +18,39 @@ import java.util.List;
|
|||
public class AddBizCompanyParam {
|
||||
|
||||
/**
|
||||
* 用户 Id; sys_user.id
|
||||
* 归属用户
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 业务对象; 字典代码:biz_obj
|
||||
* 是否为站点; 0-->否、1-->是
|
||||
*/
|
||||
private BizObj bizObj;
|
||||
private Boolean station;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
private String companyName;
|
||||
|
||||
/**
|
||||
* 统一社会信用代码; biz_company.uscc
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
private String uscc;
|
||||
|
||||
/**
|
||||
* 营业执照; 图片
|
||||
* 公司名称
|
||||
*/
|
||||
private String companyName;
|
||||
|
||||
/**
|
||||
* 营业执照
|
||||
*/
|
||||
private String businessLicense;
|
||||
|
||||
/**
|
||||
* 资质证明; 图片
|
||||
*/
|
||||
private String certification;
|
||||
|
||||
/**
|
||||
* 营业执照有效期; [开始日期,结束日期]
|
||||
* 营业执照有效期
|
||||
*/
|
||||
private LocalDate licenseStartTime;
|
||||
private LocalDate licenseEndTime;
|
||||
|
||||
/**
|
||||
* 资质证明有效期; [开始日期,结束日期]
|
||||
* 营业执照有效期
|
||||
*/
|
||||
private List<String> certificationDate;
|
||||
private LocalDate licenseEndTime;
|
||||
|
||||
/**
|
||||
* 法人名称
|
||||
|
|
@ -65,30 +58,60 @@ public class AddBizCompanyParam {
|
|||
private String legalRepresentative;
|
||||
|
||||
/**
|
||||
* 省; 名称
|
||||
* 省; 代码
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市; 名称
|
||||
* 市; 代码
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 区; 名称
|
||||
* 区县; 代码
|
||||
*/
|
||||
private String county;
|
||||
private String area;
|
||||
|
||||
/**
|
||||
* 街道; 名称
|
||||
* 乡镇街道; 代码
|
||||
*/
|
||||
private String street;
|
||||
private String town;
|
||||
|
||||
/**
|
||||
* 省; 名称
|
||||
*/
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 市; 名称
|
||||
*/
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 区县; 名称
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 乡镇街道; 名称
|
||||
*/
|
||||
private String townName;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private Double lng;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private Double lat;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
|
|
@ -98,4 +121,13 @@ public class AddBizCompanyParam {
|
|||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private AuditStatus auditStatus;
|
||||
/**
|
||||
* 审核备注
|
||||
*/
|
||||
private String auditMemo;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
package com.njzscloud.supervisory.biz.pojo.result;
|
||||
|
||||
import com.njzscloud.supervisory.biz.contant.AuditStatus;
|
||||
import com.njzscloud.supervisory.biz.contant.BizObj;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业信息
|
||||
|
|
@ -18,49 +16,42 @@ import java.util.List;
|
|||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class SearchCompanyResult {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 统一社会信用代码; biz_company.uscc
|
||||
*/
|
||||
private String uscc;
|
||||
|
||||
/**
|
||||
* 用户 Id; sys_user.id
|
||||
* 归属用户
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 业务对象; 字典代码:biz_obj
|
||||
* 是否为站点; 0-->否、1-->是
|
||||
*/
|
||||
private BizObj bizObj;
|
||||
private Boolean station;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
private String uscc;
|
||||
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String companyName;
|
||||
|
||||
/**
|
||||
* 营业执照; 图片
|
||||
* 营业执照
|
||||
*/
|
||||
private String businessLicense;
|
||||
|
||||
/**
|
||||
* 资质证明; 图片
|
||||
*/
|
||||
private String certification;
|
||||
|
||||
/**
|
||||
* 营业执照有效期; [开始日期,结束日期]
|
||||
* 营业执照有效期
|
||||
*/
|
||||
private LocalDate licenseStartTime;
|
||||
private LocalDate licenseEndTime;
|
||||
|
||||
/**
|
||||
* 资质证明有效期; [开始日期,结束日期]
|
||||
* 营业执照有效期
|
||||
*/
|
||||
private List<String> certificationDate;
|
||||
private LocalDate licenseEndTime;
|
||||
|
||||
/**
|
||||
* 法人名称
|
||||
|
|
@ -68,24 +59,44 @@ public class SearchCompanyResult {
|
|||
private String legalRepresentative;
|
||||
|
||||
/**
|
||||
* 省; 名称
|
||||
* 省; 代码
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市; 名称
|
||||
* 市; 代码
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 区; 名称
|
||||
* 区县; 代码
|
||||
*/
|
||||
private String county;
|
||||
private String area;
|
||||
|
||||
/**
|
||||
* 街道; 名称
|
||||
* 乡镇街道; 代码
|
||||
*/
|
||||
private String street;
|
||||
private String town;
|
||||
|
||||
/**
|
||||
* 省; 名称
|
||||
*/
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 市; 名称
|
||||
*/
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 区县; 名称
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 乡镇街道; 名称
|
||||
*/
|
||||
private String townName;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
|
|
@ -111,9 +122,12 @@ public class SearchCompanyResult {
|
|||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 审核状态; 字典代码:audit_status
|
||||
* 审核状态
|
||||
*/
|
||||
private AuditStatus auditStatus;
|
||||
/**
|
||||
* 审核备注
|
||||
*/
|
||||
private String auditMemo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import com.njzscloud.supervisory.biz.pojo.param.AddBizCompanyParam;
|
|||
import com.njzscloud.supervisory.biz.pojo.param.ModifyBizCompanyParam;
|
||||
import com.njzscloud.supervisory.biz.pojo.param.SearchCompanyParam;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import com.njzscloud.supervisory.config.AppProperties;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -31,6 +32,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BizCompanyService extends ServiceImpl<BizCompanyMapper, BizCompanyEntity> implements IService<BizCompanyEntity> {
|
||||
|
||||
private final AppProperties appProperties;
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
|
|
@ -43,8 +46,13 @@ public class BizCompanyService extends ServiceImpl<BizCompanyMapper, BizCompanyE
|
|||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void add(AddBizCompanyParam addBizCompanyParam) {
|
||||
BizCompanyEntity bizCompanyEntity = BeanUtil.copyProperties(addBizCompanyParam, BizCompanyEntity.class);
|
||||
bizCompanyEntity.setAuditStatus(AuditStatus.DaiShenHe);
|
||||
AppProperties.DefaultPlace defaultPlace = appProperties.getDefaultPlace();
|
||||
BizCompanyEntity bizCompanyEntity = BeanUtil.copyProperties(addBizCompanyParam, BizCompanyEntity.class)
|
||||
.setAuditStatus(AuditStatus.DaiShenHe)
|
||||
.setProvince(defaultPlace.getProvince())
|
||||
.setCity(defaultPlace.getCity())
|
||||
.setProvinceName(defaultPlace.getProvinceName())
|
||||
.setCityName(defaultPlace.getCityName());
|
||||
this.save(bizCompanyEntity);
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +140,6 @@ public class BizCompanyService extends ServiceImpl<BizCompanyMapper, BizCompanyE
|
|||
String companyName = searchCompanyParam.getCompanyName();
|
||||
String legalRepresentative = searchCompanyParam.getLegalRepresentative();
|
||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<BizCompanyEntity>lambdaQuery()
|
||||
.eq(bizObj != null, BizCompanyEntity::getBizObj, bizObj)
|
||||
.eq(auditStatus != null, BizCompanyEntity::getAuditStatus, auditStatus)
|
||||
.like(StrUtil.isNotBlank(companyName), BizCompanyEntity::getCompanyName, companyName)
|
||||
.like(StrUtil.isNotBlank(legalRepresentative), BizCompanyEntity::getLegalRepresentative, legalRepresentative)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,19 @@
|
|||
package com.njzscloud.supervisory.device.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.device.pojo.entity.DeviceInfoEntity;
|
||||
import com.njzscloud.supervisory.device.service.DeviceInfoService;
|
||||
import com.njzscloud.supervisory.order.pojo.param.DeviceRecognitionParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设备信息表
|
||||
|
|
@ -78,4 +82,59 @@ public class DeviceInfoController {
|
|||
return R.success(deviceInfoService.paging(pageParam, deviceInfoEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 识别
|
||||
*/
|
||||
@PostMapping("/recognition")
|
||||
public R<?> recognition(@RequestBody JSONObject param) {
|
||||
JSONObject alarmInfoPlate = param.getJSONObject("AlarmInfoPlate");
|
||||
if (alarmInfoPlate == null) {
|
||||
alarmInfoPlate = param.getJSONObject("alarmInfoPlate");
|
||||
}
|
||||
if (alarmInfoPlate == null) {
|
||||
return R.failed();
|
||||
}
|
||||
String serialno = alarmInfoPlate.getString("serialno");
|
||||
JSONObject result = alarmInfoPlate.getJSONObject("result");
|
||||
if (result == null) {
|
||||
result = alarmInfoPlate.getJSONObject("Result");
|
||||
}
|
||||
if (result == null) {
|
||||
return R.failed();
|
||||
}
|
||||
JSONObject plateResult = result.getJSONObject("PlateResult");
|
||||
if (plateResult == null) {
|
||||
plateResult = result.getJSONObject("plateResult");
|
||||
}
|
||||
if (plateResult == null) {
|
||||
return R.failed();
|
||||
}
|
||||
String imageFile = plateResult.getString("imageFile");
|
||||
String license = plateResult.getString("license");
|
||||
|
||||
if (StrUtil.isBlank(serialno) || StrUtil.isBlank(imageFile) || StrUtil.isBlank(license) || license.contains("无")) {
|
||||
return R.failed();
|
||||
}
|
||||
|
||||
deviceInfoService.recognition(new DeviceRecognitionParam().setSn(serialno).setImg(imageFile).setLicensePlate(license));
|
||||
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报1
|
||||
*/
|
||||
@PostMapping("/report1")
|
||||
public Map<String, Object> report1(@RequestBody JSONObject data) {
|
||||
return deviceInfoService.report1(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报2
|
||||
*/
|
||||
@PostMapping("/report2")
|
||||
public Map<String, Object> report2(@RequestBody JSONObject data) {
|
||||
return deviceInfoService.report2(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.njzscloud.supervisory.device.drive.barrier;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public abstract class Barrier {
|
||||
@Getter
|
||||
protected String sn;
|
||||
|
||||
public Barrier(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public abstract void open();
|
||||
|
||||
public abstract void close();
|
||||
|
||||
public abstract void auto();
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.njzscloud.supervisory.device.drive.barrier.generic;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njzscloud.common.mqtt.support.MqttMsg;
|
||||
import com.njzscloud.common.mqtt.util.MqttUtil;
|
||||
import com.njzscloud.supervisory.device.drive.barrier.Barrier;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class GenericBarrier extends Barrier {
|
||||
private static final String SUBSCRIBE_TOPIC = "device/{}/message/up/{}";
|
||||
private static final String PUBLISH_TOPIC = "device/{}/message/down/{}";
|
||||
private static final String REPLY_TOPIC = "device/{}/message/down/{}/reply";
|
||||
private final GenericBarrierConfig config;
|
||||
|
||||
public GenericBarrier(GenericBarrierConfig config) {
|
||||
super(config.getSn());
|
||||
this.config = config;
|
||||
// MqttUtil.subscribe(topic(Fn.gpio_out_reply), this::openReply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open() {
|
||||
IoParam ioParam = IoParam.defaultParam().setSn(getSn());
|
||||
ioParam
|
||||
.getPayload()
|
||||
.getBody()
|
||||
.setIo(config.getIo())
|
||||
.setValue(1);
|
||||
MqttUtil.publish(topic(Fn.gpio_out), ioParam);
|
||||
}
|
||||
|
||||
private void openReply(MqttMsg msg) {
|
||||
IoResult ioResult = msg.getMsg(IoResult.class);
|
||||
log.info("道闸开门结果:{}、{}、{}、{}", config.getName(), config.getSn(), config.getCode().getTxt(), ioResult);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
IoParam ioParam = IoParam.defaultParam().setSn(getSn());
|
||||
ioParam
|
||||
.getPayload()
|
||||
.getBody()
|
||||
.setIo(config.getIo())
|
||||
.setValue(0);
|
||||
MqttUtil.publish(topic(Fn.gpio_out), ioParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void auto() {
|
||||
IoParam ioParam = IoParam.defaultParam().setSn(getSn());
|
||||
ioParam
|
||||
.getPayload()
|
||||
.getBody()
|
||||
.setIo(config.getIo())
|
||||
.setValue(2);
|
||||
MqttUtil.publish(topic(Fn.gpio_out), ioParam);
|
||||
}
|
||||
|
||||
private String topic(Fn fn) {
|
||||
return fn.topic(getSn());
|
||||
}
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public enum Fn {
|
||||
gpio_out(PUBLISH_TOPIC, "gpio_out"),
|
||||
gpio_out_reply(REPLY_TOPIC, "gpio_out"),
|
||||
;
|
||||
|
||||
private final String tpl;
|
||||
private final String name;
|
||||
|
||||
public String topic(String sn) {
|
||||
return StrUtil.format(tpl, sn, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.njzscloud.supervisory.device.drive.barrier.generic;
|
||||
|
||||
import com.njzscloud.supervisory.device.contant.DeviceCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class GenericBarrierConfig {
|
||||
private String name;
|
||||
private String sn;
|
||||
private DeviceCode code;
|
||||
private String ip;
|
||||
private Integer io;
|
||||
private String loadometer;
|
||||
private String vidicon;
|
||||
private String voicebox;
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package com.njzscloud.supervisory.device.drive.barrier.generic;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class IoParam {
|
||||
/**
|
||||
* 消息 ID,用于关联具体消息
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 设备序列号
|
||||
*/
|
||||
private String sn;
|
||||
/**
|
||||
* 消息名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 消息版本,目前都填 1.0
|
||||
*/
|
||||
private String version;
|
||||
/**
|
||||
* 消息时间戳,单位秒
|
||||
*/
|
||||
private Integer timestamp;
|
||||
private Payload payload;
|
||||
|
||||
public static IoParam defaultParam() {
|
||||
return new IoParam()
|
||||
.setId(IdUtil.fastSimpleUUID())
|
||||
.setName("gpio_out")
|
||||
.setVersion("1.0")
|
||||
.setTimestamp((int) (System.currentTimeMillis() / 1000))
|
||||
.setPayload(new Payload()
|
||||
.setType("gpio_out")
|
||||
.setBody(new Body()
|
||||
.setDelay(500)
|
||||
.setIo(0)
|
||||
.setValue(2)
|
||||
)
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public static class Body {
|
||||
/**
|
||||
* 延 时 时 间 ms , 取 值 范 围 为
|
||||
* [500,5000]之间的整数
|
||||
*/
|
||||
private Integer delay;
|
||||
/**
|
||||
* 对应的输出 IO 编号,取值范围为
|
||||
* [0,3]之间的整数
|
||||
*/
|
||||
private Integer io;
|
||||
/**
|
||||
* 输出 IO 的状态值 0 断, 1 通 ,2 先
|
||||
* 通后断,取值范围为[0,2]之间的整数
|
||||
*/
|
||||
private Integer value;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public static class Payload {
|
||||
/**
|
||||
* 消息类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 消息体
|
||||
*/
|
||||
private Body body;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.njzscloud.supervisory.device.drive.barrier.generic;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class IoResult {
|
||||
/**
|
||||
* 消息 ID,用于关联具体消息
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 设备序列号
|
||||
*/
|
||||
private String sn;
|
||||
/**
|
||||
* 消息名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 设备是否处理成功,200 成功,非 200 失败
|
||||
*/
|
||||
private Integer code;
|
||||
/**
|
||||
* 消息版本,目前都填 1.0
|
||||
*/
|
||||
private String version;
|
||||
/**
|
||||
* 消息时间戳,单位秒
|
||||
*/
|
||||
private Integer timestamp;
|
||||
/**
|
||||
* 消息体
|
||||
*/
|
||||
private Object payload;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.njzscloud.supervisory.device.drive.loadometer;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public abstract class Loadometer {
|
||||
@Getter
|
||||
protected String sn;
|
||||
protected String weight;
|
||||
|
||||
public Loadometer(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public abstract int weight();
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.njzscloud.supervisory.device.drive.voicebox;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public abstract class Voicebox {
|
||||
@Getter
|
||||
protected String sn;
|
||||
|
||||
public Voicebox(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public abstract void play(String content);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.njzscloud.supervisory.device.drive.voicebox.generic;
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import com.njzscloud.common.mqtt.util.MqttUtil;
|
||||
import com.njzscloud.supervisory.device.drive.voicebox.Voicebox;
|
||||
|
||||
public class GenericVoicebox extends Voicebox {
|
||||
public GenericVoicebox(String sn) {
|
||||
super(sn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void play(String content) {
|
||||
MqttUtil.publish("zsy/1/voice", MapUtil.builder()
|
||||
.put("deviceNo", getSn())
|
||||
.put("text", content)
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +1,42 @@
|
|||
package com.njzscloud.supervisory.device.service;
|
||||
|
||||
import cn.hutool.core.map.MapBuilder;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.common.mqtt.util.MqttUtil;
|
||||
import com.njzscloud.supervisory.device.contant.DeviceCode;
|
||||
import com.njzscloud.supervisory.device.mapper.DeviceInfoMapper;
|
||||
import com.njzscloud.supervisory.device.pojo.entity.DeviceInfoEntity;
|
||||
import com.njzscloud.supervisory.order.contant.CheckStatus;
|
||||
import com.njzscloud.supervisory.order.contant.OrderStatus;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.param.DeviceRecognitionParam;
|
||||
import com.njzscloud.supervisory.order.pojo.param.TruckComingOrderParam;
|
||||
import com.njzscloud.supervisory.order.pojo.param.TruckLeavingOrderParam;
|
||||
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 org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设备信息表
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoEntity> implements IService<DeviceInfoEntity> {
|
||||
private final OrderInfoService orderInfoService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
|
|
@ -69,4 +87,234 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
|
|||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<DeviceInfoEntity>query(deviceInfoEntity)));
|
||||
}
|
||||
|
||||
public void recognition(DeviceRecognitionParam deviceRecognitionParam) {
|
||||
String sn = deviceRecognitionParam.getSn();
|
||||
DeviceInfoEntity deviceInfoEntity = this.getOne(Wrappers.<DeviceInfoEntity>lambdaQuery().eq(DeviceInfoEntity::getSn, sn));
|
||||
if (deviceInfoEntity == null) {
|
||||
log.error("设备不存在:{}", deviceRecognitionParam);
|
||||
return;
|
||||
}
|
||||
|
||||
DeviceCode deviceCode = deviceInfoEntity.getDeviceCode();
|
||||
|
||||
switch (deviceCode) {
|
||||
// TODO 进前置不启用
|
||||
case JinQianZhi: {
|
||||
OrderPagingResult orderInfoByLicensePlate = orderInfoService.pendingOrder(deviceRecognitionParam.getLicensePlate());
|
||||
if (orderInfoByLicensePlate == null) {
|
||||
// 播语音
|
||||
return;
|
||||
}
|
||||
// 播语音
|
||||
// 开门
|
||||
orderInfoService.updateById(new OrderInfoEntity().setId(orderInfoByLicensePlate.getId()).setOrderStatus(OrderStatus.DaiJinChang));
|
||||
}
|
||||
break;
|
||||
case Jin: {
|
||||
OrderPagingResult orderInfoByLicensePlate = orderInfoService.pendingOrder(deviceRecognitionParam.getLicensePlate());
|
||||
if (orderInfoByLicensePlate == null) {
|
||||
// 播语音
|
||||
return;
|
||||
}
|
||||
// 播语音
|
||||
// 获取磅重
|
||||
// 播语音
|
||||
// 拍照
|
||||
Integer weight = null;
|
||||
String frontPhoto = null;
|
||||
String bodyPhoto = null;
|
||||
orderInfoService.truckComing(new TruckComingOrderParam()
|
||||
.setOrderId(orderInfoByLicensePlate.getId())
|
||||
.setWeight(weight)
|
||||
.setFrontPhoto(frontPhoto)
|
||||
.setBodyPhoto(bodyPhoto)
|
||||
);
|
||||
}
|
||||
break;
|
||||
// TODO 出前置不启用
|
||||
case ChuQianZhi: {
|
||||
OrderPagingResult orderInfoByLicensePlate = orderInfoService.pendingOrder(deviceRecognitionParam.getLicensePlate());
|
||||
if (orderInfoByLicensePlate == null) {
|
||||
// 播语音
|
||||
return;
|
||||
}
|
||||
CheckStatus checkStatus = orderInfoByLicensePlate.getCheckStatus();
|
||||
if (checkStatus == CheckStatus.WeiKanLiao) {
|
||||
// 播语音
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Chu: {
|
||||
OrderPagingResult orderInfoByLicensePlate = orderInfoService.pendingOrder(deviceRecognitionParam.getLicensePlate());
|
||||
if (orderInfoByLicensePlate == null) {
|
||||
// 播语音
|
||||
return;
|
||||
}
|
||||
// 播语音
|
||||
// 获取磅重
|
||||
// 播语音
|
||||
// 拍照
|
||||
Integer weight = null;
|
||||
String frontPhoto = null;
|
||||
String bodyPhoto = null;
|
||||
orderInfoService.truckLeaving(new TruckLeavingOrderParam()
|
||||
.setOrderId(orderInfoByLicensePlate.getId())
|
||||
.setWeight(weight)
|
||||
.setFrontPhoto(frontPhoto)
|
||||
.setBodyPhoto(bodyPhoto)
|
||||
);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Map<String, Object> report1(JSONObject data) {
|
||||
MapBuilder<String, Object> resBuilder = MapUtil.<String, Object>builder()
|
||||
.put("code", 0)
|
||||
.put("msg", "success");
|
||||
MapBuilder<String, Object> dataBuilder = MapUtil.<String, Object>builder()
|
||||
.put("order_no", "")
|
||||
.put("type", 0);
|
||||
String sn = data.getString("carDiscernCode");
|
||||
String licensePlate = data.getString("carNumber");
|
||||
DeviceInfoEntity deviceInfoEntity = this.getOne(Wrappers.<DeviceInfoEntity>lambdaQuery().eq(DeviceInfoEntity::getSn, sn));
|
||||
if (deviceInfoEntity == null) {
|
||||
log.error("设备不存在:{}", data);
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.put("type", 0).build())
|
||||
.build();
|
||||
}
|
||||
OrderPagingResult orderPagingResult = orderInfoService.pendingOrder(licensePlate);
|
||||
if (orderPagingResult == null) {
|
||||
// 播语音
|
||||
playVoice(sn, "{}无订单", licensePlate);
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.put("type", 0).build())
|
||||
.build();
|
||||
}
|
||||
DeviceCode deviceCode = deviceInfoEntity.getDeviceCode();
|
||||
OrderStatus orderStatus = orderPagingResult.getOrderStatus();
|
||||
if (deviceCode == DeviceCode.JinQianZhi && orderStatus == OrderStatus.QingYunZhong) {
|
||||
// 开门
|
||||
open(sn);
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.put("type", 0).build())
|
||||
.build();
|
||||
}
|
||||
|
||||
if (deviceCode == DeviceCode.Jin && orderStatus == OrderStatus.QingYunZhong) {
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.put("type", 1)
|
||||
.put("order_no", orderPagingResult.getId() + "")
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
if (deviceCode == DeviceCode.ChuQianZhi && orderStatus == OrderStatus.YiJinChang) {
|
||||
// 开门
|
||||
open(sn);
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.put("type", 0).build())
|
||||
.build();
|
||||
}
|
||||
|
||||
if (deviceCode == DeviceCode.Chu && orderStatus == OrderStatus.YiJinChang) {
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.put("type", 2)
|
||||
.put("order_no", orderPagingResult.getId() + "")
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.put("type", 0).build())
|
||||
.build();
|
||||
}
|
||||
|
||||
public Map<String, Object> report2(JSONObject data) {
|
||||
MapBuilder<String, Object> resBuilder = MapUtil.<String, Object>builder()
|
||||
.put("code", 0)
|
||||
.put("msg", "success");
|
||||
MapBuilder<String, Object> dataBuilder = MapUtil.<String, Object>builder()
|
||||
.put("car_number", "")
|
||||
.put("order_no", "")
|
||||
.put("lane_code", "");
|
||||
String sn = data.getString("carDiscernCode");
|
||||
String licensePlate = data.getString("carNumber");
|
||||
Long orderId = data.getLong("orderNo");
|
||||
DeviceInfoEntity deviceInfoEntity = this.getOne(Wrappers.<DeviceInfoEntity>lambdaQuery().eq(DeviceInfoEntity::getSn, sn));
|
||||
if (deviceInfoEntity == null) {
|
||||
log.error("设备不存在:{}", data);
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
DeviceCode deviceCode = deviceInfoEntity.getDeviceCode();
|
||||
OrderInfoEntity orderInfo = orderInfoService.getById(orderId);
|
||||
if (orderInfo == null) {
|
||||
// 播语音
|
||||
playVoice(sn, "{}无订单", orderId);
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.build())
|
||||
.build();
|
||||
}
|
||||
Integer weight = data.getInteger("weight");
|
||||
String frontPhoto = data.getString("photoFront");
|
||||
String bodyPhoto = data.getString("photoBody");
|
||||
if (weight == null || weight <= 200) {
|
||||
// 播语音
|
||||
playVoice(sn, "{}磅重异常,请重新称重", licensePlate);
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.build())
|
||||
.build();
|
||||
}
|
||||
if (deviceCode == DeviceCode.Jin) {
|
||||
// 播语音
|
||||
playVoice(sn, "{}称重完成,磅重{}吨", licensePlate, weight / 1000);
|
||||
// 开门
|
||||
open(sn);
|
||||
orderInfoService.truckComing(new TruckComingOrderParam()
|
||||
.setOrderId(orderId)
|
||||
.setWeight(weight)
|
||||
.setFrontPhoto(frontPhoto)
|
||||
.setBodyPhoto(bodyPhoto)
|
||||
);
|
||||
}
|
||||
|
||||
if (deviceCode == DeviceCode.Chu) {
|
||||
// 播语音
|
||||
playVoice(sn, "{}称重完成,磅重{}吨", licensePlate, weight / 1000);
|
||||
// 开门
|
||||
open(sn);
|
||||
orderInfoService.truckLeaving(new TruckLeavingOrderParam()
|
||||
.setOrderId(orderId)
|
||||
.setWeight(weight)
|
||||
.setFrontPhoto(frontPhoto)
|
||||
.setBodyPhoto(bodyPhoto)
|
||||
);
|
||||
}
|
||||
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
private void open(String sn) {
|
||||
MqttUtil.publish("zsy/1/barrier", MapUtil.builder()
|
||||
.put("deviceNo", sn)
|
||||
.build());
|
||||
}
|
||||
|
||||
private void playVoice(String sn, String content, Object... params) {
|
||||
MqttUtil.publish("zsy/1/voice", MapUtil.builder()
|
||||
.put("deviceNo", sn)
|
||||
.put("text", StrUtil.format(content, params))
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
package com.njzscloud.supervisory.gps;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 地理工具类,用于判断经纬度点是否在多边形区域内
|
||||
*/
|
||||
public class GeoUtils {
|
||||
|
||||
/**
|
||||
* 判断点是否在多边形内
|
||||
*
|
||||
* @param point 待判断的点 [纬度, 经度]
|
||||
* @param polygon 多边形顶点列表,每个顶点为 [纬度, 经度]
|
||||
* @return 如果点在多边形内返回true,否则返回false
|
||||
*/
|
||||
public static boolean isPointInPolygon(double[] point, List<double[]> polygon) {
|
||||
// 点的纬度和经度
|
||||
double lat = point[0];
|
||||
double lon = point[1];
|
||||
boolean inside = false;
|
||||
|
||||
// 遍历多边形的每条边
|
||||
for (int i = 0, j = polygon.size() - 1; i < polygon.size(); j = i++) {
|
||||
double[] vertexI = polygon.get(i);
|
||||
double[] vertexJ = polygon.get(j);
|
||||
|
||||
double latI = vertexI[0];
|
||||
double lonI = vertexI[1];
|
||||
double latJ = vertexJ[0];
|
||||
double lonJ = vertexJ[1];
|
||||
|
||||
// 检查点是否在边的端点上
|
||||
if ((lat == latI && lon == lonI) || (lat == latJ && lon == lonJ)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 检查射线是否与当前边相交
|
||||
if (((latI > lat) != (latJ > lat)) &&
|
||||
(lon < (lonJ - lonI) * (lat - latI) / (latJ - latI) + lonI)) {
|
||||
inside = !inside;
|
||||
}
|
||||
}
|
||||
|
||||
return inside;
|
||||
}
|
||||
}
|
||||
|
|
@ -11,7 +11,6 @@ import lombok.RequiredArgsConstructor;
|
|||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum CheckStatus implements DictStr {
|
||||
Wu("Wu", "无"),
|
||||
YiKanLiao("YiKanLiao", "已看料"),
|
||||
WeiKanLiao("WeiKanLiao", "未看料"),
|
||||
;
|
||||
|
|
|
|||
|
|
@ -14,12 +14,14 @@ public enum OrderStatus implements DictStr {
|
|||
YiYuYue("YiYuYue", "已预约"),
|
||||
DaiPaiDan("DaiPaiDan", "待派单"),
|
||||
DaiJieDan("DaiJieDan", "待接单"),
|
||||
YiJieDan("YiJieDan", "已接单"),
|
||||
YiJieDan("YiJieDan", "已接单"),// 接单后要审核
|
||||
QingYunZhong("QingYunZhong", "清运中"),
|
||||
YiJinChang("YiJinChang", "已进场"),
|
||||
DaiJinChang("DaiJinChang", "待进场"),
|
||||
YiJinChang("YiJinChang", "已进场"),// 出场前要看料
|
||||
DaiChuChang("DaiChuChang", "待出场"),
|
||||
YiChuChang("YiChuChang", "已出场"),
|
||||
YiWanCheng("YiWanCheng", "已完成"),
|
||||
YiQuXiao("YiQuXiao", "已取消"),
|
||||
YiWanCheng("YiWanCheng", "已完成"),// 最终态,完成前要支付
|
||||
YiQuXiao("YiQuXiao", "已取消"),// 最终态,取消前要退款
|
||||
;
|
||||
private final String val;
|
||||
private final String txt;
|
||||
|
|
|
|||
|
|
@ -22,15 +22,6 @@ public class OrderCargoPlaceController {
|
|||
|
||||
private final OrderCargoPlaceService orderCargoPlaceService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> add(@RequestBody OrderCargoPlaceEntity orderCargoPlaceEntity) {
|
||||
orderCargoPlaceService.add(orderCargoPlaceEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,15 +22,6 @@ public class OrderGoodsController {
|
|||
|
||||
private final OrderGoodsService orderGoodsService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> add(@RequestBody OrderGoodsEntity orderGoodsEntity) {
|
||||
orderGoodsService.add(orderGoodsEntity);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.njzscloud.supervisory.order.controller;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.njzscloud.common.core.utils.R;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.common.security.support.UserDetail;
|
||||
import com.njzscloud.common.security.util.SecurityUtil;
|
||||
import com.njzscloud.supervisory.order.contant.OrderCategory;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.param.*;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
||||
|
|
@ -24,15 +26,18 @@ import java.util.Set;
|
|||
@RequestMapping("/order_info")
|
||||
@RequiredArgsConstructor
|
||||
public class OrderInfoController {
|
||||
|
||||
private final OrderInfoService orderInfoService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> add(@RequestBody OrderInfoEntity orderInfoEntity) {
|
||||
orderInfoService.add(orderInfoEntity);
|
||||
public R<?> add(@RequestBody AddOrderInfoParam addOrderInfoParam) {
|
||||
OrderCategory orderCategory = addOrderInfoParam.getOrderCategory();
|
||||
Assert.isTrue(orderCategory == OrderCategory.PuTong
|
||||
|| orderCategory == OrderCategory.DuanBoChu
|
||||
, "订单类型必须是普通订单、短驳出");
|
||||
orderInfoService.add(addOrderInfoParam);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
|
|
@ -45,6 +50,15 @@ public class OrderInfoController {
|
|||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单产品
|
||||
*/
|
||||
@PostMapping("/modify_goods")
|
||||
public R<?> modifyGoods(@RequestBody ModifyOrderGoodsParam modifyOrderGoodsParam) {
|
||||
orderInfoService.modifyGoods(modifyOrderGoodsParam);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
|
|
@ -138,4 +152,22 @@ public class OrderInfoController {
|
|||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆进场
|
||||
*/
|
||||
@PostMapping("/truck_coming")
|
||||
public R<?> truckComing(@RequestBody TruckComingOrderParam truckComingOrderParam) {
|
||||
orderInfoService.truckComing(truckComingOrderParam);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆出场
|
||||
*/
|
||||
@PostMapping("/truck_out")
|
||||
public R<?> truckOut(@RequestBody TruckLeavingOrderParam truckLeavingOrderParam) {
|
||||
orderInfoService.truckLeaving(truckLeavingOrderParam);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
package com.njzscloud.supervisory.order.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/device")
|
||||
public class RecognitionController {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -17,4 +17,6 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
|
|||
Page<OrderPagingResult> paging(Page<OrderPagingResult> page, @Param("ew") QueryWrapper<OrderPagingResult> ew);
|
||||
|
||||
OrderPagingResult detail(@Param("ew") QueryWrapper<OrderPagingResult> ew);
|
||||
|
||||
OrderPagingResult pendingOrder(@Param("ew") QueryWrapper<Object> ew);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.njzscloud.supervisory.order.pojo.entity;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njzscloud.supervisory.goods.contant.MoneyStrategy;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
|
@ -54,7 +55,7 @@ public class OrderGoodsEntity {
|
|||
/**
|
||||
* 计费策略; 字典代码:money_strategy
|
||||
*/
|
||||
private String moneyStrategy;
|
||||
private MoneyStrategy moneyStrategy;
|
||||
|
||||
/**
|
||||
* 计费配置 Id
|
||||
|
|
|
|||
|
|
@ -72,7 +72,15 @@ public class OrderInfoEntity {
|
|||
* 审核备注
|
||||
*/
|
||||
private String auditMemo;
|
||||
/**
|
||||
* 目标站点 Id
|
||||
*/
|
||||
private Long targetStationId;
|
||||
|
||||
/**
|
||||
* 短驳入订单 Id
|
||||
*/
|
||||
private Long targetOrderId;
|
||||
/**
|
||||
* 订单类型; 字典代码:order_category
|
||||
*/
|
||||
|
|
@ -165,6 +173,10 @@ public class OrderInfoEntity {
|
|||
@TableField(typeHandler = JsonTypeHandler.class)
|
||||
private List<String> checkPhoto;
|
||||
|
||||
/**
|
||||
* 进出场信息
|
||||
*/
|
||||
private Long carInOutId;
|
||||
/**
|
||||
* 创建人 Id; sys_user.id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
package com.njzscloud.supervisory.order.pojo.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 装货地址
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class AddOrderCargoPlaceParam {
|
||||
/**
|
||||
* 区县; 代码
|
||||
*/
|
||||
@NotBlank(message = "未指定区县")
|
||||
private String area;
|
||||
|
||||
/**
|
||||
* 乡镇街道; 代码
|
||||
*/
|
||||
private String town;
|
||||
|
||||
/**
|
||||
* 区县; 名称
|
||||
*/
|
||||
@NotBlank(message = "未指定区县名称")
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 乡镇街道; 名称
|
||||
*/
|
||||
private String townName;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@NotNull(message = "未指定经度")
|
||||
private Double lng;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@NotNull(message = "未指定纬度")
|
||||
private Double lat;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
package com.njzscloud.supervisory.order.pojo.param;
|
||||
|
||||
import com.njzscloud.common.mvc.validator.Constrained;
|
||||
import com.njzscloud.common.mvc.validator.Constraint;
|
||||
import com.njzscloud.common.mvc.validator.ValidRule;
|
||||
import com.njzscloud.supervisory.order.contant.OrderCategory;
|
||||
import com.njzscloud.supervisory.order.contant.PayerCategory;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 订单信息
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
@Constraint
|
||||
public class AddOrderInfoParam implements Constrained {
|
||||
/**
|
||||
* 装货地址 Id
|
||||
*/
|
||||
@Valid
|
||||
@NotNull(message = "未指定装货地址")
|
||||
private AddOrderCargoPlaceParam cargoPlace;
|
||||
/**
|
||||
* 产品 Id; order_goods.id
|
||||
*/
|
||||
private Long goodsId;
|
||||
/**
|
||||
* 清运公司 Id
|
||||
*/
|
||||
private Long transCompanyId;
|
||||
|
||||
/**
|
||||
* 站点 Id
|
||||
*/
|
||||
private Long stationId;
|
||||
|
||||
/**
|
||||
* 目标站点 Id
|
||||
*/
|
||||
private Long targetStationId;
|
||||
|
||||
/**
|
||||
* 短驳入订单 Id
|
||||
*/
|
||||
private Long targetOrderId;
|
||||
|
||||
/**
|
||||
* 订单类型; 字典代码:order_category
|
||||
*/
|
||||
private OrderCategory orderCategory;
|
||||
|
||||
/**
|
||||
* 付款方资金账户 Id
|
||||
*/
|
||||
private Long payer;
|
||||
|
||||
/**
|
||||
* 支付方类型; 字典代码:payer_category
|
||||
*/
|
||||
private PayerCategory payerCategory;
|
||||
|
||||
/**
|
||||
* 客户备注
|
||||
*/
|
||||
private String customerMemo;
|
||||
|
||||
@Override
|
||||
public ValidRule[] rules() {
|
||||
return new ValidRule[]{
|
||||
ValidRule.of(() -> goodsId != null && goodsId >= 0, "未指定产品"),
|
||||
ValidRule.of(() -> stationId != null && stationId >= 0, "未指定站点"),
|
||||
ValidRule.of(() -> orderCategory != null, "未指定订单类型"),
|
||||
ValidRule.of(() -> orderCategory == OrderCategory.PuTong || orderCategory == OrderCategory.DuanBoChu, "订单类型必须是普通订单、短驳出"),
|
||||
ValidRule.of(() -> {
|
||||
if (orderCategory != OrderCategory.PuTong) {
|
||||
return targetStationId != null && targetStationId >= 0;
|
||||
} else return true;
|
||||
}, "普通订单不能指定目标站点"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.njzscloud.supervisory.order.pojo.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class DeviceRecognitionParam {
|
||||
private String sn;
|
||||
private String img;
|
||||
private String licensePlate;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.njzscloud.supervisory.order.pojo.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 订单产品表
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class ModifyOrderGoodsParam {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 产品类型 Id
|
||||
*/
|
||||
private Long goodsCategoryId;
|
||||
|
||||
/**
|
||||
* 产品 Id
|
||||
*/
|
||||
private Long originGoodsId;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.njzscloud.supervisory.order.pojo.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 订单车辆进出场信息
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class TruckComingOrderParam {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 磅重; 单位:千克
|
||||
*/
|
||||
private Integer weight;
|
||||
|
||||
/**
|
||||
* 进场车头照片
|
||||
*/
|
||||
private String frontPhoto;
|
||||
|
||||
/**
|
||||
* 进场车斗照片
|
||||
*/
|
||||
private String bodyPhoto;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.njzscloud.supervisory.order.pojo.param;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 订单车辆进出场信息
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
public class TruckLeavingOrderParam {
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 磅重; 单位:千克
|
||||
*/
|
||||
private Integer weight;
|
||||
|
||||
/**
|
||||
* 出场车头照片
|
||||
*/
|
||||
private String frontPhoto;
|
||||
|
||||
/**
|
||||
* 出场车斗照片
|
||||
*/
|
||||
private String bodyPhoto;
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.njzscloud.supervisory.order.pojo.result;
|
||||
|
||||
import com.njzscloud.supervisory.biz.contant.AuditStatus;
|
||||
import com.njzscloud.supervisory.goods.contant.MoneyStrategy;
|
||||
import com.njzscloud.supervisory.order.contant.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
|
@ -60,7 +62,7 @@ public class OrderPagingResult {
|
|||
/**
|
||||
* 清运公司 Id
|
||||
*/
|
||||
private Long trafficCompanyId;
|
||||
private Long transCompanyId;
|
||||
|
||||
/**
|
||||
* 下单人 Id; sys_user.id
|
||||
|
|
@ -80,12 +82,12 @@ public class OrderPagingResult {
|
|||
/**
|
||||
* 订单类型; 字典代码:order_category
|
||||
*/
|
||||
private String orderCategory;
|
||||
private OrderCategory orderCategory;
|
||||
|
||||
/**
|
||||
* 订单状态; 字典代码:order_status
|
||||
*/
|
||||
private String orderStatus;
|
||||
private OrderStatus orderStatus;
|
||||
|
||||
/**
|
||||
* 看料员 Id; sys_user.id
|
||||
|
|
@ -95,7 +97,7 @@ public class OrderPagingResult {
|
|||
/**
|
||||
* 看料状态; 字典代码:check_status
|
||||
*/
|
||||
private String checkStatus;
|
||||
private CheckStatus checkStatus;
|
||||
|
||||
/**
|
||||
* 车辆 Id
|
||||
|
|
@ -135,12 +137,12 @@ public class OrderPagingResult {
|
|||
/**
|
||||
* 支付方类型; 字典代码:payer_category
|
||||
*/
|
||||
private String payerCategory;
|
||||
private PayerCategory payerCategory;
|
||||
|
||||
/**
|
||||
* 支付状态; 字典代码:payment_status
|
||||
*/
|
||||
private String paymentStatus;
|
||||
private PaymentStatus paymentStatus;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
|
|
@ -203,7 +205,7 @@ public class OrderPagingResult {
|
|||
/**
|
||||
* 计费策略; 字典代码:money_strategy
|
||||
*/
|
||||
private String moneyStrategy;
|
||||
private MoneyStrategy moneyStrategy;
|
||||
|
||||
/**
|
||||
* 计费配置 Id
|
||||
|
|
|
|||
|
|
@ -5,12 +5,16 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.order.contant.OrderCategory;
|
||||
import com.njzscloud.supervisory.order.mapper.OrderCarInOutMapper;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderCarInOutEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.param.TruckComingOrderParam;
|
||||
import com.njzscloud.supervisory.order.pojo.param.TruckLeavingOrderParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -56,4 +60,53 @@ public class OrderCarInOutService extends ServiceImpl<OrderCarInOutMapper, Order
|
|||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<OrderCarInOutEntity>query(orderCarInOutEntity)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆进场
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public long truckComing(TruckComingOrderParam truckComingOrderParam, OrderCategory orderCategory) {
|
||||
Integer roughWeight = null;
|
||||
Integer tareWeight = null;
|
||||
if (orderCategory == OrderCategory.DuanBoChu) {
|
||||
tareWeight = truckComingOrderParam.getWeight();
|
||||
} else {
|
||||
roughWeight = truckComingOrderParam.getWeight();
|
||||
}
|
||||
OrderCarInOutEntity entity = new OrderCarInOutEntity()
|
||||
.setRoughWeight(roughWeight)
|
||||
.setTareWeight(tareWeight)
|
||||
.setInFrontPhoto(truckComingOrderParam.getFrontPhoto())
|
||||
.setInBodyPhoto(truckComingOrderParam.getBodyPhoto())
|
||||
.setInTime(LocalDateTime.now());
|
||||
this.save(entity);
|
||||
return entity.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆出场
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void truckOut(Long carInOutId, TruckLeavingOrderParam truckLeavingOrderParam, OrderCategory orderCategory) {
|
||||
OrderCarInOutEntity orderCarInOutEntity = this.getById(carInOutId);
|
||||
Integer roughWeight = null;
|
||||
Integer tareWeight = null;
|
||||
Integer settleWeight = null;
|
||||
if (orderCategory == OrderCategory.DuanBoChu) {
|
||||
roughWeight = truckLeavingOrderParam.getWeight();
|
||||
settleWeight = roughWeight - orderCarInOutEntity.getRoughWeight();
|
||||
} else {
|
||||
tareWeight = truckLeavingOrderParam.getWeight();
|
||||
settleWeight = orderCarInOutEntity.getRoughWeight() - tareWeight;
|
||||
}
|
||||
|
||||
this.updateById(new OrderCarInOutEntity()
|
||||
.setId(carInOutId)
|
||||
.setRoughWeight(roughWeight)
|
||||
.setTareWeight(tareWeight)
|
||||
.setOutFrontPhoto(truckLeavingOrderParam.getFrontPhoto())
|
||||
.setOutBodyPhoto(truckLeavingOrderParam.getBodyPhoto())
|
||||
.setSettleWeight(settleWeight)
|
||||
.setOutTime(LocalDateTime.now())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,16 @@
|
|||
package com.njzscloud.supervisory.order.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.config.AppProperties;
|
||||
import com.njzscloud.supervisory.order.mapper.OrderCargoPlaceMapper;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderCargoPlaceEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.param.AddOrderCargoPlaceParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -18,13 +22,25 @@ import java.util.List;
|
|||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class OrderCargoPlaceService extends ServiceImpl<OrderCargoPlaceMapper, OrderCargoPlaceEntity> implements IService<OrderCargoPlaceEntity> {
|
||||
private final AppProperties appProperties;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public void add(OrderCargoPlaceEntity orderCargoPlaceEntity) {
|
||||
this.save(orderCargoPlaceEntity);
|
||||
public long add(AddOrderCargoPlaceParam addOrderCargoPlaceParam) {
|
||||
OrderCargoPlaceEntity orderCargoPlaceEntity = BeanUtil.copyProperties(addOrderCargoPlaceParam, OrderCargoPlaceEntity.class);
|
||||
AppProperties.DefaultPlace defaultPlace = appProperties.getDefaultPlace();
|
||||
this.save(orderCargoPlaceEntity
|
||||
.setProvince(defaultPlace.getProvince())
|
||||
.setCity(defaultPlace.getCity())
|
||||
.setProvinceName(defaultPlace.getProvinceName())
|
||||
.setCityName(defaultPlace.getCityName())
|
||||
);
|
||||
return orderCargoPlaceEntity.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,12 +1,18 @@
|
|||
package com.njzscloud.supervisory.order.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njzscloud.common.core.ex.Exceptions;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.supervisory.goods.pojo.entity.GoodsInfoEntity;
|
||||
import com.njzscloud.supervisory.goods.service.GoodsInfoService;
|
||||
import com.njzscloud.supervisory.order.mapper.OrderGoodsMapper;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderGoodsEntity;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -18,13 +24,22 @@ import java.util.List;
|
|||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class OrderGoodsService extends ServiceImpl<OrderGoodsMapper, OrderGoodsEntity> implements IService<OrderGoodsEntity> {
|
||||
|
||||
private final GoodsInfoService goodsInfoService;
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public void add(OrderGoodsEntity orderGoodsEntity) {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public long add(Long goodsId) {
|
||||
GoodsInfoEntity goodsInfoEntity = goodsInfoService.getById(goodsId);
|
||||
Assert.notNull(goodsInfoEntity, () -> Exceptions.clierr("商品不存在"));
|
||||
goodsInfoEntity.setId(null);
|
||||
OrderGoodsEntity orderGoodsEntity = BeanUtil.copyProperties(goodsInfoEntity, OrderGoodsEntity.class)
|
||||
.setOriginGoodsId(goodsId);
|
||||
this.save(orderGoodsEntity);
|
||||
return orderGoodsEntity.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.njzscloud.supervisory.order.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
|
@ -10,12 +11,15 @@ import com.njzscloud.common.core.ex.Exceptions;
|
|||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import com.njzscloud.common.security.util.SecurityUtil;
|
||||
import com.njzscloud.common.sn.support.SnUtil;
|
||||
import com.njzscloud.supervisory.biz.contant.AuditStatus;
|
||||
import com.njzscloud.supervisory.biz.pojo.entity.BizAuditConfigEntity;
|
||||
import com.njzscloud.supervisory.biz.service.BizAuditConfigService;
|
||||
import com.njzscloud.supervisory.order.contant.CheckStatus;
|
||||
import com.njzscloud.supervisory.order.contant.OrderCategory;
|
||||
import com.njzscloud.supervisory.order.contant.OrderStatus;
|
||||
import com.njzscloud.supervisory.order.mapper.OrderInfoMapper;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderGoodsEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.param.*;
|
||||
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
|
||||
|
|
@ -25,6 +29,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -38,12 +43,62 @@ import java.util.stream.Collectors;
|
|||
public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEntity> implements IService<OrderInfoEntity> {
|
||||
|
||||
private final BizAuditConfigService bizAuditConfigService;
|
||||
private final OrderGoodsService orderGoodsService;
|
||||
private final OrderCargoPlaceService orderCargoPlaceService;
|
||||
private final OrderCarInOutService orderCarInOutService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public void add(OrderInfoEntity orderInfoEntity) {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void add(AddOrderInfoParam addOrderInfoParam) {
|
||||
AddOrderCargoPlaceParam cargoPlace = addOrderInfoParam.getCargoPlace();
|
||||
long cargoPlaceId = orderCargoPlaceService.add(cargoPlace);
|
||||
Long userId = SecurityUtil.currentUserId();
|
||||
String area = cargoPlace.getArea();
|
||||
BizAuditConfigEntity bizAuditConfigEntity = bizAuditConfigService.getOne(Wrappers.lambdaQuery(BizAuditConfigEntity.class).eq(BizAuditConfigEntity::getArea, area));
|
||||
|
||||
AuditStatus auditStatus = null;
|
||||
if (bizAuditConfigEntity != null) {
|
||||
String areaRole = bizAuditConfigEntity.getAreaRole();
|
||||
String cityRole = bizAuditConfigEntity.getCityRole();
|
||||
if (areaRole != null && cityRole != null) {
|
||||
auditStatus = AuditStatus.QuDaiShenHe;
|
||||
} else if (areaRole == null && cityRole != null) {
|
||||
auditStatus = AuditStatus.ShiDaiShenHe;
|
||||
}
|
||||
}
|
||||
|
||||
Long transCompanyId = addOrderInfoParam.getTransCompanyId();
|
||||
OrderStatus orderStatus = transCompanyId == null ? OrderStatus.YiYuYue : OrderStatus.DaiPaiDan;
|
||||
|
||||
Long goodsId = addOrderInfoParam.getGoodsId();
|
||||
|
||||
Long orderGoodsId = orderGoodsService.add(goodsId);
|
||||
|
||||
OrderInfoEntity orderInfoEntity = BeanUtil.copyProperties(addOrderInfoParam, OrderInfoEntity.class)
|
||||
.setSn(SnUtil.next())
|
||||
.setCargoPlaceId(cargoPlaceId)
|
||||
.setUserId(userId)
|
||||
.setAuditStatus(auditStatus)
|
||||
.setOrderStatus(orderStatus)
|
||||
.setGoodsId(orderGoodsId)
|
||||
.setCheckStatus(CheckStatus.WeiKanLiao);
|
||||
this.save(orderInfoEntity);
|
||||
|
||||
Long orderId = orderInfoEntity.getId();
|
||||
OrderCategory orderCategory = addOrderInfoParam.getOrderCategory();
|
||||
if (orderCategory == OrderCategory.DuanBoChu) {
|
||||
this.add(addOrderInfoParam.setOrderCategory(OrderCategory.DuanBoRu)
|
||||
.setTargetOrderId(orderId)
|
||||
.setTargetStationId(addOrderInfoParam.getStationId())
|
||||
.setStationId(addOrderInfoParam.getTargetStationId())
|
||||
);
|
||||
|
||||
} else if (orderCategory == OrderCategory.DuanBoRu) {
|
||||
this.updateById(new OrderInfoEntity().setId(addOrderInfoParam.getTargetOrderId())
|
||||
.setTargetOrderId(orderId));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -239,4 +294,68 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
);
|
||||
// TODO 关闭 GPS
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void modifyGoods(ModifyOrderGoodsParam modifyOrderGoodsParam) {
|
||||
OrderInfoEntity orderInfoEntity = this.getById(modifyOrderGoodsParam.getOrderId());
|
||||
Assert.notNull(orderInfoEntity, () -> Exceptions.clierr("订单不存在"));
|
||||
OrderStatus orderStatus = orderInfoEntity.getOrderStatus();
|
||||
Assert.isTrue(orderStatus != OrderStatus.YiChuChang
|
||||
&& orderStatus != OrderStatus.YiWanCheng
|
||||
&& orderStatus != OrderStatus.YiQuXiao
|
||||
, () -> Exceptions.clierr("当前订单状态,无法修改商品"));
|
||||
orderGoodsService.modify(new OrderGoodsEntity()
|
||||
.setId(orderInfoEntity.getGoodsId())
|
||||
.setGoodsCategoryId(modifyOrderGoodsParam.getGoodsCategoryId())
|
||||
.setOriginGoodsId(modifyOrderGoodsParam.getOriginGoodsId())
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆进场
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void truckComing(TruckComingOrderParam truckComingOrderParam) {
|
||||
OrderInfoEntity orderInfoEntity = this.getById(truckComingOrderParam.getOrderId());
|
||||
Assert.notNull(orderInfoEntity, () -> Exceptions.clierr("订单不存在"));
|
||||
OrderStatus orderStatus = orderInfoEntity.getOrderStatus();
|
||||
Assert.isTrue(orderStatus == OrderStatus.QingYunZhong, () -> Exceptions.clierr("当前订单状态,无法进场"));
|
||||
|
||||
OrderCategory orderCategory = orderInfoEntity.getOrderCategory();
|
||||
long carInOutId = orderCarInOutService.truckComing(truckComingOrderParam, orderCategory);
|
||||
|
||||
this.updateById(new OrderInfoEntity()
|
||||
.setId(orderInfoEntity.getId())
|
||||
.setCarInOutId(carInOutId)
|
||||
.setOrderStatus(OrderStatus.YiJinChang)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆出场
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void truckLeaving(TruckLeavingOrderParam truckLeavingOrderParam) {
|
||||
OrderInfoEntity orderInfoEntity = this.getById(truckLeavingOrderParam.getOrderId());
|
||||
Assert.notNull(orderInfoEntity, () -> Exceptions.clierr("订单不存在"));
|
||||
OrderStatus orderStatus = orderInfoEntity.getOrderStatus();
|
||||
Assert.isTrue(orderStatus == OrderStatus.YiJinChang, () -> Exceptions.clierr("当前订单状态,无法出场"));
|
||||
this.updateById(new OrderInfoEntity()
|
||||
.setId(orderInfoEntity.getId())
|
||||
.setOrderStatus(OrderStatus.YiChuChang)
|
||||
);
|
||||
OrderCategory orderCategory = orderInfoEntity.getOrderCategory();
|
||||
orderCarInOutService.truckOut(orderInfoEntity.getCarInOutId(), truckLeavingOrderParam, orderCategory);
|
||||
|
||||
// TODO 关闭 GPS
|
||||
|
||||
}
|
||||
|
||||
public OrderPagingResult pendingOrder(String licensePlate) {
|
||||
return baseMapper.pendingOrder(Wrappers.query()
|
||||
.eq("e.license_plate", licensePlate)
|
||||
.in("a.order_status", Arrays.asList(OrderStatus.QingYunZhong, OrderStatus.YiJinChang))
|
||||
.orderByDesc("a.trans_time")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
import com.njzscloud.common.security.support.EndpointResource;
|
||||
import com.njzscloud.common.security.support.MenuResource;
|
||||
import com.njzscloud.common.security.support.UserDetail;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -19,4 +20,6 @@ public interface AuthMapper {
|
|||
Set<String> selectRoleByUserId(@Param("userId") Long userId);
|
||||
|
||||
UserDetail selectUser(@Param("ew") QueryWrapper<Object> ew);
|
||||
|
||||
SearchCompanyResult selectCompanyInfo(@Param("userId") Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.njzscloud.supervisory.sys.auth.pojo.result;
|
|||
|
||||
import com.njzscloud.common.security.support.EndpointResource;
|
||||
import com.njzscloud.common.security.support.MenuResource;
|
||||
import com.njzscloud.supervisory.biz.contant.BizObj;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import com.njzscloud.supervisory.sys.user.contant.Gender;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
|
@ -21,6 +23,9 @@ public class MyResult {
|
|||
private List<EndpointResource> endpoints;
|
||||
|
||||
private List<Map<String, Object>> setting;
|
||||
private BizObj bizObj;
|
||||
private SearchCompanyResult company;
|
||||
|
||||
/**
|
||||
* Id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||
import com.njzscloud.common.security.contant.AuthWay;
|
||||
import com.njzscloud.common.security.support.*;
|
||||
import com.njzscloud.common.security.util.SecurityUtil;
|
||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||
import com.njzscloud.supervisory.sys.auth.mapper.AuthMapper;
|
||||
import com.njzscloud.supervisory.sys.auth.pojo.result.MyResult;
|
||||
import com.njzscloud.supervisory.sys.user.pojo.entity.UserEntity;
|
||||
|
|
@ -51,7 +52,6 @@ public class AuthService implements IUserService, IResourceService, IRoleService
|
|||
return authMapper.selectRoleByUserId(userId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前登录人信息
|
||||
*/
|
||||
|
|
@ -60,7 +60,9 @@ public class AuthService implements IUserService, IResourceService, IRoleService
|
|||
UserEntity userEntity = userService.getById(userId);
|
||||
List<MenuResource> menuResources = authMapper.selectUserMenu(userId);
|
||||
List<EndpointResource> endpointResources = authMapper.selectUserEndpoint(userId);
|
||||
return BeanUtil.copyProperties(userEntity, MyResult.class).setMenus(menuResources).setEndpoints(endpointResources);
|
||||
SearchCompanyResult company = authMapper.selectCompanyInfo(userId);
|
||||
|
||||
return BeanUtil.copyProperties(userEntity, MyResult.class).setMenus(menuResources).setEndpoints(endpointResources).setCompany(company);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,20 +152,23 @@ public class UserRegisterParam implements Constrained {
|
|||
private String legalRepresentative;
|
||||
|
||||
/**
|
||||
* 省; 名称
|
||||
* 省; 代码
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市; 名称
|
||||
* 市; 代码
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 区; 名称
|
||||
* 区县; 代码
|
||||
*/
|
||||
private String county;
|
||||
private String area;
|
||||
|
||||
/**
|
||||
* 乡镇街道; 代码
|
||||
*/
|
||||
private String town;
|
||||
|
||||
/**
|
||||
|
|
@ -179,12 +182,12 @@ public class UserRegisterParam implements Constrained {
|
|||
private String cityName;
|
||||
|
||||
/**
|
||||
* 区; 名称
|
||||
* 区县; 名称
|
||||
*/
|
||||
private String countyName;
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 街道; 名称
|
||||
* 乡镇街道; 名称
|
||||
*/
|
||||
private String townName;
|
||||
|
||||
|
|
@ -196,12 +199,12 @@ public class UserRegisterParam implements Constrained {
|
|||
/**
|
||||
* 经度
|
||||
*/
|
||||
private String lng;
|
||||
private Double lng;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private String lat;
|
||||
private Double lat;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
|
|
|
|||
|
|
@ -157,8 +157,7 @@ public class UserService extends ServiceImpl<UserMapper, UserEntity> implements
|
|||
|
||||
AddBizCompanyParam addBizCompanyParam = BeanUtil
|
||||
.copyProperties(company, AddBizCompanyParam.class)
|
||||
.setUserId(userId)
|
||||
.setBizObj(bizObj);
|
||||
.setUserId(userId);
|
||||
bizCompanyService.add(addBizCompanyParam);
|
||||
return SecurityUtil.registrationToken(userRegisterParam.getAccount().getUsername(), AuthWay.PASSWORD);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ spring:
|
|||
- /user/register
|
||||
- /oss/**
|
||||
- /district/tree
|
||||
- /sys_sn_config/add
|
||||
|
||||
app:
|
||||
default-place:
|
||||
|
|
|
|||
|
|
@ -5,128 +5,138 @@
|
|||
|
||||
<sql id="base_select">
|
||||
SELECT a.id,
|
||||
a.sn,
|
||||
a.station_id,
|
||||
a.lane_id,
|
||||
a.project_id,
|
||||
a.traffic_company_id,
|
||||
a.user_id,
|
||||
a.audit_status,
|
||||
a.audit_memo,
|
||||
a.order_category,
|
||||
a.order_status,
|
||||
a.checker_id,
|
||||
a.check_status,
|
||||
a.truck_id,
|
||||
a.driver_id,
|
||||
a.goods_id,
|
||||
a.discount_money,
|
||||
a.revise_money,
|
||||
a.settle_money,
|
||||
a.payer,
|
||||
a.payer_category,
|
||||
a.payment_status,
|
||||
a.payment_time,
|
||||
a.customer_memo,
|
||||
a.checker_memo,
|
||||
a.cargo_photo,
|
||||
a.check_photo,
|
||||
a.creator_id,
|
||||
a.modifier_id,
|
||||
a.create_time,
|
||||
a.modify_time,
|
||||
a.deleted,
|
||||
a.cargo_place_id,
|
||||
a.car_in_out_id,
|
||||
a.sn,
|
||||
a.station_id,
|
||||
a.lane_id,
|
||||
a.project_id,
|
||||
a.trans_company_id,
|
||||
a.user_id,
|
||||
a.audit_status,
|
||||
a.audit_memo,
|
||||
a.order_category,
|
||||
a.order_status,
|
||||
a.checker_id,
|
||||
a.check_status,
|
||||
a.truck_id,
|
||||
a.driver_id,
|
||||
a.goods_id,
|
||||
a.discount_money,
|
||||
a.revise_money,
|
||||
a.settle_money,
|
||||
a.payer,
|
||||
a.payer_category,
|
||||
a.payment_status,
|
||||
a.payment_time,
|
||||
a.customer_memo,
|
||||
a.checker_memo,
|
||||
a.cargo_photo,
|
||||
a.check_photo,
|
||||
a.creator_id,
|
||||
a.modifier_id,
|
||||
a.create_time,
|
||||
a.modify_time,
|
||||
a.deleted,
|
||||
a.cargo_place_id,
|
||||
a.car_in_out_id,
|
||||
|
||||
b.province,
|
||||
b.city,
|
||||
b.area,
|
||||
b.town,
|
||||
b.province_name,
|
||||
b.city_name,
|
||||
b.area_name,
|
||||
b.town_name,
|
||||
b.address,
|
||||
b.lng,
|
||||
b.lat,
|
||||
b.province,
|
||||
b.city,
|
||||
b.area,
|
||||
b.town,
|
||||
b.province_name,
|
||||
b.city_name,
|
||||
b.area_name,
|
||||
b.town_name,
|
||||
b.address,
|
||||
b.lng,
|
||||
b.lat,
|
||||
|
||||
c.goods_category_id,
|
||||
c.origin_goods_id,
|
||||
c.goods_name,
|
||||
c.unit_price,
|
||||
c.unit,
|
||||
c.money_strategy,
|
||||
c.money_config_id,
|
||||
c.picture,
|
||||
c.tax_rate,
|
||||
c.quantity,
|
||||
c.total_money,
|
||||
c.goods_category_id,
|
||||
c.origin_goods_id,
|
||||
c.goods_name,
|
||||
c.unit_price,
|
||||
c.unit,
|
||||
c.money_strategy,
|
||||
c.money_config_id,
|
||||
c.picture,
|
||||
c.tax_rate,
|
||||
c.quantity,
|
||||
c.total_money,
|
||||
|
||||
d.rough_weight,
|
||||
d.tare_weight,
|
||||
d.settle_weight,
|
||||
d.in_front_photo,
|
||||
d.in_body_photo,
|
||||
d.out_front_photo,
|
||||
d.out_body_photo,
|
||||
d.in_time,
|
||||
d.out_time,
|
||||
d.rough_weight,
|
||||
d.tare_weight,
|
||||
d.settle_weight,
|
||||
d.in_front_photo,
|
||||
d.in_body_photo,
|
||||
d.out_front_photo,
|
||||
d.out_body_photo,
|
||||
d.in_time,
|
||||
d.out_time,
|
||||
|
||||
|
||||
e.license_plate,
|
||||
e.truck_license,
|
||||
e.vn_code,
|
||||
e.qualification,
|
||||
e.carrying_capacity,
|
||||
e.tare_weight history_tare_weight,
|
||||
e.audit_status,
|
||||
e.audit_memo,
|
||||
e.license_plate,
|
||||
e.truck_license,
|
||||
e.vn_code,
|
||||
e.qualification,
|
||||
e.carrying_capacity,
|
||||
e.tare_weight history_tare_weight,
|
||||
e.audit_status,
|
||||
e.audit_memo,
|
||||
|
||||
f.driver_name,
|
||||
f.phone driver_phone,
|
||||
f.driving_licence,
|
||||
f.licence_start_time,
|
||||
f.licence_end_time,
|
||||
f.driver_name,
|
||||
f.phone driver_phone,
|
||||
f.driving_licence,
|
||||
f.licence_start_time,
|
||||
f.licence_end_time,
|
||||
|
||||
g.uscc tarffic_company_uscc,
|
||||
g.company_name tarffic_company_company_name,
|
||||
g.business_license tarffic_company_business_license,
|
||||
g.license_start_time tarffic_company_license_start_time,
|
||||
g.license_end_time tarffic_company_license_end_time,
|
||||
g.legal_representative tarffic_company_legal_representative,
|
||||
g.province tarffic_company_province,
|
||||
g.city tarffic_company_city,
|
||||
g.area tarffic_company_area,
|
||||
g.town tarffic_company_town,
|
||||
g.province_name tarffic_company_province_name,
|
||||
g.city_name tarffic_company_city_name,
|
||||
g.area_name tarffic_company_area_name,
|
||||
g.town_name tarffic_company_town_name,
|
||||
g.address tarffic_company_address,
|
||||
g.lng tarffic_company_lng,
|
||||
g.lat tarffic_company_lat,
|
||||
g.contacts tarffic_company_contacts,
|
||||
g.phone tarffic_company_phone,
|
||||
h.nickname,
|
||||
h.phone
|
||||
g.uscc tarffic_company_uscc,
|
||||
g.company_name tarffic_company_company_name,
|
||||
g.business_license tarffic_company_business_license,
|
||||
g.license_start_time tarffic_company_license_start_time,
|
||||
g.license_end_time tarffic_company_license_end_time,
|
||||
g.legal_representative tarffic_company_legal_representative,
|
||||
g.province tarffic_company_province,
|
||||
g.city tarffic_company_city,
|
||||
g.area tarffic_company_area,
|
||||
g.town tarffic_company_town,
|
||||
g.province_name tarffic_company_province_name,
|
||||
g.city_name tarffic_company_city_name,
|
||||
g.area_name tarffic_company_area_name,
|
||||
g.town_name tarffic_company_town_name,
|
||||
g.address tarffic_company_address,
|
||||
g.lng tarffic_company_lng,
|
||||
g.lat tarffic_company_lat,
|
||||
g.contacts tarffic_company_contacts,
|
||||
g.phone tarffic_company_phone,
|
||||
h.nickname,
|
||||
h.phone
|
||||
|
||||
FROM order_info a
|
||||
INNER JOIN order_cargo_place b ON b.id = a.cargo_place_id
|
||||
INNER JOIN order_goods c ON c.id = a.goods_id
|
||||
INNER JOIN order_car_in_out d ON d.id = a.car_in_out_id
|
||||
INNER JOIN biz_truck e ON e.id = a.truck_id
|
||||
INNER JOIN biz_driver f ON f.id = a.driver_id
|
||||
INNER JOIN biz_company g ON g.id = a.traffic_company_id
|
||||
INNER JOIN sys_user h ON h.id = a.user_id
|
||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
${ew.customSqlSegment}
|
||||
</if>
|
||||
INNER JOIN order_cargo_place b ON b.id = a.cargo_place_id
|
||||
INNER JOIN order_goods c ON c.id = a.goods_id
|
||||
INNER JOIN order_car_in_out d ON d.id = a.car_in_out_id
|
||||
INNER JOIN biz_truck e ON e.id = a.truck_id
|
||||
INNER JOIN biz_driver f ON f.id = a.driver_id
|
||||
INNER JOIN biz_company g ON g.id = a.trans_company_id
|
||||
INNER JOIN sys_user h ON h.id = a.user_id
|
||||
</sql>
|
||||
<select id="paging" resultType="com.njzscloud.supervisory.order.pojo.result.OrderPagingResult">
|
||||
<include refid="base_select"/>
|
||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
${ew.customSqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
<select id="detail" resultType="com.njzscloud.supervisory.order.pojo.result.OrderPagingResult">
|
||||
<include refid="base_select"/>
|
||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
${ew.customSqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
<select id="pendingOrder" resultType="com.njzscloud.supervisory.order.pojo.result.OrderPagingResult">
|
||||
<include refid="base_select"/>
|
||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
${ew.customSqlSegment}
|
||||
</if>
|
||||
LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -65,4 +65,32 @@
|
|||
INNER JOIN sys_user_role b ON b.role_id = a.id AND b.user_id = #{userId}
|
||||
WHERE a.deleted = 0
|
||||
</select>
|
||||
<select id="selectCompanyInfo" resultType="com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult">
|
||||
SELECT id,
|
||||
user_id,
|
||||
station,
|
||||
uscc,
|
||||
company_name,
|
||||
business_license,
|
||||
license_start_time,
|
||||
license_end_time,
|
||||
legal_representative,
|
||||
province,
|
||||
city,
|
||||
area,
|
||||
town,
|
||||
province_name,
|
||||
city_name,
|
||||
area_name,
|
||||
town_name,
|
||||
address,
|
||||
lng,
|
||||
lat,
|
||||
contacts,
|
||||
phone,
|
||||
audit_status,
|
||||
audit_memo
|
||||
FROM biz_company
|
||||
WHERE user_id = #{userId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"avatar": "data:image/png;base64,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",
|
||||
"version": "4.9.4",
|
||||
"createdTime": "2023-4-13 11:53:52",
|
||||
"updatedTime": "2025-9-12 22:42:33",
|
||||
"updatedTime": "2025-9-13 11:23:04",
|
||||
"dbConns": [],
|
||||
"profile": {
|
||||
"default": {
|
||||
|
|
@ -10009,16 +10009,16 @@
|
|||
"id": "F60961B2-DB77-48E3-844D-D9E6A744AA81"
|
||||
},
|
||||
{
|
||||
"defKey": "lane_id",
|
||||
"defKey": "lane",
|
||||
"defName": "车道",
|
||||
"comment": "",
|
||||
"type": "VARCHAR",
|
||||
"len": 30,
|
||||
"scale": "",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"defaultValue": "'1车道'",
|
||||
"defaultValue": "",
|
||||
"hideInGraph": false,
|
||||
"refDict": "",
|
||||
"baseType": "AA07828C-4FCB-4EDA-9B51-53A3F264F231",
|
||||
|
|
@ -10144,6 +10144,60 @@
|
|||
"extProps": {},
|
||||
"id": "82373BA9-825C-4EBF-ACAF-F520D59A2467"
|
||||
},
|
||||
{
|
||||
"defKey": "target_station_id",
|
||||
"defName": "对方站点 Id",
|
||||
"comment": "短驳单有值",
|
||||
"type": "BIGINT",
|
||||
"len": "",
|
||||
"scale": "",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"defaultValue": "",
|
||||
"hideInGraph": false,
|
||||
"refDict": "",
|
||||
"extProps": {},
|
||||
"notes": {},
|
||||
"attr1": "",
|
||||
"attr2": "",
|
||||
"attr3": "",
|
||||
"attr4": "",
|
||||
"attr5": "",
|
||||
"attr6": "",
|
||||
"attr7": "",
|
||||
"attr8": "",
|
||||
"attr9": "",
|
||||
"id": "6F7DADE7-8171-4822-B489-D51CB3015659",
|
||||
"baseType": "9B6B9E10-DB11-4409-878B-5868A19CD9B0"
|
||||
},
|
||||
{
|
||||
"defKey": "target_order_id",
|
||||
"defName": "对方订单 Id",
|
||||
"comment": "短驳单有值",
|
||||
"type": "BIGINT",
|
||||
"len": "",
|
||||
"scale": "",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoIncrement": false,
|
||||
"defaultValue": "",
|
||||
"hideInGraph": false,
|
||||
"refDict": "",
|
||||
"extProps": {},
|
||||
"notes": {},
|
||||
"attr1": "",
|
||||
"attr2": "",
|
||||
"attr3": "",
|
||||
"attr4": "",
|
||||
"attr5": "",
|
||||
"attr6": "",
|
||||
"attr7": "",
|
||||
"attr8": "",
|
||||
"attr9": "",
|
||||
"id": "1CF52CA5-1B99-43F1-BD6F-B12A7DFCA610",
|
||||
"baseType": "9B6B9E10-DB11-4409-878B-5868A19CD9B0"
|
||||
},
|
||||
{
|
||||
"defKey": "order_category",
|
||||
"defName": "订单类型",
|
||||
|
|
@ -14186,6 +14240,60 @@
|
|||
"extProps": {},
|
||||
"id": "D76BA1D7-C780-497D-9FB0-0F4F1CDAB126"
|
||||
},
|
||||
{
|
||||
"defKey": "audit_status",
|
||||
"defName": "审核状态",
|
||||
"comment": "字典代码:audit_status",
|
||||
"type": "VARCHAR",
|
||||
"len": 32,
|
||||
"scale": "",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoIncrement": false,
|
||||
"defaultValue": "",
|
||||
"hideInGraph": false,
|
||||
"refDict": "F88D246F-A17A-4711-A6AB-500EF85E91E1",
|
||||
"extProps": {},
|
||||
"notes": {},
|
||||
"attr1": "",
|
||||
"attr2": "",
|
||||
"attr3": "",
|
||||
"attr4": "",
|
||||
"attr5": "",
|
||||
"attr6": "",
|
||||
"attr7": "",
|
||||
"attr8": "",
|
||||
"attr9": "",
|
||||
"id": "F6574AFC-C3BF-4123-AEFF-090EB797E4C2",
|
||||
"baseType": "AA07828C-4FCB-4EDA-9B51-53A3F264F231"
|
||||
},
|
||||
{
|
||||
"defKey": "audit_memo",
|
||||
"defName": "审核备注",
|
||||
"comment": "",
|
||||
"type": "VARCHAR",
|
||||
"len": 512,
|
||||
"scale": "",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoIncrement": false,
|
||||
"defaultValue": "''",
|
||||
"hideInGraph": false,
|
||||
"refDict": "",
|
||||
"extProps": {},
|
||||
"notes": {},
|
||||
"attr1": "",
|
||||
"attr2": "",
|
||||
"attr3": "",
|
||||
"attr4": "",
|
||||
"attr5": "",
|
||||
"attr6": "",
|
||||
"attr7": "",
|
||||
"attr8": "",
|
||||
"attr9": "",
|
||||
"id": "E4F2B183-A5D1-48B2-812A-7B1860852039",
|
||||
"baseType": "AA07828C-4FCB-4EDA-9B51-53A3F264F231"
|
||||
},
|
||||
{
|
||||
"defKey": "creator_id",
|
||||
"defName": "创建人 Id",
|
||||
|
|
|
|||
|
|
@ -4,32 +4,40 @@ Content-Type: application/json
|
|||
|
||||
{
|
||||
"gender": "",
|
||||
"bizObj": "GeRen",
|
||||
"nickname": "13115042121",
|
||||
"account": {
|
||||
"email": "",
|
||||
"phone": "2",
|
||||
"username": "2",
|
||||
"secret": "",
|
||||
"code": "00000",
|
||||
"codeId": "00000"
|
||||
"phone": "13115042213",
|
||||
"username": "873143",
|
||||
"secret": "123456"
|
||||
},
|
||||
"company": {
|
||||
"companyName": "",
|
||||
"businessLicense": "",
|
||||
"certification": "",
|
||||
"businessLicenseDate": [],
|
||||
"certificationDate": [],
|
||||
"legalRepresentative": "",
|
||||
"province": "",
|
||||
"city": "",
|
||||
"county": "",
|
||||
"street": "",
|
||||
"address": "",
|
||||
"contacts": "",
|
||||
"phoneNum": "",
|
||||
"name": "",
|
||||
"intro": "",
|
||||
"sex": "",
|
||||
"radio": "",
|
||||
"businessLicenseDate": [
|
||||
"2025-09-13",
|
||||
"2025-09-16"
|
||||
],
|
||||
"certificationDate": [
|
||||
"2025-09-13",
|
||||
"2025-09-19"
|
||||
],
|
||||
"bizObj": "QingYunGongSi",
|
||||
"companyName": "清运公司1",
|
||||
"uscc": "1",
|
||||
"legalRepresentative": "张三",
|
||||
"lat": 31.95266,
|
||||
"lng": 118.84002,
|
||||
"county": "江宁区",
|
||||
"street": "东山街道",
|
||||
"address": "江宁区上元大街369号",
|
||||
"contacts": "张三",
|
||||
"phone": "13115042213",
|
||||
"scopeList": []
|
||||
}
|
||||
},
|
||||
"bizObj": "QingYunGongSi",
|
||||
"nickname": "873143"
|
||||
}
|
||||
|
||||
### 登录
|
||||
|
|
|
|||
Loading…
Reference in New Issue