|
|
|
@ -60,91 +60,93 @@ public class ZSRM_PUR_INFO_CheckAction extends BaseBean implements Action, EsbSe
|
|
|
|
|
}
|
|
|
|
|
logger_9ad0d62b.error("xxjllx -----"+ xxjllx);
|
|
|
|
|
DetailTable[] detailtable1 = requestinfo.getDetailTableInfo().getDetailTable();
|
|
|
|
|
logger_9ad0d62b.error("workflow_action_ZSRM_PUR_INFO_CheckAction detailtable1---->"+ JSONObject.toJSONString(detailtable1));
|
|
|
|
|
DetailTable dtq1 = detailtable1[1];
|
|
|
|
|
Row[] sq1 = dtq1.getRow();
|
|
|
|
|
|
|
|
|
|
logger_9ad0d62b.error("sq1 -----"+ sq1.toString());
|
|
|
|
|
if ("4".equals(xxjllx)) {
|
|
|
|
|
logger_9ad0d62b.error("sq1.length -----"+ sq1.length);
|
|
|
|
|
if (sq1.length == 0) {
|
|
|
|
|
requestinfo.getRequestManager().setMessageid("ERROR");
|
|
|
|
|
requestinfo.getRequestManager().setMessagecontent("请填写黄金实际价信息明细!");
|
|
|
|
|
return WeaResult.fail(500, "请填写黄金实际价信息明细!", getResultMapForAction(weaverResultMap, "result", "", requestinfo.getRequestManager()));
|
|
|
|
|
}
|
|
|
|
|
Set<String> set = new HashSet<String>();
|
|
|
|
|
for (int k = 0; k < sq1.length; k++) {
|
|
|
|
|
Row r = sq1[k];
|
|
|
|
|
Cell[] c = r.getCell();
|
|
|
|
|
for (int l = 0; l < c.length; l++) {
|
|
|
|
|
Cell mc = c[l];
|
|
|
|
|
String named = mc.getName().toUpperCase();
|
|
|
|
|
String valued = Util.null2String(mc.getValue());
|
|
|
|
|
if ("GSDM".equals(named)) {
|
|
|
|
|
set.add(valued);
|
|
|
|
|
if(detailtable1.length >1){
|
|
|
|
|
DetailTable dtq1 = detailtable1[1];
|
|
|
|
|
Row[] sq1 = dtq1.getRow();
|
|
|
|
|
logger_9ad0d62b.error("sq1 -----"+ sq1.toString());
|
|
|
|
|
if ("4".equals(xxjllx)) {
|
|
|
|
|
logger_9ad0d62b.error("sq1.length -----"+ sq1.length);
|
|
|
|
|
if (sq1.length == 0) {
|
|
|
|
|
requestinfo.getRequestManager().setMessageid("ERROR");
|
|
|
|
|
requestinfo.getRequestManager().setMessagecontent("请填写黄金实际价信息明细!");
|
|
|
|
|
return WeaResult.fail(500, "请填写黄金实际价信息明细!", getResultMapForAction(weaverResultMap, "result", "", requestinfo.getRequestManager()));
|
|
|
|
|
}
|
|
|
|
|
Set<String> set = new HashSet<String>();
|
|
|
|
|
for (int k = 0; k < sq1.length; k++) {
|
|
|
|
|
Row r = sq1[k];
|
|
|
|
|
Cell[] c = r.getCell();
|
|
|
|
|
for (int l = 0; l < c.length; l++) {
|
|
|
|
|
Cell mc = c[l];
|
|
|
|
|
String named = mc.getName().toUpperCase();
|
|
|
|
|
String valued = Util.null2String(mc.getValue());
|
|
|
|
|
if ("GSDM".equals(named)) {
|
|
|
|
|
set.add(valued);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (set.size() > 1) {
|
|
|
|
|
requestinfo.getRequestManager().setMessageid("ERROR");
|
|
|
|
|
requestinfo.getRequestManager().setMessagecontent("黄金实际价信息多行明细里的公司代码要保持一致!");
|
|
|
|
|
return WeaResult.fail(500, "黄金实际价信息多行明细里的公司代码要保持一致!", getResultMapForAction(weaverResultMap, "result", "", requestinfo.getRequestManager()));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (sq1.length > 0) {
|
|
|
|
|
requestinfo.getRequestManager().setMessageid("ERROR");
|
|
|
|
|
requestinfo.getRequestManager().setMessagecontent("信息记录类型不是黄金实际价时,不需要填写黄金实际价信息明细!");
|
|
|
|
|
return WeaResult.fail(500, "信息记录类型不是黄金实际价时,不需要填写黄金实际价信息明细!", getResultMapForAction(weaverResultMap, "result", "", requestinfo.getRequestManager()));
|
|
|
|
|
if (set.size() > 1) {
|
|
|
|
|
requestinfo.getRequestManager().setMessageid("ERROR");
|
|
|
|
|
requestinfo.getRequestManager().setMessagecontent("黄金实际价信息多行明细里的公司代码要保持一致!");
|
|
|
|
|
return WeaResult.fail(500, "黄金实际价信息多行明细里的公司代码要保持一致!", getResultMapForAction(weaverResultMap, "result", "", requestinfo.getRequestManager()));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (sq1.length > 0) {
|
|
|
|
|
requestinfo.getRequestManager().setMessageid("ERROR");
|
|
|
|
|
requestinfo.getRequestManager().setMessagecontent("信息记录类型不是黄金实际价时,不需要填写黄金实际价信息明细!");
|
|
|
|
|
return WeaResult.fail(500, "信息记录类型不是黄金实际价时,不需要填写黄金实际价信息明细!", getResultMapForAction(weaverResultMap, "result", "", requestinfo.getRequestManager()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DetailTable[] detailtable = requestinfo.getDetailTableInfo().getDetailTable();
|
|
|
|
|
logger_9ad0d62b.error("workflow_action_ZSRM_PUR_INFO_CheckAction detailtable---->"+ JSONObject.toJSONString(detailtable));
|
|
|
|
|
DetailTable dtq = detailtable[0];
|
|
|
|
|
logger_9ad0d62b.error("workflow_action_ZSRM_PUR_INFO_CheckAction dtq---->"+ JSONObject.toJSONString(dtq));
|
|
|
|
|
Row[] sq = dtq.getRow();
|
|
|
|
|
if (sq.length > 0) {
|
|
|
|
|
String[][] str = new String[sq.length][21];
|
|
|
|
|
for (int j = 0; j < sq.length; j++) {
|
|
|
|
|
Row rq = sq[j];
|
|
|
|
|
Cell[] cq = rq.getCell();
|
|
|
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
|
|
|
for (int k = 0; k < cq.length; k++) {
|
|
|
|
|
Cell cq1 = cq[k];
|
|
|
|
|
String nameq = cq1.getName().toUpperCase();
|
|
|
|
|
String valueq = Util.null2String(cq1.getValue());
|
|
|
|
|
map.put(nameq, valueq);
|
|
|
|
|
if(detailtable.length >0){
|
|
|
|
|
DetailTable dtq = detailtable[0];
|
|
|
|
|
logger_9ad0d62b.error("workflow_action_ZSRM_PUR_INFO_CheckAction dtq---->"+ JSONObject.toJSONString(dtq));
|
|
|
|
|
Row[] sq = dtq.getRow();
|
|
|
|
|
if (sq.length > 0) {
|
|
|
|
|
String[][] str = new String[sq.length][21];
|
|
|
|
|
for (int j = 0; j < sq.length; j++) {
|
|
|
|
|
Row rq = sq[j];
|
|
|
|
|
Cell[] cq = rq.getCell();
|
|
|
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
|
|
|
for (int k = 0; k < cq.length; k++) {
|
|
|
|
|
Cell cq1 = cq[k];
|
|
|
|
|
String nameq = cq1.getName().toUpperCase();
|
|
|
|
|
String valueq = Util.null2String(cq1.getValue());
|
|
|
|
|
map.put(nameq, valueq);
|
|
|
|
|
}
|
|
|
|
|
logger_9ad0d62b.error("map -----"+ map);
|
|
|
|
|
str[j][0] = requestid + "_" + j;
|
|
|
|
|
str[j][1] = map.get("MXCGZZ");
|
|
|
|
|
str[j][2] = map.get("CGZ");
|
|
|
|
|
str[j][3] = map.get("MXWL");
|
|
|
|
|
str[j][4] = map.get("GYSZHH");
|
|
|
|
|
str[j][5] = map.get("DDDW");
|
|
|
|
|
str[j][6] = map.get("JBDW");
|
|
|
|
|
str[j][7] = map.get("JBDWFZ");
|
|
|
|
|
str[j][8] = map.get("ZSDLS");
|
|
|
|
|
str[j][9] = map.get("BZDLS");
|
|
|
|
|
str[j][10] = map.get("YTJJHSJ");
|
|
|
|
|
str[j][11] = map.get("XSGMSDM");
|
|
|
|
|
str[j][12] = map.get("JLFL");
|
|
|
|
|
str[j][13] = map.get("YXQSRQ").replaceAll("-", "");
|
|
|
|
|
str[j][14] = map.get("YXJZRQ").replaceAll("-", "");
|
|
|
|
|
str[j][15] = map.get("JJG");
|
|
|
|
|
str[j][16] = map.get("JGDW");
|
|
|
|
|
str[j][17] = map.get("GYSWLZ");
|
|
|
|
|
str[j][18] = "X";
|
|
|
|
|
str[j][19] = map.get("HB");
|
|
|
|
|
str[j][20] = requestid;
|
|
|
|
|
}
|
|
|
|
|
logger_9ad0d62b.error("map -----"+ map);
|
|
|
|
|
str[j][0] = requestid + "_" + j;
|
|
|
|
|
str[j][1] = map.get("MXCGZZ");
|
|
|
|
|
str[j][2] = map.get("CGZ");
|
|
|
|
|
str[j][3] = map.get("MXWL");
|
|
|
|
|
str[j][4] = map.get("GYSZHH");
|
|
|
|
|
str[j][5] = map.get("DDDW");
|
|
|
|
|
str[j][6] = map.get("JBDW");
|
|
|
|
|
str[j][7] = map.get("JBDWFZ");
|
|
|
|
|
str[j][8] = map.get("ZSDLS");
|
|
|
|
|
str[j][9] = map.get("BZDLS");
|
|
|
|
|
str[j][10] = map.get("YTJJHSJ");
|
|
|
|
|
str[j][11] = map.get("XSGMSDM");
|
|
|
|
|
str[j][12] = map.get("JLFL");
|
|
|
|
|
str[j][13] = map.get("YXQSRQ").replaceAll("-", "");
|
|
|
|
|
str[j][14] = map.get("YXJZRQ").replaceAll("-", "");
|
|
|
|
|
str[j][15] = map.get("JJG");
|
|
|
|
|
str[j][16] = map.get("JGDW");
|
|
|
|
|
str[j][17] = map.get("GYSWLZ");
|
|
|
|
|
str[j][18] = "X";
|
|
|
|
|
str[j][19] = map.get("HB");
|
|
|
|
|
str[j][20] = requestid;
|
|
|
|
|
}
|
|
|
|
|
ZSRM_PUR_INFO info = new ZSRM_PUR_INFO();
|
|
|
|
|
String[] ret = info.Getexecute(str);
|
|
|
|
|
logger_9ad0d62b.error(String.valueOf("ZSRM_PUR_INFO_CheckAction-return-" + requestid + "-[" + ret[0] + "," + ret[1] + "]"));
|
|
|
|
|
if (!"S".equals(ret[0])) {
|
|
|
|
|
requestinfo.getRequestManager().setMessageid("ERROR");
|
|
|
|
|
requestinfo.getRequestManager().setMessagecontent("SAP返回错误信息:" + ret[1]);
|
|
|
|
|
return WeaResult.fail(500, "SAP返回错误信息:" + ret[1], getResultMapForAction(weaverResultMap, "result", "", requestinfo.getRequestManager()));
|
|
|
|
|
ZSRM_PUR_INFO info = new ZSRM_PUR_INFO();
|
|
|
|
|
String[] ret = info.Getexecute(str);
|
|
|
|
|
logger_9ad0d62b.error(String.valueOf("ZSRM_PUR_INFO_CheckAction-return-" + requestid + "-[" + ret[0] + "," + ret[1] + "]"));
|
|
|
|
|
if (!"S".equals(ret[0])) {
|
|
|
|
|
requestinfo.getRequestManager().setMessageid("ERROR");
|
|
|
|
|
requestinfo.getRequestManager().setMessagecontent("SAP返回错误信息:" + ret[1]);
|
|
|
|
|
return WeaResult.fail(500, "SAP返回错误信息:" + ret[1], getResultMapForAction(weaverResultMap, "result", "", requestinfo.getRequestManager()));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|