mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 21:52:07 +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_NEW_ORDER = new ErrorCode(1_001_109_000, "生产单不为新单,清空无效");
|
||||||
ErrorCode ORDER_NOT_CANCEL = 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_CANCEL = new ErrorCode(1_001_109_000, "生产单未作废,还原无效");
|
||||||
|
ErrorCode ORDER_PLAN_ERROR = new ErrorCode(1_001_109_001, "选中删除对象有已开料板件,请联系管理员修改开料状态后再删除!");
|
||||||
|
|
||||||
// ========== 生产单 TODO 补充编号 ==========
|
// ========== 生产单 TODO 补充编号 ==========
|
||||||
ErrorCode MODULE_NOT_EXISTS = new ErrorCode(1_001_110_000, "模块不存在");
|
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 isRowHole;
|
||||||
|
/**
|
||||||
|
* 是否优化
|
||||||
|
*/
|
||||||
|
private Boolean isOptimized;
|
||||||
/**
|
/**
|
||||||
* 排单过滤类型,1 有挖穿造型 2 有挖穿孔 4 有二维刀路 8 可叠
|
* 排单过滤类型,1 有挖穿造型 2 有挖穿孔 4 有二维刀路 8 可叠
|
||||||
*/
|
*/
|
||||||
|
|||||||
+10
-6
@@ -48,8 +48,8 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
|||||||
// .leftJoin(OrderItemDO.class, OrderItemDO::getId, PlanItemDO::getItemId)
|
// .leftJoin(OrderItemDO.class, OrderItemDO::getId, PlanItemDO::getItemId)
|
||||||
.leftJoin(OrderDO.class, OrderDO::getId, GoodsDO::getOrderId)
|
.leftJoin(OrderDO.class, OrderDO::getId, GoodsDO::getOrderId)
|
||||||
.like(OrderDO::getCustomer, reqVO.getCustomer())
|
.like(OrderDO::getCustomer, reqVO.getCustomer())
|
||||||
.orderBy(true, true, PlanDO::getSort)
|
// .orderBy(true, true, PlanDO::getSort)
|
||||||
.orderByDesc(PlanDO::getUpdateTime)
|
.orderByDesc(PlanDO::getCreateTime)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,8 +68,8 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
|
|||||||
.betweenIfPresent(PlanDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(PlanDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.eqIfPresent(PlanDO::getOperator, reqVO.getOperator())
|
.eqIfPresent(PlanDO::getOperator, reqVO.getOperator())
|
||||||
.betweenIfPresent(PlanDO::getProduceTime, reqVO.getProduceTime())
|
.betweenIfPresent(PlanDO::getProduceTime, reqVO.getProduceTime())
|
||||||
.orderBy(true, true, PlanDO::getSort)
|
// .orderBy(true, true, PlanDO::getSort)
|
||||||
.orderByDesc(PlanDO::getUpdateTime));
|
.orderByDesc(PlanDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<PlateOptimize> selectPlateListByPlanId(@Param("planId") Long planId, @Param("organId") Long organId);
|
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);
|
// 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.saveOptimize.*;
|
||||||
import com.cf.imes.module.executor.controller.admin.plan.vo.*;
|
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.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.goods.OptimizeBoardModelDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.ordermodel.OrderModelDO;
|
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() ?
|
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()) {
|
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.orderBody.OrderBodyDO;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.orderItem.OrderItemDO;
|
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.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.dataobject.plate.PlateDO;
|
||||||
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
|
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
|
||||||
import com.cf.imes.module.executor.dal.mysql.orderBody.OrderBodyMapper;
|
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.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
|
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.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 实现类
|
* 生产单板件 Service 实现类
|
||||||
@@ -267,7 +267,7 @@ public class PlateServiceImpl implements PlateService {
|
|||||||
plateDO.setRemark(reqVO.getRemake1() +","+ reqVO.getRemake2());
|
plateDO.setRemark(reqVO.getRemake1() +","+ reqVO.getRemake2());
|
||||||
plateDO.setHoleArrange(reqVO.getPlaceHole());
|
plateDO.setHoleArrange(reqVO.getPlaceHole());
|
||||||
plateDO.setGoodsId(goodsId);
|
plateDO.setGoodsId(goodsId);
|
||||||
|
plateDO.setIsOptimized(true);
|
||||||
plateDO.setPlateNo((obtainingTime) + Long.toString(plateNo).substring(2));
|
plateDO.setPlateNo((obtainingTime) + Long.toString(plateNo).substring(2));
|
||||||
|
|
||||||
plateDO.setArea(reqVO.getWidth().multiply(reqVO.getHeight()).movePointLeft(4).stripTrailingZeros());
|
plateDO.setArea(reqVO.getWidth().multiply(reqVO.getHeight()).movePointLeft(4).stripTrailingZeros());
|
||||||
@@ -303,19 +303,19 @@ public class PlateServiceImpl implements PlateService {
|
|||||||
orderItemMapper.insertBatch(orderItemDOS);
|
orderItemMapper.insertBatch(orderItemDOS);
|
||||||
|
|
||||||
|
|
||||||
List<PlanItemDO> planItemDOS = new ArrayList<>();
|
// List<PlanItemDO> planItemDOS = new ArrayList<>();
|
||||||
|
//
|
||||||
orderItemDOS.forEach(orderItemDO ->{
|
// orderItemDOS.forEach(orderItemDO ->{
|
||||||
|
//
|
||||||
PlanItemDO planItemDO = PlanItemDO.builder()
|
// PlanItemDO planItemDO = PlanItemDO.builder()
|
||||||
.planId(reqVO.getPlanId())
|
// .planId(reqVO.getPlanId())
|
||||||
.itemId(orderItemDO.getId())
|
// .itemId(orderItemDO.getId())
|
||||||
.build();
|
// .build();
|
||||||
planItemDOS.add(planItemDO);
|
// planItemDOS.add(planItemDO);
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
// 排单明细表新增数据
|
// // 排单明细表新增数据
|
||||||
planItemMapper.insertBatch(planItemDOS);
|
// planItemMapper.insertBatch(planItemDOS);
|
||||||
|
|
||||||
return plateDOS.stream().map(PlateDO::getId).toList();
|
return plateDOS.stream().map(PlateDO::getId).toList();
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
from orders o
|
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_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}
|
${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_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}
|
${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_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}
|
${ew.customSqlSegment}
|
||||||
|
|
||||||
|
|||||||
+19
-6
@@ -183,11 +183,10 @@
|
|||||||
select * from order_plan where
|
select * from order_plan where
|
||||||
organ_id = #{organId}
|
organ_id = #{organId}
|
||||||
and deleted = false
|
and deleted = false
|
||||||
and update_time >= #{updateTime}
|
and create_time >= #{createTime}
|
||||||
and sort <= #{sort}
|
|
||||||
and id != #{planId}
|
and id != #{planId}
|
||||||
|
|
||||||
ORDER BY sort DESC, update_time
|
ORDER BY create_time
|
||||||
limit 1;
|
limit 1;
|
||||||
|
|
||||||
|
|
||||||
@@ -199,16 +198,30 @@
|
|||||||
select * from order_plan where
|
select * from order_plan where
|
||||||
organ_id = #{organId}
|
organ_id = #{organId}
|
||||||
and deleted = false
|
and deleted = false
|
||||||
and update_time <= #{updateTime}
|
and create_time <= #{createTime}
|
||||||
and sort >= #{sort}
|
|
||||||
and id != #{planId}
|
and id != #{planId}
|
||||||
|
|
||||||
ORDER BY sort , update_time desc
|
ORDER BY create_time desc
|
||||||
limit 1;
|
limit 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
+5
-5
@@ -400,7 +400,7 @@
|
|||||||
|
|
||||||
<update id="updateDeletedById">
|
<update id="updateDeletedById">
|
||||||
UPDATE order_plate
|
UPDATE order_plate
|
||||||
SET deleted = #{deleted}
|
SET deleted = #{deleted},is_optimized = false
|
||||||
WHERE id IN
|
WHERE id IN
|
||||||
<if test="plateIds != null and plateIds.size() > 0">
|
<if test="plateIds != null and plateIds.size() > 0">
|
||||||
<foreach item="plateId" collection="plateIds" open="(" separator="," close=")">
|
<foreach item="plateId" collection="plateIds" open="(" separator="," close=")">
|
||||||
@@ -896,7 +896,7 @@
|
|||||||
|
|
||||||
update order_plate
|
update order_plate
|
||||||
|
|
||||||
set isOptimized = true
|
set is_optimized = true
|
||||||
|
|
||||||
where organ_id = #{organId}
|
where organ_id = #{organId}
|
||||||
and deleted = false
|
and deleted = false
|
||||||
@@ -911,7 +911,7 @@
|
|||||||
#{ids}
|
#{ids}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
and isOptimized = false
|
and is_optimized = false
|
||||||
|
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
@@ -919,7 +919,7 @@
|
|||||||
|
|
||||||
update order_plate
|
update order_plate
|
||||||
|
|
||||||
set isOptimized = false
|
set is_optimized = false
|
||||||
|
|
||||||
where organ_id = #{organId}
|
where organ_id = #{organId}
|
||||||
and deleted = false
|
and deleted = false
|
||||||
@@ -932,7 +932,7 @@
|
|||||||
#{ids}
|
#{ids}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
||||||
and isOptimized = true
|
and is_optimized = true
|
||||||
|
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -52,7 +52,7 @@ public class PackController {
|
|||||||
|
|
||||||
|
|
||||||
@GetMapping("/getOrderPlate")
|
@GetMapping("/getOrderPlate")
|
||||||
@Operation(summary = "查看生产订单对应的板材信息")
|
@Operation(summary = "查看生产订单对应的没有打包的板材信息")
|
||||||
@Parameter(name = "orderId", description = "生产单Id", required = true)
|
@Parameter(name = "orderId", description = "生产单Id", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('manage:pack-palte:query')")
|
@PreAuthorize("@ss.hasPermission('manage:pack-palte:query')")
|
||||||
public CommonResult<List<PlateDetailsRespVO>> getOrderPlateList(@Valid @RequestParam("orderId") Long orderId) {
|
public CommonResult<List<PlateDetailsRespVO>> getOrderPlateList(@Valid @RequestParam("orderId") Long orderId) {
|
||||||
|
|||||||
+1
-1
@@ -286,7 +286,7 @@ public interface ErrorCodeConstants {
|
|||||||
|
|
||||||
//=========== 断言提示信息 1-002-041-000 ============
|
//=========== 断言提示信息 1-002-041-000 ============
|
||||||
ErrorCode ORDER_DATE_ERROR = new ErrorCode(1_002_041_001, "生产单信息不存在,请重新进入或切换生产单");
|
ErrorCode ORDER_DATE_ERROR = new ErrorCode(1_002_041_001, "生产单信息不存在,请重新进入或切换生产单");
|
||||||
ErrorCode ORDER_PLATE_ERROR = new ErrorCode(1_002_041_002, "生产单对应的板材信息不存在");
|
ErrorCode ORDER_PLATE_ERROR = new ErrorCode(1_002_041_002, "生产单对应的板材数据有异常,请查看板材信息或联系客服");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user