Commit 360aae57a6667f74c95639813b7177bc29197dfe
1 parent
c11ab318
fix:1.更新配置文件。
2.添加填写尾期验货结果超过生产科拖货日期,就无法填写。 3.跟单信息复制功能,针对于A06订单,设置扫描时间为一个月,其余订单都为四天。
Showing
5 changed files
with
40 additions
and
21 deletions
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
@@ -60,6 +60,7 @@ import java.time.LocalDate; | @@ -60,6 +60,7 @@ import java.time.LocalDate; | ||
60 | import java.time.LocalDateTime; | 60 | import java.time.LocalDateTime; |
61 | import java.time.LocalTime; | 61 | import java.time.LocalTime; |
62 | import java.time.Month; | 62 | import java.time.Month; |
63 | +import java.time.format.DateTimeFormatter; | ||
63 | import java.util.*; | 64 | import java.util.*; |
64 | import java.util.concurrent.TimeUnit; | 65 | import java.util.concurrent.TimeUnit; |
65 | import java.util.function.Function; | 66 | import java.util.function.Function; |
@@ -2185,6 +2186,15 @@ end | @@ -2185,6 +2186,15 @@ end | ||
2185 | .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | 2186 | .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) |
2186 | .eq(OrderInspectionStageDO::getOrderId, updateVO.getOrderId()) | 2187 | .eq(OrderInspectionStageDO::getOrderId, updateVO.getOrderId()) |
2187 | .last("limit 1")); | 2188 | .last("limit 1")); |
2189 | + | ||
2190 | + //对于质检信息,如果填写时间查超过订单的尾期拖货时间并且你的尾期结果不为FAIL,那么你就无法填写,说明你在补数据,而不是实时填写。--start | ||
2191 | + String dateStr = orderBaseInfoDo.getProductionDepartmentConsignTime().substring(0, 10); | ||
2192 | + LocalDate productionDepartmentConsignTime = LocalDate.parse(dateStr, DateTimeFormatter.ofPattern("yyyy-MM-dd")); | ||
2193 | + if(currentDate.isAfter(productionDepartmentConsignTime) && StringUtils.isBlank(inspectionStageDO.getEndCheckResult())){ | ||
2194 | + throw new BusinessException("已经过了"+dateStr+"拖货时间,禁止填写质检信息"); | ||
2195 | + } | ||
2196 | + //上面这段代码始终不行,还是需要前端控制是否填写。不然一直填写不上。因为你不能像前端那样申请字段解锁逻辑,到时候由前端来控制实际否能够填写尾期验货结果,就需要删除这段代码。 -end | ||
2197 | + | ||
2188 | String midCheckResult = inspectionStageInfo.getMidCheckResult(); | 2198 | String midCheckResult = inspectionStageInfo.getMidCheckResult(); |
2189 | String endCheckResult = inspectionStageInfo.getEndCheckResult(); | 2199 | String endCheckResult = inspectionStageInfo.getEndCheckResult(); |
2190 | if (Objects.nonNull(inspectionStageDO)) { | 2200 | if (Objects.nonNull(inspectionStageDO)) { |
@@ -2282,23 +2292,33 @@ end | @@ -2282,23 +2292,33 @@ end | ||
2282 | redisUtils.set(orderBaseInfoDo.getCustomerStyle()+Constant.CROSS_BAR_CHARACTER+resultText, "1", 90, TimeUnit.DAYS); | 2292 | redisUtils.set(orderBaseInfoDo.getCustomerStyle()+Constant.CROSS_BAR_CHARACTER+resultText, "1", 90, TimeUnit.DAYS); |
2283 | } | 2293 | } |
2284 | } | 2294 | } |
2285 | - //查询创建时间在4天的数据。 | ||
2286 | - private List<OrderBaseInfoDO> getTwoMonthOrderBaseInfo(OrderBaseInfoDO orderBaseInfoDo){ | 2295 | + //查询创建时间在4天的数据,A06的订单则为一个月左右的订单。 |
2296 | + private List<OrderBaseInfoDO> getTwoMonthOrderBaseInfo(OrderBaseInfoDO orderBaseInfoDo) { | ||
2287 | LocalDateTime createTime = orderBaseInfoDo.getCreateTime(); | 2297 | LocalDateTime createTime = orderBaseInfoDo.getCreateTime(); |
2288 | - LocalDateTime twoFeatureDay = createTime.plusDays(2); | ||
2289 | - LocalDateTime twoAgoDay = createTime.minusDays(2); | ||
2290 | - List<OrderBaseInfoDO> orderBaseInfoDOList; | ||
2291 | - //这部分代码的目的是,遇到相同style的订单,他们只需要填写其中任何一个订单的跟单信息,就会填写的跟单信息复制到其他订单上。 | ||
2292 | - if(Constant.STRING_ZERO.equals(orderBaseInfoDo.getReturnOrder())){ | ||
2293 | - //查询所有相同的style的并且不是返单的订单。 | ||
2294 | - orderBaseInfoDOList = baseMapper.sameAttributeOrder(orderBaseInfoDo.getCustomerStyle(), orderBaseInfoDo.getInnerNo(), Constant.STRING_ZERO, twoAgoDay,twoFeatureDay); | ||
2295 | - }else{ | ||
2296 | - //查询所有相同的style的并且是返单的订单。 | ||
2297 | - orderBaseInfoDOList = baseMapper.sameAttributeOrder(orderBaseInfoDo.getCustomerStyle(), orderBaseInfoDo.getInnerNo(), Constant.STRING_ONE, twoAgoDay, twoFeatureDay); | 2298 | + LocalDateTime startTime; |
2299 | + LocalDateTime endTime; | ||
2300 | + | ||
2301 | + // 判断客户是否为 A06,决定时间范围 | ||
2302 | + if ("A06".equals(orderBaseInfoDo.getCustomerCode())) { | ||
2303 | + startTime = createTime.minusMonths(1); | ||
2304 | + endTime = createTime; | ||
2305 | + } else { | ||
2306 | + startTime = createTime.minusDays(2); | ||
2307 | + endTime = createTime.plusDays(2); | ||
2298 | } | 2308 | } |
2299 | - //如果一个都没有查询出来,就说明创建订单时创建质检信息,到现在已经距离四个月了,所以连自己都没有查询出来,这个时候就把自己传过去,避免一个都没有。 | ||
2300 | - if(CollectionUtils.isEmpty(orderBaseInfoDOList)){ | ||
2301 | - orderBaseInfoDOList.add(orderBaseInfoDo); | 2309 | + |
2310 | + // 判断是否为返单 | ||
2311 | + String returnOrderFlag = orderBaseInfoDo.getReturnOrder(); | ||
2312 | + String customerStyle = orderBaseInfoDo.getCustomerStyle(); | ||
2313 | + String innerNo = orderBaseInfoDo.getInnerNo(); | ||
2314 | + | ||
2315 | + List<OrderBaseInfoDO> orderBaseInfoDOList = baseMapper.sameAttributeOrder( | ||
2316 | + customerStyle, innerNo, returnOrderFlag, startTime, endTime); | ||
2317 | + | ||
2318 | + // 如果没查到数据,返回包含自己本身的列表,避免为空 | ||
2319 | + if (CollectionUtils.isEmpty(orderBaseInfoDOList)) { | ||
2320 | + orderBaseInfoDOList = new ArrayList<>(); | ||
2321 | + orderBaseInfoDOList.add(orderBaseInfoDo); | ||
2302 | } | 2322 | } |
2303 | return orderBaseInfoDOList; | 2323 | return orderBaseInfoDOList; |
2304 | } | 2324 | } |
src/main/resources/application-local.yml
@@ -59,7 +59,7 @@ spring: | @@ -59,7 +59,7 @@ spring: | ||
59 | testOnReturn: true | 59 | testOnReturn: true |
60 | password: root | 60 | password: root |
61 | time-between-eviction-runs-millis: 1000 | 61 | time-between-eviction-runs-millis: 1000 |
62 | - url: jdbc:mysql://localhost:3306/order-erp1?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true | 62 | + url: jdbc:mysql://localhost:3306/order-erp?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true |
63 | username: root | 63 | username: root |
64 | redis: | 64 | redis: |
65 | database: 0 | 65 | database: 0 |
src/main/resources/application-pre-prod.yml
@@ -59,7 +59,7 @@ spring: | @@ -59,7 +59,7 @@ spring: | ||
59 | testOnReturn: true | 59 | testOnReturn: true |
60 | password: eJ8(bD6]wN6=gI5= | 60 | password: eJ8(bD6]wN6=gI5= |
61 | time-between-eviction-runs-millis: 1000 | 61 | time-between-eviction-runs-millis: 1000 |
62 | - url: jdbc:mysql://47.104.8.35:3307/order-erp?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true | 62 | + url: jdbc:mysql://47.104.8.35:3307/order-erp-pre-prod?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true |
63 | username: root | 63 | username: root |
64 | redis: | 64 | redis: |
65 | database: 10 | 65 | database: 10 |
src/main/resources/application-test.yml
@@ -81,7 +81,7 @@ spring: | @@ -81,7 +81,7 @@ spring: | ||
81 | # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 | 81 | # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的 |
82 | username: chenhang4442024@163.com | 82 | username: chenhang4442024@163.com |
83 | # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 | 83 | # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码 |
84 | - password: ACHWYJSXRITHTMGA | 84 | + password: WGdg9Fx4za53FXvj |
85 | # 邮件接收者 | 85 | # 邮件接收者 |
86 | mailRecipient: #邮件接收者邮箱 | 86 | mailRecipient: #邮件接收者邮箱 |
87 | # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) | 87 | # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议) |
@@ -98,7 +98,6 @@ spring: | @@ -98,7 +98,6 @@ spring: | ||
98 | #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误 | 98 | #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误 |
99 | debug: true | 99 | debug: true |
100 | 100 | ||
101 | - | ||
102 | freemarker: | 101 | freemarker: |
103 | template-loader-path: classpath:/template/ | 102 | template-loader-path: classpath:/template/ |
104 | suffix: .flt | 103 | suffix: .flt |
src/main/resources/application.yml