Commit cf40cce3 by wuwenlong

生产任务&工序质检APP接口;

parent cf5b21b5
package com.baosight.hggp.hg.sc.service; package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.domain.HGSC007; import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil; import com.baosight.hggp.util.StringUtil;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
...@@ -10,7 +13,11 @@ import com.baosight.iplat4j.core.ei.EiConstant; ...@@ -10,7 +13,11 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import org.apache.commons.lang.StringUtils;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/** /**
...@@ -36,7 +43,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase; ...@@ -36,7 +43,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
try { try {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock); EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
String creatTime = block.getCellStr(ACConstants.ROW_CODE_0, HGSC007.FIELD_created_time); String creatTime = block.getCellStr(ACConstants.ROW_CODE_0, HGSC007.FIELD_created_time);
if (!creatTime.isEmpty()) { if (StringUtils.isNotBlank(creatTime)) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime)); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime));
} }
...@@ -48,6 +55,31 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase; ...@@ -48,6 +55,31 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "生产任务", operType = "查询", operDesc = "APP查询数量")
public Integer count(EiInfo inInfo) {
Integer count = null;
try {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
String creatTime = block.getCellStr(ACConstants.ROW_CODE_0, HGSC007.FIELD_created_time);
if (StringUtils.isNotBlank(creatTime)) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSC007.FIELD_created_time, StringUtil.removeHorizontalLine(creatTime));
} }
Map paramMap = EiInfoUtils.getFirstRow(inInfo);
count = super.count(HGSC007.COUNT,paramMap);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return count;
}
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询公司", operDesc = "APP查询当前登陆用户角色所属公司")
public List<Company> getRoleCompany() {
List<Company> companyList = UserSessionUtils.getRoleCompany();
return companyList;
}
}
...@@ -13,7 +13,7 @@ import com.baosight.iplat4j.core.ei.EiConstant; ...@@ -13,7 +13,7 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.List; import java.util.*;
/** /**
...@@ -80,4 +80,25 @@ public class ServiceHGZL002 extends ServiceBase { ...@@ -80,4 +80,25 @@ public class ServiceHGZL002 extends ServiceBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "工序质检单", operType = "查询", operDesc = "APP查询数量")
public Map<String,Object> count(EiInfo inInfo) {
Map<String,Object> resultMap = new HashMap<String,Object>();
resultMap.put("quantity",0);
resultMap.put("passQuantity",0);
resultMap.put("unpassQuantity",0);
try {
inInfo = super.query(inInfo, HGZL002.QUERY, new HGZL002());
List<HGZL002> hgzl002s = MapUtils.toDaoEPBase(inInfo,HGZL002.class);
int quantity = Optional.ofNullable(hgzl002s).orElse(new ArrayList<>()).stream().mapToInt(HGZL002::getQuantity).sum();
int passQuantity = Optional.ofNullable(hgzl002s).orElse(new ArrayList<>()).stream().mapToInt(HGZL002::getPassQuantity).sum();
int unpassQuantity = Optional.ofNullable(hgzl002s).orElse(new ArrayList<>()).stream().mapToInt(HGZL002::getUnpassQuantity).sum();
resultMap.put("quantity",quantity);
resultMap.put("passQuantity",passQuantity);
resultMap.put("unpassQuantity",unpassQuantity);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return resultMap;
}
} }
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