From a106ddc2b1b25c8891cb0a15a775bd39b5bda2ff Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期五, 26 七月 2024 11:22:59 +0800
Subject: [PATCH] 数据库连接设置时区、工单下发返回重点点位标识、下发人、下发时间
---
ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml | 34 ++++++++++-------
ycl-server/src/main/resources/application-prod.yml | 2
ycl-pojo/src/main/java/com/ycl/platform/domain/vo/WorkOrderVO.java | 15 +++++++
ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java | 8 +++
ycl-server/src/main/resources/application-dev.yml | 6 +-
5 files changed, 46 insertions(+), 19 deletions(-)
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/WorkOrderVO.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/WorkOrderVO.java
index dda5d06..55d2059 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/WorkOrderVO.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/WorkOrderVO.java
@@ -5,6 +5,7 @@
import com.ycl.platform.domain.entity.WorkOrder;
import java.time.LocalDateTime;
+import java.util.Date;
import java.util.List;
import org.springframework.lang.NonNull;
import org.springframework.beans.BeanUtils;
@@ -41,6 +42,13 @@
*/
private Integer pointId;
+ private String pointTag;
+
+ /**
+ * 鏄惁閲嶇偣鐐逛綅
+ */
+ private Boolean important;
+
/** 鏁呴殰绫诲瀷 */
private String errorType;
@@ -64,6 +72,13 @@
/** 0鏈秴鏃� 1瓒呮椂 */
private Integer overtime;
+ /** 涓嬪彂鏃堕棿 */
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date distributeTime;
+
+ /** 涓嬪彂浜� */
+ private String realName;
+
public static WorkOrderVO getVoByEntity(@NonNull WorkOrder entity, WorkOrderVO vo) {
if(vo == null) {
vo = new WorkOrderVO();
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java
index 7e75841..8485cc6 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java
@@ -24,6 +24,7 @@
import com.ycl.utils.SecurityUtils;
import com.ycl.utils.redis.RedisCache;
import com.ycl.utils.uuid.IdUtils;
+import constant.PointConfigConstants;
import enumeration.general.*;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.ArrayUtils;
@@ -63,6 +64,7 @@
private final WorkOrderDistributeRecordMapper workOrderDistributeRecordMapper;
private final String DISTRIBUTE_LOCK_KEY = "distributeLock";
+ private final static String IMPORTANT = "important";
@Autowired
private RedisCache redisCache;
@@ -257,8 +259,12 @@
@Override
public Result distributePage(DistributeWorkOrderQuery query) {
IPage<WorkOrderVO> page = PageUtil.getPage(query, WorkOrderVO.class);
- // todo 鍏抽敭璇嶆悳绱�
baseMapper.distributePage(page, query);
+ page.getRecords().stream().forEach(workOrder -> {
+ if (StringUtils.hasText(workOrder.getPointTag()) && workOrder.getPointTag().contains(IMPORTANT)) {
+ workOrder.setImportant(Boolean.TRUE);
+ }
+ });
return Result.ok().data(page).total(page.getTotal());
}
diff --git a/ycl-server/src/main/resources/application-dev.yml b/ycl-server/src/main/resources/application-dev.yml
index ff8109b..ce14b61 100644
--- a/ycl-server/src/main/resources/application-dev.yml
+++ b/ycl-server/src/main/resources/application-dev.yml
@@ -7,7 +7,7 @@
# 鐗堟潈骞翠唤
copyrightYear: 2024
# 鏂囦欢璺緞 绀轰緥锛� Windows閰嶇疆D:/zgyw/uploadPath锛孡inux閰嶇疆 /home/zgyw/uploadPath锛�
- profile: D:/zgyw/uploadPath
+ profile: E:/ycl/zgyw/uploadPath
# 鑾峰彇ip鍦板潃寮�鍏�
addressEnabled: false
# 楠岃瘉鐮佺被鍨� math 鏁板瓧璁$畻 char 瀛楃楠岃瘉
@@ -17,7 +17,7 @@
# 寮�鍙戠幆澧冮厤缃�
server:
# 鏈嶅姟鍣ㄧ殑HTTP绔彛锛岄粯璁や负8080
- port: 8080
+ port: 8085
servlet:
# 搴旂敤鐨勮闂矾寰�
context-path: /
@@ -36,7 +36,7 @@
spring:
# 鏁版嵁婧愰厤缃�
datasource:
- url: jdbc:mysql://101.35.247.188:3306/zgyw?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
+ url: jdbc:mysql://101.35.247.188:3306/zgyw?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8
username: root
password: ycl@202466
type: com.alibaba.druid.pool.DruidDataSource
diff --git a/ycl-server/src/main/resources/application-prod.yml b/ycl-server/src/main/resources/application-prod.yml
index b28e93a..d3e3353 100644
--- a/ycl-server/src/main/resources/application-prod.yml
+++ b/ycl-server/src/main/resources/application-prod.yml
@@ -36,7 +36,7 @@
spring:
# 鏁版嵁婧愰厤缃�
datasource:
- url: jdbc:mysql://101.35.247.188:3306/zgyw?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
+ url: jdbc:mysql://101.35.247.188:3306/zgyw?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8
username: root
password: ycl@202466
type: com.alibaba.druid.pool.DruidDataSource
diff --git a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml
index 1b76a6b..1fe79c6 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml
@@ -44,21 +44,27 @@
<select id="distributePage" resultType="com.ycl.platform.domain.vo.WorkOrderVO">
SELECT
- wo.*,
- u.unit_name,
- p.yw_person_name
+ wo.*,
+ u.unit_name,
+ p.yw_person_name,
+ yp.point_tag,
+ odr.create_time as distributeTime,
+ su.nick_name as realName
FROM
- t_work_order wo
- LEFT JOIN t_yw_unit u ON wo.unit_id = u.id and u.deleted = 0
- LEFT JOIN t_yw_people p ON wo.yw_people_id = p.id and p.deleted = 0
- where
- wo.deleted = 0
- <if test="query.unitId != null">
- AND wo.unit_id = #{query.unitId}
- </if>
- <if test="query.status != null and query.status != ''">
- AND wo.status = #{query.status}
- </if>
+ t_work_order wo
+ LEFT JOIN t_yw_unit u ON wo.unit_id = u.id and u.deleted = 0
+ LEFT JOIN t_yw_people p ON wo.yw_people_id = p.id and p.deleted = 0
+ INNER JOIN t_yw_point yp ON yp.id = wo.point_id AND yp.deleted = 0
+ LEFT JOIN t_work_order_distribute_record odr ON odr.work_order_id = wo.id AND odr.deleted = 0
+ LEFT JOIN sys_user su ON su.user_id = odr.user_id
+ WHERE
+ wo.deleted = 0
+ <if test="query.unitId != null">
+ AND wo.unit_id = #{query.unitId}
+ </if>
+ <if test="query.status != null and query.status != ''">
+ AND wo.status = #{query.status}
+ </if>
ORDER BY wo.create_time DESC
</select>
--
Gitblit v1.8.0