提交 3e58d0bd authored 作者: liruixin's avatar liruixin

Merge remote-tracking branch 'origin/v4.9_create_goods_child_20230918' into…

Merge remote-tracking branch 'origin/v4.9_create_goods_child_20230918' into v4.9_create_goods_child_20230918
......@@ -27,6 +27,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
</dependency>
<dependency>
......
package com.clx.performance.param.pc;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
/**
* @ClassName PageTruckListParam
* @Description
* @Author kavin
* @Date 2023/9/19 16:04
* @Version 1.0
*/
@Getter
@Setter
public class PageTruckListParam {
@NotNull(message = "需要车数不能为空")
@ApiModelProperty(value = "需要车辆数量", example = "5")
private Integer needTruckNum;
@ApiModelProperty(value = "空重车状态 1 空车 2 运单-空车 3 运单-重车", example = "1")
private Integer truckUserStatus;
@ApiModelProperty(value = "车辆等级", example = "A")
private String truckLevel;
@ApiModelProperty(value = "距离最大值", example = "20")
private Integer maxDistance;
@ApiModelProperty(value = "车牌号", example = "冀F12345")
private String truckNo;
}
package com.clx.performance.vo.pc;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
* @ClassName SeniorLogisticsManagerVO
* @Description
* @Author kavin
* @Date 2023/9/18 19:51
* @Version 1.0
*/
@Getter
@Setter
public class PageTruckListVO {
@ApiModelProperty("车牌号")
private String truckNo;
@ApiModelProperty("状态")
private String userName;
@ApiModelProperty(value = "车辆等级", example = "A")
private String truckLevel;
@ApiModelProperty(value = "距货源地", example = "20")
private Integer maxDistance;
}
......@@ -38,6 +38,12 @@
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.clx.cy</groupId>
<artifactId>user-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.msl</groupId>
<artifactId>user-sdk</artifactId>
......
package com.clx.performance.component;
import com.clx.performance.constant.RedisConstants;
import com.clx.performance.dao.OrderGoodsDao;
import com.msl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -18,25 +19,27 @@ public class OrderGoodsIdGenerate {
private OrderGoodsDao orderGoodsDao;
public int getOrderGoodsId(String type, Integer size) {
int baseStart = Integer.parseInt(DateUtils.formatDate(LocalDate.now(), "yyyyMMdd") + "00001");
Object o = redisTemplate.opsForHash().get("performance:orderGoodsId:", type);
public long getOrderGoodsId(String type, Integer size) {
long baseStart = Long.parseLong(DateUtils.formatDate(LocalDate.now(), "yyyyMMdd").get() + "00001");
Object o = redisTemplate.opsForHash().get(RedisConstants.ORDER_GOODS_ID, type);
if (o == null) {
int maxOrderGoodsId = orderGoodsDao.getMaxOrderGoodsId(type);
Long maxOrderGoodsId = orderGoodsDao.getMaxOrderGoodsId(type);
if (maxOrderGoodsId == null) {
maxOrderGoodsId = 0L;
}
if (baseStart > maxOrderGoodsId) {
redisTemplate.opsForHash().put("performance:orderGoodsId:", type, baseStart + size);
redisTemplate.opsForHash().put(RedisConstants.ORDER_GOODS_ID, type, String.valueOf(baseStart + size));
return baseStart;
} else {
int orderGoodsId = maxOrderGoodsId + 1;
redisTemplate.opsForHash().put("performance:orderGoodsId:", type, orderGoodsId + size);
return orderGoodsId;
long orderGoodsId = maxOrderGoodsId + size;
redisTemplate.opsForHash().put(RedisConstants.ORDER_GOODS_ID, type, String.valueOf(orderGoodsId));
return maxOrderGoodsId + 1;
}
} else {
int redisOrderGoodsId = Integer.parseInt(o.toString());
int orderGoodsId = redisOrderGoodsId + 1;
redisTemplate.opsForHash().put("performance:orderGoodsId:", type, orderGoodsId + size);
return orderGoodsId;
long redisOrderGoodsId = Long.parseLong(o.toString());
long orderGoodsId = redisOrderGoodsId + size;
redisTemplate.opsForHash().put(RedisConstants.ORDER_GOODS_ID, type, String.valueOf(orderGoodsId));
return redisOrderGoodsId;
}
}
}
package com.clx.performance.config;
import com.clx.performance.constant.RabbitKeyConstants;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author xujianke
* @date 2017年9月14日
* @description rabbit配置文件
*/
@Configuration
public class RabbitConfig {
/**
* 订单已挂单队列
*/
@Bean
public Queue orderPostedQueue() {
return new Queue(RabbitKeyConstants.ORDER_POSTED_QUEUE, true);
}
/**
* 订单已挂单交换机
**/
@Bean
public DirectExchange orderPostedExchange() {
return new DirectExchange(RabbitKeyConstants.ORDER_POSTED_EXCHANGE);
}
/**
* 订单已挂单绑定
*/
@Bean
public Binding orderPostedExchangeBind() {
return BindingBuilder.bind(orderPostedQueue()).to(orderPostedExchange()).with(RabbitKeyConstants.ORDER_POSTED_ROUTE_KEY);
}
@Bean
public Queue orderOnQueue() {
Map<String, Object> params = new HashMap<>(6);
params.put("x-dead-letter-exchange", RabbitKeyConstants.ORDER_ON_DEAD_EXCHANGE);
params.put("x-dead-letter-routing-key", RabbitKeyConstants.ORDER_ON_ROUTE_KEY);
return new Queue(RabbitKeyConstants.ORDER_ON_QUEUE, true, false, false, params);
}
/**
* 订单挂单中交换机
**/
@Bean
public DirectExchange orderOnExchange() {
return new DirectExchange(RabbitKeyConstants.ORDER_ON_EXCHANGE);
}
/**
* 订单挂单中绑定
*/
@Bean
public Binding orderOnExchangeBind() {
return BindingBuilder.bind(orderOnQueue()).to(orderOnExchange()).with(RabbitKeyConstants.ORDER_ON_ROUTE_KEY);
}
/**
* 死信队列:死信队列处理延迟消息
* @return
*/
@Bean
public Queue orderOnDeadQueue() {
return new Queue(RabbitKeyConstants.ORDER_ON_DEAD_QUEUE, true, false, false);
}
/**
* 订单挂单中交换机:死信队列处理延迟消息
**/
@Bean
public DirectExchange orderOnDeadExchange() {
return new DirectExchange(RabbitKeyConstants.ORDER_ON_DEAD_EXCHANGE);
}
/**
* 订单挂单中绑定:死信队列处理延迟消息
*/
@Bean
public Binding orderDeadExchangeBind() {
return BindingBuilder.bind(orderOnDeadQueue()).to(orderOnDeadExchange()).with(RabbitKeyConstants.ORDER_ON_ROUTE_KEY);
}
}
package com.clx.performance.constant;
public class RabbitKeyConstants {
public static final String ORDER_POSTED_QUEUE = "order.posted.queue";
public static final String ORDER_POSTED_EXCHANGE = "order.posted.exchange";
public static final String ORDER_POSTED_ROUTE_KEY ="order.posted.route.key";
public static final String ORDER_ON_ROUTE_KEY ="order.on.route.key";
public static final String ORDER_ON_QUEUE ="order.on.queue";
public static final String ORDER_ON_EXCHANGE ="order.on.exchange";
public static final String ORDER_ON_DEAD_EXCHANGE ="order.on.dead.exchange";
public static final String ORDER_ON_DEAD_QUEUE ="order.on.dead.queue";
}
......@@ -4,4 +4,10 @@ public class RedisConstants {
public static final String ORDER_NO_BLOCK = "performance:order_no_block:";
public static final String ORDER_GOODS_ID ="performance:orderGoodsId:";
public static final String ZJXL_TRUCK_TRACE_LIST = "performance:zjxl_truck_trace_list:";
}
......@@ -9,6 +9,7 @@ import com.clx.order.params.PageCarrierOrderListParam;
import com.clx.order.vo.feign.FeignOrderVO;
import com.clx.order.vo.feign.FeignPageOrderVO;
import com.clx.performance.component.OrderGoodsIdGenerate;
import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.constant.RedisConstants;
import com.clx.performance.mapper.OrderGoodsMapper;
import com.clx.performance.model.OrderGoods;
......@@ -17,12 +18,18 @@ import com.msl.common.base.PageData;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result;
import com.msl.common.utils.DateUtils;
import com.msl.user.data.UserSessionData;
import com.msl.user.utils.TokenUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageBuilder;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.validation.annotation.Validated;
......@@ -33,6 +40,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.List;
import java.util.concurrent.TimeUnit;
......@@ -58,7 +66,7 @@ public class GoodsOrderController {
OrderGoodsMapper orderGoodsMapper;
@Autowired
private RedisTemplate<String, Object> redisTemplate;
private RabbitTemplate rabbitTemplate;
@Autowired
private RedissonClient redissonClient;
......@@ -73,6 +81,8 @@ public class GoodsOrderController {
@PostMapping("/saveGoodsOrder")
public Result<Object> saveGoodName(@RequestBody @Validated OrderGoodsParams orderGoodsParams) {
String orderNo = orderGoodsParams.getOrderNo();
LocalDateTime sendLazyTime = null;
//UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
RLock rLock = null;
try {
//1. 加分布式锁通过订单ID
......@@ -92,7 +102,7 @@ public class GoodsOrderController {
throw new RuntimeException("当前货单总吨数已超订单总吨数");
}
LocalDateTime now = LocalDateTime.now();
int beginOrderGoodsId = orderGoodsIdGenerate.getOrderGoodsId("pt", childParamsList.size());
long beginOrderGoodsId = orderGoodsIdGenerate.getOrderGoodsId("pt", childParamsList.size());
for (OrderGoodsChildParams child : childParamsList) {
if (child.getPendingOrderWay().equals(2) && child.getNeedTruckNum() == null) {
throw new RuntimeException("定向派单必须选择车辆");
......@@ -109,7 +119,15 @@ public class GoodsOrderController {
//挂单方式
orderGoods.setPendingOrderWay(child.getPendingOrderWay());
//挂单时间
orderGoods.setPendingOrderTime(DateUtils.parseDateTime(child.getPendingOrderTime()).get());
LocalDateTime postedTime = DateUtils.parseDateTime(child.getPendingOrderTime()).get();
if (sendLazyTime == null) {
sendLazyTime = postedTime;
} else {
if (sendLazyTime.isAfter(postedTime)) {
sendLazyTime = postedTime;
}
}
orderGoods.setPendingOrderTime(postedTime);
orderGoods.setPendingOrderFreight(child.getPendingOrderFreight());
orderGoods.setLastArriveSendTime(DateUtils.parseDateTime(child.getLastArriveSendTime()).get());
......@@ -129,9 +147,12 @@ public class GoodsOrderController {
orderGoods.setSendLatitude(orderInfo.getSendLatitude());
orderGoods.setReceiveLatitude(orderInfo.getReveiveLatitude());
orderGoods.setReceiveLongitude(orderInfo.getReveiveLongitude());
orderGoods.setReceiveAddressId(orderInfo.getReveiveAddressId());
orderGoods.setGoodsName(orderInfo.getGoodsName());
orderGoods.setCreateTime(now);
orderGoods.setModifiedTime(now);
orderGoods.setUserName("loginUserInfo.getUserName()");
orderGoods.setUserNo(123L);
beginOrderGoodsId = beginOrderGoodsId + 1;
orderGoodsMapper.insert(orderGoods);
}
......@@ -146,7 +167,7 @@ public class GoodsOrderController {
throw new RuntimeException("全部自有车辆只能全部提取");
}
LocalDateTime now = LocalDateTime.now();
int beginOrderGoodsId = orderGoodsIdGenerate.getOrderGoodsId("pt", childParamsList.size());
long beginOrderGoodsId = orderGoodsIdGenerate.getOrderGoodsId("pt", childParamsList.size());
for (OrderGoodsChildParams child : childParamsList) {
OrderGoods orderGoods = new OrderGoods();
......@@ -164,7 +185,15 @@ public class GoodsOrderController {
//挂单方式
orderGoods.setPendingOrderWay(child.getPendingOrderWay());
//挂单时间
orderGoods.setPendingOrderTime(DateUtils.parseDateTime(child.getPendingOrderTime()).get());
LocalDateTime postedTime = DateUtils.parseDateTime(child.getPendingOrderTime()).get();
if (sendLazyTime == null) {
sendLazyTime = postedTime;
} else {
if (sendLazyTime.isAfter(postedTime)) {
sendLazyTime = postedTime;
}
}
orderGoods.setPendingOrderTime(postedTime);
orderGoods.setPendingOrderFreight(child.getPendingOrderFreight());
orderGoods.setLastArriveSendTime(DateUtils.parseDateTime(child.getLastArriveSendTime()).get());
......@@ -184,9 +213,12 @@ public class GoodsOrderController {
orderGoods.setSendLatitude(orderInfo.getSendLatitude());
orderGoods.setReceiveLatitude(orderInfo.getReveiveLatitude());
orderGoods.setReceiveLongitude(orderInfo.getReveiveLongitude());
orderGoods.setReceiveAddressId(orderInfo.getReveiveAddressId());
orderGoods.setGoodsName(orderInfo.getGoodsName());
orderGoods.setCreateTime(now);
orderGoods.setModifiedTime(now);
orderGoods.setUserName("loginUserInfo.getUserName()");
orderGoods.setUserNo(123L);
beginOrderGoodsId = beginOrderGoodsId + 1;
orderGoodsMapper.insert(orderGoods);
}
......@@ -203,6 +235,13 @@ public class GoodsOrderController {
log.error("redis 分布式锁释放异常!", e);
}
}
rabbitTemplate.send(RabbitKeyConstants.ORDER_POSTED_EXCHANGE, RabbitKeyConstants.ORDER_POSTED_ROUTE_KEY, MessageBuilder.withBody(orderNo.getBytes()).build());
Message message = MessageBuilder.withBody(orderNo.getBytes()).build();
long epochMilli = sendLazyTime.toInstant(ZoneOffset.of("+8")).toEpochMilli();
message.getMessageProperties().setExpiration(String.valueOf(epochMilli));
rabbitTemplate.send(
RabbitKeyConstants.ORDER_ON_EXCHANGE, RabbitKeyConstants.ORDER_ON_ROUTE_KEY, message
);
return Result.ok();
}
......
package com.clx.performance.controller.pc;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.order.feign.OrderFeign;
import com.clx.order.params.OrderGoodsChildParams;
import com.clx.order.params.OrderGoodsParams;
import com.clx.order.params.PageCarrierOrderListParam;
import com.clx.order.vo.feign.FeignOrderVO;
import com.clx.order.vo.feign.FeignPageOrderVO;
import com.clx.performance.component.OrderGoodsIdGenerate;
import com.clx.performance.constant.RedisConstants;
import com.clx.performance.mapper.OrderGoodsMapper;
import com.clx.performance.model.OrderGoods;
import com.clx.performance.param.pc.PageTruckListParam;
import com.clx.performance.service.OrderGoodsService;
import com.clx.performance.vo.pc.PageTruckListVO;
import com.msl.common.base.PageData;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result;
import com.msl.common.utils.DateUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* @ClassName GoodsOrderController
* @Description
* @Author kavin
* @Date 2023/9/17 17:16
* @Version 1.0
*/
@Slf4j
@RestController
@RequestMapping("/pc/truck")
@Validated
@Api(tags = "PC-车辆")
public class TruckController {
@ApiOperation(value = "获取车辆列表", notes = "<br>By:刘海泉")
@PostMapping("/pageTruckList")
public Result<PageData<PageTruckListVO>> pageTruckList(@RequestBody @Validated PageTruckListParam param) {
IPage<PageTruckListVO> page = null;
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
}
......@@ -11,7 +11,7 @@ import com.clx.performance.model.OrderGoods;
* Time 16:45
*/
public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Integer> {
Integer getMaxOrderGoodsId(String type);
Long getMaxOrderGoodsId(String type);
Optional<OrderGoods> getByOrderGoodsNo(String orderGoodsNo);
......
......@@ -18,7 +18,7 @@ import org.springframework.stereotype.Repository;
public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods, Integer> implements OrderGoodsDao {
@Override
public Integer getMaxOrderGoodsId(String type) {
public Long getMaxOrderGoodsId(String type) {
return baseMapper.getMaxOrderGoodsId(type);
}
......
package com.clx.performance.job;
import com.clx.performance.constant.RedisConstants;
import com.clx.performance.dto.zjxl.TruckTraceDTO;
import com.clx.performance.utils.LocalDateTimeUtils;
import com.clx.performance.utils.zjxl.ZjxlGpsService;
import com.clx.user.feign.UserClxFeign;
import com.msl.common.enums.ResultCodeEnum;
import com.msl.common.job.JobLog;
import com.msl.common.result.Result;
import com.msl.user.feign.UserFeign;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
@Slf4j
@Component
public class TruckTraceJob {
@Resource
UserClxFeign userClxFeign;
@Autowired
ZjxlGpsService zjxlGpsService;
@Autowired
RedisTemplate redisTemplate;
/**
* 驾驶证过期
*/
@XxlJob("truckTrace")
public void truckTrace() {
try {
getPlatformTruckTrace();
} catch (Exception e) {
log.warn("定时任务获取平台车辆定位信息失败,异常原因:{}",e);
JobLog.error("定时任务获取平台车辆定位信息失败,异常原因=====================", e);
}
}
/**
* @Author kavin
* @Description 定时获取平台车辆的定位
* @Param []
* @return
**/
public void getPlatformTruckTrace(){
Result<List<String>> result = userClxFeign.getPlatformTruckList();
log.info("通过clx-user服务获取平台认证成功车辆,返回结果:{}",result);
LocalDateTime now = LocalDateTime.now();
LocalDateTime beginTime = now.plus(-5, ChronoUnit.MINUTES);
if(Objects.equals(result.getCode(), ResultCodeEnum.SUCCESS.getCode())){
List<String> truckNos = result.getData();
for(String truckNo : truckNos){
List<TruckTraceDTO> truckTrace = zjxlGpsService.getTruckTrace(truckNo,
LocalDateTimeUtils.formatTime(beginTime), LocalDateTimeUtils.formatTime(now));
if(CollectionUtils.isNotEmpty(truckTrace)){
//排序获取最新的定位位置
truckTrace.stream().sorted(Comparator.comparing(TruckTraceDTO::getGpsTime));
TruckTraceDTO truckTraceDTO = truckTrace.get(0);
redisTemplate.opsForHash().put(RedisConstants.ZJXL_TRUCK_TRACE_LIST,truckNo,truckTraceDTO);
}
}
}else{
log.info("通过clx-user服务获取平台认证成功车辆,获取失败");
}
}
}
......@@ -13,5 +13,5 @@ import org.apache.ibatis.annotations.SelectProvider;
public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
@SelectProvider(type = OrderGoodsSqlProvider.class, method = "getMaxOrderGoodsId")
Integer getMaxOrderGoodsId(String type);
Long getMaxOrderGoodsId(String type);
}
package com.clx.performance.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn;
import com.msl.common.model.HasKey;
......@@ -23,6 +25,7 @@ import java.time.LocalDateTime;
@TableName(autoResultMap = true)
public class OrderChild implements HasKey<Integer> {
@TableId(value = "id", type = IdType.AUTO)
private Integer id; //id
private Long userNo; //用户编号
private Long ownerUserNo; //货主用户编号
......
package com.clx.performance.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn;
import com.msl.common.model.HasKey;
......@@ -24,6 +26,7 @@ import java.util.Optional;
@TableName(autoResultMap = true)
public class OrderChildImage implements HasKey<Integer> {
@TableId(value = "id", type = IdType.AUTO)
private Integer id; //id
private String childNo; //运单编号
private Integer type; //图片类型
......
package com.clx.performance.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn;
import com.msl.common.model.HasKey;
......@@ -21,6 +23,7 @@ import lombok.ToString;
@TableName(autoResultMap = true)
public class OrderChildLog implements HasKey<Integer> {
@TableId(value = "id", type = IdType.AUTO)
private Integer id; //id
private String childNo; //运单编号
private Integer type; //类型
......
package com.clx.performance.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn;
import com.msl.common.model.HasKey;
......@@ -7,6 +9,8 @@ import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.math.BigDecimal;
/**
* @Author: aiqinguo
* @Description: 磅单审核表
......@@ -20,9 +24,12 @@ import lombok.Setter;
@TableName(autoResultMap = true)
public class OrderChildPoundAudit implements HasKey<Integer> {
@TableId(value = "id", type = IdType.AUTO)
private Integer id; //id
private String childNo; //运单编号
private Integer status; //审核状态
private BigDecimal loadNet; //装货净重(单位吨)
private BigDecimal unloadNet; //卸货净重(单位吨)
private Integer status; //审核状态 0-待审核,1-审核失败, 2-审核成功
private Integer rejectType; //审核驳回类型:1装车 2卸车 3装车+卸车
private String remark; //备注
private String createTime; //创建时间
......
package com.clx.performance.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn;
import com.msl.common.model.HasKey;
......@@ -21,9 +23,10 @@ import lombok.ToString;
@TableName(autoResultMap = true)
public class OrderChildPoundLog implements HasKey<Integer> {
@TableId(value = "id", type = IdType.AUTO)
private Integer id; //id
private String childNo; //运单编号
private Integer status; //审核状态
private Integer status; //审核状态 0-待审核,1-审核失败, 2-审核成功
private String remark; //备注
private Integer createType; //操作人类型1-货主, 2-承运端,3-司机
private Long createBy; //操作人编号
......
......@@ -3,7 +3,7 @@ package com.clx.performance.sqlProvider;
public class OrderGoodsSqlProvider {
public String getMaxOrderGoodsId(String type) {
return "SELECT s.order_goods_no FROM `order_goods` s WHERE s. id = ( SELECT max(id) FROM order_goods where order_goods_type = " + type + ")";
return "SELECT s.order_goods_no FROM `order_goods` s WHERE s. id = ( SELECT max(id) FROM order_goods where order_goods_type = '" + type + "')";
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论