Browse Source

吉农宝

hanfucheng 1 year ago
parent
commit
00b1fdf127

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/my/JnbNameAuthenticationController.java

@@ -90,6 +90,19 @@ public class JnbNameAuthenticationController extends BaseController {
     }
 
     /*
+    * 审核实名认证
+    *
+    * @author 韩福成
+    * @date 2024/3/5 11:09
+    */
+    @PreAuthorize("@ss.hasPermi('nameAuthentication:edit')")
+    @Log(title = "审核实名认证", businessType = BusinessType.UPDATE)
+    @PutMapping("/through")
+    public AjaxResult through(@RequestBody JnbNameAuthentication jnbNameAuthentication) {
+        return toAjax(jnbNameAuthenticationService.through(jnbNameAuthentication));
+    }
+
+    /*
     * 小程序-提交实名认证
     *
     * @author 韩福成

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/my/JnbOfficialAuthenticationController.java

@@ -97,6 +97,19 @@ public class JnbOfficialAuthenticationController extends BaseController {
     }
 
     /*
+    * 审核官方认证
+    *
+    * @author 韩福成
+    * @date 2024/3/5 13:55
+    */
+    @PreAuthorize("@ss.hasPermi('officialAuthentication:edit')")
+    @Log(title = "审核官方认证", businessType = BusinessType.UPDATE)
+    @PutMapping("/through")
+    public AjaxResult through(@RequestBody JnbOfficialAuthentication jnbOfficialAuthentication) {
+        return toAjax(jnbOfficialAuthenticationService.through(jnbOfficialAuthentication));
+    }
+
+    /*
     * 小程序-官方认证提交
     *
     * @author 韩福成

+ 8 - 0
sooka-jnb/src/main/java/com/sooka/jnb/my/service/IJnbNameAuthenticationService.java

@@ -52,6 +52,14 @@ public interface IJnbNameAuthenticationService {
      */
     public int deleteJnbNameAuthenticationByIds(String[] ids);
 
+    /*
+    * 审核
+    *
+    * @author 韩福成
+    * @date 2024/3/5 11:10
+    */
+    public int through(JnbNameAuthentication jnbNameAuthentication);
+
     /**
      * 删除实名认证信息
      *

+ 8 - 0
sooka-jnb/src/main/java/com/sooka/jnb/my/service/IJnbOfficialAuthenticationService.java

@@ -51,6 +51,14 @@ public interface IJnbOfficialAuthenticationService {
      */
     public int deleteJnbOfficialAuthenticationByIds(String[] ids);
 
+    /*
+    * 审核官方认证
+    *
+    * @author 韩福成
+    * @date 2024/3/5 13:56
+    */
+    public int through(JnbOfficialAuthentication jnbOfficialAuthentication);
+
     /**
      * 删除官方认证信息
      *

+ 27 - 0
sooka-jnb/src/main/java/com/sooka/jnb/my/service/impl/JnbNameAuthenticationServiceImpl.java

@@ -1,15 +1,19 @@
 package com.sooka.jnb.my.service.impl;
 
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.DictUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.uuid.IdUtils;
+import com.sooka.jnb.my.domain.Announcement;
 import com.sooka.jnb.my.domain.JnbAuthenticationImg;
 import com.sooka.jnb.my.domain.JnbNameAuthentication;
 import com.sooka.jnb.my.mapper.JnbNameAuthenticationMapper;
+import com.sooka.jnb.my.service.IAnnouncementService;
 import com.sooka.jnb.my.service.IJnbNameAuthenticationService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.text.SimpleDateFormat;
 import java.util.List;
 
 /**
@@ -23,6 +27,9 @@ public class JnbNameAuthenticationServiceImpl implements IJnbNameAuthenticationS
     @Autowired
     private JnbNameAuthenticationMapper jnbNameAuthenticationMapper;
 
+    @Autowired
+    private IAnnouncementService announcementService;
+
     /**
      * 查询实名认证
      *
@@ -106,4 +113,24 @@ public class JnbNameAuthenticationServiceImpl implements IJnbNameAuthenticationS
     public int deleteJnbNameAuthenticationById(String id) {
         return jnbNameAuthenticationMapper.deleteJnbNameAuthenticationById(id);
     }
+
+    /*
+    * 审核
+    *
+    * @author 韩福成
+    * @date 2024/3/5 11:10
+    */
+    @Override
+    public int through(JnbNameAuthentication jnbNameAuthentication) {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String data = simpleDateFormat.format(jnbNameAuthentication.getCreateTime());
+        Announcement announcement = new Announcement();
+        announcement.setUserId(IdUtils.simpleUUID());
+        announcement.setCreateBy(SecurityUtils.getUserId().toString());
+        String type = DictUtils.getDictLabel("examine_state",jnbNameAuthentication.getStatus());
+        announcement.setAnnouncementTitle(type+":[实名认证]");
+        announcement.setAnnouncementBody("您在"+data+"发起的[实名认证]信息已["+type+"]");
+        announcementService.insertAnnouncement(announcement);
+        return jnbNameAuthenticationMapper.updateJnbNameAuthentication(jnbNameAuthentication);
+    }
 }

