Commit 45ba1827 by liuyang

Merge branch 'dev' of http://git.pseer.com/platform/hp-smart into dev

parents a0f136fe 319bb65c
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC010"> <select id="query" resultClass="com.baosight.hpjx.hp.kc.domain.HPKC010">
SELECT <include refid="column"/> SELECT <include refid="column"/>
FROM hpjx.T_HPKC010 FROM hpjx.T_HPKC010
WHERE 1=1 WHERE 1=1 AND AMOUNT!=0
<include refid="condition"/> <include refid="condition"/>
<include refid="customCondition"/> <include refid="customCondition"/>
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
......
...@@ -44,11 +44,15 @@ public class ServiceHPMT001 extends ServiceBase { ...@@ -44,11 +44,15 @@ public class ServiceHPMT001 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
public EiInfo pmOverview(EiInfo inInfo) { public Map pmOverview(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String queryMonth = inInfo.getString("queryMonth"); String queryMonth = inInfo.getString("queryMonth");
String companyCode = UserSessionUtils.getCompanyCode(); String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) { if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常"); resultMap.put("status", 403);
resultMap.put("message","票据过期或请求不合法,请重新登录或获取合法权限!");
return resultMap;
} }
Map sqlMap = new HashMap(); Map sqlMap = new HashMap();
sqlMap.put("queryMonth", queryMonth); sqlMap.put("queryMonth", queryMonth);
...@@ -56,9 +60,7 @@ public class ServiceHPMT001 extends ServiceBase { ...@@ -56,9 +60,7 @@ public class ServiceHPMT001 extends ServiceBase {
List<Map> row1 = this.dao.query("HPMT001.pmOverview1", sqlMap);//目标 List<Map> row1 = this.dao.query("HPMT001.pmOverview1", sqlMap);//目标
List<Map> row2 = this.dao.query("HPMT001.pmOverview2", sqlMap);//实际 List<Map> row2 = this.dao.query("HPMT001.pmOverview2", sqlMap);//实际
List<Map> rows = new ArrayList<>(); List<Map> rows = new ArrayList<>();
Map resultMap = new HashMap();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM"); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");
try {
Date parse = sdf.parse(queryMonth); Date parse = sdf.parse(queryMonth);
Calendar instance = Calendar.getInstance(); Calendar instance = Calendar.getInstance();
instance.setTime(parse); instance.setTime(parse);
...@@ -132,15 +134,13 @@ public class ServiceHPMT001 extends ServiceBase { ...@@ -132,15 +134,13 @@ public class ServiceHPMT001 extends ServiceBase {
resultMap.put("actualWt_h_yoy", actualWt.subtract(actualWt2).divide(actualWt2,BigDecimal.ROUND_UP). resultMap.put("actualWt_h_yoy", actualWt.subtract(actualWt2).divide(actualWt2,BigDecimal.ROUND_UP).
multiply(new BigDecimal(100)).doubleValue()); multiply(new BigDecimal(100)).doubleValue());
} }
rows.add(resultMap); resultMap.put("status",EiConstant.STATUS_SUCCESS);
EiInfo outInfo = new EiInfo(); resultMap.put("message","SUCCESS");
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock); return resultMap;
eiBlock.setRows(rows); } catch (Exception e) {
outInfo.setBlock(eiBlock); resultMap.put("status", 500);
return outInfo; resultMap.put("message",LogUtils.getMsg(e));
} catch (ParseException e) { return resultMap;
e.printStackTrace();
return inInfo;
} }
} }
...@@ -151,24 +151,31 @@ public class ServiceHPMT001 extends ServiceBase { ...@@ -151,24 +151,31 @@ public class ServiceHPMT001 extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
public EiInfo pmBenchmarking(EiInfo inInfo) { public Map pmBenchmarking(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String queryMonth = inInfo.getString("queryMonth"); String queryMonth = inInfo.getString("queryMonth");
String companyCode = UserSessionUtils.getCompanyCode(); String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) { if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常"); resultMap.put("status", 403);
resultMap.put("message","票据过期或请求不合法,请重新登录或获取合法权限!");
return resultMap;
} }
Map sqlMap = new HashMap(); Map sqlMap = new HashMap();
sqlMap.put("queryMonth", queryMonth); sqlMap.put("queryMonth", queryMonth);
sqlMap.put("companyCode", companyCode); sqlMap.put("companyCode", companyCode);
List<Map> rows = this.dao.query("HPMT001.pmBenchmarking", sqlMap); List<Map> rows = this.dao.query("HPMT001.pmBenchmarking", sqlMap);
List<Map> rows2 = this.dao.query("HPMT001.pmBenchmarking2", sqlMap); List<Map> rows2 = this.dao.query("HPMT001.pmBenchmarking2", sqlMap);
EiInfo outInfo = new EiInfo(); resultMap.put("result",rows);
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock); resultMap.put("result2",rows2);
eiBlock.setRows(rows); resultMap.put("status",EiConstant.STATUS_SUCCESS);
outInfo.setBlock(eiBlock); resultMap.put("message","SUCCESS");
outInfo.set("cout",rows2); return resultMap;
} catch (Exception e) {
return outInfo; resultMap.put("status", 500);
resultMap.put("message",LogUtils.getMsg(e));
return resultMap;
}
} }
} }
...@@ -312,7 +312,7 @@ ...@@ -312,7 +312,7 @@
<select id="queryFvalue" resultClass="java.util.HashMap"> <select id="queryFvalue" resultClass="java.util.HashMap">
SELECT FVALUE AS "fvalue" FROM iplat.TEDCC03 WHERE FKEY='docRootDir' SELECT DISTINCT FVALUE AS "fvalue" FROM iplat.TEDCC03 WHERE FKEY='docRootDir'
</select> </select>
......
package com.baosight.hpjx.hp.mt.untils; package com.baosight.hpjx.hp.mt.untils;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.iplat4j.core.data.ibatis.dao.Dao; import com.baosight.iplat4j.core.data.ibatis.dao.Dao;
import com.baosight.iplat4j.core.data.id.UUIDHexIdGenerator; import com.baosight.iplat4j.core.data.id.UUIDHexIdGenerator;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
...@@ -44,10 +45,12 @@ public class UploadUtils { ...@@ -44,10 +45,12 @@ public class UploadUtils {
filePath = multipartFile.getOriginalFilename(); filePath = multipartFile.getOriginalFilename();
Long docSize = multipartFile.getSize(); Long docSize = multipartFile.getSize();
String chgName = transformFileName(filePath); String chgName = transformFileName(filePath);
System.out.println("----------------------------------解析Path");
String attachmentName; String attachmentName;
Map<String, String> pathMap = getRealPath("A"); Map<String, String> pathMap = getRealPath("A");
msg = (String)pathMap.get("dirId"); msg = (String)pathMap.get("dirId");
category = (String)pathMap.get("path"); category = (String)pathMap.get("path");
System.out.println("----------------------------------获取dirId成功");
checkInvalidPath(category); checkInvalidPath(category);
File dir = new File(category); File dir = new File(category);
if (!dir.exists()) { if (!dir.exists()) {
...@@ -116,7 +119,10 @@ public class UploadUtils { ...@@ -116,7 +119,10 @@ public class UploadUtils {
public static Map<String, String> getRealPath(String path) { public static Map<String, String> getRealPath(String path) {
String postPath = preparePath(path); String postPath = preparePath(path);
String dirId = initPath(postPath); String dirId = initPath(postPath);
List<Map> query = dao.query("HPMT002.queryFvalue"); Map hashMap = new HashMap();
hashMap.put("fkey","docRootDir");
List<Map> query = DaoBase.getInstance().query("EDCC03.query",hashMap);
System.out.println("----------------------------------获取path地址");
if (query.get(0).get("fvalue")!=null) { if (query.get(0).get("fvalue")!=null) {
ROOT_PATH= (String) query.get(0).get("fvalue"); ROOT_PATH= (String) query.get(0).get("fvalue");
} }
......
package com.baosight.hpjx.hp.mt.untils; package com.baosight.hpjx.hp.mt.untils;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.iplat4j.core.data.ibatis.dao.Dao; import com.baosight.iplat4j.core.data.ibatis.dao.Dao;
import com.baosight.iplat4j.core.data.id.UUIDHexIdGenerator; import com.baosight.iplat4j.core.data.id.UUIDHexIdGenerator;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
...@@ -13,17 +14,17 @@ import com.baosight.iplat4j.eu.dm.util.FileProcessUtils; ...@@ -13,17 +14,17 @@ import com.baosight.iplat4j.eu.dm.util.FileProcessUtils;
import com.baosight.iplat4j.eu.dm.util.IFileUploader; import com.baosight.iplat4j.eu.dm.util.IFileUploader;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Base64;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartFile; import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class UploadUtils2 { public class UploadUtils2 {
private static Dao dao = (Dao)PlatApplicationContext.getApplicationContext().getBean("dao"); private static Dao dao = (Dao)PlatApplicationContext.getApplicationContext().getBean("dao");
...@@ -32,10 +33,9 @@ public class UploadUtils2 { ...@@ -32,10 +33,9 @@ public class UploadUtils2 {
String docName = multipartFile.getOriginalFilename(); String docName = multipartFile.getOriginalFilename();
Long docSize = multipartFile.getSize(); Long docSize = multipartFile.getSize();
HashMap<String, String> inMap = new HashMap(); HashMap<String, String> inMap = new HashMap();
inMap.put("groupId", "hk_file11");
Map<String, String> returnMap = null; inMap.put("configPathDefine", "A");
Map<String, String> returnMap = PlatFileUploadUtils.uploadFile(multipartFile, inMap);
returnMap = PlatFileUploadUtils.uploadFile(multipartFile, inMap);
String docId = (String)returnMap.get("docId"); String docId = (String)returnMap.get("docId");
String docUrl = (String)returnMap.get("docUrl"); String docUrl = (String)returnMap.get("docUrl");
docId = docId == null ? "" : docId; docId = docId == null ? "" : docId;
...@@ -45,15 +45,13 @@ public class UploadUtils2 { ...@@ -45,15 +45,13 @@ public class UploadUtils2 {
} else { } else {
documentJSON.remove("docUrl"); documentJSON.remove("docUrl");
} }
documentJSON.put("groupId", returnMap.get("groupId") == null ? "" : returnMap.get("groupId")); documentJSON.put("groupId", returnMap.get("groupId") == null ? "" : returnMap.get("groupId"));
documentJSON.put("docName", docName); documentJSON.put("docName", docName);
documentJSON.put("docSize", docSize); documentJSON.put("docSize", docSize);
documentJSON.put("docType", docName.substring(docName.lastIndexOf(46))); documentJSON.put("docType", docName.substring(docName.lastIndexOf(46)));
return documentJSON; return documentJSON;
}
}
} }
...@@ -96,7 +96,7 @@ public class ServiceHPPZ015 extends ServiceBase { ...@@ -96,7 +96,7 @@ public class ServiceHPPZ015 extends ServiceBase {
HPPZ015.setProjCode(hpsc001.getProjCode()); HPPZ015.setProjCode(hpsc001.getProjCode());
HPPZ015.setTemplateName(inInfo.getString("templateName")); HPPZ015.setTemplateName(inInfo.getString("templateName"));
HPPZ015.setCreatedBy(UserSession.getUserId()); HPPZ015.setCreatedBy(UserSession.getUserId());
HPPZ015.setCompanyCode(UserSession.getUserId()); HPPZ015.setCompanyCode(UserSessionUtils.getCompanyCode());
HPPZ015.setCreatedName(UserSession.getUserId()+"-"+UserSession.getLoginCName()); HPPZ015.setCreatedName(UserSession.getUserId()+"-"+UserSession.getLoginCName());
HPPZ015.setCreatedTime(sdf.format(new Date())); HPPZ015.setCreatedTime(sdf.format(new Date()));
HPPZ015.setUpdatedBy(null); HPPZ015.setUpdatedBy(null);
......
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
</select> </select>
<!-- 查询组织信息 --> <!-- 查询组织信息 -->
<select id="queryTedcm01" resultClass="com.baosight.iplat4j.common.ed.domain.TEDCM01"> <select id="queryTedcm01" resultClass="java.util.HashMap">
SELECT SELECT
ITEM_CODE AS "itemCode", ITEM_CODE AS "itemCode",
ITEM_CNAME AS "itemCname" ITEM_CNAME AS "itemCname"
......
...@@ -381,26 +381,8 @@ function checkIn(id) { ...@@ -381,26 +381,8 @@ function checkIn(id) {
callbackName: checkInCallback callbackName: checkInCallback
}); });
} }
checkInCallback = function () { checkInCallback = function (e) {
var block = detailGrid.getEiBlock(); detailGrid.setEiInfo(e);
var result = resultGrid.getCheckedRows()
if (rows.length < 1) {
message("请选择数据");
return;
}
if (block != null) {
block.setRows([]);
detailGrid.setEiBlock(block);
}
var info = new EiInfo()
var productionOrderNo = result[0]['prodOrderNo'];
info.set("productionOrderNo",productionOrderNo);
EiCommunicator.send("HPSC006","queryDetail",info,{
onSuccess:function(ei){//返回结果集
detailGrid.setEiInfo(ei);
},onFail:function(ei){}
},{async:false});
} }
let selectStock = function (id) { let selectStock = function (id) {
JSColorbox.open({ JSColorbox.open({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment