Commit adf7915f authored by 刘学辉's avatar 刘学辉

物料主数据申请页面业务用途的全选,传输日志功能

parent 5bb353e3
$(document).ready(function () {
initializateUI();
bindEvent();
});
function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3});
var isEnable = $("#isEnable").val();
if (isEnable == "0"){
UICtrl.setDisable($("#submitForm"));
if (isApplyProcUnit()){
UICtrl.enable($("#telePhone"))
UICtrl.enable($("#reason"))
}
}
}
function bindEvent(){
}
function setId(value) {
$('#id').val(value);
}
function getId() {
return $("#id").val();
}
<%--
Created by IntelliJ IDEA.
User: zht
Date: 2023/12/13
Time: 16:39
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,combox,commonTree,date"/>
<x:script src='/biz/topsun/sap/mutualEpLog/mutualEpLogDetail.js'/>
</head>
<body>
<div class="container-fluid">
<x:billTitle title="传输日志详情" needStatus="false" needPerson="true"/>
<div class="blank_div clearfix"></div>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="id"/>
<div class="hg-form-row">
<x:inputC name="businessType" required="false" label="业务类型" labelCol="1" maxLength="64" fieldCol="4" readonly="true"/>
<x:inputC name="type" required="false" label="状态" labelCol="1" maxLength="64" fieldCol="2" readonly="true"/>
<x:inputC name="createdDate" required="false" label="创建时间" labelCol="1" maxLength="64" fieldCol="2" readonly="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="message" required="false" label="返回消息" labelCol="1" maxLength="255" fieldCol="10" readonly="true"/>
</div>
<div class="hg-form-row">
<x:textareaC name="parameter" label="参数" rows="10" labelCol="1" fieldCol="10" readonly="true"/>
</div>
<div class="blank_div clearfix"></div>
</form>
</div>
</body>
</html>
var gridManager = null;
var refreshFlag = false;
$(document).ready(function () {
initializateUI()
loadMutualEpLogDataListGrid();
})
function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3});
}
function loadMutualEpLogDataListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
});
gridManager = UICtrl.grid("#mutualEpLogDataListGrid", {
columns: [
{display: "创建日期", name: "createdDate", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "业务类型", name: "businessType", width: 150, minWidth: 60, type: "string", align: "left"},
{display: "状态", name: "type", width: 80, minWidth: 60, type: "string", align: "left"},
{display: "返回消息", name: "message", width: 400, minWidth: 60, type: "string", align: "left"},
{display: "参数", name: "parameter", width: 460, minWidth: 60, type: "string", align: "left"},
],
dataAction: "server",
url: web_app.name + '/mutualEpLog/slicedMutualEpLogList.ajax',
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
width: "100%",
height: "100%",
heightDiff: -8,
checkbox: true,
async: false,
fixedCellHeight: true,
selectRowButtonOnly: true,
onDblClickRow: function (data, rowindex, rowobj) {
doView(data.id);
},
onAfterShowData: function (data){
console.log(data)
}
});
UICtrl.setSearchAreaToggle(gridManager);
}
function query(obj) {
var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param);
}
function reloadGrid() {
gridManager.loadData();
}
function resetForm(obj) {
$(obj).formClean();
}
function doView(id) {
var title="传输日志详情";
UICtrl.addTabItem({
tabid: 'mutualEpLog'+id,
text: title,
url: web_app.name + '/mutualEpLog/showMutualEpLog.do?id='+id
});
}
// 关闭对话框
function onDialogCloseHandler() {
if (refreshFlag) {
reloadGrid();
refreshFlag = false;
}
}
\ No newline at end of file
<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@ taglib uri="/WEB-INF/taglib.tld" prefix="x" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,combox,commonTree"/>
<x:script src='/biz/topsun/sap/mutualEpLog/mutualEpLogList.js'/>
</head>
<body>
<div class="container-fluid">
<%-- <x:button value="next" onclick="next()" icon="fa-save"/>--%>
<div class="ui-hide">
<x:select name="processType" dictionary="processType"/>
<x:select name="yesorno" dictionary="yesorno"/>
</div>
<div id="layout">
<div position="center" title="日志查询">
<x:title title="common.button.search" hideTable="queryMainForm" isHide="true"/>
<form class="hg-form ui-hide" method="post" action="" id="queryMainForm">
<x:inputC name="businessType" required="false" label="业务类型" labelCol="1"/>
<x:inputC name="type" required="false" label="状态" labelCol="1"/>
<x:inputC name="message" required="false" label="返回消息" labelCol="1"/>
<x:inputC name="parameter" required="false" label="参数" labelCol="1"/>
<x:searchButtons/>
</form>
<div class="blank_div clearfix"></div>
<div id="mutualEpLogDataListGrid" style="margin: 2px;"></div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -42,6 +42,45 @@ function initialize(){
UICtrl.disable($("#itemAttributes"));
UICtrl.setDisable("#businessUsageDiv")
}
if (isAll=="1"){
$('input[name="isAll"]').attr("checked",true);
}
$('input[name="isAll"]').change(function () {
//alert($(this).is(':checked'));
debugger
if ($(this).is(':checked')) { //alert("全选");
// $("#busiLens").val(dictUsage.length);
for (var x=0;x<$("input[name='businessUsage']").length;x++) {
$("input[name='businessUsage']")[x].checked = true;
}
} else {
$("input[name='businessUsage']").each(function(){
$(this).attr("checked",false);
})
}
});
$('input[name="businessUsage"]').change(function () {
let isAll = 1;
for (var x=0;x<$("input[name='businessUsage']").length;x++) {
if ($("input[name='businessUsage']")[x].checked != true){
isAll=0;
break;
}
}
if ($(this).is(':checked')) {
if (isAll==1) {
$('input[name="isAll"]')[0].checked = true;
}
} else {
if (isAll==0) {
$('input[name="isAll"]').attr("checked",false);
}
}
});
}
/**
......
......@@ -5,6 +5,7 @@
<head>
<script type="text/javascript">
var applyType ="${applyType}";
var isAll ="${isAll}";
</script>
<x:base include="layout,dialog,grid,tree,combox,commonTree,date,attachment"/>
<x:script src='/biz/topsun/sap/nonProdApply/nonProdApplyDetail.js'/>
......@@ -69,8 +70,9 @@
</div>
<c:if test="${applyType==2}">
<div class="hg-form-row">
<x:checkbox name="isAll" label="全选" />
<x:checkboxListC name="businessUsage" label="业务用途" list="businessUsageUnSeledList" labelCol="1"
fieldCol="11"/>
fieldCol="8"/>
</div>
</c:if>
<c:if test="${applyType==1}">
......@@ -81,8 +83,9 @@
</c:if>
<c:if test="${applyType==0}">
<div class="hg-form-row">
<x:checkbox name="isAll" label="全选" />
<x:checkboxListC name="businessUsage" label="业务用途" dictionary="serviceusage" labelCol="1"
fieldCol="11"/>
fieldCol="8"/>
</div>
</c:if>
......
......@@ -82,7 +82,7 @@
<%--<x:inputC name="mobExtens" label="第一个移动电话号码分机" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="faxNumber" label="传真" labelCol="1" fieldCol="2"/>
<%--<x:inputC name="faxExtens" label="第一个传真号分机号" labelCol="1" fieldCol="2"/>--%>
<x:selectC name="ktokk" label="供应商帐户组" labelCol="1" fieldCol="2" required="true" dictionary="buGroup"/>
<!--x:selectC name="ktokk" label="供应商帐户组" labelCol="1" fieldCol="2" required="true" dictionary="buGroup"/-->
<x:inputC name="kunnr" label="客户编号" labelCol="1" fieldCol="2"/>
<x:inputC name="vbund" label="贸易伙伴" labelCol="1" fieldCol="2"/>
<x:inputC name="stenr" label="责任税务部门的税收编号" labelCol="2" fieldCol="2" required="true"/>
......
package com.huigou.topsun.sap.common.application;
import com.huigou.topsun.sap.common.domain.SapMutualEpLog;
import com.huigou.topsun.sap.common.domain.query.MutualEpLogQueryRequest;
import java.util.Map;
......@@ -16,5 +17,11 @@ public interface SapMutualEpLogApplication {
//Map<String,Object> slicedSapPurchaseList(SapPurchaseQueryRequest queryRequest);
String QUERY_XML_FILE_PATH= "config/topsun/sap/mutualEpLog/mutualEpLog.xml";
SapMutualEpLog saveSapMutualEpLog(Map<String, Object> map);
Map<String, Object> slicedMutualEpLogQuery(MutualEpLogQueryRequest query);
}
package com.huigou.topsun.sap.common.application.impl;
import cn.hutool.core.bean.BeanUtil;
import com.huigou.cache.DictUtil;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.sap.common.application.SapMutualEpLogApplication;
import com.huigou.topsun.sap.common.domain.SapMutualEpLog;
import com.huigou.topsun.sap.common.domain.query.MutualEpLogQueryRequest;
import com.huigou.topsun.sap.common.repository.SapMutualEpLogRepository;
import com.huigou.topsun.sap.nonProdApply.domain.query.NonProdApplyBaseInfoQueryRequest;
import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.util.ClassHelper;
import com.huigou.util.DateUtil;
import com.huigou.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
......@@ -18,7 +25,7 @@ import java.util.Map;
@Service("sapMutualEpLogApplication")
public class SapMutualEpLogApplicationImpl implements SapMutualEpLogApplication {
public class SapMutualEpLogApplicationImpl extends FlowBroker implements SapMutualEpLogApplication {
@Autowired
SapMutualEpLogRepository sapMutualEpLogRepository;
......@@ -42,4 +49,32 @@ public class SapMutualEpLogApplicationImpl implements SapMutualEpLogApplication
}
return sapMutualEpLog;
}
@Override
public Map<String, Object> slicedMutualEpLogQuery(MutualEpLogQueryRequest query) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "slicedMutualEpLogQuery");
QueryModel model = this.sqlExecutorDao.getQueryModel(queryDescriptor, query);
if (StringUtil.isNotBlank(query.getBusinessType())) {
model.addCriteria(" and business_type like:BusinessType");
model.putLikeParam("BusinessType", query.getBusinessType());
}
if (StringUtil.isNotBlank(query.getType())) {
model.addCriteria(" and type=:type");
model.putParam("type", query.getType());
}
if (StringUtil.isNotBlank(query.getMessage())) {
model.addCriteria(" and message like:message");
model.putLikeParam("message", query.getMessage());
}
if (StringUtil.isNotBlank(query.getParameter())) {
model.addCriteria(" and parameter like:parameter");
model.putLikeParam("parameter", query.getParameter());
}
// model.putDictionary("maintenanceType", DictUtil.getDictionary("maintainType"));
model.setSortFieldName("createdDate");
model.setSortOrder("desc");
return this.sqlExecutorDao.executeSlicedQuery(model);
}
}
package com.huigou.topsun.sap.common.controller;
import com.huigou.topsun.sap.common.application.SapMutualEpLogApplication;
import com.huigou.topsun.sap.common.domain.SapMutualEpLog;
import com.huigou.topsun.sap.common.domain.query.MutualEpLogQueryRequest;
import com.huigou.topsun.sap.common.repository.SapMutualEpLogRepository;
import com.huigou.topsun.sap.costCenter.domain.query.CostCenterQueryRequest;
import com.huigou.topsun.sap.nonProdApply.domain.query.NonProdApplyBaseInfoQueryRequest;
import com.huigou.topsun.sap.suppliers.domain.SuppliersInfo;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import java.util.Map;
/**
* @Auther: lxh
* @Date: 2024/1、04/16/11:36
* @Description:
*/
@Controller
@ControllerMapping("/mutualEpLog")
public class MutualEpLogController extends CommonController {
@Autowired
private SapMutualEpLogApplication sapMutualEpLogApplication;
@Autowired
SapMutualEpLogRepository sapMutualEpLogRepository;
@Override
protected String getPagePath() {
return "/biz/topsun/sap/mutualEpLog/";
}
/**
* 跳转到传输日志查询列表
*
* @return
*/
public String forwardMutualEpLogList() {
return forward("mutualEpLogList");
}
public String slicedMutualEpLogList() {
SDO sdo = this.getSDO();
MutualEpLogQueryRequest queryRequest = sdo.toQueryRequest(MutualEpLogQueryRequest.class);
Map<String, Object> map = sapMutualEpLogApplication.slicedMutualEpLogQuery(queryRequest);
return toResult(map);
}
public String showMutualEpLog() {
SDO sdo = this.getSDO();
String id = sdo.getString("id");
// String isDetailPage = sdo.getString("isDetailPage");
// if("true".equals(isDetailPage)) this.putAttribute("isDetailPage","true");
SapMutualEpLog sapMutualEpLog = sapMutualEpLogRepository.findOne(id);
return forward("mutualEpLogDetail", sapMutualEpLog);
}
}
package com.huigou.topsun.sap.common.domain.query;
import com.huigou.data.domain.query.QueryAbstractRequest;
import lombok.Data;
@Data
public class MutualEpLogQueryRequest extends QueryAbstractRequest {
private String businessType;
private String type;
private String message;
private String parameter;
}
......@@ -304,7 +304,7 @@ public class NonProdApplyDeptApplicationImpl extends BaseApplication implements
Map<String, Object> backMap = new HashMap<>();
backMap.put("businessType", busiType);
backMap.put("businessId", baseInfo.getId());
backMap.put("parameter", JSON.toJSONString(map));
backMap.put("parameter", JSON.toJSONString(mapList));
backMap.put("sequence", backMap.get("row"));
backMap.put("type", "E");
try {
......
......@@ -261,6 +261,18 @@ public class NonProdApplyController extends CommonController {
}
this.putAttribute("businessUsageUnSeledList",unMapTmp);
}
Map <String,String>dictMapUsage=DictUtil.getDictionary("serviceusage");
String dictMapUsages="";
for (Map.Entry<String, String> entry: dictMapUsage.entrySet()) {
// String key = entry.getKey().toUpperCase();
dictMapUsages+=entry.getKey().toUpperCase()+","+entry.getValue()+";";
}
dictMapUsages=dictMapUsages.substring(0,dictMapUsages.length()-1);
//this.putAttribute("dictUsages",dictMapUsages);
this.putAttribute("isAll","0");
if (nonProdApplyBaseInfo.getBusinessUsage().split(",").length==dictMapUsages.split(";").length){
this.putAttribute("isAll","1");
}
return forward("nonProdApplyDetail", nonProdApplyBaseInfo);
}
......
<?xml version="1.0" encoding="UTF-8" ?>
<query-mappings>
<query name="slicedMutualEpLogQuery" table="sap_mutual_ep_log">
<sql-query>
select * from sap_mutual_ep_log where 1=1
</sql-query>
<!-- <condition column="stats_indicators_id" name="statsIndicatorsId" type="java.lang.String" symbol="=" alias="t"/>-->
</query>
</query-mappings>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment