Exemplo n.º 1
0
 /**
  *
  * <pre>
  * 方法体说明:合同申请---判断发票标记类型
  * 作者:andy
  * 日期: 2013-11-25 上午14:18:21
  * @param map
  * @return:1-true,否则false
  * </pre>
  */
 public boolean isType(Map<?, ?> map) {
   // 根据业务编码获取合同信息
   ContractWorkflowInfo info = new ContractWorkflowInfo();
   // 获得业务编码
   String bizCode = (String) map.get(BPMSConstant.BIZCODE); // 流程实例ID
   // 获得流程定义名称
   String processDefName = map.get(BPMSConstant.PROCESS_DEF_NAME).toString();
   // 获得WebApplicationContext
   WebApplicationContext wac = WebApplicationContextHolder.getWebApplicationContext();
   // 得到合同工作流manager
   IContractWorkflowManager contractWorkflowManager =
       (IContractWorkflowManager) wac.getBean("contractWorkflowManager");
   // 根据工作流业务编码及流程定义名称查询出合同详细信息
   info = contractWorkflowManager.findContractWorkflowInfoByWorkNo(bizCode, processDefName);
   // 如果对应的合同信息不为空
   if (null != info & StringUtil.isNotEmpty(info.getContractNumber())) {
     // 发票标记为01 返回true
     if (Constant.INVOICE_TYPE_01.equals(info.getInvoiceType())) {
       return true;
     } else {
       return false;
     }
   }
   return false;
 }
Exemplo n.º 2
0
 /**
  *
  * <pre>
  * 方法体说明:结算限额判断
  * 作者:andy
  * 日期: 2013-11-25 下午14:18:21
  * @param map
  * @param mcDefiniTionName
  * @return:是则返回true,否则false
  * </pre>
  */
 private boolean isBalanceAccount(Map<?, ?> map, String mcDefiniTionName) {
   double balanceAccount = 0; // 结算限额
   ContractWorkflowInfo info = new ContractWorkflowInfo();
   String bizCode = (String) map.get(BPMSConstant.BIZCODE); // 流程实例ID
   String currentActivityDefId = map.get(BPMSConstant.CURRENT_ACTIVITY_DEF_ID).toString(); // 当前节点
   String nextActivityDefId = map.get(BPMSConstant.NEXT_ACTIVITY_DEF_ID).toString(); // 下一节点
   WebApplicationContext wac = WebApplicationContextHolder.getWebApplicationContext();
   IContractWorkflowManager contractWorkflowManager =
       (IContractWorkflowManager) wac.getBean("contractWorkflowManager");
   IAmountConfigService amountConfigService =
       (IAmountConfigService) wac.getBean("bpsAmountConfigService");
   info = contractWorkflowManager.findContractWorkflowInfoByWorkNo(bizCode, mcDefiniTionName);
   balanceAccount = Double.valueOf(info.getBalanceAccount());
   if (BpsConstant.EX_UPDATE_PROCESSNAME.equals(mcDefiniTionName)
       || BpsConstant.LTT_UPDATE_PROCESSNAME.equals(mcDefiniTionName)) {
     balanceAccount = Double.valueOf(info.getNewBalanceAccount());
   }
   BigDecimal amount = new BigDecimal(balanceAccount);
   AmountConfigEntity amountConfigEntity = new AmountConfigEntity();
   amountConfigEntity.setCurrentApproStepNo(currentActivityDefId);
   amountConfigEntity.setTargetApproStepNo(nextActivityDefId);
   amountConfigEntity.setMcDefiniTionName(mcDefiniTionName);
   AmountConfigEntity entity = amountConfigService.queryForBranch(amountConfigEntity);
   if (entity != null) {
     BigDecimal minAmount = entity.getMinAmount();
     BigDecimal maxAmount = entity.getMaxAmount();
     if (amount.compareTo(minAmount) > 0 && amount.compareTo(maxAmount) <= 0) {
       return true;
     }
   }
   return false;
 }
Exemplo n.º 3
0
 /**
  *
  * <pre>
  * 方法体说明:判断是否快递大区
  * 作者:andy
  * 日期: 2013-11-25 上午14:18:21
  * @param map
  * @return:是则返回true,否则false
  * </pre>
  */
 public boolean isExpressArea(Map<?, ?> map) {
   ContractWorkflowInfo info = new ContractWorkflowInfo();
   String bizCode = (String) map.get(BPMSConstant.BIZCODE); // 流程实例ID
   String processDefName = map.get(BPMSConstant.PROCESS_DEF_NAME).toString();
   WebApplicationContext wac = WebApplicationContextHolder.getWebApplicationContext();
   IContractWorkflowManager contractWorkflowManager =
       (IContractWorkflowManager) wac.getBean("contractWorkflowManager");
   IDepartmentService departmentService = (IDepartmentService) wac.getBean("departmentService");
   info = contractWorkflowManager.findContractWorkflowInfoByWorkNo(bizCode, processDefName);
   if (null != info & StringUtil.isNotEmpty(info.getContractNumber())) {
     // 点部标杆编码
     String expressPointDeptCode = info.getExpressPointDeptCode();
     // 如果编码不为空
     if (StringUtil.isNotEmpty(expressPointDeptCode)) {
       // 查询出对应的快递点部
       Department exDept = departmentService.getDeptByStandardCode(expressPointDeptCode);
       Department bigArea = null;
       if (null != exDept) {
         bigArea = departmentService.getBigAreaByDeptId(exDept.getId());
       }
       if (bigArea != null && !StringUtil.isEmpty(bigArea.getId())) {
         List<Department> deptList = departmentService.queryAllChildDeptByDeptId(bigArea.getId());
         for (int i = 0; i < deptList.size(); i++) {
           Department deptment = deptList.get(i);
           // 如果子部门有快递部分 则改部门不是快递大区
           if (deptment != null && deptment.getDeptName().endsWith("快递分部")) { // 有快递分部,则无快递事业部
             return false;
           }
         }
         return true;
       }
     }
   }
   return false;
 }
