|
|
@ -177,6 +177,13 @@ public class TestController {
|
|
|
|
sos.close();
|
|
|
|
sos.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 第二个版本的合同
|
|
|
|
|
|
|
|
* @param clientMoniker
|
|
|
|
|
|
|
|
* @param manager
|
|
|
|
|
|
|
|
* @param httpResponse
|
|
|
|
|
|
|
|
* @throws Exception
|
|
|
|
|
|
|
|
*/
|
|
|
|
@ManagerMapping(value = "/{clientMoniker}/export/aggregate/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
|
|
|
|
@ManagerMapping(value = "/{clientMoniker}/export/aggregate/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
|
|
|
|
public void exportAggregateAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
|
|
|
|
public void exportAggregateAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
|
|
|
|
httpResponse.setContentType("application/pdf");
|
|
|
|
httpResponse.setContentType("application/pdf");
|
|
|
@ -205,8 +212,24 @@ public class TestController {
|
|
|
|
throw new BadRequestException("The Partner's Rate is not config!");
|
|
|
|
throw new BadRequestException("The Partner's Rate is not config!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN));
|
|
|
|
client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN));
|
|
|
|
client.put("clean", "T+" + weChatRate.getString("clean_days"));
|
|
|
|
client.put("clean", weChatRate.getString("clean_days"));
|
|
|
|
client.put("clean_days", weChatRate.getString("clean_days"));
|
|
|
|
client.put("clean_days", weChatRate.getString("clean_days"));
|
|
|
|
|
|
|
|
if("1".equalsIgnoreCase(weChatRate.getString("clean_days"))){
|
|
|
|
|
|
|
|
// clean_1 clean_1_friday clean_1_saturday
|
|
|
|
|
|
|
|
client.put("clean_1", weChatRate.getString("clean_days"));
|
|
|
|
|
|
|
|
// second, third or fourth
|
|
|
|
|
|
|
|
client.put("clean_1_friday", "first");
|
|
|
|
|
|
|
|
client.put("clean_1_saturday", "second");
|
|
|
|
|
|
|
|
}else if("2".equalsIgnoreCase(weChatRate.getString("clean_days"))){
|
|
|
|
|
|
|
|
client.put("clean_1", weChatRate.getString("clean_days"));
|
|
|
|
|
|
|
|
client.put("clean_1_friday", "second");
|
|
|
|
|
|
|
|
client.put("clean_1_saturday", "third");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else if("3".equalsIgnoreCase(weChatRate.getString("clean_days"))){
|
|
|
|
|
|
|
|
client.put("clean_1", weChatRate.getString("clean_days"));
|
|
|
|
|
|
|
|
client.put("clean_1_friday", "third");
|
|
|
|
|
|
|
|
client.put("clean_1_saturday", "fourth");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay");
|
|
|
|
JSONObject alipayRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Alipay");
|
|
|
@ -225,6 +248,7 @@ public class TestController {
|
|
|
|
if (account == null || account.size() <= 0) {
|
|
|
|
if (account == null || account.size() <= 0) {
|
|
|
|
throw new BadRequestException("The Partner's Account is not config!");
|
|
|
|
throw new BadRequestException("The Partner's Account is not config!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
client.put("bank", account.getString("bank"));
|
|
|
|
client.put("bank", account.getString("bank"));
|
|
|
|
client.put("bsb_no", account.getString("bsb_no"));
|
|
|
|
client.put("bsb_no", account.getString("bsb_no"));
|
|
|
|
client.put("account_no", account.getString("account_no"));
|
|
|
|
client.put("account_no", account.getString("account_no"));
|
|
|
@ -240,6 +264,7 @@ public class TestController {
|
|
|
|
client.put("legal_job_title", clientLegal.getString("job_title"));
|
|
|
|
client.put("legal_job_title", clientLegal.getString("job_title"));
|
|
|
|
client.put("legal_phone", clientLegal.getString("phone"));
|
|
|
|
client.put("legal_phone", clientLegal.getString("phone"));
|
|
|
|
client.put("legal_email", clientLegal.getString("email"));
|
|
|
|
client.put("legal_email", clientLegal.getString("email"));
|
|
|
|
|
|
|
|
client.put("contract_manager", clientLegal.getString("legal_person"));//client contract manager
|
|
|
|
}
|
|
|
|
}
|
|
|
|
PdfUtils pdu = new PdfUtils();
|
|
|
|
PdfUtils pdu = new PdfUtils();
|
|
|
|
pdu.setTemplatePdfPath(aggragatePdfPath);
|
|
|
|
pdu.setTemplatePdfPath(aggragatePdfPath);
|
|
|
@ -248,6 +273,7 @@ public class TestController {
|
|
|
|
ByteArrayOutputStream bos = pdu.templetPdfBos(file);
|
|
|
|
ByteArrayOutputStream bos = pdu.templetPdfBos(file);
|
|
|
|
sos.write(bos.toByteArray());
|
|
|
|
sos.write(bos.toByteArray());
|
|
|
|
sos.close();
|
|
|
|
sos.close();
|
|
|
|
|
|
|
|
logger.debug("结束!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 制作卡支付合同
|
|
|
|
* 制作卡支付合同
|
|
|
|