Commit 6b52a0fe by 江和松

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

parents 053f47a2 508d4c0e
...@@ -279,7 +279,7 @@ public enum DdynamicEnum { ...@@ -279,7 +279,7 @@ public enum DdynamicEnum {
put("orgType", OrgTypeEnum.COMPANY.getCode()); put("orgType", OrgTypeEnum.COMPANY.getCode());
}}), }}),
USER_ID_BOX_BLOCK_ID("user_block_id","loginName","userName","XSOG0801.queryUserByOrgIdBack"), USER_ID_BOX_BLOCK_ID("user_block_id","loginName","userName","companyCode","XSOG0801.queryUserByOrgIdBack"),
/** /**
* 模块:工序编码 * 模块:工序编码
......
...@@ -77,13 +77,13 @@ public class ServiceHGCB001 extends ServiceBase { ...@@ -77,13 +77,13 @@ public class ServiceHGCB001 extends ServiceBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<HGCB001> hgcb001List = MapUtils.toDaoEPBase(resultRows,HGCB001.class); List<HGCB001> hgcb001List = MapUtils.toDaoEPBase(resultRows,HGCB001.class);
checkSaveData(hgcb001List); checkRepetition(hgcb001List);
// 写入数据 // 写入数据
Optional.ofNullable(hgcb001List).orElse(new ArrayList<>()).forEach(hgcb001 -> { Optional.ofNullable(hgcb001List).orElse(new ArrayList<>()).forEach(hgcb001 -> {
hgcb001.setAccountPeriod(DateUtils.formatShort(hgcb001.getAccountPeriod())); hgcb001.setAccountPeriod(DateUtils.formatShort(hgcb001.getAccountPeriod()));
}); });
List<HGCB001> addList = Optional.ofNullable(hgcb001List).orElse(new ArrayList<>()).stream().filter(o -> Objects.isNull(o.getId())||o.getId()==0).collect(Collectors.toList()); List<HGCB001> addList = Optional.ofNullable(hgcb001List).orElse(new ArrayList<>()).stream().filter(o -> Objects.isNull(o.getId())||o.getId()==0).collect(Collectors.toList());
add(addList); HGCBTools.HgCb001.add(addList);
List<HGCB001> updateList = Optional.ofNullable(hgcb001List).orElse(new ArrayList<>()).stream().filter(o -> Objects.nonNull(o.getId())&&o.getId()!=0).collect(Collectors.toList()); List<HGCB001> updateList = Optional.ofNullable(hgcb001List).orElse(new ArrayList<>()).stream().filter(o -> Objects.nonNull(o.getId())&&o.getId()!=0).collect(Collectors.toList());
modify(updateList); modify(updateList);
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
...@@ -95,7 +95,7 @@ public class ServiceHGCB001 extends ServiceBase { ...@@ -95,7 +95,7 @@ public class ServiceHGCB001 extends ServiceBase {
return inInfo; return inInfo;
} }
private void checkSaveData(List<HGCB001> hgcb001List){ private void checkRepetition(List<HGCB001> hgcb001List){
if(CollectionUtils.isNotEmpty(hgcb001List)) { if(CollectionUtils.isNotEmpty(hgcb001List)) {
List<String> stringList = hgcb001List.stream().map(o -> { List<String> stringList = hgcb001List.stream().map(o -> {
return o.getCompanyCode() + "-" + o.getAccountPeriod(); return o.getCompanyCode() + "-" + o.getAccountPeriod();
...@@ -105,24 +105,7 @@ public class ServiceHGCB001 extends ServiceBase { ...@@ -105,24 +105,7 @@ public class ServiceHGCB001 extends ServiceBase {
} }
} }
/**
* 新增操作
*
* @param addList
* @return
*/
public void add(List<HGCB001> addList) {
Map<String,List<String>> periodMap = Optional.ofNullable(addList).orElse(new ArrayList<>()).stream().collect(
Collectors.groupingBy(HGCB001::getCompanyCode,Collectors.mapping(HGCB001::getAccountPeriod,Collectors.toList())));
Optional.ofNullable(periodMap).orElse(new HashMap<>()).forEach((k,v)->{
Map paramMap = new HashMap();
paramMap.put(HGCB001.FIELD_COMPANY_CODE,k);
paramMap.put("accountPeriods",v);
List dbList = HGCBTools.HgCb001.queryNoAuth(paramMap);
AssertUtils.isNotEmpty(dbList,"账期重复,请检查数据!");
});
DaoUtils.insertBatch(HGCB001.INSERT, addList);
}
/** /**
* 修改操作 * 修改操作
...@@ -131,6 +114,7 @@ public class ServiceHGCB001 extends ServiceBase { ...@@ -131,6 +114,7 @@ public class ServiceHGCB001 extends ServiceBase {
* @return * @return
*/ */
public void modify(List<HGCB001> updateList) { public void modify(List<HGCB001> updateList) {
HGCBTools.HgCb001.checkSaveData(updateList);
Map<String,List<String>> periodMap = Optional.ofNullable(updateList).orElse(new ArrayList<>()).stream().collect( Map<String,List<String>> periodMap = Optional.ofNullable(updateList).orElse(new ArrayList<>()).stream().collect(
Collectors.groupingBy(HGCB001::getCompanyCode,Collectors.mapping(HGCB001::getAccountPeriod,Collectors.toList()))); List<Long> notIds = Optional.ofNullable(updateList).orElse(new ArrayList<>()).stream().map(HGCB001::getId).collect(Collectors.toList()); Collectors.groupingBy(HGCB001::getCompanyCode,Collectors.mapping(HGCB001::getAccountPeriod,Collectors.toList()))); List<Long> notIds = Optional.ofNullable(updateList).orElse(new ArrayList<>()).stream().map(HGCB001::getId).collect(Collectors.toList());
Optional.ofNullable(periodMap).orElse(new HashMap<>()).forEach((k,v)->{ Optional.ofNullable(periodMap).orElse(new HashMap<>()).forEach((k,v)->{
...@@ -232,23 +216,8 @@ public class ServiceHGCB001 extends ServiceBase { ...@@ -232,23 +216,8 @@ public class ServiceHGCB001 extends ServiceBase {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
HGCB001 hgcb001 = new HGCB001(); HGCB001 hgcb001 = new HGCB001();
hgcb001.fromMap(resultRows.get(0)); hgcb001.fromMap(resultRows.get(0));
Integer accountPeriodStatus = hgcb001.getAccountPeriodStatus(); checkSwitchDate(hgcb001);
if (accountPeriodStatus == 1) { DaoUtils.update("HGCB001.updateSwitchRow", hgcb001);
//开账 - 做关账
//当前账期的上个账期是否关账,当前账期对应的业务账是否关账
hgcb001.setAccountPeriodStatus(0);
DaoUtils.update("HGCB001.updateSwitchRow", hgcb001);
} else if (accountPeriodStatus == 0) {
//当前账期的下个账期是否开账状态
int switchRowNum = dao.count("HGCB001.getSwitchRowNum", hgcb001);
if (switchRowNum > 0) {
inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!已经有一个会计期为开账状态!");
return inInfo;
}
hgcb001.setAccountPeriodStatus(1);
DaoUtils.update("HGCB001.updateSwitchRow", hgcb001);
}
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据操作成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据操作成功!");
...@@ -261,6 +230,7 @@ public class ServiceHGCB001 extends ServiceBase { ...@@ -261,6 +230,7 @@ public class ServiceHGCB001 extends ServiceBase {
private void checkSwitchDate(HGCB001 hgcb001){ private void checkSwitchDate(HGCB001 hgcb001){
try { try {
HGCB001 dbhgcb001 = null; HGCB001 dbhgcb001 = null;
switch (hgcb001.getAccountPeriodStatus()) { switch (hgcb001.getAccountPeriodStatus()) {
case 0: case 0:
Date nextDate = DateUtils.addMonths(DateUtils.parseDate(hgcb001.getAccountPeriod(), DateUtil.DATE12_PATTERN), 1); Date nextDate = DateUtils.addMonths(DateUtils.parseDate(hgcb001.getAccountPeriod(), DateUtil.DATE12_PATTERN), 1);
...@@ -269,7 +239,8 @@ public class ServiceHGCB001 extends ServiceBase { ...@@ -269,7 +239,8 @@ public class ServiceHGCB001 extends ServiceBase {
put(HGCW001.FIELD_COMPANY_CODE,hgcb001.getCompanyCode()); put(HGCW001.FIELD_COMPANY_CODE,hgcb001.getCompanyCode());
put(HGCW001.FIELD_ACCOUNT_PERIOD,nextDateStr); put(HGCW001.FIELD_ACCOUNT_PERIOD,nextDateStr);
}}); }});
AssertUtils.isTrue(Objects.nonNull(dbhgcb001)&&dbhgcb001.getAccountPeriodStatus()== CommonConstant.YesNo.NO_0,String.format("下个账期为关账状态:%s[%s]账期会计账已经关账!",dbhgcb001.getCompanyName(),dbhgcb001.getAccountPeriod())); AssertUtils.isTrue(Objects.nonNull(dbhgcb001)&&dbhgcb001.getAccountPeriodStatus().compareTo( CommonConstant.YesNo.NO_0)==0,String.format("下个账期为关账状态:%s[%s]账期会计账已经关账!",hgcb001.getCompanyName(),nextDateStr));
hgcb001.setAccountPeriodStatus(CommonConstant.YesNo.YES_1);
break; break;
case 1: case 1:
Date lastDate = DateUtils.addMonths(DateUtils.parseDate(hgcb001.getAccountPeriod(), DateUtil.DATE12_PATTERN), -1); Date lastDate = DateUtils.addMonths(DateUtils.parseDate(hgcb001.getAccountPeriod(), DateUtil.DATE12_PATTERN), -1);
...@@ -279,12 +250,13 @@ public class ServiceHGCB001 extends ServiceBase { ...@@ -279,12 +250,13 @@ public class ServiceHGCB001 extends ServiceBase {
put(HGCW001.FIELD_ACCOUNT_PERIOD,lastDateStr); put(HGCW001.FIELD_ACCOUNT_PERIOD,lastDateStr);
}}); }});
AssertUtils.isNull(Objects.isNull(dbhgcb001),String.format("会计账期缺失:%s[%s]账期会计账不存在!",hgcb001.getCompanyName(),lastDateStr)); AssertUtils.isNull(Objects.isNull(dbhgcb001),String.format("会计账期缺失:%s[%s]账期会计账不存在!",hgcb001.getCompanyName(),lastDateStr));
AssertUtils.isTrue(dbhgcb001.getAccountPeriodStatus()== CommonConstant.YesNo.YES_1,String.format("上个账期未关账:%s[%s]账期会计账未关账!",dbhgcb001.getCompanyName(),dbhgcb001.getAccountPeriod())); AssertUtils.isTrue(dbhgcb001.getAccountPeriodStatus().compareTo(CommonConstant.YesNo.YES_1)==0,String.format("上个账期未关账:%s[%s]账期会计账未关账!",hgcb001.getCompanyName(),lastDateStr));
HGCW001 hgcw001 = HGCWTools.HgCw001.getNoAuth(new HashMap(){{ HGCW001 hgcw001 = HGCWTools.HgCw001.getNoAuth(new HashMap(){{
put(HGCW001.FIELD_COMPANY_CODE,hgcb001.getCompanyCode()); put(HGCW001.FIELD_COMPANY_CODE,hgcb001.getCompanyCode());
put(HGCW001.FIELD_ACCOUNT_PERIOD,hgcb001.getAccountPeriod()); put(HGCW001.FIELD_ACCOUNT_PERIOD,hgcb001.getAccountPeriod());
}}); }});
AssertUtils.isTrue(Objects.nonNull(hgcw001)&&hgcw001.getAccountPeriodStatus()== CommonConstant.YesNo.YES_1,String.format("业务账未关账:%s[%s]账期业务账未关账!",hgcb001.getCompanyName(),hgcb001.getAccountPeriod())); AssertUtils.isTrue(Objects.nonNull(hgcw001)&&hgcw001.getAccountPeriodStatus().compareTo(CommonConstant.YesNo.YES_1)==0,String.format("业务账未关账:%s[%s]账期业务账未关账!",hgcb001.getCompanyName(),hgcb001.getAccountPeriod()));
hgcb001.setAccountPeriodStatus(CommonConstant.YesNo.NO_0);
break; break;
default: default:
AssertUtils.isTrue(true,"会计账期状态异常!"); AssertUtils.isTrue(true,"会计账期状态异常!");
......
...@@ -85,7 +85,7 @@ public class ServiceHGCB002 extends ServiceEPBase { ...@@ -85,7 +85,7 @@ public class ServiceHGCB002 extends ServiceEPBase {
public EiInfo selectAll(EiInfo inInfo) { public EiInfo selectAll(EiInfo inInfo) {
try { try {
Map params= EiInfoUtils.getFirstRow(inInfo); 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); EiInfoUtils.addBlock(inInfo,"hgcw001_block_id", hgcw001, HGCW001.class);
}catch (Exception e){ }catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "同步数据失败"); LogUtils.setDetailMsg(inInfo, e, "同步数据失败");
......
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
$orderBy$ $orderBy$
</isNotEmpty> </isNotEmpty>
<isEmpty property="orderBy"> <isEmpty property="orderBy">
ID asc COMPANY_CODE,ACCOUNT_PERIOD desc
</isEmpty> </isEmpty>
</dynamic> </dynamic>
...@@ -360,7 +360,6 @@ ...@@ -360,7 +360,6 @@
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 --> UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 --> DEP_CODE as "depCode" <!-- 部门编码 -->
FROM ${hggpSchema}.HGCB001 WHERE 1=1 FROM ${hggpSchema}.HGCB001 WHERE 1=1
where 1=1
<include refid="no_auth_condition"/> <include refid="no_auth_condition"/>
</select> </select>
</sqlMap> </sqlMap>
...@@ -90,6 +90,36 @@ public class HGCBTools { ...@@ -90,6 +90,36 @@ public class HGCBTools {
return CollectionUtils.isEmpty(list) ? null : list.get(0); return CollectionUtils.isEmpty(list) ? null : list.get(0);
} }
/**
* 新增操作
*
* @param addList
* @return
*/
public static void add(List<HGCB001> addList) {
checkSaveData(addList);
Map<String,List<String>> periodMap = Optional.ofNullable(addList).orElse(new ArrayList<>()).stream().collect(
Collectors.groupingBy(HGCB001::getCompanyCode,Collectors.mapping(HGCB001::getAccountPeriod,Collectors.toList())));
Optional.ofNullable(periodMap).orElse(new HashMap<>()).forEach((k,v)->{
Map paramMap = new HashMap();
paramMap.put(HGCB001.FIELD_COMPANY_CODE,k);
paramMap.put("accountPeriods",v);
List dbList = HGCBTools.HgCb001.queryNoAuth(paramMap);
AssertUtils.isNotEmpty(dbList,"账期重复,请检查数据!");
});
DaoUtils.insertBatch(HGCB001.INSERT, addList);
}
public static void checkSaveData(List<HGCB001> addList){
Optional.ofNullable(addList).orElse(new ArrayList<>()).forEach( hgcb001 -> {
AssertUtils.isEmpty(hgcb001.getCompanyCode(),"保存失败,会计账公司编码不能为空!");
AssertUtils.isEmpty(hgcb001.getCompanyName(),"保存失败,会计账公司名称不能为空!");
AssertUtils.isEmpty(hgcb001.getAccountYear(),"保存失败,会计账会计年份不能为空!");
AssertUtils.isEmpty(hgcb001.getAccountPeriod(),"保存失败,会计账会计期不能为空!");
AssertUtils.isNull(hgcb001.getAccountPeriodStatus(),"保存失败,会计账会计状态不能为空!");
});
}
/** /**
* 查询当前公司账期 * 查询当前公司账期
...@@ -368,9 +398,11 @@ public class HGCBTools { ...@@ -368,9 +398,11 @@ public class HGCBTools {
BigDecimal endAmount = hgcb004 == null ? BigDecimal.ZERO : hgcb004.getEndAmount(); BigDecimal endAmount = hgcb004 == null ? BigDecimal.ZERO : hgcb004.getEndAmount();
quantity = quantity.add(endQuantity); quantity = quantity.add(endQuantity);
amount = amount.add(endAmount); amount = amount.add(endAmount);
BigDecimal price = amount.divide(quantity, 3, RoundingMode.HALF_UP); if (quantity.compareTo(BigDecimal.ZERO) > 0) {
cb003.setPrice(price); BigDecimal price = amount.divide(quantity, 3, RoundingMode.HALF_UP);
cb003.setAmount(cb003.getQuantity().multiply(price)); cb003.setPrice(price);
cb003.setAmount(cb003.getQuantity().multiply(price));
}
cb003.setIsEstimate(0); cb003.setIsEstimate(0);
results.add(cb003); results.add(cb003);
//DaoUtils.insert(HGCB003.INSERT, cb003); //DaoUtils.insert(HGCB003.INSERT, cb003);
...@@ -654,28 +686,30 @@ public class HGCBTools { ...@@ -654,28 +686,30 @@ public class HGCBTools {
kc003ParamMap.put(HGCW001.FIELD_ACCOUNT_PERIOD_DATE_START,hgcw001.getAccountPeriodDateStart()); kc003ParamMap.put(HGCW001.FIELD_ACCOUNT_PERIOD_DATE_START,hgcw001.getAccountPeriodDateStart());
kc003ParamMap.put(HGCW001.FIELD_ACCOUNT_PERIOD_DATE_END,hgcw001.getAccountPeriodDateEnd()); kc003ParamMap.put(HGCW001.FIELD_ACCOUNT_PERIOD_DATE_END,hgcw001.getAccountPeriodDateEnd());
List<HGKC003> hgkc003List = HGKCTools.HgKc003.list(kc003ParamMap); List<HGKC003> hgkc003List = HGKCTools.HgKc003.list(kc003ParamMap);
//入库单按项目编码、产品编码、存货工序ID、规格、单重分组,分别取正向入库单数量、重量和退回数量 if(CollectionUtils.isNotEmpty(hgkc003List)) {
//生成制造成本基础数据 //入库单按项目编码、产品编码、存货工序ID、规格、单重分组,分别取正向入库单数量、重量和退回数量
List<HGCB005> hgcb005List = constractHGCB005(hgcw001,hgkc003List); //生成制造成本基础数据
//设置权重 List<HGCB005> hgcb005List = constractHGCB005(hgcw001, hgkc003List);
setingCostWeight(hgcb005List); //设置权重
//计算项目总成本 setingCostWeight(hgcb005List);
Map<String,BigDecimal> totalAmoutMap = calculateProjAmout(hgcw001); //计算项目总成本
//计算产副品成本:权重值*项目总费用=产副品制造总成本;总成本/数量=单位成本 Map<String, BigDecimal> totalAmoutMap = calculateProjAmout(hgcw001);
Optional.ofNullable(hgcb005List).orElse(new ArrayList<>()).stream().forEach( o -> { //计算产副品成本:权重值*项目总费用=产副品制造总成本;总成本/数量=单位成本
BigDecimal totalAmout = totalAmoutMap.get(o.getProjCode()); Optional.ofNullable(hgcb005List).orElse(new ArrayList<>()).stream().forEach(o -> {
o.setTotalCost(totalAmout.multiply(o.getCostWeightValue()).setScale(6,RoundingMode.HALF_UP)); BigDecimal totalAmout = totalAmoutMap.get(o.getProjCode());
o.setUnitCost(o.getTotalCost().divide(o.getQuantity(),6,RoundingMode.HALF_UP)); o.setTotalCost(totalAmout.multiply(o.getCostWeightValue()).setScale(6, RoundingMode.HALF_UP));
}); o.setUnitCost(o.getTotalCost().divide(o.getQuantity(), 6, RoundingMode.HALF_UP));
//按公司删除当前会计起的成本核算数据 });
Map cb005DeleteParam = new HashMap(); //按公司删除当前会计起的成本核算数据
cb005DeleteParam.put(HGCB005.FIELD_company_code,hgcw001.getCompanyCode()); Map cb005DeleteParam = new HashMap();
cb005DeleteParam.put(HGCB005.FIELD_account_year,hgcw001.getAccountYear()); cb005DeleteParam.put(HGCB005.FIELD_company_code, hgcw001.getCompanyCode());
cb005DeleteParam.put(HGCB005.FIELD_account_month,hgcw001.getAccountPeriod().substring(4)); cb005DeleteParam.put(HGCB005.FIELD_account_year, hgcw001.getAccountYear());
deleteByCondition(cb005DeleteParam); cb005DeleteParam.put(HGCB005.FIELD_account_month, hgcw001.getAccountPeriod().substring(4));
//保存新的成本核算数据 deleteByCondition(cb005DeleteParam);
if(CollectionUtils.isNotEmpty(hgcb005List)){ //保存新的成本核算数据
DaoBase.getInstance().insertBatch(HGCB005.INSERT, hgcb005List); if (CollectionUtils.isNotEmpty(hgcb005List)) {
DaoBase.getInstance().insertBatch(HGCB005.INSERT, hgcb005List);
}
} }
} }
} }
......
...@@ -72,6 +72,10 @@ public class ServiceHGCW001 extends ServiceBase { ...@@ -72,6 +72,10 @@ public class ServiceHGCW001 extends ServiceBase {
if (!roleCompanyCode.isEmpty()) { if (!roleCompanyCode.isEmpty()) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCW001.FIELD_COMPANY_CODES,roleCompanyCode); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCW001.FIELD_COMPANY_CODES,roleCompanyCode);
} }
String accountPeriod = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCW001.FIELD_ACCOUNT_PERIOD);
if (StringUtils.isNotEmpty(accountPeriod)) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGCW001.FIELD_ACCOUNT_PERIOD,DateUtils.formatShort(accountPeriod));
}
inInfo = super.query(inInfo, HGCW001.QUERY, new HGCW001()); inInfo = super.query(inInfo, HGCW001.QUERY, new HGCW001());
}catch (Exception e) { }catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -97,13 +101,6 @@ public class ServiceHGCW001 extends ServiceBase { ...@@ -97,13 +101,6 @@ public class ServiceHGCW001 extends ServiceBase {
hgcw001.setAccountPeriodDateStart(DateUtils.formatShort(hgcw001.getAccountPeriodDateStart())); hgcw001.setAccountPeriodDateStart(DateUtils.formatShort(hgcw001.getAccountPeriodDateStart()));
hgcw001.setAccountPeriodDateEnd(DateUtils.formatShort(hgcw001.getAccountPeriodDateEnd())); hgcw001.setAccountPeriodDateEnd(DateUtils.formatShort(hgcw001.getAccountPeriodDateEnd()));
if (hgcw001.getId() == null || hgcw001.getId() == 0) { if (hgcw001.getId() == null || hgcw001.getId() == 0) {
Map paramMap = new HashMap<>();
paramMap.put(HGCW001.FIELD_COMPANY_CODE,hgcw001.getCompanyCode());
paramMap.put(HGCW001.FIELD_ACCOUNT_PERIOD,hgcw001.getAccountPeriod());
HGCW001 cw001 =HGCWTools.HgCw001.getByCondition(paramMap); //获取当月业务账期
if (cw001 != null) {
throw new PlatException(String.format("公司[%s]会计期[%s]已存在,保存失败!",hgcw001.getCompanyCode(),hgcw001.getAccountPeriod()));
}
this.add(hgcw001); this.add(hgcw001);
} else { } else {
this.modify(hgcw001); this.modify(hgcw001);
...@@ -127,13 +124,7 @@ public class ServiceHGCW001 extends ServiceBase { ...@@ -127,13 +124,7 @@ public class ServiceHGCW001 extends ServiceBase {
DaoUtils.insert(HGCW001.INSERT, hgcw001); DaoUtils.insert(HGCW001.INSERT, hgcw001);
HGCB001 hgcb001 = new HGCB001(); HGCB001 hgcb001 = new HGCB001();
BeanUtils.copyProperties(hgcw001,hgcb001); BeanUtils.copyProperties(hgcw001,hgcb001);
HGCB001 cb001 = HGCBTools.HgCb001.select(new HashMap<String,String>(){{ HGCBTools.HgCb001.add(Collections.singletonList(hgcb001));
put(HGCB001.FIELD_ACCOUNT_PERIOD,hgcw001.getAccountPeriod());
put(HGCB001.FIELD_COMPANY_CODE,hgcw001.getCompanyCode());
}});
if (cb001 == null) {
DaoUtils.insert(HGCB001.INSERT, hgcb001); //同步添加会计期维护
}
} }
/** /**
...@@ -274,7 +265,7 @@ public class ServiceHGCW001 extends ServiceBase { ...@@ -274,7 +265,7 @@ public class ServiceHGCW001 extends ServiceBase {
throw new PlatException(String.format("公司[%s]会计期[%s]会计期维护为关账状态,业务账期关账失败!", hgcb001.getCompanyCode(),hgcw001.getAccountPeriod())); throw new PlatException(String.format("公司[%s]会计期[%s]会计期维护为关账状态,业务账期关账失败!", hgcb001.getCompanyCode(),hgcw001.getAccountPeriod()));
} }
//检查数据 //检查数据
HGCWTools.HgCw001.checkAllData(hgcw001); //HGCWTools.HgCw001.checkAllData(hgcw001);
hgcw001.setAccountPeriodStatus(0); //关账 hgcw001.setAccountPeriodStatus(0); //关账
DaoUtils.update("HGCW001.updateSwitchRow", hgcw001); DaoUtils.update("HGCW001.updateSwitchRow", hgcw001);
......
...@@ -198,7 +198,7 @@ public class ServiceHGCW014 extends ServiceBase { ...@@ -198,7 +198,7 @@ public class ServiceHGCW014 extends ServiceBase {
contractNumber.append(hgcw015.getContractNumber()).append(","); contractNumber.append(hgcw015.getContractNumber()).append(",");
} }
for (Map m : resultRows) { for (Map m : resultRows) {
String c = m.get("settlementNumber").toString(); String c = m.get("billNumber").toString();
BigDecimal remainingAmount = new BigDecimal(m.get("thisAmount").toString()); BigDecimal remainingAmount = new BigDecimal(m.get("thisAmount").toString());
rowMap.put(c, remainingAmount); rowMap.put(c, remainingAmount);
totalContractPriceIncluding = totalContractPriceIncluding.add(remainingAmount); totalContractPriceIncluding = totalContractPriceIncluding.add(remainingAmount);
...@@ -222,7 +222,7 @@ public class ServiceHGCW014 extends ServiceBase { ...@@ -222,7 +222,7 @@ public class ServiceHGCW014 extends ServiceBase {
Map<String, BigDecimal> rowMap = new HashMap<>(); Map<String, BigDecimal> rowMap = new HashMap<>();
for (Map m : resultRows) { for (Map m : resultRows) {
String c = m.get("settlementNumber").toString(); String c = m.get("billNumber").toString();
BigDecimal remainingAmount = new BigDecimal(m.get("thisAmount").toString()); BigDecimal remainingAmount = new BigDecimal(m.get("thisAmount").toString());
rowMap.put(c, remainingAmount); rowMap.put(c, remainingAmount);
} }
......
...@@ -137,6 +137,16 @@ ...@@ -137,6 +137,16 @@
ACCOUNT_PERIOD &lt;= #accountPeriodEnd# ACCOUNT_PERIOD &lt;= #accountPeriodEnd#
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
COMPANY_CODE ASC, ACCOUNT_YEAR desc, ACCOUNT_PERIOD desc, ID desc
</isEmpty>
</dynamic>
</sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW001"> resultClass="com.baosight.hggp.hg.cw.domain.HGCW001">
...@@ -159,14 +169,7 @@ ...@@ -159,14 +169,7 @@
DEP_CODE as "depCode" <!-- 部门编码 --> DEP_CODE as "depCode" <!-- 部门编码 -->
FROM ${hggpSchema}.HGCW001 WHERE 1=1 FROM ${hggpSchema}.HGCW001 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<dynamic prepend="ORDER BY"> <include refid="order" />
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ACCOUNT_YEAR desc, ACCOUNT_PERIOD desc, ID desc
</isEmpty>
</dynamic>
</select> </select>
...@@ -338,14 +341,14 @@ ...@@ -338,14 +341,14 @@
ACCOUNT_PERIOD_DATE_START as "accountPeriodDateStart", ACCOUNT_PERIOD_DATE_START as "accountPeriodDateStart",
ACCOUNT_PERIOD_DATE_END as "accountPeriodDateEnd" ACCOUNT_PERIOD_DATE_END as "accountPeriodDateEnd"
from ${hggpSchema}.HGCW001 from ${hggpSchema}.HGCW001
where ACCOUNT_PERIOD_STATUS = 0 where ACCOUNT_PERIOD_STATUS = #accountPeriodStatus#
AND ACCOUNT_CODE = #accountCode# AND ACCOUNT_CODE = #accountCode#
AND COMPANY_CODE = #companyCode# AND COMPANY_CODE = #companyCode#
AND ACCOUNT_PERIOD = ( AND ACCOUNT_PERIOD = (
select MAX(ACCOUNT_PERIOD) from ${hggpSchema}.HGCW001 select MAX(ACCOUNT_PERIOD) from ${hggpSchema}.HGCW001
where ACCOUNT_CODE = #accountCode# where ACCOUNT_CODE = #accountCode#
and COMPANY_CODE = #companyCode# and COMPANY_CODE = #companyCode#
and ACCOUNT_PERIOD_STATUS = 0 and ACCOUNT_PERIOD_STATUS = #accountPeriodStatus#
) )
</select> </select>
......
...@@ -558,7 +558,7 @@ ...@@ -558,7 +558,7 @@
LEFT JOIN ${hggpSchema}.HGSC001 b on a.PROJ_CODE = b.PROJ_CODE LEFT JOIN ${hggpSchema}.HGSC001 b on a.PROJ_CODE = b.PROJ_CODE
WHERE 1=1 WHERE 1=1
AND a.REVIEW_STATUS= 3 AND a.REVIEW_STATUS= 3
AND a.CONTRACT_TYPE IN (1,2) AND a.CONTRACT_TYPE IN (1,2,4)
AND b.approval_status = 2 AND b.approval_status = 2
AND b.proj_status = 0 AND b.proj_status = 0
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
......
...@@ -363,6 +363,23 @@ ...@@ -363,6 +363,23 @@
ID = #id# ID = #id#
</update> </update>
<select id="queryInvoicing" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.cw.domain.HGCW012">
SELECT
<include refid="column" />
FROM ${hggpSchema}.HGCW012 WHERE REVIEW_STATUS = '1'
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID desc
</isEmpty>
</dynamic>
</select>
<select id="queryCheckList" parameterClass="java.util.HashMap" resultClass="com.baosight.hggp.hg.cw.domain.HGCW012"> <select id="queryCheckList" parameterClass="java.util.HashMap" resultClass="com.baosight.hggp.hg.cw.domain.HGCW012">
SELECT SELECT
<include refid="column" /> <include refid="column" />
......
package com.baosight.hggp.hg.cw.tools; package com.baosight.hggp.hg.cw.tools;
import cn.hutool.core.util.StrUtil;
import com.baosight.hggp.common.AccountPeriodStatusEnum; import com.baosight.hggp.common.AccountPeriodStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cb.domain.HGCB001;
import com.baosight.hggp.hg.constant.HGSqlConstant; import com.baosight.hggp.hg.constant.HGSqlConstant;
import com.baosight.hggp.hg.cw.domain.*; import com.baosight.hggp.hg.cw.domain.*;
import com.baosight.hggp.hg.cw.vo.UserVO; import com.baosight.hggp.hg.cw.vo.UserVO;
...@@ -24,7 +24,10 @@ import java.math.BigDecimal; ...@@ -24,7 +24,10 @@ import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -45,8 +48,19 @@ public class HGCWTools { ...@@ -45,8 +48,19 @@ public class HGCWTools {
public static HGCW001 getMaxAccountPeriod(String companyCode) { public static HGCW001 getMaxAccountPeriod(String companyCode) {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("companyCode", companyCode); params.put("companyCode", companyCode);
params.put(HGCW001.FIELD_ACCOUNT_PERIOD_STATUS, AccountPeriodStatusEnum.OPEN.getCode());
List<HGCW001> list = DaoBase.getInstance().query("HGCW001.getMaxAccountPeriod", params); 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); return list.get(0);
} }
...@@ -55,7 +69,9 @@ public class HGCWTools { ...@@ -55,7 +69,9 @@ public class HGCWTools {
* @param paramMap * @param paramMap
* @return * @return
*/ */
public static HGCW001 getByCondition(Map paramMap){ public static HGCW001 getByCondition(Map<String,String> paramMap){
AssertUtils.isEmpty(paramMap.get(HGCB001.FIELD_COMPANY_CODE), "公司不能为空!");
AssertUtils.isEmpty(paramMap.get(HGCB001.FIELD_ACCOUNT_PERIOD), "会计期不能为空!");
List<HGCW001> results = DaoBase.getInstance().query(HGCW001.QUERY, paramMap); List<HGCW001> results = DaoBase.getInstance().query(HGCW001.QUERY, paramMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0); return CollectionUtils.isEmpty(results) ? null : results.get(0);
} }
...@@ -136,14 +152,12 @@ public class HGCWTools { ...@@ -136,14 +152,12 @@ public class HGCWTools {
paramMap.put(HGCW001.FIELD_ACCOUNT_PERIOD, DateUtils.formatShort(accountPeriod.substring(0, 7))); paramMap.put(HGCW001.FIELD_ACCOUNT_PERIOD, DateUtils.formatShort(accountPeriod.substring(0, 7)));
List<HGCW001> list =DaoBase.getInstance().query(HGCW001.QUERY, paramMap); List<HGCW001> list =DaoBase.getInstance().query(HGCW001.QUERY, paramMap);
if (list.size() > 0) { if (list.size() > 0) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); //SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
Date account = formatter.parse(list.get(0).getAccountPeriodDateEnd()); //Date account = formatter.parse(list.get(0).getAccountPeriodDateEnd());
String dateEnd = DateUtil.getLastDayInMonth(account,0,0,DateUtil.DATE10_PATTERN);//DateUtils.yesterdayEnd(dateStart,-1); //String dateEnd = DateUtil.getLastDayInMonth(account,0,0,DateUtil.DATE10_PATTERN);
inInfo.set(HGCW001.FIELD_ACCOUNT_PERIOD_DATE_START, dateEnd); inInfo.set(HGCW001.FIELD_ACCOUNT_PERIOD_DATE_START, DateUtils.yesterdayEnd(list.get(0).getAccountPeriodDateEnd(),1));
}else { }else {
/*获取当前最后时间*/ /*获取当前开始时间*/
//
//
inInfo.set(HGCW001.FIELD_ACCOUNT_PERIOD_DATE_START, (accountPeriodStr.substring(0,7).concat("-01"))); inInfo.set(HGCW001.FIELD_ACCOUNT_PERIOD_DATE_START, (accountPeriodStr.substring(0,7).concat("-01")));
} }
}catch (Exception e){ }catch (Exception e){
...@@ -216,6 +230,18 @@ public class HGCWTools { ...@@ -216,6 +230,18 @@ public class HGCWTools {
} }
} }
/**
* 检查数据是否重复
* @param hgcw001
*/
public static void checkSaveData(HGCW001 hgcw001){
Map<String,String> paramMap = new HashMap<>();
paramMap.put(HGCW001.FIELD_COMPANY_CODE,hgcw001.getCompanyCode());
paramMap.put(HGCW001.FIELD_ACCOUNT_PERIOD,hgcw001.getAccountPeriod());
HGCW001 cw001 = getByCondition(paramMap); //重复校验
AssertUtils.isNotNull(cw001, String.format("[%s]会计期[%s]已存在,无法重复添加,保存失败!",hgcw001.getCompanyName(),hgcw001.getAccountPeriod()));
}
public static List<HGCW001> queryNoAuth(Map paramMap){ public static List<HGCW001> queryNoAuth(Map paramMap){
List<HGCW001> list = DaoBase.getInstance().query(HGCW001.QUERY_NO_AUTH, paramMap); List<HGCW001> list = DaoBase.getInstance().query(HGCW001.QUERY_NO_AUTH, paramMap);
return list; return list;
...@@ -570,13 +596,38 @@ public class HGCWTools { ...@@ -570,13 +596,38 @@ public class HGCWTools {
DaoUtils.update("HGCW010.update", hgcw010); DaoUtils.update("HGCW010.update", hgcw010);
} }
} }
public static void cutAmount(String settlementNumber, BigDecimal cutAmount) { public static void cutAmount(String billNumber, BigDecimal cutAmount) {
AssertUtils.isNull(billNumber, "来源单号不能为空!");
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// throw new PlatException("扣款金额不能小于等于0!");
// }
List<HGCW010> results = DaoBase.getInstance().query(HGCW010.QUERY,new HashMap<String,Object>(){
{put("billNumber",billNumber);}
});
if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的销售开票记录!");
}
DecimalFormat decimalFormat = new DecimalFormat("#.000");
HGCW010 HGCW010 = results.get(0);
BigDecimal remainingAmount = new BigDecimal(decimalFormat.format(HGCW010.getRemainingAmount().subtract(cutAmount)));
if (remainingAmount.compareTo(new BigDecimal(BigInteger.ZERO)) < 0) {
throw new PlatException("扣款金额不能大于销售开票剩余金额!");
}
HGCW010.setRemainingAmount(remainingAmount);
DaoUtils.update("HGCW010.updateDeductionAmount", HGCW010);
}
public static void cutAmount(String settlementNumber, String billNumber, BigDecimal cutAmount) {
AssertUtils.isNull(settlementNumber, "来源单号不能为空!"); AssertUtils.isNull(settlementNumber, "来源单号不能为空!");
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) { // if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// throw new PlatException("扣款金额不能小于等于0!"); // throw new PlatException("扣款金额不能小于等于0!");
// } // }
List<HGCW010> results = DaoBase.getInstance().query(HGCW010.QUERY,new HashMap<String,Object>(){ List<HGCW010> results = DaoBase.getInstance().query(HGCW010.QUERY,new HashMap<String,Object>(){
{put("settlementNumber",settlementNumber);} {
put("billNumber",settlementNumber);
put("billNumber",billNumber);
}
}); });
if (CollectionUtils.isEmpty(results)) { if (CollectionUtils.isEmpty(results)) {
throw new PlatException("找不到对应的销售开票记录!"); throw new PlatException("找不到对应的销售开票记录!");
...@@ -856,7 +907,7 @@ public class HGCWTools { ...@@ -856,7 +907,7 @@ public class HGCWTools {
rows.forEach(row -> { rows.forEach(row -> {
HGCW015 hgcw015 = new HGCW015(); HGCW015 hgcw015 = new HGCW015();
hgcw015.fromMap(row); hgcw015.fromMap(row);
String contractNumber = row.get("settlementNumber").toString(); String contractNumber = row.get("billNumber").toString();
String remainingAmount = row.get("thisAmount").toString(); String remainingAmount = row.get("thisAmount").toString();
hgcw015.setContractNumber(contractNumber); hgcw015.setContractNumber(contractNumber);
hgcw015.setTotalContractPriceIncluding(new BigDecimal(remainingAmount)); hgcw015.setTotalContractPriceIncluding(new BigDecimal(remainingAmount));
......
...@@ -322,7 +322,7 @@ ...@@ -322,7 +322,7 @@
</select> </select>
<select id="queryList" parameterClass="java.util.HashMap" <select id="queryList" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.kc.domain.HGKC007A"> resultClass="com.baosight.hggp.hg.kc.domain.HGKC007B">
SELECT SELECT
A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 --> A.ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
A.DEP_CODE as "depCode", <!-- 部门编码 --> A.DEP_CODE as "depCode", <!-- 部门编码 -->
......
...@@ -401,6 +401,30 @@ public class ServiceHGPZ005 extends ServiceBase { ...@@ -401,6 +401,30 @@ public class ServiceHGPZ005 extends ServiceBase {
return inInfo; return inInfo;
} }
@OperationLogAnnotation(operModul = "存货档案", operType = "修改", operDesc = "批量绑定流程")
public EiInfo updateFlowIds(EiInfo inInfo) {
try {
//List<Map> resultRows = inInfo.getBlock(EiConstant.queryBlock).getRows();
Map map = EiInfoUtils.getFirstRow(inInfo);
String[] ids = map.get("ids").toString().split(",");
List<HGPZ005> hgpz005List = HGPZTools.HgPz005.getIdStrs(Arrays.asList(ids));
Map flowMap = (Map) map.get("flow");
HGSJ002 hgsj002 = new HGSJ002();
hgsj002.fromMap(flowMap);
for (HGPZ005 hgpz005 : hgpz005List) {
hgpz005.setFlowId(hgsj002.getId());
DaoUtils.update(HGPZ005.UPDATE_FLOW_ID, hgpz005);
addHgpz005a(hgpz005,hgsj002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + hgpz005List.size() + "]条数据修改成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
/** /**
* 添加流程详情 * 添加流程详情
* @param hppz005 * @param hppz005
......
...@@ -61,6 +61,9 @@ ...@@ -61,6 +61,9 @@
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
PROCESS_CLASS = #processClass#, <!-- 工序类别 --> PROCESS_CLASS = #processClass#, <!-- 工序类别 -->
PARENT_ID = #parentId#, <!-- 上级ID --> PARENT_ID = #parentId#, <!-- 上级ID -->
PROCESS_ORDER = #processOrder#, PROCESS_ORDER = #processOrder#,
COMPUTE_TYPE = #computeType# COST_WEIGHT = #costWeight#
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
......
...@@ -259,6 +259,15 @@ public class HGPZTools { ...@@ -259,6 +259,15 @@ public class HGPZTools {
return DaoBase.getInstance().query(HGPZ005.QUERY, queryMap); return DaoBase.getInstance().query(HGPZ005.QUERY, queryMap);
} }
public static List<HGPZ005> getIdStrs(List<String> ids) {
if (CollectionUtils.isEmpty(ids)) {
return null;
}
Map queryMap = new HashMap();
queryMap.put("ids", ids);
return DaoBase.getInstance().query(HGPZ005.QUERY, queryMap);
}
/** /**
* 查询 * 查询
* *
......
...@@ -45,7 +45,7 @@ public class ServiceHGSB001 extends ServiceEPBase { ...@@ -45,7 +45,7 @@ public class ServiceHGSB001 extends ServiceEPBase {
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID)); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
//角色公司 //角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode(); List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,roleCompanyCode); qarma.put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
}catch (Exception e){ }catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败!"); LogUtils.setDetailMsg(inInfo,e,"初始化失败!");
......
...@@ -44,7 +44,7 @@ public class ServiceHGSB002 extends ServiceEPBase { ...@@ -44,7 +44,7 @@ public class ServiceHGSB002 extends ServiceEPBase {
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID)); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
//角色公司 //角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode(); List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,roleCompanyCode); qarma.put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
}catch (Exception e){ }catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败"); LogUtils.setDetailMsg(inInfo,e,"初始化失败");
......
...@@ -36,12 +36,12 @@ public class ServiceHGSB002A extends ServiceEPBase { ...@@ -36,12 +36,12 @@ public class ServiceHGSB002A extends ServiceEPBase {
String companyCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB001.FIELD_COMPANY_CODE); String companyCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB001.FIELD_COMPANY_CODE);
String groupCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB002A.FIELD_GROUP_CODE); String groupCode = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0,HGSB002A.FIELD_GROUP_CODE);
inInfo = super.query(inInfo, HGSB002A.QUERY, new HGSB002A()); inInfo = super.query(inInfo, HGSB002A.QUERY, new HGSB002A());
Map qarma = new HashMap(); /*Map qarma = new HashMap();
Map userCompany = HGSBTools.getUserCompany(); Map userCompany = HGSBTools.getUserCompany();
if (!userCompany.isEmpty()) { if (!userCompany.isEmpty()) {
qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE)); qarma.put(Org.FIELD_PARENT_ORG_ID,userCompany.get(HGSB002.FIELD_COMPANY_CODE));
} }*/
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID),qarma); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
//CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null); //CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_CODE_BOX_BLOCK_ID),null);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID), CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID),
new HashMap<String,Object>(){{ new HashMap<String,Object>(){{
......
...@@ -45,7 +45,7 @@ public class ServiceHGSB003 extends ServiceEPBase { ...@@ -45,7 +45,7 @@ public class ServiceHGSB003 extends ServiceEPBase {
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
//角色公司 //角色公司
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode(); List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,roleCompanyCode); qarma.put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID)); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.DEVICE_CODE_BOX_BLOCK_ID));
......
...@@ -43,7 +43,7 @@ public class ServiceHGSB004 extends ServiceEPBase { ...@@ -43,7 +43,7 @@ public class ServiceHGSB004 extends ServiceEPBase {
Map<String,Object> qarma = new HashMap<>(); Map<String,Object> qarma = new HashMap<>();
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode(); List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,roleCompanyCode); qarma.put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
}catch (Exception e){ }catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败"); LogUtils.setDetailMsg(inInfo,e,"初始化失败");
......
...@@ -41,8 +41,8 @@ public class ServiceHGSB004B extends ServiceEPBase { ...@@ -41,8 +41,8 @@ public class ServiceHGSB004B extends ServiceEPBase {
Map<String,Object> qarma = new HashMap<>(); Map<String,Object> qarma = new HashMap<>();
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID)); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(inInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
List<String> orgIds = HGSBTools.getRoleCompanyCode(); List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,orgIds); qarma.put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma); CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
}catch (Exception e){ }catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败"); LogUtils.setDetailMsg(inInfo,e,"初始化失败");
......
...@@ -44,8 +44,8 @@ public class ServiceHGSB005 extends ServiceEPBase { ...@@ -44,8 +44,8 @@ public class ServiceHGSB005 extends ServiceEPBase {
EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class); EiInfoUtils.addBlock(outInfo,"roleCompany", UserSessionUtils.getRoleCompany(), Company.class);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID)); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID));
//角色公司 //角色公司
List<String> orgIds = HGSBTools.getRoleCompanyCode(); List<String> roleCompanyCode = HGSBTools.getRoleCompanyCode();
qarma.put(Org.FIELD_ORG_ID,orgIds); qarma.put(HGSB001.FIELD_COMPANY_CODES,roleCompanyCode);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma); CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.USER_ID_BOX_BLOCK_ID),qarma);
}catch (Exception e){ }catch (Exception e){
LogUtils.setDetailMsg(inInfo,e,"初始化失败"); LogUtils.setDetailMsg(inInfo,e,"初始化失败");
......
package com.baosight.hggp.hg.xs.service; package com.baosight.hggp.hg.xs.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.xs.domain.User; import com.baosight.hggp.hg.xs.domain.User;
...@@ -64,6 +65,32 @@ public class ServiceHGXSUser extends ServiceBase { ...@@ -64,6 +65,32 @@ public class ServiceHGXSUser extends ServiceBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "用户管理",operType = "查询",operDesc = "用户所属公司所有用户")
public EiInfo queryOrgUserBox(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
queryMap.put("accountCode", UserSessionUtils.getAccountCode());
Object isSplicingSymbol = queryMap.get("isSplicingSymbol");
List<DdynamicEnum> list = new ArrayList<>();
list.add(DdynamicEnum.USER_ID_BOX_BLOCK_ID);
if (isSplicingSymbol != null){
CommonMethod.initBlock(inInfo, list, queryMap, true);
}else {
CommonMethod.initBlock(inInfo, list, queryMap, false);
}
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询企业失败");
}
return inInfo;
}
/**
* 查询用户下拉框
*
* @param inInfo
* @return
*/
public EiInfo queryComboBox(EiInfo inInfo) { public EiInfo queryComboBox(EiInfo inInfo) {
try { try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo); Map queryMap = EiInfoUtils.getFirstRow(inInfo);
...@@ -76,7 +103,7 @@ public class ServiceHGXSUser extends ServiceBase { ...@@ -76,7 +103,7 @@ public class ServiceHGXSUser extends ServiceBase {
} }
return inInfo; return inInfo;
} }
/** /**
* 查询用户的企业下拉框 * 查询用户的企业下拉框
* *
......
...@@ -91,7 +91,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils { ...@@ -91,7 +91,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
* @return * @return
*/ */
public static String yesterdayEnd(String date,Integer day) { public static String yesterdayEnd(String date,Integer day) {
return LocalDate.parse(date).minusDays(day).format(DATE); return LocalDate.parse(date, SHORT_DATE).plusDays(day).format(DATE);
} }
/** /**
* 获取日期字符串(yyyy-MM-dd) * 获取日期字符串(yyyy-MM-dd)
......
...@@ -137,6 +137,7 @@ ...@@ -137,6 +137,7 @@
t1.ORG_ID AS "orgId", t1.ORG_ID AS "orgId",
t1.ORG_ENAME AS "orgEname", t1.ORG_ENAME AS "orgEname",
t1.ORG_CNAME AS "orgCname", t1.ORG_CNAME AS "orgCname",
t1.COMPANY_CODE AS "companyCode",
t2.rec_create_time AS "recCreateTime", t2.rec_create_time AS "recCreateTime",
t2.USER_ID AS userId FROM ${platSchema}.txsog01 t1 LEFT JOIN ${platSchema}.txsog02 t2 ON t1.ORG_ID = t2.ORG_ID t2.USER_ID AS userId FROM ${platSchema}.txsog01 t1 LEFT JOIN ${platSchema}.txsog02 t2 ON t1.ORG_ID = t2.ORG_ID
INNER JOIN ${platSchema}.xs_user xu ON t2.USER_ID = xu.USER_ID INNER JOIN ${platSchema}.xs_user xu ON t2.USER_ID = xu.USER_ID
...@@ -145,6 +146,12 @@ ...@@ -145,6 +146,12 @@
<isNotEmpty prepend="AND" property="accountCode"> <isNotEmpty prepend="AND" property="accountCode">
t1.ACCOUNT_CODE = #accountCode# t1.ACCOUNT_CODE = #accountCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend="AND" property="companyCode">
t1.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend="AND" property="companyCodes">
t1.COMPANY_CODE IN <iterate property="companyCodes" open="(" close=")" conjunction=","> #companyCodes[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend="AND" property="orgCname"> <isNotEmpty prepend="AND" property="orgCname">
t1.ORG_CNAME LIKE ('%$orgCname$%') t1.ORG_CNAME LIKE ('%$orgCname$%')
</isNotEmpty> </isNotEmpty>
......
$(function() { $(function() {
var globalCompanyList = __eiInfo.getBlock("roleCompany").getMappedRows();
// 查询 // 查询
$("#QUERY").on("click", function () { $("#QUERY").on("click", function () {
...@@ -14,8 +15,21 @@ $(function() { ...@@ -14,8 +15,21 @@ $(function() {
pageSize: 20, pageSize: 20,
pageSizes: [10,20,30,50,100,200], pageSizes: [10,20,30,50,100,200],
}, },
columns: [ columns: [{
], field: "companyCode",
template: function (item) {
let template = "";
if (item.companyCode) {
for (let i = 0; i < globalCompanyList.length; i++) {
if (item.companyCode === globalCompanyList[i]['companyCode']) {
item['companyName'] = globalCompanyList[i]['companyName'];
template = globalCompanyList[i]['companyName'];
}
}
}
return template;
}
}],
onSave: function (e) { onSave: function (e) {
// 阻止默认请求,使用自定义保存 // 阻止默认请求,使用自定义保存
e.preventDefault(); e.preventDefault();
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head> <head>
</head> </head>
<EF:EFPage title="会计期维护"> <EF:EFPage title="会计期维护">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3" filter="contains"> <EF:EFSelect cname="公司名称" blockId="inqu_status" ename="companyCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFDatePicker cname="会计期" blockId="inqu_status" ename="accountPeriod" row="0" colWidth="3" <EF:EFDatePicker cname="会计期" blockId="inqu_status" ename="accountPeriod" row="0" colWidth="3"
format="yyyy-MM" parseFormats="['yyyyMM']" start="year" depth="year"/> format="yyyy-MM" parseFormats="['yyyyMM']" start="year" depth="year"/>
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false"> <EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<%-- <EF:EFColumn ename="companyName" cname="公司名称" hidden="false"/>--%>
<EF:EFComboColumn ename="companyCode" cname="公司名称" width="110" align="center" <EF:EFComboColumn ename="companyCode" cname="公司名称" width="110" align="center"
filter="contains" readonly="true"> filter="contains" readonly="true">
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/> <EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
...@@ -46,5 +47,4 @@ ...@@ -46,5 +47,4 @@
<script> <script>
var ctx = "${ctx}"; var ctx = "${ctx}";
</script> </script>
<script src="${ctx}/HG/CW/HGCB001.js"></script> \ No newline at end of file
\ No newline at end of file
...@@ -3,33 +3,43 @@ $(function() { ...@@ -3,33 +3,43 @@ $(function() {
let companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows(); let companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".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 () { $("#CONFIRM").on("click", function () {
let companyCode = $("#inqu_status-0-companyCode").val(); let companyCode = $("#inqu_status-0-companyCode").val();
let companyName = $("#inqu_status-0-companyName").val();
if (companyCode.length < 1) { if (companyCode.length < 1) {
message("请选择公司"); message("请选择公司");
return; return;
} }
let hgcw001 = queryHgcw001(companyCode); let flag = true;
let companyName; let hgcw001 = queryHgcw001(companyCode,companyName);
let accountPeriod = hgcw001[0].accountPeriod; if (hgcw001.length <= 0 ){
for (let i = 0; i <companyCodeBox.length ; i++) { flag = false;
if (companyCodeBox[i].companyCode == hgcw001[0].companyCode) { return false;
companyName = companyCodeBox[i].companyName;
break;
}
} }
JSUtils.confirm("确定要对[" + companyName + " 会计期"+accountPeriod+"]做\"数据同步\"操作? ", { if (flag){
ok: function () { let accountPeriod = hgcw001[0].accountPeriod;
parent.JSColorbox.setValueCallback(hgcw001[0]); JSUtils.confirm("确定要对[" + companyName + " 会计期"+accountPeriod+"]做\"数据同步\"操作? ", {
} ok: function () {
}); parent.JSColorbox.setValueCallback(hgcw001[0]);
}
});
}
}); });
}); });
let queryHgcw001 = function (companyCode){ let queryHgcw001 = function (companyCode,companyName){
var hgcw001_block_id =[]; var hgcw001_block_id =[];
let info = new EiInfo(); let info = new EiInfo();
info.set("inqu_status-0-companyCode", companyCode); info.set("inqu_status-0-companyCode", companyCode);
info.set("inqu_status-0-companyName", companyName);
EiCommunicator.send("HGCB002", "selectAll", info, { EiCommunicator.send("HGCB002", "selectAll", info, {
onSuccess: function (ei) { onSuccess: function (ei) {
if (ei.getStatus() >= 0) { if (ei.getStatus() >= 0) {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<EF:EFOption label="-- 请选择 --" value="" /> <EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/> <EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="companyName" cname="公司名称" colWidth="3" type="hidden" />
</div> </div>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="业务类型" colWidth="3" filter="contains"> <EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="业务类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.common.yesNo"/> <EF:EFCodeOption codeName="hggp.hgcb.bizType"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="accountPeriod" cname="会计期" colWidth="3" <EF:EFDatePicker blockId="inqu_status" row="0" ename="accountPeriod" cname="会计期" colWidth="3"
format="yyyy-MM" depth="year" start="year" required="true"/> format="yyyy-MM" depth="year" start="year" required="true"/>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<EF:EFColumn ename="accountPeriod" cname="会计期" enable="false" width="120" align="center" <EF:EFColumn ename="accountPeriod" cname="会计期" enable="false" width="120" align="center"
editType="date" dateFormat="yyyy-MM" parseFormats="['yyyyMM']"/> editType="date" dateFormat="yyyy-MM" parseFormats="['yyyyMM']"/>
<EF:EFComboColumn ename="bizType" cname="业务类型" width="120" enable="false" align="center" required="true"> <EF:EFComboColumn ename="bizType" cname="业务类型" width="120" enable="false" align="center" required="true">
<EF:EFCodeOption codeName="hggp.hgsj.computeType"/> <EF:EFCodeOption codeName="hggp.hgcb.bizType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="receiptDate" cname="单据日期" width="120" align="center" editType="date" enable="false" <EF:EFColumn ename="receiptDate" cname="单据日期" width="120" align="center" editType="date" enable="false"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="false" required="true"/>
......
$(function (){
var companyCodeBox = __eiInfo.getBlock("company_code_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", function (e) {
query();
})
$("#SYNC").on("click", function () {
showDetail();
});
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "accountPeriod",
title: "会计期",
template: function (item) {
return item.accountYear + "-" + item.accountMonth;
}
}
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "产副品制造成本核算_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "unitCost") {
let items = e.items[0];
for (let i = 0; i < items.length; i++) {
let totalCost = items[i].unitCost * items[i].totalWeight;
resultGrid.setCellValue(e.items[i],"totalCost",totalCost);
}
}
if (e.field === "totalCost") {
let items = e.items[0];
for (let i = 0; i < items.length; i++) {
let unitCost = items[i].totalCost / items[i].totalWeight;
resultGrid.setCellValue(e.items[i],"unitCost",unitCost);
}
}
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let unitCost = item.get("unitCost");
let totalCost= item.get("totalCost");
if(isBlank(unitCost)){
message("选中的第"+(index+1)+"行\"单位成本\",不能为空!");
flag = false;
return false;
}
if(isBlank(totalCost)){
message("选中的第"+(index+1)+"行\"总成本\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGCB005", "save", true);
btnNode.attr("disabled", false);
}
});
}
};
/**
* 显示详情
*/
function showDetail() {
JSColorbox.open({
href: "HGCB002A?methodName=initLoad",
title: "<div style='text-align: center;'>选择公司</div>",
width: "60%",
height: "60%",
callbackName: windowCallback
});
}
function windowCallback(item) {
synchData(item);
// 关闭弹窗
JSColorbox.close();
}
/**
* 确认
*/
let synchData = function (item) {
let info = new EiInfo();
info.set("inqu_status-0-companyCode", item.companyCode);
info.set("inqu_status-0-accountYear", item.accountYear);
info.set("inqu_status-0-accountPeriod", item.accountPeriod);
info.set("inqu_status-0-createdTimeFrom", item.accountPeriodDateStart);
info.set("inqu_status-0-createdTimeTo", item.accountPeriodDateEnd);
EiCommunicator.send("HGCB005", "synchData", info, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
// 刷新列表
query();
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
\ No newline at end of file
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<EF:EFPage title="产副品制造成本核算">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="company_code_block_id" textField="companyName" valueField="companyCode"/>
</EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="accountYear" cname="会计期(年)" colWidth="3"
format="yyyy" depth="decade" start="decade"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="accountMonth" cname="会计期(月)" colWidth="3" filter="contains">
<EF:EFOption label="" value=""/>
<EF:EFCodeOption codeName="hggp.month" />
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="accountYear" cname="会计期(年)" hidden="true"/>
<EF:EFColumn ename="accountMonth" cname="会计期(月)" hidden="true"/>
<EF:EFColumn ename="returnQuantity" cname="退回数量" hidden="true"/>
<EF:EFColumn ename="accountCode" cname="企业编码" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="200" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="company_code_block_id" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn>
<EF:EFColumn ename="accountPeriod" cname="会计期" enable="false" width="120" align="center"
editType="date" dateFormat="yyyy-MM" parseFormats="['yyyyMM']"/>
<EF:EFColumn ename="projCode" cname="项目编码" enable="true" width="120" align="center" readonly="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="120" enable="true" align="center" readonly="true"/>
<EF:EFColumn ename="inventCode" cname="存货编码" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="inventName" cname="存货名称" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="processCode" cname="工序编码" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="processName" cname="工序名称" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="spec" cname="规格" width="120" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="quantity" cname="数量" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="singleWeight" cname="单重(kg)" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="totalWeight" cname="总重(kg)" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="unitCost" cname="单位成本" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
<EF:EFColumn ename="totalCost" cname="总成本" width="120" enable="false" format="{0:N3}" editType="text"
displayType="0.000" sort="true" align="right" maxLength="17" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () { $(function () {
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
let companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
"result":{ "result":{
pageable: { pageable: {
...@@ -62,29 +62,35 @@ $(function () { ...@@ -62,29 +62,35 @@ $(function () {
}, },
loadComplete: function (grid) { loadComplete: function (grid) {
$("#SWITCH").on("click", function () { $("#SWITCH").on("click", function () {
switchRow(); let btnNode = $(this);
btnNode.attr("disabled", true);
switchRow(btnNode);
}); });
grid.dataSource.bind("change",function(e){ grid.dataSource.bind("change",function(e){
var item = e.items[0]; var item = e.items[0];
/* if(e.field == "accountYear"){ if(e.field == "companyCode"){
let accountPeriod = currMonth(item.accountYear); for (let i = 0; i < companyCodeBox.length; i++) {
resultGrid.setCellValue(item,'accountPeriod',accountPeriod) if (item.companyCode == companyCodeBox[i].companyCode){
//loadChange(grid,e,"accountPeriod"); resultGrid.setCellValue(item,'companyName',companyCodeBox[i].companyName);
}else */ break;
if(e.field == "accountPeriod"){ }
}
}else if(e.field == "accountPeriod"){
let accountPeriod = dateFormate(item.accountPeriod,"yyyy-MM-dd") let accountPeriod = dateFormate(item.accountPeriod,"yyyy-MM-dd")
let accountPeriodDateStart = queryLast(item.companyCode,accountPeriod); let accountPeriodDateStart = queryLast(item.companyCode,accountPeriod);
resultGrid.setCellValue(item,'accountYear',accountPeriod.substring(0,4)); resultGrid.setCellValue(item,'accountYear',accountPeriod.substring(0,4));
resultGrid.setCellValue(item,'accountPeriodDateStart',dateFormate(new Date(accountPeriodDateStart),"yyyyMMdd")); resultGrid.setCellValue(item,'accountPeriodDateStart',dateFormate(new Date(accountPeriodDateStart),"yyyyMMdd"));
loadChange(grid,e,"accountPeriodDateEnd"); loadChange(grid,e,"accountPeriodDateEnd");
} }
}) })
}, },
onSave: function (e) { onSave: function (e) {
// 阻止默认请求,使用自定义保存 // 阻止默认请求,使用自定义保存
e.preventDefault(); e.preventDefault();
saveFunc(); let btnNode = $(this);
btnNode.attr("disabled", true);
saveFunc(btnNode);
}, },
onDelete: function (e) { onDelete: function (e) {
// 阻止默认请求,使用自定义删除 // 阻止默认请求,使用自定义删除
...@@ -124,7 +130,7 @@ var query = function () { ...@@ -124,7 +130,7 @@ var query = function () {
/** /**
* 保存 * 保存
*/ */
function saveFunc() { function saveFunc(btnNode) {
let rows = resultGrid.getCheckedRows(); let rows = resultGrid.getCheckedRows();
if (rows.length < 1) { if (rows.length < 1) {
message("请选择数据"); message("请选择数据");
...@@ -178,28 +184,27 @@ function saveFunc() { ...@@ -178,28 +184,27 @@ function saveFunc() {
info.addBlock(JSUtils.checkedRows2Block("result")); info.addBlock(JSUtils.checkedRows2Block("result"));
EiCommunicator.send("HGCW001", "save", info, { EiCommunicator.send("HGCW001", "save", info, {
onSuccess: function (ei) { onSuccess: function (ei) {
btnNode.attr("disabled", false);
if (ei.getStatus() >= 0) { if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) { if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning'); NotificationUtil(ei, 'warning');
} else { } else {
NotificationUtil(ei); NotificationUtil(ei);
} }
query();
} else { } else {
NotificationUtil(ei, "error"); NotificationUtil(ei, "error");
} }
}, },
onFail: function (ei) { onFail: function (ei) {
btnNode.attr("disabled", false);
// 发生异常 // 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error"); NotificationUtil("操作失败,原因[" + ei + "]", "error");
} }
}); });
//JSUtils.submitGridsData("result", "HPSC001", "save", true); //JSUtils.submitGridsData("result", "HPSC001", "save", true);
},cancel: function () {
btnNode.attr("disabled", false);
} }
}); });
} }
...@@ -232,7 +237,7 @@ function deleteFunc() { ...@@ -232,7 +237,7 @@ function deleteFunc() {
} }
} }
function switchRow() { function switchRow(btnNode) {
let rows = resultGrid.getCheckedRows(); let rows = resultGrid.getCheckedRows();
if (rows.length != 1) { if (rows.length != 1) {
message("请选择一条数据"); message("请选择一条数据");
...@@ -259,14 +264,18 @@ function switchRow() { ...@@ -259,14 +264,18 @@ function switchRow() {
} else { } else {
NotificationUtil(ei, "error"); NotificationUtil(ei, "error");
} }
btnNode.attr("disabled", false);
}, },
onFail: function (ei) { onFail: function (ei) {
// 发生异常 // 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error"); NotificationUtil("操作失败,原因[" + ei + "]", "error");
btnNode.attr("disabled", false);
} }
}); },);
//JSUtils.submitGridsData("result", "HPSC001", "save", true); //JSUtils.submitGridsData("result", "HPSC001", "save", true);
},cancel: function () {
btnNode.attr("disabled", false);
} }
}); });
} }
......
...@@ -24,12 +24,13 @@ ...@@ -24,12 +24,13 @@
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="记录集"> <EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false"> <EF:EFGrid blockId="result" autoDraw="no" isFloat="true" autoBind="false" checkMode="single">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称" width="110" align="center" <EF:EFComboColumn ename="companyCode" cname="公司名称" width="110" align="center"
filter="contains" readonly="true"> filter="contains" readonly="true">
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/> <EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="公司名称" hidden="true"/>
<EF:EFColumn ename="accountYear" cname="会计年度" enable="false" width="100" align="center" start="decade" depth="decade" <EF:EFColumn ename="accountYear" cname="会计年度" enable="false" width="100" align="center" start="decade" depth="decade"
editType="date" dateFormat="yyyy" parseFormats="['yyyy']" required="true"/> editType="date" dateFormat="yyyy" parseFormats="['yyyy']" required="true"/>
<EF:EFColumn ename="accountPeriod" cname="会计期" readonly="true" width="100" align="center" start="year" depth="year" <EF:EFColumn ename="accountPeriod" cname="会计期" readonly="true" width="100" align="center" start="year" depth="year"
...@@ -38,7 +39,7 @@ ...@@ -38,7 +39,7 @@
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="1"> columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" defaultValue="1">
<EF:EFCodeOption codeName="hggp.cw.accountPeriodStatus"/> <EF:EFCodeOption codeName="hggp.cw.accountPeriodStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="accountPeriodDateStart" cname="账期开始日期" enable="false" width="100" align="center" <EF:EFColumn ename="accountPeriodDateStart" cname="账期开始日期" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="accountPeriodDateEnd" cname="账期结束日期" width="100" align="center" <EF:EFColumn ename="accountPeriodDateEnd" cname="账期结束日期" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
......
...@@ -5,6 +5,10 @@ $(function() { ...@@ -5,6 +5,10 @@ $(function() {
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
$("#BATCH_FLOW").on("click", function () {
showFlowDetail();
});
IPLATUI.EFGrid.result = { IPLATUI.EFGrid.result = {
pageable: { pageable: {
pageSize: 20, pageSize: 20,
...@@ -257,6 +261,7 @@ function showDetail(id) { ...@@ -257,6 +261,7 @@ function showDetail(id) {
}); });
} }
function showFlowDetail(id,inventCode,flowId) { function showFlowDetail(id,inventCode,flowId) {
JSColorbox.open({ JSColorbox.open({
href: "HGPZ005B?methodName=initLoad&inqu_status-0-parentId=" + id+"&inqu_status-0-inventCode="+inventCode+"&inqu_status-0-flowId="+flowId, href: "HGPZ005B?methodName=initLoad&inqu_status-0-parentId=" + id+"&inqu_status-0-inventCode="+inventCode+"&inqu_status-0-flowId="+flowId,
...@@ -267,6 +272,26 @@ function showFlowDetail(id,inventCode,flowId) { ...@@ -267,6 +272,26 @@ function showFlowDetail(id,inventCode,flowId) {
}); });
} }
function showFlowDetail() {
let rows = resultGrid.getCheckedRows();
let selectIds = [];
//selectIds.push(rows[i]['id']);
if (rows.length < 1) {
message("请选择数据")
return;
}
$.each(rows, function(index, item) {
selectIds.push(item.get("id"));
});
JSColorbox.open({
href: "HGPZ005B?methodName=initLoad&inqu_status-0-parentIds=" + selectIds,
title: "<div style='text-align: center;'>工艺流程</div>",
width: "75%",
height: "80%",
callbackName: cllback2
});
}
/** /**
* 回调 * 回调
*/ */
...@@ -291,3 +316,28 @@ function cllback(result) { ...@@ -291,3 +316,28 @@ function cllback(result) {
async: false async: false
}); });
} }
/**
* 回调
*/
function cllback2(result) {
let inEiInfo = new EiInfo();
inEiInfo.set("inqu_status-0-ids", result.ids);
inEiInfo.set("inqu_status-0-flow", result.rows);
EiCommunicator.send('HGPZ005', 'updateFlowIds', inEiInfo, {
onSuccess(ei) {
if (ei.status == "-1") {
NotificationUtil({msg: ei.msg, detailMsg: ei.detailMsg}, "error");
} else {
NotificationUtil(ei.msg);
query();
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
\ No newline at end of file
...@@ -30,28 +30,29 @@ $(function (){ ...@@ -30,28 +30,29 @@ $(function (){
} }
} }
return dataItem['processCode']; return dataItem['processCode'];
},
},{
field: "processClass",
template: function (dataItem) {
for (let i = 0; i < itemCodeBox.length; i++) {
if (itemCodeBox[i]['valueField'] === dataItem['processClass']) {
return itemCodeBox[i]['textField'];
}
}
return "";
},
editor: function (container, options) {
let eiInfo = new EiInfo();
eiInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
eiInfo.set("inqu_status-0-processCode", options.model["processCode"]);
eiInfo.set("serviceName", "HGPZ005A");
eiInfo.set("methodName", "queryEdcm01");
eiInfo.set("blockId", "item_code_box_block_id");
eiInfo.set("field", options.field);
refreshSelect(container,eiInfo);
} }
} }
// ,{
// field: "processClass",
// template: function (dataItem) {
// for (let i = 0; i < itemCodeBox.length; i++) {
// if (itemCodeBox[i]['valueField'] === dataItem['processClass']) {
// return itemCodeBox[i]['textField'];
// }
// }
// return "";
// },
// editor: function (container, options) {
// let eiInfo = new EiInfo();
// eiInfo.set("inqu_status-0-companyCode", options.model["companyCode"]);
// eiInfo.set("inqu_status-0-processCode", options.model["processCode"]);
// eiInfo.set("serviceName", "HGPZ005A");
// eiInfo.set("methodName", "queryEdcm01");
// eiInfo.set("blockId", "item_code_box_block_id");
// eiInfo.set("field", options.field);
// refreshSelect(container,eiInfo);
// }
// }
], ],
loadComplete: function(grid) {}, loadComplete: function(grid) {},
afterEdit:function (e) {}, afterEdit:function (e) {},
...@@ -105,8 +106,8 @@ let save = function (btnNode) { ...@@ -105,8 +106,8 @@ let save = function (btnNode) {
$.each(rows, function(index, item) { $.each(rows, function(index, item) {
let processCode= item.get("processCode"); let processCode= item.get("processCode");
let composingCoeff= item.get("composingCoeff"); let composingCoeff= item.get("composingCoeff");
let unitCoeff= item.get("unitCoeff"); // let unitCoeff= item.get("unitCoeff");
let processClass= item.get("processClass"); // let processClass= item.get("processClass");
if(isBlank(processCode)){ if(isBlank(processCode)){
message("选中的第"+(index+1)+"行\"工序名称\",不能为空!"); message("选中的第"+(index+1)+"行\"工序名称\",不能为空!");
flag = false; flag = false;
...@@ -117,16 +118,16 @@ let save = function (btnNode) { ...@@ -117,16 +118,16 @@ let save = function (btnNode) {
flag = false; flag = false;
return false; return false;
} }
if(isBlank(unitCoeff)){ /*if(isBlank(unitCoeff)){
message("选中的第"+(index+1)+"行\"单价系数\",不能为空!"); message("选中的第"+(index+1)+"行\"单价系数\",不能为空!");
flag = false; flag = false;
return false; return false;
} }*/
if(isBlank(processClass)){ /*if(isBlank(processClass)){
message("选中的第"+(index+1)+"行\"工序类别\",不能为空!"); message("选中的第"+(index+1)+"行\"工序类别\",不能为空!");
flag = false; flag = false;
return false; return false;
} }*/
}); });
if(flag) { if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
......
...@@ -50,11 +50,11 @@ ...@@ -50,11 +50,11 @@
displayType="0" sort="true" align="right" displayType="0" sort="true" align="right"
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true" data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/> data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="unitCoeff" cname="单价系数" width="120" enable="true" format="{0:N3}" editType="text" hidden="true" <%-- <EF:EFColumn ename="unitCoeff" cname="单价系数" width="120" enable="true" format="{0:N3}" editType="text" hidden="true"--%>
displayType="0.000" sort="true" align="right" <%-- displayType="0.000" sort="true" align="right"--%>
data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true" <%-- data-regex="/^-?[0-9]{1,15}([.][0-9]{1,3})?$/" maxLength="15" required="true"--%>
data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/> <%-- data-errorprompt="请输入数字,该值最大可设置15位整数和3位小数!"/>--%>
<EF:EFColumn ename="processClass" cname="工序分类" width="120" enable="true" align="center" required="true" hidden="true"/> <%-- <EF:EFColumn ename="processClass" cname="工序分类" width="120" enable="true" align="center" required="true" hidden="true"/>--%>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
...@@ -55,22 +55,23 @@ $(function (){ ...@@ -55,22 +55,23 @@ $(function (){
$("#result").on("click", function () { $("#result").on("click", function () {
let id = $("#inqu_status-0-parentId").val(); let id = $("#inqu_status-0-parentId").val();
let inventCode = $("#inqu_status-0-inventCode").val(); let ids = $("#inqu_status-0-parentIds").val();
let flowId = $("#inqu_status-0-flowId").val(); // let inventCode = $("#inqu_status-0-inventCode").val();
// let flowId = $("#inqu_status-0-flowId").val();
let rows = resultGrid.getCheckedRows(); let rows = resultGrid.getCheckedRows();
let flag = true; // let flag = true;
$.each(rows, function(index, item) { // $.each(rows, function(index, item) {
let id= item.get("id"); // let id= item.get("id");
if(id == flowId){ // if(id == flowId){
message("当前选中的公司流程 ["+(item.get("factoryName"))+" - "+(item.get("flowName"))+"] 已经绑定,无法重复绑定!"); // message("当前选中的公司流程 ["+(item.get("factoryName"))+" - "+(item.get("flowName"))+"] 已经绑定,无法重复绑定!");
flag = false; // flag = false;
return false; // return false;
} // }
}); // });
if (flag){ // if (flag){
parent.JSColorbox.setValueCallback({"id":id,"inventCode":inventCode,"rows":rows[0]}); parent.JSColorbox.setValueCallback({"id":id,"ids":ids,"rows":rows[0]});
parent.JSColorbox.close(); parent.JSColorbox.close();
} // }
}); });
}) })
......
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" placeholder="模糊查询" colWidth="3"/> <EF:EFInput blockId="inqu_status" row="0" ename="flowName" cname="流程名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/> <EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级ID" colWidth="3" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="inventCode" cname="存货编码" colWidth="3" type="hidden"/> <EF:EFInput blockId="inqu_status" row="0" ename="parentIds" cname="上级IDS" colWidth="3" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="flowId" cname="流程ID" colWidth="3" type="hidden"/> <%-- <EF:EFInput blockId="inqu_status" row="0" ename="inventCode" cname="存货编码" colWidth="3" type="hidden"/>--%>
<%-- <EF:EFInput blockId="inqu_status" row="0" ename="flowId" cname="流程ID" colWidth="3" type="hidden"/>--%>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
......
...@@ -2,6 +2,7 @@ $(function () { ...@@ -2,6 +2,7 @@ $(function () {
var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows(); var companyCodeBox = __eiInfo.getBlock("roleCompany").getMappedRows();
var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows(); var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
...@@ -112,7 +113,18 @@ $(function () { ...@@ -112,7 +113,18 @@ $(function () {
},{ },{
field: "deviceCode", field: "deviceCode",
title: "设备编码", title: "设备编码",
},{
field: "deviceUserId",
title: "设备负责人",
filter: function (option) {
let companyCode = option.model['companyCode'];
if (companyCode){
return _.filter(userIdBox, function (item) {
return item["param1Field"]==companyCode;
})
}
return option.values
},
} }
], ],
exportGrid: { exportGrid: {
......
...@@ -4,6 +4,7 @@ $(function () { ...@@ -4,6 +4,7 @@ $(function () {
var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows(); var groupCodeBox = __eiInfo.getBlock("group_record_block_id").getMappedRows();
var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows(); var userIdBox = __eiInfo.getBlock("user_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3"); $(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
...@@ -128,6 +129,15 @@ $(function () { ...@@ -128,6 +129,15 @@ $(function () {
}, { }, {
field: "planUserId", field: "planUserId",
title: "计划人", title: "计划人",
filter: function (option) {
let companyCode = option.model['companyCode'];
if (companyCode){
return _.filter(userIdBox, function (item) {
return item["param1Field"]==companyCode;
})
}
return option.values
},
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < userIdBox.length; i++) { for (let i = 0; i < userIdBox.length; i++) {
if (userIdBox[i]['valueField'] === dataItem['planUserId']){ if (userIdBox[i]['valueField'] === dataItem['planUserId']){
......
...@@ -111,6 +111,15 @@ $(function () { ...@@ -111,6 +111,15 @@ $(function () {
},*/ { },*/ {
field: "applyUserId", field: "applyUserId",
title: "申请人", title: "申请人",
filter: function (option) {
let companyCode = option.model['companyCode'];
if (companyCode){
return _.filter(userIdBox, function (item) {
return item["param1Field"]==companyCode;
})
}
return option.values
},
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < userIdBox.length; i++) { for (let i = 0; i < userIdBox.length; i++) {
if (userIdBox[i]['valueField'] === dataItem['applyUserId']){ if (userIdBox[i]['valueField'] === dataItem['applyUserId']){
......
...@@ -93,6 +93,15 @@ $(function () { ...@@ -93,6 +93,15 @@ $(function () {
}, { }, {
field: "inspecUserId", field: "inspecUserId",
title: "点检人", title: "点检人",
filter: function (option) {
let companyCode = option.model['companyCode'];
if (companyCode){
return _.filter(userIdBox, function (item) {
return item["param1Field"]==companyCode;
})
}
return option.values
},
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < userIdBox.length; i++) { for (let i = 0; i < userIdBox.length; i++) {
if (userIdBox[i]['valueField'] === dataItem['inspecUserId']){ if (userIdBox[i]['valueField'] === dataItem['inspecUserId']){
......
...@@ -84,6 +84,15 @@ $(function () { ...@@ -84,6 +84,15 @@ $(function () {
}, { }, {
field: "upkeepUserId", field: "upkeepUserId",
title: "保养人", title: "保养人",
filter: function (option) {
let companyCode = option.model['companyCode'];
if (companyCode){
return _.filter(userIdBox, function (item) {
return item["param1Field"]==companyCode;
})
}
return option.values
},
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < userIdBox.length; i++) { for (let i = 0; i < userIdBox.length; i++) {
if (userIdBox[i]['valueField'] === dataItem['upkeepUserId']){ if (userIdBox[i]['valueField'] === dataItem['upkeepUserId']){
......
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
</EF:EFCascadeSelect> </EF:EFCascadeSelect>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="result-0-subcontractName" cname="方名称" type="hidden"/> <EF:EFInput ename="result-0-subcontractName" cname="方名称" type="hidden"/>
<EF:EFSelect cname="方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains"> <EF:EFSelect cname="方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" /> <EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/> <EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput ename="result-0-genralContractName" cname="方名称" type="hidden"/> <EF:EFInput ename="result-0-genralContractName" cname="方名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="方" ename="result-0-genralContractCode" <EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="方" ename="result-0-genralContractCode"
colWidth="4" required="true" filter="contains" defaultValue="" colWidth="4" required="true" filter="contains" defaultValue=""
serviceName="HGSC001" methodName="genralContractComboBox" resultId="customer_record_block_id" serviceName="HGSC001" methodName="genralContractComboBox" resultId="customer_record_block_id"
textField="textField" valueField="valueField" > textField="textField" valueField="valueField" >
......
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
</EF:EFCascadeSelect> </EF:EFCascadeSelect>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="result-0-subcontractName" cname="方名称" type="hidden"/> <EF:EFInput ename="result-0-subcontractName" cname="方名称" type="hidden"/>
<EF:EFSelect cname="方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains"> <EF:EFSelect cname="方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" /> <EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/> <EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput ename="result-0-genralContractName" cname="方名称" type="hidden"/> <EF:EFInput ename="result-0-genralContractName" cname="方名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="方" ename="result-0-genralContractCode" <EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="方" ename="result-0-genralContractCode"
colWidth="4" required="true" filter="contains" defaultValue="" colWidth="4" required="true" filter="contains" defaultValue=""
serviceName="HGSC001" methodName="genralContractComboBox" resultId="customer_record_block_id" serviceName="HGSC001" methodName="genralContractComboBox" resultId="customer_record_block_id"
textField="textField" valueField="valueField" > textField="textField" valueField="valueField" >
......
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
</EF:EFCascadeSelect> </EF:EFCascadeSelect>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="result-0-subcontractName" cname="方名称" type="hidden"/> <EF:EFInput ename="result-0-subcontractName" cname="方名称" type="hidden"/>
<EF:EFSelect cname="方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains"> <EF:EFSelect cname="方" ename="result-0-subcontractCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" /> <EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/> <EF:EFOptions blockId="roleCompany" valueField="companyCode" textField="companyName"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput ename="result-0-genralContractName" cname="方名称" type="hidden"/> <EF:EFInput ename="result-0-genralContractName" cname="方名称" type="hidden"/>
<EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="方" ename="result-0-genralContractCode" <EF:EFCascadeSelect cascadeFrom="result-0-subcontractCode" cname="方" ename="result-0-genralContractCode"
colWidth="4" required="true" filter="contains" defaultValue="" colWidth="4" required="true" filter="contains" defaultValue=""
serviceName="HGSC001" methodName="genralContractComboBox" resultId="customer_record_block_id" serviceName="HGSC001" methodName="genralContractComboBox" resultId="customer_record_block_id"
textField="textField" valueField="valueField" > 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