Commit b8ad581f authored by Data-王博's avatar Data-王博

湖北消金 - 增加补充提前还款构建信息flowNo

parent 462c830d
......@@ -48,5 +48,12 @@ public interface IHuBeiCFCDao {
Integer getMaxSeqNoByDocId(Long docId);
List<MailInfo> getListByType(Byte type);
/**
* 通过合同号查询flow不为空的
* @param contactNoList
* @return
*/
List<HuBeiHistory> getFlowByContractNoList(List<String> contactNoList);
}
......@@ -10,6 +10,7 @@ import cn.quantgroup.financial.model.MailInfo;
import cn.quantgroup.financial.model.PaymentDetail;
import cn.quantgroup.financial.model.huibeicfc.HuBeiDocName;
import cn.quantgroup.financial.model.huibeicfc.HuBeiHistory;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -137,5 +138,12 @@ public class HuBeiCFCDaoImpl implements IHuBeiCFCDao {
return mailInfoMapper.getByType(type);
}
@Override
public List<HuBeiHistory> getFlowByContractNoList(List<String> contactNoList){
if(CollectionUtils.isEmpty(contactNoList)){
return new ArrayList<HuBeiHistory>();
}
return huBeiHistoryMapper.getFlowByContractNoList(contactNoList);
}
}
......@@ -14,6 +14,7 @@ public interface HuBeiHistoryMapper {
List<HuBeiHistory> getListByDocNameId(@Param("docNameId") Long docNameId);
List<HuBeiHistory> getFlowByContractNoList(@Param("contractNoList") List<String> contractNoList);
/**
* 通过文档id 以及批次序号查询
* @param docNameId
......
......@@ -575,11 +575,16 @@ public class HuBeiServiceImpl implements IHuBeiService {
iApiCommonService.queryData(repayXyqbDetailList.get(0).getLoanApplicationHistoryId(),null);
}
List<HuBeiHistory> flowHuBeiHistoryList = huBeiCFCDao.getFlowByContractNoList(Arrays.asList(paymentDetail.getMerchantContractNo()));
if(paymentDetail!=null){
for(RepayXyqbDetail repayXyqbDetail: repayXyqbDetailList){
seqNo++;
HuBeiHistory advanceHuiBeiHistory = new HuBeiHistory();
advanceHuiBeiHistory.setFlowNo(null);
if(CollectionUtils.isEmpty(flowHuBeiHistoryList)){
advanceHuiBeiHistory.setFlowNo(null);
}else {
advanceHuiBeiHistory.setFlowNo(flowHuBeiHistoryList.get(0).getFlowNo());
}
advanceHuiBeiHistory.setContactNo(paymentDetail.getMerchantContractNo());
advanceHuiBeiHistory.setCurrTermNo(repayXyqbDetail.getCurrTermNo());
advanceHuiBeiHistory.setUserIdType(new Integer(UserCardType.IDENTITY_CARD.get()).byteValue());
......@@ -729,7 +734,11 @@ public class HuBeiServiceImpl implements IHuBeiService {
}
StringBuilder errorStringBuilder = new StringBuilder(noticeMessage+"\r");
for(HuBeiHistory huBeiHistory:huBeiHistoryList){
errorStringBuilder.append(huBeiHandlerDispatcher.builder(HubeiCFCField.HubeiTypeMap.get(huBeiHistory.getDataType()),huBeiHistory)).append("\r");
if(HubeiCFCDataType.RETURN_ADVANCE_REPAYMENT.get().equals(huBeiHistory.getDataType())){
errorStringBuilder.append(huBeiHistory.getFlowNo()).append(SysConstant.vertical).append(huBeiHandlerDispatcher.builder(HubeiCFCField.HubeiTypeMap.get(huBeiHistory.getDataType()),huBeiHistory)).append("\r");
}else {
errorStringBuilder.append(huBeiHandlerDispatcher.builder(HubeiCFCField.HubeiTypeMap.get(huBeiHistory.getDataType()),huBeiHistory)).append("\r");
}
}
String message = errorStringBuilder.toString();
if(!StringUtils.isEmpty(message)){
......
......@@ -29,6 +29,15 @@
from hubeihistory
where id = #{id,jdbcType=BIGINT}
</select>
<select id="getFlowByContractNoList" resultMap="BaseResultMap" parameterType="java.util.List">
select
<include refid="Base_Column_List" />
from hubeihistory
where flowNo IS NOT NULL AND contactNo IN
<foreach collection="contractNoList" item="contactNo" separator="," open="(" close=")" index="index">
#{contactNo}
</foreach>
</select>
<select id="getListByDocNameId" resultMap="BaseResultMap" parameterType="java.lang.Long">
select
<include refid="Base_Column_List" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment