[修改] 草稿功能开发,及部分bug修改
This commit is contained in:
+67
-7
@@ -95,7 +95,7 @@ public class TodoTaskController {
|
||||
private IBusProcessEntrustService iBusProcessEntrustService;
|
||||
|
||||
@Resource
|
||||
private IBusProcessApproveService iBusProcessApproveService;
|
||||
private IBusProcessApproveService ibusProcessApproveService;
|
||||
|
||||
@Resource
|
||||
private BusProcessApproveMapper busProcessApproveMapper;
|
||||
@@ -265,7 +265,7 @@ public class TodoTaskController {
|
||||
busProcessApprove.setPrcId(task.getProcessInstanceId());
|
||||
busProcessApprove.setCreateDate(new Date());
|
||||
busProcessApprove.setFromValsJson(busMes.getSubmitJson());
|
||||
iBusProcessApproveService.save(busProcessApprove);
|
||||
ibusProcessApproveService.save(busProcessApprove);
|
||||
if (StringUtils.isNotEmpty(dataJson)){
|
||||
//根据业务情况 对业务数据进行saveOrupdate
|
||||
activitDefineService.saveOrUpdateDate(busMes.getPrcType(),dataJson, task.getId(),task.getProcessInstanceId());
|
||||
@@ -384,6 +384,40 @@ public class TodoTaskController {
|
||||
return Result.success(busProcessNewVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dataId
|
||||
* @param prcType
|
||||
*/
|
||||
@ApiOperation(value = "草稿详情")
|
||||
@GetMapping("/queryDetailByDataId")
|
||||
public ResponseMessage queryDetailByDataId(@RequestParam("dataId") String dataId,
|
||||
@RequestParam("prcType")String prcType,
|
||||
@RequestParam(value = "prcId",required = false)String prcId) {
|
||||
// 查找详细业务数据
|
||||
BusProcessNewVO busProcessNewVO = this.queryDetailDateByDataId(dataId, prcType);
|
||||
//审批数据
|
||||
BusProcessApprove busProcessApprove = new BusProcessApprove();
|
||||
if(StringUtils.isNotEmpty(prcId)){
|
||||
List<BusProcessApprove> busProcessApproves = busProcessApproveMapper.selectEoByPrcIdAndTask(prcId);
|
||||
busProcessApprove = busProcessApproves.get(0);
|
||||
}else {
|
||||
busProcessApprove = busProcessApproveMapper.selectEoByDataId(dataId);
|
||||
}
|
||||
busProcessNewVO.setSubmitJson(busProcessApprove.getFromValsJson());
|
||||
return Result.success(busProcessNewVO);
|
||||
}
|
||||
|
||||
private BusProcessNewVO queryDetailDateByDataId(String dataId, String prcType) {
|
||||
BusProcessNewVO busProcessNewVO = new BusProcessNewVO();
|
||||
if ("1".equals(prcType)){
|
||||
List<PowerApplyActPageVO> powerApplyActs = powerApplyActDao.selectListBydataId(dataId);
|
||||
String string = JSONArray.toJSONString(powerApplyActs);
|
||||
//去对应的 数据表查数据
|
||||
busProcessNewVO.setDataJson(string);
|
||||
}
|
||||
return busProcessNewVO;
|
||||
}
|
||||
|
||||
private BusProcessNewVO queryDetailDate(BusProcessNew busProcessNew, String prcType) {
|
||||
BusProcessNewVO busProcessNewVO = new BusProcessNewVO();
|
||||
BeanUtils.copyProperties(busProcessNew,busProcessNewVO);
|
||||
@@ -406,7 +440,9 @@ public class TodoTaskController {
|
||||
@PostMapping("/saveTaskFirst")
|
||||
public Wrapper<String> saveTaskFirst(@RequestBody ApproveDataVO approveDataVO) {
|
||||
String dataJson = approveDataVO.getDataJson();
|
||||
String submitJson = approveDataVO.getSubmitJson();
|
||||
String saveId = null;
|
||||
String dataId = null;
|
||||
if (approveDataVO.getId() != null && !approveDataVO.getId().equals("")) {
|
||||
saveId = approveDataVO.getId();
|
||||
|
||||
@@ -418,8 +454,14 @@ public class TodoTaskController {
|
||||
List<BusProcessName> list = iBusProcessNameService.list(queryWrapper);
|
||||
if (list != null && list.size() > 0) {
|
||||
BusProcessName busProcessName = list.get(0);
|
||||
|
||||
busProcessName.setPrcName(approveDataVO.getPrcName());
|
||||
busProcessName.setSubmitStatus(SubmitStatusEnum.DRAFT.getValue());
|
||||
if (StringUtils.isNotEmpty(dataJson)){
|
||||
//根据业务情况 对业务数据进行saveOrupdate
|
||||
dataId = activitDefineService.saveOrUpdateDate(approveDataVO.getPrcType(), dataJson, null,
|
||||
null);
|
||||
busProcessName.setDataId(dataId);
|
||||
}
|
||||
iBusProcessNameService.saveOrUpdate(busProcessName);
|
||||
}
|
||||
} else {
|
||||
@@ -428,11 +470,12 @@ public class TodoTaskController {
|
||||
BusProcessName busProcessName = new BusProcessName();
|
||||
if (StringUtils.isNotEmpty(dataJson)) {
|
||||
//根据业务情况 对业务数据进行saveOrupdate
|
||||
String dataId = activitDefineService.saveOrUpdateDate(approveDataVO.getPrcType(), dataJson,
|
||||
dataId = activitDefineService.saveOrUpdateDate(approveDataVO.getPrcType(), dataJson,
|
||||
approveDataVO.getTaskId(),"");
|
||||
busProcessName.setDataId(dataId);
|
||||
}
|
||||
busProcessName.setPrcType(approveDataVO.getPrcType());
|
||||
busProcessName.setPrcName(approveDataVO.getPrcName());
|
||||
busProcessName.setCreatUser(approveDataVO.getCreateUser());
|
||||
busProcessName.setCreatTime(time);
|
||||
busProcessName.setCreatUserName(approveDataVO.getCreateUserName());
|
||||
@@ -444,10 +487,21 @@ public class TodoTaskController {
|
||||
queryWrapper.eq("PRC_TYPE", approveDataVO.getPrcType());
|
||||
queryWrapper.eq("CREAT_USER", approveDataVO.getCreateUser());
|
||||
BusProcessName one = iBusProcessNameService.getOne(queryWrapper);
|
||||
|
||||
saveId = one.getId();
|
||||
|
||||
}
|
||||
//存储审批数据
|
||||
if (StringUtils.isNotEmpty(submitJson)){
|
||||
BusProcessApprove busProcessApprove = busProcessApproveMapper.selectEoByDataId(dataId);
|
||||
if (busProcessApprove == null){
|
||||
busProcessApprove = new BusProcessApprove();
|
||||
busProcessApprove.setDataId(dataId);
|
||||
busProcessApprove.setCreateDate(new Date());
|
||||
busProcessApprove.setCreateUserId(approveDataVO.getCreateUser());
|
||||
}
|
||||
busProcessApprove.setFromValsJson(submitJson);
|
||||
ibusProcessApproveService.saveOrUpdate(busProcessApprove);
|
||||
}
|
||||
return WrapMapper.ok(saveId);
|
||||
}
|
||||
|
||||
@@ -476,7 +530,7 @@ public class TodoTaskController {
|
||||
*/
|
||||
@ApiOperation(value = "查询草稿")
|
||||
@PostMapping("/queryTaskDraft")
|
||||
public List<BusProcessName> queryTaskDraft(@RequestBody TaskCommonQuery taskCommonQuery) {
|
||||
public ResponseMessage queryTaskDraft(@RequestBody TaskCommonQuery taskCommonQuery) {
|
||||
QueryWrapper<BusProcessName> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("CREAT_USER", taskCommonQuery.getUserId());
|
||||
if (taskCommonQuery.getPrcNum() != null && !taskCommonQuery.getPrcNum().equals("")) {
|
||||
@@ -493,8 +547,14 @@ public class TodoTaskController {
|
||||
|
||||
queryWrapper.lambda().eq(BusProcessName::getSubmitStatus,SubmitStatusEnum.DRAFT.getValue());
|
||||
queryWrapper.orderByDesc("CREAT_TIME");
|
||||
Page page = new Page();
|
||||
List<BusProcessName> list = iBusProcessNameService.list(queryWrapper);
|
||||
return list;
|
||||
List<BusProcessName> reList = this.startPage(list, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
page.setList(reList);
|
||||
page.setPageNo(taskCommonQuery.getCurrent());
|
||||
page.setPageSize(taskCommonQuery.getSize());
|
||||
page.setCount((long) list.size());
|
||||
return Result.success(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询流程是否结束", notes = "查询流程是否结束")
|
||||
|
||||
+3
@@ -44,4 +44,7 @@ public class BusProcessApprove {
|
||||
@TableField("FROM_VALS_JSON")
|
||||
private String fromValsJson;
|
||||
|
||||
@TableField("DATA_ID")
|
||||
private String dataId;
|
||||
|
||||
}
|
||||
|
||||
+1
@@ -19,4 +19,5 @@ public interface BusProcessApproveMapper extends BaseMapper<BusProcessApprove> {
|
||||
|
||||
List<BusProcessApprove> selectEoByPrcIdAndTask(@Param("prcId") String prcId);
|
||||
|
||||
BusProcessApprove selectEoByDataId(@Param("dataId") String dataId);
|
||||
}
|
||||
|
||||
@@ -32,4 +32,6 @@ public class ApproveDataVO {
|
||||
|
||||
private String dept;
|
||||
|
||||
private String prcName;
|
||||
|
||||
}
|
||||
|
||||
@@ -6,4 +6,7 @@
|
||||
select * from bus_process_approve where prc_id = #{prcId}
|
||||
Order by CREATE_DATE desc
|
||||
</select>
|
||||
<select id="selectEoByDataId" resultType="com.adc.da.wkflow.business_main.entity.BusProcessApprove">
|
||||
select * from bus_process_approve where data_id =#{dataId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user