智慧保安后台管理项目备份
Administrator
2021-08-20 665ea36fde7a275e705b2fe72d89af5e016bf683
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -24,6 +24,8 @@
import org.springblade.common.cache.DictCache;
import org.springblade.common.enums.DictEnum;
import org.springblade.common.utils.FtpUtil;
import org.springblade.common.utils.MysqlCenlint;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
@@ -47,7 +49,14 @@
import org.springblade.modules.information.service.IInformationService;
import org.springblade.core.boot.ctrl.BladeController;
import springfox.documentation.annotations.ApiIgnore;
import java.sql.*;
import java.sql.DriverManager; //需要这个jar包 mysql-connector-java-5.1.49.jar
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.io.*;
import java.util.*;
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
@@ -110,8 +119,8 @@
   @ApiOperation(value = "新增", notes = "传入information")
   public R save(@Valid @RequestBody Information information) {
      Dept dept = new Dept();
      String departmentid = information.getDepartmentid();
      Long l = Long.parseLong(departmentid);
      //String departmentid = information.getDepartmentid();
      //Long l = Long.parseLong(departmentid);
      //自招保安公司
      if (information.getStats().equals("0")) {
         Long i = 1420222768149966850L;
@@ -149,7 +158,7 @@
         dept.setAncestors("0,1420222961377357825");
         dept.setDeptCategory(1);
      }
      dept.setId(l);
      //dept.setId(l);
      if (iDeptService.submit(dept)) {
         CacheUtil.clear(SYS_CACHE);
         // 返回懒加载树更新节点所需字段
@@ -676,6 +685,7 @@
   /**
    * 统计用户资格异常的数量
    *
    * @return
    */
   @PostMapping("/selectExtypeUser")
@@ -801,8 +811,8 @@
    * 保安员统计
    */
   @PostMapping("/selectLi")
   public R selectLi(String jurisdiction, String deptid) {
      List<Map<Object, Object>> list = informationService.selectLi(jurisdiction, deptid);
   public R selectLi(String jurisdiction, String deptid,Integer current,Integer size) {
      List<Map<Object, Object>> list = informationService.selectLi(jurisdiction, deptid,current,size);
      return R.data(list);
   }
@@ -835,8 +845,8 @@
    * 公司运营情况进入图表
    */
   @PostMapping("/selectTb")
   public R selectTb(String jurisdiction,String enterpriseName,Integer current,Integer size) {
      List<Map<Object, Object>> list = informationService.selectTb(jurisdiction, enterpriseName,current,size);
   public R selectTb(String jurisdiction, String enterpriseName, Integer current, Integer size) {
      List<Map<Object, Object>> list = informationService.selectTb(jurisdiction, enterpriseName, current, size);
      return R.data(list);
   }
@@ -844,8 +854,8 @@
    * 公司经济情况进入图表
    */
   @PostMapping("/selectJj")
   public R selectJj(String jurisdiction,String enterpriseName,Integer current,Integer size) {
      List<Map<Object, Object>> list = informationService.selectJj(jurisdiction, enterpriseName,current,size);
   public R selectJj(String jurisdiction, String enterpriseName, Integer current, Integer size) {
      List<Map<Object, Object>> list = informationService.selectJj(jurisdiction, enterpriseName, current, size);
      return R.data(list);
   }
@@ -853,8 +863,8 @@
    * 业务统计情况
    */
   @PostMapping("/selectYw")
   public R selectYw(String jurisdiction, String deptid) {
      List<Map<Object, Object>> list = informationService.selectYw(jurisdiction, deptid);
   public R selectYw(String jurisdiction, String deptid,Integer current,Integer size) {
      List<Map<Object, Object>> list = informationService.selectYw(jurisdiction, deptid,current,size);
      return R.data(list);
   }
@@ -862,23 +872,23 @@
    * 保安员详情
    */
   @PostMapping("/selectUIn")
   public R selectUIn(String deptid,String name,String hold,String photo,String examinationtype,String dispatch,String soil) {
      List<Map<Object, Object>> list = informationService.selectUIn(deptid, name, hold, photo, examinationtype, dispatch,soil);
   public R selectUIn(String deptid, String name, String hold, String photo, String examinationtype, String dispatch, String soil) {
      List<Map<Object, Object>> list = informationService.selectUIn(deptid, name, hold, photo, examinationtype, dispatch, soil);
      return R.data(list);
   }
   /**
    *    业务统计明细
    * 业务统计明细
    */
   @PostMapping("/selectDis")
   public R selectDis(String jurisdiction,String deptid,String fid,Integer current,Integer size) {
      List<Map<Object, Object>> list = informationService.selectDis(jurisdiction,deptid,fid,current,size);
   public R selectDis(String jurisdiction, String deptid, String fid, Integer current, Integer size) {
      List<Map<Object, Object>> list = informationService.selectDis(jurisdiction, deptid, fid, current, size);
      return R.data(list);
   }
   /**
    *    服务单位下拉
    * 服务单位下拉
    */
   @PostMapping("/selectFw")
   public R selectFw() {
@@ -924,4 +934,25 @@
      return R.data(lists);
   }
//   public static void main(String[] args) throws Exception {
//      //ftp服务器IP地址
//      String ftpHost = "192.168.0.105";
//      //ftp服务器端口
//      int ftpPort = 21;
//      //ftp服务器用户名
//      String ftpUserName = "yly";
//      //ftp服务器密码
//      String ftpPassword = "Yly@123";
//      //ftp服务器路径
//      String ftpPath = "";
//      //本地路径
//      String localPath = "D:\\anbao";
//      //文件名
//      String fileName = "sql.json";
//      FtpUtil.downloadFtpFile(ftpHost, ftpUserName, ftpPassword, ftpPort, ftpPath, localPath, fileName);
//      String s = TestJson();
//      String sql = stringReplace(s);
//      MysqlCenlint.inster(sql);
//      MysqlCenlint.delete();
//   }
}