Browse Source

修改护理完成功能

qinyan 4 months ago
parent
commit
84e0188619

+ 12 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/care/CareApplicationsController.java

@@ -152,7 +152,7 @@ public class CareApplicationsController extends BaseController
 
 
     /**
-     * 修改护理申请
+     * 指派护理申请
      */
     @Log(title = "护理指派公司", businessType = BusinessType.UPDATE)
     @PostMapping("/assign")
@@ -161,4 +161,15 @@ public class CareApplicationsController extends BaseController
         Long userId=getUserId();
         return toAjax(careApplicationsService.assign(careApplications,userId));
     }
+
+    /**
+     * 护理完成
+     */
+    @Log(title = "护理完成", businessType = BusinessType.UPDATE)
+    @PostMapping("/complete")
+    public AjaxResult complete(@RequestBody CareApplications careApplications)
+    {
+        Long userId=getUserId();
+        return toAjax(careApplicationsService.complete(careApplications,userId));
+    }
 }

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/care/service/ICareApplicationsService.java

@@ -67,4 +67,6 @@ public interface ICareApplicationsService
     int start(CareApplications careApplications,Long userId);
 
     int check(CareApplications careApplications, Long userId);
+
+    int complete(CareApplications careApplications, Long userId);
 }

+ 26 - 0
ruoyi-system/src/main/java/com/ruoyi/care/service/impl/CareApplicationsServiceImpl.java

@@ -237,4 +237,30 @@ public class CareApplicationsServiceImpl implements ICareApplicationsService
         careApplications.setUpdateTime(DateUtils.getNowDate());
         return careApplicationsMapper.updateCareApplications(careApplications);
     }
+
+    @Override
+    @Transactional
+    public int complete(CareApplications careApplications, Long userId) {
+        careApplications.setDealStatus("complete");
+        careApplications.setPayStatus("dis_pay");
+
+        //获取当前节点记录
+        CareRecords curr = new CareRecords();
+        curr.setApplyId(careApplications.getApplyId());
+        curr.setState("0");
+        List<CareRecords> lst = careRecordsMapper.selectCareRecordsList(curr);
+        if (lst.size() > 0) {
+            curr = lst.get(0);
+            curr.setOperate(userId.toString());
+
+            curr.setIsAgree("1");
+            curr.setState("1");
+            curr.setUpdateTime(DateUtils.getNowDate());
+            curr.setUpdateBy(userId.toString());
+            careRecordsMapper.updateCareRecords(curr);
+
+        }
+
+        return careApplicationsMapper.updateCareApplications(careApplications);
+    }
 }

+ 10 - 1
ruoyi-vue/src/api/care/applications.js

@@ -67,4 +67,13 @@ export function checkApplications(data) {
     method: 'post',
     data: data
   })
-}
+}
+
+//完成护理申请
+export function completeApplications(data) {
+  return request({
+    url: '/care/applications/complete',
+    method: 'post',
+    data: data
+  })
+}

+ 2 - 2
ruoyi-vue/src/views/care/clocks/index_task.vue

@@ -162,7 +162,7 @@
 import {
   getApplications,
   listApplications,
-    updateApplications
+  completeApplications
 } from "@/api/care/applications";
 import clockIndex from './index.vue';
 
@@ -269,7 +269,7 @@ function finish(row){
   proxy.$modal.confirm('是否确认该客户:"' + row.personName + '"已经完成?').then(function() {
     row.dealStatus="complete"
     row.payStatus="dis_pay"
-    return updateApplications(row);
+    return completeApplications(row);
   }).then(() => {
     getList();
     proxy.$modal.msgSuccess("操作成功");