修改任务审批列表

pull/1/head
sunchenliang 2 years ago
parent 8202e5526e
commit 6f9a6074d5

@ -168,6 +168,10 @@ public class FlowTaskController extends BaseController {
if(!this.ocrTaskchildPictureService.validateApprove(formid)){ if(!this.ocrTaskchildPictureService.validateApprove(formid)){
return ResultVoUtil.error("存在已经审批的任务。"); return ResultVoUtil.error("存在已经审批的任务。");
} }
if(!this.ocrTaskchildPictureService.validateBoole(formid)){
return ResultVoUtil.error("存在未判真假数据。");
}
//TODO 判断taskid是否为非法空置、taskid是否存在 //TODO 判断taskid是否为非法空置、taskid是否存在
@ -248,11 +252,30 @@ public class FlowTaskController extends BaseController {
//租户主键,由前端页面传送 //租户主键,由前端页面传送
String tenantId = request.getHeader("X-Tenant-Id"); String tenantId = request.getHeader("X-Tenant-Id");
String taskid = request.getParameter("taskid");
String states = request.getParameter("states");
String fromprojectid = request.getParameter("fromprojectid");
String fromuserid = request.getParameter("fromuserid");
String fromplanid = request.getParameter("fromplanid");
if(org.apache.commons.lang3.StringUtils.isBlank(tenantId)){ if(org.apache.commons.lang3.StringUtils.isBlank(tenantId)){
return ResultVoUtil.error("租户主键不能为空"); return ResultVoUtil.error("租户主键不能为空");
} }
if(StringUtils.isNotBlank(taskid)){
searchQuery.addEqual("taskid",taskid);
}
if(StringUtils.isNotBlank(states)){
searchQuery.addEqual("states",states);
}
if(StringUtils.isNotBlank(fromprojectid)){
searchQuery.addEqual("fromprojectid",fromprojectid);
}
if(StringUtils.isNotBlank(fromuserid)){
searchQuery.addEqual("fromuserid",fromuserid);
}
if(StringUtils.isNotBlank(fromplanid)){
searchQuery.addEqual("fromplanid",fromplanid);
}
User user = this.userService.getSessionUser(request); User user = this.userService.getSessionUser(request);
if(user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))){ if(user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))){
@ -262,7 +285,7 @@ public class FlowTaskController extends BaseController {
//如果assigneeId 为空查询发起流程,否则查询待办流程 //如果assigneeId 为空查询发起流程,否则查询待办流程
if(StringUtils.isNotBlank(assigneeId) && assigneeId.equals(user.getId().toString())){ if(StringUtils.isNotBlank(assigneeId) && assigneeId.equals(user.getId().toString())){
searchQuery.addEqual("assignee",user.getLoginname()); searchQuery.addEqual("assignee",user.getLoginname());
searchQuery.addEqual("states",SystemConstantsOa.OA_STATUS_TYPE_ING.toString()); // searchQuery.addEqual("states",SystemConstantsOa.OA_STATUS_TYPE_ING.toString());
}else{ }else{
searchQuery.addEqual("createuser",user.getLoginname()); searchQuery.addEqual("createuser",user.getLoginname());
} }
@ -450,4 +473,23 @@ public class FlowTaskController extends BaseController {
//return ResultVoUtil.success(); //return ResultVoUtil.success();
} }
/**
*
* @return
*/
@ApiOperation(value="重置流程流程", notes="重置流程流程")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
@ApiImplicitParam(paramType = "path",name = "buessinessno", value = "业务编码", required = true)
})
@GetMapping("/historyTask")
@ResponseBody
public ResultVo historyTask(HttpServletRequest request){
String fromid = request.getParameter("fromid");
String taskid = request.getParameter("buessinessno");
return flowTaskService.removeTask(fromid,taskid);
//return ResultVoUtil.success();
}
} }

@ -97,12 +97,16 @@ public class OcrPackagetaskController extends BaseController{
if(StringUtils.isBlank(tenantId)){ if(StringUtils.isBlank(tenantId)){
return ResultVoUtil.error("租户主键不能为空"); return ResultVoUtil.error("租户主键不能为空");
} }
String packageName = request.getParameter("packagename");
//获取当前登录人 //获取当前登录人
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request)); UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
QueryWrapper<OcrPackagetask> queryWrapper = new QueryWrapper<>(); QueryWrapper<OcrPackagetask> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("tenant_id",tenantId); queryWrapper.eq("tenant_id",tenantId);
if(StringUtils.isNotBlank(packageName)){
queryWrapper.like("packagename",packageName);
}
Page<OcrPackagetask> page = new Page<OcrPackagetask>(pageNo, pageSize); Page<OcrPackagetask> page = new Page<OcrPackagetask>(pageNo, pageSize);
IPage<OcrPackagetask> pageList = ocrPackagetaskService.page(page, queryWrapper); IPage<OcrPackagetask> pageList = ocrPackagetaskService.page(page, queryWrapper);
return ResultVoUtil.success(pageList); return ResultVoUtil.success(pageList);

