Commit 935a54d9 by 江和松

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

parents e2583865 1f9296a2
......@@ -92,7 +92,7 @@ public enum DdynamicEnum {
* 用途:存货档案下拉框 (不默认状态)
* 编写:
*/
INVENT_RECORD_BOX_BLOCK_ID("invent_record_box_block_id","inventCode","inventName","status","id","inventType","spec","material","unit", "length", "width", "thick","coefficient","HGPZ005.queryInventCodeBox"),
INVENT_RECORD_BOX_BLOCK_ID("invent_record_box_block_id","inventCode","inventName","status","id","inventType","spec","material","unit", "length", "width", "thick","inventTypeDetail","HGPZ005.queryInventCodeBox"),
/**
* 模块:存货档案
......@@ -151,7 +151,7 @@ public enum DdynamicEnum {
* 用途:调拨单下拉框
* 编写:ly
*/
INVENT_CODE_BOX_BLOCK_ID("invent_code_box_block_id", "inventCode", "inventName","inventType", "specId","spec","length","width","thick","invQty","invUnitWeight","invWeight", "HGKC010.queryInventCodeBox"),
INVENT_CODE_BOX_BLOCK_ID("invent_code_box_block_id", "inventCode", "inventName","inventType", "specId","spec","length","width","thick","invQty","invUnitWeight","invWeight","inventTypeDetail", "HGKC010.queryInventCodeBox"),
/**
* 模块:从实时库存取规格信息
......
......@@ -61,6 +61,10 @@ public enum InventTypeDetailEnum {
return new Integer[]{COMPONENT.code,SEMI_FINISHED_PRODUCT.code};
}
public static Integer[] getInentTypeThree(){
return new Integer[]{RAW.code,CONSUMABLE.code,CONSUMABLE.code,SEMI_FINISHED_PRODUCT.code};
}
public static Integer[] getProdTypeFour(){
return new Integer[]{COMPONENT.code,SEMI_FINISHED_PRODUCT.code,RAW.code,CONSUMABLE.code};
}
......
......@@ -269,4 +269,17 @@
</select>
<select id="getMaxAccountPeriod" resultClass="java.util.HashMap">
select
ACCOUNT_CODE as "accountCode",
COMPANY_CODE as "companyCode",
ACCOUNT_YEAR as "accountYear",
MAX(ACCOUNT_PERIOD) as "accountPeriod"
from ${hggpSchema}.HGCW001
where ACCOUNT_PERIOD_STATUS = '0'
<include refid="condition" />
group by
ACCOUNT_CODE, COMPANY_CODE, ACCOUNT_YEAR
</select>
</sqlMap>
......@@ -30,6 +30,15 @@ public class HGCWTools {
AssertUtils.isEmpty(paramMap, "数据检查参数不能为空");
return DaoBase.getInstance().query("HGCW001.queryCheckList", paramMap);
}
public static Map getMaxAccountPeriod(String companyCode) {
Map<String, Object> params = new HashMap<>();
params.put("companyCode", companyCode);
params.put("accountPeriodStatus",0);
List<Map> list = DaoBase.getInstance().query("HGCW001.getMaxAccountPeriod", params);
AssertUtils.isEmpty(list, "未找到公司对应的会计期间");
return list.get(0);
}
}
public static class HgCw002 {
......
......@@ -72,7 +72,7 @@ public class HGKC003 extends DaoEPBase {
public static final String FIELD_AMOUNT = "amount"; /* 金额*/
public static final String FIELD_STORAGE_TYPE = "storageType"; /* 入库类型:1:入库 2:退回*/
public static final String FIELD_IS_RETURN = "isReturn"; /* 是否退回*/
public static final String FIELD_INVENT_TYPE_DETAIL = "inventTypeDetail"; /*存货类型明细*/
public static final String COL_ID = "ID";
public static final String COL_QUALITY_ID = "QUALITY_ID"; /* 质检单ID*/
......@@ -182,6 +182,7 @@ public class HGKC003 extends DaoEPBase {
private BigDecimal amount = new BigDecimal("0"); /* 金额*/
private Integer storageType; /* 入库类型:1:入库 2:退回*/
private Integer isReturn; /* 是否退回:0:否 1:是*/
private Integer inventTypeDetail; /*存货类型明细 1:构建 2:零件*/
/**
* initialize the metadata.
......@@ -421,6 +422,10 @@ public class HGKC003 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_IS_RETURN);
eiColumn.setDescName("是否退回:0:否 1:是");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_INVENT_TYPE_DETAIL);
eiColumn.setDescName("存货类型明细");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -1143,6 +1148,13 @@ public class HGKC003 extends DaoEPBase {
this.isReturn = isReturn;
}
public Integer getInventTypeDetail() {
return inventTypeDetail;
}
public void setInventTypeDetail(Integer inventTypeDetail) {
this.inventTypeDetail = inventTypeDetail;
}
/**
* get the value from Map.
*
......@@ -1200,6 +1212,7 @@ public class HGKC003 extends DaoEPBase {
setAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_AMOUNT)), amount));
setStorageType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STORAGE_TYPE)), storageType));
setIsReturn(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_IS_RETURN)), isReturn));
setInventTypeDetail(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_INVENT_TYPE_DETAIL)), inventTypeDetail));
}
/**
......@@ -1258,6 +1271,7 @@ public class HGKC003 extends DaoEPBase {
map.put(FIELD_AMOUNT, StringUtils.toString(amount, eiMetadata.getMeta(FIELD_AMOUNT)));
map.put(FIELD_STORAGE_TYPE, StringUtils.toString(storageType, eiMetadata.getMeta(FIELD_STORAGE_TYPE)));
map.put(FIELD_IS_RETURN, StringUtils.toString(isReturn, eiMetadata.getMeta(FIELD_IS_RETURN)));
map.put(FIELD_INVENT_TYPE_DETAIL,StringUtils.toString(inventTypeDetail, eiMetadata.getMeta(FIELD_INVENT_TYPE_DETAIL)));
return map;
}
......
......@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.constant.HGConstant;
......@@ -11,6 +12,7 @@ import com.baosight.hggp.hg.kc.domain.HGKC007;
import com.baosight.hggp.hg.kc.domain.HGKC007A;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.kc.utils.HGKCUtils;
import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
......@@ -49,8 +51,12 @@ public class ServiceHGKC007A extends ServiceBase {
map.put(HGKC007A.FIELD_ACCOUNT_CODE, UserSessionUtils.getAccountCode());
map.put(HGKC007A.FIELD_WH_CODE, whCode);
map.put(HGKC007A.FIELD_COMPANY_CODE, companyCode);
map.put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour());
CommonMethod.initBlock(inInfo,
Arrays.asList(DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,DdynamicEnum.SPEC_BOX_BLOCK_ID),map,false
Arrays.asList(
DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID,
DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,
DdynamicEnum.SPEC_BOX_BLOCK_ID),map,false
);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC007A().eiMetadata);
} catch (PlatException e) {
......
......@@ -189,6 +189,7 @@ public class ServiceHGKC013 extends ServiceEPBase {
hgkc006A.setPartThick(hgkc013A.getThick());
hgkc006A.setPartSpec(hgkc013A.getSpec());
hgkc006A.setSource(InventorySource.ALLOCATION.getCode());
hgkc006A.setInventTypeDetail(hgkc013A.getInventTypeDetail());
DaoUtils.insert(HGKC006A.INSERT, hgkc006A);
}
}
......@@ -230,6 +231,7 @@ public class ServiceHGKC013 extends ServiceEPBase {
hgkc007A.setPartThick(hgkc013A.getThick());
hgkc007A.setPartSpec(hgkc013A.getSpec());
hgkc007A.setSource(InventorySource.ALLOCATION.getCode());
hgkc007A.setInventTypeDetail(hgkc013A.getInventTypeDetail());
DaoUtils.insert(HGKC007A.INSERT, hgkc007A);
}
}
......
......@@ -2,12 +2,14 @@ package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.InventTypeDetailEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.kc.domain.HGKC010;
import com.baosight.hggp.hg.kc.domain.HGKC013;
import com.baosight.hggp.hg.kc.domain.HGKC013A;
import com.baosight.hggp.hg.kc.tools.HGKCTools;
import com.baosight.hggp.hg.pz.domain.HGPZ004;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
......@@ -33,12 +35,15 @@ public class ServiceHGKC013A extends ServiceEPBase {
Map map = EiInfoUtils.getFirstRow(inInfo);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGKC013A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo = super.query(inInfo, HGKC013A.QUERY, new HGKC013A());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID,DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID));
Map<String, Object> params = new HashMap<>();
params.put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour());
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.WH_RECORD_BLOCK_ID,DdynamicEnum.INVENT_TYPE_BOX_BLOCK_ID),params);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.INVENT_CODE_BOX_BLOCK_ID,DdynamicEnum.SPEC_BOX_BLOCK_ID),
new HashMap<String,Object>(){{
put(HGKC013.FIELD_COMPANY_CODE,map.get(HGKC013.FIELD_CALLOUT_COMPANY_CODE));
put(HGKC010.FIELD_WH_CODE,map.get(HGKC013A.FIELD_CALLOUT_WH_CODE));
put(HGKC013A.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
put(HGPZ004.FIELD_INVENT_TYPE_DETAILS, InventTypeDetailEnum.getProdTypeFour());
}}, false);
return inInfo;
}
......@@ -107,6 +112,7 @@ public class ServiceHGKC013A extends ServiceEPBase {
if ( result > 0){
throw new PlatException("实时库存数量不够,无法保存!");
}
hgkc013a.setInventTypeDetail(Integer.parseInt(hgkc010.getInventTypeDetail()));
}
if (hgkc013a.getId() == null || hgkc013a.getId() == 0) {
this.add(hgkc013a);
......
......@@ -150,6 +150,12 @@
<isNotEmpty prepend=" AND " property="isReturn">
IS_RETURN = #isReturn#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetail">
INVENT_TYPE_DETAIL = #inventTypeDetail#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="inventTypeDetails">
INVENT_TYPE_DETAIL IN <iterate close=")" open="(" conjunction="," property="inventTypeDetails">#inventTypeDetails[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -203,7 +209,8 @@
AMOUNT as "amount", <!-- 金额 -->
STORAGE_TYPE as "storageType", <!-- 入库类型:1:入库 2:退回 -->
IS_RETURN as "isReturn", <!-- 是否退回:0:否 1:是 -->
SUBMIT_STATUS as "submitStatus" <!-- 提交状态 -->
SUBMIT_STATUS as "submitStatus", <!-- 提交状态 -->
INVENT_TYPE_DETAIL as "inventTypeDetail"
FROM ${hggpSchema}.HGKC003 WHERE 1=1 AND DELETE_FLAG = 0
<include refid="condition" />
<dynamic prepend="ORDER BY">
......@@ -272,7 +279,8 @@
AMOUNT, <!-- 金额 -->
STORAGE_TYPE, <!-- 入库类型:1:入库 2:退回 -->
IS_RETURN, <!-- 是否退回:0:否 1:是 -->
SUBMIT_STATUS
SUBMIT_STATUS,
INVENT_TYPE_DETAIL
)
VALUES (#qualityId#,#partSpecId#,#rectificationId#,#partCoefficient#,#accountCode#,
#depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#,
......@@ -282,7 +290,7 @@
#factoryCode#, #prodOrderNo#, #prodTaskNo#, #projCode#, #projName#,
#prdtType#, #prdtCode#, #prdtName#, #prdtLength#, #prdtWidth#, #prdtThick#,
#prdtSpec#, #partType#, #partCode#, #partName#, #partLength#, #partWidth#,
#partThick#, #partSpec#, #price#, #amount#, #storageType#, #isReturn#,#submitStatus#)
#partThick#, #partSpec#, #price#, #amount#, #storageType#, #isReturn#,#submitStatus#,#inventTypeDetail#)
</insert>
<delete id="delete">
......@@ -344,7 +352,8 @@
AMOUNT = #amount#, <!-- 金额 -->
STORAGE_TYPE = #storageType#, <!-- 入库类型:1:入库 2:退回 -->
IS_RETURN = #isReturn#, <!-- 是否退回:0:否 1:是 -->
SUBMIT_STATUS = #submitStatus# <!-- 提交状态 -->
SUBMIT_STATUS = #submitStatus#, <!-- 提交状态 -->
INVENT_TYPE_DETAIL = #inventTypeDetail#
WHERE
ID = #id#
</update>
......@@ -433,7 +442,8 @@
AMOUNT as "amount", <!-- 金额 -->
STORAGE_TYPE as "storageType", <!-- 入库类型:1:入库 2:退回 -->
IS_RETURN as "isReturn", <!-- 是否退回:0:否 1:是 -->
SUBMIT_STATUS as "submitStatus" <!-- 提交状态 -->
SUBMIT_STATUS as "submitStatus", <!-- 提交状态 -->
INVENT_TYPE_DETAIL as "inventTypeDetail"
FROM ${hggpSchema}.HGKC003 WHERE 1=1 AND DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="billDate">
LEFT(DEPOSIT_DATE,6) = #billDate#
......
......@@ -242,7 +242,8 @@
THICK as "thick", <!-- 厚度 -->
INV_QTY as "invQty", <!-- 库存数量 -->
INV_UNIT_WEIGHT as "invUnitWeight", <!-- 库存单重 -->
INV_WEIGHT as "invWeight" <!-- 库存重量 -->
INV_WEIGHT as "invWeight", <!-- 库存重量 -->
INVENT_TYPE_DETAIL as "inventTypeDetail"
FROM ${hggpSchema}.HGKC010
WHERE 1=1
<include refid="condition"/>
......
......@@ -640,35 +640,76 @@
<!--项目产量-->
<select id="queryProjCodeWt" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
select
h2.factory_code as factoryCode ,
h2.factory_name as factoryName ,
h.proj_code as projCode,
h.proj_name as projName,
h.finish_date as completeDate,
sum(h.total_weight) as totalWeight,
sum(h.finish_weight) as finishWeight
from ${hggpSchema}.HGSC005a h inner join ${hggpSchema}.HGSC007 h2 on h.company_code = h2.company_code AND h.proj_code = h2.proj_code
where 1 = 1
<include refid="appCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
h.account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
h.company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
h.company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
h2.factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
h2.factory_name = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="finishDate">
h.finish_date = #finishDate#
</isNotEmpty>
group by h2.factory_code, h2.factory_name, h.proj_code, h.proj_name, h.finish_date
order by h.finish_date desc
a.proj_code as projCode,
a.proj_name as projName,
a.plan_end_date as completeDate,
sum(a.total_weight) as totalWeight,
sum(a.finish_weight) as finishWeight,
a.updated_time as updatedTime
from (
select
h.proj_code,
h.proj_name,
h.plan_end_date,
h.total_weight,
0 as finish_weight,
left(h1.updated_time,8) as updated_time
from ${hggpSchema}.HGSC005a h
inner join ${hggpSchema}.HGSC005 h1 on h.company_code = h1.company_code and h.plan_code = h1.plan_code
inner join ${hggpSchema}.HGSC007 h2 on h.company_code = h2.company_code AND h.proj_code = h2.proj_code
where 1 = 1 and h1.commit_status = 2
<include refid="appCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
h.account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
h.company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
h.company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
h2.factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
h2.factory_name = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
left(h1.updated_time,8) = #updatedTime#
</isNotEmpty>
union all
select
h.proj_code,
h.proj_name,
h.plan_end_date,
0 as totalWeight,
h.finish_weight,
left(h1.updated_time,8) as updated_time
from ${hggpSchema}.HGSC005a h
inner join ${hggpSchema}.HGSC005 h1 on h.plan_code = h1.plan_code
inner join ${hggpSchema}.HGSC007 h2 on h.company_code = h2.company_code AND h.proj_code = h2.proj_code
where 1 = 1 and h1.commit_status = 2
<include refid="appCondition"/>
<isNotEmpty prepend=" AND " property="accountCode">
h.account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
h.company_code = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
h.company_name = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
h2.factory_code = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
h2.factory_name = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
left(h1.updated_time,8) = #updatedTime#
</isNotEmpty>
)a
group by a.proj_code, a.proj_name, a.plan_end_date, a.updated_time
order by a.updated_time desc
</select>
</sqlMap>
......@@ -171,6 +171,7 @@ $(function () {
resultGrid.setCellValue(item, 'invQty', inventRecordBoxBlocks[i]['param7Field']);
resultGrid.setCellValue(item, 'invUnitWeight', inventRecordBoxBlocks[i]['param8Field']);
resultGrid.setCellValue(item, 'invWeight', inventRecordBoxBlocks[i]['param9Field']);
resultGrid.setCellValue(item, 'inventTypeDetail', inventRecordBoxBlocks[i]['param10Field']);
}
}
loadChange(grid,e,"price");
......
......@@ -35,6 +35,7 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" width="220" align="center" required="true" readonly="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="160" align="center" required="true" enable="false"/>
<EF:EFColumn ename="partSpec" cname="规格" width="120" align="center" enable="true" required="true"/>
......
......@@ -29,11 +29,11 @@ $(function() {
title: "存货名称",
filter: function (options) {
let inventType = options.model["inventType"];
if (inventType){
/*if (inventType){
return _.filter(inventCodedBox, function (item) {
return item["param1Field"] === inventType;
})
}
}*/
return options.values;
},
template: function (dataItem) {
......@@ -104,7 +104,7 @@ $(function() {
e.items[0]["width"] = specIdBox[i]['param2Field'];
e.items[0]["thick"] = specIdBox[i]['param3Field'];
e.items[0]["quantity"] = specIdBox[i]['param4Field'];
resultGrid.setCellValue(e.items[0],"unitWeight",specIdBox[i]['param5Field']);
resultGrid.setCellValue(e.items[0],"unitWeight",specIdBox[i]['param5Field']=="null"?0:specIdBox[i]['param5Field']);
resultGrid.setCellValue(e.items[0],"weight",specIdBox[i]['param6Field']);
}
}
......@@ -130,8 +130,9 @@ $(function() {
resultGrid.setCellValue(e.items[0],"width",inventCodedBox[i]['param5Field']);
resultGrid.setCellValue(e.items[0],"thick",inventCodedBox[i]['param6Field']);
resultGrid.setCellValue(e.items[0],"quantity",inventCodedBox[i]['param7Field']);
resultGrid.setCellValue(e.items[0],"unitWeight",inventCodedBox[i]['param8Field']);
resultGrid.setCellValue(e.items[0],"unitWeight",inventCodedBox[i]['param8Field']=="null"?0:inventCodedBox[i]['param8Field']);
resultGrid.setCellValue(e.items[0],"weight",inventCodedBox[i]['param9Field']);
resultGrid.setCellValue(e.items[0],"inventTypeDetail",inventCodedBox[i]['param10Field']);
}
}
loadChange(grid,e,"quantity");
......
......@@ -40,6 +40,7 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
filter="contains">
</EF:EFComboColumn>
<EF:EFColumn ename="inventTypeDetail" cname="存货类型大类" hidden="true"/>
<EF:EFComboColumn ename="spec" cname="规格" enable="true" width="120" align="center" required="true"
blockName="spec_box_block_id" textField="textField" valueField="valueField"
columnTemplate="#=textField#" itemTemplate="#=textField#" readonly="false"
......
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