mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
Merge branch 'main' of ssh://192.168.1.205:9922/cf_devdept2/cf_imes_server
This commit is contained in:
-52
@@ -1,12 +1,6 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPageReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.service.order.OrderInputProcessor;
|
||||
import com.cf.imes.module.executor.util.RandomUtils;
|
||||
import com.cf.imes.module.executor.util.deviseData.Detail;
|
||||
import com.cf.imes.module.executor.util.deviseData.IBoardProdInfo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -14,23 +8,18 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.service.plan.PlanService;
|
||||
|
||||
@@ -43,9 +32,6 @@ public class PlanController {
|
||||
@Resource
|
||||
private PlanService planService;
|
||||
|
||||
@Resource
|
||||
private OrderInputProcessor orderInputProcessor;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建排单")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plan:create')")
|
||||
@@ -156,42 +142,4 @@ public class PlanController {
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("test")
|
||||
@Operation(summary = "test")
|
||||
public Boolean test() {
|
||||
ArrayList<Detail> details = new ArrayList<>();
|
||||
for (int i = 0; i < 20; i++) {
|
||||
Detail detail = RandomUtils.randomPojo(Detail.class);
|
||||
IBoardProdInfo iBoardProdInfo = detail.getIBoardProdInfo();
|
||||
iBoardProdInfo.setRawGoodsId(999L);
|
||||
iBoardProdInfo.setGoodsName("abc");
|
||||
iBoardProdInfo.setMaterial("ccc");
|
||||
iBoardProdInfo.setColor("blue");
|
||||
iBoardProdInfo.setBrand("xxx");
|
||||
iBoardProdInfo.setSpec("xxxx");
|
||||
iBoardProdInfo.setGoodType(1);
|
||||
iBoardProdInfo.setWidth((float) 0.0);
|
||||
iBoardProdInfo.setHeight((float) 0.0);
|
||||
iBoardProdInfo.setThickness(5.0);
|
||||
iBoardProdInfo.setSplitWidth(1);
|
||||
iBoardProdInfo.setSplitHeight(1);
|
||||
iBoardProdInfo.setSplitThickness(2);
|
||||
iBoardProdInfo.setSealUp((float) 0.0);
|
||||
iBoardProdInfo.setSealLeft((float) 0.0);
|
||||
iBoardProdInfo.setSealRight((float) 0.0);
|
||||
iBoardProdInfo.setSealDown((float) 0.0);
|
||||
iBoardProdInfo.setTexture(1);
|
||||
iBoardProdInfo.setOpenDoorType(1);
|
||||
iBoardProdInfo.setTypographicFace(1);
|
||||
detail.setMultiNum(23);
|
||||
detail.setDepth(10.0);
|
||||
detail.setHeight(9.0);
|
||||
detail.getContourDetail().forEach(e->e.setTypographicFace(1));
|
||||
detail.getSideModelDetail().forEach(e->e.setTypographicFace(1));
|
||||
details.add(detail);
|
||||
}
|
||||
orderInputProcessor.input(details, 999L);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
+4
@@ -3,11 +3,13 @@ package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Valid
|
||||
@Data
|
||||
@Schema(description = "")
|
||||
public class GetSourceDataReq {
|
||||
@@ -20,9 +22,11 @@ public class GetSourceDataReq {
|
||||
private Long dataSourceId;
|
||||
|
||||
@Schema(description = "排单id")
|
||||
@NotNull(message = "排单id不能空")
|
||||
private Long planId;
|
||||
|
||||
@Schema(description = "包裹id")
|
||||
@NotNull(message = "包裹id不能空")
|
||||
private Long packageId;
|
||||
|
||||
|
||||
|
||||
+12
-5
@@ -7,6 +7,7 @@ import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -31,8 +32,8 @@ public class OrderPageReqVOCopy extends PageParam {
|
||||
private String consigneeAddress;
|
||||
@Schema(description = "状态列表")
|
||||
private List<Integer> stateList;
|
||||
@Schema(description = "矩形")
|
||||
private Boolean rectangle;
|
||||
/*@Schema(description = "矩形")
|
||||
private Boolean rectangle;*/
|
||||
@Schema(description = "异形")
|
||||
private Boolean specialShaped;
|
||||
@Schema(description = "造型")
|
||||
@@ -43,11 +44,17 @@ public class OrderPageReqVOCopy extends PageParam {
|
||||
private Boolean burrow;
|
||||
@Schema(description = "有二维纹路")
|
||||
private Boolean twoDimensionalToolPath;
|
||||
@Schema(description = "开始时间")
|
||||
@Schema(description = "门板")
|
||||
private Boolean isDoor;
|
||||
@Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date beginDate;
|
||||
private LocalDateTime[] createTime;
|
||||
/*@Schema(description = "交付日期开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date endDate;
|
||||
private LocalDateTime beginDate;
|
||||
@Schema(description = "交付日期结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime endDate;*/
|
||||
@Schema(description = "长 小范围")
|
||||
private BigDecimal longMinRang;
|
||||
@Schema(description = "长 大范围")
|
||||
|
||||
+3
@@ -30,6 +30,9 @@ public class OrderRespVOCopy {
|
||||
private String customer;
|
||||
@Schema(description = "地址")
|
||||
private String address;
|
||||
@Schema(description = "订单日期")
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private Date orderDate;
|
||||
@Schema(description = "交付日期")
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private Date deliveryDate;
|
||||
|
||||
+20
-8
@@ -34,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -219,7 +220,11 @@ public class PlanServiceImpl implements PlanService {
|
||||
List<PlateDO> plateDOS = plateMapper.selectList(new LambdaQueryWrapperX<PlateDO>().in(PlateDO::getGoodsId, goodsDOS.stream().map(GoodsDO::getGoodsId).collect(Collectors.toSet())));
|
||||
PageResult<PlanRespVO> planRespVOPageResult = BeanUtils.toBean(planDOPageResult, PlanRespVO.class);
|
||||
planRespVOPageResult.getList().forEach(e -> {
|
||||
e.setMachineName(machines.stream().filter(f -> Objects.equals(f.getId(), e.getMachineId())).map(CuttingRespDTO::getName).findAny().orElse(null));
|
||||
e.setMachineName(machines.stream()
|
||||
.filter(f -> Objects.equals(f.getId(), e.getMachineId()))
|
||||
.map(CuttingRespDTO::getName)
|
||||
.findAny()
|
||||
.orElse(null));
|
||||
e.setPlateInfoList(goodsDOS.stream()
|
||||
.filter(f -> Objects.equals(f.getOrderId(), e.getId()))
|
||||
.map(p -> PlateInfoVO.builder()
|
||||
@@ -242,12 +247,17 @@ public class PlanServiceImpl implements PlanService {
|
||||
|
||||
QueryWrapperX<OrderDO> queryWrapperX = new QueryWrapperX<>();
|
||||
queryWrapperX
|
||||
.eqIfPresent("customer", pageReqVO.getConsignee())
|
||||
.eqIfPresent("address", pageReqVO.getConsigneeAddress())
|
||||
.eqIfPresent("custom_order_no", pageReqVO.getDefaultId())
|
||||
.betweenIfPresent("delivery_date", new Date[]{pageReqVO.getBeginDate(), pageReqVO.getEndDate()})
|
||||
.isNull("d.order_id")
|
||||
;
|
||||
.isNull("opi.id")
|
||||
.eqIfPresent("a.customer", pageReqVO.getConsignee())
|
||||
.eqIfPresent("a.custom_order_no", pageReqVO.getDefaultId())
|
||||
.eqIfPresent("a.address", pageReqVO.getConsigneeAddress())
|
||||
.betweenIfPresent("a.create_time", pageReqVO.getCreateTime())
|
||||
.eqIfPresent("op.is_special_shaped", pageReqVO.getSpecialShaped())
|
||||
.eqIfPresent("op.is_sculpt", pageReqVO.getSculpt())
|
||||
.eqIfPresent("op.is_door", pageReqVO.getIsDoor())
|
||||
.betweenIfPresent("op.height", new BigDecimal[]{pageReqVO.getLongMinRang(), pageReqVO.getLongMaxRang()})
|
||||
.betweenIfPresent("op.width", new BigDecimal[]{pageReqVO.getWidthMinRang(), pageReqVO.getWidthMaxRang()})
|
||||
.orderByDesc("a.create_time");
|
||||
List<Integer> filterTypes = new ArrayList<>();
|
||||
if (Objects.nonNull(pageReqVO.getHoleThrough()) && pageReqVO.getHoleThrough()) {
|
||||
filterTypes.add(1);
|
||||
@@ -259,7 +269,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
filterTypes.add(4);
|
||||
}
|
||||
|
||||
queryWrapperX.inIfPresent("c.filter_type", filterTypes);
|
||||
queryWrapperX.inIfPresent("op.filter_type", filterTypes);
|
||||
|
||||
IPage<OrderRespVOCopy> orderDOPageResult = orderMapper.selectOrderPage(page, queryWrapperX);
|
||||
if (CollectionUtil.isEmpty(orderDOPageResult.getRecords())) {
|
||||
@@ -332,6 +342,8 @@ public class PlanServiceImpl implements PlanService {
|
||||
|
||||
queryWrapperX.eq("p.plan_id", vo.getPlanId())
|
||||
.eqIfPresent("a.is_door", vo.getIsDoor())
|
||||
.eqIfPresent("a.is_special_shaped", vo.getSpecialShaped())
|
||||
.eqIfPresent("a.is_sculpt", vo.getSculpt())
|
||||
.betweenIfPresent("a.width", new BigDecimal[]{vo.getWidthMinRang(), vo.getWidthMaxRang()})
|
||||
.betweenIfPresent("a.height", new BigDecimal[]{vo.getLongMinRang(), vo.getLongMaxRang()})
|
||||
.inIfPresent("a.filter_type", filterTypes)
|
||||
|
||||
+8
-6
@@ -4,14 +4,16 @@
|
||||
|
||||
<select id="selectOrderPage" resultType="com.cf.imes.module.executor.controller.admin.plan.vo.OrderRespVOCopy">
|
||||
select a.id as orderId, a.order_date, a.delivery_date, a.customer, a.address, a.custom_order_no as defineId,
|
||||
count(c.id) as num, sum(c.area) as area, p.goods_name, p.color, p.material, p.goods_id
|
||||
og.goods_name, og.color, og.material, op.goods_id, count(op.id) as num, sum(op.area) as area
|
||||
from `order` a
|
||||
left join order_plate c ON a.id = c.order_id and c.is_cancel = 0
|
||||
left join order_goods p on c.goods_id = p.goods_id
|
||||
left join order_item d ON c.order_id = d.order_id
|
||||
left join order_plan_item e on d.id = e.item_id
|
||||
inner join order_plate op on a.id = op.order_id and op.is_cancel = 0
|
||||
inner join order_goods og on op.goods_id = og.goods_id
|
||||
left join order_item oi on a.id = oi.order_id
|
||||
left join order_plan_item opi on oi.id = opi.item_id
|
||||
${ew.customSqlSegment}
|
||||
group by orderId, p.id
|
||||
group by a.id, og.id
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectDynamicSqlString" resultType="java.util.Map">
|
||||
|
||||
Reference in New Issue
Block a user