@ -40,6 +40,8 @@ public interface OcrTaskchildPictureService extends BaseService<OcrTaskchildPict
* @return * @return
*/ */
public boolean validateApprove(String[] formid); public boolean validateApprove(String[] formid);
public boolean validateBoole(String[] formid);
/** /**
* *

@ -12,6 +12,7 @@ import cn.jyjz.xiaoyao.ocr.dataobject.OcrPicture;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture; import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
import cn.jyjz.xiaoyao.ocr.service.OcrPictureService; import cn.jyjz.xiaoyao.ocr.service.OcrPictureService;
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService; import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -25,131 +26,133 @@ import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* *
*/ */
@Service("ocrTaskchildPictureService") @Service("ocrTaskchildPictureService")
@Slf4j @Slf4j
public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchildPictureMybatisDao, OcrTaskchildPicture> implements OcrTaskchildPictureService { public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchildPictureMybatisDao, OcrTaskchildPicture> implements OcrTaskchildPictureService {
@Resource @Resource
private OcrTaskchildPictureMybatisDao ocrtaskchildpicturemybatisdao; private OcrTaskchildPictureMybatisDao ocrtaskchildpicturemybatisdao;
@Resource @Resource
private OcrPictureService ocrPictureService; private OcrPictureService ocrPictureService;
@Resource @Resource
IFlowTaskService iFlowTaskService; IFlowTaskService iFlowTaskService;
/**
* /**
* @param childpictureids *
* @return *
*/ * @param childpictureids
public ResultVo trueorfalse(String childpictureids, String packageid, String iztrueorfalse, String judgeid, String judgedesc){ * @return
*/
String[] cps = childpictureids.split(","); public ResultVo trueorfalse(String childpictureids, String packageid, String iztrueorfalse, String judgeid, String judgedesc) {
List<OcrPicture> saveList =new ArrayList<>(); String[] cps = childpictureids.split(",");
StringBuffer historyPname = new StringBuffer(); List<OcrPicture> saveList = new ArrayList<>();
StringBuffer taskType = new StringBuffer(); StringBuffer historyPname = new StringBuffer();
for(String childpictureid:cps){
OcrTaskchildPicture old = this.listPicturePackageId(childpictureid,Long.parseLong(packageid)); StringBuffer taskType = new StringBuffer();
for (String childpictureid : cps) {
//如果是历史图片,不允许进行设置 OcrTaskchildPicture old = this.listPicturePackageId(childpictureid, Long.parseLong(packageid));
if(old.isIzHistory()){
if(historyPname.length() > 0){ //如果是历史图片,不允许进行设置
historyPname.append("," + old.getOcrPicture().getImgname()); if (old.isIzHistory()) {
}else{ if (historyPname.length() > 0) {
historyPname.append(old.getOcrPicture().getImgname()); historyPname.append("," + old.getOcrPicture().getImgname());
} } else {
} historyPname.append(old.getOcrPicture().getImgname());
if(old.getStates().intValue() == 3 || old.getStates().intValue() == 5) { }
if(taskType.length() > 0){ }
taskType.append("," + old.getOcrPicture().getImgname()); if (old.getStates().intValue() == 3 || old.getStates().intValue() == 5) {
}else{ if (taskType.length() > 0) {
taskType.append(old.getOcrPicture().getImgname()); taskType.append("," + old.getOcrPicture().getImgname());
} } else {
} taskType.append(old.getOcrPicture().getImgname());
}
OcrPicture ocrPicture = old.getOcrPicture(); }
ocrPicture.setJudgeid(Long.parseLong(judgeid));
ocrPicture.setJudgedesc(judgedesc); OcrPicture ocrPicture = old.getOcrPicture();
ocrPicture.setIztrueorfalse(Integer.parseInt(iztrueorfalse)); ocrPicture.setJudgeid(Long.parseLong(judgeid));
ocrPicture.setUpdateTime(System.currentTimeMillis()); ocrPicture.setJudgedesc(judgedesc);
ocrPicture.setIztrueorfalse(Integer.parseInt(iztrueorfalse));
saveList.add(ocrPicture); ocrPicture.setUpdateTime(System.currentTimeMillis());
}
saveList.add(ocrPicture);
if(StringUtils.isNotBlank(historyPname.toString())){ }
return ResultVoUtil.error(historyPname.toString() + "为历史数据,不能标记。");
} if (StringUtils.isNotBlank(historyPname.toString())) {
else if(StringUtils.isNotBlank(taskType.toString())){ return ResultVoUtil.error(historyPname.toString() + "为历史数据,不能标记。");
return ResultVoUtil.error( taskType.toString() + "已经审批,不能标记。"); } else if (StringUtils.isNotBlank(taskType.toString())) {
} return ResultVoUtil.error(taskType.toString() + "已经审批,不能标记。");
}
return this.ocrPictureService.updateBatchById(saveList)?ResultVoUtil.success():ResultVoUtil.error();
} return this.ocrPictureService.updateBatchById(saveList) ? ResultVoUtil.success() : ResultVoUtil.error();
}
public ResultVo clearmark(String childpictureids, String packageid){
String[] cps = childpictureids.split(","); public ResultVo clearmark(String childpictureids, String packageid) {
String[] cps = childpictureids.split(",");
List<OcrPicture> saveList =new ArrayList<>();
List<OcrPicture> saveList = new ArrayList<>();
StringBuffer historyPname = new StringBuffer();
StringBuffer historyPname = new StringBuffer();
StringBuffer taskType = new StringBuffer();
for(String childpictureid:cps){ StringBuffer taskType = new StringBuffer();
OcrTaskchildPicture old = this.listPicturePackageId(childpictureid,Long.parseLong(packageid)); for (String childpictureid : cps) {
OcrTaskchildPicture old = this.listPicturePackageId(childpictureid, Long.parseLong(packageid));
//如果是历史图片,不允许进行设置
if(old.isIzHistory()){ //如果是历史图片,不允许进行设置
if(historyPname.length() > 0){ if (old.isIzHistory()) {
historyPname.append("," + old.getOcrPicture().getImgname()); if (historyPname.length() > 0) {
}else{ historyPname.append("," + old.getOcrPicture().getImgname());
historyPname.append(old.getOcrPicture().getImgname()); } else {
} historyPname.append(old.getOcrPicture().getImgname());
} }
if(old.getStates().intValue() == 3 || old.getStates().intValue() == 5) { }
if(taskType.length() > 0){ if (old.getStates().intValue() == 3 || old.getStates().intValue() == 5) {
taskType.append("," + old.getOcrPicture().getImgname()); if (taskType.length() > 0) {
}else{ taskType.append("," + old.getOcrPicture().getImgname());
taskType.append(old.getOcrPicture().getImgname()); } else {
} taskType.append(old.getOcrPicture().getImgname());
} }
}
OcrPicture ocrPicture = old.getOcrPicture();
ocrPicture.setJudgeid(null); OcrPicture ocrPicture = old.getOcrPicture();
ocrPicture.setJudgedesc(null); ocrPicture.setJudgeid(null);
ocrPicture.setIztrueorfalse(null); ocrPicture.setJudgedesc(null);
ocrPicture.setUpdateTime(System.currentTimeMillis()); ocrPicture.setIztrueorfalse(null);
ocrPicture.setUpdateTime(System.currentTimeMillis());
saveList.add(ocrPicture);
} saveList.add(ocrPicture);
}
if(StringUtils.isNotBlank(historyPname.toString())){
return ResultVoUtil.error(historyPname.toString() + "为历史数据,不能清除标记。"); if (StringUtils.isNotBlank(historyPname.toString())) {
} return ResultVoUtil.error(historyPname.toString() + "为历史数据,不能清除标记。");
else if(StringUtils.isNotBlank(taskType.toString())){ } else if (StringUtils.isNotBlank(taskType.toString())) {
return ResultVoUtil.error( taskType.toString() + "已经审批,不能清除标记。"); return ResultVoUtil.error(taskType.toString() + "已经审批,不能清除标记。");
} }
return this.ocrPictureService.updateBatchById(saveList)?ResultVoUtil.success():ResultVoUtil.error(); return this.ocrPictureService.updateBatchById(saveList) ? ResultVoUtil.success() : ResultVoUtil.error();
} }
/** /**
* *
* @param childpictureid *
* @return * @param childpictureid
*/ * @return
public boolean pass(String childpictureid,OcrTaskchildPicture ocrTaskchildPicture){ */
OcrTaskchildPicture old = this.getById(childpictureid); public boolean pass(String childpictureid, OcrTaskchildPicture ocrTaskchildPicture) {
OcrTaskchildPicture old = this.getById(childpictureid);
//判断当前图片是否在任务包中,如果不在任务保重,不允许设置图片真假
if(!old.getPackageid().equals(ocrTaskchildPicture.getPackageid())){ //判断当前图片是否在任务包中,如果不在任务保重,不允许设置图片真假
return false; if (!old.getPackageid().equals(ocrTaskchildPicture.getPackageid())) {
} return false;
}
// //
// //更新图片真假 // //更新图片真假
// if(StringUtils.isNotBlank(ocrTaskchildPicture.getIzpass())){ // if(StringUtils.isNotBlank(ocrTaskchildPicture.getIzpass())){
@ -162,109 +165,131 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
// old.setPicturecompare(ocrTaskchildPicture.getPicturecompare()); // old.setPicturecompare(ocrTaskchildPicture.getPicturecompare());
// } // }
old.setUpdatetime(System.currentTimeMillis()); old.setUpdatetime(System.currentTimeMillis());
return this.updateById(old); return this.updateById(old);
} }
/** /**
* *
* @param formid *
* @param userToken * @param formid
* @return * @param userToken
*/ * @return
public boolean validateAssignee(String[] formid,UserToken userToken){ */
QueryWrapper queryWrapper = new QueryWrapper(); public boolean validateAssignee(String[] formid, UserToken userToken) {
queryWrapper.in("ID",formid); QueryWrapper queryWrapper = new QueryWrapper();
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper); queryWrapper.in("ID", formid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper);
//目前没有做其他信息返回,如果需要再做修改
for(OcrTaskchildPicture ocrTaskchildPicture:list){ //目前没有做其他信息返回,如果需要再做修改
//判断审批人是否为当前登录用户 for (OcrTaskchildPicture ocrTaskchildPicture : list) {
if(userToken.getLoginname().equals(ocrTaskchildPicture.getAssignee())){ //判断审批人是否为当前登录用户
if (userToken.getLoginname().equals(ocrTaskchildPicture.getAssignee())) {
}else{
return false; } else {
} return false;
} }
return true; }
} return true;
}
/**
* /**
* @param formid *
* @return *
*/ * @param formid
public boolean validateApprove(String[] formid){ * @return
QueryWrapper queryWrapper = new QueryWrapper(); */
queryWrapper.in("ID",formid); public boolean validateApprove(String[] formid) {
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper); QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("ID", formid);
//目前没有做其他信息返回,如果需要再做修改 List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper);
for(OcrTaskchildPicture ocrTaskchildPicture:list){
//判断当前审批状态为拒绝或者通过的,不允许再做审批 //目前没有做其他信息返回,如果需要再做修改
if(ocrTaskchildPicture.getStates().intValue() == SystemConstantsOa.OA_STATUS_TYPE_END for (OcrTaskchildPicture ocrTaskchildPicture : list) {
|| ocrTaskchildPicture.getStates().intValue() == SystemConstantsOa.OA_STATUS_TYPE_REFUSE ){ //判断当前审批状态为拒绝或者通过的,不允许再做审批
return false; if (ocrTaskchildPicture.getStates().intValue() == SystemConstantsOa.OA_STATUS_TYPE_END
}else{ || ocrTaskchildPicture.getStates().intValue() == SystemConstantsOa.OA_STATUS_TYPE_REFUSE) {
return false;
} } else {
}
return true; }
} }
return true;
@Override }
public List<OcrTaskchildPicture> listAll(String tenantId, String createUser, QueryWrapper queryWrapper){
/**
*
long count = this.count(queryWrapper); *
* @param formid
Page<OcrTaskchildPicture> page = new Page<>(1, count); * @return
page.setMaxLimit(count); */
public boolean validateBoole(String[] formid) {
IPage<OcrTaskchildPicture> iPage = this.page(page,queryWrapper); QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.in("ID", formid);
return iPage.getRecords(); List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapper);
} List<OcrPicture> pictures = ocrPictureService.list(new LambdaQueryWrapper<OcrPicture>().eq(OcrPicture::getId, list.stream().map(OcrTaskchildPicture::getPictureid).collect(Collectors.toList())).isNull(OcrPicture::getIztrueorfalse));
if (pictures.size() > 1) {
/** return false;
* }
* @param taskids return true;
* @return }
*/
public boolean markPoint(List<Long> taskids){ @Override
UpdateWrapper updateWrapper = new UpdateWrapper(); public List<OcrTaskchildPicture> listAll(String tenantId, String createUser, QueryWrapper queryWrapper) {
updateWrapper.set("HAVEPOINTS",1);
updateWrapper.in("ID",taskids);
long count = this.count(queryWrapper);
return this.update(updateWrapper);
} Page<OcrTaskchildPicture> page = new Page<>(1, count);
page.setMaxLimit(count);
/**
* IPage<OcrTaskchildPicture> iPage = this.page(page, queryWrapper);
* @param packageid
* @return return iPage.getRecords();
*/ }
public List<OcrTaskchildPicture> markpoint(String packageid){
QueryWrapper<OcrTaskchildPicture> queryWrapperNew = new QueryWrapper<>(); /**
queryWrapperNew.eq("HAVEPOINTS","1"); *
queryWrapperNew.eq("PACKAGEID",packageid); *
* @param taskids
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapperNew); * @return
this.formatTask(list,packageid); */
public boolean markPoint(List<Long> taskids) {
return list; UpdateWrapper updateWrapper = new UpdateWrapper();
} updateWrapper.set("HAVEPOINTS", 1);
updateWrapper.in("ID", taskids);
/**
* return this.update(updateWrapper);
* @param fromid }
* @return
*/ /**
public OcrTaskchildPicture listPicturePackageId(String fromid,Long packageid){ *
OcrTaskchildPicture ocrTaskchildPicture = this.getById(fromid); *
//查询图片对象 * @param packageid
OcrPicture ocrPicture = this.ocrPictureService.selectDtoById(ocrTaskchildPicture.getPictureid()); * @return
*/
public List<OcrTaskchildPicture> markpoint(String packageid) {
QueryWrapper<OcrTaskchildPicture> queryWrapperNew = new QueryWrapper<>();
queryWrapperNew.eq("HAVEPOINTS", "1");
queryWrapperNew.eq("PACKAGEID", packageid);
List<OcrTaskchildPicture> list = this.ocrtaskchildpicturemybatisdao.selectList(queryWrapperNew);
this.formatTask(list, packageid);
return list;
}
/**
*
*
* @param fromid
* @return
*/
public OcrTaskchildPicture listPicturePackageId(String fromid, Long packageid) {
OcrTaskchildPicture ocrTaskchildPicture = this.getById(fromid);
//查询图片对象
OcrPicture ocrPicture = this.ocrPictureService.selectDtoById(ocrTaskchildPicture.getPictureid());
// String pictureids = ocrTaskchildPicture.getPicturecompare(); // String pictureids = ocrTaskchildPicture.getPicturecompare();
// String[] splitPictureids = pictureids.split(","); // String[] splitPictureids = pictureids.split(",");
@ -272,103 +297,105 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
// //设置是否为历史信息 // //设置是否为历史信息
// ocrTaskchildPicture.setIzHistory(listPictureids.contains(ocrPicture.getPictureid())?false:true); // ocrTaskchildPicture.setIzHistory(listPictureids.contains(ocrPicture.getPictureid())?false:true);
//如果当前任务的任务包主键一致,说明不是历史数据,如果不一致,说明是历史数据 //如果当前任务的任务包主键一致,说明不是历史数据,如果不一致,说明是历史数据
if(packageid.toString().equals(ocrTaskchildPicture.getPackageid().toString())){ if (packageid.toString().equals(ocrTaskchildPicture.getPackageid().toString())) {
ocrTaskchildPicture.setIzHistory(false); ocrTaskchildPicture.setIzHistory(false);
}else{ } else {
ocrTaskchildPicture.setIzHistory(true); ocrTaskchildPicture.setIzHistory(true);
} }
//查询审批流节点信息 //查询审批流节点信息
List<Task> taskList = iFlowTaskService.nowRunTask(ocrTaskchildPicture.getProcessinstanceid(),ocrTaskchildPicture.getProcessdefinitionid()); List<Task> taskList = iFlowTaskService.nowRunTask(ocrTaskchildPicture.getProcessinstanceid(), ocrTaskchildPicture.getProcessdefinitionid());
if(null != taskList && !taskList.isEmpty()) { if (null != taskList && !taskList.isEmpty()) {
ocrTaskchildPicture.setTaskId(taskList.get(0).getId()); ocrTaskchildPicture.setTaskId(taskList.get(0).getId());
} }
//获取当前真假标记 //获取当前真假标记
ocrTaskchildPicture.setIztrueorfalse(ocrPicture.getIztrueorfalse()); ocrTaskchildPicture.setIztrueorfalse(ocrPicture.getIztrueorfalse());
//是否已经审批 //是否已经审批
ocrTaskchildPicture.setWorkStatus(ocrPicture.getWorkStatus()); ocrTaskchildPicture.setWorkStatus(ocrPicture.getWorkStatus());
ocrTaskchildPicture.setOcrPicture(ocrPicture); ocrTaskchildPicture.setOcrPicture(ocrPicture);
return ocrTaskchildPicture; return ocrTaskchildPicture;
} }
/**
*
* @param taskchildpictureid
* @param queryWrapper
* @return
*/
public IPage<OcrTaskchildPicture> listByPackageId(String taskchildpictureid, ParamterPage paramterPage,QueryWrapper queryWrapper,String orderbyname,String orderbyvalue,String packageid,String tenantId ){
Page<OcrTaskchildPicture> page = new Page<>(paramterPage.getStart(), paramterPage.getPagesize());
//当前显示的任务对象 /**
OcrTaskchildPicture mainOcrTaskchildPicture = this.getById(taskchildpictureid); *
*
* @param taskchildpictureid
* @param queryWrapper
* @return
*/
public IPage<OcrTaskchildPicture> listByPackageId(String taskchildpictureid, ParamterPage paramterPage, QueryWrapper queryWrapper, String orderbyname, String orderbyvalue, String packageid, String tenantId) {
Page<OcrTaskchildPicture> page = new Page<>(paramterPage.getStart(), paramterPage.getPagesize());
//判断当前图片是否为历史图片 //当前显示的任务对象
if(!packageid.equals(mainOcrTaskchildPicture.getPackageid().toString())){ OcrTaskchildPicture mainOcrTaskchildPicture = this.getById(taskchildpictureid);
QueryWrapper<OcrTaskchildPicture> queryWrapperNew = new QueryWrapper<>(); //判断当前图片是否为历史图片
queryWrapperNew.eq("TENANTID",tenantId); if (!packageid.equals(mainOcrTaskchildPicture.getPackageid().toString())) {
queryWrapperNew.eq("PACKAGEID",packageid);
//查询非历史图片存在的集合 QueryWrapper<OcrTaskchildPicture> queryWrapperNew = new QueryWrapper<>();
IPage<OcrTaskchildPicture> pageNew = this.selectSearchListPage(paramterPage,queryWrapperNew); queryWrapperNew.eq("TENANTID", tenantId);
queryWrapperNew.eq("PACKAGEID", packageid);
//如果是历史图片,从非历史图片存在的集合中随机选取一个 //查询非历史图片存在的集合
if(!pageNew.getRecords().isEmpty()){ IPage<OcrTaskchildPicture> pageNew = this.selectSearchListPage(paramterPage, queryWrapperNew);
mainOcrTaskchildPicture = pageNew.getRecords().get(0);
}
} //如果是历史图片,从非历史图片存在的集合中随机选取一个
if (!pageNew.getRecords().isEmpty()) {
mainOcrTaskchildPicture = pageNew.getRecords().get(0);
}
//不包含当前选中的图片 }
queryWrapper.ne("ID",taskchildpictureid);
queryWrapper.eq("TENANTID",tenantId); //不包含当前选中的图片
if(StringUtils.isNotBlank(orderbyname) && orderbyname.equals("asc")){ queryWrapper.ne("ID", taskchildpictureid);
if(StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("pictureResult")){
queryWrapper.orderByAsc("FIELD(PICTUREID,"+ mainOcrTaskchildPicture.getOcpictureid() +")");
}else if(StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("fromuptime")){
queryWrapper.orderByAsc("FROMUPTIME");
}
}else if(StringUtils.isNotBlank(orderbyname) && orderbyname.equals("desc")){ queryWrapper.eq("TENANTID", tenantId);
if (StringUtils.isNotBlank(orderbyname) && orderbyname.equals("asc")) {
if (StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("pictureResult")) {
queryWrapper.orderByAsc("FIELD(PICTUREID," + mainOcrTaskchildPicture.getOcpictureid() + ")");
} else if (StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("fromuptime")) {
queryWrapper.orderByAsc("FROMUPTIME");
}
if(StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("pictureResult")){ } else if (StringUtils.isNotBlank(orderbyname) && orderbyname.equals("desc")) {
queryWrapper.orderByDesc("FIELD(PICTUREID,"+ mainOcrTaskchildPicture.getOcpictureid() +")");
}else if(StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("fromuptime")){
queryWrapper.orderByDesc("FROMUPTIME");
}
} if (StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("pictureResult")) {
queryWrapper.in("PICTUREID",mainOcrTaskchildPicture.getOcpictureid().split(",")); queryWrapper.orderByDesc("FIELD(PICTUREID," + mainOcrTaskchildPicture.getOcpictureid() + ")");
} else if (StringUtils.isNotBlank(orderbyvalue) && orderbyvalue.equals("fromuptime")) {
queryWrapper.orderByDesc("FROMUPTIME");
}
}
queryWrapper.in("PICTUREID", mainOcrTaskchildPicture.getOcpictureid().split(","));
IPage<OcrTaskchildPicture> iPage = this.page(page,queryWrapper); IPage<OcrTaskchildPicture> iPage = this.page(page, queryWrapper);
this.formatTask(iPage.getRecords(),packageid); this.formatTask(iPage.getRecords(), packageid);
return iPage; return iPage;
} }
/** /**
* *
* @param list *
* @param packageid * @param list
*/ * @param packageid
private void formatTask(List<OcrTaskchildPicture> list,String packageid){ */
for(OcrTaskchildPicture ocrTaskchildPicture:list){ private void formatTask(List<OcrTaskchildPicture> list, String packageid) {
for (OcrTaskchildPicture ocrTaskchildPicture : list) {
//查询审批流节点信息 //查询审批流节点信息
List<Task> taskList = iFlowTaskService.nowRunTask(ocrTaskchildPicture.getProcessinstanceid(),ocrTaskchildPicture.getProcessdefinitionid()); List<Task> taskList = iFlowTaskService.nowRunTask(ocrTaskchildPicture.getProcessinstanceid(), ocrTaskchildPicture.getProcessdefinitionid());
if(null != taskList && !taskList.isEmpty()) { if (null != taskList && !taskList.isEmpty()) {
ocrTaskchildPicture.setTaskId(taskList.get(0).getId()); ocrTaskchildPicture.setTaskId(taskList.get(0).getId());
} }
// //非历史图片主键集合 // //非历史图片主键集合
// String pictureids = ocrTaskchildPicture.getPicturecompare(); // String pictureids = ocrTaskchildPicture.getPicturecompare();
// String[] splitPictureids = pictureids.split(","); // String[] splitPictureids = pictureids.split(",");
@ -376,117 +403,122 @@ public class OcrTaskchildPictureServiceImpl extends BaseServiceImpl<OcrTaskchild
// //设置是否为历史信息 // //设置是否为历史信息
// ocrTaskchildPicture.setIzHistory(listPictureids.contains(ocrTaskchildPicture.getPictureid())?false:true); // ocrTaskchildPicture.setIzHistory(listPictureids.contains(ocrTaskchildPicture.getPictureid())?false:true);
//如果当前任务的任务包主键一致,说明不是历史数据,如果不一致,说明是历史数据 //如果当前任务的任务包主键一致,说明不是历史数据,如果不一致,说明是历史数据
if(packageid.equals(ocrTaskchildPicture.getPackageid().toString())){ if (packageid.equals(ocrTaskchildPicture.getPackageid().toString())) {
ocrTaskchildPicture.setIzHistory(false); ocrTaskchildPicture.setIzHistory(false);
}else{ } else {
ocrTaskchildPicture.setIzHistory(true); ocrTaskchildPicture.setIzHistory(true);
} }
OcrPicture ocrPicture = this.ocrPictureService.selectDtoById(ocrTaskchildPicture.getPictureid()); OcrPicture ocrPicture = this.ocrPictureService.selectDtoById(ocrTaskchildPicture.getPictureid());
//获取当前真假标记 //获取当前真假标记
ocrTaskchildPicture.setIztrueorfalse(ocrPicture.getIztrueorfalse()); ocrTaskchildPicture.setIztrueorfalse(ocrPicture.getIztrueorfalse());
//是否已经审批 //是否已经审批
ocrTaskchildPicture.setWorkStatus(ocrPicture.getWorkStatus()); ocrTaskchildPicture.setWorkStatus(ocrPicture.getWorkStatus());
ocrTaskchildPicture.setOcrPicture(ocrPicture); ocrTaskchildPicture.setOcrPicture(ocrPicture);
} }
} }
/** /**
* *
* @param id *
* @return * @param id
*/ * @return
public boolean closeOrder(String id){ */
OcrTaskchildPicture ocrTaskchildPicture = this.getById(id); public boolean closeOrder(String id) {
if(null != ocrTaskchildPicture){ OcrTaskchildPicture ocrTaskchildPicture = this.getById(id);
if (null != ocrTaskchildPicture) {
// ocrTaskchildPicture.setIzclose("0"); // ocrTaskchildPicture.setIzclose("0");
return this.updateById(ocrTaskchildPicture); return this.updateById(ocrTaskchildPicture);
} }
return false; return false;
} }
/** /**
* *
* @param ocrPicture *
* @param tenantId * @param ocrPicture
* @param sysUser * @param tenantId
*/ * @param sysUser
public OcrTaskchildPicture create(OcrPicture ocrPicture, String tenantId , UserToken sysUser, Long packageid,String buessinessno){ */
public OcrTaskchildPicture create(OcrPicture ocrPicture, String tenantId, UserToken sysUser, Long packageid, String buessinessno) {
OcrTaskchildPicture ocrTaskchildPicture = new OcrTaskchildPicture();
ocrTaskchildPicture.setBuessinessno(buessinessno); OcrTaskchildPicture ocrTaskchildPicture = new OcrTaskchildPicture();
ocrTaskchildPicture.setFromtaskid(ocrPicture.getRemark()); ocrTaskchildPicture.setBuessinessno(buessinessno);
ocrTaskchildPicture.setFromtaskname(ocrPicture.getTaskname()); ocrTaskchildPicture.setFromtaskid(ocrPicture.getRemark());
ocrTaskchildPicture.setPictureid(ocrPicture.getId()); ocrTaskchildPicture.setFromtaskname(ocrPicture.getTaskname());
ocrTaskchildPicture.setTenantid(Long.parseLong(tenantId)); ocrTaskchildPicture.setPictureid(ocrPicture.getId());
ocrTaskchildPicture.setCreateuser(sysUser.getLoginname()); ocrTaskchildPicture.setTenantid(Long.parseLong(tenantId));
ocrTaskchildPicture.setCreateusername(sysUser.getUsername()); ocrTaskchildPicture.setCreateuser(sysUser.getLoginname());
ocrTaskchildPicture.setCreatedate(System.currentTimeMillis()); ocrTaskchildPicture.setCreateusername(sysUser.getUsername());
ocrTaskchildPicture.setPackageid(packageid); ocrTaskchildPicture.setCreatedate(System.currentTimeMillis());
ocrTaskchildPicture.setCategoryid(ocrPicture.getCategoryid()); ocrTaskchildPicture.setPackageid(packageid);
ocrTaskchildPicture.setCategoryid(ocrPicture.getCategoryid());
ocrTaskchildPicture.setFromsourceid(ocrPicture.getField4());
ocrTaskchildPicture.setFromuptime(ocrPicture.getUptime()); ocrTaskchildPicture.setFromsourceid(ocrPicture.getField4());
ocrTaskchildPicture.setFromplanid(ocrPicture.getPlanid()); ocrTaskchildPicture.setFromuptime(ocrPicture.getUptime());
ocrTaskchildPicture.setFromprojectid(ocrPicture.getProjectid()); ocrTaskchildPicture.setFromplanid(ocrPicture.getPlanid());
ocrTaskchildPicture.setFromuserid(ocrPicture.getUpuserid()); ocrTaskchildPicture.setFromprojectid(ocrPicture.getProjectid());
ocrTaskchildPicture.setFromuserid(ocrPicture.getUpuserid());
StringBuffer pcid = new StringBuffer();
StringBuffer result = new StringBuffer(); StringBuffer pcid = new StringBuffer();
for(OcrPicture comp:ocrPicture.getListCom()){ StringBuffer result = new StringBuffer();
if(null == pcid || pcid.toString().length() < 1){ for (OcrPicture comp : ocrPicture.getListCom()) {
pcid.append(comp.getId()); if (null == pcid || pcid.toString().length() < 1) {
result.append(comp.getResult()); pcid.append(comp.getId());
}else{ result.append(comp.getResult());
pcid.append("," + comp.getId()); } else {
result.append("," + comp.getResult()); pcid.append("," + comp.getId());
} result.append("," + comp.getResult());
} }
}
ocrTaskchildPicture.setOcpictureid(pcid.toString());
ocrTaskchildPicture.setPictureresult(result.toString()); ocrTaskchildPicture.setOcpictureid(pcid.toString());
ocrTaskchildPicture.setPicturecompare(String.join(",",ocrPicture.getPicturecompareList())); ocrTaskchildPicture.setPictureresult(result.toString());
ocrTaskchildPicture.setPicturecompare(String.join(",", ocrPicture.getPicturecompareList()));
return this.save(ocrTaskchildPicture)?ocrTaskchildPicture:null;
} return this.save(ocrTaskchildPicture) ? ocrTaskchildPicture : null;
}
/**
* /**
* @param query *
* @return *
*/ * @param query
public List<OcrTaskchildPicture> listFinal(Map<String, Object> query){ * @return
*/
return this.ocrtaskchildpicturemybatisdao.listFinal(query); public List<OcrTaskchildPicture> listFinal(Map<String, Object> query) {
}
return this.ocrtaskchildpicturemybatisdao.listFinal(query);
}
/**
* \
* @param taskchildid /**
* @return * \
*/ *
public OcrPicture findOcrPictureByTaskchildid(String taskchildid){ * @param taskchildid
OcrTaskchildPicture ocrTaskchildPicture = this.ocrtaskchildpicturemybatisdao.selectById(taskchildid); * @return
*/
if(null == ocrTaskchildPicture){ public OcrPicture findOcrPictureByTaskchildid(String taskchildid) {
return null; OcrTaskchildPicture ocrTaskchildPicture = this.ocrtaskchildpicturemybatisdao.selectById(taskchildid);
}
if (null == ocrTaskchildPicture) {
OcrPicture ocrPicture = ocrPictureService.selectDtoById(ocrTaskchildPicture.getPictureid()); return null;
}
return ocrPicture;
} OcrPicture ocrPicture = ocrPictureService.selectDtoById(ocrTaskchildPicture.getPictureid());
/** return ocrPicture;
* }
* @param query
* @return /**
*/ *
public Long listFinalCount(Map<String, Object> query){ *
return this.ocrtaskchildpicturemybatisdao.listFinalCount(query); * @param query
} * @return
*/
public Long listFinalCount(Map<String, Object> query) {
return this.ocrtaskchildpicturemybatisdao.listFinalCount(query);
}
} }

@ -111,6 +111,12 @@
<if test="tenantid != null"> and TENANTID ${tenantid.dataOp} ${tenantid.likestar}#{tenantid.value}${tenantid.likeend}</if> <if test="tenantid != null"> and TENANTID ${tenantid.dataOp} ${tenantid.likestar}#{tenantid.value}${tenantid.likeend}</if>
<if test="packageid != null"> and PACKAGEID ${packageid.dataOp} ${packageid.likestar}#{packageid.value}${packageid.likeend}</if> <if test="packageid != null"> and PACKAGEID ${packageid.dataOp} ${packageid.likestar}#{packageid.value}${packageid.likeend}</if>
<if test="processdefinitionid != null"> and PROCESSDEFINITIONID ${processdefinitionid.dataOp} ${processdefinitionid.likestar}#{processdefinitionid.value}${processdefinitionid.likeend}</if> <if test="processdefinitionid != null"> and PROCESSDEFINITIONID ${processdefinitionid.dataOp} ${processdefinitionid.likestar}#{processdefinitionid.value}${processdefinitionid.likeend}</if>
<if test="taskid != null"> and TASKID ${taskid.dataOp} ${taskid.likestar}#{taskid.value}${taskid.likeend}</if>
<if test="fromprojectid != null"> and FROMPROJECTID ${fromprojectid.dataOp} ${fromprojectid.likestar}#{fromprojectid.value}${fromprojectid.likeend}</if>
<if test="fromuserid != null"> and FROMUSERID ${fromuserid.dataOp} ${fromuserid.likestar}#{fromuserid.value}${fromuserid.likeend}</if>
<if test="fromplanid != null"> and FROMPLANID ${fromplanid.dataOp} ${fromplanid.likestar}#{fromplanid.value}${fromplanid.likeend}</if>
<if test="listFlowCcUserid != null"> <if test="listFlowCcUserid != null">
and ID in and ID in
<foreach collection="listFlowCcUserid" item="item" index="index" open="(" separator="," close=")" > <foreach collection="listFlowCcUserid" item="item" index="index" open="(" separator="," close=")" >

Loading…
Cancel
Save