智慧保安后台管理-外网
tangzy
2021-11-05 425fb772c347a85fe8c9cb38a7a386d6368402cd
src/main/java/org/springblade/modules/record/controller/RecordController.java
@@ -35,6 +35,7 @@
import org.springblade.modules.FTP.FtpUtil;
import org.springblade.modules.information.entity.Information;
import org.springblade.modules.information.service.IInformationService;
import org.springblade.modules.permit.vo.PermitVO;
import org.springblade.modules.record.entity.Record;
import org.springblade.modules.record.service.IRecordService;
import org.springblade.modules.record.vo.RecordVO;
@@ -101,7 +102,22 @@
   @ApiOperationSupport(order = 3)
   @ApiOperation(value = "分页", notes = "传入record")
   public R<IPage<RecordVO>> page(RecordVO record, Query query) {
      IPage<RecordVO> pages = recordService.selectRecordPage(Condition.getPage(query), record);
      IPage<RecordVO> pages;
      if (record.getUsetype().equals("0")) {
         pages = recordService.selectRecordPage(Condition.getPage(query), record, null);
      } else if (record.getUsetype().equals("1")) {
         String childer = informationService.selJurchilder(record.getJurisdiction());
         String[] split = childer.split(",");
         String strArrays = "";
         for (int j = 0; j < split.length; j++) {
            strArrays += "'" + split[j] + "',";
         }
         String jurisdiction = strArrays.substring(0, strArrays.length() - 1);
         pages = recordService.selectRecordPage(Condition.getPage(query), record, jurisdiction);
      } else {
         pages = recordService.selectRecordPage(Condition.getPage(query), record, null);
      }
      return R.data(pages);
   }
@@ -114,26 +130,27 @@
   public R save(@Valid @RequestBody Record record) {
      String cardid = record.getCardid();
      String type = record.getPtype();
      Map map = recordService.selectIn(cardid,type);
      Map map = recordService.selectIn(cardid, type);
      if (map != null) {
         String id = map.get("id").toString();
         recordService.removeByIds(Func.toLongList(id));
         String s1 = "delete from sys_record where id = " + "'" + id + "'";
         FtpUtil.sqlFileUpload(s1);
      }
      record.setStorage("1");
      record.setType("2");
      record.setPermitime(new Date());
      recordService.save(record);
      String offtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getOfficetime());
      String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getPermitime());
      String s = "insert into sys_record(id,enterpriseName,representative," +
         "address,business,registration,industry,type,permitime,ptype,representativecell,contacts,contactscell,perid,offices,officetime,jurisdiction,cardid,storage,overtime)" +
         "values(" + "'" + record.getId() + "'"+ "," + "'" + record.getEnterprisename() + "'" + "," +
         "'" + record.getRepresentative() + "'"+ "," + "'" +
         record.getAddress() + "'" + "," + "'" + record.getBusiness() + "'" + "," + "'" + record.getRegistration() + "'" + "," + "'" + record.getIndustry() + "'" + "," + "'" + record.getType() + "'" + "," + "'" + pertime + "'" + "," + "'" + record.getPtype() + "'" + "," +
         "'" + record.getRepresentativecell() + "'" + "," + "'" + record.getContacts() + "'" + "," + "'" + record.getContactscell() + "'" + "," +"'" + record.getPerid() + "'" + "," + "'" + record.getOffices() + "'" + "," +
         "'" + offtime + "'" + "," + "'" + record.getJurisdiction() + "'" +
         "," + "'" + record.getCardid() + "'"+
         "," + "'" + record.getStorage() + "'"+
      //String offtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getOfficetime());
      //String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getPermitime());
      String s = "insert into sys_record(id,representative," +
         "address,business,registration,industry,type,ptype,representativecell,contacts,contactscell,perid,offices,jurisdiction,cardid,storage,overtime)" +
         "values(" + "'" + record.getId() + "'" + "," +
         "'" + record.getRepresentative() + "'" + "," + "'" +
         record.getAddress() + "'" + "," + "'" + record.getBusiness() + "'" + "," + "'" + record.getRegistration() + "'" + "," + "'" + record.getIndustry() + "'" + "," + "'" + record.getType() + "'" + "," + "'" + record.getPtype() + "'" + "," +
         "'" + record.getRepresentativecell() + "'" + "," + "'" + record.getContacts() + "'" + "," + "'" + record.getContactscell() + "'" + "," + "'" + record.getPerid() + "'" + "," + "'" + record.getOffices() + "'" + "," + "'" + record.getJurisdiction() + "'" +
         "," + "'" + record.getCardid() + "'" +
         "," + "'" + record.getStorage() + "'" +
         "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getOvertime()) + "'"
         + ")";
      FtpUtil.sqlFileUpload(s);
