提交 86c64ad7 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 # Conflicts: # performance-web/src/main/java/com/clx/performance/dao/OrderChildPoundAuditDao.java # performance-web/src/main/java/com/clx/performance/dao/OrderChildPoundLogDao.java # performance-web/src/main/java/com/clx/performance/dao/impl/OrderChildPoundAuditDaoImpl.java # performance-web/src/main/java/com/clx/performance/dao/impl/OrderChildPoundLogDaoImpl.java # performance-web/src/main/java/com/clx/performance/mapper/OrderChildPoundAuditMapper.java # performance-web/src/main/java/com/clx/performance/mapper/OrderChildPoundLogMapper.java # performance-web/src/main/java/com/clx/performance/model/OrderChildPoundAudit.java # performance-web/src/main/java/com/clx/performance/model/OrderChildPoundLog.java
package com.clx.order.common;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* @author kavin
* Date 2023-09-09
* Time 10:48
*/
@Data
public class OrderInfo{
private Integer id;
@ApiModelProperty(value = "货主用户编号")
private Long ownerUserNo;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "剩余吨数")
private BigDecimal residueWeight;
@ApiModelProperty(value = "拉运类型 0单次拉运 1长期拉运")
private Integer transportType;
@ApiModelProperty(value = "长协合同编号")
private String longTermContractNo;
@ApiModelProperty(value = "货物类型编码")
private String goodsTypeCode;
@ApiModelProperty(value = "货物类型名称")
private String goodsTypeName;
@ApiModelProperty(value = "货物名称")
private String goodsName;
@ApiModelProperty(value = "货物型号")
private String goodsModel;
@ApiModelProperty(value = "拉运重量(吨)")
private BigDecimal transportWeight;
@ApiModelProperty(value = "向下浮动量(吨)")
private BigDecimal downFloatWeight;
@ApiModelProperty(value = "向上浮动量(吨)")
private BigDecimal upFloatWeight;
@ApiModelProperty(value = "是否可超吨 0 否 1 是")
private Integer overWeight;
@ApiModelProperty(value = "损耗单价(元)")
private BigDecimal lossPrice;
@ApiModelProperty(value = "联系人id(货主方)")
private Integer contactId;
@ApiModelProperty(value = "联系人(货主方)")
private String contactOwner;
@ApiModelProperty(value = "联系电话(货主方)")
private String contactPhoneOwner;
@ApiModelProperty(value = "发货-地址id")
private Integer sendAddressId;
@ApiModelProperty(value = "发货-地址简称")
private String sendAddressShorter;
@ApiModelProperty(value = "发货-场地类型id")
private Integer sendSiteTypeId;
@ApiModelProperty(value = "发货-场地类型")
private String sendSiteType;
@ApiModelProperty(value = "发货-是否可超标准 0 否 1 是")
private Integer sendOverStandard;
@ApiModelProperty(value = "发货-预估装车时长(小时)")
private BigDecimal sendEstimatedLoadingTime;
@ApiModelProperty(value = "发货-是否需要系统排队 0 否 1 是")
private Integer sendWaitSystem;
@ApiModelProperty(value = "发货-排队系统名称")
private String sendWaitSystemName;
@ApiModelProperty("发货-预估排队时长")
private BigDecimal sendEstimatedWaitTime;
@ApiModelProperty("发货-煤源生产情况 1 现产现装 2 存煤")
private Integer sendCoalSourceProductSituation;
@ApiModelProperty("发货-现产现装效率(车/小时)")
private BigDecimal sendProductLoadEfficiency;
@ApiModelProperty("发货-司机到达货源地范围(千米)")
private BigDecimal sendDriverArriveRange;
@ApiModelProperty("发货-过磅费(元)")
private BigDecimal sendPoundFee;
@ApiModelProperty("发货-其他过磅费(元)")
private BigDecimal sendOtherPoundFee;
@ApiModelProperty("发货-装卸费(元)")
private BigDecimal sendLoadFee;
@ApiModelProperty("发货-其他装卸费(元)")
private BigDecimal sendOtherLoadFee;
@ApiModelProperty("发货-其他费用 数据样例: [{'fee':500,'remark':'其他费用备注'}]")
private String sendOtherFee;
@ApiModelProperty("发货-货源地开支金额起")
private BigDecimal sendPayFeeBegin;
@ApiModelProperty("发货-货源地开支金额止")
private BigDecimal sendPayFeeEnd;
@ApiModelProperty("收货-地址id")
private Integer reveiveAddressId;
@ApiModelProperty("收货-地址简称")
private String reveiveAddressShorter;
@ApiModelProperty("收货-场地类型id")
private Integer reveiveSiteTypeId;
@ApiModelProperty("收货-场地类型")
private String reveiveSiteType;
@ApiModelProperty("收货-是否可超标准 0 否 1 是")
private Integer reveiveOverStandard;
@ApiModelProperty("收货-预估装车时长(小时)")
private BigDecimal reveiveEstimatedLoadingTime;
@ApiModelProperty("收货-是否需要系统排队 0 否 1 是")
private Integer reveiveWaitSystem;
@ApiModelProperty("收货-排队系统名称")
private String reveiveWaitSystemName;
@ApiModelProperty("收货-司机到达目的地范围(千米)")
private BigDecimal reveiveDriverArriveRange;
@ApiModelProperty("收发地磅差")
private BigDecimal reveivePoundDiff;
@ApiModelProperty("收货-过磅费(元)")
private BigDecimal reveivePoundFee;
@ApiModelProperty("收货-其他过磅费(元)")
private BigDecimal reveiveOtherPoundFee;
@ApiModelProperty("收货-装卸费(元)")
private BigDecimal reveiveLoadFee;
@ApiModelProperty("收货-其他装卸费(元)")
private BigDecimal reveiveOtherLoadFee;
@ApiModelProperty("收货-其他费用 数据样例: [{'fee':500,'remark':'其他费用备注'}]")
private String reveiveOtherFee;
@ApiModelProperty("收货-收货地开支金额起")
private BigDecimal reveivePayFeeBegin;
@ApiModelProperty("收货-收货地开支金额止")
private BigDecimal reveivePayFeeEnd;
@ApiModelProperty("用车需求: 1平台车辆 2部分平台车辆 3自有车辆")
private Integer truckDemand;
@ApiModelProperty("平台承运吨数")
private BigDecimal platformCarryWeight;
@ApiModelProperty("自有车辆(辆)")
private Integer ownerTruckNumber;
@ApiModelProperty("车型要求数组")
private String truckModelList;
@ApiModelProperty("拉运开始时间")
private LocalDateTime transportBeginTime;
@ApiModelProperty("拉运结束时间")
private LocalDateTime transportEndTime;
@ApiModelProperty("可装车时间段开始")
private String loadBeginTime;
@ApiModelProperty("可装车时间段结束")
private String loadEndTime;
@ApiModelProperty("可卸车时间段开始")
private String unloadBeginTime;
@ApiModelProperty("可卸车时间段结束")
private String unloadEndTime;
@ApiModelProperty("意向运费")
private BigDecimal intentionFreightPrice;
@ApiModelProperty("有效运费")
private BigDecimal validFreightPrice;
@ApiModelProperty("订单状态: 0待报价 1客户确认中 2报价已确认 3平台已承接 4已取消 5暂停 6拒绝承运 7 挂单中 8运输中 9订单已完成 10 已失效")
private Integer orderStatus;
@ApiModelProperty("报价状态:2确认报价 3驳回报价")
private Integer quotationStatus;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
@ApiModelProperty("修改时间")
private LocalDateTime modifiedTime;
}
package com.clx.order.params;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Getter
@Setter
public class OrderGoodsChildParams {
@ApiModelProperty("挂单运费")
private BigDecimal pendingOrderFreight;
@ApiModelProperty("提取方式 1提取全部 2提取部分")
private Integer extractWay;
@ApiModelProperty("提取吨数")
private BigDecimal extractWeight;
@ApiModelProperty("需要车辆/辆")
private Integer needTruckNum;
@ApiModelProperty("挂单方式 1公开派单 2定向派单")
private Integer pendingOrderWay;
@ApiModelProperty(value = "最晚到达货源地时间/运单的最晚装货时间", example = "2023-09-09 12:00:01", required = true)
private String lastArriveSendTime;
@ApiModelProperty(value = "挂单时间", example = "2023-09-09 12:00:01", required = true)
private String pendingOrderTime;
@ApiModelProperty("高级物流经理id")
private Integer seniorLogisticsManagerId;
@ApiModelProperty("高级物流经理姓名")
private String seniorLogisticsManagerName;
@ApiModelProperty(value = "定向运单失效时间", example = "2023-09-09 12:00:01", required = true)
private String directionalExpireTime;
@ApiModelProperty("创建人用户编号")
private Long userNo;
@ApiModelProperty("创建人姓名")
private String userName;
}
package com.clx.order.params;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.List;
@Data
public class OrderGoodsParams {
@ApiModelProperty("订单编号")
@NotBlank(message = "订单编号不能为空")
private String orderNo;
private List<OrderGoodsChildParams> orderGoodsChildParams;
}
package com.clx.order.params;
import com.msl.common.base.PageParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class PageCarrierOrderListParam extends PageParam {
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "联系人(货主)id")
private Integer contactId;
@ApiModelProperty(value="订单状态:2报价已确认 3平台已承接 7 挂单中 8运输中")
private Integer orderStatus;
@ApiModelProperty(value = "开始时间",example = "2023-09-09 12:00:01" ,required = true)
private String beginTime;
@ApiModelProperty(value = "结束",example = "2023-09-09 12:00:01" ,required = true)
private String endTime;
@ApiModelProperty(value="时间类型: 1创建时间 2拉运开始时间 3拉运结束时间 ")
@NotNull(message = "时间类型不能为空")
private Integer timeType;
@ApiModelProperty(value="用车类型: 1平台车辆 2部分平台车辆 3自有车辆")
private Integer truckDemand;
}
...@@ -32,6 +32,12 @@ ...@@ -32,6 +32,12 @@
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.clx.cy</groupId>
<artifactId>order-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>com.msl</groupId> <groupId>com.msl</groupId>
<artifactId>user-sdk</artifactId> <artifactId>user-sdk</artifactId>
...@@ -194,6 +200,11 @@ ...@@ -194,6 +200,11 @@
<version>1.0</version> <version>1.0</version>
</dependency> </dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>3.13.6</version>
</dependency>
</dependencies> </dependencies>
......
...@@ -16,12 +16,12 @@ import org.springframework.scheduling.annotation.EnableAsync; ...@@ -16,12 +16,12 @@ import org.springframework.scheduling.annotation.EnableAsync;
// @ComponentScan("com.msl.common.utils.*"), // @ComponentScan("com.msl.common.utils.*"),
//}) //})
@ComponentScan({"com.clx.performance.*", "com.msl.*"}) @ComponentScan({"com.clx.performance.*", "com.msl.*"})
@EnableFeignClients(basePackages = {"com.msl.*", "com.clx.performance.*"}) @EnableFeignClients(basePackages = {"com.msl.*", "com.clx.performance.*", "com.clx.order.*"})
@ViewScan(basePackage = "com.clx.user.view") @ViewScan(basePackage = "com.clx.user.view")
public class OrderApplication { public class PerformanceApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(OrderApplication.class, args); SpringApplication.run(PerformanceApplication.class, args);
} }
} }
package com.clx.performance.component;
import com.clx.performance.dao.OrderGoodsDao;
import com.msl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
@Component
public class OrderGoodsIdGenerate {
@Autowired
private RedisTemplate<String, String> redisTemplate;
@Autowired
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);
if (o == null) {
int maxOrderGoodsId = orderGoodsDao.getMaxOrderGoodsId(type);
if (baseStart > maxOrderGoodsId) {
redisTemplate.opsForHash().put("performance:orderGoodsId:", type, baseStart + size);
return baseStart;
} else {
int orderGoodsId = maxOrderGoodsId + 1;
redisTemplate.opsForHash().put("performance:orderGoodsId:", type, orderGoodsId + size);
return orderGoodsId;
}
} else {
int redisOrderGoodsId = Integer.parseInt(o.toString());
int orderGoodsId = redisOrderGoodsId + 1;
redisTemplate.opsForHash().put("performance:orderGoodsId:", type, orderGoodsId + size);
return orderGoodsId;
}
}
}
...@@ -12,7 +12,7 @@ import org.springframework.context.annotation.Configuration; ...@@ -12,7 +12,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.Profile;
@Configuration @Configuration
@MapperScan("com.clx.order.mapper") @MapperScan("com.clx.performance.mapper")
public class MybatisPlusConfig { public class MybatisPlusConfig {
/** /**
......
package com.clx.performance.constant;
public class RedisConstants {
public static final String ORDER_NO_BLOCK = "performance:order_no_block:";
}
package com.clx.performance.controller.pc; package com.clx.performance.controller.pc;
import cn.hutool.json.JSONUtil;
import com.clx.order.feign.OrderFeign;
import com.clx.order.param.feign.FeignPageCarrierOrderListParam;
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.service.OrderGoodsService; import com.clx.performance.service.OrderGoodsService;
import com.msl.common.base.PageData;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result; import com.msl.common.result.Result;
import com.msl.common.utils.DateUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; 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 * @ClassName GoodsOrderController
* @Description * @Description
...@@ -30,11 +54,164 @@ public class GoodsOrderController { ...@@ -30,11 +54,164 @@ public class GoodsOrderController {
@Autowired @Autowired
OrderGoodsService orderGoodsService; OrderGoodsService orderGoodsService;
@ApiOperation(value = "提交货单",notes = "<br>By:刘海泉") @Autowired
OrderGoodsMapper orderGoodsMapper;
@Autowired
private RedisTemplate<String, Object> redisTemplate;
@Autowired
private RedissonClient redissonClient;
@Autowired
private OrderFeign orderFeign;
@Autowired
private OrderGoodsIdGenerate orderGoodsIdGenerate;
@ApiOperation(value = "提交货单", notes = "<br>By:刘海泉")
@PostMapping("/saveGoodsOrder") @PostMapping("/saveGoodsOrder")
public Result saveGoodName(@RequestBody @Validated String msg) { public Result<Object> saveGoodName(@RequestBody @Validated OrderGoodsParams orderGoodsParams) {
String orderNo = orderGoodsParams.getOrderNo();
RLock rLock = null;
try {
//1. 加分布式锁通过订单ID
//获取锁
rLock = redissonClient.getLock(RedisConstants.ORDER_NO_BLOCK + orderNo);
//设置超时
rLock.lock(1, TimeUnit.MINUTES);
//2. 通过OrderNo 查询订单信息
FeignOrderVO orderInfo = orderFeign.getOrderInfoFeign(orderNo);
//1平台车辆 2部分平台车辆 3自有车辆
Integer truckDemand = orderInfo.getTruckDemand();
if (truckDemand != 3) {
List<OrderGoodsChildParams> childParamsList = orderGoodsParams.getOrderGoodsChildParams();
BigDecimal childSum = childParamsList.stream().map(OrderGoodsChildParams::getExtractWeight).reduce(
BigDecimal.ZERO, BigDecimal::add);
if (orderInfo.getResidueWeight().compareTo(childSum) < 0) {
throw new RuntimeException("当前货单总吨数已超订单总吨数");
}
LocalDateTime now = LocalDateTime.now();
int beginOrderGoodsId = orderGoodsIdGenerate.getOrderGoodsId("pt", childParamsList.size());
for (OrderGoodsChildParams child : childParamsList) {
if (child.getPendingOrderWay().equals(2) && child.getNeedTruckNum() == null) {
throw new RuntimeException("定向派单必须选择车辆");
}
OrderGoods orderGoods = new OrderGoods();
//提取吨数
orderGoods.setExtractWeight(child.getExtractWeight());
orderGoods.setExtractWeight(child.getExtractWeight());
//提取方式 1提取全部 2提取部分
Integer extractWay = child.getExtractWay();
orderGoods.setExtractWay(extractWay);
//需要车辆
orderGoods.setNeedTruckNum(child.getNeedTruckNum());
//挂单方式
orderGoods.setPendingOrderWay(child.getPendingOrderWay());
//挂单时间
orderGoods.setPendingOrderTime(DateUtils.parseDateTime(child.getPendingOrderTime()).get());
orderGoods.setPendingOrderFreight(child.getPendingOrderFreight());
orderGoods.setLastArriveSendTime(DateUtils.parseDateTime(child.getLastArriveSendTime()).get());
//定向运单失效时间
orderGoods.setDirectionalExpireTime(DateUtils.parseDateTime(child.getDirectionalExpireTime()).get());
orderGoods.setSeniorLogisticsManagerId(child.getSeniorLogisticsManagerId());
orderGoods.setSeniorLogisticsManagerName(child.getSeniorLogisticsManagerName());
orderGoods.setOrderNo(orderNo);
orderGoods.setOrderGoodsType("PT");
orderGoods.setOrderGoodsNo("PT" + beginOrderGoodsId);
orderGoods.setOrderGoodsStatus(10);
orderGoods.setSendAddressId(orderInfo.getSendAddressId());
orderGoods.setSendAddressShorter(orderInfo.getSendAddressShorter());
//收发货经纬度
orderGoods.setSendLongitude(orderInfo.getSendLongitude());
orderGoods.setSendLatitude(orderInfo.getSendLatitude());
orderGoods.setReceiveLatitude(orderInfo.getReveiveLatitude());
orderGoods.setReceiveLongitude(orderInfo.getReveiveLongitude());
orderGoods.setGoodsName(orderInfo.getGoodsName());
orderGoods.setCreateTime(now);
orderGoods.setModifiedTime(now);
beginOrderGoodsId = beginOrderGoodsId + 1;
orderGoodsMapper.insert(orderGoods);
}
} else {
List<OrderGoodsChildParams> childParamsList = orderGoodsParams.getOrderGoodsChildParams();
BigDecimal childSum = childParamsList.stream().map(OrderGoodsChildParams::getExtractWeight).reduce(
BigDecimal.ZERO, BigDecimal::add);
if (orderInfo.getResidueWeight().compareTo(childSum) < 0) {
throw new RuntimeException("当前货单总吨数已超订单总吨数");
}
if (childParamsList.size() > 1) {
throw new RuntimeException("全部自有车辆只能全部提取");
}
LocalDateTime now = LocalDateTime.now();
int beginOrderGoodsId = orderGoodsIdGenerate.getOrderGoodsId("pt", childParamsList.size());
for (OrderGoodsChildParams child : childParamsList) {
OrderGoods orderGoods = new OrderGoods();
//提取吨数
orderGoods.setExtractWeight(child.getExtractWeight());
orderGoods.setExtractWeight(child.getExtractWeight());
//提取方式 1提取全部 2提取部分
Integer extractWay = child.getExtractWay();
if (extractWay.equals(2)) {
throw new RuntimeException("全部自有车辆只能全部提取");
}
orderGoods.setExtractWay(extractWay);
//需要车辆
orderGoods.setNeedTruckNum(child.getNeedTruckNum());
//挂单方式
orderGoods.setPendingOrderWay(child.getPendingOrderWay());
//挂单时间
orderGoods.setPendingOrderTime(DateUtils.parseDateTime(child.getPendingOrderTime()).get());
orderGoods.setPendingOrderFreight(child.getPendingOrderFreight());
orderGoods.setLastArriveSendTime(DateUtils.parseDateTime(child.getLastArriveSendTime()).get());
//定向运单失效时间
orderGoods.setDirectionalExpireTime(DateUtils.parseDateTime(child.getDirectionalExpireTime()).get());
orderGoods.setSeniorLogisticsManagerId(child.getSeniorLogisticsManagerId());
orderGoods.setSeniorLogisticsManagerName(child.getSeniorLogisticsManagerName());
orderGoods.setOrderNo(orderNo);
orderGoods.setOrderGoodsType("PT");
orderGoods.setOrderGoodsNo("PT" + beginOrderGoodsId);
orderGoods.setOrderGoodsStatus(10);
orderGoods.setSendAddressId(orderInfo.getSendAddressId());
orderGoods.setSendAddressShorter(orderInfo.getSendAddressShorter());
//收发货经纬度
orderGoods.setSendLongitude(orderInfo.getSendLongitude());
orderGoods.setSendLatitude(orderInfo.getSendLatitude());
orderGoods.setReceiveLatitude(orderInfo.getReveiveLatitude());
orderGoods.setReceiveLongitude(orderInfo.getReveiveLongitude());
orderGoods.setGoodsName(orderInfo.getGoodsName());
orderGoods.setCreateTime(now);
orderGoods.setModifiedTime(now);
beginOrderGoodsId = beginOrderGoodsId + 1;
orderGoodsMapper.insert(orderGoods);
}
}
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
try {
if (rLock != null && rLock.isLocked()) {
rLock.unlock();
}
log.info("锁释放完成");
} catch (Exception e) {
log.error("redis 分布式锁释放异常!", e);
}
}
return Result.ok(); return Result.ok();
} }
@PostMapping("/pageCarrierOrderList")
@UnitCovert(param = false)
public Result<PageData<FeignPageOrderVO>> pageCarrierOrderList(@RequestBody @Validated PageCarrierOrderListParam param) {
Result<PageData<FeignPageOrderVO>> dataResult = orderFeign.pageCarrierOrderList(JSONUtil.parse(param).toString());
return dataResult;
}
} }
package com.clx.performance.dao; package com.clx.performance.dao;
import com.clx.performance.mapper.OrderChildPoundAuditMapper; import com.clx.performance.mapper.OrderChildPoundAuditMapper;
import com.clx.performance.model.OrderChildPoundAudit; import com.clx.performance.model.OrderChildPoundAudit;
import com.msl.common.dao.BaseDao; import com.msl.common.dao.BaseDao;
/** /**
* @author liruixin * @Author: aiqinguo
* Date 2023-09-19 * @Description: 磅单审核表
* Time 13:25 * @Date: 2023/09/18 11:34:50
* @Version: 1.0
*/ */
public interface OrderChildPoundAuditDao extends BaseDao<OrderChildPoundAuditMapper, OrderChildPoundAudit, Integer> { public interface OrderChildPoundAuditDao extends BaseDao<OrderChildPoundAuditMapper, OrderChildPoundAudit, Integer> {
} }
...@@ -5,9 +5,12 @@ import com.clx.performance.model.OrderChildPoundLog; ...@@ -5,9 +5,12 @@ import com.clx.performance.model.OrderChildPoundLog;
import com.msl.common.dao.BaseDao; import com.msl.common.dao.BaseDao;
/** /**
* @author liruixin * @Author: aiqinguo
* Date 2023-09-19 * @Description: 磅单日志表
* Time 13:25 * @Date: 2023/09/18 11:34:50
* @Version: 1.0
*/ */
public interface OrderChildPoundLogDao extends BaseDao<OrderChildPoundLogMapper, OrderChildPoundLog, Integer> { public interface OrderChildPoundLogDao extends BaseDao<OrderChildPoundLogMapper, OrderChildPoundLog, Integer> {
} }
...@@ -11,6 +11,7 @@ import com.clx.performance.model.OrderGoods; ...@@ -11,6 +11,7 @@ import com.clx.performance.model.OrderGoods;
* Time 16:45 * Time 16:45
*/ */
public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Integer> { public interface OrderGoodsDao extends BaseDao<OrderGoodsMapper, OrderGoods, Integer> {
Integer getMaxOrderGoodsId(String type);
Optional<OrderGoods> getByOrderGoodsNo(String orderGoodsNo); Optional<OrderGoods> getByOrderGoodsNo(String orderGoodsNo);
......
package com.clx.performance.dao.impl; package com.clx.performance.dao.impl;
import com.clx.performance.dao.OrderChildPoundAuditDao; import com.clx.performance.dao.OrderChildPoundAuditDao;
import com.clx.performance.mapper.OrderChildPoundAuditMapper; import com.clx.performance.mapper.OrderChildPoundAuditMapper;
import com.clx.performance.model.OrderChildPoundAudit; import com.clx.performance.model.OrderChildPoundAudit;
...@@ -8,10 +7,12 @@ import com.msl.common.dao.impl.BaseDaoImpl; ...@@ -8,10 +7,12 @@ import com.msl.common.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
/** /**
* @author liruixin * @Author: aiqinguo
* Date 2023-09-19 * @Description: 磅单审核表
* Time 13:25 * @Date: 2023/09/18 11:34:50
* @Version: 1.0
*/ */
@Repository @Repository
public class OrderChildPoundAuditDaoImpl extends BaseDaoImpl<OrderChildPoundAuditMapper, OrderChildPoundAudit, Integer> implements OrderChildPoundAuditDao { public class OrderChildPoundAuditDaoImpl extends BaseDaoImpl<OrderChildPoundAuditMapper, OrderChildPoundAudit, Integer> implements OrderChildPoundAuditDao {
} }
package com.clx.performance.dao.impl; package com.clx.performance.dao.impl;
import com.clx.performance.dao.OrderChildPoundLogDao; import com.clx.performance.dao.OrderChildPoundLogDao;
import com.clx.performance.mapper.OrderChildPoundLogMapper; import com.clx.performance.mapper.OrderChildPoundLogMapper;
import com.clx.performance.model.OrderChildPoundLog; import com.clx.performance.model.OrderChildPoundLog;
...@@ -8,10 +7,12 @@ import com.msl.common.dao.impl.BaseDaoImpl; ...@@ -8,10 +7,12 @@ import com.msl.common.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
/** /**
* @author liruixin * @Author: aiqinguo
* Date 2023-09-19 * @Description: 磅单日志表
* Time 13:25 * @Date: 2023/09/18 11:34:50
* @Version: 1.0
*/ */
@Repository @Repository
public class OrderChildPoundLogDaoImpl extends BaseDaoImpl<OrderChildPoundLogMapper, OrderChildPoundLog, Integer> implements OrderChildPoundLogDao { public class OrderChildPoundLogDaoImpl extends BaseDaoImpl<OrderChildPoundLogMapper, OrderChildPoundLog, Integer> implements OrderChildPoundLogDao {
} }
package com.clx.performance.dao.impl; package com.clx.performance.dao.impl;
import com.clx.performance.dao.OrderGoodsDao; import com.clx.performance.dao.OrderGoodsDao;
import com.msl.common.dao.BaseDao;
import com.msl.common.dao.impl.BaseDaoImpl;
import com.clx.performance.mapper.OrderGoodsMapper; import com.clx.performance.mapper.OrderGoodsMapper;
import com.clx.performance.model.OrderGoods; import com.clx.performance.model.OrderGoods;
import com.msl.common.base.Optional; import com.msl.common.base.Optional;
...@@ -15,6 +17,11 @@ import org.springframework.stereotype.Repository; ...@@ -15,6 +17,11 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods, Integer> implements OrderGoodsDao { public class OrderGoodsDaoImpl extends BaseDaoImpl<OrderGoodsMapper, OrderGoods, Integer> implements OrderGoodsDao {
@Override
public Integer getMaxOrderGoodsId(String type) {
return baseMapper.getMaxOrderGoodsId(type);
}
@Override @Override
public Optional<OrderGoods> getByOrderGoodsNo(String orderGoodsNo) { public Optional<OrderGoods> getByOrderGoodsNo(String orderGoodsNo) {
return Optional.of(orderGoodsNo) return Optional.of(orderGoodsNo)
......
package com.clx.performance.dao.impl; package com.clx.performance.dao.impl;
import com.clx.performance.dao.OrderGoodsDriverTruckDao;
import com.msl.common.dao.BaseDao; import com.msl.common.dao.BaseDao;
import com.msl.common.dao.impl.BaseDaoImpl; import com.msl.common.dao.impl.BaseDaoImpl;
import com.clx.performance.mapper.OrderGoodsDriverTruckMapper; import com.clx.performance.mapper.OrderGoodsDriverTruckMapper;
...@@ -12,5 +13,5 @@ import org.springframework.stereotype.Repository; ...@@ -12,5 +13,5 @@ import org.springframework.stereotype.Repository;
* Time 16:45 * Time 16:45
*/ */
@Repository @Repository
public class OrderGoodsDriverTruckDaoImpl extends BaseDaoImpl<OrderGoodsDriverTruckMapper, OrderGoodsDriverTruck, Integer> implements BaseDao<OrderGoodsDriverTruckMapper, OrderGoodsDriverTruck, Integer> { public class OrderGoodsDriverTruckDaoImpl extends BaseDaoImpl<OrderGoodsDriverTruckMapper, OrderGoodsDriverTruck, Integer> implements OrderGoodsDriverTruckDao {
} }
package com.clx.performance.dao.impl; package com.clx.performance.dao.impl;
import com.clx.performance.dao.SeniorLogisticsManagerDao;
import com.msl.common.dao.BaseDao; import com.msl.common.dao.BaseDao;
import com.msl.common.dao.impl.BaseDaoImpl; import com.msl.common.dao.impl.BaseDaoImpl;
import com.clx.performance.mapper.SeniorLogisticsManagerMapper; import com.clx.performance.mapper.SeniorLogisticsManagerMapper;
...@@ -12,5 +13,5 @@ import org.springframework.stereotype.Repository; ...@@ -12,5 +13,5 @@ import org.springframework.stereotype.Repository;
* Time 16:45 * Time 16:45
*/ */
@Repository @Repository
public class SeniorLogisticsManagerDaoImpl extends BaseDaoImpl<SeniorLogisticsManagerMapper, SeniorLogisticsManager, Integer> implements BaseDao<SeniorLogisticsManagerMapper, SeniorLogisticsManager, Integer> { public class SeniorLogisticsManagerDaoImpl extends BaseDaoImpl<SeniorLogisticsManagerMapper, SeniorLogisticsManager, Integer> implements SeniorLogisticsManagerDao {
} }
package com.clx.performance.mapper; package com.clx.performance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.clx.performance.model.OrderChildPoundAudit; import com.clx.performance.model.OrderChildPoundAudit;
import org.apache.ibatis.annotations.Mapper;
/** /**
* @author liruixin * @Author: aiqinguo
* Date 2023-09-19 * @Description: 磅单审核表
* Time 13:25 * @Date: 2023/09/18 11:34:50
*/ * @Version: 1.0
*/
@Mapper
public interface OrderChildPoundAuditMapper extends BaseMapper<OrderChildPoundAudit> { public interface OrderChildPoundAuditMapper extends BaseMapper<OrderChildPoundAudit> {
} }
\ No newline at end of file
package com.clx.performance.mapper; package com.clx.performance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.clx.performance.model.OrderChildPoundLog; import com.clx.performance.model.OrderChildPoundLog;
import org.apache.ibatis.annotations.Mapper;
/** /**
* @author liruixin * @Author: aiqinguo
* Date 2023-09-19 * @Description: 磅单日志表
* Time 13:25 * @Date: 2023/09/18 11:34:50
*/ * @Version: 1.0
*/
@Mapper
public interface OrderChildPoundLogMapper extends BaseMapper<OrderChildPoundLog> { public interface OrderChildPoundLogMapper extends BaseMapper<OrderChildPoundLog> {
} }
\ No newline at end of file
...@@ -2,6 +2,8 @@ package com.clx.performance.mapper; ...@@ -2,6 +2,8 @@ package com.clx.performance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.clx.performance.model.OrderGoods; import com.clx.performance.model.OrderGoods;
import com.clx.performance.sqlProvider.OrderGoodsSqlProvider;
import org.apache.ibatis.annotations.SelectProvider;
/** /**
* @author kavin * @author kavin
...@@ -9,4 +11,7 @@ import com.clx.performance.model.OrderGoods; ...@@ -9,4 +11,7 @@ import com.clx.performance.model.OrderGoods;
* Time 16:45 * Time 16:45
*/ */
public interface OrderGoodsMapper extends BaseMapper<OrderGoods> { public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
@SelectProvider(type = OrderGoodsSqlProvider.class, method = "getMaxOrderGoodsId")
Integer getMaxOrderGoodsId(String type);
} }
...@@ -48,12 +48,12 @@ public class OrderChild implements HasKey<Integer> { ...@@ -48,12 +48,12 @@ public class OrderChild implements HasKey<Integer> {
private BigDecimal loadRough; //装货毛重(单位吨) private BigDecimal loadRough; //装货毛重(单位吨)
private BigDecimal loadTare; //装货皮重(单位吨) private BigDecimal loadTare; //装货皮重(单位吨)
private BigDecimal loadNet; //装货净重(单位吨) private BigDecimal loadNet; //装货净重(单位吨)
private BigDecimal unloadRough; //卸货毛重(单位吨) private BigDecimal unloadRough; //卸货毛重(单位吨)
private BigDecimal unloadTare; //卸货皮重(单位吨) private BigDecimal unloadTare; //卸货皮重(单位吨)
private BigDecimal unloadNet; //卸货净重(单位吨) private BigDecimal unloadNet; //卸货净重(单位吨)
private BigDecimal weight; //拉运重量(单位吨) private BigDecimal weight; //拉运重量(单位吨)
private Integer poundStatus; //磅单审核状态
private Integer status; //状态 private Integer status; //状态
private LocalDateTime payTime; //支付时间 private LocalDateTime payTime; //支付时间
......
package com.clx.performance.model; package com.clx.performance.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn; import com.msl.common.config.KeyColumn;
import com.msl.common.model.HasKey; import com.msl.common.model.HasKey;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
/** /**
* @author liruixin * @Author: aiqinguo
* Date 2023-09-19 * @Description: 磅单审核表
* Time 13:25 * @Date: 2023/09/19 13:16:57
*/ * @Version: 1.0
*/
@Getter @Getter
@Setter @Setter
@Accessors(chain = true) @NoArgsConstructor
@TableName("order_child_pound_audit") @TableName(autoResultMap = true)
public class OrderChildPoundAudit implements HasKey<Integer> { public class OrderChildPoundAudit implements HasKey<Integer> {
@TableId(value = "id", type = IdType.AUTO) private Integer id; //id
private Integer id; private String childNo; //运单编号
private Integer status; //审核状态
@TableField("child_no") private Integer rejectType; //审核驳回类型:1装车 2卸车 3装车+卸车
@ApiModelProperty("运单编号") private String remark; //备注
private String childNo; private String createTime; //创建时间
private String modifiedTime; //修改时间
@TableField("status")
@ApiModelProperty("审核状态")
private Integer status;
@TableField("reject_type")
@ApiModelProperty("审核驳回类型:1装车 2卸车 3装车+卸车")
private Integer rejectType;
@TableField("remark")
@ApiModelProperty("备注")
private String remark;
@TableField("create_time")
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
@TableField("modified_time")
@ApiModelProperty("修改时间")
private LocalDateTime modifiedTime;
@Override
@KeyColumn("id") @KeyColumn("id")
@Override
public Integer gainKey() { public Integer gainKey() {
return this.id; return id;
} }
} }
\ No newline at end of file
package com.clx.performance.model; package com.clx.performance.model;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn; import com.msl.common.config.KeyColumn;
import com.msl.common.model.HasKey; import com.msl.common.model.HasKey;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
import lombok.experimental.Accessors; import lombok.ToString;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
/** /**
* @author liruixin * @Author: aiqinguo
* Date 2023-09-19 * @Description: 磅单日志表
* Time 13:25 * @Date: 2023/09/19 13:16:57
*/ * @Version: 1.0
*/
@Getter @Getter
@Setter @Setter
@Accessors(chain = true) @NoArgsConstructor
@TableName("order_child_pound_log") @TableName(autoResultMap = true)
public class OrderChildPoundLog implements HasKey<Integer> { public class OrderChildPoundLog implements HasKey<Integer> {
@TableId(value = "id", type = IdType.AUTO) private Integer id; //id
private Integer id; private String childNo; //运单编号
private Integer status; //审核状态
@TableField("child_no") private String remark; //备注
@ApiModelProperty("运单编号") private Integer createType; //操作人类型1-货主, 2-承运端,3-司机
private String childNo; private Long createBy; //操作人编号
private String createName; //操作人名称
@TableField("status") private String createTime; //创建时间
@ApiModelProperty("审核状态") private String modifiedTime; //修改时间
private Integer status;
@TableField("remark")
@ApiModelProperty("备注")
private String remark;
@TableField("create_type")
@ApiModelProperty("操作人类型1-货主, 2-承运端,3-司机")
private Integer createType;
@TableField("create_by")
@ApiModelProperty("操作人编号")
private Long createBy;
@TableField("create_name")
@ApiModelProperty("操作人名称")
private String createName;
@TableField("create_time")
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
@TableField("modified_time")
@ApiModelProperty("修改时间")
private LocalDateTime modifiedTime;
@Override
@KeyColumn("id") @KeyColumn("id")
@Override
public Integer gainKey() { public Integer gainKey() {
return this.id; return id;
} }
} }
\ No newline at end of file
...@@ -31,6 +31,10 @@ public class OrderGoods implements HasKey<Integer> { ...@@ -31,6 +31,10 @@ public class OrderGoods implements HasKey<Integer> {
@ApiModelProperty("订单编号") @ApiModelProperty("订单编号")
private String orderNo; private String orderNo;
@TableField("order_goods_type")
@ApiModelProperty("货单编号类型")
private String orderGoodsType;
@TableField("order_goods_no") @TableField("order_goods_no")
@ApiModelProperty("货单编号") @ApiModelProperty("货单编号")
private String orderGoodsNo; private String orderGoodsNo;
......
...@@ -20,7 +20,7 @@ import java.util.List; ...@@ -20,7 +20,7 @@ import java.util.List;
@AllArgsConstructor @AllArgsConstructor
public class SeniorLogisticsManagerServiceImpl implements SeniorLogisticsManagerService { public class SeniorLogisticsManagerServiceImpl implements SeniorLogisticsManagerService {
SeniorLogisticsManagerDao seniorLogisticsManagerDao; private final SeniorLogisticsManagerDao seniorLogisticsManagerDao;
......
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 + ")";
}
}
...@@ -17,7 +17,8 @@ spring: ...@@ -17,7 +17,8 @@ spring:
server-addr: nacos.devclx.cn:8848 server-addr: nacos.devclx.cn:8848
username: nacos username: nacos
password: nacos password: nacos
register-enabled: false register-enabled: true
namespace: new-clx-dev
# namespace: ${spring.profiles.active} # namespace: ${spring.profiles.active}
config: config:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论