瀏覽代碼

过滤条件

qzyReal 3 年之前
父節點
當前提交
bff20f48f6

+ 2 - 2
app/utils/request.js

@@ -1,6 +1,6 @@
-// const server = 'http://127.0.0.1:8099/pro';
+const server = 'http://127.0.0.1:8099/pro';
 // const server = 'https://pco.aseanbusiness.cn/pro';
-const server = 'https://dxkaa1.bgigc.com/pro';
+// const server = 'https://dxkaa1.bgigc.com/pro';
 
 import common from '../common/js/common.js';
 

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

@@ -318,8 +318,7 @@ var menuList = [{
 				id: 'tb-car-disincle-list',
 				name: '其他业务',
 				url: 'sa-view/tb-business/tb-car-disincle-list.html',
-				childList:[
-					{
+				childList: [{
 						id: 'tb-flex-business-add',
 						name: '添加业务',
 						isShow: false
@@ -340,7 +339,28 @@ var menuList = [{
 						isShow: false
 					},
 				]
-			}
+			},
+			{
+				id: 'tb-business-sort-list',
+				name: '业务顺序',
+				url: 'sa-view/tb-business-sort/tb-business-sort-list.html',
+				childList: [{
+						id: 'tb-business-sort-add',
+						name: '添加',
+						isShow: false
+					},
+					{
+						id: 'tb-business-sort-del',
+						name: '删除',
+						isShow: false
+					},
+					{
+						id: 'tb-business-sort-edit',
+						name: '修改',
+						isShow: false
+					},
+				]
+			},
 
 		]
 	},
@@ -353,8 +373,7 @@ var menuList = [{
 				id: 'tb-item-type-list',
 				name: '收费项管理',
 				url: 'sa-view/tb-item-type/tb-item-type-list.html',
-				childList:[
-					{
+				childList: [{
 						id: 'tb-item-type-add',
 						name: '添加收费项',
 						isShow: false
@@ -374,15 +393,14 @@ var menuList = [{
 						name: '删除收费项',
 						isShow: false
 					},
-					
+
 				]
 			},
 			{
 				id: 'tb-item-re-list',
 				name: '明细管理',
 				url: 'sa-view/tb-item-type/tb-item-list.html',
-				childList:[
-					{
+				childList: [{
 						id: 'tb-item-manager-add',
 						name: '添加明细',
 						isShow: false
@@ -438,8 +456,7 @@ var menuList = [{
 				},
 			]
 		}, ]
-	},
-	{
+	}, {
 		id: 'info-setting',
 		name: '信息设置',
 		icon: 'el-icon-monitor',
@@ -463,8 +480,7 @@ var menuList = [{
 				},
 			]
 		}, ]
-	},
-	{
+	}, {
 		id: 'tb-notices',
 		name: '消息管理',
 		icon: 'el-icon-news',
@@ -496,8 +512,7 @@ var menuList = [{
 			},
 
 		]
-	},
-	{
+	}, {
 		id: 'tb-charge-record',
 		name: '充值记录',
 		icon: 'el-icon-folder-opened',
@@ -507,8 +522,7 @@ var menuList = [{
 			name: '充值记录',
 			url: 'sa-view/tb-charge-record/tb-charge-record-list.html'
 		}, ]
-	},
-	{
+	}, {
 		id: 'tb-pay-record',
 		name: '支付记录',
 		icon: 'el-icon-folder-opened',
@@ -518,8 +532,7 @@ var menuList = [{
 			name: '支付记录',
 			url: 'sa-view/tb-pay-record/tb-pay-record-list.html'
 		}, ]
-	},
-	{
+	}, {
 		id: 'tb-declare',
 		name: '申报信息',
 		icon: 'el-icon-folder-opened',
@@ -546,8 +559,7 @@ var menuList = [{
 				},
 			]
 		}, ]
-	},
-	{
+	}, {
 		id: 'tb-disinfect',
 		name: '消毒信息',
 		icon: 'el-icon-folder-opened',
@@ -573,8 +585,7 @@ var menuList = [{
 				},
 			]
 		}, ]
-	},
-	{
+	}, {
 		id: 'tb-discount',
 		name: '折扣管理',
 		icon: 'el-icon-folder-opened',
@@ -605,8 +616,7 @@ var menuList = [{
 				},
 			]
 		}, ]
-	},
-	{
+	}, {
 		id: 'tb-fee-statistics',
 		name: '收费统计',
 		icon: 'el-icon-folder-opened',
@@ -633,4 +643,5 @@ var menuList = [{
 			},
 		]
 	},
+
 ]

