工序1.0
parent
26ce694217
commit
7bbdd00a61
@ -1,19 +1,27 @@
|
||||
package com.op.file.service;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
*
|
||||
* @author OP
|
||||
*/
|
||||
public interface ISysFileService {
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
*
|
||||
* @param file 上传的文件
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
public String uploadFile(MultipartFile file) throws Exception;
|
||||
|
||||
public InputStream searchGridFs(String id);
|
||||
|
||||
// public String imageUpload(MultipartFile file) throws Exception;
|
||||
|
||||
public byte[] imageOnline(String imageId);
|
||||
}
|
||||
|
@ -0,0 +1,109 @@
|
||||
package com.op.file.service;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.bson.types.ObjectId;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.data.mongodb.MongoDatabaseFactory;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.data.mongodb.gridfs.GridFsResource;
|
||||
import org.springframework.data.mongodb.gridfs.GridFsTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.mongodb.client.MongoDatabase;
|
||||
import com.mongodb.client.gridfs.GridFSBucket;
|
||||
import com.mongodb.client.gridfs.GridFSBuckets;
|
||||
import com.mongodb.client.gridfs.model.GridFSFile;
|
||||
|
||||
@Primary
|
||||
@Service
|
||||
public class MongoFileImpl implements ISysFileService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MongoFileImpl.class);
|
||||
|
||||
/**
|
||||
* 域名或本机访问地址
|
||||
*/
|
||||
@Value("${mongo.domain}")
|
||||
public String domain;
|
||||
@Autowired
|
||||
private GridFsTemplate gridFsTemplate;
|
||||
@Autowired
|
||||
private MongoTemplate mongoTemplate;
|
||||
|
||||
@Override
|
||||
public InputStream searchGridFs(String id) {
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
Query query = Query.query(Criteria.where("_id").is(id));
|
||||
GridFSFile gridFSDBFile = gridFsTemplate.findOne(query);
|
||||
GridFsResource gridFsResource = new GridFsResource(gridFSDBFile,
|
||||
defaultGridFsBucket().openDownloadStream(gridFSDBFile.getObjectId()));
|
||||
inputStream = gridFsResource.getInputStream();
|
||||
} catch (Exception e) {
|
||||
log.error("Mongo searchGridFs error", e);
|
||||
} finally {
|
||||
}
|
||||
return inputStream;
|
||||
}
|
||||
|
||||
private GridFSBucket defaultGridFsBucket() {
|
||||
// 通过mongoTemplate来获取默认的数据库连接
|
||||
MongoDatabaseFactory mongoDatabaseFactory = mongoTemplate.getMongoDatabaseFactory();
|
||||
MongoDatabase db = mongoDatabaseFactory.getMongoDatabase("op_cloud");
|
||||
// 创建GridFSBucket 并指定文件系统使用的bucket
|
||||
return GridFSBuckets.create(db);
|
||||
}
|
||||
|
||||
// 转byte[]
|
||||
public static byte[] toByteArray(InputStream input) throws IOException {
|
||||
ByteArrayOutputStream output = new ByteArrayOutputStream();
|
||||
byte[] buffer = new byte[4096];
|
||||
int n = 0;
|
||||
while (-1 != (n = input.read(buffer))) {
|
||||
output.write(buffer, 0, n);
|
||||
}
|
||||
return output.toByteArray();
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private MongoService mongoService;
|
||||
|
||||
/**
|
||||
* 图片上传
|
||||
*
|
||||
* @param file
|
||||
* @param userId
|
||||
* @param fsgisOneMapMacroAnalysis
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String uploadFile(MultipartFile file) throws Exception {
|
||||
String fileName = file.getOriginalFilename();
|
||||
String id = this.mongoService.uploadFile(file, fileName);
|
||||
String url = domain + "/online?id=" + id;
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片预览
|
||||
*
|
||||
* @param imageid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public byte[] imageOnline(String id) {
|
||||
return this.mongoService.downloadImageByte(id);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package com.op.mes.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
import com.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.mes.domain.ProProcessContent;
|
||||
import com.op.mes.service.IProProcessContentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
|
||||
|
||||
/**
|
||||
* 生产工序内容Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pro/processcontent")
|
||||
public class ProProcessContentController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IProProcessContentService proProcessContentService;
|
||||
|
||||
/**
|
||||
* 查询生产工序内容列表
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:processcontent:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProProcessContent proProcessContent)
|
||||
{
|
||||
startPage();
|
||||
List<ProProcessContent> list = proProcessContentService.selectProProcessContentList(proProcessContent);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产工序内容列表
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:processcontent:export")
|
||||
@Log(title = "生产工序内容", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProProcessContent proProcessContent)
|
||||
{
|
||||
List<ProProcessContent> list = proProcessContentService.selectProProcessContentList(proProcessContent);
|
||||
ExcelUtil<ProProcessContent> util = new ExcelUtil<ProProcessContent>(ProProcessContent.class);
|
||||
util.exportExcel(response, list, "生产工序内容数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产工序内容详细信息
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:processcontent:query")
|
||||
@GetMapping(value = "/{contentId}")
|
||||
public AjaxResult getInfo(@PathVariable("contentId") String contentId)
|
||||
{
|
||||
return AjaxResult.success(proProcessContentService.selectProProcessContentByContentId(contentId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产工序内容
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:processcontent:add")
|
||||
@Log(title = "生产工序内容", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProProcessContent proProcessContent)
|
||||
{
|
||||
return toAjax(proProcessContentService.insertProProcessContent(proProcessContent));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产工序内容
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:processcontent:edit")
|
||||
@Log(title = "生产工序内容", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProProcessContent proProcessContent)
|
||||
{
|
||||
return toAjax(proProcessContentService.updateProProcessContent(proProcessContent));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产工序内容
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:processcontent:remove")
|
||||
@Log(title = "生产工序内容", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{contentIds}")
|
||||
public AjaxResult remove(@PathVariable String[] contentIds)
|
||||
{
|
||||
return toAjax(proProcessContentService.deleteProProcessContentByContentIds(contentIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
package com.op.mes.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.op.common.core.constant.UserConstants;
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
import com.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.mes.domain.ProProcess;
|
||||
import com.op.mes.service.IProProcessService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
/**
|
||||
* 生产工序Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pro/process")
|
||||
public class ProProcessController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IProProcessService proProcessService;
|
||||
|
||||
/**
|
||||
* 查询生产工序列表
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:process:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProProcess proProcess)
|
||||
{
|
||||
startPage();
|
||||
List<ProProcess> list = proProcessService.selectProProcessList(proProcess);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有可用工序的清单
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:process:list")
|
||||
@GetMapping("/listAll")
|
||||
public AjaxResult listAll(){
|
||||
ProProcess process = new ProProcess();
|
||||
process.setEnableFlag("Y");
|
||||
List<ProProcess> list =proProcessService.selectProProcessList(process);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产工序列表
|
||||
*/
|
||||
@RequiresPermissions("@ss.hasPermi('mes:pro:process:export')")
|
||||
@Log(title = "生产工序", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProProcess proProcess)
|
||||
{
|
||||
List<ProProcess> list = proProcessService.selectProProcessList(proProcess);
|
||||
ExcelUtil<ProProcess> util = new ExcelUtil<ProProcess>(ProProcess.class);
|
||||
util.exportExcel(response, list, "生产工序数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产工序详细信息
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:process:query")
|
||||
@GetMapping(value = "/{processId}")
|
||||
public AjaxResult getInfo(@PathVariable("processId") String processId)
|
||||
{
|
||||
return AjaxResult.success(proProcessService.selectProProcessByProcessId(processId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产工序
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:process:add")
|
||||
@Log(title = "生产工序", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProProcess proProcess)
|
||||
{
|
||||
if(!proProcessService.checkProcessCodeUnique(proProcess)){
|
||||
return AjaxResult.error("工序编码已存在!");
|
||||
}
|
||||
if(!proProcessService.checkProcessNameUnique(proProcess)){
|
||||
return AjaxResult.error("工序名称已存在!");
|
||||
}
|
||||
return toAjax(proProcessService.insertProProcess(proProcess));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产工序
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:process:edit")
|
||||
@Log(title = "生产工序", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProProcess proProcess)
|
||||
{
|
||||
if(proProcessService.checkProcessCodeUnique(proProcess)){
|
||||
return AjaxResult.error("工序编码已存在!");
|
||||
}
|
||||
if(proProcessService.checkProcessNameUnique(proProcess)){
|
||||
return AjaxResult.error("工序名称已存在!");
|
||||
}
|
||||
return toAjax(proProcessService.updateProProcess(proProcess));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产工序
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:process:remove")
|
||||
@Log(title = "生产工序", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{processIds}")
|
||||
public AjaxResult remove(@PathVariable String[] processIds)
|
||||
{
|
||||
return toAjax(proProcessService.deleteProProcessByProcessIds(processIds));
|
||||
}
|
||||
}
|
@ -1,127 +0,0 @@
|
||||
package com.op.mes.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.op.common.core.domain.R;
|
||||
import com.op.common.core.utils.StringUtils;
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
import com.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.InnerAuth;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.common.security.utils.SecurityUtils;
|
||||
import com.op.system.api.domain.SysDept;
|
||||
import com.op.system.api.domain.SysRole;
|
||||
import com.op.system.api.domain.SysUser;
|
||||
import com.op.system.api.model.LoginUser;
|
||||
import com.op.mes.service.ISysUserService;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
* @author OP
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class SysUserController extends BaseController {
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@RequiresPermissions("system:user:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysUser user) {
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("system:user:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysUser user) {
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
util.exportExcel(response, list, "用户数据");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
util.importTemplateExcel(response, "用户数据");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增用户
|
||||
*/
|
||||
@RequiresPermissions("system:user:add")
|
||||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody SysUser user) {
|
||||
if (!userService.checkUserNameUnique(user)) {
|
||||
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||
} else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) {
|
||||
return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
} else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
|
||||
return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setCreateBy(SecurityUtils.getUsername());
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
return toAjax(userService.insertUser(user));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@RequiresPermissions("system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/resetPwd")
|
||||
public AjaxResult resetPwd(@RequestBody SysUser user) {
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
user.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(userService.resetPwd(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
@RequiresPermissions("system:user:edit")
|
||||
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody SysUser user) {
|
||||
userService.checkUserAllowed(user);
|
||||
userService.checkUserDataScope(user.getUserId());
|
||||
user.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(userService.updateUserStatus(user));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
package com.op.mes.domain;
|
||||
|
||||
import com.op.common.core.annotation.Excel;
|
||||
import com.op.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
|
||||
/**
|
||||
* 生产工序对象 pro_process
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
public class ProProcess extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 工序ID */
|
||||
private String processId;
|
||||
|
||||
/** 工序编码 */
|
||||
@Excel(name = "工序编码")
|
||||
private String processCode;
|
||||
|
||||
/** 工序名称 */
|
||||
@Excel(name = "工序名称")
|
||||
private String processName;
|
||||
|
||||
/** 工艺要求 */
|
||||
@Excel(name = "工艺要求")
|
||||
private String attention;
|
||||
|
||||
/** 是否启用 */
|
||||
@Excel(name = "是否启用")
|
||||
private String enableFlag;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setProcessId(String processId)
|
||||
{
|
||||
this.processId = processId;
|
||||
}
|
||||
|
||||
public String getProcessId()
|
||||
{
|
||||
return processId;
|
||||
}
|
||||
public void setProcessCode(String processCode)
|
||||
{
|
||||
this.processCode = processCode;
|
||||
}
|
||||
|
||||
public String getProcessCode()
|
||||
{
|
||||
return processCode;
|
||||
}
|
||||
public void setProcessName(String processName)
|
||||
{
|
||||
this.processName = processName;
|
||||
}
|
||||
|
||||
public String getProcessName()
|
||||
{
|
||||
return processName;
|
||||
}
|
||||
public void setAttention(String attention)
|
||||
{
|
||||
this.attention = attention;
|
||||
}
|
||||
|
||||
public String getAttention()
|
||||
{
|
||||
return attention;
|
||||
}
|
||||
public void setEnableFlag(String enableFlag)
|
||||
{
|
||||
this.enableFlag = enableFlag;
|
||||
}
|
||||
|
||||
public String getEnableFlag()
|
||||
{
|
||||
return enableFlag;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("processId", getProcessId())
|
||||
.append("processCode", getProcessCode())
|
||||
.append("processName", getProcessName())
|
||||
.append("attention", getAttention())
|
||||
.append("enableFlag", getEnableFlag())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,178 @@
|
||||
package com.op.mes.domain;
|
||||
|
||||
import com.op.common.core.annotation.Excel;
|
||||
import com.op.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 生产工序内容对象 pro_process_content
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
public class ProProcessContent extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 内容ID */
|
||||
private String contentId;
|
||||
|
||||
/** 工序ID */
|
||||
@Excel(name = "工序ID")
|
||||
private String processId;
|
||||
|
||||
/** 顺序编号 */
|
||||
@Excel(name = "顺序编号")
|
||||
private Integer orderNum;
|
||||
|
||||
/** 内容说明 */
|
||||
@Excel(name = "内容说明")
|
||||
private String contentText;
|
||||
|
||||
/** 辅助设备 */
|
||||
@Excel(name = "辅助设备")
|
||||
private String device;
|
||||
|
||||
/** 辅助材料 */
|
||||
@Excel(name = "辅助材料")
|
||||
private String material;
|
||||
|
||||
/** 材料URL */
|
||||
@Excel(name = "材料URL")
|
||||
private String docUrl;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setContentId(String contentId)
|
||||
{
|
||||
this.contentId = contentId;
|
||||
}
|
||||
|
||||
public String getContentId()
|
||||
{
|
||||
return contentId;
|
||||
}
|
||||
public void setProcessId(String processId)
|
||||
{
|
||||
this.processId = processId;
|
||||
}
|
||||
|
||||
public String getProcessId()
|
||||
{
|
||||
return processId;
|
||||
}
|
||||
public void setOrderNum(Integer orderNum)
|
||||
{
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public Integer getOrderNum()
|
||||
{
|
||||
return orderNum;
|
||||
}
|
||||
public void setContentText(String contentText)
|
||||
{
|
||||
this.contentText = contentText;
|
||||
}
|
||||
|
||||
public String getContentText()
|
||||
{
|
||||
return contentText;
|
||||
}
|
||||
public void setDevice(String device)
|
||||
{
|
||||
this.device = device;
|
||||
}
|
||||
|
||||
public String getDevice()
|
||||
{
|
||||
return device;
|
||||
}
|
||||
public void setMaterial(String material)
|
||||
{
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
public String getMaterial()
|
||||
{
|
||||
return material;
|
||||
}
|
||||
public void setDocUrl(String docUrl)
|
||||
{
|
||||
this.docUrl = docUrl;
|
||||
}
|
||||
|
||||
public String getDocUrl()
|
||||
{
|
||||
return docUrl;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("contentId", getContentId())
|
||||
.append("processId", getProcessId())
|
||||
.append("orderNum", getOrderNum())
|
||||
.append("contentText", getContentText())
|
||||
.append("device", getDevice())
|
||||
.append("material", getMaterial())
|
||||
.append("docUrl", getDocUrl())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.op.mes.mapper;
|
||||
|
||||
import com.op.mes.domain.ProProcessContent;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 生产工序内容Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProProcessContentMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产工序内容
|
||||
*
|
||||
* @param contentId 生产工序内容主键
|
||||
* @return 生产工序内容
|
||||
*/
|
||||
public ProProcessContent selectProProcessContentByContentId(String contentId);
|
||||
|
||||
/**
|
||||
* 查询生产工序内容列表
|
||||
*
|
||||
* @param proProcessContent 生产工序内容
|
||||
* @return 生产工序内容集合
|
||||
*/
|
||||
public List<ProProcessContent> selectProProcessContentList(ProProcessContent proProcessContent);
|
||||
|
||||
/**
|
||||
* 新增生产工序内容
|
||||
*
|
||||
* @param proProcessContent 生产工序内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProProcessContent(ProProcessContent proProcessContent);
|
||||
|
||||
/**
|
||||
* 修改生产工序内容
|
||||
*
|
||||
* @param proProcessContent 生产工序内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProProcessContent(ProProcessContent proProcessContent);
|
||||
|
||||
/**
|
||||
* 删除生产工序内容
|
||||
*
|
||||
* @param contentId 生产工序内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProProcessContentByContentId(String contentId);
|
||||
|
||||
/**
|
||||
* 批量删除生产工序内容
|
||||
*
|
||||
* @param contentIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProProcessContentByContentIds(String[] contentIds);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.op.mes.mapper;
|
||||
|
||||
import com.op.mes.domain.ProProcess;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 生产工序Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-11
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProProcessMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产工序
|
||||
*
|
||||
* @param processId 生产工序主键
|
||||
* @return 生产工序
|
||||
*/
|
||||
public ProProcess selectProProcessByProcessId(String processId);
|
||||
|
||||
/**
|
||||
* 查询生产工序列表
|
||||
*
|
||||
* @param proProcess 生产工序
|
||||
* @return 生产工序集合
|
||||
*/
|
||||
public List<ProProcess> selectProProcessList(ProProcess proProcess);
|
||||
|
||||
public ProProcess checkProcessCodeUnique(ProProcess proProcess);
|
||||
public ProProcess checkProcessNameUnique(ProProcess proProcess);
|
||||
|
||||
|
||||
/**
|
||||
* 新增生产工序
|
||||
*
|
||||
* @param proProcess 生产工序
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProProcess(ProProcess proProcess);
|
||||
|
||||
/**
|
||||
* 修改生产工序
|
||||
*
|
||||
* @param proProcess 生产工序
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProProcess(ProProcess proProcess);
|
||||
|
||||
/**
|
||||
* 删除生产工序
|
||||
*
|
||||
* @param processId 生产工序主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProProcessByProcessId(String processId);
|
||||
|
||||
/**
|
||||
* 批量删除生产工序
|
||||
*
|
||||
* @param processIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProProcessByProcessIds(String[] processIds);
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.op.mes.service;
|
||||
|
||||
import com.op.mes.domain.ProProcessContent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 生产工序内容Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
public interface IProProcessContentService
|
||||
{
|
||||
/**
|
||||
* 查询生产工序内容
|
||||
*
|
||||
* @param contentId 生产工序内容主键
|
||||
* @return 生产工序内容
|
||||
*/
|
||||
public ProProcessContent selectProProcessContentByContentId(String contentId);
|
||||
|
||||
/**
|
||||
* 查询生产工序内容列表
|
||||
*
|
||||
* @param proProcessContent 生产工序内容
|
||||
* @return 生产工序内容集合
|
||||
*/
|
||||
public List<ProProcessContent> selectProProcessContentList(ProProcessContent proProcessContent);
|
||||
|
||||
/**
|
||||
* 新增生产工序内容
|
||||
*
|
||||
* @param proProcessContent 生产工序内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProProcessContent(ProProcessContent proProcessContent);
|
||||
|
||||
/**
|
||||
* 修改生产工序内容
|
||||
*
|
||||
* @param proProcessContent 生产工序内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProProcessContent(ProProcessContent proProcessContent);
|
||||
|
||||
/**
|
||||
* 批量删除生产工序内容
|
||||
*
|
||||
* @param contentIds 需要删除的生产工序内容主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProProcessContentByContentIds(String[] contentIds);
|
||||
|
||||
/**
|
||||
* 删除生产工序内容信息
|
||||
*
|
||||
* @param contentId 生产工序内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProProcessContentByContentId(String contentId);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.op.mes.service;
|
||||
|
||||
import com.op.mes.domain.ProProcess;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产工序Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-11
|
||||
*/
|
||||
public interface IProProcessService
|
||||
{
|
||||
/**
|
||||
* 查询生产工序
|
||||
*
|
||||
* @param processId 生产工序主键
|
||||
* @return 生产工序
|
||||
*/
|
||||
public ProProcess selectProProcessByProcessId(String processId);
|
||||
|
||||
/**
|
||||
* 查询生产工序列表
|
||||
*
|
||||
* @param proProcess 生产工序
|
||||
* @return 生产工序集合
|
||||
*/
|
||||
public List<ProProcess> selectProProcessList(ProProcess proProcess);
|
||||
|
||||
public Boolean checkProcessCodeUnique(ProProcess proProcess);
|
||||
public Boolean checkProcessNameUnique(ProProcess proProcess);
|
||||
|
||||
/**
|
||||
* 新增生产工序
|
||||
*
|
||||
* @param proProcess 生产工序
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProProcess(ProProcess proProcess);
|
||||
|
||||
/**
|
||||
* 修改生产工序
|
||||
*
|
||||
* @param proProcess 生产工序
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProProcess(ProProcess proProcess);
|
||||
|
||||
/**
|
||||
* 批量删除生产工序
|
||||
*
|
||||
* @param processIds 需要删除的生产工序主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProProcessByProcessIds(String[] processIds);
|
||||
|
||||
/**
|
||||
* 删除生产工序信息
|
||||
*
|
||||
* @param processId 生产工序主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProProcessByProcessId(String processId);
|
||||
}
|
@ -1,149 +0,0 @@
|
||||
package com.op.mes.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.op.system.api.domain.SysUser;
|
||||
|
||||
/**
|
||||
* 用户 业务层
|
||||
*
|
||||
* @author OP
|
||||
*/
|
||||
public interface ISysUserService {
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
public List<SysUser> selectUserList(SysUser user);
|
||||
|
||||
/**
|
||||
* 根据条件分页查询已分配用户角色列表
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
public List<SysUser> selectAllocatedList(SysUser user);
|
||||
|
||||
/**
|
||||
* 根据条件分页查询未分配用户角色列表
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
public List<SysUser> selectUnallocatedList(SysUser user);
|
||||
|
||||
/**
|
||||
* 通过用户名查询用户
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
public SysUser selectUserByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
public SysUser selectUserById(Long userId);
|
||||
|
||||
/**
|
||||
* 校验用户名称是否唯一
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean checkUserNameUnique(SysUser user);
|
||||
|
||||
/**
|
||||
* 校验手机号码是否唯一
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean checkPhoneUnique(SysUser user);
|
||||
|
||||
/**
|
||||
* 校验email是否唯一
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean checkEmailUnique(SysUser user);
|
||||
|
||||
/**
|
||||
* 校验用户是否允许操作
|
||||
*
|
||||
* @param user 用户信息
|
||||
*/
|
||||
public void checkUserAllowed(SysUser user);
|
||||
|
||||
/**
|
||||
* 校验用户是否有数据权限
|
||||
*
|
||||
* @param userId 用户id
|
||||
*/
|
||||
public void checkUserDataScope(Long userId);
|
||||
|
||||
/**
|
||||
* 新增用户信息
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUser(SysUser user);
|
||||
|
||||
/**
|
||||
* 注册用户信息
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean registerUser(SysUser user);
|
||||
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserStatus(SysUser user);
|
||||
|
||||
/**
|
||||
* 修改用户基本信息
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserProfile(SysUser user);
|
||||
|
||||
/**
|
||||
* 修改用户头像
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @param avatar 头像地址
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean updateUserAvatar(String userName, String avatar);
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int resetPwd(SysUser user);
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @param password 密码
|
||||
* @return 结果
|
||||
*/
|
||||
public int resetUserPwd(String userName, String password);
|
||||
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package com.op.mes.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import com.op.common.core.utils.uuid.IdUtils;
|
||||
import com.op.mes.domain.ProProcessContent;
|
||||
import com.op.mes.mapper.ProProcessContentMapper;
|
||||
import com.op.mes.service.IProProcessContentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 生产工序内容Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
@Service
|
||||
public class ProProcessContentServiceImpl implements IProProcessContentService
|
||||
{
|
||||
@Autowired
|
||||
private ProProcessContentMapper proProcessContentMapper;
|
||||
|
||||
/**
|
||||
* 查询生产工序内容
|
||||
*
|
||||
* @param contentId 生产工序内容主键
|
||||
* @return 生产工序内容
|
||||
*/
|
||||
@Override
|
||||
public ProProcessContent selectProProcessContentByContentId(String contentId)
|
||||
{
|
||||
return proProcessContentMapper.selectProProcessContentByContentId(contentId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产工序内容列表
|
||||
*
|
||||
* @param proProcessContent 生产工序内容
|
||||
* @return 生产工序内容
|
||||
*/
|
||||
@Override
|
||||
public List<ProProcessContent> selectProProcessContentList(ProProcessContent proProcessContent)
|
||||
{
|
||||
return proProcessContentMapper.selectProProcessContentList(proProcessContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产工序内容
|
||||
*
|
||||
* @param proProcessContent 生产工序内容
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProProcessContent(ProProcessContent proProcessContent)
|
||||
{
|
||||
proProcessContent.setCreateTime(DateUtils.getNowDate());
|
||||
proProcessContent.setContentId(IdUtils.fastSimpleUUID());
|
||||
return proProcessContentMapper.insertProProcessContent(proProcessContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产工序内容
|
||||
*
|
||||
* @param proProcessContent 生产工序内容
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProProcessContent(ProProcessContent proProcessContent)
|
||||
{
|
||||
proProcessContent.setUpdateTime(DateUtils.getNowDate());
|
||||
return proProcessContentMapper.updateProProcessContent(proProcessContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产工序内容
|
||||
*
|
||||
* @param contentIds 需要删除的生产工序内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProProcessContentByContentIds(String[] contentIds)
|
||||
{
|
||||
return proProcessContentMapper.deleteProProcessContentByContentIds(contentIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产工序内容信息
|
||||
*
|
||||
* @param contentId 生产工序内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProProcessContentByContentId(String contentId)
|
||||
{
|
||||
return proProcessContentMapper.deleteProProcessContentByContentId(contentId);
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package com.op.mes.service.impl;
|
||||
|
||||
import com.op.common.core.constant.UserConstants;
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import com.op.common.core.utils.StringUtils;
|
||||
import com.op.common.core.utils.uuid.IdUtils;
|
||||
import com.op.mes.domain.ProProcess;
|
||||
import com.op.mes.mapper.ProProcessMapper;
|
||||
import com.op.mes.service.IProProcessService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产工序Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-11
|
||||
*/
|
||||
@Service
|
||||
public class ProProcessServiceImpl implements IProProcessService
|
||||
{
|
||||
@Autowired
|
||||
private ProProcessMapper proProcessMapper;
|
||||
|
||||
/**
|
||||
* 查询生产工序
|
||||
*
|
||||
* @param processId 生产工序主键
|
||||
* @return 生产工序
|
||||
*/
|
||||
@Override
|
||||
public ProProcess selectProProcessByProcessId(String processId)
|
||||
{
|
||||
return proProcessMapper.selectProProcessByProcessId(processId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产工序列表
|
||||
*
|
||||
* @param proProcess 生产工序
|
||||
* @return 生产工序
|
||||
*/
|
||||
@Override
|
||||
public List<ProProcess> selectProProcessList(ProProcess proProcess)
|
||||
{
|
||||
return proProcessMapper.selectProProcessList(proProcess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查工序编码是否唯一
|
||||
* @param proProcess
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean checkProcessCodeUnique(ProProcess proProcess) {
|
||||
ProProcess process = proProcessMapper.checkProcessCodeUnique(proProcess);
|
||||
if(StringUtils.isNotNull(process) && process.getProcessId().equals(proProcess.getProcessId())){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查工序名称是否唯一
|
||||
* @param proProcess
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean checkProcessNameUnique(ProProcess proProcess) {
|
||||
ProProcess process = proProcessMapper.checkProcessNameUnique(proProcess);
|
||||
|
||||
if(StringUtils.isNotNull(process) && process.getProcessId().equals(proProcess.getProcessId())){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产工序
|
||||
*
|
||||
* @param proProcess 生产工序
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProProcess(ProProcess proProcess)
|
||||
{
|
||||
proProcess.setProcessId(IdUtils.fastSimpleUUID());
|
||||
proProcess.setCreateTime(DateUtils.getNowDate());
|
||||
return proProcessMapper.insertProProcess(proProcess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产工序
|
||||
*
|
||||
* @param proProcess 生产工序
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProProcess(ProProcess proProcess)
|
||||
{
|
||||
proProcess.setUpdateTime(DateUtils.getNowDate());
|
||||
return proProcessMapper.updateProProcess(proProcess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产工序
|
||||
*
|
||||
* @param processIds 需要删除的生产工序主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProProcessByProcessIds(String[] processIds)
|
||||
{
|
||||
return proProcessMapper.deleteProProcessByProcessIds(processIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产工序信息
|
||||
*
|
||||
* @param processId 生产工序主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProProcessByProcessId(String processId)
|
||||
{
|
||||
return proProcessMapper.deleteProProcessByProcessId(processId);
|
||||
}
|
||||
}
|
@ -1,262 +0,0 @@
|
||||
package com.op.mes.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.validation.Validator;
|
||||
|
||||
import com.op.mes.service.ISysUserService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import com.op.common.core.constant.UserConstants;
|
||||
import com.op.common.core.exception.ServiceException;
|
||||
import com.op.common.core.utils.SpringUtils;
|
||||
import com.op.common.core.utils.StringUtils;
|
||||
import com.op.common.core.utils.bean.BeanValidators;
|
||||
import com.op.common.datascope.annotation.DataScope;
|
||||
import com.op.common.security.utils.SecurityUtils;
|
||||
import com.op.system.api.domain.SysRole;
|
||||
import com.op.system.api.domain.SysUser;
|
||||
import com.op.mes.mapper.SysUserMapper;
|
||||
|
||||
/**
|
||||
* 用户 业务层处理
|
||||
*
|
||||
* @author OP
|
||||
*/
|
||||
@Service
|
||||
public class SysUserServiceImpl implements ISysUserService {
|
||||
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private SysUserMapper userMapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
protected Validator validator;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "d", userAlias = "u")
|
||||
public List<SysUser> selectUserList(SysUser user) {
|
||||
return userMapper.selectUserList(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件分页查询已分配用户角色列表
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "d", userAlias = "u")
|
||||
public List<SysUser> selectAllocatedList(SysUser user) {
|
||||
return userMapper.selectAllocatedList(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件分页查询未分配用户角色列表
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 用户信息集合信息
|
||||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "d", userAlias = "u")
|
||||
public List<SysUser> selectUnallocatedList(SysUser user) {
|
||||
return userMapper.selectUnallocatedList(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户名查询用户
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
@Override
|
||||
public SysUser selectUserByUserName(String userName) {
|
||||
return userMapper.selectUserByUserName(userName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
@Override
|
||||
public SysUser selectUserById(Long userId) {
|
||||
return userMapper.selectUserById(userId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验用户名称是否唯一
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean checkUserNameUnique(SysUser user) {
|
||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||
SysUser info = userMapper.checkUserNameUnique(user.getUserName());
|
||||
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验手机号码是否唯一
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean checkPhoneUnique(SysUser user) {
|
||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||
SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
|
||||
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验email是否唯一
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean checkEmailUnique(SysUser user) {
|
||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||
SysUser info = userMapper.checkEmailUnique(user.getEmail());
|
||||
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验用户是否允许操作
|
||||
*
|
||||
* @param user 用户信息
|
||||
*/
|
||||
@Override
|
||||
public void checkUserAllowed(SysUser user) {
|
||||
if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) {
|
||||
throw new ServiceException("不允许操作超级管理员用户");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验用户是否有数据权限
|
||||
*
|
||||
* @param userId 用户id
|
||||
*/
|
||||
@Override
|
||||
public void checkUserDataScope(Long userId) {
|
||||
if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
|
||||
SysUser user = new SysUser();
|
||||
user.setUserId(userId);
|
||||
List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user);
|
||||
if (StringUtils.isEmpty(users)) {
|
||||
throw new ServiceException("没有权限访问用户数据!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存用户信息
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertUser(SysUser user) {
|
||||
// 新增用户信息
|
||||
int rows = userMapper.insertUser(user);
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册用户信息
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean registerUser(SysUser user) {
|
||||
return userMapper.insertUser(user) > 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改用户状态
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUserStatus(SysUser user) {
|
||||
return userMapper.updateUser(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户基本信息
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUserProfile(SysUser user) {
|
||||
return userMapper.updateUser(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户头像
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @param avatar 头像地址
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean updateUserAvatar(String userName, String avatar) {
|
||||
return userMapper.updateUserAvatar(userName, avatar) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int resetPwd(SysUser user) {
|
||||
return userMapper.updateUser(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @param password 密码
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int resetUserPwd(String userName, String password) {
|
||||
return userMapper.resetUserPwd(userName, password);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
<?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.op.mes.mapper.ProProcessContentMapper">
|
||||
|
||||
<resultMap type="ProProcessContent" id="ProProcessContentResult">
|
||||
<result property="contentId" column="content_id" />
|
||||
<result property="processId" column="process_id" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="contentText" column="content_text" />
|
||||
<result property="device" column="device" />
|
||||
<result property="material" column="material" />
|
||||
<result property="docUrl" column="doc_url" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProProcessContentVo">
|
||||
select content_id, process_id, order_num, content_text, device, material, doc_url, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_process_content
|
||||
</sql>
|
||||
|
||||
<select id="selectProProcessContentList" parameterType="ProProcessContent" resultMap="ProProcessContentResult">
|
||||
<include refid="selectProProcessContentVo"/>
|
||||
<where>
|
||||
<if test="processId != null "> and process_id = #{processId}</if>
|
||||
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
||||
<if test="contentText != null and contentText != ''"> and content_text = #{contentText}</if>
|
||||
<if test="device != null and device != ''"> and device = #{device}</if>
|
||||
<if test="material != null and material != ''"> and material = #{material}</if>
|
||||
<if test="docUrl != null and docUrl != ''"> and doc_url = #{docUrl}</if>
|
||||
</where>
|
||||
order by order_num asc
|
||||
</select>
|
||||
|
||||
<select id="selectProProcessContentByContentId" parameterType="String" resultMap="ProProcessContentResult">
|
||||
<include refid="selectProProcessContentVo"/>
|
||||
where content_id = #{contentId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProProcessContent" parameterType="ProProcessContent" useGeneratedKeys="true" keyProperty="contentId">
|
||||
insert into pro_process_content
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
content_id,
|
||||
<if test="processId != null">process_id,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="contentText != null">content_text,</if>
|
||||
<if test="device != null">device,</if>
|
||||
<if test="material != null">material,</if>
|
||||
<if test="docUrl != null">doc_url,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#{contentId},
|
||||
<if test="processId != null">#{processId},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="contentText != null">#{contentText},</if>
|
||||
<if test="device != null">#{device},</if>
|
||||
<if test="material != null">#{material},</if>
|
||||
<if test="docUrl != null">#{docUrl},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProProcessContent" parameterType="ProProcessContent">
|
||||
update pro_process_content
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="processId != null">process_id = #{processId},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="contentText != null">content_text = #{contentText},</if>
|
||||
<if test="device != null">device = #{device},</if>
|
||||
<if test="material != null">material = #{material},</if>
|
||||
<if test="docUrl != null">doc_url = #{docUrl},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where content_id = #{contentId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProProcessContentByContentId" parameterType="String">
|
||||
delete from pro_process_content where content_id = #{contentId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProProcessContentByContentIds" parameterType="String">
|
||||
delete from pro_process_content where content_id in
|
||||
<foreach item="contentId" collection="array" open="(" separator="," close=")">
|
||||
#{contentId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,124 @@
|
||||
<?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.op.mes.mapper.ProProcessMapper">
|
||||
|
||||
<resultMap type="ProProcess" id="ProProcessResult">
|
||||
<result property="processId" column="process_id" />
|
||||
<result property="processCode" column="process_code" />
|
||||
<result property="processName" column="process_name" />
|
||||
<result property="attention" column="attention" />
|
||||
<result property="enableFlag" column="enable_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProProcessVo">
|
||||
select process_id, process_code, process_name, attention, enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_process
|
||||
</sql>
|
||||
|
||||
<select id="selectProProcessList" parameterType="ProProcess" resultMap="ProProcessResult">
|
||||
<include refid="selectProProcessVo"/>
|
||||
<where>
|
||||
<if test="processCode != null and processCode != ''"> and process_code = #{processCode}</if>
|
||||
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
|
||||
<if test="attention != null and attention != ''"> and attention = #{attention}</if>
|
||||
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectProProcessByProcessId" parameterType="String" resultMap="ProProcessResult">
|
||||
<include refid="selectProProcessVo"/>
|
||||
where process_id = #{processId}
|
||||
</select>
|
||||
|
||||
<select id="checkProcessCodeUnique" parameterType="ProProcess" resultMap="ProProcessResult">
|
||||
select top 1 process_id, process_code, process_name, attention, enable_flag,
|
||||
remark, attr1, attr2, attr3, attr4, create_by, create_time,
|
||||
update_by, update_time from pro_process
|
||||
where process_code = #{processCode}
|
||||
</select>
|
||||
|
||||
<select id="checkProcessNameUnique" parameterType="ProProcess" resultMap="ProProcessResult">
|
||||
select top 1 process_id, process_code, process_name, attention, enable_flag,
|
||||
remark, attr1, attr2, attr3, attr4, create_by, create_time,
|
||||
update_by, update_time from pro_process
|
||||
where process_name = #{processName}
|
||||
</select>
|
||||
|
||||
<insert id="insertProProcess" parameterType="ProProcess" useGeneratedKeys="true" keyProperty="processId">
|
||||
insert into pro_process
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
process_id,
|
||||
<if test="processCode != null and processCode != ''">process_code,</if>
|
||||
<if test="processName != null and processName != ''">process_name,</if>
|
||||
<if test="attention != null">attention,</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#{processId},
|
||||
<if test="processCode != null and processCode != ''">#{processCode},</if>
|
||||
<if test="processName != null and processName != ''">#{processName},</if>
|
||||
<if test="attention != null">#{attention},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">#{enableFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProProcess" parameterType="ProProcess">
|
||||
update pro_process
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="processCode != null and processCode != ''">process_code = #{processCode},</if>
|
||||
<if test="processName != null and processName != ''">process_name = #{processName},</if>
|
||||
<if test="attention != null">attention = #{attention},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag = #{enableFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where process_id = #{processId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProProcessByProcessId" parameterType="String">
|
||||
delete from pro_process where process_id = #{processId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProProcessByProcessIds" parameterType="String">
|
||||
delete from pro_process where process_id in
|
||||
<foreach item="processId" collection="array" open="(" separator="," close=")">
|
||||
#{processId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,221 +0,0 @@
|
||||
<?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.op.mes.mapper.SysUserMapper">
|
||||
|
||||
<resultMap type="SysUser" id="SysUserResult">
|
||||
<id property="userId" column="user_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="email" column="email" />
|
||||
<result property="phonenumber" column="phonenumber" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="avatar" column="avatar" />
|
||||
<result property="password" column="password" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="loginIp" column="login_ip" />
|
||||
<result property="loginDate" column="login_date" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="deptResult" type="SysDept">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="leader" column="leader" />
|
||||
<result property="status" column="dept_status" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="RoleResult" type="SysRole">
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
<result property="roleSort" column="role_sort" />
|
||||
<result property="dataScope" column="data_scope" />
|
||||
<result property="status" column="role_status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userId != null and userId != 0">
|
||||
AND u.user_id = #{userId}
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND u.status = #{status}
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
where u.del_flag = '0' and r.role_id = #{roleId}
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
|
||||
and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId})
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_name = #{userName} and u.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select top 1 user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select top 1 user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select top 1 user_id, email from sys_user where email = #{email} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="avatar != null and avatar != ''">avatar,</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
||||
<if test="sex != null and sex != ''">sex,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">#{sex},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
GETDATE()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateUser" parameterType="SysUser">
|
||||
update sys_user
|
||||
<set>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||
<if test="email != null ">email = #{email},</if>
|
||||
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
||||
<if test="loginDate != null">login_date = #{loginDate},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
update_time = GETDATE()
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserStatus" parameterType="SysUser">
|
||||
update sys_user set status = #{status} where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserAvatar" parameterType="SysUser">
|
||||
update sys_user set avatar = #{avatar} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
<update id="resetUserPwd" parameterType="SysUser">
|
||||
update sys_user set password = #{password} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUserById" parameterType="Long">
|
||||
update sys_user set del_flag = '2' where user_id = #{userId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUserByIds" parameterType="Long">
|
||||
update sys_user set del_flag = '2' where user_id in
|
||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue