Browse Source

添加农户打款失败时修改农户的银行卡状态为不可打款状态

qiubo 4 years ago
parent
commit
dd9eb2e9fd

+ 2 - 0
src/main/java/com/hywa/banktest/bankframework/service/BankServiceImpl.java

@@ -3,6 +3,7 @@ package com.hywa.banktest.bankframework.service;
 import java.io.File;
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.stream.Collectors;
 
 import com.hywa.banktest.entity.ClearingRecord;
 import com.hywa.banktest.entity.ClearingRecordDetail;
@@ -199,6 +200,7 @@ public class BankServiceImpl extends BankService{
 				if(j==0){
 					orderInfoService.updateNoOrderClearing(failList);
 				}
+				orderInfoService.updateFarmerInfoBankStatus(failList);
 			}
 
 

+ 6 - 0
src/main/java/com/hywa/banktest/dao/OrderInfoMapper.java

@@ -46,4 +46,10 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfo,String> {
 
     BigDecimal clearingMoney(@Param("ids") List<String> ids);
 
+    /**
+     *
+     */
+
+    public int updateFarmerBankStatus(@Param("ids")List<String> ids);
+
 }

+ 2 - 0
src/main/java/com/hywa/banktest/service/OrderInfoService.java

@@ -68,6 +68,8 @@ public interface OrderInfoService extends BaseService<OrderInfo> {
 	*/
 	public int updateNoOrderClearing(List<TransVo> transVoList);
 
+	public int updateFarmerInfoBankStatus(List<TransVo> transVoList);
+
 
 
 

+ 12 - 0
src/main/java/com/hywa/banktest/service/impl/OrderInfoServiceImpl.java

@@ -236,4 +236,16 @@ public class OrderInfoServiceImpl extends BaseServiceImpl<OrderInfo> implements
 		return 0;
 	}
 
+	@Override
+	public int updateFarmerInfoBankStatus(List<TransVo> transVoList) {
+		if(null!=transVoList && transVoList.size()>0){
+			List<String> list = transVoList.stream().map(TransVo::getOrderNo).collect(Collectors.toList());
+			if (list != null&&list.size()>0){
+				return orderInfoMapper.updateFarmerBankStatus(list);
+			}
+		}
+		return 0;
+
+	}
+
 }

+ 6 - 0
src/main/resources/mappers/orderInfoMapper.xml

@@ -467,4 +467,10 @@
       #{id}
     </foreach>
 </select>
+  <update id="updateFarmerBankStatus" parameterType="java.lang.String">
+    UPDATE  t_farmer_info ti  LEFT JOIN t_clearing_record_detail td on ti.guid = td.fk_farmer_id set ti.bank_status=0 where td.id  in
+     <foreach collection="ids" close=")" open="(" separator="," item="id">
+       #{id}
+     </foreach>
+  </update>
 </mapper>