Commit d26bdfbb authored by suntao's avatar suntao

二次审批操作 不使用JolyneCenter 使用jpa,加快执行速递

parent 88ca41bf
...@@ -320,9 +320,7 @@ public class OrderServiceImpl implements OrderService{ ...@@ -320,9 +320,7 @@ public class OrderServiceImpl implements OrderService{
if (conscont.getGenerateStatus() != CONSCONT_STATUS) { if (conscont.getGenerateStatus() != CONSCONT_STATUS) {
log.info("secondAudit,合同状态不对,channelOrderNumber=".concat(channelOrderNumber)); log.info("secondAudit,合同状态不对,channelOrderNumber=".concat(channelOrderNumber));
// 修改合同状态 // 修改合同状态
ArrayList<String> updateContract = Lists.newArrayList(); xyqbCenterService.updateContractStatus(orderMapping.getQgUserId(), CONSCONT_STATUS);
updateContract.add("update contract set generate_status = 2 where user_id = " + orderMapping.getQgUserId() + ";");
jolyneService.executeSQL(JolyneDB.XYQB, JolyneUtil.getJolneSql(updateContract));
} }
} else { } else {
// 合同为空 log表记录问题,UI用户查询 // 合同为空 log表记录问题,UI用户查询
......
...@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.sql.Timestamp;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
...@@ -71,11 +72,11 @@ public class JolyneServiceImpl implements JolyneService { ...@@ -71,11 +72,11 @@ public class JolyneServiceImpl implements JolyneService {
} }
} }
if (waitingFundingCorpOperatePeople.getCreatedAt().getTime() > (System.currentTimeMillis() - 5 * 60 * 1000)) { long fiveAgo = System.currentTimeMillis() - 5 * 60 * 1000;
if (waitingFundingCorpOperatePeople.getCreatedAt().getTime() > fiveAgo) {
// 更新待放款时间(5分钟之前) // 更新待放款时间(5分钟之前)
ArrayList<String> updateWaitingFundingCorpOperatePeople = Lists.newArrayList(); waitingFundingCorpOperatePeople.setCreatedAt(new Timestamp(fiveAgo));
updateWaitingFundingCorpOperatePeople.add("update waiting_funding_corp_operate_people set created_at = DATE_SUB(created_at, interval 5 minute) where loan_application_history_id = " + loanId + ";"); xyqbCenterService.saveWaitingFundingCorpOperatePeople(waitingFundingCorpOperatePeople);
this.executeSQL(JolyneDB.XYQB, JolyneUtil.getJolneSql(updateWaitingFundingCorpOperatePeople));
} }
try { try {
......
...@@ -6,6 +6,7 @@ import org.springframework.data.jpa.repository.JpaRepository; ...@@ -6,6 +6,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
/** /**
* Created by WeiWei on 2019/8/13. * Created by WeiWei on 2019/8/13.
...@@ -21,7 +22,7 @@ public interface ContractRepository extends JpaRepository<Contract, Long> { ...@@ -21,7 +22,7 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
* @param status * @param status
* @return * @return
*/ */
@Deprecated @Transactional(rollbackFor = Exception.class)
@Modifying @Modifying
@Query(value = "update contract set generate_status = ?2 where user_id = ?1", nativeQuery = true) @Query(value = "update contract set generate_status = ?2 where user_id = ?1", nativeQuery = true)
int updateContractStatus(Long userId, Integer status); int updateContractStatus(Long userId, Integer status);
......
...@@ -17,6 +17,7 @@ import java.util.Map; ...@@ -17,6 +17,7 @@ import java.util.Map;
* @author: suntao * @author: suntao
*/ */
public interface XYQBCenterService { public interface XYQBCenterService {
int updateContractStatus(Long userId, Integer status); int updateContractStatus(Long userId, Integer status);
Map queryLendingRecordCount(Long fundId); Map queryLendingRecordCount(Long fundId);
......
...@@ -2,6 +2,7 @@ package cn.quantgroup.cashloanflowboss.spi.xyqb.source; ...@@ -2,6 +2,7 @@ package cn.quantgroup.cashloanflowboss.spi.xyqb.source;
import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
...@@ -43,7 +44,7 @@ public class XYQBDataSourceConfiguration { ...@@ -43,7 +44,7 @@ public class XYQBDataSourceConfiguration {
} }
@Bean @Bean(name = "xyqbEntityManager")
public LocalContainerEntityManagerFactoryBean xyqbEntityManager(EntityManagerFactoryBuilder builder, DataSource xyqbDataSource) { public LocalContainerEntityManagerFactoryBean xyqbEntityManager(EntityManagerFactoryBuilder builder, DataSource xyqbDataSource) {
return builder.dataSource(xyqbDataSource) return builder.dataSource(xyqbDataSource)
...@@ -53,8 +54,8 @@ public class XYQBDataSourceConfiguration { ...@@ -53,8 +54,8 @@ public class XYQBDataSourceConfiguration {
} }
@Bean @Bean(name = "xyqbTransactionManager")
public PlatformTransactionManager xyqbTransactionManager(EntityManagerFactory entityManagerFactory) { public PlatformTransactionManager xyqbTransactionManager(@Qualifier("xyqbEntityManager") EntityManagerFactory entityManagerFactory) {
return new JpaTransactionManager(entityManagerFactory); return new JpaTransactionManager(entityManagerFactory);
} }
......
package cn.quantgroup.cashloanflowboss.service.contract;
import cn.quantgroup.cashloanflowboss.CashLoanFlowBossApplicationTests;
import cn.quantgroup.cashloanflowboss.spi.xyqb.service.XYQBCenterService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
* function:
* date: 2019/12/6
*
* @author: suntao
*/
public class ContractServiceTest extends CashLoanFlowBossApplicationTests {
@Autowired
private XYQBCenterService xyqbCenterService;
@Test
public void testt() {
xyqbCenterService.updateContractStatus(5L, 2);
}
}
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