mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
新增根据排单id获取板材列表接口
This commit is contained in:
+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;
|
||||
|
||||
+8
@@ -78,6 +78,14 @@ public class PlanController {
|
||||
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')")
|
||||
|
||||
+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;
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
|
||||
+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
@@ -59,4 +59,6 @@ public interface PlanService {
|
||||
Boolean addPlate(AddPlateReq req);
|
||||
|
||||
Boolean cancellation(Long id);
|
||||
|
||||
List<PlateResList> getPlateByPlanId(Long id);
|
||||
}
|
||||
+22
@@ -12,12 +12,14 @@ 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;
|
||||
@@ -81,6 +83,9 @@ public class PlanServiceImpl implements PlanService {
|
||||
@Resource
|
||||
private MachineApi machineApi;
|
||||
|
||||
@Resource
|
||||
private ModuleMapper moduleMapper;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -217,6 +222,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
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())
|
||||
@@ -307,4 +313,20 @@ public class PlanServiceImpl implements PlanService {
|
||||
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>
|
||||
+9
@@ -20,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>
|
||||
Reference in New Issue
Block a user