Commit 44261c77 by liuyang

2024-06-13 app查询产量接口

parent e5812eac
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.util.BeanUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -85,6 +88,28 @@ import java.util.Map;
return companyList;
}
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工厂", operDesc = "APP查询当前登录用户角色所属工厂")
public List<Map> getRoleFactory(EiInfo inInfo) {
List<Map> factoryCodes = new ArrayList<>();
try {
List<Org> orgs = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isEmpty(orgs)) {
return new ArrayList<>();
}
for (Org org : orgs) {
List<Map> org1 = DaoBase.getInstance().query("HGXSOrg.queryFactoryComboBox",
new HashMap<String,Object>(){{
put(Org.FIELD_PARENT_ORG_ID,org.getOrgId());
}});
factoryCodes.addAll(org1);
}
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"APP查询工厂失败");
}
return factoryCodes;
}
/**
* app查询工序产量
*/
......@@ -92,12 +117,12 @@ import java.util.Map;
public Map<String,List> getWt(EiInfo inInfo) {
Map<String,List> map = new HashMap<>();
try {
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
if (StringUtils.isEmpty(queryRow.get(HGSC007.FIELD_company_code).toString())) {
Object companyCode = queryRow.get(HGSC007.FIELD_company_code);
if (companyCode == null) {
queryRow.put(HGSC007.FIELD_company_code,userVO.getUsercode());
queryRow.put(HGSC007.FIELD_company_name,userVO.getUsername());
//queryRow.put(HGSC007.FIELD_company_name,userVO.getUsername());
}
List sumList = DaoBase.getInstance().query(HGSC007.QUERY_SUM_WT, queryRow);
List dayList = DaoBase.getInstance().query(HGSC007.QUERY_DAY_WT, queryRow);
......@@ -118,9 +143,10 @@ import java.util.Map;
try {
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
if (StringUtils.isEmpty(queryRow.get(HGSC007.FIELD_company_code).toString())) {
Object companyCode = queryRow.get(HGSC007.FIELD_company_code);
if (companyCode == null) {
queryRow.put(HGSC007.FIELD_company_code,userVO.getUsercode());
queryRow.put(HGSC007.FIELD_company_name,userVO.getUsername());
//queryRow.put(HGSC007.FIELD_company_name,userVO.getUsername());
}
sumList = DaoBase.getInstance().query(HGSC007.QUERY_PROJ_CODE_WT, queryRow);
} catch (PlatException e) {
......
......@@ -488,7 +488,7 @@
</update>
<!--查询累计完成重量-->
<select id="querySumWt" parameterClass="java.lang.String" resultClass="java.util.Map">
<select id="querySumWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
a.factoryCode ,
a.factoryName ,
......@@ -574,7 +574,7 @@
group by a.factoryCode , a.factoryName
</select>
<!--查询工序日产量-->
<select id="queryDayWt" parameterClass="java.lang.String" resultClass="java.util.Map">
<select id="queryDayWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
factory_code as factoryCode ,
factory_name as factoryName ,
......@@ -602,7 +602,7 @@
group by factory_code , factory_name , process_code , process_name;
</select>
<select id="queryProjCodeWt" parameterClass="java.lang.String" resultClass="java.util.Map">
<select id="queryProjCodeWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
b.factory_code as factoryCode ,
b.factory_name as factoryName ,
......@@ -623,10 +623,10 @@
a.company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
a.factory_code = #factoryCode#
b.factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
a.factory_name = #factoryName#
b.factory_name = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="planEndDate">
a.plan_end_date = #planEndDate#
......@@ -650,6 +650,6 @@
<iterate close=")" open="(" conjunction="," property="authDepCodes">#authDepCodes[]#</iterate>
</isNotEmpty>
</isNotEqual>
group by b.factory_code , b.factory_name , a.proj_code , a.proj_name, a.plan_end_date;
group by b.factory_code , b.factory_name , a.proj_code , a.proj_name, a.plan_end_date
</select>
</sqlMap>
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