Commit 023d9c09 by 宋祥

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

parents c6adb2a7 b0416734
...@@ -39,6 +39,7 @@ public class HGBG002 extends DaoEPBase { ...@@ -39,6 +39,7 @@ public class HGBG002 extends DaoEPBase {
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/ public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/ public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_DEPOSIT_USER = "depositUser"; /* 入库人员*/ public static final String FIELD_DEPOSIT_USER = "depositUser"; /* 入库人员*/
public static final String FIELD_STATUS = "status"; /* 审批状态0.未审核1.已审核*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/
...@@ -62,6 +63,7 @@ public class HGBG002 extends DaoEPBase { ...@@ -62,6 +63,7 @@ public class HGBG002 extends DaoEPBase {
public static final String COUNT = "HGBG002.count"; public static final String COUNT = "HGBG002.count";
public static final String INSERT = "HGBG002.insert"; public static final String INSERT = "HGBG002.insert";
public static final String UPDATE = "HGBG002.update"; public static final String UPDATE = "HGBG002.update";
public static final String UPDATE_BY_STATUS = "HGBG002.updateBystatus";
public static final String DELETE = "HGBG002.delete"; public static final String DELETE = "HGBG002.delete";
public static final String DELETE_FLAG = "HGBG002.deleteFlag"; public static final String DELETE_FLAG = "HGBG002.deleteFlag";
...@@ -82,6 +84,7 @@ public class HGBG002 extends DaoEPBase { ...@@ -82,6 +84,7 @@ public class HGBG002 extends DaoEPBase {
private String whCode = " "; /* 仓库编码*/ private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/ private String whName = " "; /* 仓库名称*/
private String depositUser = " "; /* 入库人员*/ private String depositUser = " "; /* 入库人员*/
private Integer status = 2; /* 审批状态0.未审核1.已审核*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -158,6 +161,10 @@ public class HGBG002 extends DaoEPBase { ...@@ -158,6 +161,10 @@ public class HGBG002 extends DaoEPBase {
eiColumn.setDescName("入库人员"); eiColumn.setDescName("入库人员");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("审批状态0.未审核1.已审核");
eiMetadata.addMeta(eiColumn);
} }
...@@ -440,6 +447,23 @@ public class HGBG002 extends DaoEPBase { ...@@ -440,6 +447,23 @@ public class HGBG002 extends DaoEPBase {
public void setDepositUser(String depositUser) { public void setDepositUser(String depositUser) {
this.depositUser = depositUser; this.depositUser = depositUser;
} }
/**
* get the status - 审批状态0.未审核1.已审核.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 审批状态0.未审核1.已审核.
*
* @param status - 审批状态0.未审核1.已审核
*/
public void setStatus(Integer status) {
this.status = status;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -465,6 +489,7 @@ public class HGBG002 extends DaoEPBase { ...@@ -465,6 +489,7 @@ public class HGBG002 extends DaoEPBase {
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode)); setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName)); setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setDepositUser(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEPOSIT_USER)), depositUser)); setDepositUser(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEPOSIT_USER)), depositUser));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
} }
/** /**
...@@ -491,6 +516,7 @@ public class HGBG002 extends DaoEPBase { ...@@ -491,6 +516,7 @@ public class HGBG002 extends DaoEPBase {
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE))); map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME))); map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
map.put(FIELD_DEPOSIT_USER, StringUtils.toString(depositUser, eiMetadata.getMeta(FIELD_DEPOSIT_USER))); map.put(FIELD_DEPOSIT_USER, StringUtils.toString(depositUser, eiMetadata.getMeta(FIELD_DEPOSIT_USER)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
return map; return map;
} }
......
...@@ -64,7 +64,6 @@ public class HGBG002A extends DaoEPBase { ...@@ -64,7 +64,6 @@ public class HGBG002A extends DaoEPBase {
public static final String COUNT = "HGBG002A.count"; public static final String COUNT = "HGBG002A.count";
public static final String INSERT = "HGBG002A.insert"; public static final String INSERT = "HGBG002A.insert";
public static final String UPDATE = "HGBG002A.update"; public static final String UPDATE = "HGBG002A.update";
public static final String UPDATE_BY_STATUS = "HGBG002A.updateBystatus";
public static final String DELETE = "HGBG002A.delete"; public static final String DELETE = "HGBG002A.delete";
private Long id = new Long(0); private Long id = new Long(0);
......
...@@ -39,6 +39,7 @@ public class HGBG003 extends DaoEPBase { ...@@ -39,6 +39,7 @@ public class HGBG003 extends DaoEPBase {
public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/ public static final String FIELD_WH_CODE = "whCode"; /* 仓库编码*/
public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/ public static final String FIELD_WH_NAME = "whName"; /* 仓库名称*/
public static final String FIELD_RECEIVE_USER = "receiveUser"; /* 领用人员*/ public static final String FIELD_RECEIVE_USER = "receiveUser"; /* 领用人员*/
public static final String FIELD_STATUS = "status"; /* 审批状态0.未审核1.已审核*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 账套*/
...@@ -62,6 +63,7 @@ public class HGBG003 extends DaoEPBase { ...@@ -62,6 +63,7 @@ public class HGBG003 extends DaoEPBase {
public static final String COUNT = "HGBG003.count"; public static final String COUNT = "HGBG003.count";
public static final String INSERT = "HGBG003.insert"; public static final String INSERT = "HGBG003.insert";
public static final String UPDATE = "HGBG003.update"; public static final String UPDATE = "HGBG003.update";
public static final String UPDATE_BY_STATUS = "HGBG003.updateBystatus";
public static final String DELETE = "HGBG003.delete"; public static final String DELETE = "HGBG003.delete";
public static final String DELETE_FLAG = "HGBG003.deleteFlag"; public static final String DELETE_FLAG = "HGBG003.deleteFlag";
...@@ -82,6 +84,7 @@ public class HGBG003 extends DaoEPBase { ...@@ -82,6 +84,7 @@ public class HGBG003 extends DaoEPBase {
private String whCode = " "; /* 仓库编码*/ private String whCode = " "; /* 仓库编码*/
private String whName = " "; /* 仓库名称*/ private String whName = " "; /* 仓库名称*/
private String receiveUser = " "; /* 领用人员*/ private String receiveUser = " "; /* 领用人员*/
private Integer status = 2; /* 审批状态0.未审核1.已审核*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -158,7 +161,9 @@ public class HGBG003 extends DaoEPBase { ...@@ -158,7 +161,9 @@ public class HGBG003 extends DaoEPBase {
eiColumn.setDescName("领用人员"); eiColumn.setDescName("领用人员");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("审批状态0.未审核1.已审核");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -440,6 +445,23 @@ public class HGBG003 extends DaoEPBase { ...@@ -440,6 +445,23 @@ public class HGBG003 extends DaoEPBase {
public void setReceiveUser(String receiveUser) { public void setReceiveUser(String receiveUser) {
this.receiveUser = receiveUser; this.receiveUser = receiveUser;
} }
/**
* get the status - 审批状态0.未审核1.已审核.
* @return the status
*/
public Integer getStatus() {
return this.status;
}
/**
* set the status - 审批状态0.未审核1.已审核.
*
* @param status - 审批状态0.未审核1.已审核
*/
public void setStatus(Integer status) {
this.status = status;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -465,6 +487,7 @@ public class HGBG003 extends DaoEPBase { ...@@ -465,6 +487,7 @@ public class HGBG003 extends DaoEPBase {
setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode)); setWhCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_CODE)), whCode));
setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName)); setWhName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_WH_NAME)), whName));
setReceiveUser(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIVE_USER)), receiveUser)); setReceiveUser(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RECEIVE_USER)), receiveUser));
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
} }
/** /**
...@@ -491,6 +514,7 @@ public class HGBG003 extends DaoEPBase { ...@@ -491,6 +514,7 @@ public class HGBG003 extends DaoEPBase {
map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE))); map.put(FIELD_WH_CODE, StringUtils.toString(whCode, eiMetadata.getMeta(FIELD_WH_CODE)));
map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME))); map.put(FIELD_WH_NAME, StringUtils.toString(whName, eiMetadata.getMeta(FIELD_WH_NAME)));
map.put(FIELD_RECEIVE_USER, StringUtils.toString(receiveUser, eiMetadata.getMeta(FIELD_RECEIVE_USER))); map.put(FIELD_RECEIVE_USER, StringUtils.toString(receiveUser, eiMetadata.getMeta(FIELD_RECEIVE_USER)));
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
return map; return map;
} }
......
...@@ -14,6 +14,7 @@ import com.baosight.iplat4j.core.ei.EiInfo; ...@@ -14,6 +14,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -56,6 +57,7 @@ public class ServiceHGBG001 extends ServiceEPBase { ...@@ -56,6 +57,7 @@ public class ServiceHGBG001 extends ServiceEPBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据 // 写入数据
List<HGBG001> hgbg001s = new ArrayList<>();
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGBG001 hpbg001 = new HGBG001(); HGBG001 hpbg001 = new HGBG001();
hpbg001.fromMap(resultRow); hpbg001.fromMap(resultRow);
...@@ -64,7 +66,9 @@ public class ServiceHGBG001 extends ServiceEPBase { ...@@ -64,7 +66,9 @@ public class ServiceHGBG001 extends ServiceEPBase {
} else { } else {
this.modify(hpbg001); this.modify(hpbg001);
} }
hgbg001s.add(hpbg001);
} }
inInfo.getBlock(EiConstant.resultBlock).setRows(hgbg001s);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) { } catch (Exception e) {
......
...@@ -5,8 +5,10 @@ import com.baosight.hggp.common.DdynamicEnum; ...@@ -5,8 +5,10 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ReviewStatusEnum; import com.baosight.hggp.common.ReviewStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG001;
import com.baosight.hggp.hg.bg.domain.HGBG002; import com.baosight.hggp.hg.bg.domain.HGBG002;
import com.baosight.hggp.hg.bg.domain.HGBG002A; import com.baosight.hggp.hg.bg.domain.HGBG002A;
import com.baosight.hggp.hg.bg.domain.HGBG003A;
import com.baosight.hggp.hg.bg.tools.HGBGTools; import com.baosight.hggp.hg.bg.tools.HGBGTools;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
...@@ -16,9 +18,8 @@ import com.baosight.iplat4j.core.ei.EiInfo; ...@@ -16,9 +18,8 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays; import java.math.BigDecimal;
import java.util.List; import java.util.*;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -56,15 +57,8 @@ public class ServiceHGBG002 extends ServiceEPBase { ...@@ -56,15 +57,8 @@ public class ServiceHGBG002 extends ServiceEPBase {
List<Long> ids = ObjectUtils.listEpKey(resultRows, HGBG002.FIELD_ID); List<Long> ids = ObjectUtils.listEpKey(resultRows, HGBG002.FIELD_ID);
List<HGBG002A> hgbg002AList = HGBGTools.HgBg002a.getByParentId(ids); List<HGBG002A> hgbg002AList = HGBGTools.HgBg002a.getByParentId(ids);
for (HGBG002 hgbg002: resultRows) { 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); DaoUtils.update(HGBG002.DELETE, hgbg002);
hgbg002As = hgbg002AList.stream().filter(hgbg002a1 -> hgbg002a1.getParentId().equals(hgbg002.getId())).collect(Collectors.toList()); List<HGBG002A> hgbg002As = hgbg002AList.stream().filter(hgbg002a1 -> hgbg002a1.getParentId().equals(hgbg002.getId())).collect(Collectors.toList());
hgbg002As.forEach(hgbg002a -> DaoUtils.update(HGBG002A.DELETE, hgbg002a)); hgbg002As.forEach(hgbg002a -> DaoUtils.update(HGBG002A.DELETE, hgbg002a));
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
...@@ -88,6 +82,7 @@ public class ServiceHGBG002 extends ServiceEPBase { ...@@ -88,6 +82,7 @@ public class ServiceHGBG002 extends ServiceEPBase {
} }
List<Map> detailRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows(); List<Map> detailRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows();
List<HGBG002A> hpbg002As = new ArrayList<>();
// 写入数据 // 写入数据
for (Map detailRow : detailRows) { for (Map detailRow : detailRows) {
HGBG002A hgbg002a = new HGBG002A(); HGBG002A hgbg002a = new HGBG002A();
...@@ -98,7 +93,10 @@ public class ServiceHGBG002 extends ServiceEPBase { ...@@ -98,7 +93,10 @@ public class ServiceHGBG002 extends ServiceEPBase {
} else { } else {
DaoUtils.update(HGBG002A.UPDATE, hgbg002a); DaoUtils.update(HGBG002A.UPDATE, hgbg002a);
} }
hpbg002As.add(hgbg002a);
} }
inInfo.getBlock(EiConstant.resultBlock).setRows(Collections.singletonList(hgbg002));
inInfo.getBlock(CommonConstant.Field.DETAIL).setRows(hpbg002As);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + detailRows.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + detailRows.size() + "]条数据保存成功!");
} catch (Exception e) { } catch (Exception e) {
...@@ -121,4 +119,38 @@ public class ServiceHGBG002 extends ServiceEPBase { ...@@ -121,4 +119,38 @@ public class ServiceHGBG002 extends ServiceEPBase {
public void modify(HGBG002 hgbg002) { public void modify(HGBG002 hgbg002) {
DaoUtils.update(HGBG002.UPDATE, hgbg002); DaoUtils.update(HGBG002.UPDATE, hgbg002);
} }
@OperationLogAnnotation(operModul = "办公用品入库",operType = "提交",operDesc = "提交操作")
public EiInfo submit(EiInfo inInfo) {
try {
List<HGBG002> resultRows = MapUtils.toDaoEPBases(inInfo,HGBG002.class);
List<Long> ids = ObjectUtils.listEpKey(resultRows, HGBG002.FIELD_ID);
List<HGBG002A> hpbg002As = HGBGTools.HgBg002a.getByParentId(ids);
List<String> itemCodes = ObjectUtils.listEpKey(hpbg002As, HGBG002A.FIELD_ITEM_CODE);
List<HGBG001> hpbg001s = HGBGTools.HgBg001.getByItemCode(itemCodes);
// 写入数据
for (HGBG002 hpbg002 : resultRows) {
AssertUtils.isTrue(hpbg002.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode()), "数据已提交,无法重复提交!");
List<HGBG002A> hpbg002aList = hpbg002As.stream().filter(hpbg002A -> hpbg002A.getParentId().equals(hpbg002.getId())).collect(Collectors.toList());
AssertUtils.isEmpty(hpbg002aList, "请先添加办公用品入库明细");
hpbg002aList.forEach(hpbg002A -> {
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);
}
});
hpbg002.setStatus(ReviewStatusEnum.SUBMITTED.getCode());
DaoUtils.update(HGBG002.UPDATE_BY_STATUS, hpbg002);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
} }
...@@ -5,7 +5,7 @@ import com.baosight.hggp.common.DdynamicEnum; ...@@ -5,7 +5,7 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ReviewStatusEnum; import com.baosight.hggp.common.ReviewStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG001; import com.baosight.hggp.hg.bg.domain.HGBG002;
import com.baosight.hggp.hg.bg.domain.HGBG002A; import com.baosight.hggp.hg.bg.domain.HGBG002A;
import com.baosight.hggp.hg.bg.tools.HGBGTools; import com.baosight.hggp.hg.bg.tools.HGBGTools;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
...@@ -18,6 +18,7 @@ import java.math.BigDecimal; ...@@ -18,6 +18,7 @@ import java.math.BigDecimal;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -52,15 +53,14 @@ public class ServiceHGBG002A extends ServiceEPBase { ...@@ -52,15 +53,14 @@ public class ServiceHGBG002A extends ServiceEPBase {
@Override @Override
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<HGBG002A> resultRows = MapUtils.toDaoEPBases(inInfo, HGBG002A.class);
for (Map resultRow: resultRows) { List<Long> ids = ObjectUtils.listEpKey(resultRows, HGBG002A.FIELD_PARENT_ID);
HGBG002A hpbg002a = new HGBG002A(); if (Objects.nonNull(ids)) {
hpbg002a.fromMap(resultRow); HGBG002 hgbg002 = HGBGTools.HgBg002.get(resultRows.get(0).getParentId());
hpbg002a.setDeleteFlag(CommonConstant.YesNo.YES_1); AssertUtils.isTrue(hgbg002.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode()), "数据已提交,无法删除!");
if (hpbg002a.getId() == null || hpbg002a.getId() == 0) { }
continue;
} for (HGBG002A hpbg002a: resultRows) {
AssertUtils.isTrue(hpbg002a.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode()), "数据已提交,无法删除!");
DaoUtils.update(HGBG002A.DELETE, hpbg002a); DaoUtils.update(HGBG002A.DELETE, hpbg002a);
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
...@@ -70,32 +70,4 @@ public class ServiceHGBG002A extends ServiceEPBase { ...@@ -70,32 +70,4 @@ public class ServiceHGBG002A extends ServiceEPBase {
} }
return inInfo; 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;
}
} }
...@@ -42,7 +42,7 @@ public class ServiceHGBG002C extends ServiceEPBase { ...@@ -42,7 +42,7 @@ public class ServiceHGBG002C extends ServiceEPBase {
), null, false); ), null, false);
Long id = Long.parseLong(params.get(HGBG002.FIELD_ID)); Long id = Long.parseLong(params.get(HGBG002.FIELD_ID));
HGBG002 hpbg002 = HGBGTools.HgBg002.get(id); HGBG002 hpbg002 = HGBGTools.HgBg002.get(id);
List<HGBG002A> hpbg002As = HGBGTools.HgBg002a.getByParentId(id,ReviewStatusEnum.UNSUBMITTED.getCode()); List<HGBG002A> hpbg002As = HGBGTools.HgBg002a.getByParentId(id);
EiBlock resultBlock =new EiBlock(EiConstant.resultBlock); EiBlock resultBlock =new EiBlock(EiConstant.resultBlock);
resultBlock.setBlockMeta(new HGBG002().eiMetadata); resultBlock.setBlockMeta(new HGBG002().eiMetadata);
resultBlock.setRows(Collections.singletonList(hpbg002)); resultBlock.setRows(Collections.singletonList(hpbg002));
...@@ -60,7 +60,8 @@ public class ServiceHGBG002C extends ServiceEPBase { ...@@ -60,7 +60,8 @@ public class ServiceHGBG002C extends ServiceEPBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { 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_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG002A.FIELD_STATUS, ReviewStatusEnum.UNSUBMITTED.getCode()); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG002A.FIELD_PARENT_ID,
inInfo.getCellStr(EiConstant.resultBlock, ACConstants.ROW_CODE_0, HGBG002A.FIELD_ID));
return super.query(inInfo, HGBG002A.QUERY,new HGBG002A(),false,new EiBlockMeta(),EiConstant.queryBlock,CommonConstant.Field.DETAIL,CommonConstant.Field.DETAIL); return super.query(inInfo, HGBG002A.QUERY,new HGBG002A(),false,new EiBlockMeta(),EiConstant.queryBlock,CommonConstant.Field.DETAIL,CommonConstant.Field.DETAIL);
} }
...@@ -72,11 +73,6 @@ public class ServiceHGBG002C extends ServiceEPBase { ...@@ -72,11 +73,6 @@ public class ServiceHGBG002C extends ServiceEPBase {
for (Map resultRow: resultRows) { for (Map resultRow: resultRows) {
HGBG002A hpbg002a = new HGBG002A(); HGBG002A hpbg002a = new HGBG002A();
hpbg002a.fromMap(resultRow); 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); DaoUtils.update(HGBG002A.DELETE, hpbg002a);
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
...@@ -5,8 +5,7 @@ import com.baosight.hggp.common.DdynamicEnum; ...@@ -5,8 +5,7 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ReviewStatusEnum; import com.baosight.hggp.common.ReviewStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG003; import com.baosight.hggp.hg.bg.domain.*;
import com.baosight.hggp.hg.bg.domain.HGBG003A;
import com.baosight.hggp.hg.bg.tools.HGBGTools; import com.baosight.hggp.hg.bg.tools.HGBGTools;
import com.baosight.hggp.hg.constant.HGConstant; import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
...@@ -16,9 +15,8 @@ import com.baosight.iplat4j.core.ei.EiInfo; ...@@ -16,9 +15,8 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays; import java.math.BigDecimal;
import java.util.List; import java.util.*;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -57,14 +55,8 @@ public class ServiceHGBG003 extends ServiceEPBase { ...@@ -57,14 +55,8 @@ public class ServiceHGBG003 extends ServiceEPBase {
List<HGBG003A> hpbg003AList = HGBGTools.HgBg003a.getByParentId(ids); List<HGBG003A> hpbg003AList = HGBGTools.HgBg003a.getByParentId(ids);
for (HGBG003 hpbg003: resultRows) { for (HGBG003 hpbg003: resultRows) {
hpbg003.setDeleteFlag(CommonConstant.YesNo.YES_1); 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); DaoUtils.update(HGBG003.DELETE, hpbg003);
hpbg003As = hpbg003AList.stream().filter(hpbg003a1 -> hpbg003a1.getParentId().equals(hpbg003.getId())).collect(Collectors.toList()); List<HGBG003A> hpbg003As = hpbg003AList.stream().filter(hpbg003a1 -> hpbg003a1.getParentId().equals(hpbg003.getId())).collect(Collectors.toList());
hpbg003As.forEach(hpbg003a -> DaoUtils.update(HGBG003A.DELETE, hpbg003a)); hpbg003As.forEach(hpbg003a -> DaoUtils.update(HGBG003A.DELETE, hpbg003a));
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
...@@ -88,6 +80,7 @@ public class ServiceHGBG003 extends ServiceEPBase { ...@@ -88,6 +80,7 @@ public class ServiceHGBG003 extends ServiceEPBase {
} }
List<Map> detailRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows(); List<Map> detailRows = inInfo.getBlock(CommonConstant.Field.DETAIL).getRows();
List<HGBG003A> hpbg003As = new ArrayList<>();
// 写入数据 // 写入数据
for (Map detailRow : detailRows) { for (Map detailRow : detailRows) {
HGBG003A hpbg003a = new HGBG003A(); HGBG003A hpbg003a = new HGBG003A();
...@@ -98,7 +91,10 @@ public class ServiceHGBG003 extends ServiceEPBase { ...@@ -98,7 +91,10 @@ public class ServiceHGBG003 extends ServiceEPBase {
} else { } else {
DaoUtils.update(HGBG003A.UPDATE, hpbg003a); DaoUtils.update(HGBG003A.UPDATE, hpbg003a);
} }
hpbg003As.add(hpbg003a);
} }
inInfo.getBlock(EiConstant.resultBlock).setRows(Collections.singletonList(hpbg003));
inInfo.getBlock(CommonConstant.Field.DETAIL).setRows(hpbg003As);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + detailRows.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + detailRows.size() + "]条数据保存成功!");
} catch (Exception e) { } catch (Exception e) {
...@@ -121,4 +117,38 @@ public class ServiceHGBG003 extends ServiceEPBase { ...@@ -121,4 +117,38 @@ public class ServiceHGBG003 extends ServiceEPBase {
public void modify(HGBG003 hpbg003) { public void modify(HGBG003 hpbg003) {
DaoUtils.update(HGBG003.UPDATE, hpbg003); DaoUtils.update(HGBG003.UPDATE, hpbg003);
} }
@OperationLogAnnotation(operModul = "办公用品领用",operType = "提交",operDesc = "提交操作")
public EiInfo submit(EiInfo inInfo) {
try {
List<HGBG003> resultRows = MapUtils.toDaoEPBases(inInfo,HGBG003.class);
List<Long> ids = ObjectUtils.listEpKey(resultRows, HGBG003.FIELD_ID);
List<HGBG003A> hpbg003As = HGBGTools.HgBg003a.getByParentId(ids);
List<String> itemCodes = ObjectUtils.listEpKey(resultRows, HGBG003A.FIELD_ITEM_CODE);
List<HGBG001> hpbg001s = HGBGTools.HgBg001.getByItemCode(itemCodes);
// 写入数据
for (HGBG003 hpbg003 : resultRows) {
AssertUtils.isTrue(hpbg003.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode()), "数据已提交,无法重复提交!");
List<HGBG003A> hpbg003aList = hpbg003As.stream().filter(hpbg003A -> hpbg003A.getParentId().equals(hpbg003.getId())).collect(Collectors.toList());
AssertUtils.isEmpty(hpbg003aList, "请先添加办公用品入库明细");
hpbg003aList.forEach(hpbg003A -> {
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);
}
});
hpbg003.setStatus(ReviewStatusEnum.SUBMITTED.getCode());
DaoUtils.update(HGBG003.UPDATE_BY_STATUS, hpbg003);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
} }
...@@ -6,6 +6,8 @@ import com.baosight.hggp.common.ReviewStatusEnum; ...@@ -6,6 +6,8 @@ import com.baosight.hggp.common.ReviewStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG001; import com.baosight.hggp.hg.bg.domain.HGBG001;
import com.baosight.hggp.hg.bg.domain.HGBG002;
import com.baosight.hggp.hg.bg.domain.HGBG003;
import com.baosight.hggp.hg.bg.domain.HGBG003A; import com.baosight.hggp.hg.bg.domain.HGBG003A;
import com.baosight.hggp.hg.bg.tools.HGBGTools; import com.baosight.hggp.hg.bg.tools.HGBGTools;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.*;
...@@ -18,6 +20,7 @@ import java.math.BigDecimal; ...@@ -18,6 +20,7 @@ import java.math.BigDecimal;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -51,15 +54,13 @@ public class ServiceHGBG003A extends ServiceEPBase { ...@@ -51,15 +54,13 @@ public class ServiceHGBG003A extends ServiceEPBase {
@Override @Override
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<HGBG003A> resultRows = MapUtils.toDaoEPBases(inInfo, HGBG003A.class);
for (Map resultRow: resultRows) { List<Long> ids = ObjectUtils.listEpKey(resultRows, HGBG003A.FIELD_PARENT_ID);
HGBG003A hpbg003a = new HGBG003A(); if (Objects.nonNull(ids)) {
hpbg003a.fromMap(resultRow); HGBG003 hgbg003 = HGBGTools.HgBg003.get(resultRows.get(0).getParentId());
hpbg003a.setDeleteFlag(CommonConstant.YesNo.YES_1); AssertUtils.isTrue(hgbg003.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode()), "数据已提交,无法删除!");
if (hpbg003a.getId() == null || hpbg003a.getId() == 0) { }
continue; for (HGBG003A hpbg003a: resultRows) {
}
AssertUtils.isTrue(hpbg003a.getStatus().equals(ReviewStatusEnum.SUBMITTED.getCode()), "数据已提交,无法删除!");
DaoUtils.update(HGBG003A.DELETE, hpbg003a); DaoUtils.update(HGBG003A.DELETE, hpbg003a);
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
...@@ -106,31 +107,4 @@ public class ServiceHGBG003A extends ServiceEPBase { ...@@ -106,31 +107,4 @@ public class ServiceHGBG003A extends ServiceEPBase {
DaoUtils.update(HGBG003A.UPDATE, 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;
}
} }
...@@ -5,6 +5,7 @@ import com.baosight.hggp.common.DdynamicEnum; ...@@ -5,6 +5,7 @@ import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.common.ReviewStatusEnum; import com.baosight.hggp.common.ReviewStatusEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.bg.domain.HGBG002A;
import com.baosight.hggp.hg.bg.domain.HGBG003; import com.baosight.hggp.hg.bg.domain.HGBG003;
import com.baosight.hggp.hg.bg.domain.HGBG003A; import com.baosight.hggp.hg.bg.domain.HGBG003A;
import com.baosight.hggp.hg.bg.tools.HGBGTools; import com.baosight.hggp.hg.bg.tools.HGBGTools;
...@@ -42,7 +43,7 @@ public class ServiceHGBG003C extends ServiceEPBase { ...@@ -42,7 +43,7 @@ public class ServiceHGBG003C extends ServiceEPBase {
), null, false); ), null, false);
Long id = Long.parseLong(params.get(HGBG003.FIELD_ID)); Long id = Long.parseLong(params.get(HGBG003.FIELD_ID));
HGBG003 hpbg003 = HGBGTools.HgBg003.get(id); HGBG003 hpbg003 = HGBGTools.HgBg003.get(id);
List<HGBG003A> hpbg003As = HGBGTools.HgBg003a.getByParentId(id, ReviewStatusEnum.UNSUBMITTED.getCode()); List<HGBG003A> hpbg003As = HGBGTools.HgBg003a.getByParentId(id);
EiBlock resultBlock =new EiBlock(EiConstant.resultBlock); EiBlock resultBlock =new EiBlock(EiConstant.resultBlock);
resultBlock.setBlockMeta(new HGBG003().eiMetadata); resultBlock.setBlockMeta(new HGBG003().eiMetadata);
resultBlock.setRows(Collections.singletonList(hpbg003)); resultBlock.setRows(Collections.singletonList(hpbg003));
...@@ -60,7 +61,8 @@ public class ServiceHGBG003C extends ServiceEPBase { ...@@ -60,7 +61,8 @@ public class ServiceHGBG003C extends ServiceEPBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { 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_DELETE_FLAG, CommonConstant.YesNo.NO_0);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG003A.FIELD_STATUS, ReviewStatusEnum.UNSUBMITTED.getCode()); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGBG002A.FIELD_PARENT_ID,
inInfo.getCellStr(EiConstant.resultBlock, ACConstants.ROW_CODE_0, HGBG002A.FIELD_ID));
return super.query(inInfo, HGBG003A.QUERY,new HGBG003A(),false,new EiBlockMeta(),EiConstant.queryBlock,CommonConstant.Field.DETAIL,CommonConstant.Field.DETAIL); return super.query(inInfo, HGBG003A.QUERY,new HGBG003A(),false,new EiBlockMeta(),EiConstant.queryBlock,CommonConstant.Field.DETAIL,CommonConstant.Field.DETAIL);
} }
...@@ -73,10 +75,6 @@ public class ServiceHGBG003C extends ServiceEPBase { ...@@ -73,10 +75,6 @@ public class ServiceHGBG003C extends ServiceEPBase {
HGBG003A hpbg003a = new HGBG003A(); HGBG003A hpbg003a = new HGBG003A();
hpbg003a.fromMap(resultRow); hpbg003a.fromMap(resultRow);
hpbg003a.setDeleteFlag(CommonConstant.YesNo.YES_1); 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); DaoUtils.update(HGBG003A.DELETE, hpbg003a);
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......
...@@ -15,6 +15,7 @@ import com.baosight.iplat4j.core.ei.EiInfo; ...@@ -15,6 +15,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -59,6 +60,7 @@ public class ServiceHGBG004 extends ServiceEPBase { ...@@ -59,6 +60,7 @@ public class ServiceHGBG004 extends ServiceEPBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据 // 写入数据
List<HGBG004> hgbg004s = new ArrayList<>();
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGBG004 hpbg004 = new HGBG004(); HGBG004 hpbg004 = new HGBG004();
hpbg004.fromMap(resultRow); hpbg004.fromMap(resultRow);
...@@ -67,7 +69,9 @@ public class ServiceHGBG004 extends ServiceEPBase { ...@@ -67,7 +69,9 @@ public class ServiceHGBG004 extends ServiceEPBase {
} else { } else {
this.modify(hpbg004); this.modify(hpbg004);
} }
hgbg004s.add(hpbg004);
} }
inInfo.getBlock(EiConstant.resultBlock).setRows(hgbg004s);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) { } catch (Exception e) {
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
COMPANY_NAME = #companyName# COMPANY_NAME = #companyName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depositDate"> <isNotEmpty prepend=" AND " property="depositDate">
DEPOSIT_DATE = #depositDate# DEPOSIT_DATE = REPLACE(#depositDate#, '-', '')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="depositCode"> <isNotEmpty prepend=" AND " property="depositCode">
DEPOSIT_CODE = #depositCode# DEPOSIT_CODE = #depositCode#
...@@ -76,6 +76,9 @@ ...@@ -76,6 +76,9 @@
<isNotEmpty prepend=" AND " property="depositUser"> <isNotEmpty prepend=" AND " property="depositUser">
DEPOSIT_USER = #depositUser# DEPOSIT_USER = #depositUser#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
...@@ -97,7 +100,8 @@ ...@@ -97,7 +100,8 @@
DEPOSIT_CODE as "depositCode", <!-- 入库单号 --> DEPOSIT_CODE as "depositCode", <!-- 入库单号 -->
WH_CODE as "whCode", <!-- 仓库编码 --> WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 --> WH_NAME as "whName", <!-- 仓库名称 -->
DEPOSIT_USER as "depositUser" <!-- 入库人员 --> DEPOSIT_USER as "depositUser", <!-- 入库人员 -->
STATUS as "status"
FROM ${hggpSchema}.HGBG002 WHERE 1=1 FROM ${hggpSchema}.HGBG002 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
...@@ -184,10 +188,11 @@ ...@@ -184,10 +188,11 @@
DEPOSIT_CODE, <!-- 入库单号 --> DEPOSIT_CODE, <!-- 入库单号 -->
WH_CODE, <!-- 仓库编码 --> WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 --> WH_NAME, <!-- 仓库名称 -->
DEPOSIT_USER <!-- 入库人员 --> DEPOSIT_USER, <!-- 入库人员 -->
STATUS
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#, #companyCode#, VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#, #companyCode#,
#companyName#, #depositDate#, #depositCode#, #whCode#, #whName#, #depositUser#) #companyName#, #depositDate#, #depositCode#, #whCode#, #whName#, #depositUser#, #status#)
<selectKey resultClass="java.lang.Long" keyProperty="id" > <selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGBG002 SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGBG002
</selectKey> </selectKey>
...@@ -222,9 +227,21 @@ ...@@ -222,9 +227,21 @@
DEPOSIT_CODE = #depositCode#, <!-- 入库单号 --> DEPOSIT_CODE = #depositCode#, <!-- 入库单号 -->
WH_CODE = #whCode#, <!-- 仓库编码 --> WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 --> WH_NAME = #whName#, <!-- 仓库名称 -->
DEPOSIT_USER = #depositUser# <!-- 入库人员 --> DEPOSIT_USER = #depositUser#, <!-- 入库人员 -->
STATUS = #status#
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
<update id="updateBystatus">
UPDATE ${hggpSchema}.HGBG002
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
STATUS = #status# <!-- 审批状态0.未审核1.已审核 -->
WHERE
ID = #id#
</update>
</sqlMap> </sqlMap>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
COMPANY_NAME = #companyName# COMPANY_NAME = #companyName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveDate"> <isNotEmpty prepend=" AND " property="receiveDate">
RECEIVE_DATE = #receiveDate# RECEIVE_DATE = REPLACE(#receiveDate#, '-', '')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="receiveCode"> <isNotEmpty prepend=" AND " property="receiveCode">
RECEIVE_CODE = #receiveCode# RECEIVE_CODE = #receiveCode#
...@@ -76,6 +76,9 @@ ...@@ -76,6 +76,9 @@
<isNotEmpty prepend=" AND " property="receiveUser"> <isNotEmpty prepend=" AND " property="receiveUser">
RECEIVE_USER = #receiveUser# RECEIVE_USER = #receiveUser#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
...@@ -97,7 +100,8 @@ ...@@ -97,7 +100,8 @@
RECEIVE_CODE as "receiveCode", <!-- 领用单号 --> RECEIVE_CODE as "receiveCode", <!-- 领用单号 -->
WH_CODE as "whCode", <!-- 仓库编码 --> WH_CODE as "whCode", <!-- 仓库编码 -->
WH_NAME as "whName", <!-- 仓库名称 --> WH_NAME as "whName", <!-- 仓库名称 -->
RECEIVE_USER as "receiveUser" <!-- 领用人员 --> RECEIVE_USER as "receiveUser", <!-- 领用人员 -->
STATUS as "status"
FROM ${hggpSchema}.HGBG003 WHERE 1=1 FROM ${hggpSchema}.HGBG003 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
...@@ -184,10 +188,11 @@ ...@@ -184,10 +188,11 @@
RECEIVE_CODE, <!-- 领用单号 --> RECEIVE_CODE, <!-- 领用单号 -->
WH_CODE, <!-- 仓库编码 --> WH_CODE, <!-- 仓库编码 -->
WH_NAME, <!-- 仓库名称 --> WH_NAME, <!-- 仓库名称 -->
RECEIVE_USER <!-- 领用人员 --> RECEIVE_USER, <!-- 领用人员 -->
STATUS
) )
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#, #companyCode#, VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#, #companyCode#,
#companyName#, #receiveDate#, #receiveCode#, #whCode#, #whName#, #receiveUser#) #companyName#, #receiveDate#, #receiveCode#, #whCode#, #whName#, #receiveUser#, #status#)
<selectKey resultClass="java.lang.Long" keyProperty="id" > <selectKey resultClass="java.lang.Long" keyProperty="id" >
SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGBG003 SELECT MAX(ID) as "id" FROM ${hggpSchema}.HGBG003
</selectKey> </selectKey>
...@@ -197,6 +202,7 @@ ...@@ -197,6 +202,7 @@
DELETE FROM ${hggpSchema}.HGBG003 WHERE DELETE FROM ${hggpSchema}.HGBG003 WHERE
ID = #id# ID = #id#
</delete> </delete>
<update id="deleteFlag"> <update id="deleteFlag">
UPDATE ${hggpSchema}.HGBG003 UPDATE ${hggpSchema}.HGBG003
SET SET
...@@ -221,9 +227,21 @@ ...@@ -221,9 +227,21 @@
RECEIVE_CODE = #receiveCode#, <!-- 领用单号 --> RECEIVE_CODE = #receiveCode#, <!-- 领用单号 -->
WH_CODE = #whCode#, <!-- 仓库编码 --> WH_CODE = #whCode#, <!-- 仓库编码 -->
WH_NAME = #whName#, <!-- 仓库名称 --> WH_NAME = #whName#, <!-- 仓库名称 -->
RECEIVE_USER = #receiveUser# <!-- 领用人员 --> RECEIVE_USER = #receiveUser#, <!-- 领用人员 -->
STATUS = #status#
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
<update id="updateBystatus">
UPDATE ${hggpSchema}.HGBG003
SET
UPDATED_BY = #updatedBy#, <!-- 更新人 -->
UPDATED_NAME = #updatedName#, <!-- 更新人名称 -->
UPDATED_TIME = #updatedTime#, <!-- 更新时间 -->
STATUS = #status# <!-- 审批状态0.未审核1.已审核 -->
WHERE
ID = #id#
</update>
</sqlMap> </sqlMap>
...@@ -38,11 +38,10 @@ public class HGBGTools { ...@@ -38,11 +38,10 @@ public class HGBGTools {
} }
public static class HgBg002a { public static class HgBg002a {
public static List<HGBG002A> getByParentId(Long parentId, Integer status){ public static List<HGBG002A> getByParentId(Long parentId){
AssertUtils.isTrue(Objects.isNull(parentId)||parentId<=0, "委外入库单ID不能为空!"); AssertUtils.isTrue(Objects.isNull(parentId)||parentId<=0, "委外入库单ID不能为空!");
Map params = new HashMap(); Map params = new HashMap();
params.put("parentId", parentId); params.put("parentId", parentId);
params.put("status", status);
params.put("deleteFlag", 0); params.put("deleteFlag", 0);
List<HGBG002A> list = DaoBase.getInstance().query(HGBG002A.QUERY,params); List<HGBG002A> list = DaoBase.getInstance().query(HGBG002A.QUERY,params);
return CollectionUtils.isEmpty(list)?new ArrayList<>():list; return CollectionUtils.isEmpty(list)?new ArrayList<>():list;
...@@ -67,11 +66,10 @@ public class HGBGTools { ...@@ -67,11 +66,10 @@ public class HGBGTools {
} }
public static class HgBg003a { public static class HgBg003a {
public static List<HGBG003A> getByParentId(Long parentId, Integer status){ public static List<HGBG003A> getByParentId(Long parentId){
AssertUtils.isTrue(Objects.isNull(parentId)||parentId<=0, "委外入库单ID不能为空!"); AssertUtils.isTrue(Objects.isNull(parentId)||parentId<=0, "委外入库单ID不能为空!");
Map params = new HashMap(); Map params = new HashMap();
params.put("parentId", parentId); params.put("parentId", parentId);
params.put("status", status);
params.put("deleteFlag", 0); params.put("deleteFlag", 0);
List<HGBG003A> list = DaoBase.getInstance().query(HGBG003A.QUERY,params); List<HGBG003A> list = DaoBase.getInstance().query(HGBG003A.QUERY,params);
return CollectionUtils.isEmpty(list)?new ArrayList<>():list; return CollectionUtils.isEmpty(list)?new ArrayList<>():list;
......
...@@ -145,7 +145,7 @@ public class HGYX013 extends DaoEPBase { ...@@ -145,7 +145,7 @@ public class HGYX013 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_QUANTITY); eiColumn = new EiColumn(FIELD_QUANTITY);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(0); eiColumn.setScaleLength(4);
eiColumn.setFieldLength(20); eiColumn.setFieldLength(20);
eiColumn.setDescName("产品数量"); eiColumn.setDescName("产品数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
......
...@@ -32,6 +32,7 @@ $(function() { ...@@ -32,6 +32,7 @@ $(function() {
}); });
$("#BTN_INSERT").on("click",addFunc); $("#BTN_INSERT").on("click",addFunc);
$("#BTN_UPDATE").on("click",updateFunc); $("#BTN_UPDATE").on("click",updateFunc);
$("#SUBMIT").on("click", submitFunc)
}, },
onDelete: function (e) { onDelete: function (e) {
...@@ -114,7 +115,7 @@ function updateFunc() { ...@@ -114,7 +115,7 @@ function updateFunc() {
return; return;
} }
if (rows[0].status == "3") { if (rows[0].status == "3") {
message("已经提交的数据不能进行修改!"); message("数据已审批,不能进行修改!");
return; return;
} }
JSColorbox.open({ JSColorbox.open({
...@@ -133,6 +134,14 @@ function deleteFunc(){ ...@@ -133,6 +134,14 @@ function deleteFunc(){
return; return;
} }
let flag = true; 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){ if (flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { ok: function () {
...@@ -153,6 +162,38 @@ function deleteFunc(){ ...@@ -153,6 +162,38 @@ function deleteFunc(){
} }
/** /**
* 审批提交
*/
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", "HGBG002", "submit", true,
function (ei) {
if (ei.getStatus() != -1){
query();
}
});
}
});
}
}
/**
* 文件上传 * 文件上传
* *
* @param id 业务主键 * @param id 业务主键
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<EF:EFPage title="办公用品入库"> <EF:EFPage title="办公用品入库">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFDatePicker blockId="inqu_status" row="0" ename="sellDate" cname="入库日期" role="date" <EF:EFDatePicker blockId="inqu_status" row="0" ename="depositDate" cname="入库日期" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/> format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="clientName" cname="仓库名称" colWidth="3" filter="contains"> <EF:EFSelect blockId="inqu_status" row="0" ename="clientName" cname="仓库名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
...@@ -57,6 +57,9 @@ ...@@ -57,6 +57,9 @@
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </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:EFColumn cname="创建人" ename="createdName" align="center" width="120" readonly="true" required="false" <EF:EFColumn cname="创建人" ename="createdName" align="center" width="120" readonly="true" required="false"
enable="false"/> enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime" <EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
......
...@@ -15,7 +15,6 @@ $(function() { ...@@ -15,7 +15,6 @@ $(function() {
$("#QUERY").on("click", function () { $("#QUERY").on("click", function () {
grid.dataSource.page(1); grid.dataSource.page(1);
}); });
$("#SUBMIT").on("click", submitFunc)
}, },
} }
}; };
...@@ -40,32 +39,3 @@ $(window).load(function () { ...@@ -40,32 +39,3 @@ $(window).load(function () {
let query = function () { let query = function () {
resultGrid.dataSource.page(1); 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
...@@ -46,9 +46,6 @@ ...@@ -46,9 +46,6 @@
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0" displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/" data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置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:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
......
...@@ -54,7 +54,7 @@ $(function() { ...@@ -54,7 +54,7 @@ $(function() {
} }
}); });
}, },
onAdd: function (e) { beforeAdd: function (e) {
let whCode = $("#result-0-whCode").val(); let whCode = $("#result-0-whCode").val();
if (isBlank(whCode)) { if (isBlank(whCode)) {
message("请选择仓库名称!"); message("请选择仓库名称!");
......
...@@ -56,9 +56,6 @@ ...@@ -56,9 +56,6 @@
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0" displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/" data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置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:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;"> <div class="row" style="display:flex;justify-content:center;">
......
...@@ -53,7 +53,7 @@ $(function() { ...@@ -53,7 +53,7 @@ $(function() {
} }
}); });
}, },
onAdd: function (e) { beforeAdd: function (e) {
let whCode = $("#result-0-whCode").val(); let whCode = $("#result-0-whCode").val();
if (isBlank(whCode)) { if (isBlank(whCode)) {
message("请选择仓库名称!"); message("请选择仓库名称!");
......
...@@ -59,9 +59,6 @@ ...@@ -59,9 +59,6 @@
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0" displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/" data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置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:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;"> <div class="row" style="display:flex;justify-content:center;">
......
...@@ -32,6 +32,7 @@ $(function() { ...@@ -32,6 +32,7 @@ $(function() {
}); });
$("#BTN_INSERT").on("click",addFunc); $("#BTN_INSERT").on("click",addFunc);
$("#BTN_UPDATE").on("click",updateFunc); $("#BTN_UPDATE").on("click",updateFunc);
$("#SUBMIT").on("click", submitFunc)
}, },
onAdd: function (e) { onAdd: function (e) {
...@@ -109,7 +110,7 @@ function updateFunc() { ...@@ -109,7 +110,7 @@ function updateFunc() {
return; return;
} }
if (rows[0].status == "3") { if (rows[0].status == "3") {
message("已经提交的数据不能进行修改!"); message("数据已提交,不能进行修改!");
return; return;
} }
JSColorbox.open({ JSColorbox.open({
...@@ -128,6 +129,14 @@ function deleteFunc(){ ...@@ -128,6 +129,14 @@ function deleteFunc(){
return; return;
} }
let flag = true; 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){ if (flag){
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { ok: function () {
...@@ -149,6 +158,38 @@ function deleteFunc(){ ...@@ -149,6 +158,38 @@ function deleteFunc(){
} }
/** /**
* 审批提交
*/
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", "HGBG003", "submit", true,
function (ei) {
if (ei.getStatus() != -1){
query();
}
});
}
});
}
}
/**
* 文件上传 * 文件上传
* *
* @param id 业务主键 * @param id 业务主键
......
...@@ -57,6 +57,9 @@ ...@@ -57,6 +57,9 @@
align="center" filter="contains" sort="true"> align="center" filter="contains" sort="true">
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<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:EFColumn cname="创建人" ename="createdName" align="center" width="120" readonly="true" required="false" <EF:EFColumn cname="创建人" ename="createdName" align="center" width="120" readonly="true" required="false"
enable="false"/> enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime" <EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
......
...@@ -15,7 +15,6 @@ $(function() { ...@@ -15,7 +15,6 @@ $(function() {
$("#QUERY").on("click", function () { $("#QUERY").on("click", function () {
grid.dataSource.page(1); grid.dataSource.page(1);
}); });
$("#SUBMIT").on("click", submitFunc)
}, },
} }
}; };
...@@ -40,32 +39,3 @@ $(window).load(function () { ...@@ -40,32 +39,3 @@ $(window).load(function () {
let query = function () { let query = function () {
resultGrid.dataSource.page(1); 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
...@@ -46,9 +46,6 @@ ...@@ -46,9 +46,6 @@
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0" displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/" data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置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:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
...@@ -53,7 +53,7 @@ $(function() { ...@@ -53,7 +53,7 @@ $(function() {
} }
}); });
}, },
onAdd: function (e) { beforeAdd: function (e) {
let whCode = $("#result-0-whCode").val(); let whCode = $("#result-0-whCode").val();
if (isBlank(whCode)) { if (isBlank(whCode)) {
message("请选择仓库名称!"); message("请选择仓库名称!");
......
...@@ -21,15 +21,15 @@ ...@@ -21,15 +21,15 @@
<EF:EFPage title="新增办公用品领用"> <EF:EFPage title="新增办公用品领用">
<EF:EFRegion id="inqu" title="基本信息"> <EF:EFRegion id="inqu" title="基本信息">
<div class="row"> <div class="row">
<EF:EFDatePicker ename="result-0-receiveDate" cname="领用日期" colWidth="4" required="true" <EF:EFDatePicker ename="result-0-receiveDate" cname="领用日期" colWidth="3" required="true"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/> format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFSelect cname="仓库名称" ename="result-0-whCode" colWidth="4" required="true" filter="contains"> <EF:EFSelect cname="仓库名称" ename="result-0-whCode" colWidth="3" required="true" filter="contains">
<EF:EFOption label="请选择仓库" value=""/> <EF:EFOption label="请选择仓库" value=""/>
<EF:EFOptions blockId="wh_record_block_id" valueField="valueField" textField="textField"/> <EF:EFOptions blockId="wh_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput ename="result-0-whName" cname="仓库名称" colWidth="4" readonly="true" type="hidden"/> <EF:EFInput ename="result-0-whName" cname="仓库名称" colWidth="3" readonly="true" type="hidden"/>
<EF:EFInput ename="result-0-receiveCode" cname="领用单号" colWidth="4" readonly="true" defaultValue="0"/> <EF:EFInput ename="result-0-receiveCode" cname="领用单号" colWidth="3" readonly="true" defaultValue="0"/>
<EF:EFSelect ename="result-0-receiveUser" cname="领用人员" colWidth="4" filter="contains" <EF:EFSelect ename="result-0-receiveUser" cname="领用人员" colWidth="3" filter="contains"
required="true" defaultValue="${loginName}"> required="true" defaultValue="${loginName}">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="user_block_id" textField="textField" valueField="valueField"/>
...@@ -56,9 +56,6 @@ ...@@ -56,9 +56,6 @@
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0" displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/" data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置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:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;"> <div class="row" style="display:flex;justify-content:center;">
......
...@@ -59,7 +59,7 @@ $(function() { ...@@ -59,7 +59,7 @@ $(function() {
} }
}); });
}, },
onAdd: function (e) { beforeAdd: function (e) {
let whCode = $("#result-0-whCode").val(); let whCode = $("#result-0-whCode").val();
if (isBlank(whCode)) { if (isBlank(whCode)) {
message("请选择仓库名称!"); message("请选择仓库名称!");
...@@ -136,12 +136,6 @@ function btnSaveFunc() { ...@@ -136,12 +136,6 @@ function btnSaveFunc() {
flag = false; flag = false;
return false; return false;
} }
let status= item.get("status");
if(status == 3){
message("选中的第"+(index+1)+"行\"审批状态\"已提交,无法操作");
flag = false;
return false;
}
}) })
if(flag) if(flag)
JSUtils.confirm("确定对数据做\"保存\"操作? ", { JSUtils.confirm("确定对数据做\"保存\"操作? ", {
......
...@@ -59,9 +59,6 @@ ...@@ -59,9 +59,6 @@
displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0" displayType="0" sort="true" align="right" maxLength="15" required="true" defaultValue="0"
data-regex="/^-?[0-9]{1,15}?$/" data-regex="/^-?[0-9]{1,15}?$/"
data-errorprompt="请输入数字,该值最大可设置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:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<div class="row" style="display:flex;justify-content:center;"> <div class="row" style="display:flex;justify-content:center;">
......
...@@ -44,7 +44,7 @@ $(function () { ...@@ -44,7 +44,7 @@ $(function () {
} }
}); });
$("#BNT_SELECT").on("click", saveResult) $("#BTN_SAVE").on("click", saveResult);
}, },
onSuccess: function (e) { onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') { if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
...@@ -62,13 +62,6 @@ $(function () { ...@@ -62,13 +62,6 @@ $(function () {
} }
} }
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
saveResult();
});
IPLATUI.EFSelect = { IPLATUI.EFSelect = {
"result-0-companyCode": { "result-0-companyCode": {
...@@ -137,8 +130,3 @@ let saveResult = function () { ...@@ -137,8 +130,3 @@ let saveResult = function () {
} }
}; };
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.close();
}
...@@ -119,9 +119,5 @@ ...@@ -119,9 +119,5 @@
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/> data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </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> </EF:EFPage>
...@@ -44,7 +44,7 @@ $(function () { ...@@ -44,7 +44,7 @@ $(function () {
} }
}); });
$("#BNT_SELECT").on("click", saveResult) $("#BTN_SAVE").on("click", saveResult);
}, },
onSuccess: function (e) { onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') { if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
...@@ -62,13 +62,6 @@ $(function () { ...@@ -62,13 +62,6 @@ $(function () {
} }
} }
$("#cancel").on("click", function () {
cancelFunc();
});
$("#btn_save").on("click", function () {
saveResult();
});
IPLATUI.EFSelect = { IPLATUI.EFSelect = {
"result-0-companyCode": { "result-0-companyCode": {
...@@ -137,8 +130,3 @@ let saveResult = function () { ...@@ -137,8 +130,3 @@ let saveResult = function () {
} }
}; };
function cancelFunc() {
// 关闭弹窗
parent.JSColorbox.close();
}
...@@ -105,8 +105,4 @@ ...@@ -105,8 +105,4 @@
data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/> data-errorprompt="请输入数字,该值最大可设置17位整数和3位小数!"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </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> </EF:EFPage>
...@@ -105,12 +105,12 @@ ...@@ -105,12 +105,12 @@
dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/> dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']" required="true"/>
<EF:EFColumn ename="district" cname="区域" width="120" enable="true" readonly="false" align="center" required="true"/> <EF:EFColumn ename="district" cname="区域" width="120" enable="true" readonly="false" align="center" required="true"/>
<EF:EFColumn ename="productName" cname="产品名称" width="120" enable="true" readonly="false" align="center" required="false"/> <EF:EFColumn ename="productName" cname="产品名称" width="120" enable="true" readonly="false" align="center" required="false"/>
<EF:EFColumn ename="quantity" cname="产品数量" maxLength="15" displayType="0.00" format="{0:N0}" <EF:EFColumn ename="quantity" cname="产品数量" maxLength="16" displayType="0.0000" format="{0:N4}"
data-regex="/^-?[0-9]{1,12}$/" align="right" data-regex="/^-?[0-9]{1,16}([.][0-9]{1,4})?$/" align="right"
data-errorprompt="请输入数字,该值最大可设置12位整数!" sumType="all"/> data-errorprompt="请输入数字,该值最大可设置16位整数和4位小数!" sumType="all"/>
<EF:EFColumn ename="price" cname="价格" maxLength="15" displayType="0.00" format="{0:C2}" <EF:EFColumn ename="price" cname="价格" maxLength="16" displayType="0.0000" format="{0:C2}"
data-regex="/^-?[0-9]{1,12}([.][0-9]{1,3})?$/" align="right" data-regex="/^-?[0-9]{1,16}([.][0-9]{1,2})?$/" align="right"
data-errorprompt="请输入数字,该值最大可设置12位整数和3位小数!" sumType="all"/> data-errorprompt="请输入数字,该值最大可设置16位整数和2位小数!" sumType="all"/>
<EF:EFColumn ename="quality" cname="质量" width="120" enable="true" readonly="false" align="center" required="false"/> <EF:EFColumn ename="quality" cname="质量" width="120" enable="true" readonly="false" align="center" required="false"/>
<EF:EFComboColumn ename="surveyUser" cname="调查人员" columnTemplate="#=textField#" itemTemplate="#=textField#" <EF:EFComboColumn ename="surveyUser" cname="调查人员" columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField" defaultValue="${loginName}" textField="textField" valueField="valueField" defaultValue="${loginName}"
......
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