Commit fcc76798 by chamberone

feat: 修改运行逻辑

2 parents 3f1796c1 d3159ef8
...@@ -84,8 +84,7 @@ public class BatchScheduler { ...@@ -84,8 +84,7 @@ public class BatchScheduler {
DispatchSolutionUtils.removeHardConstraintCustomer(solution, solverFactory); DispatchSolutionUtils.removeHardConstraintCustomer(solution, solverFactory);
log.info("dispatchRun solve done, teamId:{}, day:{}, batch:{}, problemId:{}, score:{}", teamId, currDay, batchNo, problemId, solution.getScore().toShortString()); log.info("dispatchRun solve done, teamId:{}, day:{}, batch:{}, problemId:{}, score:{}", teamId, currDay, batchNo, problemId, solution.getScore().toShortString());
this.solveService.saveSolutionWrp(solution); this.solveService.saveSolutionWrp(solution);
// FIXME 替换工作队 this.extractService.extractDispatchToOrder2(teamId, batchNo, false);
this.extractService.extractDispatchToOrder(groupId, batchNo, false);
log.info("dispatchRun done ------ teamId:{}, day:{}", teamId, currDay); log.info("dispatchRun done ------ teamId:{}, day:{}", teamId, currDay);
JacksonSolutionFileIO<DispatchSolution> exporter = new JacksonSolutionFileIO<DispatchSolution>(DispatchSolution.class); JacksonSolutionFileIO<DispatchSolution> exporter = new JacksonSolutionFileIO<DispatchSolution>(DispatchSolution.class);
......
...@@ -40,10 +40,12 @@ public class MsgController { ...@@ -40,10 +40,12 @@ public class MsgController {
MsgQuery request) { MsgQuery request) {
CommonUtil.setNullValue(request); CommonUtil.setNullValue(request);
request.setUserId(userId); request.setUserId(userId);
if (!"isRead".equalsIgnoreCase(request.getSort())) { if ("isRead".equalsIgnoreCase(request.getSort())) {
request.setSort("create_time");
} else {
request.setSort("is_read"); request.setSort("is_read");
} if ("type".equalsIgnoreCase(request.getSort())) {
request.setSort("type");
} else {
request.setSort("create_time");
} }
if (!"asc".equalsIgnoreCase(request.getSortType())) { if (!"asc".equalsIgnoreCase(request.getSortType())) {
request.setSortType("desc"); request.setSortType("desc");
......
...@@ -16,7 +16,7 @@ import java.util.Objects; ...@@ -16,7 +16,7 @@ import java.util.Objects;
public interface MsgDao extends JpaRepository<MsgEntity, Integer> { public interface MsgDao extends JpaRepository<MsgEntity, Integer> {
@Query(value = "select t.cluster_id,t.branch_id,t.group_id" + @Query(value = "select t.cluster_id,t.branch_id,t.group_id" +
" from (" + " from (" +
" select tt.cluster_id,tt.branch_id,tt.group_id,min(tt.create_time) create_time,min(r.is_read) is_read" + " select tt.cluster_id,tt.branch_id,tt.group_id,min(tt.create_time) create_time,min(r.is_read) is_read,min(tt.type) type" +
" from zzz_msg tt join zzz_msg_receiver r on r.msg_id=tt.id and r.user_id=:#{#req.userId}" + " from zzz_msg tt join zzz_msg_receiver r on r.msg_id=tt.id and r.user_id=:#{#req.userId}" +
" where IF(:#{#req.startDate} is not null, tt.create_time>=:#{#req.startDate}, 1=1)" + " where IF(:#{#req.startDate} is not null, tt.create_time>=:#{#req.startDate}, 1=1)" +
" and IF(:#{#req.endDate} is not null, tt.create_time<:#{#req.endDate}, 1=1)" + " and IF(:#{#req.endDate} is not null, tt.create_time<:#{#req.endDate}, 1=1)" +
...@@ -28,7 +28,7 @@ public interface MsgDao extends JpaRepository<MsgEntity, Integer> { ...@@ -28,7 +28,7 @@ public interface MsgDao extends JpaRepository<MsgEntity, Integer> {
") t", ") t",
countQuery = "select count(t.cluster_id)" + countQuery = "select count(t.cluster_id)" +
" from (" + " from (" +
" select tt.cluster_id,tt.branch_id,tt.group_id,min(tt.create_time) create_time,min(r.is_read) is_read" + " select tt.cluster_id,tt.branch_id,tt.group_id,min(tt.create_time) create_time,min(r.is_read) is_read,min(tt.type) type" +
" from zzz_msg tt join zzz_msg_receiver r on r.msg_id=tt.id and r.user_id=:#{#req.userId}" + " from zzz_msg tt join zzz_msg_receiver r on r.msg_id=tt.id and r.user_id=:#{#req.userId}" +
" where IF(:#{#req.startDate} is not null, tt.create_time>=:#{#req.startDate}, 1=1)" + " where IF(:#{#req.startDate} is not null, tt.create_time>=:#{#req.startDate}, 1=1)" +
" and IF(:#{#req.endDate} is not null, tt.create_time<:#{#req.endDate}, 1=1)" + " and IF(:#{#req.endDate} is not null, tt.create_time<:#{#req.endDate}, 1=1)" +
......
...@@ -29,7 +29,7 @@ public class MsgQuery { ...@@ -29,7 +29,7 @@ public class MsgQuery {
private String userId; private String userId;
/** /**
* 排序字段:create_time、is_read * 排序字段:createTime、isRead、type
*/ */
private String sort; private String sort;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!