|
|
|
@ -7,17 +7,14 @@ import cn.hutool.crypto.SecureUtil;
|
|
|
|
import cn.hutool.crypto.symmetric.AES;
|
|
|
|
import cn.hutool.crypto.symmetric.AES;
|
|
|
|
import com.cyl.h5.pojo.dto.PayNotifyMessageDTO;
|
|
|
|
import com.cyl.h5.pojo.dto.PayNotifyMessageDTO;
|
|
|
|
import com.cyl.h5.service.H5OrderService;
|
|
|
|
import com.cyl.h5.service.H5OrderService;
|
|
|
|
import com.cyl.manager.aws.domain.SystemStatistics;
|
|
|
|
|
|
|
|
import com.cyl.manager.aws.mapper.SystemStatisticsMapper;
|
|
|
|
|
|
|
|
import com.cyl.manager.aws.service.SystemStatisticsService;
|
|
|
|
|
|
|
|
import com.cyl.manager.ums.service.MemberCartService;
|
|
|
|
import com.cyl.manager.ums.service.MemberCartService;
|
|
|
|
import com.cyl.wechat.WechatAuthService;
|
|
|
|
import com.cyl.wechat.WechatAuthService;
|
|
|
|
import com.cyl.wechat.WechatPayData;
|
|
|
|
|
|
|
|
import com.cyl.wechat.WechatPayService;
|
|
|
|
import com.cyl.wechat.WechatPayService;
|
|
|
|
import com.ruoyi.RuoYiApplication;
|
|
|
|
import com.ruoyi.RuoYiApplication;
|
|
|
|
import com.ruoyi.common.config.properties.SmsProperties;
|
|
|
|
import com.ruoyi.common.config.properties.SmsProperties;
|
|
|
|
import com.ruoyi.common.core.sms.AliyunSmsTemplate;
|
|
|
|
import com.ruoyi.common.core.sms.AliyunSmsTemplate;
|
|
|
|
import com.ruoyi.common.core.sms.SmsTemplate;
|
|
|
|
import com.ruoyi.common.core.sms.SmsTemplate;
|
|
|
|
|
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
|
import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction;
|
|
|
|
import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.Test;
|
|
|
|
@ -29,19 +26,16 @@ import org.springframework.http.ResponseEntity;
|
|
|
|
import org.springframework.test.context.ActiveProfiles;
|
|
|
|
import org.springframework.test.context.ActiveProfiles;
|
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
import java.time.LocalTime;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RunWith(SpringRunner.class)
|
|
|
|
@RunWith(SpringRunner.class)
|
|
|
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = RuoYiApplication.class)
|
|
|
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = RuoYiApplication.class)
|
|
|
|
@ActiveProfiles("dev")
|
|
|
|
@ActiveProfiles("dev")
|
|
|
|
@Slf4j
|
|
|
|
@Slf4j
|
|
|
|
public class ServiceTest {
|
|
|
|
public class ServiceTest {
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private MemberCartService memberCartService;
|
|
|
|
private MemberCartService memberCartService;
|
|
|
|
|
|
|
|
|
|
|
|
@ -51,16 +45,18 @@ public class ServiceTest {
|
|
|
|
@Value("${aes.key}")
|
|
|
|
@Value("${aes.key}")
|
|
|
|
private String key;
|
|
|
|
private String key;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private SystemStatisticsService systemStatisticsService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private SystemStatisticsMapper systemStatisticsMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void test1() {
|
|
|
|
public void test1() {
|
|
|
|
memberCartService.mineCartNum();
|
|
|
|
memberCartService.mineCartNum();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void encryptPassword() {
|
|
|
|
|
|
|
|
String newPwd = "admin123";
|
|
|
|
|
|
|
|
System.out.println("新密码:"+ SecurityUtils.encryptPassword(newPwd));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void test2(){
|
|
|
|
public void test2(){
|
|
|
|
System.out.println(smsProperties);
|
|
|
|
System.out.println(smsProperties);
|
|
|
|
@ -99,15 +95,6 @@ public class ServiceTest {
|
|
|
|
private WechatPayService wechatPayService;
|
|
|
|
private WechatPayService wechatPayService;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private WechatAuthService wechatAuthService;
|
|
|
|
private WechatAuthService wechatAuthService;
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void test5(){
|
|
|
|
|
|
|
|
// String code = "0611P2Ga1D8QCF0CVuJa1qNUJa11P2GL";
|
|
|
|
|
|
|
|
// WechatUserAuth userToken = wechatAuthService.getUserToken(code);
|
|
|
|
|
|
|
|
String openId="oUA8I6lDdwSfz-EwR4284dU3KOYw";
|
|
|
|
|
|
|
|
String res = wechatPayService.jsapiPay(UUID.randomUUID().toString().substring(0,30), "测试支付", 1, openId, 22L, WechatPayData.appId);
|
|
|
|
|
|
|
|
System.out.println(res);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private H5OrderService h5OrderService;
|
|
|
|
private H5OrderService h5OrderService;
|
|
|
|
@ -123,12 +110,4 @@ public class ServiceTest {
|
|
|
|
ResponseEntity<String> stringResponseEntity = h5OrderService.payCallBack(messageDTO);
|
|
|
|
ResponseEntity<String> stringResponseEntity = h5OrderService.payCallBack(messageDTO);
|
|
|
|
System.out.println(stringResponseEntity.getBody());
|
|
|
|
System.out.println(stringResponseEntity.getBody());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void test7(){
|
|
|
|
|
|
|
|
LocalDateTime startTime = LocalDateTime.of(LocalDate.now(), LocalTime.MIN).plusDays(-1);
|
|
|
|
|
|
|
|
LocalDateTime endTime = LocalDateTime.of(LocalDate.now(), LocalTime.MAX).plusDays(-1);
|
|
|
|
|
|
|
|
SystemStatistics data = systemStatisticsService.stat(startTime, endTime);
|
|
|
|
|
|
|
|
systemStatisticsMapper.insert(data);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|