Compare commits

...

2 Commits

  1. 3
      config/application-common.properties
  2. 14
      financial_product/src/main/resources/bootstrap.properties
  3. 28
      judgment_point/src/main/java/com/huoran/judgment_point/service/impl/LcJudgmentPointServiceImpl.java
  4. 12
      judgment_point/src/main/resources/bootstrap.properties
  5. 85
      nakadai/src/main/java/com/huoran/nakadai/service/impl/OrderOtherServiceImpl.java
  6. 2
      occupationlab/src/main/resources/bootstrap.properties

@ -35,7 +35,8 @@ operation.wxopen.redirect_url=http://192.168.31.125:8082/#/redirect?
#职站微信小程序配置,慧教小程序
zz.wxopen.appid=wx7e6ca7f895669c62
zz.wxopen.appsecret=fb49d8dc70bc040ac62da9e21d07ba49
zz.wxopen.redirectUrl=https://occupationlab.com/#/redirect?
#zz.wxopen.redirectUrl=https://occupationlab.com/#/redirect?
zz.wxopen.redirectUrl=https://izhixinyun.com/#/redirect?
# 返回json的全局时间格式
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss

@ -13,14 +13,14 @@ spring.cloud.nacos.config.namespace=huorantech-microservice-configuration-namesp
spring.config.additional-location=classpath:/application-common.properties
# Feign 客户端配置
feign.client.config.default.connectTimeout=50000
feign.client.config.default.readTimeout=50000
feign.client.config.default.connectTimeout=500000
feign.client.config.default.readTimeout=500000
feign.client.config.default.logger-level=BASIC
# Feign HTTP 客户端配置
feign.httpclient.enabled=true
feign.httpclient.max-connections=200
feign.httpclient.max-connections-per-route=50
feign.httpclient.max-connections=2000
feign.httpclient.max-connections-per-route=500
# Feign 压缩配置
feign.compression.request.enabled=false
@ -28,8 +28,8 @@ feign.compression.response.enabled=false
# Hystrix 配置
feign.hystrix.enabled=true
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=15000
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=1500000
# Ribbon 配置
ribbon.ReadTimeout=50000
ribbon.ConnectTimeout=50000
ribbon.ReadTimeout=5000000
ribbon.ConnectTimeout=5000000

@ -489,6 +489,8 @@ public class LcJudgmentPointServiceImpl extends ServiceImpl<LcJudgmentPointMappe
*/
String operationEmptyOne = operationRule.getEmptyOne();
String operationEmptyTwo = operationRule.getEmptyTwo();
System.out.println(judgmentRule.getType());
//1选择 2判断 3填空 4问答 5指标结果 6多列选择
switch (judgmentRule.getType()) {
case RuleConstant.ONE:
@ -557,6 +559,8 @@ public class LcJudgmentPointServiceImpl extends ServiceImpl<LcJudgmentPointMappe
lcRuleRecord.setRuleAnswer(ruleEmptyTwo);
lcRuleRecord.setUserAnswer(operationEmptyTwo);
break;
default:
break;
}
ArrayList<Boolean> booleanList1 = new ArrayList<>();
@ -1311,17 +1315,19 @@ public class LcJudgmentPointServiceImpl extends ServiceImpl<LcJudgmentPointMappe
}
public static void main(String[] args) {
boolean numericalComparison = compareRanges("1.0天~30天", "1天~30.0天");
System.out.println("是否相等: " + numericalComparison);
boolean differentUnits = compareRanges("1天~30天", "1分钟~30分钟");
System.out.println("不同单位是否相等: " + differentUnits);
boolean oneWithTilde = compareRanges("1天~30天", "30.0天");
System.out.println("一个有~,一个没有是否相等: " + oneWithTilde);
boolean bothWithoutTilde = compareRanges("30天", "30.0天");
System.out.println("都没有~是否相等: " + bothWithoutTilde);
boolean b = numericalComparison(">3", "<2");
System.out.println(b);
// boolean numericalComparison = compareRanges("1.0天~30天", "1天~30.0天");
// System.out.println("是否相等: " + numericalComparison);
// boolean differentUnits = compareRanges("1天~30天", "1分钟~30分钟");
// System.out.println("不同单位是否相等: " + differentUnits);
//
// boolean oneWithTilde = compareRanges("1天~30天", "30.0天");
// System.out.println("一个有~,一个没有是否相等: " + oneWithTilde);
//
// boolean bothWithoutTilde = compareRanges("30天", "30.0天");
// System.out.println("都没有~是否相等: " + bothWithoutTilde);
}

