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:
+4
@@ -11,6 +11,10 @@ public interface ErrorCodeConstants {
|
||||
// ========== 生产单开料排单
|
||||
ErrorCode PLAN_NOT_EXISTS = new ErrorCode(1_001_107_000, "生产单开料排单不存在");
|
||||
|
||||
ErrorCode PLAN_NOT_ALLOW_DELETE = new ErrorCode(1_001_107_001, "排单 开料中 已开料 不予许删除");
|
||||
|
||||
ErrorCode PLAN_NOT_ALLOW_CANCEL = new ErrorCode(1_001_107_002, "排单 新单 不予许作废");
|
||||
|
||||
// ========== 生产单商品 TODO 补充编号 ==========
|
||||
ErrorCode GOODS_NOT_EXISTS = new ErrorCode(1_001_108_000, "生产单商品不存在");
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class ModulePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "生产单号")
|
||||
private Long orderNo;
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "模块名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
+20
-5
@@ -55,22 +55,37 @@ public class PlanController {
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除排单")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@Parameter(name = "id", description = "排单id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('executor:plan:delete')")
|
||||
public CommonResult<Boolean> deletePlan(@RequestParam("id") Long id) {
|
||||
planService.deletePlan(id);
|
||||
return success(true);
|
||||
return success(planService.deletePlan(id));
|
||||
}
|
||||
|
||||
@DeleteMapping("cancellation")
|
||||
@Operation(summary = "作废")
|
||||
@Parameter(name = "id", description = "排单id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('executor:plan:delete')")
|
||||
public CommonResult<Boolean> cancellation(@RequestParam("id") Long id) {
|
||||
return success(planService.cancellation(id));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得排单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@Parameter(name = "id", description = "排单id", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plan:query')")
|
||||
public CommonResult<PlanRespVO> getPlan(@RequestParam("id") Long id) {
|
||||
PlanRespVO plan = planService.getPlan(id);
|
||||
return success(BeanUtils.toBean(plan, PlanRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("getPlateByPlanId")
|
||||
@Operation(summary = "根据排单id获取板材列表")
|
||||
@Parameter(name = "id", description = "排单id", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plan:query')")
|
||||
public CommonResult<List<PlateResList>> getPlateByPlanId(@RequestParam("id") Long id) {
|
||||
return success(planService.getPlateByPlanId(id));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得排单分页")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plan:query')")
|
||||
@@ -79,7 +94,7 @@ public class PlanController {
|
||||
return success(BeanUtils.toBean(pageResult, PlanRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("getOrderPageByPlanId")
|
||||
@GetMapping("getNotPlanOrderListPage")
|
||||
@Operation(summary = "获取未排单的板材生产单板材分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('executor:plan:query')")
|
||||
public CommonResult<PageResult<OrderRespVO>> getOrderPage(@Valid OrderPageReqVO pageReqVO) {
|
||||
|
||||
+20
-41
@@ -31,51 +31,30 @@ public class OrderPageReqVO extends PageParam {
|
||||
private String consigneeAddress;
|
||||
@Schema(description = "状态列表")
|
||||
private List<Integer> stateList;
|
||||
@Schema(description = "形状搜索条件")
|
||||
private CheckDicBean checkDic;
|
||||
@Schema(description = "矩形")
|
||||
private boolean rectangle;
|
||||
@Schema(description = "异形")
|
||||
private boolean specialShaped;
|
||||
@Schema(description = "造型")
|
||||
private boolean sculpt;
|
||||
@Schema(description = "有挖穿造型")
|
||||
private boolean holeThrough;
|
||||
@Schema(description = "有挖穿孔")
|
||||
private boolean burrow;
|
||||
@Schema(description = "有二维纹路")
|
||||
private boolean twoDimensionalToolPath;
|
||||
@Schema(description = "开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date beginDate;
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date endDate;
|
||||
@Schema(description = "长范围")
|
||||
private LongRangBean longRang;
|
||||
@Schema(description = "宽范围")
|
||||
private WidthRangBean widthRang;
|
||||
@Schema(description = "长 小范围")
|
||||
private BigDecimal longMinRang;
|
||||
@Schema(description = "长 大范围")
|
||||
private BigDecimal longMaxRang;
|
||||
@Schema(description = "宽 小范围")
|
||||
private BigDecimal widthMinRang;
|
||||
@Schema(description = "宽 大范围")
|
||||
private BigDecimal widthMaxRang;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class CheckDicBean {
|
||||
@Schema(description = "矩形")
|
||||
private boolean rectangle;
|
||||
@Schema(description = "异形")
|
||||
private boolean specialShaped;
|
||||
@Schema(description = "造型")
|
||||
private boolean sculpt;
|
||||
@Schema(description = "有挖穿造型")
|
||||
private boolean holeThrough;
|
||||
@Schema(description = "有挖穿孔")
|
||||
private boolean burrow;
|
||||
@Schema(description = "有二维纹路")
|
||||
private boolean twoDimensionalToolPath;
|
||||
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class LongRangBean {
|
||||
@Schema(description = "生产单id")
|
||||
private BigDecimal min;
|
||||
@Schema(description = "生产单id")
|
||||
private BigDecimal max;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class WidthRangBean {
|
||||
@Schema(description = "生产单id")
|
||||
private BigDecimal min;
|
||||
@Schema(description = "生产单id")
|
||||
private BigDecimal max;
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -41,6 +41,10 @@ public class PlanRespVO {
|
||||
@ExcelProperty("机台 ID")
|
||||
private Long machineId;
|
||||
|
||||
@Schema(description = "机台 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16707")
|
||||
@ExcelProperty("机台 名称")
|
||||
private String machineName;
|
||||
|
||||
@Schema(description = "计划时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("计划时间")
|
||||
private LocalDateTime planTime;
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PlateResList {
|
||||
|
||||
@Schema(description = "生产单id")
|
||||
private Long orderId;
|
||||
@Schema(description = "房间id")
|
||||
private Long roomId;
|
||||
@Schema(description = "房间名称")
|
||||
private String roomName;
|
||||
@Schema(description = "柜体Id")
|
||||
private Long bodyId;
|
||||
@Schema(description = "柜体名称")
|
||||
private String bodyName;
|
||||
@Schema(description = "自定义板材编号")
|
||||
private String plateNo;
|
||||
@Schema(description = "板材名称")
|
||||
private String plateName;
|
||||
@Schema(description = "商品颜色")
|
||||
private String color;
|
||||
@Schema(description = "商品宽")
|
||||
private String width;
|
||||
@Schema(description = "商品高")
|
||||
private String height;
|
||||
@Schema(description = "商品厚")
|
||||
private String thickness;
|
||||
@Schema(description = "是否异形")
|
||||
private Boolean specialShaped;
|
||||
@Schema(description = "是否造型")
|
||||
private Boolean sculpt;
|
||||
}
|
||||
+2
-2
@@ -12,7 +12,7 @@ import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
*
|
||||
* @author 晨丰科技
|
||||
*/
|
||||
@TableName("order_module_n")
|
||||
@TableName("order_module")
|
||||
@KeySequence("order_module_n_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@@ -30,7 +30,7 @@ public class ModuleDO extends BaseDO {
|
||||
/**
|
||||
* 生产单号
|
||||
*/
|
||||
private Long orderNo;
|
||||
private Long orderId;
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
|
||||
+4
@@ -170,5 +170,9 @@ public class PlateDO extends BaseDO {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 是否作废
|
||||
*/
|
||||
private Boolean isCancel;
|
||||
|
||||
}
|
||||
+1
-1
@@ -19,7 +19,7 @@ public interface ModuleMapper extends BaseMapperX<ModuleDO> {
|
||||
|
||||
default PageResult<ModuleDO> selectPage(ModulePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ModuleDO>()
|
||||
.eqIfPresent(ModuleDO::getOrderNo, reqVO.getOrderNo())
|
||||
.eqIfPresent(ModuleDO::getOrderId, reqVO.getOrderId())
|
||||
.likeIfPresent(ModuleDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ModuleDO::getParentId, reqVO.getParentId())
|
||||
.eqIfPresent(ModuleDO::getGroupId, reqVO.getGroupId())
|
||||
|
||||
+2
@@ -9,6 +9,7 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlatePage;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||
@@ -62,4 +63,5 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
|
||||
IPage<PlatePage> selectPlatePage(@Param("page") IPage<PlatePage> page, @Param("orderId")Long organId, @Param("goodsId") String goodsId);
|
||||
|
||||
List<PlateResList> selectPlateByPlanId(Long id);
|
||||
}
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.executor.framework.rpc.config;
|
||||
|
||||
import com.cf.imes.module.system.api.machine.MachineApi;
|
||||
import com.cf.imes.module.system.api.user.AdminUserApi;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -8,6 +9,6 @@ import org.springframework.context.annotation.Configuration;
|
||||
* @author there
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = AdminUserApi.class)
|
||||
@EnableFeignClients(clients = {AdminUserApi.class, MachineApi.class})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
|
||||
+5
-1
@@ -34,7 +34,7 @@ public interface PlanService {
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePlan(Long id);
|
||||
Boolean deletePlan(Long id);
|
||||
|
||||
/**
|
||||
* 获得生产单开料排单
|
||||
@@ -57,4 +57,8 @@ public interface PlanService {
|
||||
PageResult<PlatePage> getNotPlanPlateListPage(PlateReqPageVO pageVO);
|
||||
|
||||
Boolean addPlate(AddPlateReq req);
|
||||
|
||||
Boolean cancellation(Long id);
|
||||
|
||||
List<PlateResList> getPlateByPlanId(Long id);
|
||||
}
|
||||
+69
-8
@@ -4,23 +4,29 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.cf.imes.framework.common.util.date.LocalDateTimeUtils;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.QueryWrapperX;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.module.ModuleDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.planitem.PlanItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.planorder.PlanOrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.plate.PlateDO;
|
||||
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.module.ModuleMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.orderItem.OrderItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.planitem.PlanItemMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.planorder.PlanOrderMapper;
|
||||
import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper;
|
||||
import com.cf.imes.module.system.api.machine.MachineApi;
|
||||
import com.cf.imes.module.system.api.machine.dto.CuttingRespDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -74,6 +80,12 @@ public class PlanServiceImpl implements PlanService {
|
||||
@Resource
|
||||
private PlateMapper plateMapper;
|
||||
|
||||
@Resource
|
||||
private MachineApi machineApi;
|
||||
|
||||
@Resource
|
||||
private ModuleMapper moduleMapper;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -148,13 +160,20 @@ public class PlanServiceImpl implements PlanService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deletePlan(Long id) {
|
||||
public Boolean deletePlan(Long id) {
|
||||
// 校验存在
|
||||
validatePlanExists(id);
|
||||
PlanDO planDO = planMapper.selectById(id);
|
||||
if (planDO == null) {
|
||||
throw exception(PLAN_NOT_EXISTS);
|
||||
}
|
||||
if (planDO.getStatus().equals(2) || planDO.getStatus().equals(3)) {
|
||||
throw exception(PLAN_NOT_ALLOW_DELETE);
|
||||
}
|
||||
// 删除
|
||||
planMapper.deleteById(id);
|
||||
planOrderMapper.delete(new LambdaQueryWrapperX<PlanOrderDO>().eq(PlanOrderDO::getPlanId, id));
|
||||
planItemMapper.delete(new LambdaQueryWrapperX<PlanItemDO>().eq(PlanItemDO::getPlanId, id));
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
private void validatePlanExists(Long id) {
|
||||
@@ -192,14 +211,18 @@ public class PlanServiceImpl implements PlanService {
|
||||
if (CollectionUtil.isEmpty(planDOPageResult.getList())) {
|
||||
return new PageResult<>();
|
||||
}
|
||||
Set<Long> macheineIds = planDOPageResult.getList().stream().map(e -> e.getMachineId()).collect(Collectors.toSet());
|
||||
List<CuttingRespDTO> machines = machineApi.list(macheineIds).getCheckedData();
|
||||
Set<Long> ids = planDOPageResult.getList().stream().map(e -> e.getId()).collect(Collectors.toSet());
|
||||
List<GoodsDO> goodsDOS = goodsMapper.selectList(new LambdaQueryWrapperX<GoodsDO>().in(GoodsDO::getOrderId, ids));
|
||||
List<PlateDO> plateDOS = plateMapper.selectList(new LambdaQueryWrapperX<PlateDO>().in(PlateDO::getGoodsId, goodsDOS.stream().map(e -> e.getGoodsId()).collect(Collectors.toSet())));
|
||||
PageResult<PlanRespVO> planRespVOPageResult = BeanUtils.toBean(planDOPageResult, PlanRespVO.class);
|
||||
planRespVOPageResult.getList().stream().forEach(e -> {
|
||||
e.setMachineName(machines.stream().filter(f -> Objects.equals(f.getId(), e.getMachineId())).map(m -> m.getName()).findAny().orElse(null));
|
||||
e.setPlateInfoList(goodsDOS.stream()
|
||||
.filter(f -> Objects.equals(f.getOrderId(), e.getId()))
|
||||
.map(p -> PlateInfoVO.builder()
|
||||
.material(p.getMaterial())
|
||||
.width(p.getWidth())
|
||||
.height(p.getHeight())
|
||||
.thickness(p.getThickness())
|
||||
@@ -223,13 +246,18 @@ public class PlanServiceImpl implements PlanService {
|
||||
.betweenIfPresent("delivery_date", new Date[]{pageReqVO.getBeginDate(), pageReqVO.getEndDate()})
|
||||
.isNull("d.order_id")
|
||||
;
|
||||
List<Integer> filterTypes = new ArrayList<>();
|
||||
if (pageReqVO.isHoleThrough()) {
|
||||
filterTypes.add(1);
|
||||
}
|
||||
if (pageReqVO.isBurrow()) {
|
||||
filterTypes.add(2);
|
||||
}
|
||||
if (pageReqVO.isTwoDimensionalToolPath()) {
|
||||
filterTypes.add(4);
|
||||
}
|
||||
|
||||
LambdaQueryWrapperX<OrderDO> wrapper = new LambdaQueryWrapperX<OrderDO>()
|
||||
.eqIfPresent(OrderDO::getId, pageReqVO.getOrderId())
|
||||
.eqIfPresent(OrderDO::getCustomer, pageReqVO.getConsignee())
|
||||
.eqIfPresent(OrderDO::getAddress, pageReqVO.getConsigneeAddress())
|
||||
.eqIfPresent(OrderDO::getCustomOrderNo, pageReqVO.getDefaultId())
|
||||
.betweenIfPresent(OrderDO::getDeliveryDate, new Date[]{pageReqVO.getBeginDate(), pageReqVO.getEndDate()});
|
||||
queryWrapperX.inIfPresent("c.filter_type", filterTypes);
|
||||
|
||||
IPage<OrderRespVO> orderDOPageResult = orderMapper.selectOrderPage(page, queryWrapperX);
|
||||
if (CollectionUtil.isEmpty(orderDOPageResult.getRecords())) {
|
||||
@@ -268,4 +296,37 @@ public class PlanServiceImpl implements PlanService {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean cancellation(Long id) {
|
||||
PlanDO planDO = planMapper.selectById(id);
|
||||
if (planDO == null) {
|
||||
throw exception(PLAN_NOT_EXISTS);
|
||||
}
|
||||
if (planDO.getStatus().equals(0) || planDO.getStatus().equals(1)) {
|
||||
throw exception(PLAN_NOT_ALLOW_CANCEL);
|
||||
}
|
||||
Set<Long> itemIds = planItemMapper.selectList(new LambdaQueryWrapperX<PlanItemDO>().eq(PlanItemDO::getPlanId, id))
|
||||
.stream().map(e -> e.getItemId())
|
||||
.collect(Collectors.toSet());
|
||||
plateMapper.update(new LambdaUpdateWrapper<PlateDO>().in(PlateDO::getId, itemIds).set(PlateDO::getIsCancel, Boolean.TRUE));
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PlateResList> getPlateByPlanId(Long id) {
|
||||
validatePlanExists(id);
|
||||
List<PlateResList> list = plateMapper.selectPlateByPlanId(id);
|
||||
Set<Long> bodyIds = list.stream().map(e -> e.getBodyId()).collect(Collectors.toSet());
|
||||
Set<Long> roomIds = list.stream().map(e -> e.getRoomId()).collect(Collectors.toSet());
|
||||
List<ModuleDO> moduleDOS = moduleMapper.selectList(new LambdaQueryWrapperX<ModuleDO>().in(ModuleDO::getId, bodyIds).eq(ModuleDO::getType, 2)
|
||||
.or().in(ModuleDO::getId, roomIds).eq(ModuleDO::getType, 1)
|
||||
);
|
||||
for (PlateResList resList : list) {
|
||||
resList.setBodyName(moduleDOS.stream().filter(e->Objects.equals(e.getId(), resList.getBodyId())).map(e->e.getName()).findAny().orElse(null));
|
||||
resList.setRoomName(moduleDOS.stream().filter(e->Objects.equals(e.getId(), resList.getRoomId())).map(e->e.getName()).findAny().orElse(null));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.cf.imes.module.executor.dal.mysql.module.ModuleMapper">
|
||||
|
||||
</mapper>
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
select a.id as orderId, 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
|
||||
from `order` a
|
||||
left join order_plate c ON a.id = c.order_id
|
||||
left join order_plate c ON a.id = c.order_id and c.is_cancel = 0
|
||||
left join plate p on c.goods_id = p.goods_id
|
||||
left join order_item d ON c.order_id = d.order_id
|
||||
${ew.customSqlSegment}
|
||||
|
||||
+10
@@ -11,6 +11,7 @@
|
||||
LEFT JOIN order_goods c on a.order_id = c.order_id
|
||||
<where>
|
||||
p.id is null
|
||||
and a.is_cancel = 0
|
||||
<if test="orderId !=null">
|
||||
and a.order_id = #{orderId}
|
||||
</if>
|
||||
@@ -19,4 +20,13 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectPlateByPlanId"
|
||||
resultType="com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList">
|
||||
select a.order_id, a.plate_no , a.name, e.material, e.color, e.width, e.height, e.thickness, b.room_id, b.body_id
|
||||
from order_plate a
|
||||
left join order_item b on a.id = b.data_id and b.type =1
|
||||
left join order_plan_item c on a.id = c.item_id
|
||||
left join order_goods e on e.goods_id = a.goods_id and e.order_id = a.order_id
|
||||
where c.plan_id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.cf.imes.module.system.api.machine;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.module.system.api.machine.dto.CuttingRespDTO;
|
||||
import com.cf.imes.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 晨丰:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 机台")
|
||||
public interface MachineApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/machine";
|
||||
|
||||
@GetMapping(PREFIX + "/get-cutting")
|
||||
@Operation(summary = "获得开料机台信息")
|
||||
@Parameter(name = "id", description = "机台id", example = "1024", required = true)
|
||||
CommonResult<CuttingRespDTO> getCutting(@RequestParam("id") Long id);
|
||||
|
||||
|
||||
@GetMapping(PREFIX + "/get-drill")
|
||||
@Operation(summary = "获得钻孔机台信息")
|
||||
@Parameter(name = "id", description = "机台id", example = "1024", required = true)
|
||||
CommonResult<CuttingRespDTO> getDrill(@RequestParam("id") Long id);
|
||||
|
||||
|
||||
@GetMapping(PREFIX + "/list")
|
||||
@Operation(summary = "获得机台基本信息列表")
|
||||
@Parameter(name = "ids", description = "机台id", example = "1024", required = true)
|
||||
CommonResult<List<CuttingRespDTO>> list(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.cf.imes.module.system.api.machine.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 机台 Response VO")
|
||||
@Data
|
||||
public class CuttingRespDTO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14092")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "1机台设备 2CNC设备", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
private Integer machineType;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.cf.imes.module.system.api.machine;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.module.system.api.machine.dto.CuttingRespDTO;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.CuttingRespVO;
|
||||
import com.cf.imes.module.system.service.machine.MachineService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class MachineApiImpl implements MachineApi {
|
||||
|
||||
@Resource
|
||||
private MachineService machineService;
|
||||
|
||||
@Override
|
||||
public CommonResult<CuttingRespDTO> getCutting(Long id) {
|
||||
return success(BeanUtils.toBean(machineService.getCutting(id), CuttingRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<CuttingRespDTO> getDrill(Long id) {
|
||||
return success(BeanUtils.toBean(machineService.getDrill(id), CuttingRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<CuttingRespDTO>> list(Collection<Long> ids) {
|
||||
return success(BeanUtils.toBean(machineService.list(ids), CuttingRespDTO.class));
|
||||
}
|
||||
}
|
||||
+2
@@ -68,4 +68,6 @@ public interface MachineService {
|
||||
void batchDeleteDrill(List<Long> ids);
|
||||
|
||||
DrillRespVO getDrill(Long id);
|
||||
|
||||
List<MachineDO> list(Collection<Long> ids);
|
||||
}
|
||||
+5
@@ -222,6 +222,11 @@ public class MachineServiceImpl implements MachineService {
|
||||
return respVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MachineDO> list(Collection<Long> ids) {
|
||||
return machineMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
private void validateExists(Long id) {
|
||||
if (machineMapper.selectById(id) == null) {
|
||||
throw exception(MACHINE_NOT_EXISTS);
|
||||
|
||||
Reference in New Issue
Block a user