Commit dd81b311 by 江和松

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

parents 7f82a15d 96de65f8
......@@ -3,7 +3,7 @@
<!-- table information
Generate time : 2024-01-08 18:33:20
Version : 1.0
tableName :eplat.tveci002
tableName :${eplatSchema}..tveci002
RES_ID VARCHAR NOT NULL primarykey,
RES_CLASS VARCHAR NOT NULL primarykey,
HTML_CODE VARCHAR,
......@@ -30,7 +30,7 @@
REC_REVISOR as "recRevisor", <!-- 更新人员 -->
REC_REVISE_TIME as "recReviseTime", <!-- 更新时间 -->
DEPENDENCIES as "dependencies" <!-- js依赖 -->
FROM eplat.tveci002 WHERE 1=1
FROM ${eplatSchema}..tveci002 WHERE 1=1
<isNotEmpty prepend=" AND " property="resId">
RES_ID = #resId#
</isNotEmpty>
......@@ -50,7 +50,7 @@
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM eplat.tveci002 WHERE 1=1
SELECT COUNT(*) FROM ${eplatSchema}..tveci002 WHERE 1=1
<isNotEmpty prepend=" AND " property="resId">
RES_ID = #resId#
</isNotEmpty>
......@@ -93,7 +93,7 @@
-->
<insert id="insert">
INSERT INTO eplat.tveci002 (RES_ID, <!-- 资源ID -->
INSERT INTO ${eplatSchema}..tveci002 (RES_ID, <!-- 资源ID -->
RES_CLASS, <!-- 资源类型 -->
HTML_CODE, <!-- html代码 -->
CSS_CODE, <!-- 样式代码 -->
......@@ -108,13 +108,13 @@
</insert>
<delete id="delete">
DELETE FROM eplat.tveci002 WHERE
DELETE FROM ${eplatSchema}..tveci002 WHERE
RES_ID = #resId# AND
RES_CLASS = #resClass#
</delete>
<update id="update">
UPDATE eplat.tveci002
UPDATE ${eplatSchema}..tveci002
SET
HTML_CODE = #htmlCode#, <!-- html代码 -->
CSS_CODE = #cssCode#, <!-- 样式代码 -->
......
......@@ -19,7 +19,7 @@
when c.LOG_VALUE = 6 then '二级报警状态'
else '异常状态' end as STATUS_DESC
from hpjx.t_hpsb003 a
join iplat.TXSOG01 b on a.GROUP_CODE = b.ORG_ID and b.IS_DELETED = 0
join ${platSchema}.TXSOG01 b on a.GROUP_CODE = b.ORG_ID and b.IS_DELETED = 0
join hpjx.t_hpsb002 c on a.DEVICE_CODE=c.EQUIPMENT_CODE
where a.DELETE_FLAG = 0 and DEVICE_STATUS = 1 and c.EQUIPMENT_TYPE = 'STARUS_TYPE'
and a.COMPANY_CODE = #companyCode#
......
......@@ -11,7 +11,9 @@ import com.baosight.hggp.hg.cb.domain.HGCB001;
import com.baosight.hggp.hg.cb.domain.HGCB002;
import com.baosight.hggp.hg.cb.domain.HGCB003;
import com.baosight.hggp.hg.cb.domain.HGCB004;
import com.baosight.hggp.hg.cb.domain.HGCB005;
import com.baosight.hggp.hg.cg.domain.HGCG003;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.cw.domain.HGCW001;
import com.baosight.hggp.hg.cw.domain.HGCW012;
......@@ -19,9 +21,11 @@ import com.baosight.hggp.hg.cw.domain.HGCW012A;
import com.baosight.hggp.hg.cw.domain.HGCW013;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.domain.HGPZ007;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.HGSC005A;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -29,6 +33,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
......@@ -613,4 +618,77 @@ public class HGCBTools {
hgcb004.fromMap(hgcb002.toMap());
}
}
public static class THGCB005 {
/**
* 同步数据
*
* @return
*/
public static void synchData() {
HGCW001 hgcw001 = new HGCW001();
//通过业务账期信息查询入库单
Map kc003ParamMap = new HashMap();
kc003ParamMap.put(HGKC003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
kc003ParamMap.put(HGKC003.FIELD_COMPANY_CODE,hgcw001.getCompanyCode());
kc003ParamMap.put(HGKC003.FIELD_STORAGE_TYPE, HGConstant.StorageType.RK);
kc003ParamMap.put(HGKC003.FIELD_IS_RETURN, CommonConstant.YesNo.NO_0);
kc003ParamMap.put(HGCW001.FIELD_ACCOUNT_PERIOD_DATE_START,hgcw001.getAccountPeriodDateStart());
kc003ParamMap.put(HGCW001.FIELD_ACCOUNT_PERIOD_DATE_END,hgcw001.getAccountPeriodDateEnd());
List<HGKC003> hgkc003List = HGKCTools.HgKc003.list(kc003ParamMap);
//入库单按项目编码、产品编码、存货工序ID、规格、单重分组,分别取正向入库单数量、重量和退回数量
//生成制造成本基础数据
List<HGCB005> hgcb005List = constractHGCB005(hgcw001,hgkc003List);
//通过存货工序ID查询工序权重
List<Long> processIds = Optional.ofNullable(hgcb005List).orElse(new ArrayList<>()).stream().map(HGCB005::getInventProcessId).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(processIds)){
List<HGPZ005> hgpz005List = HGPZTools.HgPz005.getIds(processIds);
Map<Long,HGPZ005> hgpz005Map = Optional.ofNullable(hgpz005List).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(
HGPZ005::getId,
o->o,
(o1,o2)->o1
));
}
//通过业务账期信息查询类型为分摊的费用归集数据,按项目分组金额求和
//计算成本:入库重量*工序权重=产副品权重,SUM(产副品权重)=项目权重,产副品权重/项目权重*总费用=产副品制造总成本
}
}
private static List<HGCB005> constractHGCB005(HGCW001 hgcw001, List<HGKC003> hgkc003List){
List<HGCB005> hgcb005List = Optional.ofNullable(hgkc003List).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(
o->o.getProjCode()+"-"+o.getPrdtCode()+"-"+o.getInventProcessId()+"-"+o.getPrdtSpec()+"-"+o.getInvUnitWeight(),
o->o,(v1,v2)->{
HGKC003 kc003 = new HGKC003();
BeanUtils.copyProperties(v1,kc003);
kc003.setInvQty(v1.getInvQty().add(v2.getInvQty()));
kc003.setInvWeight(v1.getInvWeight().add(v2.getInvWeight()));
return kc003;
}
)).values().stream().map(o -> {
HGCB005 cb005 = new HGCB005();
cb005.setAccountYear(hgcw001.getAccountYear());
cb005.setAccountMonth(hgcw001.getAccountPeriod().substring(4));
cb005.setCompanyCode(hgcw001.getCompanyCode());
cb005.setCompanyName(hgcw001.getCompanyName());
cb005.setProductCode(o.getPrdtCode());
cb005.setProductName(o.getPrdtName());
cb005.setTechFlowId(o.getTechFlowId());
cb005.setTechFlowName(o.getTechFlowName());
cb005.setInventProcessId(o.getInventProcessId());
cb005.setProcessCode(o.getProcessCode());
cb005.setProcessName(o.getProcessName());
cb005.setProcessOrder(o.getProcessOrder());
cb005.setProductLength(o.getPrdtLength());
cb005.setProductWidth(o.getPrdtWidth());
cb005.setProductThick(o.getPrdtThick());
cb005.setProductSpec(o.getPrdtSpec());
cb005.setSingleWeight(o.getInvUnitWeight());
cb005.setQuantity(o.getInvQty());
cb005.setTotalWeight(o.getInvWeight());
return cb005;
}).collect(Collectors.toList());
return hgcb005List;
}
}
......@@ -157,6 +157,12 @@
<isNotEmpty prepend=" AND " property="processOrder">
PROCESS_ORDER = #processOrder#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodDateStart">
<![CDATA[ DEPOSIT_DATE >= #accountPeriodDateStart# ]]>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodDateEnd">
<![CDATA[ DEPOSIT_DATE <= #accountPeriodDateEnd# ]]>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......
......@@ -387,6 +387,16 @@ public class HGKCTools {
AssertUtils.isEmpty(paramMap, "时间不能为空");
return DaoBase.getInstance().query("HGKC003.queryCheckList", paramMap);
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public static List<HGKC003> list(Map paramMap) {
return DaoBase.getInstance().query(HGKC003.QUERY, paramMap);
}
}
/**
......
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