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.util.RequestBaseUtil;
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.ResultVoUtil;
import cn.jyjz.xiaoyao.common.base.vo.UserToken;
@ -44,10 +45,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Api(tags="ocr_流程接口")
@ -365,6 +364,8 @@ public class FlowTaskController extends BaseController {
}
return ResultVoUtil.success(pageUtils);
}
/**
*
* @return
@ -376,30 +377,70 @@ public class FlowTaskController extends BaseController {
@GetMapping("/listfinal")
@ResponseBody
public ResultVo<OcrTaskchildPicture> listFinalData(PageUtils<OcrTaskchildPicture> pageUtils,
@RequestParam(name="search_fromuserid", defaultValue="",required = false) String searchFromuserid,
@RequestParam(name="search_fromprojectid", defaultValue="",required = false) String searchFromprojectid,
@RequestParam(name="search_fromplanid", defaultValue="",required = false) String searchFromplanid,
@RequestParam(name="search_states", defaultValue="",required = false) String searchStates,
@RequestParam(name="search_fromsourceid", defaultValue="",required = false) String searchFromsourceid,
@RequestParam(name="fromuptime_start", defaultValue="",required = false) BigDecimal fromuptimeStart,
@RequestParam(name="fromuptime_end", defaultValue="",required = false) BigDecimal fromuptimeEnd,
@RequestParam(name="izupuser", defaultValue="",required = false) String izupuser,
@RequestParam(name="izproject", defaultValue="",required = false) String izproject,
@RequestParam(name="izplan", defaultValue="",required = false) String izplan,
@RequestParam(name="izstatus", defaultValue="",required = false) String izstatus,
@RequestParam(name="iztaskrrom", defaultValue="",required = false) String iztaskrrom,
@RequestParam(name="izuptime", defaultValue="",required = false) String izuptime,
HttpServletRequest request){
SearchQuery searchQuery = new SearchQuery();
if(org.springframework.util.StringUtils.hasText(searchFromuserid)){
searchQuery.addEqual("fromuserid",searchFromuserid);
if(org.springframework.util.StringUtils.hasText(izupuser)){
// 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(searchFromprojectid)){
searchQuery.addEqual("fromprojectid",searchFromprojectid);
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(searchFromplanid)){
searchQuery.addEqual("fromplanid",searchFromplanid);
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(searchStates)){
searchQuery.addEqual("states",searchStates);
if (org.springframework.util.StringUtils.hasText(izstatus)) {
if (izstatus.contains(",")) {
String[] statusIds = izstatus.split(","); // 以逗号拆分字符串
searchQuery.addIn("states", statusIds);
} else {
searchQuery.addEqual("states", izstatus);
}
}
if(org.springframework.util.StringUtils.hasText(searchFromsourceid)){
searchQuery.addEqual("fromsourceid",searchFromsourceid);
if (org.springframework.util.StringUtils.hasText(iztaskrrom)) {
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");
@ -414,11 +455,48 @@ public class FlowTaskController extends BaseController {
}
Map<String,Object> query = searchQuery.getQuery();
if(fromuptimeStart != null){
query.put("fromuptimeStart",fromuptimeStart);
}
if(fromuptimeEnd != null) {
query.put("fromuptimeEnd", fromuptimeEnd);
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();
}
}
}
flowTaskService.getFinalProcessInstances(query,pageUtils);
return ResultVoUtil.success(pageUtils);

@ -1281,29 +1281,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
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()){
Long pictureId = Long.parseLong(taskchildPicture.getPictureid());
@ -1400,6 +1377,38 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
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);
}

@ -44,4 +44,12 @@ public class OcrAiApprovalTools {
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="字段新增和修改")
@PostMapping(value = "/saveOrUpdate")
public ResultVo saveOrUpdate(@ApiParam(value = "字段信息", required = true) OcrFieldVo ocrFieldVo) {
public ResultVo saveOrUpdate(@ApiParam(value = "字段信息", required = true) @RequestBody OcrFieldVo ocrFieldVo) {
try {
OcrField ocrField = new OcrField();
ocrField.setName(ocrFieldVo.getName());

@ -214,8 +214,16 @@ public class OcrPictureController extends BaseController {
QueryWrapper<OcrPicture> queryWrapper = new QueryWrapper<>();
String search_month = req.getParameter("search_month");
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)));
String ordertype = req.getParameter("ordertype");
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

@ -30,7 +30,7 @@ public class OcrUserFieldController extends BaseController{
*/
@ApiOperation(value="保存或更新用户展示字段列表", notes="保存或更新用户展示字段列表")
@PostMapping(value = "/saveOrUpdate")
public ResultVo saveOrUpdate(@ApiParam(value = "用户字段信息", required = true) OcrUserFieldVo ocrUserFieldVo) {
public ResultVo saveOrUpdate(@ApiParam(value = "用户字段信息", required = true) @RequestBody OcrUserFieldVo ocrUserFieldVo) {
try {
OcrUserField ocrUserField = new OcrUserField();
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> 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")
private String imgHash;
@ApiModelProperty(value = "相似度数值")
@Schema(description = "相似度数值")
@TableField(value = "similarity_score")
private Integer similarityscore;
@ApiModelProperty(value = "图片查重的比对图片集合")
@TableField(exist = false)
private List<OcrPicture> listCom;

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

@ -20,4 +20,6 @@ public interface IOcrSearchHistoryService extends IService<OcrSearchHistory> {
List<List<Map<String,String>>> selectsearch(String search,String assignee);
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
private OcrPictureclassService ocrPictureclassService;
@Resource
private CategoryService categoryService;
@ -323,25 +324,25 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
//分类不一致的也不需要进行比对
//TODO 接口请求判断重复情况
logService.addLog(103, "AI获取图片相似度接口", sysUser, "sendParams");
if(StringUtils.isBlank(ocrPicture.getImgHash())){
Map<String,String> map = this.getOcrPictureClassifyAndHash(ocrPicture.getLocalpictrueurl());
if(map!=null){
if (StringUtils.isBlank(ocrPicture.getImgHash())) {
Map<String, String> map = this.getOcrPictureClassifyAndHash(ocrPicture.getLocalpictrueurl());
if (map != null) {
ocrPicture.setImgHash(map.get("hash"));
ocrPicture.setClassificationid(map.get("classId"));
}
this.updateById(ocrPicture);
}
if(StringUtils.isBlank(ocrPictureNext.getImgHash())){
Map<String,String> map = this.getOcrPictureClassifyAndHash(ocrPictureNext.getLocalpictrueurl());
if(map!=null){
if (StringUtils.isBlank(ocrPictureNext.getImgHash())) {
Map<String, String> map = this.getOcrPictureClassifyAndHash(ocrPictureNext.getLocalpictrueurl());
if (map != null) {
ocrPictureNext.setImgHash(map.get("hash"));
ocrPictureNext.setClassificationid(map.get("classId"));
}
this.updateById(ocrPictureNext);
}
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 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 resultValue = HashCompareUtil.cmpHash(img, imgNext);
ocrPictureNext.setResult(resultValue);
@ -403,15 +404,15 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
@Override
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);
Map<String,String> map=new HashMap();
map.put("classId",data.getString("classId"));
map.put("hash",data.getString("hash"));
Map<String, String> map = new HashMap();
map.put("classId", data.getString("classId"));
map.put("hash", data.getString("hash"));
return map;
}else{
} else {
return null;
}
}
@ -427,7 +428,13 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
ocrTaskchildPicture.setPackageid(packageid);
StringBuffer pcid = new StringBuffer();
StringBuffer result = new StringBuffer();
int max = 0;
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) {
pcid.append(comp.getId());
result.append(comp.getResult());
@ -439,6 +446,8 @@ public class OcrPictureServiceImpl extends BaseServiceImpl<OcrPictureMybatisDao,
ocrTaskchildPicture.setOcpictureid(pcid.toString());
ocrTaskchildPicture.setPictureresult(result.toString());
ocrTaskchildPicture.setPicturecompare(String.join(",", ocrPicture.getPicturecompareList()));
ocrPicture.setSimilarityscore(max);
this.updateById(ocrPicture);
return ocrTaskchildPictureService.updateById(ocrTaskchildPicture) ? ocrTaskchildPicture : null;
}

@ -1,5 +1,6 @@
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.service.IOcrSearchHistoryService;
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 javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* <p>
@ -46,4 +44,30 @@ public class OcrSearchHistoryServiceImpl extends ServiceImpl<OcrSearchHistoryMap
public Map<Object, Object> toolscount(String 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>
<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>

@ -167,7 +167,7 @@
</where>
</sql>
<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
tc.*
from ocr_taskchild_picture tc,OA_USERFINAL_T uf
@ -215,42 +215,51 @@
</select>
<select id="listmytask" resultType="cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPictureAppro" parameterType="java.util.Map">
select tcp.* from (
select
tc.*,uf.COMMENTHIS,uf.TASKNAME as TASKNAMEHIS,uf.STATSHIS,uf.TASKINDEX,uf.TASKNO
from ocr_taskchild_picture tc
LEFT JOIN OA_USERAPPROVE_T uf ON tc.ID = uf.ID
where tc.ASSIGNEE = #{searchassignee} and tc.TENANTID=#{searchtenantid}
and tc.STATES=2
UNION
select
tc.*,uf.COMMENTHIS,uf.TASKNAME as TASKNAMEHIS,uf.STATSHIS,uf.TASKINDEX,uf.TASKNO
from ocr_taskchild_picture tc,OA_USERAPPROVE_T uf
where tc.ID = uf.FORMID and tc.TENANTID=#{searchtenantid}
<if test="thisLoginUserid != null">
and uf.USERID = #{thisLoginUserid}
</if>
) as tcp
<include refid="Base_Where_union">
</include>
select tcp.* from (
select
tc.*,uf.COMMENTHIS,uf.TASKNAME as TASKNAMEHIS,uf.STATSHIS,uf.TASKINDEX,uf.TASKNO
from ocr_taskchild_picture tc
LEFT JOIN OA_USERAPPROVE_T uf ON tc.ID = uf.ID
where tc.ASSIGNEE = #{searchassignee} and tc.TENANTID=#{searchtenantid}
UNION
select
tc.*,uf.COMMENTHIS,uf.TASKNAME as TASKNAMEHIS,uf.STATSHIS,uf.TASKINDEX,uf.TASKNO
from ocr_taskchild_picture tc,OA_USERAPPROVE_T uf
where tc.ID = uf.FORMID and tc.TENANTID=#{searchtenantid}
<if test="thisLoginUserid != null"> and uf.USERID = #{thisLoginUserid}</if>
) as tcp
<include refid="Base_Where_union"></include>
<if test="page != null">
<if test="page.sortname != null"> order by tcp.${page.sortname} ${page.sortorder}</if>
limit ${page.start}, ${page.Pagesize}
</if>
</select>
<if test="page != null">
<if test="page.sortname != null">
order by tcp.${page.sortname} ${page.sortorder}
</if>
limit ${page.start}, ${page.Pagesize}
</if>
</select>
<select id="listmytaskCount" resultType="java.lang.Long" parameterType="java.util.Map">
select count(tcp.ID) from (
select
tc.*
from ocr_taskchild_picture tc
where tc.ASSIGNEE = #{searchassignee} and tc.TENANTID=#{searchtenantid}
UNION
select
tc.*
from ocr_taskchild_picture tc,OA_USERAPPROVE_T uf
where tc.ID = uf.FORMID and tc.TENANTID=#{searchtenantid}
<if test="thisLoginUserid != null"> and uf.USERID = #{thisLoginUserid}</if>
) as tcp
<include refid="Base_Where_union"></include>
</select>
select count(tcp.ID) from (
select
tc.*
from ocr_taskchild_picture tc
where tc.ASSIGNEE = #{searchassignee} and tc.TENANTID=#{searchtenantid}
and tc.STATES=2
UNION
select
tc.*
from ocr_taskchild_picture tc,OA_USERAPPROVE_T uf
where tc.ID = uf.FORMID and tc.TENANTID=#{searchtenantid}
<if test="thisLoginUserid != null">
and uf.USERID = #{thisLoginUserid}
</if>
) as tcp
<include refid="Base_Where_union">
</include>
</select>

Loading…
Cancel
Save