+ 29 - 2
sooka-jnb/src/main/java/com/sooka/jnb/my/service/impl/JnbOfficialAuthenticationServiceImpl.java

@@ -1,18 +1,22 @@
 package com.sooka.jnb.my.service.impl;
 
-import java.util.List;
-
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.DictUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.uuid.IdUtils;
+import com.sooka.jnb.my.domain.Announcement;
 import com.sooka.jnb.my.domain.JnbAuthenticationImg;
 import com.sooka.jnb.my.domain.JnbOfficialAuthentication;
 import com.sooka.jnb.my.mapper.JnbNameAuthenticationMapper;
 import com.sooka.jnb.my.mapper.JnbOfficialAuthenticationMapper;
+import com.sooka.jnb.my.service.IAnnouncementService;
 import com.sooka.jnb.my.service.IJnbOfficialAuthenticationService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.text.SimpleDateFormat;
+import java.util.List;
+
 /**
  * 官方认证Service业务层处理
  *
@@ -27,6 +31,9 @@ public class JnbOfficialAuthenticationServiceImpl implements IJnbOfficialAuthent
     @Autowired
     private JnbNameAuthenticationMapper jnbNameAuthenticationMapper;
 
+    @Autowired
+    private IAnnouncementService announcementService;
+
     /**
      * 查询官方认证
      *
@@ -110,4 +117,24 @@ public class JnbOfficialAuthenticationServiceImpl implements IJnbOfficialAuthent
     public int deleteJnbOfficialAuthenticationById(String id) {
         return jnbOfficialAuthenticationMapper.deleteJnbOfficialAuthenticationById(id);
     }
+
+    /*
+    * 审核官方认证
+    *
+    * @author 韩福成
+    * @date 2024/3/5 13:56
+    */
+    @Override
+    public int through(JnbOfficialAuthentication jnbOfficialAuthentication) {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String data = simpleDateFormat.format(jnbOfficialAuthentication.getCreateTime());
+        Announcement announcement = new Announcement();
+        announcement.setUserId(IdUtils.simpleUUID());
+        announcement.setCreateBy(SecurityUtils.getUserId().toString());
+        String type = DictUtils.getDictLabel("examine_state",jnbOfficialAuthentication.getStatus());
+        announcement.setAnnouncementTitle(type+":[官方认证]");
+        announcement.setAnnouncementBody("您在"+data+"发起的[官方认证]信息已["+type+"]");
+        announcementService.insertAnnouncement(announcement);
+        return jnbOfficialAuthenticationMapper.updateJnbOfficialAuthentication(jnbOfficialAuthentication);
+    }
 }

+ 2 - 1
sooka-jnb/src/main/resources/mapper/my/JnbNameAuthenticationMapper.xml

@@ -30,10 +30,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
             <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
             <if test="status != null  and status != ''"> and status = #{status}</if>
+        order by create_time desc
     </select>
     
     <select id="selectJnbNameAuthenticationById" parameterType="String" resultMap="JnbNameAuthenticationResult">
-        select a.id, a.name, a.phone, a.id_card, a.status,GROUP_CONCAT(b.path) path
+        select a.id, a.name, a.phone, a.id_card, a.status,GROUP_CONCAT(b.path) path,a.create_time
         from jnb_name_authentication a
 		left join jnb_authentication_img b on a.id = b.authentication_id
         where a.id = #{id}

+ 2 - 1
sooka-jnb/src/main/resources/mapper/my/JnbOfficialAuthenticationMapper.xml

@@ -38,7 +38,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             a.phone,
             a.legal_name,
             a.STATUS,
-            GROUP_CONCAT( b.path ) path
+            GROUP_CONCAT( b.path ) path,
+            a.create_time
         FROM
             jnb_official_authentication a
             LEFT JOIN jnb_authentication_img b ON a.id = b.authentication_id