|
@@ -11,8 +11,12 @@ import com.jeeplus.core.excel.ExcelOptions;
|
|
import com.jeeplus.core.excel.annotation.ExportMode;
|
|
import com.jeeplus.core.excel.annotation.ExportMode;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
import com.jeeplus.aop.logging.annotation.ApiLog;
|
|
import com.jeeplus.aop.logging.annotation.ApiLog;
|
|
|
|
+import com.jeeplus.question.domain.DzfQuestionDetil;
|
|
|
|
+import com.jeeplus.question.service.DzfQuestionDetilService;
|
|
import com.jeeplus.question.service.DzfQuestionService;
|
|
import com.jeeplus.question.service.DzfQuestionService;
|
|
import com.jeeplus.question.service.dto.DzfQuestionDTO;
|
|
import com.jeeplus.question.service.dto.DzfQuestionDTO;
|
|
|
|
+import com.jeeplus.question.service.dto.DzfQuestionDetilDTO;
|
|
|
|
+import com.jeeplus.question.service.mapstruct.DzfQuestionDetilWrapper;
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@@ -52,6 +56,9 @@ public class DzfQuestionOpRecordController {
|
|
@Autowired
|
|
@Autowired
|
|
private DzfQuestionService dzfQuestionService;
|
|
private DzfQuestionService dzfQuestionService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private DzfQuestionDetilService dzfQuestionDetilService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 处理操作流程列表数据
|
|
* 处理操作流程列表数据
|
|
*/
|
|
*/
|
|
@@ -98,6 +105,8 @@ public class DzfQuestionOpRecordController {
|
|
public ResponseEntity <String> save2(@Valid @RequestBody DzfQuestionDTO op) {
|
|
public ResponseEntity <String> save2(@Valid @RequestBody DzfQuestionDTO op) {
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
|
|
|
|
|
+ String nextuser="",nextusername="";//默认办结(有一个问题属于提交那都改成提交)
|
|
|
|
+
|
|
// 新增流程记录
|
|
// 新增流程记录
|
|
for(int i=0;i<op.getDzfQuestionDetilDTOList().size();i++){
|
|
for(int i=0;i<op.getDzfQuestionDetilDTOList().size();i++){
|
|
|
|
|
|
@@ -110,55 +119,182 @@ public class DzfQuestionOpRecordController {
|
|
if(op.getDzfQuestionDetilDTOList().get(i).current.equals("0")){
|
|
if(op.getDzfQuestionDetilDTOList().get(i).current.equals("0")){
|
|
dzfQuestionOpRecordDTO.setOpType("3");
|
|
dzfQuestionOpRecordDTO.setOpType("3");
|
|
dzfQuestionOpRecordDTO.setOpTypeName("办结");
|
|
dzfQuestionOpRecordDTO.setOpTypeName("办结");
|
|
|
|
+ nextuser="dazoufang";
|
|
|
|
+ nextusername="大走访办公室";
|
|
}else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("1")){
|
|
}else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("1")){
|
|
dzfQuestionOpRecordDTO.setOpType("4");
|
|
dzfQuestionOpRecordDTO.setOpType("4");
|
|
dzfQuestionOpRecordDTO.setOpTypeName("反馈大走访活动办");
|
|
dzfQuestionOpRecordDTO.setOpTypeName("反馈大走访活动办");
|
|
|
|
+ nextuser="dazoufang";
|
|
|
|
+ nextusername="大走访办公室";
|
|
}else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("2")){
|
|
}else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("2")){
|
|
dzfQuestionOpRecordDTO.setOpType("5");
|
|
dzfQuestionOpRecordDTO.setOpType("5");
|
|
dzfQuestionOpRecordDTO.setOpTypeName("正在办理");
|
|
dzfQuestionOpRecordDTO.setOpTypeName("正在办理");
|
|
|
|
+ nextuser=userDTO.getLoginName()+",dazoufang";
|
|
|
|
+ nextusername=userDTO.getName()+",大走访办公室";
|
|
}else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("3")){
|
|
}else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("3")){
|
|
dzfQuestionOpRecordDTO.setOpType("6");
|
|
dzfQuestionOpRecordDTO.setOpType("6");
|
|
dzfQuestionOpRecordDTO.setOpTypeName("难以化解");
|
|
dzfQuestionOpRecordDTO.setOpTypeName("难以化解");
|
|
|
|
+ nextuser=userDTO.getLoginName()+",dazoufang";
|
|
|
|
+ nextusername=userDTO.getName()+",大走访办公室";
|
|
}else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("4")){
|
|
}else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("4")){
|
|
dzfQuestionOpRecordDTO.setOpType("7");
|
|
dzfQuestionOpRecordDTO.setOpType("7");
|
|
dzfQuestionOpRecordDTO.setOpTypeName("持续跟踪");
|
|
dzfQuestionOpRecordDTO.setOpTypeName("持续跟踪");
|
|
|
|
+ nextuser=userDTO.getLoginName()+",dazoufang";
|
|
|
|
+ nextusername=userDTO.getName()+",大走访办公室";
|
|
}else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("5")){
|
|
}else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("5")){
|
|
dzfQuestionOpRecordDTO.setOpType("8");
|
|
dzfQuestionOpRecordDTO.setOpType("8");
|
|
dzfQuestionOpRecordDTO.setOpTypeName("提请会办");
|
|
dzfQuestionOpRecordDTO.setOpTypeName("提请会办");
|
|
|
|
+ nextuser=userDTO.getLoginName()+",dazoufang";
|
|
|
|
+ nextusername=userDTO.getName()+",大走访办公室";
|
|
}
|
|
}
|
|
|
|
|
|
dzfQuestionOpRecordDTO.setRoleName("挂钩干部");
|
|
dzfQuestionOpRecordDTO.setRoleName("挂钩干部");
|
|
dzfQuestionOpRecordDTO.setDes1("");//单位名称
|
|
dzfQuestionOpRecordDTO.setDes1("");//单位名称
|
|
- dzfQuestionOpRecordDTO.setDes2(userDTO.getName());
|
|
|
|
//挂钩干部提交,将dazoufang带入到待办人中
|
|
//挂钩干部提交,将dazoufang带入到待办人中
|
|
dzfQuestionOpRecordDTO.setDes3("dazoufang");
|
|
dzfQuestionOpRecordDTO.setDes3("dazoufang");
|
|
dzfQuestionOpRecordDTO.setDes4("大走访办公室");
|
|
dzfQuestionOpRecordDTO.setDes4("大走访办公室");
|
|
- dzfQuestionOpRecordDTO.setDes5(op.getDzfQuestionDetilDTOList().get(i).finishdate);//预计办结时间
|
|
|
|
|
|
|
|
- //修改主表的待办人
|
|
|
|
- DzfQuestionDTO aa=dzfQuestionService.findById ( op.getId() );
|
|
|
|
- aa.setStates("1");//新增时提交;
|
|
|
|
- //挂钩干部提交,大走访办公室带入到待办人中
|
|
|
|
- aa.setDes1("dazoufang");
|
|
|
|
- aa.setDes2("大走访办公室");
|
|
|
|
- dzfQuestionService.saveOrUpdate (aa);
|
|
|
|
|
|
+
|
|
|
|
+ //修改副表的状态
|
|
|
|
+ DzfQuestionDetilDTO aa=dzfQuestionDetilService.findById ( op.getDzfQuestionDetilDTOList().get(i).getId() );
|
|
|
|
+ aa.setDes1(nextuser);
|
|
|
|
+ aa.setDes2(nextusername);
|
|
|
|
+ dzfQuestionDetilService.saveOrUpdate ( DzfQuestionDetilWrapper.INSTANCE.toEntity ( aa ));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
//办公室
|
|
//办公室
|
|
if(userDTO.getRoleIds().equals("1910175386924417025")){
|
|
if(userDTO.getRoleIds().equals("1910175386924417025")){
|
|
|
|
+ if(op.getDzfQuestionDetilDTOList().get(i).current.equals("0")){
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpType("3");
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpTypeName("办结");
|
|
|
|
+
|
|
|
|
+ //修改副表的状态
|
|
|
|
+ DzfQuestionDetilDTO aa=dzfQuestionDetilService.findById ( op.getDzfQuestionDetilDTOList().get(i).getId() );
|
|
|
|
+ aa.setStates("0");//问题办结;
|
|
|
|
+ aa.setDes1("");
|
|
|
|
+ aa.setDes2("");
|
|
|
|
+ dzfQuestionDetilService.saveOrUpdate ( DzfQuestionDetilWrapper.INSTANCE.toEntity ( aa ));
|
|
|
|
+
|
|
|
|
+ }else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("1")){
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpType("9");
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpTypeName("交办");
|
|
|
|
+
|
|
|
|
+ //大走访办公室提交,将选择的交办单位带入到待办人中
|
|
|
|
+ dzfQuestionOpRecordDTO.setDes3(op.getDzfQuestionDetilDTOList().get(i).checkUserList);
|
|
|
|
+ dzfQuestionOpRecordDTO.setDes4(op.getDzfQuestionDetilDTOList().get(i).checkUserListName);
|
|
|
|
+
|
|
|
|
+ //修改副表的状态
|
|
|
|
+ DzfQuestionDetilDTO aa=dzfQuestionDetilService.findById ( op.getDzfQuestionDetilDTOList().get(i).getId() );
|
|
|
|
+ aa.setDes1(op.getDzfQuestionDetilDTOList().get(i).checkUserList);
|
|
|
|
+ aa.setDes2(op.getDzfQuestionDetilDTOList().get(i).checkUserListName);
|
|
|
|
+ dzfQuestionDetilService.saveOrUpdate ( DzfQuestionDetilWrapper.INSTANCE.toEntity ( aa ));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ //设置其他默认值
|
|
|
|
+ dzfQuestionOpRecordDTO.setRoleName("大走访办公室");
|
|
|
|
+ dzfQuestionOpRecordDTO.setDes1("");//单位名称
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
//办理部门
|
|
//办理部门
|
|
if(userDTO.getRoleIds().equals("1910175949166673921")){
|
|
if(userDTO.getRoleIds().equals("1910175949166673921")){
|
|
|
|
+ //不办结的情况下都没有待办人
|
|
|
|
+ dzfQuestionOpRecordDTO.setDes3("");
|
|
|
|
+ dzfQuestionOpRecordDTO.setDes4("");
|
|
|
|
+
|
|
|
|
+ if(op.getDzfQuestionDetilDTOList().get(i).current.equals("0")){
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpType("3");
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpTypeName("办结");
|
|
|
|
+
|
|
|
|
+ //修改副表的状态(删除问题表中的 待办人)
|
|
|
|
+ DzfQuestionDetilDTO aa=dzfQuestionDetilService.findById ( op.getDzfQuestionDetilDTOList().get(i).getId() );
|
|
|
|
+ String olduser=aa.getDes1()+",";
|
|
|
|
+ String oldusern=aa.getDes2()+",";
|
|
|
|
+ String newuser=olduser.replaceFirst(userDTO.getLoginName()+",","");
|
|
|
|
+ newuser=newuser.substring(0,newuser.length()-2);
|
|
|
|
+ String newusern=oldusern.replaceFirst(userDTO.getName()+",","");
|
|
|
|
+ newusern=newusern.substring(0,newusern.length()-2);
|
|
|
|
+ aa.setDes1(newuser);
|
|
|
|
+ aa.setDes2(newusern);
|
|
|
|
+ dzfQuestionDetilService.saveOrUpdate ( DzfQuestionDetilWrapper.INSTANCE.toEntity ( aa ));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("1")){
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpType("5");
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpTypeName("正在办理");
|
|
|
|
+ }else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("2")){
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpType("6");
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpTypeName("难以化解");
|
|
|
|
+ }else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("3")){
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpType("7");
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpTypeName("持续跟踪");
|
|
|
|
+ }else if(op.getDzfQuestionDetilDTOList().get(i).current.equals("4")){
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpType("8");
|
|
|
|
+ dzfQuestionOpRecordDTO.setOpTypeName("提请会办");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
+ //设置其他默认值
|
|
|
|
+ dzfQuestionOpRecordDTO.setRoleName("交办单位");
|
|
|
|
+ dzfQuestionOpRecordDTO.setDes1(userDTO.getName());//单位名称
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //所有角色一样的默认值
|
|
|
|
+ dzfQuestionOpRecordDTO.setDes2(userDTO.getName());
|
|
|
|
+ dzfQuestionOpRecordDTO.setDes5(op.getDzfQuestionDetilDTOList().get(i).finishdate);//预计办结时间
|
|
|
|
+ dzfQuestionOpRecordDTO.setDes6(op.getDzfQuestionDetilDTOList().get(i).delyj);//处理建议
|
|
dzfQuestionOpRecordService.saveOrUpdate (dzfQuestionOpRecordWrapper.toEntity (dzfQuestionOpRecordDTO));
|
|
dzfQuestionOpRecordService.saveOrUpdate (dzfQuestionOpRecordWrapper.toEntity (dzfQuestionOpRecordDTO));
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ //修改主表状态,待办人以及问题是否办结
|
|
|
|
+ updateQusestionState(op.getId());
|
|
|
|
+
|
|
return ResponseEntity.ok ( "保存处理操作流程成功" );
|
|
return ResponseEntity.ok ( "保存处理操作流程成功" );
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void updateQusestionState(String id){
|
|
|
|
+ DzfQuestionDTO aa=dzfQuestionService.findById ( id );
|
|
|
|
+ int states=0;
|
|
|
|
+ String nextuser="",nextusername="";
|
|
|
|
+ for(int i=0;i<aa.getDzfQuestionDetilDTOList().size();i++){
|
|
|
|
+ if(aa.getDzfQuestionDetilDTOList().get(i).getStates()==null||!aa.getDzfQuestionDetilDTOList().get(i).getStates().equals("0")){
|
|
|
|
+ states=1;
|
|
|
|
+ }
|
|
|
|
+ if(nextuser.equals("")){
|
|
|
|
+ nextuser=aa.getDzfQuestionDetilDTOList().get(i).getDes1();
|
|
|
|
+ nextusername=aa.getDzfQuestionDetilDTOList().get(i).getDes2();
|
|
|
|
+ }else{
|
|
|
|
+ nextuser=nextuser+","+aa.getDzfQuestionDetilDTOList().get(i).getDes1();
|
|
|
|
+ nextusername=nextusername+","+aa.getDzfQuestionDetilDTOList().get(i).getDes2();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ //如果都是办结,就更新主表为办结
|
|
|
|
+ if(states==0){
|
|
|
|
+ aa.setStates("3");
|
|
|
|
+ aa.setDes1("");
|
|
|
|
+ aa.setDes2("");
|
|
|
|
+ dzfQuestionService.saveOrUpdate (aa);
|
|
|
|
+ }else{
|
|
|
|
+ //没有办结,那就是提交,并将附表的代办人相加赋值给主表(一个诉求,多个问题都有一个用户代办,主表会有多个这个用户)
|
|
|
|
+ aa.setStates("1");
|
|
|
|
+ aa.setDes1(nextuser);
|
|
|
|
+ aa.setDes2(nextusername);
|
|
|
|
+ dzfQuestionService.saveOrUpdate (aa);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 删除处理操作流程
|
|
* 删除处理操作流程
|