@RequestMapping(value = "queryOaTempTech")
@ResponseBody
public Map<String, Object> queryOaTempTech(HttpServletRequest request, HttpServletResponse response) {
Map<String, Object> cusTechNumMap = new HashMap<String, Object>();
try {
String cusTechNums = request.getParameter("cusTechNums").toString().trim();
if (!StringUtils.isRealEmpty(cusTechNums)) {
OaTempTech temptech = new OaTempTech();
if (cusTechNums.contains("|")) {
String[] cusTechNumes = cusTechNums.split("\\|");
for (String str : cusTechNumes) {
if (!StringUtils.isRealEmpty(str)) {
temptech.setCusTechNum(str);
List<OaTempTech> list = oaTempTechService.findList(temptech);
if (list.size() > 0) {
OaTempTech temptech2 = list.get(0);
// 如果DCC审核意见没有填写,那么就认为流程没有走过这个节点
// 走过这个节点,后面的流程就是MES工程变更执行和结束
String sug = temptech2.getSug2();
if (StringUtils.isRealEmpty(sug)) {
String userName = temptech2.getUser().getName();
cusTechNumMap.put(temptech2.getCusTechNum(), "未在临技单流程执行完毕,请联系临技单申请人" + userName);
}
} else {
cusTechNumMap.put(str, "未在临技单流程中找到,请确认输入是否正确");
}
}
}
} else {
temptech.setCusTechNum(cusTechNums);
List<OaTempTech> list = oaTempTechService.findList(temptech);
if (list.size() > 0) {
OaTempTech temptech2 = list.get(0);
// 如果DCC审核意见没有填写,那么就认为流程没有走过这个节点
// 走过这个节点,后面的流程就是MES工程变更执行和结束
String sug = temptech2.getSug2();
if (StringUtils.isRealEmpty(sug)) {
String userName = temptech2.getUser().getName();
cusTechNumMap.put(temptech2.getCusTechNum(), "未在临技单流程执行完毕,请联系临技单申请人" + userName);
}
} else {
cusTechNumMap.put(cusTechNums, "未在临技单流程中找到,请确认输入是否正确");
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
if (cusTechNumMap.keySet().size() == 0) {
return null;
} else {
return cusTechNumMap;
}
}
页面处理方案:(for (var key in data) { })
success: function (data) {
if (data != null) {
var messages = ""
for (var key in data) {
var mess = '【' + '客户临技单号' + key + data[key] + '】' + '\n';
messages += mess;
}
flag = false;
top.$.jBox.tip(messages, "info", {persistent: true, opacity: 0, timeout: 5000});
return false;
}
}
@RequiresPermissions("production:productionorder:scProductionOrderSubject:edit")
@RequestMapping(value = "queryByPackageName")
@ResponseBody
public Map<String, Object> queryByPackageName(HttpServletRequest request, HttpServletResponse response, Model model)
throws JSONException {
Map<String, Object> mapList = new HashMap<String, Object>();
try {
// 获取输入的资料包名称
String packName = request.getParameter("packageName");
if (!StringUtils.isBlank(packName) && !"".equals(packName)) {
// 获取资料包主表相关信息
ScProductionPackageTitle packageTitle = new ScProductionPackageTitle();
packageTitle.setPackageName(packName);
/**************
* 因为是最新的版本的一个资料包, 所以 状态是审核通过的情况下面,版本号是最大的,set这两个条件进行查询
***********/
// 是否通过审核状态(0通过,1未通过)
packageTitle.setApproved("0");
List<ScProductionPackageTitle> packageTitleList = scProductionPackageTitleService
.findNewestPackageName(packageTitle);
if (packageTitleList.size() < 1) {
mapList.put("packageTitleList", "");
} else {
mapList.put("packageTitleList", packageTitleList);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return mapList;
}
页面处理方案:(for(var i=0;i 页面处理方案:(for(i=0;isuccess:function(data){
if(data.packageTitleList.length == 0){
/* 没有相关新版记录 */
top.$.jBox.tip("
";
for(var i=0;i<data.packageTitleList.length;i++){
num = num +1 ;
var titleId = data.packageTitleList[i].id;
var packageName = data.packageTitleList[i].packageName;
var titleVersion = data.packageTitleList[i].versionInformation;
var titleName = packageName + "_" + titleVersion;
var titleFalg = 0;
/* 新加生产通知书选择资料包的时候需要保存资料包的ECN、其他流程实例ID(otherProcInsId) */
var ecrNo = data.packageTitleList[i].ecrNo;
var ecnNo = data.packageTitleList[i].ecnNo;
var otherProcInsId = data.packageTitleList[i].otherProcInsId;
var oaCallType = data.packageTitleList[i].oaCallType;
tableContent += ' + num + '\">';
tableContent += ' ';
}
$("#packetVersionHtmlAppend").after(tableContent);
}
}
' + data.packageTitleList[i].packageName + '+' + data.packageTitleList[i].versionInformation + ' '
+"\""/* 查看 */
+ 'οnclick=\"queryCheckPackage(\'' + titleId +'\',\'' + titleName +'\',\'' + titleFalg +'\',\'' + ecrNo +'\',\''+ ecnNo + '\',\''+ otherProcInsId + '\',\''+ oaCallType +'\')\"> '
+' + num + '\" type=\"text\" value= \"' + data.packageTitleList[i].id + '\">
@RequiresPermissions("production:productionorder:scProductionOrderSubject:edit")
@RequestMapping(value = "queryByErp")
@ResponseBody
public List<Map<String, String>> queryByErp(HttpServletRequest request, HttpServletResponse response, Model model)
throws JSONException, SQLException {
List<Map<String, String>> list = new ArrayList<Map<String, String>>();
PreparedStatement pstmt = null;
Connection conn = null;
ResultSet rs = null;
try {
StringBuffer sql = new StringBuffer("");
if (!StringUtils.isBlank(singleAccount) && !"".equals(singleAccount)) {
conn = getConnection(singleAccount);
if (table.equals("dcsibb")) {
// 查询 DCSIBB 表
sql.append("SELECT * FROM DCSIBB WHERE IBB023='T' AND IBB015='N'");
if (!StringUtils.isBlank(ibbOne)) {
sql.append(" AND IBB001 LIKE '%" + ibbOne + "%'");
}
if (!StringUtils.isBlank(ibbTow)) {
sql.append(" AND IBB002 LIKE '%" + ibbTow + "%'");
}
}
pstmt = (PreparedStatement) conn.prepareStatement(sql.toString());
rs = pstmt.executeQuery();
while (rs.next()) {
if (table.equals("dcsibb")) {
String one = rs.getString("IBB001");
String tow = rs.getString("IBB002");
String three = rs.getString("IBB003");
String four = rs.getString("IBB004");
String fortyOne = rs.getString("IBB041");
String five = rs.getString("IBB005");
String six = rs.getString("IBB006");
String fourteen = rs.getString("IBB014");
String thirteen = rs.getString("IBB013");
Map<String, String> mapList = new HashMap<String, String>();
mapList.put("IBB001", one);
mapList.put("IBB002", tow);
mapList.put("IBB003", three);
mapList.put("IBB004", four);
mapList.put("IBB041", fortyOne);
mapList.put("IBB005", five);
mapList.put("IBB006", six);
mapList.put("IBB014", fourteen);
mapList.put("IBB013", thirteen);
list.add(mapList);
}
}
conn.close();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
rs.close();
pstmt.close();
}
return list;
}
success:function(data){
if(data != null){
var context=""
dataList = data; //集合赋值
for(i=0;i<data.length;i++){
var cont ="";
cont +="
";
context += cont;
}
$("#met_body").html(context);
}
}
";
cont +=" "+ data[i].IBB001+" ";
cont +=""+ data[i].IBB002+" ";
cont +=""+ data[i].IBB003+" ";
cont +=""+ data[i].IBB004+" ";
cont +=""+ data[i].IBB041+" ";
cont +=""+ data[i].IBB005+" ";
cont +=""+ data[i].IBB006+" ";
cont +=""+ data[i].IBB014+" ";
cont +=""+ data[i].IBB013+"