ylx 7 anni fa
parent
commit
547d77b48f

+ 2 - 2
saicLogistics/src/main/java/com/fuzamei/mapper/CargoDeliverMapper.xml

@@ -22,7 +22,7 @@
 			<if test="orderId!=null">
 				and o.order_id=#{orderId}
 			</if>
-			<if test="carNo!=null">
+			<if test="carNo!=null and carNo!=''">
 				and o.car_no=#{carNo}
 			</if>
 			<if test="statusId!=null">
@@ -47,7 +47,7 @@
 			<if test="orderId!=null">
 				and order_id=#{orderId}
 			</if>
-			<if test="carNo!=null">
+			<if test="carNo!=null and carNo!=''">
 				and car_no=#{carNo}
 			</if>
 			<if test="statusId!=null">

+ 2 - 2
saicLogistics/src/main/java/com/fuzamei/mapper/CargoTallyMapper.xml

@@ -23,7 +23,7 @@
 			<if test="orderId!=null">
 				and o.order_id=#{orderId}
 			</if>
-			<if test="boxNo!=null">
+			<if test="boxNo!=null and boxNo!=''">
 				and o.box_no=#{boxNo}
 			</if>
 			<if test="statusId!=null">
@@ -47,7 +47,7 @@
 			<if test="orderId!=null">
 				and order_id=#{orderId}
 			</if>
-			<if test="boxNo!=null">
+			<if test="boxNo!=null and boxNo!=''">
 				and box_no=#{boxNo}
 			</if>
 			<if test="statusId!=null">

+ 6 - 6
saicLogistics/src/main/java/com/fuzamei/mapper/OrdersIssueMapper.xml

@@ -25,10 +25,10 @@
 			o.supplier_id=u.user_id
 		<where>
 			o.planner_id=#{userId}
-			<if test="supplierName!=null">
+			<if test="supplierName!=null and supplierName!=''">
 				and u.person_name=#{supplierName}
 			</if>
-			<if test="boxNo!=null">
+			<if test="boxNo!=null and boxNo!=''">
 				and o.box_no=#{boxNo}
 			</if>
 			<if test="statusId!=null">
@@ -63,10 +63,10 @@
 				o.supplier_id=u.user_id
 			<where>
 				o.planner_id=#{userId}
-				<if test="supplierName!=null">
+				<if test="supplierName!=null and supplierName!=''">
 					and u.person_name=#{supplierName}
 				</if>
-				<if test="boxNo!=null">
+				<if test="boxNo!=null and boxNo!=''">
 					and o.box_no=#{boxNo}
 				</if>
 				<if test="statusId!=null">
@@ -98,7 +98,7 @@
 			<if test="orderId!=null">
 				and o.order_id=#{orderId}
 			</if>
-			<if test="boxNo!=null">
+			<if test="boxNo!=null and boxNo!=''">
 				and o.box_no=#{boxNo}
 			</if>
 			<if test="statusId!=null">
@@ -122,7 +122,7 @@
 			<if test="orderId!=null">
 				and o.order_id=#{orderId}
 			</if>
-			<if test="boxNo!=null">
+			<if test="boxNo!=null and boxNo!=''">
 				and o.box_no=#{boxNo}
 			</if>
 			<if test="statusId!=null">

+ 1 - 3
saicLogistics/src/main/java/com/fuzamei/web/OrdersIssueAction.java

@@ -87,7 +87,6 @@ public class OrdersIssueAction {
 			params.setUserId(Integer.parseInt(userId));
 			int page = ValidationUtil.checkMinAndAssignInt(params.getPage(), 1);
 			int rowNum = ValidationUtil.checkMinAndAssignInt(params.getRowNum(), 1);
-			params.setStatusId(ValidationUtil.checkAndAssignNullIntegerIfIsBlank(params.getStatusId()));
 			Long startTime=ValidationUtil.checkAndAssignDefaultLong(params.getStartTime(), 0L);
 			Long endTime=ValidationUtil.checkAndAssignDefaultLong(params.getEndTime(), Long.MAX_VALUE);
 			params.setStartTime(startTime);
@@ -198,8 +197,7 @@ public class OrdersIssueAction {
 	public Map<String, Object> addOrder(@RequestBody Params params){
 		try {
 			String userId = req.getHeader("Authorization").split("&")[1];
-			SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
-			params.setOrderId(ValidationUtil.checkAndAssignInt(sdf.format(new Date())+RandomUtil.getRandomDigits(3)));
+			params.setOrderId(ValidationUtil.checkAndAssignInt(new SimpleDateFormat("yyMMdd").format(new Date())+RandomUtil.getRandomDigits(3)));
 			orderService.checkIfHasTheSameId(ValidationUtil.checkAndAssignInt(params.getOrderId(),ORDER_ID_PATTERN));
 			params.setUserId(Integer.parseInt(userId));
 			UserDetail userDetail = userAuthoricationService.queryUserDetail(ValidationUtil.checkAndAssignInt(userId), Role.PLANNER);//检测当前操作用户权限