Merge remote-tracking branch 'origin/master'

pull/1/head
lzCodeGarden 1 year ago
commit f133c8e9a8

@ -15,6 +15,7 @@ import cn.jyjz.xiaoyao.common.base.param.ParamterPage;
import cn.jyjz.xiaoyao.common.base.service.UserTokenService; import cn.jyjz.xiaoyao.common.base.service.UserTokenService;
import cn.jyjz.xiaoyao.common.base.util.RequestBaseUtil; import cn.jyjz.xiaoyao.common.base.util.RequestBaseUtil;
import cn.jyjz.xiaoyao.common.base.util.requestFormat.SearchQuery; import cn.jyjz.xiaoyao.common.base.util.requestFormat.SearchQuery;
import cn.jyjz.xiaoyao.common.base.util.requestFormat.SearchQueryForm;
import cn.jyjz.xiaoyao.common.base.vo.ResultVo; import cn.jyjz.xiaoyao.common.base.vo.ResultVo;
import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil; import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil;
import cn.jyjz.xiaoyao.common.base.vo.UserToken; import cn.jyjz.xiaoyao.common.base.vo.UserToken;
@ -44,10 +45,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.text.SimpleDateFormat;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Api(tags="ocr_流程接口") @Api(tags="ocr_流程接口")
@ -365,6 +364,8 @@ public class FlowTaskController extends BaseController {
} }
return ResultVoUtil.success(pageUtils); return ResultVoUtil.success(pageUtils);
} }
/** /**
* *
* @return * @return
@ -376,30 +377,70 @@ public class FlowTaskController extends BaseController {
@GetMapping("/listfinal") @GetMapping("/listfinal")
@ResponseBody @ResponseBody
public ResultVo<OcrTaskchildPicture> listFinalData(PageUtils<OcrTaskchildPicture> pageUtils, public ResultVo<OcrTaskchildPicture> listFinalData(PageUtils<OcrTaskchildPicture> pageUtils,
@RequestParam(name="search_fromuserid", defaultValue="",required = false) String searchFromuserid, @RequestParam(name="izupuser", defaultValue="",required = false) String izupuser,
@RequestParam(name="search_fromprojectid", defaultValue="",required = false) String searchFromprojectid, @RequestParam(name="izproject", defaultValue="",required = false) String izproject,
@RequestParam(name="search_fromplanid", defaultValue="",required = false) String searchFromplanid, @RequestParam(name="izplan", defaultValue="",required = false) String izplan,
@RequestParam(name="search_states", defaultValue="",required = false) String searchStates, @RequestParam(name="izstatus", defaultValue="",required = false) String izstatus,
@RequestParam(name="search_fromsourceid", defaultValue="",required = false) String searchFromsourceid, @RequestParam(name="iztaskrrom", defaultValue="",required = false) String iztaskrrom,
@RequestParam(name="fromuptime_start", defaultValue="",required = false) BigDecimal fromuptimeStart, @RequestParam(name="izuptime", defaultValue="",required = false) String izuptime,
@RequestParam(name="fromuptime_end", defaultValue="",required = false) BigDecimal fromuptimeEnd,
HttpServletRequest request){ HttpServletRequest request){
SearchQuery searchQuery = new SearchQuery(); SearchQuery searchQuery = new SearchQuery();
if(org.springframework.util.StringUtils.hasText(searchFromuserid)){ if(org.springframework.util.StringUtils.hasText(izupuser)){
searchQuery.addEqual("fromuserid",searchFromuserid); // searchQuery.addEqual("fromuserid",izupuser);
if (izupuser.contains(",")) {
String[] userIds = izupuser.split(",");
List<String> arrayData = Arrays.asList(userIds);
SearchQueryForm searchQueryForm = new SearchQueryForm();
searchQuery.addIn("fromuserid", arrayData);
} else {
searchQuery.addEqual("fromuserid", izupuser);
}
}
if (org.springframework.util.StringUtils.hasText(izproject)) {
if (izproject.contains(",")) {
String[] projectIds = izproject.split(","); // 以逗号拆分字符串
searchQuery.addIn("fromprojectid", projectIds);
} else {
searchQuery.addEqual("fromprojectid", izproject);
}
}
if (org.springframework.util.StringUtils.hasText(izplan)) {
if (izplan.contains(",")) {
String[] planIds = izplan.split(","); // 以逗号拆分字符串
searchQuery.addIn("fromplanid", planIds);
} else {
searchQuery.addEqual("fromplanid", izplan);
} }
if(org.springframework.util.StringUtils.hasText(searchFromprojectid)){
searchQuery.addEqual("fromprojectid",searchFromprojectid);
} }
if(org.springframework.util.StringUtils.hasText(searchFromplanid)){ if (org.springframework.util.StringUtils.hasText(izstatus)) {
searchQuery.addEqual("fromplanid",searchFromplanid); if (izstatus.contains(",")) {
String[] statusIds = izstatus.split(","); // 以逗号拆分字符串
searchQuery.addIn("states", statusIds);
} else {
searchQuery.addEqual("states", izstatus);
} }
if(org.springframework.util.StringUtils.hasText(searchStates)){
searchQuery.addEqual("states",searchStates);
} }
if(org.springframework.util.StringUtils.hasText(searchFromsourceid)){ if (org.springframework.util.StringUtils.hasText(iztaskrrom)) {
searchQuery.addEqual("fromsourceid",searchFromsourceid); if (iztaskrrom.contains(",")) {
String[] taskrromIds = iztaskrrom.split(","); // 以逗号拆分字符串
searchQuery.addIn("fromsourceid", taskrromIds);
} else {
searchQuery.addEqual("fromsourceid", iztaskrrom);
} }
}
//
// if(org.springframework.util.StringUtils.hasText(izproject)){
// searchQuery.addEqual("fromprojectid",izproject);
// }
// if(org.springframework.util.StringUtils.hasText(izplan)){
// searchQuery.addEqual("fromplanid",izplan);
// }
// if(org.springframework.util.StringUtils.hasText(izstatus)){
// searchQuery.addEqual("states",izstatus);
// }
// if(org.springframework.util.StringUtils.hasText(iztaskrrom)){
// searchQuery.addEqual("fromsourceid",iztaskrrom);
// }
//租户主键,由前端页面传送 //租户主键,由前端页面传送
String tenantId = request.getHeader("X-Tenant-Id"); String tenantId = request.getHeader("X-Tenant-Id");
@ -414,11 +455,48 @@ public class FlowTaskController extends BaseController {
} }
Map<String,Object> query = searchQuery.getQuery(); Map<String,Object> query = searchQuery.getQuery();
if(fromuptimeStart != null){
query.put("fromuptimeStart",fromuptimeStart); if(org.springframework.util.StringUtils.hasText(izuptime)){
String[] dateRange = izuptime.split("-");
// if (dateRange.length == 2) {
// try {
// long startTimeStamp = Long.parseLong(dateRange[0].trim());
// long endTimeStamp = Long.parseLong(dateRange[1].trim());
// query.put("fromuptimeStart", startTimeStamp);
// query.put("fromuptimeEnd", endTimeStamp);
// } catch (NumberFormatException e) {
// e.printStackTrace();
// }
// }
if (dateRange.length == 2) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
// 解析开始时间
long startTimeStamp = Long.parseLong(dateRange[0].trim());
Date startDate = new Date(startTimeStamp);
String startDateString = sdf.format(startDate);
// 解析结束时间
long endTimeStamp = Long.parseLong(dateRange[1].trim());
Date endDate = new Date(endTimeStamp);
String endDateString = sdf.format(endDate);
// 如果开始时间不为空,则将其放入查询条件中
if (!startDateString.isEmpty()) {
query.put("fromuptimeStart", startDateString);
}
// 如果结束时间不为空,则将其放入查询条件中
if (!endDateString.isEmpty()) {
query.put("fromuptimeEnd", endDateString);
}
} catch (NumberFormatException e) {
// 处理时间戳解析异常
e.printStackTrace();
}
} }
if(fromuptimeEnd != null) {
query.put("fromuptimeEnd", fromuptimeEnd);
} }
flowTaskService.getFinalProcessInstances(query,pageUtils); flowTaskService.getFinalProcessInstances(query,pageUtils);
return ResultVoUtil.success(pageUtils); return ResultVoUtil.success(pageUtils);

@ -1281,29 +1281,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
for(OcrTaskchildPictureAppro taskchildPicture:list){ for(OcrTaskchildPictureAppro taskchildPicture:list){
if(taskchildPicture.getStatshis() != null){
String stateText;
switch (taskchildPicture.getStatshis()) {
case 1:
stateText = "待审批";
break;
case 2:
stateText = "通过";
break;
case 3:
stateText = "不通过";
break;
default:
stateText = "未知状态";
break;
}
// 将中文状态赋值给 flowUnionVo 的状态属性
taskchildPicture.setStatshisText(stateText);
}else {
//暂定,后期修改
taskchildPicture.setStatshisText("待审批");
}
if(taskchildPicture.getPictureid() != null && !taskchildPicture.getPictureid().isEmpty()){ if(taskchildPicture.getPictureid() != null && !taskchildPicture.getPictureid().isEmpty()){
Long pictureId = Long.parseLong(taskchildPicture.getPictureid()); Long pictureId = Long.parseLong(taskchildPicture.getPictureid());
@ -1400,6 +1377,38 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
} }
pageUtils.setTotalCount(count.intValue()); pageUtils.setTotalCount(count.intValue());
//补充历史状态名称,检查补充节点信息
for (OcrTaskchildPictureAppro ocrTaskchildPictureAppro : list) {
//审批节点 当前如果没有历史操作,则将当前节点赋值到历史审批节点中.
if(StringUtils.isBlank(ocrTaskchildPictureAppro.getTasknamehis())){
ocrTaskchildPictureAppro.setTasknamehis(ocrTaskchildPictureAppro.getTaskname());
}
if(ocrTaskchildPictureAppro.getStatshis() != null){
String stateText;
switch (ocrTaskchildPictureAppro.getStatshis()) {
case 1:
stateText = "待审批";
break;
case 2:
stateText = "通过";
break;
case 3:
stateText = "不通过";
break;
default:
stateText = "未知状态";
break;
}
// 将中文状态赋值给 flowUnionVo 的状态属性
ocrTaskchildPictureAppro.setStatshisText(stateText);
}else {
//暂定,后期修改
ocrTaskchildPictureAppro.setStatshisText("待审批");
}
}
pageUtils.setList(list); pageUtils.setList(list);
} }

@ -44,4 +44,12 @@ public class OcrAiApprovalTools {
return ResultVoUtil.success(toolscount); return ResultVoUtil.success(toolscount);
} }
@RequestMapping(value = "/aiApprovaltools", method = RequestMethod.GET)
public ResultVo aiApprovaltools(HttpServletRequest request,@RequestParam(value = "taskid", required = true) String taskid) {
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
Map<Object, Object> selectaisp = iocrsearchhistoryservice.selectaisp(userToken.getUserid(), taskid);
return ResultVoUtil.success(selectaisp);
}
} }

@ -74,7 +74,7 @@ public class OcrFieldController extends BaseController {
*/ */
@ApiOperation(value="字段新增和修改", notes="字段新增和修改") @ApiOperation(value="字段新增和修改", notes="字段新增和修改")
@PostMapping(value = "/saveOrUpdate") @PostMapping(value = "/saveOrUpdate")
public ResultVo saveOrUpdate(@ApiParam(value = "字段信息", required = true) OcrFieldVo ocrFieldVo) { public ResultVo saveOrUpdate(@ApiParam(value = "字段信息", required = true) @RequestBody OcrFieldVo ocrFieldVo) {
try { try {
OcrField ocrField = new OcrField(); OcrField ocrField = new OcrField();
ocrField.setName(ocrFieldVo.getName()); ocrField.setName(ocrFieldVo.getName());

@ -214,8 +214,16 @@ public class OcrPictureController extends BaseController {
QueryWrapper<OcrPicture> queryWrapper = new QueryWrapper<>(); QueryWrapper<OcrPicture> queryWrapper = new QueryWrapper<>();
String search_month = req.getParameter("search_month"); String search_month = req.getParameter("search_month");
if(StringUtils.isNotBlank(search_month) && Integer.parseInt(search_month) <= 12 && Integer.parseInt(search_month) > 0){ String ordertype = req.getParameter("ordertype");
queryWrapper.ge("create_time",DataUtil.afterDateByMonth(Integer.parseInt(search_month))); if (StringUtils.isNotBlank(ordertype)) {
if (ordertype.equals("0")) {
queryWrapper.orderByAsc("similarity_score");
} else {
queryWrapper.orderByDesc("similarity_score");
}
}
if (StringUtils.isNotBlank(search_month) && Integer.parseInt(search_month) <= 12 && Integer.parseInt(search_month) > 0) {
queryWrapper.ge("create_time", DataUtil.afterDateByMonth(Integer.parseInt(search_month)));
} }
//根据参数枚举获取检索参数并映射为数据库的字段的key-v map //根据参数枚举获取检索参数并映射为数据库的字段的key-v map

@ -30,7 +30,7 @@ public class OcrUserFieldController extends BaseController{
*/ */
@ApiOperation(value="保存或更新用户展示字段列表", notes="保存或更新用户展示字段列表") @ApiOperation(value="保存或更新用户展示字段列表", notes="保存或更新用户展示字段列表")
@PostMapping(value = "/saveOrUpdate") @PostMapping(value = "/saveOrUpdate")
public ResultVo saveOrUpdate(@ApiParam(value = "用户字段信息", required = true) OcrUserFieldVo ocrUserFieldVo) { public ResultVo saveOrUpdate(@ApiParam(value = "用户字段信息", required = true) @RequestBody OcrUserFieldVo ocrUserFieldVo) {
try { try {
OcrUserField ocrUserField = new OcrUserField(); OcrUserField ocrUserField = new OcrUserField();
ocrUserField.setUserId(ocrUserFieldVo.getUserId()); ocrUserField.setUserId(ocrUserFieldVo.getUserId());

@ -29,4 +29,8 @@ public interface OcrSearchHistoryMapper extends BaseMapper<OcrSearchHistory> {
Map<Object,Object> toolscount(@Param("userid")String userid); Map<Object,Object> toolscount(@Param("userid")String userid);
Map<Object,Object> selectaisp(@Param("id")String id);
String selectaiuser(@Param("userid")String userid);
} }

@ -306,6 +306,11 @@ public class OcrPicture implements BaseDto, java.io.Serializable {
@TableField(value = "img_hash") @TableField(value = "img_hash")
private String imgHash; private String imgHash;
@ApiModelProperty(value = "相似度数值")
@Schema(description = "相似度数值")
@TableField(value = "similarity_score")
private Integer similarityscore;
@ApiModelProperty(value = "图片查重的比对图片集合") @ApiModelProperty(value = "图片查重的比对图片集合")
@TableField(exist = false) @TableField(exist = false)
private List<OcrPicture> listCom; private List<OcrPicture> listCom;

@ -31,160 +31,159 @@ import java.util.stream.Stream;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Data @Data
@Builder @Builder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ApiModel(value="任务信息", description="任务信息") @ApiModel(value = "任务信息", description = "任务信息")
@TableName(value = "ocr_taskchild_picture") @TableName(value = "ocr_taskchild_picture")
public class OcrTaskchildPicture implements BaseDto,java.io.Serializable { public class OcrTaskchildPicture implements BaseDto, java.io.Serializable {
private static final long serialVersionUID = -8018660053527763810L; private static final long serialVersionUID = -8018660053527763810L;
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
@TableId(value = "id",type = IdType.ASSIGN_ID) @TableId(value = "id", type = IdType.ASSIGN_ID)
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
@TableField(value="ID") @TableField(value = "ID")
private Long id; private Long id;
@ApiModelProperty(value = "比对图片主键,多个数据使用英文逗号分隔") @ApiModelProperty(value = "比对图片主键,多个数据使用英文逗号分隔")
@TableField(value="OCPICTUREID") @TableField(value = "OCPICTUREID")
private String ocpictureid; private String ocpictureid;
@ApiModelProperty(value = "图片比对结果,与图片主键一一对应记录比对结果使用英文逗号分隔例如99.6,98.1,97.2") @ApiModelProperty(value = "图片比对结果,与图片主键一一对应记录比对结果使用英文逗号分隔例如99.6,98.1,97.2")
@TableField(value="PICTURERESULT") @TableField(value = "PICTURERESULT")
private String pictureresult; private String pictureresult;
@ApiModelProperty(value = "只记录主图,如果存在历史图片,不在这里记录") @ApiModelProperty(value = "只记录主图,如果存在历史图片,不在这里记录")
@TableField(value="PICTURECOMPARE") @TableField(value = "PICTURECOMPARE")
private String picturecompare; private String picturecompare;
@ApiModelProperty(value = "所属部门") @ApiModelProperty(value = "所属部门")
@TableField(value="DEPTID") @TableField(value = "DEPTID")
private String deptid; private String deptid;
@ApiModelProperty(value = "租户ID") @ApiModelProperty(value = "租户ID")
@TableField(value="TENANTID") @TableField(value = "TENANTID")
private Long tenantid; private Long tenantid;
@ApiModelProperty(value = "任务包主键") @ApiModelProperty(value = "任务包主键")
@TableField(value="PACKAGEID") @TableField(value = "PACKAGEID")
private Long packageid; private Long packageid;
@ApiModelProperty(value = "原图片主键") @ApiModelProperty(value = "原图片主键")
@TableField(value="PICTUREID") @TableField(value = "PICTUREID")
private Long pictureid; private Long pictureid;
@ApiModelProperty(value = "类型名称") @ApiModelProperty(value = "类型名称")
@TableField(value="CATEGORY") @TableField(value = "CATEGORY")
private String category; private String category;
@ApiModelProperty(value = "项目ID") @ApiModelProperty(value = "项目ID")
@TableField(value="CATEGORYID") @TableField(value = "CATEGORYID")
private Long categoryid; private Long categoryid;
@ApiModelProperty(value = "明细单") @ApiModelProperty(value = "明细单")
@TableField(value="SPECIFICATION") @TableField(value = "SPECIFICATION")
private String specification; private String specification;
@ApiModelProperty(value = "业务编码") @ApiModelProperty(value = "业务编码")
@TableField(value="BUESSINESSNO") @TableField(value = "BUESSINESSNO")
private String buessinessno; private String buessinessno;
@ApiModelProperty(value = "状态,审批状态 1:未提交 2:审批中 3:审批通过 5拒绝") @ApiModelProperty(value = "状态,审批状态 1:未提交 2:审批中 3:审批通过 5拒绝")
@TableField(value="STATES") @TableField(value = "STATES")
private Integer states; private Integer states;
@ApiModelProperty(value = "流程实例IdprocessInstanceId") @ApiModelProperty(value = "流程实例IdprocessInstanceId")
@TableField(value="PROCESSINSTANCEID") @TableField(value = "PROCESSINSTANCEID")
private String processinstanceid; private String processinstanceid;
@ApiModelProperty(value = "流程定义id") @ApiModelProperty(value = "流程定义id")
@TableField(value="PROCESSDEFINITIONID") @TableField(value = "PROCESSDEFINITIONID")
private String processdefinitionid; private String processdefinitionid;
@ApiModelProperty(value = "流程部署id") @ApiModelProperty(value = "流程部署id")
@TableField(value="DEPLOYMENTID") @TableField(value = "DEPLOYMENTID")
private String deploymentid; private String deploymentid;
@ApiModelProperty(value = "审批人姓名") @ApiModelProperty(value = "审批人姓名")
@TableField(value="ASSIGNEENAME") @TableField(value = "ASSIGNEENAME")
private String assigneename; private String assigneename;
@ApiModelProperty(value = "审批人") @ApiModelProperty(value = "审批人")
@TableField(value="ASSIGNEE") @TableField(value = "ASSIGNEE")
private String assignee; private String assignee;
@ApiModelProperty(value = "修改人,记录创建人的帐号") @ApiModelProperty(value = "修改人,记录创建人的帐号")
@TableField(value="UPDATEUSER") @TableField(value = "UPDATEUSER")
private String updateuser; private String updateuser;
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
@TableField(value="UPDATETIME") @TableField(value = "UPDATETIME")
private Long updatetime; private Long updatetime;
@ApiModelProperty(value = "附件") @ApiModelProperty(value = "附件")
@TableField(value="FILEANNEX") @TableField(value = "FILEANNEX")
private String fileannex; private String fileannex;
@ApiModelProperty(value = "是否归档0未归档1归档") @ApiModelProperty(value = "是否归档0未归档1归档")
@TableField(value="GUIDANG") @TableField(value = "GUIDANG")
private Integer guidang; private Integer guidang;
@ApiModelProperty(value = "创建人") @ApiModelProperty(value = "创建人")
@TableField(value="CREATEUSER") @TableField(value = "CREATEUSER")
private String createuser; private String createuser;
@ApiModelProperty(value = "创建人姓名") @ApiModelProperty(value = "创建人姓名")
@TableField(value="CREATEUSERNAME") @TableField(value = "CREATEUSERNAME")
private String createusername; private String createusername;
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
@TableField(value="CREATEDATE") @TableField(value = "CREATEDATE")
private Long createdate; private Long createdate;
@ApiModelProperty(value = "员工主键") @ApiModelProperty(value = "员工主键")
@TableField(value="USERID") @TableField(value = "USERID")
private Long userid; private Long userid;
@ApiModelProperty(value = "员工姓名") @ApiModelProperty(value = "员工姓名")
@TableField(value="USERNAME") @TableField(value = "USERNAME")
private String username; private String username;
@ApiModelProperty(value = "任务id,来源于图片表") @ApiModelProperty(value = "任务id,来源于图片表")
@TableField(value="FROMTASKID") @TableField(value = "FROMTASKID")
private String fromtaskid; private String fromtaskid;
@ApiModelProperty(value = "任务名称,来源于图片表") @ApiModelProperty(value = "任务名称,来源于图片表")
@TableField(value="FROMTASKNAME") @TableField(value = "FROMTASKNAME")
private String fromtaskname; private String fromtaskname;
@ApiModelProperty(value = "提报人") @ApiModelProperty(value = "提报人")
@TableField(value="FROMUSERID") @TableField(value = "FROMUSERID")
private String fromuserid; private String fromuserid;
@ApiModelProperty(value = "所属项目") @ApiModelProperty(value = "所属项目")
@TableField(value="FROMPROJECTID") @TableField(value = "FROMPROJECTID")
private String fromprojectid; private String fromprojectid;
@ApiModelProperty(value = "所属计划") @ApiModelProperty(value = "所属计划")
@TableField(value="FROMPLANID") @TableField(value = "FROMPLANID")
private String fromplanid; private String fromplanid;
@ApiModelProperty(value = "提报时间") @ApiModelProperty(value = "提报时间")
@TableField(value="FROMUPTIME") @TableField(value = "FROMUPTIME")
private Long fromuptime; private Long fromuptime;
@ApiModelProperty(value = "任务来源") @ApiModelProperty(value = "任务来源")
@TableField(value="FROMSOURCEID") @TableField(value = "FROMSOURCEID")
private String fromsourceid; private String fromsourceid;
@ApiModelProperty(value = "是否为相似图片与其他图片对比为百分百的记录为10不相似1相似") @ApiModelProperty(value = "是否为相似图片与其他图片对比为百分百的记录为10不相似1相似")
@TableField(value="HAVEPOINTS") @TableField(value = "HAVEPOINTS")
private Integer havepoints; private Integer havepoints;
@Schema(description = "当前节点名称") @Schema(description = "当前节点名称")
@TableField(value="TASKNAME") @TableField(value = "TASKNAME")
private String taskname; private String taskname;
@ApiModelProperty(value = "项目对象") @ApiModelProperty(value = "项目对象")
@ -209,27 +208,31 @@ public class OcrTaskchildPicture implements BaseDto,java.io.Serializable {
@TableField(exist = false) @TableField(exist = false)
private boolean izHistory; private boolean izHistory;
@ApiModelProperty(value ="图片真假 0:假1其他表示没有设置") @ApiModelProperty(value = "图片真假 0:假1其他表示没有设置")
@TableField(exist = false) @TableField(exist = false)
private Integer iztrueorfalse; private Integer iztrueorfalse;
@ApiModelProperty(value ="是否已经审批0未审批1审批中2已审批") @ApiModelProperty(value = "是否已经审批0未审批1审批中2已审批")
@TableField(exist = false) @TableField(exist = false)
private String workStatus; private String workStatus;
@ApiModelProperty(value ="图片对象") @ApiModelProperty(value = "图片对象")
@TableField(exist = false) @TableField(exist = false)
private OcrPicture ocrPicture; private OcrPicture ocrPicture;
@ApiModelProperty(value ="提报时间") @ApiModelProperty(value = "提报时间")
@TableField(exist = false) @TableField(exist = false)
private String reporttime; private String reporttime;
@ApiModelProperty(value ="本人审查日志") @ApiModelProperty(value = "相似度数值")
@TableField(exist = false)
private Integer similarityscore;
@ApiModelProperty(value = "本人审查日志")
@TableField(exist = false) @TableField(exist = false)
private Userapprove userapprove; private Userapprove userapprove;
@ApiModelProperty(value ="审查日志") @ApiModelProperty(value = "审查日志")
@TableField(exist = false) @TableField(exist = false)
private List<Userapprove> userapproveList; private List<Userapprove> userapproveList;
@ -238,7 +241,7 @@ public class OcrTaskchildPicture implements BaseDto,java.io.Serializable {
@JsonIgnore @JsonIgnore
private SearchQuery searchQueryrolesShowleave; private SearchQuery searchQueryrolesShowleave;
public FlowModelVO getFlowModelVO(){ public FlowModelVO getFlowModelVO() {
FlowModelVO flowModelVO = new FlowModelVO(); FlowModelVO flowModelVO = new FlowModelVO();
flowModelVO.setFormid(this.getId()); flowModelVO.setFormid(this.getId());
flowModelVO.setAssignee(this.getAssignee()); flowModelVO.setAssignee(this.getAssignee());
@ -263,49 +266,50 @@ public class OcrTaskchildPicture implements BaseDto,java.io.Serializable {
@TableField(exist = false) @TableField(exist = false)
@JsonIgnore @JsonIgnore
private final Map<String,String> query = Stream.of( private final Map<String, String> query = Stream.of(
new SimpleEntry<>("ID","id"), new SimpleEntry<>("ID", "id"),
new SimpleEntry<>("OCPICTUREID","ocpictureid"), new SimpleEntry<>("OCPICTUREID", "ocpictureid"),
new SimpleEntry<>("PICTURERESULT","pictureresult"), new SimpleEntry<>("PICTURERESULT", "pictureresult"),
new SimpleEntry<>("PICTURECOMPARE","picturecompare"), new SimpleEntry<>("PICTURECOMPARE", "picturecompare"),
new SimpleEntry<>("DEPTID","deptid"), new SimpleEntry<>("DEPTID", "deptid"),
new SimpleEntry<>("TENANTID","tenantid"), new SimpleEntry<>("TENANTID", "tenantid"),
new SimpleEntry<>("PACKAGEID","packageid"), new SimpleEntry<>("PACKAGEID", "packageid"),
new SimpleEntry<>("PICTUREID","pictureid"), new SimpleEntry<>("PICTUREID", "pictureid"),
new SimpleEntry<>("CATEGORY","category"), new SimpleEntry<>("CATEGORY", "category"),
new SimpleEntry<>("CATEGORYID","categoryid"), new SimpleEntry<>("CATEGORYID", "categoryid"),
new SimpleEntry<>("SPECIFICATION","specification"), new SimpleEntry<>("SPECIFICATION", "specification"),
new SimpleEntry<>("BUESSINESSNO","buessinessno"), new SimpleEntry<>("BUESSINESSNO", "buessinessno"),
new SimpleEntry<>("STATES","states"), new SimpleEntry<>("STATES", "states"),
new SimpleEntry<>("PROCESSINSTANCEID","processinstanceid"), new SimpleEntry<>("PROCESSINSTANCEID", "processinstanceid"),
new SimpleEntry<>("PROCESSDEFINITIONID","processdefinitionid"), new SimpleEntry<>("PROCESSDEFINITIONID", "processdefinitionid"),
new SimpleEntry<>("DEPLOYMENTID","deploymentid"), new SimpleEntry<>("DEPLOYMENTID", "deploymentid"),
new SimpleEntry<>("ASSIGNEENAME","assigneename"), new SimpleEntry<>("ASSIGNEENAME", "assigneename"),
new SimpleEntry<>("ASSIGNEE","assignee"), new SimpleEntry<>("ASSIGNEE", "assignee"),
new SimpleEntry<>("UPDATEUSER","updateuser"), new SimpleEntry<>("UPDATEUSER", "updateuser"),
new SimpleEntry<>("UPDATETIME","updatetime"), new SimpleEntry<>("UPDATETIME", "updatetime"),
new SimpleEntry<>("FILEANNEX","fileannex"), new SimpleEntry<>("FILEANNEX", "fileannex"),
new SimpleEntry<>("GUIDANG","guidang"), new SimpleEntry<>("GUIDANG", "guidang"),
new SimpleEntry<>("CREATEUSER","createuser"), new SimpleEntry<>("CREATEUSER", "createuser"),
new SimpleEntry<>("CREATEUSERNAME","createusername"), new SimpleEntry<>("CREATEUSERNAME", "createusername"),
new SimpleEntry<>("CREATEDATE","createdate"), new SimpleEntry<>("CREATEDATE", "createdate"),
new SimpleEntry<>("USERID","userid"), new SimpleEntry<>("USERID", "userid"),
new SimpleEntry<>("USERNAME","username"), new SimpleEntry<>("USERNAME", "username"),
new SimpleEntry<>("FROMTASKID","fromtaskid"), new SimpleEntry<>("FROMTASKID", "fromtaskid"),
new SimpleEntry<>("FROMTASKNAME","fromtaskname"), new SimpleEntry<>("FROMTASKNAME", "fromtaskname"),
new SimpleEntry<>("FROMUSERID","fromuserid"), new SimpleEntry<>("FROMUSERID", "fromuserid"),
new SimpleEntry<>("FROMPROJECTID","fromprojectid"), new SimpleEntry<>("FROMPROJECTID", "fromprojectid"),
new SimpleEntry<>("FROMPLANID","fromplanid"), new SimpleEntry<>("FROMPLANID", "fromplanid"),
new SimpleEntry<>("FROMUPTIME","fromuptime"), new SimpleEntry<>("FROMUPTIME", "fromuptime"),
new SimpleEntry<>("FROMSOURCEID","fromsourceid"), new SimpleEntry<>("FROMSOURCEID", "fromsourceid"),
new SimpleEntry<>("HAVEPOINTS","havepoints"), new SimpleEntry<>("HAVEPOINTS", "havepoints"),
new SimpleEntry<>("TASKNAME","taskname") new SimpleEntry<>("TASKNAME", "taskname")
) )
.collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue)); .collect(Collectors.toMap(SimpleEntry::getKey, SimpleEntry::getValue));
@Override @Override
public String getQueryFiled(String filedname){ public String getQueryFiled(String filedname) {
String obj = null; String obj = null;
if(null != query && query.size() > 0){ if (null != query && query.size() > 0) {
obj = query.get(filedname); obj = query.get(filedname);
} }
return obj; return obj;

@ -20,4 +20,6 @@ public interface IOcrSearchHistoryService extends IService<OcrSearchHistory> {
List<List<Map<String,String>>> selectsearch(String search,String assignee); List<List<Map<String,String>>> selectsearch(String search,String assignee);
Map<Object,Object> toolscount(String userid); Map<Object,Object> toolscount(String userid);
Map<Object,Object> selectaisp(String userid,String id);
} }

@ -82,6 +82,7 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
@Resource @Resource
private OcrPictureclassService ocrPictureclassService; private OcrPictureclassService ocrPictureclassService;
@Resource @Resource
private CategoryService categoryService; private CategoryService categoryService;
@ -323,25 +324,25 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
//分类不一致的也不需要进行比对 //分类不一致的也不需要进行比对
//TODO 接口请求判断重复情况 //TODO 接口请求判断重复情况
logService.addLog(103, "AI获取图片相似度接口", sysUser, "sendParams"); logService.addLog(103, "AI获取图片相似度接口", sysUser, "sendParams");
if(StringUtils.isBlank(ocrPicture.getImgHash())){ if (StringUtils.isBlank(ocrPicture.getImgHash())) {
Map<String,String> map = this.getOcrPictureClassifyAndHash(ocrPicture.getLocalpictrueurl()); Map<String, String> map = this.getOcrPictureClassifyAndHash(ocrPicture.getLocalpictrueurl());
if(map!=null){ if (map != null) {
ocrPicture.setImgHash(map.get("hash")); ocrPicture.setImgHash(map.get("hash"));
ocrPicture.setClassificationid(map.get("classId")); ocrPicture.setClassificationid(map.get("classId"));
} }
this.updateById(ocrPicture); this.updateById(ocrPicture);
} }
if(StringUtils.isBlank(ocrPictureNext.getImgHash())){ if (StringUtils.isBlank(ocrPictureNext.getImgHash())) {
Map<String,String> map = this.getOcrPictureClassifyAndHash(ocrPictureNext.getLocalpictrueurl()); Map<String, String> map = this.getOcrPictureClassifyAndHash(ocrPictureNext.getLocalpictrueurl());
if(map!=null){ if (map != null) {
ocrPictureNext.setImgHash(map.get("hash")); ocrPictureNext.setImgHash(map.get("hash"));
ocrPictureNext.setClassificationid(map.get("classId")); ocrPictureNext.setClassificationid(map.get("classId"));
} }
this.updateById(ocrPictureNext); this.updateById(ocrPictureNext);
} }
String img=StringUtils.isBlank(ocrPicture.getImgHash())?StringUtils.isBlank(ocrPicture.getLocalpictrueurl()) ? ocrPicture.getImgurl() : ocrPicture.getLocalpictrueurl():ocrPicture.getImgHash(); String img = StringUtils.isBlank(ocrPicture.getImgHash()) ? StringUtils.isBlank(ocrPicture.getLocalpictrueurl()) ? ocrPicture.getImgurl() : ocrPicture.getLocalpictrueurl() : ocrPicture.getImgHash();
String imgNext=StringUtils.isBlank(ocrPictureNext.getImgHash())?StringUtils.isBlank(ocrPictureNext.getLocalpictrueurl()) ? ocrPictureNext.getImgurl() : ocrPictureNext.getLocalpictrueurl():ocrPictureNext.getImgHash(); String imgNext = StringUtils.isBlank(ocrPictureNext.getImgHash()) ? StringUtils.isBlank(ocrPictureNext.getLocalpictrueurl()) ? ocrPictureNext.getImgurl() : ocrPictureNext.getLocalpictrueurl() : ocrPictureNext.getImgHash();
String resultValue = HashCompareUtil.cmpHash(img, imgNext); String resultValue = HashCompareUtil.cmpHash(img, imgNext);
ocrPictureNext.setResult(resultValue); ocrPictureNext.setResult(resultValue);
@ -403,15 +404,15 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
@Override @Override
public Map<String, String> getOcrPictureClassifyAndHash(String img) { public Map<String, String> getOcrPictureClassifyAndHash(String img) {
JSONObject jsonObjectSimi = ImageClassUtil.getClassify(img,"1",classifyPath); JSONObject jsonObjectSimi = ImageClassUtil.getClassify(img, "1", classifyPath);
//返回内容为零,表示成功,否则表示失败 //返回内容为零,表示成功,否则表示失败
if (null != jsonObjectSimi && jsonObjectSimi.getString("code").equals("0") && jsonObjectSimi.get("data")!=null&&jsonObjectSimi.getJSONArray("data").size()>0) { if (null != jsonObjectSimi && jsonObjectSimi.getString("code").equals("0") && jsonObjectSimi.get("data") != null && jsonObjectSimi.getJSONArray("data").size() > 0) {
JSONObject data = jsonObjectSimi.getJSONArray("data").getJSONObject(0); JSONObject data = jsonObjectSimi.getJSONArray("data").getJSONObject(0);
Map<String,String> map=new HashMap(); Map<String, String> map = new HashMap();
map.put("classId",data.getString("classId")); map.put("classId", data.getString("classId"));
map.put("hash",data.getString("hash")); map.put("hash", data.getString("hash"));
return map; return map;
}else{ } else {
return null; return null;
} }
} }
@ -427,7 +428,13 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
ocrTaskchildPicture.setPackageid(packageid); ocrTaskchildPicture.setPackageid(packageid);
StringBuffer pcid = new StringBuffer(); StringBuffer pcid = new StringBuffer();
StringBuffer result = new StringBuffer(); StringBuffer result = new StringBuffer();
int max = 0;
for (OcrPicture comp : ocrPicture.getListCom()) { for (OcrPicture comp : ocrPicture.getListCom()) {
double doubleValue = Double.parseDouble(comp.getResult());
int intValue = (int) doubleValue;
if (intValue > max) {
max = intValue;
}
if (null == pcid || pcid.toString().length() < 1) { if (null == pcid || pcid.toString().length() < 1) {
pcid.append(comp.getId()); pcid.append(comp.getId());
result.append(comp.getResult()); result.append(comp.getResult());
@ -439,6 +446,8 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
ocrTaskchildPicture.setOcpictureid(pcid.toString()); ocrTaskchildPicture.setOcpictureid(pcid.toString());
ocrTaskchildPicture.setPictureresult(result.toString()); ocrTaskchildPicture.setPictureresult(result.toString());
ocrTaskchildPicture.setPicturecompare(String.join(",", ocrPicture.getPicturecompareList())); ocrTaskchildPicture.setPicturecompare(String.join(",", ocrPicture.getPicturecompareList()));
ocrPicture.setSimilarityscore(max);
this.updateById(ocrPicture);
return ocrTaskchildPictureService.updateById(ocrTaskchildPicture) ? ocrTaskchildPicture : null; return ocrTaskchildPictureService.updateById(ocrTaskchildPicture) ? ocrTaskchildPicture : null;
} }

@ -1,5 +1,6 @@
package cn.jyjz.xiaoyao.ocr.service.impl; package cn.jyjz.xiaoyao.ocr.service.impl;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrPicture;
import cn.jyjz.xiaoyao.ocr.dataobject.OcrSearchHistory; import cn.jyjz.xiaoyao.ocr.dataobject.OcrSearchHistory;
import cn.jyjz.xiaoyao.ocr.service.IOcrSearchHistoryService; import cn.jyjz.xiaoyao.ocr.service.IOcrSearchHistoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -7,10 +8,7 @@ import org.springframework.stereotype.Service;
import cn.jyjz.xiaoyao.ocr.dataDao.OcrSearchHistoryMapper; import cn.jyjz.xiaoyao.ocr.dataDao.OcrSearchHistoryMapper;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
@ -46,4 +44,30 @@ public class OcrSearchHistoryServiceImpl extends ServiceImpl<OcrSearchHistoryMap
public Map<Object, Object> toolscount(String userid) { public Map<Object, Object> toolscount(String userid) {
return ocrsearchhistorymapper.toolscount(userid); return ocrsearchhistorymapper.toolscount(userid);
} }
@Override
public Map<Object, Object> selectaisp(String userid,String id) {
Map<Object, Object> selectaisp = ocrsearchhistorymapper.selectaisp(id);
String selectaiuser = ocrsearchhistorymapper.selectaiuser(userid);
String[] cps = selectaisp.get("pictureresult").toString().split(",");
List<OcrPicture> saveList = new ArrayList<>();
int i=0;
for (String childpictureid : cps) {
if (childpictureid.equals("100.00")){
i++;
}
}
Map<Object,Object> map=new HashMap<>();
map.put("tenantusername",selectaiuser);
map.put("packagename",selectaisp.get("packagename"));
map.put("tasks","基线任务");
map.put("similarcount",selectaisp.get("similarcount"));
map.put("createtime",selectaisp.get("createtime"));
map.put("similarComplete",i);
return map;
}
} }

@ -83,4 +83,19 @@
(SELECT COUNT(*) FROM ocr_taskchild_picture WHERE USERID = ""#{userid}"" AND STATES = '3') as approved (SELECT COUNT(*) FROM ocr_taskchild_picture WHERE USERID = ""#{userid}"" AND STATES = '3') as approved
</select> </select>
<select id="selectaisp" resultType="map">
SELECT
t.packagename,rw.PICTURERESULT as pictureresult,count(length(rw.PICTURERESULT)-length(replace(rw.PICTURERESULT,',',''))+1) as similarcount,t.create_time as createtime
FROM
ocr_taskchild_picture rw
LEFT JOIN ocr_packagetask t ON rw.PACKAGEID = t.ID
WHERE t.ID = #{id}
</select>
<select id="selectaiuser" resultType="String">
SELECT CONCAT_WS( "-", t.`NAME`, u.USERNAME ) as tenantusername FROM s_user_t u LEFT JOIN s_user_tenant_t z ON u.ID = z.USERID
LEFT JOIN s_tenant_t t ON z.TENANTID = t.ID WHERE u.ID = #{userid}
</select>
</mapper> </mapper>

@ -167,7 +167,7 @@
</where> </where>
</sql> </sql>
<select id="listFinal" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture" parameterType="java.util.Map"> <select id="listFinal" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture" parameterType="java.util.Map">
select tcp.*,pic.field11 reporttime from ( select tcp.*,pic.field11 reporttime,pic.similarity_score similarityscore from (
select select
tc.* tc.*
from ocr_taskchild_picture tc,OA_USERFINAL_T uf from ocr_taskchild_picture tc,OA_USERFINAL_T uf
@ -215,24 +215,29 @@
</select> </select>
<select id="listmytask" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPictureAppro" parameterType="java.util.Map"> <select id="listmytask" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPictureAppro" parameterType="java.util.Map">
select tcp.* from ( select tcp.* from (
select select
tc.*,uf.COMMENTHIS,uf.TASKNAME as TASKNAMEHIS,uf.STATSHIS,uf.TASKINDEX,uf.TASKNO tc.*,uf.COMMENTHIS,uf.TASKNAME as TASKNAMEHIS,uf.STATSHIS,uf.TASKINDEX,uf.TASKNO
from ocr_taskchild_picture tc from ocr_taskchild_picture tc
LEFT JOIN OA_USERAPPROVE_T uf ON tc.ID = uf.ID LEFT JOIN OA_USERAPPROVE_T uf ON tc.ID = uf.ID
where tc.ASSIGNEE = #{searchassignee} and tc.TENANTID=#{searchtenantid} where tc.ASSIGNEE = #{searchassignee} and tc.TENANTID=#{searchtenantid}
and tc.STATES=2
UNION UNION
select select
tc.*,uf.COMMENTHIS,uf.TASKNAME as TASKNAMEHIS,uf.STATSHIS,uf.TASKINDEX,uf.TASKNO tc.*,uf.COMMENTHIS,uf.TASKNAME as TASKNAMEHIS,uf.STATSHIS,uf.TASKINDEX,uf.TASKNO
from ocr_taskchild_picture tc,OA_USERAPPROVE_T uf from ocr_taskchild_picture tc,OA_USERAPPROVE_T uf
where tc.ID = uf.FORMID and tc.TENANTID=#{searchtenantid} where tc.ID = uf.FORMID and tc.TENANTID=#{searchtenantid}
<if test="thisLoginUserid != null"> and uf.USERID = #{thisLoginUserid}</if> <if test="thisLoginUserid != null">
and uf.USERID = #{thisLoginUserid}
</if>
) as tcp ) as tcp
<include refid="Base_Where_union"></include> <include refid="Base_Where_union">
</include>
<if test="page != null"> <if test="page != null">
<if test="page.sortname != null"> order by tcp.${page.sortname} ${page.sortorder}</if> <if test="page.sortname != null">
order by tcp.${page.sortname} ${page.sortorder}
</if>
limit ${page.start}, ${page.Pagesize} limit ${page.start}, ${page.Pagesize}
</if> </if>
</select> </select>
@ -242,14 +247,18 @@
tc.* tc.*
from ocr_taskchild_picture tc from ocr_taskchild_picture tc
where tc.ASSIGNEE = #{searchassignee} and tc.TENANTID=#{searchtenantid} where tc.ASSIGNEE = #{searchassignee} and tc.TENANTID=#{searchtenantid}
and tc.STATES=2
UNION UNION
select select
tc.* tc.*
from ocr_taskchild_picture tc,OA_USERAPPROVE_T uf from ocr_taskchild_picture tc,OA_USERAPPROVE_T uf
where tc.ID = uf.FORMID and tc.TENANTID=#{searchtenantid} where tc.ID = uf.FORMID and tc.TENANTID=#{searchtenantid}
<if test="thisLoginUserid != null"> and uf.USERID = #{thisLoginUserid}</if> <if test="thisLoginUserid != null">
and uf.USERID = #{thisLoginUserid}
</if>
) as tcp ) as tcp
<include refid="Base_Where_union"></include> <include refid="Base_Where_union">
</include>
</select> </select>

Loading…
Cancel
Save