mirror of
https://github.com/Karaka-Management/oms-Exchange.git
synced 2026-02-14 08:48:41 +00:00
Merge branch 'develop' of https://github.com/Orange-Management/oms-Exchange into develop
This commit is contained in:
commit
4279f02c5d
|
|
@ -146,12 +146,16 @@ final class Importer extends ImporterAbstract
|
||||||
public function importCostCenter(\DateTime $start, \DateTime $end) : void
|
public function importCostCenter(\DateTime $start, \DateTime $end) : void
|
||||||
{
|
{
|
||||||
DataMapperAbstract::setConnection($this->remote);
|
DataMapperAbstract::setConnection($this->remote);
|
||||||
$costCenters = GSDCostCenterMapper::getAll();
|
$query = GSDCostCenterMapper::getQuery();
|
||||||
|
$query->where('row_create_time', '=>', $start->format('Y-m-d H:i:s'))
|
||||||
|
->andWhere('row_create_time', '<=', $end->format('Y-m-d H:i:s'));
|
||||||
|
|
||||||
|
$costCenters = GSDCostCenterMapper::getByQuery($query);
|
||||||
|
|
||||||
$obj = new CostCenter();
|
|
||||||
DataMapperAbstract::setConnection($this->local);
|
DataMapperAbstract::setConnection($this->local);
|
||||||
|
|
||||||
foreach ($costCenters as $cc) {
|
foreach ($costCenters as $cc) {
|
||||||
|
$obj = new CostCenter();
|
||||||
$obj->setCostCenter((int) $cc->getCostCenter());
|
$obj->setCostCenter((int) $cc->getCostCenter());
|
||||||
$obj->setCostCenterName($cc->getDescription());
|
$obj->setCostCenterName($cc->getDescription());
|
||||||
|
|
||||||
|
|
@ -172,16 +176,20 @@ final class Importer extends ImporterAbstract
|
||||||
public function importCostObject(\DateTime $start, \DateTime $end) : void
|
public function importCostObject(\DateTime $start, \DateTime $end) : void
|
||||||
{
|
{
|
||||||
DataMapperAbstract::setConnection($this->remote);
|
DataMapperAbstract::setConnection($this->remote);
|
||||||
$costObjects = GSDCostObjectMapper::getAll();
|
$query = GSDCostObjectMapper::getQuery();
|
||||||
|
$query->where('row_create_time', '=>', $start->format('Y-m-d H:i:s'))
|
||||||
|
->andWhere('row_create_time', '<=', $end->format('Y-m-d H:i:s'));
|
||||||
|
|
||||||
|
$costObjects = GSDCostObjectMapper::getByQuery($query);
|
||||||
|
|
||||||
$obj = new CostObject();
|
|
||||||
DataMapperAbstract::setConnection($this->local);
|
DataMapperAbstract::setConnection($this->local);
|
||||||
|
|
||||||
foreach ($costObjects as $co) {
|
foreach ($costObjects as $cc) {
|
||||||
|
$obj = new CostCenter();
|
||||||
$obj->setCostObject((int) $co->getCostObject());
|
$obj->setCostObject((int) $co->getCostObject());
|
||||||
$obj->setCostObjectName($co->getDescription());
|
$obj->setCostObjectName($co->getDescription());
|
||||||
|
|
||||||
CostObjectMapper::create($obj);
|
CostCenterMapper::create($obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user