NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.kickidler.server;

import com.kickidler.server.company.Company;
import com.kickidler.server.company.ICompanyService;
import com.kickidler.server.company.Language;
import com.kickidler.server.currency.Currency;
import com.kickidler.server.currency.ICurrencyService;
import com.kickidler.server.invite.IInviteService;
import com.kickidler.server.invite.Invite;
import com.kickidler.server.payments.IPaymentService;
import com.kickidler.server.payments.Payment;
import com.kickidler.server.price.IPriceService;
import com.kickidler.server.price.Price;
import com.kickidler.server.pricegrid.IPriceGridService;
import com.kickidler.server.pricegrid.PriceGrid;
import com.kickidler.server.settings.ISettingsService;
import com.kickidler.server.settings.Settings;
import com.kickidler.server.structure.IStructureService;
import com.kickidler.server.unit.grabber.Grabber;
import com.kickidler.server.unit.grabber.GrabberService;
import com.kickidler.server.unit.server.Server;
import com.kickidler.server.unit.server.ServerService;
import com.kickidler.server.unit.viewer.Viewer;
import com.kickidler.server.unit.viewer.ViewerService;
import java.math.BigDecimal;
import java.util.Calendar;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
*
* @author pashaev_timur
*/
@Component
public class Initializer {

@Autowired
private IPriceService prs;

@Autowired
private IInviteService is;

@Autowired
private IStructureService strs;

@Autowired
private ServerService ss;

@Autowired
private ICurrencyService currencyService;

@Autowired
private IPaymentService ps;

@Autowired
private ViewerService vs;

@Autowired
private GrabberService gs;

@Autowired
private ICompanyService cs;

@Autowired
private ISettingsService settingsService;

@Autowired
private IPriceGridService priceGridService;

/**
* Функция, которая заполняет базу начальными данными, выполняется при старте проекта
*
*/
@PostConstruct
protected void initialize() {
if (cs.findById(1) != null) {
return;
}
Currency c;
if ((c = currencyService.findByName("RUB")) == null) {
c = currencyService.create("RUB");
}
Company company = cs.create(c, "OPEN BUSINESS SOLUTIONS", Language.Russian);

Calendar priceDate = Calendar.getInstance();
priceDate.set(Calendar.HOUR_OF_DAY, 1);
priceDate.set(Calendar.MINUTE, 0);
priceDate.set(Calendar.SECOND, 0);
priceDate.set(Calendar.MILLISECOND, 0);

Price price = new Price();
price.setValue(BigDecimal.valueOf(100));
prs.create(price);

price = new Price();
price.setValue(BigDecimal.valueOf(75));
prs.create(price);

Settings settings = new Settings();
settings.setCreatingDate(Calendar.getInstance());
settings.setDuartionTrial(30);
settings.setExtebsionLicense(30);
settings.setWarningTrial(7);
settings.setWarningLicense(30);
settingsService.create(settings);

Invite groupInvite = is.createGroupInvite(company);

Server srv = new Server();
srv.setName("бигдев");
srv.setHardwareKey("SD145857ZC");
srv.setIp("192.168.1.39");
srv = ss.create(groupInvite, srv);
Server serv = new Server();
serv.setName("локальный");
serv.setHardwareKey("SD145358GX");
serv.setIp("192.168.1.34");
serv = ss.create(groupInvite, serv);

strs.createFilial(company, "Москва");
strs.createFilial(company, "Ростов");

Payment p = ps.create(company, BigDecimal.valueOf(11100), company.getCurrency());
p.setType(Payment.Type.DEBET);
ps.update(p);

Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);

Grabber grabber = new Grabber();
grabber.setHardwareKey("GR34654WZ");
grabber.setName("nevezhin");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WX");
grabber.setName("potapov");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WC");
grabber.setName("gusev");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WV");
grabber.setName("kovjogin");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WB");
grabber.setName("furmanov");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WN");
grabber.setName("nikolayev");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WM");
grabber.setName("sadovoy");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WA");
grabber.setName("vredniska");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WS");
grabber.setName("sokurenko");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WD");
grabber.setName("abu_halil");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WF");
grabber.setName("dankovtseva");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WG");
grabber.setName("akimenko");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WH");
grabber.setName("bek");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WJ");
grabber.setName("bereznyak");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WK");
grabber.setName("rekunkov");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WL");
grabber.setName("melnik");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WQ");
grabber.setName("nekrasov");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WW");
grabber.setName("mudragel");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WE");
grabber.setName("kravchuk");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WR");
grabber.setName("krasnikov");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

grabber = new Grabber();
grabber.setHardwareKey("GR34654WT");
grabber.setName("tihonov");
grabber.setStructure(strs.getDefault(company));
gs.create(groupInvite, grabber);

Viewer viewer = new Viewer();
viewer.setCompany(company);
viewer.setHardwareKey("VW235345RY");
viewer.setName("dankovtseva");
vs.create(groupInvite, viewer);

viewer = new Viewer();
viewer.setCompany(company);
viewer.setHardwareKey("VW235345RU");
viewer.setName("badalyan");
vs.create(groupInvite, viewer);

viewer = new Viewer();
viewer.setCompany(company);
viewer.setHardwareKey("VW235345RI");
viewer.setName("soloviev");
vs.create(groupInvite, viewer);

viewer = new Viewer();
viewer.setCompany(company);
viewer.setHardwareKey("VW235345RO");
viewer.setName("muralova");
vs.create(groupInvite, viewer);

viewer = new Viewer();
viewer.setCompany(company);
viewer.setHardwareKey("VW235345RP");
viewer.setName("sadkevich");
vs.create(groupInvite, viewer);

viewer = new Viewer();
viewer.setCompany(company);
viewer.setHardwareKey("VW235345RZ");
viewer.setName("shturlak");
vs.create(groupInvite, viewer);

PriceGrid priceGrid = new PriceGrid();
priceGrid.setCreateDate(Calendar.getInstance());
priceGrid.setCurrency(c);
priceGrid.setStartFrom(Calendar.getInstance());

priceGrid = priceGridService.create(priceGrid);

for (int i = 0; i < 40; i += 5) {
price = new Price();
price.setCreateDate(Calendar.getInstance());
price.setFromCount((long) i);
if (i != 9) {
price.setToCount((long) i + 5);
}
price.setLicenseDuration(1);
price.setName("Price " + i);
price.setValue(BigDecimal.valueOf(i * 15));
price.setPriceGrid(priceGrid);
prs.create(price);
}
}

}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.