默认折叠,导出总表修改
parent
eca26ee675
commit
e9ed18d082
|
@ -95,7 +95,7 @@ public class ProjectController extends BaseController {
|
|||
model.put("admin", InterfaceUtil.getAdmin());
|
||||
model.put("deptList", deptService.findAll());
|
||||
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model);
|
||||
model.putIfAbsent("extend", "0");
|
||||
model.putIfAbsent("extend", "1");
|
||||
Page<Project> page = projectService.list(searchInfo, pageNumber, pageSize);
|
||||
List<Project> list = page.getList();
|
||||
if(CollectionUtil.isNotEmpty(list)){
|
||||
|
@ -142,7 +142,7 @@ public class ProjectController extends BaseController {
|
|||
*/
|
||||
@RequestMapping("/exportAll")
|
||||
public void exportAll(HttpServletResponse response, Integer id) throws IOException {
|
||||
Project project = projectRepository.findOne(id);
|
||||
Project project = projectService.findById(id);
|
||||
response.setHeader("Content-Disposition", "attachment;filename=".concat(new String((Utils.generateExcelName(project.getName())).getBytes(), StandardCharsets.ISO_8859_1)));
|
||||
response.setHeader("Connection", "close");
|
||||
response.setHeader("Content-Type", "application/vnd.ms-excel");
|
||||
|
@ -522,7 +522,7 @@ public class ProjectController extends BaseController {
|
|||
model.put("admin", InterfaceUtil.getAdmin());
|
||||
model.put("deptList", deptService.findAll());
|
||||
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model);
|
||||
model.putIfAbsent("extend", "0");
|
||||
model.putIfAbsent("extend", "1");
|
||||
Page<Project> page = projectService.list(searchInfo, pageNumber, pageSize);
|
||||
List<Project> list = page.getList();
|
||||
if(CollectionUtil.isNotEmpty(list)){
|
||||
|
|
|
@ -26,4 +26,7 @@ public interface ProjectRepository extends JpaRepository<Project,Integer> {
|
|||
@Transactional(rollbackOn = Exception.class)
|
||||
@Query(value = "update project set project_no = ?1 where id = ?2", nativeQuery = true)
|
||||
int updateProjectNo(String projectNo, int id);
|
||||
|
||||
@Query(value = "SELECT p.*, FORMAT(p.contract_amount,2) as contractRound, FORMAT(p.huazhi_product_amount,2) as huazhiRound, FORMAT(p.huizhi_product_amount,2) as huizhiRound, FORMAT(p.huasan_product_amount,2) as huasanRound, FORMAT(p.ziguang_other_amount,2) as ziguangRound, FORMAT(p.gross_profit,2) as grossProfitRound, FORMAT(p.gross_profit_margin,2) as grossProfitMarginRound, FORMAT(p.advance_interest_amount,2) as advanceInterestAmountRound, FORMAT(p.advance_peak_amount,2) as advancePeakAmountRound from project p where id = ?1 limit 1", nativeQuery = true)
|
||||
Project findById(int id);
|
||||
}
|
||||
|
|
|
@ -517,4 +517,12 @@ public class ProjectService {
|
|||
}
|
||||
projectRepository.save(project);
|
||||
}
|
||||
|
||||
public Project findById(Integer id) {
|
||||
QueryHelper queryHelper = new QueryHelper("SELECT p.*, FORMAT(p.contract_amount,2) as contractRound, FORMAT(p.huazhi_product_amount,2) as huazhiRound, FORMAT(p.huizhi_product_amount,2) as huizhiRound, FORMAT(p.huasan_product_amount,2) as huasanRound, FORMAT(p.ziguang_other_amount,2) as ziguangRound" +
|
||||
", FORMAT(p.gross_profit,2) as grossProfitRound, FORMAT(p.gross_profit_margin,2) as grossProfitMarginRound, FORMAT(p.advance_interest_amount,2) as advanceInterestAmountRound, FORMAT(p.advance_peak_amount,2) as advancePeakAmountRound","project","p");
|
||||
queryHelper.addCondition("p.id=?", id);
|
||||
Project first = pagination.findFirst(queryHelper.getSql(), Project.class);
|
||||
return first;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -249,7 +249,7 @@
|
|||
<td colspan="8">
|
||||
<div align='right'>
|
||||
<button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary"
|
||||
id="extend" value="${extend!}">隐藏筛选项
|
||||
id="extend" value="${extend!}">扩展筛选项
|
||||
</button>
|
||||
<@shiro.hasPermission name="PROJECT_QUERY">
|
||||
<button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary"
|
||||
|
|
|
@ -248,7 +248,7 @@
|
|||
<td colspan="8">
|
||||
<div align='right'>
|
||||
<button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary"
|
||||
id="extend" value="${extend!}">隐藏筛选项
|
||||
id="extend" value="${extend!}">扩展筛选项
|
||||
</button>
|
||||
<@shiro.hasPermission name="APPROVE_QUERY">
|
||||
<button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary"
|
||||
|
|
Loading…
Reference in New Issue