master
wangning 7 years ago
parent f79085be54
commit c2b9fc6424

@ -256,11 +256,11 @@ public interface ClientManager {
void getAgreeFile(String clientMoniker, JSONObject manager) throws Exception;
void getAggregateAgreeFile(String clientMoniker, JSONObject manager) throws Exception;
void getAggregateAgreeFile(String clientMoniker, JSONObject manager,boolean renewal) throws Exception;
void temporaryExportPdf(String clientMoniker, JSONObject manager, HttpServletResponse httpResponse) throws Exception;
void importAgreeFile(String clientMoniker, JSONObject manager, String sourceFile);
void importAgreeFile(String clientMoniker, JSONObject manager, String sourceFile,boolean renewal);
void completeAgree(String clientMoniker, JSONObject manager);

@ -1865,7 +1865,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
ByteArrayOutputStream bos = pdu.templetPdfBos(file);
stream = new ByteArrayInputStream(bos.toByteArray());
JSONObject fileRes = attachmentClient.uploadFile(stream, clientMoniker + "_agreement.pdf", false);
importAgreeFile(clientMoniker, manager, fileRes.getString("url"));
importAgreeFile(clientMoniker, manager, fileRes.getString("url"),false);
} catch (Exception e) {
logger.error("合同制作出现问题:", e);
} finally {
@ -1875,7 +1875,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
@Transactional
public void getAggregateAgreeFile(String clientMoniker, JSONObject manager) throws Exception {
public void getAggregateAgreeFile(String clientMoniker, JSONObject manager,boolean renewal) throws Exception {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
@ -1933,7 +1933,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
InputStream stream = new ByteArrayInputStream(bos.toByteArray());
JSONObject fileRes = attachmentClient.uploadFile(stream, clientMoniker + "_" + System.currentTimeMillis() + "_agreement.pdf", false);
if (fileRes != null) {
importAgreeFile(clientMoniker, manager, fileRes.getString("url"));
importAgreeFile(clientMoniker, manager, fileRes.getString("url"),renewal);
}
stream.close();
} catch (Exception e) {
@ -2019,7 +2019,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
@Transactional
public void importAgreeFile(String clientMoniker, JSONObject manager, String sourceFile) {
public void importAgreeFile(String clientMoniker, JSONObject manager, String sourceFile,boolean renewal) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
@ -2048,8 +2048,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
file.put("file_id", existFile.getString("file_id"));
clientFilesMapper.update(file);
}
client.put("open_status", 2);
clientMapper.update(client);
if(!renewal) {
client.put("open_status", 2);
clientMapper.update(client);
}
if (manager != null) {
saveClientAuditProcess(client.getIntValue("client_id"), 1, 2, "Compliance合同制作中", manager);

@ -439,7 +439,7 @@ public class PartnerManageController {
@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) throws Exception {
clientManager.getAggregateAgreeFile(clientMoniker, manager);
clientManager.getAggregateAgreeFile(clientMoniker, manager,false);
}
@ManagerMapping(value = "/{clientMoniker}/temp/export/pdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
@ -449,7 +449,7 @@ public class PartnerManageController {
@ManagerMapping(value = "/{clientMoniker}/import/agreepdf", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
public void importAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject source) throws Exception {
clientManager.importAgreeFile(clientMoniker, manager, source.getString("source_agree_file"));
clientManager.importAgreeFile(clientMoniker, manager, source.getString("source_agree_file"),false);
}
@ManagerMapping(value = "/{clientMoniker}/notify/completeAgree", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})

@ -54,7 +54,7 @@ public class ClientContractServiceImpl implements ClientContractService {
Date now = new Date();
if (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0) {
try {
clientManager.getAggregateAgreeFile(client.getString("client_moniker"), null);
clientManager.getAggregateAgreeFile(client.getString("client_moniker"), null,true);
} catch (Exception e) {
logger.info("App generate PDF failed");
throw new ServerErrorException("System error");

Loading…
Cancel
Save