工单变更
parent
d6e17541a9
commit
fb0a2ab614
@ -1,3 +1,4 @@
|
||||
com.op.system.api.factory.RemoteUserFallbackFactory
|
||||
com.op.system.api.factory.RemoteLogFallbackFactory
|
||||
com.op.system.api.factory.RemoteFileFallbackFactory
|
||||
com.op.system.api.factory.RemoteMesFallbackFactory
|
||||
|
@ -0,0 +1,91 @@
|
||||
package com.op.mes.controller;
|
||||
|
||||
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.mes.domain.ProRecipeContent;
|
||||
import com.op.mes.service.IProRecipeContentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 配药配方管理内容Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pro/recipecontent")
|
||||
public class ProRecipeContentController extends BaseController {
|
||||
@Autowired
|
||||
private IProRecipeContentService proRecipeContentService;
|
||||
|
||||
/**
|
||||
* 查询配药配方管理内容列表
|
||||
*/
|
||||
//@RequiresPermissions("mes:pro:recipecontent:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProRecipeContent proRecipeContent) {
|
||||
startPage();
|
||||
List<ProRecipeContent> list = proRecipeContentService.selectProRecipeContentList(proRecipeContent);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配药配方管理内容列表
|
||||
*/
|
||||
//@RequiresPermissions("mes:pro:recipecontent:export")
|
||||
@Log(title = "配药配方管理内容", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProRecipeContent proRecipeContent) {
|
||||
List<ProRecipeContent> list = proRecipeContentService.selectProRecipeContentList(proRecipeContent);
|
||||
ExcelUtil<ProRecipeContent> util = new ExcelUtil<ProRecipeContent>(ProRecipeContent.class);
|
||||
util.exportExcel(response, list, "配药配方管理内容数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配药配方管理内容详细信息
|
||||
*/
|
||||
//@RequiresPermissions("mes:pro:recipecontent:query")
|
||||
@GetMapping(value = "/{contentId}")
|
||||
public AjaxResult getInfo(@PathVariable("contentId") String contentId) {
|
||||
return AjaxResult.success(proRecipeContentService.selectProRecipeContentByContentId(contentId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配药配方管理内容
|
||||
*/
|
||||
//@RequiresPermissions("mes:pro:recipecontent:add")
|
||||
@Log(title = "配药配方管理内容", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProRecipeContent proRecipeContent) {
|
||||
return toAjax(proRecipeContentService.insertProRecipeContent(proRecipeContent));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配药配方管理内容
|
||||
*/
|
||||
//@RequiresPermissions("mes:pro:recipecontent:edit")
|
||||
@Log(title = "配药配方管理内容", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProRecipeContent proRecipeContent) {
|
||||
return toAjax(proRecipeContentService.updateProRecipeContent(proRecipeContent));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配药配方管理内容
|
||||
*/
|
||||
//@RequiresPermissions("mes:pro:recipecontent:remove")
|
||||
@Log(title = "配药配方管理内容", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{contentIds}")
|
||||
public AjaxResult remove(@PathVariable String[] contentIds) {
|
||||
return toAjax(proRecipeContentService.deleteProRecipeContentByContentIds(contentIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package com.op.mes.controller;
|
||||
|
||||
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.ProRecipe;
|
||||
import com.op.mes.service.IProRecipeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 配药配方Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pro/recipe")
|
||||
public class ProRecipeController extends BaseController {
|
||||
@Autowired
|
||||
private IProRecipeService proRecipeService;
|
||||
|
||||
/**
|
||||
* 查询配药配方列表
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:recipe:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProRecipe proRecipe) {
|
||||
startPage();
|
||||
List<ProRecipe> list = proRecipeService.selectProRecipeList(proRecipe);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有可用配方的清单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:recipe:list")
|
||||
@GetMapping("/listAll")
|
||||
public AjaxResult listAll() {
|
||||
ProRecipe recipe = new ProRecipe();
|
||||
recipe.setEnableFlag("Y");
|
||||
List<ProRecipe> list = proRecipeService.selectProRecipeList(recipe);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出配药配方列表
|
||||
*/
|
||||
@RequiresPermissions("@ss.hasPermi('mes:pro:recipe:export')")
|
||||
@Log(title = "配药配方", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProRecipe proRecipe) {
|
||||
List<ProRecipe> list = proRecipeService.selectProRecipeList(proRecipe);
|
||||
ExcelUtil<ProRecipe> util = new ExcelUtil<ProRecipe>(ProRecipe.class);
|
||||
util.exportExcel(response, list, "配药配方数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配药配方详细信息
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:recipe:query")
|
||||
@GetMapping(value = "/{recipeId}")
|
||||
public AjaxResult getInfo(@PathVariable("recipeId") String recipeId) {
|
||||
return AjaxResult.success(proRecipeService.selectProRecipeByRecipeId(recipeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增配药配方
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:recipe:add")
|
||||
@Log(title = "配药配方", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProRecipe proRecipe) {
|
||||
if (!proRecipeService.checkRecipeCodeUnique(proRecipe)) {
|
||||
return AjaxResult.error("配方编码已存在!");
|
||||
}
|
||||
if (!proRecipeService.checkRecipeNameUnique(proRecipe)) {
|
||||
return AjaxResult.error("配方名称已存在!");
|
||||
}
|
||||
return toAjax(proRecipeService.insertProRecipe(proRecipe));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配药配方
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:recipe:edit")
|
||||
@Log(title = "配药配方", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProRecipe proRecipe) {
|
||||
if (!proRecipeService.checkRecipeCodeUnique(proRecipe)) {
|
||||
return AjaxResult.error("配方编码已存在!");
|
||||
}
|
||||
if (!proRecipeService.checkRecipeNameUnique(proRecipe)) {
|
||||
return AjaxResult.error("配方名称已存在!");
|
||||
}
|
||||
return toAjax(proRecipeService.updateProRecipe(proRecipe));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配药配方
|
||||
*/
|
||||
@RequiresPermissions("mes:pro:recipe:remove")
|
||||
@Log(title = "配药配方", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recipeIds}")
|
||||
public AjaxResult remove(@PathVariable String[] recipeIds) {
|
||||
return toAjax(proRecipeService.deleteProRecipeByRecipeIds(recipeIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.op.mes.mapper;
|
||||
|
||||
import com.op.mes.domain.ProRecipeContent;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 配药配方内容Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProRecipeContentMapper
|
||||
{
|
||||
/**
|
||||
* 查询配药配方内容
|
||||
*
|
||||
* @param contentId 配药配方内容主键
|
||||
* @return 配药配方内容
|
||||
*/
|
||||
public ProRecipeContent selectProRecipeContentByContentId(String contentId);
|
||||
|
||||
/**
|
||||
* 查询配药配方内容列表
|
||||
*
|
||||
* @param proRecipeContent 配药配方内容
|
||||
* @return 配药配方内容集合
|
||||
*/
|
||||
public List<ProRecipeContent> selectProRecipeContentList(ProRecipeContent proRecipeContent);
|
||||
|
||||
/**
|
||||
* 新增配药配方内容
|
||||
*
|
||||
* @param proRecipeContent 配药配方内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProRecipeContent(ProRecipeContent proRecipeContent);
|
||||
|
||||
/**
|
||||
* 修改配药配方内容
|
||||
*
|
||||
* @param proRecipeContent 配药配方内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProRecipeContent(ProRecipeContent proRecipeContent);
|
||||
|
||||
/**
|
||||
* 删除配药配方内容
|
||||
*
|
||||
* @param contentId 配药配方内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProRecipeContentByContentId(String contentId);
|
||||
|
||||
/**
|
||||
* 批量删除配药配方内容
|
||||
*
|
||||
* @param contentIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProRecipeContentByContentIds(String[] contentIds);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.op.mes.mapper;
|
||||
|
||||
import com.op.mes.domain.ProRecipe;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 配药配方管理Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-11
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProRecipeMapper
|
||||
{
|
||||
/**
|
||||
* 查询配药配方管理
|
||||
*
|
||||
* @param processId 配药配方管理主键
|
||||
* @return 配药配方管理
|
||||
*/
|
||||
public ProRecipe selectProRecipeByRecipeId(String processId);
|
||||
|
||||
/**
|
||||
* 查询配药配方管理列表
|
||||
*
|
||||
* @param proRecipe 配药配方管理
|
||||
* @return 配药配方管理集合
|
||||
*/
|
||||
public List<ProRecipe> selectProRecipeList(ProRecipe proRecipe);
|
||||
|
||||
public ProRecipe checkRecipeCodeUnique(ProRecipe proRecipe);
|
||||
public ProRecipe checkRecipeNameUnique(ProRecipe proRecipe);
|
||||
|
||||
|
||||
/**
|
||||
* 新增配药配方管理
|
||||
*
|
||||
* @param proRecipe 配药配方管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProRecipe(ProRecipe proRecipe);
|
||||
|
||||
/**
|
||||
* 修改配药配方管理
|
||||
*
|
||||
* @param proRecipe 配药配方管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProRecipe(ProRecipe proRecipe);
|
||||
|
||||
/**
|
||||
* 删除配药配方管理
|
||||
*
|
||||
* @param processId 配药配方管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProRecipeByRecipeId(String processId);
|
||||
|
||||
/**
|
||||
* 批量删除配药配方管理
|
||||
*
|
||||
* @param processIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProRecipeByRecipeIds(String[] processIds);
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.op.mes.service;
|
||||
|
||||
import com.op.mes.domain.ProRecipeContent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 配药配方内容Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
public interface IProRecipeContentService
|
||||
{
|
||||
/**
|
||||
* 查询配药配方内容
|
||||
*
|
||||
* @param contentId 配药配方内容主键
|
||||
* @return 配药配方内容
|
||||
*/
|
||||
public ProRecipeContent selectProRecipeContentByContentId(String contentId);
|
||||
|
||||
/**
|
||||
* 查询配药配方内容列表
|
||||
*
|
||||
* @param proRecipeContent 配药配方内容
|
||||
* @return 配药配方内容集合
|
||||
*/
|
||||
public List<ProRecipeContent> selectProRecipeContentList(ProRecipeContent proRecipeContent);
|
||||
|
||||
/**
|
||||
* 新增配药配方内容
|
||||
*
|
||||
* @param proRecipeContent 配药配方内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProRecipeContent(ProRecipeContent proRecipeContent);
|
||||
|
||||
/**
|
||||
* 修改配药配方内容
|
||||
*
|
||||
* @param proRecipeContent 配药配方内容
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProRecipeContent(ProRecipeContent proRecipeContent);
|
||||
|
||||
/**
|
||||
* 批量删除配药配方内容
|
||||
*
|
||||
* @param contentIds 需要删除的配药配方内容主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProRecipeContentByContentIds(String[] contentIds);
|
||||
|
||||
/**
|
||||
* 删除配药配方内容信息
|
||||
*
|
||||
* @param contentId 配药配方内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProRecipeContentByContentId(String contentId);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.op.mes.service;
|
||||
|
||||
import com.op.mes.domain.ProRecipe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配药配方Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-11
|
||||
*/
|
||||
public interface IProRecipeService
|
||||
{
|
||||
/**
|
||||
* 查询配药配方
|
||||
*
|
||||
* @param processId 配药配方主键
|
||||
* @return 配药配方
|
||||
*/
|
||||
public ProRecipe selectProRecipeByRecipeId(String processId);
|
||||
|
||||
/**
|
||||
* 查询配药配方列表
|
||||
*
|
||||
* @param proRecipe 配药配方
|
||||
* @return 配药配方集合
|
||||
*/
|
||||
public List<ProRecipe> selectProRecipeList(ProRecipe proRecipe);
|
||||
|
||||
public Boolean checkRecipeCodeUnique(ProRecipe proRecipe);
|
||||
public Boolean checkRecipeNameUnique(ProRecipe proRecipe);
|
||||
|
||||
/**
|
||||
* 新增配药配方
|
||||
*
|
||||
* @param proRecipe 配药配方
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProRecipe(ProRecipe proRecipe);
|
||||
|
||||
/**
|
||||
* 修改配药配方
|
||||
*
|
||||
* @param proRecipe 配药配方
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProRecipe(ProRecipe proRecipe);
|
||||
|
||||
/**
|
||||
* 批量删除配药配方
|
||||
*
|
||||
* @param processIds 需要删除的配药配方主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProRecipeByRecipeIds(String[] processIds);
|
||||
|
||||
/**
|
||||
* 删除配药配方信息
|
||||
*
|
||||
* @param processId 配药配方主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProRecipeByRecipeId(String processId);
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
package com.op.mes.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import com.op.common.core.utils.uuid.IdUtils;
|
||||
import com.op.mes.domain.ProRecipeContent;
|
||||
import com.op.mes.mapper.ProRecipeContentMapper;
|
||||
import com.op.mes.service.IProRecipeContentService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产工序内容Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
@Service
|
||||
public class ProRecipeContentServiceImpl implements IProRecipeContentService
|
||||
{
|
||||
@Autowired
|
||||
private ProRecipeContentMapper proRecipeContentMapper;
|
||||
|
||||
/**
|
||||
* 查询生产工序内容
|
||||
*
|
||||
* @param contentId 生产工序内容主键
|
||||
* @return 生产工序内容
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public ProRecipeContent selectProRecipeContentByContentId(String contentId)
|
||||
{
|
||||
return proRecipeContentMapper.selectProRecipeContentByContentId(contentId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产工序内容列表
|
||||
*
|
||||
* @param proRecipeContent 生产工序内容
|
||||
* @return 生产工序内容
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<ProRecipeContent> selectProRecipeContentList(ProRecipeContent proRecipeContent)
|
||||
{
|
||||
return proRecipeContentMapper.selectProRecipeContentList(proRecipeContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产工序内容
|
||||
*
|
||||
* @param proRecipeContent 生产工序内容
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertProRecipeContent(ProRecipeContent proRecipeContent)
|
||||
{
|
||||
proRecipeContent.setCreateTime(DateUtils.getNowDate());
|
||||
proRecipeContent.setContentId(IdUtils.fastSimpleUUID());
|
||||
return proRecipeContentMapper.insertProRecipeContent(proRecipeContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产工序内容
|
||||
*
|
||||
* @param proRecipeContent 生产工序内容
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateProRecipeContent(ProRecipeContent proRecipeContent)
|
||||
{
|
||||
proRecipeContent.setUpdateTime(DateUtils.getNowDate());
|
||||
return proRecipeContentMapper.updateProRecipeContent(proRecipeContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产工序内容
|
||||
*
|
||||
* @param contentIds 需要删除的生产工序内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteProRecipeContentByContentIds(String[] contentIds)
|
||||
{
|
||||
return proRecipeContentMapper.deleteProRecipeContentByContentIds(contentIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产工序内容信息
|
||||
*
|
||||
* @param contentId 生产工序内容主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteProRecipeContentByContentId(String contentId)
|
||||
{
|
||||
return proRecipeContentMapper.deleteProRecipeContentByContentId(contentId);
|
||||
}
|
||||
}
|
@ -0,0 +1,189 @@
|
||||
package com.op.mes.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.common.core.constant.UserConstants;
|
||||
import com.op.common.core.domain.BaseFileData;
|
||||
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.common.security.utils.SecurityUtils;
|
||||
import com.op.mes.domain.BaseFile;
|
||||
import com.op.mes.domain.ProRecipe;
|
||||
import com.op.mes.mapper.BaseFileMapper;
|
||||
import com.op.mes.mapper.ProRecipeMapper;
|
||||
import com.op.mes.service.IProRecipeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产工序Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-11
|
||||
*/
|
||||
@Service
|
||||
public class ProRecipeServiceImpl implements IProRecipeService {
|
||||
@Autowired
|
||||
private ProRecipeMapper proRecipeMapper;
|
||||
|
||||
@Autowired
|
||||
private BaseFileMapper baseFileMapper;
|
||||
|
||||
/**
|
||||
* 查询生产工序
|
||||
*
|
||||
* @param processId 生产工序主键
|
||||
* @return 生产工序
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public ProRecipe selectProRecipeByRecipeId(String processId) {
|
||||
ProRecipe p = proRecipeMapper.selectProRecipeByRecipeId(processId);
|
||||
List<BaseFile> files = baseFileMapper.getBaseFileBatch(processId);
|
||||
if (!CollectionUtils.isEmpty(files)) {
|
||||
p.setFiles(files);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产工序列表
|
||||
*
|
||||
* @param proRecipe 生产工序
|
||||
* @return 生产工序
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<ProRecipe> selectProRecipeList(ProRecipe proRecipe) {
|
||||
return proRecipeMapper.selectProRecipeList(proRecipe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查工序编码是否唯一
|
||||
*
|
||||
* @param proRecipe
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public Boolean checkRecipeCodeUnique(ProRecipe proRecipe) {
|
||||
ProRecipe process = proRecipeMapper.checkRecipeCodeUnique(proRecipe);
|
||||
if (StringUtils.isNotNull(process) && !process.getRecipeId().equals(proRecipe.getRecipeId())) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查工序名称是否唯一
|
||||
*
|
||||
* @param proRecipe
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public Boolean checkRecipeNameUnique(ProRecipe proRecipe) {
|
||||
ProRecipe process = proRecipeMapper.checkRecipeNameUnique(proRecipe);
|
||||
|
||||
if (StringUtils.isNotNull(process) && !process.getRecipeId().equals(proRecipe.getRecipeId())) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产工序
|
||||
*
|
||||
* @param proRecipe 生产工序
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertProRecipe(ProRecipe proRecipe) {
|
||||
proRecipe.setRecipeId(IdUtils.fastSimpleUUID());
|
||||
proRecipe.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
//上传附件
|
||||
if (StringUtils.isNotEmpty(proRecipe.getFileList())) {
|
||||
String[] ids = proRecipe.getFileList().split(",");
|
||||
List<BaseFileData> files = new ArrayList<>();
|
||||
BaseFileData file = null;
|
||||
for (String id : ids) {
|
||||
file = new BaseFileData();
|
||||
file.setFileId(IdUtils.fastSimpleUUID());
|
||||
file.setFileName(id.split("&fileName=")[1]);
|
||||
file.setFileAddress(id);
|
||||
file.setSourceId(proRecipe.getRecipeId());
|
||||
file.setCreateBy(SecurityUtils.getUsername());
|
||||
file.setCreateTime(new Date());
|
||||
files.add(file);
|
||||
}
|
||||
baseFileMapper.insertBaseFileBatch(files);
|
||||
}
|
||||
|
||||
return proRecipeMapper.insertProRecipe(proRecipe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产工序
|
||||
*
|
||||
* @param proRecipe 生产工序
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateProRecipe(ProRecipe proRecipe) {
|
||||
|
||||
//上传附件
|
||||
if (StringUtils.isNotEmpty(proRecipe.getFileList())) {
|
||||
baseFileMapper.deleteBaseFileBySourceId(proRecipe.getRecipeId());
|
||||
String[] ids = proRecipe.getFileList().split(",");
|
||||
List<BaseFileData> files = new ArrayList<>();
|
||||
BaseFileData file = null;
|
||||
for (String id : ids) {
|
||||
file = new BaseFileData();
|
||||
file.setFileId(IdUtils.fastSimpleUUID());
|
||||
file.setFileAddress(id);
|
||||
file.setFileName(id.split("&fileName=")[1]);
|
||||
file.setSourceId(proRecipe.getRecipeId());
|
||||
file.setCreateBy(SecurityUtils.getUsername());
|
||||
file.setCreateTime(new Date());
|
||||
files.add(file);
|
||||
}
|
||||
baseFileMapper.insertBaseFileBatch(files);
|
||||
}
|
||||
|
||||
proRecipe.setUpdateTime(DateUtils.getNowDate());
|
||||
return proRecipeMapper.updateProRecipe(proRecipe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产工序
|
||||
*
|
||||
* @param processIds 需要删除的生产工序主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteProRecipeByRecipeIds(String[] processIds) {
|
||||
return proRecipeMapper.deleteProRecipeByRecipeIds(processIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产工序信息
|
||||
*
|
||||
* @param processId 生产工序主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteProRecipeByRecipeId(String processId) {
|
||||
return proRecipeMapper.deleteProRecipeByRecipeId(processId);
|
||||
}
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
<?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.ProRecipeContentMapper">
|
||||
|
||||
<resultMap type="ProRecipeContent" id="ProRecipeContentResult">
|
||||
<result property="contentId" column="content_id" />
|
||||
<result property="recipeId" column="recipe_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="selectProRecipeContentVo">
|
||||
select content_id, recipe_id, order_num, content_text, device, material,
|
||||
doc_url, remark, attr1, attr2, attr3, attr4, create_by,
|
||||
create_time, update_by, update_time
|
||||
from pro_recipe_content
|
||||
</sql>
|
||||
|
||||
<select id="selectProRecipeContentList" parameterType="ProRecipeContent" resultMap="ProRecipeContentResult">
|
||||
<include refid="selectProRecipeContentVo"/>
|
||||
<where>
|
||||
<if test="recipeId != null "> and recipe_id = #{recipeId}</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="selectProRecipeContentByContentId" parameterType="String" resultMap="ProRecipeContentResult">
|
||||
<include refid="selectProRecipeContentVo"/>
|
||||
where content_id = #{contentId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProRecipeContent" parameterType="ProRecipeContent" useGeneratedKeys="true" keyProperty="contentId">
|
||||
insert into pro_recipe_content
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
content_id,
|
||||
<if test="recipeId != null">recipe_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="recipeId != null">#{recipeId},</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="updateProRecipeContent" parameterType="ProRecipeContent">
|
||||
update pro_recipe_content
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="recipeId != null">recipe_id = #{recipeId},</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="deleteProRecipeContentByContentId" parameterType="String">
|
||||
delete from pro_recipe_content where content_id = #{contentId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProRecipeContentByContentIds" parameterType="String">
|
||||
delete from pro_recipe_content where content_id in
|
||||
<foreach item="contentId" collection="array" open="(" separator="," close=")">
|
||||
#{contentId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,146 @@
|
||||
<?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.ProRecipeMapper">
|
||||
|
||||
<resultMap type="ProRecipe" id="ProRecipeResult">
|
||||
<result property="recipeId" column="recipe_id" />
|
||||
<result property="recipeCode" column="recipe_code" />
|
||||
<result property="recipeName" column="recipe_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" />
|
||||
<result property="splitMerge" column="split_merge" />
|
||||
<result property="splitMergNum" column="split_merg_num" />
|
||||
<result property="sync" column="sync"/>
|
||||
<result property="version" column="version"/>
|
||||
<result property="workTime" column="work_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProRecipeVo">
|
||||
select recipe_id, recipe_code, recipe_name, attention,
|
||||
enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time,
|
||||
update_by, update_time,split_merge,split_merg_num,sync,version,work_time
|
||||
from pro_recipe
|
||||
</sql>
|
||||
|
||||
<select id="selectProRecipeList" parameterType="ProRecipe" resultMap="ProRecipeResult">
|
||||
<include refid="selectProRecipeVo"/>
|
||||
<where>
|
||||
<if test="recipeCode != null and recipeCode != ''"> and recipe_code = #{recipeCode}</if>
|
||||
<if test="recipeName != null and recipeName != ''"> and recipe_name like concat('%', #{recipeName}, '%')</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="selectProRecipeByRecipeId" parameterType="String" resultMap="ProRecipeResult">
|
||||
<include refid="selectProRecipeVo"/>
|
||||
where recipe_id = #{recipeId}
|
||||
</select>
|
||||
|
||||
<select id="checkRecipeCodeUnique" parameterType="ProRecipe" resultMap="ProRecipeResult">
|
||||
select top 1 recipe_id, recipe_code, recipe_name, attention, enable_flag,
|
||||
remark, attr1, attr2, attr3, attr4, create_by, create_time,
|
||||
update_by, update_time from pro_recipe
|
||||
where recipe_code = #{recipeCode}
|
||||
</select>
|
||||
|
||||
<select id="checkRecipeNameUnique" parameterType="ProRecipe" resultMap="ProRecipeResult">
|
||||
select top 1 recipe_id, recipe_code, recipe_name, attention, enable_flag,
|
||||
remark, attr1, attr2, attr3, attr4, create_by, create_time,
|
||||
update_by, update_time from pro_recipe
|
||||
where recipe_name = #{recipeName}
|
||||
</select>
|
||||
|
||||
<insert id="insertProRecipe" parameterType="ProRecipe" useGeneratedKeys="true" keyProperty="recipeId">
|
||||
insert into pro_recipe
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
recipe_id,
|
||||
<if test="recipeCode != null and recipeCode != ''">recipe_code,</if>
|
||||
<if test="recipeName != null and recipeName != ''">recipe_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>
|
||||
<if test="splitMerge != null">split_merge,</if>
|
||||
<if test="splitMergNum != null">split_merg_num,</if>
|
||||
<if test="sync != null">sync,</if>
|
||||
<if test="version != null">version,</if>
|
||||
<if test="workTime != null">work_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#{recipeId},
|
||||
<if test="recipeCode != null and recipeCode != ''">#{recipeCode},</if>
|
||||
<if test="recipeName != null and recipeName != ''">#{recipeName},</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>
|
||||
<if test="splitMerge != null">#{splitMerge},</if>
|
||||
<if test="splitMergNum != null">#{splitMergNum},</if>
|
||||
<if test="sync != null">#{sync},</if>
|
||||
<if test="version != null">#{version},</if>
|
||||
<if test="workTime != null">#{workTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateProRecipe" parameterType="ProRecipe">
|
||||
update pro_recipe
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="recipeCode != null and recipeCode != ''">recipe_code = #{recipeCode},</if>
|
||||
<if test="recipeName != null and recipeName != ''">recipe_name = #{recipeName},</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>
|
||||
<if test="splitMerge != null">split_merge = #{splitMerge},</if>
|
||||
<if test="splitMergNum != null">split_merg_num = #{splitMergNum},</if>
|
||||
<if test="sync != null">sync = #{sync},</if>
|
||||
<if test="version != null">version = #{version},</if>
|
||||
<if test="workTime != null">work_time = #{workTime},</if>
|
||||
</trim>
|
||||
where recipe_id = #{recipeId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProRecipeByRecipeId" parameterType="String">
|
||||
delete from pro_recipe where recipe_id = #{recipeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProRecipeByRecipeIds" parameterType="String">
|
||||
delete from pro_recipe where recipe_id in
|
||||
<foreach item="recipeId" collection="array" open="(" separator="," close=")">
|
||||
#{recipeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue