提交 1b4ea23f authored 作者: huyufan's avatar huyufan

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
......@@ -4,6 +4,7 @@ import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
public enum OrderChildEnum {
......@@ -82,5 +83,22 @@ public enum OrderChildEnum {
}
}
// 运输中
public static final List<Integer> TRANSIT_lIST = Arrays.asList(
Status.CREATED.getCode(),
Status.PAY.getCode(),
Status.GO_TO_SEND.getCode(),
Status.ARRIVE_SEND.getCode(),
Status.LOAD.getCode(),
Status.GO_TO_RECEIVE.getCode(),
Status.ARRIVE_RECEIVE.getCode(),
Status.UNLOAD.getCode(),
Status.UNSETTLE.getCode()
);
}
package com.clx.performance.feign;
import com.msl.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -17,6 +18,6 @@ public interface PerformanceFeign {
* @return
*/
@GetMapping(value = {"clx-performance/feign/orderGoodsDriverTruck/getTrucksByOrderGoodsNo"})
List<Integer> getTrucksByOrderGoodsNo(@RequestParam("orderGoodsNo") @NotBlank(message = "货单编号不可为空") String orderGoodsNo);
Result<List<Integer>> getTrucksByOrderGoodsNo(@RequestParam("orderGoodsNo") @NotBlank(message = "货单编号不可为空") String orderGoodsNo);
}
......@@ -32,7 +32,7 @@ public class PagePoundAuditParam extends PageParam {
@ApiModelProperty(value="收货地址",example = "黄羊城")
private String receiveAddress;
@ApiModelProperty(value="审核状态 0-待审核,1-审核失败, 2-审核成功",example = "1")
@ApiModelProperty(value="审核状态 0 待审核 1 审核通过 2 审核驳回",example = "1")
private Integer status;
@ApiModelProperty(value="开始时间",example = "2020-01-01 10:10:10")
......
......@@ -31,7 +31,7 @@ public class PoundAuditParam {
private String remark;
@NotNull(message = "审核状态不能为空")
@ApiModelProperty(value="审核状态 0-待审核,1-审核失败, 2-审核成功",example = "1")
@ApiModelProperty(value="审核状态 0 待审核 1 审核通过 2 审核驳回",example = "1")
private Integer status;
@ApiModelProperty(value="装货净重",example = "11")
......
package com.clx.performance.vo.app;
import com.clx.performance.enums.OrderChildEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
......@@ -7,7 +8,6 @@ import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.List;
......@@ -91,6 +91,11 @@ public class OrderChildVO {
private Integer poundStatus;
@ApiModelProperty(value = "状态", example = "")
private Integer status;
@ApiModelProperty(value = "运输状态 0非运输中 1运输中", example = "1")
private Integer transitStatus;
public Integer getTransitStatus() {
return status==null || !OrderChildEnum.TRANSIT_lIST.contains(status)? 0 : 1;
}
@ApiModelProperty(value = "支付时间", example = "")
private String payTime;
......
......@@ -23,7 +23,7 @@ public class OrderChildPoundAuditDetailVO {
@ApiModelProperty(value="卸货净重",example = "41")
private BigDecimal unloadNet;
@ApiModelProperty(value="审核状态 0-待审核,1-审核失败, 2-审核成功",example = "1")
@ApiModelProperty(value="审核状态 0 待审核 1 审核通过 2 审核驳回",example = "1")
private Integer status;
@ApiModelProperty(value="备注",example = "41441")
......
......@@ -14,7 +14,7 @@ import lombok.Setter;
public class OrderChildPoundLogVO {
@ApiModelProperty(value="审核状态 0-待审核,1-审核失败, 2-审核成功",example = "1")
@ApiModelProperty(value="审核状态 0 待审核 1 审核通过 2 审核驳回",example = "1")
private Integer status;
@ApiModelProperty(value="操作时间",example = "2020-01-01 10:10:10")
......
......@@ -43,7 +43,7 @@ public class PageOrderChildPoundAuditVO {
@ApiModelProperty(value="卸货净重",example = "41")
private BigDecimal unloadNet;
@ApiModelProperty(value="审核状态 0-待审核,1-审核失败, 2-审核成功",example = "1")
@ApiModelProperty(value="审核状态 0 待审核 1 审核通过 2 审核驳回",example = "1")
private Integer status;
@ApiModelProperty(value="接单时间",example = "2020-01-01 10:10:10")
......
......@@ -217,6 +217,10 @@
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>com.msl</groupId>
<artifactId>log-spring-boot-starter</artifactId>
</dependency>
</dependencies>
......
......@@ -14,10 +14,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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 org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank;
......@@ -43,7 +40,7 @@ public class OrderChildPoundAuditController {
@ApiOperation(value = "磅单审核详情",notes = "<br>By:李瑞新")
@PostMapping("/getPoundAuditDetail")
@GetMapping("/getPoundAuditDetail")
public Result<OrderChildPoundAuditDetailVO> getPoundAuditDetail(@NotBlank(message = "运单编号不能为空") String childNo) {
return Result.ok(orderChildPoundAuditService.getPoundAuditDetail(childNo));
}
......
......@@ -8,7 +8,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -28,7 +28,7 @@ public class OrderChildPoundLogController {
private final OrderChildPoundLogService orderChildPoundLogService;
@ApiOperation(value = "磅单审核日志列表",notes = "<br>By:李瑞新")
@PostMapping("/getPoundLogList")
@GetMapping("/getPoundLogList")
public Result<List<OrderChildPoundLogVO>> getPoundLogList(@NotBlank(message = "运单编号不能为空") String childNo) {
return Result.ok(orderChildPoundLogService.getPoundLogList(childNo));
}
......
......@@ -21,7 +21,7 @@ import java.math.BigDecimal;
public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
@Update(" update order_goods set " +
" residue_transport_weight = residue_transport_weight-#{weight}, " +
" residue_transport_weight = residue_transport_weight-#{weight} " +
" where id = #{orderId}")
int updateWeight(@Param("orderId")Integer orderId, @Param("weight")BigDecimal weight);
......
......@@ -57,7 +57,9 @@ public class OrderChild implements HasKey<Integer> {
private BigDecimal unloadRough; //卸货毛重(单位吨)
private BigDecimal unloadTare; //卸货皮重(单位吨)
private BigDecimal unloadNet; //卸货净重(单位吨)
private BigDecimal weight; //拉运重量(单位吨)
private BigDecimal freight; //运费(分)
private String cancelRemark; //取消原因
private Integer poundStatus; //磅单审核状态 0 待审核 1 审核通过 2 审核驳回
......
......@@ -128,6 +128,7 @@ public class OrderChildServiceImpl implements OrderChildService {
orderChild.setTruckLoad(truckLoad);
orderChild.setWeight(orderChild.getTruckLoad());
orderChild.setFreight(orderChildFreightCalc(orderChild));
orderChild.setPayTime(now);
orderChild.setStatus(OrderChildEnum.Status.CREATED.getCode());
orderChild.setCreateTime(now);
......@@ -667,6 +668,13 @@ public class OrderChildServiceImpl implements OrderChildService {
else {return orderChild.getUnloadNet().compareTo(orderChild.getLoadNet())>0? orderChild.getLoadNet() : orderChild.getUnloadNet();}
}
/**
* 运费计算
*/
private BigDecimal orderChildFreightCalc(OrderChild orderChild){
return orderChild.getWeight().multiply(orderChild.getFreightPrice()).setScale(0, BigDecimal.ROUND_HALF_UP);
}
/**
* 接单锁定司机
......
......@@ -18,7 +18,7 @@ public class OrderChildSqlProvider {
return new SQL(){{
SELECT("child_no,goods_name,freight_price," +
"send_address,receive_address," +
"driver_name,driver_mobile," +
"driver_user_no, driver_name,driver_mobile," +
"truck_no," +
"weight," +
"cancel_remark," +
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论