Commit c74b46b6 by liuyang

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

parents cbb3f91b 7bea233c
...@@ -519,6 +519,7 @@ public class ServiceHGBI002 extends ServiceBase { ...@@ -519,6 +519,7 @@ public class ServiceHGBI002 extends ServiceBase {
outInfo.set("result",list2); outInfo.set("result",list2);
return outInfo; return outInfo;
} }
/** /**
* 近7日综合产量 45d33e71262840babc0d60c0a01863d0 * 近7日综合产量 45d33e71262840babc0d60c0a01863d0
* *
...@@ -568,16 +569,84 @@ public class ServiceHGBI002 extends ServiceBase { ...@@ -568,16 +569,84 @@ public class ServiceHGBI002 extends ServiceBase {
Map result1 = (Map) result.get("45d33e71262840babc0d60c0a01863d0"); Map result1 = (Map) result.get("45d33e71262840babc0d60c0a01863d0");
List<Map> list1 = (List) result1.get("data"); List<Map> list1 = (List) result1.get("data");
JSONArray tempArr = new JSONArray(); JSONArray tempArr = new JSONArray();
String json = "appEname,date,unitCover"; String json = "date,unitCover";
List tempContentList = Arrays.asList(json.split(",")); List tempContentList = Arrays.asList(json.split(","));
tempArr.add(tempContentList); tempArr.add(tempContentList);
JSONObject item = new JSONObject(); JSONObject item = new JSONObject();
list1.forEach(obj -> { list1.forEach(obj -> {
// 处理obj // 处理obj
List datalist =new ArrayList(); List datalist =new ArrayList();
datalist.add(obj.get("SERIES"));
datalist.add(obj.get("X")); datalist.add(obj.get("X"));
datalist.add(obj.get("VALUE")); datalist.add(obj.get("RCL"));
tempArr.add(datalist);
});
JSONArray ids = new JSONArray();
ids.add(idsStr);
item.put("ids", ids);
item.put("component", null);
item.put("data", tempArr);
List list2 =new ArrayList();
list2.add(item);
outInfo.set("result",list2);
return outInfo;
}
/**
* 工序日产量 4af343c61a1742a49a9a0bb11111cbd5
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "生产管理驾驶舱",operType = "查询",operDesc = "工序日产量")
public EiInfo queryXXCLInfo(EiInfo inInfo) {
String paramsStr = inInfo.getString(PARAMS_KEY_STR);
JSONArray jsonArray = (JSONArray) JSONArray.parse(paramsStr);
JSONObject jsonObject = (JSONObject) jsonArray.get(0);
JSONArray idsArr = (JSONArray) jsonObject.get("ids");
String idsStr = idsArr.getString(0);
JSONObject paramsObj = null;
if (jsonObject.get("params") instanceof String) {
paramsObj=JSON.parseObject((String) jsonObject.get("params"));
} else {
paramsObj= (JSONObject) jsonObject.get("params");
}
String dateStr = paramsObj.getString("date").replace("-","");
EiInfo eiInfo = new EiInfo();
String serviceId = "S_BE_XP_17";
eiInfo.set(EiConstant.serviceId,serviceId);
Map map = new HashMap();
map.put("uuid","4af343c61a1742a49a9a0bb11111cbd5");
map.put("offset",0);
map.put("limit",1000);
//获取公司代码
String companycode = "%";
if(!StringUtils.isEmpty(UserSessionUtils.getUserCompany().getUsercode())){
companycode = UserSessionUtils.getUserCompany().getUsercode();
}
//数据集入参
Map params =new HashMap();
params.put("companycode",companycode);
params.put("date",dateStr);
map.put("params",params);
List list =new ArrayList();
list.add(map);
eiInfo.set("queryInfo",list);
//服务接口调用
EiInfo outInfo = XServiceManager.call(eiInfo);
//调用微服务后的结果
Map result = (Map) outInfo.get("result");
Map result1 = (Map) result.get("4af343c61a1742a49a9a0bb11111cbd5");
List<Map> list1 = (List) result1.get("data");
JSONArray tempArr = new JSONArray();
String json = "SERIES,RCL";
List tempContentList = Arrays.asList(json.split(","));
tempArr.add(tempContentList);
JSONObject item = new JSONObject();
list1.forEach(obj -> {
// 处理obj
List datalist =new ArrayList();
datalist.add(obj.get("SERIES"));
datalist.add(obj.get("RCL"));
tempArr.add(datalist); tempArr.add(datalist);
}); });
JSONArray ids = new JSONArray(); JSONArray ids = new JSONArray();
...@@ -615,7 +684,7 @@ public class ServiceHGBI002 extends ServiceBase { ...@@ -615,7 +684,7 @@ public class ServiceHGBI002 extends ServiceBase {
String serviceId = "S_BE_XP_17"; String serviceId = "S_BE_XP_17";
eiInfo.set(EiConstant.serviceId,serviceId); eiInfo.set(EiConstant.serviceId,serviceId);
Map map = new HashMap(); Map map = new HashMap();
map.put("uuid","4f5cb7ea6eb646d98aa0b1c79bf5c224"); map.put("uuid","4af343c61a1742a49a9a0bb11111cbd5");
map.put("offset",0); map.put("offset",0);
map.put("limit",1000); map.put("limit",1000);
//获取公司代码 //获取公司代码
...@@ -636,7 +705,7 @@ public class ServiceHGBI002 extends ServiceBase { ...@@ -636,7 +705,7 @@ public class ServiceHGBI002 extends ServiceBase {
EiInfo outInfo = XServiceManager.call(eiInfo); EiInfo outInfo = XServiceManager.call(eiInfo);
//调用微服务后的结果 //调用微服务后的结果
Map result = (Map) outInfo.get("result"); Map result = (Map) outInfo.get("result");
Map result1 = (Map) result.get("4f5cb7ea6eb646d98aa0b1c79bf5c224"); Map result1 = (Map) result.get("4af343c61a1742a49a9a0bb11111cbd5");
List<Map> list1 = (List) result1.get("data"); List<Map> list1 = (List) result1.get("data");
JSONArray tempArr = new JSONArray(); JSONArray tempArr = new JSONArray();
String json = "appEname,date,unitCover"; String json = "appEname,date,unitCover";
...@@ -648,7 +717,7 @@ public class ServiceHGBI002 extends ServiceBase { ...@@ -648,7 +717,7 @@ public class ServiceHGBI002 extends ServiceBase {
List datalist =new ArrayList(); List datalist =new ArrayList();
datalist.add(obj.get("SERIES")); datalist.add(obj.get("SERIES"));
datalist.add(obj.get("X")); datalist.add(obj.get("X"));
datalist.add(obj.get("VALUE")); datalist.add(obj.get("RCL"));
tempArr.add(datalist); tempArr.add(datalist);
}); });
JSONArray ids = new JSONArray(); JSONArray ids = new JSONArray();
...@@ -705,7 +774,7 @@ public class ServiceHGBI002 extends ServiceBase { ...@@ -705,7 +774,7 @@ public class ServiceHGBI002 extends ServiceBase {
List datalist =new ArrayList(); List datalist =new ArrayList();
datalist.add(obj.get("SERIES")); datalist.add(obj.get("SERIES"));
datalist.add(obj.get("X")); datalist.add(obj.get("X"));
datalist.add(obj.get("VALUE")); datalist.add(obj.get("RCL"));
tempArr.add(datalist); tempArr.add(datalist);
}); });
JSONArray ids = new JSONArray(); JSONArray ids = new JSONArray();
......
...@@ -148,7 +148,7 @@ public class HGSCTools { ...@@ -148,7 +148,7 @@ public class HGSCTools {
HGSC007 hgsc007 = THGSC007.getById(hgsc008.getTaskId()); HGSC007 hgsc007 = THGSC007.getById(hgsc008.getTaskId());
//更新生产任务完工数量 //更新生产任务完工数量
Integer finishQuatity = hgsc007.getFinishQuantity()+completeNum; Integer finishQuatity = hgsc007.getFinishQuantity()+completeNum;
AssertUtils.isTrue(hgsc007.getQuantity().compareTo(finishQuatity)<0,"完工数量加已完工数量不能大于任务数量!"); // AssertUtils.isTrue(hgsc007.getQuantity().compareTo(finishQuatity)<0,"完工数量加已完工数量不能大于任务数量!");
AssertUtils.isTrue(finishQuatity<0,"扣除完工数量不能大于已完工数量!"); AssertUtils.isTrue(finishQuatity<0,"扣除完工数量不能大于已完工数量!");
hgsc007.setFinishQuantity(finishQuatity); hgsc007.setFinishQuantity(finishQuatity);
hgsc007.setUnfinishQuantity(hgsc007.getQuantity() - finishQuatity); hgsc007.setUnfinishQuantity(hgsc007.getQuantity() - finishQuatity);
...@@ -161,7 +161,7 @@ public class HGSCTools { ...@@ -161,7 +161,7 @@ public class HGSCTools {
HGSC006A hgsc006A = THGSC006A.getById(hgsc007.getOrderDetailId()); HGSC006A hgsc006A = THGSC006A.getById(hgsc007.getOrderDetailId());
HGSC005A hgsc005A = THGSC005A.getById(hgsc006A.getPlanDetailId()); HGSC005A hgsc005A = THGSC005A.getById(hgsc006A.getPlanDetailId());
finishQuatity = hgsc005A.getFinishQuantity()+completeNum; finishQuatity = hgsc005A.getFinishQuantity()+completeNum;
AssertUtils.isTrue(hgsc005A.getQuantity().compareTo(finishQuatity)<0,"完工数量加已完工数量不能大于任务数量!"); // AssertUtils.isTrue(hgsc005A.getQuantity().compareTo(finishQuatity)<0,"完工数量加已完工数量不能大于任务数量!");
AssertUtils.isTrue(finishQuatity<0,"扣除完工数量不能大于已完工数量!"); AssertUtils.isTrue(finishQuatity<0,"扣除完工数量不能大于已完工数量!");
hgsc005A.setFinishQuantity(finishQuatity); hgsc005A.setFinishQuantity(finishQuatity);
hgsc005A.setUnfinishQuantity(hgsc005A.getQuantity() - finishQuatity); hgsc005A.setUnfinishQuantity(hgsc005A.getQuantity() - finishQuatity);
......
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