Commit 7b0ec092 by 刘鑫

Merge branch 'develop' of https://gitlab.dituhui.com/bsh/project/project into develop

2 parents 2823b2ba b3b193bd
......@@ -3,7 +3,7 @@ server:
dispatch:
cron:
expr: 0 32 8-23 * * ?
expr: 0 25 8-23 * * ?
next-day-limit: 20
# expr: 0 */10 8-18 * * ?
......@@ -49,13 +49,13 @@ spring:
enabled: false
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://127.0.0.1:3306/saas_aftersale_test?serverTimezone=Asia/Shanghai
# username: root
# password: 123456
url: jdbc:mysql://localhost:32306/saas_aftersale_test?serverTimezone=Asia/Shanghai
username: boxi
password: boxi_dev_0725
type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://127.0.0.1:3306/saas_aftersale_test?serverTimezone=Asia/Shanghai
username: root
password: 123456
# url: jdbc:mysql://localhost:32306/saas_aftersale_test?serverTimezone=Asia/Shanghai
# username: boxi
# password: boxi_dev_0725
# type: com.alibaba.druid.pool.DruidDataSource
jpa:
show-sql: true
......
......@@ -40,17 +40,6 @@ public class MsgController {
MsgQuery request) {
CommonUtil.setNullValue(request);
request.setUserId(userId);
if ("isRead".equalsIgnoreCase(request.getSort())) {
request.setSort("is_read");
}
if ("type".equalsIgnoreCase(request.getSort())) {
request.setSort("type");
} else {
request.setSort("create_time");
}
if (!"asc".equalsIgnoreCase(request.getSortType())) {
request.setSortType("desc");
}
if (Objects.nonNull(request.getEndDate())) {
request.setEndDate(CommonUtil.addDays(request.getEndDate(), 1));
......
......@@ -129,6 +129,6 @@ public interface EngineerInfoDao extends JpaRepository<EngineerInfoEntity, Integ
"WHERE ote.team_id = :teamId AND ote.engineer_code = :engineerCode AND ote.`status` = 1", nativeQuery = true)
EngineerInfoEntity selectEngineerByEngineerCodeAndTeamId(@Param("engineerCode") String engineerCode, @Param("teamId") String teamId);
@Query(value = "SELECT DISTINCT esg.engineer_code FROM engineer_skill_group esg WHERE engineer_code in (:engineerCodes) and skill_group_code in (:skillGroupCodes)", nativeQuery = true)
@Query(value = "SELECT DISTINCT esg.engineer_code FROM engineer_skill_group esg WHERE engineer_code in (:engineerCodes) and skill_group_code in (:skillGroupCodes) and status = 1", nativeQuery = true)
List<String> findByEngineerCodesBySkillCodes(@Param("engineerCodes") List<String> engineerCodes, @Param("skillGroupCodes") Set<String> skillGroupCodes);
}
......@@ -22,10 +22,7 @@ import org.springframework.data.domain.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.stream.Collectors;
@Service
......@@ -49,7 +46,24 @@ public class MsgServiceImpl implements MsgService {
@Override
public PageResult<MsgGroupResp> list(MsgQuery request) {
Sort sort = Sort.by("asc".equalsIgnoreCase(request.getSortType()) ? Sort.Direction.ASC : Sort.Direction.DESC, request.getSort());
List<Sort.Order> orders = new ArrayList<>();
Sort.Direction direction = Sort.Direction.ASC;
if (!"asc".equalsIgnoreCase(request.getSortType())) {
direction = Sort.Direction.DESC;
}
if ("isRead".equalsIgnoreCase(request.getSort())) {
request.setSort("is_read");
} else if ("type".equalsIgnoreCase(request.getSort())) {
request.setSort("type");
} else if ("createTime".equalsIgnoreCase(request.getSort())) {
request.setSort("create_time");
} else {
request.setSort("create_time");
orders.add(new Sort.Order(Sort.Direction.ASC,
"is_read"));
}
orders.add(new Sort.Order(direction, request.getSort()));
Sort sort = Sort.by(orders);
Pageable pageable = PageRequest.of(request.getPage() - 1, request.getSize(), sort);
Page<Map<String, Objects>> page = msgDao.getGroupList(request, pageable);
List<MsgGroupResp> list = page.getContent().stream().map(msg -> {
......
......@@ -128,10 +128,10 @@ public class ScheduleServiceImpl implements ScheduleService {
List<ScheduleOverviewResp.Item> children = new ArrayList<>();
Integer teamDistance = 0;
Integer minOrderSum=null;
Integer maxOrderSum=null;
Integer minDistance=null;
Integer maxDistance=null;
Integer minOrderSum=0;
Integer maxOrderSum=0;
Integer minDistance=0;
Integer maxDistance=0;
for (Map.Entry<String, List<EngineerInfoEntity>> entry : engineers.entrySet()) {
ScheduleOverviewResp.Item child = new ScheduleOverviewResp.Item();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!