@@ -149,7 +166,7 @@
   public R rocordsave(@Valid @RequestBody Record record) {
      String cardid = record.getCardid();
      String type = record.getPtype();
      Map map = recordService.selectIn(cardid,type);
      Map map = recordService.selectIn(cardid, type);
      if (map != null) {
         record.setStorage("0");
         record.setPermitime(new Date());
@@ -173,7 +190,7 @@
      //审核通过
      if (record.getType().equals("0")) {
         //新增组织机构和单位信息
         Information information =new Information();
         Information information = new Information();
         information.setCreditcode(record.getCreditcode());
         information.setEnterprisename(record.getEnterprisename());
         information.setRepresentative(record.getRepresentative());
@@ -192,7 +209,7 @@
         information.setContactscell(record.getContactscell());
         Dept dept = new Dept();
         //本市公司
         if (record.getPtype().equals("2")){
         if (record.getPtype().equals("2")) {
            Long i = 1425366663452196865L;
            dept.setParentId(i);
            dept.setAncestors("0,1425366663452196865");
@@ -222,26 +239,25 @@
         user.setPassword(initPassword);
         boolean b = userService.saveOrUpdate(user);
         //把附件添加单位id
         attachService.updat(information.getDepartmentid(),record.getCardid());
         attachService.updat(information.getDepartmentid(), record.getCardid());
         String s1 = "update sys_record set type = " + "'" + record.getType() + "'" +
            ",papprove = " + "'" + record.getPapprove() + "'"+
            ",xapprove = " + "'" + record.getXapprove() + "'"+
            ",sapprove = " + "'" + record.getSapprove() + "'"+
            ",popinion = " + "'" + record.getPopinion() + "'"+
            ",sopinion = " + "'" + record.getSopinion() + "'"+
            ",xopinion = " + "'" + record.getXopinion() + "'"+
            " " +"where id = " + "'" + record.getId() + "'";
            ",papprove = " + "'" + record.getPapprove() + "'" +
            ",xapprove = " + "'" + record.getXapprove() + "'" +
            ",sapprove = " + "'" + record.getSapprove() + "'" +
            ",popinion = " + "'" + record.getPopinion() + "'" +
            ",sopinion = " + "'" + record.getSopinion() + "'" +
            ",xopinion = " + "'" + record.getXopinion() + "'" +
            " " + "where id = " + "'" + record.getId() + "'";
         FtpUtil.sqlFileUpload(s1);
      }
      else {
      } else {
         String s1 = "update sys_record set type = " + "'" + record.getType() + "'" +
            ",papprove = " + "'" + record.getPapprove() + "'"+
            ",xapprove = " + "'" + record.getXapprove() + "'"+
            ",sapprove = " + "'" + record.getSapprove() + "'"+
            ",popinion = " + "'" + record.getPopinion() + "'"+
            ",sopinion = " + "'" + record.getSopinion() + "'"+
            ",xopinion = " + "'" + record.getXopinion() + "'"+
            " " +"where id = " + "'" + record.getId() + "'";
            ",papprove = " + "'" + record.getPapprove() + "'" +
            ",xapprove = " + "'" + record.getXapprove() + "'" +
            ",sapprove = " + "'" + record.getSapprove() + "'" +
            ",popinion = " + "'" + record.getPopinion() + "'" +
            ",sopinion = " + "'" + record.getSopinion() + "'" +
            ",xopinion = " + "'" + record.getXopinion() + "'" +
            " " + "where id = " + "'" + record.getId() + "'";
         FtpUtil.sqlFileUpload(s1);
      }
      return R.status(recordService.saveOrUpdate(record));
@@ -270,8 +286,8 @@
   @PostMapping("/selectIn")
   public R selectIn(String cardid,String type) {
      Map map = recordService.selectIn(cardid,type);
   public R selectIn(String cardid, String type) {
      Map map = recordService.selectIn(cardid, type);
      return R.data(map);
   }
}