mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 05:12:07 +08:00
bug修改
This commit is contained in:
+1
-1
@@ -179,7 +179,7 @@ public interface ErrorCodeConstants {
|
||||
|
||||
//=========== 工序信息 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_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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.PROCESS_GROUP_NOT_EXISTS;
|
||||
|
||||
@@ -34,13 +37,17 @@ public class ProcessGroupApiImpl implements ProcessGroupApi {
|
||||
|
||||
@Override
|
||||
public ProcessListReqDTO getProcessGroupDetail(Long groupId) {
|
||||
|
||||
ProcessGroupDO processGroupDO = processGroupMapper.selectById(groupId);
|
||||
|
||||
if (processGroupDO == null)
|
||||
throw exception(PROCESS_GROUP_NOT_EXISTS);
|
||||
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) {
|
||||
ProcessDO processDO = processMapper.selectById(Long.parseLong(item));
|
||||
|
||||
processListReqDTO.getLists().add(BeanUtils.toBean(processDO, ProcessRespDTO.class));
|
||||
}
|
||||
return processListReqDTO;
|
||||
|
||||
+3
-3
@@ -33,18 +33,18 @@ public interface ProcessMapper extends BaseMapperX<ProcessDO> {
|
||||
.eqIfPresent(ProcessDO::getOrganId, reqVO.getOrganId())
|
||||
.eqIfPresent(ProcessDO::getIsEnabled, reqVO.getIsEnabled())
|
||||
.betweenIfPresent(ProcessDO::getPrepareTime, reqVO.getPrepareTime())
|
||||
.eqIfPresent(ProcessDO::getDescription, reqVO.getDescription())
|
||||
.likeIfPresent(ProcessDO::getDescription, reqVO.getDescription())
|
||||
.betweenIfPresent(ProcessDO::getCreateTime, reqVO.getCreateTime())
|
||||
.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);
|
||||
|
||||
default List<ProcessDO> selectAll(Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<ProcessDO>()
|
||||
.orderByDesc(ProcessDO::getId)
|
||||
// .orderByDesc(ProcessDO::getId)
|
||||
.eqIfPresent(ProcessDO::getOrganId, organId)
|
||||
.eqIfPresent(ProcessDO::getIsEnabled, true));
|
||||
}
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ public class ProcessGroupServiceImpl implements ProcessGroupService {
|
||||
// 校验存在
|
||||
validateProcessGroupExists(id);
|
||||
// 判断是否在生产中使用这个加工组,如果使用则不能删除
|
||||
// checkProcessGroupUsed(id);
|
||||
checkProcessGroupUsed(id);
|
||||
// 删除
|
||||
processGroupMapper.deleteById(id);
|
||||
}
|
||||
|
||||
+10
-9
@@ -24,6 +24,7 @@ import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.module.system.dal.mysql.process.ProcessMapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
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) {
|
||||
// 校验存在
|
||||
validateProcessExists(updateReqVO.getId());
|
||||
if (updateReqVO.getIsEnabled()) {//为禁用
|
||||
if (!updateReqVO.getIsEnabled()) {//调为禁用
|
||||
if (isProcessUsed(String.valueOf(updateReqVO.getId()))){
|
||||
throw exception(PROCESS_IS_ENABLED);
|
||||
}
|
||||
@@ -117,14 +118,14 @@ public class ProcessServiceImpl implements ProcessService {
|
||||
}
|
||||
processMapper.updateById(updateProcess);
|
||||
}
|
||||
|
||||
// 判断此工序是否已在工序组中使用
|
||||
public boolean isProcessUsed(String items) {
|
||||
System.out.println("processGroupMapper.selectListByItems(items) " + processGroupMapper.selectListByItems(items));
|
||||
System.out.println(processGroupMapper.selectListByItems(items) != null);
|
||||
System.out.println(processGroupMapper.selectListByItems(items).size());
|
||||
if (processGroupMapper.selectListByItems(items) != null)
|
||||
return true;
|
||||
return false;
|
||||
// System.out.println("processGroupMapper.selectListByItems(items) " + processGroupMapper.selectListByItems(items));
|
||||
// System.out.println(processGroupMapper.selectListByItems(items).size());
|
||||
if (processGroupMapper.selectListByItems(items).size() == 0) // 没有使用
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -169,13 +170,13 @@ public class ProcessServiceImpl implements ProcessService {
|
||||
|
||||
@Override
|
||||
public PageResult<ProcessDO> getProcessPage(ProcessPageReqVO pageReqVO) {//分页加用户
|
||||
return processMapper.selectPage(pageReqVO);
|
||||
return processMapper.selectPage(pageReqVO.setOrganId(OrganContextHolder.getOrganId()).setIsDealer(false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProcessRespVO> getProcessPageAll(ProcessPageReqVO pageReqVO) {
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -24,21 +24,21 @@
|
||||
p.deleted
|
||||
from process p
|
||||
<where>
|
||||
p.deleted = 0
|
||||
<if test="page.userId != null and page.userId != '' ">
|
||||
and p.id in (select process_id from process_user where user_id = #{page.userId})
|
||||
p.deleted = 0 and p.organ_id = #{vo.organId}
|
||||
<if test="vo.userId != null and vo.userId != '' ">
|
||||
and p.id in (select process_id from process_user where user_id = #{vo.userId})
|
||||
</if>
|
||||
<if test="page.name != null and page.name != '' ">
|
||||
and p.name like concat('%', #{page.name}, '%')
|
||||
<if test="vo.name != null and vo.name != '' ">
|
||||
and p.name like concat('%', #{vo.name}, '%')
|
||||
</if>
|
||||
<if test="page.isEnabled != null">
|
||||
and p.is_enabled = #{page.isEnabled}
|
||||
<if test="vo.isEnabled != null">
|
||||
and p.is_enabled = #{vo.isEnabled}
|
||||
</if>
|
||||
<if test="page.type != null">
|
||||
and p.type = #{page.type}
|
||||
<if test="vo.type != null">
|
||||
and p.type = #{vo.type}
|
||||
</if>
|
||||
<if test="page.pieceType != null">
|
||||
and p.piece_type = #{page.pieceType}
|
||||
<if test="vo.pieceType != null">
|
||||
and p.piece_type = #{vo.pieceType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user