mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
bug修改
This commit is contained in:
+2
-1
@@ -211,7 +211,7 @@ public interface ErrorCodeConstants {
|
||||
|
||||
//=========== 板材信息 1-002-034-000 ============
|
||||
ErrorCode PROCESS_USER_NOT_EXISTS = new ErrorCode(1_002_032_002, "工序用户不存在");
|
||||
ErrorCode PROCESS_USER_EXISTS = new ErrorCode(1_002_032_002, "工序用户存在");
|
||||
ErrorCode PROCESS_USER_EXISTS = new ErrorCode(1_002_032_003, "工序用户存在");
|
||||
|
||||
//=========== 板材信息 1-002-035-000 ============
|
||||
ErrorCode RAW_GOODS_NOT_EXISTS = new ErrorCode(1_002_033_001, "设计板材不存再");
|
||||
@@ -230,4 +230,5 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode APPLICATION_NOT_EXISTS = new ErrorCode(1_002_037_001, "应用信息不存在");
|
||||
ErrorCode APPLICATION_LOGIN_USER_DISABLED = new ErrorCode(1_002_037_001, "应用登陆失败");
|
||||
|
||||
ErrorCode ERR = new ErrorCode(1_002_038_001, "未知错误");
|
||||
}
|
||||
|
||||
+2
@@ -30,4 +30,6 @@ public interface ProcessGroupMapper extends BaseMapperX<ProcessGroupDO> {
|
||||
}
|
||||
|
||||
ProcessDO selectOneById(@Param("id") Long id, @Param("organId") Long organId);
|
||||
|
||||
int updateIsDefault(@Param("processGroupId") Long processGroupId, @Param("organId") Long organId);
|
||||
}
|
||||
+6
@@ -31,6 +31,12 @@ public interface ProcessUserMapper extends BaseMapperX<ProcessUserDO> {
|
||||
.eq(ProcessUserDO::getProcessId, processId));
|
||||
}
|
||||
|
||||
default List<ProcessUserDO> selectById(Long processId,Long userId) {
|
||||
return selectList(new LambdaQueryWrapperX<ProcessUserDO>()
|
||||
.eq(ProcessUserDO::getProcessId, processId)
|
||||
.eq(ProcessUserDO::getUserId, userId));
|
||||
}
|
||||
|
||||
default ProcessUserDO selectUserByProcessId(Long processId) {
|
||||
return selectOne(ProcessUserDO::getProcessId, processId);
|
||||
}
|
||||
|
||||
+12
@@ -51,6 +51,9 @@ public class ProcessGroupServiceImpl implements ProcessGroupService {
|
||||
ProcessGroupDO processGroup = BeanUtils.toBean(createReqVO, ProcessGroupDO.class);
|
||||
processGroup.setItems(checkProcessGroupExists(createReqVO.getItems()));
|
||||
processGroupMapper.insert(processGroup);
|
||||
if (createReqVO.getIsDefault()) {
|
||||
processGroupMapper.updateIsDefault(processGroup.getId(), OrganContextHolder.getOrganId());
|
||||
}
|
||||
// 返回
|
||||
return processGroup.getId();
|
||||
}
|
||||
@@ -63,6 +66,9 @@ public class ProcessGroupServiceImpl implements ProcessGroupService {
|
||||
ProcessGroupDO updateObj = BeanUtils.toBean(updateReqVO, ProcessGroupDO.class);
|
||||
updateObj.setItems(checkProcessGroupExists(updateReqVO.getItems()));
|
||||
processGroupMapper.updateById(updateObj);
|
||||
if (updateReqVO.getIsDefault()) {
|
||||
processGroupMapper.updateIsDefault(updateReqVO.getId(), OrganContextHolder.getOrganId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -152,4 +158,10 @@ public class ProcessGroupServiceImpl implements ProcessGroupService {
|
||||
// 返回格式化的列表字符串
|
||||
return itemsBuilder.length() > 0 ? itemsBuilder.toString() : "[]";
|
||||
}
|
||||
|
||||
// 批量更新工序组默认
|
||||
public void updateProcessGroupIsDefault(Long processGroupId, Long organId) {
|
||||
processGroupMapper.updateIsDefault(processGroupId, organId);
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -69,7 +69,7 @@ public class ProcessServiceImpl implements ProcessService {
|
||||
processAndUserSaveReqVO.setUserId(Long.parseLong(user));
|
||||
processUserService.createProcessUser(processAndUserSaveReqVO);
|
||||
}catch (Exception e){
|
||||
throw ServiceExceptionUtil.exception(ErrorCodeConstants.USER_NOT_EXISTS);
|
||||
throw ServiceExceptionUtil.exception(ErrorCodeConstants.ERR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-3
@@ -1,6 +1,5 @@
|
||||
package com.cf.imes.module.system.service.process;
|
||||
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
import com.cf.imes.module.system.controller.admin.process.vo.processUser.ProcessAndUserSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
@@ -14,6 +13,7 @@ import com.cf.imes.module.system.dal.mysql.process.ProcessUserMapper;
|
||||
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_USER_EXISTS;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.PROCESS_USER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
@@ -30,8 +30,9 @@ public class ProcessUserServiceImpl implements ProcessUserService {
|
||||
|
||||
@Override
|
||||
public Long createProcessUser(ProcessAndUserSaveReqVO createReqVO) {
|
||||
if (processUserMapper.selectByProcessId(createReqVO.getProcessId()).size() != 0) {
|
||||
throw exception(PROCESS_USER_NOT_EXISTS);
|
||||
// 判断是否有
|
||||
if (processUserMapper.selectById(createReqVO.getProcessId(), createReqVO.getUserId()).size() != 0) {
|
||||
throw exception(PROCESS_USER_EXISTS);
|
||||
}
|
||||
// 插入
|
||||
ProcessUserDO processUser = BeanUtils.toBean(createReqVO, ProcessUserDO.class);
|
||||
|
||||
+3
@@ -20,4 +20,7 @@
|
||||
where p.id = #{id} and p.organ_id = #{organId} and p.deleted = 0
|
||||
</select>
|
||||
|
||||
<update id="updateIsDefault" >
|
||||
UPDATE process_group SET is_default = 0 WHERE organ_id = #{organId} AND id != #{processGroupId}
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user