Commit 419f4ad0 by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

 Conflicts:
	src/main/java/com/baosight/hggp/hg/cw/sql/HGCW001.xml
	src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
parents 97fc9efd 591b0662
......@@ -58,6 +58,9 @@ public class HGCG001 extends DaoEPBase {
public static final String FIELD_AUDIT_USER_NAME = "auditUserName"; /* 审核人名称*/
public static final String FIELD_AUDIT_REASON = "auditReason"; /* 审核原因*/
public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /*存货类型明细*/
public static final String FIELD_MATERIAL_PLAN_ID = "materialPlanId"; /*材料计划id*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
......@@ -135,6 +138,8 @@ public class HGCG001 extends DaoEPBase {
private String auditUserId = " "; /* 审核人ID*/
private String auditUserName = " "; /* 审核人名称*/
private String auditReason = " "; /* 审核原因*/
private Integer inventTypeDetail; /*存货类型明细 1:构建 2:零件*/
private Long materialPlanId = new Long(0); /*材料计划id*/
/**
* initialize the metadata.
......@@ -310,7 +315,13 @@ public class HGCG001 extends DaoEPBase {
eiColumn.setDescName("审核原因");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE_DETAIL);
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MATERIAL_PLAN_ID);
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -880,6 +891,23 @@ public class HGCG001 extends DaoEPBase {
public void setAuditReason(String auditReason) {
this.auditReason = auditReason;
}
public Integer getInventTypeDetail() {
return inventTypeDetail;
}
public void setInventTypeDetail(Integer inventTypeDetail) {
this.inventTypeDetail = inventTypeDetail;
}
public Long getMaterialPlanId() {
return materialPlanId;
}
public void setMaterialPlanId(Long materialPlanId) {
this.materialPlanId = materialPlanId;
}
/**
* get the value from Map.
*
......@@ -923,6 +951,8 @@ public class HGCG001 extends DaoEPBase {
setAuditUserId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_USER_ID)), auditUserId));
setAuditUserName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_USER_NAME)), auditUserName));
setAuditReason(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_AUDIT_REASON)), auditReason));
setMaterialPlanId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MATERIAL_PLAN_ID)), materialPlanId));
setInventTypeDetail(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
}
/**
......@@ -967,7 +997,8 @@ public class HGCG001 extends DaoEPBase {
map.put(FIELD_AUDIT_USER_ID, StringUtils.toString(auditUserId, eiMetadata.getMeta(FIELD_AUDIT_USER_ID)));
map.put(FIELD_AUDIT_USER_NAME, StringUtils.toString(auditUserName, eiMetadata.getMeta(FIELD_AUDIT_USER_NAME)));
map.put(FIELD_AUDIT_REASON, StringUtils.toString(auditReason, eiMetadata.getMeta(FIELD_AUDIT_REASON)));
map.put(FIELD_MATERIAL_PLAN_ID,StringUtils.toString(materialPlanId, eiMetadata.getMeta(FIELD_MATERIAL_PLAN_ID)));
map.put(FIELD_INVENT_TYPE_DETAIL,StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
return map;
}
}
......@@ -37,7 +37,9 @@
AUDIT_TIME as "auditTime", <!-- 审核时间 -->
AUDIT_USER_ID as "auditUserId", <!-- 审核人ID -->
AUDIT_USER_NAME as "auditUserName", <!-- 审核人名称 -->
AUDIT_REASON as "auditReason" <!-- 审核原因 -->
AUDIT_REASON as "auditReason", <!-- 审核原因 -->
INVENT_TYPE_DETAIL as "inventTypeDetail", <!-- 存货类型明细 -->
MATERIAL_PLAN_ID as "materialPlanId" <!-- 材料计划id -->
</sql>
<sql id="condition">
......@@ -78,6 +80,12 @@
<isNotEmpty prepend=" AND " property="auditUserName">
AUDIT_USER_NAME = #auditUserName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialPlanId">
MATERIAL_PLAN_ID = #materialPlanId#
</isNotEmpty>
</sql>
<sql id="idCondition">
......@@ -90,6 +98,9 @@
<isNotEmpty prepend=" AND " property="planNos">
PLAN_NO IN <iterate open="(" close=")" conjunction="," property="planNos">#planNos[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="materialPlanIds">
MATERIAL_PLAN_ID IN <iterate open="(" close=")" conjunction="," property="materialPlanIds">#materialPlanIds[]#</iterate>
</isNotEmpty>
</sql>
<sql id="customCondition">
......@@ -152,12 +163,14 @@
PLAN_QTY, <!-- 计划数量 -->
PLAN_UNIT_WEIGHT, <!-- 计划单重 -->
PLAN_WEIGHT, <!-- 计划重量 -->
STATUS <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
STATUS, <!-- 状态:0-未审批,1-审核通过,2-审核未通过 -->
INVENT_TYPE_DETAIL, <!-- 存货类型明细 -->
MATERIAL_PLAN_ID <!-- 材料计划id -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#companyCode#, #companyName#, #planDate#, #planNo#, #inventCode#, #inventName#,
#specId#, #spec#, #material#, #unit#, #length#, #width#, #thick#,
#planQty#, #planUnitWeight#, #planWeight#, #status#
#planQty#, #planUnitWeight#, #planWeight#, #status#, #inventTypeDetail#, #materialPlanId#
)
</insert>
......
......@@ -73,6 +73,19 @@ public class HGCGTools {
/**
* 查询
*
* @param materialPlanIds
* @return
*/
public static List<HGCG001> listByMaterialPlanIds(List<Long> materialPlanIds) {
AssertUtils.isEmpty(materialPlanIds, "材料计划id不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put("materialPlanIds", materialPlanIds);
return DaoBase.getInstance().query(HGCG001.QUERY, paramMap);
}
/**
* 查询
*
* @param planNos
* @return
*/
......
package com.baosight.hggp.hg.cw.service;
import cn.hutool.core.util.StrUtil;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.domain.HGCW001;
import com.baosight.hggp.hg.cw.domain.HGCW012;
import com.baosight.hggp.hg.cw.domain.HGCW055;
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.xs.domain.Company;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @className: com.baosight.hggp.hg.cw.service.ServiceHGCW055
* @description: 成本核算
* @author: lwj
* @create: 2024-06-26 15:52
*/
public class ServiceHGCW055 extends ServiceBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "成本核算",operType = "查询",operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "成本核算",operType = "查询",operDesc = "查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGCW055.QUERY, new HGCW055());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 数据检查操作
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "成本核算",operType = "查询",operDesc = "数据检查")
public EiInfo checkData(EiInfo inInfo){
try {
this.checkAllData(inInfo);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 成本核算操作
* @param inInfo
* @return
*/
public EiInfo calculate(EiInfo inInfo){
try {
this.checkAllData(inInfo);
if ("100".equals(inInfo.getString("resultCode"))) {
// 检查返回码
String resultCode = "200";
String resultDesc = "成本核算完成";
String id = inInfo.getString("id");
AssertUtils.isNull(id, "成本核算ID不能为空!");
List<HGCW055> results = dao.query(HGCW055.QUERY, new HashMap<String, Object>() {
{
put("id", id);
}
});
if (results.size() > 0) {
HGCW055 hgcw055 = results.get(0);
// 成本核算步骤:
// 1,入库成本核算;
// 2,出库成本核算;
// 3,收发存汇总数据同步接口;
// 4,产副品制造成本核算接口;
// 5.费用归集完成
// 6.费用分摊完成
}
inInfo.set("resultCode",resultCode);
inInfo.set("resultDesc",resultDesc);
}
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
private void checkAllData(EiInfo inInfo) {
// 检查返回码
String resultCode = "100";
String resultDesc = "数据检查完成";
String id = inInfo.getString("id");
AssertUtils.isNull(id, "成本核算ID不能为空!");
List<HGCW055> results = dao.query(HGCW055.QUERY,new HashMap<String,Object>(){
{put("id",id);}
});
if (results.size() > 0) {
HGCW055 hgcw055 = results.get(0);
Map paramMap = new HashMap();
paramMap.put("billDate", StrUtil.concat(true,hgcw055.getYear(),hgcw055.getMonth()));
paramMap.put("submitStatus", 0);
paramMap.put("accountPeriodStatus", 1);
paramMap.put("companyCode", hgcw055.getCompanyCode());
// 点击数据检查按钮弹出窗口,点击执行进行数据检查,检查顺序和显示内容如下:
// 1.业务单据日期为当月会计期的日期范围采购入库单提交或未提交;HGKC001 采购入库
List<HGKC001> hgkc001List = HGKCTools.HgKc001.checkList(paramMap);
if (hgkc001List.size() > 0) {
resultCode = "101";
resultDesc = "采购入库单未提交";
}
// 2.业务单据日期为当月会计期的日期范围采购发票提交或未提交;HGCW012 采购发票
List<HGCW012> hgcw012List = HGCWTools.HgCw012.checkList(paramMap);
if (hgcw012List.size() > 0) {
resultCode = "102";
resultDesc = "采购发票未审核";
}
// 3.业务单据日期为当月会计期的日期范围生产领用单提交或未提交;HGKC008 生产领料单
List<HGKC008> hgkc008List = HGKCTools.HgKc008.checkList(paramMap);
if (hgkc008List.size() > 0) {
resultCode = "103";
resultDesc = "生产领料单未提交";
}
// 4.业务单据日期为当月会计期的日期范围生产入库单提交或未提交;HGKC003 生产入库单
List<HGKC003> hgkc003List = HGKCTools.HgKc003.checkList(paramMap);
if (hgkc003List.size() > 0) {
resultCode = "104";
resultDesc = "生产入库单未提交";
}
// 5.业务单据日期为当月会计期的日期范围销售出库单提交或未提交;HGKC004 销售出库单
List<HGKC004> hgkc004List = HGKCTools.HgKc004.checkList(paramMap);
if (hgkc004List.size() > 0) {
resultCode = "105";
resultDesc = "销售出库单未提交";
}
// 6.业务单据日期为当月会计期的日期范围其他入库单提交或未提交;HGKC006 其他入库单
List<HGKC006> hgkc006List = HGKCTools.HgKc006.checkList(paramMap);
if (hgkc006List.size() > 0) {
resultCode = "106";
resultDesc = "其他入库单未提交";
}
// 7.业务单据日期为当月会计期的日期范围其他出库单提交或未提交;HGKC007 其他出库单
List<HGKC007> hgkc007List = HGKCTools.HgKc007.checkList(paramMap);
if (hgkc007List.size() > 0) {
resultCode = "107";
resultDesc = "其他出库单未提交";
}
// 8.当前公司的当月会计期是否为关账状态
List<HGCW001> hgcw001List = HGCWTools.HgCw001.checkList(paramMap);
if (hgcw001List.size() > 0) {
resultCode = "108";
resultDesc = "账期为开帐状态";
}
}
inInfo.set("resultCode",resultCode);
inInfo.set("resultDesc",resultDesc);
}
}
......@@ -229,6 +229,46 @@
ID = #id#
</update>
<select id="queryCheckList" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW001">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
ACCOUNT_YEAR as "accountYear", <!-- 会计年度 -->
ACCOUNT_PERIOD as "accountPeriod", <!-- 会计期 -->
ACCOUNT_PERIOD_STATUS as "accountPeriodStatus", <!-- 会计期状态0:关账1:开账 -->
ACCOUNT_PERIOD_DATE_START as "accountPeriodDateStart", <!-- 账期开始日期 -->
ACCOUNT_PERIOD_DATE_END as "accountPeriodDateEnd", <!-- 账期结束日期 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 -->
FROM ${hggpSchema}.HGCW001 WHERE 1=1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="billDate">
ACCOUNT_PERIOD = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountPeriodStatus">
ACCOUNT_PERIOD_STATUS = #accountPeriodStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="getMaxAccountPeriod" resultClass="java.util.HashMap">
select
ACCOUNT_CODE as "accountCode",
......
......@@ -325,4 +325,25 @@
ID = #id#
</update>
<select id="queryCheckList" resultClass="com.baosight.hggp.hg.cw.domain.HGCW012">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGCW012
WHERE 1 = 1
<isNotEmpty prepend=" AND " property="billDate">
LEFT(RECEIVE_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
REVIEW_STATUS = #submitStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID desc
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -69,18 +69,18 @@
A.YEAR AS "year",
A.MONTH as "month",
A.ID AS "id",
SUM(B.AMOUNT) AS "amount"
B.AMOUNT AS "amount"
from ${hggpSchema}.HGCW051 a,
${hggpSchema}.HGCW052 b
WHERE A.ID = B.HGCW051_ID
from ${hggpSchema}.HGCW051 a
left JOIN (SELECT HGCW051_ID, SUM(AMOUNT) as AMOUNT FROM ${hggpSchema}.HGCW052 GROUP BY HGCW051_ID) b on A.ID = B.HGCW051_ID
WHERE 1 = 1
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
a.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="month">
MONTH = #month#
a.MONTH = #month#
</isNotEmpty>
GROUP BY A.COMPANY_CODE,A.COMPANY_NAME,A.YEAR, A.MONTH,A.ID
</select>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-06-26 15:48:30
Version : 1.0
schema : hggp
tableName : HGCW055
ID BIGINT NOT NULL primarykey,
CREATED_BY VARCHAR NOT NULL,
CREATED_NAME VARCHAR NOT NULL,
CREATED_TIME VARCHAR NOT NULL,
UPDATED_BY VARCHAR NOT NULL,
UPDATED_NAME VARCHAR NOT NULL,
UPDATED_TIME VARCHAR NOT NULL,
DELETE_FLAG TINYINT,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
YEAR VARCHAR NOT NULL,
MONTH VARCHAR NOT NULL,
CHECK_STATUS VARCHAR,
CHECK_BY VARCHAR,
CHECK_NAME VARCHAR,
CHECK_TIME VARCHAR
-->
<sqlMap namespace="HGCW055">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="year">
YEAR = #year#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="month">
MONTH = #month#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkStatus">
CHECK_STATUS = #checkStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkBy">
CHECK_BY = #checkBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkName">
CHECK_NAME = #checkName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkTime">
CHECK_TIME = #checkTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="yearMonth">
CONCAT(YEAR, MONTH) = #yearMonth#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW055">
SELECT
ID as "id",
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
YEAR as "year", <!-- 年份 -->
MONTH as "month", <!-- 月份 -->
CHECK_STATUS as "checkStatus", <!-- 核算状态 -->
CHECK_BY as "checkBy", <!-- 核算人 -->
CHECK_NAME as "checkName", <!-- 核算人名称 -->
CHECK_TIME as "checkTime" <!-- 核算时间 -->
FROM ${hggpSchema}.HGCW055 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID asc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGCW055 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="year">
YEAR = #year#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="month">
MONTH = #month#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkStatus">
CHECK_STATUS = #checkStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkBy">
CHECK_BY = #checkBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkName">
CHECK_NAME = #checkName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="checkTime">
CHECK_TIME = #checkTime#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGCW055 (
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
YEAR, <!-- 年份 -->
MONTH, <!-- 月份 -->
CHECK_STATUS, <!-- 核算状态 -->
CHECK_BY, <!-- 核算人 -->
CHECK_NAME, <!-- 核算人名称 -->
CHECK_TIME <!-- 核算时间 -->
)
VALUES (#createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #year#, #month#, #checkStatus#, #checkBy#, #checkName#, #checkTime#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGCW055 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGCW055
SET
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
YEAR = #year#, <!-- 年份 -->
MONTH = #month#, <!-- 月份 -->
CHECK_STATUS = #checkStatus#, <!-- 核算状态 -->
CHECK_BY = #checkBy#, <!-- 核算人 -->
CHECK_NAME = #checkName#, <!-- 核算人名称 -->
CHECK_TIME = #checkTime# <!-- 核算时间 -->
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -26,6 +26,10 @@ import java.util.stream.Collectors;
public class HGCWTools {
public static class HgCw001 {
public static List<HGCW001> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "数据检查参数不能为空");
return DaoBase.getInstance().query("HGCW001.queryCheckList", paramMap);
}
public static Map getMaxAccountPeriod(String companyCode) {
Map<String, Object> params = new HashMap<>();
......@@ -450,6 +454,11 @@ public class HGCWTools {
DaoUtils.update("HGCW012.updateDeductionAmount", HGCW012);
}
public static List<HGCW012> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "数据检查参数不能为空");
return DaoBase.getInstance().query("HGCW012.queryCheckList", paramMap);
}
}
/**
......@@ -679,4 +688,20 @@ public class HGCWTools {
}
}
public static class HgCw055{
public static void save(List<Map> rows, UserVO userVO) {
// AssertUtils.isNull(contractNumber, "合同号不能为空!");
rows.forEach(row -> {
HGCW055 hgcw055 = new HGCW055();
hgcw055.fromMap(row);
hgcw055.setCompanyCode(userVO.getUsercode());
hgcw055.setCompanyName(userVO.getUsername());
DaoUtils.insert(HGCW055.INSERT, hgcw055);
});
}
}
}
......@@ -294,4 +294,27 @@
<include refid="orderBy"/>
</select>
<select id="queryCheckList" resultClass="com.baosight.hggp.hg.kc.domain.HGKC001">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC001
WHERE DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="billDate">
LEFT(DEPOSIT_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
SUBMIT_STATUS = #submitStatus#
</isNotEmpty>
<include refid="orderBy"/>
</select>
</sqlMap>
......@@ -382,4 +382,74 @@
GROUP BY COMPANY_CODE, DEP_CODE, WH_CODE, PROJ_CODE, PART_CODE
</select>
<select id="queryCheckList" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC003">
SELECT
ID as "id",
QUALITY_ID as "qualityId",<!-- 质检单明细ID -->
RECTIFICATION_ID as "rectificationId",<!-- 整改通知单ID -->
PART_SPEC_ID as "partSpecId",<!-- 零件规格ID -->
PART_COEFFICIENT as "partCoefficient",<!-- 零件系数 -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
DEPOSIT_DATE as "depositDate", <!-- 入库日期 -->
DEPOSIT_NO as "depositNo", <!-- 入库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
INV_QTY as "invQty", <!-- 数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 单重 -->
INV_WEIGHT as "invWeight", <!-- 重量 -->
DEPOSIT_NO_OLD as "depositNoOld", <!-- 入库单号(旧) -->
REMARK as "remark", <!-- 备注 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_TYPE as "prdtType", <!-- 产品类型 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
PRDT_LENGTH as "prdtLength", <!-- 产品-长 -->
PRDT_WIDTH as "prdtWidth", <!-- 产品-宽 -->
PRDT_THICK as "prdtThick", <!-- 产品-厚 -->
PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
PART_TYPE as "partType", <!-- 零件类型 -->
PART_CODE as "partCode", <!-- 零件编码 -->
PART_NAME as "partName", <!-- 零件名称 -->
PART_LENGTH as "partLength", <!-- 零件-长 -->
PART_WIDTH as "partWidth", <!-- 零件-宽 -->
PART_THICK as "partThick", <!-- 零件-厚 -->
PART_SPEC as "partSpec", <!-- 零件规格 -->
PRICE as "price", <!-- 单价 -->
AMOUNT as "amount", <!-- 金额 -->
STORAGE_TYPE as "storageType", <!-- 入库类型:1:入库 2:退回 -->
IS_RETURN as "isReturn", <!-- 是否退回:0:否 1:是 -->
SUBMIT_STATUS as "submitStatus" <!-- 提交状态 -->
FROM ${hggpSchema}.HGKC003 WHERE 1=1 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="billDate">
LEFT(DEPOSIT_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
SUBMIT_STATUS = #submitStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID desc
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -290,4 +290,24 @@
</dynamic>
</select>
<select id="queryCheckList" parameterClass="HashMap" resultClass="HGKC004">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC004 WHERE 1=1
<isNotEmpty prepend=" AND " property="billDate">
LEFT(RECEIPT_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
STATUS = #submitStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
RECEIPT_DATE DESC,CREATED_TIME DESC
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -534,4 +534,64 @@
</select>
<select id="queryCheckList" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC006">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
OTHER_ENTER_DATE as "otherEnterDate", <!-- 其他入库日期 -->
OTHER_ENTER_NO as "otherEnterNo", <!-- 其他入库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
OTHER_ENTER_NO_OLD as "otherEnterNoOld", <!-- 其他入库单号(旧) -->
REMARK as "remark", <!-- 备注 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_TYPE as "prdtType", <!-- 产品类型 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
PRDT_LENGTH as "prdtLength", <!-- 产品-长 -->
PRDT_WIDTH as "prdtWidth", <!-- 产品-宽 -->
PRDT_THICK as "prdtThick", <!-- 产品-厚 -->
PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
PART_TYPE as "partType", <!-- 零件类型 -->
PART_CODE as "partCode", <!-- 零件编码 -->
PART_NAME as "partName", <!-- 零件名称 -->
PART_LENGTH as "partLength", <!-- 零件-长 -->
PART_WIDTH as "partWidth", <!-- 零件-宽 -->
PART_THICK as "partThick", <!-- 零件-厚 -->
PART_SPEC as "partSpec", <!-- 零件规格 -->
SUBMIT_STATUS as "submitStatus", <!-- 提交状态 -->
SOURCE as "source" <!-- 数据来源 -->
FROM ${hggpSchema}.HGKC006 WHERE 1=1 and DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="billDate">
LEFT(OTHER_ENTER_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
SUBMIT_STATUS = #submitStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -532,4 +532,65 @@
</select>
<select id="queryCheckList" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC007">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
OTHER_OUT_DATE as "otherOutDate", <!-- 其他出库日期 -->
OTHER_OUT_NO as "otherOutNo", <!-- 其他出库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
OTHER_OUT_NO_OLD as "otherOutNoOld", <!-- 其他出库单号(旧) -->
REMARK as "remark", <!-- 备注 -->
FACTORY_CODE as "factoryCode", <!-- 工厂代码 -->
PROD_ORDER_NO as "prodOrderNo", <!-- 生产订单号 -->
PROD_TASK_NO as "prodTaskNo", <!-- 生产任务号 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
PRDT_TYPE as "prdtType", <!-- 产品类型 -->
PRDT_CODE as "prdtCode", <!-- 产品编码 -->
PRDT_NAME as "prdtName", <!-- 产品名称 -->
PRDT_LENGTH as "prdtLength", <!-- 产品-长 -->
PRDT_WIDTH as "prdtWidth", <!-- 产品-宽 -->
PRDT_THICK as "prdtThick", <!-- 产品-厚 -->
PRDT_SPEC as "prdtSpec", <!-- 产品规格 -->
PART_TYPE as "partType", <!-- 零件类型 -->
PART_CODE as "partCode", <!-- 零件编码 -->
PART_NAME as "partName", <!-- 零件名称 -->
PART_LENGTH as "partLength", <!-- 零件-长 -->
PART_WIDTH as "partWidth", <!-- 零件-宽 -->
PART_THICK as "partThick", <!-- 零件-厚 -->
PART_SPEC as "partSpec", <!-- 零件规格 -->
SUBMIT_STATUS as "submitStatus", <!-- 提交状态 -->
SOURCE as "source" <!-- 数据来源 -->
FROM ${hggpSchema}.HGKC007 WHERE 1=1 and DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="billDate">
LEFT(OTHER_OUT_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
SUBMIT_STATUS = #submitStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME desc
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -188,4 +188,44 @@
WHERE
ID = #id#
</update>
<select id="queryCheckList" resultClass="com.baosight.hggp.hg.kc.domain.HGKC008">
SELECT
ID as "id", <!-- 主键id -->
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
RECEIPT_DATE as "receiptDate", <!-- 单据日期 -->
APPLY_CODE as "applyCode", <!-- 申请单号 -->
WH_CODE as "whCode", <!-- 仓库编号 -->
WH_NAME as "whName", <!-- 仓库名称 -->
STATUS as "status", <!-- 状态 0未提交,1已提交 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
RECEIVE_TYPE as "receiveType" <!-- 领料单类型 0:正常,1:退库 -->
FROM ${hggpSchema}.HGKC008 WHERE 1=1
<isNotEmpty prepend=" AND " property="billDate">
LEFT(RECEIPT_DATE,6) = #billDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="submitStatus">
STATUS = #submitStatus#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID desc
</isEmpty>
</dynamic>
</select>
</sqlMap>
......@@ -13,6 +13,8 @@ import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.kc.domain.*;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.zl.domain.HGZL002;
import com.baosight.hggp.hg.zl.domain.HGZL004;
import com.baosight.hggp.util.AssertUtils;
......@@ -127,6 +129,16 @@ public class HGKCTools {
// HGCGTools.HgCg003.updateStatus(receiveNo, HGConstant.CgReceiveStatus.S_5);
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public static List<HGKC001> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "入库时间不能为空");
return DaoBase.getInstance().query("HGKC001.queryCheckList", paramMap);
}
}
/**
......@@ -278,8 +290,10 @@ public class HGKCTools {
private static void setHgkc003Data(List<HGZL002> hgzl002List, List<HGKC003> hgkc003List, Integer code, List<HGZL004> hgzl004List) {
List<String> inventCodes = hgzl002List.stream().map(HGZL002::getProductCode).collect(Collectors.toList());
List<HGPZ005> hgpz005List = HGPZTools.HgPz005.listByInventCodes(inventCodes);
hgzl002List.forEach(o->{
HGPZ005 hgpz005 = hgpz005List.stream().filter(h->h.getInventCode().equals(o.getProductCode())).findAny().orElse(null);
HGSC008 hgsc008 = HGSCTools.THGSC008.getById(o.getWorkId());
if(Objects.nonNull(hgpz005)){
HGKC003 hgkc003 = new HGKC003();
hgkc003.setDepositNo(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROD_DEPOSIT_NO));
......@@ -302,11 +316,11 @@ public class HGKCTools {
return;
}
//单重
BigDecimal invUnitWeight = HGPZTools.HgPz005.calcUnitWeight(hgpz005);
hgkc003.setInvUnitWeight(invUnitWeight);
// BigDecimal invUnitWeight = HGPZTools.HgPz005.calcUnitWeight(hgpz005);
hgkc003.setInvUnitWeight(hgsc008.getSingleWeight());
//总重
BigDecimal invWeight = invUnitWeight.multiply(hgkc003.getInvQty());
hgkc003.setInvWeight(invWeight);
// BigDecimal invWeight = invUnitWeight.multiply(hgkc003.getInvQty());
hgkc003.setInvWeight(hgsc008.getTotalWeight());
hgkc003.setProjCode(o.getProjCode());
hgkc003.setProjName(o.getProjName());
hgkc003.setPartCode(o.getProductCode());
......@@ -387,6 +401,17 @@ public class HGKCTools {
List<HGKC003> results = list(depositNos);
return results.stream().collect(Collectors.toMap(HGKC003::getDepositNo, item -> item));
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public static List<HGKC003> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "时间不能为空");
return DaoBase.getInstance().query("HGKC003.queryCheckList", paramMap);
}
}
/**
......@@ -527,6 +552,17 @@ public class HGKCTools {
queryMap.put("ids", ids);
DaoUtils.update(HGSqlConstant.HGKC004.UPDATE_PRINT, queryMap);
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public static List<HGKC004> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "时间不能为空");
return DaoBase.getInstance().query("HGKC004.queryCheckList", paramMap);
}
}
/**
......@@ -653,6 +689,17 @@ public class HGKCTools {
HGKC006 result = (HGKC006) DaoBase.getInstance().get(HGKC006.QUERY, HGKC006.FIELD_ID, id);
return result;
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public static List<HGKC006> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "时间不能为空");
return DaoBase.getInstance().query("HGKC006.queryCheckList", paramMap);
}
}
public static class HgKc006A {
......@@ -671,6 +718,17 @@ public class HGKCTools {
HGKC007 result = (HGKC007) DaoBase.getInstance().get(HGKC007.QUERY, HGKC007.FIELD_ID, id);
return result;
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public static List<HGKC007> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "时间不能为空");
return DaoBase.getInstance().query("HGKC007.queryCheckList", paramMap);
}
}
public static class HgKc007A {
......@@ -680,7 +738,6 @@ public class HGKCTools {
List<HGKC007A> results = DaoBase.getInstance().query(HGKC007A.QUERY, paramMap);
return results;
}
}
......@@ -691,6 +748,17 @@ public class HGKCTools {
return result;
}
/**
* 查询
* 成本核算数据检查
* @param paramMap
* @return
*/
public static List<HGKC008> checkList(Map paramMap) {
AssertUtils.isEmpty(paramMap, "时间不能为空");
return DaoBase.getInstance().query("HGKC008.queryCheckList", paramMap);
}
}
public static class HgKc008A {
......
......@@ -5,6 +5,7 @@ import com.baosight.hggp.common.AssignStatusEnum;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cg.domain.HGCG001;
import com.baosight.hggp.hg.cg.tools.HGCGTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ005;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
......@@ -219,11 +220,14 @@ public class ServiceHGSC009A extends ServiceBase {
inventUnitMap = hgpz005List.stream().collect(Collectors.toMap(HGPZ005::getInventCode,HGPZ005::getUnit,(v1,v2)->v1));
}
}
// 数据校验
this.checkInsertcgData(hgsc009AList);
for (HGSC009A hgsc009 : hgsc009AList) {
// 写入子表数据
HGCG001 hgcg001 = new HGCG001();
BeanUtils.copyProperties(hgsc009,hgcg001);
hgcg001.setMaterialPlanId(hgsc009.getId());
hgcg001.setCompanyCode(hgsc009.getCompanyCode());
hgcg001.setCompanyName(hgsc009.getCompanyName());
hgcg001.setInventCode(hgsc009.getInventCode());
......@@ -251,4 +255,13 @@ public class ServiceHGSC009A extends ServiceBase {
return inInfo;
}
private void checkInsertcgData(List<HGSC009A> hgsc009AList) {
List<Long> materialPlanIds = hgsc009AList.stream().map(HGSC009A::getId).collect(Collectors.toList());
List<HGCG001> hgcg001List = HGCGTools.HgCg001.listByMaterialPlanIds(materialPlanIds);
hgsc009AList.forEach(o->{
HGCG001 hgcg001 = hgcg001List.stream().filter(c -> c.getMaterialPlanId().intValue() == o.getId()).findAny().orElse(null);
AssertUtils.isTrue(Objects.nonNull(hgcg001), String.format("材料计划[%s]已生成采购计划", o.getPlanMaterialCode()));
});
}
}
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
{
field: "button",
title: "操作",
template: '<input value="数据检查" class="i-btn-sm" type="button" align="center" onclick="openButtonCheck(\'#:id#\')" >' +
'<input value="成本核算" class="i-btn-sm" type="button" align="center" onclick="openButtonCalculate(\'#:id#\')" >'
,
width: 100
}
],
}
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 数据检查
* @param id
*/
let openButtonCheck = function (id) {
let inEiInfo = new EiInfo();
inEiInfo.set("id", id);
JSUtils.confirm("确定进行检查数据吗? ", {
ok: function () {
EiCommunicator.send('HGCW055', 'checkData', inEiInfo, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
let resultCode = ei.extAttr.resultCode;
let resultDesc = ei.extAttr.resultDesc;
message(resultDesc);
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
}
);
}
});
}
/**
* 成本核算
* @param id
*/
let openButtonCalculate = function (id) {
let inEiInfo = new EiInfo();
inEiInfo.set("id", id);
JSUtils.confirm("确定进行成本核算操作吗? ", {
ok: function () {
EiCommunicator.send('HGCW055', 'calculate', inEiInfo, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
let resultCode = ei.extAttr.resultCode;
let resultDesc = ei.extAttr.resultDesc;
message(resultDesc);
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
}
);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head>
</head>
<EF:EFPage title="账期维护">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFDatePicker cname="核算年月" blockId="inqu_status" ename="yearMonth" row="0" colWidth="3"
format="yyyy-MM" parseFormats="['yyyyMM']" start="year" depth="year"/>
<EF:EFSelect cname="核算状态" ename="inqu_status-0-checkStatus" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.checkStatus"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="button" cname="操作" width="120" enable="false" align="center"/>
<EF:EFColumn ename="companyName" cname="公司名称" width="150" align="center" required="true"/>
<EF:EFColumn ename="year" cname="核算年度" width="100" align="center" required="true"/>
<EF:EFColumn ename="month" cname="核算月份" width="100" align="center" required="true"/>
<EF:EFComboColumn ename="checkStatus" cname="核算状态" width="100" align="center" required="true"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="0">
<EF:EFCodeOption codeName="hggp.cw.checkStatus"/>
</EF:EFComboColumn>
<EF:EFColumn ename="checkName" cname="核算人" width="100" align="center"
required="true"/>
<EF:EFColumn ename="checkBy" cname="核算人" width="100" align="center"
required="true" hidden="true"/>
<EF:EFColumn ename="checkTime" cname="核算时间" enable="false" width="120" editType="datetime"
parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"
dateFormat="yyyy-MM-dd HH:mm:ss" displayType="datetime" />
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HG/CW/HGCW055.js"></script>
\ No newline at end of file
......@@ -49,7 +49,7 @@
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="otherOutDate" cname="单据日期" width="100" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="otherOutNo" cname="其他库单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="otherOutNo" cname="其他库单号" enable="false" width="140" align="center"/>
<EF:EFColumn ename="whCode" cname="仓库名称" width="120" align="center" required="true" />
<EF:EFColumn ename="whName" cname="仓库名称" hidden="true"/>
<EF:EFComboColumn cname="状态" ename="submitStatus" width="90" align="center" enable="false" >
......
......@@ -107,7 +107,6 @@ $(function () {
resultGrid.setCellValue(e.items[0],"companyName",companyCodeBox[i]['companyName']);
}
}
loadChange(grid, e, "projCode");
}
// 判断父级节点是否发生变化
if (e.field == "projCode") {
......@@ -136,9 +135,6 @@ $(function () {
}
let query = function () {
resultGrid.dataSource.page(1);
}
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
......@@ -174,6 +170,9 @@ $(function () {
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 显示附件详情
*
......@@ -237,8 +236,12 @@ function INSERTCG() {
ok: function () {
EiCommunicator.send('HGSC009A', 'insertcg', inEiInfo, {
onSuccess(response) {
if (response.status == 1){
NotificationUtil(response.msg);
query();
}else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
......
......@@ -29,13 +29,13 @@
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="150" align="center"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="200" required="true"
columnTemplate="#=companyName#" itemTemplate="#=companyName#"
textField="companyName" valueField="companyCode"
maxLength="16" readonly="false" width="100" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center" hidden="true" />
<EF:EFColumn ename="companyName" cname="公司名称" width="120" enable="false" readonly="true" align="center"/>
<%-- <EF:EFComboColumn ename="projCode" cname="项目编码"--%>
<%-- columnTemplate="#=textField#" itemTemplate="#=textField#"--%>
<%-- textField="textField" valueField="valueField"--%>
......
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