feat(supplier): 优化供应商列表表格列宽度并完善人员机台配置功能
This commit is contained in:
parent
a7e9b2dab3
commit
4f0cb9ec28
@ -1,13 +1,12 @@
|
|||||||
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.usermachine;
|
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.usermachine;
|
||||||
|
|
||||||
import java.util.*;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
|
||||||
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
||||||
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.usermachine.vo.UserMachinePageReqVO;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.usermachine.UserMachineDO;
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.usermachine.UserMachineDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.usermachine.vo.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员所属机台、班组配置 Mapper
|
* 人员所属机台、班组配置 Mapper
|
||||||
@ -25,4 +24,8 @@ public interface UserMachineMapper extends BaseMapperX<UserMachineDO> {
|
|||||||
.orderByDesc(UserMachineDO::getId));
|
.orderByDesc(UserMachineDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default UserMachineDO selectByUserId(String userId) {
|
||||||
|
return selectOne(new LambdaQueryWrapper<UserMachineDO>()
|
||||||
|
.eq(UserMachineDO::getUserId, userId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -15,6 +15,8 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员所属机台、班组配置 Service 实现类
|
* 人员所属机台、班组配置 Service 实现类
|
||||||
*
|
*
|
||||||
@ -33,6 +35,7 @@ public class UserMachineServiceImpl implements UserMachineService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer createUserMachine(UserMachineSaveReqVO createReqVO) {
|
public Integer createUserMachine(UserMachineSaveReqVO createReqVO) {
|
||||||
|
validateUserMachineUnique(createReqVO);
|
||||||
UserMachineDO userMachine = BeanUtils.toBean(createReqVO, UserMachineDO.class);
|
UserMachineDO userMachine = BeanUtils.toBean(createReqVO, UserMachineDO.class);
|
||||||
userMachineMapper.insert(userMachine);
|
userMachineMapper.insert(userMachine);
|
||||||
|
|
||||||
@ -45,6 +48,7 @@ public class UserMachineServiceImpl implements UserMachineService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateUserMachine(UserMachineSaveReqVO updateReqVO) {
|
public void updateUserMachine(UserMachineSaveReqVO updateReqVO) {
|
||||||
validateUserMachineExists(updateReqVO.getId());
|
validateUserMachineExists(updateReqVO.getId());
|
||||||
|
validateUserMachineUnique(updateReqVO);
|
||||||
|
|
||||||
UserMachineDO updateObj = BeanUtils.toBean(updateReqVO, UserMachineDO.class);
|
UserMachineDO updateObj = BeanUtils.toBean(updateReqVO, UserMachineDO.class);
|
||||||
userMachineMapper.updateById(updateObj);
|
userMachineMapper.updateById(updateObj);
|
||||||
@ -68,10 +72,18 @@ public class UserMachineServiceImpl implements UserMachineService {
|
|||||||
|
|
||||||
private void validateUserMachineExists(Integer id) {
|
private void validateUserMachineExists(Integer id) {
|
||||||
if (userMachineMapper.selectById(id) == null) {
|
if (userMachineMapper.selectById(id) == null) {
|
||||||
// throw exception(USER_MACHINE_NOT_EXISTS);
|
throw exception("人员所属机台、班组配置不存在");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void validateUserMachineUnique(UserMachineSaveReqVO saveReqVO) {
|
||||||
|
UserMachineDO existUserMachine = userMachineMapper.selectByUserId(saveReqVO.getUserId());
|
||||||
|
if (existUserMachine != null && !existUserMachine.getId().equals(saveReqVO.getId())) {
|
||||||
|
throw exception("该人员已配置,请确认!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UserMachineDO getUserMachine(Integer id) {
|
public UserMachineDO getUserMachine(Integer id) {
|
||||||
return userMachineMapper.selectById(id);
|
return userMachineMapper.selectById(id);
|
||||||
|
|||||||
@ -106,17 +106,17 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="联系人1" align="center" prop="contact1" />
|
<el-table-column label="联系人1" align="center" prop="contact1" />
|
||||||
<el-table-column label="联系电话1" align="center" prop="conPhone1" />
|
<el-table-column label="联系电话1" align="center" prop="conPhone1" />
|
||||||
<el-table-column label="供应商状态" align="center" prop="status">
|
<el-table-column label="供应商状态" align="center" prop="status" width="120px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.SUPPLIER_STATUS" :value="scope.row.status" />
|
<dict-tag :type="DICT_TYPE.SUPPLIER_STATUS" :value="scope.row.status" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="启用状态" align="center" prop="enabledStatus">
|
<el-table-column label="启用状态" align="center" prop="enabledStatus" width="120px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.SYSTEM_STATUS" :value="scope.row.enabledStatus" />
|
<dict-tag :type="DICT_TYPE.SYSTEM_STATUS" :value="scope.row.enabledStatus" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="是否黑名单" align="center" prop="isBlacklist">
|
<el-table-column label="是否黑名单" align="center" prop="isBlacklist" width="110px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag :type="scope.row.isBlacklist === 1 ? 'danger' : 'success'">
|
<el-tag :type="scope.row.isBlacklist === 1 ? 'danger' : 'success'">
|
||||||
{{ scope.row.isBlacklist === 1 ? '是' : '否' }}
|
{{ scope.row.isBlacklist === 1 ? '是' : '否' }}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user