liaoyongfei 4 年 前
コミット
d56b53519d

+ 15 - 13
ymall/pom.xml

@@ -33,19 +33,21 @@
     <!--</dependency>-->
 
     <!--client -->
-    <dependency>
-      <groupId>org.springframework.cloud</groupId>
-      <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
-    </dependency>
-    <!--configs -->
-    <dependency>
-      <groupId>org.springframework.cloud</groupId>
-      <artifactId>spring-cloud-starter-config</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework.cloud</groupId>
-      <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
-    </dependency>
+    <!--<dependency>-->
+      <!--<groupId>com.alibaba.cloud</groupId>-->
+      <!--<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
+      <!--<version>2.2.1.RELEASE</version>-->
+    <!--</dependency>-->
+    <!--&lt;!&ndash;configs &ndash;&gt;-->
+    <!--<dependency>-->
+      <!--<groupId>org.springframework.cloud</groupId>-->
+      <!--<artifactId>spring-cloud-starter-config</artifactId>-->
+    <!--</dependency>-->
+    <!--<dependency>-->
+      <!--<groupId>com.alibaba.cloud</groupId>-->
+      <!--<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>-->
+      <!--<version>2.2.1.RELEASE</version>-->
+    <!--</dependency>-->
     <!-- feign客户端依赖 -->
     <dependency>
       <groupId>org.springframework.cloud</groupId>

+ 2 - 1
ymall/src/main/java/com/liangjian11/ymall/controller/CashOutController.java

@@ -67,7 +67,8 @@ public class CashOutController {
   public ResultData deleteAccountBank(@RequestBody UserAccountBank userAccountBank) {
     if (userAccountBank.getId() == null)
       return ResultData.getParamValidResult("id不能为空");
-    if (userAccountBankService.removeById(userAccountBank.getId()))
+    userAccountBank.setIsDelete(true);
+    if (userAccountBankService.updateById(userAccountBank))
       return ResultData.getSuccessResult("删除成功");
     return ResultData.getFailResult("删除失败");
   }

+ 3 - 0
ymall/src/main/java/com/liangjian11/ymall/service/impl/UserAccountBankServiceImpl.java

@@ -36,10 +36,12 @@ public class UserAccountBankServiceImpl extends ServiceImpl<UserAccountBankMappe
   @Override
   public ResultData addOrEditAccountBank(UserAccountBank userAccountBank) {
     ResultData resultData = this.checkUserAccountBank(userAccountBank);
+    userAccountBank.setIsDelete(false);
     if (resultData.getErr() != 0)
       return resultData;
     QueryWrapper<UserAccountBank> queryByUnionid = new QueryWrapper<>();
     queryByUnionid.eq("unionid", userAccountBank.getUnionid());
+    queryByUnionid.eq("is_delete", false);
     int existNumber = userAccountBankMapper.selectCount(queryByUnionid);
     if (existNumber == 0)
       userAccountBank.setIsDefault(true);
@@ -67,6 +69,7 @@ public class UserAccountBankServiceImpl extends ServiceImpl<UserAccountBankMappe
     return ResultData.getFailResult("操作失败");
   }
 
+
   @Override
   public ResultData checkUserAccountBank(UserAccountBank userAccountBank) {
     if (StringUtils.isEmpty(userAccountBank.getUserId()))

+ 3 - 3
ymall/src/test/java/com/liangjian11/ymall/DomainTest.java

@@ -34,10 +34,10 @@ public class DomainTest {
 	@Test
 	public void testRun() throws Throwable {
 		HproseHttpClient client = new HproseHttpClient();
-//		client.useService("http://hprose.360lj.com/EncryptionAlgorithm/");// 正式
-		client.useService("http://t-hprose.360lj.com/EncryptionAlgorithm/");// 测试
+		client.useService("http://hprose.360lj.com/EncryptionAlgorithm/");// 正式
+		//client.useService("http://t-hprose.360lj.com/EncryptionAlgorithm/");// 测试
 		String result = (String) client.invoke("EncryptionAlgorithmService_AEncrypt",
-				new Object[]{"123456", "123456e10adc3949ba59abbe56e057f20f883e", "15347409413"});
+				new Object[]{"123456", "123456e10adc3949ba59abbe56e057f20f883e", "18507323703"});
 		System.out.println(result);
 		result = (String) client.invoke("EncryptionAlgorithmService_ADecrypt", new Object[]{"123456", "123456e10adc3949ba59abbe56e057f20f883e", "BBE02AB90D400FE6C7E92DD7C0EA72DE"});
 		System.out.println(result);