update
This commit is contained in:
parent
39161ebca1
commit
2d683824b0
@ -13,96 +13,97 @@
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\adminapi\controller\project;
|
||||
namespace app\adminapi\controller\project;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\project\ProjectAttendanceDetailLists;
|
||||
use app\adminapi\logic\project\ProjectAttendanceDetailLogic;
|
||||
use app\adminapi\validate\project\ProjectAttendanceDetailValidate;
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\project\ProjectAttendanceDetailLists;
|
||||
use app\adminapi\logic\project\ProjectAttendanceDetailLogic;
|
||||
use app\adminapi\validate\project\ProjectAttendanceDetailValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 考勤明细控制器
|
||||
* Class ProjectAttendanceDetailController
|
||||
* @package app\adminapi\controller\project
|
||||
*/
|
||||
class ProjectAttendanceDetailController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* 考勤明细控制器
|
||||
* Class ProjectAttendanceDetailController
|
||||
* @package app\adminapi\controller\project
|
||||
*/
|
||||
class ProjectAttendanceDetailController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取考勤明细列表
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2023/12/26 10:54
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new ProjectAttendanceDetailLists());
|
||||
}
|
||||
/**
|
||||
* @notes 获取考勤明细列表
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2023/12/26 10:54
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new ProjectAttendanceDetailLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加考勤明细
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2023/12/26 10:54
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new ProjectAttendanceDetailValidate())->post()->goCheck('add');
|
||||
$result = ProjectAttendanceDetailLogic::add($params);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ProjectAttendanceDetailLogic::getError());
|
||||
}
|
||||
/**
|
||||
* @notes 添加考勤明细
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2023/12/26 10:54
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new ProjectAttendanceDetailValidate())->post()->goCheck('add');
|
||||
halt($params);
|
||||
$result = ProjectAttendanceDetailLogic::add($params);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ProjectAttendanceDetailLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑考勤明细
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2023/12/26 10:54
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new ProjectAttendanceDetailValidate())->post()->goCheck('edit');
|
||||
$result = ProjectAttendanceDetailLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ProjectAttendanceDetailLogic::getError());
|
||||
}
|
||||
/**
|
||||
* @notes 编辑考勤明细
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2023/12/26 10:54
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new ProjectAttendanceDetailValidate())->post()->goCheck('edit');
|
||||
$result = ProjectAttendanceDetailLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(ProjectAttendanceDetailLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除考勤明细
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2023/12/26 10:54
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new ProjectAttendanceDetailValidate())->post()->goCheck('delete');
|
||||
ProjectAttendanceDetailLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
/**
|
||||
* @notes 删除考勤明细
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2023/12/26 10:54
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new ProjectAttendanceDetailValidate())->post()->goCheck('delete');
|
||||
ProjectAttendanceDetailLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取考勤明细详情
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2023/12/26 10:54
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new ProjectAttendanceDetailValidate())->goCheck('detail');
|
||||
$result = ProjectAttendanceDetailLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
/**
|
||||
* @notes 获取考勤明细详情
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2023/12/26 10:54
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new ProjectAttendanceDetailValidate())->goCheck('detail');
|
||||
$result = ProjectAttendanceDetailLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -12,83 +12,85 @@
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\supervision_work;
|
||||
namespace app\adminapi\lists\supervision_work;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\supervision_work\SupervisionMaterialEntry;
|
||||
use app\common\model\supervision_work\SupervisionMaterialEntryDetail;
|
||||
use app\common\model\supervision_work\SupervisionMaterialParallelTesting;
|
||||
use app\common\model\supervision_work\SupervisionMaterialParallelTestingDetail;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\supervision_work\SupervisionProblem;
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\supervision_work\SupervisionMaterialEntry;
|
||||
use app\common\model\supervision_work\SupervisionMaterialEntryDetail;
|
||||
use app\common\model\supervision_work\SupervisionMaterialParallelTesting;
|
||||
use app\common\model\supervision_work\SupervisionMaterialParallelTestingDetail;
|
||||
use app\common\model\supervision_work\SupervisionProblem;
|
||||
|
||||
|
||||
/**
|
||||
* 工程监理--材料平行检验明细列表
|
||||
* Class SupervisionMaterialParallelTestingDetailLists
|
||||
* @package app\adminapi\listssupervision_work
|
||||
*/
|
||||
class SupervisionMaterialParallelTestingDetailLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
/**
|
||||
* 工程监理--材料平行检验明细列表
|
||||
* Class SupervisionMaterialParallelTestingDetailLists
|
||||
* @package app\adminapi\listssupervision_work
|
||||
*/
|
||||
class SupervisionMaterialParallelTestingDetailLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/02/29 15:00
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['material_parallel_testing_id', 'material_entry_detail_id', 'check_result'],
|
||||
'%like%' => ['check_code', 'check_user'],
|
||||
];
|
||||
}
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/02/29 15:00
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['material_parallel_testing_id', 'material_entry_detail_id', 'check_result'],
|
||||
'%like%' => ['check_code', 'check_user'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取工程监理--材料平行检验明细列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/02/29 15:00
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return SupervisionMaterialParallelTestingDetail::withoutField('create_time,update_time,delete_time')->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function($data){
|
||||
$material_parallel_testing = SupervisionMaterialParallelTesting::field('inspection_date')->where('id',$data['material_parallel_testing_id'])->findOrEmpty();
|
||||
$material_entry_detail = SupervisionMaterialEntryDetail::field('material_entry_id,name,brand,model,contract_brand,entry_number')->where('id',$data['material_entry_detail_id'])->findOrEmpty();
|
||||
$material_entry = SupervisionMaterialEntry::field('enter_time')->where('id',$material_entry_detail['material_entry_id'])->findOrEmpty();
|
||||
$data['name'] = $material_entry_detail['name'];
|
||||
$data['brand'] = $material_entry_detail['brand'];
|
||||
$data['model'] = $material_entry_detail['model'];
|
||||
$data['contract_brand_text'] = $material_entry_detail->contract_brand_text;
|
||||
$data['entry_number'] = $material_entry_detail['entry_number'];
|
||||
$data['enter_time'] = $material_entry['enter_time'];
|
||||
$data['inspection_date'] = $material_parallel_testing['inspection_date'];
|
||||
$data['problem_num'] = SupervisionProblem::field('id')->where('data_id',$data['id'])->where('data_type',7)->count();
|
||||
$data['reply_num'] = SupervisionProblem::field('id')->where('data_id',$data['id'])->where('data_type',7)->where('is_rectification',1)->count();
|
||||
})
|
||||
->toArray();
|
||||
}
|
||||
/**
|
||||
* @notes 获取工程监理--材料平行检验明细列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/02/29 15:00
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return SupervisionMaterialParallelTestingDetail::withoutField('create_time,update_time,delete_time')->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function ($data) {
|
||||
$material_parallel_testing = SupervisionMaterialParallelTesting::field('inspection_date')->where('id', $data['material_parallel_testing_id'])->findOrEmpty();
|
||||
$material_entry_detail = SupervisionMaterialEntryDetail::field('material_entry_id,name,brand,model,unit,contract_brand,entry_number')->where('id', $data['material_entry_detail_id'])->findOrEmpty();
|
||||
$material_entry = SupervisionMaterialEntry::field('enter_time')->where('id', $material_entry_detail['material_entry_id'])->findOrEmpty();
|
||||
$data['name'] = $material_entry_detail['name'];
|
||||
$data['brand'] = $material_entry_detail['brand'];
|
||||
$data['model'] = $material_entry_detail['model'];
|
||||
$data['unit'] = $material_entry_detail['unit'];
|
||||
$data['contract_brand'] = $material_entry_detail['contract_brand'];
|
||||
$data['contract_brand_text'] = $material_entry_detail->contract_brand_text;
|
||||
$data['entry_number'] = $material_entry_detail['entry_number'];
|
||||
$data['enter_time'] = $material_entry['enter_time'];
|
||||
$data['inspection_date'] = $material_parallel_testing['inspection_date'];
|
||||
$data['problem_num'] = SupervisionProblem::field('id')->where('data_id', $data['id'])->where('data_type', 7)->count();
|
||||
$data['reply_num'] = SupervisionProblem::field('id')->where('data_id', $data['id'])->where('data_type', 7)->where('is_rectification', 1)->count();
|
||||
})
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取工程监理--材料平行检验明细数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/02/29 15:00
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return SupervisionMaterialParallelTestingDetail::where($this->searchWhere)->count();
|
||||
}
|
||||
/**
|
||||
* @notes 获取工程监理--材料平行检验明细数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/02/29 15:00
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return SupervisionMaterialParallelTestingDetail::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -83,7 +83,6 @@
|
||||
'settlement_date' => strtotime($params['settlement_date']),
|
||||
'remark' => $params['remark'],
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
||||
'add_user' => $params['add_user'],
|
||||
'update_time' => time(),
|
||||
]);
|
||||
Db::commit();
|
||||
|
@ -37,8 +37,8 @@
|
||||
'project_id' => 'require|checkProject',
|
||||
'person_id' => 'require|checkPerson',
|
||||
'attendance_date' => 'require|dateFormat:Y-m-d',
|
||||
'work_start_time' => 'dateFormat:H:i:s',
|
||||
'work_end_time' => 'dateFormat:H:i:s',
|
||||
'work_start_time' => 'dateFormat:H:i',
|
||||
'work_end_time' => 'dateFormat:H:i',
|
||||
'work_record_num' => 'require|float|gt:0',
|
||||
'daily_salary' => 'require|float|gt:0',
|
||||
'daily_living' => 'require|float|gt:0',
|
||||
|
Loading…
x
Reference in New Issue
Block a user