Prechádzať zdrojové kódy

完善银行卡新增

杜魏 4 rokov pred
rodič
commit
422d6838a6

+ 1 - 3
modules/admin/src/main/java/com/fire/admin/mapper/BankCardMapper.java

@@ -6,8 +6,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fire.dto.BankCard;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
-
 /**
  * @author: admin
  * @Description:
@@ -18,5 +16,5 @@ public interface BankCardMapper extends BaseMapper<BankCard> {
 
     IPage<BankCard> getBankCardList(Page page, @Param("supplierId") Integer supplierId);
 
-    int saveBankCards(@Param("bankCards") List<BankCard> bankCards);
+//    int saveBankCards(@Param("bankCards") List<BankCard> bankCards);
 }

+ 1 - 2
modules/admin/src/main/java/com/fire/admin/mapper/ChannelInfoMapper.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.fire.admin.request.ChannelPageParam;
 import com.fire.dto.ChannelInfo;
-import org.apache.ibatis.annotations.Param;
 
 /**
  * @author: admin
@@ -14,7 +13,7 @@ import org.apache.ibatis.annotations.Param;
  */
 public interface ChannelInfoMapper extends BaseMapper<ChannelInfo> {
 
-    IPage<ChannelInfo> selectChannelInfoList(@Param("selectList") ChannelPageParam channelPageParam);
+    IPage<ChannelInfo> selectChannelInfoList(ChannelPageParam channelPageParam);
 
     int delChannelById(Integer channelId);
 

+ 4 - 3
modules/admin/src/main/java/com/fire/admin/rest/BankCardRest.java

@@ -15,6 +15,7 @@ import com.fire.dto.response.BaseRestResponse;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -33,16 +34,16 @@ public class BankCardRest {
         this.bankCardService = bankCardService;
     }
 
-    @RequestMapping("/list")
+    @PostMapping("/list")
     @ApiOperation(value = "银行卡列表",notes = "bankcard_list.py")
     public BaseRestResponse getBankCardList(BankCardPageParam bankCardPageParam) {
         return new BaseRestResponse(bankCardService.getBankCardList(bankCardPageParam,bankCardPageParam.getSupplierId()));
     }
 
-    @RequestMapping("/add")
+    @PostMapping("/add")
     @ApiOperation(value = "批量添加银行卡",notes = "add_bankcards.py")
     public BaseResponse addBankCard(@RequestBody List<BankCard> bankCards) {
-        bankCardService.saveBankCards(bankCards);
+        bankCardService.saveOrUpdateBatch(bankCards);
         return new BaseResponse();
     }
 }

+ 1 - 3
modules/admin/src/main/java/com/fire/admin/service/BankCardService.java

@@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fire.dto.BankCard;
 
-import java.util.List;
-
 /**
  * @author: admin
  * @Description:
@@ -17,7 +15,7 @@ public interface BankCardService extends IService<BankCard> {
 
     IPage<BankCard> getBankCardList(Page page, Integer supplierId);
 
-    void saveBankCards(List<BankCard> bankCards);
+//    void saveBankCards(List<BankCard> bankCards);
 
 
 

+ 2 - 4
modules/admin/src/main/java/com/fire/admin/service/impl/BankCardServiceImpl.java

@@ -8,8 +8,6 @@ import com.fire.admin.service.BankCardService;
 import com.fire.dto.BankCard;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-
 /**
  * @author: admin
  * @Description:
@@ -24,11 +22,11 @@ public class BankCardServiceImpl extends ServiceImpl<BankCardMapper, BankCard> i
         return baseMapper.getBankCardList(page, supplierId);
     }
 
-    @Override
+    /*@Override
     public void saveBankCards(List<BankCard> bankCards) {
         int result = baseMapper.saveBankCards(bankCards);
         if (result>0) {
             // TODO: 2021/5/20 向MQ推送消息
         }
-    }
+    }*/
 }

+ 2 - 2
modules/admin/src/main/resources/mapper/BankCardMapper.xml

@@ -36,7 +36,7 @@
         </where>
     </select>
 
-    <insert id="saveBankCards">
+    <!--<insert id="saveBankCards">
         INSERT INTO bank_card
         (card_no, bank_deposit, account, supplier_id, creator, create_time,updator,update_time,distinguish)
         VALUES
@@ -45,6 +45,6 @@
             #{item.supplierId}, #{item.creator},#{item.createTime},
             #{item.updator},#{item.updateTime},#{distinguish});
         </foreach>
-    </insert>
+    </insert>-->
 
 </mapper>

+ 5 - 4
modules/admin/src/main/resources/mapper/ChannelInfoMapper.xml

@@ -41,14 +41,15 @@
         FROM access_channel_info
         <where>
             <if test="channelId !=null">
-                AND channel_id = #{selectList.channelId}
+                AND channel_id = #{channelId}
             </if>
             <if test="supplierId !=null">
-                AND supplier_id = #{selectList.supplierId}
+                AND supplier_id = #{supplierId}
             </if>
-            <if test="supplierName !=null and supplierName.trim()!=''">
-                AND supplier_name = #{selectList.supplierName}
+            <if test="channelName !=null and channelName.trim()!=''">
+                AND channel_name = #{channelName}
             </if>
+            AND is_delete = 0
         </where>
     </select>