|
@@ -113,13 +113,22 @@ class PersonSalaryService extends Service
|
|
|
return $detail;
|
|
return $detail;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function MonthlyPsOrderDel($data){
|
|
|
|
|
|
|
+ public function MonthlyPsOrderDel($data, $user){
|
|
|
if($this->isEmpty($data,'id')) return [false,'请选择数据!'];
|
|
if($this->isEmpty($data,'id')) return [false,'请选择数据!'];
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
DB::beginTransaction();
|
|
DB::beginTransaction();
|
|
|
$time = time();
|
|
$time = time();
|
|
|
|
|
|
|
|
|
|
+ $month = MonthlyPsOrder::where('del_time',0)
|
|
|
|
|
+ ->whereIn('id',$data['id'])
|
|
|
|
|
+ ->pluck('month')
|
|
|
|
|
+ ->toArray();
|
|
|
|
|
+
|
|
|
|
|
+ //归档
|
|
|
|
|
+ list($status, $msg) = ArchiveService::isArchive($month, $user);
|
|
|
|
|
+ if(! $status) return [false, $msg];
|
|
|
|
|
+
|
|
|
MonthlyPsOrder::where('del_time',0)
|
|
MonthlyPsOrder::where('del_time',0)
|
|
|
->whereIn('id',$data['id'])
|
|
->whereIn('id',$data['id'])
|
|
|
->update(['del_time' => $time]);
|
|
->update(['del_time' => $time]);
|
|
@@ -191,6 +200,11 @@ class PersonSalaryService extends Service
|
|
|
$data['month'] = $this->changeDateToDate($data['month']);
|
|
$data['month'] = $this->changeDateToDate($data['month']);
|
|
|
|
|
|
|
|
$data['top_depart_id'] = $user['top_depart_id'];
|
|
$data['top_depart_id'] = $user['top_depart_id'];
|
|
|
|
|
+
|
|
|
|
|
+ //归档
|
|
|
|
|
+ list($status, $msg) = ArchiveService::isArchive($data['month'], $user);
|
|
|
|
|
+ if(! $status) return [false, $msg];
|
|
|
|
|
+
|
|
|
if(empty($data['details'])) return [false, '人员月度工时单明细不能为空'];
|
|
if(empty($data['details'])) return [false, '人员月度工时单明细不能为空'];
|
|
|
foreach ($data['details'] as $key => $value){
|
|
foreach ($data['details'] as $key => $value){
|
|
|
if(empty($value['employee_id'])) return [false, '人员不能为空'];
|
|
if(empty($value['employee_id'])) return [false, '人员不能为空'];
|