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