+ 173 - 0
sp-admin/sa-view/tb-business-sort/tb-business-sort-add.html

@@ -0,0 +1,173 @@
+<!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: 130px;
+				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">
+						<div v-for="item in list" :key="item.index">
+							<div class="c-item" v-if="item.index>0">
+								<label class="c-label">间隔(分):</label>
+								<el-input-number class="item-num" v-model="item.interval" :step="10" :min="1" :max="9999">
+								</el-input-number>
+							</div>
+							<div class="c-item">
+								<label class="c-label">第{{item.index+1}}个:</label>
+								<el-select v-model="item.typeId" placeholder="请选择">
+									<el-option :label="type.name" :value="type.id"
+										v-for="(type,index) in item.businessTypeList">
+									</el-option>
+								</el-select>
+								<el-button @click="handlerAdd" v-if="item.index==0">添加项</el-button>
+								<el-button @click="handlerDel(item.index)" v-if="item.index>0">删除项</el-button>
+							</div>
+						</div>
+						<sa-item name="" class="s-ok" br>
+							<el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
+						</sa-item>
+					</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: null, // 实体对象 
+					list: [],
+					businessTypeList:[],
+				},
+				methods: {
+					handlerAdd(){
+						let list=this.list;
+						this.list.push({
+							index: list.length,
+							typeId: '',
+							interval: 30,
+							businessTypeList: this.businessTypeList
+						})
+					},
+					handlerDel(index){
+						let list=this.list;
+						list.splice(index,1);
+						for(let i in list){
+							let obj=list[i];
+							if(obj.index>index){
+								obj.index=obj.index-1;
+							}
+						}
+						this.list=list;
+					},
+					getBusinessType() {
+						this.list = [];
+						sa.ajax('/TbCostomer/getTypeList', function(resp) {
+							let list=resp.data;
+							this.businessTypeList=list;
+							this.list.push({
+								index: 0,
+								typeId: '',
+								interval: 30,
+								businessTypeList: list
+							})
+						}.bind(this))
+					},
+					// 创建一个 默认Model 
+					createModel: function() {
+						return {
+							id: '', //  
+							name: '', //  
+							typeId: '',
+							typeName: '', //  
+							sort: '', //  
+						}
+					},
+					// 提交数据 
+					ok: function() {
+						// 表单校验 
+						let m = this.m;
+						sa.checkNull(m.id, '请输入 []');
+						sa.checkNull(m.name, '请输入 []');
+						sa.checkNull(m.typeName, '请输入 []');
+						sa.checkNull(m.sort, '请输入 []');
+
+						// 开始增加或修改
+						if (this.id <= 0) { // 添加
+							sa.ajax('/TbBusinessOrder/add', m, function(res) {
+								sa.alert('增加成功', this.clean);
+							}.bind(this));
+						} else { // 修改
+							sa.ajax('/TbBusinessOrder/update', m, function(res) {
+								sa.alert('修改成功', this.clean);
+							}.bind(this));
+						}
+					},
+					// 添加/修改 完成后的动作
+					clean: function() {
+						if (this.id == 0) {
+							this.m = this.createModel();
+						} else {
+							parent.app.f5(); // 刷新父页面列表
+							sa.closeCurrIframe(); // 关闭本页 
+						}
+					}
+				},
+				mounted: function() {
+					this.getBusinessType();
+					// 初始化数据 
+					if (this.id <= 0) {
+						this.m = this.createModel();
+					} else {
+						sa.ajax('/TbBusinessOrder/getById?id=' + this.id, function(res) {
+							this.m = res.data;
+							if (res.data == null) {
+								sa.alert('未能查找到 id=' + this.id + " 详细数据");
+							}
+						}.bind(this))
+					}
+				}
+			})
+		</script>
+	</body>
+</html>

+ 63 - 0
sp-admin/sa-view/tb-business-sort/tb-business-sort-info.html

@@ -0,0 +1,63 @@
+<!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">
+						<sa-info name="" br>{{m.id}}</sa-info>
+						<sa-info name="" br>{{m.name}}</sa-info>
+						<sa-info name="" br>{{m.typeName}}</sa-info>
+						<sa-info name="" br>{{m.sort}}</sa-info>
+					</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('/TbBusinessOrder/getById?id=' + this.id, function(res) {
+						this.m = res.data;
+						if(res.data == null) {
+							sa.alert('未能查找到 id=' + this.id + " 详细数据");
+						}
+					}.bind(this))
+				}
+			})
+			
+		</script>
+	</body>
+</html>

