| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.constant.FtpConstant; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | 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.springblade.modules.coinspect.entity.Coinspect; |
| | | import org.springblade.modules.coinspect.service.ICoinspectService; |
| | | import org.springblade.modules.coinspect.vo.CoinspectVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.text.SimpleDateFormat; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入coinspect") |
| | | public R save(@Valid @RequestBody Coinspect coinspect) throws Exception { |
| | | //arg.test01(arg.url+"/coinspect/save",coinspect); |
| | | return R.status(coinspectService.save(coinspect)); |
| | | coinspectService.save(coinspect); |
| | | String url = ""; |
| | | String[] split = coinspect.getUrl().split(","); |
| | | for (int i = 0; i < split.length; i++) { |
| | | String s = split[i].substring(26, split[i].length()); |
| | | url += FtpConstant.ip + s + ","; |
| | | } |
| | | String substring = url.substring(0, url.length() - 1); |
| | | coinspect.setUrl(substring); |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_coinspect(id,name,sName,deptName,reviewTime,insid,results,url) " + |
| | | "values(" + "'" + coinspect.getId() + "'" + "," + |
| | | "'" + coinspect.getName() + "'" + "," + |
| | | "'" + coinspect.getSname() + "'" + "," + |
| | | "'" + coinspect.getSname() + "'" + "," + |
| | | "'" + coinspect.getDeptname() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd").format(coinspect.getReviewtime()) + "'" + "," + |
| | | "'" + coinspect.getInsid() + "'" + "," + |
| | | "'" + coinspect.getResults() + "'" + "," + |
| | | "'" + coinspect.getUrl() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.success("新增成功"); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入coinspect") |
| | | public R update(@Valid @RequestBody Coinspect coinspect) throws Exception { |
| | | //arg.test01(arg.url+"/coinspect/update",coinspect); |
| | | return R.status(coinspectService.updateById(coinspect)); |
| | | } |
| | | |
| | |
| | | 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.directive.entity.Directive; |
| | | import org.springblade.modules.directive.entity.DirectiveFile; |
| | | import org.springblade.modules.directive.service.DirectiveService; |
| | | import org.springblade.modules.directive.vo.DirectiveVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | boolean status = false; |
| | | directive.setSendTime(new Date()); |
| | | status = directiveService.save(directive); |
| | | //内网新增 |
| | | //arg.test01(arg.url+"/directive/saveDirectiveAndFile",directive); |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_directive(id,type,send_directive_id,receive_directive_ids,send_time,content) " + |
| | | "values(" + "'" + directive.getId() + "'" + "," + |
| | | "'" + directive.getType() + "'" + "," + |
| | | "'" + directive.getSendDirectiveId() + "'" + "," + |
| | | "'" + directive.getReceiveDirectiveIds() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd").format(directive.getStartTime()) + "'" + "," + |
| | | "'" +directive.getContent() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | if (status){ |
| | | //新增图片 |
| | | if (null!=directive.getUrl() && directive.getUrl()!=""){ |
| | |
| | | IFNULL(C.pnum ,0) as pnum |
| | | FROM |
| | | sys_information i |
| | | LEFT JOIN ( SELECT COUNT( * ) AS znum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND |
| | | LEFT JOIN ( SELECT COUNT( * ) AS znum, dept_id FROM blade_user WHERE |
| | | ( role_id = '1412226235153731586' OR role_id = '1416733602219110402' ) AND |
| | | status=1 GROUP BY dept_id ) A ON A.dept_id = i.departmentid |
| | | LEFT JOIN ( SELECT COUNT( * ) AS cnum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND |
| | | LEFT JOIN ( SELECT COUNT( * ) AS cnum, dept_id FROM blade_user WHERE |
| | | ( role_id = '1412226235153731586' OR role_id = '1416733602219110402' ) AND |
| | | status=1 AND hold=1 GROUP BY dept_id ) B ON B.dept_id = i.departmentid |
| | | LEFT JOIN ( SELECT COUNT( * ) AS pnum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND |
| | | status=1 AND dispatch=0 GROUP BY dept_id ) C ON C.dept_id = i.departmentid |
| | |
| | | FROM |
| | | blade_user |
| | | WHERE |
| | | `status` = 1 |
| | | ( role_id = '1412226235153731586' OR role_id = '1416733602219110402' ) |
| | | and `status` = 1 |
| | | AND is_deleted = 0 |
| | | AND dispatch = 0 |
| | | GROUP BY |
| | |
| | | FROM |
| | | blade_user |
| | | WHERE |
| | | `status` = 1 |
| | | ( role_id = '1412226235153731586' OR role_id = '1416733602219110402' ) |
| | | and `status` = 1 |
| | | AND is_deleted = 0 |
| | | AND dispatch = 1 |
| | | GROUP BY |
| | |
| | | String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") |
| | | + fileName.substring(fileName.lastIndexOf(".")); |
| | | InputStream in = file.getInputStream(); |
| | | String[] split = newName.split("/"); |
| | | //创建头部信息 |
| | | Map<String, String> headers = new HashMap<>(1 << 2); |
| | | //添加自定义内容类型 |
| | |
| | | in, in.available(), -1) |
| | | .headers(headers) |
| | | .build()); |
| | | FtpUtil.uploadFile(ftpHost_dev, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", split[2], in); |
| | | in.close(); |
| | | String urls = "http://223.82.109.183:2081/zhba/" + newName; |
| | | return R.data(urls); |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.constant.FtpConstant; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | 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.springblade.modules.seinspect.entity.Seinspect; |
| | | import org.springblade.modules.seinspect.service.ISeinspectService; |
| | | import org.springblade.modules.seinspect.vo.SeinspectVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.text.SimpleDateFormat; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入seinspect") |
| | | public R save(@Valid @RequestBody Seinspect seinspect) throws Exception { |
| | | //arg.test01(arg.url+"/seinspect/save",seinspect); |
| | | return R.status(seinspectService.save(seinspect)); |
| | | seinspectService.save(seinspect); |
| | | String url = ""; |
| | | String[] split = seinspect.getUrl().split(","); |
| | | for (int i = 0; i < split.length; i++) { |
| | | String s = split[i].substring(26, split[i].length()); |
| | | url += FtpConstant.ip + s + ","; |
| | | } |
| | | String substring = url.substring(0, url.length() - 1); |
| | | seinspect.setUrl(substring); |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_seinspect(id,realName,carid,sName,inspectman,deptName,reviewTime,insid,examination_type,url,jid,deptid,jurisdiction) " + |
| | | "values(" + "'" + seinspect.getId() + "'" + "," + |
| | | "'" + seinspect.getRealname() + "'" + "," + |
| | | "'" + seinspect.getCarid() + "'" + "," + |
| | | "'" + seinspect.getSname() + "'" + "," + |
| | | "'" + seinspect.getInspectman() + "'" + "," + |
| | | "'" + seinspect.getDeptname() + "'" + "," + |
| | | "'" + new SimpleDateFormat("yyyy-MM-dd").format(seinspect.getReviewtime()) + "'" + "," + |
| | | "'" + seinspect.getInsid() + "'" + "," + |
| | | "'" + seinspect.getExaminationType() + "'" + "," + |
| | | "'" + seinspect.getUrl() + "'" + "," + |
| | | "'" + seinspect.getJid() + "'" + "," + |
| | | "'" + seinspect.getDeptid() + "'" + "," + |
| | | "'" +seinspect.getJurisdiction() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.success("成功"); |
| | | } |
| | | |
| | | /** |