洪城义警-正式版后台
zengh
2022-03-07 e38b0c2f6836e87e8cebed180d7f6bf2f1dd1fa3
src/main/java/org/springblade/modules/zc/controller/ZcController.java
@@ -171,14 +171,16 @@
   @ApiOperation(value = "新增或修改", notes = "传入zc")
   public R submit(@Valid @RequestBody Zc zc) {
      String type = zc.getType();
      String stype="1";
      String account=zc.getUsername();
      String stype = "1";
      String account = zc.getUsername();
      if (type.equals("1")) {
         iUserService.updateAcc(stype,account);
         iUserService.updateAcc(stype, account);
         zcService.saveOrUpdate(zc);
      } else {
         iUserService.delete(account);
         zcService.deleteZc(account);
      }
      return R.status(zcService.saveOrUpdate(zc));
      return R.success("成功");
   }
@@ -214,15 +216,26 @@
      user.setRealName(zc.getSname());
      user.setSex(Integer.valueOf(zc.getSex()));
      user.setPhone(zc.getPhone());
      user.setDeptId(zc.getDeptid());
      //user.setDeptId(zc.getDeptid());
      user.setRoleId(zc.getParentId());
      user.setJurisdiction(zc.getJurisdiction());
      user.setWorkaddress(zc.getWorkaddress());
      user.setWorkjurisdiction(zc.getWorkjurisdiction());
      user.setExamination_type("0");
      user.setExamination_mx("正常");
      user.setCardid(zc.getCardid());
      if (!zc.getSignals().equals("")) {
         user.setSignals(zc.getSignals());
      }
      user.setStype("0");
      if (!zc.getAddress().equals("")) {
         user.setAddress(zc.getAddress());
         user.setJurisdiction(zc.getJurisdiction());
      }
      if (!zc.getJobUnit().equals("")) {
         user.setJobUnit(zc.getJobUnit());
      }
      iUserService.saveOrUpdate(user);
      String s = "insert into act_zc(id,username,password,sname,sex,phone,zctime,deptid,parent_id,jurisdiction,cardid)" +
      String s = "insert into act_zc(id,username,password,sname,sex,phone,zctime,parent_id,jurisdiction,cardid,address)" +
         "values(" + "'" + zc.getId() + "'" +
         "," + "'" + zc.getUsername() + "'" +
         "," + "'" + zc.getPassword() + "'" +
@@ -230,10 +243,25 @@
         "," + "'" + zc.getSex() + "'" +
         "," + "'" + zc.getPhone() + "'" +
         "," + "'" + zc.getZctime() + "'" +
         "," + "'" + zc.getDeptid() + "'" +
         "," + "'" + zc.getParentId() + "'" +
         "," + "'" + zc.getJurisdiction() + "'" +
         "," + "'" + zc.getCardid() + "'" + ")";
         "," + "'" + zc.getCardid() + "'" +
         "," + "'" + zc.getAddress() + "'"
         + ")";
//      String s = "insert into act_zc(id,username,password,sname,sex,phone,zctime,deptid,parent_id,jurisdiction,cardid,address)" +
//         "values(" + "'" + zc.getId() + "'" +
//         "," + "'" + zc.getUsername() + "'" +
//         "," + "'" + zc.getPassword() + "'" +
//         "," + "'" + zc.getSname() + "'" +
//         "," + "'" + zc.getSex() + "'" +
//         "," + "'" + zc.getPhone() + "'" +
//         "," + "'" + zc.getZctime() + "'" +
//         "," + "'" + zc.getDeptid() + "'" +
//         "," + "'" + zc.getParentId() + "'" +
//         "," + "'" + zc.getJurisdiction() + "'" +
//         "," + "'" + zc.getCardid() + "'" +
//         "," + "'" + zc.getAddress() + "'"
//         + ")";
      FtpUtil.sqlFileUpload(s);
      return R.success("新增成功");
   }
@@ -247,7 +275,8 @@
   @GetMapping("/inspect")
   public R inspect(String username) {
      Integer userCount = iUserService.selectCount(username);
      if (userCount > 0) {
      Integer integer = zcService.selecyZcCount(username);
      if (userCount > 0 || integer > 0) {
         throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("当前用户{}已存在!", username));
      }
      return R.success("当前用户不存在!");