项目库导出

wushunjie
杜函宇 6 months ago
parent bcee7405c2
commit 442e9873c7

@ -12,20 +12,14 @@ import com.ruoyi.common.utils.poi.ProjectValueUtil;
import com.ruoyi.jjh.declaration.entity.vo.BmsApprovalInfoQueryVo; import com.ruoyi.jjh.declaration.entity.vo.BmsApprovalInfoQueryVo;
import com.ruoyi.jjh.ent.entity.JProject; import com.ruoyi.jjh.ent.entity.JProject;
import com.ruoyi.jjh.ent.entity.request.JProjectExcel; import com.ruoyi.jjh.ent.entity.request.JProjectExcel;
import com.ruoyi.jjh.ent.mapper.JProjectMapper;
import com.ruoyi.jjh.ent.service.JProjectService; import com.ruoyi.jjh.ent.service.JProjectService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -49,6 +43,9 @@ public class JProjectController extends BaseController {
@Resource @Resource
private JProjectService jProjectService; private JProjectService jProjectService;
@Resource
private JProjectMapper jProjectMapper;
// /** // /**
// * 改变没有信用代码的项目 // * 改变没有信用代码的项目
// * @return // * @return
@ -97,6 +94,32 @@ public class JProjectController extends BaseController {
return success(jProjectService.page(page, jProject)); return success(jProjectService.page(page, jProject));
} }
/**
*
*/
@PreAuthorize("@ss.hasAnyRoles('admin,other-gov,gov,ent')")
@ApiOperation(value = "导出项目")
@PostMapping("/exportProject")
public void exportProject(HttpServletResponse response, JProject jProject) {
boolean b = false;
boolean admin = false;
String str = null;
try {
admin = SecurityUtils.isAdmin(SecurityUtils.getUserId());
b = SecurityUtils.hasRole("ent");
str = SecurityUtils.getUsername();
} catch (Exception ignored) {
}
if (!admin & b) {
jProject.setCreditCode(str);
}
List<JProject> list = jProjectMapper.page(jProject);
ExcelUtil<JProject> util = new ExcelUtil<>(JProject.class);
util.exportExcel(response, list, "项目记录");
}
/** /**
* () * ()
* *

Loading…
Cancel
Save