|
|
@@ -1582,6 +1582,30 @@ class ItemService extends Service
|
|
|
return [true, $customer];
|
|
|
}
|
|
|
|
|
|
+ public function itemNodeMissionUpdateState($data, $user){
|
|
|
+ if(empty($data['id'])) return [false, '任务ID不能为空'];
|
|
|
+ if(empty($data['state']) || ! isset(ItemNodeMission::State_Type[$data['state']])) return [false, '状态不存在错误'];
|
|
|
+ $model = ItemNodeMission::where('del_time',0)
|
|
|
+ ->where('id',$data['id'])
|
|
|
+ ->first();
|
|
|
+ if(empty($model)) return [false,'项目节点任务不存在或已被删除'];
|
|
|
+ if($model->state == ItemNodeMission::TYPE_THREE || $model->state == ItemNodeMission::TYPE_MINUS_ONE) return [false, '任务状态处在不允许更新的状态'];
|
|
|
+
|
|
|
+ try {
|
|
|
+ DB::beginTransaction();
|
|
|
+
|
|
|
+ $model->state = $data['state'];
|
|
|
+ $model->save();
|
|
|
+
|
|
|
+ DB::commit();
|
|
|
+ }catch (\Exception $exception){
|
|
|
+ DB::rollBack();
|
|
|
+ return [false,$exception->getMessage()];
|
|
|
+ }
|
|
|
+
|
|
|
+ return [true, ''];
|
|
|
+ }
|
|
|
+
|
|
|
public function itemNodeMissionUpdateProgressContent($data, $user){
|
|
|
if(empty($data['id'])) return [false, '任务ID不能为空'];
|
|
|
$customer = ItemNodeMission::where('del_time',0)
|