|
@@ -1,5 +1,7 @@
|
|
|
package com.minpay.guomao.obsmanage.action;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
+import java.net.URLDecoder;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
@@ -10,9 +12,14 @@ import org.springframework.context.ApplicationContext;
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+import com.min.base64.Base64;
|
|
|
import com.minpay.SpringContextUtil;
|
|
|
import com.minpay.common.bean.User;
|
|
|
import com.minpay.common.format.IFormatService;
|
|
|
+import com.minpay.db.table.mapper.ImBranchMapper;
|
|
|
+import com.minpay.db.table.mapper.ImUserMapper;
|
|
|
+import com.minpay.db.table.model.ImBranch;
|
|
|
+import com.minpay.db.table.model.ImUser;
|
|
|
import com.minpay.db.table.model.ObsQuestion;
|
|
|
import com.minpay.db.table.own.mapper.QuestionMapper;
|
|
|
import com.minpay.db.table.service.IObsQuestionService;
|
|
@@ -35,6 +42,8 @@ public class ObsQuestionManage implements IMINAction{
|
|
|
public final static String QUESTION_QUERY = "questionQuery";
|
|
|
public final static String QUESTION_EDIT = "questionEdit";
|
|
|
public final static String QUESTION_DEAL = "questionDeal";
|
|
|
+ public final static String MENU_LIST = "menuList";
|
|
|
+ public final static String QUESTION_PRINT_QUERY = "questionPrintQuery";
|
|
|
|
|
|
ApplicationContext applicationContext = SpringContextUtil.getApplicationContext();
|
|
|
|
|
@@ -43,25 +52,34 @@ public class ObsQuestionManage implements IMINAction{
|
|
|
MINSession session,
|
|
|
@MINParam(key = "name") String name,
|
|
|
@MINParam(key = "degree") String degree,
|
|
|
+ @MINParam(key = "module") String module,
|
|
|
+ @MINParam(key = "expectTime") String expectTime,
|
|
|
@MINParam(key = "step") String step
|
|
|
- ){
|
|
|
+ ) throws IOException{
|
|
|
+ step = Base64.decode(step);
|
|
|
+ step = URLDecoder.decode(step, "UTF-8");
|
|
|
+
|
|
|
IObsQuestionService iObsQuestionService = applicationContext.getBean(IObsQuestionService.class);
|
|
|
User u = session.getUser();
|
|
|
|
|
|
Date date = new Date();
|
|
|
- SimpleDateFormat sd = new SimpleDateFormat("yyyyMMddhhmmss");
|
|
|
+ SimpleDateFormat sd = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
String dateString = sd.format(date);
|
|
|
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
ObsQuestion obsQuestion = new ObsQuestion();
|
|
|
obsQuestion.setOqId(String.valueOf(System.currentTimeMillis()));
|
|
|
- obsQuestion.setoqType("问题");
|
|
|
+ obsQuestion.setoqType("0");
|
|
|
obsQuestion.setOqName(name);
|
|
|
obsQuestion.setOqDegree(degree);
|
|
|
obsQuestion.setOqStep(step);
|
|
|
+ obsQuestion.setOqModule(module);
|
|
|
+ obsQuestion.setOqExpectTime(expectTime.replaceAll("-", ""));
|
|
|
obsQuestion.setOqState("00");
|
|
|
obsQuestion.setOqCreateTime(dateString);
|
|
|
obsQuestion.setOqCreateUser(u.getId());
|
|
|
+ String record = u.getName() + "在" + dateString + "提出";
|
|
|
+ obsQuestion.setOqRecord(record);
|
|
|
iObsQuestionService.save(obsQuestion);
|
|
|
return res;
|
|
|
}
|
|
@@ -135,22 +153,112 @@ public class ObsQuestionManage implements IMINAction{
|
|
|
public MINActionResult questionDeal(
|
|
|
MINSession session,
|
|
|
@MINParam(key = "id") String id,
|
|
|
- @MINParam(key = "state") String state
|
|
|
+ @MINParam(key = "state") String state,
|
|
|
+ @MINParam(key = "desc") String desc
|
|
|
){
|
|
|
Date date = new Date();
|
|
|
- SimpleDateFormat sd = new SimpleDateFormat("yyyyMMddhhmmss");
|
|
|
+ SimpleDateFormat sd = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
+ SimpleDateFormat sd2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String dateString = sd.format(date);
|
|
|
+ String dateString2 = sd2.format(date);
|
|
|
User u = session.getUser();
|
|
|
|
|
|
IObsQuestionService iObsQuestionService = applicationContext.getBean(IObsQuestionService.class);
|
|
|
+ // 原记录
|
|
|
+ String record = iObsQuestionService.getById(id).getOqRecord();
|
|
|
+
|
|
|
ObsQuestion obsQuestion = new ObsQuestion();
|
|
|
obsQuestion.setOqId(id);
|
|
|
obsQuestion.setOqState(state);
|
|
|
obsQuestion.setOqUpdateUser(u.getId());
|
|
|
obsQuestion.setOqUpdateTime(dateString);
|
|
|
+
|
|
|
+ // 确认
|
|
|
+ if("01".equals(state)) {
|
|
|
+ obsQuestion.setOqConfirmTime(dateString);
|
|
|
+ obsQuestion.setOqEngineer(u.getId());
|
|
|
+ record = record + "\n" + u.getName() + "在" + dateString2 + "确认";
|
|
|
+ } else if("02".equals(state)) {
|
|
|
+ obsQuestion.setOqCompleteTime(dateString);
|
|
|
+ record = record + "\n" + u.getName() + "在" + dateString2 + "解决了该问题";
|
|
|
+ } else if("03".equals(state)) {
|
|
|
+ obsQuestion.setOqFeedbackTime(dateString);
|
|
|
+ record = record + "\n" + u.getName() + "在" + dateString2 + "确认该问题已解决";
|
|
|
+ } else if("04".equals(state)) {
|
|
|
+ obsQuestion.setOqFeedbackTime(dateString);
|
|
|
+ obsQuestion.setOqCompleteDesc(desc);
|
|
|
+ record = record + "\n" + u.getName() + "在" + dateString2 + "确认该问题未解决";
|
|
|
+ }
|
|
|
+ obsQuestion.setOqRecord(record);
|
|
|
iObsQuestionService.updateById(obsQuestion);
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ @MINAction(value = MENU_LIST)
|
|
|
+ public MINActionResult menuList(
|
|
|
+ MINSession session
|
|
|
+ ) throws MINBusinessException{
|
|
|
+ User u = session.getUser();
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("roleId", u.getRoleId());
|
|
|
+ List<Map<String, String>> list = Service.lookup(IMINDataBaseService.class).getMybatisMapper(QuestionMapper.class)
|
|
|
+ .getMenuListByRoleId(param);
|
|
|
+ MINActionResult res = new MINActionResult();
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_LAY, list);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ @MINAction(value = QUESTION_PRINT_QUERY)
|
|
|
+ public MINActionResult questionPrintQuery(
|
|
|
+ @MINParam(key = "oqId") String oqId
|
|
|
+ ) throws MINBusinessException{
|
|
|
+ IObsQuestionService iObsQuestionService = applicationContext.getBean(IObsQuestionService.class);
|
|
|
+ ObsQuestion obsQuestion = iObsQuestionService.getById(oqId);
|
|
|
+
|
|
|
+ ImUser imUser = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ImUserMapper.class).selectByPrimaryKey(obsQuestion.getOqCreateUser());
|
|
|
+ ImBranch imBranch = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ImBranchMapper.class).selectByPrimaryKey(imUser.getBranchid());
|
|
|
+
|
|
|
+ Map<String, String> data = new HashMap<>();
|
|
|
+ data.put("shenqingriqi", obsQuestion.getOqCreateTime());
|
|
|
+ data.put("shenqingrenxingming", imUser.getName());
|
|
|
+ data.put("suozaibumen", imBranch.getName());
|
|
|
+ data.put("lianxidianhua", imUser.getPhone());
|
|
|
+
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("itemId", obsQuestion.getOqModule());
|
|
|
+ List<Map<String, String>> list = Service.lookup(IMINDataBaseService.class).getMybatisMapper(QuestionMapper.class)
|
|
|
+ .getMenuListByRoleId(param);
|
|
|
+ data.put("mukuai", list.get(0).get("menuName"));
|
|
|
+
|
|
|
+ data.put("shixiangmiaoshu", obsQuestion.getOqStep());
|
|
|
+ data.put("yaoqiuwanchengqixian", obsQuestion.getOqExpectTime());
|
|
|
+
|
|
|
+ if(obsQuestion.getOqEngineer() != null && !"".equals(obsQuestion.getOqEngineer())) {
|
|
|
+ ImUser imUser2 = Service.lookup(IMINDataBaseService.class).getMybatisMapper(ImUserMapper.class).selectByPrimaryKey(obsQuestion.getOqEngineer());
|
|
|
+ if("02".equals(obsQuestion.getOqState()) || "03".equals(obsQuestion.getOqState())) {
|
|
|
+ data.put("wanchengqingkuang", "已解决");
|
|
|
+ } else if ("00".equals(obsQuestion.getOqState()) || "04".equals(obsQuestion.getOqState())) {
|
|
|
+ data.put("wanchengqingkuang", "待确认");
|
|
|
+ } else if ("01".equals(obsQuestion.getOqState())) {
|
|
|
+ data.put("wanchengqingkuang", "已确认");
|
|
|
+ }
|
|
|
+ data.put("yaoqiuwanchengqixian", obsQuestion.getOqExpectTime());
|
|
|
+ data.put("fuwurenyuan", imUser2.getName());
|
|
|
+ data.put("wanchengshijian", obsQuestion.getOqCompleteTime());
|
|
|
+ }
|
|
|
+
|
|
|
+ if("04".equals(obsQuestion.getOqState())){
|
|
|
+ data.put("shifouwancheng", "fou");
|
|
|
+ } else if("03".equals(obsQuestion.getOqState())){
|
|
|
+ data.put("shifouwancheng", "shi");
|
|
|
+ }
|
|
|
+ data.put("miaoshu", obsQuestion.getOqCompleteDesc());
|
|
|
+ data.put("shenqingrenyuan", imUser.getName());
|
|
|
+ data.put("fanguiriqi", obsQuestion.getOqFeedbackTime());
|
|
|
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
+ res.set(IMINBusinessConstant.F_PAGING_LAY, data);
|
|
|
return res;
|
|
|
}
|
|
|
}
|