浏览代码

反馈意见催办

jz.kai 2 年之前
父节点
当前提交
1f3b1d10fd

+ 1 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/dao/FeedbackStepStatusDAO.java

@@ -16,4 +16,5 @@ public interface FeedbackStepStatusDAO {
 	List<FeedbackStepStatus> list();
 	List<FeedbackStepStatus> search(Map<String,Object> searchParams,List<Sort> sortList);
 	List<FeedbackStepStatus> findByList(String feedbackOpinionId, Boolean status);
+	List<String> findPhoneByRemind(String date);
 }

+ 1 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/FeedbackStepStatusService.java

@@ -15,4 +15,5 @@ public interface FeedbackStepStatusService {
 	List<FeedbackStepStatus> list();
 	Page<FeedbackStepStatus> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
 	List<FeedbackStepStatus> findByList(String feedbackOpinionId, Boolean status);
+	List<String> findPhoneByRemind(String date);
 }

+ 6 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/FeedbackStepStatusServiceImpl.java

@@ -73,4 +73,10 @@ public class FeedbackStepStatusServiceImpl implements FeedbackStepStatusService
 		// TODO Auto-generated method stub
 		return feedbackStepStatusDAO.findByList(feedbackOpinionId, status);
 	}
+
+	@Override
+	public List<String> findPhoneByRemind(String date) {
+		// TODO Auto-generated method stub
+		return feedbackStepStatusDAO.findPhoneByRemind(date);
+	}
 }

+ 7 - 0
common/src/main/resources/mapper/base/FeedbackStepStatus.xml

@@ -117,4 +117,11 @@ id_,feedback_step_id,station_id,user_id,content_,status_,alloted_date,del_flag,c
 		</if>
 		ORDER BY create_time ASC
 	</select>
+	<select id="findPhoneByRemind" resultType="string">
+		SELECT b.phone_ FROM base_feedback_step_status a
+		LEFT JOIN sys_user b ON a.station_id = b.station_id
+		WHERE a.status_ = FALSE
+		AND a.create_time LIKE #{0}
+		GROUP BY b.phone_
+	</select>
 </mapper>

+ 3 - 1
web/src/main/java/com/jpsoft/excellent/modules/base/controller/FeedbackOpinionController.java

@@ -108,11 +108,13 @@ public class FeedbackOpinionController {
 
     @ApiOperation(value="获取信息")
     @GetMapping("edit/{id}")
-    public MessageResult<FeedbackOpinion> edit(@PathVariable("id") String id){
+    public MessageResult<FeedbackOpinion> edit(@PathVariable("id") String id, @RequestAttribute String subject){
         MessageResult<FeedbackOpinion> msgResult = new MessageResult<>();
 
         try {
+            User userNow = userService.get(subject);
             FeedbackOpinion feedbackOpinion = feedbackOpinionService.get(id);
+            feedbackOpinion.setUpdateBy(userNow.getStationId());
             Area area = areaService.get(feedbackOpinion.getAreaId());
             if(area != null){
                 feedbackOpinion.setAreaName(area.getName());

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

@@ -0,0 +1,45 @@
+package com.jpsoft.excellent.modules.timed;
+
+import com.jpsoft.excellent.modules.base.entity.FeedbackStepStatus;
+import com.jpsoft.excellent.modules.base.service.FeedbackStepStatusService;
+import com.jpsoft.excellent.modules.common.utils.SMSUtil;
+import com.jpsoft.excellent.modules.sys.entity.User;
+import com.jpsoft.excellent.modules.sys.service.UserService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Profile;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+
+@Profile({"production","dev","test"})
+@Component
+@Slf4j
+public class stepStatusSMS {
+    @Autowired
+    private FeedbackStepStatusService feedbackStepStatusService;
+    @Autowired
+    private UserService userService;
+
+    //每天9点执行一次->同时在unactive方法中执行
+    @Scheduled(cron = "0 0 9 * * ?")
+//    @Scheduled(cron = "0 0/1 * * * ?")
+    public void run() {
+        log.warn("定时任务:待办反馈提醒短信开始");
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar calendar = Calendar.getInstance();
+        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);
+        }
+
+        log.warn("定时任务:待办反馈提醒短信结束");
+    }
+}