Browse Source

上报导出

jz.kai 2 năm trước cách đây
mục cha
commit
8768d62a6e

+ 5 - 0
common/src/main/resources/mapper/base/FeedbackOpinion.xml

@@ -204,6 +204,11 @@
 			<if test="searchParams.year != null">
 				and a.sort_ like #{searchParams.year}
 			</if>
+			<if test="searchParams.lv3 == true">
+				and LENGTH(c.code_) = 110
+				and c.code_ NOT LIKE '%50f3c8f8-5979-470b-9b1d-8c2314ccb2e5%'
+				and c.code_ NOT LIKE '%d452b1d7-3f81-4559-b399-0ae44846fa69%'
+			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 	        ${sort.name} ${sort.order}

+ 5 - 0
common/src/main/resources/mapper/base/Office.xml

@@ -87,6 +87,11 @@ id_,area_id,name_,del_flag,create_time,create_by,update_time,update_by		from bas
 			<if test="searchParams.name != null">
 				and name_ like #{searchParams.name}
 			</if>
+			<if test="searchParams.names != null">
+				<foreach collection="searchParams.names" item="li" open="and (" separator="and" close=")">
+					name_ like CONCAT("%",#{li},"%")
+				</foreach>
+			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 	        ${sort.name} ${sort.order}

+ 97 - 0
web/src/main/java/com/jpsoft/excellent/modules/base/controller/FeedbackOpinionController.java

@@ -23,6 +23,7 @@ import org.apache.poi.ss.usermodel.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ClassPathResource;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
@@ -613,6 +614,102 @@ public class FeedbackOpinionController {
         return downloadUrl;
     }
 
+    @ApiOperation(value="导出上报报表")
+    @RequestMapping(value = "reportListXlsSB",method = RequestMethod.POST)
+    public String reportListXlsSB(Date[] reportDate, @RequestAttribute String subject){
+        String downloadUrl = "";
+
+        try{
+            String xlsPath = "static/jzs_qzp_pjsjb.xls";
+            ClassPathResource resource = new ClassPathResource(xlsPath);
+            Workbook workbook = WorkbookFactory.create(resource.getInputStream());
+            Sheet sheet = workbook.getSheetAt(0);
+
+            //读取数据
+            Map<String,Object> searchParams = new HashMap<>();
+            searchParams.put("lv3",true);
+            if (reportDate.length > 0) {
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                Calendar calendar = new GregorianCalendar();
+                calendar.setTime(reportDate[1]);
+                calendar.add(calendar.DATE,1);
+
+                searchParams.put("reportDateStart",sdf.format(reportDate[0]));
+                searchParams.put("reportDateEnd",sdf.format(calendar.getTime()));
+            }
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("create_time","asc"));
+
+            Page<FeedbackOpinion> page = feedbackOpinionService.pageSearch(searchParams,1,100000,false,sortList);
+
+            //写入数据
+            for(int i=0; i<page.getResult().size(); i++){
+                FeedbackOpinion feedbackOpinion = page.getResult().get(i);
+
+                Row row = sheet.createRow(i+2);
+                row.createCell(0).setCellValue(feedbackOpinion.getId());
+//                row.createCell(1).setCellValue(1);
+                if(StringUtils.isNotEmpty(feedbackOpinion.getAreaId())) {
+                    Area area = areaService.get(feedbackOpinion.getAreaId());
+                    row.createCell(2).setCellValue(area.getName());
+                }
+                row.createCell(3).setCellValue("5");
+//                row.createCell(4).setCellValue(4);
+                row.createCell(5).setCellValue(feedbackOpinion.getStationName());
+                row.createCell(6).setCellValue(feedbackOpinion.getConnect());
+                row.createCell(7).setCellValue(feedbackOpinion.getConnectPhone());
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                row.createCell(8).setCellValue(sdf.format(feedbackOpinion.getCreateTime()));
+                if(feedbackOpinion.getIsSatisfied()){
+                    row.createCell(9).setCellValue("4");
+                }
+                else{
+                    row.createCell(9).setCellValue("2");
+                }
+//                row.createCell(10).setCellValue(10);
+//                row.createCell(11).setCellValue(11);
+//                row.createCell(12).setCellValue(12);
+//                row.createCell(13).setCellValue(13);
+                row.createCell(14).setCellValue(feedbackOpinion.getContent());
+                if(feedbackOpinion.getConfirmStatus() == 2){
+                    row.createCell(15).setCellValue("0");
+                }
+                else{
+                    row.createCell(15).setCellValue("1");
+                }
+                if(feedbackOpinion.getOpinionStatus()){
+                    row.createCell(16).setCellValue("1");
+                }
+                else{
+                    row.createCell(16).setCellValue("0");
+                }
+//                row.createCell(17).setCellValue(17);
+                if(StringUtils.isNotEmpty(feedbackOpinion.getContentAttachment())) {
+                    row.createCell(18).setCellValue(feedbackOpinion.getContentAttachment());
+                }
+                if(feedbackOpinion.getUpdateTime() != null) {
+                    row.createCell(19).setCellValue(sdf.format(feedbackOpinion.getUpdateTime()));
+                    row.createCell(20).setCellValue(sdf.format(feedbackOpinion.getUpdateTime()));
+                }
+                row.createCell(21).setCellValue("I");
+            }
+
+            ByteArrayOutputStream output = new ByteArrayOutputStream();
+            workbook.write(output);
+            byte[] buffer = output.toByteArray();
+            ByteArrayInputStream input = new ByteArrayInputStream(buffer);
+
+            String fileName = "荆州市双优督办反馈报表.xls";
+            downloadUrl = OSSUtil.upload(ossConfig,"InsuranceReport",fileName,input);
+        }
+        catch (Exception ex){
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return downloadUrl;
+    }
+
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageListStatistics",method = RequestMethod.POST)
     public MessageResult<List> pageListStatistics(String areaId, String workStation, String isSatisfied, Date[] reportDate){

+ 2 - 2
web/src/main/java/com/jpsoft/excellent/modules/base/controller/WorkStationController.java

@@ -427,8 +427,8 @@ public class WorkStationController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("area_id","asc"));
-        sortList.add(new Sort("create_time","asc"));
+        sortList.add(new Sort("a.area_id","asc"));
+        sortList.add(new Sort("a.create_time","asc"));
 
         if (StringUtils.isNotEmpty(areaId)) {
             Area area = areaService.get(areaId);

+ 16 - 3
web/src/main/java/com/jpsoft/excellent/modules/open/OfficeOpinionApiController.java

@@ -77,7 +77,7 @@ public class OfficeOpinionApiController {
             if("0".equals(isSatisfied)) {
                 officeOpinion.setIsSatisfied(false);
 
-                String MessageContent = "【双优督办】干部监督评议有一条投诉,请查收。";
+                String MessageContent = "【双优督办】干部监督评议有一条投诉,请查收。(http://39.104.144.104/excellent-portal)";
                 String UserNumber = "13677200818,13647155484";
                 SMSUtil.sendSMS(MessageContent, UserNumber, null);
             }
@@ -114,9 +114,22 @@ public class OfficeOpinionApiController {
         MessageResult msgResult = new MessageResult<>();
 
         try {
+            for(int i=0; i>-1; i++) {
+                if (name.indexOf("  ") > 0) {
+                    name = name.replace("  ", " ");
+                }
+                else {
+                    break;
+                }
+            }
+            String[] keys = name.split(" ");
+
             Map<String, Object> searchParams = new HashMap<>();
-            if (StringUtils.isNotEmpty(name)) {
-                searchParams.put("name","%" + name + "%");
+//            if (StringUtils.isNotEmpty(name)) {
+//                searchParams.put("name","%" + name + "%");
+//            }
+            if (keys.length > 0) {
+                searchParams.put("names",keys);
             }
 
             List<Sort> sortList = new ArrayList<>();

+ 27 - 1
web/src/main/java/com/jpsoft/excellent/modules/textController.java

@@ -67,7 +67,7 @@ public class textController {
     public MessageResult sendSMS(@RequestAttribute String subject){
         MessageResult msgResult = new MessageResult();
 
-        String MessageContent = "【双优督办】干部监督评议有一条投诉,请查收。";
+        String MessageContent = "【双优督办】干部监督评议有一条投诉,请查收。(http://39.104.144.104/excellent-portal)";
         String UserNumber = "19972671252,15827719088";
 
         try {
@@ -402,4 +402,30 @@ public class textController {
 
         return msgResult;
     }
+
+    @ApiOperation(value="格式化")
+    @RequestMapping(value = "formatText",method = RequestMethod.POST)
+    public MessageResult formatText(String text){
+        MessageResult msgResult = new MessageResult();
+
+        try {
+            for(int i=0; i>-1; i++) {
+                if (text.indexOf("  ") > 0) {
+                    text = text.replace("  ", " ");
+                }
+                else {
+                    break;
+                }
+            }
+
+            msgResult.setResult(true);
+            msgResult.setData(text.split(" "));
+        }
+        catch(Exception ex){
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
 }

+ 1 - 1
web/src/main/java/com/jpsoft/excellent/modules/timed/officeReplySMS.java

@@ -35,7 +35,7 @@ public class officeReplySMS {
         calendar.add(calendar.DATE,-7);
         List<String> list = officeReplyService.findPhoneByRemind(sdf.format(calendar.getTime()) + "%");
         if(list.size() > 0) {
-            SMSUtil.sendSMS("【双优督办】干部评议存在未处理的待办事项,请及时处理。", StringUtils.join(list.toArray(), ","), null);
+            SMSUtil.sendSMS("【双优督办】干部评议存在未处理的待办事项,请及时处理。(http://39.104.144.104/excellent-portal)", StringUtils.join(list.toArray(), ","), null);
         }
 
         log.warn("定时任务:干部评议提醒短信结束");

+ 1 - 1
web/src/main/java/com/jpsoft/excellent/modules/timed/stepStatusSMS.java

@@ -37,7 +37,7 @@ public class stepStatusSMS {
         calendar.add(calendar.DATE,-7);
         List<String> list = feedbackStepStatusService.findPhoneByRemind(sdf.format(calendar.getTime()) + "%");
         if(list.size() > 0) {
-            SMSUtil.sendSMS("【双优督办】待办反馈存在未处理的待办事项,请及时处理。", StringUtils.join(list.toArray(), ","), null);
+            SMSUtil.sendSMS("【双优督办】待办反馈存在未处理的待办事项,请及时处理。(http://39.104.144.104/excellent-portal)", StringUtils.join(list.toArray(), ","), null);
         }
 
         log.warn("定时任务:待办反馈提醒短信结束");

+ 5 - 5
web/src/main/resources/application-dev.yml

@@ -5,12 +5,12 @@ server:
 
 spring:
   datasource:
-    url: jdbc:log4jdbc:mysql://39.104.144.104:3308/double_excellent?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-    username: root
-    password: jpsoft8121234
-#    url: jdbc:log4jdbc:mysql://192.168.33.20:3306/double_excellent?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+#    url: jdbc:log4jdbc:mysql://39.104.144.104:3308/double_excellent?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 #    username: root
-#    password: jpsoft2016
+#    password: jpsoft8121234
+    url: jdbc:log4jdbc:mysql://192.168.33.20:3306/double_excellent?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+    username: root
+    password: jpsoft2016
   devtools:
     add-properties: false
     restart:

BIN
web/src/main/resources/static/jzs_qzp_pjsjb.xls