智慧保安后台管理-外网
tangzy
2021-08-25 02c1cdc64b62e5248b7b5bdadcfd5cc661b43248
src/main/java/org/springblade/modules/record/controller/RecordController.java
@@ -39,7 +39,7 @@
import java.util.Map;
/**
 *  控制器
 * 控制器
 *
 * @author BladeX
 * @since 2021-07-12
@@ -94,27 +94,29 @@
   public R save(@Valid @RequestBody Record record) {
      String cardid = record.getCardid();
      Map map = recordService.selectIn(cardid);
      if (map!=null){
      if (map != null) {
         String id = map.get("id").toString();
         recordService.removeByIds(Func.toLongList(id));
      }
      record.setStorage("1");
      record.setType("2");
      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 pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getPermitime());
      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)" +
         "address,business,region,registration,industry,type,permitime,deptid,ptype,representativecell,contacts,contactscell,perid,offices,officetime,jurisdiction)" +
         "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 + "'"+")" ;
         record.getRegion() + "'" + "," + "'" + record.getRegistration() + "'" + "," + "'" + record.getIndustry() + "'" + "," + "'" + record.getType() + "'" + "," + "'" + pertime + "'" + "," + "'" + record.getDeptid() + "'" + "," + "'" + record.getPtype() + "'" + "," +
         "'" + record.getRepresentativecell() + "'" + "," + "'" + record.getContacts() + "'" + "," + "'" + record.getContactscell() + "'" + "," +
         "'" + record.getPerid() + "'" + "," + "'" + record.getOffices() + "'" + "," + "'" + offtime + "'" + "'" + "," + "'" + record.getJurisdiction() + "'" + ")";
      FtpUtil.sqlFileUpload(s);
      return R.success("成功");
   }
@@ -128,12 +130,11 @@
   public R rocordsave(@Valid @RequestBody Record record) {
      String cardid = record.getCardid();
      Map map = recordService.selectIn(cardid);
      if (map!=null){
      if (map != null) {
         record.setStorage("0");
         record.setPermitime(new Date());
         recordService.updateById(record);
      }
      else {
      } else {
         record.setStorage("0");
         record.setType("2");
         record.setPtype("2");