Kaynağa Gözat

fix(苏商银行):续授信逻辑修改

liutao 1 ay önce
ebeveyn
işleme
597d24fc26

+ 16 - 0
src/main/java/com/sunxung/factoring/entity/smb/vo/SmbRequestLogVo.java

@@ -0,0 +1,16 @@
+package com.sunxung.factoring.entity.smb.vo;
+
+import com.sunxung.factoring.entity.BaseSearch;
+
+public class SmbRequestLogVo extends BaseSearch {
+
+    private String transCode;
+
+    public String getTransCode() {
+        return transCode;
+    }
+
+    public void setTransCode(String transCode) {
+        this.transCode = transCode;
+    }
+}

+ 6 - 0
src/main/java/com/sunxung/factoring/mapper/smbApi/SMBRequestLogMapper.java

@@ -24,4 +24,10 @@ public interface SMBRequestLogMapper {
      * @return List<SMBRequestLogPO>
      */
     List<SMBRequestLogPO> findBySearch(@Param("transCode") String transCode);
+
+    /**
+     * 查询所有的taanscode
+     * @return
+     */
+    List<String> findAllCode();
 }

+ 9 - 0
src/main/java/com/sunxung/factoring/service/smbApi/api/SMBRequestLogService.java

@@ -1,11 +1,20 @@
 package com.sunxung.factoring.service.smbApi.api;
 
+import com.sunxung.factoring.entity.GridPage;
+import com.sunxung.factoring.entity.smb.vo.SmbRequestLogVo;
 import com.sunxung.factoring.entity.smbApi.SMBRequestLogPO;
 
+import java.util.List;
+
 /**
  * 苏商银行 接口日志 Service 层
  */
 public interface SMBRequestLogService {
 
     void add(SMBRequestLogPO po);
+
+    GridPage<SMBRequestLogPO> findBySearch(SmbRequestLogVo smbRequestLogVo);
+
+    List<String> findAllCode();
+
 }

+ 18 - 0
src/main/java/com/sunxung/factoring/service/smbApi/api/impl/SMBRequestLogServiceImpl.java

@@ -2,11 +2,17 @@ package com.sunxung.factoring.service.smbApi.api.impl;
 
 import javax.annotation.Resource;
 
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.sunxung.factoring.entity.GridPage;
+import com.sunxung.factoring.entity.smb.vo.SmbRequestLogVo;
 import com.sunxung.factoring.entity.smbApi.SMBRequestLogPO;
 import com.sunxung.factoring.mapper.smbApi.SMBRequestLogMapper;
 import com.sunxung.factoring.service.smbApi.api.SMBRequestLogService;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * 苏商银行 接口日志 Service 实现层
  */
@@ -20,4 +26,16 @@ public class SMBRequestLogServiceImpl implements SMBRequestLogService {
     public void add(SMBRequestLogPO po) {
         smbRequestLogMapper.add(po);
     }
+
+    @Override
+    public GridPage<SMBRequestLogPO> findBySearch(SmbRequestLogVo smbRequestLogVo) {
+        Page page = PageHelper.startPage(smbRequestLogVo.getPage(), smbRequestLogVo.getRows());
+        List<SMBRequestLogPO> result = smbRequestLogMapper.findBySearch(smbRequestLogVo.getTransCode());
+        return new GridPage<>(smbRequestLogVo.getRows(),smbRequestLogVo.getPage(),page.getTotal(),result);
+    }
+
+    @Override
+    public List<String> findAllCode() {
+        return smbRequestLogMapper.findAllCode();
+    }
 }

+ 37 - 0
src/main/java/com/sunxung/factoring/web/smb/SmbRequestLogController.java

@@ -0,0 +1,37 @@
+package com.sunxung.factoring.web.smb;
+
+import com.sunxung.factoring.entity.GridPage;
+import com.sunxung.factoring.entity.ResponseJson;
+import com.sunxung.factoring.entity.smb.vo.SmbRequestLogVo;
+import com.sunxung.factoring.entity.smbApi.SMBRequestLogPO;
+import com.sunxung.factoring.service.smbApi.api.SMBRequestLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 苏商日志
+ * @author liutao
+ * @date 2024-10-12
+ */
+@RestController
+@RequestMapping("smb/log")
+public class SmbRequestLogController {
+
+    @Autowired
+    private SMBRequestLogService smbRequestLogService;
+
+    @RequestMapping("allCode")
+    public ResponseJson findAllCode(){
+        List<String> result = smbRequestLogService.findAllCode();
+        return new ResponseJson(result);
+    }
+
+    @RequestMapping("findBySearch")
+    public GridPage<SMBRequestLogPO> findBySearch(@RequestBody SmbRequestLogVo smbRequestLogVo){
+        return smbRequestLogService.findBySearch(smbRequestLogVo);
+    }
+}

+ 4 - 0
src/main/resources/mapper/smbApi/SMBRequestLogMapper.xml

@@ -47,4 +47,8 @@
         order by a.id desc
     </select>
 
+    <select id="findAllCode" resultType="java.lang.String">
+        SELECT DISTINCT trans_code from smb_request_log
+    </select>
+
 </mapper>