修改首页跳转及批量审核
This commit is contained in:
parent
400efc5505
commit
0774d7f588
|
|
@ -178,8 +178,28 @@
|
||||||
JY.Model.info("您没有选择任何内容!");
|
JY.Model.info("您没有选择任何内容!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log("selectedValues:", selectedValues);
|
|
||||||
|
let pizhun=[];
|
||||||
|
let shenhe=[];
|
||||||
|
|
||||||
|
for (var i = 0; i < selectedValues.length; i++) {
|
||||||
|
const item = selectedValues[i]; // 缓存当前元素,代码更简洁
|
||||||
|
console.log('当前遍历元素:', item);
|
||||||
|
// 核心:判断字符串是否包含「新购任务审核」,includes返回布尔值
|
||||||
|
if (item.includes('新购任务审核')) {
|
||||||
|
shenhe.push(item); // 符合条件,推入xingo
|
||||||
|
} else if (item.includes('新购任务批准')){
|
||||||
|
pizhun.push(item); // 不符合,推入shenhe
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('当前遍历元素:', pizhun);
|
||||||
|
console.log('当前遍历元素:', shenhe);
|
||||||
|
if(shenhe.length>0){
|
||||||
|
aduitFunction(shenhe);
|
||||||
|
}
|
||||||
|
if(pizhun.length>0){
|
||||||
|
pizhunFunction(pizhun);
|
||||||
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: bonuspath + '/backstage/rm/taskRecord/batchApproval',
|
url: bonuspath + '/backstage/rm/taskRecord/batchApproval',
|
||||||
|
|
@ -196,6 +216,42 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
//审核
|
||||||
|
function aduitFunction(shenhe){
|
||||||
|
console.log(shenhe)
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: bonuspath + '/backstage/new/isExamines',
|
||||||
|
traditional: true,
|
||||||
|
data: { id: shenhe.join(",") },
|
||||||
|
success: function(data) {
|
||||||
|
dataNum++;
|
||||||
|
},
|
||||||
|
error: function(xhr) {
|
||||||
|
console.error("请求失败,状态码:", xhr.status);
|
||||||
|
console.error("响应内容:", xhr.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function pizhunFunction(pizhun){
|
||||||
|
console.log(pizhun)
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: bonuspath + '/backstage/new/isApprovals',
|
||||||
|
traditional: true,
|
||||||
|
data: { id: pizhun.join(",") },
|
||||||
|
success: function(data) {
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function(xhr) {
|
||||||
|
console.error("请求失败,状态码:", xhr.status);
|
||||||
|
console.error("响应内容:", xhr.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 全选逻辑
|
// 全选逻辑
|
||||||
$('#checkAll').on('click', function(e) {
|
$('#checkAll').on('click', function(e) {
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ let AQGQJ_IP='http://10.1.0.142:1999';
|
||||||
let AQGQJ_HTML_IP='http://10.1.0.142:1999/gz-aqgqj/';
|
let AQGQJ_HTML_IP='http://10.1.0.142:1999/gz-aqgqj/';
|
||||||
|
|
||||||
//车辆 后端请求IP
|
//车辆 后端请求IP
|
||||||
let CAR_IP='http://192.168.0.38:21522';
|
let CAR_IP='http://127.0.0.1:21522';
|
||||||
//车辆 跳转页面IP
|
//车辆 跳转页面IP
|
||||||
let CAR_HTML_IP='http://192.168.0.38:8848/gz_car_ui/';
|
let CAR_HTML_IP='http://127.0.0.1:8848/gz_car_ui/';
|
||||||
|
|
||||||
|
|
||||||
// dev -生产
|
// dev -生产
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -105,7 +105,35 @@
|
||||||
AND
|
AND
|
||||||
wnd.IS_ACTIVE = '1'
|
wnd.IS_ACTIVE = '1'
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getNewInputList" parameterType="java.util.List" resultMap="new">
|
||||||
|
SELECT wnd.ID AS id,SUM(wir.NUM) AS nums,wnd.IS_APPROVAL AS isApproval,
|
||||||
|
wnd.IS_EXAMINE AS isExamine,mt.`NAME` AS maModel,mtt.`NAME` AS maType,
|
||||||
|
pu.`NAME` AS checker,puu.`NAME` AS customerRep,wnd.QUALIFIED_NUM AS checkNum,
|
||||||
|
wnd.MODEL_ID as maModelId,wnd.TASK_ID as taskId,audit.time auditTime ,pus.`NAME` auditUser
|
||||||
|
FROM wf_new_details wnd
|
||||||
|
LEFT JOIN wf_task_appoint wta ON wta.TASK_ID = wnd.TASK_ID
|
||||||
|
LEFT JOIN wf_info_record wir ON wir.SUP_ID = wnd.TASK_ID AND wnd.MODEL_ID = wir.MODEL_ID
|
||||||
|
LEFT JOIN pm_user pu on pu.ID = wnd.CHECKER
|
||||||
|
LEFT JOIN pm_user puu ON puu.ID = wnd.CUSTOMER_SERVICE_REP
|
||||||
|
LEFT JOIN ma_org_relation mor on mor.TYPE_ID = wnd.MODEL_ID
|
||||||
|
LEFT JOIN mm_type mt ON mt.ID = mor.TYPE_ID
|
||||||
|
LEFT JOIN mm_type mtt ON mtt.ID = mt.PARENT_ID
|
||||||
|
LEFT JOIN(
|
||||||
|
SELECT task, max(time) time ,creator
|
||||||
|
from bm_logs
|
||||||
|
where fun='/backstage/new/isApproval'
|
||||||
|
GROUP BY task
|
||||||
|
)audit on audit.task=wnd.TASK_ID
|
||||||
|
LEFT JOIN pm_user pus on pus.ID = audit.creator
|
||||||
|
WHERE wir.NUM IS NOT NULL AND wnd.IS_EXAMINE = 1 AND wta.IS_ACTIVE = 1
|
||||||
|
and wnd.id in
|
||||||
|
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
GROUP BY wnd.MODEL_ID,wnd.TASK_ID
|
||||||
|
ORDER BY wnd.IS_APPROVAL
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="findIsApproval" parameterType="com.bonus.newInput.beans.NewInputBean"
|
<select id="findIsApproval" parameterType="com.bonus.newInput.beans.NewInputBean"
|
||||||
resultMap="new">
|
resultMap="new">
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,55 @@
|
||||||
</if>
|
</if>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
wtr.id AS id,
|
||||||
|
taskinfo.ID AS checkerId,
|
||||||
|
'-' number,
|
||||||
|
concat(wpd.NAME,IF(taskinfo.IS_EXAMINE=0,'审核','批准')) processName,
|
||||||
|
wtd.NAME definitionName,
|
||||||
|
pu.NAME AS creatorName,
|
||||||
|
DATE_FORMAT(wtr.OPERATION_TIME, '%Y-%m-%d') AS operationTime,
|
||||||
|
wtr.DEFINITION_ID AS definitionId,
|
||||||
|
CASE
|
||||||
|
WHEN wtr.DEFINITION_ID = 11 THEN wtr1.IS_FINISH
|
||||||
|
ELSE wtr.IS_FINISH
|
||||||
|
END AS isFinish,
|
||||||
|
'TASK' AS source
|
||||||
|
FROM
|
||||||
|
wf_task_record wtr
|
||||||
|
INNER join(
|
||||||
|
SELECT TASK_ID,ID,IS_EXAMINE,IS_APPROVAL
|
||||||
|
FROM wf_new_details
|
||||||
|
<where>
|
||||||
|
CAST(QUALIFIED_NUM AS DECIMAL(18,2)) = CAST(INPUT_NUM AS DECIMAL(18,2))
|
||||||
|
and IS_ACTIVE=1
|
||||||
|
<if test='param.isFinish==1 or param.isFinish=="1"'>
|
||||||
|
and (IS_APPROVAL=1 and IS_EXAMINE=1)
|
||||||
|
</if>
|
||||||
|
<if test='param.isFinish==0 or param.isFinish=="0"'>
|
||||||
|
and (IS_APPROVAL!=1 OR IS_EXAMINE!=1)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
)taskinfo on taskinfo.TASK_ID=wtr.id
|
||||||
|
LEFT JOIN wf_task_record wtr1 ON wtr1.ID = wtr.SUP_ID
|
||||||
|
LEFT JOIN pm_user pu ON pu.id = wtr.OPERATION_USER
|
||||||
|
LEFT JOIN wf_task_definition wtd ON wtd.ID = wtr.DEFINITION_ID
|
||||||
|
LEFT JOIN wf_process_definition wpd ON wpd.id = wtr.PROCESS_ID
|
||||||
|
WHERE wtr.DEFINITION_ID IN (12)
|
||||||
|
AND wtr.IS_ACTIVE = 1
|
||||||
|
<if test="param.operationUserId != null and param.operationUserId != 0">
|
||||||
|
AND wtr.OPERATION_USER = #{param.operationUserId}
|
||||||
|
</if>
|
||||||
|
<if test="param.keyWord != null and param.keyWord != ''">
|
||||||
|
AND (
|
||||||
|
wpd.NAME LIKE CONCAT('%', #{param.keyWord}, '%')
|
||||||
|
OR wtd.NAME LIKE CONCAT('%', #{param.keyWord}, '%')
|
||||||
|
OR pu.NAME LIKE CONCAT('%', #{param.keyWord}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
||||||
(
|
(
|
||||||
|
|
|
||||||
|
|
@ -450,7 +450,7 @@ public class InputDetailsController extends BaseController<InputDetailsBean> {
|
||||||
String saveDirectory = "/data/gzimt/" + mkdirsName + "/"; // linux 系统路径
|
String saveDirectory = "/data/gzimt/" + mkdirsName + "/"; // linux 系统路径
|
||||||
String os = System.getProperty("os.name");
|
String os = System.getProperty("os.name");
|
||||||
if (os.toLowerCase().startsWith("win")) {
|
if (os.toLowerCase().startsWith("win")) {
|
||||||
saveDirectory = "e://GZMachinesWeb/" + mkdirsName + "/";
|
saveDirectory = "D://GZMachinesWeb/" + mkdirsName + "/";
|
||||||
}
|
}
|
||||||
File files = new File(saveDirectory);
|
File files = new File(saveDirectory);
|
||||||
if (!files.exists()) {
|
if (!files.exists()) {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.bonus.data.StringUtil;
|
||||||
import com.bonus.newInput.beans.NewInputBean;
|
import com.bonus.newInput.beans.NewInputBean;
|
||||||
import com.bonus.newInput.service.NewInputService;
|
import com.bonus.newInput.service.NewInputService;
|
||||||
import com.bonus.sys.beans.UserBean;
|
import com.bonus.sys.beans.UserBean;
|
||||||
|
|
@ -222,6 +223,28 @@ public class NewInputController extends BaseController<NewInputBean> {
|
||||||
ar.setSucceed(o);
|
ar.setSucceed(o);
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "isExamines", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxRes isExamines(NewInputBean o) {
|
||||||
|
AjaxRes ar = getAjaxRes();
|
||||||
|
try {
|
||||||
|
if(!StringUtil.isEmpty(o.getId())) {
|
||||||
|
String[] ids=o.getId().split(",");
|
||||||
|
for (String string : ids) {
|
||||||
|
NewInputBean newInputBean=new NewInputBean();
|
||||||
|
newInputBean.setId(string.split("_")[0]);
|
||||||
|
service.isExamine(newInputBean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ar.setSucceedMsg(GlobalConst.SAVE_SUCCEED);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.toString(), e);
|
||||||
|
ar.setFailMsg(GlobalConst.SAVE_FAIL);
|
||||||
|
}
|
||||||
|
ar.setSucceed(o);
|
||||||
|
return ar;
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "isApproval", method = RequestMethod.POST)
|
@RequestMapping(value = "isApproval", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
@ -237,6 +260,21 @@ public class NewInputController extends BaseController<NewInputBean> {
|
||||||
ar.setSucceed(o);
|
ar.setSucceed(o);
|
||||||
return ar;
|
return ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "isApprovals", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxRes isApprovals (NewInputBean o) {
|
||||||
|
AjaxRes ar = getAjaxRes();
|
||||||
|
try {
|
||||||
|
service.isApprovals(o);
|
||||||
|
ar.setSucceedMsg(GlobalConst.SAVE_SUCCEED);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.toString(), e);
|
||||||
|
ar.setFailMsg(GlobalConst.SAVE_FAIL);
|
||||||
|
}
|
||||||
|
ar.setSucceed(o);
|
||||||
|
return ar;
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "update", method = RequestMethod.POST)
|
@RequestMapping(value = "update", method = RequestMethod.POST)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
|
||||||
|
|
@ -75,4 +75,10 @@ public interface NewInputDao extends BaseDao<NewInputBean> {
|
||||||
public int delDetails(NewInputBean o);
|
public int delDetails(NewInputBean o);
|
||||||
|
|
||||||
public NewInputBean getNewInputByTaskId(NewInputBean o);
|
public NewInputBean getNewInputByTaskId(NewInputBean o);
|
||||||
|
/**
|
||||||
|
* 依据id查询数据
|
||||||
|
* @param idList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<NewInputBean> getNewInputList(@Param("list")List<String> idList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,9 @@ import com.bonus.sys.AjaxRes;
|
||||||
import com.bonus.sys.BaseServiceImp;
|
import com.bonus.sys.BaseServiceImp;
|
||||||
import com.bonus.sys.GlobalConst;
|
import com.bonus.sys.GlobalConst;
|
||||||
import com.bonus.sys.Page;
|
import com.bonus.sys.Page;
|
||||||
|
import com.bonus.sys.UserShiroHelper;
|
||||||
|
import com.bonus.wf.beans.TaskRecordBean;
|
||||||
|
import com.bonus.wf.dao.TaskRecordDao;
|
||||||
|
|
||||||
@Service("newQrcode")
|
@Service("newQrcode")
|
||||||
public class NewInputQrcodeServiceImp extends BaseServiceImp<NewInputQrcodeBean> implements NewInputQrcodeService {
|
public class NewInputQrcodeServiceImp extends BaseServiceImp<NewInputQrcodeBean> implements NewInputQrcodeService {
|
||||||
|
|
@ -232,6 +235,7 @@ public class NewInputQrcodeServiceImp extends BaseServiceImp<NewInputQrcodeBean>
|
||||||
o.setOperationTime(DateTimeHelper.getNowTime());
|
o.setOperationTime(DateTimeHelper.getNowTime());
|
||||||
o.setState("5");
|
o.setState("5");
|
||||||
if (StringHelper.isNotEmpty(o.getQrCode()) || StringHelper.isNotEmpty(o.getDeviceCode())) {
|
if (StringHelper.isNotEmpty(o.getQrCode()) || StringHelper.isNotEmpty(o.getDeviceCode())) {
|
||||||
|
//第一次添加数据
|
||||||
o.setNums("1");
|
o.setNums("1");
|
||||||
res = insertInfoRecordByCode(o);
|
res = insertInfoRecordByCode(o);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -245,6 +249,9 @@ public class NewInputQrcodeServiceImp extends BaseServiceImp<NewInputQrcodeBean>
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void isFinish(NewInputQrcodeBean o) {
|
private void isFinish(NewInputQrcodeBean o) {
|
||||||
List<NewInputQrcodeBean> list = dao.findIsSure(o);
|
List<NewInputQrcodeBean> list = dao.findIsSure(o);
|
||||||
if (list.size() > 0 && list != null) {
|
if (list.size() > 0 && list != null) {
|
||||||
|
|
|
||||||
|
|
@ -29,4 +29,9 @@ public interface NewInputService extends BaseService<NewInputBean> {
|
||||||
public int deleteQrcode(NewInputBean o);
|
public int deleteQrcode(NewInputBean o);
|
||||||
|
|
||||||
public AjaxRes getProcessInfo(NewInputBean o);
|
public AjaxRes getProcessInfo(NewInputBean o);
|
||||||
|
/**
|
||||||
|
* 批量批准
|
||||||
|
* @param o
|
||||||
|
*/
|
||||||
|
void isApprovals(NewInputBean o);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
|
||||||
import com.bonus.bm.beans.LogBean;
|
import com.bonus.bm.beans.LogBean;
|
||||||
import com.bonus.bm.dao.LogDao;
|
import com.bonus.bm.dao.LogDao;
|
||||||
import com.bonus.core.DateTimeHelper;
|
import com.bonus.core.DateTimeHelper;
|
||||||
|
import com.bonus.data.StringUtil;
|
||||||
import com.bonus.ma.beans.MachineBean;
|
import com.bonus.ma.beans.MachineBean;
|
||||||
import com.bonus.ma.beans.MachineTypeBean;
|
import com.bonus.ma.beans.MachineTypeBean;
|
||||||
import com.bonus.ma.dao.MachineDao;
|
import com.bonus.ma.dao.MachineDao;
|
||||||
|
|
@ -138,9 +139,27 @@ public class NewInputServiceImp extends BaseServiceImp<NewInputBean> implements
|
||||||
o.setAuditTime(time);
|
o.setAuditTime(time);
|
||||||
o.setIsExamine("1");
|
o.setIsExamine("1");
|
||||||
dao.isExamine(o);
|
dao.isExamine(o);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void isApprovals(NewInputBean o) {
|
||||||
|
String ids=o.getId();
|
||||||
|
if(!StringUtil.isEmpty(ids)) {
|
||||||
|
String[] idData=ids.split(",");
|
||||||
|
List<String> idList=new ArrayList<String>();
|
||||||
|
for (String string : idData) {
|
||||||
|
idList.add(string.split("_")[0]);
|
||||||
|
}
|
||||||
|
List<NewInputBean> list=dao.getNewInputList(idList);
|
||||||
|
for (NewInputBean newInputBean : list) {
|
||||||
|
//审核
|
||||||
|
//System.err.print(false);
|
||||||
|
isApproval(newInputBean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批准 1.修改机具状态,增加库存 2.修改任务状态3.修改批准状态
|
* 批准 1.修改机具状态,增加库存 2.修改任务状态3.修改批准状态
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue