Commit 171e7d25 authored by 1650842865's avatar 1650842865

异常原因分类维护界面;品质异常报告模糊查询异常原因分类

parent bc70e7fd
var gridManager = null, refreshFlag = false
$(document).ready(function () {
initUI();
initGrid();
}
);
function initUI() {
UICtrl.initDefaultLayout();
}
function initGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: addHandler,
updateHandler:function (){
updateHandler();
},
deleteHandler: deleteHandler,
impExcelDataHandler:{id:'impExcelData',img:'fa-table',text:'导入数据',click:impExcelDataHandler},
});
gridManager = UICtrl.grid('#maingrid', {
columns: [
{display: "序号(一级分类编码)", name: "reasonType", width: "200", align: "center", type: "string"}
, {display: "标准名称大类(一级分类)", name: "reasonTypeName", width: "200", minWidth: 60, type: "string", align: "center"}
, {display: "问题类型代码(二级分类 )", name: "reasonTypeDetail", width: "200", minWidth: 60, type: "string", align: "center"}
, {display: "问题类型(二级分类 )", name: "reasonTypeDetailName", width: "500", minWidth: 60, type: "string", align: "center"}
],
dataAction: 'server',
url: web_app.name + '/exceptionReasonTypeDetail/slicedExceptionReasonTypeDetailList.ajax?',
toolbar: toolbarOptions,
width: '99.8%',
height: '100%',
pageSize: 100,
heightDiff: -4,
sortName: 'reasonType',
sortOrder: 'asc',
checkbox: true,
usePager: true,
rownumbers: true,
enabledEdit: false,
fixedCellHeight: true,
selectRowButtonOnly: true,
enableObjectBag: true,
allowAdjustColWidth: true,
onDblClickRow: function (data, rowindex, rowobj) {
updateHandler(data.id);
},
}
);
UICtrl.setSearchAreaToggle(gridManager);
}
//添加按钮
function addHandler() {
UICtrl.showAjaxDialog({url: web_app.name + '/exceptionReasonTypeDetail/showInsertExceptionReasonTypeDetail.load',
ok: insert, close: dialogClose,width:750,title:'新增'
});
}
//编辑按钮
function updateHandler(id){
if(!id){
var id = DataUtil.getUpdateRowId(gridManager);
if (!id){ return; }
}
UICtrl.showAjaxDialog({url: web_app.name + '/exceptionReasonTypeDetail/showUpdateExceptionReasonTypeDetail.load',
param:{id:id},
ok: update,
width:750,
title:'修改',
close: dialogClose
});
}
//删除按钮
function deleteHandler(){
DataUtil.del({action:'exceptionReasonTypeDetail/deleteExceptionReasonTypeDetail.ajax',
gridManager:gridManager,
onSuccess:function(){
reloadGrid();
}
});
}
function insert() {
var id=$('#id').val();
if(id!='') {
return update();
}
var _self=this;
$('#submitForm').ajaxSubmit({url: web_app.name + '/exceptionReasonTypeDetail/savedExceptionReasonTypeDetail.ajax',
param:{},
success: function(id) {
$('#id').val(id);
_self.close();
gridManager.loadData();
refreshFlag = true;
}
});
}
//编辑保存
function update(){
var _self=this;
$('#submitForm').ajaxSubmit({url: web_app.name + '/exceptionReasonTypeDetail/savedExceptionReasonTypeDetail.ajax',
param:{},
success: function() {
refreshFlag = true;
_self.close();
gridManager.loadData();
}
});
}
//关闭对话框
function dialogClose(){
if(refreshFlag){
reloadGrid();
refreshFlag=false;
}
}
//从EXCEL导入数据
function impExcelDataHandler(){
ExcelImpManager.showImpDialog('导入', 'exceptionReasonTypeDetail', Public.getUUID());
}
function reloadGrid() {
var params = $("#queryMainForm").formToJSON();
UICtrl.gridSearch(gridManager, params);
}
function query(obj) {
var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param);
}
function resetForm(obj) {
$(obj).formClean();
}
<%@ 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,dateTime,combox,attachment,commonTree,comboDialog"/>
<x:script src="/system/excelimport/AssignCodeImp.js"/>
<script src='<c:url value="/biz/topsun/sap/exceptionReport/exceptionReasonTypeDetailList.js"/>' type="text/javascript"></script>
</head>
<body>
<div class="container-fluid">
<div id="layout">
<div position="center" title="">
<x:title title="搜索" hideTable="queryMainForm"/>
<form class="hg-form ui-show" method="post" action="" id="queryMainForm">
<div class="hg-form-row">
<x:inputC name="reasonType" label="序号(一级分类编码)" labelCol="2" fieldCol="2" />
<x:inputC name="reasonTypeName" label="标准名称大类(一级分类)" labelCol="2" fieldCol="4" />
</div>
<div class="hg-form-row">
<x:inputC name="reasonTypeDetail" label="问题类型代码(二级分类 )" labelCol="2" fieldCol="2" />
<x:inputC name="reasonTypeDetailName" label="问题类型(二级分类 )" labelCol="2" fieldCol="4" />
</div>
<x:searchButtons/>
</form>
<x:title title="异常原因分类明细" hideTable="#maingrid" name="list"/>
<div id="maingrid" style="margin:2px;"></div>
</div>
</div>
</div>
</body>
</html>
...@@ -41,8 +41,10 @@ ...@@ -41,8 +41,10 @@
<x:inputC name="reportDate" label="呈报日期" labelCol="1" fieldCol="2" required="true" wrapper="date"/> <x:inputC name="reportDate" label="呈报日期" labelCol="1" fieldCol="2" required="true" wrapper="date"/>
<x:selectC name="urgency" label="紧急程度" labelCol="1" fieldCol="2" required="true" dictionary="urgency"/> <x:selectC name="urgency" label="紧急程度" labelCol="1" fieldCol="2" required="true" dictionary="urgency"/>
<x:selectC name="exceptionType" label="异常类型" labelCol="1" fieldCol="2" required="true" dictionary="exceptionType"/> <x:selectC name="exceptionType" label="异常类型" labelCol="1" fieldCol="2" required="true" dictionary="exceptionType"/>
<x:selectC name="exceptionReasonType" label="异常原因分类" labelCol="1" fieldCol="2" required="true" dictionary="exceptionReasonType"/> <x:selectC name="exceptionReasonType" label="原因分类" labelCol="1" fieldCol="2" required="true" dictionary="exceptionReasonType"/>
<x:inputC name="reasonTypeDetailName" label="异常问题类型" labelCol="1" fieldCol="2" required="true" wrapper="select"/>
<x:hidden name="reasonTypeDetail"/>
<x:hidden name="reasonTypeName"/>
<x:inputC name="productTypeName" label="产品类别" required="false" labelCol="1" fieldCol="2" wrapper="select"/> <x:inputC name="productTypeName" label="产品类别" required="false" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="productType"/> <x:hidden name="productType"/>
<!--x:inputC name="appealNo" label="客诉编号" labelCol="1" fieldCol="2" required="false"/--> <!--x:inputC name="appealNo" label="客诉编号" labelCol="1" fieldCol="2" required="false"/-->
...@@ -68,19 +70,21 @@ ...@@ -68,19 +70,21 @@
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="customerNo" label="客户编号" labelCol="1" fieldCol="2" required="false" wrapper="select"/> <x:inputC name="customerNo" label="客户编号" labelCol="1" fieldCol="2" required="false" wrapper="select"/>
<x:inputC name="customerOrderNo" label="客户单号" labelCol="1" fieldCol="2" wrapper="select" required="false"/> <x:inputC name="customerOrderNo" label="客户单号" labelCol="1" fieldCol="2" wrapper="select" required="false"/>
<div id="produceNoDiv"> <x:inputC name="produceNo" label="生产单号" labelCol="1" fieldCol="2" wrapper="select" required="false"/>
<x:inputC name="produceNo" label="生产单号" labelCol="1" fieldCol="2" wrapper="select" required="false"/>
</div>
<x:inputC name="customerName" label="客户名称" labelCol="1" fieldCol="2" required="false" readonly="true"/> <x:inputC name="customerName" label="客户名称" labelCol="1" fieldCol="2" required="false" readonly="true"/>
</div> </div>
<x:title title="单号信息" name="group" hideTable="#info" /> <x:title title="单号信息" name="group" hideTable="#info" />
<div class="hg-form-cols" id="producegridDiv"> <%--<div class="hg-form-cols" id="producegridDiv">
<div id="producegrid"></div> <div id="producegrid"></div>
</div> </div>--%>
<div class="hg-form-cols" id="clientgridDiv"> <div class="hg-form-cols" id="clientgridDiv">
<div id="clientgrid"></div> <div id="clientgrid"></div>
</div> </div>
</div> </div>
<div class="hg-form-row">
<x:inputC name="payMoney" label="赔付金额" labelCol="1" fieldCol="2" required="false" />
<x:inputC name="loseMoney" label="损失金额" labelCol="1" fieldCol="2" required="false" readonly="true" />
</div>
<div class="hg-form-cols"> <div class="hg-form-cols">
<div style="padding-top: 15px;"> <div style="padding-top: 15px;">
...@@ -96,9 +100,9 @@ ...@@ -96,9 +100,9 @@
<x:textareaC name="dealMethod" required="false" label="改善措施" maxLength="1500" labelCol="1" fieldCol="11" rows="3"/> <x:textareaC name="dealMethod" required="false" label="改善措施" maxLength="1500" labelCol="1" fieldCol="11" rows="3"/>
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="dutyDeptName" label="责任部门" labelCol="1" fieldCol="2" required="false" wrapper="tree"/> <x:inputC name="dutyDeptName" label="处理部门" labelCol="1" fieldCol="2" required="false" wrapper="tree"/>
<x:hidden name="dutyDept"/> <x:hidden name="dutyDept"/>
<x:inputC name="checkOperatorName" label="负责人" labelCol="1" fieldCol="2" required="false" wrapper="tree"/> <x:inputC name="checkOperatorName" label="处理人" labelCol="1" fieldCol="2" required="false" wrapper="tree"/>
<x:hidden name="checkOperator"/> <x:hidden name="checkOperator"/>
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
...@@ -115,10 +119,6 @@ ...@@ -115,10 +119,6 @@
</div> </div>
<x:title title="责任人信息" name="group" hideTable="#info" /> <x:title title="责任人信息" name="group" hideTable="#info" />
<div id="dutyPersonGrid"></div> <div id="dutyPersonGrid"></div>
<div class="hg-form-row">
<x:inputC name="payMoney" label="赔付金额" labelCol="1" fieldCol="2" required="false" />
<x:inputC name="loseMoney" label="损失金额" labelCol="1" fieldCol="2" required="false" readonly="true" />
</div>
</form> </form>
</div> </div>
</body> </body>
\ 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,dateTime,combox,attachment,commonTree,comboDialog"/>
<x:script src="/biz/topsun/sap/exceptionReport/exceptionReportDetailPurchase.js"/>
</head>
<body>
<div class="container-fluid">
<x:billTitle title="品质异常报告(采购/外发)" needStatus="true" needPerson="true"/>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="billType"/>
<x:hidden name="id"/>
<x:hidden name="version"/>
<x:hidden name="attbizId"/>
<x:hidden name="billCode"/>
<x:hidden name="fillinDate"/>
<x:hidden name="fullId"/>
<x:hidden name="organId"/>
<x:hidden name="organName"/>
<x:hidden name="deptId"/>
<x:hidden name="deptName"/>
<x:hidden name="positionId"/>
<x:hidden name="positionName"/>
<x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/>
<x:hidden name="statusId"/>
<x:hidden name="frgdt"/>
<x:hidden name="handleNodeId"/>
<x:hidden name="handleNodeName"/>
<div class="hg-form-cols">
<c:if test="${statusId==3}">
<div style="float: right; margin-right: 10px;" class="btn-group" id="buttonBox">
<button id="save" title="" type="button" onclick="printPage()" class="btn btn-gray"><i
class="fa fa-save"></i>打印
</button>
</div>
</c:if>
<div class="hg-form-row">
<x:selectC name="exceptionType" label="异常类型" labelCol="1" fieldCol="2" required="true" dictionary="exceptionType"/>
<x:inputC name="reportDate" label="呈报日期" labelCol="1" fieldCol="2" required="true" wrapper="date"/>
<x:inputC name="werksName" required="false" label="工厂" labelCol="1" wrapper="select" fieldCol="2"/>
<x:hidden name="werks"/>
<x:inputC name="exceptionTitle" label="异常标题" labelCol="1" fieldCol="2" required="true"/>
</div>
<div class="hg-form-row">
<x:selectC name="exceptionReasonType" label="异常原因分类" labelCol="1" fieldCol="2" required="true" dictionary="exceptionReasonType"/>
<x:inputC name="appealNo" label="客诉编号" labelCol="1" fieldCol="2" required="false"/>
<x:inputC name="customerName" label="客户名称" labelCol="1" fieldCol="2" required="true"/>
<x:inputC name="customerOrderNo" label="客户单号" labelCol="1" fieldCol="2" required="true"/>
<x:selectC name="urgency" label="紧急程度" labelCol="1" fieldCol="2" required="true" dictionary="urgency"/>
<x:inputC name="problemTimes" label="问题发生次数" labelCol="1" fieldCol="2" required="false"/>
<x:inputC name="brandName" label="品牌名称" labelCol="1" fieldCol="2" required="true"/>
<x:inputC name="exceptionDate" label="异常日期" labelCol="1" fieldCol="2" required="false" wrapper="date"/>
<x:checkbox name="needImproveReport" id="needImproveReport" cssStyle="margin-left:10px;" label="客户是否需要改善报告"/>
<x:checkbox name="needGuarantee" id="needGuarantee" cssStyle="margin-left:10px;" label="客户是否需要保证书"/>
</div>
</div>
<x:title title="单号信息" name="group" hideTable="#info" />
<div id="maingrid"></div>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:textareaC name="exceptionState" required="false" label="异常陈诉" maxLength="120" labelCol="1" fieldCol="11" rows="3"/>
</div>
<div style="padding-top: 15px;">
<x:fileList bizCode="exceptionStateInfo" bizId="attbizId" id="exceptionStateInfoList" title="相关资料" />
</div>
<div class="hg-form-row">
<x:textareaC name="exceptionReason" required="false" label="异常原因" maxLength="120" labelCol="1" fieldCol="11" rows="3"/>
</div>
<div class="hg-form-row">
<x:textareaC name="dealMethod" required="false" label="改善措施" maxLength="120" labelCol="1" fieldCol="11" rows="3"/>
</div>
<div class="hg-form-row">
<x:inputC name="dutyDeptName" label="责任部门" labelCol="1" fieldCol="2" required="false" wrapper="tree"/>
<x:hidden name="dutyDept"/>
<x:inputC name="checkOperatorName" label="责任人" labelCol="1" fieldCol="2" required="false" wrapper="tree"/>
<x:hidden name="checkOperator"/>
</div>
<div class="hg-form-row">
<x:textareaC name="dealResult" required="false" label="处理结果" maxLength="120" labelCol="1" fieldCol="11" rows="3"/>
</div>
<div class="hg-form-row">
<x:inputC name="manager" label="单位主管" labelCol="1" fieldCol="2" required="false"/>
<x:inputC name="deputyManager" label="副理" labelCol="1" fieldCol="2" required="false"/>
<x:inputC name="generalManager" label="经理" labelCol="1" fieldCol="2" required="false"/>
</div>
<div class="hg-form-row">
<x:textareaC name="remark" required="false" label="备注" maxLength="120" labelCol="1" fieldCol="11" rows="3"/>
</div>
</div>
<x:title title="责任人信息" name="group" hideTable="#info" />
<div id="dutyPersonGrid"></div>
<div class="hg-form-row">
<x:inputC name="payMoney" label="赔付金额" labelCol="1" fieldCol="2" required="false" readonly="false" />
<x:inputC name="loseMoney" label="损失金额" labelCol="1" fieldCol="2" required="false" readonly="true" />
</div>
</form>
</div>
</body>
\ No newline at end of file
...@@ -2,7 +2,7 @@ var gridManager = null, refreshFlag = false, _roleId = null, purchaseSelectedLis ...@@ -2,7 +2,7 @@ var gridManager = null, refreshFlag = false, _roleId = null, purchaseSelectedLis
$(document).ready(function () { $(document).ready(function () {
initUI(); initUI();
initGrid(); initGrid();
bindEvents();
} }
); );
...@@ -116,6 +116,19 @@ function initGrid() { ...@@ -116,6 +116,19 @@ function initGrid() {
UICtrl.setSearchAreaToggle(gridManager); UICtrl.setSearchAreaToggle(gridManager);
} }
function bindEvents() {
//产品类别
$('#productTypeName').searchbox({
type: "system", name: "dictionary",
getParam: function (item) {
return {fieldName: "MATKL"}
},
onChange: function (value, data) {
$('#productType').val(data.MATKL);
$('#productTypeName').val(data.WGBEZ);
}
});
}
/** /**
* 查看品质异常报告详情 * 查看品质异常报告详情
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
<x:selectC name="exceptionReasonType" label="异常原因分类" labelCol="1" dictionary="exceptionReasonType"/> <x:selectC name="exceptionReasonType" label="异常原因分类" labelCol="1" dictionary="exceptionReasonType"/>
<x:selectC name="status" label="状态" labelCol="1" fieldCol="2" dictionary="bizBillStatus"/> <x:selectC name="status" label="状态" labelCol="1" fieldCol="2" dictionary="bizBillStatus"/>
<x:selectC name="urgency" label="紧急程度" labelCol="1" fieldCol="2" dictionary="urgency"/> <x:selectC name="urgency" label="紧急程度" labelCol="1" fieldCol="2" dictionary="urgency"/>
<x:inputC name="productTypeName" label="产品类别" required="false" labelCol="1" fieldCol="2" wrapper="select"/>
<x:hidden name="productType"/>
</div> </div>
<x:searchButtons/> <x:searchButtons/>
</form> </form>
......
<%@ 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"/>
</head>
<body>
<form class="hg-form" method="post" action="" id="submitForm">
<div class="hg-form-cols">
<div class="hg-form-row">
<x:hidden name="id"/>
<x:inputC name="reasonType" label="序号(一级分类编码)" labelCol="3" fieldCol="2" required="true"/>
<x:inputC name="reasonTypeName" label="标准名称大类(一级分类)" labelCol="3" fieldCol="4" required="true" />
</div>
<div class="hg-form-row">
<x:inputC name="reasonTypeDetail" label="问题类型代码(二级分类 )" labelCol="3" fieldCol="2" required="true" />
<x:inputC name="reasonTypeDetailName" label="问题类型(二级分类 )" labelCol="3" fieldCol="4" required="true" />
</div>
</div>
</form>
</body>
</html>
...@@ -109,7 +109,6 @@ function bindEvent(){ ...@@ -109,7 +109,6 @@ function bindEvent(){
} }
}, },
onChange: function (value, data) { onChange: function (value, data) {
debugger
$('#waers').val(data.waers); $('#waers').val(data.waers);
$('#waersName').val(data.waersName); $('#waersName').val(data.waersName);
$('#ltsnr').val(data.ltsnr); $('#ltsnr').val(data.ltsnr);
......
...@@ -2,10 +2,14 @@ package com.huigou.topsun.controller; ...@@ -2,10 +2,14 @@ package com.huigou.topsun.controller;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.huigou.cache.DictUtil; import com.huigou.cache.DictUtil;
import com.huigou.topsun.ep.epApplication.EpApplication; import com.huigou.topsun.ep.epApplication.EpApplication;
import com.huigou.topsun.sap.exceptionReport.application.ExceptionReasonTypeDetailApplication;
import com.huigou.topsun.sap.exceptionReport.domain.ExceptionReasonTypeDetail;
import com.huigou.topsun.sap.exceptionReport.repository.ExceptionReasonTypeDetailRepository;
import com.huigou.topsun.sap.sapApplication.application.*; import com.huigou.topsun.sap.sapApplication.application.*;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogOrderQuery; import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogOrderQuery;
import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery; import com.huigou.topsun.sap.sapApplication.domain.query.SapDialogQuery;
...@@ -19,9 +23,11 @@ import com.huigou.uasp.bmp.common.easysearch.domain.model.QuerySchemeField; ...@@ -19,9 +23,11 @@ import com.huigou.uasp.bmp.common.easysearch.domain.model.QuerySchemeField;
import com.huigou.uasp.bmp.configuration.application.DictionaryApplication; import com.huigou.uasp.bmp.configuration.application.DictionaryApplication;
import com.huigou.uasp.bmp.opm.application.MemEasySearcher; import com.huigou.uasp.bmp.opm.application.MemEasySearcher;
import com.huigou.uasp.bmp.opm.application.impl.MemEasySearcherImpl; import com.huigou.uasp.bmp.opm.application.impl.MemEasySearcherImpl;
import com.huigou.util.ClassHelper;
import com.huigou.util.JSONUtil; import com.huigou.util.JSONUtil;
import com.huigou.util.SDO; import com.huigou.util.SDO;
import com.huigou.util.StringUtil; import com.huigou.util.StringUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
...@@ -56,6 +62,8 @@ public class ResourceSearchController { ...@@ -56,6 +62,8 @@ public class ResourceSearchController {
private SuppliersDataApplication suppliersDataApplication; private SuppliersDataApplication suppliersDataApplication;
@Autowired @Autowired
private EpApplication epApplication; private EpApplication epApplication;
@Autowired
private ExceptionReasonTypeDetailApplication exceptionReasonTypeDetailApplication;
@EasySearch(queryName = "knttp") @EasySearch(queryName = "knttp")
public Map<String, Object> knttpSelect(SDO sdo){ public Map<String, Object> knttpSelect(SDO sdo){
...@@ -354,24 +362,30 @@ public class ResourceSearchController { ...@@ -354,24 +362,30 @@ public class ResourceSearchController {
PageRequest pageRequest = new PageRequest(intPage - 1, pageSize); PageRequest pageRequest = new PageRequest(intPage - 1, pageSize);
EasySearchParse easySearchParse = new EasySearchParse(); EasySearchParse easySearchParse = new EasySearchParse();
List<QuerySchemeField> fields =new ArrayList<>(); List<QuerySchemeField> fields =new ArrayList<>();
if ("2".equals(queryRequest.getReasonType())){ //生产异常 // if ("2".equals(queryRequest.getReasonType())){ //生产异常
fields = // fields =
Arrays.asList( // Arrays.asList(
new QuerySchemeField("订单号", "VBELN", "string", 150L), // new QuerySchemeField("订单号", "VBELN", "string", 150L),
// new QuerySchemeField("订单描述", "KTEXT", "string", 160L), // // new QuerySchemeField("订单描述", "KTEXT", "string", 160L),
new QuerySchemeField("物料编码", "MATNR", "string", 160L), // new QuerySchemeField("物料编码", "MATNR", "string", 160L),
new QuerySchemeField("物料描述", "MAKTX", "string", 160L), // new QuerySchemeField("物料描述", "MAKTX", "string", 160L),
new QuerySchemeField("数量", "PSMNG", "string", 100L), // new QuerySchemeField("数量", "PSMNG", "string", 100L),
new QuerySchemeField("单位", "MEINS", "string", 100L) // new QuerySchemeField("单位", "MEINS", "string", 100L)
); // );
} else { // } else {
fields = // fields =
Arrays.asList( // Arrays.asList(
new QuerySchemeField("订单号", "VBELN", "string", 130L), // new QuerySchemeField("订单号", "VBELN", "string", 130L),
new QuerySchemeField("客户编号", "KUNNR", "string", 60L), // new QuerySchemeField("客户编号", "KUNNR", "string", 60L),
new QuerySchemeField("客户名称", "NAME1", "string", 150L) // new QuerySchemeField("客户名称", "NAME1", "string", 150L)
); // );
} // }
fields =
Arrays.asList(
new QuerySchemeField("订单号", "VBELN", "string", 130L),
new QuerySchemeField("客户编号", "KUNNR", "string", 60L),
new QuerySchemeField("客户名称", "NAME1", "string", 150L)
);
easySearchParse.setFields(fields); easySearchParse.setFields(fields);
easySearchParse.setWidth(500L); easySearchParse.setWidth(500L);
MemEasySearcher<Map<String, String>> memEasySearcher = new MemEasySearcherImpl<>(); MemEasySearcher<Map<String, String>> memEasySearcher = new MemEasySearcherImpl<>();
...@@ -768,4 +782,39 @@ public class ResourceSearchController { ...@@ -768,4 +782,39 @@ public class ResourceSearchController {
return model; return model;
} }
/**
* 查询异常分类明细
* @param sdo
* @return
*/
@EasySearch(queryName = "selectExceptionReasonTypeDetail")
public Map<String, Object> selectExceptionReasonTypeDetail(SDO sdo) {
String param = sdo.getString("paramValue");
List<Map<String, String>> mapList = new ArrayList<>();
List<Map<String, Object>> maps = exceptionReasonTypeDetailApplication.getReasonTypeDetailListMap(param);
String result = JSONUtil.toString(maps);
ObjectMapper objectMapper = SAPUtils.objectMapper();
try {
mapList = objectMapper.readValue(result, new TypeReference<List<Map<String, String>>>() {});
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
Integer intPage = sdo.getInteger("intPage", 1);
Integer pageSize = sdo.getInteger("pageSize",10);
PageRequest pageRequest = new PageRequest(intPage - 1, pageSize);
EasySearchParse easySearchParse = new EasySearchParse();
List<QuerySchemeField> fields =
Arrays.asList(
new QuerySchemeField("标准名称大类", "reasonTypeName", "string", 100L),
new QuerySchemeField("问题类型代码", "reasonTypeDetail", "string", 100L),
new QuerySchemeField("问题类型", "reasonTypeDetailName", "string", 200L),
new QuerySchemeField("序号(一级分类编码)", "reasonType", "hidden")
);
easySearchParse.setFields(fields);
easySearchParse.setWidth(500L);
MemEasySearcher<Map<String, String>> memEasySearcher = new MemEasySearcherImpl<>();
Map<String, Object> model = memEasySearcher.search(mapList, easySearchParse, pageRequest, null);
return model;
}
} }
package com.huigou.topsun.sap.exceptionReport.application;
import com.huigou.topsun.sap.exceptionReport.domain.ExceptionReasonTypeDetail;
import com.huigou.topsun.sap.exceptionReport.domain.query.ExceptionReasonTypeDetailQueryRequest;
import java.util.List;
import java.util.Map;
/**
* @author xin.lu
* @Description: TODO
* @date 2025/2/1115:25
*/
public interface ExceptionReasonTypeDetailApplication {
public static final String QUERY_XML_FILE_PATH = "config/topsun/sap/exceptionReport/exceptionReasonTypeDetail.xml";
ExceptionReasonTypeDetail save(ExceptionReasonTypeDetail exceptionReasonTypeDetail);
void delete(String id);
Map<String, Object> getReasonTypeDetailMap(ExceptionReasonTypeDetailQueryRequest queryRequest);
void deleteByIds(List<String> ids);
ExceptionReasonTypeDetail load(String id);
List<Map<String, Object>> getReasonTypeDetailListMap(String param);
}
package com.huigou.topsun.sap.exceptionReport.application.impl;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.sap.exceptionReport.application.ExceptionReasonTypeDetailApplication;
import com.huigou.topsun.sap.exceptionReport.domain.ExceptionReasonTypeDetail;
import com.huigou.topsun.sap.exceptionReport.domain.query.ExceptionReasonTypeDetailQueryRequest;
import com.huigou.topsun.sap.exceptionReport.repository.ExceptionReasonTypeDetailRepository;
import com.huigou.uasp.bmp.common.application.BaseApplication;
import com.huigou.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* @author xin.lu
* @Description: TODO
* @date 2025/2/1115:25
*/
@Service("exceptionReasonTypeDetailApplication")
public class ExceptionReasonTypeDetailApplicationImpl extends BaseApplication implements ExceptionReasonTypeDetailApplication {
@Autowired
private ExceptionReasonTypeDetailRepository exceptionReasonTypeDetailRepository;
@Override
public ExceptionReasonTypeDetail save(ExceptionReasonTypeDetail exceptionReasonTypeDetail) {
return exceptionReasonTypeDetailRepository.save(exceptionReasonTypeDetail);
}
@Override
public void delete(String id) {
exceptionReasonTypeDetailRepository.delete(id);
}
@Override
public Map<String, Object> getReasonTypeDetailMap(ExceptionReasonTypeDetailQueryRequest queryRequest) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "exceptionReasonTypeDetail");
QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
return this.sqlExecutorDao.executeSlicedQuery(queryModel);
}
@Override
public void deleteByIds(List<String> ids) {
ids.forEach(this::delete);
}
@Override
public ExceptionReasonTypeDetail load(String id) {
return exceptionReasonTypeDetailRepository.findOne(id);
}
@Override
public List<Map<String, Object>> getReasonTypeDetailListMap(String param) {
if (StringUtil.isNotBlank(param)){
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "exceptionReasonTypeDetailListByCondition");
String sql = queryDescriptor.getSql();
return this.sqlExecutorDao.queryToListMap(sql, param, param, param);
}else {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "exceptionReasonTypeDetailListNoCondition");
String sql = queryDescriptor.getSql();
return this.sqlExecutorDao.queryToListMap(sql);
}
}
}
package com.huigou.topsun.sap.exceptionReport.application.impl;
import com.huigou.topsun.sap.exceptionReport.domain.ExceptionReasonTypeDetail;
import com.huigou.topsun.sap.exceptionReport.domain.TmpExceptionReasonTypeDetail;
import com.huigou.topsun.sap.exceptionReport.repository.ExceptionReasonTypeDetailRepository;
import com.huigou.topsun.sap.exceptionReport.repository.TmpExceptionReasonTypeDetailRepository;
import com.huigou.uasp.tool.dataimport.application.ExcelImportInterface;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
@Service("reasonTypeDetailExcelImport")
public class ExceptionReasonTypeDetailExcelImport implements ExcelImportInterface {
@Autowired
private TmpExceptionReasonTypeDetailRepository tmpExceptionReasonTypeDetailRepository;
@Autowired
private ExceptionReasonTypeDetailRepository exceptionReasonTypeDetailRepository;
@Override
public void executeImport(String batchNumer) {
List<TmpExceptionReasonTypeDetail> tmpExceptionReasonTypeDetails = tmpExceptionReasonTypeDetailRepository.findByBatchNumber(batchNumer);
if (!CollectionUtils.isEmpty(tmpExceptionReasonTypeDetails)){
for (TmpExceptionReasonTypeDetail tmpExceptionReasonTypeDetail : tmpExceptionReasonTypeDetails) {
ExceptionReasonTypeDetail exceptionReasonTypeDetail = new ExceptionReasonTypeDetail();
BeanUtils.copyProperties(tmpExceptionReasonTypeDetail,exceptionReasonTypeDetail);
exceptionReasonTypeDetailRepository.save(exceptionReasonTypeDetail);
}
}
System.out.println("=========================");
}
}
package com.huigou.topsun.sap.exceptionReport.controller;
import com.huigou.topsun.sap.exceptionReport.application.ExceptionReasonTypeDetailApplication;
import com.huigou.topsun.sap.exceptionReport.domain.ExceptionReasonTypeDetail;
import com.huigou.topsun.sap.exceptionReport.domain.query.ExceptionReasonTypeDetailQueryRequest;
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.List;
import java.util.Map;
/**
* @author xin.lu
* @Description: TODO
* @date 2025/2/1116:01
*/
@Controller
@ControllerMapping("/exceptionReasonTypeDetail")
public class ExceptionReasonTypeDetailController extends CommonController {
@Autowired
private ExceptionReasonTypeDetailApplication exceptionReasonTypeDetailApplication;
@Override
protected String getPagePath() {
return "/biz/topsun/sap/exceptionReport/";
}
/**
* 跳转到异常原因分类明细查询页面
* @return
*/
public String forwardExceptionReasonTypeDetailList(){
return forward("exceptionReasonTypeDetailList");
}
/**
* 条件查询异常原因分类明细
* @return
*/
public String slicedExceptionReasonTypeDetailList(){
SDO sdo = this.getSDO();
ExceptionReasonTypeDetailQueryRequest queryRequest = sdo.toQueryRequest(ExceptionReasonTypeDetailQueryRequest.class);
Map<String, Object> map = exceptionReasonTypeDetailApplication.getReasonTypeDetailMap(queryRequest);
return toResult(map);
}
public String showInsertExceptionReasonTypeDetail(){
return forward("insertExceptionReasonTypeDetail");
}
/**
* 保存异常原因分类明细
* @return
*/
public String savedExceptionReasonTypeDetail(){
SDO sdo = this.getSDO();
ExceptionReasonTypeDetail exceptionReasonTypeDetail = sdo.toObject( ExceptionReasonTypeDetail.class);
return toResult(exceptionReasonTypeDetailApplication.save(exceptionReasonTypeDetail));
}
public String showUpdateExceptionReasonTypeDetail(){
SDO sdo = this.getSDO();
String id = sdo.getString("id");
ExceptionReasonTypeDetail exceptionReasonTypeDetail = exceptionReasonTypeDetailApplication.load(id);
return forward("insertExceptionReasonTypeDetail",exceptionReasonTypeDetail);
}
/**
* 批量删除
* @return
*/
public String deleteExceptionReasonTypeDetail(){
SDO sdo = this.getSDO();
List<String> ids = sdo.getIds();
exceptionReasonTypeDetailApplication.deleteByIds(ids);
return success();
}
}
package com.huigou.topsun.sap.exceptionReport.domain;
import com.huigou.data.domain.model.AbstractEntity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @author xin.lu
* @Description: TODO
* @date 2025/2/1115:19
* 异常分类原因明细
*/
@Entity
@Table(name = "sap_exception_reason_type_detail")
@Data
public class ExceptionReasonTypeDetail extends AbstractEntity {
@Column(name = "reason_type")
private String reasonType;
@Column(name = "reason_type_name")
private String reasonTypeName;
@Column(name = "reason_type_detail")
private String reasonTypeDetail;
@Column(name = "reason_type_detail_name")
private String reasonTypeDetailName;
}
...@@ -214,6 +214,15 @@ public class ExceptionReport extends FlowBillAbstractEntity { ...@@ -214,6 +214,15 @@ public class ExceptionReport extends FlowBillAbstractEntity {
@Column(name = "produce_no") @Column(name = "produce_no")
private String produceNo; private String produceNo;
@Column(name = "reason_type_name")
private String reasonTypeName;
@Column(name = "reason_type_detail")
private String reasonTypeDetail;
@Column(name = "reason_type_detail_name")
private String reasonTypeDetailName;
@Override @Override
protected String getCodeRuleId() { protected String getCodeRuleId() {
return "exceptionReport"; return "exceptionReport";
......
...@@ -117,4 +117,28 @@ public class ExceptionReportItem extends AbstractEntity { ...@@ -117,4 +117,28 @@ public class ExceptionReportItem extends AbstractEntity {
*/ */
@Column(name = "exchange_rate") @Column(name = "exchange_rate")
private BigDecimal exchangeRate; private BigDecimal exchangeRate;
/**
* 运输费
*/
@Column(name = "freight")
private BigDecimal freight;
/**
* 返工费
*/
@Column(name = "rework")
private BigDecimal rework;
/**
* 停工待料费
*/
@Column(name = "stop_wait_material")
private BigDecimal stopWaitMaterial;
/**
* 开机费
*/
@Column(name = "startup_fee")
private BigDecimal startupFee;
} }
package com.huigou.topsun.sap.exceptionReport.domain;
import com.huigou.topsun.common.AbstractPortalOrg;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @author xin.lu
* @Description: TODO
* @date 2025/2/1115:19
*/
@Entity
@Table(name = "tmp_exception_reason_type_detail")
@Data
public class TmpExceptionReasonTypeDetail extends AbstractPortalOrg {
/**
* 序号(一级分类编码)
*/
@Column(name = "reason_type")
private String reasonType;
/**
* 一级分类名称
*/
@Column(name = "reason_type_name")
private String reasonTypeName;
/**
* 二级分类编码
*/
@Column(name = "reason_type_detail")
private String reasonTypeDetail;
/**
* 二级分类名称
*/
@Column(name = "reason_type_detail_name")
private String reasonTypeDetailName;
}
package com.huigou.topsun.sap.exceptionReport.domain.query;
import com.huigou.data.domain.query.QueryAbstractRequest;
import lombok.Data;
/**
* @author xin.lu
* @Description: TODO
* @date 2025/2/1115:19
*/
@Data
public class ExceptionReasonTypeDetailQueryRequest extends QueryAbstractRequest {
private String no;
private String reasonType;
private String reasonTypeName;
private String reasonTypeDetail;
private String reasonTypeDetailName;
}
...@@ -24,5 +24,6 @@ public class ExceptionReportQueryRequest extends QueryAbstractRequest { ...@@ -24,5 +24,6 @@ public class ExceptionReportQueryRequest extends QueryAbstractRequest {
private String billCode; private String billCode;
private String exceptionReasonType; private String exceptionReasonType;
private String urgency; private String urgency;
private String productType;
} }
package com.huigou.topsun.sap.exceptionReport.repository;
import com.huigou.topsun.sap.exceptionReport.domain.ExceptionReasonTypeDetail;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* @author xin.lu
* @Description: TODO
* @date 2025/2/1115:19
*/
public interface ExceptionReasonTypeDetailRepository extends JpaRepository<ExceptionReasonTypeDetail,String> {
}
package com.huigou.topsun.sap.exceptionReport.repository;
import com.huigou.topsun.sap.exceptionReport.domain.TmpExceptionReasonTypeDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* @author xin.lu
* @Description: TODO
* @date 2025/2/1115:19
*/
public interface TmpExceptionReasonTypeDetailRepository extends JpaRepository<TmpExceptionReasonTypeDetail,String> {
List<TmpExceptionReasonTypeDetail> findByBatchNumber(String batchNumber);
}
<?xml version="1.0" encoding="UTF-8" ?>
<query-mappings>
<query name="exceptionReasonTypeDetail" label="异常原因分类" table="sap_exception_report">
<sql-query>
select t.* from sap_exception_reason_type_detail t
</sql-query>
<condition column="reason_type" name="reasonType" type="java.lang.String" symbol="=" alias="t"/>
<condition column="reason_type_name" name="reasonTypeName" type="java.lang.String" symbol="like" alias="t"/>
<condition column="reason_type_detail" name="reasonTypeDetail" type="java.lang.String" symbol="like" alias="t"/>
<condition column="reason_type_detail_name" name="reasonTypeDetailName" type="java.lang.String" symbol="like" alias="t"/>
</query>
<query name="exceptionReasonTypeDetailListByCondition" label="异常原因分类" table="sap_exception_report">
<sql-query>
select t.* from sap_exception_reason_type_detail t
where t.reason_type_name like concat('%',?,'%')
or t.reason_type_detail like concat('%',?,'%')
or t.reason_type_detail_name like concat('%',?,'%')
</sql-query>
</query>
<query name="exceptionReasonTypeDetailListNoCondition" label="异常原因分类" table="sap_exception_report">
<sql-query>
select t.* from sap_exception_reason_type_detail t
</sql-query>
</query>
</query-mappings>
\ No newline at end of file
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<condition column="report_date" name="endDate" type="java.util.Date" symbol="&lt;=" alias="t"/> <condition column="report_date" name="endDate" type="java.util.Date" symbol="&lt;=" alias="t"/>
<condition column="exception_reason_type" name="exceptionReasonType" type="java.lang.String" symbol="=" alias="t"/> <condition column="exception_reason_type" name="exceptionReasonType" type="java.lang.String" symbol="=" alias="t"/>
<condition column="urgency" name="urgency" type="java.lang.String" symbol="=" alias="t"/> <condition column="urgency" name="urgency" type="java.lang.String" symbol="=" alias="t"/>
<condition column="product_type" name="productType" type="java.lang.String" symbol="=" alias="t"/>
</query> </query>
......
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