Commit 847cd936 by xmh

一些修改

1 parent a2c8aede
Showing 19 changed files with 430 additions and 147 deletions
......@@ -20,7 +20,10 @@ public enum SubTaskStatus {
/** 审核驳回 */
reject(5),
/** 审核通过 */
VERIFY_PASSED(6);
VERIFY_PASSED(6),
/** 低质量 */
LOW_QUALITY(7),
;
public int val;
SubTaskStatus(int val) {
......
......@@ -7,6 +7,7 @@ import com.viontech.label.platform.model.Account;
import com.viontech.label.platform.model.AccountExample;
import com.viontech.label.platform.service.adapter.AccountService;
import com.viontech.label.platform.vo.AccountVo;
import javax.annotation.Resource;
public abstract class AccountBaseController extends BaseController<Account, AccountVo> {
......@@ -17,126 +18,144 @@ public abstract class AccountBaseController extends BaseController<Account, Acco
protected BaseExample getExample(AccountVo accountVo, int type) {
AccountExample accountExample = new AccountExample();
AccountExample.Criteria criteria = accountExample.createCriteria();
if(accountVo.getId() != null) {
if (accountVo.getId() != null) {
criteria.andIdEqualTo(accountVo.getId());
}
if(accountVo.getId_arr() != null) {
if (accountVo.getId_arr() != null) {
criteria.andIdIn(accountVo.getId_arr());
}
if(accountVo.getId_gt() != null) {
if (accountVo.getId_gt() != null) {
criteria.andIdGreaterThan(accountVo.getId_gt());
}
if(accountVo.getId_lt() != null) {
if (accountVo.getId_lt() != null) {
criteria.andIdLessThan(accountVo.getId_lt());
}
if(accountVo.getId_gte() != null) {
if (accountVo.getId_gte() != null) {
criteria.andIdGreaterThanOrEqualTo(accountVo.getId_gte());
}
if(accountVo.getId_lte() != null) {
if (accountVo.getId_lte() != null) {
criteria.andIdLessThanOrEqualTo(accountVo.getId_lte());
}
if(accountVo.getUnid() != null) {
if (accountVo.getUnid() != null) {
criteria.andUnidEqualTo(accountVo.getUnid());
}
if(accountVo.getUnid_arr() != null) {
if (accountVo.getUnid_arr() != null) {
criteria.andUnidIn(accountVo.getUnid_arr());
}
if(accountVo.getUnid_like() != null) {
if (accountVo.getUnid_like() != null) {
criteria.andUnidLike(accountVo.getUnid_like());
}
if(accountVo.getCreateTime() != null) {
if (accountVo.getCreateTime() != null) {
criteria.andCreateTimeEqualTo(accountVo.getCreateTime());
}
if(accountVo.getCreateTime_arr() != null) {
if (accountVo.getCreateTime_arr() != null) {
criteria.andCreateTimeIn(accountVo.getCreateTime_arr());
}
if(accountVo.getCreateTime_gt() != null) {
if (accountVo.getCreateTime_gt() != null) {
criteria.andCreateTimeGreaterThan(accountVo.getCreateTime_gt());
}
if(accountVo.getCreateTime_lt() != null) {
if (accountVo.getCreateTime_lt() != null) {
criteria.andCreateTimeLessThan(accountVo.getCreateTime_lt());
}
if(accountVo.getCreateTime_gte() != null) {
if (accountVo.getCreateTime_gte() != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(accountVo.getCreateTime_gte());
}
if(accountVo.getCreateTime_lte() != null) {
if (accountVo.getCreateTime_lte() != null) {
criteria.andCreateTimeLessThanOrEqualTo(accountVo.getCreateTime_lte());
}
if(accountVo.getCreateUser() != null) {
if (accountVo.getCreateUser() != null) {
criteria.andCreateUserEqualTo(accountVo.getCreateUser());
}
if(accountVo.getCreateUser_null() != null) {
if(accountVo.getCreateUser_null().booleanValue()) {
if (accountVo.getCreateUser_null() != null) {
if (accountVo.getCreateUser_null().booleanValue()) {
criteria.andCreateUserIsNull();
} else {
criteria.andCreateUserIsNotNull();
}
}
if(accountVo.getCreateUser_arr() != null) {
if (accountVo.getCreateUser_arr() != null) {
criteria.andCreateUserIn(accountVo.getCreateUser_arr());
}
if(accountVo.getCreateUser_gt() != null) {
if (accountVo.getCreateUser_gt() != null) {
criteria.andCreateUserGreaterThan(accountVo.getCreateUser_gt());
}
if(accountVo.getCreateUser_lt() != null) {
if (accountVo.getCreateUser_lt() != null) {
criteria.andCreateUserLessThan(accountVo.getCreateUser_lt());
}
if(accountVo.getCreateUser_gte() != null) {
if (accountVo.getCreateUser_gte() != null) {
criteria.andCreateUserGreaterThanOrEqualTo(accountVo.getCreateUser_gte());
}
if(accountVo.getCreateUser_lte() != null) {
if (accountVo.getCreateUser_lte() != null) {
criteria.andCreateUserLessThanOrEqualTo(accountVo.getCreateUser_lte());
}
if(accountVo.getName() != null) {
if (accountVo.getName() != null) {
criteria.andNameEqualTo(accountVo.getName());
}
if(accountVo.getName_arr() != null) {
if (accountVo.getName_arr() != null) {
criteria.andNameIn(accountVo.getName_arr());
}
if(accountVo.getName_like() != null) {
if (accountVo.getName_like() != null) {
criteria.andNameLike(accountVo.getName_like());
}
if(accountVo.getManagerId() != null) {
if (accountVo.getManagerId() != null) {
criteria.andManagerIdEqualTo(accountVo.getManagerId());
}
if(accountVo.getManagerId_null() != null) {
if(accountVo.getManagerId_null().booleanValue()) {
if (accountVo.getManagerId_null() != null) {
if (accountVo.getManagerId_null().booleanValue()) {
criteria.andManagerIdIsNull();
} else {
criteria.andManagerIdIsNotNull();
}
}
if(accountVo.getManagerId_arr() != null) {
if (accountVo.getManagerId_arr() != null) {
criteria.andManagerIdIn(accountVo.getManagerId_arr());
}
if(accountVo.getManagerId_gt() != null) {
if (accountVo.getManagerId_gt() != null) {
criteria.andManagerIdGreaterThan(accountVo.getManagerId_gt());
}
if(accountVo.getManagerId_lt() != null) {
if (accountVo.getManagerId_lt() != null) {
criteria.andManagerIdLessThan(accountVo.getManagerId_lt());
}
if(accountVo.getManagerId_gte() != null) {
if (accountVo.getManagerId_gte() != null) {
criteria.andManagerIdGreaterThanOrEqualTo(accountVo.getManagerId_gte());
}
if(accountVo.getManagerId_lte() != null) {
if (accountVo.getManagerId_lte() != null) {
criteria.andManagerIdLessThanOrEqualTo(accountVo.getManagerId_lte());
}
if(accountVo.getDescription() != null) {
if (accountVo.getDescription() != null) {
criteria.andDescriptionEqualTo(accountVo.getDescription());
}
if(accountVo.getDescription_null() != null) {
if(accountVo.getDescription_null().booleanValue()) {
if (accountVo.getDescription_null() != null) {
if (accountVo.getDescription_null().booleanValue()) {
criteria.andDescriptionIsNull();
} else {
criteria.andDescriptionIsNotNull();
}
}
if(accountVo.getDescription_arr() != null) {
if (accountVo.getDescription_arr() != null) {
criteria.andDescriptionIn(accountVo.getDescription_arr());
}
if(accountVo.getDescription_like() != null) {
if (accountVo.getDescription_like() != null) {
criteria.andDescriptionLike(accountVo.getDescription_like());
}
if (accountVo.getStatus() != null) {
criteria.andStatusEqualTo(accountVo.getStatus());
}
if (accountVo.getStatus_arr() != null) {
criteria.andStatusIn(accountVo.getStatus_arr());
}
if (accountVo.getStatus_gt() != null) {
criteria.andStatusGreaterThan(accountVo.getStatus_gt());
}
if (accountVo.getStatus_lt() != null) {
criteria.andStatusLessThan(accountVo.getStatus_lt());
}
if (accountVo.getStatus_gte() != null) {
criteria.andStatusGreaterThanOrEqualTo(accountVo.getStatus_gte());
}
if (accountVo.getStatus_lte() != null) {
criteria.andStatusLessThanOrEqualTo(accountVo.getStatus_lte());
}
return accountExample;
}
......
......@@ -106,6 +106,24 @@ public abstract class SubTaskBaseController extends BaseController<SubTask, SubT
if (subTaskVo.getPicId_lte() != null) {
criteria.andPicIdLessThanOrEqualTo(subTaskVo.getPicId_lte());
}
if (subTaskVo.getPackId() != null) {
criteria.andPackIdEqualTo(subTaskVo.getPackId());
}
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());
}
if (subTaskVo.getTaskId() != null) {
criteria.andTaskIdEqualTo(subTaskVo.getTaskId());
}
......@@ -294,6 +312,31 @@ public abstract class SubTaskBaseController extends BaseController<SubTask, SubT
if (subTaskVo.getStatus_lte() != null) {
criteria.andStatusLessThanOrEqualTo(subTaskVo.getStatus_lte());
}
if (subTaskVo.getDirection() != null) {
criteria.andDirectionEqualTo(subTaskVo.getDirection());
}
if (subTaskVo.getDirection_null() != null) {
if (subTaskVo.getDirection_null().booleanValue()) {
criteria.andDirectionIsNull();
} else {
criteria.andDirectionIsNotNull();
}
}
if (subTaskVo.getDirection_arr() != null) {
criteria.andDirectionIn(subTaskVo.getDirection_arr());
}
if (subTaskVo.getDirection_gt() != null) {
criteria.andDirectionGreaterThan(subTaskVo.getDirection_gt());
}
if (subTaskVo.getDirection_lt() != null) {
criteria.andDirectionLessThan(subTaskVo.getDirection_lt());
}
if (subTaskVo.getDirection_gte() != null) {
criteria.andDirectionGreaterThanOrEqualTo(subTaskVo.getDirection_gte());
}
if (subTaskVo.getDirection_lte() != null) {
criteria.andDirectionLessThanOrEqualTo(subTaskVo.getDirection_lte());
}
if (subTaskVo.getPersonUnid() != null) {
criteria.andPersonUnidEqualTo(subTaskVo.getPersonUnid());
}
......@@ -310,31 +353,6 @@ public abstract class SubTaskBaseController extends BaseController<SubTask, SubT
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;
}
......
package com.viontech.label.platform.controller.web;
import com.github.pagehelper.PageInfo;
import com.viontech.keliu.util.JsonMessageUtil;
import com.viontech.label.platform.base.BaseExample;
import com.viontech.label.platform.controller.base.PackBaseController;
......@@ -10,15 +11,14 @@ import com.viontech.label.platform.model.entity.PackInfo;
import com.viontech.label.platform.service.adapter.UserService;
import com.viontech.label.platform.vo.PackVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import static com.viontech.keliu.util.JsonMessageUtil.getSuccessJsonMsg;
@Controller
@RequestMapping("/packs")
public class PackController extends PackBaseController {
......@@ -34,7 +34,8 @@ public class PackController extends PackBaseController {
packExample.createTaskColumns();
User currentUser = userService.getCurrentUser();
if (!currentUser.getType().equals(0)) {
// 类型为管理员和内部质检员 可以查看所有的 pack
if (!currentUser.getType().equals(0) && !currentUser.getType().equals(2)) {
packExample.andTaskCriteria().andAccountIdEqualTo(currentUser.getAccountId());
}
......@@ -48,6 +49,30 @@ public class PackController extends PackBaseController {
return JsonMessageUtil.getSuccessJsonMsg(info);
}
@Override
@RequestMapping(value = "", method = RequestMethod.GET)
@ResponseBody
public Object page(PackVo packVo, @RequestParam(value = "page", defaultValue = "-1") int page, @RequestParam(value = "pageSize", defaultValue = "100") int pageSize, String sortName, String sortOrder) {
PackExample baseExample = (PackExample) getExample(packVo, EXAMPLE_TYPE_PAGE);
if (packVo.getAccountId() != null) {
baseExample.andTaskCriteria().andAccountIdEqualTo(packVo.getAccountId());
}
if (isNotNull(sortOrder) && isNotNull(sortName)) {
baseExample.setOrderByClause(baseExample.getTableAlias() + "." + sortName + " " + sortOrder);
} else if (isNotNull(sortName) && !isNotNull(sortOrder)) {
baseExample.setOrderByClause(sortName);
}
if (page <= 0) {
List result = getService().selectByExample(baseExample);
return getSuccessJsonMsg(MESSAGE_SELECT_SUCCESS, result);
} else {
PageInfo pageInfo = getService().pagedQuery(baseExample, page, pageSize);
return getSuccessJsonMsg(MESSAGE_PAGE_SUCCESS, pageInfo);
}
}
@GetMapping("/assignTo")
@ResponseBody
public JsonMessageUtil.JsonMessage assignTo(@RequestParam Long[] packIds, @RequestParam(required = false) Long taskId) {
......
......@@ -11,10 +11,12 @@ import com.viontech.label.platform.mapper.LogMapper;
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.model.User;
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;
import com.viontech.label.platform.vo.SubTaskVo;
import org.apache.commons.io.FileUtils;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
......@@ -55,21 +57,27 @@ public class ReidController {
*/
@GetMapping("/getPeople")
public Object getPeople(@RequestParam Long packId, @RequestParam(required = false) Integer status
, @RequestParam(required = false) Long page, @RequestParam(required = false) Long size
, @RequestParam(required = false) Long page, @RequestParam(required = false) Long size, @RequestParam(required = false) Long annotatorId
, @RequestParam(defaultValue = "1") Integer countGTE, @RequestParam(defaultValue = "10000") Integer countLTE) {
SubTaskMapper mapper = (SubTaskMapper) subTaskService.getMapper();
List<SubTask> people = mapper.getPeople(packId, status, page == null ? null : (page - 1) * size, size, countGTE, countLTE);
List<SubTaskVo> people = mapper.getPeople(packId, status, page == null ? null : (page - 1) * size, size, annotatorId, countGTE, countLTE);
LinkedHashMap<String, List<SubTask>> temp = new LinkedHashMap<>();
for (SubTask item : people) {
List<SubTask> list = temp.computeIfAbsent(item.getPersonUnid(), x -> new LinkedList<>());
LinkedHashMap<String, List<SubTaskVo>> temp = new LinkedHashMap<>();
Map<String, User> labelingMap = reidService.getRedissonClient().<String, User>getMap("labeling:" + packId).readAllMap();
for (SubTaskVo item : people) {
String personUnid = item.getPersonUnid();
List<SubTaskVo> list = temp.computeIfAbsent(personUnid, x -> new LinkedList<>());
list.add(item);
if (labelingMap.containsKey(personUnid)) {
item.setLabelUserName(labelingMap.get(personUnid).getName());
}
}
if (page != null) {
PageInfo<Object> pageInfo = new PageInfo<>(new ArrayList<>(temp.entrySet()), page.intValue());
pageInfo.setTotal(mapper.countPeople(packId, status, countGTE, countLTE));
pageInfo.setTotal(mapper.countPeople(packId, status, annotatorId, countGTE, countLTE));
return JsonMessageUtil.getSuccessJsonMsg(pageInfo);
} else {
return JsonMessageUtil.getSuccessJsonMsg(temp);
......
......@@ -3,6 +3,7 @@ package com.viontech.label.platform.mapper;
import com.viontech.label.platform.base.BaseMapper;
import com.viontech.label.platform.model.SubTask;
import com.viontech.label.platform.model.SubTaskExample;
import com.viontech.label.platform.vo.SubTaskVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
......@@ -54,31 +55,37 @@ public interface SubTaskMapper extends BaseMapper {
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 d_sub_task.id,d_sub_task.unid,d_sub_task.create_time as createTime,pack_id as packId," +
"pic_id as picId,task_id as taskId,person_unid as personUnid,d_sub_task.status,s_user.name as labelUserName " +
"from d_sub_task left join s_user on annotator_id=s_user.id 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> " +
" <if test = 'status == null'> and status != -1</if> " +
" <if test = 'annotatorId != null'> and annotator_id = #{annotatorId}</if> " +
"group by person_unid " +
" having count(*) between #{countGTE} and #{countLTE} " +
" 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, Integer countGTE, Integer countLTE);
List<SubTaskVo> getPeople(Long packId, Integer status, Long offset, Long limit, Long annotatorId, Integer countGTE, Integer countLTE);
@Select("<script>" +
"select count(*) from " +
"(select person_unid from d_sub_task where pack_id=#{packId}" +
" <if test = 'status != null'> and status=#{status}</if> " +
" <if test = 'status == null'> and status != -1</if> " +
" <if test = 'annotatorId != null'> and annotator_id = #{annotatorId}</if> " +
" group by person_unid " +
" having count(*) between #{countGTE} and #{countLTE} " +
") as t " +
"</script>")
int countPeople(Long packId, Integer status, Integer countGTE, Integer countLTE);
int countPeople(Long packId, Integer status, Long annotatorId, Integer countGTE, Integer countLTE);
@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 d_sub_task.id,d_sub_task.unid,d_sub_task.create_time as createTime,pack_id as packId," +
"pic_id as picId,task_id as taskId,person_unid as personUnid,d_sub_task.status,s_user.name as labelUserName " +
"from d_sub_task left join s_user on annotator_id=s_user.id 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>" +
" <if test = 'status == null'> and status != -1</if> " +
......
......@@ -9,6 +9,7 @@
<result column="account_name" property="name" />
<result column="account_manager_id" property="managerId" />
<result column="account_description" property="description" />
<result column="account_status" property="status" />
</resultMap>
<resultMap id="BaseResultMap" type="com.viontech.label.platform.model.Account" extends="BaseResultMapRoot" />
<sql id="Example_Where_Clause" >
......@@ -72,7 +73,8 @@
<sql id="Base_Column_List_Root" >
"account".id as account_id, "account".unid as account_unid, "account".create_time as account_create_time,
"account".create_user as account_create_user, "account"."name" as "account_name",
"account".manager_id as account_manager_id, "account".description as account_description
"account".manager_id as account_manager_id, "account".description as account_description,
"account"."status" as "account_status"
</sql>
<sql id="Base_Column_List" >
<if test="!(_parameter.getClass().getSimpleName() == 'AccountExample')" >
......@@ -128,11 +130,11 @@
</delete>
<insert id="insert" parameterType="com.viontech.label.platform.model.Account" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
insert into "s_account" (unid, create_time, create_user,
"name", manager_id, description
)
"name", manager_id, description,
"status")
values (#{unid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createUser,jdbcType=BIGINT},
#{name,jdbcType=VARCHAR}, #{managerId,jdbcType=BIGINT}, #{description,jdbcType=VARCHAR}
)
#{name,jdbcType=VARCHAR}, #{managerId,jdbcType=BIGINT}, #{description,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.viontech.label.platform.model.Account" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
insert into "s_account"
......@@ -155,6 +157,9 @@
<if test="description != null" >
description,
</if>
<if test="status != null" >
"status",
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="unid != null" >
......@@ -175,6 +180,9 @@
<if test="description != null" >
#{description,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.viontech.label.platform.model.AccountExample" resultType="java.lang.Integer" >
......@@ -207,6 +215,9 @@
<if test="record.description != null" >
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.status != null" >
"status" = #{record.status,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
......@@ -220,7 +231,8 @@
create_user = #{record.createUser,jdbcType=BIGINT},
"name" = #{record.name,jdbcType=VARCHAR},
manager_id = #{record.managerId,jdbcType=BIGINT},
description = #{record.description,jdbcType=VARCHAR}
description = #{record.description,jdbcType=VARCHAR},
"status" = #{record.status,jdbcType=INTEGER}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -246,6 +258,9 @@
<if test="description != null" >
description = #{description,jdbcType=VARCHAR},
</if>
<if test="status != null" >
"status" = #{status,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......@@ -256,7 +271,8 @@
create_user = #{createUser,jdbcType=BIGINT},
"name" = #{name,jdbcType=VARCHAR},
manager_id = #{managerId,jdbcType=BIGINT},
description = #{description,jdbcType=VARCHAR}
description = #{description,jdbcType=VARCHAR},
"status" = #{status,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
......@@ -7,6 +7,7 @@
<result column="subTask_create_time" property="createTime" />
<result column="subTask_create_user" property="createUser" />
<result column="subTask_pic_id" property="picId" />
<result column="subTask_pack_id" property="packId" />
<result column="subTask_task_id" property="taskId" />
<result column="subTask_in_inspector_id" property="inInspectorId" />
<result column="subTask_out_inspector_id" property="outInspectorId" />
......@@ -16,8 +17,8 @@
<result column="subTask_in_status" property="inStatus" />
<result column="subTask_out_status" property="outStatus" />
<result column="subTask_status" property="status" />
<result column="subTask_direction" property="direction" />
<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" />
......@@ -116,12 +117,12 @@
<sql id="Base_Column_List_Root" >
"subTask".id as subTask_id, "subTask".unid as subTask_unid, "subTask".create_time as subTask_create_time,
"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".pack_id as subTask_pack_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".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
"subTask"."status" as "subTask_status", "subTask".direction as subTask_direction,
"subTask".person_unid as subTask_person_unid
</sql>
<sql id="Base_Column_List" >
<if test="!(_parameter.getClass().getSimpleName() == 'SubTaskExample')" >
......@@ -194,17 +195,17 @@
</delete>
<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, annotate_time,
label_result, in_status, out_status,
"status", person_unid, pack_id
)
pic_id, pack_id, task_id,
in_inspector_id, out_inspector_id, annotator_id,
annotate_time, label_result, in_status,
out_status, "status", direction,
person_unid)
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}, #{annotateTime,jdbcType=TIMESTAMP},
#{labelResult,jdbcType=VARCHAR}, #{inStatus,jdbcType=INTEGER}, #{outStatus,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{personUnid,jdbcType=VARCHAR}, #{packId,jdbcType=BIGINT}
)
#{picId,jdbcType=BIGINT}, #{packId,jdbcType=BIGINT}, #{taskId,jdbcType=BIGINT},
#{inInspectorId,jdbcType=BIGINT}, #{outInspectorId,jdbcType=BIGINT}, #{annotatorId,jdbcType=BIGINT},
#{annotateTime,jdbcType=TIMESTAMP}, #{labelResult,jdbcType=VARCHAR}, #{inStatus,jdbcType=INTEGER},
#{outStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{direction,jdbcType=INTEGER},
#{personUnid,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.viontech.label.platform.model.SubTask" useGeneratedKeys="true" keyProperty="id" keyColumn="id" >
insert into "d_sub_task"
......@@ -221,6 +222,9 @@
<if test="picId != null" >
pic_id,
</if>
<if test="packId != null" >
pack_id,
</if>
<if test="taskId != null" >
task_id,
</if>
......@@ -248,12 +252,12 @@
<if test="status != null" >
"status",
</if>
<if test="direction != null" >
direction,
</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" >
......@@ -268,6 +272,9 @@
<if test="picId != null" >
#{picId,jdbcType=BIGINT},
</if>
<if test="packId != null" >
#{packId,jdbcType=BIGINT},
</if>
<if test="taskId != null" >
#{taskId,jdbcType=BIGINT},
</if>
......@@ -295,12 +302,12 @@
<if test="status != null" >
#{status,jdbcType=INTEGER},
</if>
<if test="direction != null" >
#{direction,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" >
......@@ -328,6 +335,9 @@
<if test="record.picId != null" >
pic_id = #{record.picId,jdbcType=BIGINT},
</if>
<if test="record.packId != null" >
pack_id = #{record.packId,jdbcType=BIGINT},
</if>
<if test="record.taskId != null" >
task_id = #{record.taskId,jdbcType=BIGINT},
</if>
......@@ -355,12 +365,12 @@
<if test="record.status != null" >
"status" = #{record.status,jdbcType=INTEGER},
</if>
<if test="record.direction != null" >
direction = #{record.direction,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" />
......@@ -373,6 +383,7 @@
create_time = #{record.createTime,jdbcType=TIMESTAMP},
create_user = #{record.createUser,jdbcType=BIGINT},
pic_id = #{record.picId,jdbcType=BIGINT},
pack_id = #{record.packId,jdbcType=BIGINT},
task_id = #{record.taskId,jdbcType=BIGINT},
in_inspector_id = #{record.inInspectorId,jdbcType=BIGINT},
out_inspector_id = #{record.outInspectorId,jdbcType=BIGINT},
......@@ -382,8 +393,8 @@
in_status = #{record.inStatus,jdbcType=INTEGER},
out_status = #{record.outStatus,jdbcType=INTEGER},
"status" = #{record.status,jdbcType=INTEGER},
person_unid = #{record.personUnid,jdbcType=VARCHAR},
pack_id = #{record.packId,jdbcType=BIGINT}
direction = #{record.direction,jdbcType=INTEGER},
person_unid = #{record.personUnid,jdbcType=VARCHAR}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -403,6 +414,9 @@
<if test="picId != null" >
pic_id = #{picId,jdbcType=BIGINT},
</if>
<if test="packId != null" >
pack_id = #{packId,jdbcType=BIGINT},
</if>
<if test="taskId != null" >
task_id = #{taskId,jdbcType=BIGINT},
</if>
......@@ -430,12 +444,12 @@
<if test="status != null" >
"status" = #{status,jdbcType=INTEGER},
</if>
<if test="direction != null" >
direction = #{direction,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>
......@@ -445,6 +459,7 @@
create_time = #{createTime,jdbcType=TIMESTAMP},
create_user = #{createUser,jdbcType=BIGINT},
pic_id = #{picId,jdbcType=BIGINT},
pack_id = #{packId,jdbcType=BIGINT},
task_id = #{taskId,jdbcType=BIGINT},
in_inspector_id = #{inInspectorId,jdbcType=BIGINT},
out_inspector_id = #{outInspectorId,jdbcType=BIGINT},
......@@ -454,8 +469,8 @@
in_status = #{inStatus,jdbcType=INTEGER},
out_status = #{outStatus,jdbcType=INTEGER},
"status" = #{status,jdbcType=INTEGER},
person_unid = #{personUnid,jdbcType=VARCHAR},
pack_id = #{packId,jdbcType=BIGINT}
direction = #{direction,jdbcType=INTEGER},
person_unid = #{personUnid,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ 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 Account extends BaseModel {
......@@ -19,6 +18,8 @@ public class Account extends BaseModel {
private String description;
private Integer status;
public Long getId() {
return id;
}
......@@ -74,4 +75,12 @@ public class Account extends BaseModel {
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
\ 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 AccountExample extends BaseExample {
......@@ -536,6 +538,66 @@ public class AccountExample extends BaseExample {
addCriterion("\"account\".description not between", value1, value2, "description");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("\"account\".\"status\" is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("\"account\".\"status\" is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("\"account\".\"status\" =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("\"account\".\"status\" <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("\"account\".\"status\" >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("\"account\".\"status\" >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("\"account\".\"status\" <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("\"account\".\"status\" <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("\"account\".\"status\" in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("\"account\".\"status\" not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("\"account\".\"status\" between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("\"account\".\"status\" not between", value1, value2, "status");
return (Criteria) this;
}
}
public static class ColumnContainer extends ColumnContainerBase {
......@@ -578,5 +640,10 @@ public class AccountExample extends BaseExample {
addColumnStr("\"account\".description as account_description ");
return (ColumnContainer) this;
}
public ColumnContainer hasStatusColumn() {
addColumnStr("\"account\".\"status\" as \"account_status\" ");
return (ColumnContainer) this;
}
}
}
\ No newline at end of file
......@@ -14,6 +14,8 @@ public class SubTask extends BaseModel {
private Long picId;
private Long packId;
private Long taskId;
private Long inInspectorId;
......@@ -32,9 +34,9 @@ public class SubTask extends BaseModel {
private Integer status;
private String personUnid;
private Integer direction;
private Long packId;
private String personUnid;
private Pic pic;
......@@ -80,6 +82,14 @@ public class SubTask extends BaseModel {
this.picId = picId;
}
public Long getPackId() {
return packId;
}
public void setPackId(Long packId) {
this.packId = packId;
}
public Long getTaskId() {
return taskId;
}
......@@ -152,20 +162,20 @@ public class SubTask extends BaseModel {
this.status = status;
}
public String getPersonUnid() {
return personUnid;
public Integer getDirection() {
return direction;
}
public void setPersonUnid(String personUnid) {
this.personUnid = personUnid == null ? null : personUnid.trim();
public void setDirection(Integer direction) {
this.direction = direction;
}
public Long getPackId() {
return packId;
public String getPersonUnid() {
return personUnid;
}
public void setPackId(Long packId) {
this.packId = packId;
public void setPersonUnid(String personUnid) {
this.personUnid = personUnid == null ? null : personUnid.trim();
}
public Pic getPic() {
......
......@@ -106,6 +106,7 @@ public class ReidService {
subTask.setCreateTime(data.getCountTime());
subTask.setTaskId(taskId == null ? data.getTaskId() : taskId);
subTask.setStatus(SubTaskStatus.TO_BE_LABELED.val);
subTask.setDirection(data.getDirection());
subTaskService.insertSelective(subTask);
......@@ -864,4 +865,8 @@ public class ReidService {
this.userService = userService;
return this;
}
public RedissonClient getRedissonClient() {
return redissonClient;
}
}
......@@ -23,5 +23,6 @@ public class ReidUploadData {
private String personUnid;
private Date countTime;
private Long taskId;
private Integer direction;
}
......@@ -6,6 +6,7 @@ import com.viontech.label.platform.vobase.SubTaskVoBase;
public class SubTaskVo extends SubTaskVoBase {
private boolean group;
private String labelUserName;
public SubTaskVo() {
super();
......@@ -23,4 +24,13 @@ public class SubTaskVo extends SubTaskVoBase {
this.group = group;
return this;
}
public String getLabelUserName() {
return labelUserName;
}
public SubTaskVo setLabelUserName(String labelUserName) {
this.labelUserName = labelUserName;
return this;
}
}
\ No newline at end of file
......@@ -97,12 +97,27 @@ public class AccountVoBase extends Account implements VoInterface<Account> {
@JsonIgnore
private String description_like;
@JsonIgnore
private ArrayList<Integer> status_arr;
@JsonIgnore
private Integer status_gt;
@JsonIgnore
private Integer status_lt;
@JsonIgnore
private Integer status_gte;
@JsonIgnore
private Integer status_lte;
public AccountVoBase() {
this(null);
}
public AccountVoBase(Account account) {
if(account == null) {
if (account == null) {
account = new Account();
}
this.account = account;
......@@ -158,14 +173,14 @@ public class AccountVoBase extends Account implements VoInterface<Account> {
}
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);
......@@ -188,14 +203,14 @@ public class AccountVoBase extends Account implements VoInterface<Account> {
}
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);
......@@ -242,14 +257,14 @@ public class AccountVoBase extends Account implements VoInterface<Account> {
}
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);
......@@ -304,14 +319,14 @@ public class AccountVoBase extends Account implements VoInterface<Account> {
}
public Long getCreateUser() {
if(getModel() == null ){
if (getModel() == null) {
throw new RuntimeException("model is null");
}
return this.getModel().getCreateUser();
}
public void setCreateUser(Long createUser) {
if(getModel() == null ){
if (getModel() == null) {
throw new RuntimeException("model is null");
}
this.getModel().setCreateUser(createUser);
......@@ -334,14 +349,14 @@ public class AccountVoBase extends Account implements VoInterface<Account> {
}
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);
......@@ -396,14 +411,14 @@ public class AccountVoBase extends Account implements VoInterface<Account> {
}
public Long getManagerId() {
if(getModel() == null ){
if (getModel() == null) {
throw new RuntimeException("model is null");
}
return this.getModel().getManagerId();
}
public void setManagerId(Long managerId) {
if(getModel() == null ){
if (getModel() == null) {
throw new RuntimeException("model is null");
}
this.getModel().setManagerId(managerId);
......@@ -434,16 +449,70 @@ public class AccountVoBase extends Account implements VoInterface<Account> {
}
public String getDescription() {
if(getModel() == null ){
if (getModel() == null) {
throw new RuntimeException("model is null");
}
return this.getModel().getDescription();
}
public void setDescription(String description) {
if(getModel() == null ){
if (getModel() == null) {
throw new RuntimeException("model is null");
}
this.getModel().setDescription(description);
}
public ArrayList<Integer> getStatus_arr() {
return status_arr;
}
public void setStatus_arr(ArrayList<Integer> status_arr) {
this.status_arr = status_arr;
}
public Integer getStatus_gt() {
return status_gt;
}
public void setStatus_gt(Integer status_gt) {
this.status_gt = status_gt;
}
public Integer getStatus_lt() {
return status_lt;
}
public void setStatus_lt(Integer status_lt) {
this.status_lt = status_lt;
}
public Integer getStatus_gte() {
return status_gte;
}
public void setStatus_gte(Integer status_gte) {
this.status_gte = status_gte;
}
public Integer getStatus_lte() {
return status_lte;
}
public void setStatus_lte(Integer status_lte) {
this.status_lte = status_lte;
}
public Integer getStatus() {
if (getModel() == null) {
throw new RuntimeException("model is null");
}
return this.getModel().getStatus();
}
public void setStatus(Integer status) {
if (getModel() == null) {
throw new RuntimeException("model is null");
}
this.getModel().setStatus(status);
}
}
\ No newline at end of file
......@@ -56,7 +56,7 @@ public class KeliuController {
@GetMapping("/sendData")
public Object sendData(@RequestParam Date date, @RequestParam Long mallId, @RequestParam Long packId,@RequestParam Long taskId) {
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("有数据传输任务正在进行");
......@@ -71,7 +71,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,taskId);
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:{},count:{}/{}", faceRecognition.getUnid(), body.getMsg(), count.incrementAndGet(), faceRecognitions.size());
......@@ -130,6 +130,7 @@ public class KeliuController {
map.add("packId", packId);
map.add("taskId", taskId);
map.add("countTime", DateUtil.format("yyyy-MM-dd HH:mm:ss", faceRecognition.getCounttime()));
map.add("direction", faceRecognition.getDirection());
return new HttpEntity<>(map, headers);
}
......
......@@ -24,7 +24,7 @@ public class KeliuRepository {
private JdbcTemplate jdbcTemplate;
public List<FaceRecognition> getFaceRecognitionsByDateAndMallId(Date date, Long mallId) {
return jdbcTemplate.query("select unid,person_unid,channel_serialnum,body_pic,countdate,counttime from d_face_recognition where countdate=? and mall_id=?", new BeanPropertyRowMapper<>(FaceRecognition.class), date, mallId);
return jdbcTemplate.query("select unid,person_unid,channel_serialnum,body_pic,countdate,counttime,direction from d_face_recognition where countdate=? and mall_id=?", new BeanPropertyRowMapper<>(FaceRecognition.class), date, mallId);
}
public HashMap<Long, String> getMallMap() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!