|
@@ -1,19 +1,30 @@
|
|
|
package u8c.impl.mm;
|
|
|
|
|
|
-import nc.vo.OperationDemandVO;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Iterator;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import nc.bs.framework.common.NCLocator;
|
|
|
+import nc.itf.uap.IUAPQueryBS;
|
|
|
+import nc.jdbc.framework.processor.BeanProcessor;
|
|
|
import nc.vo.OperationMainVO;
|
|
|
+import nc.vo.OperationPurchaseVO;
|
|
|
+import nc.vo.OperationTransferVO;
|
|
|
import nc.vo.hr.tools.pub.HRAggVO;
|
|
|
import nc.vo.pub.BusinessException;
|
|
|
+import nc.vo.pub.lang.UFDouble;
|
|
|
import u8c.itf.mm.IOperationInfo;
|
|
|
|
|
|
-public class OperationInfoImpl implements IOperationInfo{
|
|
|
+public class OperationInfoImpl implements IOperationInfo {
|
|
|
+ private IUAPQueryBS iuap = NCLocator.getInstance().lookup(IUAPQueryBS.class);
|
|
|
|
|
|
@Override
|
|
|
public boolean UpdateStatus(HRAggVO aggvo, int status) throws BusinessException {
|
|
|
OperationMainVO mainVO = (OperationMainVO) aggvo.getParentVO();
|
|
|
OperationInfoDAO dao = new OperationInfoDAO();
|
|
|
mainVO.setStatus(status);
|
|
|
- dao.execUpdate(mainVO, new String[]{OperationMainVO.BILLSTATUS});
|
|
|
+ dao.execUpdate(mainVO, new String[] { OperationMainVO.BILLSTATUS });
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -21,9 +32,76 @@ public class OperationInfoImpl implements IOperationInfo{
|
|
|
public boolean execApprove(HRAggVO aggvo) throws BusinessException {
|
|
|
OperationMainVO mainVO = (OperationMainVO) aggvo.getParentVO();
|
|
|
OperationInfoDAO dao = new OperationInfoDAO();
|
|
|
- dao.execUpdate(mainVO, new String[]{OperationMainVO.BILLSTATUS,OperationMainVO.CHECKER});
|
|
|
+ dao.execUpdate(mainVO, new String[] { OperationMainVO.BILLSTATUS, OperationMainVO.CHECKER });
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean updateParyExecNum(Map<String, UFDouble> updatemap) throws BusinessException {
|
|
|
+ List<OperationPurchaseVO> updatevos = new ArrayList<>();
|
|
|
+ OperationInfoDAO dao = new OperationInfoDAO();
|
|
|
+ Boolean res = false;
|
|
|
+ Iterator it = updatemap.keySet().iterator();
|
|
|
+ try {
|
|
|
+ while (it.hasNext()) {
|
|
|
+ Object key = it.next();
|
|
|
+ Object val = updatemap.get(key);
|
|
|
+ OperationPurchaseVO operationPurchaseVO = getOperationPurchaseVO(key.toString());
|
|
|
+ operationPurchaseVO.setExecnum(val.toString());
|
|
|
+ updatevos.add(operationPurchaseVO);
|
|
|
+ }
|
|
|
+ for (int i = 0; i < updatevos.size(); i++) {
|
|
|
+ dao.updateParyExecNum(updatevos.get(i), new String[] { OperationPurchaseVO.EXECNUM });
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ private OperationPurchaseVO getOperationPurchaseVO(String pk_operation_purchase) throws Exception {
|
|
|
+ String qrysql = "select * from mm_operation_purchase where isnull(dr,0) = 0 and pk_operation_purchase = '" + pk_operation_purchase + "'";
|
|
|
+ Object obj = iuap.executeQuery(qrysql, new BeanProcessor(OperationPurchaseVO.class));
|
|
|
+ if (obj == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return (OperationPurchaseVO) obj;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean updateTranExecNum(Map<String, UFDouble> updatemap) throws BusinessException {
|
|
|
+ List<OperationTransferVO> updatevos = new ArrayList<>();
|
|
|
+ OperationInfoDAO dao = new OperationInfoDAO();
|
|
|
+ Boolean res = false;
|
|
|
+ Iterator it = updatemap.keySet().iterator();
|
|
|
+ try {
|
|
|
+ while (it.hasNext()) {
|
|
|
+ Object key = it.next();
|
|
|
+ Object val = updatemap.get(key);
|
|
|
+ OperationTransferVO operationPurchaseVO = getOperationTransferVO(key.toString());
|
|
|
+ operationPurchaseVO.setExecnum(val.toString());
|
|
|
+ updatevos.add(operationPurchaseVO);
|
|
|
+ }
|
|
|
+ for (int i = 0; i < updatevos.size(); i++) {
|
|
|
+ dao.updateTranNum(updatevos.get(i), new String[] { OperationTransferVO.EXECNUM });
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ private OperationTransferVO getOperationTransferVO(String pk_operation_transfer) throws Exception {
|
|
|
+ String qrysql = "select * from mm_operation_transfer where isnull(dr,0) = 0 and pk_operation_transfer = '" + pk_operation_transfer + "'";
|
|
|
+ Object obj = iuap.executeQuery(qrysql, new BeanProcessor(OperationTransferVO.class));
|
|
|
+ if (obj == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return (OperationTransferVO) obj;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|