开发流程与工序关系功能
parent
3c48da6ea8
commit
bc7877a1e4
|
@ -1,9 +1,13 @@
|
|||
package com.wangziyang.mes.basedata.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.wangziyang.mes.basedata.dto.SpFlowDto;
|
||||
import com.wangziyang.mes.basedata.entity.SpFlow;
|
||||
import com.wangziyang.mes.basedata.entity.SpFlowOperRelation;
|
||||
import com.wangziyang.mes.basedata.entity.SpOper;
|
||||
import com.wangziyang.mes.basedata.request.SpTableManagerReq;
|
||||
import com.wangziyang.mes.basedata.service.ISpFlowOperRelationService;
|
||||
import com.wangziyang.mes.basedata.service.ISpFlowService;
|
||||
import com.wangziyang.mes.basedata.service.ISpOperService;
|
||||
import com.wangziyang.mes.basedata.vo.SpOperVo;
|
||||
|
@ -13,13 +17,11 @@ import io.swagger.annotations.ApiImplicitParam;
|
|||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -46,6 +48,11 @@ public class SpFlowOperRelationController extends BaseController {
|
|||
*/
|
||||
@Autowired
|
||||
public ISpOperService iSpOperService;
|
||||
/**
|
||||
* 流程与工序基础数据服务
|
||||
*/
|
||||
@Autowired
|
||||
public ISpFlowOperRelationService iSpFlowOperRelationService;
|
||||
|
||||
/**
|
||||
* 流程与工序关系管理界面
|
||||
|
@ -106,5 +113,32 @@ public class SpFlowOperRelationController extends BaseController {
|
|||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 流程与工序关系管理新增+修改
|
||||
*
|
||||
* @param spFlowDto 流程与工序DTO
|
||||
* @return 执行结果
|
||||
*/
|
||||
@ApiOperation("主数据表头修改")
|
||||
@PostMapping("/add-or-update")
|
||||
@ResponseBody
|
||||
public Result addOrUpdate(@RequestBody SpFlowDto spFlowDto) throws Exception {
|
||||
List<SpFlowOperRelation> spFlowOperRelationList = spFlowDto.getSpFlowOperRelationList();
|
||||
|
||||
if(CollectionUtil.isEmpty(spFlowOperRelationList))
|
||||
{
|
||||
throw new Exception("流程下的工序不能为空");
|
||||
}
|
||||
SpFlow spFlow =new SpFlow();
|
||||
BeanUtils.copyProperties(spFlowDto,spFlow);
|
||||
|
||||
|
||||
//保存流程头表信息
|
||||
iSpFlowService.saveOrUpdate(spFlow);
|
||||
iSpFlowOperRelationService.saveOrUpdateBatch(spFlowOperRelationList);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
package com.wangziyang.mes.basedata.dto;
|
||||
|
||||
import com.wangziyang.mes.basedata.entity.SpFlow;
|
||||
import com.wangziyang.mes.basedata.entity.SpFlowOperRelation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程DTO
|
||||
*/
|
||||
public class SpFlowDto extends SpFlow {
|
||||
/**
|
||||
* 流程与工序关系集合
|
||||
*/
|
||||
private List<SpFlowOperRelation> spFlowOperRelationList;
|
||||
|
||||
/**
|
||||
* 获取 流程与工序关系集合
|
||||
*
|
||||
* @return spFlowOperRelationList 流程与工序关系集合
|
||||
*/
|
||||
public List<SpFlowOperRelation> getSpFlowOperRelationList() {
|
||||
return this.spFlowOperRelationList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 流程与工序关系集合
|
||||
*
|
||||
* @param spFlowOperRelationList 流程与工序关系集合
|
||||
*/
|
||||
public void setSpFlowOperRelationList(List<SpFlowOperRelation> spFlowOperRelationList) {
|
||||
this.spFlowOperRelationList = spFlowOperRelationList;
|
||||
}
|
||||
}
|
|
@ -1,4 +1,15 @@
|
|||
package com.wangziyang.mes.basedata.dto;
|
||||
|
||||
public class SpFlowOperRelationDto {
|
||||
import com.wangziyang.mes.basedata.entity.SpFlowOperRelation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程与工序关系DTO
|
||||
*
|
||||
* @author wangziyang
|
||||
* @since 20200316
|
||||
*/
|
||||
public class SpFlowOperRelationDto extends SpFlowOperRelation {
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,12 @@ import com.wangziyang.mes.basedata.entity.SpTableManagerItem;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基础主数据管理DTO
|
||||
*
|
||||
* @author wangziyang
|
||||
* @since 20200316
|
||||
*/
|
||||
public class SpTableManagerDto extends SpTableManager {
|
||||
/**
|
||||
* 表显示的字段
|
||||
|
|
|
@ -13,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface ISpFlowService extends IService<SpFlow> {
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue