【DAOP-1.0】数据需求
【功能点】测试问题处理
Showing
3 changed files
with
61 additions
and
8 deletions
... | @@ -168,7 +168,7 @@ public class DemandRSVO { | ... | @@ -168,7 +168,7 @@ public class DemandRSVO { |
168 | * 加工单生成时间 | 168 | * 加工单生成时间 |
169 | */ | 169 | */ |
170 | @Schema(description = "加工单生成时间") | 170 | @Schema(description = "加工单生成时间") |
171 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | 171 | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
172 | private Date processingGenerateTime; | 172 | private Date processingGenerateTime; |
173 | 173 | ||
174 | /** | 174 | /** | ... | ... |
1 | package com.csbr.qingcloud.portal.service.impl; | 1 | package com.csbr.qingcloud.portal.service.impl; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | ||
4 | import com.alibaba.fastjson.JSONArray; | ||
5 | import com.alibaba.fastjson.JSONObject; | ||
6 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
7 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | 4 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
8 | import com.csbr.cloud.common.enums.SystemError; | 5 | import com.csbr.cloud.common.enums.SystemError; |
... | @@ -13,6 +10,7 @@ import com.csbr.qingcloud.portal.domain.vo.*; | ... | @@ -13,6 +10,7 @@ import com.csbr.qingcloud.portal.domain.vo.*; |
13 | import com.csbr.qingcloud.portal.feign.ConfigureFeign; | 10 | import com.csbr.qingcloud.portal.feign.ConfigureFeign; |
14 | import com.csbr.qingcloud.portal.feign.DataProcessBasicFeign; | 11 | import com.csbr.qingcloud.portal.feign.DataProcessBasicFeign; |
15 | import com.csbr.qingcloud.portal.feign.PersonelFeign; | 12 | import com.csbr.qingcloud.portal.feign.PersonelFeign; |
13 | import com.csbr.qingcloud.portal.util.DateUtil; | ||
16 | import csbr.cloud.entity.domain.user.UserInfo; | 14 | import csbr.cloud.entity.domain.user.UserInfo; |
17 | import csbr.cloud.entity.enums.ApprovalStateEnum; | 15 | import csbr.cloud.entity.enums.ApprovalStateEnum; |
18 | import com.csbr.cloud.common.exception.CsbrSystemException; | 16 | import com.csbr.cloud.common.exception.CsbrSystemException; |
... | @@ -36,7 +34,6 @@ import org.apache.commons.lang3.StringUtils; | ... | @@ -36,7 +34,6 @@ import org.apache.commons.lang3.StringUtils; |
36 | import org.springframework.stereotype.Service; | 34 | import org.springframework.stereotype.Service; |
37 | import io.seata.spring.annotation.GlobalTransactional; | 35 | import io.seata.spring.annotation.GlobalTransactional; |
38 | import org.springframework.transaction.annotation.Transactional; | 36 | import org.springframework.transaction.annotation.Transactional; |
39 | |||
40 | import java.util.*; | 37 | import java.util.*; |
41 | import java.util.stream.Collectors; | 38 | import java.util.stream.Collectors; |
42 | 39 | ||
... | @@ -136,8 +133,13 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -136,8 +133,13 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
136 | if(CollectionUtils.isEmpty(guids)){ | 133 | if(CollectionUtils.isEmpty(guids)){ |
137 | return null; | 134 | return null; |
138 | } | 135 | } |
139 | Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(guids).getData(); | 136 | try{ |
140 | return map; | 137 | Map<String, DemandUpdateStateVO> map = dataProcessBasicFeign.getOrderState(guids).getData(); |
138 | return map; | ||
139 | }catch (Exception e){ | ||
140 | e.printStackTrace(); | ||
141 | return null; | ||
142 | } | ||
141 | } | 143 | } |
142 | 144 | ||
143 | /** | 145 | /** |
... | @@ -595,12 +597,15 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService | ... | @@ -595,12 +597,15 @@ public class DemandServiceImpl extends FlowAbstractImpl implements DemandService |
595 | vo.setProductProcessingState(voState.getProductProcessingState()); | 597 | vo.setProductProcessingState(voState.getProductProcessingState()); |
596 | vo.setProductDeliveryState(voState.getProductDeliveryState()); | 598 | vo.setProductDeliveryState(voState.getProductDeliveryState()); |
597 | vo.setProductAcceptState(voState.getProductAcceptState()); | 599 | vo.setProductAcceptState(voState.getProductAcceptState()); |
598 | vo.setAcceptFinishTime(voState.getAcceptFinishTime()); | 600 | vo.setAcceptFinishTime(DateUtil.getShortDate(voState.getAcceptFinishTime())); |
601 | vo.setFinishCycle(DateUtil.getDiffDay(voState.getAcceptFinishTime(),entity.getProcessingGenerateTime())); | ||
599 | } | 602 | } |
600 | } | 603 | } |
601 | return vo; | 604 | return vo; |
602 | } | 605 | } |
603 | 606 | ||
607 | |||
608 | |||
604 | /** | 609 | /** |
605 | * 数据需求新增、修改和其他情况的参数转换为实体 | 610 | * 数据需求新增、修改和其他情况的参数转换为实体 |
606 | * @author xcq | 611 | * @author xcq | ... | ... |
1 | package com.csbr.qingcloud.portal.util; | ||
2 | |||
3 | import java.text.SimpleDateFormat; | ||
4 | import java.util.Date; | ||
5 | |||
6 | public class DateUtil { | ||
7 | |||
8 | /** 时间相差多少天 无视小时 */ | ||
9 | public static int getDiffDay(Date one, Date two) { | ||
10 | if(one == null || two == null){ | ||
11 | return 0; | ||
12 | } | ||
13 | one = getDateByString(getShortDateToString(one)); | ||
14 | two = getDateByString(getShortDateToString(two)); | ||
15 | long difference = (one.getTime() - two.getTime()) / 86400000; | ||
16 | return (int) Math.abs(difference); | ||
17 | } | ||
18 | |||
19 | /** 字符串时间转日期 */ | ||
20 | public static Date getDateByString(String time){ | ||
21 | try { | ||
22 | return new SimpleDateFormat("yyyy-MM-dd").parse(time); | ||
23 | } catch (Exception e) { | ||
24 | return new Date(); | ||
25 | } | ||
26 | } | ||
27 | |||
28 | /** 时间转字符串 */ | ||
29 | public static String getShortDateToString(Date time){ | ||
30 | if(time == null) { | ||
31 | return ""; | ||
32 | } | ||
33 | return new SimpleDateFormat("yyyy-MM-dd").format(time); | ||
34 | } | ||
35 | |||
36 | /** 字符串时间转日期 */ | ||
37 | public static Date getShortDate(Date time){ | ||
38 | if(time == null) { | ||
39 | return null; | ||
40 | } | ||
41 | try { | ||
42 | return new SimpleDateFormat("yyyy-MM-dd").parse(getShortDateToString(time)); | ||
43 | } catch (Exception e) { | ||
44 | return new Date(); | ||
45 | } | ||
46 | } | ||
47 | |||
48 | } |
-
Please register or sign in to post a comment