Разработка автоматизированной системы контроля процессов обслуживания кредитовых ведомств ОАО "РЖД"
Система контроля процессов обслуживания кредитовых ведомств (воинских министерств) в среде ОАО "РЖД". Требования к функциям, выполняемым системой. Идентификация ключевых абстракций. Обоснование компоновки Web-страницы. Формирование запроса к системе.
Рубрика | Программирование, компьютеры и кибернетика |
Вид | дипломная работа |
Язык | русский |
Дата добавления | 15.10.2013 |
Размер файла | 3,4 M |
Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже
Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.
Код программы
VoinClass.java
package voin.Classes;
import java.util.*;
public class VoinClass {
private String dor = null;
private String min = null;
private String min_name = null;
private String nazvd = null;
private String oplata = null;
private String moplata = null;
private String sumpd = null;
private String msumpd = null;
private String kolpas = null;
private String mkolpas = null;
private String sumpr = null;
private String msumpr = null;
private String kolpr = null;
private String mkolpr = null;
private String sumbag = null;
private String msumbag = null;
private String kolbag = null;
private String mkolbag = null;
private String komsbv = null;
private String mkomsbv = null;
private String kolv = null;
private String mkolv = null;
private String abd = null;
//====CHECK PARAMETRS========
private String dorUser = null;
private String gosUser = null;
private String agentUser = null;
private String skpUser = null;
private String agent = null;
private String agent_name = null;
private String per = null;
private String per_name = null;
private String ust = null;
//============================
private boolean chek_str = false;
public String getDor() {
return dor;
}
public String getAbd() {
return abd;
}
public String getAgent() {
return agent;
}
public void setAgent(String agent) {
this.agent = agent;
}
public String getAgent_name() {
return agent_name;
}
public void setAgent_name(String agent_name) {
this.agent_name =agent_name;
}
public String getPer() {
return per;
}
public void setPer(String per) {
this.per = per;
}
public String getPer_name() {
return per_name;
}
public void setPer_name(String per_name) {
this.per_name = per_name;
}
public String getUst() {
return ust;
}
public void setUst(String ust) {
this.ust = ust;
}
public void setAbd(String abd) {
this.abd = abd;
}
public void setDor(String dor) {
this.dor = dor;
}
public String getMin() {
return min;
}
public void setMin(String min) {
this.min = min;
}
public String getMin_name() {
return min_name;
}
public void setMin_name(String min_name) {
this.min_name = min_name;
}
public String getNazvd() {
return nazvd;
}
public void setNazvd(String nazvd) {
this.nazvd = nazvd;
}
public String getOplata() {
return oplata;
}
public void setOplata(String oplata) {
this.oplata = oplata;
}
public String getMoplata() {
return moplata;
}
public void setMoplata(String moplata) {
this.moplata = moplata;
}
public String getSumpd() {
return sumpd;
}
public void setSumpd(String sumpd) {
this.sumpd = sumpd;
}
public String getMsumpd() {
return msumpd;
}
public void setMsumpd(String msumpd) {
this.msumpd = msumpd;
}
public String getKolpas() {
return kolpas;
}
public void setKolpas(String kolpas) {
this.kolpas = kolpas;
}
public String getMkolpas() {
return mkolpas;
}
public void setMkolpas(String mkolpas) {
this.mkolpas = mkolpas;
}
public String getSumpr() {
return sumpr;
}
public void setSumpr(String sumpr) {
this.sumpr = sumpr;
}
public String getMsumpr() {
return msumpr;
}
public void setMsumpr(String msumpr) {
this.msumpr = msumpr;
}
public String getKolpr() {
return kolpr;
}
public void setKolpr(String kolpr) {
this.kolpr = kolpr;
}
public String getMkolpr() {
return mkolpr;
}
public void setMkolpr(String mkolpr) {
this.mkolpr = mkolpr;
}
public String getSumbag() {
return sumbag;
}
public void setSumbag(String sumbag) {
this.sumbag = sumbag;
}
public String getMsumbag() {
return msumbag;
}
public void setMsumbag(String msumbag) {
this.msumbag = msumbag;
}
public String getKolbag() {
return kolbag;
}
public void setKolbag(String kolbag) {
this.kolbag = kolbag;
}
public String getMkolbag() {
return mkolbag;
}
public void setMkolbag(String mkolbag) {
this.mkolbag= mkolbag;
}
public String getKomsbv() {
return komsbv;
}
public void setKomsbv(String komsbv) {
this.komsbv = komsbv;
}
public String getMkomsbv() {
return mkomsbv;
}
public void setMkomsbv(String mkomsbv) {
this.mkomsbv = mkomsbv;
}
public String getKolv() {
return kolv;
}
public void setKolv(String kolv) {
this.kolv = kolv;
}
public String getMkolv() {
return mkolv;
}
public void setMkolv(String mkolv) {
this.mkolv = mkolv;
}
//===========CHECK_PARAMETSR==========
public String getDorUser() {
return dorUser;
}
public void setDorUser(String dorUser) {
this.dorUser = dorUser;
}
public String getGosUser() {
return gosUser;
}
public void setGosUser(String gosUser) {
this.gosUser = gosUser;
}
public String getSkpUser() {
return skpUser;
}
public void setSkpUser(String skpUser) {
this.skpUser = skpUser;
}
//=========chek_str========
public boolean getChek_str() {
return chek_str;
}
public void setChek_str(boolean c) {
this.chek_str = c;
}
}
ActionServlet.java
package voin.Classes;
import java.io.IOException;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import morutils.ActivityData;
public class ActionServlet extends org.apache.struts.action.ActionServlet implements Servlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
doPost(req, resp);
}
public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String st=req.getServletPath();
ActivityData ad=null;
long procId=0;
{
ad = new ActivityData(req, "VOIN");
procId = ad.startProcess();
}
super.doPost(req, resp);
{
ad.stopProcess(procId);
}
}
}
StartAction.java
package voin.actions;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.Vector;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.ParseException;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.TreeMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.util.LabelValueBean;
import voin.Classes.VoinClass;
import voin.Classes.JDBCConnection;
import voin.Forms.ArmVoinForm;
import comserv.UserCheck;
import morutils.IsAvailable;
public class StartAction extends Action{
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws SQLException, Exception {
JDBCConnection jdbcConnection = new JDBCConnection();
ActionErrors errors = new ActionErrors();
ActionForward forward = new ActionForward();
Connection connec = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
PreparedStatement pstmt2 = null;
ResultSet rs2 = null;
PreparedStatement pstmt3 = null;
ResultSet rs3 = null;
PreparedStatement pstmt4 = null;
ResultSet rs4 = null;
HttpSession session = request.getSession(false);
String cond1 = "";
String cond2 = "";
String cond3 = "";
String cond4 = "";
String vis = null;
String vis1 = null;
String vis2 = null;
UserCheck ch = null;
String remoteUser = request.getRemoteUser();
String remoteIP = request.getRemoteAddr();
try {
IsAvailable ia = new IsAvailable();
if (ia.avLevel != IsAvailable.isOk) {
if (ia.message.length() > 0)
request.setAttribute("isAv", ia.message);
if (ia.avLevel == IsAvailable.isBusy) {
errors.add("errorIsAv", new ActionError("error.IsAv",
ia.message));
throw new Exception();
}
}
////=======UserCheck=========
ch = new UserCheck();
ch.setUser(remoteUser);
ch.setIp(remoteIP);
ch.setTaskCode("DOHODV");
ch.setStatTaskCode("DOHODV");
String dorUser = "";
String gosUser = "";
String agentUser = "";
String skpUser = "";
if (!ch.check()) {
ch.setTaskCode("ARMPP");
if (!ch.check()) {
errors.add("errorUserLockMsg", new ActionError(
"error.UserLockMsg", ch.getMessage(), remoteIP));
throw new Exception();
}
}
request.setAttribute("breakpoints", "22");
dorUser = ch.getUserDor();
gosUser = ch.getUserGos();
agentUser = String.valueOf(ch.getAgent());
if (agentUser.trim().equals("-1")) {
agentUser = "";
}
request.setAttribute("breakpoints", "23");
skpUser = String.valueOf(ch.getSkp());
if (skpUser.trim().equals("-1")) {
skpUser = "";//===skpUser = "";
}
if (!skpUser.equals("") && skpUser!=null) {
cond3 = "AND SKP = ? ";
} else {
cond3 = "";
}
if (!agentUser.equals("") && agentUser!=null){
cond4 = "AND SKP = ? ";
} else {
cond4 = "";
}
request.setAttribute("breakpoints", "3");
if (dorUser != null && !dorUser.equals("@") && !dorUser.equals("*")){
vis = "1";
cond1 = " AND A.KODD = ? ";
cond2 = " AND GOS = ? ";
}
if (dorUser != null && dorUser.equals("*")) {
vis1 = "1";
cond1 = " AND A.KODG = ? ";
cond2 = " AND GOS = ? ";
}
if (dorUser !=null && dorUser.equals("@")) {
vis2 = "1";
cond1 = "";
cond2 = " AND GOS = S.GOS_ABD ";
}
request.setAttribute("breakpoints", "4");
//=========================
String query ="SELECT DISTINCT A.KODD, A.KODG,A.SNAZVD, A.NAZVD FROM EXPBD.DOR A, EXPBD.GOS B "+
" WHERE A.KODG=B.KODGOS AND CURRENT_DATE<=A.DATAK AND CURRENT_DATE>=A.DATAN " +
cond1+
" AND B.PR_SNG='1' AND A.DATAK>=B.DATAN AND A.DATAK<=B.DATAK ORDER BY A.KODG ";
jdbcConnection.setDSConnection("java:comp/env/DataSourceRef");
connec = jdbcConnection.getConnection();
pstmt = connec.prepareStatement(query);
if (dorUser != null && !dorUser.equals("@") && !dorUser.equals("*")){
pstmt.setString(1, dorUser);
}
if (dorUser != null && dorUser.equals("*")) {
pstmt.setString(1, gosUser);
}
rs = pstmt.executeQuery();
ArrayList dors = new ArrayList();
if ((dorUser !=null) && (dorUser.equals("@")))
dors.add(new LabelValueBean("* Сумма по дорогам России", "*"));
if ((dorUser !=null) && (dorUser.equals("*")))
dors.add(new LabelValueBean("* Сумма по дорогам России", "*"));
while (rs.next()) {
dors.add(new LabelValueBean(rs.getString(1).trim() + " "
+ rs.getString(2).trim() + " "+ rs.getString(3).trim() + " " + rs.getString(4).trim(),rs.getString(1).trim() + "--" + rs.getString(2).trim()));
}
rs.close();
pstmt.close();
request.setAttribute("breakpoints", "5");
session.setAttribute("attrDors", dors);
session.setAttribute("vis", vis);
session.setAttribute("vis1", vis1);
session.setAttribute("vis2", vis2);
//======query #2===
int schet_query2 = 1;
String query2 = "SELECT DISTINCT SKP, MNKODP FROM DBKLAS.SOBPER " +
" WHERE CURRENT_DATE<=DATAKO AND CURRENT_DATE<=DATAKP " +
" AND CURRENT_DATE>=DATANO AND CURRENT_DATE>=DATANP " +
" AND PRFIL<>'1' " + cond4;
if (dorUser != null && !dorUser.equals("@")){
query2+= cond2;
}
pstmt2 = connec.prepareStatement(query2);
if (!agentUser.equals("") && agentUser != null)
pstmt2.setString(schet_query2++, agentUser);
if (dorUser != null && !dorUser.equals("@"))
pstmt2.setString(schet_query2++, gosUser);
rs2 = pstmt2.executeQuery();
ArrayList agents = new ArrayList();
if (agentUser.equals("")){
agents.add(new LabelValueBean("Сумма по всем", "*--ЛЮБОЙ"));
agents.add(new LabelValueBean("* Детализация", "**--ЛЮБОЙ"));
}
while (rs2.next()) {
agents.add(new LabelValueBean(rs2.getString(1).trim() + " " + rs2.getString(2).trim(), rs2.getString(1).trim() + "--" + rs2.getString(2).trim()));
}
rs2.close();
pstmt2.close();
session.setAttribute("attrAgents", agents);
//=======query #3======
int schet_query3 = 1;
String query3="SELECT DISTINCT SKP, MNKODP FROM DBKLAS.SOBPER " +
" WHERE CURRENT_DATE<=DATAKO AND CURRENT_DATE<=DATAKP " +
" AND CURRENT_DATE>=DATANO AND CURRENT_DATE>=DATANP " +
" AND PRFIL<>'1' "+ cond3;
if (dorUser != null && !dorUser.equals("@")){
query3+= cond2;
}
pstmt3 = connec.prepareStatement(query3);
if (!skpUser.equals("") && skpUser != null)
pstmt3.setString(schet_query3++, skpUser);
if (dorUser != null && !dorUser.equals("@"))
pstmt3.setString(schet_query3++, gosUser);
rs3 = pstmt3.executeQuery();
ArrayList pers = new ArrayList();
if(skpUser.equals("")){
pers.add(new LabelValueBean("Сумма по всем", "*--ЛЮБОЙ"));
pers.add(new LabelValueBean("* Детализация", "**--ЛЮБОЙ"));
}
while (rs3.next()) {
pers.add(new LabelValueBean(rs3.getString(1).trim() + " "
+ rs3.getString(2).trim(), rs3.getString(1).trim() + "--" + rs3.getString(2).trim()));
}
rs3.close();
pstmt3.close();
session.setAttribute("attrPers", pers);
//===========query #4=============
String query4="SELECT DISTINCT NOMMV, NAME, GOS FROM EXPBD.LGOT ";
if (dorUser != null && dorUser.equals("@")){
query4 += ", EXPBD.SERV S ";
}
query4 += " WHERE CURRENT_DATE>=DATAN AND CURRENT_DATE<=DATAOT " +
" AND NOMMV<>0 " + cond2;
pstmt4 = connec.prepareStatement(query4);
if (dorUser != null && !dorUser.equals("@")) {
pstmt4.setString(1, gosUser);
}
rs4 = pstmt4.executeQuery();
ArrayList mins = new ArrayList();
mins.add(new LabelValueBean("* Детализация", "*--ЛЮБОЙ--ЛЮБОЙ"));
while (rs4.next()) {
mins.add(new LabelValueBean(rs4.getString(1).trim() + " "
+ rs4.getString(2).trim(), rs4.getString(1).trim() + "--"
+ rs4.getString(2).trim() + "--" + rs4.getString(3).trim()));
}
rs4.close();
pstmt4.close();
session.setAttribute("attrMins", mins);
session.setAttribute("dorUser", dorUser);
session.setAttribute("gosUser", gosUser);
//=============================
}
catch (SQLException e) {
// Report the error using the appropriate name and ID.
errors.add("errorDB2", new ActionError("error.errorDB2", e.getMessage()));
// throw e;
}
catch (Exception e) {
// Report the error using the appropriate name and ID.
if (errors.isEmpty())
errors.add("Exception", new ActionError("error.Exception", e.getMessage()));
}
finally {
try {
if (rs != null) {
rs.close();
}
if (pstmt != null) {
pstmt.close();
}
if (jdbcConnection.getConnection()!=null)
jdbcConnection.releaseConnection();
} catch (SQLException e1) {
if (rs != null) {
rs.close();
}
if (pstmt != null) {
pstmt.close();
}
throw e1;
}
}
if (!errors.isEmpty()) {
saveErrors(request, errors);
forward = mapping.findForward("failure");
} else {
forward = mapping.findForward("success");
}
return (forward);
}
}
index3.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@page language="java" contentType="text/html; charset=Windows-1251"
pageEncoding="Windows-1251"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1251">
<META name="GENERATOR" content="IBM Software Development Platform">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet" type="text/css">
<title>Кредитовые ведомства</title>
</HEAD>
<%String vis;
vis = (String)session.getAttribute("vis");
%>
<script language="JavaScript">
function dataChange(objForm,field){
if(field[0].checked){
objForm.day.disabled=false;
objForm.month.disabled=false;
objForm.year.disabled=false;
objForm.systemdata.disabled=true;
objForm.fday.disabled=true;
objForm.fmonth.disabled=true;
objForm.fyear.disabled=true;
objForm.f_fmonth.disabled=true;
objForm.f_fyear.disabled=true;
changeData(objForm);
}
if(field[1].checked){
objForm.day.disabled=true;
objForm.month.disabled=true;
objForm.year.disabled=true;
objForm.systemdata.disabled=false;
objForm.fday.disabled=true;
objForm.fmonth.disabled=true;
objForm.fyear.disabled=true;
objForm.f_fmonth.disabled=true;
objForm.f_fyear.disabled=true;
}
if(field[2].checked){
objForm.day.disabled=true;
objForm.month.disabled=true;
objForm.year.disabled=true;
objForm.systemdata.disabled=true;
objForm.fday.disabled=false;
objForm.fmonth.disabled=false;
objForm.fyear.disabled=false;
objForm.f_fmonth.disabled=true;
objForm.f_fyear.disabled=true;
}
if(field[3].checked){
objForm.day.disabled=true;
objForm.month.disabled=true;
objForm.year.disabled=true;
objForm.systemdata.disabled=true;
objForm.fday.disabled=true;
objForm.fmonth.disabled=true;
objForm.fyear.disabled=true;
objForm.f_fmonth.disabled=false;
objForm.f_fyear.disabled=false;
}
}
function changeData(objForm){
day=objForm.day.value;
m=objForm.month.value;
y=objForm.year.value;
d=new Date(y,m-1,1);
var months=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
days=months[m-1];
if(days==28){
if(y%4==0)days=29;
}
objForm.day.length=0;
var dayVal;
for(i=0;i<days;i++){
dayVal=new String(i+1);
if(dayVal.length==1)
dayVal="0"+dayVal;
objForm.day[i]=new Option(i+1,dayVal);
}
if(days>=day){
objForm.day[day-1].selected=true;
}
}
function ustChange(objForm,field){
if(field[0].checked){
objForm.dor.disabled=true;
}else {
objForm.dor.disabled=false;
}
if (objForm.dorUser.value=="1"){
field[0].disabled=true;
}
}
function doShow(thisform) {
thisform.submit();
return true;
}
function onLoadBody(objForm){
dataChange(objForm,objForm.data);
ustChange(objForm,objForm.ust);
}
</script>
<body onload="onLoadBody(document.forms[0])">
<a href="/express3/"><i>Вернуться на страницу "Экспресс-3"</i></a> |
<a href="/armpp/"><i>Главная страница АРМа</i></a>
<h1 align="center" style="font-size:18pt">АСУ "ЭКСПРЕСС-3" </h1>
<h2 align="center">Информация о дорожных счётчиках кредитовых ведомств</h2>
<h3 align="left">Критерии выбора информации:</h3>
<center>
<HR>
<html:form action="/voin">
<html:hidden property="dorUser"/>
<div id="terminal" align="left"><b>На :</b>
<html:radio property="data" value="data"
onclick="dataChange(this.form,this.form.data)">
</html:radio>день: <html:select property="day">
<html:option value="01">1</html:option>
<html:option value="02">2</html:option>
<html:option value="03">3</html:option>
<html:option value="04">4</html:option>
<html:option value="05">5</html:option>
<html:option value="06">6</html:option>
<html:option value="07">7</html:option>
<html:option value="08">8</html:option>
<html:option value="09">9</html:option>
<html:option value="10">10</html:option>
<html:option value="11">11</html:option>
<html:option value="12">12</html:option>
<html:option value="13">13</html:option>
<html:option value="14">14</html:option>
<html:option value="15">15</html:option>
<html:option value="16">16</html:option>
<html:option value="17">17</html:option>
<html:option value="18">18</html:option>
<html:option value="19">19</html:option>
<html:option value="20">20</html:option>
<html:option value="21">21</html:option>
<html:option value="22">22</html:option>
<html:option value="23">23</html:option>
<html:option value="24">24</html:option>
<html:option value="25">25</html:option>
<html:option value="26">26</html:option>
<html:option value="27">27</html:option>
<html:option value="28">28</html:option>
<html:option value="29">29</html:option>
<html:option value="30">30</html:option>
<html:option value="31">31</html:option>
</html:select> месяц: <html:select property="month"
onchange="changeData(this.form)">
<html:option value="01">Январь</html:option>
<html:option value="02">Февраль</html:option>
<html:option value="03">Март</html:option>
<html:option value="04">Апрель</html:option>
<html:option value="05">Май</html:option>
<html:option value="06">Июнь</html:option>
<html:option value="07">Июль</html:option>
<html:option value="08">Август</html:option>
<html:option value="09">Сентябрь</html:option>
<html:option value="10">Октябрь</html:option>
<html:option value="11">Ноябрь</html:option>
<html:option value="12">Декабрь</html:option>
</html:select> год: <html:select property="year">
<html:option value="2003">2003</html:option>
<html:option value="2004">2004</html:option>
<html:option value="2005">2005</html:option>
<html:option value="2006">2006</html:option>
<html:option value="2007">2007</html:option>
<html:option value="2008">2008</html:option>
<html:option value="2009">2009</html:option>
<html:option value="2010">2010</html:option>
</html:select>
<html:radio property="data" value="odat"
onclick="dataChange(this.form,this.form.data)"></html:radio>отчетную
дату <html:text property="systemdata" size="8" /><br><hr>
<html:radio property="data" value="fdat"
onclick="dataChange(this.form, this.form.data)"></html:radio>пятидневку
<html:select property="fday">
<html:option value="01">1-5</html:option>
<html:option value="02">6-10</html:option>
<html:option value="03">11-15</html:option>
<html:option value="04">16-20</html:option>
<html:option value="05">21-25</html:option>
<html:option value="06">26-до конца месяца</html:option>
</html:select> месяц: <html:select property="fmonth">
<html:option value="01">Январь</html:option>
<html:option value="02">Февраль</html:option>
<html:option value="03">Март</html:option>
<html:option value="04">Апрель</html:option>
<html:option value="05">Май</html:option>
<html:option value="06">Июнь</html:option>
<html:option value="07">Июль</html:option>
<html:option value="08">Август</html:option>
<html:option value="09">Сентябрь</html:option>
<html:option value="10">Октябрь</html:option>
<html:option value="11">Ноябрь</html:option>
<html:option value="12">Декабрь</html:option>
</html:select> год: <html:select property="fyear">
<html:option value="2003">2003</html:option>
<html:option value="2004">2004</html:option>
<html:option value="2005">2005</html:option>
<html:option value="2006">2006</html:option>
<html:option value="2007">2007</html:option>
<html:option value="2008">2008</html:option>
<html:option value="2009">2009</html:option>
<html:option value="2010">2010</html:option>
</html:select>
<br>
<hr>
<html:radio property="data" value="f_month"
onclick="dataChange(this.form, this.form.data)"></html:radio>за месяц:
<html:select property="f_fmonth">
<html:option value="01">Январь</html:option>
<html:option value="02">Февраль</html:option>
<html:option value="03">Март</html:option>
<html:option value="04">Апрель</html:option>
<html:option value="05">Май</html:option>
<html:option value="06">Июнь</html:option>
<html:option value="07">Июль</html:option>
<html:option value="08">Август</html:option>
<html:option value="09">Сентябрь</html:option>
<html:option value="10">Октябрь</html:option>
<html:option value="11">Ноябрь</html:option>
<html:option value="12">Декабрь</html:option>
</html:select> год: <html:select property="f_fyear">
<html:option value="2003">2003</html:option>
<html:option value="2004">2004</html:option>
<html:option value="2005">2005</html:option>
<html:option value="2006">2006</html:option>
<html:option value="2007">2007</html:option>
<html:option value="2008">2008</html:option>
<html:option value="2009">2009</html:option>
<html:option value="2010">2010</html:option>
</html:select> <b></b>
<br>
<hr>
</div>
<div id="terminal" align="left"><html:radio property="ust"
value="all_set" onclick="ustChange(this.form,this.form.ust)"></html:radio>
все дороги сети <html:radio property="ust" value="dor"
onclick="ustChange(this.form,this.form.ust)"></html:radio>
дорога: <html:select property="dor">
<html:optionsCollection property="dors" />
</html:select>
<br>
<hr>
<div align=left><!--<html:radio property="kod" value="agent"
onclick="kodChange(this.form,this.form.kod)"></html:radio>--> Код
агента <html:select property="agent">
<html:optionsCollection property="agents" />
</html:select>
<br>
<br>
<!--<html:radio property="kod" value="per"
onclick="kodChange(this.form,this.form.kod)"></html:radio>-->
Код перевозчика
<html:select property="per">
<html:optionsCollection property="pers" />
</html:select>
<br>
<br>
<!--<html:radio property="kod" value="min"
onclick="kodChange(this.form,this.form.kod)"></html:radio>-->
Ведомство
<html:select property="min">
<html:optionsCollection property="mins" />
</html:select>
<br>
<br>
<html:checkbox property="chek_str" />учёт нулевых строк<br>
</div>
<hr>
<br>
<br>
<p align="center"><html:submit value="Выполнить запрос"
onclick="return doShow(this.form)"
style="width:140; position:relative; height: 20; text-align:Center; font-size:8pt; color:#000099; margin-left:14" />
</p>
<div align="right"><b>База данных: </b><html:select
property="abd">
<html:option value="EXPBD">Производственная</html:option>
<html:option value="EXPBDO">Отладочная</html:option>
</html:select> <br>
<br>
</div>
<br>
<table width="100%" border="0">
<tr>
<td align="left" valign="top">Разработчик: Сунгатуллина А.Т. <br>
<a>Руководитель: Ширман И.И.</a> <br>
<a>Почтовые адреса Intranet </a><br>
<a href="mailto:express@vniias.org.rzd">express@vniias.org.rzd</a> <br>
<a href="mailto:A.Sungatullina@vniias.org.rzd">A.Sungatullina@vniias.org.rzd</a>
<br>
Почтовый адрес Internet <br>
<a href="mailto:express@vniias.ru">express@vniias.ru</a></td>
<td align="right" valign="top"><a href="instr_dohodv.doc">инструкция</a> |
Версия 2.0</td>
</tr>
</table>
</html:form>
<HR>
</body>
</html>
error.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ page isErrorPage="true" %>
<html:html>
<HEAD>
<%@ page
language="java"
contentType="text/html; charset=CP1251"
pageEncoding="CP1251"
%>
<META http-equiv="Content-Type" content="text/html; charset=Windows-1251">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet"
type="text/css">
<TITLE>Кредитовые ведомства: Ошибка</TITLE>
</HEAD>
<BODY>
<P>Произошла ошибка:</P>
<html:errors/>
<ul>
<% if(exception!=null){%>
<%= exception.getMessage()
%>
<% } %>
</ul>
<p>
<%
String breakpoints=null;
breakpoints = ((String) request.getAttribute("breakpoints"));
if (breakpoints == null)
{
breakpoints = "";
}
%>
</p>
<%=breakpoints %>
<a href="javascript:history.back()">Вернуться назад</a>
</body>
</html:html>
VoinAction.java
package voin.actions;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.Vector;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.ParseException;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.TreeMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import voin.Classes.VoinClass;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.util.LabelValueBean;
import voin.Classes.JDBCConnection;
import voin.Forms.ArmVoinForm;
public class VoinAction extends Action
{
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws SQLException, Exception {
ArmVoinForm armvoinForm = (ArmVoinForm) form;
ActionErrors errors = new ActionErrors();
ActionForward forward = new ActionForward();
JDBCConnection jdbcConnection = new JDBCConnection();
Connection connec = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
PreparedStatement pstmt_name = null;
ResultSet rs_name = null;
PreparedStatement pstmtAll = null;
ResultSet rsAll = null;
PreparedStatement pstmt_min = null;
ResultSet rs_min = null;
HttpSession session = request.getSession(false);
VoinClass vc;
VoinClass vcAll;
VoinClass vc_min;
VoinClass set_vc;
ArrayList tableRows = new ArrayList();
ArrayList tableRowsAll = new ArrayList();
ArrayList tableRowsSet = new ArrayList();
try {
connec = jdbcConnection.getConnection();
String day = armvoinForm.getDay();
String month = armvoinForm.getMonth();
String year = armvoinForm.getYear();
String day_sys = armvoinForm.getDay_sys();
String month_sys = armvoinForm.getMonth_sys();
String year_sys = armvoinForm.getYear_sys();
String systemdata = armvoinForm.getSystemdata();
String dor = armvoinForm.getDor();
String data = armvoinForm.getData();
String data_sys = armvoinForm.getData_sys();
String ust = armvoinForm.getUst();
String kod = armvoinForm.getKod();
String abd = armvoinForm.getAbd();
//========fdat=====
String fday = armvoinForm.getFday();
String fmonth = armvoinForm.getFmonth();
String fyear = armvoinForm.getFyear();
//======f_month====
String f_fmonth = armvoinForm.getF_fmonth();
String f_fyear = armvoinForm.getF_fyear();
//-------???-------------
String agent = armvoinForm.getAgent();
String agent_name = armvoinForm.getAgent_name();
String per_name = armvoinForm.getPer_name();
String per = armvoinForm.getPer();
String min = armvoinForm.getMin();
String min_name = armvoinForm.getMin_name();
String nazvd = armvoinForm.getNazvd();
String oplata = armvoinForm.getOplata();
String moplata = armvoinForm.getMoplata();
String sumpd = armvoinForm.getSumpd();
String msumpd = armvoinForm.getMsumpd();
String kolpas = armvoinForm.getKolpas();
String mkolpas = armvoinForm.getMkolpas();
String sumpr = armvoinForm.getSumpr();
String msumpr = armvoinForm.getMsumpr();
String kolpr = armvoinForm.getKolpr();
String mkolpr = armvoinForm.getMkolpr();
String sumbag = armvoinForm.getSumbag();
String msumbag = armvoinForm.getMsumbag();
String kolbag = armvoinForm.getKolbag();
String mkolbag = armvoinForm.getMkolbag();
String komsbv = armvoinForm.getKomsbv();
String mkomsbv = armvoinForm.getMkomsbv();
String kolv = armvoinForm.getKolv();
String mkolv = armvoinForm.getMkolv();
boolean chek_str = armvoinForm.getChek_str();
String dohod_data = null;
String data_begin = "";
String data_end = "";
String begin_data = "";
String end_data = "";
String month_period = "x";
String year_period = "x";
String day_b = "";
String day_e = "";
String fmonth1 = "";
String dohod_dataAll = null;
String schet_data = null;
String schet_dataAll = null;
String FirstDor = "";
String DorFirst = "";
String FirstAgent = "";
String AgentFirst = "";
String PerFirst = "";
String FirstPer = "";
String NazvFirstDor = "";
String NazvDor = "";
String abds = "";
String dorGos = "";
int schet_row;
int kol_rowAll;
String kol_rowAlls = "";
String schet_rows = "0";
String schet_row_dors = "0";
String FirstAgent_name = "";
String FirstPer_name = "";
String cond2 = "";
String correct ="";
//=========ITOGO============
long ItogSumpd;
String ItogSumpdS = "";
long ItogMsumpd;
long ItogOplata;
long ItogMoplata;
long ItogKolpas;
long ItogMkolpas;
long ItogMsumpr;
long ItogSumpr;
long ItogKolpr;
long ItogMkolpr;
long ItogSumbag;
long ItogMsumbag;
long ItogKolbag;
long ItogMkolbag;
long ItogKomsbv;
long ItogMkomsbv;
long ItogKolv;
long ItogMkolv;
//====ITOG_ALL====
long ItogOplataAll;
long ItogMoplataAll;
long ItogSumpdAll;
String ItogSumpdAllS = "";
long ItogMsumpdAll;
long ItogKolpasAll;
long ItogMkolpasAll;
long ItogMsumprAll;
long ItogSumprAll;
long ItogKolprAll;
long ItogMkolprAll;
long ItogSumbagAll;
long ItogMsumbagAll;
long ItogKolbagAll;
long ItogMkolbagAll;
long ItogKomsbvAll;
long ItogMkomsbvAll;
long ItogKolvAll;
long ItogMkolvAll;
//========dop_usl====
String agent_query = "ЛЮБОЙ";
String per_query = "ЛЮБОЙ";
String min_query = "ЛЮБОЙ";
String min_query_gos = "ЛЮБОЙ";
//======ITOG_MIN=======
long ItogOplataMin;
long ItogMoplataMin;
long ItogSumpdMin;
long ItogMsumpdMin;
long ItogKolpasMin;
long ItogMkolpasMin;
long ItogMsumprMin;
long ItogSumprMin;
long ItogKolprMin;
long ItogMkolprMin;
long ItogSumbagMin;
long ItogMsumbagMin;
long ItogKolbagMin;
long ItogMkolbagMin;
long ItogKomsbvMin;
long ItogMkomsbvMin;
long ItogKolvMin;
long ItogMkolvMin;
//==================
String param_dor = "";
String dor_query = "";
String vis1=null;
String vis2=null;
vis1 = (String)session.getAttribute("vis1");
vis2 = (String)session.getAttribute("vis2");
String dorUser = null;
String gosUser = null;
dorUser = (String)session.getAttribute("dorUser");
gosUser = (String)session.getAttribute("gosUser");
//========MAP========
String[] ob_minNo = new String[15];
String[] ob_minName = new String[15];
String obName = "";
String obNazvd = "";
String obDor ="";
int j;
// ======ITOG_ALL==========
ItogOplata = 0;
ItogMoplata = 0;
ItogSumpd = 0;
ItogMsumpd = 0;
ItogKolpas = 0;
ItogMkolpas = 0;
ItogSumpr = 0;
ItogMsumpr = 0;
ItogKolpr = 0;
ItogMkolpr = 0;
ItogSumbag = 0;
ItogMsumbag = 0;
ItogKolbag = 0;
ItogMkolbag = 0;
ItogKomsbv = 0;
ItogMkomsbv = 0;
ItogKolv = 0;
ItogMkolv = 0;
//=====ITOG_ALL=====
ItogOplataAll = 0;
ItogMoplataAll = 0;
ItogSumpdAll = 0;
ItogMsumpdAll = 0;
ItogKolpasAll = 0;
ItogMkolpasAll = 0;
ItogSumprAll = 0;
ItogMsumprAll = 0;
ItogKolprAll = 0;
ItogMkolprAll = 0;
ItogSumbagAll = 0;
ItogMsumbagAll = 0;
ItogKolbagAll = 0;
ItogMkolbagAll = 0;
ItogKomsbvAll = 0;
ItogMkomsbvAll = 0;
ItogKolvAll = 0;
ItogMkolvAll = 0;
//=======Itog_min====
ItogOplataMin = 0;
ItogMoplataMin = 0;
ItogSumpdMin = 0;
ItogMsumpdMin = 0;
ItogKolpasMin = 0;
ItogMkolpasMin = 0;
ItogSumprMin = 0;
ItogMsumprMin = 0;
ItogKolprMin = 0;
ItogMkolprMin = 0;
ItogSumbagMin = 0;
ItogMsumbagMin = 0;
ItogKolbagMin = 0;
ItogMkolbagMin = 0;
ItogKomsbvMin = 0;
ItogMkomsbvMin = 0;
ItogKolvMin = 0;
ItogMkolvMin = 0;
//=======================
long SetItogOplata = 0;
long SetItogMoplata = 0;
long SetItogSumpd = 0;
long SetItogMsumpd = 0;
long SetItogKolpas = 0;
long SetItogMkolpas = 0;
long SetItogSumpr = 0;
long SetItogMsumpr = 0;
long SetItogKolpr = 0;
long SetItogMkolpr = 0;
long SetItogSumbag = 0;
long SetItogMsumbag = 0;
long SetItogKolbag = 0;
long SetItogMkolbag = 0;
long SetItogKomsbv = 0;
long SetItogMkomsbv = 0;
long SetItogKolv = 0;
long SetItogMkolv = 0;
int fm = 0;
int fy = 0;
//===========
schet_row = 0;
kol_rowAll = 0;
//=====valuta===
String nazvl ="";
int mkoef =0;
jdbcConnection.setDSConnection("java:comp/env/DataSourceRef");
connec = jdbcConnection.getConnection();
abds = abd;
year_sys = systemdata.substring(systemdata.length() - 4, systemdata
.length());
month_sys = systemdata.substring(systemdata.indexOf(".") + 1,
systemdata.indexOf(".") + 3);
day_sys = systemdata.substring(0, 2);
data_sys = year_sys+"-" + month_sys +"-" + day_sys;
//=========agent=====
String [] temp = null;
temp = agent.split("--");
agent = temp[0];
agent_query = temp[1];
//=======per==========
temp = null;
temp = per.split("--");
per = temp[0];
per_query = temp[1];
//======MIN==========
temp = null;
temp = min.split("--");
min = temp[0];
min_query = temp[1];
min_query_gos = temp[2];
//======valuta============
String query_kodG ="";
if (!ust.equals("all_set")){
temp=null;
temp = dor.split("--");
dor = temp[0];
dor_query = dor.toString();
if (!dor.equals("*"))
dorGos = temp[1];
}
//====kodGos=====
if ((ust.equals("dor") && dor.equals("*"))||(ust.equals("all_set")))
{
query_kodG = " SELECT GOS_ABD FROM EXPBD.SERV ";
pstmt = connec.prepareStatement(query_kodG);
rs = pstmt.executeQuery();
while(rs.next()){
dorGos = rs.getString(1);
}
rs.close();
pstmt.close();
}
//===========valuta=====
String query_valut ="";
query_valut = "SELECT NAZVL, MKOEF FROM EXPBD.VALUT WHERE DATAN<='" +data_sys+ "' AND " +
" DATAK>='" +data_sys+ "' AND GOS = '" +dorGos+ "' " ;
pstmt = connec.prepareStatement(query_valut);
rs = pstmt.executeQuery();
while(rs.next()){
nazvl = rs.getString(1);
mkoef = rs.getInt(2);
}
rs.close();
pstmt.close();
//=====fdat========================
if (data.equals("fdat")){
if (fday.equals("01")){
day_b = "01";
day_e = "05";
}
if (fday.equals("02")){
day_b = "06";
day_e = "10";
}
if (fday.equals("03")){
day_b = "11";
day_e = "15";
}
if (fday.equals("04")){
day_b = "16";
day_e = "20";
}
if (fday.equals("05")){
day_b = "21";
day_e = "25";
}
if (fday.equals("06")){
day_b = "26";
day_e = "01";
}
if(!fday.equals("06")){
data_begin = fyear+"-" + fmonth +"-" + day_b;
data_end = fyear+"-" + fmonth +"-" + day_e;
begin_data = day_b+"-" + fmonth +"-" +fyear;
end_data = day_e+"-" + fmonth +"-" +fyear;
}
if(fday.equals("06")){
data_begin = fyear + "-" + fmonth + "-" + day_b;
begin_data = day_b+"-" + fmonth +"-" +fyear;
fm = Integer.parseInt(fmonth);
fm++;
if (fm>12){
fm = 1;
fy = Integer.parseInt(fyear);
fy++;
fyear = Integer.toString(fy);
}
fmonth1 = Integer.toString(fm);
fm = fmonth1.length();
if (fm==1){
data_end = fyear+"-" + "0" + fmonth1 +"-" + day_e;
end_data = day_e+"-" + "0" + fmonth1 +"-" +fyear;
}
else{
data_end = fyear+"-" + fmonth1 +"-" + day_e;
end_data = day_e+"-" + fmonth1 +"-" +fyear;
}
}
}
//======f_month====================
if(data.equals("f_month")){
day_b = "01";
day_e = "01";
fm = Integer.parseInt(f_fmonth);
data_begin = f_fyear+"-" + f_fmonth +"-" + day_b;
begin_data = day_b+"-" + f_fmonth +"-" + f_fyear;
year_period = f_fyear;
fm++;
if (fm>12){
fm = 1;
fy = Integer.parseInt(f_fyear);
fy++;
f_fyear = Integer.toString(fy);
}
fmonth1 = Integer.toString(fm);
fm = fmonth1.length();
if (fm==1){
data_end = f_fyear+"-" + "0" + fmonth1 +"-" + day_e;
end_data = day_e+"-" + "0" + fmonth1 +"-" + f_fyear;
}
else{
data_end = f_fyear+"-" + fmonth1 +"-" + day_e;
end_data = day_e+"-" + fmonth1 +"-" +f_fyear;
}
if (f_fmonth.equals("01")){
month_period = "январь";
}
if (f_fmonth.equals("02")){
month_period = "февраль";
}
if (f_fmonth.equals("03")){
month_period = "март";
}
if (f_fmonth.equals("04")){
month_period = "апрель";
}
if (f_fmonth.equals("05")){
month_period = "май";
}
if (f_fmonth.equals("06")){
month_period = "июнь";
}
if (f_fmonth.equals("07")){
month_period = "июль";
}
if (f_fmonth.equals("08")){
month_period = "август";
}
if (f_fmonth.equals("09")){
month_period = "сентябрь";
}
if (f_fmonth.equals("10")){
month_period = "октябрь";
}
if (f_fmonth.equals("11")){
month_period = "ноябрь";
}
if (f_fmonth.equals("12")){
month_period = "декабрь";
}
}
// ============QUERY MIN========
if (min.equals("*")){
if (dorUser != null && !dorUser.equals("@") && !dorUser.equals("*")){
cond2 = " AND GOS = ? ";
}
if (dorUser != null && dorUser.equals("*")) {
cond2 = " AND GOS = ? ";
}
if (dorUser !=null && dorUser.equals("@")) {
cond2 = " AND GOS = S.GOS_ABD ";
}
String query_min="SELECT DISTINCT NOMMV, NAME, GOS FROM EXPBD.LGOT ";
if (dorUser != null && dorUser.equals("@")){
query_min += ", EXPBD.SERV S ";
}
query_min += " WHERE CURRENT_DATE>=DATAN AND CURRENT_DATE<=DATAOT " +
" AND NOMMV<>0 " + cond2;
pstmt_min = connec.prepareStatement(query_min);
if (dorUser != null && !dorUser.equals("@")) {
pstmt_min.setString(1, gosUser);
}
rs_min = pstmt_min.executeQuery();
String minNo ="";
String minName ="";
j=0;
while (rs_min.next()){
ob_minNo[j] = rs_min.getString(1);
ob_minName[j] = rs_min.getString(2);
j++;
}
rs_min.close();
pstmt_min.close();
}
//====data===
if (data == null) {
errors
.add("errorNoSession", new ActionError(
"error.NoSession"));
throw new Exception();
}
if (data.equals("odat")) {
year = systemdata.substring(systemdata.length() - 4, systemdata.length());
month = systemdata.substring(systemdata.indexOf(".") + 1,
systemdata.indexOf(".") + 3);
day = systemdata.substring(0, 2);
}
if(!data.equals("fdat") && (!data.equals("f_month"))){
dohod_data = year+"-" + month +"-" + day;
schet_dataAll = day+"-" + month +"-" +year;
}
//========================
if ((ust.equals("dor")) && (dor.equals("*")) && (!agent.equals("**")) && (!per.equals("**")))
{
// =====================================
String queryAll = "";
if (data == null) {
errors.add("errorNoSession", new ActionError(
"error.NoSession"));
throw new Exception();
}
if (data.equals("odat")) {
year = systemdata.substring(systemdata.length() - 4, systemdata
.length());
month = systemdata.substring(systemdata.indexOf(".") + 1,
systemdata.indexOf(".") + 3);
day = systemdata.substring(0, 2);
}
if(!data.equals("fdat") && (!data.equals("f_month"))){
dohod_data = year+"-" + month +"-" + day;
schet_dataAll = day+"-" + month +"-" +year;
}
if (min.equals("*")){
queryAll = " SELECT A.MIN, SUM(A.SUMPD), SUM(A.MSUMPD), SUM(A.KOLPAS), SUM(A.MKOLPAS), "+
" SUM(A.SUMPR), SUM(A.MSUMPR), SUM(A.KOLPR), SUM(A.MKOLPR), " +
" SUM(A.SUMBAG), SUM(A.MSUMBAG), SUM(A.KOLBAG), SUM(A.MKOLBAG), " +
" SUM(A.KOMSBV), SUM(A.MKOMSBV), SUM(A.KOLV), SUM(A.MKOLV), B.NAME " +
" FROM " +abds+ ".DOHODV A ";
if (!chek_str){
queryAll += ", ";
}
if(chek_str){
queryAll += " LEFT OUTER JOIN ";
}
queryAll += " (SELECT DISTINCT NAME, NOMMV, S.GOS_ABD FROM EXPBD.LGOT, EXPBD.SERV S ";
queryAll+=" WHERE GOS = S.GOS_ABD AND ";
if(vis1 != null && vis1.equals("1")){
queryAll += " GOS='20' AND ";
}
if(!data.equals("fdat") && (!data.equals("f_month"))){
queryAll += " DATAN<='" +dohod_data+ "' AND " +
" DATAOT>= '" +dohod_data+ "') B ";
if(chek_str) {
queryAll += " ON A.MIN=B.NOMMV ";
}
queryAll += " WHERE A.DATA = ? AND A.MES ='" +month+ "' AND ";
}
if(data.equals("fdat") && !fday.equals("06")){
queryAll += " DATAN<='" +data_end+ "' AND " +
" DATAOT>= '" +data_end+ "') B ";
if(chek_str) {
queryAll += " ON A.MIN=B.NOMMV ";
}
queryAll +=" WHERE A.DATA <='" +data_end+ "' AND A.DATA>= '" +data_begin+ "' AND A.MES ='" +fmonth+ "' AND ";
}
if(data.equals("fdat") && fday.equals("06")){
queryAll += " DATAN<'" +data_end+ "' AND " +
" DATAOT >='" +data_end+ "') B ";
if(chek_str){
queryAll += " ON A.MIN=B.NOMMV ";
}
queryAll +=" WHERE A.DATA <'" +data_end+ "' AND A.DATA>= '" +data_begin+ "' AND A.MES ='" +fmonth+ "' AND ";
}
if(data.equals("f_month")){
queryAll += " DATAN<'" +data_end+ "' AND " +
" DATAOT>='" +data_end+ "') B ";
if(chek_str){
queryAll += " ON A.MIN=B.NOMMV ";
}
queryAll += " WHERE A.DATA <'" +data_end+ "' AND A.DATA>= '" +data_begin+ "' AND A.MES ='" +f_fmonth+ "' AND ";
}
queryAll +=" A.MIN=B.NOMMV ";
if (!min.equals("*")){
queryAll += " AND A.MIN = ? ";
// queryAll += " AND B.NAME = ? ";
}
//====
if (!agent.equals("*")){
queryAll+= " AND A.AGENT = ? ";
}
if (!per.equals("*"))
{
queryAll += " AND A.SKP = ? ";
}
//====
queryAll += " GROUP BY A.MIN, B.NAME ";
queryAll += " ORDER BY A.MIN, B.NAME ";
int schetAll = 1;
pstmtAll = connec.prepareStatement(queryAll);
if(!data.equals("fdat") && (!data.equals("f_month"))){
pstmtAll.setString(schetAll++,dohod_data.toString());
}
if (min!= null && !min.equals("*")){
pstmtAll.setString(schetAll++,min.toString());
}
if (agent!= null && !agent.equals("*")){
pstmtAll.setString(schetAll++,agent.toString());
}
if (per!= null && !per.equals("*")){
pstmtAll.setString(schetAll++,per.toString());
}
}
else if (!min.equals("*")) {
queryAll = " SELECT A.MIN, SUM(A.SUMPD), SUM(A.MSUMPD), SUM(A.KOLPAS), SUM(A.MKOLPAS), "+
" SUM(A.SUMPR), SUM(A.MSUMPR), SUM(A.KOLPR), SUM(A.MKOLPR), " +
" SUM(A.SUMBAG), SUM(A.MSUMBAG), SUM(A.KOLBAG), SUM(A.MKOLBAG), " +
" SUM(A.KOMSBV), SUM(A.MKOMSBV), SUM(A.KOLV), SUM(A.MKOLV) " +
" FROM " +abds+ ".DOHODV A, " +
" (SELECT DISTINCT NAME, NOMMV, S.GOS_ABD FROM EXPBD.LGOT, EXPBD.SERV S ";
queryAll+=" WHERE GOS = S.GOS_ABD AND ";
if(vis1 != null && vis1.equals("1")){
queryAll += " GOS='20' AND ";
}
if(!data.equals("fdat") && (!data.equals("f_month"))){
queryAll += " DATAN<='" +dohod_data+ "' AND " +
" DATAOT>= '" +dohod_data+ "') B " +
" WHERE A.DATA = ? AND A.MES ='" +month+ "' AND ";
}
if(data.equals("fdat") && !fday.equals("06")){
queryAll += " DATAN<='" +data_end+ "' AND " +
" DATAOT>= '" +data_end+ "') B " +
" WHERE A.DATA <='" +data_end+ "' AND A.DATA>= '" +data_begin+ "' AND A.MES ='" +fmonth+ "' AND ";
}
if(data.equals("fdat") && fday.equals("06")){
queryAll += " DATAN<'" +data_end+ "' AND " +
" DATAOT >='" +data_end+ "') B " +
" WHERE A.DATA <'" +data_end+ "' AND A.DATA>= '" +data_begin+ "' AND A.MES ='" +fmonth+ "' AND ";
}
if(data.equals("f_month")){
queryAll += " DATAN<'" +data_end+ "' AND " +
" DATAOT>='" +data_end+ "') B " +
" WHERE A.DATA <'" +data_end+ "' AND A.DATA>= '" +data_begin+ "' AND A.MES ='" +f_fmonth+ "' AND ";
}
queryAll +=" A.MIN=B.NOMMV ";
if (!min.equals("*")){
queryAll += " AND A.MIN = ? ";
// queryAll += " AND B.NAME = ? ";
}
//====
if (!agent.equals("*")){
queryAll+= " AND A.AGENT = ? ";
}
if (!per.equals("*"))
{
queryAll += " AND A.SKP = ? ";
}
//====
queryAll += " GROUP BY A.MIN ";
int schetAll = 1;
pstmtAll = connec.prepareStatement(queryAll);
if(!data.equals("fdat") && (!data.equals("f_month"))){
pstmtAll.setString(schetAll++,dohod_data.toString());
}
if (min!= null && !min.equals("*")){
pstmtAll.setString(schetAll++,min.toString());
}
if (agent!= null && !agent.equals("*")){
pstmtAll.setString(schetAll++,agent.toString());
}
if (per!= null && !per.equals("*")){
pstmtAll.setString(schetAll++,per.toString());
}
}
request.setAttribute("breakpoints", "2");
rsAll = pstmtAll.executeQuery();
request.setAttribute("breakpoints", "3");
//====================================
ItogSumpdAllS = "x";
while (rsAll.next()){
vcAll = new VoinClass();
if (!chek_str){
if( !rsAll.getString(2).equals("0") || !rsAll.getString(3).equals("0") || !rsAll.getString(4).equals("0") ||
!rsAll.getString(5).equals("0") || !rsAll.getString(6).equals("0") || !rsAll.getString(7).equals("0") ||
!rsAll.getString(8).equals("0") || !rsAll.getString(9).equals("0") || !rsAll.getString(10).equals("0") ||
!rsAll.getString(11).equals("0") || !rsAll.getString(12).equals("0") || !rsAll.getString(13).equals("0") ||
!rsAll.getString(14).equals("0") || !rsAll.getString(15).equals("0") || !rsAll.getString(16).equals("0") ||
!rsAll.getString(17).equals("0") )
{
if(min.equals("*"))
vcAll.setMin_name(rsAll.getString(18));
else
vcAll.setMin_name("");
vcAll.setMin(rsAll.getString(1));
vcAll.setOplata(MainFormat(rsAll.getLong(2) + rsAll.getLong(10), mkoef));
ItogOplataAll = rsAll.getLong(2) + rsAll.getLong(10) + ItogOplataAll;
vcAll.setMoplata(MainFormat(rsAll.getLong(3) + rsAll.getLong(11), mkoef));
ItogMoplataAll = rsAll.getLong(3) + rsAll.getLong(11) + ItogMoplataAll;
vcAll.setSumpd(MainFormat(rsAll.getLong(2)-rsAll.getLong(6),mkoef));
ItogSumpdAll = rsAll.getLong(2)-rsAll.getLong(6) + ItogSumpdAll;
ItogSumpdAllS=Long.toString(ItogSumpdAll);
vcAll.setMsumpd(MainFormat(rsAll.getLong(3)-rsAll.getLong(7),mkoef));
ItogMsumpdAll = rsAll.getLong(3) - rsAll.getLong(7)+ItogMsumpdAll;
vcAll.setKolpas(integerFormat(rsAll.getLong(4)-rsAll.getLong(8)));
ItogKolpasAll = rsAll.getLong(4)-rsAll.getLong(8)+ItogKolpasAll;
vcAll.setMkolpas(integerFormat(rsAll.getLong(5)-rsAll.getLong(9)));
ItogMkolpasAll =rsAll.getLong(5)-rsAll.getLong(9)+ItogMkolpasAll;
vcAll.setSumpr(MainFormat(rsAll.getLong(6),mkoef));
ItogSumprAll = rsAll.getLong(6)+ItogSumprAll;
vcAll.setMsumpr(MainFormat(rsAll.getLong(7),mkoef));
ItogMsumprAll = rsAll.getLong(7)+ItogMsumprAll;
vcAll.setKolpr(integerFormat(rsAll.getLong(8)));
ItogKolprAll = rsAll.getLong(8)+ItogKolprAll;
vcAll.setMkolpr(integerFormat(rsAll.getLong(9)));
ItogMkolprAll = rsAll.getLong(9)+ItogMkolprAll;
vcAll.setSumbag(MainFormat(rsAll.getLong(10),mkoef));
ItogSumbagAll = rsAll.getLong(10)+ItogSumbagAll;
vcAll.setMsumbag(MainFormat(rsAll.getLong(11),mkoef));
ItogMsumbagAll =rsAll.getLong(11)+ItogMsumbagAll;
vcAll.setKolbag(integerFormat(rsAll.getLong(12)));
ItogKolbagAll =rsAll.getLong(12)+ItogKolbagAll;
vcAll.setMkolbag(integerFormat(rsAll.getLong(13)));
ItogMkolbagAll =rsAll.getLong(13)+ItogMkolbagAll;
vcAll.setKomsbv(MainFormat(rsAll.getLong(14),mkoef));
ItogKomsbvAll =rsAll.getLong(14)+ItogKomsbvAll;
vcAll.setMkomsbv(MainFormat(rsAll.getLong(15),mkoef));
ItogMkomsbvAll = rsAll.getLong(15)+ItogMkomsbvAll;
vcAll.setKolv(integerFormat(rsAll.getLong(16)));
ItogKolvAll = rsAll.getLong(16)+ItogKolvAll;
vcAll.setMkolv(integerFormat(rsAll.getLong(17)));
ItogMkolvAll = rsAll.getLong(17)+ItogMkolvAll;
tableRowsAll.add(vcAll);
}
}
if (chek_str && !rsAll.getString(1).equals("0")){
if(min.equals("*"))
vcAll.setMin_name(rsAll.getString(18));
else
vcAll.setMin_name("");
vcAll.setMin(rsAll.getString(1));
vcAll.setOplata(MainFormat(rsAll.getLong(2) + rsAll.getLong(10), mkoef));
ItogOplataAll = rsAll.getLong(2) + rsAll.getLong(10) + ItogOplataAll;
vcAll.setMoplata(MainFormat(rsAll.getLong(3) + rsAll.getLong(11), mkoef));
ItogMoplataAll = rsAll.getLong(3) + rsAll.getLong(11) + ItogMoplataAll;
vcAll.setSumpd(MainFormat(rsAll.getLong(2)-rsAll.getLong(6),mkoef));
ItogSumpdAll = rsAll.getLong(2)-rsAll.getLong(6) + ItogSumpdAll;
ItogSumpdAllS=Long.toString(ItogSumpdAll);
vcAll.setMsumpd(MainFormat(rsAll.getLong(3)-rsAll.getLong(7),mkoef));
ItogMsumpdAll = rsAll.getLong(3) - rsAll.getLong(7)+ItogMsumpdAll;
vcAll.setKolpas(integerFormat(rsAll.getLong(4)-rsAll.getLong(8)));
ItogKolpasAll = rsAll.getLong(4)-rsAll.getLong(8)+ItogKolpasAll;
vcAll.setMkolpas(integerFormat(rsAll.getLong(5)-rsAll.getLong(9)));
ItogMkolpasAll =rsAll.getLong(5)-rsAll.getLong(9)+ItogMkolpasAll;
vcAll.setSumpr(MainFormat(rsAll.getLong(6),mkoef));
ItogSumprAll = rsAll.getLong(6)+ItogSumprAll;
vcAll.setMsumpr(MainFormat(rsAll.getLong(7),mkoef));
ItogMsumprAll = rsAll.getLong(7)+ItogMsumprAll;
vcAll.setKolpr(integerFormat(rsAll.getLong(8)));
Подобные документы
Требования к системе проектирования информационной системы финансового контроля. Информационное, программное и техническое обеспечение автоматизированной системы. Алгоритмы и модели работы базы данных, созданной в среде разработки Borland Delphi 7.0.
дипломная работа [1,2 M], добавлен 25.10.2013Проектирование программы для предприятия ООО "Чудо свечи" в среде программирования Borland Delphi. Произведение расчета системы методом аддитивной оптимизации. Требования к функциям, выполняемым системой, к программному и аппаратному обеспечению.
курсовая работа [2,8 M], добавлен 27.02.2015Структурно–функциональная модель системы проведения соревнований школьников. Формирование требований к проектируемой автоматизированной системе обработки информации и управления. Разработка концепции и документации, анализ и выявление ключевых процессов.
дипломная работа [3,4 M], добавлен 04.03.2014Создание автоматизированной системы c помощью MS SqlServer 2005. Результат работы запроса выборки с вычисляемым значением и сортировкой. Разработка технологий доступа к базе данных, клиентского приложения. Требования к программному обеспечению.
курсовая работа [3,9 M], добавлен 28.06.2011Определение назначения и описание функций имитационных моделей стохастических процессов систем массового обслуживания. Разработка модели описанной системы в виде Q-схемы и программы на языке GPSS и C#. Основные показатели работы имитационной модели.
курсовая работа [487,4 K], добавлен 18.12.2014Управление процессами операционных систем. Разработка программы, моделирующей обслуживание множества вычислительных процессов в системе с 4 очередями, определяемыми значениями приоритетов. Выполнение инструкций компьютерной программы на процессоре.
контрольная работа [302,7 K], добавлен 06.08.2013Построение имитационной модели системы массового обслуживания, список и содержание ее активностей. Блок-схема алгоритма моделирования и текст процедуры. Моделирование случайных независимых величин и процессов. Оптимизация системы массового обслуживания.
курсовая работа [4,0 M], добавлен 28.05.2013Система GPSS World как мощная универсальная среда моделирования как дискретных, так и непрерывных процессов, предназначенная для профессионального моделирования самых разнообразных процессов и систем. Системы массового обслуживания. Листинг программы.
курсовая работа [499,6 K], добавлен 25.12.2013Требования к функциям и задачам, выполняемым системой "Подбор кредита ОАО "Россельхозбанк". Проектирование архитектуры программного продукта. Структурная схема программного продукта. Описание компонент программного обеспечения. План менеджмента проекта.
курсовая работа [684,0 K], добавлен 03.05.2015События для создания процесса при запуске операционной системы. Распределении времени процессоров между выполняющимися процессами. Программа, реализующая модель обслуживания процессов с абсолютными приоритетами обслуживания и заданным квантом времени.
контрольная работа [142,4 K], добавлен 09.12.2013