Commit 4715141b by liuyang

2024-07-16 原材料成本核算选择公司提示bug修复

parent 9e263532
......@@ -85,7 +85,7 @@ public class ServiceHGCB002 extends ServiceEPBase {
public EiInfo selectAll(EiInfo inInfo) {
try {
Map params= EiInfoUtils.getFirstRow(inInfo);
HGCW001 hgcw001 = HGCWTools.HgCw001.getMaxAccountPeriod(params.get(HGCB002.FIELD_COMPANY_CODE).toString());
HGCW001 hgcw001 = HGCWTools.HgCw001.getMaxAccountPeriod(params);
EiInfoUtils.addBlock(inInfo,"hgcw001_block_id", hgcw001, HGCW001.class);
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "同步数据失败");
......
......@@ -338,14 +338,14 @@
ACCOUNT_PERIOD_DATE_START as "accountPeriodDateStart",
ACCOUNT_PERIOD_DATE_END as "accountPeriodDateEnd"
from ${hggpSchema}.HGCW001
where ACCOUNT_PERIOD_STATUS = 0
where ACCOUNT_PERIOD_STATUS = #accountPeriodStatus#
AND ACCOUNT_CODE = #accountCode#
AND COMPANY_CODE = #companyCode#
AND ACCOUNT_PERIOD = (
select MAX(ACCOUNT_PERIOD) from ${hggpSchema}.HGCW001
where ACCOUNT_CODE = #accountCode#
and COMPANY_CODE = #companyCode#
and ACCOUNT_PERIOD_STATUS = 0
and ACCOUNT_PERIOD_STATUS = #accountPeriodStatus#
)
</select>
......
......@@ -48,8 +48,19 @@ public class HGCWTools {
public static HGCW001 getMaxAccountPeriod(String companyCode) {
Map<String, Object> params = new HashMap<>();
params.put("companyCode", companyCode);
params.put(HGCW001.FIELD_ACCOUNT_PERIOD_STATUS, AccountPeriodStatusEnum.OPEN.getCode());
List<HGCW001> list = DaoBase.getInstance().query("HGCW001.getMaxAccountPeriod", params);
AssertUtils.isEmpty(list, "未找到公司有关账状态的会计期");
AssertUtils.isEmpty(list, "未找到公司有关账状态的会计期,请先业务账期关账!");
return list.get(0);
}
public static HGCW001 getMaxAccountPeriod(Map paramMap) {
AssertUtils.isEmpty(paramMap.get("companyCode").toString(), "公司不能为空!");
Map<String, Object> params = new HashMap<>();
params.put(HGCW001.FIELD_COMPANY_CODE, paramMap.get("companyCode"));
params.put(HGCW001.FIELD_ACCOUNT_PERIOD_STATUS, AccountPeriodStatusEnum.OPEN.getCode());
List<HGCW001> list = DaoBase.getInstance().query("HGCW001.getMaxAccountPeriod", params);
AssertUtils.isEmpty(list, String.format("未找到[%s]有关账状态的会计期,请先业务账期关账!", paramMap.get(HGCW001.FIELD_COMPANY_NAME)));
return list.get(0);
}
......
......@@ -3,33 +3,43 @@ $(function() {
let companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#inqu_status-0-companyCode").on("change", function () {
let companyCode = $("#inqu_status-0-companyCode");
let textField = IPLAT.EFSelect.text(companyCode);
//let valueField = IPLAT.EFSelect.value(companyCode);
$("#inqu_status-0-companyName").val(textField);
})
$("#CONFIRM").on("click", function () {
let companyCode = $("#inqu_status-0-companyCode").val();
let companyName = $("#inqu_status-0-companyName").val();
if (companyCode.length < 1) {
message("请选择公司");
return;
}
let hgcw001 = queryHgcw001(companyCode);
let companyName;
let accountPeriod = hgcw001[0].accountPeriod;
for (let i = 0; i <companyCodeBox.length ; i++) {
if (companyCodeBox[i].companyCode == hgcw001[0].companyCode) {
companyName = companyCodeBox[i].companyName;
break;
}
let flag = true;
let hgcw001 = queryHgcw001(companyCode,companyName);
if (hgcw001.length <= 0 ){
flag = false;
return false;
}
JSUtils.confirm("确定要对[" + companyName + " 会计期"+accountPeriod+"]做\"数据同步\"操作? ", {
ok: function () {
parent.JSColorbox.setValueCallback(hgcw001[0]);
}
});
if (flag){
let accountPeriod = hgcw001[0].accountPeriod;
JSUtils.confirm("确定要对[" + companyName + " 会计期"+accountPeriod+"]做\"数据同步\"操作? ", {
ok: function () {
parent.JSColorbox.setValueCallback(hgcw001[0]);
}
});
}
});
});
let queryHgcw001 = function (companyCode){
let queryHgcw001 = function (companyCode,companyName){
var hgcw001_block_id =[];
let info = new EiInfo();
info.set("inqu_status-0-companyCode", companyCode);
info.set("inqu_status-0-companyName", companyName);
EiCommunicator.send("HGCB002", "selectAll", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
......
......@@ -20,6 +20,7 @@
<EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司名称" colWidth="3" type="hidden" />
</div>
</EF:EFRegion>
</EF:EFPage>
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