完善流程新增修改
parent
685a9c5867
commit
5635edd630
|
@ -109,7 +109,7 @@ public class SpFlowOperRelationController extends BaseController {
|
|||
* @param spFlowDto 流程与工序DTO
|
||||
* @return 执行结果
|
||||
*/
|
||||
@ApiOperation("主数据表头修改")
|
||||
@ApiOperation("流程与工序关系管理新增+修改")
|
||||
@PostMapping("/add-or-update")
|
||||
@ResponseBody
|
||||
public Result addOrUpdate(@RequestBody SpFlowDto spFlowDto) throws Exception {
|
||||
|
|
|
@ -18,9 +18,15 @@ import java.util.List;
|
|||
public interface SpFlowOperRelationMapper extends BaseMapper<SpFlowOperRelation> {
|
||||
/**
|
||||
* 根据流程ID查询下挂的全部工序
|
||||
*
|
||||
* @param flowId 流程关联ID
|
||||
* @return 工序关系集合
|
||||
*/
|
||||
List<SpOperVo> queryOperRelationByFlowId(@Param("flowId") String flowId);
|
||||
|
||||
/**
|
||||
* 删除流程下挂的全部工序
|
||||
* @param flowId 流程关联ID
|
||||
*/
|
||||
void deleteOperRelationByFlowId(@Param("flowId") String flowId);
|
||||
|
||||
}
|
||||
|
|
|
@ -102,7 +102,11 @@ public class SpFlowOperRelationServiceImpl extends ServiceImpl<SpFlowOperRelatio
|
|||
String flowId = spFlow.getId();
|
||||
String flow = spFlow.getFlow();
|
||||
if (StringUtils.isNotEmpty(flowId)) {
|
||||
//TODO 根据流程ID 批量删除下挂的工序
|
||||
spFlowOperRelationMapper.deleteOperRelationByFlowId(flowId);
|
||||
} else {
|
||||
//如果流程头表为空先创建一下
|
||||
iSpFlowService.saveOrUpdate(spFlow);
|
||||
flowId = spFlow.getId();
|
||||
}
|
||||
// 批量处理需要插入数据库的工序
|
||||
log.info("开始处理流程下工序关系");
|
||||
|
@ -110,6 +114,7 @@ public class SpFlowOperRelationServiceImpl extends ServiceImpl<SpFlowOperRelatio
|
|||
SpFlowOperRelation relation = new SpFlowOperRelation();
|
||||
relation.setFlowId(flowId);//流程ID
|
||||
relation.setFlow(flow);//流程编号
|
||||
SpOper oper = iSpOperService.getById(spOperVoList.get(i).getValue());
|
||||
if (i == 0) {//首个工序
|
||||
relation.setPerOperId("");
|
||||
relation.setPerOper("");
|
||||
|
@ -134,12 +139,16 @@ public class SpFlowOperRelationServiceImpl extends ServiceImpl<SpFlowOperRelatio
|
|||
relation.setOperId(spOperVoList.get(i).getValue());
|
||||
relation.setOper(spOperVoList.get(i).getTitle());
|
||||
relation.setSortNum(i + 1);//顺序
|
||||
processBuild.append("123->");
|
||||
if (i == 0) {
|
||||
processBuild.append(oper.getOperDesc());
|
||||
} else {
|
||||
processBuild.append("->" + oper.getOperDesc());
|
||||
}
|
||||
spFlowOperRelationList.add(relation);
|
||||
}
|
||||
log.info("本次流程时序" + processBuild.toString());
|
||||
spFlow.setProcess(processBuild.toString());
|
||||
//保存流程头表信息
|
||||
//更细流程头表信息
|
||||
iSpFlowService.saveOrUpdate(spFlow);
|
||||
saveOrUpdateBatch(spFlowOperRelationList);
|
||||
return Result.success();
|
||||
|
|
|
@ -20,5 +20,11 @@
|
|||
ORDER BY sort_num
|
||||
</select>
|
||||
|
||||
<delete id="deleteOperRelationByFlowId">
|
||||
delete from sp_flow_oper_relation
|
||||
<where>
|
||||
flow_id = #{flowId}
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -30,7 +30,7 @@ body {
|
|||
}
|
||||
|
||||
.splayui-form .layui-form-item > .layui-form-label {
|
||||
width: 120px !important;
|
||||
/*width: 120px !important;*/
|
||||
}
|
||||
|
||||
.splayui-form > .layui-form-item > .layui-input-block {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>添加用户</title>
|
||||
<title>工序与流程关系</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport"
|
||||
|
@ -30,18 +30,19 @@
|
|||
class="layui-input" value="${flow.flowDesc}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label for="js-descr" class="layui-form-label ">流程时序
|
||||
</label>
|
||||
<div class="layui-input-inline" style="width: 200px">
|
||||
<input type="text" id="js-process" name="process" readonly autocomplete="off"
|
||||
class="layui-input" value="${flow.process}">
|
||||
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label for="js-descr" class="layui-form-label " >流程时序
|
||||
</label>
|
||||
<div class="layui-input-inline" style="width: 514px">
|
||||
<input type="text" id="js-process" readonly autocomplete="off"
|
||||
class="layui-input" value="${flow.process}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
|
||||
<fieldset class="layui-elem-field layui-field-title" >
|
||||
<legend>流程与工序关系</legend>
|
||||
</fieldset>
|
||||
<div id="js-shuttle" class="demo-transfer"></div>
|
||||
|
|
Loading…
Reference in New Issue