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:
+15
-5
@@ -415,9 +415,15 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
orderInputProcessor.batchInsert(rawGoodsDO, bodyDO, groupDO, partsDO, plateDO, null, itemDO, order.get(0), goodsDO, plateGoodDOS);
|
||||
List<OrderModelDO> orderModelDOs = BeanUtils.toBean(plateDetail, OrderModelDO.class);
|
||||
orderModelDOs.forEach(orderModelDO -> orderModelDO.setOrderId(order.get(0).getId()));
|
||||
orderInputProcessor.batchSaveModel(orderModelDOs);
|
||||
orderInputProcessor.batchSaveOrderPartsModel(partsRemark);
|
||||
|
||||
if (orderModelDOs.size() > 0) {
|
||||
orderModelDOs.forEach(orderModelDO -> orderModelDO.setOrderId(order.get(0).getId()));
|
||||
orderInputProcessor.batchSaveModel(orderModelDOs);
|
||||
}
|
||||
if (partsRemark.size() > 0){
|
||||
orderInputProcessor.batchSaveOrderPartsModel(partsRemark);
|
||||
}
|
||||
|
||||
return order.get(0).getId();
|
||||
}
|
||||
|
||||
@@ -600,8 +606,12 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
// validateCustomOrderNoExists(orderDO.getCustomOrderNo());
|
||||
orderInputProcessor.batchInsert(rawGoodsDO, bodyDO, groupDO, partsDO, plateDO, null, itemDO, orderDO, goodsDO, plateGoodDOS);
|
||||
orderInputProcessor.batchSaveModel(orderModelDOS);
|
||||
orderInputProcessor.batchSaveOrderPartsModel(orderPartsRemarks);
|
||||
if (orderModelDOS.size() > 0){
|
||||
orderInputProcessor.batchSaveModel(orderModelDOS);
|
||||
}
|
||||
if (orderPartsRemarks.size() > 0){
|
||||
orderInputProcessor.batchSaveOrderPartsModel(orderPartsRemarks);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+8
@@ -107,6 +107,14 @@ public class RemainPlateController {
|
||||
return success(BeanUtils.toBean(pageResult, RemainPlateRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/pageAdd")
|
||||
@Operation(summary = "获得生产单余料板可添加分页")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:remain')")
|
||||
public CommonResult<PageResult<RemainPlateRespVO>> getRemainPlatePageToAdd(@Valid RemainPlatePageReqVO pageReqVO) {
|
||||
PageResult<RemainPlateDO> pageResult = remainPlateService.getRemainPlatePageToAdd(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RemainPlateRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生产单余料板表Excel")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:remain')")
|
||||
|
||||
+29
-6
@@ -8,6 +8,7 @@ import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.manage.controller.admin.plate.vo.remain.RemainPlatePageReqVO;
|
||||
import com.cf.imes.module.manage.dal.dataobject.remainplaten.RemainPlateDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -47,6 +48,27 @@ public interface RemainPlateMapper extends BaseMapperX<RemainPlateDO> {
|
||||
.orderByDesc(RemainPlateDO::getId));
|
||||
}
|
||||
|
||||
default PageResult<RemainPlateDO> selectPageToAdd(RemainPlatePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RemainPlateDO>()
|
||||
.neIfPresent(RemainPlateDO::getInitPlanId, reqVO.getInitPlanId())
|
||||
.eqIfPresent(RemainPlateDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(RemainPlateDO::getGoodsId, reqVO.getGoodsId())
|
||||
.likeIfPresent(RemainPlateDO::getName, reqVO.getName())
|
||||
.likeIfPresent(RemainPlateDO::getMaterial, reqVO.getMaterial())
|
||||
.likeIfPresent(RemainPlateDO::getColor, reqVO.getColor())
|
||||
.eqIfPresent(RemainPlateDO::getThickness, reqVO.getThickness())
|
||||
.eqIfPresent(RemainPlateDO::getBrand, reqVO.getBrand())
|
||||
.likeIfPresent(RemainPlateDO::getStore, reqVO.getStore())
|
||||
.eqIfPresent(RemainPlateDO::getCount, reqVO.getCount())
|
||||
.eqIfPresent(RemainPlateDO::getTexture, reqVO.getTexture())
|
||||
.likeIfPresent(RemainPlateDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(RemainPlateDO::getOrganId, reqVO.getOrganId())
|
||||
.eqIfPresent(RemainPlateDO::getOutLineJson, reqVO.getOutLineJson())
|
||||
.betweenIfPresent(RemainPlateDO::getWidth, reqVO.getWidth())
|
||||
.betweenIfPresent(RemainPlateDO::getLength, reqVO.getLength())
|
||||
.betweenIfPresent(RemainPlateDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(RemainPlateDO::getId));
|
||||
}
|
||||
// 批量修改状态
|
||||
default void updateRemainPlateStatus(Set<Long> ids, Integer status, Integer useType,Long organId,Long planId) {
|
||||
update(new UpdateWrapper<RemainPlateDO>()
|
||||
@@ -75,12 +97,13 @@ public interface RemainPlateMapper extends BaseMapperX<RemainPlateDO> {
|
||||
}
|
||||
|
||||
// 通过排单id批量余料板
|
||||
default void deleteRemainPlate(Long initPlanId, Long organId) {
|
||||
update(new UpdateWrapper<RemainPlateDO>()
|
||||
.set("deleted", 1)
|
||||
.eq("init_plan_id", initPlanId)
|
||||
.eq("organ_id", organId));
|
||||
}
|
||||
// default void deleteRemainPlate(Long initPlanId, Long organId) {
|
||||
// update(new UpdateWrapper<RemainPlateDO>()
|
||||
// .set("deleted", 1)
|
||||
// .eq("init_plan_id", initPlanId)
|
||||
// .eq("organ_id", organId));
|
||||
// }
|
||||
void deleteRemainPlate(@Param("initPlanId") Long initPlanId, @Param("organId") Long organId);
|
||||
|
||||
// 根据使用排单id批量还原状态
|
||||
default void updateRemainPlateStatusByPlanId(Integer status, Integer useType,Long organId,Long planId) {
|
||||
|
||||
+7
@@ -79,4 +79,11 @@ public interface RemainPlateService {
|
||||
*/
|
||||
PageResult<RemainPlateDO> getRemainPlatePage(RemainPlatePageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 查询可添加余料板
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 生产单余料板表
|
||||
*/
|
||||
PageResult<RemainPlateDO> getRemainPlatePageToAdd(RemainPlatePageReqVO pageReqVO);
|
||||
}
|
||||
+5
@@ -173,4 +173,9 @@ public class RemainPlateServiceImpl implements RemainPlateService {
|
||||
return remainPlateMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<RemainPlateDO> getRemainPlatePageToAdd(RemainPlatePageReqVO pageReqVO) {
|
||||
return remainPlateMapper.selectPageToAdd(pageReqVO.setStatus(RemainPlateStatusEnum.UNUSED.getStatus()));
|
||||
}
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?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.manage.dal.mysql.remainplaten.RemainPlateMapper">
|
||||
|
||||
<delete id="deleteRemainPlate">
|
||||
delete from order_remain_plate where init_plan_id = #{initPlanId} and organ_id = #{organId}
|
||||
</delete>
|
||||
</mapper>
|
||||
+5
@@ -36,4 +36,9 @@ public class ProcessGroupPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "field", example = "field")
|
||||
private String field;
|
||||
|
||||
@Schema(description = "order", example = "order")
|
||||
private String order;
|
||||
}
|
||||
-3
@@ -24,15 +24,12 @@ public class ProcessGroupSaveReqVO {
|
||||
private Boolean isDefault;
|
||||
|
||||
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排序优先级不能为空")
|
||||
private Short sort;
|
||||
|
||||
@Schema(description = "明细,工序 ID 逗号分隔", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "明细,工序 ID 逗号分隔不能为空")
|
||||
private String items;
|
||||
|
||||
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便")
|
||||
@NotEmpty(message = "描述不能为空")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "工序集合", requiredMode = Schema.RequiredMode.REQUIRED, example = "{},{}")
|
||||
|
||||
-4
@@ -23,18 +23,14 @@ public class ProcessListSaveReqVO {
|
||||
private Boolean isDefault;
|
||||
|
||||
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排序优先级")
|
||||
private Short sort;
|
||||
|
||||
@Schema(description = "明细,工序 ID 逗号分隔", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "明细,工序 ID 逗号分隔不能为空")
|
||||
private String items;
|
||||
|
||||
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便")
|
||||
@NotEmpty(message = "描述不能为空")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "工序列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "待添加的工序")
|
||||
private List<ProcessRespVO> lists;
|
||||
}
|
||||
|
||||
+19
-2
@@ -20,7 +20,7 @@ import java.util.List;
|
||||
public interface ProcessGroupMapper extends BaseMapperX<ProcessGroupDO> {
|
||||
|
||||
default PageResult<ProcessGroupDO> selectPage(ProcessGroupPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ProcessGroupDO>()
|
||||
LambdaQueryWrapperX<ProcessGroupDO> queryWrapper = new LambdaQueryWrapperX<ProcessGroupDO>()
|
||||
.likeIfPresent(ProcessGroupDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ProcessGroupDO::getIsDefault, reqVO.getIsDefault())
|
||||
.eqIfPresent(ProcessGroupDO::getSort, reqVO.getSort())
|
||||
@@ -28,7 +28,24 @@ public interface ProcessGroupMapper extends BaseMapperX<ProcessGroupDO> {
|
||||
.eqIfPresent(ProcessGroupDO::getOrganId, reqVO.getOrganId())
|
||||
.eqIfPresent(ProcessGroupDO::getDescription, reqVO.getDescription())
|
||||
.betweenIfPresent(ProcessGroupDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ProcessGroupDO::getId));
|
||||
.orderByDesc(ProcessGroupDO::getSort);
|
||||
|
||||
if (reqVO.getOrder() == null) {
|
||||
queryWrapper.orderByDesc(ProcessGroupDO::getSort);
|
||||
}else {
|
||||
if (reqVO.getOrder().equals("ascend")) {
|
||||
switch (reqVO.getField()) {
|
||||
case "name" -> queryWrapper.orderByAsc(ProcessGroupDO::getName);
|
||||
case "sort" -> queryWrapper.orderByAsc(ProcessGroupDO::getSort);
|
||||
}
|
||||
}else if (reqVO.getOrder().equals("descend")) {
|
||||
switch (reqVO.getField()) {
|
||||
case "name" -> queryWrapper.orderByDesc(ProcessGroupDO::getName);
|
||||
case "sort" -> queryWrapper.orderByDesc(ProcessGroupDO::getSort);
|
||||
}
|
||||
}
|
||||
}
|
||||
return selectPage(reqVO, queryWrapper);
|
||||
}
|
||||
|
||||
ProcessDO selectOneById(@Param("id") Long id, @Param("organId") Long organId);
|
||||
|
||||
+3
-3
@@ -184,7 +184,7 @@ public class ProcessGroupServiceImpl implements ProcessGroupService {
|
||||
private String checkProcessGroupExists(String userLists) {
|
||||
// 检查输入是否为空或仅包含空白字符
|
||||
if (userLists == null || userLists.trim().isEmpty()) {
|
||||
return "[]"; // 统一返回空列表格式化字符串
|
||||
return ""; // 统一返回空列表格式化字符串
|
||||
}
|
||||
|
||||
List<String> itemsList = Arrays.stream(userLists.split(","))
|
||||
@@ -194,7 +194,7 @@ public class ProcessGroupServiceImpl implements ProcessGroupService {
|
||||
|
||||
// 如果列表为空,直接返回空字符串,表示没有有效的进程ID
|
||||
if (itemsList.isEmpty()) {
|
||||
return "[]";
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuilder itemsBuilder = new StringBuilder();
|
||||
@@ -229,7 +229,7 @@ public class ProcessGroupServiceImpl implements ProcessGroupService {
|
||||
}
|
||||
|
||||
// 返回格式化的列表字符串
|
||||
return itemsBuilder.length() > 0 ? itemsBuilder.toString() : "[]";
|
||||
return itemsBuilder.length() > 0 ? itemsBuilder.toString() : "";
|
||||
}
|
||||
|
||||
// 批量更新工序组默认
|
||||
|
||||
Reference in New Issue
Block a user