485 lines
22 KiB
Plaintext
485 lines
22 KiB
Plaintext
|
package th.co.muangthai.endrprint.controller.service;
|
||
|
|
||
|
import org.apache.log4j.Logger;
|
||
|
import org.springframework.beans.BeanUtils;
|
||
|
import th.co.muangthai.endrprint.controller.AbstractMasterController;
|
||
|
import th.co.muangthai.endrprint.model.bean.form.MsgErrorForm;
|
||
|
import th.co.muangthai.endrprint.model.bean.form.data.PrinterDataTxtForm;
|
||
|
import th.co.muangthai.endrprint.model.bean.form.data.PrintingDataForm;
|
||
|
import th.co.muangthai.endrprint.model.bean.master.EndrUserLoginBean;
|
||
|
import th.co.muangthai.endrprint.model.bean.tmp.EndrTmpDataPrintBean;
|
||
|
import th.co.muangthai.endrprint.util.DateUtil;
|
||
|
import th.co.muangthai.endrprint.util.SessionUtil;
|
||
|
import th.co.muangthai.endrprint.util.TextContent;
|
||
|
import th.co.muangthai.endrprint.controller.service.ftp.FTPUtil;
|
||
|
|
||
|
import th.co.muangthai.endrprint.util.VSMUtil;
|
||
|
|
||
|
import javax.servlet.http.HttpServletRequest;
|
||
|
import java.io.*;
|
||
|
import java.io.File;
|
||
|
import java.math.BigDecimal;
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.Date;
|
||
|
import java.util.List;
|
||
|
|
||
|
/**
|
||
|
* Service Controller For ENDR001Controller
|
||
|
*/
|
||
|
public class ENDR001Service extends AbstractMasterController {
|
||
|
private Logger log = Logger.getLogger(ENDR001Service.class);
|
||
|
|
||
|
FTPUtil ftpService = new FTPUtil();
|
||
|
|
||
|
/**
|
||
|
* Insert ENDR data to temp and update data
|
||
|
* Save ENDR data to .dat file and transfer text file to server by ftp process
|
||
|
* Delete text file when transfer text file is complete
|
||
|
*
|
||
|
* @param request
|
||
|
* @param lstPrintingData - list of ENDR Print data
|
||
|
* @param serverId - Id of printer
|
||
|
* @return Object[] results
|
||
|
*/
|
||
|
public Object[] insertOrUpdateData(HttpServletRequest request, List<PrintingDataForm> lstPrintingData, BigDecimal serverId, BigDecimal sType) {
|
||
|
|
||
|
Object[] obj = new Object[1];
|
||
|
MsgErrorForm msgErrorForm = new MsgErrorForm();
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("0"));
|
||
|
msgErrorForm.setErrorDesc("Save successful");
|
||
|
obj[0] = msgErrorForm;
|
||
|
|
||
|
List<PrinterDataTxtForm> printerDataTxtFormList = new ArrayList<PrinterDataTxtForm>();
|
||
|
|
||
|
try {
|
||
|
EndrUserLoginBean loginForm = getUerLoginBean(request);
|
||
|
Date dateSave = new Date();
|
||
|
|
||
|
List<EndrTmpDataPrintBean> endrTmpDataPrintList = new ArrayList<EndrTmpDataPrintBean>();
|
||
|
EndrTmpDataPrintBean endrTmpDataPrintForm = new EndrTmpDataPrintBean();
|
||
|
|
||
|
String processId = DateUtil.toFormatString(new Date(), "ddMMyyyyHHmmss");
|
||
|
|
||
|
if (VSMUtil.isNotEmptyLst(lstPrintingData) && lstPrintingData.size() > 0) {
|
||
|
for (int i = 0; i < lstPrintingData.size(); i++) {
|
||
|
PrintingDataForm printingDataFormSet = new PrintingDataForm();
|
||
|
BeanUtils.copyProperties(lstPrintingData.get(i), printingDataFormSet);
|
||
|
|
||
|
endrTmpDataPrintForm = new EndrTmpDataPrintBean();
|
||
|
endrTmpDataPrintForm.setProcessId(processId);
|
||
|
endrTmpDataPrintForm.setTaskId(printingDataFormSet.getTaskId());
|
||
|
endrTmpDataPrintForm.setUserId(loginForm.getUserId());
|
||
|
endrTmpDataPrintForm.setServerId(serverId);
|
||
|
|
||
|
endrTmpDataPrintForm.setCreateBy(loginForm.getUserId());
|
||
|
endrTmpDataPrintForm.setCreateDate(dateSave);
|
||
|
endrTmpDataPrintForm.setUpdateBy(loginForm.getUserId());
|
||
|
endrTmpDataPrintForm.setUpdateDate(dateSave);
|
||
|
|
||
|
endrTmpDataPrintList.add(endrTmpDataPrintForm);
|
||
|
}
|
||
|
}
|
||
|
log.info("endrTmpDataPrintList size --> " + endrTmpDataPrintList.size());
|
||
|
log.info("processId --> " + processId);
|
||
|
boolean f = commonService.insertEndrTmpDataPrint(endrTmpDataPrintList);
|
||
|
|
||
|
if (!f) {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("1"));
|
||
|
msgErrorForm.setErrorDesc("Save error!!!");
|
||
|
} else {
|
||
|
|
||
|
//////////////////////////////////////////////////
|
||
|
// search data
|
||
|
printerDataTxtFormList = new ArrayList<PrinterDataTxtForm>();
|
||
|
printerDataTxtFormList = commonService.searchPrinterDataTxtFormPkg(processId, sType);
|
||
|
log.info("printerDataTxtFormList size --> " + printerDataTxtFormList.size());
|
||
|
if (VSMUtil.isNotEmptyLst(printerDataTxtFormList)) {
|
||
|
|
||
|
List<PrinterDataTxtForm> printerDataTxtFormListWrite = new ArrayList<PrinterDataTxtForm>();
|
||
|
List<PrinterDataTxtForm> printerDataTxtList = new ArrayList<PrinterDataTxtForm>();
|
||
|
PrinterDataTxtForm form = null;
|
||
|
|
||
|
for (int i = 0; i < printerDataTxtFormList.size(); i++) {
|
||
|
if (printerDataTxtFormList.size() == 1) {
|
||
|
printerDataTxtList = new ArrayList<PrinterDataTxtForm>();
|
||
|
form = new PrinterDataTxtForm();
|
||
|
form = printerDataTxtFormList.get(i);
|
||
|
printerDataTxtList.add(form);
|
||
|
form.setPrinterDataTxtLst(printerDataTxtList);
|
||
|
printerDataTxtFormListWrite.add(form);
|
||
|
} else {
|
||
|
if (printerDataTxtFormList.size() > i + 1) {
|
||
|
if (VSMUtil.isNotEmpty(printerDataTxtFormList.get(i).getDatJob())) {
|
||
|
if (printerDataTxtFormList.get(i).getDatJob().equals(printerDataTxtFormList.get(i + 1).getDatJob())) {
|
||
|
|
||
|
} else {
|
||
|
|
||
|
form = new PrinterDataTxtForm();
|
||
|
form = printerDataTxtFormList.get(i);
|
||
|
//printerDataTxtList.add(form);
|
||
|
|
||
|
printerDataTxtList = new ArrayList<PrinterDataTxtForm>();
|
||
|
for (int j = 0; j < printerDataTxtFormList.size(); j++) {
|
||
|
if (form.getDatJob().equals(printerDataTxtFormList.get(j).getDatJob())) {
|
||
|
PrinterDataTxtForm formSet = new PrinterDataTxtForm();
|
||
|
formSet = printerDataTxtFormList.get(j);
|
||
|
printerDataTxtList.add(formSet);
|
||
|
}
|
||
|
}
|
||
|
form.setPrinterDataTxtLst(printerDataTxtList);
|
||
|
printerDataTxtFormListWrite.add(form);
|
||
|
}
|
||
|
} else {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("1"));
|
||
|
msgErrorForm.setErrorDesc("record is not team");
|
||
|
obj[0] = msgErrorForm;
|
||
|
//return obj;
|
||
|
}
|
||
|
|
||
|
|
||
|
} else {
|
||
|
|
||
|
form = new PrinterDataTxtForm();
|
||
|
form = printerDataTxtFormList.get(i);
|
||
|
//printerDataTxtList.add(form);
|
||
|
|
||
|
printerDataTxtList = new ArrayList<PrinterDataTxtForm>();
|
||
|
for (int j = 0; j < printerDataTxtFormList.size(); j++) {
|
||
|
if (form.getDatJob().equals(printerDataTxtFormList.get(j).getDatJob())) {
|
||
|
PrinterDataTxtForm formSet = new PrinterDataTxtForm();
|
||
|
formSet = printerDataTxtFormList.get(j);
|
||
|
printerDataTxtList.add(formSet);
|
||
|
}
|
||
|
}
|
||
|
form.setPrinterDataTxtLst(printerDataTxtList);
|
||
|
printerDataTxtFormListWrite.add(form);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (printerDataTxtFormListWrite.size() > 0) {
|
||
|
List<PrinterDataTxtForm> lst = new ArrayList<PrinterDataTxtForm>();
|
||
|
for (PrinterDataTxtForm data : printerDataTxtFormListWrite) {
|
||
|
lst = new ArrayList<PrinterDataTxtForm>();
|
||
|
lst = data.getPrinterDataTxtLst();
|
||
|
|
||
|
//////////////////////////////////////////////////
|
||
|
// write text file
|
||
|
//Object[] objWriteTxt = writeTxtFile(printerDataTxtFormList ,request);
|
||
|
Object[] objWriteTxt = writeTxtFile(lst, request);
|
||
|
msgErrorForm = (MsgErrorForm) objWriteTxt[0];
|
||
|
String filePath = (String) objWriteTxt[1];
|
||
|
PrinterDataTxtForm dataSetting = (PrinterDataTxtForm) objWriteTxt[2];
|
||
|
|
||
|
if (getBigDecimal("0").equals(msgErrorForm.getErrorFlag())) {
|
||
|
|
||
|
String hostname = ""; // ip address
|
||
|
if (VSMUtil.IP_ADDR_PRINTER_PRO) {
|
||
|
// ipAddrProduction
|
||
|
hostname = dataSetting.getIpAddrProd();
|
||
|
} else {
|
||
|
// ipAddrUAT
|
||
|
hostname = dataSetting.getIpAddrUat(); //"10.22.145.154";
|
||
|
}
|
||
|
|
||
|
int port = 21; //port
|
||
|
String username = dataSetting.getFtpUsername(); // "Thawarom-BSD";
|
||
|
String password = dataSetting.getFtpPassword(); // "kireida";
|
||
|
|
||
|
String fileName = dataSetting.getDatJob() + ".dat"; //fileName.dat
|
||
|
String ftpDirectory = dataSetting.getFtpDirectory(); // directoryName
|
||
|
|
||
|
//////////////////////////////////////////////////
|
||
|
// ftp file upload
|
||
|
Object[] objFtpUpload = ftpUploadFile(hostname, port, username, password, filePath, fileName, ftpDirectory);
|
||
|
msgErrorForm = (MsgErrorForm) objFtpUpload[0];
|
||
|
if (getBigDecimal("0").equals(msgErrorForm.getErrorFlag())) {
|
||
|
msgErrorForm.setErrorDesc("Process successful");
|
||
|
}
|
||
|
|
||
|
String ftpDirectoryTmp = SessionUtil.getPathFile("100001");
|
||
|
if (VSMUtil.isNotEmpty(ftpDirectoryTmp)) {
|
||
|
|
||
|
Object[] objFtpUploadTmp = ftpUploadFile(hostname, port, username, password, filePath, fileName, ftpDirectory + ftpDirectoryTmp);
|
||
|
//msgErrorForm = (MsgErrorForm)objFtpUploadTmp[0];
|
||
|
//if (getBigDecimal("0").equals(msgErrorForm.getErrorFlag())){
|
||
|
// msgErrorForm.setErrorDesc("Process successful");
|
||
|
//}
|
||
|
}
|
||
|
|
||
|
|
||
|
//if (getBigDecimal("0").equals(msgErrorForm.getErrorFlag())){
|
||
|
//
|
||
|
// //////////////////////////////////////////////////
|
||
|
// // delete source file when upload file is successful
|
||
|
// Object[] objDeleteFile = deleteTxtFile(filePath);
|
||
|
// msgErrorForm = (MsgErrorForm)objDeleteFile[0];
|
||
|
// if (getBigDecimal("0").equals(msgErrorForm.getErrorFlag())){
|
||
|
// msgErrorForm.setErrorDesc("Process successful");
|
||
|
// }
|
||
|
//}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
boolean s = commonService.updateFinishFtp(processId, sType);
|
||
|
|
||
|
//if (!s){
|
||
|
|
||
|
//}
|
||
|
|
||
|
} else {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("1"));
|
||
|
msgErrorForm.setErrorDesc("No data found");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
} catch (Exception e) {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("1"));
|
||
|
msgErrorForm.setErrorDesc("Data not found ,Invalid team");
|
||
|
log.error(e.toString(), e);
|
||
|
}
|
||
|
obj[0] = msgErrorForm;
|
||
|
return obj;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Write/Save .dat file
|
||
|
*
|
||
|
* @param printerDataTxtFormList - list of ENDR Print data
|
||
|
* @return Object[] results
|
||
|
*/
|
||
|
public Object[] writeTxtFile(List<PrinterDataTxtForm> printerDataTxtFormList, HttpServletRequest request) {
|
||
|
|
||
|
Object[] obj = new Object[3];
|
||
|
MsgErrorForm msgErrorForm = new MsgErrorForm();
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("0"));
|
||
|
msgErrorForm.setErrorDesc("Save successful");
|
||
|
obj[0] = msgErrorForm;
|
||
|
|
||
|
String filePath = "";
|
||
|
//String filePathTest = SessionUtil.getPathFile("100000");
|
||
|
PrinterDataTxtForm dataSetting = new PrinterDataTxtForm();
|
||
|
|
||
|
try {
|
||
|
EndrUserLoginBean loginForm = getUerLoginBean(request);
|
||
|
|
||
|
if (printerDataTxtFormList.size() > 0) {
|
||
|
for (PrinterDataTxtForm dataSet : printerDataTxtFormList) {
|
||
|
dataSetting = new PrinterDataTxtForm();
|
||
|
dataSetting = dataSet;
|
||
|
//String a = SessionUtil.getPathFile("100000").substring(SessionUtil.getPathFile("100000").length()-1,SessionUtil.getPathFile("100000").length());
|
||
|
//String b = (dataSetting.getDatJob()+".dat").substring(0,1);
|
||
|
filePath = SessionUtil.getPathFile("100000") + dataSetting.getDatJob() + ".dat"; //"D://txt/"+dataSet.getDatJob()+".dat"; //filePath = dataSet.getDatJob();
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
log.info("writing file to " + filePath + " start ...");
|
||
|
log.info("writing file by " + loginForm.getUserId());
|
||
|
if (VSMUtil.isNotEmpty(dataSetting.getDatJob())) {
|
||
|
|
||
|
File createPath = new File(SessionUtil.getPathFile("100000"));
|
||
|
if (!createPath.exists()) {
|
||
|
createPath.mkdir();
|
||
|
}
|
||
|
// BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filePath) ,"UTF-8"));
|
||
|
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filePath), "TIS-620")); //
|
||
|
// BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filePath) ,"MS-874"));
|
||
|
|
||
|
|
||
|
if (printerDataTxtFormList.size() > 0) {
|
||
|
for (int i = 0; i < printerDataTxtFormList.size(); i++) {
|
||
|
PrinterDataTxtForm data = new PrinterDataTxtForm();
|
||
|
data = printerDataTxtFormList.get(i);
|
||
|
if (i == 0) {
|
||
|
if (VSMUtil.isNotEmpty(data.getDatPrinter()))
|
||
|
out.write(new String(data.getDatPrinter().getBytes(), "TIS-620"));
|
||
|
|
||
|
out.write("\r\n");
|
||
|
//out.newLine();
|
||
|
}
|
||
|
out.write(data.getDatData());
|
||
|
//out.newLine();
|
||
|
//out.write(VSMUtil.NEW_LINE);
|
||
|
out.write("\r\n");
|
||
|
}
|
||
|
}
|
||
|
//out.flush();
|
||
|
out.close();
|
||
|
log.info("write file to " + filePath + " successful ...");
|
||
|
} else {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("1"));
|
||
|
msgErrorForm.setErrorDesc("FileName is null !!!");
|
||
|
log.info("write file to " + filePath + " fail ,Invalid FileName.");
|
||
|
}
|
||
|
|
||
|
|
||
|
} catch (Exception e) {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("1"));
|
||
|
msgErrorForm.setErrorDesc(e.getMessage());
|
||
|
log.error(e.toString(), e);
|
||
|
}
|
||
|
obj[0] = msgErrorForm;
|
||
|
obj[1] = filePath;
|
||
|
obj[2] = dataSetting;
|
||
|
return obj;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Transfer/Upload .dat file to server by ftp process
|
||
|
*
|
||
|
* @param hostname - server ftp IP
|
||
|
* @param port - server ftp port
|
||
|
* @param username server ftp username login
|
||
|
* @param password server ftp password login
|
||
|
* @param localFileNames - path of source file
|
||
|
* @param remotePath - file name to transfer
|
||
|
* @param ftpDirectory - directory for destination
|
||
|
* @return Object[] results
|
||
|
*/
|
||
|
public Object[] ftpUploadFile(String hostname, int port, String username, String password, String localFileNames, String remotePath, String ftpDirectory) {
|
||
|
|
||
|
Object[] obj = new Object[1];
|
||
|
MsgErrorForm msgErrorForm = new MsgErrorForm();
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("0"));
|
||
|
msgErrorForm.setErrorDesc("Transfer file successful");
|
||
|
obj[0] = msgErrorForm;
|
||
|
|
||
|
try {
|
||
|
|
||
|
boolean a = ftpService.putFile(hostname, port, username, password, remotePath, localFileNames, ftpDirectory);
|
||
|
// boolean a = false;
|
||
|
if (a) {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("0"));
|
||
|
msgErrorForm.setErrorDesc("Transfer file successful");
|
||
|
} else {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("1"));
|
||
|
msgErrorForm.setErrorDesc("Transfer file fail");
|
||
|
}
|
||
|
|
||
|
} catch (Exception e) {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("1"));
|
||
|
msgErrorForm.setErrorDesc(e.getMessage());
|
||
|
log.error(e.toString(), e);
|
||
|
}
|
||
|
|
||
|
obj[0] = msgErrorForm;
|
||
|
return obj;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Delete source file when transfer successful
|
||
|
*
|
||
|
* @param pathFile - path file for delete
|
||
|
* @return Object[] results
|
||
|
*/
|
||
|
public Object[] deleteTxtFile(String pathFile) {
|
||
|
|
||
|
Object[] obj = new Object[3];
|
||
|
MsgErrorForm msgErrorForm = new MsgErrorForm();
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("0"));
|
||
|
msgErrorForm.setErrorDesc("Delete successful");
|
||
|
obj[0] = msgErrorForm;
|
||
|
|
||
|
try {
|
||
|
|
||
|
String pathFileForDelete = pathFile.replace("//", "\\");
|
||
|
pathFileForDelete = pathFileForDelete.replace("/", "\\");
|
||
|
|
||
|
File f = null;
|
||
|
f = new File(pathFileForDelete);
|
||
|
|
||
|
log.info("Delete file " + f + " start...");
|
||
|
boolean success = f.delete();
|
||
|
|
||
|
if (success) {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("0"));
|
||
|
msgErrorForm.setErrorDesc("Delete successful");
|
||
|
log.info("Delete file " + f + " successful...");
|
||
|
} else {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("1"));
|
||
|
msgErrorForm.setErrorDesc("Delete fail");
|
||
|
log.info("Delete file " + f + " fail...");
|
||
|
}
|
||
|
|
||
|
} catch (Exception e) {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("1"));
|
||
|
msgErrorForm.setErrorDesc(e.getMessage());
|
||
|
log.error(e.toString(), e);
|
||
|
}
|
||
|
obj[0] = msgErrorForm;
|
||
|
return obj;
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Insert ENDR data to temp and update data
|
||
|
* Save ENDR data to .dat file and transfer text file to server by ftp process
|
||
|
* Delete text file when transfer text file is complete
|
||
|
*
|
||
|
* @param request
|
||
|
* @param lstPrintingData - list of ENDR Print data
|
||
|
* @param serverId - Id of printer
|
||
|
* @return Object[] results
|
||
|
*/
|
||
|
public Object[] rejectData(HttpServletRequest request, List<PrintingDataForm> lstPrintingData, BigDecimal serverId, BigDecimal sType) {
|
||
|
|
||
|
Object[] obj = new Object[1];
|
||
|
MsgErrorForm msgErrorForm = new MsgErrorForm();
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("0"));
|
||
|
msgErrorForm.setErrorDesc("Save successful");
|
||
|
obj[0] = msgErrorForm;
|
||
|
|
||
|
try {
|
||
|
EndrUserLoginBean loginForm = getUerLoginBean(request);
|
||
|
Date dateSave = new Date();
|
||
|
|
||
|
List<EndrTmpDataPrintBean> endrTmpDataPrintList = new ArrayList<EndrTmpDataPrintBean>();
|
||
|
EndrTmpDataPrintBean endrTmpDataPrintForm = new EndrTmpDataPrintBean();
|
||
|
|
||
|
//String processId = DateUtil.toFormatString(new Date(), "ddMMyyyyHHmmss");
|
||
|
String processId = new Date().getTime() + "";
|
||
|
|
||
|
if (VSMUtil.isNotEmptyLst(lstPrintingData) && lstPrintingData.size() > 0) {
|
||
|
for (int i = 0; i < lstPrintingData.size(); i++) {
|
||
|
PrintingDataForm printingDataFormSet = new PrintingDataForm();
|
||
|
BeanUtils.copyProperties(lstPrintingData.get(i), printingDataFormSet);
|
||
|
|
||
|
endrTmpDataPrintForm = new EndrTmpDataPrintBean();
|
||
|
endrTmpDataPrintForm.setProcessId(processId);
|
||
|
endrTmpDataPrintForm.setTaskId(printingDataFormSet.getTaskId());
|
||
|
endrTmpDataPrintForm.setUserId(loginForm.getUserId());
|
||
|
endrTmpDataPrintForm.setServerId(serverId);
|
||
|
|
||
|
endrTmpDataPrintForm.setCreateBy(loginForm.getUserId());
|
||
|
endrTmpDataPrintForm.setCreateDate(dateSave);
|
||
|
endrTmpDataPrintForm.setUpdateBy(loginForm.getUserId());
|
||
|
endrTmpDataPrintForm.setUpdateDate(dateSave);
|
||
|
|
||
|
endrTmpDataPrintList.add(endrTmpDataPrintForm);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
boolean f = commonService.insertEndrTmpDataPrint(endrTmpDataPrintList);
|
||
|
|
||
|
if (!f) {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("1"));
|
||
|
msgErrorForm.setErrorDesc("Save error!!!");
|
||
|
} else {
|
||
|
|
||
|
boolean s = commonService.updateReject(processId, sType);
|
||
|
|
||
|
//if (!s){
|
||
|
//}
|
||
|
}
|
||
|
|
||
|
} catch (Exception e) {
|
||
|
msgErrorForm.setErrorFlag(getBigDecimal("1"));
|
||
|
msgErrorForm.setErrorDesc("Data not found");
|
||
|
log.error(e.toString(), e);
|
||
|
}
|
||
|
obj[0] = msgErrorForm;
|
||
|
return obj;
|
||
|
}
|
||
|
}
|