From 2fcd97552d16718cc7997629fd637a73a5a4483f Mon Sep 17 00:00:00 2001
From: 郑永安 <zyazyz250@sina.com>
Date: 星期一, 19 六月 2023 14:44:19 +0800
Subject: [PATCH] 删除

---
 src/main/java/com/gk/firework/Service/ServiceImpl/StandardGuardRollServiceImpl.java |   90 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 90 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/gk/firework/Service/ServiceImpl/StandardGuardRollServiceImpl.java b/src/main/java/com/gk/firework/Service/ServiceImpl/StandardGuardRollServiceImpl.java
new file mode 100644
index 0000000..711d8fb
--- /dev/null
+++ b/src/main/java/com/gk/firework/Service/ServiceImpl/StandardGuardRollServiceImpl.java
@@ -0,0 +1,90 @@
+package com.gk.firework.Service.ServiceImpl;
+
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gk.firework.Domain.StandardGuardRoll;
+import com.gk.firework.Domain.UserInfo;
+import com.gk.firework.Mapper.StandardGuardRollMapper;
+import com.gk.firework.Service.StandardGuardRollService;
+import com.gk.firework.Service.UserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.List;
+
+@Service("standardGuardRollService")
+public class StandardGuardRollServiceImpl extends ServiceImpl<StandardGuardRollMapper, StandardGuardRoll> implements StandardGuardRollService {
+
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private StandardGuardRollMapper standardGuardRollMapper;
+
+
+    @Override
+    public IPage selectPage(Page<StandardGuardRoll> page, Map filter, UserInfo userInfo) {
+        UserInfo user = userService.getById(userInfo.getId());
+        Map<String, Object> params = new HashMap<>();
+        //菜单
+        //可视权限
+        {
+            params.put("enterprisenumber", user.getCompanynumber());
+            params.put("province", user.getProvince());
+            params.put("city", user.getCity());
+            params.put("district", user.getArea());
+            params.put("street", user.getTown());
+            params.put("committee", user.getCommunity());
+        }
+
+        params.put("filterProvince", filter.get("province"));
+        params.put("filterCity", filter.get("city"));
+        params.put("filterDistrict", filter.get("district"));
+        params.put("filterStreet", filter.get("street"));
+        params.put("filterCommittee", filter.get("committee"));
+        params.put("safetysupervision", filter.get("safetysupervision"));
+        params.put("enterprisename", filter.get("enterprisename"));
+        List<StandardGuardRoll> list =  standardGuardRollMapper.selectPages(page,params);
+        return page.setRecords(list);
+    }
+
+
+    @Override
+    public void addStandardGuardRoll(StandardGuardRoll standardGuardRoll, UserInfo userInfo) {
+
+        UserInfo user = userService.getById(userInfo.getId());
+        standardGuardRoll.setCreateby(user.getId());
+        standardGuardRoll.setCreatebyname(user.getUsername());
+        standardGuardRoll.setCreatetime(new Date());
+        standardGuardRoll.setValidflag(true);
+        standardGuardRoll.setEnterprisenumber(user.getUsername());
+        standardGuardRoll.setEnterprisename(user.getUsername());
+
+        this.save(standardGuardRoll);
+    }
+
+    @Override
+    public void modStandardGuardRoll(StandardGuardRoll standardGuardRoll, UserInfo user) {
+        standardGuardRoll.setUpdatebyname(user.getUsername());
+        standardGuardRoll.setUpdatetime(new Date());
+        standardGuardRoll.setUpdateby(user.getId());
+        this.updateById(standardGuardRoll);
+    }
+
+    @Override
+    public void delStandardGuardRoll(Long id, UserInfo user) {
+        LambdaUpdateWrapper<StandardGuardRoll> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper.set(StandardGuardRoll::getValidflag, false)
+                .set(StandardGuardRoll::getUpdatetime, new Date())
+                .set(StandardGuardRoll::getUpdateby, user.getId())
+                .set(StandardGuardRoll::getUpdatebyname,user.getUsername())
+                .eq(StandardGuardRoll::getId, id);
+        this.update(updateWrapper);
+    }
+
+
+}

--
Gitblit v1.9.2