update 2024/2/3-1
This commit is contained in:
parent
11add7ae0a
commit
a929f77908
@ -52,7 +52,7 @@ class ProjectCostBudgetController extends BaseAdminController
|
||||
public function add()
|
||||
{
|
||||
$params = (new ProjectCostBudgetValidate())->post()->goCheck('add');
|
||||
$result = ProjectCostBudgetLogic::add($params);
|
||||
$result = ProjectCostBudgetLogic::add($params,$this->adminId);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class ProjectEquipmentBudgetController extends BaseAdminController
|
||||
public function add()
|
||||
{
|
||||
$params = (new ProjectEquipmentBudgetValidate())->post()->goCheck('add');
|
||||
$result = ProjectEquipmentBudgetLogic::add($params);
|
||||
$result = ProjectEquipmentBudgetLogic::add($params,$this->adminId);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class ProjectLaborBudgetController extends BaseAdminController
|
||||
public function add()
|
||||
{
|
||||
$params = (new ProjectLaborBudgetValidate())->post()->goCheck('add');
|
||||
$result = ProjectLaborBudgetLogic::add($params);
|
||||
$result = ProjectLaborBudgetLogic::add($params,$this->adminId);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class ProjectMaterialBudgetController extends BaseAdminController
|
||||
public function add()
|
||||
{
|
||||
$params = (new ProjectMaterialBudgetValidate())->post()->goCheck('add');
|
||||
$result = ProjectMaterialBudgetLogic::add($params);
|
||||
$result = ProjectMaterialBudgetLogic::add($params,$this->adminId);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class ProjectSubpackageBudgetController extends BaseAdminController
|
||||
public function add()
|
||||
{
|
||||
$params = (new ProjectSubpackageBudgetValidate())->post()->goCheck('add');
|
||||
$result = ProjectSubpackageBudgetLogic::add($params);
|
||||
$result = ProjectSubpackageBudgetLogic::add($params,$this->adminId);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class ProjectTotalBudgetController extends BaseAdminController
|
||||
public function add()
|
||||
{
|
||||
$params = (new ProjectTotalBudgetValidate())->post()->goCheck('add');
|
||||
$result = ProjectTotalBudgetLogic::add($params);
|
||||
$result = ProjectTotalBudgetLogic::add($params,$this->adminId);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ class ProjectCostBudgetLogic extends BaseLogic
|
||||
* @author likeadmin
|
||||
* @date 2024/01/16 14:32
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
public static function add(array $params,$admin_id): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
@ -64,6 +64,16 @@ class ProjectCostBudgetLogic extends BaseLogic
|
||||
'remark' => $item['remark'] ?? '',
|
||||
]);
|
||||
}
|
||||
//添加审批信息
|
||||
addApprove(
|
||||
'项目费用预算',
|
||||
$res->id,
|
||||
'app\common\model\project\ProjectCostBudget',
|
||||
'app\adminapi\logic\project\ProjectCostBudgetLogic',
|
||||
$params['approve_detail']['flow_type'],
|
||||
$params['approve_detail']['flow_path'],
|
||||
$admin_id
|
||||
);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
|
@ -40,7 +40,7 @@ class ProjectEquipmentBudgetLogic extends BaseLogic
|
||||
* @author likeadmin
|
||||
* @date 2024/01/16 11:40
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
public static function add(array $params,$admin_id): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
@ -67,6 +67,16 @@ class ProjectEquipmentBudgetLogic extends BaseLogic
|
||||
'remark' => $item['remark'] ?? '',
|
||||
]);
|
||||
}
|
||||
//添加审批信息
|
||||
addApprove(
|
||||
'项目机具预算',
|
||||
$res->id,
|
||||
'app\common\model\project\ProjectEquipmentBudget',
|
||||
'app\adminapi\logic\project\ProjectEquipmentBudgetLogic',
|
||||
$params['approve_detail']['flow_type'],
|
||||
$params['approve_detail']['flow_path'],
|
||||
$admin_id
|
||||
);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
namespace app\adminapi\logic\project;
|
||||
|
||||
|
||||
use app\common\model\dept\Dept;
|
||||
use app\common\model\dept\Orgs;
|
||||
use app\common\model\project\Project;
|
||||
@ -40,7 +39,7 @@ class ProjectLaborBudgetLogic extends BaseLogic
|
||||
* @author likeadmin
|
||||
* @date 2024/01/16 09:26
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
public static function add(array $params,$admin_id): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
@ -66,6 +65,16 @@ class ProjectLaborBudgetLogic extends BaseLogic
|
||||
'remark' => $item['remark'] ?? '',
|
||||
]);
|
||||
}
|
||||
//添加审批信息
|
||||
addApprove(
|
||||
'项目人工预算',
|
||||
$res->id,
|
||||
'app\common\model\project\ProjectLaborBudget',
|
||||
'app\adminapi\logic\project\ProjectLaborBudgetLogic',
|
||||
$params['approve_detail']['flow_type'],
|
||||
$params['approve_detail']['flow_path'],
|
||||
$admin_id
|
||||
);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
|
@ -40,7 +40,7 @@ class ProjectMaterialBudgetLogic extends BaseLogic
|
||||
* @author likeadmin
|
||||
* @date 2024/01/08 16:30
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
public static function add(array $params,$admin_id): bool
|
||||
{
|
||||
$detail = $params['material_budget_detail'];//json_decode($params['material_budget_detail'],true);
|
||||
Db::startTrans();
|
||||
@ -66,6 +66,16 @@ class ProjectMaterialBudgetLogic extends BaseLogic
|
||||
'remark' => $item['remark'] ?? '',
|
||||
]);
|
||||
}
|
||||
//添加审批信息
|
||||
addApprove(
|
||||
'项目材料结算',
|
||||
$project_material_budget->id,
|
||||
'app\common\model\project\ProjectMaterialBudget',
|
||||
'app\adminapi\logic\project\ProjectMaterialBudgetLogic',
|
||||
$params['approve_detail']['flow_type'],
|
||||
$params['approve_detail']['flow_path'],
|
||||
$admin_id
|
||||
);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
|
@ -44,7 +44,7 @@ class ProjectSettlementLogic extends BaseLogic
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectSettlement::create([
|
||||
$res = ProjectSettlement::create([
|
||||
'settlement_code' => data_unique_code('甲方结算'),
|
||||
'project_id' => $params['project_id'],
|
||||
'contract_id' => $params['contract_id'],
|
||||
@ -54,6 +54,16 @@ class ProjectSettlementLogic extends BaseLogic
|
||||
'annex' => $params['annex']? json_encode($params['annex']) : null,
|
||||
'add_user' => $admin_id
|
||||
]);
|
||||
//添加审批信息
|
||||
addApprove(
|
||||
'项目结算',
|
||||
$res->id,
|
||||
'app\common\model\project\ProjectSettlement',
|
||||
'app\adminapi\logic\project\ProjectSettlementLogic',
|
||||
$params['approve_detail']['flow_type'],
|
||||
$params['approve_detail']['flow_path'],
|
||||
$admin_id
|
||||
);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
|
@ -44,7 +44,7 @@ class ProjectSubcontractSettlementLogic extends BaseLogic
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectSubcontractSettlement::create([
|
||||
$res = ProjectSubcontractSettlement::create([
|
||||
'settlement_code' => data_unique_code('分包结算'),
|
||||
'project_id' => $params['project_id'],
|
||||
'contract_id' => $params['contract_id'],
|
||||
@ -54,7 +54,16 @@ class ProjectSubcontractSettlementLogic extends BaseLogic
|
||||
'annex' => $params['annex']? json_encode($params['annex']) : null,
|
||||
'add_user' => $admin_id,
|
||||
]);
|
||||
|
||||
//添加审批信息
|
||||
addApprove(
|
||||
'分包结算',
|
||||
$res->id,
|
||||
'app\common\model\project\ProjectSubcontractSettlement',
|
||||
'app\adminapi\logic\project\ProjectSubcontractSettlementLogic',
|
||||
$params['approve_detail']['flow_type'],
|
||||
$params['approve_detail']['flow_path'],
|
||||
$admin_id
|
||||
);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
namespace app\adminapi\logic\project;
|
||||
|
||||
|
||||
use app\common\model\dept\Dept;
|
||||
use app\common\model\dept\Orgs;
|
||||
use app\common\model\project\Project;
|
||||
@ -40,7 +39,7 @@ class ProjectSubpackageBudgetLogic extends BaseLogic
|
||||
* @author likeadmin
|
||||
* @date 2024/01/10 15:19
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
public static function add(array $params,$admin_id): bool
|
||||
{
|
||||
$detail = $params['subpackage_budget_detail'];//json_decode($params['subpackage_budget_detail'],true);
|
||||
Db::startTrans();
|
||||
@ -68,6 +67,16 @@ class ProjectSubpackageBudgetLogic extends BaseLogic
|
||||
'remark' => $item['remark'] ?? '',
|
||||
]);
|
||||
}
|
||||
//添加审批信息
|
||||
addApprove(
|
||||
'项目分包预算',
|
||||
$res->id,
|
||||
'app\common\model\project\ProjectSubpackageBudget',
|
||||
'app\adminapi\logic\project\ProjectSubpackageBudgetLogic',
|
||||
$params['approve_detail']['flow_type'],
|
||||
$params['approve_detail']['flow_path'],
|
||||
$admin_id
|
||||
);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
|
@ -39,11 +39,11 @@ class ProjectTotalBudgetLogic extends BaseLogic
|
||||
* @author likeadmin
|
||||
* @date 2024/01/08 14:25
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
public static function add(array $params,$admin_id): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectTotalBudget::create([
|
||||
$res = ProjectTotalBudget::create([
|
||||
'org_id' => $params['org_id'],
|
||||
'dept_id' => $params['dept_id'],
|
||||
'project_id' => $params['project_id'],
|
||||
@ -63,6 +63,16 @@ class ProjectTotalBudgetLogic extends BaseLogic
|
||||
'is_budget' => 1,
|
||||
'update_time' => time(),
|
||||
]);
|
||||
//添加审批信息
|
||||
addApprove(
|
||||
'项目总预算',
|
||||
$res->id,
|
||||
'app\common\model\project\ProjectTotalBudget',
|
||||
'app\adminapi\logic\project\ProjectTotalBudgetLogic',
|
||||
$params['approve_detail']['flow_type'],
|
||||
$params['approve_detail']['flow_path'],
|
||||
$admin_id
|
||||
);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
|
@ -41,7 +41,8 @@ class ProjectCostBudgetValidate extends BaseValidate
|
||||
'dept_id' => 'require|checkDept',
|
||||
'project_id' => 'require|checkProject',
|
||||
'annex' => 'checkAnnex',
|
||||
'cost_budget_detail' => 'require|checkCostBudgetDetail'
|
||||
'cost_budget_detail' => 'require|checkCostBudgetDetail',
|
||||
'approve_detail' => 'require|checkApproveDetail',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
@ -49,7 +50,8 @@ class ProjectCostBudgetValidate extends BaseValidate
|
||||
'org_id.require' => '请选择组织',
|
||||
'dept_id.require' => '请选择部门',
|
||||
'project_id.require' => '请选择项目',
|
||||
'cost_budget_detail.require' => '请填写费用预算清单'
|
||||
'cost_budget_detail.require' => '请填写费用预算清单',
|
||||
'approve_detail.require' => '请填写审批流程信息',
|
||||
];
|
||||
|
||||
|
||||
|
@ -40,7 +40,8 @@ class ProjectEquipmentBudgetValidate extends BaseValidate
|
||||
'dept_id' => 'require|checkDept',
|
||||
'project_id' => 'require|checkProject',
|
||||
'annex' => 'checkAnnex',
|
||||
'equipment_budget_detail' => 'require|checkEquipmentBudgetDetail'
|
||||
'equipment_budget_detail' => 'require|checkEquipmentBudgetDetail',
|
||||
'approve_detail' => 'require|checkApproveDetail',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
@ -48,7 +49,8 @@ class ProjectEquipmentBudgetValidate extends BaseValidate
|
||||
'org_id.require' => '请选择组织',
|
||||
'dept_id.require' => '请选择部门',
|
||||
'project_id.require' => '请选择项目',
|
||||
'equipment_budget_detail.require' => '请填机具预算清单'
|
||||
'equipment_budget_detail.require' => '请填机具预算清单',
|
||||
'approve_detail.require' => '请填写审批流程信息',
|
||||
];
|
||||
|
||||
|
||||
|
@ -41,7 +41,8 @@ class ProjectLaborBudgetValidate extends BaseValidate
|
||||
'dept_id' => 'require|checkDept',
|
||||
'project_id' => 'require|checkProject',
|
||||
'annex' => 'checkAnnex',
|
||||
'labor_budget_detail' => 'require|checkLaborBudgetDetail'
|
||||
'labor_budget_detail' => 'require|checkLaborBudgetDetail',
|
||||
'approve_detail' => 'require|checkApproveDetail',
|
||||
];
|
||||
|
||||
|
||||
@ -50,7 +51,8 @@ class ProjectLaborBudgetValidate extends BaseValidate
|
||||
'org_id.require' => '请选择组织',
|
||||
'dept_id.require' => '请选择部门',
|
||||
'project_id.require' => '请选择项目',
|
||||
'labor_budget_detail.require' => '请填写人工预算清单'
|
||||
'labor_budget_detail.require' => '请填写人工预算清单',
|
||||
'approve_detail.require' => '请填写审批流程信息',
|
||||
];
|
||||
|
||||
|
||||
|
@ -40,7 +40,8 @@ class ProjectMaterialBudgetValidate extends BaseValidate
|
||||
'dept_id' => 'require|checkDept',
|
||||
'project_id' => 'require|checkProject',
|
||||
'annex' => 'checkAnnex',
|
||||
'material_budget_detail' => 'require|checkMaterialBudgetDetail'
|
||||
'material_budget_detail' => 'require|checkMaterialBudgetDetail',
|
||||
'approve_detail' => 'require|checkApproveDetail',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
@ -48,7 +49,8 @@ class ProjectMaterialBudgetValidate extends BaseValidate
|
||||
'org_id.require' => '请选择组织',
|
||||
'dept_id.require' => '请选择部门',
|
||||
'project_id.require' => '请选择项目',
|
||||
'material_budget_detail.require' => '请填写材料预算清单'
|
||||
'material_budget_detail.require' => '请填写材料预算清单',
|
||||
'approve_detail.require' => '请填写审批流程信息',
|
||||
];
|
||||
|
||||
|
||||
|
@ -39,7 +39,8 @@ class ProjectSettlementValidate extends BaseValidate
|
||||
'contract_id' => 'require|checkContract',
|
||||
'settlement_amount' => 'require|float|egt:0',
|
||||
'settlement_date' => 'require|dateFormat:Y-m-d',
|
||||
'annex' => 'checkAnnex'
|
||||
'annex' => 'checkAnnex',
|
||||
'approve_detail' => 'require|checkApproveDetail',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
@ -51,6 +52,7 @@ class ProjectSettlementValidate extends BaseValidate
|
||||
'settlement_amount.egt' => '结算金额值必须大于等于0',
|
||||
'settlement_date.require' => '请选择结算日期',
|
||||
'settlement_date.dateFormat' => '结算日期格式错误',
|
||||
'approve_detail.require' => '请填写审批流程信息',
|
||||
];
|
||||
|
||||
|
||||
|
@ -37,7 +37,8 @@ class ProjectSubcontractSettlementValidate extends BaseValidate
|
||||
'contract_id' => 'require|checkContract',
|
||||
'settlement_amount' => 'require|float|egt:0',
|
||||
'settlement_date' => 'require|dateFormat:Y-m-d',
|
||||
'annex' => 'checkAnnex'
|
||||
'annex' => 'checkAnnex',
|
||||
'approve_detail' => 'require|checkApproveDetail',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
@ -49,6 +50,7 @@ class ProjectSubcontractSettlementValidate extends BaseValidate
|
||||
'settlement_amount.egt' => '结算金额值必须大于等于0',
|
||||
'settlement_date.require' => '请选择结算日期',
|
||||
'settlement_date.dateFormat' => '结算日期格式错误',
|
||||
'approve_detail.require' => '请填写审批流程信息',
|
||||
];
|
||||
|
||||
|
||||
|
@ -40,7 +40,8 @@ class ProjectSubpackageBudgetValidate extends BaseValidate
|
||||
'dept_id' => 'require|checkDept',
|
||||
'project_id' => 'require|checkProject',
|
||||
'annex' => 'checkAnnex',
|
||||
'subpackage_budget_detail' => 'require|checkSubpackageBudgetDetail'
|
||||
'subpackage_budget_detail' => 'require|checkSubpackageBudgetDetail',
|
||||
'approve_detail' => 'require|checkApproveDetail',
|
||||
];
|
||||
|
||||
/**
|
||||
@ -52,7 +53,8 @@ class ProjectSubpackageBudgetValidate extends BaseValidate
|
||||
'org_id' => '组织id',
|
||||
'dept_id' => '部门id',
|
||||
'project_id' => '项目id',
|
||||
'material_budget_detail' => '分包预算明细'
|
||||
'material_budget_detail' => '分包预算明细',
|
||||
'approve_detail' => '审批流程',
|
||||
];
|
||||
|
||||
|
||||
|
@ -47,6 +47,7 @@ class ProjectTotalBudgetValidate extends BaseValidate
|
||||
'budget_list' => 'checkAnnex',
|
||||
'budget_date' => 'require|dateFormat:Y-m-d',
|
||||
'project_manager' => 'require',
|
||||
'approve_detail' => 'require|checkApproveDetail',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
@ -69,6 +70,7 @@ class ProjectTotalBudgetValidate extends BaseValidate
|
||||
'jj_cost.egt' => '机具成本值必须大于等于0',
|
||||
'budget_date.dateFormat' => '预算日期数据格式错误',
|
||||
'project_manager' => '请填写项目经理',
|
||||
'approve_detail.require' => '请填写审批流程信息',
|
||||
];
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user