@ -6,7 +6,7 @@ server.max-http-header-size=104857600
spring.cloud.nacos.config.server-addr=127.0.0.1:8848
#正式部署打开
#spring.cloud.nacos.discovery.ip=47.97.49.1
spring.cloud.nacos.discovery.ip=47.97.49.1
#测试部署打开
#spring.cloud.nacos.discovery.ip=118.31.167.228
#namespace
@ -15,16 +15,16 @@ spring.cloud.nacos.config.namespace=huorantech-microservice-configuration-namesp
spring.config.additional-location=classpath:/application-common.properties
#spring.cloud.inetutils.preferred-networks=192.168.0
feign.client.config.default.connectTimeout=20000
feign.client.config.default.readTimeout=20000
feign.client.config.default.connectTimeout=50000
feign.client.config.default.readTimeout=50000
feign.client.config.default.logger-level=BASIC
feign.hystrix.enabled=true
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=15000
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=150000
#指的是建立连接所用的时间,适用于网络状况正常的情况下,两端连接所用的时间
ribbon.ReadTimeout=50000
ribbon.ReadTimeout=500000
#指的是建立连接后从服务器读取到可用资源所用的时间
ribbon.ConnectTimeout=50000
ribbon.ConnectTimeout=500000
feign.httpclient.enabled=true
feign.httpclient.max-connections=200

@ -25,6 +25,10 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.*;
/**
@ -121,36 +125,71 @@ public class OrderOtherServiceImpl extends ServiceImpl<OrderOtherMapper, OrderOt
return update > 0;
}
public static void main(String[] args) {
LocalDate currentDate = LocalDate.now();
System.out.println(currentDate);
// 使用 SimpleDateFormat 解析字符串日期
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date date = dateFormat.parse("2024-12-19 01:00:01");
// 将 Date 转换为 LocalDate
LocalDate endDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
// 计算两个日期之间的天数
long daysBetween = ChronoUnit.DAYS.between(currentDate, endDate);
System.out.println(daysBetween);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 根据起止日期以及当前日期设置剩余期限
*/
@Override
public void remainingPeriod() {
// List<OrderOtherResp> orderOtherList = baseMapper.remainingDay();
//查询所有订单产品
List<OrderOther> orderOtherList = baseMapper.selectList(null);
orderOtherList.forEach(orderOther -> {
if (orderOther.getShip().equals(OrderConstant.SHIPPED)) {
if (orderOther.getRemainingPeriod() > 0) {
//用于将负数全部修正,判断隔天可以删除
if (orderOther.getRemainingPeriod() < 0) {
orderOther.setRemainingPeriod(0);
}
//修改订单剩余期限,当前时间在产品时间内进行扣除
long start = orderOther.getStartTime().getTime();
long now = DateUtil.date().getTime();
long end = orderOther.getEndTime().getTime();
if (now >= start && now <= end){
orderOther.setRemainingPeriod(orderOther.getRemainingPeriod()-1);
baseMapper.updateById(orderOther);
}
}else {
//关闭产品
orderOther.setIsEnable(0);
baseMapper.updateById(orderOther);
}
QueryWrapper<OrderOther> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("ship","1");
List<OrderOther> orderOtherList = baseMapper.selectList(queryWrapper);
LocalDate currentDate = LocalDate.now();
for (OrderOther orderOther : orderOtherList) {
LocalDate endDate = orderOther.getEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
if (currentDate.isAfter(endDate)) {
orderOther.setRemainingPeriod(0);
orderOther.setIsEnable(0);
} else {
long daysBetween = ChronoUnit.DAYS.between(currentDate, endDate);
orderOther.setRemainingPeriod((int) daysBetween);
}
});
baseMapper.updateById(orderOther);
}
// orderOtherList.forEach(orderOther -> {
// if (orderOther.getShip().equals(OrderConstant.SHIPPED)) {
// if (orderOther.getRemainingPeriod() > 0) {
// //用于将负数全部修正,判断隔天可以删除
// if (orderOther.getRemainingPeriod() < 0) {
// orderOther.setRemainingPeriod(0);
// }
// //修改订单剩余期限,当前时间在产品时间内进行扣除
// long start = orderOther.getStartTime().getTime();
// long now = DateUtil.date().getTime();
// long end = orderOther.getEndTime().getTime();
// if (now >= start && now <= end){
// orderOther.setRemainingPeriod(orderOther.getRemainingPeriod()-1);
// baseMapper.updateById(orderOther);
// }
// }else {
// //关闭产品
// orderOther.setIsEnable(0);
// baseMapper.updateById(orderOther);
// }
// }
// });
}
@Override

@ -5,7 +5,7 @@ spring.cloud.nacos.config.namespace=huorantech-microservice-configuration-namesp
spring.cloud.nacos.config.server-addr=127.0.0.1:8848
#正式部署打开
#spring.cloud.nacos.discovery.ip=47.97.49.1
spring.cloud.nacos.discovery.ip=47.97.49.1
#测试部署打开
#spring.cloud.nacos.discovery.ip=118.31.167.228

Loading…
Cancel
Save