+ 126 - 0
sp-admin/sa-view/tb-business-sort/tb-business-sort-list.html

@@ -0,0 +1,126 @@
+<!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>
+				<!-- ------------- 快捷按钮 ------------- -->
+				<sa-item type="fast-btn" show="add,reset"></sa-item>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList" >
+					<sa-td name="名称" prop="name" ></sa-td>
+					<sa-td name="业务类型" prop="typeName" ></sa-td>
+					<sa-td name="顺序" prop="sort" ></sa-td>
+					<sa-td name="距离上一业务间隔" prop="intervalTime" ></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: '',		//  
+						name: '',		//  
+						typeName: '',		//  
+						sort: '',		//  
+						pageNo: 1,		// 当前页 
+						pageSize: 10,	// 页大小 
+						sortType: 0		// 排序方式 
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合 
+				},
+				methods: {
+					// 刷新
+					f5: function() {
+						sa.ajax('/TbBusinessOrder/getList', sa.removeNull(this.p), function(res) {
+							this.dataList = res.data; // 数据
+							this.dataCount = res.dataCount; // 数据总数 
+							sa.f5TableHeight();		// 刷新表格高度 
+						}.bind(this));
+					},
+					// 查看
+					get: function(data) {
+						sa.showIframe('数据详情', 'tb-business-sort-info.html?id=' + data.id, '1050px', '90%');
+					},
+					// 查看 - 根据选中的
+					getBySelect: function(data) {
+						var selection = this.$refs['data-table'].selection;
+						if(selection.length == 0) {
+							return sa.msg('请选择一条数据')
+						}
+						this.get(selection[0]);
+					},
+					// 修改
+					update: function(data) {
+						sa.showIframe('修改数据', 'tb-business-sort-add.html?id=' + data.id, '800px', '80%');
+					},
+					// 新增
+					add: function(data) {
+						sa.showIframe('新增数据', 'tb-business-sort-add.html?id=-1', '700px', '80%');
+					},
+					// 删除
+					del: function(data) {
+						sa.confirm('是否删除,此操作不可撤销', function() {
+							sa.ajax('/TbBusinessOrder/delete?id=' + data.id, function(res) {
+								sa.arrayDelete(this.dataList, data);
+								sa.ok('删除成功');
+								sa.f5TableHeight();		// 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+					// 批量删除
+					deleteByIds: function() {
+						// 获取选中元素的id列表 
+						let selection = this.$refs['data-table'].selection;
+						let ids = sa.getArrayField(selection, 'id');
+						if(selection.length == 0) {
+							return sa.msg('请至少选择一条数据')
+						}
+						// 提交删除 
+						sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
+							sa.ajax('/TbBusinessOrder/deleteByIds', {ids: ids.join(',')}, function(res) {
+								sa.arrayDelete(this.dataList, selection);
+								sa.ok('删除成功');
+								sa.f5TableHeight();		// 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+				},
+				created: function() {
+					this.f5();
+					sa.onInputEnter();
+				}
+			})
+		</script>
+	</body>
+</html>

+ 24 - 0
sp-server/src/main/java/com/pj/api/service/ApiService.java

@@ -27,6 +27,8 @@ import com.pj.project.tb_business_car.TbBusinessCar;
 import com.pj.project.tb_business_car.TbBusinessCarService;
 import com.pj.project.tb_business_item.TbBusinessItem;
 import com.pj.project.tb_business_item.TbBusinessItemService;
+import com.pj.project.tb_business_sort.TbBusinessSort;
+import com.pj.project.tb_business_sort.TbBusinessSortService;
 import com.pj.project.tb_car.TbCar;
 import com.pj.project.tb_car.TbCarService;
 import com.pj.project.tb_costomer.TbCostomer;
@@ -109,6 +111,9 @@ public class ApiService {
     @Resource
     private TbItemTypeService tbItemTypeService;
 
+    @Resource
+    private TbBusinessSortService tbBusinessSortService;
+
     private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
 
 
@@ -307,6 +312,23 @@ public class ApiService {
             throw new BusinessException("请选择明细");
         }
         String carNo = otherBusinessBO.getCarNo().trim().toUpperCase();
+        SoMap soMap = SoMap.getRequestSoMap();
+        List<TbBusinessSort> sorts = tbBusinessSortService.getList(soMap);
+        LocalDateTime now = LocalDateTime.now();
+        int i = 1;
+        for (TbBusinessSort tbBusinessSort : sorts) {
+            if (i > 1) {
+                TbBusinessSort beforeItem = sorts.get(i - 1);
+                String typeId = beforeItem.getTypeId();
+                Integer interval = tbBusinessSort.getIntervalTime();
+                LocalDateTime endTime = now.minusMinutes(interval);
+                int count = tbBusinessCarService.checkCarBusinessType(typeId, carNo, endTime.toString());
+                if (count > 0) {
+                    throw new BusinessException(beforeItem.getTypeName() + "后" + tbBusinessSort.getIntervalTime() + "才可以执行" + tbBusinessSort.getTypeName());
+                }
+            }
+            i++;
+        }
         for (TbItem tbItem1 : tbItems) {
             List<TbBusinessCar> tbBusinessCarList = tbBusinessCarService.findTodayRecord(carNo, tbItem1.getId());
             if (!tbBusinessCarList.isEmpty()) {
@@ -329,6 +351,8 @@ public class ApiService {
             }
         }
         TbBusiness tbBusiness = new TbBusiness();
+        db.setBusinessType(TbBusiness.BusinessType.CAR_DISINCLE.getCode());
+        tbBusinessCarService.updateById(db);
         tbBusiness.setBusinessCarId(db.getId()).setPayStep(tbItemType.getPayStep());
         TbCostomer tbCostomer = tbCostomerService.getById(customerId);
         if (tbCostomer != null) {

+ 2 - 0
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarMapper.java

@@ -36,4 +36,6 @@ public interface TbBusinessCarMapper extends BaseMapper<TbBusinessCar> {
     List<TbBusinessCar> searchOtherBusinessCar(String carNo);
 
     List<TbBusinessCar> findTodayRecord(@Param("carNo") String carNo, @Param("itemId") String itemId);
+
+    int checkCarBusinessType(@Param("typeId")String typeId, @Param("carNo")String carNo,@Param("timeEnd") String timeEnd);
 }

+ 18 - 4
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarMapper.xml

@@ -45,16 +45,16 @@
                 and   real_out_time is  null
             </if>
             <if test="leaveStart!=null and leaveStart !=''">
-              and  date_format(real_out_time,'%Y-%m-%d %H:%m:%s') &gt;=#{leaveStart}
+              and  date_format(real_out_time,'%Y-%m-%d %H:%i:%s') &gt;=#{leaveStart}
             </if>
             <if test="leaveEnd!=null and leaveEnd !=''">
-                and  date_format(real_out_time,'%Y-%m-%d %H:%m:%s') &lt;=#{leaveEnd}
+                and  date_format(real_out_time,'%Y-%m-%d %H:%i:%s') &lt;=#{leaveEnd}
             </if>
             <if test="inStart!=null and inStart !=''">
-                and  date_format(real_in_time,'%Y-%m-%d %H:%m:%s') &gt;=#{inStart}
+                and  date_format(real_in_time,'%Y-%m-%d %H:%i:%s') &gt;=#{inStart}
             </if>
             <if test="inEnd!=null and inEnd !=''">
-                and  date_format(real_in_time,'%Y-%m-%d %H:%m:%s') &lt;=#{inEnd}
+                and  date_format(real_in_time,'%Y-%m-%d %H:%i:%s') &lt;=#{inEnd}
             </if>
             <if test="color !=null and color !='' and color !='其他'">
                 and color=#{color}
@@ -122,6 +122,20 @@
          and c.item_id=#{itemId};
 
     </select>
+    <select id="checkCarBusinessType" resultType="java.lang.Integer">
+        SELECT
+            count(a.id)
+            FROM
+            tb_business_car a,
+            tb_business b,
+            tb_business_item c
+        WHERE
+            a.id = b.business_car_id
+            AND b.id = c.business_id
+        AND car_no=#{carNo}
+        and c.business_type=#{typeId}
+        and DATE_FORMAT(c.create_time,'%y-%m-%d %H:%i') &lt;=#{timeEnd}
+    </select>
 
 
 </mapper>

+ 4 - 0
sp-server/src/main/java/com/pj/project/tb_business_car/TbBusinessCarService.java

@@ -391,4 +391,8 @@ public class TbBusinessCarService extends ServiceImpl<TbBusinessCarMapper, TbBus
     public List<TbBusinessCar> findTodayRecord(String carNo, String itemId) {
         return tbBusinessCarMapper.findTodayRecord(carNo,itemId);
     }
+
+    public int checkCarBusinessType(String typeId, String carNo, String timeEnd) {
+        return tbBusinessCarMapper.checkCarBusinessType(typeId,carNo,timeEnd);
+    }
 }

+ 68 - 0
sp-server/src/main/java/com/pj/project/tb_business_sort/TbBusinessSort.java

@@ -0,0 +1,68 @@
+package com.pj.project.tb_business_sort;
+
+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: tb_business_order -- 业务顺序
+ * @author qzy 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbBusinessSort.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbBusinessSort extends Model<TbBusinessSort> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "tb_business_sort";
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "tb_business_sort";
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 *  
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 *  
+	 */
+	private String name;	
+
+	/**
+	 *  
+	 */
+	private String typeId;
+
+	private String typeName;
+
+	/**
+	 *  
+	 */
+	private Integer sort=1;
+	private Integer intervalTime=30;
+
+
+
+
+
+	
+
+
+}

+ 92 - 0
sp-server/src/main/java/com/pj/project/tb_business_sort/TbBusinessSortController.java

@@ -0,0 +1,92 @@
+package com.pj.project.tb_business_sort;
+
+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: tb_business_order -- 业务顺序
+ * @author qzy 
+ */
+@RestController
+@RequestMapping("/TbBusinessOrder/")
+public class TbBusinessSortController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbBusinessSortService tbBusinessSortService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(TbBusinessSort.PERMISSION_CODE)
+	@Transactional(rollbackFor = Exception.class)
+	public AjaxJson add(TbBusinessSort t){
+		tbBusinessSortService.add(t);
+		t = tbBusinessSortService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(TbBusinessSort.PERMISSION_CODE)
+	public AjaxJson delete(Long id){
+		tbBusinessSortService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbBusinessSort.PERMISSION_CODE)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(TbBusinessSort.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(TbBusinessSort.PERMISSION_CODE)
+	public AjaxJson update(TbBusinessSort t){
+		tbBusinessSortService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+	public AjaxJson getById(Long id){
+		TbBusinessSort t = tbBusinessSortService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbBusinessSort> list = tbBusinessSortService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	
+	// ------------------------- 前端接口 -------------------------
+	
+	
+
+	
+	
+	
+	
+	
+
+}

+ 29 - 0
sp-server/src/main/java/com/pj/project/tb_business_sort/TbBusinessSortMapper.java

@@ -0,0 +1,29 @@
+package com.pj.project.tb_business_sort;
+
+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: tb_business_order -- 业务顺序
+ * @author qzy 
+ */
+
+@Mapper
+@Repository
+public interface TbBusinessSortMapper extends BaseMapper <TbBusinessSort> {
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<TbBusinessSort> getList(SoMap so);
+
+
+}

+ 51 - 0
sp-server/src/main/java/com/pj/project/tb_business_sort/TbBusinessSortMapper.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.tb_business_sort.TbBusinessSortMapper">
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, name, type_name, sort from tb_business_sort  -->
+	
+	<!-- 通用映射:手动模式 -->
+	<resultMap id="model" type="com.pj.project.tb_business_sort.TbBusinessSort">
+		<result property="id" column="id" />
+		<result property="name" column="name" />
+		<result property="typeName" column="type_name" />
+		<result property="sort" column="sort" />
+	</resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from tb_business_sort 
+	</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("name") '> and name = #{name} </if>
+			<if test=' this.has("typeName") '> and type_name = #{typeName} </if>
+			<if test=' this.has("sort") '> and sort = #{sort} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> name desc </when>
+			<when test='sortType == 3'> type_name desc </when>
+			<when test='sortType == 4'> sort desc </when>
+			<otherwise> sort asc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 50 - 0
sp-server/src/main/java/com/pj/project/tb_business_sort/TbBusinessSortService.java

@@ -0,0 +1,50 @@
+package com.pj.project.tb_business_sort;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.pj.project.tb_costomer.TbCostomer;
+import com.pj.project.tb_costomer.TbCostomerMapper;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * Service: tb_business_order -- 业务顺序
+ * @author qzy 
+ */
+@Service
+public class TbBusinessSortService extends ServiceImpl<TbBusinessSortMapper, TbBusinessSort> implements IService<TbBusinessSort> {
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbBusinessSortMapper tbBusinessOrderMapper;
+
+	/** 增 */
+	void add(TbBusinessSort t){
+		 super.save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		 this.removeById(id);
+	}
+
+	/** 改 */
+	void update(TbBusinessSort t){
+		this.updateById(t);
+	}
+
+	/** 查 */
+	TbBusinessSort getById(Long id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	public List<TbBusinessSort> getList(SoMap so) {
+		return tbBusinessOrderMapper.getList(so);	
+	}
+	
+
+}