Exemplo n.º 4
0
 /**
  * Description:是否只修改了发票标记<br>
  *
  * @author royxhl
  * @version 0.1 2013-11-27
  * @param map
  * @return boolean
  */
 public boolean ismodifyInvoiceOnly(Map<?, ?> map) {
   ContractWorkflowInfo info = new ContractWorkflowInfo();
   String bizCode = (String) map.get(BPMSConstant.BIZCODE); // 流程实例ID
   String processDefName = map.get(BPMSConstant.PROCESS_DEF_NAME).toString();
   WebApplicationContext wac = WebApplicationContextHolder.getWebApplicationContext();
   IContractWorkflowManager contractWorkflowManager =
       (IContractWorkflowManager) wac.getBean("contractWorkflowManager");
   info = contractWorkflowManager.findContractWorkflowInfoByWorkNo(bizCode, processDefName);
   if (null != info & StringUtil.isNotEmpty(info.getContractNumber())) {
     return info.getModifyContractType().equals("1000");
   }
   return false;
 }
Exemplo n.º 5
0
 /**
  *
  * <pre>
  * 方法体说明:判断是否经理提交
  * 作者:andy
  * 日期: 2013-11-25 上午9:51:37
  * @param map
  * @return:是则返回true,否则false
  * </pre>
  */
 public boolean isManagerSubmit(Map<?, ?> map) {
   ContractWorkflowInfo info = new ContractWorkflowInfo();
   String bizCode = (String) map.get(BPMSConstant.BIZCODE); // 流程实例ID
   String processDefName = map.get(BPMSConstant.PROCESS_DEF_NAME).toString();
   WebApplicationContext wac = WebApplicationContextHolder.getWebApplicationContext();
   IContractWorkflowManager contractWorkflowManager =
       (IContractWorkflowManager) wac.getBean("contractWorkflowManager");
   info = contractWorkflowManager.findContractWorkflowInfoByWorkNo(bizCode, processDefName);
   // 对应的合同序号不为空
   if (null != info & StringUtil.isNotEmpty(info.getContractNumber())) {
     if ("Y".equals(info.getFisPointManager())) {
       return false;
     }
   } else {
     return true;
   }
   return false;
 }
Exemplo n.º 6
0
 /**
  *
  * <pre>
  * 方法体说明:合同申请---判断是否有零担折扣
  * 作者:royxhl
  * 日期: 2013-11-25 上午14:18:21
  * @param map
  * @return:true,否则false
  * </pre>
  */
 public boolean isLTTDiscount(Map<?, ?> map) {
   ContractWorkflowInfo info = new ContractWorkflowInfo();
   // 获得业务编码
   String bizCode = (String) map.get(BPMSConstant.BIZCODE);
   // 获得流程定义名称
   String processDefName = map.get(BPMSConstant.PROCESS_DEF_NAME).toString();
   // 获得WebApplicationContext
   WebApplicationContext wac = WebApplicationContextHolder.getWebApplicationContext();
   // 得到合同工作流manager
   IContractWorkflowManager contractWorkflowManager =
       (IContractWorkflowManager) wac.getBean("contractWorkflowManager");
   // 根据工作流业务编码及流程定义名称查询出合同详细信息
   info = contractWorkflowManager.findContractWorkflowInfoByWorkNo(bizCode, processDefName);
   if (null != info & StringUtil.isNotEmpty(info.getContractNumber())) {
     // 返回是否有零担折扣
     return info.isHasLTTDiscount();
   }
   return false;
 }
Exemplo n.º 7
0
 /**
  * Description:仅快递近三月发货金额为0时,签订快递月结或优惠类型选择运费折扣或两者同时选择,,
  * 或仅零担近三月发货金额为0的零担月结或非纯月发月送合同,或近三月发货金额同时为0的非纯月发越折、月发月送合同<br>
  *
  * @author 106138
  * @version 0.1 2013-12-5
  * @param map
  * @return boolean
  */
 public boolean isTypeTwo(Map<?, ?> map) {
   ContractWorkflowInfo info = new ContractWorkflowInfo();
   String bizCode = (String) map.get(BPMSConstant.BIZCODE); // 流程实例ID
   String processDefName = map.get(BPMSConstant.PROCESS_DEF_NAME).toString();
   WebApplicationContext wac = WebApplicationContextHolder.getWebApplicationContext();
   IContractWorkflowManager contractWorkflowManager =
       (IContractWorkflowManager) wac.getBean("contractWorkflowManager");
   info = contractWorkflowManager.findContractWorkflowInfoByWorkNo(bizCode, processDefName);
   if (null != info & StringUtil.isNotEmpty(info.getContractNumber())) {
     if ((info.getExpAmountOfConsignMent() == null
                 && info.getAmountOfConsignment() != null
                 && "月结".equals(info.getExpNodesectionType())
             || "运费折扣".equals(info.getExpressPreferentialType()))
         || (info.getExpAmountOfConsignMent() != null
             && info.getAmountOfConsignment() == null
             && "月结".equals(info.getNodeSectionType()))
         || (info.getExpAmountOfConsignMent() == null && info.getAmountOfConsignment() == null)
             && !("无".equals(info.getExpNodesectionType())
                 && "月发越折".equals(info.getExpressPreferentialType()))) {
       return true;
     }
   }
   return false;
 }