Commit db374b8b authored by 鲁鑫's avatar 鲁鑫

工艺管理查询、新增页面

parent 91b72ed0
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<value>i18n/messages</value> <value>i18n/messages</value>
<value>i18n/pages</value> <value>i18n/pages</value>
<value>i18n/common</value> <value>i18n/common</value>
<value>i18n/ssrf</value> <!--<value>i18n/ssrf</value>-->
</list> </list>
</property> </property>
</bean> </bean>
......
var processGridManager = null;
$(document).ready(function () {
loadProcessListGrid();
});
function loadProcessListGrid(){
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function(){
UICtrl.addGridRow(processGridManager);
},
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#processListGrid');
DataUtil.delSelectedRows({
action: 'technologyProcess/deleteTechnologyProcess.ajax',
param: {},
gridManager: _grid,
idFieldName: 'technologyId',
onSuccess: function () {
reloadGrid();
}
});
}
});
processGridManager = UICtrl.grid("#processListGrid", {
columns: [
{ display: "工序名称", name: "processName", width: 120, minWidth: 60, type: "string", align: "left",
editor: {
required: true,
type: 'text'
}
},
{ display: "工序类别", name: "processTypeTextView", width: 120, minWidth: 60, type: "string", align: "left",
editor : {
type : 'combobox',
data : $("#processType").combox('getJSONData'),
required : true,
valueField : 'processType'
}},
{ display: "工时", name: "workHours", width: 120, minWidth: 60, type: "number", align: "left",
editor: {
required: true,
type: 'text',
mask: 'positiveMoney'
}},
{ display: "工序内容", name: "processContent", width: 180, minWidth: 60, type: "string", align: "left",
editor: {
required: true,
type: 'text'
}},
{ display: "工序说明", name: "processRemark", width: 180, minWidth: 60, type: "string", align: "left",
editor: {
required: true,
type: 'text'
}
},
],
dataAction: "server",
url: web_app.name + '/technologyProcess/slicedTechnologyProcessList.ajax',
param:{technologyId:$("#technologyId").val()},
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
enabledEdit: true,
width: "100%",
height: 500,
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
onDblClickRow : function(data, rowindex, rowobj) {
updateHandler(data.id);
}
});
UICtrl.setSearchAreaToggle(processGridManager);
}
<%@ 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"%>
<head>
<x:script src='/biz/topsun/technology/technologyDetail.js'/>
</head>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="technologyId" />
<x:hidden name="productId"/>
<div class="hg-form-row">
<x:inputC name="technologyName" required="true" label="工艺路线名称" labelCol="2" maxLength="64" fieldCol="4" />
<x:selectC name="technologyType" required="true" label="工艺类型" labelCol="2" dictionary="technologyType" fieldCol="4" />
<x:inputC name="technologyVersion" required="false" readonly="true" label="工艺版本" labelCol="2" maxLength="32" fieldCol="4" />
</div>
<div class="blank_div clearfix"></div>
<x:title title="工序设置" name="group" hideTable="#info" />
<div id="processListGrid" style="margin: 2px;"></div>
</form>
\ No newline at end of file
var gridManager = null;
$(document).ready(function() {
initializateUI();
loadTechnologyListGrid();
});
function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3});
}
function loadTechnologyListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function(){
addHandler();
},
updateHandler: function(){
updateHandler();
},
deleteHandler: deleteHandler,
});
gridManager = UICtrl.grid("#technologyListGrid", {
columns: [
{ display: "工艺路线名称", name: "technologyName", width: 140, minWidth: 60, type: "string", align: "left" },
{ display: "产品ID", name: "productId", width: 120, minWidth: 60, type: "string", align: "left" },
{ display: "工艺版本", name: "technologyVersion", width: 120, minWidth: 60, type: "string", align: "left" },
{ display: "工艺类型", name: "technologyTypeTextView", width: 100, minWidth: 60, type: "string", align: "left" },
],
dataAction: "server",
url: web_app.name + '/technology/slicedTechnologyList.ajax',
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
width: "100%",
height: "100%",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
onDblClickRow : function(data, rowindex, rowobj) {
updateHandler(data.id);
}
});
UICtrl.setSearchAreaToggle(gridManager);
}
function query(obj) {
var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param);
}
function reloadGrid() {
gridManager.loadData();
}
function resetForm(obj) {
$(obj).formClean();
}
function addHandler(){
UICtrl.showAjaxDialog({
url: web_app.name + '/technology/addTechnologyDetail.load',
title: "新增工艺设置",
width: 800,
ok: function(div){
var _self=this;
$('#submitForm',div).ajaxSubmit({url: web_app.name + '/technology/saveTechnology.ajax',
success : function() {
_self.close();
reloadGrid();
}
});
}
});
}
function updateHandler(technologyId){
if(!technologyId){
var technologyId = DataUtil.getUpdateRowId(gridManager);
if (!technologyId){ return; }
}
UICtrl.showAjaxDialog({
url: web_app.name + '/technology/showTechnologyDetail.load',
title: "修改工艺设置",
width: 1000,
param:{technologyId:technologyId},
ok: function(div){
var _self=this;
$('#submitForm',div).ajaxSubmit({url: web_app.name + '/technology/updateTechnology.ajax',
success : function() {
_self.close();
reloadGrid();
}
});
}
});
}
//删除按钮
function deleteHandler() {
DataUtil.del({
action: 'technology/deleteTechnologyByTechnologyId.ajax',
gridManager: gridManager, idFieldName: 'technologyProcessId',
onSuccess: function () {
reloadGrid();
}
});
}
<%@ 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" />
<x:script src='/biz/topsun/technology/technologyList.js'/>
</head>
<body>
<div class="container-fluid">
<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="ruleKind" required="false" label="工艺名称" labelCol="1"/>
<x:searchButtons />
</form>
<div class="blank_div clearfix"></div>
<div id="technologyListGrid" style="margin: 2px;"></div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application;
* @description 针对表【brand(品牌)】的数据库操作Service * @description 针对表【brand(品牌)】的数据库操作Service
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
public interface BrandService { public interface BrandApplication {
} }
...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application;
* @description 针对表【color(颜色)】的数据库操作Service * @description 针对表【color(颜色)】的数据库操作Service
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
public interface ColorService { public interface ColorApplication {
} }
...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application;
* @description 针对表【factory(生产工厂)】的数据库操作Service * @description 针对表【factory(生产工厂)】的数据库操作Service
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
public interface FactoryService { public interface FactoryApplication {
} }
...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application;
* @description 针对表【product(产品)】的数据库操作Service * @description 针对表【product(产品)】的数据库操作Service
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
public interface ProductService { public interface ProductApplication {
} }
...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application;
* @description 针对表【product_category(产品类别)】的数据库操作Service * @description 针对表【product_category(产品类别)】的数据库操作Service
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
public interface ProductCategoryService { public interface ProductCategoryApplication {
} }
...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application;
* @description 针对表【product_detail(产品详细信息)】的数据库操作Service * @description 针对表【product_detail(产品详细信息)】的数据库操作Service
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
public interface ProductDetailService { public interface ProductDetailApplication {
} }
...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application;
* @description 针对表【product_face(产品版面信息)】的数据库操作Service * @description 针对表【product_face(产品版面信息)】的数据库操作Service
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
public interface ProductFaceService { public interface ProductFaceApplication {
} }
...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application;
* @description 针对表【product_face_color(产品版面颜色)】的数据库操作Service * @description 针对表【product_face_color(产品版面颜色)】的数据库操作Service
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
public interface ProductFaceColorService { public interface ProductFaceColorApplication {
} }
...@@ -8,7 +8,7 @@ import com.huigou.topsun.product.domain.ProductLooked; ...@@ -8,7 +8,7 @@ import com.huigou.topsun.product.domain.ProductLooked;
* @description 针对表【product_looked(产品外观)】的数据库操作Service * @description 针对表【product_looked(产品外观)】的数据库操作Service
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
public interface ProductLookedService { public interface ProductLookedApplication {
public ProductLooked getProductLookedById(String productLookedId); public ProductLooked getProductLookedById(String productLookedId);
......
...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application;
* @description 针对表【product_loss(产品loss配置)】的数据库操作Service * @description 针对表【product_loss(产品loss配置)】的数据库操作Service
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
public interface ProductLossService { public interface ProductLossApplication {
} }
...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application;
* @description 针对表【product_material(产品物料组成)】的数据库操作Service * @description 针对表【product_material(产品物料组成)】的数据库操作Service
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
public interface ProductMaterialService { public interface ProductMaterialApplication {
} }
...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application;
* @description 针对表【product_published_conf(产品打样排版参数配置)】的数据库操作Service * @description 针对表【product_published_conf(产品打样排版参数配置)】的数据库操作Service
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
public interface ProductPublishedConfService { public interface ProductPublishedConfApplication {
} }
...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.product.application;
* @description 针对表【product_typeset_conf(产品排版配置ID)】的数据库操作Service * @description 针对表【product_typeset_conf(产品排版配置ID)】的数据库操作Service
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
public interface ProductTypesetConfService { public interface ProductTypesetConfApplication {
} }
package com.huigou.topsun.product.application.impl; package com.huigou.topsun.product.application.impl;
import com.huigou.topsun.product.application.BrandService; import com.huigou.topsun.product.application.BrandApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
@Service @Service
public class BrandServiceImpl implements BrandService{ public class BrandApplicationImpl implements BrandApplication {
} }
......
package com.huigou.topsun.product.application.impl; package com.huigou.topsun.product.application.impl;
import com.huigou.topsun.product.application.ColorService; import com.huigou.topsun.product.application.ColorApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
@Service @Service
public class ColorServiceImpl implements ColorService{ public class ColorApplicationImpl implements ColorApplication {
} }
......
package com.huigou.topsun.product.application.impl; package com.huigou.topsun.product.application.impl;
import com.huigou.topsun.product.application.FactoryService; import com.huigou.topsun.product.application.FactoryApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
@Service @Service
public class FactoryServiceImpl implements FactoryService{ public class FactoryApplicationImpl implements FactoryApplication {
} }
......
package com.huigou.topsun.product.application.impl; package com.huigou.topsun.product.application.impl;
import com.huigou.topsun.product.application.ProductService; import com.huigou.topsun.product.application.ProductApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
@Service @Service
public class ProductServiceImpl implements ProductService{ public class ProductApplicationImpl implements ProductApplication {
} }
......
package com.huigou.topsun.product.application.impl; package com.huigou.topsun.product.application.impl;
import com.huigou.topsun.product.application.ProductCategoryService; import com.huigou.topsun.product.application.ProductCategoryApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
@Service @Service
public class ProductCategoryServiceImpl implements ProductCategoryService{ public class ProductCategoryApplicationImpl implements ProductCategoryApplication {
} }
......
package com.huigou.topsun.product.application.impl; package com.huigou.topsun.product.application.impl;
import com.huigou.topsun.product.application.ProductDetailService; import com.huigou.topsun.product.application.ProductDetailApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
@Service @Service
public class ProductDetailServiceImpl implements ProductDetailService{ public class ProductDetailApplicationImpl implements ProductDetailApplication {
} }
......
package com.huigou.topsun.product.application.impl; package com.huigou.topsun.product.application.impl;
import com.huigou.topsun.product.application.ProductFaceService; import com.huigou.topsun.product.application.ProductFaceApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
@Service @Service
public class ProductFaceServiceImpl implements ProductFaceService{ public class ProductFaceApplicationImpl implements ProductFaceApplication {
} }
......
package com.huigou.topsun.product.application.impl; package com.huigou.topsun.product.application.impl;
import com.huigou.topsun.product.application.ProductFaceColorService; import com.huigou.topsun.product.application.ProductFaceColorApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
@Service @Service
public class ProductFaceColorServiceImpl implements ProductFaceColorService{ public class ProductFaceColorApplicationImpl implements ProductFaceColorApplication {
} }
......
package com.huigou.topsun.product.application.impl; package com.huigou.topsun.product.application.impl;
import com.huigou.topsun.product.application.ProductLookedService; import com.huigou.topsun.product.application.ProductLookedApplication;
import com.huigou.topsun.product.domain.ProductLooked; import com.huigou.topsun.product.domain.ProductLooked;
import com.huigou.topsun.product.repository.ProductLookedRepository; import com.huigou.topsun.product.repository.ProductLookedRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service; ...@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
@Service @Service
public class ProductLookedServiceImpl implements ProductLookedService{ public class ProductLookedApplicationImpl implements ProductLookedApplication {
@Autowired @Autowired
ProductLookedRepository productLookedRepository; ProductLookedRepository productLookedRepository;
......
package com.huigou.topsun.product.application.impl; package com.huigou.topsun.product.application.impl;
import com.huigou.topsun.product.application.ProductLossService; import com.huigou.topsun.product.application.ProductLossApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
@Service @Service
public class ProductLossServiceImpl implements ProductLossService{ public class ProductLossApplicationImpl implements ProductLossApplication {
} }
......
package com.huigou.topsun.product.application.impl; package com.huigou.topsun.product.application.impl;
import com.huigou.topsun.product.application.ProductMaterialService; import com.huigou.topsun.product.application.ProductMaterialApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
@Service @Service
public class ProductMaterialServiceImpl implements ProductMaterialService{ public class ProductMaterialApplicationImpl implements ProductMaterialApplication {
} }
......
package com.huigou.topsun.product.application.impl; package com.huigou.topsun.product.application.impl;
import com.huigou.topsun.product.application.ProductPublishedConfService; import com.huigou.topsun.product.application.ProductPublishedConfApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
@Service @Service
public class ProductPublishedConfServiceImpl implements ProductPublishedConfService{ public class ProductPublishedConfApplicationImpl implements ProductPublishedConfApplication {
} }
......
package com.huigou.topsun.product.application.impl; package com.huigou.topsun.product.application.impl;
import com.huigou.topsun.product.application.ProductTypesetConfService; import com.huigou.topsun.product.application.ProductTypesetConfApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 10:24:31 * @createDate 2023-11-22 10:24:31
*/ */
@Service @Service
public class ProductTypesetConfServiceImpl implements ProductTypesetConfService{ public class ProductTypesetConfApplicationImpl implements ProductTypesetConfApplication {
} }
......
package com.huigou.topsun.technology.application; package com.huigou.topsun.technology.application;
import java.util.Map;
/** /**
* @author 16508 * @author 16508
* @description 针对表【process(工序)】的数据库操作Service * @description 针对表【process(工序)】的数据库操作Service
* @createDate 2023-11-22 11:04:03 * @createDate 2023-11-22 11:04:03
*/ */
public interface ProcessService { public interface ProcessApplication {
public static final String QUERY_XML_FILE_PATH = "config/topsun/technology/process.xml";
} }
...@@ -6,6 +6,6 @@ package com.huigou.topsun.technology.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.technology.application;
* @description 针对表【process_material_item(工序物料关系表)】的数据库操作Service * @description 针对表【process_material_item(工序物料关系表)】的数据库操作Service
* @createDate 2023-11-22 11:04:03 * @createDate 2023-11-22 11:04:03
*/ */
public interface ProcessMaterialItemService { public interface ProcessMaterialItemApplication {
} }
...@@ -6,6 +6,6 @@ package com.huigou.topsun.technology.application; ...@@ -6,6 +6,6 @@ package com.huigou.topsun.technology.application;
* @description 针对表【process_resource(工序资源)】的数据库操作Service * @description 针对表【process_resource(工序资源)】的数据库操作Service
* @createDate 2023-11-22 11:04:03 * @createDate 2023-11-22 11:04:03
*/ */
public interface ProcessResourceService { public interface ProcessResourceApplication {
} }
package com.huigou.topsun.technology.application;
import com.huigou.topsun.technology.domain.model.Technology;
import com.huigou.topsun.technology.domain.query.TechnologyQueryRequest;
import com.huigou.topsun.technology.vo.TechnologyVo;
import java.util.Map;
/**
* @author 16508
* @description 针对表【technology(工艺)】的数据库操作Service
* @createDate 2023-11-22 11:04:03
*/
public interface TechnologyApplication {
public static final String QUERY_XML_FILE_PATH = "config/topsun/technology/technology.xml";
Map<String,Object> slicedTechnologyList(TechnologyQueryRequest queryRequest);
TechnologyVo saveTechnology(TechnologyVo technologyVo);
TechnologyVo updateTechnologyVo(TechnologyVo technologyVo);
void deleteTechnologyVo(String id);
TechnologyVo findTechnologyByTechnologyIdId(String technologyId);
}
package com.huigou.topsun.technology.application;
/**
* @author 16508
* @description 针对表【technology(工艺)】的数据库操作Service
* @createDate 2023-11-22 11:04:03
*/
public interface TechnologyService {
}
package com.huigou.topsun.technology.application.impl; package com.huigou.topsun.technology.application.impl;
import com.huigou.topsun.technology.application.ProcessMaterialItemService; import com.huigou.topsun.technology.application.ProcessMaterialItemApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 11:04:03 * @createDate 2023-11-22 11:04:03
*/ */
@Service @Service
public class ProcessMaterialItemServiceImpl implements ProcessMaterialItemService{ public class ProcessMaterialItemApplicationImpl implements ProcessMaterialItemApplication {
} }
......
package com.huigou.topsun.technology.application.impl; package com.huigou.topsun.technology.application.impl;
import com.huigou.topsun.technology.application.ProcessResourceService; import com.huigou.topsun.technology.application.ProcessResourceApplication;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
* @createDate 2023-11-22 11:04:03 * @createDate 2023-11-22 11:04:03
*/ */
@Service @Service
public class ProcessResourceServiceImpl implements ProcessResourceService{ public class ProcessResourceApplicationImpl implements ProcessResourceApplication {
} }
......
package com.huigou.topsun.technology.application.impl;
import com.huigou.cache.DictUtil;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.technology.application.TechnologyApplication;
import com.huigou.topsun.technology.domain.model.Technology;
import com.huigou.topsun.technology.domain.query.TechnologyQueryRequest;
import com.huigou.topsun.technology.repository.TechnologyRepository;
import com.huigou.topsun.technology.vo.TechnologyVo;
import com.huigou.uasp.bmp.common.application.BaseApplication;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Map;
/**
* @author 16508
* @description 针对表【technology(工艺)】的数据库操作Service实现
* @createDate 2023-11-22 11:04:03
*/
@Service
public class TechnologyApplicationImpl extends BaseApplication implements TechnologyApplication {
@Resource
private TechnologyRepository technologyRepository;
@Override
public Map<String, Object> slicedTechnologyList(TechnologyQueryRequest queryRequest) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "technology");
QueryModel model = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
model.putDictionary("technologyType", DictUtil.getDictionary("technologyType"));
return this.sqlExecutorDao.executeSlicedQuery(model);
}
@Override
public TechnologyVo saveTechnology(TechnologyVo technologyVo) {
Technology technology = TechnologyVo.getTechnology(technologyVo);
technologyRepository.saveAndFlush(technology);
technologyVo.setTechnologyId(technology.getTechnologyId());
return technologyVo;
}
@Override
public TechnologyVo updateTechnologyVo(TechnologyVo technologyVo) {
return null;
}
@Override
public void deleteTechnologyVo(String id) {
technologyRepository.delete(id);
}
@Override
public TechnologyVo findTechnologyByTechnologyIdId(String technologyId) {
Technology technology = technologyRepository.findOne(technologyId);
return TechnologyVo.getTechnologyVo(technology);
}
}
package com.huigou.topsun.technology.application.impl;
import com.huigou.topsun.technology.application.TechnologyService;
import org.springframework.stereotype.Service;
/**
* @author 16508
* @description 针对表【technology(工艺)】的数据库操作Service实现
* @createDate 2023-11-22 11:04:03
*/
@Service
public class TechnologyServiceImpl implements TechnologyService{
}
package com.huigou.topsun.technology.controller;
import com.huigou.topsun.technology.application.ProcessApplication;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
/**
* @Auther: xin.lu
* @Date: 2023/11/23/15:48
* @Description:
*/
@Controller
@ControllerMapping("/process")
public class ProcessController extends CommonController {
}
package com.huigou.topsun.technology.controller;
import com.huigou.cache.DictUtil;
import com.huigou.topsun.technology.application.TechnologyApplication;
import com.huigou.topsun.technology.domain.query.TechnologyQueryRequest;
import com.huigou.topsun.technology.vo.TechnologyVo;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
import java.util.Map;
/**
* @Auther: xin.lu
* @Date: 2023/11/23/11:14
* @Description:
*/
@Controller
@ControllerMapping("/technology")
public class TechnologyController extends CommonController {
@Resource
private TechnologyApplication technologyApplication;
protected String getPagePath() {
return "/biz/topsun/technology/";
}
/**
* 跳转到查询页面
* @return
*/
public String forwardTechnologyList(){
Map<String, String> processType = DictUtil.getDictionary("processType");
this.putAttribute("processType",processType);
return forward("technologyList");
}
/**
* 查询数据列表
* @return
*/
public String slicedTechnologyList(){
SDO sdo = this.getSDO();
TechnologyQueryRequest queryRequest = sdo.toQueryRequest(TechnologyQueryRequest.class);
return toResult(technologyApplication.slicedTechnologyList(queryRequest));
}
/**
* 保存工艺
* @return
*/
public String saveTechnology(){
SDO sdo = this.getSDO();
TechnologyVo technologyVo = sdo.toObject(TechnologyVo.class);
technologyApplication.saveTechnology(technologyVo);
return success(technologyVo);
}
/**
* 修改工艺
* @return
*/
public String updateTechnology(){
SDO sdo = this.getSDO();
TechnologyVo technologyVo = sdo.toObject(TechnologyVo.class);
technologyApplication.updateTechnologyVo(technologyVo);
return success(technologyVo);
}
/**
* 删除工艺
* @return
*/
public String deleteTechnologyByTechnologyId(){
SDO sdo = this.getSDO();
String technologyId = sdo.getString("technologyId");
technologyApplication.deleteTechnologyVo(technologyId);
return success();
}
/**
* 工艺新增明细
* @return
*/
public String addTechnologyDetail(){
return forward("technologyDetail");
}
/**
* 查看工艺明细
* @return
*/
public String showTechnologyDetail(){
SDO sdo = this.getSDO();
String technologyId = sdo.getString("technologyId");
TechnologyVo technologyVo = technologyApplication.findTechnologyByTechnologyIdId(technologyId);
return forward("technologyDetail",technologyVo);
}
}
package com.huigou.topsun.technology.controller;
import com.huigou.topsun.technology.application.TechnologyProcessApplication;
import com.huigou.topsun.technology.domain.query.TechnologyProcessQueryRequest;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
import java.util.List;
/**
* @Auther: xin.lu
* @Date: 2023/11/23/16:56
* @Description:
*/
@Controller
@ControllerMapping("/technologyProcess")
public class TechnologyProcessController extends CommonController {
@Resource
private TechnologyProcessApplication technologyProcessApplication;
public String slicedTechnologyProcessList(){
SDO sdo = this.getSDO();
TechnologyProcessQueryRequest queryRequest = sdo.toQueryRequest(TechnologyProcessQueryRequest.class);
return toResult(technologyProcessApplication.slicedTechnologyProcessList(queryRequest));
}
public String deleteTechnologyProcess(){
SDO sdo = this.getSDO();
List<String> technologyProcessIds = sdo.getIds();
return success();
}
}
package com.huigou.topsun.technology.domain; package com.huigou.topsun.technology.domain.model;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.*; import javax.persistence.*;
......
package com.huigou.topsun.technology.domain; package com.huigou.topsun.technology.domain.model;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.*; import javax.persistence.*;
......
package com.huigou.topsun.technology.domain; package com.huigou.topsun.technology.domain.model;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.*; import javax.persistence.*;
......
package com.huigou.topsun.technology.domain; package com.huigou.topsun.technology.domain.model;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.*; import javax.persistence.*;
......
package com.huigou.topsun.technology.domain; package com.huigou.topsun.technology.domain.model;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.*; import javax.persistence.*;
......
package com.huigou.topsun.technology.domain.query;
import com.alibaba.fastjson.JSON;
import com.huigou.data.domain.query.QueryAbstractRequest;
import lombok.Data;
import java.io.Serializable;
/**
* 工序
* @TableName process
*/
@Data
public class TechnologyProcessQueryRequest extends QueryAbstractRequest {
/**
* 工艺节点条目ID
*/
private String technologyProcessId;
/**
* 工艺ID
*/
private String technologyId;
/**
* 工序ID
*/
private String processId;
/**
* 条目序号
*/
private Integer sortNum;
/**
* 工序名称
*/
private String processName;
/**
* 工序说明
*/
private String processRemark;
/**
* 工时
*/
private Double workHours;
/**
* 工序类别(process_type)
*/
private String processType;
/**
* 工序内容
*/
private String processContent;
}
\ No newline at end of file
package com.huigou.topsun.technology.domain.query;
import com.huigou.data.domain.query.QueryAbstractRequest;
import lombok.Data;
/**
* 工艺
* @TableName technology
*/
@Data
public class TechnologyQueryRequest extends QueryAbstractRequest {
/**
* 工艺路线ID
*/
private String technologyId;
/**
* 工艺路线名称
*/
private String technologyName;
/**
* 产品ID
*/
private String productId;
/**
* 工艺版本
*/
private String technologyVersion;
/**
* 工艺类型(technology_type)
*/
private String technologyType;
}
\ No newline at end of file
package com.huigou.topsun.technology.repository; package com.huigou.topsun.technology.repository;
import com.huigou.topsun.technology.domain.ProcessMaterialItem; import com.huigou.topsun.technology.domain.model.ProcessMaterialItem;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
/** /**
......
package com.huigou.topsun.technology.repository; package com.huigou.topsun.technology.repository;
import com.huigou.topsun.technology.domain.Process; import com.huigou.topsun.technology.domain.model.Process;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/** /**
* @Auther: xin.lu * @Auther: xin.lu
* @Date: 2023/11/22/11:11 * @Date: 2023/11/22/11:11
* @Description: * @Description:
*/ */
public interface ProcessRepository extends JpaRepository<Process,String> { public interface ProcessRepository extends JpaRepository<Process,String> {
} }
package com.huigou.topsun.technology.repository; package com.huigou.topsun.technology.repository;
import com.huigou.topsun.technology.domain.ProcessResource; import com.huigou.topsun.technology.domain.model.ProcessResource;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
/** /**
......
package com.huigou.topsun.technology.repository; package com.huigou.topsun.technology.repository;
import com.huigou.topsun.technology.domain.TechnologyProcess; import com.huigou.topsun.technology.domain.model.TechnologyProcess;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
/** /**
......
package com.huigou.topsun.technology.repository; package com.huigou.topsun.technology.repository;
import com.huigou.topsun.technology.domain.Technology; import com.huigou.topsun.technology.domain.model.Technology;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
/** /**
......
package com.huigou.topsun.technology.vo;
import com.alibaba.fastjson.JSON;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
/**
* 工序
* @TableName process
*/
@Data
public class TechnologyProcessVo implements Serializable {
/**
* 工艺节点条目ID
*/
private String technologyProcessId;
/**
* 工艺ID
*/
private String technologyId;
/**
* 工序ID
*/
private String processId;
/**
* 条目序号
*/
private Integer sortNum;
/**
* 工序名称
*/
private String processName;
/**
* 工序说明
*/
private String processRemark;
/**
* 工时
*/
private Double workHours;
/**
* 工序类别(process_type)
*/
private String processType;
/**
* 工序内容
*/
private String processContent;
public static Process getProcess(TechnologyProcessVo processVo){
return JSON.parseObject(JSON.toJSONString(processVo),Process.class);
}
public static TechnologyProcessVo getProcessVo(Process process){
return JSON.parseObject(JSON.toJSONString(process), TechnologyProcessVo.class);
}
}
\ No newline at end of file
package com.huigou.topsun.technology.vo;
import com.alibaba.fastjson.JSON;
import com.huigou.data.domain.query.QueryAbstractRequest;
import com.huigou.topsun.technology.domain.model.Technology;
import lombok.Data;
import java.io.Serializable;
/**
* 工艺
* @TableName technology
*/
@Data
public class TechnologyVo implements Serializable {
/**
* 工艺路线ID
*/
private String technologyId;
/**
* 工艺路线名称
*/
private String technologyName;
/**
* 产品ID
*/
private String productId;
/**
* 工艺版本
*/
private String technologyVersion;
/**
* 工艺类型(technology_type)
*/
private String technologyType;
public static TechnologyVo getTechnologyVo(Technology technology){
return JSON.parseObject(JSON.toJSONString(technology),TechnologyVo.class);
}
public static Technology getTechnology(TechnologyVo technologyVo){
return JSON.parseObject(JSON.toJSONString(technologyVo),Technology.class);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<query-mappings>
<query name="processByTechnologyId" label="工序表" table="process">
<sql-query>
SELECT
p.process_id,
p.process_name,
p.process_content,
p.process_type,
p.process_remark,
p.work_hours
FROM
process p
LEFT JOIN technology_process tp ON tp.process_id = p.process_id
WHERE 1 =1
</sql-query>
<condition column="technology_id" name="technologyId" type="java.lang.String" symbol="=" alias="tp"/>
</query>
</query-mappings>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<query-mappings>
<query name="technology" label="工艺表" table="technology">
<sql-query>
select t.* from technology t
</sql-query>
<condition column="name" name="name" type="java.lang.String" symbol="=" alias="like"/>
<condition column="full_id" name="fullId" type="java.lang.String" symbol="half_like" alias="o"/>
<condition column="rule_kind" name="ruleKind" type="java.lang.String" symbol="=" alias="t"/>
</query>
</query-mappings>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<query-mappings>
<query name="slicedTechnologyProcessList" label="工艺工序表" table="technology_process">
<sql-query>
SELECT
tp.technology_process_id,
tp.technology_id,
tp.sort_num,
p.process_id,
p.process_name,
p.process_content,
p.process_type,
p.process_remark,
p.work_hours
FROM
technology_process tp
LEFT JOIN process p ON tp.process_id = p.process_id
WHERE 1 =1
</sql-query>
<condition column="technology_id" name="technologyId" type="java.lang.String" symbol="=" alias="tp"/>
</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