Commit cfdafdca by liuyang

2024-10-09 办公用品

parent 3f2d3b28
......@@ -364,7 +364,14 @@ public enum DdynamicEnum {
*/
SALE_NO_BLOCK_ID("sale_no_block_id","saleOutCode","saleOutCode","HGXS007.getSaleCode"),
;
/**
* 模块:协同办公
* 用途:用户用品下拉框
* 编写:ly
*/
ITEM_CODE_BLOCK_ID("itemCode_block_id","itemCode","itemName","itemModel","itemType","itemUnit","invQty","whCode","whName","HGBG001.queryItemCodeBox"),
;
......
package com.baosight.hggp.hg.bg.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG001;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/10/9
* @description 办公用品台账
*/
public class ServiceHGBG001 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID,
DdynamicEnum.WH_RECORD_BLOCK_ID,
DdynamicEnum.USER_BLOCK_ID
), null, false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGBG001.QUERY,new HGBG001());
}
@OperationLogAnnotation(operModul = "办公用品台账",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
return super.delete(inInfo, HGBG001.DELETE_FLAG);
}
@OperationLogAnnotation(operModul = "办公用品台账",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HGBG001 hpbg001 = new HGBG001();
hpbg001.fromMap(resultRow);
if (hpbg001.getId() == null || hpbg001.getId() == 0) {
this.add(hpbg001);
} else {
this.modify(hpbg001);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGBG001 hpbg001) {
hpbg001.setItemCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGBG001_ITEM_CODE));
DaoUtils.insert(HGBG001.INSERT, hpbg001);
}
/**
* 修改操作
*/
public void modify(HGBG001 hpbg001) {
DaoUtils.update(HGBG001.UPDATE, hpbg001);
}
}
package com.baosight.hggp.hg.bg.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ReviewStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG002;
import com.baosight.hggp.hg.bg.domain.HGBG002A;
import com.baosight.hggp.hg.bg.tools.HGBGTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/10/9
* @description 办公用品入库
*/
public class ServiceHGBG002 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.WH_RECORD_BLOCK_ID,
DdynamicEnum.USER_BLOCK_ID
), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGBG002().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG002.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGBG002.QUERY,new HGBG002());
}
@OperationLogAnnotation(operModul = "办公用品入库",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<HGBG002> resultRows = MapUtils.toDaoEPBases(inInfo,HGBG002.class);
List<Long> ids = ObjectUtils.listEpKey(resultRows, HGBG002.FIELD_ID);
List<HGBG002A> hgbg002AList = HGBGTools.HgBg002a.getByParentId(ids);
for (HGBG002 hgbg002: resultRows) {
hgbg002.setDeleteFlag(CommonConstant.YesNo.YES_1);
if (hgbg002.getId() == null || hgbg002.getId() == 0) {
continue;
}
List<HGBG002A> hgbg002As = hgbg002AList.stream().filter(hgbg002a1 -> hgbg002a1.getParentId().equals(hgbg002.getId())
&& hgbg002a1.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode())).collect(Collectors.toList());
AssertUtils.isTrue(hgbg002As.size()>0, "数据已提交,无法删除!");
DaoUtils.update(HGBG002.DELETE, hgbg002);
hgbg002As = hgbg002AList.stream().filter(hgbg002a1 -> hgbg002a1.getParentId().equals(hgbg002.getId())).collect(Collectors.toList());
hgbg002As.forEach(hgbg002a -> DaoUtils.update(HGBG002A.DELETE, hgbg002a));
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "办公用品入库",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
Map resultRow = EiInfoUtils.getFirstRow(inInfo, EiConstant.resultBlock);
HGBG002 hgbg002 = new HGBG002();
hgbg002.fromMap(resultRow);
if (hgbg002.getId() == null || hgbg002.getId() == 0){
this.add(hgbg002);
}else {
this.modify(hgbg002);
}
List<Map> detailRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows();
// 写入数据
for (Map detailRow : detailRows) {
HGBG002A hgbg002a = new HGBG002A();
hgbg002a.fromMap(detailRow);
if (hgbg002a.getId() == null || hgbg002a.getId() == 0) {
hgbg002a.setParentId(hgbg002.getId());
DaoUtils.insert(HGBG002A.INSERT, hgbg002a);
} else {
DaoUtils.update(HGBG002A.UPDATE, hgbg002a);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + detailRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGBG002 hgbg002) {
hgbg002.setDepositCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGBG002_DEPOSIT_CODE));
DaoUtils.insert(HGBG002.INSERT, hgbg002);
}
/**
* 修改操作
*/
public void modify(HGBG002 hgbg002) {
DaoUtils.update(HGBG002.UPDATE, hgbg002);
}
}
package com.baosight.hggp.hg.bg.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ReviewStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG001;
import com.baosight.hggp.hg.bg.domain.HGBG002A;
import com.baosight.hggp.hg.bg.tools.HGBGTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/10/9
* @description
*/
public class ServiceHGBG002A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID,
DdynamicEnum.WH_RECORD_BLOCK_ID,
DdynamicEnum.USER_BLOCK_ID
), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGBG002A().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG002A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGBG002A.QUERY,new HGBG002A());
}
@OperationLogAnnotation(operModul = "办公用品入库",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow: resultRows) {
HGBG002A hpbg002a = new HGBG002A();
hpbg002a.fromMap(resultRow);
hpbg002a.setDeleteFlag(CommonConstant.YesNo.YES_1);
if (hpbg002a.getId() == null || hpbg002a.getId() == 0) {
continue;
}
AssertUtils.isTrue(hpbg002a.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode()), "数据已提交,无法删除!");
DaoUtils.update(HGBG002A.DELETE, hpbg002a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "办公用品入库",operType = "提交",operDesc = "提交操作")
public EiInfo submit(EiInfo inInfo) {
try {
List<HGBG002A> resultRows = MapUtils.toDaoEPBases(inInfo,HGBG002A.class);
List<String> itemCodes = ObjectUtils.listEpKey(resultRows, HGBG002A.FIELD_ITEM_CODE);
List<HGBG001> hpbg001s = HGBGTools.HgBg001.getByItemCode(itemCodes);
// 写入数据
for (HGBG002A hpbg002A : resultRows) {
AssertUtils.isTrue(hpbg002A.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode()), "数据已提交,无法重复提交!");
Map<String,HGBG001> hpbg001Map = hpbg001s.stream().filter(item -> item.getItemCode().equals(hpbg002A.getItemCode())).collect(Collectors.toMap(HGBG001::getItemCode, item -> item));
if (!hpbg001Map.isEmpty()){
HGBG001 hpbg001 = hpbg001Map.get(hpbg002A.getItemCode());
BigDecimal invQty = hpbg001.getInvQty().add(hpbg002A.getInvQty());
hpbg001.setInvQty(invQty.compareTo(BigDecimal.ZERO) < 0?BigDecimal.ZERO:invQty);
DaoUtils.update(HGBG001.UPDATE, hpbg001);
}
hpbg002A.setStatus(ReviewStatusEnum.SUBMITTED.getCode());
DaoUtils.update(HGBG002A.UPDATE_BY_STATUS, hpbg002A);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.bg.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/10/9
* @description
*/
public class ServiceHGBG002B extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.WH_RECORD_BLOCK_ID,
DdynamicEnum.USER_BLOCK_ID,
DdynamicEnum.ITEM_CODE_BLOCK_ID
), null, false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.bg.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ReviewStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG002;
import com.baosight.hggp.hg.bg.domain.HGBG002A;
import com.baosight.hggp.hg.bg.tools.HGBGTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiBlockMeta;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/10/9
* @description
*/
public class ServiceHGBG002C extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
Map<String,String> params = EiInfoUtils.getFirstRow(inInfo);
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.WH_RECORD_BLOCK_ID,
DdynamicEnum.USER_BLOCK_ID,
DdynamicEnum.ITEM_CODE_BLOCK_ID
), null, false);
Long id = Long.parseLong(params.get(HGBG002.FIELD_ID));
HGBG002 hpbg002 = HGBGTools.HgBg002.get(id);
List<HGBG002A> hpbg002As = HGBGTools.HgBg002a.getByParentId(id,ReviewStatusEnum.UNSUBMITTED.getCode());
EiBlock resultBlock =new EiBlock(EiConstant.resultBlock);
resultBlock.setBlockMeta(new HGBG002().eiMetadata);
resultBlock.setRows(Collections.singletonList(hpbg002));
EiBlock detailBlock =new EiBlock(CommonConstant.Field.DETAIL);
detailBlock.setBlockMeta(new HGBG002A().eiMetadata);
detailBlock.setRows(hpbg002As);
inInfo.setBlock(resultBlock);
inInfo.setBlock(detailBlock);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG002A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG002A.FIELD_STATUS, ReviewStatusEnum.UNSUBMITTED.getCode());
return super.query(inInfo, HGBG002A.QUERY,new HGBG002A(),false,new EiBlockMeta(),EiConstant.queryBlock,CommonConstant.Field.DETAIL,CommonConstant.Field.DETAIL);
}
@OperationLogAnnotation(operModul = "办公用品入库",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows();
for (Map resultRow: resultRows) {
HGBG002A hpbg002a = new HGBG002A();
hpbg002a.fromMap(resultRow);
hpbg002a.setDeleteFlag(CommonConstant.YesNo.YES_1);
if (hpbg002a.getId() == null || hpbg002a.getId() == 0) {
continue;
}
AssertUtils.isTrue(hpbg002a.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode()), "数据已提交,无法删除!");
DaoUtils.update(HGBG002A.DELETE, hpbg002a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.bg.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ReviewStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG003;
import com.baosight.hggp.hg.bg.domain.HGBG003A;
import com.baosight.hggp.hg.bg.tools.HGBGTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/10/9
* @description
*/
public class ServiceHGBG003 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.WH_RECORD_BLOCK_ID,
DdynamicEnum.USER_BLOCK_ID
), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGBG003().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG003.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGBG003.QUERY,new HGBG003());
}
@OperationLogAnnotation(operModul = "办公用品领用",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<HGBG003> resultRows = MapUtils.toDaoEPBases(inInfo,HGBG003.class);
List<Long> ids = ObjectUtils.listEpKey(resultRows, HGBG003.FIELD_ID);
List<HGBG003A> hpbg003AList = HGBGTools.HgBg003a.getByParentId(ids);
for (HGBG003 hpbg003: resultRows) {
hpbg003.setDeleteFlag(CommonConstant.YesNo.YES_1);
if (hpbg003.getId() == null || hpbg003.getId() == 0) {
continue;
}
List<HGBG003A> hpbg003As = hpbg003AList.stream().filter(hpbg003a1 -> hpbg003a1.getParentId().equals(hpbg003.getId())
&& hpbg003a1.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode())).collect(Collectors.toList());
AssertUtils.isTrue(hpbg003As.size()>0, "数据已提交,无法删除!");
DaoUtils.update(HGBG003.DELETE, hpbg003);
hpbg003As = hpbg003AList.stream().filter(hpbg003a1 -> hpbg003a1.getParentId().equals(hpbg003.getId())).collect(Collectors.toList());
hpbg003As.forEach(hpbg003a -> DaoUtils.update(HGBG003A.DELETE, hpbg003a));
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "办公用品领用",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
Map resultRow = EiInfoUtils.getFirstRow(inInfo, EiConstant.resultBlock);
HGBG003 hpbg003 = new HGBG003();
hpbg003.fromMap(resultRow);
if (hpbg003.getId() == null || hpbg003.getId() == 0){
this.add(hpbg003);
}else {
this.modify(hpbg003);
}
List<Map> detailRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows();
// 写入数据
for (Map detailRow : detailRows) {
HGBG003A hpbg003a = new HGBG003A();
hpbg003a.fromMap(detailRow);
if (hpbg003a.getId() == null || hpbg003a.getId() == 0) {
hpbg003a.setParentId(hpbg003.getId());
DaoUtils.insert(HGBG003A.INSERT, hpbg003a);
} else {
DaoUtils.update(HGBG003A.UPDATE, hpbg003a);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + detailRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGBG003 hpbg003) {
hpbg003.setReceiveCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.HGBG003_RECEIVE_CODE));
DaoUtils.insert(HGBG003.INSERT, hpbg003);
}
/**
* 修改操作
*/
public void modify(HGBG003 hpbg003) {
DaoUtils.update(HGBG003.UPDATE, hpbg003);
}
}
package com.baosight.hggp.hg.bg.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ReviewStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG001;
import com.baosight.hggp.hg.bg.domain.HGBG003A;
import com.baosight.hggp.hg.bg.tools.HGBGTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/10/9
* @description
*/
public class ServiceHGBG003A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.WH_RECORD_BLOCK_ID,
DdynamicEnum.USER_BLOCK_ID
), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGBG003A().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG003A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGBG003A.QUERY,new HGBG003A());
}
@OperationLogAnnotation(operModul = "办公用品领用",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow: resultRows) {
HGBG003A hpbg003a = new HGBG003A();
hpbg003a.fromMap(resultRow);
hpbg003a.setDeleteFlag(CommonConstant.YesNo.YES_1);
if (hpbg003a.getId() == null || hpbg003a.getId() == 0) {
continue;
}
AssertUtils.isTrue(hpbg003a.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode()), "数据已提交,无法删除!");
DaoUtils.update(HGBG003A.DELETE, hpbg003a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "办公用品领用",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HGBG003A hpbg003a = new HGBG003A();
hpbg003a.fromMap(resultRow);
if (hpbg003a.getId() == null || hpbg003a.getId() == 0) {
this.add(hpbg003a);
} else {
this.modify(hpbg003a);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGBG003A hpbg003a) {
DaoUtils.insert(HGBG003A.INSERT, hpbg003a);
}
/**
* 修改操作
*/
public void modify(HGBG003A hpbg003a) {
DaoUtils.update(HGBG003A.UPDATE, hpbg003a);
}
@OperationLogAnnotation(operModul = "办公用品领用",operType = "提交",operDesc = "提交操作")
public EiInfo submit(EiInfo inInfo) {
try {
List<HGBG003A> resultRows = MapUtils.toDaoEPBases(inInfo,HGBG003A.class);
List<String> itemCodes = ObjectUtils.listEpKey(resultRows, HGBG003A.FIELD_ITEM_CODE);
List<HGBG001> hpbg001s = HGBGTools.HgBg001.getByItemCode(itemCodes);
// 写入数据
for (HGBG003A hpbg003A : resultRows) {
AssertUtils.isTrue(hpbg003A.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode()), "数据已提交,无法重复提交!");
Map<String,HGBG001> hpbg001Map = hpbg001s.stream().filter(item -> item.getItemCode().equals(hpbg003A.getItemCode())).collect(Collectors.toMap(HGBG001::getItemCode, item -> item));
if (!hpbg001Map.isEmpty()){
HGBG001 hpbg001 = hpbg001Map.get(hpbg003A.getItemCode());
BigDecimal invQty = hpbg001.getInvQty().subtract(hpbg003A.getReceiveQty());
hpbg001.setInvQty(invQty.compareTo(BigDecimal.ZERO) < 0?BigDecimal.ZERO:invQty);
DaoUtils.update(HGBG001.UPDATE, hpbg001);
}
hpbg003A.setStatus(ReviewStatusEnum.SUBMITTED.getCode());
DaoUtils.update(HGBG003A.UPDATE_BY_STATUS, hpbg003A);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.bg.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
/**
* @author LiuYang
* @version 1.0 2024/10/9
* @description
*/
public class ServiceHGBG003B extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.WH_RECORD_BLOCK_ID,
DdynamicEnum.USER_BLOCK_ID,
DdynamicEnum.ITEM_CODE_BLOCK_ID
), null, false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.bg.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ReviewStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG003;
import com.baosight.hggp.hg.bg.domain.HGBG003A;
import com.baosight.hggp.hg.bg.tools.HGBGTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiBlockMeta;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/10/9
* @description
*/
public class ServiceHGBG003C extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
Map<String,String> params = EiInfoUtils.getFirstRow(inInfo);
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.WH_RECORD_BLOCK_ID,
DdynamicEnum.USER_BLOCK_ID,
DdynamicEnum.ITEM_CODE_BLOCK_ID
), null, false);
Long id = Long.parseLong(params.get(HGBG003.FIELD_ID));
HGBG003 hpbg003 = HGBGTools.HgBg003.get(id);
List<HGBG003A> hpbg003As = HGBGTools.HgBg003a.getByParentId(id, ReviewStatusEnum.UNSUBMITTED.getCode());
EiBlock resultBlock =new EiBlock(EiConstant.resultBlock);
resultBlock.setBlockMeta(new HGBG003().eiMetadata);
resultBlock.setRows(Collections.singletonList(hpbg003));
EiBlock detailBlock =new EiBlock(CommonConstant.Field.DETAIL);
detailBlock.setBlockMeta(new HGBG003A().eiMetadata);
detailBlock.setRows(hpbg003As);
inInfo.setBlock(resultBlock);
inInfo.setBlock(detailBlock);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG003A.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG003A.FIELD_STATUS, ReviewStatusEnum.UNSUBMITTED.getCode());
return super.query(inInfo, HGBG003A.QUERY,new HGBG003A(),false,new EiBlockMeta(),EiConstant.queryBlock,CommonConstant.Field.DETAIL,CommonConstant.Field.DETAIL);
}
@OperationLogAnnotation(operModul = "办公用品领用",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows();
for (Map resultRow: resultRows) {
HGBG003A hpbg003a = new HGBG003A();
hpbg003a.fromMap(resultRow);
hpbg003a.setDeleteFlag(CommonConstant.YesNo.YES_1);
if (hpbg003a.getId() == null || hpbg003a.getId() == 0) {
continue;
}
AssertUtils.isTrue(hpbg003a.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode()), "数据已提交,无法删除!");
DaoUtils.update(HGBG003A.DELETE, hpbg003a);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
}catch (Exception e){
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.bg.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ReviewStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG001;
import com.baosight.hggp.hg.bg.domain.HGBG004;
import com.baosight.hggp.hg.bg.tools.HGBGTools;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/10/9
* @description
*/
public class ServiceHGBG004 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(
DdynamicEnum.CUSTOMER_RECORD_BLOCK_ID,
DdynamicEnum.WH_RECORD_BLOCK_ID,
DdynamicEnum.USER_BLOCK_ID,
DdynamicEnum.ITEM_CODE_BLOCK_ID
), null, false);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG004.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGBG004.QUERY,new HGBG004());
}
@OperationLogAnnotation(operModul = "办公用品盘点",operType = "删除",operDesc = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
return super.delete(inInfo, HGBG004.DELETE_FLAG);
}
@OperationLogAnnotation(operModul = "办公用品盘点",operType = "保存",operDesc = "操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HGBG004 hpbg004 = new HGBG004();
hpbg004.fromMap(resultRow);
if (hpbg004.getId() == null || hpbg004.getId() == 0) {
this.add(hpbg004);
} else {
this.modify(hpbg004);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGBG004 hpbg004) {
hpbg004.setStatus(ReviewStatusEnum.UNSUBMITTED.getCode());
DaoUtils.insert(HGBG004.INSERT, hpbg004);
}
/**
* 修改操作
*/
public void modify(HGBG004 hpbg004) {
DaoUtils.update(HGBG004.UPDATE, hpbg004);
}
@OperationLogAnnotation(operModul = "办公用品盘点",operType = "提交",operDesc = "提交操作")
public EiInfo submit(EiInfo inInfo) {
try {
List<HGBG004> resultRows = MapUtils.toDaoEPBases(inInfo,HGBG004.class);
List<String> itemCodes = ObjectUtils.listEpKey(resultRows, HGBG004.FIELD_ITEM_CODE);
List<HGBG001> hpbg001s = HGBGTools.HgBg001.getByItemCode(itemCodes);
// 写入数据
for (HGBG004 hpbg004 : resultRows) {
AssertUtils.isTrue(hpbg004.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode()), "数据已提交,无法提交!");
Map<String, HGBG001> hpbg001Map = hpbg001s.stream().filter(item -> item.getItemCode().equals(hpbg004.getItemCode())).collect(Collectors.toMap(HGBG001::getItemCode, item -> item));
if (!hpbg001Map.isEmpty()){
HGBG001 hpbg001 = hpbg001Map.get(hpbg004.getItemCode());
BigDecimal invQty = hpbg001.getInvQty().add(hpbg004.getProLossQty());
hpbg001.setInvQty(invQty.compareTo(BigDecimal.ZERO) < 0?BigDecimal.ZERO:invQty);
DaoUtils.update(HGBG001.UPDATE, hpbg001);
}
hpbg004.setStatus(ReviewStatusEnum.SUBMITTED.getCode());
DaoUtils.update(HGBG004.UPDATE_BY_STATUS, hpbg004);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-10-09 13:59:51
Version : 1.0
schema : hggp
tableName : HGBG001
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
WH_CODE VARCHAR,
WH_NAME VARCHAR,
ITEM_TYPE TINYINT,
ITEM_CODE VARCHAR,
ITEM_NAME VARCHAR,
ITEM_MODEL VARCHAR,
ITEM_UNIT VARCHAR,
INV_QTY DECIMAL
-->
<sqlMap namespace="HGBG001">
<typeAlias alias="HGBG001" type="com.baosight.hggp.hg.bg.domain.HGBG001"/>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemType">
ITEM_TYPE = #itemType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemCode">
ITEM_CODE = #itemCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemName">
ITEM_NAME like concat('%', #itemName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemModel">
ITEM_MODEL like concat('%', #itemModel#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemUnit">
ITEM_UNIT = #itemUnit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invQty">
INV_QTY = #invQty#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap" resultClass="HGBG001">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
ITEM_TYPE as "itemType", <!-- 用品分类 -->
ITEM_CODE as "itemCode", <!-- 用品编码 -->
ITEM_NAME as "itemName", <!-- 用品名称 -->
ITEM_MODEL as "itemModel", <!-- 用品型号 -->
ITEM_UNIT as "itemUnit", <!-- 用品单位 -->
INV_QTY as "invQty" <!-- 库存数量 -->
FROM ${hggpSchema}.HGBG001 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGBG001 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemType">
ITEM_TYPE = #itemType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemCode">
ITEM_CODE = #itemCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemName">
ITEM_NAME = #itemName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemModel">
ITEM_MODEL = #itemModel#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemUnit">
ITEM_UNIT = #itemUnit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invQty">
INV_QTY = #invQty#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGBG001 (ID,
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
ITEM_TYPE, <!-- 用品分类 -->
ITEM_CODE, <!-- 用品编码 -->
ITEM_NAME, <!-- 用品名称 -->
ITEM_MODEL, <!-- 用品型号 -->
ITEM_UNIT, <!-- 用品单位 -->
INV_QTY <!-- 库存数量 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#, #companyCode#,
#companyName#, #whCode#, #whName#, #itemType#, #itemCode#, #itemName#, #itemModel#, #itemUnit#, #invQty#)
<selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGBG001
</selectKey>
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGBG001 WHERE
ID = #id#
</delete>
<update id="deleteFlag">
UPDATE ${hggpSchema}.HGBG001
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = 1 <!-- 是否删除0.否1.是 -->
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hggpSchema}.HGBG001
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
ITEM_TYPE = #itemType#, <!-- 用品分类 -->
ITEM_CODE = #itemCode#, <!-- 用品编码 -->
ITEM_NAME = #itemName#, <!-- 用品名称 -->
ITEM_MODEL = #itemModel#, <!-- 用品型号 -->
ITEM_UNIT = #itemUnit#, <!-- 用品单位 -->
INV_QTY = #invQty# <!-- 库存数量 -->
WHERE
ID = #id#
</update>
<select id="queryItemCodeBox" parameterClass="java.util.HashMap" resultClass="HGBG001">
SELECT
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
ITEM_TYPE as "itemType", <!-- 用品分类 -->
ITEM_CODE as "itemCode", <!-- 用品编码 -->
CONCAT(ITEM_NAME,'-',ITEM_MODEL) as "itemName", <!-- 用品名称 -->
ITEM_MODEL as "itemModel", <!-- 用品型号 -->
ITEM_UNIT as "itemUnit", <!-- 用品单位 -->
INV_QTY as "invQty" <!-- 库存数量 -->
FROM ${hggpSchema}.HGBG001
WHERE DELETE_FLAG = 0
<include refid="condition" />
</select>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-10-09 13:59:51
Version : 1.0
schema : hggp
tableName : HGBG002
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
DEPOSIT_DATE VARCHAR,
DEPOSIT_CODE VARCHAR,
WH_CODE VARCHAR,
WH_NAME VARCHAR,
DEPOSIT_USER VARCHAR
-->
<sqlMap namespace="HGBG002">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositDate">
DEPOSIT_DATE = #depositDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositCode">
DEPOSIT_CODE = #depositCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositUser">
DEPOSIT_USER = #depositUser#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.bg.domain.HGBG002">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
DEPOSIT_DATE as "depositDate", <!-- 入库日期 -->
DEPOSIT_CODE as "depositCode", <!-- 入库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
DEPOSIT_USER as "depositUser" <!-- 入库人员 -->
FROM ${hggpSchema}.HGBG002 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
DEPOSIT_DATE DESC, ID desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGBG002 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositDate">
DEPOSIT_DATE = #depositDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositCode">
DEPOSIT_CODE = #depositCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depositUser">
DEPOSIT_USER = #depositUser#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGBG002 (ID,
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
DEPOSIT_DATE, <!-- 入库日期 -->
DEPOSIT_CODE, <!-- 入库单号 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
DEPOSIT_USER <!-- 入库人员 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#, #companyCode#,
#companyName#, #depositDate#, #depositCode#, #whCode#, #whName#, #depositUser#)
<selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGBG002
</selectKey>
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGBG002 WHERE
ID = #id#
</delete>
<update id="deleteFlag">
UPDATE ${hggpSchema}.HGBG002
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = 1 <!-- 是否删除0.否1.是 -->
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hggpSchema}.HGBG002
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
DEPOSIT_DATE = #depositDate#, <!-- 入库日期 -->
DEPOSIT_CODE = #depositCode#, <!-- 入库单号 -->
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
DEPOSIT_USER = #depositUser# <!-- 入库人员 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-10-09 13:59:51
Version : 1.0
schema : hggp
tableName : HGBG002A
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
ITEM_TYPE TINYINT,
ITEM_CODE VARCHAR,
ITEM_NAME VARCHAR,
ITEM_MODEL VARCHAR,
ITEM_UNIT VARCHAR,
INV_QTY DECIMAL,
STATUS TINYINT,
PARENT_ID BIGINT
-->
<sqlMap namespace="HGBG002A">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemType">
ITEM_TYPE = #itemType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemCode">
ITEM_CODE = #itemCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemName">
ITEM_NAME like concat('%', #itemName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemModel">
ITEM_MODEL like concat('%', #itemModel#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemUnit">
ITEM_UNIT = #itemUnit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invQty">
INV_QTY = #invQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentIds">
PARENT_ID IN <iterate close=")" open="(" conjunction="," property="parentIds">#parentIds[]#</iterate>
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.bg.domain.HGBG002A">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
ITEM_TYPE as "itemType", <!-- 用品分类 -->
ITEM_CODE as "itemCode", <!-- 用品编码 -->
ITEM_NAME as "itemName", <!-- 用品名称 -->
ITEM_MODEL as "itemModel", <!-- 用品型号 -->
ITEM_UNIT as "itemUnit", <!-- 用品单位 -->
INV_QTY as "invQty", <!-- 入库数量 -->
STATUS as "status", <!-- 审批状态0.未审核1.已审核 -->
PARENT_ID as "parentId" <!-- 父级ID -->
FROM ${hggpSchema}.HGBG002A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGBG002A WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemType">
ITEM_TYPE = #itemType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemCode">
ITEM_CODE = #itemCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemName">
ITEM_NAME = #itemName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemModel">
ITEM_MODEL = #itemModel#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemUnit">
ITEM_UNIT = #itemUnit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="invQty">
INV_QTY = #invQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGBG002A (ID,
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
ITEM_TYPE, <!-- 用品分类 -->
ITEM_CODE, <!-- 用品编码 -->
ITEM_NAME, <!-- 用品名称 -->
ITEM_MODEL, <!-- 用品型号 -->
ITEM_UNIT, <!-- 用品单位 -->
INV_QTY, <!-- 入库数量 -->
STATUS, <!-- 审批状态0.未审核1.已审核 -->
PARENT_ID <!-- 父级ID -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#, #itemType#,
#itemCode#, #itemName#, #itemModel#, #itemUnit#, #invQty#, #status#, #parentId#)
<selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGBG002A
</selectKey>
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGBG002A WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGBG002A
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
ITEM_TYPE = #itemType#, <!-- 用品分类 -->
ITEM_CODE = #itemCode#, <!-- 用品编码 -->
ITEM_NAME = #itemName#, <!-- 用品名称 -->
ITEM_MODEL = #itemModel#, <!-- 用品型号 -->
ITEM_UNIT = #itemUnit#, <!-- 用品单位 -->
INV_QTY = #invQty#, <!-- 入库数量 -->
STATUS = #status#, <!-- 审批状态0.未审核1.已审核 -->
PARENT_ID = #parentId# <!-- 父级ID -->
WHERE
ID = #id#
</update>
<update id="updateBystatus">
UPDATE ${hggpSchema}.HGBG002A
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
STATUS = #status# <!-- 审批状态0.未审核1.已审核 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-10-09 13:59:51
Version : 1.0
schema : hggp
tableName : HGBG003
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
RECEIVE_DATE VARCHAR,
RECEIVE_CODE VARCHAR,
WH_CODE VARCHAR,
WH_NAME VARCHAR,
RECEIVE_USER VARCHAR
-->
<sqlMap namespace="HGBG003">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveDate">
RECEIVE_DATE = #receiveDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveCode">
RECEIVE_CODE = #receiveCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveUser">
RECEIVE_USER = #receiveUser#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.bg.domain.HGBG003">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
RECEIVE_DATE as "receiveDate", <!-- 领用日期 -->
RECEIVE_CODE as "receiveCode", <!-- 领用单号 -->
WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 -->
RECEIVE_USER as "receiveUser" <!-- 领用人员 -->
FROM ${hggpSchema}.HGBG003 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
RECEIVE_DATE desc, ID desc
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGBG003 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveDate">
RECEIVE_DATE = #receiveDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveCode">
RECEIVE_CODE = #receiveCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whCode">
WH_CODE = #whCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="whName">
WH_NAME = #whName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveUser">
RECEIVE_USER = #receiveUser#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGBG003 (ID,
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
RECEIVE_DATE, <!-- 领用日期 -->
RECEIVE_CODE, <!-- 领用单号 -->
WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 -->
RECEIVE_USER <!-- 领用人员 -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#, #companyCode#,
#companyName#, #receiveDate#, #receiveCode#, #whCode#, #whName#, #receiveUser#)
<selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGBG003
</selectKey>
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGBG003 WHERE
ID = #id#
</delete>
<update id="deleteFlag">
UPDATE ${hggpSchema}.HGBG003
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = 1 <!-- 是否删除0.否1.是 -->
WHERE
ID = #id#
</update>
<update id="update">
UPDATE ${hggpSchema}.HGBG003
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
RECEIVE_DATE = #receiveDate#, <!-- 领用日期 -->
RECEIVE_CODE = #receiveCode#, <!-- 领用单号 -->
WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 -->
RECEIVE_USER = #receiveUser# <!-- 领用人员 -->
WHERE
ID = #id#
</update>
</sqlMap>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-10-09 13:59:51
Version : 1.0
schema : hggp
tableName : HGBG003A
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
ITEM_TYPE TINYINT,
ITEM_CODE VARCHAR,
ITEM_NAME VARCHAR,
ITEM_MODEL VARCHAR,
ITEM_UNIT VARCHAR,
RECEIVE_QTY DECIMAL,
STATUS TINYINT,
PARENT_ID BIGINT
-->
<sqlMap namespace="HGBG003A">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemType">
ITEM_TYPE = #itemType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemCode">
ITEM_CODE = #itemCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemName">
ITEM_NAME like concat('%', #itemName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemModel">
ITEM_MODEL like concat('%', #itemModel#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemUnit">
ITEM_UNIT = #itemUnit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveQty">
RECEIVE_QTY = #receiveQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.bg.domain.HGBG003A">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 更新人 -->
UPDATED_NAME as "updatedName", <!-- 更新人名称 -->
UPDATED_TIME as "updatedTime", <!-- 更新时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0.否1.是 -->
ITEM_TYPE as "itemType", <!-- 用品分类 -->
ITEM_CODE as "itemCode", <!-- 用品编码 -->
ITEM_NAME as "itemName", <!-- 用品名称 -->
ITEM_MODEL as "itemModel", <!-- 用品型号 -->
ITEM_UNIT as "itemUnit", <!-- 用品单位 -->
RECEIVE_QTY as "receiveQty", <!-- 领用数量 -->
STATUS as "status", <!-- 审批状态0.未审核1.已审核 -->
PARENT_ID as "parentId" <!-- 父级ID -->
FROM ${hggpSchema}.HGBG003A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGBG003A WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemType">
ITEM_TYPE = #itemType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemCode">
ITEM_CODE = #itemCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemName">
ITEM_NAME = #itemName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemModel">
ITEM_MODEL = #itemModel#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="itemUnit">
ITEM_UNIT = #itemUnit#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveQty">
RECEIVE_QTY = #receiveQty#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGBG003A (ID,
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 是否删除0.否1.是 -->
ITEM_TYPE, <!-- 用品分类 -->
ITEM_CODE, <!-- 用品编码 -->
ITEM_NAME, <!-- 用品名称 -->
ITEM_MODEL, <!-- 用品型号 -->
ITEM_UNIT, <!-- 用品单位 -->
RECEIVE_QTY, <!-- 领用数量 -->
STATUS, <!-- 审批状态0.未审核1.已审核 -->
PARENT_ID <!-- 父级ID -->
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#, #itemType#,
#itemCode#, #itemName#, #itemModel#, #itemUnit#, #receiveQty#, #status#, #parentId#)
<selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGBG003A
</selectKey>
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGBG003A WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGBG003A
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0.否1.是 -->
ITEM_TYPE = #itemType#, <!-- 用品分类 -->
ITEM_CODE = #itemCode#, <!-- 用品编码 -->
ITEM_NAME = #itemName#, <!-- 用品名称 -->
ITEM_MODEL = #itemModel#, <!-- 用品型号 -->
ITEM_UNIT = #itemUnit#, <!-- 用品单位 -->
RECEIVE_QTY = #receiveQty#, <!-- 领用数量 -->
STATUS = #status#, <!-- 审批状态0.未审核1.已审核 -->
PARENT_ID = #parentId# <!-- 父级ID -->
WHERE
ID = #id#
</update>
<update id="updateBystatus">
UPDATE ${hggpSchema}.HGBG003A
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
STATUS = #status# <!-- 审批状态0.未审核1.已审核 -->
WHERE
ID = #id#
</update>
</sqlMap>
package com.baosight.hggp.hg.bg.tools;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.hg.bg.domain.*;
import com.baosight.hggp.util.AssertUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import java.util.*;
/**
* @author LiuYang
* @version 1.0 2024/10/9
* @description
*/
@Slf4j
public class HGBGTools {
public static class HgBg001 {
public static List<HGBG001> getByItemCode(List<String> itemCodes){
if (CollectionUtils.isEmpty(itemCodes)){
return new ArrayList<>();
}
Map params = new HashMap();
params.put("itemCodes", itemCodes);
params.put("deleteFlag", 0);
List<HGBG001> list = DaoBase.getInstance().query(HGBG001.QUERY, params);
return CollectionUtils.isEmpty(list)?new ArrayList<>():list;
}
}
public static class HgBg002 {
public static HGBG002 get(Long id){
AssertUtils.isTrue(Objects.isNull(id)||id<=0, "委外入库单ID不能为空!");
HGBG002 hpbg002 = (HGBG002) DaoBase.getInstance().get(HGBG002.QUERY,HGBG002.FIELD_ID, id);
return hpbg002;
}
}
public static class HgBg002a {
public static List<HGBG002A> getByParentId(Long parentId, Integer status){
AssertUtils.isTrue(Objects.isNull(parentId)||parentId<=0, "委外入库单ID不能为空!");
Map params = new HashMap();
params.put("parentId", parentId);
params.put("status", status);
params.put("deleteFlag", 0);
List<HGBG002A> list = DaoBase.getInstance().query(HGBG002A.QUERY,params);
return CollectionUtils.isEmpty(list)?new ArrayList<>():list;
}
public static List<HGBG002A> getByParentId(List<Long> parentIds){
AssertUtils.isTrue(parentIds.size()==0, "委外入库单ID不能为空!");
Map params = new HashMap();
params.put("parentIds", parentIds);
params.put("deleteFlag", 0);
List<HGBG002A> list = DaoBase.getInstance().query(HGBG002A.QUERY,params);
return CollectionUtils.isEmpty(list)?new ArrayList<>():list;
}
}
public static class HgBg003 {
public static HGBG003 get(Long id){
AssertUtils.isTrue(Objects.isNull(id)||id<=0, "委外入库单ID不能为空!");
HGBG003 hpbg003 = (HGBG003) DaoBase.getInstance().get(HGBG003.QUERY,HGBG003.FIELD_ID, id);
return hpbg003;
}
}
public static class HgBg003a {
public static List<HGBG003A> getByParentId(Long parentId, Integer status){
AssertUtils.isTrue(Objects.isNull(parentId)||parentId<=0, "委外入库单ID不能为空!");
Map params = new HashMap();
params.put("parentId", parentId);
params.put("status", status);
params.put("deleteFlag", 0);
List<HGBG003A> list = DaoBase.getInstance().query(HGBG003A.QUERY,params);
return CollectionUtils.isEmpty(list)?new ArrayList<>():list;
}
public static List<HGBG003A> getByParentId(List<Long> parentIds){
AssertUtils.isTrue(parentIds.size()==0, "委外入库单ID不能为空!");
Map params = new HashMap();
params.put("parentIds", parentIds);
params.put("deleteFlag", 0);
List<HGBG003A> list = DaoBase.getInstance().query(HGBG003A.QUERY,params);
return CollectionUtils.isEmpty(list)?new ArrayList<>():list;
}
}
}
......@@ -168,6 +168,12 @@ public class HGConstant {
public static final String DEPOSIT_CODE = "DEPOSIT_CODE";
//委外出库单号
public static final String OUT_CODE = "OUT_CODE";
//办公用品编码
public static final String HGBG001_ITEM_CODE = "HGBG001_ITEM_CODE";
//办公用品入库单号
public static final String HGBG002_DEPOSIT_CODE = "HGBG002_DEPOSIT_CODE";
//办公用品领用单号
public static final String HGBG003_RECEIVE_CODE = "HGBG003_RECEIVE_CODE";
}
......
$(function () {
var whRecordBox = __eiInfo.getBlock("wh_record_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let BG001 = "BG001";
let template = "";
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px"'
+ ' onclick="uploadFile(' + item.id + ',\''+BG001+'\')" >附件清单</a>';
}
return template;
}
}
],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "whCode") {
for (let i = 0; i < whRecordBox.length; i++) {
if (whRecordBox[i]['valueField'] === e.items[0]['whCode']) {
resultGrid.setCellValue(e.items[0],"whName",whRecordBox[i]['textField']);
break;
}
}
loadChange(grid, e,"itemName")
//resultGrid.refresh();
}
});
$("#submit").on("click", submitFunc)
},
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();
});
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 whCode= item.get("whCode");
let itemName= item.get("itemName");
let itemType= item.get("itemType");
let invQty= item.get("invQty");
if(isBlank(whCode)){
message("选中的第"+(index+1)+"行\"仓库名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(itemName)){
message("选中的第"+(index+1)+"行\"用品名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(itemType)){
message("选中的第"+(index+1)+"行\"用品分类\",不能为空!");
flag = false;
return false;
}
if(isBlank(invQty) || !isNumber(invQty) || invQty <= 0){
message("选中的第"+(index+1)+"行\"库存数量\",不能为0!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGBG001", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let status= item.get("status");
if(isBlank(status) || status == 1){
message("选中的第"+(index+1)+"行\"已提交\",不能重复提交!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGBG001", "submit", true);
btnNode.attr("disabled", false);
}
});
}
}
/**
* 文件上传
*
* @param id
* @param bizType
*/
function uploadFile(id,bizType) {
JSColorbox.open({
href: "HGSB099?methodName=initLoad&inqu_status-0-matId="+id+"&inqu_status-0-bizType="+bizType,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
//callbackName: uploadFileCallback
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/9
Time: 15:04
To change this template use File | Settings | File Templates.
--%>
<!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" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script type="text/javascript" src="${ctx}/common/js/dayjs.min.js"></script>
<EF:EFPage title="办公用品台账">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="whCode" cname="仓库名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="itemType" cname="用品分类" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgbg.itemType" />
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="itemName" cname="用品名称" placeholder="模糊查询用品名称" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="itemModel" cname="用品型号" placeholder="模糊查询用品型号" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" queryMethod="query" autoBind="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whName" cname="仓库名称" hidden="true"/>
<EF:EFComboColumn ename="itemType" cname="用品分类" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hggp.hgbg.itemType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="itemCode" cname="用品编码" width="100" enable="false" readonly="true" align="center" required="false"/>
<EF:EFColumn ename="itemName" cname="用品名称" width="160" enable="true" readonly="false" align="center" required="true"/>
<EF:EFColumn ename="itemModel" cname="用品型号" width="120" enable="true" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="itemUnit" cname="用品单位" width="120" enable="true" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="invQty" cname="库存数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid = {
"result": {
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let BG002 = "BG002";
let template = "";
if (item.id) {
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="detailFunc(' + item.id + ')">详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px"'
+ ' onclick="uploadFile(' + item.id + ',\''+BG002+'\')" >附件清单</a>';
}
return template;
}
}
],
loadComplete: function(grid) {
// 此 grid 对象
$("#QUERY").on("click", function () {
grid.dataSource.page(1);
});
$("#BTN_INSERT").on("click",addFunc);
$("#BTN_UPDATE").on("click",updateFunc);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
},
onAdd: function (e) {
$.each(e.items, function (index, item) {
item['depositDate'] = currShortDate()
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
//e.preventDefault();
//let btnNode = $(this);
//禁用按钮
//btnNode.attr("disabled", true);
//btnSaveFunc(btnNode);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
}
};
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
grid.closeCell();
}
})
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
function detailFunc(id) {
JSColorbox.open({
href: "HGBG002A?methodName=initLoad&inqu_status-0-parentId=" + id + "&efParentFormEname=HGBG002",
title: "<div style='text-align: center;'>办公入库详情</div>",
width: "80%",
height: "80%",
callbackName: windowCallback
});
}
/**
* 新增
*/
function addFunc() {
JSColorbox.open({
href: "HGBG002B?methodName=initLoad&efParentFormEname=HGBG002",
title: "<div style='text-align: center;'>新增办公入库</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
/**
* 修改
*/
function updateFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
if (rows[0].status == "3") {
message("已经提交的数据不能进行修改!");
return;
}
JSColorbox.open({
href: "HGBG002C?methodName=initLoad&inqu_status-0-id=" + rows[0].id + "&efParentFormEname=HGBG002",
title: "<div style='text-align: center;'>修改办公入库</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function deleteFunc(){
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
let flag = true;
if (flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGBG002", "delete", true,
function (e) {
var status = e.getStatus();
if (status !== -1) {
NotificationUtil(e.msg);
query();
}else {
NotificationUtil(e.msg, "error");
}
}
);
}
});
}
}
/**
* 文件上传
*
* @param id 业务主键
* @param bizType 业务类型
*/
function uploadFile(id,bizType) {
JSColorbox.open({
href: "HGSB099?methodName=initLoad&inqu_status-0-matId="+id+"&inqu_status-0-bizType="+bizType,
title: "<div style='text-align: center;'>附件清单</div>",
width: "60%",
height: "50%",
//callbackName: uploadFileCallback
});
}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/9
Time: 15:04
To change this template use File | Settings | File Templates.
--%>
<!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" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script type="text/javascript" src="${ctx}/common/js/dayjs.min.js"></script>
<EF:EFPage title="办公用品入库">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker blockId="inqu_status" row="0" ename="sellDate" cname="入库日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="clientName" cname="仓库名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="sellUser" cname="入库人员" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="depositDate" cname="入库日期" width="120" enable="true" readonly="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="depositCode" cname="入库单号" width="100" enable="false" readonly="true" align="center" required="false"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whName" cname="仓库名称" hidden="true"/>
<EF:EFComboColumn ename="depositUser" cname="入库人员" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" defaultValue="${loginName}"
maxLength="16" width="100" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="120" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="140" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid = {
"result": {
columns: [
],
loadComplete: function(grid) {
// 此 grid 对象
$("#QUERY").on("click", function () {
grid.dataSource.page(1);
});
$("#SUBMIT").on("click", submitFunc)
},
}
};
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
grid.closeCell();
}
})
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let status= item.get("status");
if(isBlank(status) || status == 3){
message("选中的第"+(index+1)+"行\"已审批\",不能重复审批!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGBG002A", "submit", true,
function (ei) {
if (ei.getStatus() != -1){
query();
}
});
}
});
}
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/9
Time: 15:05
To change this template use File | Settings | File Templates.
--%>
<!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" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script type="text/javascript" src="${ctx}/common/js/dayjs.min.js"></script>
<EF:EFPage title="办公用品入库明细">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="父级ID" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="itemName" cname="用品名称" placeholder="模糊查询用品名称" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="itemModel" cname="用品型号" placeholder="模糊查询用品型号" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="审批状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus" condition="ITEM_CODE IN ('2','3')"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="itemCode" cname="用品编码" width="100" enable="false" readonly="true" align="center" required="false"/>
<EF:EFColumn ename="itemName" cname="用品名称" width="160" enable="true" readonly="false" align="center" required="true"/>
<EF:EFComboColumn ename="itemType" cname="用品分类" width="80" align="center" readonly="false" required="true" defaultValue="1">
<EF:EFCodeOption codeName="hggp.hgbg.itemType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="itemModel" cname="用品型号" width="120" enable="true" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="itemUnit" cname="用品单位" width="120" enable="true" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="invQty" cname="入库数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFComboColumn ename="status" cname="审批状态" width="80" align="center" readonly="false" required="true" defaultValue="2">
<EF:EFCodeOption codeName="hggp.cw.reviewStatus" condition="ITEM_CODE IN ('2','3')"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
var itemCodeBox = __eiInfo.getBlock("itemCode_block_id").getMappedRows();
$("#result-0-depositDate").val(currShortDate());
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.detail = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
{
field: "itemCode",
filter: function (options) {
let whCode = $("#result-0-whCode").val();
if (whCode){
return _.filter(itemCodeBox, function (item) {
return item["param5Field"]==whCode ;
})
}
return options.values;
},
template: function (item) {
for (let i = 0; i < itemCodeBox.length; i++) {
if (itemCodeBox[i]['valueField'] === item['itemCode']){
return itemCodeBox[i]['textField'].split("-")[0];
}
}
return item["itemCode"]
}
}
],
loadComplete: function (grid) {
grid.dataSource.bind("change", function(e) {
let item = e.items[0];
if (e.field === "itemCode") {
for (let i = 0; i < itemCodeBox.length; i++) {
if (itemCodeBox[i]['valueField'] === item['itemCode']) {
detailGrid.setCellValue(item,"itemName",itemCodeBox[i]['textField'].split("-")[0]);
detailGrid.setCellValue(item,"itemModel",itemCodeBox[i]['param1Field']);
detailGrid.setCellValue(item,"itemType",itemCodeBox[i]['param2Field']);
detailGrid.setCellValue(item,"itemUnit",itemCodeBox[i]['param3Field']);
break;
}
}
}
});
},
onAdd: function (e) {
let whCode = $("#result-0-whCode").val();
if (isBlank(whCode)) {
message("请选择仓库名称!");
e.preventDefault();
}
},
onSave: function (e) {
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFileFunc();
}
}
$("#DELETE_FILE").on("click", function () {
deleteFileFunc();
});
/**
* 下拉框事件
*/
IPLATUI.EFSelect = {
"result-0-whCode": {
// 点击下拉选项时触发
select: function (e) { //获取勾选值
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
var textField = "";
if (valueField) {
textField = dataItem['textField'];
$("#result-0-whCode").val(valueField);
$("#result-0-whName").val(textField);
}
}
}
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.close();
}
function btnSaveFunc() {
let flag = true;
flag = fieldValidation();
let rows = detailGrid.getDataItems();
if (rows.length < 1) {
message("请添加数据");
return false;
}
$.each(rows, function(index, item) {
let itemCode= item.get("itemCode");
if(isBlank(itemCode)){
message("选中的第"+(index+1)+"行\"用品名称\"不能为空!");
flag = false;
return false;
}
let invQty= item.get("invQty");
if(isBlank(invQty) || !isNumber(invQty) || invQty <= 0){
message("选中的第"+(index+1)+"行\"入库数量\"不能为0!");
flag = false;
return false;
}
})
if(flag)
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail", "HGBG002", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
}
});
}
function deleteFileFunc() {
let rows = detailGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
rows.forEach(function (row) {
detailGrid.removeRows([row.rowNo]);// 刷新行号
})
refreshRowNo();
}
let refreshRowNo = function () {
let allRows = detailGrid.getDataItems();
for (let i = 0; i < allRows.length; i++) {
detailGrid.setCellValue(i, "rowNo", i);
detailGrid.refresh();
}
}
function fieldValidation() {
var depositDate = $("#result-0-depositDate").val();
if (isBlank(depositDate)) {
message("请选择入库日期!");
return false;
}
var whCode = $("#result-0-whCode").val();
if (isBlank(whCode)) {
message("请选择仓库名称!");
return false;
}
var depositUser = $("#result-0-depositUser").val();
if (isBlank(depositUser)) {
message("入库人员不能为空!");
return false;
}
return true;
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/9
Time: 15:05
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="新增办公用品入库">
<EF:EFRegion id="inqu1" title="基本信息">
<div class="row">
<EF:EFDatePicker ename="result-0-depositDate" cname="入库日期" colWidth="3" required="true"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFSelect cname="仓库名称" ename="result-0-whCode" colWidth="3" required="true" filter="contains">
<EF:EFOption label="请选择仓库" value=""/>
<EF:EFOptions blockId="wh_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-whName" cname="仓库名称" colWidth="3" readonly="true" type="hidden"/>
<EF:EFInput ename="result-0-depositCode" cname="入库单号" colWidth="3" readonly="true" defaultValue="0"/>
<EF:EFSelect ename="result-0-depositUser" cname="入库人员" colWidth="3" filter="contains"
required="true" defaultValue="${loginName}">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="detail" title="记录详情">
<EF:EFGrid blockId="detail" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="itemCode" cname="用品名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="itemCode_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="itemName" cname="用品名称" hidden="true"/>
<EF:EFComboColumn ename="itemType" cname="用品分类" width="80" enable="false" align="center" readonly="false">
<EF:EFCodeOption codeName="hggp.hgbg.itemType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="itemModel" cname="用品型号" width="120" enable="false" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="itemUnit" cname="用品单位" width="120" enable="false" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="invQty" cname="入库数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFComboColumn ename="status" cname="审批状态" width="80" align="center" readonly="false" required="true" defaultValue="2" hidden="true">
<EF:EFCodeOption codeName="hggp.cw.reviewStatus" condition="ITEM_CODE IN ('2','3')"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
\ No newline at end of file
$(function() {
var itemCodeBox = __eiInfo.getBlock("itemCode_block_id").getMappedRows();
$("#result-0-sellDate").val(currShortDate())
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.detail = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
{
field: "itemCode",
filter: function (options) {
let whCode = $("#result-0-whCode").val();
if (whCode){
return _.filter(itemCodeBox, function (item) {
return item["param5Field"]==whCode ;
})
}
return options.values;
},
template: function (item) {
for (let i = 0; i < itemCodeBox.length; i++) {
if (itemCodeBox[i]['valueField'] === item['itemCode']){
return itemCodeBox[i]['textField'].split("-")[0];
}
}
return item["itemCode"]
}
}
],
loadComplete: function (grid) {
grid.dataSource.bind("change", function(e) {
let item = e.items[0];
if (e.field === "itemCode") {
for (let i = 0; i < itemCodeBox.length; i++) {
if (itemCodeBox[i]['valueField'] === item['itemCode']) {
detailGrid.setCellValue(item,"itemName",itemCodeBox[i]['textField'].split("-")[0]);
detailGrid.setCellValue(item,"itemModel",itemCodeBox[i]['param1Field']);
detailGrid.setCellValue(item,"itemType",itemCodeBox[i]['param2Field']);
detailGrid.setCellValue(item,"itemUnit",itemCodeBox[i]['param3Field']);
break;
}
}
}
});
},
onAdd: function (e) {
let whCode = $("#result-0-whCode").val();
if (isBlank(whCode)) {
message("请选择仓库名称!");
e.preventDefault();
}
},
onSave: function (e) {
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteResult1Func();
}
}
$("#DELETE_FILE").on("click", function () {
deleteFileFunc();
});
/**
* 下拉框事件
*/
IPLATUI.EFSelect = {
"result-0-whCode": {
// 点击下拉选项时触发
select: function (e) { //获取勾选值
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
var textField = "";
if (valueField) {
textField = dataItem['textField'];
$("#result-0-whCode").val(valueField);
$("#result-0-whName").val(textField);
}
}
}
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function btnSaveFunc() {
let flag = true;
flag = fieldValidation();
let rows = detailGrid.getDataItems();
if (rows.length < 1) {
message("请添加数据");
return false;
}
$.each(rows, function(index, item) {
let itemCode= item.get("itemCode");
if(isBlank(itemCode)){
message("选中的第"+(index+1)+"行\"用品名称\"不能为空!");
flag = false;
return false;
}
let invQty= item.get("invQty");
if(isBlank(invQty) || !isNumber(invQty) || invQty <= 0){
message("选中的第"+(index+1)+"行\"入库数量\"不能为0!");
flag = false;
return false;
}
let status= item.get("status");
if(status == 3){
message("选中的第"+(index+1)+"行\"审批状态\"已提交,无法操作");
flag = false;
return false;
}
})
if(flag)
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail", "HGBG002", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
}
});
}
function deleteFileFunc() {
let rows = detailGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
rows.forEach(function (row) {
detailGrid.removeRows([row.rowNo]);// 刷新行号
})
refreshRowNo();
}
let refreshRowNo = function () {
let allRows = detailGrid.getDataItems();
for (let i = 0; i < allRows.length; i++) {
detailGrid.setCellValue(i, "rowNo", i);
detailGrid.refresh();
}
}
function deleteResult1Func() {
let rows = detailGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
flag = fieldValidation();
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("detail", "HGBG002C", "delete", true,
function (ei) {
if (ei.getStatus() >= 0) {
detailGrid.dataSource.page(1);
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
})
}
});
}
}
function fieldValidation() {
var depositDate = $("#result-0-depositDate").val();
if (isBlank(depositDate)) {
message("请选择入库日期!");
return false;
}
var whCode = $("#result-0-whCode").val();
if (isBlank(whCode)) {
message("请选择仓库名称!");
return false;
}
var depositUser = $("#result-0-depositUser").val();
if (isBlank(depositUser)) {
message("入库人员不能为空!");
return false;
}
return true;
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/9
Time: 15:06
To change this template use File | Settings | File Templates.
--%>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="修改办公用品入库">
<EF:EFRegion id="inqu1" title="基本信息">
<div class="row">
<EF:EFInput ename="result-0-id" cname="id" type="hidden"/>
<EF:EFDatePicker ename="result-0-depositDate" cname="入库日期" colWidth="4" required="true"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFInput ename="result-0-depositCode" cname="入库单号" colWidth="4" readonly="true" defaultValue="0"/>
<EF:EFSelect cname="仓库名称" ename="result-0-whCode" colWidth="4" required="true" filter="contains" readonly="true">
<EF:EFOption label="请选择仓库" value=""/>
<EF:EFOptions blockId="wh_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-whName" cname="仓库名称" colWidth="4" readonly="true" type="hidden"/>
<EF:EFSelect ename="result-0-depositUser" cname="入库人员" colWidth="4" filter="contains"
required="true" defaultValue="${loginName}">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="detail" title="记录详情">
<EF:EFGrid blockId="detail" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="parentId" cname="父级ID" hidden="true"/>
<EF:EFComboColumn ename="itemCode" cname="用品名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="itemCode_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="itemName" cname="用品名称" hidden="true"/>
<EF:EFComboColumn ename="itemType" cname="用品分类" width="80" enable="false" align="center" readonly="false" required="true">
<EF:EFCodeOption codeName="hggp.hgbg.itemType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="itemModel" cname="用品型号" width="120" enable="false" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="itemUnit" cname="用品单位" width="120" enable="false" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="invQty" cname="入库数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFComboColumn ename="status" cname="审批状态" width="80" align="center" readonly="false" required="true" defaultValue="2">
<EF:EFCodeOption codeName="hggp.cw.reviewStatus" condition="ITEM_CODE IN ('2','3')"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid = {
"result": {
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let BG003 = "BG003";
let template = "";
if (item.id) {
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="detailFunc(' + item.id + ')">详情</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px"'
+ ' onclick="uploadFile(' + item.id + ',\''+BG003+'\')" >附件清单</a>';
}
return template;
}
}
],
loadComplete: function(grid) {
// 此 grid 对象
$("#QUERY").on("click", function () {
grid.dataSource.page(1);
});
$("#BTN_INSERT").on("click",addFunc);
$("#BTN_UPDATE").on("click",updateFunc);
},
onAdd: function (e) {
$.each(e.items, function (index, item) {
item['sellDate'] = currShortDate()
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
//e.preventDefault();
//let btnNode = $(this);
//禁用按钮
//btnNode.attr("disabled", true);
//btnSaveFunc(btnNode);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
}
};
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
grid.closeCell();
}
})
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
function detailFunc(id) {
JSColorbox.open({
href: "HGBG003A?methodName=initLoad&&inqu_status-0-parentId=" + id + "&efParentFormEname=HGBG003",
title: "<div style='text-align: center;'>详情</div>",
width: "80%",
height: "80%",
callbackName: windowCallback
});
}
/**
* 新增
*/
function addFunc() {
JSColorbox.open({
href: "HGBG003B?methodName=initLoad&efParentFormEname=HGBG003",
title: "<div style='text-align: center;'>新增办公用品领用</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
/**
* 修改
*/
function updateFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length != 1) {
message("请选择一条数据");
return;
}
if (rows[0].status == "3") {
message("已经提交的数据不能进行修改!");
return;
}
JSColorbox.open({
href: "HGBG003C?methodName=initLoad&inqu_status-0-id=" + rows[0].id + "&efParentFormEname=HGBG003",
title: "<div style='text-align: center;'>修改办公用品领用</div>",
width: "90%",
height: "90%",
callbackName: windowCallback
});
}
function deleteFunc(){
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据")
return;
}
let flag = true;
if (flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGBG003", "delete", true,
function (e) {
var status = e.getStatus();
if (status !== -1) {
NotificationUtil(e.msg);
query();
}else {
NotificationUtil(e.msg, "error");
}
btnNode.attr("disabled", false);
}
);
}
});
}
}
/**
* 文件上传
*
* @param id 业务主键
* @param bizType 业务类型
*/
function uploadFile(id,bizType) {
JSColorbox.open({
href: "HGSB099?methodName=initLoad&inqu_status-0-matId="+id+"&inqu_status-0-bizType="+bizType,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
//callbackName: uploadFileCallback
});
}
function windowCallback() {
// 刷新列表
resultGrid.dataSource.page(1);
// 关闭弹窗
JSColorbox.close();
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/9
Time: 15:06
To change this template use File | Settings | File Templates.
--%>
<!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" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script type="text/javascript" src="${ctx}/common/js/dayjs.min.js"></script>
<EF:EFPage title="办公用品领用">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFDatePicker blockId="inqu_status" row="0" ename="receiveDate" cname="领用日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="whCode" cname="仓库名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="receiveUser" cname="领用人员" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="single">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="receiveDate" cname="领用日期" width="120" enable="true" readonly="true" align="center" editType="date"
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="receiveCode" cname="领用单号" width="100" enable="false" readonly="true" align="center" required="false"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" width="100" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whName" cname="仓库名称" hidden="true"/>
<EF:EFComboColumn ename="receiveUser" cname="领用人员" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" defaultValue="${loginName}"
maxLength="16" width="100" readonly="false" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="120" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="140" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
// 查询
$("#QUERY").on("click", function () {
query();
});
IPLATUI.EFGrid = {
"result": {
columns: [
],
loadComplete: function(grid) {
// 此 grid 对象
$("#QUERY").on("click", function () {
grid.dataSource.page(1);
});
$("#SUBMIT").on("click", submitFunc)
},
}
};
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
grid.closeCell();
}
})
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
resultGrid.dataSource.page(1);
}
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let status= item.get("status");
if(isBlank(status) || status == 3){
message("选中的第"+(index+1)+"行\"已审批\",不能重复审批!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGBG003A", "submit", true,
function (ei) {
if (ei.getStatus() != -1){
query();
}
});
}
});
}
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/9
Time: 15:06
To change this template use File | Settings | File Templates.
--%>
<!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" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script type="text/javascript" src="${ctx}/common/js/dayjs.min.js"></script>
<EF:EFPage title="办公用品领用明细">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="父级ID" type="hidden"/>
<EF:EFInput blockId="inqu_status" row="0" ename="itemName" cname="用品名称" placeholder="模糊查询用品名称" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="itemModel" cname="用品型号" placeholder="模糊查询用品型号" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="审批状态" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.reviewStatus" condition="ITEM_CODE IN ('2','3')"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="itemCode" cname="用品编码" width="100" enable="false" readonly="true" align="center" required="false"/>
<EF:EFColumn ename="itemName" cname="用品名称" width="160" enable="true" readonly="false" align="center" required="true"/>
<EF:EFComboColumn ename="itemType" cname="用品分类" width="80" align="center" readonly="false" required="true" >
<EF:EFCodeOption codeName="hggp.hgbg.itemType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="itemModel" cname="用品型号" width="120" enable="true" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="itemUnit" cname="用品单位" width="120" enable="true" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="receiveQty" cname="领用数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFComboColumn ename="status" cname="审批状态" width="80" align="center" readonly="false" required="true" defaultValue="2">
<EF:EFCodeOption codeName="hggp.cw.reviewStatus" condition="ITEM_CODE IN ('2','3')"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function() {
var itemCodeBox = __eiInfo.getBlock("itemCode_block_id").getMappedRows();
$("#result-0-receiveDate").val(currShortDate());
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.detail = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
{
field: "itemCode",
filter: function (options) {
let whCode = $("#result-0-whCode").val();
if (whCode){
return _.filter(itemCodeBox, function (item) {
return item["param5Field"]==whCode ;
})
}
return options.values;
},
template: function (item) {
for (let i = 0; i < itemCodeBox.length; i++) {
if (itemCodeBox[i]['valueField'] === item['itemCode']){
return itemCodeBox[i]['textField'].split("-")[0];
}
}
return item["itemCode"]
}
}
],
loadComplete: function (grid) {
grid.dataSource.bind("change", function(e) {
let item = e.items[0];
if (e.field === "itemCode") {
for (let i = 0; i < itemCodeBox.length; i++) {
if (itemCodeBox[i]['valueField'] === item['itemCode']) {
detailGrid.setCellValue(item,"itemName",itemCodeBox[i]['textField'].split("-")[0]);
detailGrid.setCellValue(item,"itemModel",itemCodeBox[i]['param1Field']);
detailGrid.setCellValue(item,"itemType",itemCodeBox[i]['param2Field']);
detailGrid.setCellValue(item,"itemUnit",itemCodeBox[i]['param3Field']);
break;
}
}
}
});
},
onAdd: function (e) {
let whCode = $("#result-0-whCode").val();
if (isBlank(whCode)) {
message("请选择仓库名称!");
e.preventDefault();
}
},
onSave: function (e) {
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFileFunc();
}
}
$("#DELETE_FILE").on("click", function () {
deleteFileFunc();
});
/**
* 下拉框事件
*/
IPLATUI.EFSelect = {
"result-0-whCode": {
// 点击下拉选项时触发
select: function (e) { //获取勾选值
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
var textField = "";
if (valueField) {
textField = dataItem['textField'];
$("#result-0-whCode").val(valueField);
$("#result-0-whName").val(textField);
}
}
}
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.close();
}
function btnSaveFunc() {
let flag = true;
flag = fieldValidation();
let rows = detailGrid.getDataItems();
$.each(rows, function(index, item) {
let itemCode= item.get("itemCode");
if(isBlank(itemCode)){
message("选中的第"+(index+1)+"行\"用品名称\"不能为空!");
flag = false;
return false;
}
let invQty= item.get("receiveQty");
if(isBlank(invQty) || !isNumber(invQty) || invQty <= 0){
message("选中的第"+(index+1)+"行\"入库数量\"不能为0!");
flag = false;
return false;
}
})
if(flag)
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail", "HGBG003", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
}
});
}
function deleteFileFunc() {
let rows = detailGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
rows.forEach(function (row) {
detailGrid.removeRows([row.rowNo]);// 刷新行号
})
refreshRowNo();
}
let refreshRowNo = function () {
let allRows = detailGrid.getDataItems();
for (let i = 0; i < allRows.length; i++) {
detailGrid.setCellValue(i, "rowNo", i);
detailGrid.refresh();
}
}
function fieldValidation() {
var receiveDate = $("#result-0-receiveDate").val();
if (isBlank(receiveDate)) {
message("请选择领用日期!");
return false;
}
var whCode = $("#result-0-whCode").val();
if (isBlank(whCode)) {
message("请选择仓库名称!");
return false;
}
var receiveUser = $("#result-0-receiveUser").val();
if (isBlank(receiveUser)) {
message("领用人员不能为空!");
return false;
}
return true;
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/9
Time: 15:07
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="新增办公用品领用">
<EF:EFRegion id="inqu" title="基本信息">
<div class="row">
<EF:EFDatePicker ename="result-0-receiveDate" cname="领用日期" colWidth="4" required="true"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFSelect cname="仓库名称" ename="result-0-whCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="请选择仓库" value=""/>
<EF:EFOptions blockId="wh_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-whName" cname="仓库名称" colWidth="4" readonly="true" type="hidden"/>
<EF:EFInput ename="result-0-receiveCode" cname="领用单号" colWidth="4" readonly="true" defaultValue="0"/>
<EF:EFSelect ename="result-0-receiveUser" cname="领用人员" colWidth="4" filter="contains"
required="true" defaultValue="${loginName}">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="detail" title="记录详情">
<EF:EFGrid blockId="detail" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="itemCode" cname="用品名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="itemCode_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="itemName" cname="用品名称" hidden="true"/>
<EF:EFComboColumn ename="itemType" cname="用品分类" width="80" enable="false" align="center" readonly="false" required="true">
<EF:EFCodeOption codeName="hggp.hgbg.itemType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="itemModel" cname="用品型号" width="120" enable="false" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="itemUnit" cname="用品单位" width="120" enable="false" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="receiveQty" cname="领用数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFComboColumn ename="status" cname="审批状态" width="80" enable="false" align="center" readonly="false" required="true" defaultValue="2">
<EF:EFCodeOption codeName="hggp.cw.reviewStatus" condition="ITEM_CODE IN ('2','3')"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
$(function() {
var itemCodeBox = __eiInfo.getBlock("itemCode_block_id").getMappedRows();
$("#result-0-sellDate").val(currShortDate())
$("#result-0-whCode").change(function () {
let textField = IPLAT.EFSelect.text($("#result-0-whCode"));
$("#result-0-whName").val(textField);
})
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
btnSaveFunc();
});
IPLATUI.EFGrid.detail = {
pageable: {
pageSize: 20,
pageSizes: [10,20,30,50,100,200],
},
columns: [
{
field: "itemCode",
filter: function (options) {
let whCode = $("#result-0-whCode").val();
if (whCode){
return _.filter(itemCodeBox, function (item) {
return item["param5Field"]==whCode ;
})
}
return options.values;
},
template: function (item) {
for (let i = 0; i < itemCodeBox.length; i++) {
if (itemCodeBox[i]['valueField'] === item['itemCode']){
return itemCodeBox[i]['textField'].split("-")[0];
}
}
return item["itemCode"]
}
}
],
loadComplete: function (grid) {
grid.dataSource.bind("change", function(e) {
let item = e.items[0];
if (e.field === "itemCode") {
for (let i = 0; i < itemCodeBox.length; i++) {
if (itemCodeBox[i]['valueField'] === item['itemCode']) {
detailGrid.setCellValue(item,"itemName",itemCodeBox[i]['textField'].split("-")[0]);
detailGrid.setCellValue(item,"itemModel",itemCodeBox[i]['param1Field']);
detailGrid.setCellValue(item,"itemType",itemCodeBox[i]['param2Field']);
detailGrid.setCellValue(item,"itemUnit",itemCodeBox[i]['param3Field']);
break;
}
}
}
});
},
onAdd: function (e) {
let whCode = $("#result-0-whCode").val();
if (isBlank(whCode)) {
message("请选择仓库名称!");
e.preventDefault();
}
},
onSave: function (e) {
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteResult1Func();
}
}
$("#DELETE_FILE").on("click", function () {
deleteFileFunc();
});
/**
* 下拉框事件
*/
IPLATUI.EFSelect = {
"result-0-whCode": {
// 点击下拉选项时触发
select: function (e) { //获取勾选值
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
var textField = "";
if (valueField) {
textField = dataItem['textField'];
$("#result-0-whCode").val(valueField);
$("#result-0-whName").val(textField);
}
}
}
}
window.document.addEventListener("keyup",function (event) {
if(event.keyCode === 13){
var grid = $("#ef_grid_result").data("kendoGrid");
// 回填
//grid.addRows(returnRows);
grid.closeCell();
}
})
});
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.setValueCallback();
}
function btnSaveFunc() {
let flag = true;
flag = fieldValidation();
let rows = detailGrid.getDataItems();
if (rows.length < 1) {
message("请添加数据");
return false;
}
$.each(rows, function(index, item) {
let itemCode= item.get("itemCode");
if(isBlank(itemCode)){
message("选中的第"+(index+1)+"行\"用品名称\"不能为空!");
flag = false;
return false;
}
let invQty= item.get("receiveQty");
if(isBlank(invQty) || !isNumber(invQty) || invQty <= 0){
message("选中的第"+(index+1)+"行\"领用数量\"不能为0!");
flag = false;
return false;
}
let status= item.get("status");
if(status == 3){
message("选中的第"+(index+1)+"行\"审批状态\"已提交,无法操作");
flag = false;
return false;
}
})
if(flag)
JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGrid("detail", "HGBG003", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
}
});
}
function deleteFileFunc() {
let rows = detailGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
rows.forEach(function (row) {
detailGrid.removeRows([rows.rowNo]);// 刷新行号
})
refreshRowNo();
}
let refreshRowNo = function () {
let allRows = detailGrid.getDataItems();
for (let i = 0; i < allRows.length; i++) {
detailGrid.setCellValue(i, "rowNo", i);
detailGrid.refresh();
}
}
function deleteResult1Func() {
let rows = detailGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
flag = fieldValidation();
if(flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("detail", "HGBG003C", "delete", true,
function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
})
}
});
}
}
function fieldValidation() {
var depositDate = $("#result-0-receiveDate").val();
if (isBlank(depositDate)) {
message("请选择领用日期!");
return false;
}
var whCode = $("#result-0-whCode").val();
if (isBlank(whCode)) {
message("请选择仓库名称!");
return false;
}
var depositUser = $("#result-0-receiveUser").val();
if (isBlank(depositUser)) {
message("领用人员不能为空!");
return false;
}
return true;
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/9
Time: 15:07
To change this template use File | Settings | File Templates.
--%>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script>
var ctx = "${ctx}";
</script>
<EF:EFPage title="修改办公用品领用">
<EF:EFRegion id="inqu" title="基本信息">
<div class="row">
<EF:EFInput ename="result-0-id" cname="id" type="hidden"/>
<EF:EFDatePicker ename="result-0-receiveDate" cname="领用日期" colWidth="4" required="true"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFInput ename="result-0-receiveCode" cname="领用单号" colWidth="4" readonly="true" defaultValue="0"/>
<EF:EFSelect cname="仓库名称" ename="result-0-whCode" colWidth="4" required="true" filter="contains">
<EF:EFOption label="请选择仓库" value=""/>
<EF:EFOptions blockId="wh_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-whName" cname="仓库名称" colWidth="4" readonly="true" type="hidden"/>
<EF:EFSelect ename="result-0-receiveUser" cname="领用人员" colWidth="4" filter="contains"
required="true" defaultValue="${loginName}">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion id="detail" title="记录详情">
<EF:EFGrid blockId="detail" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="parentId" cname="父级ID" hidden="true"/>
<EF:EFComboColumn ename="itemCode" cname="用品名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="itemCode_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="itemName" cname="用品名称" hidden="true"/>
<EF:EFComboColumn ename="itemType" cname="用品分类" width="80" align="center" readonly="false" required="true">
<EF:EFCodeOption codeName="hggp.hgbg.itemType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="itemModel" cname="用品型号" width="120" enable="true" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="itemUnit" cname="用品单位" width="120" enable="true" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="receiveQty" cname="领用数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFComboColumn ename="status" cname="审批状态" width="80" align="center" readonly="false" required="true" defaultValue="2">
<EF:EFCodeOption codeName="hggp.cw.reviewStatus" condition="ITEM_CODE IN ('2','3')"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;">
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div>
</EF:EFPage>
$(function () {
var whRecordBox = __eiInfo.getBlock("wh_record_block_id").getMappedRows();
var itemCodeBox = __eiInfo.getBlock("itemCode_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let BG004 = "BG004";
let template = "";
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px"'
+ ' onclick="uploadFile(' + item.id + ',\''+BG004+'\')" >附件清单</a>';
}
return template;
}
}, {
field: "itemCode",
filter: function (options) {
let whCode = options.model["whCode"];
if (whCode){
return _.filter(itemCodeBox, function (item) {
return item["param5Field"]==whCode ;
})
}
return options.values;
},
template: function (item) {
for (let i = 0; i < itemCodeBox.length; i++) {
if (itemCodeBox[i]['valueField'] === item['itemCode']){
return itemCodeBox[i]['textField'].split("-")[0];
}
}
return item["itemCode"]
}
}
],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
let item = e.items[0];
if (e.field === "whCode") {
for (let i = 0; i < whRecordBox.length; i++) {
if (whRecordBox[i]['valueField'] === item['whCode']) {
resultGrid.setCellValue(item,"whName",whRecordBox[i]['textField']);
break;
}
}
}
if (e.field === "itemCode") {
for (let i = 0; i < itemCodeBox.length; i++) {
if (itemCodeBox[i]['valueField'] === item['itemCode']) {
resultGrid.setCellValue(item,"itemName",itemCodeBox[i]['textField'].split("-")[0]);
resultGrid.setCellValue(item,"itemModel",itemCodeBox[i]['param1Field']);
resultGrid.setCellValue(item,"itemType",itemCodeBox[i]['param2Field']);
resultGrid.setCellValue(item,"itemUnit",itemCodeBox[i]['param3Field']);
resultGrid.setCellValue(item,"paperQty",itemCodeBox[i]['param4Field']);
if (isBlank(item['whCode'])){
resultGrid.setCellValue(item,"whCode",itemCodeBox[i]['param5Field']);
resultGrid.setCellValue(item,"whName",itemCodeBox[i]['param6Field']);
}
break;
}
}
}
if (e.field === "actualQty"){
let proLossQty = item['actualQty'] - item['paperQty'];
resultGrid.setCellValue(item,"proLossQty",proLossQty);
}
});
$("#SUBMIT").on("click", submitFunc)
},
onAdd: function (e) {
$.each(e.items, function (index, item) {
item['takeStockDate'] = currShortDate()
});
},
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) {
}
}
}
//工厂类型下拉联动
$('input[name="inqu_status-0-factoryCode"]').change(function () {
var inInfo=new EiInfo();
var factoryCode=$("#inqu_status-0-factoryCode").val();
inInfo.set("factoryCode",factoryCode);
inInfo.set("groupType","prodGroup");
EiCommunicator.send("HGSB003", "queryFactoryCode", inInfo, {
onSuccess: function (ei) {
var input=$("#inqu_status-0-groupCode");
let dataEdition=ei.getBlock("groupCodeBox_block_id").getMappedRows();
input.kendoDropDownList({
valuePrimitive: true,
dataTextField: "textField",
dataValueField: "valueField",
optionLabel:"请选择",
dataSource: dataEdition,
template: "#=textField#"
});
}, onFail: function (ei) {
}
}, {async: false});
});
downKeyUp();
});
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 whCode= item.get("whCode");
let itemName= item.get("itemName");
let actualQty= item.get("actualQty");
if(isBlank(whCode)){
message("选中的第"+(index+1)+"行\"仓库名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(itemName)){
message("选中的第"+(index+1)+"行\"用品名称\",不能为空!");
flag = false;
return false;
}
if(isBlank(actualQty) || !isNumber(actualQty)){
message("选中的第"+(index+1)+"行\"实际数量\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGBG004", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
function submitFunc() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let status= item.get("status");
if(isBlank(status) || status == 3){
message("选中的第"+(index+1)+"行\"已审批\",不能重复审批!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGBG004", "submit", true,
function (e) {
if (ei.getStatus() != -1){
query();
}
});
}
});
}
}
/**
* 文件上传
*
* @param id
* @param bizType
*/
function uploadFile(id,bizType) {
JSColorbox.open({
href: "HGSB099?methodName=initLoad&inqu_status-0-matId="+id+"&inqu_status-0-bizType="+bizType,
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
//callbackName: uploadFileCallback
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/9
Time: 15:07
To change this template use File | Settings | File Templates.
--%>
<!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" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script type="text/javascript" src="${ctx}/common/js/dayjs.min.js"></script>
<EF:EFPage title="办公用品盘点">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="whCode" cname="仓库名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect blockId="inqu_status" row="0" ename="itemType" cname="用品分类" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgbg.itemType" />
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="itemName" cname="用品名称" placeholder="模糊查询用品名称" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="itemModel" cname="用品型号" placeholder="模糊查询用品型号" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" queryMethod="query" autoBind="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<%--blockName="factoryCodeBox_block_id"--%>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="takeStockDate" cname="盘点日期" width="120" enable="true" readonly="true" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFComboColumn ename="whCode" cname="仓库名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="wh_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="whName" cname="仓库名称" hidden="true"/>
<EF:EFComboColumn ename="itemCode" cname="用品名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="120" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="itemCode_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="itemName" cname="用品名称" hidden="true"/>
<EF:EFColumn ename="itemModel" cname="用品型号" width="120" enable="false" readonly="true" align="center" required="true"/>
<EF:EFComboColumn ename="itemType" cname="用品分类" width="80" enable="false" align="center" readonly="false" required="true">
<EF:EFCodeOption codeName="hggp.hgbg.itemType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="itemUnit" cname="用品单位" width="120" enable="false" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="paperQty" cname="账面数量" width="120" enable="false" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="actualQty" cname="实际数量" width="120" enable="true" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="proLossQty" cname="盈亏数量" width="120" enable="false" format="{0:N0}" editType="text"
displayType="0" sort="true" align="right" maxLength="15" required="false" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置15位整数!"/>
<EF:EFColumn ename="stoLoca" cname="存放位置" width="120" enable="true" readonly="true" align="center" required="false"/>
<EF:EFComboColumn ename="takeStockUser" cname="盘点人员" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" defaultValue="${loginName}"
maxLength="16" width="100" readonly="false" required="false"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="status" cname="审批状态" width="80" align="center" readonly="false" required="true" defaultValue="2">
<EF:EFCodeOption codeName="hggp.cw.reviewStatus" condition="ITEM_CODE IN ('2', '3')"/>
</EF:EFComboColumn>
</EF:EFGrid>
</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