diff --git a/web/Application/Home/Controller/FIdListController.class.php b/web/Application/Home/Controller/FIdListController.class.php deleted file mode 100644 index 53ed8638..00000000 --- a/web/Application/Home/Controller/FIdListController.class.php +++ /dev/null @@ -1,76 +0,0 @@ -hasPermission(FIdConst::FID_LIST)) { - $this->initVar(); - - $this->assign("title", "FId一览"); - - $this->display(); - } else { - $this->gotoLoginPage("/Home/FIdList"); - } - } - - /** - * 查询全部FId数据 - */ - public function fidList() - { - if (IS_POST) { - $us = new UserService(); - if (!$us->hasPermission(FIdConst::FID_LIST)) { - die("没有权限"); - } - - - $service = new FIdListService(); - $this->ajaxReturn($service->fidList()); - } - } - - /** - * 编辑fid - */ - public function editFId() - { - if (IS_POST) { - $us = new UserService(); - if (!$us->hasPermission(FIdConst::FID_LIST)) { - die("没有权限"); - } - - $params = [ - "fid" => I("post.fid"), - "code" => I("post.code"), - "py" => I("post.py"), - ]; - - $service = new FIdListService(); - $this->ajaxReturn($service->editFId($params)); - } - } -} diff --git a/web/Application/Home/DAO/FIdListDAO.class.php b/web/Application/Home/DAO/FIdListDAO.class.php deleted file mode 100644 index acf3afd1..00000000 --- a/web/Application/Home/DAO/FIdListDAO.class.php +++ /dev/null @@ -1,180 +0,0 @@ -db; - - $sql = "select name from t_solution where code = '%s' "; - $data = $db->query($sql, $slnCode); - if ($data) { - $name = $data[0]["name"]; - return "{$slnCode} - {$name}"; - } else { - return "[SLN编码未定义]"; - } - } - - /** - * 查询全部FId数据 - */ - public function fidList() - { - $db = $this->db; - - $result = []; - - // t_fid中的均为系统固有 - $category = "系统固有"; - - $sql = "select fid, code, py, name, sln_code from t_fid order by fid"; - $data = $db->query($sql); - - foreach ($data as $v) { - $result[] = [ - "fid" => $v["fid"], - "code" => $v["code"], - "name" => $v["name"], - "py" => $v["py"], - "category" => $category, - "sln" => $this->getSlnInfo($v["sln_code"]), - ]; - } - - // t_fid_plus 由码表设置、自定义表单、视图开发助手等模块添加的Fid - $sql = "select fid, code, py, name, sln_code from t_fid_plus order by fid"; - $data = $db->query($sql); - - foreach ($data as $v) { - $fid = $v["fid"]; - $item = [ - "fid" => $fid, - "code" => $v["code"], - "name" => $v["name"], - "py" => $v["py"], - ]; - - $category = ""; - $sln = ""; - if (substr($fid, 0, 2) == "ct") { - // 码表 - $category = "码表"; - - $sql = "select s.name, m.sln_code - from t_code_table_md m, t_solution s - where m.sln_code = s.code and m.fid = '%s' "; - $d = $db->query($sql, $fid); - if ($d) { - $n = $d[0]["name"]; - $c = $d[0]["sln_code"]; - $sln = "{$c} - {$n}"; - } else { - $sln = "未查询到解决方案"; - } - } else { - // TODO 其他模块的查询逻辑 - $category = "待处理"; - } - - $item["category"] = $category; - $item["sln"] = $sln; - - $result[] = $item; - } - - return $result; - } - - /** - * 编辑fid - */ - public function editFId(&$params) - { - $db = $this->db; - - $fid = $params["fid"]; - $code = strtoupper(trim($params["code"])); - $py = strtoupper(trim($params["py"])); - - if (!$fid) { - return $this->badParam("fid"); - } - if (!$py) { - return $this->bad("拼音字头不能为空"); - } - - $sql = "select count(*) as cnt from t_fid where fid = '%s' "; - $data = $db->query($sql, $fid); - $cnt = $data[0]["cnt"]; - if ($cnt == 1) { - $sql = "update t_fid - set code = '%s', py = '%s' - where fid = '%s' "; - $rc = $db->execute($sql, $code, $py, $fid); - if ($rc === false) { - return $this->sqlError(__METHOD__, __LINE__); - } - } else { - $sql = "select count(*) as cnt from t_fid_plus where fid = '%s' "; - $data = $db->query($sql, $fid); - $cnt = $data[0]["cnt"]; - if ($cnt == 1) { - $sql = "update t_fid_plus - set code = '%s', py = '%s' - where fid = '%s' "; - $rc = $db->execute($sql, $code, $py, $fid); - if ($rc === false) { - return $this->sqlError(__METHOD__, __LINE__); - } - } else { - return $this->bad("fid:{$fid} 不存在"); - } - } - - // 同步主菜单中fid的code字段 - $sql = "select count(*) as cnt from t_menu_item where fid = '%s' "; - $data = $db->query($sql, $fid); - $cnt = $data[0]["cnt"]; - if ($cnt > 0) { - $sql = "update t_menu_item - set code = '%s' - where fid = '%s' "; - $rc = $db->query($sql, $code, $fid); - if ($rc === false) { - return $this->sqlError(__METHOD__, __LINE__); - } - } else { - // t_menu_item_plus - $sql = "select count(*) as cnt from t_menu_item_plus where fid = '%s' "; - $data = $db->query($sql, $fid); - $cnt = $data[0]["cnt"]; - - if ($cnt > 0) { - $sql = "update t_menu_item_plus - set code = '%s' - where fid = '%s' "; - $rc = $db->query($sql, $code, $fid); - if ($rc === false) { - return $this->sqlError(__METHOD__, __LINE__); - } - } else { - // 该fid没有挂接到主菜单中 - } - } - - // 操作成功 - $params["log"] = "编辑fid:{$fid} 的编码和拼音字头"; - return null; - } -} diff --git a/web/Application/Home/Service/FIdListService.class.php b/web/Application/Home/Service/FIdListService.class.php deleted file mode 100644 index 661bc58f..00000000 --- a/web/Application/Home/Service/FIdListService.class.php +++ /dev/null @@ -1,66 +0,0 @@ -isNotOnline()) { - return $this->emptyResult(); - } - - $dao = new FIdListDAO($this->db()); - return $dao->fidList(); - } - - /** - * 编辑fid - */ - public function editFId($params) - { - if ($this->isNotOnline()) { - return $this->notOnlineError(); - } - - if ($this->isDemo()) { - return $this->bad("演示环境下不能编辑fid"); - } - - $db = $this->db(); - $db->startTrans(); - - $dao = new FIdListDAO($db); - $rc = $dao->editFId($params); - if ($rc) { - $db->rollback(); - return $rc; - } - - // 记录业务日志 - $log = $params["log"]; - $bs = new BizlogService($db); - $bs->insertBizlog($log, $this->LOG_CATEGORY); - - $db->commit(); - - $fid = $params["fid"]; - return $this->ok($fid); - } -} diff --git a/web/Application/SLN0000/Controller/FIdListController.class.php b/web/Application/SLN0000/Controller/FIdListController.class.php index 452a3fdc..f7727ec2 100644 --- a/web/Application/SLN0000/Controller/FIdListController.class.php +++ b/web/Application/SLN0000/Controller/FIdListController.class.php @@ -4,8 +4,8 @@ namespace SLN0000\Controller; use Home\Common\FIdConst; use Home\Controller\PSIBaseController; -use Home\Service\FIdListService; use Home\Service\UserService; +use SLN0000\Service\FIdListService; /** * FId一览Controller