Commit 4afb0917 authored by 1650842865's avatar 1650842865

品质异常报告导出主表及明细

parent 171e7d25
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
<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:inputC name="reasonTypeDetailName" label="异常问题类型" labelCol="1" fieldCol="2" required="true" wrapper="select"/>
<x:hidden name="reasonTypeDetail"/> <x:inputC name="reasonTypeDetail" label="异常问题类型代码" labelCol="1" fieldCol="2" readonly="true" />
<x:hidden name="reasonTypeName"/> <x:inputC name="reasonTypeName" label="异常问题一级分类" labelCol="1" fieldCol="2" readonly="true"/>
<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"/-->
......
...@@ -22,7 +22,7 @@ function initGrid() { ...@@ -22,7 +22,7 @@ function initGrid() {
}); });
} }
}, },
//exportExcelHandler: exportExcelHandler, exportExcelHandler: exportExcelHandler,
/* addPurchaseHandler: {id: 'purchaseException', text: '添加采购异常单', img: 'fa-building-o', className: 'btn-gray', /* addPurchaseHandler: {id: 'purchaseException', text: '添加采购异常单', img: 'fa-building-o', className: 'btn-gray',
click: function () { click: function () {
UICtrl.addTabItem({ UICtrl.addTabItem({
...@@ -43,44 +43,7 @@ function initGrid() { ...@@ -43,44 +43,7 @@ function initGrid() {
}*/ }*/
}); });
gridManager = UICtrl.grid('#maingrid', { gridManager = UICtrl.grid('#maingrid', {
columns: [ columns: getColumns(),
{display: "状态", name: "statusTextView", width: "60", align: "left", type: "string"}
, {display: "id", name: "id", width: "100", align: "left", type: "string", hide: true}
, {display: "报告编号", name: "billCode", width: 150, minWidth: 60, type: "string", align: "center"}
, {display: "异常类型", name: "exceptionTypeTextView", width: 80, minWidth: 60, type: "string", align: "center"}
/*, {display: "单据类型", name: "billType", width: 80, minWidth: 60, type: "string", align: "center",
render: function (item) {
if (item.billType=="supplier"){
return "供应商";
} else if (item.billType=="purchase"){
return "采购";
} else if (item.billType=="outgoing"){
return " 外发";
} else {
return "生产";
}
}
} */
, {display: "异常原因分类", name: "exceptionReasonTypeTextView", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "处理方式", name: "dealWayTextView", width: 150, minWidth: 60, type: "string", align: "center"}
, {display: "呈报日期", name: "reportDate", width: 100, minWidth: 60, type: "date", align: "center"}
, {display: "异常日期", name: "exceptionDate", width: 100, minWidth: 60, type: "date", align: "center"}
// , {display: "异常标题", name: "exceptionTitle", width: 200, minWidth: 60, type: "date", align: "center"}
// , {display: "客户编号", name: "customerName", width: 200, minWidth: 60, type: "date", align: "center"}
, {display: "客户名称", name: "customerName", width: 200, minWidth: 60, type: "string", align: "center"}
, {display: "客户单号", name: "customerOrderNo", width: 180, minWidth: 60, type: "string", align: "center"}
, {display: "紧急程度", name: "urgencyTextView", width: 80, minWidth: 60, type: "string", align: "center"}
, {display: "改善措施", name: "dealMethod", width: 200, minWidth: 60, type: "string", align: "center"}
, {display: "异常原因", name: "exceptionReason", width: 200, minWidth: 60, type: "string", align: "center"}
, {display: "责任部门", name: "dutyDeptName", width: 120, minWidth: 60, type: "string", align: "center"}
, {display: "责任人", name: "checkOperatorName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "处理结果", name: "dealResult", width: 200, minWidth: 60, type: "string", align: "center"}
//, {display: "备注", name: "remark", width: 200, minWidth: 60, type: "date", align: "center"}
, {display: "创建日期", name: "fillinDate", width: 150, minWidth: 60, type: "dateTime", align: "center"}
, {display: "创建部门", name: "deptName", width: 120, minWidth: 60, type: "string", align: "center"}
, {display: "创建人", name: "personMemberName", width: 100, minWidth: 60, type: "string", align: "center"}
],
dataAction: 'server', dataAction: 'server',
url: web_app.name + '/exceptionReport/slicedExceptionReportList.ajax?', url: web_app.name + '/exceptionReport/slicedExceptionReportList.ajax?',
//parms: {requireItemId: $("#prepareItemId").val()}, //parms: {requireItemId: $("#prepareItemId").val()},
...@@ -89,8 +52,8 @@ function initGrid() { ...@@ -89,8 +52,8 @@ function initGrid() {
height: '100%', height: '100%',
pageSize: 100, pageSize: 100,
heightDiff: -4, heightDiff: -4,
//sortName: 'lastModifiedDate', sortName: 'fillinDate',
//sortOrder: 'desc', sortOrder: 'desc',
checkbox: true, checkbox: true,
usePager: true, usePager: true,
rownumbers: true, rownumbers: true,
...@@ -116,6 +79,51 @@ function initGrid() { ...@@ -116,6 +79,51 @@ function initGrid() {
UICtrl.setSearchAreaToggle(gridManager); UICtrl.setSearchAreaToggle(gridManager);
} }
function getColumns(){
var columns = [
{display: "状态", name: "statusTextView", width: "60", align: "left", type: "string"}
, {display: "id", name: "id", width: "100", align: "left", type: "string", hide: true}
, {display: "报告编号", name: "billCode", width: 150, minWidth: 60, type: "string", align: "center"}
, {display: "工厂", name: "werksName", width: 150, minWidth: 60, type: "string", align: "center"}
, {display: "异常类型", name: "exceptionTypeTextView", width: 80, minWidth: 60, type: "string", align: "center"}
, {display: "紧急程度", name: "urgencyTextView", width: 80, minWidth: 60, type: "string", align: "center"}
, {display: "原因分类", name: "exceptionReasonTypeTextView", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "异常问题类型", name: "reasonTypeDetailName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "异常问题类型代码", name: "reasonTypeDetail", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "异常问题一级分类", name: "reasonTypeName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "产品类别", name: "productTypeName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "异常日期", name: "exceptionDate", width: 100, minWidth: 60, type: "date", align: "center"}
, {display: "客户是否需要改善报告", name: "needImproveReportTextView", width: 150, minWidth: 60, type: "string", align: "center"}
, {display: "客户是否需要保证书", name: "needGuaranteeTextView", width: 150, minWidth: 60, type: "string", align: "center"}
, {display: "处理方式", name: "dealWayTextView", width: 150, minWidth: 60, type: "string", align: "center"}
, {display: "呈报日期", name: "reportDate", width: 100, minWidth: 60, type: "date", align: "center"}
, {display: "客户编号", name: "customerNo", width: 200, minWidth: 60, type: "date", align: "center"}
, {display: "客户名称", name: "customerName", width: 200, minWidth: 60, type: "string", align: "center"}
, {display: "客户订单号", name: "customerOrderNo", width: 180, minWidth: 60, type: "string", align: "center"}
, {display: "生产单号", name: "produceNo", width: 180, minWidth: 60, type: "string", align: "center"}
, {display: "品牌名称", name: "brandName", width: 180, minWidth: 60, type: "string", align: "center"}
, {display: "问题发生次数", name: "problemTimes", width: 180, minWidth: 60, type: "string", align: "center"}
, {display: "赔付金额", name: "payMoney", width: 180, minWidth: 60, type: "string", align: "center"}
, {display: "损失金额", name: "loseMoney", width: 180, minWidth: 60, type: "string", align: "center"}
, {display: "异常陈诉", name: "exceptionState", width: 300, minWidth: 60, type: "string", align: "center"}
, {display: "异常原因", name: "exceptionReason", width: 200, minWidth: 60, type: "string", align: "center"}
, {display: "改善措施", name: "dealMethod", width: 200, minWidth: 60, type: "string", align: "center"}
, {display: "处理部门", name: "dutyDeptName", width: 120, minWidth: 60, type: "string", align: "center"}
, {display: "处理人", name: "checkOperatorName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "处理结果", name: "dealResult", width: 200, minWidth: 60, type: "string", align: "center"}
, {display: "单位主管", name: "manager", width: 120, minWidth: 60, type: "string", align: "center"}
, {display: "副理", name: "deputyManager", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "经理", name: "generalManager", width: 200, minWidth: 60, type: "string", align: "center"}
, {display: "备注", name: "remark", width: 200, minWidth: 60, type: "date", align: "center"}
, {display: "创建日期", name: "fillinDate", width: 150, minWidth: 60, type: "dateTime", align: "center"}
, {display: "创建部门", name: "deptName", width: 120, minWidth: 60, type: "string", align: "center"}
, {display: "创建人", name: "personMemberName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "产品编码", name: "productCode", width: 100, minWidth: 60, hide: true}
, {display: "产品名称", name: "productName", width: 100, minWidth: 60, hide: true}
]
return columns;
}
function bindEvents() { function bindEvents() {
//产品类别 //产品类别
$('#productTypeName').searchbox({ $('#productTypeName').searchbox({
...@@ -220,6 +228,72 @@ function resetForm(obj) { ...@@ -220,6 +228,72 @@ function resetForm(obj) {
//导出Excel //导出Excel
function exportExcelHandler() { function exportExcelHandler() {
UICtrl.gridExport(gridManager); UICtrl.setGridColumns(gridManager,getExportColumns());
var date = Public.formatDate(new Date(),`%Y%M%D%H%I%S`);
UICtrl.gridExport(gridManager,{fileName:"异常报告"+date});
UICtrl.setGridColumns(gridManager,getColumns());
}
function getExportColumns() {
var columns = [
{display: "报告编号", name: "billCode", width: 150, minWidth: 60, type: "string", align: "center"}
, {display: "创建日期", name: "fillinDate", width: 150, minWidth: 60, type: "dateTime", align: "center"}
, {display: "创建人", name: "personMemberName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "工厂", name: "werksName", width: 150, minWidth: 60, type: "string", align: "center"}
, {display: "异常类型", name: "exceptionTypeTextView", width: 80, minWidth: 60, type: "string", align: "center"}
, {display: "紧急程度", name: "urgencyTextView", width: 80, minWidth: 60, type: "string", align: "center"}
, {display: "原因分类", name: "exceptionReasonTypeTextView", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "异常问题类型", name: "reasonTypeDetailName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "异常问题类型代码", name: "reasonTypeDetail", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "异常问题一级分类", name: "reasonTypeName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "产品类别", name: "productTypeName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "异常日期", name: "exceptionDate", width: 100, minWidth: 60, type: "date", align: "center"}
, {display: "客户是否需要改善报告", name: "needImproveReportTextView", width: 150, minWidth: 60, type: "string", align: "center"}
, {display: "客户是否需要保证书", name: "needGuaranteeTextView", width: 150, minWidth: 60, type: "string", align: "center"}
, {display: "处理方式", name: "dealWayTextView", width: 150, minWidth: 60, type: "string", align: "center"}
, {display: "呈报日期", name: "reportDate", width: 100, minWidth: 60, type: "date", align: "center"}
, {display: "客户编号", name: "customerNo", width: 200, minWidth: 60, type: "date", align: "center"}
, {display: "客户名称", name: "customerName", width: 200, minWidth: 60, type: "string", align: "center"}
, {display: "客户订单号", name: "customerOrderNo", width: 180, minWidth: 60, type: "string", align: "center"}
, {display: "生产单号", name: "produceNo", width: 180, minWidth: 60, type: "string", align: "center"}
, {display: "品牌名称", name: "brandName", width: 180, minWidth: 60, type: "string", align: "center"}
, {display: "问题发生次数", name: "problemTimes", width: 180, minWidth: 60, type: "string", align: "center"}
, {display: "赔付金额", name: "payMoney", width: 180, minWidth: 60, type: "string", align: "center"}
, {display: "损失金额", name: "loseMoney", width: 180, minWidth: 60, type: "string", align: "center"}
, {display: "异常陈诉", name: "exceptionState", width: 300, minWidth: 60, type: "string", align: "center"}
, {display: "异常原因", name: "exceptionReason", width: 200, minWidth: 60, type: "string", align: "center"}
, {display: "改善措施", name: "dealMethod", width: 200, minWidth: 60, type: "string", align: "center"}
, {display: "处理部门", name: "dutyDeptName", width: 120, minWidth: 60, type: "string", align: "center"}
, {display: "处理人", name: "checkOperatorName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "处理结果", name: "dealResult", width: 200, minWidth: 60, type: "string", align: "center"}
, {display: "单位主管", name: "manager", width: 120, minWidth: 60, type: "string", align: "center"}
, {display: "副理", name: "deputyManager", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "经理", name: "generalManager", width: 200, minWidth: 60, type: "string", align: "center"}
, {display: "备注", name: "remark", width: 200, minWidth: 60, type: "date", align: "center"}
, {display: "产品编码", name: "productCode", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "产品名称", name: "productName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "单位", name: "unit", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "单位描述", name: "unitName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "币别", name: "currencyName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "单价", name: "price", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "数量", name: "number", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "金额", name: "money", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "民币金额", name: "rmbMoney", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "出货日期", name: "sendDate", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "异常数量", name: "exceptionNumber", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "汇率", name: "exchangeRate", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "运输费", name: "freight", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "返工费", name: "rework", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "停工待料费", name: "stopWaitMaterial", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "开机费", name: "startupFee", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "工号/客户编码", name: "personNo", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "姓名/客户名", name: "personName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "部门名称", name: "deptName", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "定责比例", name: "dutyRate", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "个人责任比例", name: "personDutyRate", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "责任金额", name: "dutyMoney", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "备注", name: "dutyRemark", width: 100, minWidth: 60, type: "string", align: "center"}
]
return columns;
} }
...@@ -19,6 +19,7 @@ public interface ExceptionReportApplication { ...@@ -19,6 +19,7 @@ public interface ExceptionReportApplication {
String PROCESS_DEFINITION_KEY = "exceptionReportProc"; String PROCESS_DEFINITION_KEY = "exceptionReportProc";
Map<String,Object> slicedExceptionReportList(ExceptionReportQueryRequest queryRequest); Map<String,Object> slicedExceptionReportList(ExceptionReportQueryRequest queryRequest);
Map<String,Object> slicedExceptionReportExportList(ExceptionReportQueryRequest queryRequest);
ExceptionReport findById(String id); ExceptionReport findById(String id);
......
...@@ -124,7 +124,16 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except ...@@ -124,7 +124,16 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except
// queryModel.addCriteria(" and t.report_date <=:endDate"); // queryModel.addCriteria(" and t.report_date <=:endDate");
// queryModel.putParam("endDate", queryRequest.getEndDate()); // queryModel.putParam("endDate", queryRequest.getEndDate());
// } // }
queryModel.addCriteria(" order by bill_code desc "); queryModel.putDictionary("status", BizBillStatus.getMap());
queryModel.putDictionary("needImproveReport",DictUtil.getDictionary("yesorno"));
queryModel.putDictionary("needGuarantee",DictUtil.getDictionary("yesorno"));
return this.sqlExecutorDao.executeSlicedQuery(queryModel);
}
@Override
public Map<String, Object> slicedExceptionReportExportList(ExceptionReportQueryRequest queryRequest) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "exceptionReportExport");
QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
queryModel.putDictionary("status", BizBillStatus.getMap()); queryModel.putDictionary("status", BizBillStatus.getMap());
return this.sqlExecutorDao.executeSlicedQuery(queryModel); return this.sqlExecutorDao.executeSlicedQuery(queryModel);
} }
......
...@@ -67,7 +67,12 @@ public class ExceptionReportController extends CommonController { ...@@ -67,7 +67,12 @@ public class ExceptionReportController extends CommonController {
public String slicedExceptionReportList(){ public String slicedExceptionReportList(){
SDO sdo = this.getSDO(); SDO sdo = this.getSDO();
ExceptionReportQueryRequest queryRequest = sdo.toQueryRequest(ExceptionReportQueryRequest.class); ExceptionReportQueryRequest queryRequest = sdo.toQueryRequest(ExceptionReportQueryRequest.class);
Map<String, Object> map = exceptionReportApplication.slicedExceptionReportList(queryRequest); Map<String, Object> map = new HashMap<>();
if (ObjectUtils.isEmpty(sdo.getProperty("exportHead"))) {
map = exceptionReportApplication.slicedExceptionReportList(queryRequest);
}else {
map = exceptionReportApplication.slicedExceptionReportExportList(queryRequest);
}
return toResult(map); return toResult(map);
} }
......
...@@ -53,4 +53,102 @@ ...@@ -53,4 +53,102 @@
</sql-query> </sql-query>
<condition column="exception_report_id" name="exceptionReportId" type="java.lang.String" symbol="like" alias="t"/> <condition column="exception_report_id" name="exceptionReportId" type="java.lang.String" symbol="like" alias="t"/>
</query> </query>
<query name="exceptionReportExport" label="品质异常报告" table="sap_exception_report">
<sql-query>
SELECT
t.fillin_date,
t.bill_code,
t.person_member_name,
t.exception_type,
t.report_date,
t.werks,
t.werks_name,
t.customer_no,
t.customer_name,
t.customer_order_no,
t.exception_state,
t.exception_reason,
t.deal_method,
t.duty_dept,
t.duty_dept_name,
t.check_operator,
t.check_operator_name,
t.deal_result,
t.manager,
t.deputy_manager,
t.general_manager,
t.remark,
t.attbiz_id,
t.pay_money,
t.lose_money,
t.bill_type,
t.exception_title,
t.exception_reason_type,
t.appeal_no,
t.urgency,
t.exception_date,
t.problem_times,
t.brand_name,
t.need_improve_report,
t.need_guarantee,
t.matnr,
t.maktx,
t.deal_way,
t.sap_bill_no,
t.handle_node_id,
t.handle_node_name,
t.product_type,
t.source_bill_code,
t.product_type_name,
<!--t.produce_no,-->
t.reason_type_name,
t.reason_type_detail,
t.reason_type_detail_name,
i.produce_no,
<!--i.product_type,-->
i.product_code,
i.product_name,
i.unit,
i.unit_name,
i.currency,
i.currency_name,
i.price,
i.number,
i.money,
i.rmb_money,
i.send_date,
i.reason_type,
i.exception_number,
i.exchange_rate,
i.freight,
i.stop_wait_material,
i.rework,
i.startup_fee,
p.person_no,
p.person_name,
p.dept_name,
p.duty_rate,
p.person_duty_rate,
p.duty_money,
p.duty_remark
FROM sap_exception_report t
LEFT JOIN sap_exception_report_item i ON t.id = i.exception_report_id
LEFT JOIN sap_exception_duty_person p ON t.id = p.exception_report_id where 1=1
</sql-query>
<condition column="bill_code" name="billCode" type="java.lang.String" symbol="like" alias="t"/>
<condition column="customer_name" name="customerName" type="java.lang.String" symbol="like" alias="t"/>
<condition column="status" name="status" type="java.lang.String" symbol="=" alias="t"/>
<condition column="customer_order_no" name="customerOrderNo" type="java.lang.String" symbol="like" alias="t"/>
<condition column="dept_name" name="deptName" type="java.lang.String" symbol="like" alias="t"/>
<condition column="person_member_name" name="personMemberName" type="java.lang.String" symbol="like" alias="t"/>
<condition column="check_operator_name" name="checkOperatorName" type="java.lang.String" symbol="like" alias="t"/>
<condition column="duty_dept_name" name="dutyDeptName" type="java.lang.String" symbol="like" alias="t"/>
<condition column="report_date" name="startDate" type="java.util.Date" symbol="&gt;=" 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="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-mappings> </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