mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 21:52:07 +08:00
bug修改
This commit is contained in:
+6
-1
@@ -4,18 +4,23 @@ package com.cf.imes.module.executor.api.orderProcess;
|
|||||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||||
import com.cf.imes.module.executor.dal.dataobject.process.OrderProcessDO;
|
import com.cf.imes.module.executor.dal.dataobject.process.OrderProcessDO;
|
||||||
import com.cf.imes.module.executor.service.process.OrderProcessService;
|
import com.cf.imes.module.executor.service.process.OrderProcessService;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
public class OrderProcessServiceImpl implements OrderProcessApi{
|
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||||
|
@Validated
|
||||||
|
public class OrderProcessApiImpl implements OrderProcessApi{
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private OrderProcessService orderProcessService;
|
private OrderProcessService orderProcessService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<Boolean> getOrderProcessByProcessGroupId(Long id) {
|
public CommonResult<Boolean> getOrderProcessByProcessGroupId(Long id) {
|
||||||
|
System.out.println(" Long id " + id);
|
||||||
OrderProcessDO plateDO = orderProcessService.getOrderProcessByProcessGroupId(id);
|
OrderProcessDO plateDO = orderProcessService.getOrderProcessByProcessGroupId(id);
|
||||||
if (plateDO == null) {
|
if (plateDO == null) {
|
||||||
return success(false);
|
return success(false);
|
||||||
+1
-1
@@ -12,7 +12,7 @@ import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
|||||||
*
|
*
|
||||||
* @author 晨丰科技
|
* @author 晨丰科技
|
||||||
*/
|
*/
|
||||||
@TableName("order_process")
|
@TableName("imes_prod.order_process")
|
||||||
@KeySequence("order_process_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
@KeySequence("order_process_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
|||||||
+22
-22
@@ -70,30 +70,30 @@ public class OrderProcessServiceImpl implements OrderProcessService {
|
|||||||
// 插入
|
// 插入
|
||||||
OrderProcessDO orderProcess = BeanUtils.toBean(createReqVO, OrderProcessDO.class).setId((Long) identifierGenerator.nextId(null));
|
OrderProcessDO orderProcess = BeanUtils.toBean(createReqVO, OrderProcessDO.class).setId((Long) identifierGenerator.nextId(null));
|
||||||
|
|
||||||
//
|
|
||||||
// List<ProcessStepDO> processStepDOS = new ArrayList<>();
|
List<ProcessStepDO> processStepDOS = new ArrayList<>();
|
||||||
// List<OrderProcessStepItemDO> orderProcessStepItemDOS = new ArrayList<>();
|
List<OrderProcessStepItemDO> orderProcessStepItemDOS = new ArrayList<>();
|
||||||
// // 需要获取工序组的具体信息,以及工序组中工序的信息,然后将工序组中工序的信息插入到生产单工序步骤表中
|
// 需要获取工序组的具体信息,以及工序组中工序的信息,然后将工序组中工序的信息插入到生产单工序步骤表中
|
||||||
// ProcessListReqDTO processListReqDTO = processGroupApi.getProcessGroupDetail(createReqVO.getGroupId());
|
ProcessListReqDTO processListReqDTO = processGroupApi.getProcessGroupDetail(createReqVO.getGroupId());
|
||||||
// System.err.println(processListReqDTO);
|
|
||||||
// processListReqDTO.getLists().forEach(processRespDTO -> {
|
processListReqDTO.getLists().forEach(processRespDTO -> {
|
||||||
// ProcessStepDO processStepDO = BeanUtils.toBean(processRespDTO, ProcessStepDO.class).setOrderId(createReqVO.getOrderId())
|
ProcessStepDO processStepDO = BeanUtils.toBean(processRespDTO, ProcessStepDO.class).setOrderId(createReqVO.getOrderId())
|
||||||
// .setStatus(false).setProcessinfoId(processRespDTO.getId()).setOrderProcessId(orderProcess.getId())
|
.setStatus(false).setProcessinfoId(processRespDTO.getId()).setOrderProcessId(orderProcess.getId())
|
||||||
// .setId((Long) identifierGenerator.nextId(null));// 计划日期没有填写
|
.setId((Long) identifierGenerator.nextId(null));// 计划日期没有填写
|
||||||
// processStepDOS.add(processStepDO);
|
processStepDOS.add(processStepDO);
|
||||||
// OrderProcessStepItemDO orderProcessStepItemDO = OrderProcessStepItemDO.builder()
|
OrderProcessStepItemDO orderProcessStepItemDO = OrderProcessStepItemDO.builder()
|
||||||
// .name(processRespDTO.getName())
|
.name(processRespDTO.getName())
|
||||||
// .processStepId(processRespDTO.getId())
|
.processStepId(processRespDTO.getId())
|
||||||
// .orderProcessId(orderProcess.getId())
|
.orderProcessId(orderProcess.getId())
|
||||||
// .status(false)
|
.status(false)
|
||||||
// .groupName(processListReqDTO.getName())
|
.groupName(processListReqDTO.getName())
|
||||||
// .build();// 查模块id,柜体id,加工组id
|
.build();// 查模块id,柜体id,加工组id
|
||||||
// orderProcessStepItemDOS.add(orderProcessStepItemDO);
|
orderProcessStepItemDOS.add(orderProcessStepItemDO);
|
||||||
// });
|
});
|
||||||
// 批量插入
|
// 批量插入
|
||||||
orderProcessMapper.insert(orderProcess);
|
orderProcessMapper.insert(orderProcess);
|
||||||
// processStepMapper.insertBatch(processStepDOS);
|
processStepMapper.insertBatch(processStepDOS);
|
||||||
// processStepItemMapper.insertBatch(orderProcessStepItemDOS);
|
processStepItemMapper.insertBatch(orderProcessStepItemDOS);
|
||||||
// 返回
|
// 返回
|
||||||
return orderProcess.getId();
|
return orderProcess.getId();
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -22,19 +22,19 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
|||||||
|
|
||||||
default PageResult<PlateDO> selectPage(PlatePageReqVO reqVO) {
|
default PageResult<PlateDO> selectPage(PlatePageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<PlateDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<PlateDO>()
|
||||||
|
.eqIfPresent(PlateDO::getOrganId, reqVO.getOrganId())
|
||||||
.eqIfPresent(PlateDO::getGoodsId, reqVO.getGoodsId())
|
.eqIfPresent(PlateDO::getGoodsId, reqVO.getGoodsId())
|
||||||
.likeIfPresent(PlateDO::getGoodsName, reqVO.getGoodsName())
|
.likeIfPresent(PlateDO::getGoodsName, reqVO.getGoodsName())
|
||||||
.eqIfPresent(PlateDO::getMaterial, reqVO.getMaterial())
|
.likeIfPresent(PlateDO::getMaterial, reqVO.getMaterial())
|
||||||
.eqIfPresent(PlateDO::getColor, reqVO.getColor())
|
.likeIfPresent(PlateDO::getColor, reqVO.getColor())
|
||||||
.eqIfPresent(PlateDO::getWidth, reqVO.getWidth())
|
.eqIfPresent(PlateDO::getWidth, reqVO.getWidth())
|
||||||
.eqIfPresent(PlateDO::getHeight, reqVO.getHeight())
|
.eqIfPresent(PlateDO::getHeight, reqVO.getHeight())
|
||||||
.eqIfPresent(PlateDO::getThickness, reqVO.getThickness())
|
.eqIfPresent(PlateDO::getThickness, reqVO.getThickness())
|
||||||
.eqIfPresent(PlateDO::getOrganId, reqVO.getOrganId())
|
.likeIfPresent(PlateDO::getBrand, reqVO.getBrand())
|
||||||
.eqIfPresent(PlateDO::getBrand, reqVO.getBrand())
|
.likeIfPresent(PlateDO::getSpec, reqVO.getSpec())
|
||||||
.eqIfPresent(PlateDO::getSpec, reqVO.getSpec())
|
.likeIfPresent(PlateDO::getRemark, reqVO.getRemark())
|
||||||
.eqIfPresent(PlateDO::getRemark, reqVO.getRemark())
|
|
||||||
.eqIfPresent(PlateDO::getPrice, reqVO.getPrice())
|
.eqIfPresent(PlateDO::getPrice, reqVO.getPrice())
|
||||||
.eqIfPresent(PlateDO::getOrganId, reqVO.getOrganId())
|
.likeIfPresent(PlateDO::getTexture, reqVO.getTexture())
|
||||||
.betweenIfPresent(PlateDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(PlateDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(PlateDO::getId));
|
.orderByDesc(PlateDO::getId));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -179,7 +179,7 @@ public interface ErrorCodeConstants {
|
|||||||
|
|
||||||
//=========== 工序信息 1-002-028-000 ============
|
//=========== 工序信息 1-002-028-000 ============
|
||||||
ErrorCode PROCESS_NOT_EXISTS = new ErrorCode(1_002_028_000, "工序不存在");
|
ErrorCode PROCESS_NOT_EXISTS = new ErrorCode(1_002_028_000, "工序不存在");
|
||||||
ErrorCode PROCESS_IS_ENABLED = new ErrorCode(1_002_028_000, "工序以启用,禁止关闭");
|
ErrorCode PROCESS_IS_ENABLED = new ErrorCode(1_002_028_000, "工序已在工序组中启用,禁止关闭");
|
||||||
ErrorCode PROCESS_ID_IS_NULL = new ErrorCode(1_002_028_000, "工序ID填写错误不存在");
|
ErrorCode PROCESS_ID_IS_NULL = new ErrorCode(1_002_028_000, "工序ID填写错误不存在");
|
||||||
ErrorCode PROCESS_STATUS_DISABLE = new ErrorCode(1_002_028_000, "工序状态以已禁用");
|
ErrorCode PROCESS_STATUS_DISABLE = new ErrorCode(1_002_028_000, "工序状态以已禁用");
|
||||||
|
|
||||||
|
|||||||
+8
-1
@@ -12,6 +12,9 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
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.module.system.enums.ErrorCodeConstants.PROCESS_GROUP_NOT_EXISTS;
|
import static com.cf.imes.module.system.enums.ErrorCodeConstants.PROCESS_GROUP_NOT_EXISTS;
|
||||||
|
|
||||||
@@ -34,13 +37,17 @@ public class ProcessGroupApiImpl implements ProcessGroupApi {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProcessListReqDTO getProcessGroupDetail(Long groupId) {
|
public ProcessListReqDTO getProcessGroupDetail(Long groupId) {
|
||||||
|
|
||||||
ProcessGroupDO processGroupDO = processGroupMapper.selectById(groupId);
|
ProcessGroupDO processGroupDO = processGroupMapper.selectById(groupId);
|
||||||
|
|
||||||
if (processGroupDO == null)
|
if (processGroupDO == null)
|
||||||
throw exception(PROCESS_GROUP_NOT_EXISTS);
|
throw exception(PROCESS_GROUP_NOT_EXISTS);
|
||||||
String[] items = processGroupDO.getItems().split(",");
|
String[] items = processGroupDO.getItems().split(",");
|
||||||
ProcessListReqDTO processListReqDTO = BeanUtils.toBean(processGroupDO, ProcessListReqDTO.class);
|
List<ProcessRespDTO> lists = new ArrayList<>();
|
||||||
|
ProcessListReqDTO processListReqDTO = BeanUtils.toBean(processGroupDO, ProcessListReqDTO.class).setLists(lists);
|
||||||
for (String item : items) {
|
for (String item : items) {
|
||||||
ProcessDO processDO = processMapper.selectById(Long.parseLong(item));
|
ProcessDO processDO = processMapper.selectById(Long.parseLong(item));
|
||||||
|
|
||||||
processListReqDTO.getLists().add(BeanUtils.toBean(processDO, ProcessRespDTO.class));
|
processListReqDTO.getLists().add(BeanUtils.toBean(processDO, ProcessRespDTO.class));
|
||||||
}
|
}
|
||||||
return processListReqDTO;
|
return processListReqDTO;
|
||||||
|
|||||||
+3
-3
@@ -33,18 +33,18 @@ public interface ProcessMapper extends BaseMapperX<ProcessDO> {
|
|||||||
.eqIfPresent(ProcessDO::getOrganId, reqVO.getOrganId())
|
.eqIfPresent(ProcessDO::getOrganId, reqVO.getOrganId())
|
||||||
.eqIfPresent(ProcessDO::getIsEnabled, reqVO.getIsEnabled())
|
.eqIfPresent(ProcessDO::getIsEnabled, reqVO.getIsEnabled())
|
||||||
.betweenIfPresent(ProcessDO::getPrepareTime, reqVO.getPrepareTime())
|
.betweenIfPresent(ProcessDO::getPrepareTime, reqVO.getPrepareTime())
|
||||||
.eqIfPresent(ProcessDO::getDescription, reqVO.getDescription())
|
.likeIfPresent(ProcessDO::getDescription, reqVO.getDescription())
|
||||||
.betweenIfPresent(ProcessDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(ProcessDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(ProcessDO::getId));
|
.orderByDesc(ProcessDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
IPage<ProcessDO> selectProcessPage(@Param("page") IPage<ProcessDO> page , @Param("page") ProcessPageReqVO reqVO);
|
IPage<ProcessDO> selectProcessPage(@Param("page") IPage<ProcessDO> page , @Param("vo") ProcessPageReqVO reqVO);
|
||||||
|
|
||||||
ProcessDO selectOneById(@Param("id") Long id, @Param("organId") Long organId);
|
ProcessDO selectOneById(@Param("id") Long id, @Param("organId") Long organId);
|
||||||
|
|
||||||
default List<ProcessDO> selectAll(Long organId) {
|
default List<ProcessDO> selectAll(Long organId) {
|
||||||
return selectList(new LambdaQueryWrapperX<ProcessDO>()
|
return selectList(new LambdaQueryWrapperX<ProcessDO>()
|
||||||
.orderByDesc(ProcessDO::getId)
|
// .orderByDesc(ProcessDO::getId)
|
||||||
.eqIfPresent(ProcessDO::getOrganId, organId)
|
.eqIfPresent(ProcessDO::getOrganId, organId)
|
||||||
.eqIfPresent(ProcessDO::getIsEnabled, true));
|
.eqIfPresent(ProcessDO::getIsEnabled, true));
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -83,7 +83,7 @@ public class ProcessGroupServiceImpl implements ProcessGroupService {
|
|||||||
// 校验存在
|
// 校验存在
|
||||||
validateProcessGroupExists(id);
|
validateProcessGroupExists(id);
|
||||||
// 判断是否在生产中使用这个加工组,如果使用则不能删除
|
// 判断是否在生产中使用这个加工组,如果使用则不能删除
|
||||||
// checkProcessGroupUsed(id);
|
checkProcessGroupUsed(id);
|
||||||
// 删除
|
// 删除
|
||||||
processGroupMapper.deleteById(id);
|
processGroupMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-8
@@ -24,6 +24,7 @@ import com.cf.imes.framework.common.util.object.BeanUtils;
|
|||||||
import com.cf.imes.module.system.dal.mysql.process.ProcessMapper;
|
import com.cf.imes.module.system.dal.mysql.process.ProcessMapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
|
||||||
@@ -87,7 +88,7 @@ public class ProcessServiceImpl implements ProcessService {
|
|||||||
public void updateProcess(ProcessUserSaveReqVO updateReqVO) {
|
public void updateProcess(ProcessUserSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateProcessExists(updateReqVO.getId());
|
validateProcessExists(updateReqVO.getId());
|
||||||
if (updateReqVO.getIsEnabled()) {//为禁用
|
if (!updateReqVO.getIsEnabled()) {//调为禁用
|
||||||
if (isProcessUsed(String.valueOf(updateReqVO.getId()))){
|
if (isProcessUsed(String.valueOf(updateReqVO.getId()))){
|
||||||
throw exception(PROCESS_IS_ENABLED);
|
throw exception(PROCESS_IS_ENABLED);
|
||||||
}
|
}
|
||||||
@@ -117,14 +118,14 @@ public class ProcessServiceImpl implements ProcessService {
|
|||||||
}
|
}
|
||||||
processMapper.updateById(updateProcess);
|
processMapper.updateById(updateProcess);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断此工序是否已在工序组中使用
|
// 判断此工序是否已在工序组中使用
|
||||||
public boolean isProcessUsed(String items) {
|
public boolean isProcessUsed(String items) {
|
||||||
System.out.println("processGroupMapper.selectListByItems(items) " + processGroupMapper.selectListByItems(items));
|
// System.out.println("processGroupMapper.selectListByItems(items) " + processGroupMapper.selectListByItems(items));
|
||||||
System.out.println(processGroupMapper.selectListByItems(items) != null);
|
// System.out.println(processGroupMapper.selectListByItems(items).size());
|
||||||
System.out.println(processGroupMapper.selectListByItems(items).size());
|
if (processGroupMapper.selectListByItems(items).size() == 0) // 没有使用
|
||||||
if (processGroupMapper.selectListByItems(items) != null)
|
|
||||||
return true;
|
|
||||||
return false;
|
return false;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -169,13 +170,13 @@ public class ProcessServiceImpl implements ProcessService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<ProcessDO> getProcessPage(ProcessPageReqVO pageReqVO) {//分页加用户
|
public PageResult<ProcessDO> getProcessPage(ProcessPageReqVO pageReqVO) {//分页加用户
|
||||||
return processMapper.selectPage(pageReqVO);
|
return processMapper.selectPage(pageReqVO.setOrganId(OrganContextHolder.getOrganId()).setIsDealer(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<ProcessRespVO> getProcessPageAll(ProcessPageReqVO pageReqVO) {
|
public PageResult<ProcessRespVO> getProcessPageAll(ProcessPageReqVO pageReqVO) {
|
||||||
PageDTO<ProcessDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
PageDTO<ProcessDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||||
IPage<ProcessDO> processRespVOPageResult = processMapper.selectProcessPage(page,BeanUtils.toBean(pageReqVO, ProcessPageReqVO.class));
|
IPage<ProcessDO> processRespVOPageResult = processMapper.selectProcessPage(page,BeanUtils.toBean(pageReqVO, ProcessPageReqVO.class).setOrganId(OrganContextHolder.getOrganId()));
|
||||||
return new PageResult<ProcessRespVO>(BeanUtils.toBean(processRespVOPageResult.getRecords(), ProcessRespVO.class), processRespVOPageResult.getTotal());
|
return new PageResult<ProcessRespVO>(BeanUtils.toBean(processRespVOPageResult.getRecords(), ProcessRespVO.class), processRespVOPageResult.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -24,21 +24,21 @@
|
|||||||
p.deleted
|
p.deleted
|
||||||
from process p
|
from process p
|
||||||
<where>
|
<where>
|
||||||
p.deleted = 0
|
p.deleted = 0 and p.organ_id = #{vo.organId}
|
||||||
<if test="page.userId != null and page.userId != '' ">
|
<if test="vo.userId != null and vo.userId != '' ">
|
||||||
and p.id in (select process_id from process_user where user_id = #{page.userId})
|
and p.id in (select process_id from process_user where user_id = #{vo.userId})
|
||||||
</if>
|
</if>
|
||||||
<if test="page.name != null and page.name != '' ">
|
<if test="vo.name != null and vo.name != '' ">
|
||||||
and p.name like concat('%', #{page.name}, '%')
|
and p.name like concat('%', #{vo.name}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="page.isEnabled != null">
|
<if test="vo.isEnabled != null">
|
||||||
and p.is_enabled = #{page.isEnabled}
|
and p.is_enabled = #{vo.isEnabled}
|
||||||
</if>
|
</if>
|
||||||
<if test="page.type != null">
|
<if test="vo.type != null">
|
||||||
and p.type = #{page.type}
|
and p.type = #{vo.type}
|
||||||
</if>
|
</if>
|
||||||
<if test="page.pieceType != null">
|
<if test="vo.pieceType != null">
|
||||||
and p.piece_type = #{page.pieceType}
|
and p.piece_type = #{vo.pieceType}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user