mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
生产单板材表实体类字段增加,修改排单分页按创建时间排序
This commit is contained in:
+1
@@ -32,6 +32,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode ORDER_NOT_NEW_ORDER = new ErrorCode(1_001_109_000, "生产单不为新单,清空无效");
|
||||
ErrorCode ORDER_NOT_CANCEL = new ErrorCode(1_001_109_000, "生产单已排单,小板操作无效");
|
||||
ErrorCode ORDER_CANCEL = new ErrorCode(1_001_109_000, "生产单未作废,还原无效");
|
||||
ErrorCode ORDER_PLAN_ERROR = new ErrorCode(1_001_109_001, "选中删除对象有已开料板件,请联系管理员修改开料状态后再删除!");
|
||||
|
||||
// ========== 生产单 TODO 补充编号 ==========
|
||||
ErrorCode MODULE_NOT_EXISTS = new ErrorCode(1_001_110_000, "模块不存在");
|
||||
|
||||
+4
@@ -165,6 +165,10 @@ public class PlateDO extends BaseDO {
|
||||
* 是否造型
|
||||
*/
|
||||
private Boolean isRowHole;
|
||||
/**
|
||||
* 是否优化
|
||||
*/
|
||||
private Boolean isOptimized;
|
||||
/**
|
||||
* 排单过滤类型,1 有挖穿造型 2 有挖穿孔 4 有二维刀路 8 可叠
|
||||
*/
|
||||
|
||||
+10
-6
@@ -48,8 +48,8 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
||||
// .leftJoin(OrderItemDO.class, OrderItemDO::getId, PlanItemDO::getItemId)
|
||||
.leftJoin(OrderDO.class, OrderDO::getId, GoodsDO::getOrderId)
|
||||
.like(OrderDO::getCustomer, reqVO.getCustomer())
|
||||
.orderBy(true, true, PlanDO::getSort)
|
||||
.orderByDesc(PlanDO::getUpdateTime)
|
||||
// .orderBy(true, true, PlanDO::getSort)
|
||||
.orderByDesc(PlanDO::getCreateTime)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
||||
.betweenIfPresent(PlanDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(PlanDO::getOperator, reqVO.getOperator())
|
||||
.betweenIfPresent(PlanDO::getProduceTime, reqVO.getProduceTime())
|
||||
.orderBy(true, true, PlanDO::getSort)
|
||||
.orderByDesc(PlanDO::getUpdateTime));
|
||||
// .orderBy(true, true, PlanDO::getSort)
|
||||
.orderByDesc(PlanDO::getCreateTime));
|
||||
}
|
||||
|
||||
List<PlateOptimize> selectPlateListByPlanId(@Param("planId") Long planId, @Param("organId") Long organId);
|
||||
@@ -107,11 +107,15 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
||||
|
||||
|
||||
|
||||
List<PlanDO> selectPlanIds(@Param("updateTime") String updateTime,@Param("sort") Long sort,@Param("organId") Long organId,@Param("planId") Long planId);
|
||||
List<PlanDO> selectPlanIds(@Param("createTime") String createTime,@Param("sort") Long sort,@Param("organId") Long organId,@Param("planId") Long planId);
|
||||
|
||||
|
||||
|
||||
List<PlanDO> selectPlanIdsFalse(@Param("updateTime") String updateTime,@Param("sort") Long sort,@Param("organId") Long organId,@Param("planId") Long planId);
|
||||
List<PlanDO> selectPlanIdsFalse(@Param("createTime") String createTime,@Param("sort") Long sort,@Param("organId") Long organId,@Param("planId") Long planId);
|
||||
|
||||
|
||||
List<PlanDO> selectPlanStatus(@Param("planIds") List<Long> planIds,@Param("organId") Long organId);
|
||||
|
||||
|
||||
|
||||
// List<PlanDO> seleTestSQL(@Param("sql") String sql);
|
||||
|
||||
+1
@@ -22,6 +22,7 @@ import com.cf.imes.module.executor.controller.admin.plan.bo.ProcessStepSalaryIds
|
||||
import com.cf.imes.module.executor.controller.admin.plan.saveOptimize.*;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.CutedBoardInfo;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.GoodsDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.goods.OptimizeBoardModelDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
||||
|
||||
+2
-2
@@ -447,9 +447,9 @@ public class PlanServiceImpl implements PlanService {
|
||||
|
||||
|
||||
List<PlanDO> plan = pageReqVO.getIsUp() ?
|
||||
planMapper.selectPlanIds(planDO.getUpdateTime().toString(),planDO.getSort(), getUserOrganId(), planDO.getId()) :
|
||||
planMapper.selectPlanIds(planDO.getCreateTime().toString(),planDO.getSort(), getUserOrganId(), planDO.getId()) :
|
||||
|
||||
planMapper.selectPlanIdsFalse(planDO.getUpdateTime().toString(),planDO.getSort(), getUserOrganId(), planDO.getId());
|
||||
planMapper.selectPlanIdsFalse(planDO.getCreateTime().toString(),planDO.getSort(), getUserOrganId(), planDO.getId());
|
||||
|
||||
if (plan.isEmpty()) {
|
||||
|
||||
|
||||
+16
-16
@@ -22,7 +22,6 @@ import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.planitem.PlanItemDO;
|
||||
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.orderBody.OrderBodyMapper;
|
||||
@@ -48,7 +47,8 @@ import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConsta
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
|
||||
import static com.cf.imes.module.executor.service.optimizeplan.OptimizePlanService.ORDER_PLATE_MODEL;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.*;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.REMAIN_PLATE_NOT_EXISTS;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.THE_CURRENT_BOARD_IS_NOT_SELECTED;
|
||||
|
||||
/**
|
||||
* 生产单板件 Service 实现类
|
||||
@@ -267,7 +267,7 @@ public class PlateServiceImpl implements PlateService {
|
||||
plateDO.setRemark(reqVO.getRemake1() +","+ reqVO.getRemake2());
|
||||
plateDO.setHoleArrange(reqVO.getPlaceHole());
|
||||
plateDO.setGoodsId(goodsId);
|
||||
|
||||
plateDO.setIsOptimized(true);
|
||||
plateDO.setPlateNo((obtainingTime) + Long.toString(plateNo).substring(2));
|
||||
|
||||
plateDO.setArea(reqVO.getWidth().multiply(reqVO.getHeight()).movePointLeft(4).stripTrailingZeros());
|
||||
@@ -303,19 +303,19 @@ public class PlateServiceImpl implements PlateService {
|
||||
orderItemMapper.insertBatch(orderItemDOS);
|
||||
|
||||
|
||||
List<PlanItemDO> planItemDOS = new ArrayList<>();
|
||||
|
||||
orderItemDOS.forEach(orderItemDO ->{
|
||||
|
||||
PlanItemDO planItemDO = PlanItemDO.builder()
|
||||
.planId(reqVO.getPlanId())
|
||||
.itemId(orderItemDO.getId())
|
||||
.build();
|
||||
planItemDOS.add(planItemDO);
|
||||
});
|
||||
|
||||
// 排单明细表新增数据
|
||||
planItemMapper.insertBatch(planItemDOS);
|
||||
// List<PlanItemDO> planItemDOS = new ArrayList<>();
|
||||
//
|
||||
// orderItemDOS.forEach(orderItemDO ->{
|
||||
//
|
||||
// PlanItemDO planItemDO = PlanItemDO.builder()
|
||||
// .planId(reqVO.getPlanId())
|
||||
// .itemId(orderItemDO.getId())
|
||||
// .build();
|
||||
// planItemDOS.add(planItemDO);
|
||||
// });
|
||||
//
|
||||
// // 排单明细表新增数据
|
||||
// planItemMapper.insertBatch(planItemDOS);
|
||||
|
||||
return plateDOS.stream().map(PlateDO::getId).toList();
|
||||
}
|
||||
|
||||
+3
-3
@@ -45,7 +45,7 @@
|
||||
|
||||
from orders o
|
||||
join order_goods og on o.organ_id = og.organ_id and o.id = og.order_id and og.plan_id = 0 and o.deleted = og.deleted
|
||||
join order_plate op on o.organ_id = op.organ_id and o.deleted = op.deleted and o.id = op.order_id and op.isOptimized = false
|
||||
join order_plate op on o.organ_id = op.organ_id and o.deleted = op.deleted and o.id = op.order_id and op.is_optimized = false
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
@@ -257,7 +257,7 @@
|
||||
|
||||
join order_goods og on o.organ_id = og.organ_id and o.id = og.order_id and og.plan_id = 0 and o.deleted = og.deleted
|
||||
|
||||
join order_plate op on o.organ_id = op.organ_id and o.deleted = op.deleted and o.id = op.order_id and op.isOptimized = false
|
||||
join order_plate op on o.organ_id = op.organ_id and o.deleted = op.deleted and o.id = op.order_id and op.is_optimized = false
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
@@ -278,7 +278,7 @@
|
||||
|
||||
join order_goods og on o.organ_id = og.organ_id and o.id = og.order_id and og.plan_id = 0 and o.deleted = og.deleted
|
||||
|
||||
join order_plate op on o.organ_id = op.organ_id and o.deleted = op.deleted and o.id = op.order_id and op.isOptimized = false
|
||||
join order_plate op on o.organ_id = op.organ_id and o.deleted = op.deleted and o.id = op.order_id and op.is_optimized = false
|
||||
|
||||
${ew.customSqlSegment}
|
||||
|
||||
|
||||
+19
-6
@@ -183,11 +183,10 @@
|
||||
select * from order_plan where
|
||||
organ_id = #{organId}
|
||||
and deleted = false
|
||||
and update_time >= #{updateTime}
|
||||
and sort <= #{sort}
|
||||
and create_time >= #{createTime}
|
||||
and id != #{planId}
|
||||
|
||||
ORDER BY sort DESC, update_time
|
||||
ORDER BY create_time
|
||||
limit 1;
|
||||
|
||||
|
||||
@@ -199,16 +198,30 @@
|
||||
select * from order_plan where
|
||||
organ_id = #{organId}
|
||||
and deleted = false
|
||||
and update_time <= #{updateTime}
|
||||
and sort >= #{sort}
|
||||
and create_time <= #{createTime}
|
||||
and id != #{planId}
|
||||
|
||||
ORDER BY sort , update_time desc
|
||||
ORDER BY create_time desc
|
||||
limit 1;
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectPlanStatus" resultType="com.cf.imes.module.executor.dal.dataobject.plan.PlanDO">
|
||||
|
||||
select id
|
||||
from order_plan
|
||||
where organ_id = #{organId}
|
||||
and deleted = false
|
||||
and id in
|
||||
<foreach item="planIds" collection="planIds" open="(" separator="," close=")">
|
||||
#{planIds}
|
||||
</foreach>
|
||||
and status !=0;
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
+5
-5
@@ -400,7 +400,7 @@
|
||||
|
||||
<update id="updateDeletedById">
|
||||
UPDATE order_plate
|
||||
SET deleted = #{deleted}
|
||||
SET deleted = #{deleted},is_optimized = false
|
||||
WHERE id IN
|
||||
<if test="plateIds != null and plateIds.size() > 0">
|
||||
<foreach item="plateId" collection="plateIds" open="(" separator="," close=")">
|
||||
@@ -896,7 +896,7 @@
|
||||
|
||||
update order_plate
|
||||
|
||||
set isOptimized = true
|
||||
set is_optimized = true
|
||||
|
||||
where organ_id = #{organId}
|
||||
and deleted = false
|
||||
@@ -911,7 +911,7 @@
|
||||
#{ids}
|
||||
</foreach>
|
||||
|
||||
and isOptimized = false
|
||||
and is_optimized = false
|
||||
|
||||
</update>
|
||||
|
||||
@@ -919,7 +919,7 @@
|
||||
|
||||
update order_plate
|
||||
|
||||
set isOptimized = false
|
||||
set is_optimized = false
|
||||
|
||||
where organ_id = #{organId}
|
||||
and deleted = false
|
||||
@@ -932,7 +932,7 @@
|
||||
#{ids}
|
||||
</foreach>
|
||||
|
||||
and isOptimized = true
|
||||
and is_optimized = true
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user