فهرست منبع

新增订单作废

pangjl 4 سال پیش
والد
کامیت
badda8b163
2فایلهای تغییر یافته به همراه53 افزوده شده و 4 حذف شده
  1. 26 4
      src/main/java/com/minpay/shouhuo/ShOrderManageAction.java
  2. 27 0
      src/main/webapp/admin/orderManage/orderManage.html

+ 26 - 4
src/main/java/com/minpay/shouhuo/ShOrderManageAction.java

@@ -5,13 +5,12 @@ import com.minpay.common.constant.Constant;
 import com.minpay.common.format.IFormatService;
 import com.minpay.common.service.ILogService;
 import com.minpay.common.service.IPublicService;
+import com.minpay.common.util.CommonUtil;
 import com.minpay.common.util.RegexUtil;
 import com.minpay.db.table.mapper.VmOrderDetailsMapper;
+import com.minpay.db.table.mapper.VmOrderInfMapper;
 import com.minpay.db.table.mapper.VmRechargeRuleMapper;
-import com.minpay.db.table.model.VmOrderDetails;
-import com.minpay.db.table.model.VmOrderDetailsExample;
-import com.minpay.db.table.model.VmRechargeRule;
-import com.minpay.db.table.model.VmRechargeRuleExample;
+import com.minpay.db.table.model.*;
 import com.minpay.db.table.own.mapper.OrderInfMapper;
 import com.minpay.db.table.own.mapper.ShOrderMapper;
 import com.mysql.jdbc.StringUtils;
@@ -45,6 +44,8 @@ import java.util.Map;
 public class ShOrderManageAction implements IMINAction {
 	public final static String	QUERY_ORDER				= "queryOrder";
 	public final static String	QUERY_ORDER_DETAILS				= "queryOrderDetails";
+	/** 订单作废 */
+	public final static String	ORDER_CANCEL				= "orderCancel";
 
 
 	/**
@@ -134,5 +135,26 @@ public class ShOrderManageAction implements IMINAction {
 		res.set(IMINBusinessConstant.F_PAGING_COUNT, rows.getCount());
 		return res;
 	}
+	@MINAction(value = ORDER_CANCEL)
+	public MINActionResult orderCancel(
+			MINSession session,
+			@MINParam(key = "id") String id,
+			MINHttpServletRequestContext fapRequest
+	) throws MINBusinessException {
+		MINActionResult res = new MINActionResult();
+		if (CommonUtil.isEmpty(id)){
+			throw new MINBusinessException("订单编号为空!");
+		}
+		VmOrderInf vmOrderInf = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmOrderInfMapper.class).selectByPrimaryKey(id);
+		if (null == vmOrderInf){
+			throw new MINBusinessException("订单信息不存在!");
+		}
+		vmOrderInf.setPickupStt("02");
+		Service.lookup(IMINDataBaseService.class)
+				.getMybatisMapper(VmOrderInfMapper.class)
+				.updateByPrimaryKeySelective(vmOrderInf);
 
+		// 设置返回值
+		return res;
+	}
 }

+ 27 - 0
src/main/webapp/admin/orderManage/orderManage.html

@@ -70,6 +70,9 @@
 <script src="../../js/min-loader-next.js"></script>
 <script type="text/html" id="barDemo">
 	<a class="layui-btn layui-btn-xs" lay-event="look">订单详情</a>
+	{{#  if(d.state == '00' && d.isUsed == '01' && d.pickupStt == '00' ){ }}
+	<a class="layui-btn layui-btn-xs" lay-event="cancel">订单作废</a>
+	{{#  } }}
 </script>
 <script>
 	$("#toggle").click(function() {
@@ -149,6 +152,30 @@
 			var tr = obj.tr; //获得当前行 tr 的DOM对象
 			if(layEvent === 'look'){ //详情
 				lookDetail(data);
+			}else if (layEvent ==='cancel'){
+				layer.confirm('真的要作废订单吗', function(index){
+					$.request({
+						action : '../../ShOrderManageAction/orderCancel',
+						data : {
+							id : id ,//订单id
+						},
+						success : function(data) {
+							//成功后刷新
+							var btn=$(".layui-laypage-btn")[0];
+							btn.click();
+							layer.alert('操作成功!', {
+								icon: 6,
+								title: "提示"
+							});
+						},
+						error : function(data) {
+							layer.alert('操作失败!', {
+								icon: 5,
+								title: "提示"
+							});
+						}
+					});
+				});
 			}
 		});