修改创建排单的接口参数

This commit is contained in:
yangsb
2024-05-08 15:08:26 +08:00
parent 1abca14719
commit 305828f352
4 changed files with 32 additions and 3 deletions
@@ -4,6 +4,7 @@ import com.cf.imes.framework.es.core.valid.CreateGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.Valid;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@@ -45,8 +46,11 @@ public class PlanSaveReqVO {
/*@Schema(description = "生产单id列表", requiredMode = Schema.RequiredMode.REQUIRED)
private List<Long> orderIds;*/
@Schema(description = "板件id列表")
private List<Long> plateIds;
/*@Schema(description = "板件id列表")
private List<Long> plateIds;*/
@Schema(description = "生产单id与商品id 列表")
private List<Item> itemList;
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
private String remark;
@@ -58,4 +62,15 @@ public class PlanSaveReqVO {
@Schema(description = "生产时间", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "生产时间不能为空", groups = CreateGroup.class)
private LocalDateTime produceTime;
@Valid
@Data
public static class Item {
@Schema(description = "生产单id")
@NotNull
private Long orderId;
@Schema(description = "商品id")
@NotNull
private Long goodsId;
}
}
@@ -10,6 +10,7 @@ import com.cf.imes.framework.common.pojo.PageResult;
import com.cf.imes.framework.common.util.object.BeanUtils;
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.PlanSaveReqVO;
import com.cf.imes.module.executor.controller.admin.plan.vo.PlatePage;
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateParam;
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
@@ -88,4 +89,6 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
}
IPage<PlateRespVO> selectProductList(@Param("page") IPage<PlateRespVO> page , @Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId);
Set<Long> selectBatchOrderIdsAndGoodsIds(@Param("itemList") List<PlanSaveReqVO.Item> itemList);
}
@@ -110,7 +110,10 @@ public class PlanServiceImpl implements PlanService {
}
planOrderMapper.insertBatch(planOrderDOS);
}*/
List<Long> plateIds = createReqVO.getPlateIds();
//List<Long> plateIds = createReqVO.getPlateIds();
List<PlanSaveReqVO.Item> itemList = createReqVO.getItemList();
Set<Long> plateIds = plateMapper.selectBatchOrderIdsAndGoodsIds(itemList);
if (CollectionUtil.isNotEmpty(plateIds)) {
ArrayList<PlanItemDO> planItemDOS = new ArrayList<>();
for (Long plateId : plateIds) {
@@ -55,4 +55,12 @@
AND (#{bodyId} IS NULL OR b.body_id = #{bodyId})
GROUP BY a.id, c.material, c.color;
</select>
<select id="selectBatchOrderIdsAndGoodsIds" resultType="java.lang.Long">
select id from order_plate
where ( order_id, goods_id ) in
<foreach collection="itemList" item="item" open="(" close=")" separator=",">
(#{item.orderId},#{item.goodsId})
</foreach>
</select>
</mapper>