Commit 36a7e3c2 by wenyi.chen

V1确定版本

parent 1ab962f8
APP_DEBUG = true [APP] DEFAULT_TIMEZONE = Asia/Shanghai ###项目初始化配置 [init] // 项目名称 entry_name = data-collect-dev // 是否开启调试日志 log = true ###数据库配置 [database] type = mysql hostname = huisheng_mysql database = data-collect-dev username = root password = Huisheng@12345 hostport = 3306 charset = utf8 debug = true ###redis配置 [redis] hostname = huisheng_redis port = 6379 debug = true [LANG] default_lang = zh-cn APP_DEBUG = true [APP] DEFAULT_TIMEZONE = Asia/Shanghai ###项目初始化配置 [init] // 项目名称 entry_name = data-collect-dev // 是否开启调试日志 log = true ###数据库配置 [database] type = mysql hostname = huisheng_mysql database = data-collect username = root password = Huisheng@12345 hostport = 3306 charset = utf8 debug = true ###redis配置 [redis] hostname = huisheng_redis port = 6379 debug = true [LANG] default_lang = zh-cn
\ No newline at end of file \ No newline at end of file
......
...@@ -543,6 +543,7 @@ class ExcelFile extends BaseController ...@@ -543,6 +543,7 @@ class ExcelFile extends BaseController
$val['sort'] ='/'; $val['sort'] ='/';
} }
$data = [ $data = [
'norm'=>$value['name'],
'name'=>$val['name'], 'name'=>$val['name'],
'level'=>$val['level'], 'level'=>$val['level'],
'refer'=>$val['refer'], 'refer'=>$val['refer'],
...@@ -693,6 +694,7 @@ class ExcelFile extends BaseController ...@@ -693,6 +694,7 @@ class ExcelFile extends BaseController
$val['sort'] ='/'; $val['sort'] ='/';
} }
$data = [ $data = [
'norm'=>$norm['name'],
'name'=>$val['name'], 'name'=>$val['name'],
'level'=>$val['level'], 'level'=>$val['level'],
'refer'=>$val['refer'], 'refer'=>$val['refer'],
...@@ -843,6 +845,7 @@ class ExcelFile extends BaseController ...@@ -843,6 +845,7 @@ class ExcelFile extends BaseController
$val['sort'] ='/'; $val['sort'] ='/';
} }
$data = [ $data = [
'norm'=>$value['name'],
'name'=>$val['name'], 'name'=>$val['name'],
'level'=>$val['level'], 'level'=>$val['level'],
'refer'=>$val['refer'], 'refer'=>$val['refer'],
...@@ -931,6 +934,7 @@ class ExcelFile extends BaseController ...@@ -931,6 +934,7 @@ class ExcelFile extends BaseController
->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID) ->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)
->getStartColor()->setARGB('C5D9F1'); // FF后面的六位数是颜色的RGB值 ->getStartColor()->setARGB('C5D9F1'); // FF后面的六位数是颜色的RGB值
$title = [ $title = [
'子任务名称',
'指标名称', '指标名称',
'难度等级', '难度等级',
'参考信源', '参考信源',
...@@ -975,6 +979,9 @@ class ExcelFile extends BaseController ...@@ -975,6 +979,9 @@ class ExcelFile extends BaseController
$position = 0; $position = 0;
$sheet = $spreadsheet->getActiveSheet(); $sheet = $spreadsheet->getActiveSheet();
// 指标名称 // 指标名称
$sheet->setCellValue($column[$num+$position].$row, $value['norm']);
$position++;
// 指标名称
$sheet->setCellValue($column[$num+$position].$row, $value['name']); $sheet->setCellValue($column[$num+$position].$row, $value['name']);
$position++; $position++;
// 难度等级 // 难度等级
......
...@@ -246,13 +246,21 @@ class Norm ...@@ -246,13 +246,21 @@ class Norm
$NormListExtendBus = new CommonBus('NormListExtendBus'); // 通过公共业务初始化指标类 $NormListExtendBus = new CommonBus('NormListExtendBus'); // 通过公共业务初始化指标类
$data['receivesList'][$index]['norm_list_extend'] = $NormListExtendBus->getConditionalQueryAll(['norm_list_id'=>$vlues['norm_list_id']]); $data['receivesList'][$index]['norm_list_extend'] = $NormListExtendBus->getConditionalQueryAll(['norm_list_id'=>$vlues['norm_list_id']]);
$NormCollectsBus = new CommonBus('NormCollectsBus'); // 通过公共业务初始化指标类 $NormCollectsBus = new CommonBus('NormCollectsBus'); // 通过公共业务初始化指标类
$collectsInfo = $NormCollectsBus->getConditionalQueryAll(['norm_receive_id'=>$vlues['id']]); $collectsInfo = $NormCollectsBus->getConditionalQuery(['norm_receive_id'=>$vlues['id']]);
if ($collectsInfo){ if ($collectsInfo){
$data['receivesList'][$index]['receives_status'] = 1; $NormCollectsExtendBus = new CommonBus('NormCollectsExtendBus'); // 通过公共业务初始化指标类
$data['receivesList'][$index]['completion_status'] =1; $normCollectsExtend = $NormCollectsExtendBus->getConditionalQueryAll(['norm_collects_id'=>$collectsInfo['id']]);
$data['receivesList'][$index]['refer_type'] = $collectsInfo['refer_type'];
$data['receivesList'][$index]['remark'] = $collectsInfo['remark'];
$data['receivesList'][$index]['imgPath'] = $collectsInfo['imgPath'];
$data['receivesList'][$index]['normCollectsExtend'] = $normCollectsExtend;
}else{ }else{
$data['receivesList'][$index]['receives_status'] = 1; $normExtendBus = new CommonBus('NormExtendBus');
$data['receivesList'][$index]['completion_status'] = 0; $res = $normExtendBus->getConditionalQueryAll(['norm_id'=>$id,'user_filled'=>1]);
$data['receivesList'][$index]['refer_type'] = '';
$data['receivesList'][$index]['remark'] = '';
$data['receivesList'][$index]['imgPath'] = '';
$data['receivesList'][$index]['normCollectsExtend'] =$res;
} }
} }
} }
......
<?php
/**
* 用户填写指标详情
* User: raisound
*/
namespace app\api\controller;
use app\common\business\CommonBus as CommonBus;
use app\common\model\redis\RedisModel;
use think\facade\Db;
class NormCollectsaaaaaa extends AuthBase
{
/**
* 指标领取
*
* @param \think\Request $request
* @return \think\Response
*/
public function add()
{
try{
$queryArr = json_decode(file_get_contents('php://input'),true);
$data = array();
$data['norm_list_id'] = trim($queryArr['addItem']['norm_list_id']);
$data['task_id'] = trim($queryArr['addItem']['task_id']);
$data['norm_id'] = trim($queryArr['addItem']['norm_id']);
$data['norm_receive_id'] = trim($queryArr['addItem']['norm_receive_id']);
$data['refer_type'] = trim($queryArr['addItem']['refer_type']);
$data['remark'] = trim($queryArr['addItem']['remark']);
$data['imgPath'] = $queryArr['editorImgList'];
$data['editorContent'] = $queryArr['editorContent'];
$data['user_id'] = $this->userId;
if(empty($data['norm_list_id']) || empty($data['task_id']) ||empty($data['norm_id']) ||empty($data['norm_receive_id']) ||empty($data['user_id'])){
errorRecord('NormCollects.add',json_encode($data),true);
return returnResult(config("config.code.error"),'无法获取相关信息!','');
}
$NormCollectsBus = new \app\api\business\NormReceivesBus; // 通过公共业务初始化指标类
$res = $NormCollectsBus->getConditionalQuery(['id'=>$data['norm_receive_id']]);
if($res['status'] ==3 || $res['status'] ==4){
errorRecord('NormCollects.add',$res['status'],true);
return returnResult(config("config.code.error"),'管理员已审核无法修改!','');
}
// 开启数据库事务
Db::startTrans();
$index = 1;
// 查询是否已经填写了
$arr = [
'norm_list_id'=>$data['norm_list_id'],
'task_id'=>$data['task_id'],
'norm_id'=>$data['norm_id'],
'user_id'=>$data['user_id']
];
if($data['imgPath']){
$data['imgPath'] = implode(',',$data['imgPath']);
}else{
$data['imgPath'] = '';
}
$NormCollectsBus = new \app\api\business\CommonBus('NormCollectsBus'); // 通过公共业务初始化指标类
$res = $NormCollectsBus->getConditionalQuery($arr);
if(empty($res)){
$add = $NormCollectsBus->addData($data);
if (empty($add)){
$index++;
}
}else{
$where = [
'norm_list_id'=>$data['norm_list_id'],
'task_id'=>$data['task_id'],
'norm_id'=>$data['norm_id'],
'user_id'=>$data['user_id'],
];
$updateData = [
'refer_type'=>$data['refer_type'],
'remark'=>$data['remark'],
'imgPath'=>$data['imgPath'],
'editorContent'=>$data['editorContent'],
];
$update = $NormCollectsBus->updateData($updateData,$where);
if (empty($update)){
$index++;
}
}
// 用户填写区域
$userFilled = $queryArr['userFilled'];
$NormExtendBus = new \app\api\business\CommonBus('NormExtendBus'); // 通过公共业务初始化指标类
foreach ($userFilled as $value){
$update = $NormExtendBus->updateData(['id'=>$value['id'],'extend_value'=>$value['value']]);
if (empty($update)){
$index++;
}
}
$NormReceivesBus = new \app\api\business\NormReceivesBus;
$res = $NormReceivesBus->updateData(['id'=>$data['norm_receive_id'],'status'=>1]);
if (empty($res)){
$index++;
}
if($index ==1){
Db::commit();
return returnResult(config("config.code.success"),config("config.describe.success"),$res);
}else{
Db::rollback();
return returnResult(config("config.code.success"),config("config.describe.null_data"),[]);
}
}catch (\Exception $e){
exception($e,'NormCollects.add');
}
}
/**
* 数据保存
* @return void
*/
public function preserve()
{
try{
$data = [];
$data['norm_receive_id'] = input("param.norm_receive_id",'',"trim");
$data['content'] = input("param.content",'',"trim");
$data['editor'] = input("param.editor");
$PreserveBus = new \app\api\business\CommonBus('PreserveBus'); // 通过公共业务初始化指标类
$info= $PreserveBus->getConditionalQuery(['norm_receive_id'=>$data['norm_receive_id']]);
if(empty($info)){
$res = $PreserveBus->addData($data);
}else{
$res = $PreserveBus->updateData(['content'=>$data['content'],'editor'=>$data['editor']],['norm_receive_id'=>$data['norm_receive_id']]);
}
if($res){
return returnResult(config("config.code.success"),config("config.describe.success"),$res);
}else{
return returnResult(config("config.code.success"),config("config.describe.null_data"),[]);
}
}catch (\Exception $e){
exception($e,'NormCollects.preserve');
}
}
/**
* 数据保存
* @return void
*/
public function getPreserve()
{
try{
$id = input("param.id",'',"trim");
$PreserveBus = new \app\api\business\CommonBus('PreserveBus'); // 通过公共业务初始化指标类
$info= $PreserveBus->getConditionalQuery(['norm_receive_id'=>$id]);
return returnResult(config("config.code.success"),config("config.describe.success"),$info);
}catch (\Exception $e){
exception($e,'NormCollects.getPreserve');
}
}
}
\ No newline at end of file
...@@ -70,5 +70,5 @@ return [ ...@@ -70,5 +70,5 @@ return [
], ],
// "resource_address"=>'https://data-collect.raisound.com/data-collect-api/', // "resource_address"=>'https://data-collect.raisound.com/data-collect-api/',
// "resource_address"=>'http://192.168.10.168/data-collect-api/' // "resource_address"=>'http://192.168.10.168/data-collect-api/'
"resource_address"=>'http://gcspider.raisound.com:81/data-collect-api-dev/' "resource_address"=>'http://gcspider.raisound.com:81/data-collect-api/'
]; ];
a:1:{s:5:"users";a:10:{s:2:"id";i:3;s:4:"name";s:10:"管理员1";s:5:"phone";s:11:"18417180202";s:7:"account";s:8:"admin001";s:8:"password";s:32:"e10adc3949ba59abbe56e057f20f883e";s:6:"status";i:1;s:4:"type";i:1;s:11:"create_time";s:10:"1709196711";s:5:"email";s:0:"";s:13:"department_id";i:1;}}
\ No newline at end of file
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