| | |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.common.constant.FtpConstant; |
| | | import org.springblade.core.mp.support.Condition; |
| | | 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.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.licetuser.entity.Licetuser; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/liceUp") |
| | | @ApiOperationSupport(order = 1) |
| | | public R liceUp(@Valid @RequestBody Licetuser licetuser) { |
| | | Map map = licetuserService.liceIn(licetuser.getUserid(),licetuser.getPtype()); |
| | | if (map==null){ |
| | | licetuserService.save(licetuser); |
| | | String url = ""; |
| | | String[] split = licetuser.getLinks().split(","); |
| | | for (int i = 0; i < split.length; i++) { |
| | | String s = split[i].substring(26, split[i].length()); |
| | | String[] splits = split[i].split("/"); |
| | | url += FtpConstant.ip +"/zhba/upload/picture/"+ splits[6] + ","; |
| | | } |
| | | String substring = url.substring(0, url.length() - 1); |
| | | licetuser.setLinks(substring); |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_licetuser(id,userid,ptype,templateid,links) " + |
| | | "values(" + "'" + licetuser.getId() + "'" + "," + |
| | | "'" + licetuser.getUserid() + "'" + "," + |
| | | "'" + licetuser.getPtype() + "'" + "," + |
| | | "'" + licetuser.getTemplateid() + "'" + "," + |
| | | "'" + licetuser.getLinks() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | } |
| | | else { |
| | | String id = map.get("id").toString(); |
| | | Integer a= Integer.parseInt(id); |
| | | licetuser.setId(a); |
| | | licetuserService.updateById(licetuser); |
| | | String url = ""; |
| | | String[] split = licetuser.getLinks().split(","); |
| | | for (int i = 0; i < split.length; i++) { |
| | | String s = split[i].substring(26, split[i].length()); |
| | | String[] splits = split[i].split("/"); |
| | | url += FtpConstant.ip +"/zhba/upload/picture/"+ splits[6] + ","; |
| | | } |
| | | String substring = url.substring(0, url.length() - 1); |
| | | licetuser.setLinks(substring); |
| | | String s1 = "update sys_licetuser set userid = " + "'" + licetuser.getUserid() + "'" + |
| | | ",ptype = " + "'" + licetuser.getPtype() + "'" + |
| | | ",templateid = " + "'" + licetuser.getTemplateid() + "'" + |
| | | ",links = " + "'" + licetuser.getLinks() + "'" + |
| | | " " + "where id = " + "'" + licetuser.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | } |
| | | return R.data("成功"); |
| | | } |
| | |
| | | permit.setPermitime(new Date()); |
| | | permitService.save(permit); |
| | | String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(permit.getPermitime()); |
| | | String overtime = new SimpleDateFormat("yyyy-MM-dd").format(permit.getOvertime()); |
| | | String s = "insert into sys_permit(id,creditCode,enterpriseName,representative," + |
| | | "registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," + |
| | | "address,business,region,registration,industry,type,permitime,deptid,ptype,representativecell,contacts,contactscell,jurisdiction,cardid)" + |
| | | "address,business,region,registration,industry,type,permitime,deptid,ptype,representativecell,contacts,contactscell,jurisdiction,cardid,overtime)" + |
| | | "values(" + "'" + permit.getId() + "'" + "," + "'" + permit.getCreditcode() + "'" + "," + "'" + permit.getEnterprisename() + "'" + "," + "'" |
| | | + permit.getRepresentative() + "'" + "," + "'" + permit.getRegisteredcapital() + "'" + "," + "'" |
| | | + permit.getOrganizationcode() + "'" + "," + "'" + permit.getRegistrationnumber() + "'" + "," + |
| | |
| | | "'" + pertime + "'" + "," + "'" + permit.getDeptid() + "'" + "," + "'" + permit.getPtype() + "'" + "," + |
| | | "'" + permit.getRepresentativecell() + "'" + "," + "'" + permit.getContacts() + "'" + "," + "'" |
| | | + permit.getContactscell() + "'" + "," + "'" + permit.getJurisdiction() + "'" + |
| | | "," + "'" + permit.getCardid() + "'" + ")"; |
| | | "," + "'" + permit.getCardid() + "'"+ "," + "'" + overtime+ "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | return R.success("许可提交成功"); |
| | | } |
| | |
| | | user.setAccount(record.getEnterprisename()); |
| | | String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD); |
| | | user.setPassword(initPassword); |
| | | userService.saveOrUpdate(user); |
| | | boolean b = userService.saveOrUpdate(user); |
| | | //把附件添加单位id |
| | | attachService.updat(information.getDepartmentid(),record.getCardid()); |
| | | String s1 = "update sys_record set type = " + "'" + record.getType() + "'" + |
| | |
| | | " " +"where id = " + "'" + record.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | } |
| | | return R.status(recordService.updateById(record)); |
| | | return R.success("成功"); |
| | | } |
| | | |
| | | /** |