智慧保安后台管理-外网
tangzy
2021-08-25 55c7ca1ef88e9b3cf772cbf77eed3ac81dcfb41a
src/main/java/org/springblade/modules/record/controller/RecordController.java
@@ -27,12 +27,15 @@
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.FTP.FtpUtil;
import org.springblade.modules.record.entity.Record;
import org.springblade.modules.record.service.IRecordService;
import org.springblade.modules.record.vo.RecordVO;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
/**
@@ -95,8 +98,25 @@
         String id = map.get("id").toString();
         recordService.removeByIds(Func.toLongList(id));
      }
      record.setStorage("0");
      return R.status(recordService.save(record));
      record.setStorage("1");
      record.setPermitime(new Date());
      recordService.save(record);
      String formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getEstablishtime());
      String offtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getOfficetime());
      String s = "insert into sys_record(id,creditCode,enterpriseName,representative,establishTime," +
         "registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," +
         "address,business,region,registration,industry,type,permitime,deptid,ptype,representativecell,contacts,contactscell,perid,offices,officetime)" +
         "values(" + "'" + record.getId() + "'" + "," + "'" + record.getCreditcode() + "'" + "," + "'" + record.getEnterprisename() + "'" + "," + "'"
         + record.getRepresentative() + "'" + "," +
         "'" + formatStr + "'" + "," + "'" + record.getRegisteredcapital() + "'" + "," + "'"
         + record.getOrganizationcode() + "'" + "," + "'" + record.getRegistrationnumber() + "'" + "," +
         "'" + record.getIdentificationnumber() + "'" + "," + "'" + record.getEnterprises() + "'" + "," + "'" +
         record.getAddress() + "'" + "," + "'" + record.getBusiness() + "'" + "," + "'" +
         record.getRegion() + "'" + "," + "'" + record.getRegistration() + "'" + "," + "'" + record.getIndustry()+ "'" + "," + "'"+ record.getType() + "'" + "," +"'" + record.getPermitime() + "'" + "," + "'" + record.getDeptid() + "'" + "," + "'" + record.getPtype() + "'" + "," +
         "'" + record.getRepresentativecell() + "'" + "," + "'" + record.getContacts() + "'" + "," + "'" + record.getContactscell() + "'"+"," +
         "'" + record.getPerid() + "'"+"," + "'" + record.getOffices() + "'"+"," + "'" + offtime + "'"+")" ;
      FtpUtil.sqlFileUpload(s);
      return R.success("成功");
   }
   /**
@@ -110,12 +130,14 @@
      Map map = recordService.selectIn(cardid);
      if (map!=null){
         record.setStorage("0");
         record.setPermitime(new Date());
         recordService.updateById(record);
      }
      else {
         record.setStorage("0");
         record.setType("2");
         record.setPtype("2");
         record.setPermitime(new Date());
         recordService.save(record);
      }
      return R.success("暂存成功");
@@ -153,4 +175,9 @@
   }
   @PostMapping("/selectIn")
   public R selectIn(String cardid) {
      Map map = recordService.selectIn(cardid);
      return R.data(map);
   }
}