Commit 1396b111 by 江和松

Merge remote-tracking branch 'origin/dev' into dev

parents 4800b392 4e1251f3
......@@ -569,6 +569,8 @@ public class HGSqlConstant {
public static final String QUERY_PARENT = "HGXSOrg.queryParent";
// 查询用户组织机构
public static final String QUERY_BY_USER = "HGXSOrg.queryByUser";
// 查询用户组织机构
public static final String QUERY_BY_FACTORY = "HGXSOrg.queryFactoryComboBox";
}
}
......@@ -115,6 +115,7 @@ public class HGSC007 extends DaoEPBase {
public static final String UPDATE = "HGSC007.update";
public static final String DELETE = "HGSC007.delete";
public static final String QUERY_SUM_WT = "HGSC007.querySumWt"; /*查询累计产量*/
public static final String QUERY_WT = "HGSC007.queryWt"; /*查询日工序产量*/
public static final String QUERY_DAY_WT = "HGSC007.queryDayWt"; /*查询工序日产量*/
public static final String QUERY_MONTH_WT = "HGSC007.queryMonthWt"; /*查询工序月产量*/
public static final String QUERY_PROJ_CODE_WT = "HGSC007.queryProjCodeWt"; /*查询项目产量*/
......
......@@ -6,8 +6,11 @@ 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.constant.HGSqlConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.sb.tools.HGSBTools;
import com.baosight.hggp.hg.sc.domain.HGSC007;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
......@@ -89,17 +92,8 @@ import java.util.*;
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) {
Map<String,String> map = new HashMap<>();
map.put(Org.FIELD_ORG_ID,org.getFactoryCode());
map.put(Org.FIELD_ORG_CNAME,org.getFactoryName());
factoryCodes.add(map);
}
List<Map<String,Object>> mapList = getOrg();
factoryCodes.addAll(mapList);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"APP查询工厂失败");
}
......@@ -137,7 +131,7 @@ import java.util.*;
if (StringUtils.isEmpty(companyCode)) {
queryRow.setCell(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code,userVO.getUsercode());
}
inInfo = super.query(inInfo,HGSC007.QUERY_DAY_WT);
inInfo = super.query(inInfo,HGSC007.QUERY_WT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
......@@ -212,6 +206,33 @@ import java.util.*;
return inInfo;
}
public static List<Map<String,Object>> getOrg() {
List<Map<String,Object>> list = new ArrayList<>();
List<Org> orgList = HGXSTools.XsOrg.queryByUser();
if (CollectionUtils.isNotEmpty(orgList)) {
for (Org org: orgList) {
Map<String,Object> objectMap = new HashMap<>();
if (!org.getOrgType().equals(OrgTypeEnum.COMPANY.getCode())) {
//Org org1 = HGXSTools.XsOrg.queryCompany(org.getOrgId());
objectMap.put(Org.FIELD_FACTORY_CODE,org.getFactoryCode());
objectMap.put(Org.FIELD_FACTORY_NAME,org.getFactoryName());
} else {
Map<String, Object> map = new HashMap<String, Object>();
map.put(Org.FIELD_PARENT_ORG_ID, org.getOrgId());
List<Map> results = DaoBase.getInstance().query(HGSqlConstant.HgXsOrg.QUERY_BY_FACTORY,map);
if (results.size()>0) {
Map org1 = results.get(0);
objectMap.put(Org.FIELD_FACTORY_CODE,org1.get(Org.FIELD_ORG_ID));
objectMap.put(Org.FIELD_FACTORY_NAME,org1.get(Org.FIELD_ORG_CNAME));
}
}
list.add(objectMap);
}
}
return list;
}
}
......@@ -581,6 +581,25 @@
group by a.factoryCode , a.factoryName
</select>
<!--查询工序日产量-->
<select id="queryWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
h.DEPOSIT_DATE as "completeDate",
h2.factory_code as "factoryCode",
h2.factory_name as "factoryName",
h2.process_code as "processCode",
h2.process_name as "processName",
SUM(h.INV_WEIGHT) "totalWeight"
from ${hggpSchema}.hgkc003 h inner join ${hggpSchema}.hgzl002 h2 on h.QUALITY_ID = h2.id
where 1 = 1 and h.DELETE_FLAG = '0' and h.SUBMIT_STATUS = '1'
<include refid="appCondition"/>
<include refid="appOrderCondition"/>
<isNotEmpty prepend=" AND " property="depositDate">
h.DEPOSIT_DATE = #depositDate#
</isNotEmpty>
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name
order by h.DEPOSIT_DATE asc
</select>
<!--查询工序日产量-->
<select id="queryDayWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
h.DEPOSIT_DATE as "completeDate",
......
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