|
@@ -2,6 +2,7 @@ package org.jeecg.modules.oa.controller;
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.io.IOException;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.net.URLDecoder;
|
|
|
import java.sql.Connection;
|
|
|
import java.util.*;
|
|
@@ -90,17 +91,22 @@ public class IncidentTicketController {
|
|
|
// System.out.println(aa.replaceAll(",null","").replaceAll("null,",""));
|
|
|
|
|
|
|
|
|
- String date1 = "2022-02-15";//开票
|
|
|
- String date2 = "2022-02-14";
|
|
|
- System.out.println(date1.compareTo(date2));
|
|
|
- if(date1.compareTo(date2) > 0) {
|
|
|
- System.out.println("date1 大于 date2");
|
|
|
- }
|
|
|
- if(date1.compareTo(date2) < 0) {
|
|
|
- System.out.println("false");
|
|
|
- }else{
|
|
|
- System.out.println("tre");
|
|
|
- }
|
|
|
+// String date1 = "2022-02-15";//开票
|
|
|
+// String date2 = "2022-02-14";
|
|
|
+// System.out.println(date1.compareTo(date2));
|
|
|
+// if(date1.compareTo(date2) > 0) {
|
|
|
+// System.out.println("date1 大于 date2");
|
|
|
+// }
|
|
|
+// if(date1.compareTo(date2) < 0) {
|
|
|
+// System.out.println("false");
|
|
|
+// }else{
|
|
|
+// System.out.println("tre");
|
|
|
+// }
|
|
|
+ String practicalSumOld = "-1232131.23232";
|
|
|
+ BigDecimal practicalSumBig = new BigDecimal(practicalSumOld).abs();//
|
|
|
+ String practicalSum = practicalSumBig.toString();
|
|
|
+ System.out.println(new BigDecimal(practicalSum));
|
|
|
+
|
|
|
}
|
|
|
@RequestMapping(value = "/list1", method = RequestMethod.GET)
|
|
|
public JSONObject list1(Map<String, Object> param) {
|
|
@@ -644,8 +650,64 @@ public class IncidentTicketController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/exportXls")
|
|
|
public ModelAndView exportXls(HttpServletRequest request, IncidentTicket incidentTicket) {
|
|
|
+
|
|
|
+ String state = incidentTicket.getState();//单据状态
|
|
|
+ String informant = incidentTicket.getInformant();//填报人
|
|
|
+ String processor = incidentTicket.getProcessor();//处理人
|
|
|
+
|
|
|
+ String handle = incidentTicket.getHandle();
|
|
|
+ incidentTicket.setProcessor(null);
|
|
|
+ incidentTicket.setState(null);
|
|
|
+ incidentTicket.setInformant(null);
|
|
|
+ incidentTicket.setHandle(null);
|
|
|
+ QueryWrapper<IncidentTicket> queryWrapper = QueryGenerator.initQueryWrapper(incidentTicket, request.getParameterMap());
|
|
|
+ queryWrapper.eq("1","1");
|
|
|
+
|
|
|
+// queryWrapper.last("and id in(select table_id from act_z_business where table_name='incident_ticket' and result = 2) " +
|
|
|
+// "order by accident_number desc ");
|
|
|
+ if(StringUtils.isNotBlank(state)){
|
|
|
+ queryWrapper.in("state",state.split(","));
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(informant)){
|
|
|
+ queryWrapper.in("informant",informant.split(","));
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(processor)){
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ for(String o:processor.split(",")){
|
|
|
+ if(StringUtils.isBlank(sb.toString())){
|
|
|
+ sb.append("'").append(o).append("'");
|
|
|
+ }else{
|
|
|
+ sb.append(",'").append(o).append("'");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isBlank(handle)){
|
|
|
+
|
|
|
+ queryWrapper.last("and id in (select pk_incident_ticket from incident_ticket_msg where user_id in ("+sb.toString()+") ) " +
|
|
|
+ "and id in(select table_id from act_z_business where table_name='incident_ticket' and result = 2) " +
|
|
|
+ "order by date_format(create_time,'%Y-%m-%d') desc ,substring_index(accident_number, '-', -1) + 0 desc ");
|
|
|
+
|
|
|
+ }else{
|
|
|
+ if(handle.equals("是")){
|
|
|
+
|
|
|
+ queryWrapper.last("and id in (select pk_incident_ticket from incident_ticket_msg where user_id in ("+sb.toString()+") and confirm != '否') " +
|
|
|
+ "and id in(select table_id from act_z_business where table_name='incident_ticket' and result = 2) " +
|
|
|
+ "order by date_format(create_time,'%Y-%m-%d') desc ,substring_index(accident_number, '-', -1) + 0 desc ");
|
|
|
+
|
|
|
+ }else{
|
|
|
+ queryWrapper.last("and id in (select pk_incident_ticket from incident_ticket_msg where user_id in ("+sb.toString()+") and confirm = '否') " +
|
|
|
+ "and id in(select table_id from act_z_business where table_name='incident_ticket' and result = 2) " +
|
|
|
+ "order by date_format(create_time,'%Y-%m-%d') desc ,substring_index(accident_number, '-', -1) + 0 desc ");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ queryWrapper.last("and id in(select table_id from act_z_business where table_name='incident_ticket' and result = 2) " +
|
|
|
+ "order by date_format(create_time,'%Y-%m-%d') desc ,substring_index(accident_number, '-', -1) + 0 desc ");
|
|
|
+ }
|
|
|
+
|
|
|
// Step.1 组装查询条件查询数据
|
|
|
- QueryWrapper<IncidentTicket> queryWrapper = QueryGenerator.initQueryWrapper(incidentTicket, request.getParameterMap());
|
|
|
+
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
|
|
//Step.2 获取导出数据
|