工单变更

highway
zhaoxiaolin 2 years ago
parent d6e17541a9
commit fb0a2ab614

@ -3,9 +3,6 @@ package com.op.system.api.factory;
import com.op.common.core.domain.BaseFileData;
import com.op.common.core.domain.R;
import com.op.system.api.RemoteMesService;
import com.op.system.api.RemoteUserService;
import com.op.system.api.domain.SysUser;
import com.op.system.api.model.LoginUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@ -33,3 +30,4 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
};
}
}

@ -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

@ -38,8 +38,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("/pro/process")
public class ProProcessController extends BaseController
{
public class ProProcessController extends BaseController {
@Autowired
private IProProcessService proProcessService;
@ -48,8 +47,7 @@ public class ProProcessController extends BaseController
*/
@RequiresPermissions("mes:pro:process:list")
@GetMapping("/list")
public TableDataInfo list(ProProcess proProcess)
{
public TableDataInfo list(ProProcess proProcess) {
startPage();
List<ProProcess> list = proProcessService.selectProProcessList(proProcess);
return getDataTable(list);
@ -57,14 +55,15 @@ public class ProProcessController extends BaseController
/**
*
*
* @return
*/
@RequiresPermissions("mes:pro:process:list")
@GetMapping("/listAll")
public AjaxResult listAll(){
public AjaxResult listAll() {
ProProcess process = new ProProcess();
process.setEnableFlag("Y");
List<ProProcess> list =proProcessService.selectProProcessList(process);
List<ProProcess> list = proProcessService.selectProProcessList(process);
return AjaxResult.success(list);
}
@ -74,8 +73,7 @@ public class ProProcessController extends BaseController
@RequiresPermissions("@ss.hasPermi('mes:pro:process:export')")
@Log(title = "生产工序", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProProcess proProcess)
{
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, "生产工序数据");
@ -86,8 +84,7 @@ public class ProProcessController extends BaseController
*/
@RequiresPermissions("mes:pro:process:query")
@GetMapping(value = "/{processId}")
public AjaxResult getInfo(@PathVariable("processId") String processId)
{
public AjaxResult getInfo(@PathVariable("processId") String processId) {
return AjaxResult.success(proProcessService.selectProProcessByProcessId(processId));
}
@ -97,12 +94,11 @@ public class ProProcessController extends BaseController
@RequiresPermissions("mes:pro:process:add")
@Log(title = "生产工序", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProProcess proProcess)
{
if(!proProcessService.checkProcessCodeUnique(proProcess)){
public AjaxResult add(@RequestBody ProProcess proProcess) {
if (!proProcessService.checkProcessCodeUnique(proProcess)) {
return AjaxResult.error("工序编码已存在!");
}
if(!proProcessService.checkProcessNameUnique(proProcess)){
if (!proProcessService.checkProcessNameUnique(proProcess)) {
return AjaxResult.error("工序名称已存在!");
}
return toAjax(proProcessService.insertProProcess(proProcess));
@ -114,12 +110,11 @@ public class ProProcessController extends BaseController
@RequiresPermissions("mes:pro:process:edit")
@Log(title = "生产工序", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProProcess proProcess)
{
if(proProcessService.checkProcessCodeUnique(proProcess)){
public AjaxResult edit(@RequestBody ProProcess proProcess) {
if (!proProcessService.checkProcessCodeUnique(proProcess)) {
return AjaxResult.error("工序编码已存在!");
}
if(proProcessService.checkProcessNameUnique(proProcess)){
if (!proProcessService.checkProcessNameUnique(proProcess)) {
return AjaxResult.error("工序名称已存在!");
}
return toAjax(proProcessService.updateProProcess(proProcess));
@ -130,9 +125,8 @@ public class ProProcessController extends BaseController
*/
@RequiresPermissions("mes:pro:process:remove")
@Log(title = "生产工序", businessType = BusinessType.DELETE)
@DeleteMapping("/{processIds}")
public AjaxResult remove(@PathVariable String[] processIds)
{
@DeleteMapping("/{processIds}")
public AjaxResult remove(@PathVariable String[] processIds) {
return toAjax(proProcessService.deleteProProcessByProcessIds(processIds));
}
}

@ -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));
}
}

@ -78,7 +78,8 @@ public class ProOrderWorkorder extends TreeEntity {
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "工单生产日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date productDate;
private String productDateStart;
private String productDateEnd;
/** 班次 */
@Excel(name = "班次")
private String shiftId;
@ -406,6 +407,22 @@ public class ProOrderWorkorder extends TreeEntity {
return factoryCode;
}
public String getProductDateStart() {
return productDateStart;
}
public void setProductDateStart(String productDateStart) {
this.productDateStart = productDateStart;
}
public String getProductDateEnd() {
return productDateEnd;
}
public void setProductDateEnd(String productDateEnd) {
this.productDateEnd = productDateEnd;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -451,4 +468,4 @@ public class ProOrderWorkorder extends TreeEntity {
.append("bucketName",getBucketName())
.toString();
}
}
}

@ -14,39 +14,56 @@ import java.util.List;
* @author yinjinlu
* @date 2022-05-12
*/
public class ProRecipe extends BaseEntity
{
public class ProRecipe extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 工序ID */
private String processId;
/** 工序编码 */
@Excel(name = "工序编码")
private String processCode;
/** 工序名称 */
@Excel(name = "工序名称")
private String processName;
/** 工艺要求 */
/**
* ID
*/
private String recipeId;
/**
*
*/
@Excel(name = "配方编码")
private String recipeCode;
/**
*
*/
@Excel(name = "配方名称")
private String recipeName;
/**
*
*/
@Excel(name = "工艺要求")
private String attention;
/** 是否启用 */
/**
*
*/
@Excel(name = "是否启用")
private String enableFlag;
/** 预留字段1 */
/**
* 1
*/
private String attr1;
/** 预留字段2 */
/**
* 2
*/
private String attr2;
/** 预留字段3 */
/**
* 3
*/
private Long attr3;
/** 预留字段4 */
/**
* 4
*/
private Long attr4;
private String fileList;
@ -58,7 +75,7 @@ public class ProRecipe extends BaseEntity
//1允许多单并行
private String sync;
//工作中心
private String workCenter;
private String version;
//工作时长
private Double workTime;
@ -71,11 +88,11 @@ public class ProRecipe extends BaseEntity
}
public String getWorkCenter() {
return workCenter;
return version;
}
public void setWorkCenter(String workCenter) {
this.workCenter = workCenter;
public void setWorkCenter(String version) {
this.version = version;
}
public Double getWorkTime() {
@ -118,105 +135,96 @@ public class ProRecipe extends BaseEntity
this.fileList = fileList;
}
public void setProcessId(String processId)
{
this.processId = processId;
public String getRecipeCode() {
return recipeCode;
}
public String getProcessId()
{
return processId;
}
public void setProcessCode(String processCode)
{
this.processCode = processCode;
public void setRecipeCode(String recipeCode) {
this.recipeCode = recipeCode;
}
public String getProcessCode()
{
return processCode;
}
public void setProcessName(String processName)
{
this.processName = processName;
public String getRecipeName() {
return recipeName;
}
public String getProcessName()
{
return processName;
public void setRecipeName(String recipeName) {
this.recipeName = recipeName;
}
public void setAttention(String attention)
{
public void setAttention(String attention) {
this.attention = attention;
}
public String getAttention()
{
public String getAttention() {
return attention;
}
public void setEnableFlag(String enableFlag)
{
public void setEnableFlag(String enableFlag) {
this.enableFlag = enableFlag;
}
public String getEnableFlag()
{
public String getEnableFlag() {
return enableFlag;
}
public void setAttr1(String attr1)
{
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1()
{
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2)
{
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2()
{
public String getAttr2() {
return attr2;
}
public void setAttr3(Long attr3)
{
public void setAttr3(Long attr3) {
this.attr3 = attr3;
}
public Long getAttr3()
{
public Long getAttr3() {
return attr3;
}
public void setAttr4(Long attr4)
{
public void setAttr4(Long attr4) {
this.attr4 = attr4;
}
public Long getAttr4()
{
public Long getAttr4() {
return attr4;
}
public String getRecipeId() {
return recipeId;
}
public void setRecipeId(String recipeId) {
this.recipeId = recipeId;
}
@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();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("recipeId", getRecipeId())
.append("processCode", getRecipeCode())
.append("processName", getRecipeName())
.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();
}
}

@ -19,8 +19,8 @@ public class ProRecipeContent extends BaseEntity
private String contentId;
/** 工序ID */
@Excel(name = "工序ID")
private String processId;
@Excel(name = "配方ID")
private String recipeId;
/** 顺序编号 */
@Excel(name = "顺序编号")
@ -63,14 +63,14 @@ public class ProRecipeContent extends BaseEntity
{
return contentId;
}
public void setProcessId(String processId)
public void setProcessId(String recipeId)
{
this.processId = processId;
this.recipeId = recipeId;
}
public String getProcessId()
public String getRecipeId()
{
return processId;
return recipeId;
}
public void setOrderNum(Integer orderNum)
{
@ -158,7 +158,7 @@ public class ProRecipeContent extends BaseEntity
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("contentId", getContentId())
.append("processId", getProcessId())
.append("recipeId", getRecipeId())
.append("orderNum", getOrderNum())
.append("contentText", getContentText())
.append("device", getDevice())

@ -6,6 +6,10 @@ import com.op.mes.domain.Convert;
import com.op.mes.domain.ProLine;
import com.op.mes.domain.ProOrder;
import com.op.mes.domain.ProShift;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.mes.domain.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* Mapper
@ -137,4 +141,6 @@ public interface ProOrderMapper {
* @return
*/
public List<ProLine> selectPackageLine();
public void updateOrderBatch(@Param("workers") List<ProOrderWorkorder> workers);
}

@ -67,7 +67,7 @@ public interface ProOrderWorkorderMapper {
* @return
*/
List<ProOrderWorkorder> selectFirWorkOrder(String id);
ProOrderWorkorder selectWorkOrderByCode(String workorderCode);
/**
* code
*
@ -83,6 +83,8 @@ public interface ProOrderWorkorderMapper {
* @return
*/
List<ProOrderWorkorder> selectWorkOrderByTime(Date productDate);
/**下发生产订单**/
public int downProOrderWorkorderByWorkorderIds(String[] workorderIds);
/**
* idcode
@ -91,4 +93,4 @@ public interface ProOrderWorkorderMapper {
* @return
*/
String selectEndWorkOrder(String id);
}
}

@ -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);
}

@ -59,4 +59,11 @@ public interface IProOrderWorkorderService {
* @return
*/
public int deleteProOrderWorkorderByWorkorderId(String workorderId);
}
/**
*
* @param workorderIds
* @return
*/
public int downProOrderWorkorderByWorkorderIds(String[] workorderIds);
}

@ -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);
}

@ -249,6 +249,7 @@ public class ProOrderServiceImpl implements IProOrderService {
* @return
*/
@Override
@DS("#header.poolName")
public ProOrder selectProOrderById(String id) {
return proOrderMapper.selectProOrderById(id);
}
@ -476,4 +477,4 @@ public class ProOrderServiceImpl implements IProOrderService {
return 1;
}
}
}
}

@ -1,12 +1,19 @@
package com.op.mes.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.mes.domain.ProOrderWorkorder;
import com.op.mes.mapper.ProOrderMapper;
import com.op.mes.mapper.ProOrderWorkorderBatchMapper;
import com.op.mes.mapper.ProOrderWorkorderMapper;
import com.op.mes.service.IProOrderWorkorderService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
@ -20,7 +27,10 @@ import java.util.List;
public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
@Autowired
private ProOrderWorkorderMapper proOrderWorkorderMapper;
@Autowired
private ProOrderWorkorderBatchMapper proOrderWorkorderBatchMapper;
@Autowired
private ProOrderMapper proOrderMapper;
/**
*
*
@ -28,6 +38,7 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
* @return
*/
@Override
@DS("#header.poolName")
public ProOrderWorkorder selectProOrderWorkorderByWorkorderId(String workorderId) {
return proOrderWorkorderMapper.selectProOrderWorkorderByWorkorderId(workorderId);
}
@ -39,7 +50,9 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
* @return
*/
@Override
@DS("#header.poolName")
public List<ProOrderWorkorder> selectProOrderWorkorderList(ProOrderWorkorder proOrderWorkorder) {
return proOrderWorkorderMapper.selectProOrderWorkorderList(proOrderWorkorder);
}
@ -50,6 +63,7 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
* @return
*/
@Override
@DS("#header.poolName")
public int insertProOrderWorkorder(ProOrderWorkorder proOrderWorkorder) {
proOrderWorkorder.setCreateTime(DateUtils.getNowDate());
return proOrderWorkorderMapper.insertProOrderWorkorder(proOrderWorkorder);
@ -62,6 +76,7 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
* @return
*/
@Override
@DS("#header.poolName")
public int updateProOrderWorkorder(ProOrderWorkorder proOrderWorkorder) {
proOrderWorkorder.setUpdateTime(DateUtils.getNowDate());
return proOrderWorkorderMapper.updateProOrderWorkorder(proOrderWorkorder);
@ -74,10 +89,51 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
* @return
*/
@Override
@DS("#header.poolName")
@Transactional
public int deleteProOrderWorkorderByWorkorderIds(String[] workorderIds) {
return proOrderWorkorderMapper.deleteProOrderWorkorderByWorkorderIds(workorderIds);
for(String workorderId:workorderIds){
//要删除的工单id们
List<String> delteIds = new ArrayList<>();
delteIds.add(workorderId);
//最底级,用来还原订单拆分数量
List<ProOrderWorkorder> workers = new ArrayList<>();
ProOrderWorkorder work = proOrderWorkorderMapper.selectProOrderWorkorderByWorkorderId(workorderId);
if(work != null){
workers.add(work);
ProOrderWorkorder bottomWork = work;
Boolean run = true;
while(run){
//上级
ProOrderWorkorder topworkers = proOrderWorkorderMapper.selectWorkOrderByCode(bottomWork.getParentOrder());
//有上级code
if(topworkers!=null) {
workers.add(topworkers);
delteIds.add(topworkers.getWorkorderId());
bottomWork.setParentOrder(topworkers.getParentOrder());
}else{
run = false;
}
}
}
String[] workorderIds0 = (String[])delteIds.toArray(new String[delteIds.size()]);
if(workorderIds0.length>0){
//删除工单(字母)pro_order_workorder
proOrderWorkorderMapper.deleteProOrderWorkorderByWorkorderIds(workorderIds0);
//删除批次pro_order_workorder_batch
proOrderWorkorderBatchMapper.deleteProOrderWorkorderBatchByWorkorderIds(workorderIds0);
}
if(!CollectionUtils.isEmpty(workers)){
//释放订单拆分数pro_order
proOrderMapper.updateOrderBatch(workers);
}
}
return 1;
}
/**
*
*
@ -85,7 +141,20 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
* @return
*/
@Override
@DS("#header.poolName")
public int deleteProOrderWorkorderByWorkorderId(String workorderId) {
return proOrderWorkorderMapper.deleteProOrderWorkorderByWorkorderId(workorderId);
}
}
/**
*
* @param workorderIds
* @return
*/
@Override
@DS("#header.poolName")
public int downProOrderWorkorderByWorkorderIds(String[] workorderIds) {
int m= proOrderWorkorderMapper.downProOrderWorkorderByWorkorderIds(workorderIds);
return m;
}
}

@ -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);
}
}

@ -217,8 +217,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where id = #{id}
</update>
<update id="updateOrderBatch">
<foreach collection="workers" item="worker" index="index" separator=";">
update pro_order set quantity_split = quantity_split-#{worker.quantitySplit},
update_time = GETDATE()
where id = #{worker.orderId}
</foreach>
</update>
<delete id="deleteProOrderById" parameterType="String">
<delete id="deleteProOrderById" parameterType="String">
delete from pro_order where id = #{id}
</delete>

@ -70,6 +70,8 @@
<if test="prodType != null and prodType != ''"> and prod_type = #{prodType}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="isEnd != null and isEnd != ''"> and is_end = #{isEnd}</if>
<if test="productDateStart != null "> and CONVERT(varchar(10),product_date, 120) >= '${productDateStart}'</if>
<if test="productDateEnd != null "> and '${productDateEnd}%' >= CONVERT(varchar(10),product_date, 120)</if>
</where>
</select>
@ -93,6 +95,10 @@
WHERE CONVERT(date, create_time) = #{productDate}
)
</select>
<select id="selectWorkOrderByCode" resultMap="ProOrderWorkorderResult">
<include refid="selectProOrderWorkorderVo"/>
where workorder_code = #{workorderCode}
</select>
<select id="selectEndWorkOrder" resultType="java.lang.String">
select TOP 1 workorder_code
@ -207,6 +213,15 @@
</trim>
where workorder_id = #{workorderId}
</update>
<!--工单下发-->
<update id="downProOrderWorkorderByWorkorderIds">
update pro_order_workorder
set status = 'w1'
where workorder_code in
<foreach item="workorderCode" collection="array" open="(" separator="," close=")">
#{workorderCode}
</foreach>
</update>
<delete id="deleteProOrderWorkorderByWorkorderId" parameterType="String">
delete from pro_order_workorder where workorder_id = #{workorderId}
@ -218,4 +233,4 @@
#{workorderId}
</foreach>
</delete>
</mapper>
</mapper>

@ -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…
Cancel
Save