Commit 6f4f23a2 by liuyang

2024-06-17 app查询工序月产量

parent 9144122a
......@@ -115,7 +115,8 @@ 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_DAY_WT = "HGSC007.queryDayWt"; /*查询工序产量*/
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"; /*查询项目产量*/
private Long id = new Long(0);
......
......@@ -22,10 +22,7 @@ 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;
import java.util.*;
/**
......@@ -96,13 +93,12 @@ import java.util.Map;
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);
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);
}
}catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"APP查询工厂失败");
......@@ -149,7 +145,7 @@ import java.util.Map;
}
/**
* app查询工序产量
* app查询工序产量
*/
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工序日产量", operDesc = "APP查询工序日产量")
public EiInfo getProcessDayWt(EiInfo inInfo) {
......@@ -157,6 +153,11 @@ import java.util.Map;
EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock);
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
String companyCode = queryRow.getCellStr(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code);
String endDate = queryRow.getCellStr(ACConstants.ROW_CODE_0,ACConstants.SQL_END_DATE);
if (StringUtils.isNotEmpty(endDate)) {
String startDate = DateUtil.dateSubStr(endDate,-7);
queryRow.setCell(ACConstants.ROW_CODE_0,ACConstants.SQL_START_DATE,startDate);
}
if (StringUtils.isEmpty(companyCode)) {
queryRow.setCell(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code,userVO.getUsercode());
}
......@@ -168,6 +169,30 @@ import java.util.Map;
}
/**
* app查询工序日产量
*/
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询工序日产量", operDesc = "APP查询工序日产量")
public EiInfo getProcessMonthWt(EiInfo inInfo) {
try {
EiBlock queryRow = inInfo.getBlock(EiConstant.queryBlock);
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
String companyCode = queryRow.getCellStr(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code);
String endDate = queryRow.getCellStr(ACConstants.ROW_CODE_0,ACConstants.SQL_END_DATE);
if (StringUtils.isNotEmpty(endDate)) {
String startDate = DateUtil.getMonthOfDays(endDate,-6,DateUtil.DATE8_PATTERN);
queryRow.setCell(ACConstants.ROW_CODE_0,ACConstants.SQL_START_DATE,startDate);
}
if (StringUtils.isEmpty(companyCode)) {
queryRow.setCell(ACConstants.ROW_CODE_0,HGSC007.FIELD_company_code,userVO.getUsercode());
}
inInfo = super.query(inInfo,HGSC007.QUERY_MONTH_WT);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* app查询工序产量
*/
@OperationLogAnnotation(operModul = "生产任务", operType = "APP查询项目产量", operDesc = "APP查询项目产量")
......
......@@ -525,13 +525,13 @@
</update>
<!--查询累计完成重量-->
<select id="querySumWt" parameterClass="java.util.HashMap" resultClass="com.baosight.hggp.hg.sc.domain.HGSC007POJO">
<select id="querySumWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
a.factoryCode ,
a.factoryName ,
sum(a.dayWt) as dayWt,
sum(a.monthWt) as monthWt,
sum(a.yearWt) as yearWt
sum(a.dayWt) as dayWeight,
sum(a.monthWt) as monthWeight,
sum(a.yearWt) as yearWeight
from (
select
h2.factory_code as factoryCode ,
......@@ -581,7 +581,7 @@
group by a.factoryCode , a.factoryName
</select>
<!--查询工序日产量-->
<select id="queryDayWt" parameterClass="java.util.HashMap" resultClass="com.baosight.hggp.hg.sc.domain.HGSC007POJO">
<select id="queryDayWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
h.DEPOSIT_DATE as "completeDate",
h2.factory_code as "factoryCode",
......@@ -593,15 +593,33 @@
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 prepend=" AND " property="endDate">
h.DEPOSIT_DATE between #startDate# and #endDate#
</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="queryMonthWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
left(h.DEPOSIT_DATE,6) 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="endDate">
left(h.DEPOSIT_DATE,6) between left(#startDate#,6) and left(#endDate#,6)
</isNotEmpty>
group by h.DEPOSIT_DATE, h2.factory_code, h2.factory_name, h2.process_code, h2.process_name
order by h.DEPOSIT_DATE desc
order by h.DEPOSIT_DATE asc
</select>
<!--项目产量-->
<select id="queryProjCodeWt" parameterClass="java.util.HashMap" resultClass="com.baosight.hggp.hg.sc.domain.HGSC007POJO">
<select id="queryProjCodeWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
h2.factory_code as factoryCode ,
h2.factory_name as factoryName ,
......
......@@ -228,7 +228,9 @@
A.ORG_TYPE AS "orgType",
A.ACCOUNT_CODE AS "accounCcode",
A.FACTORY_CODE AS "factoryCode",
A.FACTORY_NAME AS "factoryName",
A.COMPANY_CODE AS "companyCode",
A.COMPANY_NAME AS "companyName",
A.PARENT_ORG_ID as "parentOrgId"
FROM ${platSchema}.TXSOG01 A, ${platSchema}.TXSOG02 B, ${platSchema}.XS_USER C
WHERE 1=1
......
......@@ -80,9 +80,13 @@ public class DateUtil {
* @return
*/
public static String getMonthOfDays(String date){
return getMonthOfDays(date, -1,DATE10_PATTERN);
}
public static String getMonthOfDays(String date,int month,String pattern){
Calendar calendar = Calendar.getInstance();//日历对象
calendar.setTime(Objects.requireNonNull(DateUtil.toDate(date, DATE10_PATTERN)));//设置当前日期
calendar.add(Calendar.MONTH, -1);//月份减一
calendar.setTime(Objects.requireNonNull(DateUtil.toDate(date, pattern)));//设置当前日期
calendar.add(Calendar.MONTH, month);//月份减一
return DateUtil.toDateStr(calendar.getTime(),DATE8_PATTERN);//输出上个月的日期
}
......
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