增加待办移动端适配-优化sql判断
This commit is contained in:
parent
271569ba6e
commit
fe7722020d
|
|
@ -80,11 +80,11 @@
|
||||||
console.log('当前URL:', window.location.href);
|
console.log('当前URL:', window.location.href);
|
||||||
|
|
||||||
// 检测移动端并跳转
|
// 检测移动端并跳转
|
||||||
var isMobile = MobileDetect.isMobile();
|
const isMobile = MobileDetect.isMobile();
|
||||||
console.log('移动端检测结果:', isMobile);
|
console.log('移动端检测结果:', isMobile);
|
||||||
|
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
var currentUrl = window.location.href;
|
const currentUrl = window.location.href;
|
||||||
console.log('当前URL分析:', currentUrl);
|
console.log('当前URL分析:', currentUrl);
|
||||||
|
|
||||||
// 避免无限重定向 - 检查是否已经在移动端页面
|
// 避免无限重定向 - 检查是否已经在移动端页面
|
||||||
|
|
@ -94,11 +94,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建移动端页面URL
|
// 构建移动端页面URL
|
||||||
var baseUrl = currentUrl.split('?')[0]; // 去掉查询参数
|
const baseUrl = currentUrl.split('?')[0]; // 去掉查询参数
|
||||||
var queryParams = currentUrl.split('?')[1] || ''; // 保留查询参数
|
const queryParams = currentUrl.split('?')[1] || ''; // 保留查询参数
|
||||||
|
|
||||||
// 将 show 替换为 showMobile
|
// 将 show 替换为 showMobile
|
||||||
var mobileUrl = baseUrl.replace('/show', '/showMobile');
|
let mobileUrl = baseUrl.replace('/show', '/showMobile');
|
||||||
if (queryParams) {
|
if (queryParams) {
|
||||||
mobileUrl += '?' + queryParams;
|
mobileUrl += '?' + queryParams;
|
||||||
}
|
}
|
||||||
|
|
@ -109,7 +109,6 @@
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
window.location.href = mobileUrl;
|
window.location.href = mobileUrl;
|
||||||
}, 100);
|
}, 100);
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
console.log('桌面设备,不进行跳转');
|
console.log('桌面设备,不进行跳转');
|
||||||
}
|
}
|
||||||
|
|
@ -149,9 +148,8 @@
|
||||||
console.log("页面重新激活,刷新任务列表...");
|
console.log("页面重新激活,刷新任务列表...");
|
||||||
getbaseList(1); // 重新请求表格数据
|
getbaseList(1); // 重新请求表格数据
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
|
|
||||||
// 获取所有选中的 value(你可以绑定按钮触发)
|
// 获取所有选中的 value(你可以绑定按钮触发)
|
||||||
$('#getSelectedBtn').on('click', function () {
|
$('#getSelectedBtn').on('click', function () {
|
||||||
let selectedValues = $('.rowCheck:checked')
|
let selectedValues = $('.rowCheck:checked')
|
||||||
|
|
@ -164,7 +162,6 @@
|
||||||
}
|
}
|
||||||
console.log("selectedValues:", selectedValues);
|
console.log("selectedValues:", selectedValues);
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: bonuspath + '/backstage/rm/taskRecord/batchApproval',
|
url: bonuspath + '/backstage/rm/taskRecord/batchApproval',
|
||||||
|
|
@ -191,8 +188,6 @@
|
||||||
$('#isFinish').change(function () {
|
$('#isFinish').change(function () {
|
||||||
toggleButton();
|
toggleButton();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('.rowCheck').prop('checked', false); // 取消所有 rowCheck 的选中状态
|
$('.rowCheck').prop('checked', false); // 取消所有 rowCheck 的选中状态
|
||||||
$('#checkAll').prop('checked', false); // 如果你还有全选框,也一并清除
|
$('#checkAll').prop('checked', false); // 如果你还有全选框,也一并清除
|
||||||
});
|
});
|
||||||
|
|
@ -263,6 +258,7 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanForm() {
|
function cleanForm() {
|
||||||
$("#auForm input[id$='unitName']").val("");
|
$("#auForm input[id$='unitName']").val("");
|
||||||
$("#auForm input[id$='projectName']").val("");
|
$("#auForm input[id$='projectName']").val("");
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
OR (wtr.DEFINITION_ID != 11 AND wtr.IS_FINISH = #{param.isFinish})
|
OR (wtr.DEFINITION_ID != 11 AND wtr.IS_FINISH = #{param.isFinish})
|
||||||
)
|
)
|
||||||
AND wtr.IS_ACTIVE = 1
|
AND wtr.IS_ACTIVE = 1
|
||||||
<if test="param.operationUserId != null and param.operationUserId != ''">
|
<if test="param.operationUserId != null and param.operationUserId != 0">
|
||||||
AND wtr.OPERATION_USER = #{param.operationUserId}
|
AND wtr.OPERATION_USER = #{param.operationUserId}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.keyWord != null and param.keyWord != ''">
|
<if test="param.keyWord != null and param.keyWord != ''">
|
||||||
|
|
@ -127,7 +127,7 @@
|
||||||
WHERE
|
WHERE
|
||||||
cpa.status = '1'
|
cpa.status = '1'
|
||||||
<choose>
|
<choose>
|
||||||
<when test="param.operationUserId == '14'">
|
<when test="param.operationUserId == 14">
|
||||||
<if test="param.isFinish == 0">
|
<if test="param.isFinish == 0">
|
||||||
AND cpa.status_type = '4'
|
AND cpa.status_type = '4'
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -135,7 +135,7 @@
|
||||||
AND cpa.status_type = '1'
|
AND cpa.status_type = '1'
|
||||||
</if>
|
</if>
|
||||||
</when>
|
</when>
|
||||||
<when test="param.operationUserId == '84' or param.operationUserId == '85'">
|
<when test="param.operationUserId == 84 or param.operationUserId == 85">
|
||||||
<if test="param.isFinish == 0">
|
<if test="param.isFinish == 0">
|
||||||
AND cpa.status_type = '3'
|
AND cpa.status_type = '3'
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -176,7 +176,7 @@
|
||||||
LEFT JOIN car_plan_apply cpa ON cpo.apply_id = cpa.id
|
LEFT JOIN car_plan_apply cpa ON cpo.apply_id = cpa.id
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="param.operationUserId == '57' or param.operationUserId == '29' or param.operationUserId == '55' or param.operationUserId == '56' or param.operationUserId == '67'">
|
<when test="param.operationUserId == 57 or param.operationUserId == 29 or param.operationUserId == 55 or param.operationUserId == 56 or param.operationUserId == 67">
|
||||||
<if test="param.isFinish == 0">
|
<if test="param.isFinish == 0">
|
||||||
AND cpo.status = 0
|
AND cpo.status = 0
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -184,7 +184,7 @@
|
||||||
AND cpo.status in (1, 2)
|
AND cpo.status in (1, 2)
|
||||||
</if>
|
</if>
|
||||||
</when>
|
</when>
|
||||||
<when test="param.operationUserId == '49' or param.operationUserId == '50'">
|
<when test="param.operationUserId == 49 or param.operationUserId == 50">
|
||||||
<if test="param.isFinish == 0">
|
<if test="param.isFinish == 0">
|
||||||
AND cpo.status = '1'
|
AND cpo.status = '1'
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,8 @@ public class ReturnMaterialTaskRecordController extends BaseController<ReturnMat
|
||||||
public String findUnFinishContent(@RequestBody Page<TaskRecordBean> page,HttpServletRequest request,TaskRecordBean o,Model model, HttpSession sess) {
|
public String findUnFinishContent(@RequestBody Page<TaskRecordBean> page,HttpServletRequest request,TaskRecordBean o,Model model, HttpSession sess) {
|
||||||
try {
|
try {
|
||||||
String a = request.getParameter("isFinish");
|
String a = request.getParameter("isFinish");
|
||||||
String userId = UserShiroHelper.getRealCurrentUser().getId() + "";
|
Integer userId = UserShiroHelper.getCurrentUser().getId();
|
||||||
|
System.out.println("当前登陆userId:"+userId);
|
||||||
// UserBean user = UserShiroHelper.getRealCurrentUser();
|
// UserBean user = UserShiroHelper.getRealCurrentUser();
|
||||||
// page.setUser(user);
|
// page.setUser(user);
|
||||||
page.setIsFinish(a);
|
page.setIsFinish(a);
|
||||||
|
|
@ -83,6 +84,46 @@ public class ReturnMaterialTaskRecordController extends BaseController<ReturnMat
|
||||||
return "/rm/UnFinishContentList";
|
return "/rm/UnFinishContentList";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 移动端任务列表接口
|
||||||
|
@RequestMapping(value = "findUnFinishContentMobile", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxRes findUnFinishContentMobile(@RequestBody Page<TaskRecordBean> page, HttpServletRequest request,
|
||||||
|
TaskRecordBean o) {
|
||||||
|
AjaxRes ar = getAjaxRes();
|
||||||
|
try {
|
||||||
|
String isFinish = request.getParameter("isFinish");
|
||||||
|
Integer userId = UserShiroHelper.getCurrentUser().getId();
|
||||||
|
|
||||||
|
page.setIsFinish(isFinish);
|
||||||
|
if (1 != userId) {
|
||||||
|
page.setOperationUserId(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用服务获取数据
|
||||||
|
Page<TaskRecordBean> result = service.findUnFinishContent(page, o);
|
||||||
|
|
||||||
|
// 构造移动端响应数据
|
||||||
|
Map<String, Object> data = new HashMap<String, Object>();
|
||||||
|
data.put("data", result.getResults());
|
||||||
|
|
||||||
|
// 分页信息
|
||||||
|
Map<String, Object> pagination = new HashMap<String, Object>();
|
||||||
|
pagination.put("currentPage", result.getPageNum());
|
||||||
|
pagination.put("totalPages", result.getTotalPage());
|
||||||
|
pagination.put("totalRecords", result.getTotalRecord());
|
||||||
|
pagination.put("pageSize", result.getPageSize());
|
||||||
|
data.put("pagination", pagination);
|
||||||
|
|
||||||
|
ar.setSucceed(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error(e.toString(), e);
|
||||||
|
ar.setFailMsg("获取任务列表失败");
|
||||||
|
}
|
||||||
|
return ar;
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "findByPage", method = RequestMethod.POST)
|
@RequestMapping(value = "findByPage", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxRes findByPage(Page<ReturnMaterialTaskRecordBean> page, ReturnMaterialTaskRecordBean o) {
|
public AjaxRes findByPage(Page<ReturnMaterialTaskRecordBean> page, ReturnMaterialTaskRecordBean o) {
|
||||||
|
|
@ -164,60 +205,17 @@ public class ReturnMaterialTaskRecordController extends BaseController<ReturnMat
|
||||||
map.put("res", "修改失败");
|
map.put("res", "修改失败");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 移动端任务列表接口
|
|
||||||
@RequestMapping(value = "findUnFinishContentMobile", method = RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public AjaxRes findUnFinishContentMobile(@RequestBody Page<TaskRecordBean> page, HttpServletRequest request,
|
|
||||||
TaskRecordBean o) {
|
|
||||||
AjaxRes ar = getAjaxRes();
|
|
||||||
try {
|
|
||||||
String isFinish = request.getParameter("isFinish");
|
|
||||||
String userId = UserShiroHelper.getRealCurrentUser().getId() + "";
|
|
||||||
|
|
||||||
page.setIsFinish(isFinish);
|
|
||||||
if (!"1".equals(userId)) {
|
|
||||||
page.setOperationUserId(userId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 调用服务获取数据
|
|
||||||
Page<TaskRecordBean> result = service.findUnFinishContent(page, o);
|
|
||||||
|
|
||||||
// 构造移动端响应数据
|
|
||||||
Map<String, Object> data = new HashMap<String, Object>();
|
|
||||||
data.put("data", result.getResults());
|
|
||||||
|
|
||||||
// 分页信息
|
|
||||||
Map<String, Object> pagination = new HashMap<String, Object>();
|
|
||||||
pagination.put("currentPage", result.getPageNum());
|
|
||||||
pagination.put("totalPages", result.getTotalPage());
|
|
||||||
pagination.put("totalRecords", result.getTotalRecord());
|
|
||||||
pagination.put("pageSize", result.getPageSize());
|
|
||||||
data.put("pagination", pagination);
|
|
||||||
|
|
||||||
ar.setSucceed(data);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
logger.error(e.toString(), e);
|
|
||||||
ar.setFailMsg("获取任务列表失败");
|
|
||||||
}
|
|
||||||
return ar;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 待办详情
|
|
||||||
//待办详情
|
//待办详情
|
||||||
@RequestMapping(value = "findUnFinishContentDetails", method = RequestMethod.POST)
|
@RequestMapping(value = "findUnFinishContentDetails", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List<ReturnMaterialTaskRecordBean> findUnFinishContentDetails(ReturnMaterialTaskRecordBean o) {
|
public List<ReturnMaterialTaskRecordBean> findUnFinishContentDetails(ReturnMaterialTaskRecordBean o) {
|
||||||
List<ReturnMaterialTaskRecordBean> list = new ArrayList<ReturnMaterialTaskRecordBean>();
|
List<ReturnMaterialTaskRecordBean> list = new ArrayList<ReturnMaterialTaskRecordBean>();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
||||||
list = service.findUnFinishContentDetails(o);
|
list = service.findUnFinishContentDetails(o);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.toString(), e);
|
logger.error(e.toString(), e);
|
||||||
|
|
@ -225,10 +223,6 @@ public class ReturnMaterialTaskRecordController extends BaseController<ReturnMat
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = "export", method = RequestMethod.GET)
|
@RequestMapping(value = "export", method = RequestMethod.GET)
|
||||||
public void export(Page<ReturnMaterialTaskRecordBean> page, HttpServletRequest request, HttpServletResponse response,
|
public void export(Page<ReturnMaterialTaskRecordBean> page, HttpServletRequest request, HttpServletResponse response,
|
||||||
ReturnMaterialTaskRecordBean o) {
|
ReturnMaterialTaskRecordBean o) {
|
||||||
|
|
|
||||||
|
|
@ -22,13 +22,13 @@ public class Page<T> {
|
||||||
private String isFinish;
|
private String isFinish;
|
||||||
|
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
private String operationUserId;
|
private Integer operationUserId;
|
||||||
|
|
||||||
public String getOperationUserId() {
|
public Integer getOperationUserId() {
|
||||||
return operationUserId;
|
return operationUserId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOperationUserId(String operationUserId) {
|
public void setOperationUserId(Integer operationUserId) {
|
||||||
this.operationUserId = operationUserId;
|
this.operationUserId = operationUserId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue