Browse Source

收费项目管理

qzyReal 2 years ago
parent
commit
5eefe0fbf2
28 changed files with 1546 additions and 385 deletions
  1. 24 7
      sp-admin/sa-frame/menu-list.js
  2. 156 0
      sp-admin/sa-view/tb-item-type/tb-item-add.html
  3. 76 0
      sp-admin/sa-view/tb-item-type/tb-item-info.html
  4. 138 0
      sp-admin/sa-view/tb-item-type/tb-item-list.html
  5. 110 0
      sp-admin/sa-view/tb-item-type/tb-item-select.html
  6. 136 0
      sp-admin/sa-view/tb-item-type/tb-item-type-add.html
  7. 76 0
      sp-admin/sa-view/tb-item-type/tb-item-type-info.html
  8. 154 0
      sp-admin/sa-view/tb-item-type/tb-item-type-list.html
  9. 128 0
      sp-admin/sa-view/tb-item-type/tb-item.html
  10. 1 0
      sp-server/app.pid
  11. 64 0
      sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItem.java
  12. 53 0
      sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItemController.java
  13. 28 0
      sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItemMapper.java
  14. 51 0
      sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItemMapper.xml
  15. 63 0
      sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItemService.java
  16. 134 123
      sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomer.java
  17. 5 1
      sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerController.java
  18. 3 0
      sp-server/src/main/java/com/pj/project/tb_item/TbItem.java
  19. 14 6
      sp-server/src/main/java/com/pj/project/tb_item/TbItemController.java
  20. 1 26
      sp-server/src/main/java/com/pj/project/tb_item/TbItemMapper.java
  21. 18 43
      sp-server/src/main/java/com/pj/project/tb_item/TbItemMapper.xml
  22. 28 31
      sp-server/src/main/java/com/pj/project/tb_item/TbItemService.java
  23. 1 0
      sp-server/src/main/java/com/pj/project/tb_item_type/TbItemType.java
  24. 76 78
      sp-server/src/main/java/com/pj/project/tb_item_type/TbItemTypeController.java
  25. 0 25
      sp-server/src/main/java/com/pj/project/tb_item_type/TbItemTypeMapper.java
  26. 3 33
      sp-server/src/main/java/com/pj/project/tb_item_type/TbItemTypeMapper.xml
  27. 4 11
      sp-server/src/main/java/com/pj/project/tb_item_type/TbItemTypeService.java
  28. 1 1
      sp-server/src/main/resources/application-dev.yml

+ 24 - 7
sp-admin/sa-frame/menu-list.js

@@ -115,7 +115,7 @@ var menuList = [{
 			},
 		]
 	},
-	
+
 	{
 		id: 'tb-costomer-maintain',
 		name: '信息维护',
@@ -322,6 +322,24 @@ var menuList = [{
 
 		]
 	},
+	{
+		id: 'tb-item-type',
+		name: '收费项管理',
+		icon: 'el-icon-notebook-2',
+		parent: true,
+		childList: [{
+				id: 'tb-item-type-list',
+				name: '收费项管理',
+				url: 'sa-view/tb-item-type/tb-item-type-list.html'
+			},
+			{
+				id: 'tb-item-list',
+				name: '明细管理',
+				url: 'sa-view/tb-item-type/tb-item-list.html'
+			},
+		],
+
+	},
 
 	{
 		id: 'tb-business-car',
@@ -332,27 +350,26 @@ var menuList = [{
 			id: 'tb-business-car-list',
 			name: '放行列表',
 			url: 'sa-view/tb-business-car/tb-business-car-list.html',
-			childList:[
-				{
-				
+			childList: [{
+
 					id: 'tb-business-car-add',
 					name: '添加记录',
 					isShow: false
 				},
 				{
-				
+
 					id: 'tb-business-car-export',
 					name: '导出记录',
 					isShow: false
 				},
 				{
-				
+
 					id: 'tb-business-car-edit',
 					name: '修改记录',
 					isShow: false
 				},
 				{
-				
+
 					id: 'tb-business-car-del',
 					name: '删除记录',
 					isShow: false

+ 156 - 0
sp-admin/sa-view/tb-item-type/tb-item-add.html

@@ -0,0 +1,156 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>作业配置项-添加/修改</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+		<style type="text/css">
+			.c-panel .el-form .c-label {
+				width: 7em !important;
+			}
+
+			.c-panel .el-form .el-input,
+			.c-panel .el-form .el-textarea__inner {
+				width: 250px;
+			}
+
+			.item-num .el-input__inner {
+				width: 100px;
+				display: inline;
+			}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel">
+					<div class="c-title" v-if="id == 0">数据添加</div>
+					<div class="c-title" v-else>数据修改</div>
+					<el-form v-if="m">
+						<sa-item type="text" name="明细名称" v-model="m.itemName" placeholder="请输入项目名称" br></sa-item>
+						<sa-item type="text" name="计价单位" v-model="m.unit" placeholder="请输入计量单位" br></sa-item>
+						<div class="c-item">
+							<label class="c-label">计费金额(元):</label>
+							<el-input-number class="item-num" v-model="m.price" :step="10" :min="0" :max="9999"
+								></el-input-number>
+						</div>
+						<div>
+							<label>适用载重(吨):</label>
+							<div style="display: inline;margin-left: 20px;">
+								<el-input-number class="item-num" v-model="m.minWeight" :step="1" :min="0" :max="9999"
+									></el-input-number>
+								至
+								<el-input-number class="item-num" v-model="m.maxWeight" :step="1" :min="0" :max="9999"
+									></el-input-number>
+							</div>
+						</div>
+						<div style="margin-top: 20px;">
+							<label>适用车长(米):</label>
+							<div style="display: inline;margin-left: 20px;">
+								<el-input-number class="item-num" v-model="m.minLength" :step="1" :min="0" :max="99"
+									></el-input-number>
+								至
+								<el-input-number class="item-num" v-model="m.carLength" :step="1" :min="0" :max="99"
+									></el-input-number>
+							</div>
+						</div>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="primary" @click="ok()">确定</el-button>
+				<el-button @click="sa.closeCurrIframe()">取消</el-button>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改) 
+					m: {
+						id: '', // 主键
+						itemName: '',
+						price: '',
+						unit: '元/车',
+						minLength: '4.2',
+						carLength: '20', //车长
+						minWeight: '5',
+						maxWeight: '10', //最大载重
+						status: '1', //转态
+					}, // 实体对象
+					itemTypeList: [],
+				},
+				methods: {
+					// 提交数据 
+					ok: function() {
+						// 表单校验 
+						let m = this.m;
+						// sa.checkNull(m.id, '请输入 [主键]');
+						sa.checkNull(m.itemName, '请输入 [项目名称]');
+						sa.checkNull(m.price, '请输入 [计费金额]');
+						sa.checkNull(m.unit, '请输入 [计价单位]');
+						let minLength = m.minLength;
+						let maxLength = m.carLength;
+						let minWeight = m.minWeight;
+						let maxWeight = m.maxWeight;
+						sa.checkNull(minLength, '请输入 [最小车长]');
+						sa.checkNull(maxLength, '请输入 [最大车长]');
+						sa.checkNull(minWeight, '请输入 [最小载重]');
+						sa.checkNull(maxWeight, '请输入 [最大载重]');
+						if (minLength > maxLength) {
+							sa.error('最小车长不能大于最大车长')
+							return;
+						}
+						if (minWeight > maxWeight) {
+							sa.error('最小载重不能大于最大载重')
+							return;
+						}
+						// 开始增加或修改
+						if (this.id <= 0) { // 添加
+							sa.ajax('/TbItem/add', m, function(res) {
+								sa.alert('增加成功', this.clean);
+							}.bind(this));
+						} else { // 修改
+							sa.ajax('/TbItem/update', m, function(res) {
+								sa.alert('修改成功', this.clean);
+							}.bind(this));
+						}
+					},
+					// 添加/修改 完成后的动作
+					clean: function() {
+						if (this.id == 0) {} else {
+							parent.app.f5(); // 刷新父页面列表
+							sa.closeCurrIframe(); // 关闭本页 
+						}
+					},
+				},
+				mounted: function() {
+					// 初始化数据 
+					if (this.id <= 0) {} else {
+						sa.ajax('/TbItem/getById?id=' + this.id, function(res) {
+							this.m = res.data;
+							if (res.data == null) {
+								sa.alert('未能查找到 id=' + this.id + " 详细数据");
+							}
+						}.bind(this))
+					}
+				}
+			})
+		</script>
+	</body>
+</html>

+ 76 - 0
sp-admin/sa-view/tb-item-type/tb-item-info.html

@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>作业配置项-详情</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+		<style type="text/css">
+			.c-panel .c-label{width: 8em;}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box sbot" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel">
+					<el-form v-if="m">
+						<el-row>
+							<el-col span="12">
+								<sa-info name="项目编号" br>{{m.itemCode}}</sa-info>
+								<sa-info name="项目名称" br>{{m.itemName}}</sa-info>
+								<sa-info name="项目类型" br>{{m.typeName}}</sa-info>
+								<sa-info name="项目金额(元)" br>{{m.price}}</sa-info>
+							</el-col>
+							<el-col span="12">
+								<sa-info name="金额单位" br>{{m.unit}}</sa-info>
+								<sa-info name="车长(米)" br>{{m.carLength}}</sa-info>
+								<sa-info name="最大载重(吨)" br>{{m.maxWeight}}</sa-info>
+								<sa-info name="状态" br>
+									<span v-if="m.status == 1">启用</span>
+									<span v-if="m.status == 0">禁用</span>
+								</sa-info>
+							</el-col>
+						</el-row>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="success" @click="sa.closeCurrIframe()">关闭</el-button>
+<!--				<el-button @click="sa.closeCurrIframe()">取消</el-button>-->
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue')
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', 0),	// 获取数据ID 
+					m: null
+				},
+				methods: {
+				},
+				mounted: function() {
+					sa.ajax('/TbItem/getById?id=' + this.id, function(res) {
+						this.m = res.data;
+						if(res.data == null) {
+							sa.alert('未能查找到 id=' + this.id + " 详细数据");
+						}
+					}.bind(this))
+				}
+			})
+			
+		</script>
+	</body>
+</html>

+ 138 - 0
sp-admin/sa-view/tb-item-type/tb-item-list.html

@@ -0,0 +1,138 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>作业配置项-列表</title>
+		<meta charset="utf-8">
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css & js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+	</head>
+	<body>
+		<div class="vue-box" style="display: none;" :style="'display: block;'">
+			<div class="c-panel">
+				<!-- ------------- 检索参数 ------------- -->
+				<div class="c-title">检索参数</div>
+				<el-form ref="form" :model='p' @submit.native.prevent>
+					<sa-item type="text" name="名称" v-model="p.itemName"></sa-item>
+					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<sa-item type="fast-btn" show="reset" style="display: inline;"></sa-item>
+					<el-button type="primary" icon="el-icon-plus" @click="add()">新增
+					</el-button>
+					<br />
+				</el-form>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList">
+					<el-table-column type="index" width="50">
+					</el-table-column>
+					<sa-td name="明细名称" prop="itemName" width="300px"></sa-td>
+					<sa-td name="价格" prop="price"></sa-td>
+					<sa-td name="单位" prop="unit"></sa-td>
+					<sa-td name="适合规格(米)">
+						<template slot-scope="s">
+							<label>{{s.row.minLength}}—{{s.row.carLength}}</label>
+						</template>
+					</sa-td>
+					<sa-td name="适合载重(吨)">
+						<template slot-scope="s">
+							<label>{{s.row.minWeight}}—{{s.row.maxWeight}}</label>
+						</template>
+					</sa-td>
+					<el-table-column label="操作" fixed="right" width="240px">
+						<template slot-scope="s">
+							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
+							</el-button>
+							<el-button  class="c-btn" type="primary" icon="el-icon-edit"
+								@click="update(s.row)">修改
+							</el-button>
+							<el-button  class="c-btn" type="danger" icon="el-icon-delete"
+								@click="del(s.row)">删除
+							</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+				<!-- ------------- 分页 ------------- -->
+				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
+				</sa-item>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
+				},
+				el: '.vue-box',
+				data: {
+					p: { // 查询参数  
+						id: '', // 主键
+						itemName: '', // 项目名称 
+						pageNo: 1, // 当前页 
+						pageSize: 20, // 页大小 
+						sortType: 0 // 排序方式 
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合
+					itemTypeList: [],
+					businessTypeList: [{
+							value: '0',
+							name: '默认'
+						},
+						{
+							value: '1',
+							name: '消杀'
+						},
+						{
+							value: '2',
+							name: '装卸'
+						},
+						{
+							value: '3',
+							name: '核酸'
+						},
+					]
+				},
+				methods: {
+					// 修改
+					update: function(data) {
+						sa.showIframe('修改数据', 'tb-item-add.html?id=' + data.id, '600px', '60%');
+					},
+					// 新增
+					add: function(data) {
+						sa.showIframe('新增数据', 'tb-item-add.html?id=-1', '600px', '60%');
+					},
+					// 删除
+					del: function(data) {
+						sa.confirm('是否删除,此操作不可撤销', function() {
+							sa.ajax('/TbItem/delete?id=' + data.id, function(res) {
+								sa.arrayDelete(this.dataList, data);
+								sa.ok('删除成功');
+								sa.f5TableHeight(); // 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+					// 刷新
+					f5: function() {
+						sa.ajax('/TbItem/getList', sa.removeNull(this.p), function(res) {
+							let list = res.data;
+							this.dataList = list; // 数据
+							this.dataCount = res.dataCount; // 数据总数 
+							sa.f5TableHeight(); // 刷新表格高度 
+						}.bind(this));
+					},
+				},
+				created: function() {
+					this.f5();
+					sa.onInputEnter();
+				}
+			})
+		</script>
+	</body>
+</html>

+ 110 - 0
sp-admin/sa-view/tb-item-type/tb-item-select.html

@@ -0,0 +1,110 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>作业配置项-列表</title>
+		<meta charset="utf-8">
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css & js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+	</head>
+	<body>
+		<div class="vue-box" style="display: none;" :style="'display: block;'">
+			<div class="c-panel">
+				<!-- ------------- 检索参数 ------------- -->
+				<div class="c-title">检索参数</div>
+				<el-form ref="form" :model='p' @submit.native.prevent>
+					<sa-item type="text" name="名称" v-model="p.itemName"></sa-item>
+					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<sa-item type="fast-btn" show="reset" style="display: inline;"></sa-item>
+					<el-button type="primary" @click="add()">确定
+					</el-button>
+					<br />
+				</el-form>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList">
+					<sa-td type="selection"></sa-td>
+					<sa-td name="明细名称" prop="itemName" width="300px"></sa-td>
+					<sa-td name="价格" prop="price"></sa-td>
+					<sa-td name="单位" prop="unit"></sa-td>
+					<sa-td name="适合规格(米)">
+						<template slot-scope="s">
+							<label>{{s.row.minLength}}—{{s.row.carLength}}</label>
+						</template>
+					</sa-td>
+					<sa-td name="适合载重(吨)">
+						<template slot-scope="s">
+							<label>{{s.row.minWeight}}—{{s.row.maxWeight}}</label>
+						</template>
+					</sa-td>
+					<el-table-column label="操作" fixed="right">
+						<template slot-scope="s">
+							<el-button class="c-btn" type="primary" @click="selectFn(s.row)">选择
+							</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+				<!-- ------------- 分页 ------------- -->
+				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
+				</sa-item>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
+				},
+				el: '.vue-box',
+				data: {
+					typeId: sa.p('id', ''),
+					p: { // 查询参数  
+						id: '', // 主键
+						itemName: '', // 项目名称 
+						pageNo: 1, // 当前页 
+						pageSize: 20, // 页大小 
+						sortType: 0 // 排序方式 
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合
+				},
+				methods: {
+					// 新增
+					add: function(data) {
+						var selection = this.$refs['data-table'].selection;
+						if (selection.length == 0) {
+							return sa.msg('至少选择一条数据')
+						}
+						let obj={typeId:this.typeId,itemIds:selection.map(obj=>obj.id).join(',')}
+						sa.ajax('/RelationTypeItem/setBatch',obj,function(resp){
+							
+						}.bind(this))
+					},
+					selectFn(data) {
+
+					},
+					// 刷新
+					f5: function() {
+						sa.ajax('/TbItem/getList', sa.removeNull(this.p), function(res) {
+							let list = res.data;
+							this.dataList = list; // 数据
+							this.dataCount = res.dataCount; // 数据总数 
+							sa.f5TableHeight(); // 刷新表格高度 
+						}.bind(this));
+					},
+				},
+				created: function() {
+					this.f5();
+					sa.onInputEnter();
+				}
+			})
+		</script>
+	</body>
+</html>

+ 136 - 0
sp-admin/sa-view/tb-item-type/tb-item-type-add.html

@@ -0,0 +1,136 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>作业配置项-添加/修改</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+		<style type="text/css">
+			.c-panel .el-form .c-label {
+				width: 7em !important;
+			}
+
+			.c-panel .el-form .el-input,
+			.c-panel .el-form .el-textarea__inner {
+				width: 250px;
+			}
+
+			.item-num .el-input__inner {
+				width: 100px;
+			}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel">
+					<div class="c-title" v-if="id == 0">数据添加</div>
+					<div class="c-title" v-else>数据修改</div>
+					<el-form v-if="m">
+						<sa-item type="text" name="项目名称" v-model="m.name" placeholder="请输入项目名称" br>
+						</sa-item>
+						<div class="c-item">
+							<label class="c-label">项目类型:</label>
+							<el-select multiple v-model="businessType"  placeholder="请选择项目类型">
+								<el-option v-for="type in typeList" :key="type.id" :label="type.name" :value="type.id">
+								</el-option>
+							</el-select>
+						</div>
+						<div class="c-item">
+							<label class="c-label">税率(%):</label>
+							<el-input-number class="item-num" v-model="m.taxRate" :step="0.1" :min="0" :max="100"
+								></el-input-number>
+						</div>
+						<div class="c-item">
+							<label class="c-label">排序:</label>
+							<el-input-number class="item-num" v-model="m.sort" :step="1" :min="1" step-strictly>
+							</el-input-number>
+						</div>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="primary" @click="ok()">确定</el-button>
+				<el-button @click="sa.closeCurrIframe()">取消</el-button>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改) 
+					businessType:[],
+					m: {
+						id: '', // 主键
+						sort: '1',
+						taxRate: 0.6,
+						name: '',
+						code: '',
+						business: '0',
+					}, // 实体对象
+					typeList: [],
+				},
+				methods: {
+					// 提交数据 
+					ok: function() {
+						// 表单校验 
+						let m = this.m;
+						sa.checkNull(m.name, '请输入 [项目名称]');
+						// sa.checkNull(m.code, '请输入 [项目编号]');
+						sa.checkNull(this.businessType, '请选择 [项目分类]');
+						m.businessType=this.businessType.join(',');
+						// 开始增加或修改
+						if (this.id <= 0) { // 添加
+							sa.ajax('/TbItemType/add', m, function(res) {
+								sa.alert('增加成功', this.clean);
+							}.bind(this));
+						} else { // 修改
+							sa.ajax('/TbItemType/update', m, function(res) {
+								sa.alert('修改成功', this.clean);
+							}.bind(this));
+						}
+					},
+					// 添加/修改 完成后的动作
+					clean: function() {
+						if (this.id == 0) {} else {
+							parent.app.f5(); // 刷新父页面列表
+							sa.closeCurrIframe(); // 关闭本页 
+						}
+					},
+					getTypeList() {
+						sa.ajax('/TbCostomer/getTypeList', function(resp) {
+							this.typeList = resp.data;
+						}.bind(this))
+					}
+				},
+				mounted: function() {
+					this.getTypeList();
+					// 初始化数据 
+					if (this.id <= 0) {} else {
+						sa.ajax('/TbItemType/getById?id=' + this.id, function(res) {
+							this.m = res.data;
+							this.businessType=res.data.businessType?res.data.businessType.split(','):[]
+							if (res.data == null) {
+								sa.alert('未能查找到 id=' + this.id + " 详细数据");
+							}
+						}.bind(this))
+					}
+				}
+			})
+		</script>
+	</body>
+</html>

+ 76 - 0
sp-admin/sa-view/tb-item-type/tb-item-type-info.html

@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>作业配置项-详情</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+		<style type="text/css">
+			.c-panel .c-label{width: 8em;}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box sbot" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel">
+					<el-form v-if="m">
+						<el-row>
+							<el-col span="12">
+								<sa-info name="项目编号" br>{{m.itemCode}}</sa-info>
+								<sa-info name="项目名称" br>{{m.itemName}}</sa-info>
+								<sa-info name="项目类型" br>{{m.typeName}}</sa-info>
+								<sa-info name="项目金额(元)" br>{{m.price}}</sa-info>
+							</el-col>
+							<el-col span="12">
+								<sa-info name="金额单位" br>{{m.unit}}</sa-info>
+								<sa-info name="车长(米)" br>{{m.carLength}}</sa-info>
+								<sa-info name="最大载重(吨)" br>{{m.maxWeight}}</sa-info>
+								<sa-info name="状态" br>
+									<span v-if="m.status == 1">启用</span>
+									<span v-if="m.status == 0">禁用</span>
+								</sa-info>
+							</el-col>
+						</el-row>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="success" @click="sa.closeCurrIframe()">关闭</el-button>
+<!--				<el-button @click="sa.closeCurrIframe()">取消</el-button>-->
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue')
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', 0),	// 获取数据ID 
+					m: null
+				},
+				methods: {
+				},
+				mounted: function() {
+					sa.ajax('/TbItem/getById?id=' + this.id, function(res) {
+						this.m = res.data;
+						if(res.data == null) {
+							sa.alert('未能查找到 id=' + this.id + " 详细数据");
+						}
+					}.bind(this))
+				}
+			})
+			
+		</script>
+	</body>
+</html>

+ 154 - 0
sp-admin/sa-view/tb-item-type/tb-item-type-list.html

@@ -0,0 +1,154 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>作业配置项-列表</title>
+		<meta charset="utf-8">
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css & js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+	</head>
+	<body>
+		<div class="vue-box" style="display: none;" :style="'display: block;'">
+			<div class="c-panel">
+				<!-- ------------- 检索参数 ------------- -->
+				<div class="c-title">检索参数</div>
+				<el-form ref="form" :model='p' @submit.native.prevent>
+					<sa-item type="text" name="项目名称" v-model="p.name"></sa-item>
+					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<sa-item type="fast-btn" show="reset" style="display: inline;"></sa-item>
+					<el-button type="primary" icon="el-icon-plus" @click="add()">新增
+					</el-button>
+					<br />
+				</el-form>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList">
+					<el-table-column type="index" width="50"></el-table-column>
+						<sa-td name="项目名称" prop="name" width="300px"></sa-td>
+						<sa-td name="业务分类" prop="businessType">
+							<template slot-scope="s">
+								<el-select :disabled="!sa.isAuth('tb-item-list-edit-type')" multiple
+									v-model="s.row.type" placeholder="收费项" @change="businessChange(s.row)">
+									<el-option v-for="item in businessTypeList" :key="item.value" :value="item.value"
+										:label="item.name">
+									</el-option>
+								</el-select>
+							</template>
+						</sa-td>
+						<sa-td name="税率" prop="taxRate"></sa-td>
+						<sa-td name="排序" prop="sort"></sa-td>
+						<el-table-column label="操作" fixed="right" width="240px">
+							<template slot-scope="s">
+								<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
+								</el-button>
+								<el-button class="c-btn" type="success" icon="el-icon-view" @click="itemFn(s.row)">收费明细
+								</el-button>
+								<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
+								</el-button>
+								<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除
+								</el-button>
+							</template>
+						</el-table-column>
+				</el-table>
+				<!-- ------------- 分页 ------------- -->
+				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
+				</sa-item>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
+				},
+				el: '.vue-box',
+				data: {
+					p: { // 查询参数  
+						id: '', // 主键
+						name: '', // 项目名称 
+						business: 0,
+						pageNo: 1, // 当前页 
+						pageSize: 20, // 页大小 
+						sortType: 0 // 排序方式 
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合
+					itemTypeList: [],
+					businessTypeList: [{
+							value: '0',
+							name: '默认'
+						},
+						{
+							value: '1',
+							name: '消杀'
+						},
+						{
+							value: '2',
+							name: '装卸'
+						},
+						{
+							value: '3',
+							name: '核酸'
+						},
+					]
+				},
+				methods: {
+					itemFn(data){
+						sa.showIframe('收费明细', 'tb-item.html?id=' + data.id, '1080px', '90%');
+					},
+					businessChange(data) {
+						let obj = {
+							id: data.id,
+							businessType: data.type.join(',')
+						}
+						sa.ajax('/TbItemType/update', obj, function(res) {
+							this.f5();
+						}.bind(this));
+					},
+					// 修改
+					update: function(data) {
+						sa.showIframe('修改数据', 'tb-item-type-add.html?id=' + data.id, '600px', '60%');
+					},
+					// 新增
+					add: function(data) {
+						sa.showIframe('新增数据', 'tb-item-type-add.html?id=-1', '600px', '60%');
+					},
+					// 删除
+					del: function(data) {
+						sa.confirm('是否删除,此操作不可撤销', function() {
+							sa.ajax('/TbItemType/delete?id=' + data.id, function(res) {
+								sa.arrayDelete(this.dataList, data);
+								sa.ok('删除成功');
+								sa.f5TableHeight(); // 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+					// 刷新
+					f5: function() {
+						sa.ajax('/TbItemType/getList', sa.removeNull(this.p), function(res) {
+							let list = res.data;
+							for (let i in list) {
+								let obj = list[i];
+								obj.type = obj.businessType.split(',')
+							}
+							this.dataList = list; // 数据
+							this.dataCount = res.dataCount; // 数据总数 
+							sa.f5TableHeight(); // 刷新表格高度 
+						}.bind(this));
+					},
+				},
+				created: function() {
+					this.f5();
+					sa.onInputEnter();
+				}
+			})
+		</script>
+	</body>
+</html>

+ 128 - 0
sp-admin/sa-view/tb-item-type/tb-item.html

@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>作业配置项-列表</title>
+		<meta charset="utf-8">
+		<meta name="viewport"
+			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<!-- 所有的 css & js 资源 -->
+		<link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
+		<link rel="stylesheet" href="../../static/sa.css">
+		<script src="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+	</head>
+	<body>
+		<div class="vue-box" style="display: none;" :style="'display: block;'">
+			<div class="c-panel">
+				<!-- ------------- 检索参数 ------------- -->
+				<el-form ref="form" :model='p' @submit.native.prevent>
+					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<el-button type="primary" icon="el-icon-plus" @click="add()">选择
+					</el-button>
+					<br />
+				</el-form>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList" style="margin-top: 10px;">
+					<el-table-column type="index" width="50">
+					</el-table-column>
+					<sa-td name="明细名称" prop="itemName"></sa-td>
+					<sa-td name="价格" prop="price"></sa-td>
+					<sa-td name="单位" prop="unit"></sa-td>
+					<sa-td name="适合规格(米)">
+						<template slot-scope="s">
+							<label>{{s.row.minLength}}—{{s.row.carLength}}</label>
+						</template>
+					</sa-td>
+					<sa-td name="适合载重(吨)">
+						<template slot-scope="s">
+							<label>{{s.row.minWeight}}—{{s.row.maxWeight}}</label>
+						</template>
+					</sa-td>
+					<sa-td name="是否必须" prop="need" type="switch" :jv="{0: '是[#ff0000]', 1: '否[#005500]'}"
+						@change="s => updateStatus(s.row)"></sa-td>
+					<el-table-column label="操作" fixed="right">
+						<template slot-scope="s">
+							<el-button  class="c-btn" type="danger"
+								@click="del(s.row)">移除
+							</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+				<!-- ------------- 分页 ------------- -->
+				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
+				</sa-item>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
+				},
+				el: '.vue-box',
+				data: {
+					p: { // 查询参数  
+						id: '', // 主键
+						typeId:sa.p('id',''),
+						pageNo: 1, // 当前页 
+						pageSize: 20, // 页大小 
+						sortType: 0 // 排序方式 
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合
+				},
+				methods: {
+					updateStatus: function(data) {
+						// 声明变量记录是否成功 
+						var isOk = false;
+						var oldValue = data.status;
+						var ajax = sa.ajax('/TbCostomer/updateStatus', {
+							id: data.id,
+							value: data.status
+						}, function(res) {
+							isOk = true;
+							sa.msg('修改成功');
+						}.bind(this));
+						// 如果未能修改成功, 则回滚 
+						$.when(ajax).done(function() {
+							if (isOk == false) {
+								data.status = oldValue;
+							}
+						})
+					},
+					// 新增
+					add: function(data) {
+						sa.showIframe('选择明细', 'tb-item-select.html?id='+this.p.typeId, '900px', '90%');
+					},
+					// 删除
+					del: function(data) {
+						sa.confirm('是否移除出该收费项?', function() {
+							sa.ajax('/TbItem/delete?id=' + data.id, function(res) {
+								sa.arrayDelete(this.dataList, data);
+								sa.ok('删除成功');
+								sa.f5TableHeight(); // 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+					// 刷新
+					f5: function() {
+						sa.ajax('/TbItem/getTypeItemList', sa.removeNull(this.p), function(res) {
+							let list = res.data;
+							this.dataList = list; // 数据
+							this.dataCount = res.dataCount; // 数据总数 
+							sa.f5TableHeight(); // 刷新表格高度 
+						}.bind(this));
+					},
+				},
+				created: function() {
+					this.f5();
+					sa.onInputEnter();
+				}
+			})
+		</script>
+	</body>
+</html>

+ 1 - 0
sp-server/app.pid

@@ -0,0 +1 @@
+14604

+ 64 - 0
sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItem.java

@@ -0,0 +1,64 @@
+package com.pj.project.relation_type_item;
+
+import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: relation_type_item -- 
+ * @author qzy 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(RelationTypeItem.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class RelationTypeItem extends Model<RelationTypeItem> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "relation_type_item";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "relation-type-item";	
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 *  
+	 */
+	private String id;
+
+	/**
+	 * 类型ID 
+	 */
+	private String typeId;
+
+	/**
+	 * 是否必须 
+	 */
+	private String need;	
+
+	/**
+	 * 明细ID 
+	 */
+	private String itemId;
+
+
+
+
+
+	
+
+
+}

+ 53 - 0
sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItemController.java

@@ -0,0 +1,53 @@
+package com.pj.project.relation_type_item;
+
+import java.util.List;
+
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: relation_type_item --
+ *
+ * @author qzy
+ */
+@RestController
+@RequestMapping("/RelationTypeItem/")
+public class RelationTypeItemController {
+
+    /**
+     * 底层 Service 对象
+     */
+    @Autowired
+    RelationTypeItemService relationTypeItemService;
+
+
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     */
+    @RequestMapping("getList")
+    public AjaxJson getList() {
+        SoMap so = SoMap.getRequestSoMap();
+        List<RelationTypeItem> list = relationTypeItemService.getList(so.startPage());
+        return AjaxJson.getPageData(so.getDataCount(), list);
+    }
+
+    @RequestMapping("setBatch")
+    public AjaxJson setBatch() {
+        SoMap so = SoMap.getRequestSoMap();
+        String typeId = so.getString("typeId");
+        String itemIds = so.getString("itemIds");
+       relationTypeItemService.setBatch(typeId,itemIds);
+        return AjaxJson.getSuccess();
+    }
+
+
+}

+ 28 - 0
sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItemMapper.java

@@ -0,0 +1,28 @@
+package com.pj.project.relation_type_item;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: relation_type_item -- 
+ * @author qzy 
+ */
+
+@Mapper
+@Repository
+public interface RelationTypeItemMapper extends BaseMapper <RelationTypeItem> {
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<RelationTypeItem> getList(SoMap so);
+
+
+}

+ 51 - 0
sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItemMapper.xml

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pj.project.relation_type_item.RelationTypeItemMapper">
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, type_id, need, item_id from relation_type_item  -->
+	
+	<!-- 通用映射:手动模式 -->
+	<resultMap id="model" type="com.pj.project.relation_type_item.RelationTypeItem">
+		<result property="id" column="id" />
+		<result property="typeId" column="type_id" />
+		<result property="need" column="need" />
+		<result property="itemId" column="item_id" />
+	</resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from relation_type_item 
+	</sql>
+	
+
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("typeId") '> and type_id = #{typeId} </if>
+			<if test=' this.has("need") '> and need = #{need} </if>
+			<if test=' this.has("itemId") '> and item_id = #{itemId} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> type_id desc </when>
+			<when test='sortType == 3'> need desc </when>
+			<when test='sortType == 4'> item_id desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 63 - 0
sp-server/src/main/java/com/pj/project/relation_type_item/RelationTypeItemService.java

@@ -0,0 +1,63 @@
+package com.pj.project.relation_type_item;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.project.tb_item.TbItem;
+import com.pj.project.tb_item.TbItemMapper;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.pj.utils.sg.*;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * Service: relation_type_item --
+ *
+ * @author qzy
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class RelationTypeItemService extends ServiceImpl<RelationTypeItemMapper, RelationTypeItem> implements IService<RelationTypeItem> {
+
+    /**
+     * 底层 Mapper 对象
+     */
+    @Autowired
+    RelationTypeItemMapper relationTypeItemMapper;
+
+
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     */
+    List<RelationTypeItem> getList(SoMap so) {
+        return relationTypeItemMapper.getList(so);
+    }
+
+    List<RelationTypeItem> findByTypeId(String typeId) {
+        QueryWrapper<RelationTypeItem> ew = new QueryWrapper<>();
+        ew.eq("type_id", typeId);
+        return list(ew);
+    }
+
+
+    public void setBatch(String typeId, String itemIds) {
+        List<String> itemIdList = StrUtil.splitTrim(itemIds, ",");
+        List<RelationTypeItem> list = findByTypeId(typeId);
+        List<String> removeIds = list.stream().filter(relationTypeItem -> !itemIdList.contains(relationTypeItem.getItemId())).map(RelationTypeItem::getId).collect(Collectors.toList());
+        this.removeByIds(removeIds);
+        List<String> dbItemIdList = list.stream().map(RelationTypeItem::getItemId).collect(Collectors.toList());
+        itemIdList.stream().filter(id -> !dbItemIdList.contains(id)).
+                forEach(id -> {
+                    RelationTypeItem relationTypeItem = new RelationTypeItem();
+                    relationTypeItem.setItemId(id).setTypeId(typeId).setNeed("1");
+                    this.save(relationTypeItem);
+                });
+
+    }
+}

+ 134 - 123
sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomer.java

@@ -1,8 +1,8 @@
 package com.pj.project.tb_costomer;
 
 import java.io.Serializable;
-import java.util.Arrays;
-import java.util.Date;
+import java.util.*;
+import java.util.stream.Collectors;
 
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.annotation.*;
@@ -14,10 +14,12 @@ import lombok.EqualsAndHashCode;
 import lombok.Data;
 import lombok.Getter;
 import lombok.experimental.Accessors;
+import org.omg.CORBA.IRObject;
 
 /**
  * Model: tb_costomer -- 客户管理
- * @author qzy 
+ *
+ * @author qzy
  */
 @Data
 @Accessors(chain = true)
@@ -25,126 +27,135 @@ import lombok.experimental.Accessors;
 @EqualsAndHashCode(callSuper = false)
 public class TbCostomer extends Model<TbCostomer> implements Serializable {
 
-	// ---------- 模块常量 ----------
-	/**
-	 * 序列化版本id 
-	 */
-	private static final long serialVersionUID = 1L;	
-	/**
-	 * 此模块对应的表名 
-	 */
-	public static final String TABLE_NAME = "tb_costomer";	
-	/**
-	 * 此模块对应的权限码 
-	 */
-	public static final String PERMISSION_CODE = "tb-costomer";
-	public static final String PARTNER_PERMISSION_CODE = "tb-partner";
-	public static final String PERMISSION_INFO = "tb-costomer-maintain";
-
-	// ---------- 表中字段 ----------
-	/**
-	 * 主键 
-	 */
-	private String id;
-
-	/**
-	 * 名称 
-	 */
-	private String name;	
-
-	/**
-	 * 联系号码 
-	 */
-	private String phone;	
-
-	/**
-	 * 负责人 
-	 */
-	private String dutyPeople;	
-
-	/**
-	 * 地址id 
-	 */
-	private String addressIds;	
-
-	/**
-	 * 地址 
-	 */
-	private String addressStr;	
-
-	/**
-	 * 营业执照 
-	 */
-	private String businessLicence;	
-
-	/**
-	 * 状态(0=否,1=是) 
-	 */
-	private Integer status;
-
-	/**
-	 * 创建时间 
-	 */
-	private Date creareTime=null;
-
-	/**
-	 * 审核状态(1=未审核,2审核通过,3审核不通过) 
-	 */
-	private Integer judgeStatus=1;
-
-	/**
-	 * 审核时间 
-	 */
-	private Date judgeTime=null;
-
-	/**
-	 * 审核意见 
-	 */
-	private String judgeContent;
-	/**
-	 * 结账方式(1=现结,2=月结)[j]
-	 */
-	private int payType;
-	/**
-	 * 类型0、理货员;1、消杀;2、装卸
-	 */
-	private String type="0";
-
-	@TableField(exist = false)
-	private String typeDes;
-
-	public String getTypeDes() {
-		String type=this.type;
-		StringBuilder sb=new StringBuilder();
-		StrUtil.splitTrim(type,",")
-				.forEach(t->{
-					sb.append(CustomerEnum.getDesc(t)).append("、");
-				});
-		return sb.substring(0,sb.lastIndexOf("、"));
-	}
-
-	@Getter
-	@AllArgsConstructor
-	public static enum CustomerEnum{
-		BUSINESS_TYPE("0","理货员"),
-		DISINFECT_TYPE("1","消杀"),
-		TAKE_TYPE("2","装卸"),
-		HESUAN_TYPE("3","核酸"),
-		;
-		private String type;
-		private String desc;
-		public static String getDesc(String type){
-			return Arrays.stream(CustomerEnum.values()).filter(customerEnum -> customerEnum.getType().equals(type))
-					.findFirst().orElseThrow(()->new BusinessException("不存在")).getDesc();
-		}
-	}
-
-
-
-
-
-
-	
+    // ---------- 模块常量 ----------
+    /**
+     * 序列化版本id
+     */
+    private static final long serialVersionUID = 1L;
+    /**
+     * 此模块对应的表名
+     */
+    public static final String TABLE_NAME = "tb_costomer";
+    /**
+     * 此模块对应的权限码
+     */
+    public static final String PERMISSION_CODE = "tb-costomer";
+    public static final String PARTNER_PERMISSION_CODE = "tb-partner";
+    public static final String PERMISSION_INFO = "tb-costomer-maintain";
+
+    // ---------- 表中字段 ----------
+    /**
+     * 主键
+     */
+    private String id;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 联系号码
+     */
+    private String phone;
+
+    /**
+     * 负责人
+     */
+    private String dutyPeople;
+
+    /**
+     * 地址id
+     */
+    private String addressIds;
+
+    /**
+     * 地址
+     */
+    private String addressStr;
+
+    /**
+     * 营业执照
+     */
+    private String businessLicence;
+
+    /**
+     * 状态(0=否,1=是)
+     */
+    private Integer status;
+
+    /**
+     * 创建时间
+     */
+    private Date creareTime = null;
+
+    /**
+     * 审核状态(1=未审核,2审核通过,3审核不通过)
+     */
+    private Integer judgeStatus = 1;
+
+    /**
+     * 审核时间
+     */
+    private Date judgeTime = null;
+
+    /**
+     * 审核意见
+     */
+    private String judgeContent;
+    /**
+     * 结账方式(1=现结,2=月结)[j]
+     */
+    private int payType;
+    /**
+     * 类型0、理货员;1、消杀;2、装卸
+     */
+    private String type = "0";
+
+    @TableField(exist = false)
+    private String typeDes;
+
+    public String getTypeDes() {
+        String type = this.type;
+        StringBuilder sb = new StringBuilder();
+        StrUtil.splitTrim(type, ",")
+                .forEach(t -> {
+                    sb.append(CustomerEnum.getDesc(t)).append("、");
+                });
+        return sb.substring(0, sb.lastIndexOf("、"));
+    }
+
+    @Getter
+    @AllArgsConstructor
+    public static enum CustomerEnum {
+        BUSINESS_TYPE("0", "理货员"),
+        DISINFECT_TYPE("1", "消杀"),
+        TAKE_TYPE("2", "装卸"),
+        HESUAN_TYPE("3", "核酸"),
+        ;
+        private String type;
+        private String desc;
+
+        public static String getDesc(String type) {
+            return Arrays.stream(CustomerEnum.values()).filter(customerEnum -> customerEnum.getType().equals(type))
+                    .findFirst().orElseThrow(() -> new BusinessException("不存在")).getDesc();
+        }
+
+        public static List<Map<String, String>> getList() {
+            List<Map<String, String>> list = new ArrayList<>();
+            for (CustomerEnum customerEnum : CustomerEnum.values()) {
+                if (customerEnum.getType().equals("0")) {
+                    continue;
+                }
+                Map<String, String> map = new HashMap<>();
+                map.put("id", customerEnum.getType());
+                map.put("name", customerEnum.getDesc());
+                list.add(map);
+            }
+            return list;
+        }
+
+    }
 
 
 }

+ 5 - 1
sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerController.java

@@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.pj.constants.UserTypeEnum;
 import com.pj.utils.so.SoMap;
+import org.aspectj.weaver.loadtime.Aj;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
@@ -164,6 +165,9 @@ public class TbCostomerController {
         costomers.add(0, tbCostomer);
         return AjaxJson.getSuccessData(costomers);
     }
-
+    @RequestMapping("getTypeList")
+    public AjaxJson getTypeList(){
+        return AjaxJson.getSuccessData(TbCostomer.CustomerEnum.getList());
+    }
 
 }

+ 3 - 0
sp-server/src/main/java/com/pj/project/tb_item/TbItem.java

@@ -68,4 +68,7 @@ public class TbItem extends Model<TbItem> implements Serializable {
     @TableField(exist = false)
     private String typeName;
 
+    @TableField(exist = false)
+    private Integer need;
+
 }

+ 14 - 6
sp-server/src/main/java/com/pj/project/tb_item/TbItemController.java

@@ -31,8 +31,7 @@ public class TbItemController {
 	@SaCheckPermission(TbItem.PERMISSION_CODE)
 	@Transactional(rollbackFor = Exception.class)
 	public AjaxJson add(TbItem t){
-		tbItemService.add(t);
-		t = tbItemService.getById(SP.publicMapper.getPrimarykey());
+		tbItemService.save(t);
 		return AjaxJson.getSuccessData(t);
 	}
 
@@ -40,8 +39,8 @@ public class TbItemController {
 	@RequestMapping("delete")
 	@SaCheckPermission(TbItem.PERMISSION_CODE)
 	public AjaxJson delete(Long id){
-		int line = tbItemService.delete(id);
-		return AjaxJson.getByLine(line);
+		tbItemService.delete(id);
+		return AjaxJson.getSuccess();
 	}
 	
 	/** 删 - 根据id列表 */  
@@ -57,8 +56,8 @@ public class TbItemController {
 	@RequestMapping("update")
 	@SaCheckPermission(TbItem.PERMISSION_CODE)
 	public AjaxJson update(TbItem t){
-		int line = tbItemService.update(t);
-		return AjaxJson.getByLine(line);
+		tbItemService.updateById(t);
+		return AjaxJson.getSuccess();
 	}
 
 	/** 查 - 根据id */  
@@ -77,6 +76,15 @@ public class TbItemController {
 		return AjaxJson.getPageData(so.getDataCount(), list);
 	}
 
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	@RequestMapping("getTypeItemList")
+	public AjaxJson getTypeItemList() {
+		SoMap so = SoMap.getRequestSoMap();
+		so.put("status",1);
+		List<TbItem> list = tbItemService.getTypeItemList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+
     /** 改 - 状态(0=否,1=是) */
     @RequestMapping("updateStatus")
     @SaCheckPermission(TbItem.PERMISSION_CODE)

+ 1 - 26
sp-server/src/main/java/com/pj/project/tb_item/TbItemMapper.java

@@ -17,33 +17,7 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface TbItemMapper extends BaseMapper <TbItem> {
 
-	/**
-	 * 增  
-	 * @param t 实体对象 
-	 * @return 受影响行数 
-	 */
-	int add(TbItem t);
-
-	/**
-	 * 删  
-	 * @param id 要删除的数据id  
-	 * @return 受影响行数 
-	 */
-	int delete(Long id);	 
-
-	/** 
-	 * 改  
-	 * @param t 实体对象 
-	 * @return 受影响行数 
-	 */
-	int update(TbItem t);
 
-	/** 
-	 * 查 - 根据id  
-	 * @param id 要查询的数据id 
-	 * @return 实体对象 
-	 */
-	TbItem getById(Long id);	 
 
 	/**
 	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
@@ -53,4 +27,5 @@ public interface TbItemMapper extends BaseMapper <TbItem> {
 	List<TbItem> getList(SoMap so);
 
 
+	List<TbItem> getTypeItemList(SoMap soMap);
 }

+ 18 - 43
sp-server/src/main/java/com/pj/project/tb_item/TbItemMapper.xml

@@ -2,35 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.pj.project.tb_item.TbItemMapper">
 
-    <!-- 增 [G] -->
-    <insert id="add">
-		insert into 
-		tb_item (id, type_id, item_code, item_name, price, unit, car_length, max_weight, status)
-		values (#{id}, #{typeId}, #{itemCode}, #{itemName}, #{price}, #{unit}, #{carLength}, #{maxWeight}, #{status})
-	</insert>
-
-    <!-- 删 -->
-    <delete id="delete">
-		delete from tb_item
-		where id = #{id}
-	</delete>
-
-    <!-- 改 [G] -->
-    <update id="update">
-		update tb_item set
-		id = #{id},
-		type_id = #{typeId},
-		item_code = #{itemCode},
-		item_name = #{itemName},
-		price = #{price},
-		unit = #{unit},
-		car_length =  #{carLength},
-		max_weight = #{maxWeight},
-		status = #{status}
-		where id = #{id}
-	</update>
-
-
     <!-- ================================== 查询相关 ================================== -->
     <!-- select id, type_id, type_name, item_code, item_name, price, unit from tb_item  -->
 
@@ -55,12 +26,6 @@
 		from tb_item
 	</sql>
 
-	<!-- 查 - 根据id -->
-	<select id="getById" resultMap="model">
-		<include refid="select_sql"></include>
-		where id = #{id}
-	</select>
-
 	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
 	<select id="getList" resultMap="model">
 		<include refid="select_sql"></include>
@@ -85,14 +50,24 @@
 			<otherwise> id desc </otherwise>
 		</choose>
 	</select>
-
-
-
-
-
-
-
-
+    <select id="getTypeItemList" resultType="com.pj.project.tb_item.TbItem">
+         SELECT
+            a.id,
+            a.item_name,
+            a.price,
+            a.car_length,
+            a.min_length,
+            a.min_weight,
+            a.max_weight,
+            b.need,
+            a.unit
+        FROM
+            tb_item a,
+            relation_type_item b
+        WHERE
+            a.id = b.item_id
+           	and b.type_id=#{typeId}
+    </select>
 
 
 </mapper>

+ 28 - 31
sp-server/src/main/java/com/pj/project/tb_item/TbItemService.java

@@ -17,39 +17,36 @@ import javax.annotation.Resource;
 
 /**
  * Service: tb_item -- 作业配置项
- * @author qzy 
+ *
+ * @author qzy
  */
 @Service
-public class TbItemService extends ServiceImpl<TbItemMapper,TbItem> implements IService<TbItem> {
-
-	/** 底层 Mapper 对象 */
-	@Autowired
-	TbItemMapper tbItemMapper;
-
-	/** 增 */
-	int add(TbItem t){
-		return tbItemMapper.add(t);
-	}
-
-	/** 删 */
-	int delete(Long id){
-		return tbItemMapper.delete(id);
-	}
-
-	/** 改 */
-	int update(TbItem t){
-		return tbItemMapper.update(t);
-	}
-
-	/** 查 */
-	TbItem getById(Long id){
-		return tbItemMapper.getById(id);
-	}
-
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
-	List<TbItem> getList(SoMap so) {
+public class TbItemService extends ServiceImpl<TbItemMapper, TbItem> implements IService<TbItem> {
+
+    /**
+     * 底层 Mapper 对象
+     */
+    @Autowired
+    TbItemMapper tbItemMapper;
+
+
+    /**
+     * 删
+     */
+    void delete(Long id) {
+        this.removeById(id);
+    }
+
+
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     */
+    List<TbItem> getList(SoMap so) {
         return tbItemMapper.getList(so);
-	}
-	
+    }
+
 
+    public List<TbItem> getTypeItemList(SoMap soMap) {
+        return tbItemMapper.getTypeItemList(soMap);
+    }
 }

+ 1 - 0
sp-server/src/main/java/com/pj/project/tb_item_type/TbItemType.java

@@ -66,6 +66,7 @@ public class TbItemType extends Model<TbItemType> implements Serializable {
 	 */
 	private String businessType="0";
 	private Integer business=1;
+	private Integer sort;
 
 	@TableField(exist = false)
 	private List<TbItem>items=new ArrayList<>();

+ 76 - 78
sp-server/src/main/java/com/pj/project/tb_item_type/TbItemTypeController.java

@@ -1,5 +1,6 @@
 package com.pj.project.tb_item_type;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 import com.pj.utils.so.SoMap;
@@ -16,88 +17,85 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 
 /**
  * Controller: tb_item_type -- 业务项类型
- * @author qzy 
+ *
+ * @author qzy
  */
 @RestController
 @RequestMapping("/TbItemType/")
 public class TbItemTypeController {
 
-	/** 底层 Service 对象 */
-	@Autowired
-	TbItemTypeService tbItemTypeService;
-
-	/** 增 */  
-	@RequestMapping("add")
-	@SaCheckPermission(TbItemType.PERMISSION_CODE)
-	@Transactional(rollbackFor = Exception.class)
-	public AjaxJson add(TbItemType t){
-		tbItemTypeService.add(t);
-		t = tbItemTypeService.getById(SP.publicMapper.getPrimarykey()+"");
-		return AjaxJson.getSuccessData(t);
-	}
-
-	/** 删 */  
-	@RequestMapping("delete")
-	@SaCheckPermission(TbItemType.PERMISSION_CODE)
-	public AjaxJson delete(String id){
-		int line = tbItemTypeService.delete(id);
-		return AjaxJson.getByLine(line);
-	}
-	
-	/** 删 - 根据id列表 */  
-	@RequestMapping("deleteByIds")
-	@SaCheckPermission(TbItemType.PERMISSION_CODE)
-	public AjaxJson deleteByIds(){
-		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
-		int line = SP.publicMapper.deleteByIds(TbItemType.TABLE_NAME, ids);
-		return AjaxJson.getByLine(line);
-	}
-	
-	/** 改 */  
-	@RequestMapping("update")
-	public AjaxJson update(TbItemType t){
-		tbItemTypeService.updateById(t);
-		return AjaxJson.getSuccess();
-	}
-
-	/** 查 - 根据id */  
-	@RequestMapping("getById")
-	public AjaxJson getById(String id){
-		TbItemType t = tbItemTypeService.getById(id);
-		return AjaxJson.getSuccessData(t);
-	}
-
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
-	@RequestMapping("getList")
-	public AjaxJson getList() { 
-		SoMap so = SoMap.getRequestSoMap();
-		List<TbItemType> list = tbItemTypeService.getList(so.startPage());
-		return AjaxJson.getPageData(so.getDataCount(), list);
-	}
-
-	
-	
-	// ------------------------- 前端接口 -------------------------
-	
-	
-	/** 改 - 不传不改 [G] */
-	@RequestMapping("updateByNotNull")
-	public AjaxJson updateByNotNull(String id){
-		AjaxError.throwBy(true, "如需正常调用此接口,请删除此行代码");
-		// 鉴别身份,是否为数据创建者 
-		long userId = SP.publicMapper.getColumnByIdToLong(TbItemType.TABLE_NAME, "user_id", id);
-		AjaxError.throwBy(userId != StpUserUtil.getLoginIdAsLong(), "此数据您无权限修改");
-		// 开始修改 (请只保留需要修改的字段)
-		SoMap so = SoMap.getRequestSoMap();
-		so.clearNotIn("id", "name", "need", "createTime", "unit").clearNull().humpToLineCase();	
-		int line = SP.publicMapper.updateBySoMapById(TbItemType.TABLE_NAME, so, id);
-		return AjaxJson.getByLine(line);
-	}
-	
-	
-	
-	
-	
-	
+    /**
+     * 底层 Service 对象
+     */
+    @Autowired
+    TbItemTypeService tbItemTypeService;
+
+    /**
+     * 增
+     */
+    @RequestMapping("add")
+    @SaCheckPermission(TbItemType.PERMISSION_CODE)
+    @Transactional(rollbackFor = Exception.class)
+    public AjaxJson add(TbItemType t) {
+        tbItemTypeService.save(t);
+        return AjaxJson.getSuccess();
+    }
+
+    /**
+     * 删
+     */
+    @RequestMapping("delete")
+    @SaCheckPermission(TbItemType.PERMISSION_CODE)
+    public AjaxJson delete(String id) {
+        tbItemTypeService.delete(id);
+        return AjaxJson.getSuccess();
+    }
+
+    /**
+     * 删 - 根据id列表
+     */
+    @RequestMapping("deleteByIds")
+    @SaCheckPermission(TbItemType.PERMISSION_CODE)
+    public AjaxJson deleteByIds() {
+        List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+        int line = SP.publicMapper.deleteByIds(TbItemType.TABLE_NAME, ids);
+        return AjaxJson.getByLine(line);
+    }
+
+    /**
+     * 改
+     */
+    @RequestMapping("update")
+    public AjaxJson update(TbItemType t) {
+        tbItemTypeService.updateById(t);
+        return AjaxJson.getSuccess();
+    }
+
+
+    /**
+     * 查 - 根据id
+     */
+    @RequestMapping("getById")
+    public AjaxJson getById(String id) {
+        TbItemType t = tbItemTypeService.getById(id);
+        return AjaxJson.getSuccessData(t);
+    }
+
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     */
+    @RequestMapping("getList")
+    public AjaxJson getList() {
+        SoMap so = SoMap.getRequestSoMap();
+        List<TbItemType> list = tbItemTypeService.getList(so.startPage());
+        return AjaxJson.getPageData(so.getDataCount(), list);
+    }
+
+
+
+
+    // ------------------------- 前端接口 -------------------------
+
+
 
 }

+ 0 - 25
sp-server/src/main/java/com/pj/project/tb_item_type/TbItemTypeMapper.java

@@ -17,33 +17,8 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface TbItemTypeMapper extends BaseMapper <TbItemType> {
 
-	/**
-	 * 增  
-	 * @param t 实体对象 
-	 * @return 受影响行数 
-	 */
-	int add(TbItemType t);
 
-	/**
-	 * 删  
-	 * @param id 要删除的数据id  
-	 * @return 受影响行数 
-	 */
-	int delete(String id);	 
 
-	/** 
-	 * 改  
-	 * @param t 实体对象 
-	 * @return 受影响行数 
-	 */
-	int update(TbItemType t);
-
-	/** 
-	 * 查 - 根据id  
-	 * @param id 要查询的数据id 
-	 * @return 实体对象 
-	 */
-	TbItemType getById(String id);	 
 
 	/**
 	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)

+ 3 - 33
sp-server/src/main/java/com/pj/project/tb_item_type/TbItemTypeMapper.xml

@@ -2,30 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.pj.project.tb_item_type.TbItemTypeMapper">
 
-	<!-- 增 [G] -->
-	<insert id="add">
-		insert into 
-		tb_item_type (id, name, need, tax_rate)
-		values (#{id}, #{name}, #{need}, #{taxRate})
-	</insert>
-
-	<!-- 删 -->
-	<delete id="delete">
-		delete from tb_item_type 
-		where id = #{id}
-	</delete>
-
-	<!-- 改 [G] -->
-	<update id="update">
-		update tb_item_type set
-		id = #{id}, 
-		name = #{name}, 
-		need = #{need},
-		tax_rate = #{taxRate},
-		where id = #{id}
-	</update>
-
-
 	<!-- ================================== 查询相关 ================================== -->
 	<!-- select id, name, need, create_time, unit from tb_item_type  -->
 	
@@ -40,19 +16,13 @@
 	
 	<!-- 公共查询sql片段 -->
 	<sql id="select_sql">
-		select * 
-		from tb_item_type 
+		select *
+		from tb_item_type
 	</sql>
 	<select id="getItems" resultType="com.pj.project.tb_item.TbItem">
 		select * from tb_item where type_id=#{id}
 	</select>
-	
-	<!-- 查 - 根据id -->
-	<select id="getById" resultMap="model">
-		<include refid="select_sql"></include>
-		where id = #{id}
-	</select>
-	
+
 	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
 	<select id="getList" resultMap="model">
 		<include refid="select_sql"></include>

+ 4 - 11
sp-server/src/main/java/com/pj/project/tb_item_type/TbItemTypeService.java

@@ -21,24 +21,17 @@ public class TbItemTypeService extends ServiceImpl<TbItemTypeMapper,TbItemType>
 	@Autowired
 	TbItemTypeMapper tbItemTypeMapper;
 
-	/** 增 */
-	int add(TbItemType t){
-		return tbItemTypeMapper.add(t);
-	}
+
 
 	/** 删 */
-	int delete(String id){
-		return tbItemTypeMapper.delete(id);
+	void delete(String id){
+		this.removeById(id);
 	}
 
-	/** 改 */
-	int update(TbItemType t){
-		return tbItemTypeMapper.update(t);
-	}
 
 	/** 查 */
 	TbItemType getById(String id){
-		return tbItemTypeMapper.getById(id);
+		return super.getById(id);
 	}
 
 	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  

+ 1 - 1
sp-server/src/main/resources/application-dev.yml

@@ -6,7 +6,7 @@ spring:
     # 数据源配置
     datasource:
         type: com.alibaba.druid.pool.DruidDataSource
-        url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://127.0.0.1:3306/pco_system?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
         username: root
         password: 123456
         # 是否打开sql监控台  (生产环境请务必关闭此选项)