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

湖北消金 - 为上线做准备 提供修改接口。

parent 7d920cda
......@@ -3,6 +3,7 @@ package cn.quantgroup.financial.controller;
import cn.quantgroup.financial.json.JsonResult;
import cn.quantgroup.financial.model.MailInfo;
import cn.quantgroup.financial.model.PaymentDetail;
import cn.quantgroup.financial.service.IApiCommonService;
import cn.quantgroup.financial.service.sys.IMailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
......@@ -18,6 +19,9 @@ public class SystemToolsController {
@Autowired
private IMailService mailService;
@Autowired
private IApiCommonService apiCommonService;
@RequestMapping(value = "/mailinfo/save", method = RequestMethod.POST)
public @ResponseBody JsonResult saveMailInfo(@RequestBody MailInfo mailInfo){
Long mailId = null;
......@@ -35,4 +39,10 @@ public class SystemToolsController {
}
return JsonResult.SUCCESS(row);
}
@RequestMapping(value = "/payment/update", method = {RequestMethod.GET,RequestMethod.POST,RequestMethod.DELETE})
public @ResponseBody JsonResult updateContractNo(@RequestParam("contractNo") String contractNo,@RequestParam("loanHistoryId") Long loanHistoryId){
Integer row = apiCommonService.updateMerchantContractNo(contractNo,loanHistoryId);
return JsonResult.SUCCESS(row);
}
}
......@@ -77,4 +77,6 @@ public interface IPaymentDao {
List<Long> getIdListBeforeCompensationDate(Date compensationDate);
Integer updateBatchCompensationStatusBeforeDate(Date beforeDate,Byte compensationStatus);
Integer updateMerchantContractNo(String contractNo,Long loanHistoryId);
}
......@@ -161,4 +161,9 @@ public class PaymentDaoImpl implements IPaymentDao {
Integer row = repaymentPlanDetailMapper.updateBatchCompensationStatusBeforeDate(beforeDate,compensationStatus);
return row;
}
@Override
public Integer updateMerchantContractNo(String contractNo,Long loanHistoryId){
return paymentDetailMapper.updateMerchantContractNoByLoanHistoryId(contractNo,loanHistoryId);
}
}
......@@ -15,6 +15,7 @@ public interface PaymentDetailMapper {
PaymentDetail getByLoanHistoryId(@Param("loanHistoryId") Long loanHistoryId);
int insertSelective(PaymentDetail record);
int updateMerchantContractNoByLoanHistoryId(@Param("contractNo") String contractNo,@Param("loanHistoryId") Long loanHistoryId);
PaymentDetail selectByPrimaryKey(Long id);
......
......@@ -17,4 +17,5 @@ public interface IApiCommonService {
Integer savePaymentDetailAndRepaymentPlan(PaymentDetail paymentDetail) throws FieldInsufficientException;
PaymentDetail queryData(Long loanHistoryId, Long repaymentPlanId);
Integer updateBatchStatus(Date beforeDate, Byte compensationStatus);
Integer updateMerchantContractNo(String contractNo,Long loanHistoryId);
}
......@@ -110,4 +110,12 @@ public class ApiCommonServiceImpl implements IApiCommonService {
return iPaymentDao.updateBatchCompensationStatusBeforeDate(beforeDate,compensationStatus);
}
@Override
public Integer updateMerchantContractNo(String contractNo, Long loanHistoryId) {
if(StringUtils.isEmpty(contractNo)||loanHistoryId==null){
return 0;
}
return iPaymentDao.updateMerchantContractNo(contractNo,loanHistoryId);
}
}
......@@ -74,6 +74,9 @@
#{loanCreateAt,jdbcType=TIMESTAMP}, #{contractTotalTerm,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<update id="updateMerchantContractNoByLoanHistoryId" parameterType="java.util.Map">
UPDATE paymentdetail SET merchantContractNo=#{contractNo} WHERE loanHistoryId=#{loanHistoryId} LIMIT 1;
</update>
<insert id="insertSelective" parameterType="cn.quantgroup.financial.model.PaymentDetail" useGeneratedKeys="true" keyProperty="id">
insert into paymentdetail
<trim prefix="(" suffix=")" suffixOverrides=",">
......
......@@ -29,7 +29,7 @@ import java.util.List;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = BootStarter.class)
@WebAppConfiguration
@ActiveProfiles("local")
@ActiveProfiles("test")
public class ApiCommonServiceTest {
@Autowired
......@@ -122,5 +122,11 @@ public class ApiCommonServiceTest {
iApiCommonService.updateBatchStatus(new Date(), CompensationStatus.already_status.get());
}
@Test
public void testUpdateMerchantContractNo(){
//HT100000201611250020530
Integer row = iApiCommonService.updateMerchantContractNo("HT100000201611250020530",32618252L);
logger.info("update row={}",row);
}
}
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