/**
 * OpenCPS is the open source Core Public Services software
 * Copyright (C) 2016-present OpenCPS community
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>
 */

package org.opencps.jms.business;

import org.opencps.jms.message.body.PaymentFileMsgBody;
import org.opencps.paymentmgt.model.PaymentFile;


/**
 * @author khoavd
 *
 */
public class SubmitPaymentFile {

	/**
	 * @param paymentFileMsgBody
	 * @return
	 */
	public PaymentFile syncPaymentFile(PaymentFileMsgBody paymentFileMsgBody) {

		return null;
	}
}

@@ -903,34 +903,352 @@
 le;%0A
-%0A%0A/**%0A * @author khoavd%0A *
+import org.opencps.paymentmgt.service.PaymentFileLocalServiceUtil;%0Aimport org.opencps.util.WebKeys;%0A%0Aimport com.liferay.portal.kernel.exception.PortalException;%0Aimport com.liferay.portal.kernel.exception.SystemException;%0Aimport com.liferay.portal.kernel.util.StringPool;%0Aimport com.liferay.portal.service.ServiceContext;%0A%0A/**%0A * @author trungnt
 %0A */
@@ -1329,16 +1329,72 @@
 @return%0A
+%09 * @throws SystemException%0A%09 * @throws PortalException%0A
 %09 */%0A%09pu
@@ -1468,28 +1468,1361 @@
 ody)
- %7B%0A%0A%09%09return null
+%0A%09%09throws SystemException, PortalException %7B%0A%0A%09%09String oId = paymentFileMsgBody.getOid();%0A%0A%09%09System.out.println(%22###############################################SubmitPaymentFile OID %22 +%0A%09%09%09oId);%0A%0A%09%09System.out.println(%22###############################################paymentFileMsgBody.getTypeUpdate() %22 +%0A%09%09%09paymentFileMsgBody.getTypeUpdate());%0A%0A%09%09PaymentFile paymentFile =%0A%09%09%09PaymentFileLocalServiceUtil.getPaymentFileByOID(oId);%0A%0A%09%09ServiceContext serviceContext = paymentFileMsgBody.getServiceContext();%0A%0A%09%09serviceContext.setAddGroupPermissions(true);%0A%09%09serviceContext.setAddGuestPermissions(true);%0A%0A%09%09String sourceFileName =%0A%09%09%09paymentFileMsgBody != null ? paymentFile.getPaymentFileId() +%0A%09%09%09%09StringPool.DASH + paymentFileMsgBody.getFileTitle() +%0A%09%09%09%09StringPool.DASH + System.currentTimeMillis() : StringPool.BLANK;%0A%0A%09%09paymentFile =%0A%09%09%09PaymentFileLocalServiceUtil.syncPaymentFile(%0A%09%09%09%09oId, paymentFileMsgBody.getTypeUpdate(),%0A%09%09%09%09paymentFileMsgBody.getPaymentStatus(),%0A%09%09%09%09paymentFileMsgBody.getPaymentMethod(),%0A%09%09%09%09paymentFileMsgBody.getApproveNote(),%0A%09%09%09%09paymentFileMsgBody.getConfirmFileEntry(), sourceFileName,%0A%09%09%09%09paymentFileMsgBody.getMimeType(), paymentFileMsgBody != null%0A%09%09%09%09%09? paymentFileMsgBody.getFileTitle() : StringPool.BLANK,%0A%09%09%09%09paymentFileMsgBody.getFileDescription(), StringPool.BLANK,%0A%09%09%09%09serviceContext);%0A%0A%09%09return paymentFile
 ;%0A%09%7D%0A
+%0A
 %7D%0A

Update method syncPaymentFile