Commit c26a8dbc by xmh

重构完成

1 parent 4c06d2da
Showing 27 changed files with 1458 additions and 799 deletions
......@@ -6,17 +6,18 @@ package com.viontech.label.core.constant;
* @author 谢明辉
* @date 2021/6/23
*/
public enum PicStatus {
public enum SubTaskStatus {
/** 待标注 */
TO_BE_LABELED(1),
/** 标注中 */
LABELING(2),
/** 完成标注 */
FINISH_LABELING(3),
;
/** 已回收 */
recycled(4);
public int val;
PicStatus(int val) {
SubTaskStatus(int val) {
this.val = val;
}
}
......@@ -2,12 +2,13 @@ package com.viontech.label.platform.controller.base;
import com.viontech.label.platform.base.BaseController;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.base.BaseService;
import com.viontech.label.platform.mapper.PicMapper;
import com.viontech.label.platform.model.Pic;
import com.viontech.label.platform.model.PicExample;
import com.viontech.label.platform.service.adapter.PicService;
import com.viontech.label.platform.vo.PicVo;
import javax.annotation.Resource;
public abstract class PicBaseController extends BaseController<Pic, PicVo> {
......@@ -18,155 +19,114 @@ public abstract class PicBaseController extends BaseController<Pic, PicVo> {
protected BaseExample getExample(PicVo picVo, int type) {
PicExample picExample = new PicExample();
PicExample.Criteria criteria = picExample.createCriteria();
if (picVo.getId() != null) {
if(picVo.getId() != null) {
criteria.andIdEqualTo(picVo.getId());
}
if (picVo.getId_arr() != null) {
if(picVo.getId_arr() != null) {
criteria.andIdIn(picVo.getId_arr());
}
if (picVo.getId_gt() != null) {
if(picVo.getId_gt() != null) {
criteria.andIdGreaterThan(picVo.getId_gt());
}
if (picVo.getId_lt() != null) {
if(picVo.getId_lt() != null) {
criteria.andIdLessThan(picVo.getId_lt());
}
if (picVo.getId_gte() != null) {
if(picVo.getId_gte() != null) {
criteria.andIdGreaterThanOrEqualTo(picVo.getId_gte());
}
if (picVo.getId_lte() != null) {
if(picVo.getId_lte() != null) {
criteria.andIdLessThanOrEqualTo(picVo.getId_lte());
}
if (picVo.getUnid() != null) {
if(picVo.getUnid() != null) {
criteria.andUnidEqualTo(picVo.getUnid());
}
if (picVo.getUnid_arr() != null) {
if(picVo.getUnid_arr() != null) {
criteria.andUnidIn(picVo.getUnid_arr());
}
if (picVo.getUnid_like() != null) {
if(picVo.getUnid_like() != null) {
criteria.andUnidLike(picVo.getUnid_like());
}
if (picVo.getCreateTime() != null) {
if(picVo.getCreateTime() != null) {
criteria.andCreateTimeEqualTo(picVo.getCreateTime());
}
if (picVo.getCreateTime_arr() != null) {
if(picVo.getCreateTime_arr() != null) {
criteria.andCreateTimeIn(picVo.getCreateTime_arr());
}
if (picVo.getCreateTime_gt() != null) {
if(picVo.getCreateTime_gt() != null) {
criteria.andCreateTimeGreaterThan(picVo.getCreateTime_gt());
}
if (picVo.getCreateTime_lt() != null) {
if(picVo.getCreateTime_lt() != null) {
criteria.andCreateTimeLessThan(picVo.getCreateTime_lt());
}
if (picVo.getCreateTime_gte() != null) {
if(picVo.getCreateTime_gte() != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(picVo.getCreateTime_gte());
}
if (picVo.getCreateTime_lte() != null) {
if(picVo.getCreateTime_lte() != null) {
criteria.andCreateTimeLessThanOrEqualTo(picVo.getCreateTime_lte());
}
if (picVo.getName() != null) {
if(picVo.getName() != null) {
criteria.andNameEqualTo(picVo.getName());
}
if (picVo.getName_arr() != null) {
if(picVo.getName_arr() != null) {
criteria.andNameIn(picVo.getName_arr());
}
if (picVo.getName_like() != null) {
if(picVo.getName_like() != null) {
criteria.andNameLike(picVo.getName_like());
}
if (picVo.getStorageId() != null) {
if(picVo.getStorageId() != null) {
criteria.andStorageIdEqualTo(picVo.getStorageId());
}
if (picVo.getStorageId_arr() != null) {
if(picVo.getStorageId_arr() != null) {
criteria.andStorageIdIn(picVo.getStorageId_arr());
}
if (picVo.getStorageId_gt() != null) {
if(picVo.getStorageId_gt() != null) {
criteria.andStorageIdGreaterThan(picVo.getStorageId_gt());
}
if (picVo.getStorageId_lt() != null) {
if(picVo.getStorageId_lt() != null) {
criteria.andStorageIdLessThan(picVo.getStorageId_lt());
}
if (picVo.getStorageId_gte() != null) {
if(picVo.getStorageId_gte() != null) {
criteria.andStorageIdGreaterThanOrEqualTo(picVo.getStorageId_gte());
}
if (picVo.getStorageId_lte() != null) {
if(picVo.getStorageId_lte() != null) {
criteria.andStorageIdLessThanOrEqualTo(picVo.getStorageId_lte());
}
if (picVo.getPackId() != null) {
if(picVo.getPackId() != null) {
criteria.andPackIdEqualTo(picVo.getPackId());
}
if (picVo.getPackId_arr() != null) {
if(picVo.getPackId_arr() != null) {
criteria.andPackIdIn(picVo.getPackId_arr());
}
if (picVo.getPackId_gt() != null) {
if(picVo.getPackId_gt() != null) {
criteria.andPackIdGreaterThan(picVo.getPackId_gt());
}
if (picVo.getPackId_lt() != null) {
if(picVo.getPackId_lt() != null) {
criteria.andPackIdLessThan(picVo.getPackId_lt());
}
if (picVo.getPackId_gte() != null) {
if(picVo.getPackId_gte() != null) {
criteria.andPackIdGreaterThanOrEqualTo(picVo.getPackId_gte());
}
if (picVo.getPackId_lte() != null) {
if(picVo.getPackId_lte() != null) {
criteria.andPackIdLessThanOrEqualTo(picVo.getPackId_lte());
}
if (picVo.getPersonUnid() != null) {
criteria.andPersonUnidEqualTo(picVo.getPersonUnid());
}
if (picVo.getPersonUnid_null() != null) {
if (picVo.getPersonUnid_null().booleanValue()) {
criteria.andPersonUnidIsNull();
} else {
criteria.andPersonUnidIsNotNull();
}
}
if (picVo.getPersonUnid_arr() != null) {
criteria.andPersonUnidIn(picVo.getPersonUnid_arr());
}
if (picVo.getPersonUnid_like() != null) {
criteria.andPersonUnidLike(picVo.getPersonUnid_like());
}
if (picVo.getStatus() != null) {
if(picVo.getStatus() != null) {
criteria.andStatusEqualTo(picVo.getStatus());
}
if (picVo.getStatus_arr() != null) {
if(picVo.getStatus_arr() != null) {
criteria.andStatusIn(picVo.getStatus_arr());
}
if (picVo.getStatus_gt() != null) {
if(picVo.getStatus_gt() != null) {
criteria.andStatusGreaterThan(picVo.getStatus_gt());
}
if (picVo.getStatus_lt() != null) {
if(picVo.getStatus_lt() != null) {
criteria.andStatusLessThan(picVo.getStatus_lt());
}
if (picVo.getStatus_gte() != null) {
if(picVo.getStatus_gte() != null) {
criteria.andStatusGreaterThanOrEqualTo(picVo.getStatus_gte());
}
if (picVo.getStatus_lte() != null) {
if(picVo.getStatus_lte() != null) {
criteria.andStatusLessThanOrEqualTo(picVo.getStatus_lte());
}
if (picVo.getReidFinishUser() != null) {
criteria.andReidFinishUserEqualTo(picVo.getReidFinishUser());
}
if (picVo.getReidFinishUser_null() != null) {
if (picVo.getReidFinishUser_null().booleanValue()) {
criteria.andReidFinishUserIsNull();
} else {
criteria.andReidFinishUserIsNotNull();
}
}
if (picVo.getReidFinishUser_arr() != null) {
criteria.andReidFinishUserIn(picVo.getReidFinishUser_arr());
}
if (picVo.getReidFinishUser_gt() != null) {
criteria.andReidFinishUserGreaterThan(picVo.getReidFinishUser_gt());
}
if (picVo.getReidFinishUser_lt() != null) {
criteria.andReidFinishUserLessThan(picVo.getReidFinishUser_lt());
}
if (picVo.getReidFinishUser_gte() != null) {
criteria.andReidFinishUserGreaterThanOrEqualTo(picVo.getReidFinishUser_gte());
}
if (picVo.getReidFinishUser_lte() != null) {
criteria.andReidFinishUserLessThanOrEqualTo(picVo.getReidFinishUser_lte());
}
return picExample;
}
......
......@@ -7,6 +7,7 @@ import com.viontech.label.platform.model.SubTask;
import com.viontech.label.platform.model.SubTaskExample;
import com.viontech.label.platform.service.adapter.SubTaskService;
import com.viontech.label.platform.vo.SubTaskVo;
import javax.annotation.Resource;
public abstract class SubTaskBaseController extends BaseController<SubTask, SubTaskVo> {
......@@ -17,257 +18,323 @@ public abstract class SubTaskBaseController extends BaseController<SubTask, SubT
protected BaseExample getExample(SubTaskVo subTaskVo, int type) {
SubTaskExample subTaskExample = new SubTaskExample();
SubTaskExample.Criteria criteria = subTaskExample.createCriteria();
if(subTaskVo.getId() != null) {
if (subTaskVo.getId() != null) {
criteria.andIdEqualTo(subTaskVo.getId());
}
if(subTaskVo.getId_arr() != null) {
if (subTaskVo.getId_arr() != null) {
criteria.andIdIn(subTaskVo.getId_arr());
}
if(subTaskVo.getId_gt() != null) {
if (subTaskVo.getId_gt() != null) {
criteria.andIdGreaterThan(subTaskVo.getId_gt());
}
if(subTaskVo.getId_lt() != null) {
if (subTaskVo.getId_lt() != null) {
criteria.andIdLessThan(subTaskVo.getId_lt());
}
if(subTaskVo.getId_gte() != null) {
if (subTaskVo.getId_gte() != null) {
criteria.andIdGreaterThanOrEqualTo(subTaskVo.getId_gte());
}
if(subTaskVo.getId_lte() != null) {
if (subTaskVo.getId_lte() != null) {
criteria.andIdLessThanOrEqualTo(subTaskVo.getId_lte());
}
if(subTaskVo.getUnid() != null) {
if (subTaskVo.getUnid() != null) {
criteria.andUnidEqualTo(subTaskVo.getUnid());
}
if(subTaskVo.getUnid_arr() != null) {
if (subTaskVo.getUnid_arr() != null) {
criteria.andUnidIn(subTaskVo.getUnid_arr());
}
if(subTaskVo.getUnid_like() != null) {
if (subTaskVo.getUnid_like() != null) {
criteria.andUnidLike(subTaskVo.getUnid_like());
}
if(subTaskVo.getCreateTime() != null) {
if (subTaskVo.getCreateTime() != null) {
criteria.andCreateTimeEqualTo(subTaskVo.getCreateTime());
}
if(subTaskVo.getCreateTime_arr() != null) {
if (subTaskVo.getCreateTime_arr() != null) {
criteria.andCreateTimeIn(subTaskVo.getCreateTime_arr());
}
if(subTaskVo.getCreateTime_gt() != null) {
if (subTaskVo.getCreateTime_gt() != null) {
criteria.andCreateTimeGreaterThan(subTaskVo.getCreateTime_gt());
}
if(subTaskVo.getCreateTime_lt() != null) {
if (subTaskVo.getCreateTime_lt() != null) {
criteria.andCreateTimeLessThan(subTaskVo.getCreateTime_lt());
}
if(subTaskVo.getCreateTime_gte() != null) {
if (subTaskVo.getCreateTime_gte() != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(subTaskVo.getCreateTime_gte());
}
if(subTaskVo.getCreateTime_lte() != null) {
if (subTaskVo.getCreateTime_lte() != null) {
criteria.andCreateTimeLessThanOrEqualTo(subTaskVo.getCreateTime_lte());
}
if(subTaskVo.getCreateUser() != null) {
if (subTaskVo.getCreateUser() != null) {
criteria.andCreateUserEqualTo(subTaskVo.getCreateUser());
}
if(subTaskVo.getCreateUser_null() != null) {
if(subTaskVo.getCreateUser_null().booleanValue()) {
if (subTaskVo.getCreateUser_null() != null) {
if (subTaskVo.getCreateUser_null().booleanValue()) {
criteria.andCreateUserIsNull();
} else {
criteria.andCreateUserIsNotNull();
}
}
if(subTaskVo.getCreateUser_arr() != null) {
if (subTaskVo.getCreateUser_arr() != null) {
criteria.andCreateUserIn(subTaskVo.getCreateUser_arr());
}
if(subTaskVo.getCreateUser_gt() != null) {
if (subTaskVo.getCreateUser_gt() != null) {
criteria.andCreateUserGreaterThan(subTaskVo.getCreateUser_gt());
}
if(subTaskVo.getCreateUser_lt() != null) {
if (subTaskVo.getCreateUser_lt() != null) {
criteria.andCreateUserLessThan(subTaskVo.getCreateUser_lt());
}
if(subTaskVo.getCreateUser_gte() != null) {
if (subTaskVo.getCreateUser_gte() != null) {
criteria.andCreateUserGreaterThanOrEqualTo(subTaskVo.getCreateUser_gte());
}
if(subTaskVo.getCreateUser_lte() != null) {
if (subTaskVo.getCreateUser_lte() != null) {
criteria.andCreateUserLessThanOrEqualTo(subTaskVo.getCreateUser_lte());
}
if(subTaskVo.getPicId() != null) {
if (subTaskVo.getPicId() != null) {
criteria.andPicIdEqualTo(subTaskVo.getPicId());
}
if(subTaskVo.getPicId_arr() != null) {
if (subTaskVo.getPicId_arr() != null) {
criteria.andPicIdIn(subTaskVo.getPicId_arr());
}
if(subTaskVo.getPicId_gt() != null) {
if (subTaskVo.getPicId_gt() != null) {
criteria.andPicIdGreaterThan(subTaskVo.getPicId_gt());
}
if(subTaskVo.getPicId_lt() != null) {
if (subTaskVo.getPicId_lt() != null) {
criteria.andPicIdLessThan(subTaskVo.getPicId_lt());
}
if(subTaskVo.getPicId_gte() != null) {
if (subTaskVo.getPicId_gte() != null) {
criteria.andPicIdGreaterThanOrEqualTo(subTaskVo.getPicId_gte());
}
if(subTaskVo.getPicId_lte() != null) {
if (subTaskVo.getPicId_lte() != null) {
criteria.andPicIdLessThanOrEqualTo(subTaskVo.getPicId_lte());
}
if(subTaskVo.getTaskId() != null) {
if (subTaskVo.getTaskId() != null) {
criteria.andTaskIdEqualTo(subTaskVo.getTaskId());
}
if(subTaskVo.getTaskId_arr() != null) {
if (subTaskVo.getTaskId_arr() != null) {
criteria.andTaskIdIn(subTaskVo.getTaskId_arr());
}
if(subTaskVo.getTaskId_gt() != null) {
if (subTaskVo.getTaskId_gt() != null) {
criteria.andTaskIdGreaterThan(subTaskVo.getTaskId_gt());
}
if(subTaskVo.getTaskId_lt() != null) {
if (subTaskVo.getTaskId_lt() != null) {
criteria.andTaskIdLessThan(subTaskVo.getTaskId_lt());
}
if(subTaskVo.getTaskId_gte() != null) {
if (subTaskVo.getTaskId_gte() != null) {
criteria.andTaskIdGreaterThanOrEqualTo(subTaskVo.getTaskId_gte());
}
if(subTaskVo.getTaskId_lte() != null) {
if (subTaskVo.getTaskId_lte() != null) {
criteria.andTaskIdLessThanOrEqualTo(subTaskVo.getTaskId_lte());
}
if(subTaskVo.getInInspectorId() != null) {
if (subTaskVo.getInInspectorId() != null) {
criteria.andInInspectorIdEqualTo(subTaskVo.getInInspectorId());
}
if(subTaskVo.getInInspectorId_null() != null) {
if(subTaskVo.getInInspectorId_null().booleanValue()) {
if (subTaskVo.getInInspectorId_null() != null) {
if (subTaskVo.getInInspectorId_null().booleanValue()) {
criteria.andInInspectorIdIsNull();
} else {
criteria.andInInspectorIdIsNotNull();
}
}
if(subTaskVo.getInInspectorId_arr() != null) {
if (subTaskVo.getInInspectorId_arr() != null) {
criteria.andInInspectorIdIn(subTaskVo.getInInspectorId_arr());
}
if(subTaskVo.getInInspectorId_gt() != null) {
if (subTaskVo.getInInspectorId_gt() != null) {
criteria.andInInspectorIdGreaterThan(subTaskVo.getInInspectorId_gt());
}
if(subTaskVo.getInInspectorId_lt() != null) {
if (subTaskVo.getInInspectorId_lt() != null) {
criteria.andInInspectorIdLessThan(subTaskVo.getInInspectorId_lt());
}
if(subTaskVo.getInInspectorId_gte() != null) {
if (subTaskVo.getInInspectorId_gte() != null) {
criteria.andInInspectorIdGreaterThanOrEqualTo(subTaskVo.getInInspectorId_gte());
}
if(subTaskVo.getInInspectorId_lte() != null) {
if (subTaskVo.getInInspectorId_lte() != null) {
criteria.andInInspectorIdLessThanOrEqualTo(subTaskVo.getInInspectorId_lte());
}
if(subTaskVo.getOutInspectorId() != null) {
if (subTaskVo.getOutInspectorId() != null) {
criteria.andOutInspectorIdEqualTo(subTaskVo.getOutInspectorId());
}
if(subTaskVo.getOutInspectorId_null() != null) {
if(subTaskVo.getOutInspectorId_null().booleanValue()) {
if (subTaskVo.getOutInspectorId_null() != null) {
if (subTaskVo.getOutInspectorId_null().booleanValue()) {
criteria.andOutInspectorIdIsNull();
} else {
criteria.andOutInspectorIdIsNotNull();
}
}
if(subTaskVo.getOutInspectorId_arr() != null) {
if (subTaskVo.getOutInspectorId_arr() != null) {
criteria.andOutInspectorIdIn(subTaskVo.getOutInspectorId_arr());
}
if(subTaskVo.getOutInspectorId_gt() != null) {
if (subTaskVo.getOutInspectorId_gt() != null) {
criteria.andOutInspectorIdGreaterThan(subTaskVo.getOutInspectorId_gt());
}
if(subTaskVo.getOutInspectorId_lt() != null) {
if (subTaskVo.getOutInspectorId_lt() != null) {
criteria.andOutInspectorIdLessThan(subTaskVo.getOutInspectorId_lt());
}
if(subTaskVo.getOutInspectorId_gte() != null) {
if (subTaskVo.getOutInspectorId_gte() != null) {
criteria.andOutInspectorIdGreaterThanOrEqualTo(subTaskVo.getOutInspectorId_gte());
}
if(subTaskVo.getOutInspectorId_lte() != null) {
if (subTaskVo.getOutInspectorId_lte() != null) {
criteria.andOutInspectorIdLessThanOrEqualTo(subTaskVo.getOutInspectorId_lte());
}
if(subTaskVo.getAnnotatorId() != null) {
if (subTaskVo.getAnnotatorId() != null) {
criteria.andAnnotatorIdEqualTo(subTaskVo.getAnnotatorId());
}
if(subTaskVo.getAnnotatorId_null() != null) {
if(subTaskVo.getAnnotatorId_null().booleanValue()) {
if (subTaskVo.getAnnotatorId_null() != null) {
if (subTaskVo.getAnnotatorId_null().booleanValue()) {
criteria.andAnnotatorIdIsNull();
} else {
criteria.andAnnotatorIdIsNotNull();
}
}
if(subTaskVo.getAnnotatorId_arr() != null) {
if (subTaskVo.getAnnotatorId_arr() != null) {
criteria.andAnnotatorIdIn(subTaskVo.getAnnotatorId_arr());
}
if(subTaskVo.getAnnotatorId_gt() != null) {
if (subTaskVo.getAnnotatorId_gt() != null) {
criteria.andAnnotatorIdGreaterThan(subTaskVo.getAnnotatorId_gt());
}
if(subTaskVo.getAnnotatorId_lt() != null) {
if (subTaskVo.getAnnotatorId_lt() != null) {
criteria.andAnnotatorIdLessThan(subTaskVo.getAnnotatorId_lt());
}
if(subTaskVo.getAnnotatorId_gte() != null) {
if (subTaskVo.getAnnotatorId_gte() != null) {
criteria.andAnnotatorIdGreaterThanOrEqualTo(subTaskVo.getAnnotatorId_gte());
}
if(subTaskVo.getAnnotatorId_lte() != null) {
if (subTaskVo.getAnnotatorId_lte() != null) {
criteria.andAnnotatorIdLessThanOrEqualTo(subTaskVo.getAnnotatorId_lte());
}
if(subTaskVo.getLabelResult() != null) {
if (subTaskVo.getAnnotateTime() != null) {
criteria.andAnnotateTimeEqualTo(subTaskVo.getAnnotateTime());
}
if (subTaskVo.getAnnotateTime_null() != null) {
if (subTaskVo.getAnnotateTime_null().booleanValue()) {
criteria.andAnnotateTimeIsNull();
} else {
criteria.andAnnotateTimeIsNotNull();
}
}
if (subTaskVo.getAnnotateTime_arr() != null) {
criteria.andAnnotateTimeIn(subTaskVo.getAnnotateTime_arr());
}
if (subTaskVo.getAnnotateTime_gt() != null) {
criteria.andAnnotateTimeGreaterThan(subTaskVo.getAnnotateTime_gt());
}
if (subTaskVo.getAnnotateTime_lt() != null) {
criteria.andAnnotateTimeLessThan(subTaskVo.getAnnotateTime_lt());
}
if (subTaskVo.getAnnotateTime_gte() != null) {
criteria.andAnnotateTimeGreaterThanOrEqualTo(subTaskVo.getAnnotateTime_gte());
}
if (subTaskVo.getAnnotateTime_lte() != null) {
criteria.andAnnotateTimeLessThanOrEqualTo(subTaskVo.getAnnotateTime_lte());
}
if (subTaskVo.getLabelResult() != null) {
criteria.andLabelResultEqualTo(subTaskVo.getLabelResult());
}
if(subTaskVo.getLabelResult_null() != null) {
if(subTaskVo.getLabelResult_null().booleanValue()) {
if (subTaskVo.getLabelResult_null() != null) {
if (subTaskVo.getLabelResult_null().booleanValue()) {
criteria.andLabelResultIsNull();
} else {
criteria.andLabelResultIsNotNull();
}
}
if(subTaskVo.getLabelResult_arr() != null) {
if (subTaskVo.getLabelResult_arr() != null) {
criteria.andLabelResultIn(subTaskVo.getLabelResult_arr());
}
if(subTaskVo.getLabelResult_like() != null) {
if (subTaskVo.getLabelResult_like() != null) {
criteria.andLabelResultLike(subTaskVo.getLabelResult_like());
}
if(subTaskVo.getInStatus() != null) {
if (subTaskVo.getInStatus() != null) {
criteria.andInStatusEqualTo(subTaskVo.getInStatus());
}
if(subTaskVo.getInStatus_arr() != null) {
if (subTaskVo.getInStatus_arr() != null) {
criteria.andInStatusIn(subTaskVo.getInStatus_arr());
}
if(subTaskVo.getInStatus_gt() != null) {
if (subTaskVo.getInStatus_gt() != null) {
criteria.andInStatusGreaterThan(subTaskVo.getInStatus_gt());
}
if(subTaskVo.getInStatus_lt() != null) {
if (subTaskVo.getInStatus_lt() != null) {
criteria.andInStatusLessThan(subTaskVo.getInStatus_lt());
}
if(subTaskVo.getInStatus_gte() != null) {
if (subTaskVo.getInStatus_gte() != null) {
criteria.andInStatusGreaterThanOrEqualTo(subTaskVo.getInStatus_gte());
}
if(subTaskVo.getInStatus_lte() != null) {
if (subTaskVo.getInStatus_lte() != null) {
criteria.andInStatusLessThanOrEqualTo(subTaskVo.getInStatus_lte());
}
if(subTaskVo.getOutStatus() != null) {
if (subTaskVo.getOutStatus() != null) {
criteria.andOutStatusEqualTo(subTaskVo.getOutStatus());
}
if(subTaskVo.getOutStatus_arr() != null) {
if (subTaskVo.getOutStatus_arr() != null) {
criteria.andOutStatusIn(subTaskVo.getOutStatus_arr());
}
if(subTaskVo.getOutStatus_gt() != null) {
if (subTaskVo.getOutStatus_gt() != null) {
criteria.andOutStatusGreaterThan(subTaskVo.getOutStatus_gt());
}
if(subTaskVo.getOutStatus_lt() != null) {
if (subTaskVo.getOutStatus_lt() != null) {
criteria.andOutStatusLessThan(subTaskVo.getOutStatus_lt());
}
if(subTaskVo.getOutStatus_gte() != null) {
if (subTaskVo.getOutStatus_gte() != null) {
criteria.andOutStatusGreaterThanOrEqualTo(subTaskVo.getOutStatus_gte());
}
if(subTaskVo.getOutStatus_lte() != null) {
if (subTaskVo.getOutStatus_lte() != null) {
criteria.andOutStatusLessThanOrEqualTo(subTaskVo.getOutStatus_lte());
}
if(subTaskVo.getStatus() != null) {
if (subTaskVo.getStatus() != null) {
criteria.andStatusEqualTo(subTaskVo.getStatus());
}
if(subTaskVo.getStatus_arr() != null) {
if (subTaskVo.getStatus_arr() != null) {
criteria.andStatusIn(subTaskVo.getStatus_arr());
}
if(subTaskVo.getStatus_gt() != null) {
if (subTaskVo.getStatus_gt() != null) {
criteria.andStatusGreaterThan(subTaskVo.getStatus_gt());
}
if(subTaskVo.getStatus_lt() != null) {
if (subTaskVo.getStatus_lt() != null) {
criteria.andStatusLessThan(subTaskVo.getStatus_lt());
}
if(subTaskVo.getStatus_gte() != null) {
if (subTaskVo.getStatus_gte() != null) {
criteria.andStatusGreaterThanOrEqualTo(subTaskVo.getStatus_gte());
}
if(subTaskVo.getStatus_lte() != null) {
if (subTaskVo.getStatus_lte() != null) {
criteria.andStatusLessThanOrEqualTo(subTaskVo.getStatus_lte());
}
if (subTaskVo.getPersonUnid() != null) {
criteria.andPersonUnidEqualTo(subTaskVo.getPersonUnid());
}
if (subTaskVo.getPersonUnid_null() != null) {
if (subTaskVo.getPersonUnid_null().booleanValue()) {
criteria.andPersonUnidIsNull();
} else {
criteria.andPersonUnidIsNotNull();
}
}
if (subTaskVo.getPersonUnid_arr() != null) {
criteria.andPersonUnidIn(subTaskVo.getPersonUnid_arr());
}
if (subTaskVo.getPersonUnid_like() != null) {
criteria.andPersonUnidLike(subTaskVo.getPersonUnid_like());
}
if (subTaskVo.getPackId() != null) {
criteria.andPackIdEqualTo(subTaskVo.getPackId());
}
if (subTaskVo.getPackId_null() != null) {
if (subTaskVo.getPackId_null().booleanValue()) {
criteria.andPackIdIsNull();
} else {
criteria.andPackIdIsNotNull();
}
}
if (subTaskVo.getPackId_arr() != null) {
criteria.andPackIdIn(subTaskVo.getPackId_arr());
}
if (subTaskVo.getPackId_gt() != null) {
criteria.andPackIdGreaterThan(subTaskVo.getPackId_gt());
}
if (subTaskVo.getPackId_lt() != null) {
criteria.andPackIdLessThan(subTaskVo.getPackId_lt());
}
if (subTaskVo.getPackId_gte() != null) {
criteria.andPackIdGreaterThanOrEqualTo(subTaskVo.getPackId_gte());
}
if (subTaskVo.getPackId_lte() != null) {
criteria.andPackIdLessThanOrEqualTo(subTaskVo.getPackId_lte());
}
return subTaskExample;
}
......
......@@ -7,6 +7,7 @@ import com.viontech.label.platform.model.Task;
import com.viontech.label.platform.model.TaskExample;
import com.viontech.label.platform.service.adapter.TaskService;
import com.viontech.label.platform.vo.TaskVo;
import javax.annotation.Resource;
public abstract class TaskBaseController extends BaseController<Task, TaskVo> {
......@@ -17,239 +18,289 @@ public abstract class TaskBaseController extends BaseController<Task, TaskVo> {
protected BaseExample getExample(TaskVo taskVo, int type) {
TaskExample taskExample = new TaskExample();
TaskExample.Criteria criteria = taskExample.createCriteria();
if(taskVo.getId() != null) {
if (taskVo.getId() != null) {
criteria.andIdEqualTo(taskVo.getId());
}
if(taskVo.getId_arr() != null) {
if (taskVo.getId_arr() != null) {
criteria.andIdIn(taskVo.getId_arr());
}
if(taskVo.getId_gt() != null) {
if (taskVo.getId_gt() != null) {
criteria.andIdGreaterThan(taskVo.getId_gt());
}
if(taskVo.getId_lt() != null) {
if (taskVo.getId_lt() != null) {
criteria.andIdLessThan(taskVo.getId_lt());
}
if(taskVo.getId_gte() != null) {
if (taskVo.getId_gte() != null) {
criteria.andIdGreaterThanOrEqualTo(taskVo.getId_gte());
}
if(taskVo.getId_lte() != null) {
if (taskVo.getId_lte() != null) {
criteria.andIdLessThanOrEqualTo(taskVo.getId_lte());
}
if(taskVo.getUnid() != null) {
if (taskVo.getUnid() != null) {
criteria.andUnidEqualTo(taskVo.getUnid());
}
if(taskVo.getUnid_arr() != null) {
if (taskVo.getUnid_arr() != null) {
criteria.andUnidIn(taskVo.getUnid_arr());
}
if(taskVo.getUnid_like() != null) {
if (taskVo.getUnid_like() != null) {
criteria.andUnidLike(taskVo.getUnid_like());
}
if(taskVo.getCreateTime() != null) {
if (taskVo.getCreateTime() != null) {
criteria.andCreateTimeEqualTo(taskVo.getCreateTime());
}
if(taskVo.getCreateTime_arr() != null) {
if (taskVo.getCreateTime_arr() != null) {
criteria.andCreateTimeIn(taskVo.getCreateTime_arr());
}
if(taskVo.getCreateTime_gt() != null) {
if (taskVo.getCreateTime_gt() != null) {
criteria.andCreateTimeGreaterThan(taskVo.getCreateTime_gt());
}
if(taskVo.getCreateTime_lt() != null) {
if (taskVo.getCreateTime_lt() != null) {
criteria.andCreateTimeLessThan(taskVo.getCreateTime_lt());
}
if(taskVo.getCreateTime_gte() != null) {
if (taskVo.getCreateTime_gte() != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(taskVo.getCreateTime_gte());
}
if(taskVo.getCreateTime_lte() != null) {
if (taskVo.getCreateTime_lte() != null) {
criteria.andCreateTimeLessThanOrEqualTo(taskVo.getCreateTime_lte());
}
if(taskVo.getCreateUser() != null) {
if (taskVo.getCreateUser() != null) {
criteria.andCreateUserEqualTo(taskVo.getCreateUser());
}
if(taskVo.getCreateUser_null() != null) {
if(taskVo.getCreateUser_null().booleanValue()) {
if (taskVo.getCreateUser_null() != null) {
if (taskVo.getCreateUser_null().booleanValue()) {
criteria.andCreateUserIsNull();
} else {
criteria.andCreateUserIsNotNull();
}
}
if(taskVo.getCreateUser_arr() != null) {
if (taskVo.getCreateUser_arr() != null) {
criteria.andCreateUserIn(taskVo.getCreateUser_arr());
}
if(taskVo.getCreateUser_gt() != null) {
if (taskVo.getCreateUser_gt() != null) {
criteria.andCreateUserGreaterThan(taskVo.getCreateUser_gt());
}
if(taskVo.getCreateUser_lt() != null) {
if (taskVo.getCreateUser_lt() != null) {
criteria.andCreateUserLessThan(taskVo.getCreateUser_lt());
}
if(taskVo.getCreateUser_gte() != null) {
if (taskVo.getCreateUser_gte() != null) {
criteria.andCreateUserGreaterThanOrEqualTo(taskVo.getCreateUser_gte());
}
if(taskVo.getCreateUser_lte() != null) {
if (taskVo.getCreateUser_lte() != null) {
criteria.andCreateUserLessThanOrEqualTo(taskVo.getCreateUser_lte());
}
if(taskVo.getName() != null) {
if (taskVo.getName() != null) {
criteria.andNameEqualTo(taskVo.getName());
}
if(taskVo.getName_arr() != null) {
if (taskVo.getName_arr() != null) {
criteria.andNameIn(taskVo.getName_arr());
}
if(taskVo.getName_like() != null) {
if (taskVo.getName_like() != null) {
criteria.andNameLike(taskVo.getName_like());
}
if(taskVo.getType() != null) {
if (taskVo.getType() != null) {
criteria.andTypeEqualTo(taskVo.getType());
}
if(taskVo.getType_arr() != null) {
if (taskVo.getType_arr() != null) {
criteria.andTypeIn(taskVo.getType_arr());
}
if(taskVo.getType_gt() != null) {
if (taskVo.getType_gt() != null) {
criteria.andTypeGreaterThan(taskVo.getType_gt());
}
if(taskVo.getType_lt() != null) {
if (taskVo.getType_lt() != null) {
criteria.andTypeLessThan(taskVo.getType_lt());
}
if(taskVo.getType_gte() != null) {
if (taskVo.getType_gte() != null) {
criteria.andTypeGreaterThanOrEqualTo(taskVo.getType_gte());
}
if(taskVo.getType_lte() != null) {
if (taskVo.getType_lte() != null) {
criteria.andTypeLessThanOrEqualTo(taskVo.getType_lte());
}
if(taskVo.getLabelType() != null) {
if (taskVo.getLabelType() != null) {
criteria.andLabelTypeEqualTo(taskVo.getLabelType());
}
if(taskVo.getLabelType_arr() != null) {
if (taskVo.getLabelType_arr() != null) {
criteria.andLabelTypeIn(taskVo.getLabelType_arr());
}
if(taskVo.getLabelType_gt() != null) {
if (taskVo.getLabelType_gt() != null) {
criteria.andLabelTypeGreaterThan(taskVo.getLabelType_gt());
}
if(taskVo.getLabelType_lt() != null) {
if (taskVo.getLabelType_lt() != null) {
criteria.andLabelTypeLessThan(taskVo.getLabelType_lt());
}
if(taskVo.getLabelType_gte() != null) {
if (taskVo.getLabelType_gte() != null) {
criteria.andLabelTypeGreaterThanOrEqualTo(taskVo.getLabelType_gte());
}
if(taskVo.getLabelType_lte() != null) {
if (taskVo.getLabelType_lte() != null) {
criteria.andLabelTypeLessThanOrEqualTo(taskVo.getLabelType_lte());
}
if(taskVo.getAccountId() != null) {
if (taskVo.getAccountId() != null) {
criteria.andAccountIdEqualTo(taskVo.getAccountId());
}
if(taskVo.getAccountId_arr() != null) {
if (taskVo.getAccountId_arr() != null) {
criteria.andAccountIdIn(taskVo.getAccountId_arr());
}
if(taskVo.getAccountId_gt() != null) {
if (taskVo.getAccountId_gt() != null) {
criteria.andAccountIdGreaterThan(taskVo.getAccountId_gt());
}
if(taskVo.getAccountId_lt() != null) {
if (taskVo.getAccountId_lt() != null) {
criteria.andAccountIdLessThan(taskVo.getAccountId_lt());
}
if(taskVo.getAccountId_gte() != null) {
if (taskVo.getAccountId_gte() != null) {
criteria.andAccountIdGreaterThanOrEqualTo(taskVo.getAccountId_gte());
}
if(taskVo.getAccountId_lte() != null) {
if (taskVo.getAccountId_lte() != null) {
criteria.andAccountIdLessThanOrEqualTo(taskVo.getAccountId_lte());
}
if(taskVo.getContractorManagerId() != null) {
if (taskVo.getContractorManagerId() != null) {
criteria.andContractorManagerIdEqualTo(taskVo.getContractorManagerId());
}
if(taskVo.getContractorManagerId_null() != null) {
if(taskVo.getContractorManagerId_null().booleanValue()) {
if (taskVo.getContractorManagerId_null() != null) {
if (taskVo.getContractorManagerId_null().booleanValue()) {
criteria.andContractorManagerIdIsNull();
} else {
criteria.andContractorManagerIdIsNotNull();
}
}
if(taskVo.getContractorManagerId_arr() != null) {
if (taskVo.getContractorManagerId_arr() != null) {
criteria.andContractorManagerIdIn(taskVo.getContractorManagerId_arr());
}
if(taskVo.getContractorManagerId_gt() != null) {
if (taskVo.getContractorManagerId_gt() != null) {
criteria.andContractorManagerIdGreaterThan(taskVo.getContractorManagerId_gt());
}
if(taskVo.getContractorManagerId_lt() != null) {
if (taskVo.getContractorManagerId_lt() != null) {
criteria.andContractorManagerIdLessThan(taskVo.getContractorManagerId_lt());
}
if(taskVo.getContractorManagerId_gte() != null) {
if (taskVo.getContractorManagerId_gte() != null) {
criteria.andContractorManagerIdGreaterThanOrEqualTo(taskVo.getContractorManagerId_gte());
}
if(taskVo.getContractorManagerId_lte() != null) {
if (taskVo.getContractorManagerId_lte() != null) {
criteria.andContractorManagerIdLessThanOrEqualTo(taskVo.getContractorManagerId_lte());
}
if(taskVo.getManagerId() != null) {
if (taskVo.getManagerId() != null) {
criteria.andManagerIdEqualTo(taskVo.getManagerId());
}
if(taskVo.getManagerId_null() != null) {
if(taskVo.getManagerId_null().booleanValue()) {
if (taskVo.getManagerId_null() != null) {
if (taskVo.getManagerId_null().booleanValue()) {
criteria.andManagerIdIsNull();
} else {
criteria.andManagerIdIsNotNull();
}
}
if(taskVo.getManagerId_arr() != null) {
if (taskVo.getManagerId_arr() != null) {
criteria.andManagerIdIn(taskVo.getManagerId_arr());
}
if(taskVo.getManagerId_gt() != null) {
if (taskVo.getManagerId_gt() != null) {
criteria.andManagerIdGreaterThan(taskVo.getManagerId_gt());
}
if(taskVo.getManagerId_lt() != null) {
if (taskVo.getManagerId_lt() != null) {
criteria.andManagerIdLessThan(taskVo.getManagerId_lt());
}
if(taskVo.getManagerId_gte() != null) {
if (taskVo.getManagerId_gte() != null) {
criteria.andManagerIdGreaterThanOrEqualTo(taskVo.getManagerId_gte());
}
if(taskVo.getManagerId_lte() != null) {
if (taskVo.getManagerId_lte() != null) {
criteria.andManagerIdLessThanOrEqualTo(taskVo.getManagerId_lte());
}
if(taskVo.getInInspectorId() != null) {
if (taskVo.getAssignTime() != null) {
criteria.andAssignTimeEqualTo(taskVo.getAssignTime());
}
if (taskVo.getAssignTime_null() != null) {
if (taskVo.getAssignTime_null().booleanValue()) {
criteria.andAssignTimeIsNull();
} else {
criteria.andAssignTimeIsNotNull();
}
}
if (taskVo.getAssignTime_arr() != null) {
criteria.andAssignTimeIn(taskVo.getAssignTime_arr());
}
if (taskVo.getAssignTime_gt() != null) {
criteria.andAssignTimeGreaterThan(taskVo.getAssignTime_gt());
}
if (taskVo.getAssignTime_lt() != null) {
criteria.andAssignTimeLessThan(taskVo.getAssignTime_lt());
}
if (taskVo.getAssignTime_gte() != null) {
criteria.andAssignTimeGreaterThanOrEqualTo(taskVo.getAssignTime_gte());
}
if (taskVo.getAssignTime_lte() != null) {
criteria.andAssignTimeLessThanOrEqualTo(taskVo.getAssignTime_lte());
}
if (taskVo.getFinishTime() != null) {
criteria.andFinishTimeEqualTo(taskVo.getFinishTime());
}
if (taskVo.getFinishTime_null() != null) {
if (taskVo.getFinishTime_null().booleanValue()) {
criteria.andFinishTimeIsNull();
} else {
criteria.andFinishTimeIsNotNull();
}
}
if (taskVo.getFinishTime_arr() != null) {
criteria.andFinishTimeIn(taskVo.getFinishTime_arr());
}
if (taskVo.getFinishTime_gt() != null) {
criteria.andFinishTimeGreaterThan(taskVo.getFinishTime_gt());
}
if (taskVo.getFinishTime_lt() != null) {
criteria.andFinishTimeLessThan(taskVo.getFinishTime_lt());
}
if (taskVo.getFinishTime_gte() != null) {
criteria.andFinishTimeGreaterThanOrEqualTo(taskVo.getFinishTime_gte());
}
if (taskVo.getFinishTime_lte() != null) {
criteria.andFinishTimeLessThanOrEqualTo(taskVo.getFinishTime_lte());
}
if (taskVo.getInInspectorId() != null) {
criteria.andInInspectorIdEqualTo(taskVo.getInInspectorId());
}
if(taskVo.getInInspectorId_arr() != null) {
if (taskVo.getInInspectorId_arr() != null) {
criteria.andInInspectorIdIn(taskVo.getInInspectorId_arr());
}
if(taskVo.getInInspectorId_gt() != null) {
if (taskVo.getInInspectorId_gt() != null) {
criteria.andInInspectorIdGreaterThan(taskVo.getInInspectorId_gt());
}
if(taskVo.getInInspectorId_lt() != null) {
if (taskVo.getInInspectorId_lt() != null) {
criteria.andInInspectorIdLessThan(taskVo.getInInspectorId_lt());
}
if(taskVo.getInInspectorId_gte() != null) {
if (taskVo.getInInspectorId_gte() != null) {
criteria.andInInspectorIdGreaterThanOrEqualTo(taskVo.getInInspectorId_gte());
}
if(taskVo.getInInspectorId_lte() != null) {
if (taskVo.getInInspectorId_lte() != null) {
criteria.andInInspectorIdLessThanOrEqualTo(taskVo.getInInspectorId_lte());
}
if(taskVo.getDescription() != null) {
if (taskVo.getDescription() != null) {
criteria.andDescriptionEqualTo(taskVo.getDescription());
}
if(taskVo.getDescription_null() != null) {
if(taskVo.getDescription_null().booleanValue()) {
if (taskVo.getDescription_null() != null) {
if (taskVo.getDescription_null().booleanValue()) {
criteria.andDescriptionIsNull();
} else {
criteria.andDescriptionIsNotNull();
}
}
if(taskVo.getDescription_arr() != null) {
if (taskVo.getDescription_arr() != null) {
criteria.andDescriptionIn(taskVo.getDescription_arr());
}
if(taskVo.getDescription_like() != null) {
if (taskVo.getDescription_like() != null) {
criteria.andDescriptionLike(taskVo.getDescription_like());
}
if(taskVo.getStatus() != null) {
if (taskVo.getStatus() != null) {
criteria.andStatusEqualTo(taskVo.getStatus());
}
if(taskVo.getStatus_arr() != null) {
if (taskVo.getStatus_arr() != null) {
criteria.andStatusIn(taskVo.getStatus_arr());
}
if(taskVo.getStatus_gt() != null) {
if (taskVo.getStatus_gt() != null) {
criteria.andStatusGreaterThan(taskVo.getStatus_gt());
}
if(taskVo.getStatus_lt() != null) {
if (taskVo.getStatus_lt() != null) {
criteria.andStatusLessThan(taskVo.getStatus_lt());
}
if(taskVo.getStatus_gte() != null) {
if (taskVo.getStatus_gte() != null) {
criteria.andStatusGreaterThanOrEqualTo(taskVo.getStatus_gte());
}
if(taskVo.getStatus_lte() != null) {
if (taskVo.getStatus_lte() != null) {
criteria.andStatusLessThanOrEqualTo(taskVo.getStatus_lte());
}
return taskExample;
......
......@@ -5,9 +5,9 @@ import com.github.pagehelper.PageInfo;
import com.viontech.keliu.util.DateUtil;
import com.viontech.keliu.util.JsonMessageUtil;
import com.viontech.label.platform.mapper.LogMapper;
import com.viontech.label.platform.mapper.PicMapper;
import com.viontech.label.platform.model.Pic;
import com.viontech.label.platform.service.adapter.PicService;
import com.viontech.label.platform.mapper.SubTaskMapper;
import com.viontech.label.platform.model.SubTask;
import com.viontech.label.platform.service.adapter.SubTaskService;
import com.viontech.label.platform.service.main.ReidService;
import com.viontech.label.platform.vo.LogVo;
import com.viontech.label.platform.vo.ReidUploadData;
......@@ -33,9 +33,9 @@ import java.util.*;
public class ReidController {
@Resource
private PicService picService;
@Resource
private ReidService reidService;
@Resource
private SubTaskService subTaskService;
@PostMapping("/upload")
......@@ -53,13 +53,13 @@ public class ReidController {
public Object getPeople(@RequestParam Long packId, @RequestParam(required = false) Integer status
, @RequestParam(required = false) Long page, @RequestParam(required = false) Long size) {
PicMapper mapper = (PicMapper) picService.getMapper();
List<Pic> people = mapper.getPeople(packId, status, page == null ? null : (page - 1) * size, size);
SubTaskMapper mapper = (SubTaskMapper) subTaskService.getMapper();
List<SubTask> people = mapper.getPeople(packId, status, page == null ? null : (page - 1) * size, size);
LinkedHashMap<String, List<Pic>> temp = new LinkedHashMap<>();
for (Pic pic : people) {
List<Pic> list = temp.computeIfAbsent(pic.getPersonUnid(), x -> new LinkedList<>());
list.add(pic);
LinkedHashMap<String, List<SubTask>> temp = new LinkedHashMap<>();
for (SubTask item : people) {
List<SubTask> list = temp.computeIfAbsent(item.getPersonUnid(), x -> new LinkedList<>());
list.add(item);
}
if (page != null) {
......@@ -73,13 +73,13 @@ public class ReidController {
@GetMapping("/getOtherPeople")
public Object getNextPeoPle(@RequestParam String personUnid, @RequestParam Long packId, @RequestParam(required = false) Integer status, @RequestParam Integer type) {
PicMapper mapper = (PicMapper) picService.getMapper();
List<Pic> pics = mapper.getOtherPeople(packId, status, personUnid, type == 0 ? ">" : "<", type == 0 ? "" : "desc");
SubTaskMapper mapper = (SubTaskMapper) subTaskService.getMapper();
List<SubTask> pics = mapper.getOtherPeople(packId, status, personUnid, type == 0 ? ">" : "<", type == 0 ? "" : "desc");
if (pics.size() == 0) {
return JsonMessageUtil.getSuccessJsonMsg("没有数据了");
}
String pun = pics.get(0).getPersonUnid();
HashMap<String, List<Pic>> result = new HashMap<>(1);
HashMap<String, List<SubTask>> result = new HashMap<>(1);
result.put(pun, pics);
return JsonMessageUtil.getSuccessJsonMsg(result);
}
......@@ -160,7 +160,7 @@ public class ReidController {
*/
@GetMapping("/getSimilarPerson")
public Object getSimilarPerson(@RequestParam Long[] picIdArr, @RequestParam Long packId, @RequestParam Long size, @RequestParam(required = false) Integer timeInterval) {
Map<String, List<Pic>> similarPerson = reidService.getSimilarPerson(picIdArr, packId, size, timeInterval);
Map<String, List<SubTask>> similarPerson = reidService.getSimilarPerson(picIdArr, packId, size, timeInterval);
return JsonMessageUtil.getSuccessJsonMsg("success", similarPerson);
}
......
......@@ -31,8 +31,6 @@ public class TaskController extends TaskBaseController {
private UserService userService;
@Resource
private TaskPackService taskPackService;
@Resource
private PackService packService;
@Override
protected BaseExample getExample(TaskVo taskVo, int type) {
......
......@@ -33,35 +33,6 @@ public interface PicMapper extends BaseMapper {
int updateByPrimaryKey(Pic record);
@Insert("insert into d_sub_task(create_user,pic_id,task_id,in_inspector_id) select #{createUserId},id,#{taskId},#{inInspectorId} from d_pic where pack_id=#{packId}")
@Insert("insert into d_sub_task(create_user,pic_id,task_id,in_inspector_id,pack_id) select #{createUserId},id,#{taskId},#{inInspectorId},#{packId} from d_pic where pack_id=#{packId}")
void createTasks(Long createUserId, Long taskId, Long packId, Long inInspectorId);
@Update("update d_pic set person_unid = #{personUnid},status=(select status from d_pic where person_unid = #{personUnid} limit 1) where id = #{id}")
void mergeTo(Long id, String personUnid);
@Select("<script>" +
"select id,unid,create_time as createTime,name,storage_id as storageId,pack_id as packId,person_unid as personUnid,status from d_pic where pack_id=#{packId} and person_unid in " +
"(select person_unid from d_pic where pack_id=#{packId}" +
" <if test = 'status != null'> and status=#{status}</if> group by person_unid " +
// " having count(*) > 1 " +
" order by person_unid <if test='offset != null'> offset #{offset} limit #{limit}</if>) " +
" order by person_unid </script>")
List<Pic> getPeople(Long packId, Integer status, Long offset, Long limit);
@Select("<script>" +
"select count(*) from " +
"(select person_unid from d_pic where pack_id=#{packId}" +
" <if test = 'status != null'> and status=#{status}</if> group by person_unid " +
// " having count(*) > 1 " +
") as t " +
"</script>")
int countPeople(Long packId, Integer status);
@Select("<script>" +
"select id,unid,create_time as createTime,name,storage_id as storageId,pack_id as packId,person_unid as personUnid,status from d_pic where pack_id=#{packId} and person_unid=" +
"(select person_unid from d_pic where pack_id=#{packId} <if test = 'status != null'> and status=#{status}</if> and person_unid ${type} #{personUnid} group by person_unid " +
// " having count(*) > 1 " +
" order by person_unid ${sort} limit 1) order by id" +
"</script>")
List<Pic> getOtherPeople(Long packId, Integer status, String personUnid, String type, String sort);
}
\ No newline at end of file
......@@ -4,8 +4,10 @@ import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.model.SubTask;
import com.viontech.label.platform.model.SubTaskExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.Collection;
import java.util.List;
public interface SubTaskMapper extends BaseMapper {
......@@ -39,4 +41,41 @@ public interface SubTaskMapper extends BaseMapper {
@Update("update d_sub_task set out_inspector_id = #{outInspectorId},annotator_id = #{annotatorId} where id in (select id from d_sub_task where task_id= #{taskId} and out_inspector_id is null and annotator_id is null order by id OFFSET 0 limit #{count} )")
void assignAnnotatorAndOutInspector(long taskId, long annotatorId, long outInspectorId, long count);
@Update("<script>" +
"update d_sub_task set person_unid = #{personUnid},status=(select status from d_sub_task where person_unid = #{personUnid} limit 1) " +
"<where>" +
" id in " +
"<foreach item='item' collection='idCollection' open='(' separator=',' close=')'>" +
"#{item ,jdbcType=NUMERIC}" +
"</foreach>" +
"</where>" +
"</script>")
void mergeTo(Collection<Long> idCollection, String personUnid);
@Select("<script>" +
"select id,unid,create_time as createTime,pack_id as packId,pic_id as picId,task_id as taskId,person_unid as personUnid,status from d_sub_task where pack_id=#{packId} and person_unid in " +
"(select person_unid from d_sub_task where pack_id=#{packId}" +
" <if test = 'status != null'> and status=#{status}</if> group by person_unid " +
// " having count(*) > 1 " +
" order by person_unid <if test='offset != null'> offset #{offset} limit #{limit}</if>) " +
" order by person_unid </script>")
List<SubTask> getPeople(Long packId, Integer status, Long offset, Long limit);
@Select("<script>" +
"select count(*) from " +
"(select person_unid from d_sub_task where pack_id=#{packId}" +
" <if test = 'status != null'> and status=#{status}</if> group by person_unid " +
// " having count(*) > 1 " +
") as t " +
"</script>")
int countPeople(Long packId, Integer status);
@Select("<script>" +
"select id,unid,create_time as createTime,pack_id as packId,pic_id as picId,task_id as taskId,person_unid as personUnid,status from d_sub_task where pack_id=#{packId} and person_unid=" +
"(select person_unid from d_sub_task where pack_id=#{packId} <if test = 'status != null'> and status=#{status}</if> and person_unid ${type} #{personUnid} group by person_unid " +
// " having count(*) > 1 " +
" order by person_unid ${sort} limit 1) order by id" +
"</script>")
List<SubTask> getOtherPeople(Long packId, Integer status, String personUnid, String type, String sort);
}
\ No newline at end of file
......@@ -8,9 +8,7 @@
<result column="pic_name" property="name" />
<result column="pic_storage_id" property="storageId" />
<result column="pic_pack_id" property="packId" />
<result column="pic_person_unid" property="personUnid" />
<result column="pic_status" property="status" />
<result column="pic_reid_finish_user" property="reidFinishUser" />
</resultMap>
<resultMap id="BaseResultMap" type="com.viontech.label.platform.model.Pic" extends="BaseResultMapRoot" >
<result column="storage_id" property="storage.id" />
......@@ -26,8 +24,8 @@
<result column="pack_create_user" property="pack.createUser" />
<result column="pack_storage_id" property="pack.storageId" />
<result column="pack_name" property="pack.name" />
<result column="pack_status" property="pack.status" />
<result column="pack_type" property="pack.type" />
<result column="pack_status" property="pack.status" />
</resultMap>
<sql id="Left_Join_List" >
<foreach collection="leftJoinTableSet" item="leftJoinTable" >
......@@ -102,7 +100,7 @@
<sql id="Base_Column_List_Root" >
"pic".id as pic_id, "pic".unid as pic_unid, "pic".create_time as pic_create_time,
"pic"."name" as "pic_name", "pic".storage_id as pic_storage_id, "pic".pack_id as pic_pack_id,
"pic".person_unid as pic_person_unid, "pic"."status" as "pic_status", "pic".reid_finish_user as pic_reid_finish_user
"pic"."status" as "pic_status"
</sql>
<sql id="Base_Column_List" >
<if test="!(_parameter.getClass().getSimpleName() == 'PicExample')" >
......@@ -175,11 +173,11 @@
</delete>
<insert id="insert" parameterType="com.viontech.label.platform.model.Pic" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
insert into "d_pic" (unid, create_time, "name",
storage_id, pack_id, person_unid,
"status", reid_finish_user)
storage_id, pack_id, "status"
)
values (#{unid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR},
#{storageId,jdbcType=BIGINT}, #{packId,jdbcType=BIGINT}, #{personUnid,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{reidFinishUser,jdbcType=BIGINT})
#{storageId,jdbcType=BIGINT}, #{packId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.viontech.label.platform.model.Pic" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
insert into "d_pic"
......@@ -199,15 +197,9 @@
<if test="packId != null" >
pack_id,
</if>
<if test="personUnid != null" >
person_unid,
</if>
<if test="status != null" >
"status",
</if>
<if test="reidFinishUser != null" >
reid_finish_user,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="unid != null" >
......@@ -225,15 +217,9 @@
<if test="packId != null" >
#{packId,jdbcType=BIGINT},
</if>
<if test="personUnid != null" >
#{personUnid,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=INTEGER},
</if>
<if test="reidFinishUser != null" >
#{reidFinishUser,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.viontech.label.platform.model.PicExample" resultType="java.lang.Integer" >
......@@ -264,15 +250,9 @@
<if test="record.packId != null" >
pack_id = #{record.packId,jdbcType=BIGINT},
</if>
<if test="record.personUnid != null" >
person_unid = #{record.personUnid,jdbcType=VARCHAR},
</if>
<if test="record.status != null" >
"status" = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.reidFinishUser != null" >
reid_finish_user = #{record.reidFinishUser,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
......@@ -286,9 +266,7 @@
"name" = #{record.name,jdbcType=VARCHAR},
storage_id = #{record.storageId,jdbcType=BIGINT},
pack_id = #{record.packId,jdbcType=BIGINT},
person_unid = #{record.personUnid,jdbcType=VARCHAR},
"status" = #{record.status,jdbcType=INTEGER},
reid_finish_user = #{record.reidFinishUser,jdbcType=BIGINT}
"status" = #{record.status,jdbcType=INTEGER}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -311,15 +289,9 @@
<if test="packId != null" >
pack_id = #{packId,jdbcType=BIGINT},
</if>
<if test="personUnid != null" >
person_unid = #{personUnid,jdbcType=VARCHAR},
</if>
<if test="status != null" >
"status" = #{status,jdbcType=INTEGER},
</if>
<if test="reidFinishUser != null" >
reid_finish_user = #{reidFinishUser,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......@@ -330,9 +302,7 @@
"name" = #{name,jdbcType=VARCHAR},
storage_id = #{storageId,jdbcType=BIGINT},
pack_id = #{packId,jdbcType=BIGINT},
person_unid = #{personUnid,jdbcType=VARCHAR},
"status" = #{status,jdbcType=INTEGER},
reid_finish_user = #{reidFinishUser,jdbcType=BIGINT}
"status" = #{status,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
......@@ -11,10 +11,13 @@
<result column="subTask_in_inspector_id" property="inInspectorId" />
<result column="subTask_out_inspector_id" property="outInspectorId" />
<result column="subTask_annotator_id" property="annotatorId" />
<result column="subTask_annotate_time" property="annotateTime" />
<result column="subTask_label_result" property="labelResult" />
<result column="subTask_in_status" property="inStatus" />
<result column="subTask_out_status" property="outStatus" />
<result column="subTask_status" property="status" />
<result column="subTask_person_unid" property="personUnid" />
<result column="subTask_pack_id" property="packId" />
</resultMap>
<resultMap id="BaseResultMap" type="com.viontech.label.platform.model.SubTask" extends="BaseResultMapRoot" >
<result column="pic_id" property="pic.id" />
......@@ -23,6 +26,7 @@
<result column="pic_name" property="pic.name" />
<result column="pic_storage_id" property="pic.storageId" />
<result column="pic_pack_id" property="pic.packId" />
<result column="pic_status" property="pic.status" />
<result column="task_id" property="task.id" />
<result column="task_unid" property="task.unid" />
<result column="task_create_time" property="task.createTime" />
......@@ -33,6 +37,8 @@
<result column="task_account_id" property="task.accountId" />
<result column="task_contractor_manager_id" property="task.contractorManagerId" />
<result column="task_manager_id" property="task.managerId" />
<result column="task_assign_time" property="task.assignTime" />
<result column="task_finish_time" property="task.finishTime" />
<result column="task_in_inspector_id" property="task.inInspectorId" />
<result column="task_description" property="task.description" />
<result column="task_status" property="task.status" />
......@@ -112,8 +118,10 @@
"subTask".create_user as subTask_create_user, "subTask".pic_id as subTask_pic_id,
"subTask".task_id as subTask_task_id, "subTask".in_inspector_id as subTask_in_inspector_id,
"subTask".out_inspector_id as subTask_out_inspector_id, "subTask".annotator_id as subTask_annotator_id,
"subTask".label_result as subTask_label_result, "subTask".in_status as subTask_in_status,
"subTask".out_status as subTask_out_status, "subTask"."status" as "subTask_status"
"subTask".annotate_time as subTask_annotate_time, "subTask".label_result as subTask_label_result,
"subTask".in_status as subTask_in_status, "subTask".out_status as subTask_out_status,
"subTask"."status" as "subTask_status", "subTask".person_unid as subTask_person_unid,
"subTask".pack_id as subTask_pack_id
</sql>
<sql id="Base_Column_List" >
<if test="!(_parameter.getClass().getSimpleName() == 'SubTaskExample')" >
......@@ -187,13 +195,15 @@
<insert id="insert" parameterType="com.viontech.label.platform.model.SubTask" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
insert into "d_sub_task" (unid, create_time, create_user,
pic_id, task_id, in_inspector_id,
out_inspector_id, annotator_id, label_result,
in_status, out_status, "status"
out_inspector_id, annotator_id, annotate_time,
label_result, in_status, out_status,
"status", person_unid, pack_id
)
values (#{unid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createUser,jdbcType=BIGINT},
#{picId,jdbcType=BIGINT}, #{taskId,jdbcType=BIGINT}, #{inInspectorId,jdbcType=BIGINT},
#{outInspectorId,jdbcType=BIGINT}, #{annotatorId,jdbcType=BIGINT}, #{labelResult,jdbcType=VARCHAR},
#{inStatus,jdbcType=INTEGER}, #{outStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}
#{outInspectorId,jdbcType=BIGINT}, #{annotatorId,jdbcType=BIGINT}, #{annotateTime,jdbcType=TIMESTAMP},
#{labelResult,jdbcType=VARCHAR}, #{inStatus,jdbcType=INTEGER}, #{outStatus,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{personUnid,jdbcType=VARCHAR}, #{packId,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="com.viontech.label.platform.model.SubTask" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
......@@ -223,6 +233,9 @@
<if test="annotatorId != null" >
annotator_id,
</if>
<if test="annotateTime != null" >
annotate_time,
</if>
<if test="labelResult != null" >
label_result,
</if>
......@@ -235,6 +248,12 @@
<if test="status != null" >
"status",
</if>
<if test="personUnid != null" >
person_unid,
</if>
<if test="packId != null" >
pack_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="unid != null" >
......@@ -261,6 +280,9 @@
<if test="annotatorId != null" >
#{annotatorId,jdbcType=BIGINT},
</if>
<if test="annotateTime != null" >
#{annotateTime,jdbcType=TIMESTAMP},
</if>
<if test="labelResult != null" >
#{labelResult,jdbcType=VARCHAR},
</if>
......@@ -273,6 +295,12 @@
<if test="status != null" >
#{status,jdbcType=INTEGER},
</if>
<if test="personUnid != null" >
#{personUnid,jdbcType=VARCHAR},
</if>
<if test="packId != null" >
#{packId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.viontech.label.platform.model.SubTaskExample" resultType="java.lang.Integer" >
......@@ -312,6 +340,9 @@
<if test="record.annotatorId != null" >
annotator_id = #{record.annotatorId,jdbcType=BIGINT},
</if>
<if test="record.annotateTime != null" >
annotate_time = #{record.annotateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.labelResult != null" >
label_result = #{record.labelResult,jdbcType=VARCHAR},
</if>
......@@ -324,6 +355,12 @@
<if test="record.status != null" >
"status" = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.personUnid != null" >
person_unid = #{record.personUnid,jdbcType=VARCHAR},
</if>
<if test="record.packId != null" >
pack_id = #{record.packId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
......@@ -340,10 +377,13 @@
in_inspector_id = #{record.inInspectorId,jdbcType=BIGINT},
out_inspector_id = #{record.outInspectorId,jdbcType=BIGINT},
annotator_id = #{record.annotatorId,jdbcType=BIGINT},
annotate_time = #{record.annotateTime,jdbcType=TIMESTAMP},
label_result = #{record.labelResult,jdbcType=VARCHAR},
in_status = #{record.inStatus,jdbcType=INTEGER},
out_status = #{record.outStatus,jdbcType=INTEGER},
"status" = #{record.status,jdbcType=INTEGER}
"status" = #{record.status,jdbcType=INTEGER},
person_unid = #{record.personUnid,jdbcType=VARCHAR},
pack_id = #{record.packId,jdbcType=BIGINT}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -375,6 +415,9 @@
<if test="annotatorId != null" >
annotator_id = #{annotatorId,jdbcType=BIGINT},
</if>
<if test="annotateTime != null" >
annotate_time = #{annotateTime,jdbcType=TIMESTAMP},
</if>
<if test="labelResult != null" >
label_result = #{labelResult,jdbcType=VARCHAR},
</if>
......@@ -387,6 +430,12 @@
<if test="status != null" >
"status" = #{status,jdbcType=INTEGER},
</if>
<if test="personUnid != null" >
person_unid = #{personUnid,jdbcType=VARCHAR},
</if>
<if test="packId != null" >
pack_id = #{packId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......@@ -400,10 +449,13 @@
in_inspector_id = #{inInspectorId,jdbcType=BIGINT},
out_inspector_id = #{outInspectorId,jdbcType=BIGINT},
annotator_id = #{annotatorId,jdbcType=BIGINT},
annotate_time = #{annotateTime,jdbcType=TIMESTAMP},
label_result = #{labelResult,jdbcType=VARCHAR},
in_status = #{inStatus,jdbcType=INTEGER},
out_status = #{outStatus,jdbcType=INTEGER},
"status" = #{status,jdbcType=INTEGER}
"status" = #{status,jdbcType=INTEGER},
person_unid = #{personUnid,jdbcType=VARCHAR},
pack_id = #{packId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
......@@ -12,6 +12,8 @@
<result column="task_account_id" property="accountId" />
<result column="task_contractor_manager_id" property="contractorManagerId" />
<result column="task_manager_id" property="managerId" />
<result column="task_assign_time" property="assignTime" />
<result column="task_finish_time" property="finishTime" />
<result column="task_in_inspector_id" property="inInspectorId" />
<result column="task_description" property="description" />
<result column="task_status" property="status" />
......@@ -96,8 +98,9 @@
"task".id as task_id, "task".unid as task_unid, "task".create_time as task_create_time,
"task".create_user as task_create_user, "task"."name" as "task_name", "task"."type" as "task_type",
"task".label_type as task_label_type, "task".account_id as task_account_id, "task".contractor_manager_id as task_contractor_manager_id,
"task".manager_id as task_manager_id, "task".in_inspector_id as task_in_inspector_id,
"task".description as task_description, "task"."status" as "task_status"
"task".manager_id as task_manager_id, "task".assign_time as task_assign_time, "task".finish_time as task_finish_time,
"task".in_inspector_id as task_in_inspector_id, "task".description as task_description,
"task"."status" as "task_status"
</sql>
<sql id="Base_Column_List" >
<if test="!(_parameter.getClass().getSimpleName() == 'TaskExample')" >
......@@ -164,13 +167,13 @@
insert into "d_task" (unid, create_time, create_user,
"name", "type", label_type,
account_id, contractor_manager_id, manager_id,
in_inspector_id, description, "status"
)
assign_time, finish_time, in_inspector_id,
description, "status")
values (#{unid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createUser,jdbcType=BIGINT},
#{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{labelType,jdbcType=INTEGER},
#{accountId,jdbcType=BIGINT}, #{contractorManagerId,jdbcType=BIGINT}, #{managerId,jdbcType=BIGINT},
#{inInspectorId,jdbcType=BIGINT}, #{description,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}
)
#{assignTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, #{inInspectorId,jdbcType=BIGINT},
#{description,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.viontech.label.platform.model.Task" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
insert into "d_task"
......@@ -202,6 +205,12 @@
<if test="managerId != null" >
manager_id,
</if>
<if test="assignTime != null" >
assign_time,
</if>
<if test="finishTime != null" >
finish_time,
</if>
<if test="inInspectorId != null" >
in_inspector_id,
</if>
......@@ -240,6 +249,12 @@
<if test="managerId != null" >
#{managerId,jdbcType=BIGINT},
</if>
<if test="assignTime != null" >
#{assignTime,jdbcType=TIMESTAMP},
</if>
<if test="finishTime != null" >
#{finishTime,jdbcType=TIMESTAMP},
</if>
<if test="inInspectorId != null" >
#{inInspectorId,jdbcType=BIGINT},
</if>
......@@ -291,6 +306,12 @@
<if test="record.managerId != null" >
manager_id = #{record.managerId,jdbcType=BIGINT},
</if>
<if test="record.assignTime != null" >
assign_time = #{record.assignTime,jdbcType=TIMESTAMP},
</if>
<if test="record.finishTime != null" >
finish_time = #{record.finishTime,jdbcType=TIMESTAMP},
</if>
<if test="record.inInspectorId != null" >
in_inspector_id = #{record.inInspectorId,jdbcType=BIGINT},
</if>
......@@ -317,6 +338,8 @@
account_id = #{record.accountId,jdbcType=BIGINT},
contractor_manager_id = #{record.contractorManagerId,jdbcType=BIGINT},
manager_id = #{record.managerId,jdbcType=BIGINT},
assign_time = #{record.assignTime,jdbcType=TIMESTAMP},
finish_time = #{record.finishTime,jdbcType=TIMESTAMP},
in_inspector_id = #{record.inInspectorId,jdbcType=BIGINT},
description = #{record.description,jdbcType=VARCHAR},
"status" = #{record.status,jdbcType=INTEGER}
......@@ -354,6 +377,12 @@
<if test="managerId != null" >
manager_id = #{managerId,jdbcType=BIGINT},
</if>
<if test="assignTime != null" >
assign_time = #{assignTime,jdbcType=TIMESTAMP},
</if>
<if test="finishTime != null" >
finish_time = #{finishTime,jdbcType=TIMESTAMP},
</if>
<if test="inInspectorId != null" >
in_inspector_id = #{inInspectorId,jdbcType=BIGINT},
</if>
......@@ -377,6 +406,8 @@
account_id = #{accountId,jdbcType=BIGINT},
contractor_manager_id = #{contractorManagerId,jdbcType=BIGINT},
manager_id = #{managerId,jdbcType=BIGINT},
assign_time = #{assignTime,jdbcType=TIMESTAMP},
finish_time = #{finishTime,jdbcType=TIMESTAMP},
in_inspector_id = #{inInspectorId,jdbcType=BIGINT},
description = #{description,jdbcType=VARCHAR},
"status" = #{status,jdbcType=INTEGER}
......
package com.viontech.label.platform.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.viontech.label.platform.base.BaseModel;
import java.util.Date;
public class Pic extends BaseModel {
......@@ -18,16 +16,10 @@ public class Pic extends BaseModel {
private Long packId;
private String personUnid;
private Integer status;
private Long reidFinishUser;
@JsonIgnore
private Storage storage;
@JsonIgnore
private Pack pack;
public Long getId() {
......@@ -78,14 +70,6 @@ public class Pic extends BaseModel {
this.packId = packId;
}
public String getPersonUnid() {
return personUnid;
}
public void setPersonUnid(String personUnid) {
this.personUnid = personUnid == null ? null : personUnid.trim();
}
public Integer getStatus() {
return status;
}
......@@ -94,14 +78,6 @@ public class Pic extends BaseModel {
this.status = status;
}
public Long getReidFinishUser() {
return reidFinishUser;
}
public void setReidFinishUser(Long reidFinishUser) {
this.reidFinishUser = reidFinishUser;
}
public Storage getStorage() {
return storage;
}
......
......@@ -553,76 +553,6 @@ public class PicExample extends BaseExample {
return (Criteria) this;
}
public Criteria andPersonUnidIsNull() {
addCriterion("\"pic\".person_unid is null");
return (Criteria) this;
}
public Criteria andPersonUnidIsNotNull() {
addCriterion("\"pic\".person_unid is not null");
return (Criteria) this;
}
public Criteria andPersonUnidEqualTo(String value) {
addCriterion("\"pic\".person_unid =", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidNotEqualTo(String value) {
addCriterion("\"pic\".person_unid <>", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidGreaterThan(String value) {
addCriterion("\"pic\".person_unid >", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidGreaterThanOrEqualTo(String value) {
addCriterion("\"pic\".person_unid >=", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidLessThan(String value) {
addCriterion("\"pic\".person_unid <", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidLessThanOrEqualTo(String value) {
addCriterion("\"pic\".person_unid <=", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidLike(String value) {
addCriterion("\"pic\".person_unid like", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidNotLike(String value) {
addCriterion("\"pic\".person_unid not like", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidIn(List<String> values) {
addCriterion("\"pic\".person_unid in", values, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidNotIn(List<String> values) {
addCriterion("\"pic\".person_unid not in", values, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidBetween(String value1, String value2) {
addCriterion("\"pic\".person_unid between", value1, value2, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidNotBetween(String value1, String value2) {
addCriterion("\"pic\".person_unid not between", value1, value2, "personUnid");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("\"pic\".\"status\" is null");
return (Criteria) this;
......@@ -682,66 +612,6 @@ public class PicExample extends BaseExample {
addCriterion("\"pic\".\"status\" not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andReidFinishUserIsNull() {
addCriterion("\"pic\".reid_finish_user is null");
return (Criteria) this;
}
public Criteria andReidFinishUserIsNotNull() {
addCriterion("\"pic\".reid_finish_user is not null");
return (Criteria) this;
}
public Criteria andReidFinishUserEqualTo(Long value) {
addCriterion("\"pic\".reid_finish_user =", value, "reidFinishUser");
return (Criteria) this;
}
public Criteria andReidFinishUserNotEqualTo(Long value) {
addCriterion("\"pic\".reid_finish_user <>", value, "reidFinishUser");
return (Criteria) this;
}
public Criteria andReidFinishUserGreaterThan(Long value) {
addCriterion("\"pic\".reid_finish_user >", value, "reidFinishUser");
return (Criteria) this;
}
public Criteria andReidFinishUserGreaterThanOrEqualTo(Long value) {
addCriterion("\"pic\".reid_finish_user >=", value, "reidFinishUser");
return (Criteria) this;
}
public Criteria andReidFinishUserLessThan(Long value) {
addCriterion("\"pic\".reid_finish_user <", value, "reidFinishUser");
return (Criteria) this;
}
public Criteria andReidFinishUserLessThanOrEqualTo(Long value) {
addCriterion("\"pic\".reid_finish_user <=", value, "reidFinishUser");
return (Criteria) this;
}
public Criteria andReidFinishUserIn(List<Long> values) {
addCriterion("\"pic\".reid_finish_user in", values, "reidFinishUser");
return (Criteria) this;
}
public Criteria andReidFinishUserNotIn(List<Long> values) {
addCriterion("\"pic\".reid_finish_user not in", values, "reidFinishUser");
return (Criteria) this;
}
public Criteria andReidFinishUserBetween(Long value1, Long value2) {
addCriterion("\"pic\".reid_finish_user between", value1, value2, "reidFinishUser");
return (Criteria) this;
}
public Criteria andReidFinishUserNotBetween(Long value1, Long value2) {
addCriterion("\"pic\".reid_finish_user not between", value1, value2, "reidFinishUser");
return (Criteria) this;
}
}
public static class ColumnContainer extends ColumnContainerBase {
......@@ -780,19 +650,9 @@ public class PicExample extends BaseExample {
return (ColumnContainer) this;
}
public ColumnContainer hasPersonUnidColumn() {
addColumnStr("\"pic\".person_unid as pic_person_unid ");
return (ColumnContainer) this;
}
public ColumnContainer hasStatusColumn() {
addColumnStr("\"pic\".\"status\" as \"pic_status\" ");
return (ColumnContainer) this;
}
public ColumnContainer hasReidFinishUserColumn() {
addColumnStr("\"pic\".reid_finish_user as pic_reid_finish_user ");
return (ColumnContainer) this;
}
}
}
\ No newline at end of file
package com.viontech.label.platform.model;
import com.viontech.label.platform.base.BaseModel;
import java.util.Date;
public class SubTask extends BaseModel {
......@@ -23,6 +22,8 @@ public class SubTask extends BaseModel {
private Long annotatorId;
private Date annotateTime;
private String labelResult;
private Integer inStatus;
......@@ -31,6 +32,10 @@ public class SubTask extends BaseModel {
private Integer status;
private String personUnid;
private Long packId;
private Pic pic;
private Task task;
......@@ -107,6 +112,14 @@ public class SubTask extends BaseModel {
this.annotatorId = annotatorId;
}
public Date getAnnotateTime() {
return annotateTime;
}
public void setAnnotateTime(Date annotateTime) {
this.annotateTime = annotateTime;
}
public String getLabelResult() {
return labelResult;
}
......@@ -139,6 +152,22 @@ public class SubTask extends BaseModel {
this.status = status;
}
public String getPersonUnid() {
return personUnid;
}
public void setPersonUnid(String personUnid) {
this.personUnid = personUnid == null ? null : personUnid.trim();
}
public Long getPackId() {
return packId;
}
public void setPackId(Long packId) {
this.packId = packId;
}
public Pic getPic() {
return pic;
}
......
package com.viontech.label.platform.model;
import com.viontech.label.platform.base.BaseExample;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class SubTaskExample extends BaseExample {
......@@ -721,6 +723,66 @@ public class SubTaskExample extends BaseExample {
return (Criteria) this;
}
public Criteria andAnnotateTimeIsNull() {
addCriterion("\"subTask\".annotate_time is null");
return (Criteria) this;
}
public Criteria andAnnotateTimeIsNotNull() {
addCriterion("\"subTask\".annotate_time is not null");
return (Criteria) this;
}
public Criteria andAnnotateTimeEqualTo(Date value) {
addCriterion("\"subTask\".annotate_time =", value, "annotateTime");
return (Criteria) this;
}
public Criteria andAnnotateTimeNotEqualTo(Date value) {
addCriterion("\"subTask\".annotate_time <>", value, "annotateTime");
return (Criteria) this;
}
public Criteria andAnnotateTimeGreaterThan(Date value) {
addCriterion("\"subTask\".annotate_time >", value, "annotateTime");
return (Criteria) this;
}
public Criteria andAnnotateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("\"subTask\".annotate_time >=", value, "annotateTime");
return (Criteria) this;
}
public Criteria andAnnotateTimeLessThan(Date value) {
addCriterion("\"subTask\".annotate_time <", value, "annotateTime");
return (Criteria) this;
}
public Criteria andAnnotateTimeLessThanOrEqualTo(Date value) {
addCriterion("\"subTask\".annotate_time <=", value, "annotateTime");
return (Criteria) this;
}
public Criteria andAnnotateTimeIn(List<Date> values) {
addCriterion("\"subTask\".annotate_time in", values, "annotateTime");
return (Criteria) this;
}
public Criteria andAnnotateTimeNotIn(List<Date> values) {
addCriterion("\"subTask\".annotate_time not in", values, "annotateTime");
return (Criteria) this;
}
public Criteria andAnnotateTimeBetween(Date value1, Date value2) {
addCriterion("\"subTask\".annotate_time between", value1, value2, "annotateTime");
return (Criteria) this;
}
public Criteria andAnnotateTimeNotBetween(Date value1, Date value2) {
addCriterion("\"subTask\".annotate_time not between", value1, value2, "annotateTime");
return (Criteria) this;
}
public Criteria andLabelResultIsNull() {
addCriterion("\"subTask\".label_result is null");
return (Criteria) this;
......@@ -970,6 +1032,136 @@ public class SubTaskExample extends BaseExample {
addCriterion("\"subTask\".\"status\" not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andPersonUnidIsNull() {
addCriterion("\"subTask\".person_unid is null");
return (Criteria) this;
}
public Criteria andPersonUnidIsNotNull() {
addCriterion("\"subTask\".person_unid is not null");
return (Criteria) this;
}
public Criteria andPersonUnidEqualTo(String value) {
addCriterion("\"subTask\".person_unid =", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidNotEqualTo(String value) {
addCriterion("\"subTask\".person_unid <>", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidGreaterThan(String value) {
addCriterion("\"subTask\".person_unid >", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidGreaterThanOrEqualTo(String value) {
addCriterion("\"subTask\".person_unid >=", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidLessThan(String value) {
addCriterion("\"subTask\".person_unid <", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidLessThanOrEqualTo(String value) {
addCriterion("\"subTask\".person_unid <=", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidLike(String value) {
addCriterion("\"subTask\".person_unid like", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidNotLike(String value) {
addCriterion("\"subTask\".person_unid not like", value, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidIn(List<String> values) {
addCriterion("\"subTask\".person_unid in", values, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidNotIn(List<String> values) {
addCriterion("\"subTask\".person_unid not in", values, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidBetween(String value1, String value2) {
addCriterion("\"subTask\".person_unid between", value1, value2, "personUnid");
return (Criteria) this;
}
public Criteria andPersonUnidNotBetween(String value1, String value2) {
addCriterion("\"subTask\".person_unid not between", value1, value2, "personUnid");
return (Criteria) this;
}
public Criteria andPackIdIsNull() {
addCriterion("\"subTask\".pack_id is null");
return (Criteria) this;
}
public Criteria andPackIdIsNotNull() {
addCriterion("\"subTask\".pack_id is not null");
return (Criteria) this;
}
public Criteria andPackIdEqualTo(Long value) {
addCriterion("\"subTask\".pack_id =", value, "packId");
return (Criteria) this;
}
public Criteria andPackIdNotEqualTo(Long value) {
addCriterion("\"subTask\".pack_id <>", value, "packId");
return (Criteria) this;
}
public Criteria andPackIdGreaterThan(Long value) {
addCriterion("\"subTask\".pack_id >", value, "packId");
return (Criteria) this;
}
public Criteria andPackIdGreaterThanOrEqualTo(Long value) {
addCriterion("\"subTask\".pack_id >=", value, "packId");
return (Criteria) this;
}
public Criteria andPackIdLessThan(Long value) {
addCriterion("\"subTask\".pack_id <", value, "packId");
return (Criteria) this;
}
public Criteria andPackIdLessThanOrEqualTo(Long value) {
addCriterion("\"subTask\".pack_id <=", value, "packId");
return (Criteria) this;
}
public Criteria andPackIdIn(List<Long> values) {
addCriterion("\"subTask\".pack_id in", values, "packId");
return (Criteria) this;
}
public Criteria andPackIdNotIn(List<Long> values) {
addCriterion("\"subTask\".pack_id not in", values, "packId");
return (Criteria) this;
}
public Criteria andPackIdBetween(Long value1, Long value2) {
addCriterion("\"subTask\".pack_id between", value1, value2, "packId");
return (Criteria) this;
}
public Criteria andPackIdNotBetween(Long value1, Long value2) {
addCriterion("\"subTask\".pack_id not between", value1, value2, "packId");
return (Criteria) this;
}
}
public static class ColumnContainer extends ColumnContainerBase {
......@@ -1023,6 +1215,11 @@ public class SubTaskExample extends BaseExample {
return (ColumnContainer) this;
}
public ColumnContainer hasAnnotateTimeColumn() {
addColumnStr("\"subTask\".annotate_time as subTask_annotate_time ");
return (ColumnContainer) this;
}
public ColumnContainer hasLabelResultColumn() {
addColumnStr("\"subTask\".label_result as subTask_label_result ");
return (ColumnContainer) this;
......@@ -1042,5 +1239,15 @@ public class SubTaskExample extends BaseExample {
addColumnStr("\"subTask\".\"status\" as \"subTask_status\" ");
return (ColumnContainer) this;
}
public ColumnContainer hasPersonUnidColumn() {
addColumnStr("\"subTask\".person_unid as subTask_person_unid ");
return (ColumnContainer) this;
}
public ColumnContainer hasPackIdColumn() {
addColumnStr("\"subTask\".pack_id as subTask_pack_id ");
return (ColumnContainer) this;
}
}
}
\ No newline at end of file
package com.viontech.label.platform.model;
import com.viontech.label.platform.base.BaseModel;
import java.util.Date;
import java.util.List;
......@@ -26,6 +25,10 @@ public class Task extends BaseModel {
private Long managerId;
private Date assignTime;
private Date finishTime;
private Long inInspectorId;
private String description;
......@@ -116,6 +119,22 @@ public class Task extends BaseModel {
this.managerId = managerId;
}
public Date getAssignTime() {
return assignTime;
}
public void setAssignTime(Date assignTime) {
this.assignTime = assignTime;
}
public Date getFinishTime() {
return finishTime;
}
public void setFinishTime(Date finishTime) {
this.finishTime = finishTime;
}
public Long getInInspectorId() {
return inInspectorId;
}
......@@ -152,7 +171,8 @@ public class Task extends BaseModel {
return packs;
}
public void setPacks(List<Pack> packs) {
public Task setPacks(List<Pack> packs) {
this.packs = packs;
return this;
}
}
\ No newline at end of file
package com.viontech.label.platform.model;
import com.viontech.label.platform.base.BaseExample;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class TaskExample extends BaseExample {
......@@ -749,6 +751,126 @@ public class TaskExample extends BaseExample {
return (Criteria) this;
}
public Criteria andAssignTimeIsNull() {
addCriterion("\"task\".assign_time is null");
return (Criteria) this;
}
public Criteria andAssignTimeIsNotNull() {
addCriterion("\"task\".assign_time is not null");
return (Criteria) this;
}
public Criteria andAssignTimeEqualTo(Date value) {
addCriterion("\"task\".assign_time =", value, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeNotEqualTo(Date value) {
addCriterion("\"task\".assign_time <>", value, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeGreaterThan(Date value) {
addCriterion("\"task\".assign_time >", value, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeGreaterThanOrEqualTo(Date value) {
addCriterion("\"task\".assign_time >=", value, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeLessThan(Date value) {
addCriterion("\"task\".assign_time <", value, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeLessThanOrEqualTo(Date value) {
addCriterion("\"task\".assign_time <=", value, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeIn(List<Date> values) {
addCriterion("\"task\".assign_time in", values, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeNotIn(List<Date> values) {
addCriterion("\"task\".assign_time not in", values, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeBetween(Date value1, Date value2) {
addCriterion("\"task\".assign_time between", value1, value2, "assignTime");
return (Criteria) this;
}
public Criteria andAssignTimeNotBetween(Date value1, Date value2) {
addCriterion("\"task\".assign_time not between", value1, value2, "assignTime");
return (Criteria) this;
}
public Criteria andFinishTimeIsNull() {
addCriterion("\"task\".finish_time is null");
return (Criteria) this;
}
public Criteria andFinishTimeIsNotNull() {
addCriterion("\"task\".finish_time is not null");
return (Criteria) this;
}
public Criteria andFinishTimeEqualTo(Date value) {
addCriterion("\"task\".finish_time =", value, "finishTime");
return (Criteria) this;
}
public Criteria andFinishTimeNotEqualTo(Date value) {
addCriterion("\"task\".finish_time <>", value, "finishTime");
return (Criteria) this;
}
public Criteria andFinishTimeGreaterThan(Date value) {
addCriterion("\"task\".finish_time >", value, "finishTime");
return (Criteria) this;
}
public Criteria andFinishTimeGreaterThanOrEqualTo(Date value) {
addCriterion("\"task\".finish_time >=", value, "finishTime");
return (Criteria) this;
}
public Criteria andFinishTimeLessThan(Date value) {
addCriterion("\"task\".finish_time <", value, "finishTime");
return (Criteria) this;
}
public Criteria andFinishTimeLessThanOrEqualTo(Date value) {
addCriterion("\"task\".finish_time <=", value, "finishTime");
return (Criteria) this;
}
public Criteria andFinishTimeIn(List<Date> values) {
addCriterion("\"task\".finish_time in", values, "finishTime");
return (Criteria) this;
}
public Criteria andFinishTimeNotIn(List<Date> values) {
addCriterion("\"task\".finish_time not in", values, "finishTime");
return (Criteria) this;
}
public Criteria andFinishTimeBetween(Date value1, Date value2) {
addCriterion("\"task\".finish_time between", value1, value2, "finishTime");
return (Criteria) this;
}
public Criteria andFinishTimeNotBetween(Date value1, Date value2) {
addCriterion("\"task\".finish_time not between", value1, value2, "finishTime");
return (Criteria) this;
}
public Criteria andInInspectorIdIsNull() {
addCriterion("\"task\".in_inspector_id is null");
return (Criteria) this;
......@@ -996,6 +1118,16 @@ public class TaskExample extends BaseExample {
return (ColumnContainer) this;
}
public ColumnContainer hasAssignTimeColumn() {
addColumnStr("\"task\".assign_time as task_assign_time ");
return (ColumnContainer) this;
}
public ColumnContainer hasFinishTimeColumn() {
addColumnStr("\"task\".finish_time as task_finish_time ");
return (ColumnContainer) this;
}
public ColumnContainer hasInInspectorIdColumn() {
addColumnStr("\"task\".in_inspector_id as task_in_inspector_id ");
return (ColumnContainer) this;
......
......@@ -2,6 +2,9 @@ package com.viontech.label.platform.service.adapter;
import com.viontech.label.platform.base.BaseService;
import com.viontech.label.platform.model.SubTask;
import org.w3c.dom.stylesheets.LinkStyle;
import java.util.List;
public interface SubTaskService extends BaseService<SubTask> {
......@@ -41,4 +44,6 @@ public interface SubTaskService extends BaseService<SubTask> {
*/
void assignOutInspector(Long taskId, long outInspectorId, long count);
List<SubTask> getDataByIds(List<Long> ids);
}
\ No newline at end of file
......@@ -6,9 +6,11 @@ import com.viontech.label.platform.mapper.SubTaskMapper;
import com.viontech.label.platform.model.SubTask;
import com.viontech.label.platform.model.SubTaskExample;
import com.viontech.label.platform.service.adapter.SubTaskService;
import org.redisson.mapreduce.SubTasksExecutor;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class SubTaskServiceImpl extends BaseServiceImpl<SubTask> implements SubTaskService {
......@@ -44,4 +46,12 @@ public class SubTaskServiceImpl extends BaseServiceImpl<SubTask> implements SubT
public void assignOutInspector(Long taskId, long outInspectorId, long count) {
subTaskMapper.assignOutInspector(taskId, outInspectorId, count);
}
@Override
public List<SubTask> getDataByIds(List<Long> ids) {
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andIdIn(ids);
return selectByExample(subTaskExample);
}
}
\ No newline at end of file
......@@ -9,13 +9,10 @@ import com.viontech.keliu.util.DateUtil;
import com.viontech.keliu.websocket.AlgApiClient;
import com.viontech.label.core.constant.Constants;
import com.viontech.label.core.constant.LogOperateType;
import com.viontech.label.core.constant.PicStatus;
import com.viontech.label.platform.mapper.PicMapper;
import com.viontech.label.core.constant.SubTaskStatus;
import com.viontech.label.platform.mapper.SubTaskMapper;
import com.viontech.label.platform.model.*;
import com.viontech.label.platform.service.adapter.LogService;
import com.viontech.label.platform.service.adapter.PackService;
import com.viontech.label.platform.service.adapter.PicService;
import com.viontech.label.platform.service.adapter.UserService;
import com.viontech.label.platform.service.adapter.*;
import com.viontech.label.platform.utils.StorageUtils;
import com.viontech.label.platform.vo.PicVo;
import com.viontech.label.platform.vo.ReidUploadData;
......@@ -26,6 +23,7 @@ import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
......@@ -53,8 +51,6 @@ public class ReidService {
@Resource
private LogService logService;
@Resource
private PackService packService;
@Resource
private StorageUtils storageUtils;
@Resource
private RedissonService redissonService;
......@@ -68,12 +64,17 @@ public class ReidService {
private RedissonClient redissonClient;
@Resource
private UserService userService;
@Resource
private SubTaskService subTaskService;
/**
* 接收并存储上传工具上传的图片,特征和数据
*/
@Transactional(rollbackFor = Exception.class)
public void savePicAndFeature(ReidUploadData data) throws Exception {
Long packId = data.getPackId();
Pack pack = storageUtils.getPack(packId);
String poolName = Constants.getReidPoolName(packId);
// 存储图片文件
MultipartFile picFile = data.getPic();
......@@ -86,13 +87,21 @@ public class ReidService {
byte[] featureFileBytes = featureFile.getBytes();
storageUtils.setFile(packId, featureFile.getOriginalFilename(), featureFileBytes);
// 插入图片数据
Pack pack = storageUtils.getPack(packId);
pic.setStorageId(pack.getStorageId());
pic.setUnid(data.getUnid());
pic.setPersonUnid(data.getPersonUnid());
pic.setStatus(PicStatus.TO_BE_LABELED.val);
pic.setStatus(SubTaskStatus.TO_BE_LABELED.val);
pic.setCreateTime(data.getCountTime());
picService.insertSelective(pic);
SubTask subTask = new SubTask();
subTask.setPersonUnid(data.getPersonUnid());
subTask.setUnid(data.getUnid());
subTask.setPicId(pic.getId());
subTask.setPackId(packId);
subTask.setCreateTime(data.getCountTime());
subTask.setTaskId(data.getTaskId());
subTaskService.insertSelective(subTask);
// 建立特征池,存储特征信息
Boolean hasKey = redisTemplate.hasKey(poolName);
if (hasKey != null && !hasKey) {
......@@ -146,25 +155,29 @@ public class ReidService {
List<String> personUnidNeedDeleteAndUpdate = needMergePersonUnidList.stream().filter(x -> !x.equals(newPersonUnid)).collect(Collectors.toList());
// 更新personUnid
PicExample picExample = new PicExample();
picExample.createCriteria().andPersonUnidIn(needMergePersonUnidList);
Pic pic = new Pic();
pic.setPersonUnid(newPersonUnid);
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidIn(needMergePersonUnidList);
SubTask subTask = new SubTask();
subTask.setPersonUnid(newPersonUnid);
if (!Objects.equals(newPersonUnid, currentPerson)) {
pic.setStatus(PicStatus.TO_BE_LABELED.val);
subTask.setStatus(SubTaskStatus.TO_BE_LABELED.val);
}
picService.updateByExampleSelective(pic, picExample);
subTaskService.updateByExampleSelective(subTask, subTaskExample);
// 删除和更新特征池
CompletableFuture<AlgResult> future = matchClient.EASY_PERSON_API.deletePerson(poolName, personUnidNeedDeleteAndUpdate);
future.get();
ArrayList<BodyFeature> bodyFeatures = new ArrayList<>();
Person person = new Person().setPersonId(newPersonUnid).setBodyFeatures(bodyFeatures);
picExample = new PicExample();
picExample.createCriteria().andPersonUnidEqualTo(newPersonUnid);
List<Pic> pics = picService.selectByExample(picExample);
subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidEqualTo(newPersonUnid);
List<SubTask> subtasks = subTaskService.selectByExample(subTaskExample);
ArrayList<Long> ids = new ArrayList<>();
for (Pic item : pics) {
BodyFeature bodyFeature = storageUtils.getBodyFeature(item.getId());
for (SubTask item : subtasks) {
BodyFeature bodyFeature = storageUtils.getBodyFeature(item.getPicId());
if (bodyFeature == null) {
continue;
}
bodyFeatures.add(bodyFeature);
ids.add(item.getId());
}
......@@ -186,34 +199,37 @@ public class ReidService {
/**
* 合并多张图作为新人
*/
public void mergeAsNewPerson(Long[] idArr, Long packId) throws Exception {
public void mergeAsNewPerson(Long[] subTaskIds, Long packId) throws Exception {
String poolName = Constants.getReidPoolName(packId);
// 获取被合并的图片对应的personUnid集合
PicExample picExample = new PicExample();
picExample.createCriteria().andIdIn(Arrays.asList(idArr));
List<Pic> pics = picService.selectByExample(picExample);
Set<String> originalPersonUnidSet = pics.stream().map(Pic::getPersonUnid).collect(Collectors.toSet());
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andIdIn(Arrays.asList(subTaskIds));
List<SubTask> subTasks = subTaskService.selectByExample(subTaskExample);
Set<Long> picIdSet = subTasks.stream().map(SubTask::getPicId).collect(Collectors.toSet());
Set<String> originalPersonUnidSet = subTasks.stream().map(SubTask::getPersonUnid).collect(Collectors.toSet());
// 更新被合并的人的personUnid,然后添加到特征池中
Pic temp = new Pic();
SubTask temp = new SubTask();
String newPersonUnid = UUID.randomUUID().toString();
temp.setPersonUnid(newPersonUnid);
temp.setStatus(PicStatus.TO_BE_LABELED.val);
picService.updateByExampleSelective(temp, picExample);
temp.setStatus(SubTaskStatus.TO_BE_LABELED.val);
subTaskService.updateByExampleSelective(temp, subTaskExample);
ArrayList<BodyFeature> bodyFeatures = new ArrayList<>();
Person person = new Person().setPersonId(newPersonUnid).setBodyFeatures(bodyFeatures);
for (Long picId : idArr) {
for (Long picId : picIdSet) {
BodyFeature bodyFeature = storageUtils.getBodyFeature(picId);
bodyFeatures.add(bodyFeature);
}
CompletableFuture<AlgResult> future = matchClient.EASY_PERSON_API.addPerson(poolName, Collections.singletonList(person));
future.get();
// 更新被合并的人对应的person
picExample = new PicExample();
picExample.createCriteria().andPersonUnidIn(new ArrayList<>(originalPersonUnidSet));
pics = picService.selectByExample(picExample);
Map<String, List<Pic>> picMap = pics.stream().collect(Collectors.groupingBy(Pic::getPersonUnid, Collectors.toList()));
Set<String> keySet = picMap.keySet();
subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidIn(new ArrayList<>(originalPersonUnidSet));
subTasks = subTaskService.selectByExample(subTaskExample);
Map<String, List<SubTask>> subTaskMap = subTasks.stream().collect(Collectors.groupingBy(SubTask::getPersonUnid, Collectors.toList()));
Set<String> keySet = subTaskMap.keySet();
//如果keySet中没有原来的personUnid了,说明某个人的照片全部被合并走了需要从特征池中删掉
for (String personUnid : originalPersonUnidSet) {
if (!keySet.contains(personUnid)) {
......@@ -221,32 +237,33 @@ public class ReidService {
future.get();
}
}
for (Map.Entry<String, List<Pic>> entry : picMap.entrySet()) {
for (Map.Entry<String, List<SubTask>> entry : subTaskMap.entrySet()) {
String personUnid = entry.getKey();
bodyFeatures = new ArrayList<>();
person = new Person().setPersonId(personUnid).setBodyFeatures(bodyFeatures);
for (Pic pic : entry.getValue()) {
BodyFeature bodyFeature = storageUtils.getBodyFeature(pic.getId());
for (SubTask item : entry.getValue()) {
BodyFeature bodyFeature = storageUtils.getBodyFeature(item.getPicId());
bodyFeatures.add(bodyFeature);
}
future = matchClient.EASY_PERSON_API.updatePerson(poolName, person);
future.get();
}
storageUtils.removePicCache(idArr);
// 写入日志
logMergeAsNewPerson(idArr);
// websocket
storageUtils.removePicCache(picIdSet.toArray(new Long[0]));
HashMap<String, Object> message = new HashMap<>(2);
message.put("personUnid", newPersonUnid);
message.put("picIdArr", idArr);
message.put("subTaskIds", subTaskIds);
// 写入日志
logMergeAsNewPerson(subTaskIds);
// websocket
ReidWebsocket.sendInfo(packId, new ReidWebsocket.Message().setCommand("mergeAsNewPerson").setData(message));
}
/**
* 将张图与某个人合并
* 将张图与某个人合并
*/
public void mergeTo(Long[] picIdArr, String personUnid, String currentPerson, Long packId) throws Exception {
public void mergeTo(Long[] subTaskIdArr, String personUnid, String currentPerson, Long packId) throws Exception {
if (!Objects.equals(personUnid, currentPerson)) {
if (isLabeling(personUnid, packId) != null) {
throw new RuntimeException("有标注中的人被选择");
......@@ -254,29 +271,36 @@ public class ReidService {
}
String poolName = Constants.getReidPoolName(packId);
String originalPersonUnid = null;
for (Long picId : picIdArr) {
PicVo pic = storageUtils.getPic(picId);
originalPersonUnid = pic.getPersonUnid();
// 更新pic的personUnid并加入到特征池中
PicMapper picMapper = (PicMapper) picService.getMapper();
picMapper.mergeTo(picId, personUnid);
List<Long> subTaskIdList = Arrays.asList(subTaskIdArr);
List<SubTask> subTasks = subTaskService.getDataByIds(subTaskIdList);
Set<Long> picIdSet = subTasks.stream().map(SubTask::getPicId).collect(Collectors.toSet());
Set<String> originalPersonUnidSet = subTasks.stream().map(SubTask::getPersonUnid).collect(Collectors.toSet());
// 合并操作
SubTaskMapper subTaskMapper = (SubTaskMapper) subTaskService.getMapper();
subTaskMapper.mergeTo(subTaskIdList, personUnid);
// 将对应 pic 的特征加入到特征池中
for (Long picId : picIdSet) {
List<BodyFeature> bodyFeatures = Collections.singletonList(storageUtils.getBodyFeature(picId));
Person person = new Person().setPersonId(personUnid).setBodyFeatures(bodyFeatures);
CompletableFuture<AlgResult> future = matchClient.EASY_PERSON_API.addPerson(poolName, Collections.singletonList(person));
future.get();
}
// 更新pic对应的原来的person
updatePoolByPersonUnid(originalPersonUnid, poolName);
for (String originalPersonUnid : originalPersonUnidSet) {
updatePoolByPersonUnid(originalPersonUnid, poolName);
}
// 移除缓存
for (Long picId : picIdArr) {
for (Long picId : picIdSet) {
storageUtils.removePicCache(picId);
}
// 写入日志
logMergeTo(picIdArr, personUnid);
logMergeTo(subTaskIdArr, personUnid);
// websocket
HashMap<String, Object> body = new HashMap<>(2);
body.put("picIdArr", picIdArr);
body.put("subTaskIdArr", subTaskIdArr);
body.put("personUnid", personUnid);
ReidWebsocket.sendInfo(packId, new ReidWebsocket.Message().setCommand("mergeTo").setData(body));
}
......@@ -285,19 +309,21 @@ public class ReidService {
* 标记人为纯净的(修改人对应的所有的图片状态)
*/
public void setPackPure(String personUnid, Long packId) {
PicExample picExample = new PicExample();
picExample.createCriteria().andPersonUnidEqualTo(personUnid);
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidEqualTo(personUnid);
List<SubTask> subTasks = subTaskService.selectByExample(subTaskExample);
List<Pic> pics = picService.selectByExample(picExample);
if (pics.size() > 0 && pics.get(0).getStatus().equals(PicStatus.FINISH_LABELING.val)) {
if (subTasks.size() > 0 && subTasks.get(0).getStatus().equals(SubTaskStatus.FINISH_LABELING.val)) {
throw new RuntimeException("已经是完成状态了!");
}
SubTask subTask = new SubTask();
subTask.setStatus(SubTaskStatus.FINISH_LABELING.val);
subTask.setAnnotatorId(StpUtil.getLoginIdAsLong());
subTask.setAnnotateTime(new Date());
subTaskService.updateByExampleSelective(subTask, subTaskExample);
Pic pic = new Pic();
pic.setStatus(PicStatus.FINISH_LABELING.val);
pic.setReidFinishUser(StpUtil.getLoginIdAsLong());
picService.updateByExampleSelective(pic, picExample);
//删除缓存
RMap<String, User> labelingSet = redissonClient.getMap("labeling:" + packId);
labelingSet.remove(personUnid);
......@@ -310,20 +336,21 @@ public class ReidService {
/**
* 根据所选择的图片获取相似的人
*/
public Map<String, List<Pic>> getSimilarPerson(Long[] picIdArr, Long packId, Long size, Integer timeInterval) {
public Map<String, List<SubTask>> getSimilarPerson(Long[] subTaskIdArr, Long packId, Long size, Integer timeInterval) {
List<BodyFeature> bodyFeatures = new ArrayList<>();
String reidPoolName = Constants.getReidPoolName(packId);
Set<String> personUnidSet = new HashSet<>();
Date countTimeGTE = null;
Date countTimeLTE = null;
for (Long picId : picIdArr) {
List<SubTask> subTasks = subTaskService.getDataByIds(Arrays.asList(subTaskIdArr));
Set<Long> picIdSet = subTasks.stream().map(SubTask::getPicId).collect(Collectors.toSet());
Set<String> personUnidSet = subTasks.stream().map(SubTask::getPersonUnid).collect(Collectors.toSet());
for (Long picId : picIdSet) {
PicVo pic = storageUtils.getPic(picId);
if (pic == null) {
continue;
}
String personUnid = pic.getPersonUnid();
personUnidSet.add(personUnid);
if (timeInterval != null) {
Date max = DateUtil.addMinutes(pic.getCreateTime(), timeInterval);
......@@ -354,13 +381,16 @@ public class ReidService {
if (personUnidList.size() == 0) {
return Collections.emptyMap();
}
PicExample picExample = new PicExample();
picExample.createCriteria().andPersonUnidIn(personUnidList);
List<Pic> pics = picService.selectByExample(picExample);
Map<String, List<Pic>> collect = pics.stream().collect(Collectors.groupingBy(Pic::getPersonUnid, Collectors.toList()));
for (Map.Entry<String, List<Pic>> entry : collect.entrySet()) {
Pic pic = entry.getValue().get(0);
if (pic.getStatus() == PicStatus.FINISH_LABELING.val && entry.getValue().size() > 3) {
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidIn(personUnidList);
subTasks = subTaskService.selectByExample(subTaskExample);
Map<String, List<SubTask>> collect = subTasks.stream().collect(Collectors.groupingBy(SubTask::getPersonUnid, Collectors.toList()));
for (Map.Entry<String, List<SubTask>> entry : collect.entrySet()) {
SubTask pic = entry.getValue().get(0);
if (pic.getStatus() == SubTaskStatus.FINISH_LABELING.val && entry.getValue().size() > 3) {
entry.setValue(entry.getValue().subList(0, 3));
}
......@@ -378,21 +408,21 @@ public class ReidService {
* 2.删除数据库记录和缓存记录
* 3.更新或删除特征池记录
*/
public void deletePic(Long[] picIdArr, Long packId) {
public void deletePic(Long[] subTaskIdArr, Long packId) {
String reidPoolName = Constants.getReidPoolName(packId);
Set<String> personUnidSet = new HashSet<>();
for (Long picId : picIdArr) {
PicVo pic = storageUtils.getPic(picId);
personUnidSet.add(pic.getPersonUnid());
}
List<SubTask> subTasks = subTaskService.getDataByIds(Arrays.asList(subTaskIdArr));
Set<String> personUnidSet = subTasks.stream().map(SubTask::getPersonUnid).collect(Collectors.toSet());
for (String item : personUnidSet) {
if (isLabeling(item, packId) != null) {
throw new RuntimeException("有正在标注中的图片被选择");
}
}
for (Long picId : picIdArr) {
picService.deleteByPrimaryKey(picId);
storageUtils.removePicCache(picId);
for (SubTask item : subTasks) {
subTaskService.deleteByPrimaryKey(item.getId());
storageUtils.removePicCache(item.getPicId());
}
try {
......@@ -404,9 +434,9 @@ public class ReidService {
}
//写入日志
logDeletePic(picIdArr);
logDeletePic(subTaskIdArr);
//websocket
ReidWebsocket.sendInfo(packId, new ReidWebsocket.Message().setCommand("deletePic").setData(picIdArr));
ReidWebsocket.sendInfo(packId, new ReidWebsocket.Message().setCommand("deletePic").setData(subTaskIdArr));
}
/**
......@@ -424,22 +454,24 @@ public class ReidService {
}
// 数据库更新状态
Pic pic = new Pic();
pic.setStatus(PicStatus.LABELING.val);
pic.setReidFinishUser(StpUtil.getLoginIdAsLong());
PicExample picExample = new PicExample();
picExample.createCriteria().andPersonUnidEqualTo(personUnid);
SubTask subTask = new SubTask();
subTask.setStatus(SubTaskStatus.LABELING.val);
subTask.setAnnotatorId(StpUtil.getLoginIdAsLong());
List<Pic> pics = picService.selectByExample(picExample);
if (pics.size() > 0 && pics.get(0).getStatus().equals(PicStatus.FINISH_LABELING.val)) {
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidEqualTo(personUnid);
List<SubTask> subTasks = subTaskService.selectByExample(subTaskExample);
if (subTasks.size() > 0 && subTasks.get(0).getStatus().equals(SubTaskStatus.FINISH_LABELING.val)) {
return true;
}
if (pics.size() == 0) {
if (subTasks.size() == 0) {
return true;
}
picService.updateByExampleSelective(pic, picExample);
subTaskService.updateByExampleSelective(subTask, subTaskExample);
// redis 进行记录
labelingSet.put(personUnid, currentUser);
......@@ -456,17 +488,17 @@ public class ReidService {
public void exitLabeling(String personUnid, Long packId) {
// 数据库更新状态
Pic pic = new Pic();
pic.setStatus(PicStatus.TO_BE_LABELED.val);
PicExample picExample = new PicExample();
picExample.createCriteria().andPersonUnidEqualTo(personUnid).andPackIdEqualTo(packId);
SubTask subTask = new SubTask();
subTask.setStatus(SubTaskStatus.TO_BE_LABELED.val);
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidEqualTo(personUnid).andPackIdEqualTo(packId);
List<Pic> pics = picService.selectByExample(picExample);
if (pics.size() > 0 && pics.get(0).getStatus() == (PicStatus.FINISH_LABELING.val)) {
List<SubTask> subTasks = subTaskService.selectByExample(subTaskExample);
if (subTasks.size() > 0 && subTasks.get(0).getStatus() == (SubTaskStatus.FINISH_LABELING.val)) {
return;
}
picService.updateByExampleSelective(pic, picExample);
subTaskService.updateByExampleSelective(subTask, subTaskExample);
// redis 删除缓存
RMap<String, User> labelingSet = redissonClient.getMap("labeling:" + packId);
......@@ -495,14 +527,15 @@ public class ReidService {
if (personUnid == null || poolName == null) {
return;
}
PicExample picExample = new PicExample();
picExample.createCriteria().andPersonUnidEqualTo(personUnid);
List<Pic> pics = picService.selectByExample(picExample);
if (pics.size() > 0) {
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidEqualTo(personUnid);
List<SubTask> subTasks = subTaskService.selectByExample(subTaskExample);
if (subTasks.size() > 0) {
ArrayList<BodyFeature> bodyFeatures = new ArrayList<>();
Person person = new Person().setPersonUnid(personUnid).setBodyFeatures(bodyFeatures);
for (Pic item : pics) {
BodyFeature bodyFeature = storageUtils.getBodyFeature(item.getId());
for (SubTask item : subTasks) {
BodyFeature bodyFeature = storageUtils.getBodyFeature(item.getPicId());
bodyFeatures.add(bodyFeature);
}
CompletableFuture<AlgResult> future = matchClient.EASY_PERSON_API.updatePerson(poolName, person);
......@@ -577,26 +610,26 @@ public class ReidService {
File tempFile = File.createTempFile("label-" + packId, ".zip");
try (ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(tempFile))) {
PicExample picExample = new PicExample();
picExample.createCriteria().andPackIdEqualTo(packId).andStatusEqualTo(PicStatus.FINISH_LABELING.val);
List<Pic> allPic = picService.selectByExample(picExample);
Map<String, List<Pic>> collect = allPic.stream().collect(Collectors.groupingBy(Pic::getPersonUnid, Collectors.toList()));
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPackIdEqualTo(packId).andStatusEqualTo(SubTaskStatus.FINISH_LABELING.val);
List<SubTask> allSubTask = subTaskService.selectByExample(subTaskExample);
Map<String, List<SubTask>> collect = allSubTask.stream().collect(Collectors.groupingBy(SubTask::getPersonUnid, Collectors.toList()));
byte[] bytes;
for (Map.Entry<String, List<Pic>> entry : collect.entrySet()) {
for (Map.Entry<String, List<SubTask>> entry : collect.entrySet()) {
String personUnid = entry.getKey();
List<Pic> pics = entry.getValue();
List<SubTask> subtasks = entry.getValue();
for (Pic pic : pics) {
try {
bytes = storageUtils.getFile(packId, pic.getName());
} catch (Exception e) {
log.error("打包文件时出错,packId:{},picId:{}", packId, pic.getId());
log.error("", e);
for (SubTask subTask : subtasks) {
PicVo pic = storageUtils.getPic(subTask.getPicId());
if (pic == null) {
continue;
}
if (bytes != null) {
byte[] image = pic.getImage();
if (image != null) {
zipOutputStream.putNextEntry(new ZipEntry(personUnid + "/" + pic.getName()));
zipOutputStream.write(bytes);
zipOutputStream.write(image);
}
}
}
......
......@@ -22,5 +22,6 @@ public class ReidUploadData {
private String unid;
private String personUnid;
private Date countTime;
private Long taskId;
}
......@@ -5,7 +5,6 @@ import com.viontech.label.platform.base.VoInterface;
import com.viontech.label.platform.model.Pack;
import com.viontech.label.platform.model.Pic;
import com.viontech.label.platform.model.Storage;
import java.util.ArrayList;
import java.util.Date;
......@@ -85,15 +84,6 @@ public class PicVoBase extends Pic implements VoInterface<Pic> {
private Long packId_lte;
@JsonIgnore
private Boolean personUnid_null;
@JsonIgnore
private ArrayList<String> personUnid_arr;
@JsonIgnore
private String personUnid_like;
@JsonIgnore
private ArrayList<Integer> status_arr;
@JsonIgnore
......@@ -108,30 +98,12 @@ public class PicVoBase extends Pic implements VoInterface<Pic> {
@JsonIgnore
private Integer status_lte;
@JsonIgnore
private Boolean reidFinishUser_null;
@JsonIgnore
private ArrayList<Long> reidFinishUser_arr;
@JsonIgnore
private Long reidFinishUser_gt;
@JsonIgnore
private Long reidFinishUser_lt;
@JsonIgnore
private Long reidFinishUser_gte;
@JsonIgnore
private Long reidFinishUser_lte;
public PicVoBase() {
this(null);
}
public PicVoBase(Pic pic) {
if (pic == null) {
if(pic == null) {
pic = new Pic();
}
this.pic = pic;
......@@ -187,14 +159,14 @@ public class PicVoBase extends Pic implements VoInterface<Pic> {
}
public Long getId() {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getId();
}
public void setId(Long id) {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setId(id);
......@@ -217,14 +189,14 @@ public class PicVoBase extends Pic implements VoInterface<Pic> {
}
public String getUnid() {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getUnid();
}
public void setUnid(String unid) {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setUnid(unid);
......@@ -271,14 +243,14 @@ public class PicVoBase extends Pic implements VoInterface<Pic> {
}
public Date getCreateTime() {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getCreateTime();
}
public void setCreateTime(Date createTime) {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setCreateTime(createTime);
......@@ -301,14 +273,14 @@ public class PicVoBase extends Pic implements VoInterface<Pic> {
}
public String getName() {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getName();
}
public void setName(String name) {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setName(name);
......@@ -355,14 +327,14 @@ public class PicVoBase extends Pic implements VoInterface<Pic> {
}
public Long getStorageId() {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getStorageId();
}
public void setStorageId(Long storageId) {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setStorageId(storageId);
......@@ -409,57 +381,19 @@ public class PicVoBase extends Pic implements VoInterface<Pic> {
}
public Long getPackId() {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getPackId();
}
public void setPackId(Long packId) {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setPackId(packId);
}
public Boolean getPersonUnid_null() {
return personUnid_null;
}
public void setPersonUnid_null(Boolean personUnid_null) {
this.personUnid_null = personUnid_null;
}
public ArrayList<String> getPersonUnid_arr() {
return personUnid_arr;
}
public void setPersonUnid_arr(ArrayList<String> personUnid_arr) {
this.personUnid_arr = personUnid_arr;
}
public String getPersonUnid_like() {
return personUnid_like;
}
public void setPersonUnid_like(String personUnid_like) {
this.personUnid_like = personUnid_like;
}
public String getPersonUnid() {
if (getModel() == null) {
throw new RuntimeException("model is null");
}
return this.getModel().getPersonUnid();
}
public void setPersonUnid(String personUnid) {
if (getModel() == null) {
throw new RuntimeException("model is null");
}
this.getModel().setPersonUnid(personUnid);
}
public ArrayList<Integer> getStatus_arr() {
return status_arr;
}
......@@ -501,104 +435,42 @@ public class PicVoBase extends Pic implements VoInterface<Pic> {
}
public Integer getStatus() {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getStatus();
}
public void setStatus(Integer status) {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setStatus(status);
}
public Boolean getReidFinishUser_null() {
return reidFinishUser_null;
}
public void setReidFinishUser_null(Boolean reidFinishUser_null) {
this.reidFinishUser_null = reidFinishUser_null;
}
public ArrayList<Long> getReidFinishUser_arr() {
return reidFinishUser_arr;
}
public void setReidFinishUser_arr(ArrayList<Long> reidFinishUser_arr) {
this.reidFinishUser_arr = reidFinishUser_arr;
}
public Long getReidFinishUser_gt() {
return reidFinishUser_gt;
}
public void setReidFinishUser_gt(Long reidFinishUser_gt) {
this.reidFinishUser_gt = reidFinishUser_gt;
}
public Long getReidFinishUser_lt() {
return reidFinishUser_lt;
}
public void setReidFinishUser_lt(Long reidFinishUser_lt) {
this.reidFinishUser_lt = reidFinishUser_lt;
}
public Long getReidFinishUser_gte() {
return reidFinishUser_gte;
}
public void setReidFinishUser_gte(Long reidFinishUser_gte) {
this.reidFinishUser_gte = reidFinishUser_gte;
}
public Long getReidFinishUser_lte() {
return reidFinishUser_lte;
}
public void setReidFinishUser_lte(Long reidFinishUser_lte) {
this.reidFinishUser_lte = reidFinishUser_lte;
}
public Long getReidFinishUser() {
if (getModel() == null) {
throw new RuntimeException("model is null");
}
return this.getModel().getReidFinishUser();
}
public void setReidFinishUser(Long reidFinishUser) {
if (getModel() == null) {
throw new RuntimeException("model is null");
}
this.getModel().setReidFinishUser(reidFinishUser);
}
public Storage getStorage() {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getStorage();
}
public void setStorage(Storage storage) {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setStorage(storage);
}
public Pack getPack() {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getPack();
}
public void setPack(Pack pack) {
if (getModel() == null) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setPack(pack);
......
......@@ -5,7 +5,6 @@ import com.viontech.label.platform.base.VoInterface;
import com.viontech.label.platform.model.Pic;
import com.viontech.label.platform.model.SubTask;
import com.viontech.label.platform.model.Task;
import java.util.ArrayList;
import java.util.Date;
......@@ -151,6 +150,24 @@ public class SubTaskVoBase extends SubTask implements VoInterface<SubTask> {
private Long annotatorId_lte;
@JsonIgnore
private Boolean annotateTime_null;
@JsonIgnore
private ArrayList<Date> annotateTime_arr;
@JsonIgnore
private Date annotateTime_gt;
@JsonIgnore
private Date annotateTime_lt;
@JsonIgnore
private Date annotateTime_gte;
@JsonIgnore
private Date annotateTime_lte;
@JsonIgnore
private Boolean labelResult_null;
@JsonIgnore
......@@ -204,6 +221,33 @@ public class SubTaskVoBase extends SubTask implements VoInterface<SubTask> {
@JsonIgnore
private Integer status_lte;
@JsonIgnore
private Boolean personUnid_null;
@JsonIgnore
private ArrayList<String> personUnid_arr;
@JsonIgnore
private String personUnid_like;
@JsonIgnore
private Boolean packId_null;
@JsonIgnore
private ArrayList<Long> packId_arr;
@JsonIgnore
private Long packId_gt;
@JsonIgnore
private Long packId_lt;
@JsonIgnore
private Long packId_gte;
@JsonIgnore
private Long packId_lte;
public SubTaskVoBase() {
this(null);
}
......@@ -718,6 +762,68 @@ public class SubTaskVoBase extends SubTask implements VoInterface<SubTask> {
this.getModel().setAnnotatorId(annotatorId);
}
public Boolean getAnnotateTime_null() {
return annotateTime_null;
}
public void setAnnotateTime_null(Boolean annotateTime_null) {
this.annotateTime_null = annotateTime_null;
}
public ArrayList<Date> getAnnotateTime_arr() {
return annotateTime_arr;
}
public void setAnnotateTime_arr(ArrayList<Date> annotateTime_arr) {
this.annotateTime_arr = annotateTime_arr;
}
public Date getAnnotateTime_gt() {
return annotateTime_gt;
}
public void setAnnotateTime_gt(Date annotateTime_gt) {
this.annotateTime_gt = annotateTime_gt;
}
public Date getAnnotateTime_lt() {
return annotateTime_lt;
}
public void setAnnotateTime_lt(Date annotateTime_lt) {
this.annotateTime_lt = annotateTime_lt;
}
public Date getAnnotateTime_gte() {
return annotateTime_gte;
}
public void setAnnotateTime_gte(Date annotateTime_gte) {
this.annotateTime_gte = annotateTime_gte;
}
public Date getAnnotateTime_lte() {
return annotateTime_lte;
}
public void setAnnotateTime_lte(Date annotateTime_lte) {
this.annotateTime_lte = annotateTime_lte;
}
public Date getAnnotateTime() {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getAnnotateTime();
}
public void setAnnotateTime(Date annotateTime) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setAnnotateTime(annotateTime);
}
public Boolean getLabelResult_null() {
return labelResult_null;
}
......@@ -918,6 +1024,106 @@ public class SubTaskVoBase extends SubTask implements VoInterface<SubTask> {
this.getModel().setStatus(status);
}
public Boolean getPersonUnid_null() {
return personUnid_null;
}
public void setPersonUnid_null(Boolean personUnid_null) {
this.personUnid_null = personUnid_null;
}
public ArrayList<String> getPersonUnid_arr() {
return personUnid_arr;
}
public void setPersonUnid_arr(ArrayList<String> personUnid_arr) {
this.personUnid_arr = personUnid_arr;
}
public String getPersonUnid_like() {
return personUnid_like;
}
public void setPersonUnid_like(String personUnid_like) {
this.personUnid_like = personUnid_like;
}
public String getPersonUnid() {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getPersonUnid();
}
public void setPersonUnid(String personUnid) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setPersonUnid(personUnid);
}
public Boolean getPackId_null() {
return packId_null;
}
public void setPackId_null(Boolean packId_null) {
this.packId_null = packId_null;
}
public ArrayList<Long> getPackId_arr() {
return packId_arr;
}
public void setPackId_arr(ArrayList<Long> packId_arr) {
this.packId_arr = packId_arr;
}
public Long getPackId_gt() {
return packId_gt;
}
public void setPackId_gt(Long packId_gt) {
this.packId_gt = packId_gt;
}
public Long getPackId_lt() {
return packId_lt;
}
public void setPackId_lt(Long packId_lt) {
this.packId_lt = packId_lt;
}
public Long getPackId_gte() {
return packId_gte;
}
public void setPackId_gte(Long packId_gte) {
this.packId_gte = packId_gte;
}
public Long getPackId_lte() {
return packId_lte;
}
public void setPackId_lte(Long packId_lte) {
this.packId_lte = packId_lte;
}
public Long getPackId() {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getPackId();
}
public void setPackId(Long packId) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setPackId(packId);
}
public Pic getPic() {
if(getModel() == null ){
throw new RuntimeException("model is null");
......
......@@ -5,7 +5,6 @@ import com.viontech.label.platform.base.VoInterface;
import com.viontech.label.platform.model.Pack;
import com.viontech.label.platform.model.Task;
import com.viontech.label.platform.model.TaskPack;
import java.util.ArrayList;
import java.util.Date;
......
......@@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.viontech.label.platform.base.VoInterface;
import com.viontech.label.platform.model.Account;
import com.viontech.label.platform.model.Task;
import java.util.ArrayList;
import java.util.Date;
......@@ -153,6 +152,42 @@ public class TaskVoBase extends Task implements VoInterface<Task> {
private Long managerId_lte;
@JsonIgnore
private Boolean assignTime_null;
@JsonIgnore
private ArrayList<Date> assignTime_arr;
@JsonIgnore
private Date assignTime_gt;
@JsonIgnore
private Date assignTime_lt;
@JsonIgnore
private Date assignTime_gte;
@JsonIgnore
private Date assignTime_lte;
@JsonIgnore
private Boolean finishTime_null;
@JsonIgnore
private ArrayList<Date> finishTime_arr;
@JsonIgnore
private Date finishTime_gt;
@JsonIgnore
private Date finishTime_lt;
@JsonIgnore
private Date finishTime_gte;
@JsonIgnore
private Date finishTime_lte;
@JsonIgnore
private ArrayList<Long> inInspectorId_arr;
@JsonIgnore
......@@ -727,6 +762,130 @@ public class TaskVoBase extends Task implements VoInterface<Task> {
this.getModel().setManagerId(managerId);
}
public Boolean getAssignTime_null() {
return assignTime_null;
}
public void setAssignTime_null(Boolean assignTime_null) {
this.assignTime_null = assignTime_null;
}
public ArrayList<Date> getAssignTime_arr() {
return assignTime_arr;
}
public void setAssignTime_arr(ArrayList<Date> assignTime_arr) {
this.assignTime_arr = assignTime_arr;
}
public Date getAssignTime_gt() {
return assignTime_gt;
}
public void setAssignTime_gt(Date assignTime_gt) {
this.assignTime_gt = assignTime_gt;
}
public Date getAssignTime_lt() {
return assignTime_lt;
}
public void setAssignTime_lt(Date assignTime_lt) {
this.assignTime_lt = assignTime_lt;
}
public Date getAssignTime_gte() {
return assignTime_gte;
}
public void setAssignTime_gte(Date assignTime_gte) {
this.assignTime_gte = assignTime_gte;
}
public Date getAssignTime_lte() {
return assignTime_lte;
}
public void setAssignTime_lte(Date assignTime_lte) {
this.assignTime_lte = assignTime_lte;
}
public Date getAssignTime() {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getAssignTime();
}
public void setAssignTime(Date assignTime) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setAssignTime(assignTime);
}
public Boolean getFinishTime_null() {
return finishTime_null;
}
public void setFinishTime_null(Boolean finishTime_null) {
this.finishTime_null = finishTime_null;
}
public ArrayList<Date> getFinishTime_arr() {
return finishTime_arr;
}
public void setFinishTime_arr(ArrayList<Date> finishTime_arr) {
this.finishTime_arr = finishTime_arr;
}
public Date getFinishTime_gt() {
return finishTime_gt;
}
public void setFinishTime_gt(Date finishTime_gt) {
this.finishTime_gt = finishTime_gt;
}
public Date getFinishTime_lt() {
return finishTime_lt;
}
public void setFinishTime_lt(Date finishTime_lt) {
this.finishTime_lt = finishTime_lt;
}
public Date getFinishTime_gte() {
return finishTime_gte;
}
public void setFinishTime_gte(Date finishTime_gte) {
this.finishTime_gte = finishTime_gte;
}
public Date getFinishTime_lte() {
return finishTime_lte;
}
public void setFinishTime_lte(Date finishTime_lte) {
this.finishTime_lte = finishTime_lte;
}
public Date getFinishTime() {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
return this.getModel().getFinishTime();
}
public void setFinishTime(Date finishTime) {
if(getModel() == null ){
throw new RuntimeException("model is null");
}
this.getModel().setFinishTime(finishTime);
}
public ArrayList<Long> getInInspectorId_arr() {
return inInspectorId_arr;
}
......
......@@ -5,11 +5,15 @@ import com.viontech.keliu.model.*;
import com.viontech.keliu.util.DateUtil;
import com.viontech.keliu.websocket.AlgApiClient;
import com.viontech.label.core.constant.Constants;
import com.viontech.label.core.constant.PicStatus;
import com.viontech.label.core.constant.SubTaskStatus;
import com.viontech.label.platform.model.Pic;
import com.viontech.label.platform.model.PicExample;
import com.viontech.label.platform.model.SubTask;
import com.viontech.label.platform.model.SubTaskExample;
import com.viontech.label.platform.service.adapter.PicService;
import com.viontech.label.platform.service.adapter.SubTaskService;
import com.viontech.label.platform.utils.StorageUtils;
import com.viontech.label.platform.vo.PicVo;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
......@@ -30,6 +34,8 @@ class LabelApplicationTests {
@Resource
private StorageUtils storageUtils;
@Resource
private SubTaskService subTaskService;
@Resource
private PicService picService;
@Resource
private AlgApiClient matchClient;
......@@ -51,20 +57,21 @@ class LabelApplicationTests {
Date countTimeLTE = null;
for (Long picId : picIdArr) {
Pic pic = picService.selectByPrimaryKey(picId);
SubTask subTask = subTaskService.selectByPrimaryKey(picId);
PicVo pic = storageUtils.getPic(subTask.getPicId());
if (pic == null) {
continue;
}
String personUnid = pic.getPersonUnid();
String personUnid = subTask.getPersonUnid();
personUnidSet.add(personUnid);
if (timeInterval != null) {
Date max = DateUtil.addMinutes(pic.getCreateTime(), timeInterval);
Date min = DateUtil.addMinutes(pic.getCreateTime(), -timeInterval);
Date max = DateUtil.addMinutes(subTask.getCreateTime(), timeInterval);
Date min = DateUtil.addMinutes(subTask.getCreateTime(), -timeInterval);
countTimeLTE = countTimeLTE == null ? max : max.compareTo(countTimeLTE) > 0 ? max : countTimeLTE;
countTimeGTE = countTimeGTE == null ? min : min.compareTo(countTimeGTE) < 0 ? min : countTimeGTE;
}
BodyFeature feature = getBodyFeature(picId);
BodyFeature feature = getBodyFeature(pic.getId());
if (feature == null) {
continue;
}
......@@ -90,13 +97,15 @@ class LabelApplicationTests {
if (personUnidList.size() == 0) {
System.out.println("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
}
PicExample picExample = new PicExample();
picExample.createCriteria().andPersonUnidIn(personUnidList);
List<Pic> pics = picService.selectByExample(picExample);
Map<String, List<Pic>> collect = pics.stream().collect(Collectors.groupingBy(Pic::getPersonUnid, Collectors.toList()));
for (Map.Entry<String, List<Pic>> entry : collect.entrySet()) {
Pic pic = entry.getValue().get(0);
if (pic.getStatus() == PicStatus.FINISH_LABELING.val && entry.getValue().size() > 3) {
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidIn(personUnidList);
List<SubTask> subtasks = subTaskService.selectByExample(subTaskExample);
Map<String, List<SubTask>> collect = subtasks.stream().collect(Collectors.groupingBy(SubTask::getPersonUnid, Collectors.toList()));
for (Map.Entry<String, List<SubTask>> entry : collect.entrySet()) {
SubTask pic = entry.getValue().get(0);
if (pic.getStatus() == SubTaskStatus.FINISH_LABELING.val && entry.getValue().size() > 3) {
entry.setValue(entry.getValue().subList(0, 3));
}
......
......@@ -55,7 +55,7 @@ public class KeliuController {
@GetMapping("/sendData")
public Object sendData(@RequestParam Date date, @RequestParam Long mallId, @RequestParam Long packId) {
public Object sendData(@RequestParam Date date, @RequestParam Long mallId, @RequestParam Long packId,@RequestParam Long taskId) {
List<Future<JsonMessageUtil.JsonMessage>> responses = new LinkedList<>();
if (SEND_DATA) {
return JsonMessageUtil.getErrorJsonMsg("有数据传输任务正在进行");
......@@ -69,7 +69,7 @@ public class KeliuController {
try {
byte[] bodyPic = fileService.getFile(faceRecognition.getBodyPath());
byte[] bodyFeature = fileService.getFile(faceRecognition.getBodyFeaturePath());
HttpEntity<MultiValueMap<String, Object>> requestEntity = getRequestEntity(faceRecognition, bodyPic, bodyFeature, packId);
HttpEntity<MultiValueMap<String, Object>> requestEntity = getRequestEntity(faceRecognition, bodyPic, bodyFeature, packId,taskId);
ResponseEntity<JsonMessageUtil.JsonMessage> exchange = restTemplate.exchange(vionConfig.getTargetUrl(), HttpMethod.POST, requestEntity, JsonMessageUtil.JsonMessage.class);
JsonMessageUtil.JsonMessage body = exchange.getBody();
log.info("unid:{},msg:{}", faceRecognition.getUnid(), body.getMsg());
......@@ -103,7 +103,7 @@ public class KeliuController {
return JsonMessageUtil.getSuccessJsonMsg("success:" + success + ";failed:" + failed);
}
private HttpEntity<MultiValueMap<String, Object>> getRequestEntity(FaceRecognition faceRecognition, byte[] bodyPic, byte[] bodyFeature, Long packId) {
private HttpEntity<MultiValueMap<String, Object>> getRequestEntity(FaceRecognition faceRecognition, byte[] bodyPic, byte[] bodyFeature, Long packId, Long taskId) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
......@@ -126,6 +126,7 @@ public class KeliuController {
map.add("unid", faceRecognition.getUnid());
map.add("personUnid", faceRecognition.getPersonUnid());
map.add("packId", packId);
map.add("taskId", taskId);
map.add("countTime", DateUtil.format("yyyy-MM-dd HH:mm:ss", faceRecognition.getCounttime()));
return new HttpEntity<>(map, headers);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!