|
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
import nc.bs.dao.BaseDAO;
|
|
import nc.bs.dao.BaseDAO;
|
|
import nc.bs.dao.DAOException;
|
|
import nc.bs.dao.DAOException;
|
|
|
|
+import nc.bs.framework.common.InvocationInfoProxy;
|
|
import nc.bs.framework.common.NCLocator;
|
|
import nc.bs.framework.common.NCLocator;
|
|
import nc.bs.logging.Logger;
|
|
import nc.bs.logging.Logger;
|
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
|
@@ -25,6 +26,7 @@ import nccloud.framework.core.exception.ExceptionUtils;
|
|
import nccloud.framework.core.io.WebFile;
|
|
import nccloud.framework.core.io.WebFile;
|
|
import nccloud.framework.web.action.itf.ICommonAction;
|
|
import nccloud.framework.web.action.itf.ICommonAction;
|
|
import nccloud.framework.web.container.IRequest;
|
|
import nccloud.framework.web.container.IRequest;
|
|
|
|
+import nccloud.framework.web.container.SessionContext;
|
|
import nccloud.pubitf.riart.pflow.CloudPFlowContext;
|
|
import nccloud.pubitf.riart.pflow.CloudPFlowContext;
|
|
import nccloud.pubitf.riart.pflow.ICloudScriptPFlowService;
|
|
import nccloud.pubitf.riart.pflow.ICloudScriptPFlowService;
|
|
import nccloud.vo.zjnytwo_cd.zjnytwo_cd.BankaccountsHVOConst;
|
|
import nccloud.vo.zjnytwo_cd.zjnytwo_cd.BankaccountsHVOConst;
|
|
@@ -117,7 +119,7 @@ public class BankaccountsHVOImportAction implements ICommonAction {
|
|
* 校验单位映射是否正确
|
|
* 校验单位映射是否正确
|
|
*/
|
|
*/
|
|
public void judgment(BankaccountsBillVO bankaccountsBillVO) throws DAOException {
|
|
public void judgment(BankaccountsBillVO bankaccountsBillVO) throws DAOException {
|
|
-
|
|
|
|
|
|
+
|
|
String unit = "";
|
|
String unit = "";
|
|
String accountunit = "";
|
|
String accountunit = "";
|
|
String unitfather = "";
|
|
String unitfather = "";
|
|
@@ -180,7 +182,11 @@ public class BankaccountsHVOImportAction implements ICommonAction {
|
|
*/
|
|
*/
|
|
private BankaccountsBillVO showBankaccountsBillVOs() throws MetaDataException {
|
|
private BankaccountsBillVO showBankaccountsBillVOs() throws MetaDataException {
|
|
|
|
|
|
- String sql = "month = '"+String.valueOf(month)+"' and pk_org = '"+org+"' and dr = '0'";
|
|
|
|
|
|
+ Date date = new Date();
|
|
|
|
+ SimpleDateFormat SimpleDate = new SimpleDateFormat("yyyy");
|
|
|
|
+ String year = SimpleDate.format(date);
|
|
|
|
+
|
|
|
|
+ String sql = "month = '"+String.valueOf(month)+"' and pk_org = '"+org+"' and dr = '0' and def1 = '"+year+"'";
|
|
|
|
|
|
BankaccountsBillVO oldBankaccountsBillVO = getVO(sql);
|
|
BankaccountsBillVO oldBankaccountsBillVO = getVO(sql);
|
|
|
|
|
|
@@ -213,6 +219,7 @@ public class BankaccountsHVOImportAction implements ICommonAction {
|
|
/*
|
|
/*
|
|
* 导入表头
|
|
* 导入表头
|
|
*/
|
|
*/
|
|
|
|
+ @SuppressWarnings("static-access")
|
|
private BankaccountsHVO sethead(JSONArray headArray) throws Exception {
|
|
private BankaccountsHVO sethead(JSONArray headArray) throws Exception {
|
|
|
|
|
|
BankaccountsHVO bankaccountsHVO = new BankaccountsHVO();
|
|
BankaccountsHVO bankaccountsHVO = new BankaccountsHVO();
|
|
@@ -266,17 +273,46 @@ public class BankaccountsHVOImportAction implements ICommonAction {
|
|
bankaccountsHVO.setInputdate(new UFDate(Inputdate));//导入日期
|
|
bankaccountsHVO.setInputdate(new UFDate(Inputdate));//导入日期
|
|
bankaccountsHVO.setDbilldate(new UFDateTime(Dbilldate));//单据日期
|
|
bankaccountsHVO.setDbilldate(new UFDateTime(Dbilldate));//单据日期
|
|
|
|
|
|
-// String cuserid = AppContext.getInstance().getPkUser();
|
|
|
|
|
|
+ String cuserid = SessionContext.getInstance().getClientInfo().getUserid();
|
|
|
|
|
|
- bankaccountsHVO.setInputman(SqlQuery("cuserid", "sm_user", "user_code", headObject.getString("导入人"),"导入人"));
|
|
|
|
|
|
+ bankaccountsHVO.setInputman(cuserid);
|
|
bankaccountsHVO.setCode(headObject.getString("编码"));
|
|
bankaccountsHVO.setCode(headObject.getString("编码"));
|
|
bankaccountsHVO.setName(headObject.getString("名称"));
|
|
bankaccountsHVO.setName(headObject.getString("名称"));
|
|
bankaccountsHVO.setVnote(headObject.getString("备注"));
|
|
bankaccountsHVO.setVnote(headObject.getString("备注"));
|
|
|
|
|
|
|
|
+ if(headObject.getString("年份")==null) {
|
|
|
|
+ SimpleDateFormat SimpleDate = new SimpleDateFormat("yyyy");
|
|
|
|
+ String year = SimpleDate.format(date);
|
|
|
|
+ bankaccountsHVO.setDef1(year);
|
|
|
|
+ }else {
|
|
|
|
+ if (this.isNumber(headObject.getString("年份"))) {
|
|
|
|
+ bankaccountsHVO.setDef1(headObject.getString("年份"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
return bankaccountsHVO;
|
|
return bankaccountsHVO;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 判断年份
|
|
|
|
+ * @param str
|
|
|
|
+ * @return
|
|
|
|
+ * @throws Exception
|
|
|
|
+ */
|
|
|
|
+ private static boolean isNumber(String str) throws Exception{
|
|
|
|
+ String reg = "^[0-9]+(.[0-9]+)?$";
|
|
|
|
+ if(str.matches(reg)) {
|
|
|
|
+ if (str.length()>4 || str.length()<4) {
|
|
|
|
+ throw new Exception("请输入正确的年份!");
|
|
|
|
+ }else {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ throw new Exception("年份只允许填入数字,请检查!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* 导入表体
|
|
* 导入表体
|
|
*/
|
|
*/
|