|
@@ -18,6 +18,7 @@ import com.ruoyi.common.constant.Constants;
|
|
|
import com.ruoyi.common.constant.RoleConstants;
|
|
|
import com.ruoyi.common.core.page.PageDomain;
|
|
|
import com.ruoyi.common.core.page.TableSupport;
|
|
|
+import com.ruoyi.common.core.text.Convert;
|
|
|
import com.ruoyi.common.enums.DeptEnums;
|
|
|
import com.ruoyi.common.enums.FlowTypeEnums;
|
|
|
import com.ruoyi.common.enums.UserEnums;
|
|
@@ -270,23 +271,36 @@ public class DispatchRegistrationController extends BaseController {
|
|
|
@RequiresPermissions("ahrs:dispatchRegistration:export")
|
|
|
@RequestMapping("/export")
|
|
|
@ResponseBody
|
|
|
- public void export(DispatchRegistration dispatchRegistration, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
|
|
- if (dispatchRegistration.getSendToDeptId()==null){
|
|
|
- dispatchRegistration.setSendToDeptId(getDeptId());
|
|
|
- }
|
|
|
- //根据部门级别查询
|
|
|
- SysDept sysDept = sysDeptService.selectDeptById(dispatchRegistration.getSendToDeptId());
|
|
|
- dispatchRegistration.setDeptLevel(sysDept.getDeptLevel());
|
|
|
- //判断是否是主管部门或者事业单位,如果是主管部门或者事业单位就不查询已作废的和没有备案时间的
|
|
|
- Long roleId = ShiroUtils.getSysUser().getRoleId();
|
|
|
- if(RoleConstants.ROLE_ZGBM_CZY.equals(roleId) || RoleConstants.ROLE_SYDW_CZY.equals(roleId) ||RoleConstants.ROLE_SYDW_CKY.equals(roleId) ||RoleConstants.ROLE_ZGBM_CKY.equals(roleId) ){
|
|
|
- dispatchRegistration.setStatus("0");
|
|
|
- }else{
|
|
|
- dispatchRegistration.setDispatchRegistrationTime(new Date());
|
|
|
+ public void export(String ids, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
|
|
+ List<DispatchRegistration> dispatchRegistrationList=new ArrayList<>();
|
|
|
+ if (!StringUtils.isNotBlank(ids)){
|
|
|
+ //未勾选导出全部
|
|
|
+ DispatchRegistration dispatchRegistration=new DispatchRegistration();
|
|
|
+ if (dispatchRegistration.getSendToDeptId() == null) {
|
|
|
+ dispatchRegistration.setSendToDeptId(getDeptId());
|
|
|
+ }
|
|
|
+ //根据部门级别查询
|
|
|
+ SysDept sysDept = sysDeptService.selectDeptById(dispatchRegistration.getSendToDeptId());
|
|
|
+ dispatchRegistration.setDeptLevel(sysDept.getDeptLevel());
|
|
|
+ //判断是否是主管部门或者事业单位,如果是主管部门或者事业单位就不查询已作废的和没有备案时间的
|
|
|
+ Long roleId = ShiroUtils.getSysUser().getRoleId();
|
|
|
+ if (RoleConstants.ROLE_ZGBM_CZY.equals(roleId) || RoleConstants.ROLE_SYDW_CZY.equals(roleId) || RoleConstants.ROLE_SYDW_CKY.equals(roleId) || RoleConstants.ROLE_ZGBM_CKY.equals(roleId)) {
|
|
|
+ dispatchRegistration.setStatus("0");
|
|
|
+ } else {
|
|
|
+ dispatchRegistration.setDispatchRegistrationTime(new Date());
|
|
|
+ }
|
|
|
+ dispatchRegistrationList = dispatchRegistrationService.selectDispatchRegistrationList(dispatchRegistration);
|
|
|
+ }else {
|
|
|
+ //勾选的导出勾选
|
|
|
+ Long[] disIds = Convert.toLongArray(",", ids);
|
|
|
+ for (Long disId : disIds) {
|
|
|
+ DispatchRegistration dispatchRegistration = dispatchRegistrationService.selectDispatchRegistrationById(disId);
|
|
|
+ dispatchRegistrationList.add(dispatchRegistration);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- List<DispatchRegistration> list = dispatchRegistrationService.selectDispatchRegistrationList(dispatchRegistration);
|
|
|
- list = createParentDeclatation(list);
|
|
|
- dispatchRegistrationService.export(request, response, list);
|
|
|
+ dispatchRegistrationList = createParentDeclatation(dispatchRegistrationList);
|
|
|
+ dispatchRegistrationService.export(request, response, dispatchRegistrationList);
|
|
|
}
|
|
|
|
|
|
|