Commit 5f0b6e57 authored by IT18195194-Karunaratne J.M.P.D's avatar IT18195194-Karunaratne J.M.P.D

Merge branch 'v1/be/IT18195194/summarization_and_price_analyzer' into 'development'

V1/be/it18195194/summarization and price analyzer

See merge request !2
parents d68b237f dca7ba83
...@@ -3,7 +3,7 @@ from django.db.models.fields import AutoField ...@@ -3,7 +3,7 @@ from django.db.models.fields import AutoField
# Create your models here. # Create your models here.
#User Table
class Users(models.Model): class Users(models.Model):
UserID = models.AutoField(primary_key=True) UserID = models.AutoField(primary_key=True)
UserEmpID = models.CharField(max_length=5, default='00000') UserEmpID = models.CharField(max_length=5, default='00000')
...@@ -37,7 +37,7 @@ class G_POST_V(models.Model): ...@@ -37,7 +37,7 @@ class G_POST_V(models.Model):
District = models.CharField(max_length=50) District = models.CharField(max_length=50)
Description = models.CharField(max_length=2000) Description = models.CharField(max_length=2000)
#Create Commoditity Value Table
class Commodity(models.Model): class Commodity(models.Model):
ITEM = models.AutoField(primary_key=True) ITEM = models.AutoField(primary_key=True)
GAZETTE = models.CharField(max_length=4, default="N/A") GAZETTE = models.CharField(max_length=4, default="N/A")
...@@ -67,7 +67,7 @@ class Exm(models.Model): ...@@ -67,7 +67,7 @@ class Exm(models.Model):
url = models.CharField(max_length=20000) url = models.CharField(max_length=20000)
cat = models.CharField(max_length=100) cat = models.CharField(max_length=100)
#Compare Table created
class ComCompare(models.Model): class ComCompare(models.Model):
id = models.AutoField(primary_key=True) id = models.AutoField(primary_key=True)
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
......
...@@ -119,6 +119,8 @@ class Summarizer_: ...@@ -119,6 +119,8 @@ class Summarizer_:
print("") print("")
return "Summarized result: \n" + str(lll) return "Summarized result: \n" + str(lll)
#Price_Analizer
def commodityPriceHandler(): def commodityPriceHandler():
pdfFiles = [] pdfFiles = []
...@@ -155,7 +157,7 @@ class Summarizer_: ...@@ -155,7 +157,7 @@ class Summarizer_:
csvFile, sep=",", encoding='cp1252', usecols=[0, 2], header=None) csvFile, sep=",", encoding='cp1252', usecols=[0, 2], header=None)
c = 2 c = 2
if c == 1: if c == 1:
for index, row in priceData.iterrows(): for index, row in priceData.iterrows():
if 'Rs.' in str(row): if 'Rs.' in str(row):
print(row[0], row[3]) print(row[0], row[3])
...@@ -167,4 +169,4 @@ class Summarizer_: ...@@ -167,4 +169,4 @@ class Summarizer_:
if 'Rs.' in str(row): if 'Rs.' in str(row):
print(row[0], row[2]) print(row[0], row[2])
Commodity.objects.create( Commodity.objects.create(
NAME=row[0], NEWPRICE=row[2], GAZETTE=gnumber) NAME=row[0], NEWPRICE=row[2], GAZETTE=gnumber)
from django.conf.urls import url from django.conf.urls import url
from CgpApp import views from CgpApp import views
#URL created to connect Apis
urlpatterns = [ urlpatterns = [
url(r'^gazette/$', views.gazetteApi), url(r'^gazette/$', views.gazetteApi),
url(r'^gazette/([0-9]+)$', views.gazetteApi), url(r'^gazette/([0-9]+)$', views.gazetteApi),
......
...@@ -15,7 +15,7 @@ import CommodityView from "./components/CommodityView"; ...@@ -15,7 +15,7 @@ import CommodityView from "./components/CommodityView";
import { BrowserRouter, NavLink, Route, Switch } from "react-router-dom"; import { BrowserRouter, NavLink, Route, Switch } from "react-router-dom";
import GazetteDetailView from "./components/GazetteDetailView"; import GazetteDetailView from "./components/GazetteDetailView";
import Exam from "./components/Exam"; import Exam from "./components/Exam";
//Login Created
function App(props) { function App(props) {
const [user, setuser] = useState({ empid: "", password: "", dep: "" }); const [user, setuser] = useState({ empid: "", password: "", dep: "" });
const [error, setError] = useState(""); const [error, setError] = useState("");
......
...@@ -43,6 +43,8 @@ export default function CommodityView() { ...@@ -43,6 +43,8 @@ export default function CommodityView() {
let location = useLocation(); let location = useLocation();
console.log(location.state.gno); console.log(location.state.gno);
//Price Analyzer Table Created
//Price Analyzer Graph Created 84-100
return ( return (
<div className="custom-container p-2"> <div className="custom-container p-2">
<Container className="p-2"> <Container className="p-2">
...@@ -79,6 +81,7 @@ export default function CommodityView() { ...@@ -79,6 +81,7 @@ export default function CommodityView() {
style={{ width: 20, height: 20, marginTop: 10 }} style={{ width: 20, height: 20, marginTop: 10 }}
/> />
)} )}
</Col> </Col>
</Row> </Row>
))} ))}
......
...@@ -20,7 +20,7 @@ export default function Login({ login, error }) { ...@@ -20,7 +20,7 @@ export default function Login({ login, error }) {
}); });
// login(user); // login(user);
}; };
// Guest Login Created
const clickHandler = () => { const clickHandler = () => {
// e.preventDefault(); // e.preventDefault();
setuser({ empid: "Guest", password: "", dep: "Guest" }); setuser({ empid: "Guest", password: "", dep: "Guest" });
......
import React from "react"; import React from "react";
//Full Description of the Summerization Pop Up Created
class Popup extends React.Component { class Popup extends React.Component {
render() { render() {
return ( return (
......
...@@ -2,6 +2,8 @@ import React, { Component } from "react"; ...@@ -2,6 +2,8 @@ import React, { Component } from "react";
import PowerbiEmbedded from "powerbi-client-react"; import PowerbiEmbedded from "powerbi-client-react";
import data from "./data"; import data from "./data";
//Embeded Power BI Graph created
class PowerBi extends Component { class PowerBi extends Component {
onEmbedded = (_dataRecived) => { onEmbedded = (_dataRecived) => {
console.log("data", _dataRecived); console.log("data", _dataRecived);
......
...@@ -39,6 +39,8 @@ const LoadingIndicator = (props) => { ...@@ -39,6 +39,8 @@ const LoadingIndicator = (props) => {
); );
}; };
//Full Description popup added to the Vacancy summerization
export default function Vacancy() { export default function Vacancy() {
const [vac, setVac] = useState([]); const [vac, setVac] = useState([]);
const [filteredData, setFilteredData] = useState(vac); const [filteredData, setFilteredData] = useState(vac);
...@@ -53,6 +55,7 @@ export default function Vacancy() { ...@@ -53,6 +55,7 @@ export default function Vacancy() {
fetchVacancy(); fetchVacancy();
} }
function fetchVacancy() { function fetchVacancy() {
trackPromise( trackPromise(
fetch(process.env.REACT_APP_API + "postvacancy/" + selectedClient) fetch(process.env.REACT_APP_API + "postvacancy/" + selectedClient)
......
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