增加手机端返回用户信息
diff --git a/backend/src/main/java/com/supwisdom/dlpay/framework/util/DataUtil.java b/backend/src/main/java/com/supwisdom/dlpay/framework/util/DataUtil.java
new file mode 100644
index 0000000..5d8546c
--- /dev/null
+++ b/backend/src/main/java/com/supwisdom/dlpay/framework/util/DataUtil.java
@@ -0,0 +1,24 @@
+package com.supwisdom.dlpay.framework.util;
+
+public class DataUtil {
+ public static String desensitization(String str, int start, int end) {
+ if (StringUtil.isEmpty(str)) {
+ return "";
+ }
+ int length = str.length();
+ if (start + end >= length || end > length) {
+ return "";
+ }
+ String prefix = str.substring(0, start);
+ String suffix = str.substring(length - end - 1, length - 1);
+ return prefix + repeat("*", length - start - end) + suffix;
+ }
+
+ public static String repeat(String str, int length) {
+ StringBuilder sb = new StringBuilder(str);
+ for (int i = 0; i < length - 1; i++) {
+ sb.append(str);
+ }
+ return sb.toString();
+ }
+}
diff --git a/backend/src/main/java/com/supwisdom/dlpay/portal/domain/TBOutlets.java b/backend/src/main/java/com/supwisdom/dlpay/portal/domain/TBOutlets.java
new file mode 100644
index 0000000..a459cc8
--- /dev/null
+++ b/backend/src/main/java/com/supwisdom/dlpay/portal/domain/TBOutlets.java
@@ -0,0 +1,115 @@
+package com.supwisdom.dlpay.portal.domain;
+
+import org.hibernate.annotations.GenericGenerator;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "tb_outlets",
+ indexes = {@Index(name = "outlets_idx1", columnList = "outlesno"),
+ @Index(name = "outlets_idx2", columnList = "name"),
+ @Index(name = "outlets_idx3", columnList = "address")})
+public class TBOutlets {
+ @Id
+ @GenericGenerator(name = "idGenerator", strategy = "uuid")
+ @GeneratedValue(generator = "idGenerator")
+ @Column(name = "id", nullable = false, length = 32)
+ private String id;
+
+ @Column(name = "outlesno")
+ private String outlesno;
+
+ @Column(name = "name",length = 100)
+ private String name;
+
+ @Column(name = "address", length = 200)
+ private String address;
+
+ @Column(name = "starttime", length = 6)
+ private String starttime;
+
+ @Column(name = "endtime", length = 6)
+ private String endtime;
+
+ @Column(name = "location",length = 20)
+ private String location;
+
+
+ @Column(name = "businescope", length = 100)
+ private String businescope;
+
+ @Column(name = "tel",length = 50)
+ private String tel;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getOutlesno() {
+ return outlesno;
+ }
+
+ public void setOutlesno(String outlesno) {
+ this.outlesno = outlesno;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getStarttime() {
+ return starttime;
+ }
+
+ public void setStarttime(String starttime) {
+ this.starttime = starttime;
+ }
+
+ public String getEndtime() {
+ return endtime;
+ }
+
+ public void setEndtime(String endtime) {
+ this.endtime = endtime;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public String getBusinescope() {
+ return businescope;
+ }
+
+ public void setBusinescope(String businescope) {
+ this.businescope = businescope;
+ }
+
+ public String getTel() {
+ return tel;
+ }
+
+ public void setTel(String tel) {
+ this.tel = tel;
+ }
+}
diff --git a/backend/src/main/java/com/supwisdom/dlpay/portal/util/PortalConstant.java b/backend/src/main/java/com/supwisdom/dlpay/portal/util/PortalConstant.java
index 490b5d6..c6c7129 100644
--- a/backend/src/main/java/com/supwisdom/dlpay/portal/util/PortalConstant.java
+++ b/backend/src/main/java/com/supwisdom/dlpay/portal/util/PortalConstant.java
@@ -10,6 +10,7 @@
public static final String SYSPARA_IMAGE_URLASSIGN = "imageserver.url.assign";
public static final String SYSPARA_IMAGE_URLPUSH = "imageserver.url.push";
public static final String SYSPARA_ARTICLE_CURRENTNO = "article.currentno";
+ public static final String SYSPARA_OUTLETS_CURRENTNO = "outlets.currentno";
public static final String SYSPARA_PORTAL_APPID = "portal.appid";
public static final String SYSPARA_PORTAL_SECRET = "portal.secret";
diff --git a/backend/src/main/kotlin/com/supwisdom/dlpay/mobile/AuthLoginHandler.kt b/backend/src/main/kotlin/com/supwisdom/dlpay/mobile/AuthLoginHandler.kt
index 4cd7ccc..04af1ff 100644
--- a/backend/src/main/kotlin/com/supwisdom/dlpay/mobile/AuthLoginHandler.kt
+++ b/backend/src/main/kotlin/com/supwisdom/dlpay/mobile/AuthLoginHandler.kt
@@ -4,7 +4,6 @@
import com.supwisdom.dlpay.api.bean.JsonResult
import com.supwisdom.dlpay.api.bean.QueryCardInfo
import com.supwisdom.dlpay.api.bean.QueryCardParam
-import com.supwisdom.dlpay.api.service.UserService
import com.supwisdom.dlpay.framework.core.JwtConfig
import com.supwisdom.dlpay.framework.core.JwtTokenUtil
import com.supwisdom.dlpay.framework.domain.JwtRedis
@@ -45,8 +44,6 @@
@Autowired
lateinit var systemUtilService: SystemUtilService
@Autowired
- lateinit var userService: UserService
- @Autowired
lateinit var userProxy: UserProxy
override fun onAuthenticationSuccess(request: HttpServletRequest, response: HttpServletResponse, authentication: Authentication) {
@@ -89,6 +86,9 @@
}
var name = ""
var signed=""
+ var citizenCardNo = ""
+ var bankCardNo = ""
+ var idno = ""
if (!user.userid.isNullOrEmpty()) {
val personResponse = userProxy.queryPerson(user.userid)
if (personResponse.retcode != 0) {
@@ -96,16 +96,25 @@
throw UserLoginFailException("查询用户失败")
}
val person = personResponse.person
- val cardResponse = userProxy.queryCard(QueryCardParam().apply {
+ name = person.name
+ idno = DataUtil.desensitization(person.idno,3,4)
+ val citizenCardResponse = userProxy.queryCard(QueryCardParam().apply {
+ this.userid = user.userid
+ this.cardtype = ConstantUtil.CARDTYPE_CITIZENCARD
+ })
+ if (citizenCardResponse.retcode == 0&&citizenCardResponse.card!=null) {
+ citizenCardNo = citizenCardResponse.card.cardno
+ }
+ val bankCardResponse = userProxy.queryCard(QueryCardParam().apply {
this.userid = user.userid
this.cardtype = ConstantUtil.CARDTYPE_BANKCARD
})
var card:QueryCardInfo?=null
- if (cardResponse.retcode == 0) {
- card = cardResponse.card
+ if (bankCardResponse.retcode == 0) {
+ card = bankCardResponse.card
}
- name = person.name
if(card!=null&&card.signed){
+ bankCardNo = DataUtil.desensitization(card.cardno,4,4)
signed = TradeDict.STATUS_YES
}
}
@@ -123,6 +132,9 @@
?.put("paypwdset",payseted)
?.put("signed", signed)
?.put("imageurl",imageUrl)
+ ?.put("citizenCardNo",citizenCardNo)
+ ?.put("bankCardNo",bankCardNo)
+ ?.put("idno",idno)
?.put("userid",if(user.userid.isNullOrEmpty()) "" else user.userid)))
} else {
throw UserLoginFailException("登录错误")
diff --git a/backend/src/main/kotlin/com/supwisdom/dlpay/portal/PortalApi.kt b/backend/src/main/kotlin/com/supwisdom/dlpay/portal/PortalApi.kt
index eaa5fe7..d5c5219 100644
--- a/backend/src/main/kotlin/com/supwisdom/dlpay/portal/PortalApi.kt
+++ b/backend/src/main/kotlin/com/supwisdom/dlpay/portal/PortalApi.kt
@@ -308,6 +308,17 @@
}
}
+ @RequestMapping(value = ["/article/withdraw/{articleno}"], method = [RequestMethod.POST])
+ fun withdrawArticle(@PathVariable(value = "articleno") articleno: String): JsonResult? {
+ return try {
+ articleService.withdrawArticle(articleno)
+ JsonResult.ok()
+ } catch (e: Exception) {
+ logger.error { e.message }
+ JsonResult.error("撤回文章异常")
+ }
+ }
+
@RequestMapping(value = ["/article/get/{articleno}"], method = [RequestMethod.GET])
fun getArticle(@PathVariable(value = "articleno") articleno: String): JsonResult? {
return try {
diff --git a/backend/src/main/kotlin/com/supwisdom/dlpay/portal/dao/ArticleAuthDao.kt b/backend/src/main/kotlin/com/supwisdom/dlpay/portal/dao/ArticleAuthDao.kt
index e7f72fb..5cf1a1f 100644
--- a/backend/src/main/kotlin/com/supwisdom/dlpay/portal/dao/ArticleAuthDao.kt
+++ b/backend/src/main/kotlin/com/supwisdom/dlpay/portal/dao/ArticleAuthDao.kt
@@ -7,4 +7,5 @@
@Repository
interface ArticleAuthDao : JpaRepository<TBArticleAuth, String> {
fun findByArticlenoAndStatus(articleno: String, status: String):TBArticleAuth?
+ fun deleteByArticleno(articleno: String)
}
\ No newline at end of file
diff --git a/backend/src/main/kotlin/com/supwisdom/dlpay/portal/service/ArticleService.kt b/backend/src/main/kotlin/com/supwisdom/dlpay/portal/service/ArticleService.kt
index 89409d6..d4ed8d9 100644
--- a/backend/src/main/kotlin/com/supwisdom/dlpay/portal/service/ArticleService.kt
+++ b/backend/src/main/kotlin/com/supwisdom/dlpay/portal/service/ArticleService.kt
@@ -20,6 +20,8 @@
@Transactional
fun deleteArticle(articleno:String)
@Transactional
+ fun withdrawArticle(articleno:String)
+ @Transactional
fun switchDisplay(articleno:String,value:String):String
@Transactional
fun getArticle(articleno:String):TBArticle
diff --git a/backend/src/main/kotlin/com/supwisdom/dlpay/portal/service/Impl/ArticleServiceImpl.kt b/backend/src/main/kotlin/com/supwisdom/dlpay/portal/service/Impl/ArticleServiceImpl.kt
index f10cb67..31e3abd 100644
--- a/backend/src/main/kotlin/com/supwisdom/dlpay/portal/service/Impl/ArticleServiceImpl.kt
+++ b/backend/src/main/kotlin/com/supwisdom/dlpay/portal/service/Impl/ArticleServiceImpl.kt
@@ -125,6 +125,14 @@
articleDao.save(article)
}
+ override fun withdrawArticle(articleno: String) {
+ val article = articleDao.findByArticlenoAndIsdelete(articleno, PortalConstant.NO)
+ ?: throw RuntimeException("编号为:[${articleno}]的文章未找到")
+ article.status = PortalConstant.ARTICLE_STATUS_SAVE
+ articleDao.save(article)
+ articleAuthDao.deleteByArticleno(articleno)
+ }
+
override fun switchDisplay(articleno: String, value: String): String {
val article = articleDao.findByArticlenoAndIsdelete(articleno, PortalConstant.NO)
?: throw RuntimeException("编号为:[${articleno}]的文章未找到")
diff --git a/backend/src/main/resources/data-postgresql.sql b/backend/src/main/resources/data-postgresql.sql
index bc0b484..755e49b 100644
--- a/backend/src/main/resources/data-postgresql.sql
+++ b/backend/src/main/resources/data-postgresql.sql
@@ -14,6 +14,7 @@
INSERT INTO "tb_businesspara"("parakey", "paraval", "tenantid") VALUES ('sms.url', 'http://112.35.4.197:15000', '{tenantid}');
INSERT INTO "tb_businesspara"("parakey", "paraval", "tenantid") VALUES ('sms.pwd', 'kingstar#2019', '{tenantid}');
INSERT INTO "tb_businesspara"("parakey", "paraval", "tenantid") VALUES ('article.currentno', '1', '{tenentid}');
+INSERT INTO "tb_businesspara"("parakey", "paraval", "tenantid") VALUES ('outlets.currentno', '1', '{tenentid}');
INSERT INTO "tb_businesspara"("parakey", "paraval", "tenantid") VALUES ('portal.appid', '800001', '{tenentid}');
INSERT INTO "tb_businesspara"("parakey", "paraval", "tenantid") VALUES ('portal.secret', '1a8905a272364ef592e61f4a1288f07d', '{tenentid}');
INSERT INTO "tb_businesspara"("parakey", "paraval", "tenantid") VALUES ('aes.cfb.totp.offset', '20', '{tenantid}');