完善OA流程
This commit is contained in:
parent
9356c5b983
commit
ba4cf8af77
@ -4,6 +4,7 @@ import ink.wgink.common.base.DefaultBaseController;
|
|||||||
import ink.wgink.exceptions.ParamsException;
|
import ink.wgink.exceptions.ParamsException;
|
||||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||||
import ink.wgink.module.activiti.service.oa.IOaFormReportService;
|
import ink.wgink.module.activiti.service.oa.IOaFormReportService;
|
||||||
|
import ink.wgink.module.form.service.design.IFormFieldService;
|
||||||
import ink.wgink.pojo.ListPage;
|
import ink.wgink.pojo.ListPage;
|
||||||
import ink.wgink.pojo.result.SuccessResult;
|
import ink.wgink.pojo.result.SuccessResult;
|
||||||
import ink.wgink.pojo.result.SuccessResultList;
|
import ink.wgink.pojo.result.SuccessResultList;
|
||||||
@ -32,6 +33,8 @@ public class OaFormReportController extends DefaultBaseController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOaFormReportService oaFormReportService;
|
private IOaFormReportService oaFormReportService;
|
||||||
|
@Autowired
|
||||||
|
private IFormFieldService formFieldService;
|
||||||
|
|
||||||
@ApiOperation(value = "保存表单(发起流程)", notes = "保存表单(发起流程)接口")
|
@ApiOperation(value = "保存表单(发起流程)", notes = "保存表单(发起流程)接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ -131,9 +134,5 @@ public class OaFormReportController extends DefaultBaseController {
|
|||||||
if (!isNextEndEvent && assignees.isEmpty()) {
|
if (!isNextEndEvent && assignees.isEmpty()) {
|
||||||
throw new ParamsException("未选择下节点代理人");
|
throw new ParamsException("未选择下节点代理人");
|
||||||
}
|
}
|
||||||
for (Map.Entry<String, Object> kv : body.entrySet()) {
|
|
||||||
String key = kv.getKey();
|
|
||||||
Object value = kv.getValue();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
|||||||
confirmAssigneeVO.setNextEndEvent(nextUserTasks.isEmpty() ? true : false);
|
confirmAssigneeVO.setNextEndEvent(nextUserTasks.isEmpty() ? true : false);
|
||||||
confirmAssigneeVO.setBtnExc(getSequenceFlowExcCondition(sequenceFlow.getConditionExpression()));
|
confirmAssigneeVO.setBtnExc(getSequenceFlowExcCondition(sequenceFlow.getConditionExpression()));
|
||||||
if (StringUtils.isBlank(name)) {
|
if (StringUtils.isBlank(name)) {
|
||||||
confirmAssigneeVO.setBtnText("提交" + (i + 1));
|
confirmAssigneeVO.setBtnText("提交");
|
||||||
} else {
|
} else {
|
||||||
confirmAssigneeVO.setBtnText(name);
|
confirmAssigneeVO.setBtnText(name);
|
||||||
}
|
}
|
||||||
|
@ -215,19 +215,22 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
|||||||
LOG.debug("6.2 当前节点为会签节点(多实例)");
|
LOG.debug("6.2 当前节点为会签节点(多实例)");
|
||||||
LOG.debug("6.2.1 删除未完成的任务(当前任务除外)");
|
LOG.debug("6.2.1 删除未完成的任务(当前任务除外)");
|
||||||
for (HistoricTaskInstance historicTaskInstance : historicTaskInstances) {
|
for (HistoricTaskInstance historicTaskInstance : historicTaskInstances) {
|
||||||
if (!StringUtils.equals(historicTaskInstance.getId(), currentTaskId)) {
|
// 当前任务不处理
|
||||||
|
if (StringUtils.equals(historicTaskInstance.getId(), currentTaskId)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// 已经完成的不处理
|
||||||
if (historicTaskInstance.getEndTime() != null) {
|
if (historicTaskInstance.getEndTime() != null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
/// 未完成的
|
||||||
TaskCommentBO taskCommentBO = new TaskCommentBO();
|
TaskCommentBO taskCommentBO = new TaskCommentBO();
|
||||||
taskCommentBO.setType(TaskCommentTypeEnum.GO_BACK);
|
taskCommentBO.setType(TaskCommentTypeEnum.GO_BACK);
|
||||||
taskCommentBO.setContent("其他人回退(自动完成)");
|
taskCommentBO.setContent("其他人回退(自动完成)");
|
||||||
taskCommentBO.setTime(DateUtil.getTime());
|
taskCommentBO.setTime(DateUtil.getTime());
|
||||||
taskCommentBO.setUserId(userId);
|
taskCommentBO.setUserId(userId);
|
||||||
taskCommentBO.setUserName(userName);
|
taskCommentBO.setUserName(userName);
|
||||||
taskService.addComment(currentTaskId, processInstanceId, TaskCommentTypeEnum.GO_BACK.getValue(), JSONObject.toJSONString(taskCommentBO));
|
taskService.addComment(historicTaskInstance.getId(), processInstanceId, TaskCommentTypeEnum.GO_BACK.getValue(), JSONObject.toJSONString(taskCommentBO));
|
||||||
taskService.complete(historicTaskInstance.getId());
|
taskService.complete(historicTaskInstance.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ public class FormFieldPO implements Serializable {
|
|||||||
private String fieldTag;
|
private String fieldTag;
|
||||||
private String fieldDefault;
|
private String fieldDefault;
|
||||||
private Boolean listShow;
|
private Boolean listShow;
|
||||||
|
private String fieldRequired;
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
@ -86,4 +87,12 @@ public class FormFieldPO implements Serializable {
|
|||||||
public void setListShow(Boolean listShow) {
|
public void setListShow(Boolean listShow) {
|
||||||
this.listShow = listShow;
|
this.listShow = listShow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getFieldRequired() {
|
||||||
|
return fieldRequired;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFieldRequired(String fieldRequired) {
|
||||||
|
this.fieldRequired = fieldRequired;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,8 @@ public class FormFieldVO {
|
|||||||
private String fieldDefault;
|
private String fieldDefault;
|
||||||
@ApiModelProperty(name = "listShow", value = "列表显示")
|
@ApiModelProperty(name = "listShow", value = "列表显示")
|
||||||
private String listShow;
|
private String listShow;
|
||||||
|
@ApiModelProperty(name = "fieldRequired", value = "字段校验")
|
||||||
|
private String fieldRequired;
|
||||||
|
|
||||||
public String getFormId() {
|
public String getFormId() {
|
||||||
return formId;
|
return formId;
|
||||||
@ -76,4 +78,12 @@ public class FormFieldVO {
|
|||||||
public void setListShow(String listShow) {
|
public void setListShow(String listShow) {
|
||||||
this.listShow = listShow;
|
this.listShow = listShow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getFieldRequired() {
|
||||||
|
return fieldRequired;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFieldRequired(String fieldRequired) {
|
||||||
|
this.fieldRequired = fieldRequired;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -139,4 +139,13 @@ public interface IFormFieldService {
|
|||||||
*/
|
*/
|
||||||
List<String> listFieldNameByFormIdAndListShow(String formId, Boolean isListShow);
|
List<String> listFieldNameByFormIdAndListShow(String formId, Boolean isListShow);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字段列表
|
||||||
|
*
|
||||||
|
* @param formCode 表单编码
|
||||||
|
* @param formVersion 表单版本
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<FormFieldDTO> listByFormCodeAndVersion(String formCode, Integer formVersion);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -136,5 +136,11 @@ public class FormFieldServiceImpl extends DefaultBaseService implements IFormFie
|
|||||||
return listFieldName(params);
|
return listFieldName(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FormFieldDTO> listByFormCodeAndVersion(String formCode, Integer formVersion) {
|
||||||
|
Map<String, Object> params = getHashMap(4);
|
||||||
|
params.put("formCode", formCode);
|
||||||
|
params.put("formVersion", formVersion);
|
||||||
|
return list(params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,9 @@
|
|||||||
<result column="field_type" property="fieldType"/>
|
<result column="field_type" property="fieldType"/>
|
||||||
<result column="field_tag" property="fieldTag"/>
|
<result column="field_tag" property="fieldTag"/>
|
||||||
<result column="field_default" property="fieldDefault"/>
|
<result column="field_default" property="fieldDefault"/>
|
||||||
|
<result column="field_default" property="fieldDefault"/>
|
||||||
<result column="list_show" property="listShow"/>
|
<result column="list_show" property="listShow"/>
|
||||||
|
<result column="field_required" property="fieldRequired"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="formFieldDTO" type="ink.wgink.module.form.pojo.dtos.design.FormFieldDTO">
|
<resultMap id="formFieldDTO" type="ink.wgink.module.form.pojo.dtos.design.FormFieldDTO">
|
||||||
@ -23,6 +25,7 @@
|
|||||||
<result column="field_tag" property="fieldTag"/>
|
<result column="field_tag" property="fieldTag"/>
|
||||||
<result column="field_default" property="fieldDefault"/>
|
<result column="field_default" property="fieldDefault"/>
|
||||||
<result column="list_show" property="listShow"/>
|
<result column="list_show" property="listShow"/>
|
||||||
|
<result column="field_required" property="fieldRequired"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<!-- 建表 -->
|
<!-- 建表 -->
|
||||||
@ -36,6 +39,7 @@
|
|||||||
`field_type` varchar(255) DEFAULT NULL COMMENT '字段类型',
|
`field_type` varchar(255) DEFAULT NULL COMMENT '字段类型',
|
||||||
`field_tag` varchar(255) DEFAULT NULL COMMENT '标签类型',
|
`field_tag` varchar(255) DEFAULT NULL COMMENT '标签类型',
|
||||||
`field_default` varchar(255) DEFAULT NULL COMMENT '字段默认',
|
`field_default` varchar(255) DEFAULT NULL COMMENT '字段默认',
|
||||||
|
`field_required` varchar(255) DEFAULT 'none' COMMENT '字段校验',
|
||||||
`list_show` varchar(10) DEFAULT 'false' COMMENT '是否列表显示',
|
`list_show` varchar(10) DEFAULT 'false' COMMENT '是否列表显示',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字段字段';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字段字段';
|
||||||
@ -51,6 +55,7 @@
|
|||||||
field_type,
|
field_type,
|
||||||
field_tag,
|
field_tag,
|
||||||
field_default,
|
field_default,
|
||||||
|
field_required,
|
||||||
list_show
|
list_show
|
||||||
) VALUES(
|
) VALUES(
|
||||||
#{fieldId},
|
#{fieldId},
|
||||||
@ -60,6 +65,7 @@
|
|||||||
#{fieldType},
|
#{fieldType},
|
||||||
#{fieldTag},
|
#{fieldTag},
|
||||||
#{fieldDefault},
|
#{fieldDefault},
|
||||||
|
#{fieldRequired},
|
||||||
#{listShow}
|
#{listShow}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
@ -99,6 +105,7 @@
|
|||||||
field_type = #{fieldType},
|
field_type = #{fieldType},
|
||||||
field_tag = #{fieldTag},
|
field_tag = #{fieldTag},
|
||||||
field_default = #{fieldDefault},
|
field_default = #{fieldDefault},
|
||||||
|
field_required = #{fieldRequired},
|
||||||
list_show = #{listShow}
|
list_show = #{listShow}
|
||||||
WHERE
|
WHERE
|
||||||
field_id = #{fieldId}
|
field_id = #{fieldId}
|
||||||
@ -114,6 +121,7 @@
|
|||||||
field_type,
|
field_type,
|
||||||
field_tag,
|
field_tag,
|
||||||
field_default,
|
field_default,
|
||||||
|
field_required,
|
||||||
list_show
|
list_show
|
||||||
FROM
|
FROM
|
||||||
form_field
|
form_field
|
||||||
@ -131,6 +139,7 @@
|
|||||||
field_type,
|
field_type,
|
||||||
field_tag,
|
field_tag,
|
||||||
field_default,
|
field_default,
|
||||||
|
field_required,
|
||||||
list_show
|
list_show
|
||||||
FROM
|
FROM
|
||||||
form_field
|
form_field
|
||||||
@ -148,6 +157,7 @@
|
|||||||
field_type,
|
field_type,
|
||||||
field_tag,
|
field_tag,
|
||||||
field_default,
|
field_default,
|
||||||
|
field_required,
|
||||||
list_show
|
list_show
|
||||||
FROM
|
FROM
|
||||||
form_field
|
form_field
|
||||||
@ -156,6 +166,21 @@
|
|||||||
AND
|
AND
|
||||||
form_id = #{formId}
|
form_id = #{formId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="formCode != null and formCode != '' and formVersion != ''">
|
||||||
|
AND
|
||||||
|
form_id = (
|
||||||
|
SELECT
|
||||||
|
form_id
|
||||||
|
FROM
|
||||||
|
form_form
|
||||||
|
WHERE
|
||||||
|
is_delete = 0
|
||||||
|
AND
|
||||||
|
form_code = #{formCode}
|
||||||
|
AND
|
||||||
|
form_version = #{formVersion}
|
||||||
|
)
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@ -169,6 +194,7 @@
|
|||||||
field_type,
|
field_type,
|
||||||
field_tag,
|
field_tag,
|
||||||
field_default,
|
field_default,
|
||||||
|
field_required,
|
||||||
list_show
|
list_show
|
||||||
FROM
|
FROM
|
||||||
form_field
|
form_field
|
||||||
|
@ -169,6 +169,9 @@ function OaFormUtil(layui) {
|
|||||||
textAlign: 'center'
|
textAlign: 'center'
|
||||||
})
|
})
|
||||||
$('#processImage').append(html);
|
$('#processImage').append(html);
|
||||||
|
$('#runtimeProcessImageBox').css({
|
||||||
|
height: '100%',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
initRuntimeProcessImage();
|
initRuntimeProcessImage();
|
||||||
@ -195,7 +198,7 @@ function OaFormUtil(layui) {
|
|||||||
* 初始化选择项
|
* 初始化选择项
|
||||||
*/
|
*/
|
||||||
this.initTabItem = function (processInstanceId) {
|
this.initTabItem = function (processInstanceId) {
|
||||||
$('.layui-tab-item, #runtimeProcessImageBox').css({
|
$('.layui-tab-item').css({
|
||||||
height: (win.height() - 138) + 'px',
|
height: (win.height() - 138) + 'px',
|
||||||
overflow: 'auto'
|
overflow: 'auto'
|
||||||
});
|
});
|
||||||
|
@ -154,7 +154,7 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
formUtil.selectUsers({
|
oaFormUtil.selectUsers({
|
||||||
selectType: selectType,
|
selectType: selectType,
|
||||||
users: confirmAssignees[index].assignees,
|
users: confirmAssignees[index].assignees,
|
||||||
selectedUserIds: [],
|
selectedUserIds: [],
|
||||||
|
@ -207,12 +207,11 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
formUtil.selectUsers({
|
oaFormUtil.selectUsers({
|
||||||
selectType: selectType,
|
selectType: selectType,
|
||||||
users: confirmAssignees[index].assignees,
|
users: confirmAssignees[index].assignees,
|
||||||
selectedUserIds: [],
|
selectedUserIds: [],
|
||||||
onConfirm: function(selectedUsers) {
|
onConfirm: function(selectedUsers) {
|
||||||
console.log(selectedUsers);
|
|
||||||
var assignees = [];
|
var assignees = [];
|
||||||
for(var j = 0, jItem; jItem = selectedUsers[j++];) {
|
for(var j = 0, jItem; jItem = selectedUsers[j++];) {
|
||||||
assignees.push(jItem.userId);
|
assignees.push(jItem.userId);
|
||||||
|
Loading…
Reference in New Issue
Block a user