ylx 7 年之前
父節點
當前提交
ba4ece4e94
共有 27 個文件被更改,包括 1188 次插入25 次删除
  1. 51 9
      saicLogistics/src/main/java/com/fuzamei/entity/Param.java
  2. 126 0
      saicLogistics/src/main/java/com/fuzamei/mapper/CargoConsignMapper.xml
  3. 54 0
      saicLogistics/src/main/java/com/fuzamei/mapper/CargoDeliverMapper.xml
  4. 67 0
      saicLogistics/src/main/java/com/fuzamei/mapper/CargoTallyMapper.xml
  5. 103 2
      saicLogistics/src/main/java/com/fuzamei/mapper/OrdersIssueMapper.xml
  6. 14 0
      saicLogistics/src/main/java/com/fuzamei/mapper/UserAuthoricationMapper.xml
  7. 15 0
      saicLogistics/src/main/java/com/fuzamei/mapperInterface/CargoConsignMapper.java
  8. 9 0
      saicLogistics/src/main/java/com/fuzamei/mapperInterface/CargoDeliverMapper.java
  9. 11 0
      saicLogistics/src/main/java/com/fuzamei/mapperInterface/CargoTallyMapper.java
  10. 11 2
      saicLogistics/src/main/java/com/fuzamei/mapperInterface/OrdersIssueMapper.java
  11. 6 3
      saicLogistics/src/main/java/com/fuzamei/mapperInterface/UserAuthoricationMapper.java
  12. 13 0
      saicLogistics/src/main/java/com/fuzamei/service/CargoConsignService.java
  13. 9 0
      saicLogistics/src/main/java/com/fuzamei/service/CargoDeliverService.java
  14. 14 0
      saicLogistics/src/main/java/com/fuzamei/service/CargoTallyService.java
  15. 4 0
      saicLogistics/src/main/java/com/fuzamei/service/OrdersIssueService.java
  16. 5 0
      saicLogistics/src/main/java/com/fuzamei/service/UserAuthoricationService.java
  17. 59 0
      saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/CargoConsignServiceImpl.java
  18. 24 0
      saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/CargoDeliverServiceImpl.java
  19. 60 0
      saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/CargoTallyServiceImpl.java
  20. 29 1
      saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/OrdersIssueServiceImpl.java
  21. 8 0
      saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/UserAuthoricationServiceImpl.java
  22. 185 0
      saicLogistics/src/main/java/com/fuzamei/web/CargoConsignAction.java
  23. 88 0
      saicLogistics/src/main/java/com/fuzamei/web/CargoDeliverAction.java
  24. 148 0
      saicLogistics/src/main/java/com/fuzamei/web/CargoTallyAction.java
  25. 74 3
      saicLogistics/src/main/java/com/fuzamei/web/OrdersIssueAction.java
  26. 1 0
      saicLogistics/src/main/resources/conf.properties
  27. 0 5
      saicLogistics/src/test/java/com/fuzamei/web/UserDetailTest.java

+ 51 - 9
saicLogistics/src/main/java/com/fuzamei/entity/Param.java

@@ -11,6 +11,7 @@ public class Param {
 	private Integer page;				//页数
 	private Integer rowNum;				//单页显示条目数量
 	private Integer startPage;			//起始页
+	private String roleName;			//角色名
 	private String supplierName;		//供应商名称
 	private Integer supplierId;			//供应商id
 	private Integer plannerId;			//计划员id
@@ -20,11 +21,15 @@ public class Param {
 	private Integer statusId;			//状态id
 	private Integer orderId;			//订单id
 	private Integer carrierId;			//承运商id
+	private Integer receiverId;			//收货员id
 	private String carNo;				//车牌号
-	private Integer confirm;			//收货确认码1表示确认收货,0表示拒绝收货
+	private Integer confirmId;			//收货确认码1表示确认收货,0表示拒绝收货
 	private Long startTime;				//起始时间
 	private Long endTime;				//结束时间
 	private Long requireTime;			//需求时间
+	private Long sendTime;				//发货时间
+	private Long transportTime;			//承运时间
+	private Long tallyTime;				//点货时间
 	private Long createTime;			//创建时间
 	private Long updateTime;			//更新时间
 	private Integer operationTypeId;	//操作类型id
@@ -32,6 +37,36 @@ public class Param {
 	private Long operationTime;			//操作时间
 	private UserDetail userDetail;		//用户详细信息对象
 	private Orders order;				//整个订单详细信息
+	public Integer getReceiverId() {
+		return receiverId;
+	}
+	public void setReceiverId(Integer receiverId) {
+		this.receiverId = receiverId;
+	}
+	public Long getTransportTime() {
+		return transportTime;
+	}
+	public void setTransportTime(Long transportTime) {
+		this.transportTime = transportTime;
+	}
+	public Long getTallyTime() {
+		return tallyTime;
+	}
+	public void setTallyTime(Long tallyTime) {
+		this.tallyTime = tallyTime;
+	}
+	public String getRoleName() {
+		return roleName;
+	}
+	public void setRoleName(String roleName) {
+		this.roleName = roleName;
+	}
+	public Long getSendTime() {
+		return sendTime;
+	}
+	public void setSendTime(Long sendTime) {
+		this.sendTime = sendTime;
+	}
 	public Orders getOrder() {
 		return order;
 	}
@@ -164,11 +199,11 @@ public class Param {
 	public void setCarNo(String carNo) {
 		this.carNo = carNo;
 	}
-	public Integer getConfirm() {
-		return confirm;
+	public Integer getConfirmId() {
+		return confirmId;
 	}
-	public void setConfirm(Integer confirm) {
-		this.confirm = confirm;
+	public void setConfirmId(Integer confirmId) {
+		this.confirmId = confirmId;
 	}
 	public Long getStartTime() {
 		return startTime;
@@ -184,10 +219,17 @@ public class Param {
 	}
 	@Override
 	public String toString() {
-		return "Param [userId=" + userId + ", supplierName=" + supplierName + ", boxNo=" + boxNo + ", partNo=" + partNo
-				+ ", inboxQty=" + inboxQty + ", statusId=" + statusId + ", orderId=" + orderId + ", carrierId="
-				+ carrierId + ", carNo=" + carNo + ", confirm=" + confirm + ", startTime=" + startTime + ", endTime="
-				+ endTime + "]";
+		return "Param [userId=" + userId + ", page=" + page + ", rowNum=" + rowNum + ", startPage=" + startPage
+				+ ", roleName=" + roleName + ", supplierName=" + supplierName + ", supplierId=" + supplierId
+				+ ", plannerId=" + plannerId + ", boxNo=" + boxNo + ", partNo=" + partNo + ", inboxQty=" + inboxQty
+				+ ", statusId=" + statusId + ", orderId=" + orderId + ", carrierId=" + carrierId + ", carNo=" + carNo
+				+ ", confirmId=" + confirmId + ", startTime=" + startTime + ", endTime=" + endTime + ", requireTime="
+				+ requireTime + ", sendTime=" + sendTime + ", transportTime=" + transportTime + ", tallyTime="
+				+ tallyTime + ", createTime=" + createTime + ", updateTime=" + updateTime + ", operationTypeId="
+				+ operationTypeId + ", operatorId=" + operatorId + ", operationTime=" + operationTime + ", userDetail="
+				+ userDetail + ", order=" + order + "]";
 	}
 	
+	
+	
 }

+ 126 - 0
saicLogistics/src/main/java/com/fuzamei/mapper/CargoConsignMapper.xml

@@ -2,6 +2,132 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace = "com.fuzamei.mapperInterface.CargoConsignMapper">
 	
+	<select id="queryOrdersBySupplier" parameterType="Param" resultType="SendOrder">
+		select 
+			o.order_id,
+			u.person_name as carrier_name,
+			o.part_no,
+			o.box_no,
+			o.inbox_qty,
+			o.send_time,
+			o.update_time,
+			s.status_name
+		from 
+			orders o
+		left join 
+			status s
+		on 
+			o.status_id=s.status_id
+		left join 
+			user u
+		on 
+			o.carrier_id=u.user_id
+		<where>
+			o.supplier_id=#{supplierId}
+			<if test="orderId!=null">
+				and o.order_id=#{orderId}
+			</if>
+			<if test="boxNo!=null">
+				and o.box_no=#{boxNo}
+			</if>
+			<if test="statusId!=null">
+				and o.status_id=#{statusId}
+			</if>
+			<if test="startTime!=null and endTime!=null">
+				and o.require_time between #{startTime} and #{endTime}
+			</if>
+		</where>
+		limit #{startPage},#{rowNum}
+		order by o.require_time desc
+	</select>
 	
+	<select id="findQueryCountBySupplier" parameterType="Param" resultType="int">
+		select 
+			count(*)
+		from 
+			orders
+		<where>
+			supplier_id=#{supplierId}
+			<if test="orderId!=null">
+				and order_id=#{orderId}
+			</if>
+			<if test="boxNo!=null">
+				and box_no=#{boxNo}
+			</if>
+			<if test="statusId!=null">
+				and status_id=#{statusId}
+			</if>
+			<if test="startTime!=null and endTime!=null">
+				and require_time between #{startTime} and #{endTime}
+			</if>
+		</where>
+	</select>
+	
+	<select id="queryOrdersByCarrier" parameterType="Param" resultType="SendOrder">
+		select 
+			o.order_id,
+			o.part_no,
+			o.box_no,
+			o.inbox_qty,
+			o.send_time,
+			o.update_time,
+			s.status_name
+		from 
+			orders o
+		left join 
+			status s
+		on 
+			o.status_id=s.status_id
+		<where>
+			o.carrier_id=#{carrierId}
+			<if test="orderId!=null">
+				and o.order_id=#{orderId}
+			</if>
+			<if test="boxNo!=null">
+				and o.box_no=#{boxNo}
+			</if>
+			<if test="statusId!=null">
+				and o.status_id=#{statusId}
+			</if>
+			<if test="startTime!=null and endTime!=null">
+				and o.require_time between #{startTime} and #{endTime}
+			</if>
+		</where>
+		limit #{startPage},#{rowNum}
+		order by o.require_time desc
+	</select>
+	
+	<select id="findQueryCountByCarrier" parameterType="Param" resultType="int">
+		select 
+			count(*)
+		from 
+			orders
+		<where>
+			carrier_id=#{carrierId}
+			<if test="orderId!=null">
+				and order_id=#{orderId}
+			</if>
+			<if test="boxNo!=null">
+				and box_no=#{boxNo}
+			</if>
+			<if test="statusId!=null">
+				and status_id=#{statusId}
+			</if>
+			<if test="startTime!=null and endTime!=null">
+				and require_time between #{startTime} and #{endTime}
+			</if>
+		</where>
+	</select>
+	
+	<update id="doCarry">
+		update 
+			orders
+		set
+			transport_time=#{transportTime},
+			status_id=#{statusId},
+			update_time=#{updateTime}
+		where 
+			order_id=#{orderId}
+	</update>
 	
 </mapper>

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

@@ -2,6 +2,60 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace = "com.fuzamei.mapperInterface.CargoDeliverMapper">
 	
+	<select id="queryOrdersByCarrier" parameterType="Param" resultType="DeliverOrder">
+		select 
+			o.order_id,
+			o.box_no,
+			o.box_qty,
+			o.car_no,
+			o.transport_time,
+			o.update_time,
+			s.status_name
+		from 
+			orders o
+		left join 
+			status s
+		on 
+			o.status_id=s.status_id
+		<where>
+			o.carrier_id=#{userId}
+			<if test="orderId!=null">
+				and o.order_id=#{orderId}
+			</if>
+			<if test="carNo!=null">
+				and o.car_no=#{carNo}
+			</if>
+			<if test="statusId!=null">
+				and o.status_id=#{statusId}
+			</if>
+			<if test="startTime!=null and endTime!=null">
+				and o.require_time between #{startTime} and #{endTime}
+			</if>
+		</where>
+		limit #{startPage},#{rowNum}
+		order by o.require_time desc
+	</select>
 	
 	
+	<select id="findQueryCountByCarrier" parameterType="Param" resultType="int">
+		select 
+			count(*)
+		from 
+			orders
+		<where>
+			carrier_id=#{userId}
+			<if test="orderId!=null">
+				and order_id=#{orderId}
+			</if>
+			<if test="carNo!=null">
+				and car_no=#{carNo}
+			</if>
+			<if test="statusId!=null">
+				and status_id=#{statusId}
+			</if>
+			<if test="startTime!=null and endTime!=null">
+				and require_time between #{startTime} and #{endTime}
+			</if>
+		</where>
+	</select>
 </mapper>

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

@@ -2,6 +2,73 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace = "com.fuzamei.mapperInterface.CargoTallyMapper">
 	
+	<select id="queryOrdersByReceiver" parameterType="Param" resultType="TallyOrder">
+		select 
+			o.order_id,
+			o.part_no,
+			o.box_no,
+			o.box_qty,
+			o.car_no,
+			o.tally_time,
+			o.update_time,
+			s.status_name
+		from 
+			orders o
+		left join 
+			status s
+		on 
+			o.status_id=s.status_id
+		<where>
+			o.receiver_id=#{userId}
+			<if test="orderId!=null">
+				and o.order_id=#{orderId}
+			</if>
+			<if test="boxNo!=null">
+				and o.box_no=#{boxNo}
+			</if>
+			<if test="statusId!=null">
+				and o.status_id=#{statusId}
+			</if>
+			<if test="startTime!=null and endTime!=null">
+				and o.require_time between #{startTime} and #{endTime}
+			</if>
+		</where>
+		limit #{startPage},#{rowNum}
+		order by o.require_time desc
+	</select>
 	
+	<select id="findQueryCountByReceiver" parameterType="Param" resultType="int">
+		select 
+			count(*)
+		from 
+			orders
+		<where>
+			receiver_id=#{userId}
+			<if test="orderId!=null">
+				and order_id=#{orderId}
+			</if>
+			<if test="boxNo!=null">
+				and box_no=#{boxNo}
+			</if>
+			<if test="statusId!=null">
+				and status_id=#{statusId}
+			</if>
+			<if test="startTime!=null and endTime!=null">
+				and require_time between #{startTime} and #{endTime}
+			</if>
+		</where>
+	</select>
+	
+	<update id="confirmOrReject">
+		update 
+			orders
+		set
+			receiver_id=#{receiverId},
+			tally_time=#{tallyTime},
+			status_id=#{statusId},
+			update_time=#{updateTime}
+		where 
+			order_id=#{orderId}
+	</update>
 	
 </mapper>

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

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace = "com.fuzamei.mapperInterface.OrdersIssueMapper">
 	
-	<select id="queryOrdersByPlanner" parameterType="Param" resultType="Orders">
+	<select id="queryOrdersByPlanner" parameterType="Param" resultType="IssueOrder">
 		select 
 			o.order_id,
 			u.person_name as supplier_name,
@@ -23,8 +23,9 @@
 		on 
 			o.supplier_id=u.user_id
 		<where>
+			o.planner_id=#{userId}
 			<if test="supplierName!=null">
-				o.supplier_name=#{supplierName}
+				and o.supplier_name=#{supplierName}
 			</if>
 			<if test="boxNo!=null">
 				and o.box_no=#{boxNo}
@@ -37,6 +38,106 @@
 		order by o.require_time desc
 	</select>
 	
+	<select id="findQueryCountByPlanner" parameterType="Param" resultType="int">
+		select 
+			count(*) 
+		from
+			(select 
+				o.order_id,
+				u.person_name as supplier_name,
+				o.part_no,
+				o.box_no,
+				o.inbox_qty,
+				o.require_time,
+				o.update_time,
+			from 
+				orders o
+			left join 
+				users u
+			on 
+				o.supplier_id=u.user_id
+			<where>
+				o.planner_id=#{userId}
+				<if test="supplierName!=null">
+					and o.supplier_name=#{supplierName}
+				</if>
+				<if test="boxNo!=null">
+					and o.box_no=#{boxNo}
+				</if>
+				<if test="startTime!=null and endTime!=null">
+					and o.require_time between #{startTime} and #{endTime}
+				</if>
+			</where>) temp
+	</select>
+	
+	<select id="queryOrdersBySupplier" parameterType="Param" resultType="IssueOrder">
+		select 
+			o.order_id,
+			o.part_no,
+			o.box_no,
+			o.inbox_qty,
+			o.require_time,
+			o.update_time,
+			s.status_name
+		from 
+			orders o
+		left join 
+			status s
+		on 
+			o.status_id=s.status_id
+		<where>
+			o.supplier_id=#{userId}
+			<if test="orderId!=null">
+				and o.order_id=#{orderId}
+			</if>
+			<if test="boxNo!=null">
+				and o.box_no=#{boxNo}
+			</if>
+			<if test="statusId!=null">
+				and o.status_id=#{statusId}
+			</if>
+			<if test="startTime!=null and endTime!=null">
+				and o.require_time between #{startTime} and #{endTime}
+			</if>
+		</where>
+		limit #{startPage},#{rowNum}
+		order by o.require_time desc
+	</select>
+	
+	<select id="findQueryCountBySupplier" parameterType="Param" resultType="int">
+		select 
+			count(*)
+		from 
+			orders
+		<where>
+			supplier_id=#{userId}
+			<if test="orderId!=null">
+				and order_id=#{orderId}
+			</if>
+			<if test="boxNo!=null">
+				and box_no=#{boxNo}
+			</if>
+			<if test="statusId!=null">
+				and status_id=#{statusId}
+			</if>
+			<if test="startTime!=null and endTime!=null">
+				and require_time between #{startTime} and #{endTime}
+			</if>
+		</where>
+	</select>
+	
+	<update id="consignment">
+		update 
+			orders
+		set 
+			send_time=#{sendTime},
+			carrier_id=#{carrierId},
+			status_id=#{statusId},
+			update_time=#{updateTime}
+		where 
+			order_id=#{orderId}
+	</update>
+	
 	<!-- 插入新订单 -->
 	<insert id="addOrder">
 		insert into 

+ 14 - 0
saicLogistics/src/main/java/com/fuzamei/mapper/UserAuthoricationMapper.xml

@@ -96,4 +96,18 @@
 		where 
 			u.user_id=#{userId}
 	</select>
+	
+	<select id="showAllCarriersUnderSupplier" resultType="UserDetail">
+		select 
+			u.user_id,
+			u.person_name
+		from 
+			users u
+		left join 
+			role r
+		on 
+			u.role_id=r.role_id
+		where 
+			r.role_name=#{roleName}
+	</select>
 </mapper>

+ 15 - 0
saicLogistics/src/main/java/com/fuzamei/mapperInterface/CargoConsignMapper.java

@@ -1,5 +1,20 @@
 package com.fuzamei.mapperInterface;
 
+import java.util.List;
+
+import com.fuzamei.entity.Param;
+import com.fuzamei.entity.SendOrder;
+
 public interface CargoConsignMapper {
 
+	List<SendOrder> queryOrdersBySupplier(Param param);//供应商查询订单信息
+
+	int findQueryCountBySupplier(Param param);//供应商查询订单总数
+
+	List<SendOrder> queryOrdersByCarrier(Param param);//承运商查询订单信息
+
+	int findQueryCountByCarrier(Param param);//承运商查询订单总数
+
+	void doCarry(Param param);//承运商点击承运操作
+
 }

+ 9 - 0
saicLogistics/src/main/java/com/fuzamei/mapperInterface/CargoDeliverMapper.java

@@ -1,5 +1,14 @@
 package com.fuzamei.mapperInterface;
 
+import java.util.List;
+
+import com.fuzamei.entity.DeliverOrder;
+import com.fuzamei.entity.Param;
+
 public interface CargoDeliverMapper {
 
+	List<DeliverOrder> queryOrdersByCarrier(Param param);
+
+	int findQueryCountByCarrier(Param param);
+
 }

+ 11 - 0
saicLogistics/src/main/java/com/fuzamei/mapperInterface/CargoTallyMapper.java

@@ -1,5 +1,16 @@
 package com.fuzamei.mapperInterface;
 
+import java.util.List;
+
+import com.fuzamei.entity.Param;
+import com.fuzamei.entity.TallyOrder;
+
 public interface CargoTallyMapper {
 
+	List<TallyOrder> queryOrdersByReceiver(Param param);
+
+	int findQueryCountByReceiver(Param param);
+
+	void confirmOrReject(Param param);
+
 }

+ 11 - 2
saicLogistics/src/main/java/com/fuzamei/mapperInterface/OrdersIssueMapper.java

@@ -2,15 +2,24 @@ package com.fuzamei.mapperInterface;
 
 import java.util.List;
 
+import com.fuzamei.entity.IssueOrder;
 import com.fuzamei.entity.Orders;
 import com.fuzamei.entity.Param;
 
 public interface OrdersIssueMapper {
 
-	List<Orders> queryOrdersByPlanner(Param param);//计划员查询的订单信息
+	List<IssueOrder> queryOrdersByPlanner(Param param);//计划员查询的订单信息
 
-	int findQueryCountByPlanner(Param param);//计划员查询条数总数
+	int findQueryCountByPlanner(Param param);//计划员查询条数
 
 	void addOrder(Param param);//新订单生成
 
+	List<IssueOrder> queryOrdersBySupplier(Param param);//供应商查询订单信息
+
+	int findQueryCountBySupplier(Param param);//供应商查询条数
+
+	void consignment(Param param);//供应商发货操作
+	
+	
+
 }

+ 6 - 3
saicLogistics/src/main/java/com/fuzamei/mapperInterface/UserAuthoricationMapper.java

@@ -1,13 +1,16 @@
 package com.fuzamei.mapperInterface;
 
-import org.apache.ibatis.annotations.Param;
+import java.util.List;
 
+import com.fuzamei.entity.Param;
 import com.fuzamei.entity.UserDetail;
 
 public interface UserAuthoricationMapper {
 
-	UserDetail queryUserDetail(Integer userId);
+	UserDetail queryUserDetail(Integer userId);//查询最详细的用户信息
 
-	UserDetail queryUserAuthority(Integer userId);
+	UserDetail queryUserAuthority(Integer userId);//查询简单用户信息
+
+	List<UserDetail> showAllCarriersUnderSupplier(Param param);//查询所有承运商信息
 
 }

+ 13 - 0
saicLogistics/src/main/java/com/fuzamei/service/CargoConsignService.java

@@ -1,5 +1,18 @@
 package com.fuzamei.service;
 
+import java.util.Map;
+
+import com.fuzamei.entity.Param;
+import com.fuzamei.util.PageDTO;
+
 public interface CargoConsignService {
 
+	PageDTO queryOrdersBySupplier(Param param);
+
+	PageDTO queryOrdersByCarrier(Param param);
+
+	void doCarry(Param param);
+
+	Map<String, Object> orderTracking(Param param);
+
 }

+ 9 - 0
saicLogistics/src/main/java/com/fuzamei/service/CargoDeliverService.java

@@ -1,5 +1,14 @@
 package com.fuzamei.service;
 
+import java.util.Map;
+
+import com.fuzamei.entity.Param;
+import com.fuzamei.util.PageDTO;
+
 public interface CargoDeliverService {
 
+	PageDTO queryOrdersByCarrier(Param param);
+
+	Map<String, Object> orderTracking(Param param);
+
 }

+ 14 - 0
saicLogistics/src/main/java/com/fuzamei/service/CargoTallyService.java

@@ -1,5 +1,19 @@
 package com.fuzamei.service;
 
+import java.util.Map;
+
+import com.fuzamei.entity.Param;
+import com.fuzamei.entity.TallyOrder;
+import com.fuzamei.util.PageDTO;
+
 public interface CargoTallyService {
 
+	PageDTO queryOrdersByReceiver(Param param);
+
+	TallyOrder searchNewOrderByOrderId(Param param);
+
+	void confirmOrReject(Param param);
+
+	Map<String, Object> orderTracking(Param param);
+
 }

+ 4 - 0
saicLogistics/src/main/java/com/fuzamei/service/OrdersIssueService.java

@@ -13,6 +13,10 @@ public interface OrdersIssueService {
 	void addOrder(Param param);
 
 	Map<String, Object> orderTracking(Param param);
+
+	PageDTO queryOrdersBySupplier(Param param);
+
+	void consignment(Param param);
 	
 	
 }

+ 5 - 0
saicLogistics/src/main/java/com/fuzamei/service/UserAuthoricationService.java

@@ -1,9 +1,14 @@
 package com.fuzamei.service;
 
+import java.util.List;
+
+import com.fuzamei.entity.Param;
 import com.fuzamei.entity.UserDetail;
 
 public interface UserAuthoricationService {
 	UserDetail queryUserDetail(Integer userId,String... roleNames);
 
 	UserDetail queryUserAuthority(Integer userId, String... roleNames);
+
+	List<UserDetail> showAllCarriersUnderSupplier(Param param);
 }

+ 59 - 0
saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/CargoConsignServiceImpl.java

@@ -1,14 +1,73 @@
 package com.fuzamei.service.serviceImpl;
 
+import java.util.List;
+import java.util.Map;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import com.fuzamei.constant.OperationType;
+import com.fuzamei.constant.Status;
+import com.fuzamei.entity.IssueOrder;
+import com.fuzamei.entity.Orders;
+import com.fuzamei.entity.Param;
+import com.fuzamei.entity.SendOrder;
 import com.fuzamei.mapperInterface.CargoConsignMapper;
+import com.fuzamei.mapperInterface.OperationHistoryMapper;
 import com.fuzamei.service.CargoConsignService;
+import com.fuzamei.util.PageDTO;
 
 @Service
 public class CargoConsignServiceImpl implements CargoConsignService {
 
 	@Autowired
 	private CargoConsignMapper cargoConsignMapper;
+	
+	@Autowired
+	private OperationHistoryMapper operationHistoryMapper;
+
+	@Override
+	public PageDTO queryOrdersBySupplier(Param param) {
+		PageDTO pageDto=new PageDTO();
+		List<SendOrder> orderList = cargoConsignMapper.queryOrdersBySupplier(param);
+		int count = cargoConsignMapper.findQueryCountBySupplier(param);
+		pageDto.setRows(orderList);
+		pageDto.setTotal(count);
+		return pageDto;
+	}
+
+	@Override
+	public PageDTO queryOrdersByCarrier(Param param) {
+		PageDTO pageDto=new PageDTO();
+		List<SendOrder> orderList = cargoConsignMapper.queryOrdersByCarrier(param);
+		int count = cargoConsignMapper.findQueryCountByCarrier(param);
+		pageDto.setRows(orderList);
+		pageDto.setTotal(count);
+		return pageDto;
+	}
+
+	@Override
+	@Transactional(rollbackFor=Exception.class)
+	public void doCarry(Param param) {
+		Long currentTime = System.currentTimeMillis();
+		//更新【订单表】
+		param.setTransportTime(currentTime);
+		param.setUpdateTime(currentTime);
+		param.setStatusId(Status.DELIVERING);
+		cargoConsignMapper.doCarry(param);
+		//插入【操作记录】
+		param.setOperationTypeId(OperationType.DELIVER);
+		param.setOperatorId(param.getUserId());
+		param.setOperationTime(currentTime);
+		operationHistoryMapper.addToHistory(param);
+	}
+
+	@Override
+	public Map<String, Object> orderTracking(Param param) {
+		Orders order = param.getOrder();
+		return OrdersIssueServiceImpl.dispatchOrderInfo(order);
+	}
+	
+	
 }

+ 24 - 0
saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/CargoDeliverServiceImpl.java

@@ -1,14 +1,38 @@
 package com.fuzamei.service.serviceImpl;
 
+import java.util.List;
+import java.util.Map;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.fuzamei.entity.DeliverOrder;
+import com.fuzamei.entity.Orders;
+import com.fuzamei.entity.Param;
+import com.fuzamei.entity.SendOrder;
 import com.fuzamei.mapperInterface.CargoDeliverMapper;
 import com.fuzamei.service.CargoDeliverService;
+import com.fuzamei.util.PageDTO;
 
 @Service
 public class CargoDeliverServiceImpl implements CargoDeliverService {
 
 	@Autowired
 	private CargoDeliverMapper cargoDeliverMapper;
+
+	@Override
+	public PageDTO queryOrdersByCarrier(Param param) {
+		PageDTO pageDto=new PageDTO();
+		List<DeliverOrder> orderList = cargoDeliverMapper.queryOrdersByCarrier(param);
+		int count = cargoDeliverMapper.findQueryCountByCarrier(param);
+		pageDto.setRows(orderList);
+		pageDto.setTotal(count);
+		return pageDto;
+	}
+
+	@Override
+	public Map<String, Object> orderTracking(Param param) {
+		Orders order = param.getOrder();
+		return OrdersIssueServiceImpl.dispatchOrderInfo(order);
+	}
 }

+ 60 - 0
saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/CargoTallyServiceImpl.java

@@ -1,14 +1,74 @@
 package com.fuzamei.service.serviceImpl;
 
+import java.util.List;
+import java.util.Map;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.fuzamei.constant.OperationType;
+import com.fuzamei.constant.Status;
+import com.fuzamei.entity.Orders;
+import com.fuzamei.entity.Param;
+import com.fuzamei.entity.SendOrder;
+import com.fuzamei.entity.TallyOrder;
 import com.fuzamei.mapperInterface.CargoTallyMapper;
+import com.fuzamei.mapperInterface.OperationHistoryMapper;
 import com.fuzamei.service.CargoTallyService;
+import com.fuzamei.util.PageDTO;
 
 @Service
 public class CargoTallyServiceImpl implements CargoTallyService {
 
 	@Autowired
 	private CargoTallyMapper cargoTallyMapper;
+	
+	@Autowired
+	private OperationHistoryMapper operationHistoryMapper;
+
+	@Override
+	public PageDTO queryOrdersByReceiver(Param param) {
+		PageDTO pageDto=new PageDTO();
+		List<TallyOrder> orderList = cargoTallyMapper.queryOrdersByReceiver(param);
+		int count = cargoTallyMapper.findQueryCountByReceiver(param);
+		pageDto.setRows(orderList);
+		pageDto.setTotal(count);
+		return pageDto;
+	}
+
+	@Override
+	public TallyOrder searchNewOrderByOrderId(Param param) {
+		Orders order = param.getOrder();
+		TallyOrder tallyOrder=new TallyOrder();
+		tallyOrder.setOrderId(order.getOrderId());
+		tallyOrder.setPartNo(order.getPartNo());
+		tallyOrder.setBoxNo(order.getBoxNo());
+		tallyOrder.setBoxQty(order.getBoxQty());
+		tallyOrder.setCarNo(order.getCarNo());
+		return tallyOrder;
+	}
+
+	@Override
+	public void confirmOrReject(Param param) {
+		Long currentTime = System.currentTimeMillis();
+		//更新【订单表】
+		param.setTallyTime(currentTime);
+		param.setUpdateTime(currentTime);
+		param.setReceiverId(param.getUserId());
+		if(param.getConfirmId()==1)	param.setStatusId(Status.TALLIED);
+		if(param.getConfirmId()==0)	param.setStatusId(Status.REJECTED);
+		cargoTallyMapper.confirmOrReject(param);
+		//插入【操作记录】
+		if(param.getConfirmId()==1) param.setOperationTypeId(OperationType.CONFIRM);
+		if(param.getConfirmId()==0) param.setOperationTypeId(OperationType.REJECT);
+		param.setOperatorId(param.getUserId());
+		param.setOperationTime(currentTime);
+		operationHistoryMapper.addToHistory(param);
+	}
+
+	@Override
+	public Map<String, Object> orderTracking(Param param) {
+		Orders order = param.getOrder();
+		return OrdersIssueServiceImpl.dispatchOrderInfo(order);
+	}
 }

+ 29 - 1
saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/OrdersIssueServiceImpl.java

@@ -35,12 +35,38 @@ public class OrdersIssueServiceImpl implements OrdersIssueService {
 	@Override
 	public PageDTO queryOrdersByPlanner(Param param) {
 		PageDTO pageDto=new PageDTO();
-		List<Orders> orderList = ordersIssueMapper.queryOrdersByPlanner(param);
+		List<IssueOrder> orderList = ordersIssueMapper.queryOrdersByPlanner(param);
 		int count = ordersIssueMapper.findQueryCountByPlanner(param);
 		pageDto.setRows(orderList);
 		pageDto.setTotal(count);
 		return pageDto;
 	}
+	
+	@Override
+	public PageDTO queryOrdersBySupplier(Param param) {
+		PageDTO pageDto=new PageDTO();
+		List<IssueOrder> orderList = ordersIssueMapper.queryOrdersBySupplier(param);
+		int count = ordersIssueMapper.findQueryCountBySupplier(param);
+		pageDto.setRows(orderList);
+		pageDto.setTotal(count);
+		return pageDto;
+	}
+	
+	@Override
+	@Transactional(rollbackFor=Exception.class)
+	public void consignment(Param param) {
+		Long currentTime = System.currentTimeMillis();
+		//更新【订单表】
+		param.setSendTime(currentTime);
+		param.setUpdateTime(currentTime);
+		param.setStatusId(Status.UNDELIVER);//待运输状态
+		ordersIssueMapper.consignment(param);
+		//插入【操作记录】
+		param.setOperationTypeId(OperationType.SEND);
+		param.setOperatorId(param.getUserId());
+		param.setOperationTime(currentTime);
+		operationHistoryMapper.addToHistory(param);
+	}
 
 	@Override
 	@Transactional(rollbackFor=Exception.class)
@@ -133,4 +159,6 @@ public class OrdersIssueServiceImpl implements OrdersIssueService {
 		}
 		return map;
 	}
+
+	
 }

+ 8 - 0
saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/UserAuthoricationServiceImpl.java

@@ -1,8 +1,11 @@
 package com.fuzamei.service.serviceImpl;
 
+import java.util.List;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.fuzamei.entity.Param;
 import com.fuzamei.entity.UserDetail;
 import com.fuzamei.mapperInterface.UserAuthoricationMapper;
 import com.fuzamei.service.UserAuthoricationService;
@@ -56,4 +59,9 @@ public class UserAuthoricationServiceImpl implements UserAuthoricationService {
 		return userDetail;
 	}
 
+	@Override
+	public List<UserDetail> showAllCarriersUnderSupplier(Param param) {
+		return userAuthoricationMapper.showAllCarriersUnderSupplier(param);
+	}
+
 }

+ 185 - 0
saicLogistics/src/main/java/com/fuzamei/web/CargoConsignAction.java

@@ -1,10 +1,27 @@
 package com.fuzamei.web;
 
+import java.util.List;
+import java.util.Map;
+
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.fuzamei.constant.HintMSG;
+import com.fuzamei.constant.Role;
+import com.fuzamei.constant.Status;
+import com.fuzamei.entity.Orders;
+import com.fuzamei.entity.Param;
+import com.fuzamei.entity.UserDetail;
 import com.fuzamei.service.CargoConsignService;
+import com.fuzamei.service.OrderService;
+import com.fuzamei.service.UserAuthoricationService;
+import com.fuzamei.util.JSONUtil;
+import com.fuzamei.util.PageDTO;
+import com.fuzamei.util.ReadConfUtil;
+import com.fuzamei.util.ValidationUtil;
 
 @RestController
 @RequestMapping(path="/cargoConsign")
@@ -12,4 +29,172 @@ public class CargoConsignAction {
 
 	@Autowired
 	private CargoConsignService cargoConsignService;
+	
+	@Autowired
+	private UserAuthoricationService userAuthoricationService;
+	
+	@Autowired
+	private OrderService orderService;
+	
+	private static final Integer ROWNUM=Integer.parseInt(ReadConfUtil.getProperty("rowNum"));
+	/**
+	 * 
+	* @Title: queryOrdersBySupplier
+	* @Description: TODO(供应商查询订单信息)
+	{
+		"userId":"xx",
+		"page":"1",
+		"orderId":"",
+		"boxNo":"",
+		"statusId":"",
+		"startTime":"",
+		"endTime":""
+	}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年1月26日 上午11:35:13
+	* @throws
+	 */
+	@RequestMapping(value="/queryOrdersBySupplier",method=RequestMethod.POST)
+	public Map<String, Object> queryOrdersBySupplier(@RequestBody Param param){
+		try {
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(param.getUserId()), Role.SUPPLIER);
+			int page = ValidationUtil.checkMinAndAssignInt(param.getPage(), 1);
+			Long startTime=ValidationUtil.checkAndAssignDefaultLong(param.getStartTime(), 0L);
+			Long endTime=ValidationUtil.checkAndAssignDefaultLong(param.getEndTime(), Long.MAX_VALUE);
+			param.setStartTime(startTime);
+			if(startTime<=endTime) param.setEndTime(endTime);
+			else param.setEndTime(Long.MAX_VALUE);
+			param.setStartPage((page - 1) * ROWNUM);
+			param.setRowNum(ROWNUM);
+			PageDTO pageDto = cargoConsignService.queryOrdersBySupplier(param);
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, pageDto);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	/**
+	 * 
+	* @Title: queryOrdersByCarrier
+	* @Description: TODO(承运商查看订单信息)
+	{
+		"userId":"",
+		"page":"1",
+		"orderId":"",
+		"boxNo":"",
+		"statusId":"",
+		"startTime":"",
+		"endTime":""
+	}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年1月26日 下午1:03:33
+	* @throws
+	 */
+	@RequestMapping(value="/queryOrdersByCarrier",method=RequestMethod.POST)
+	public Map<String, Object> queryOrdersByCarrier(@RequestBody Param param){
+		try {
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(param.getUserId()), Role.CARRIER);
+			int page = ValidationUtil.checkMinAndAssignInt(param.getPage(), 1);
+			Long startTime=ValidationUtil.checkAndAssignDefaultLong(param.getStartTime(), 0L);
+			Long endTime=ValidationUtil.checkAndAssignDefaultLong(param.getEndTime(), Long.MAX_VALUE);
+			param.setStartTime(startTime);
+			if(startTime<=endTime) param.setEndTime(endTime);
+			else param.setEndTime(Long.MAX_VALUE);
+			param.setStartPage((page - 1) * ROWNUM);
+			param.setRowNum(ROWNUM);
+			PageDTO pageDto = cargoConsignService.queryOrdersByCarrier(param);
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, pageDto);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	/**
+	 * 
+	* @Title: doCarry
+	* @Description: TODO(承运商点击承运按钮后对订单表进行更新)
+	{
+		"userId":"",
+		"orderId":"",
+		"carNo":""
+	}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年1月26日 下午1:14:26
+	* @throws
+	 */
+	@RequestMapping(value="/doCarry",method=RequestMethod.POST)
+	public Map<String, Object> doCarry(@RequestBody Param param){
+		try {
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(param.getUserId()), Role.CARRIER);
+			Orders order = orderService.queryFullOrderByOrderId(ValidationUtil.checkAndAssignInt(param.getOrderId()));
+			if(order==null) throw new RuntimeException("订单不存在");
+			if(!Status.UNDELIVER.equals(order.getStatusId())) throw new RuntimeException("非法操作");
+			if(!param.getUserId().equals(order.getCarrierId())) throw new RuntimeException("无权操作");
+			cargoConsignService.doCarry(param);
+			return JSONUtil.getJsonMap(200, true, HintMSG.OPERATION_SUCCESS, null);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.OPERATION_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	
+	/**
+	 * 
+	* @Title: showAllCarriersUnderSupplier
+	* @Description: TODO(当供应商点击发货时候,跳出的弹框中承运商下拉框中显示所有承运商)
+	{
+		"userId":"xxx"
+	}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年1月26日 下午12:03:48
+	* @throws
+	 */
+	@RequestMapping(value="/showAllCarriersUnderSupplier",method=RequestMethod.POST)
+	public Map<String, Object> showAllCarriersUnderSupplier(@RequestBody Param param){
+		try {
+			userAuthoricationService.queryUserDetail(ValidationUtil.checkAndAssignInt(param.getUserId()), Role.SUPPLIER);
+			param.setRoleName(Role.CARRIER);
+			List<UserDetail> carrierList = userAuthoricationService.showAllCarriersUnderSupplier(param);
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, carrierList);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	
+	/**
+	 * 
+	* @Title: orderTracking
+	* @Description: TODO(供应商和承运商的订单查询)
+	{
+		"userId":"xxx",
+		"orderId":""
+	}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年1月26日 下午1:47:45
+	* @throws
+	 */
+	@RequestMapping(value="/orderTracking",method=RequestMethod.POST)
+	public Map<String, Object> orderTracking(@RequestBody Param param){
+		try {
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(param.getUserId()),Role.CARRIER,Role.SUPPLIER);//检测当前操作用户权限
+			Orders order = orderService.queryFullOrderByOrderId(ValidationUtil.checkAndAssignInt(param.getOrderId()));
+			param.setOrder(order);
+			Map<String, Object> map = cargoConsignService.orderTracking(param);
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, map);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
 }

+ 88 - 0
saicLogistics/src/main/java/com/fuzamei/web/CargoDeliverAction.java

@@ -1,10 +1,24 @@
 package com.fuzamei.web;
 
+import java.util.Map;
+
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.fuzamei.constant.HintMSG;
+import com.fuzamei.constant.Role;
+import com.fuzamei.entity.Orders;
+import com.fuzamei.entity.Param;
 import com.fuzamei.service.CargoDeliverService;
+import com.fuzamei.service.OrderService;
+import com.fuzamei.service.UserAuthoricationService;
+import com.fuzamei.util.JSONUtil;
+import com.fuzamei.util.PageDTO;
+import com.fuzamei.util.ReadConfUtil;
+import com.fuzamei.util.ValidationUtil;
 
 @RestController
 @RequestMapping(path="/cargoDeliver")
@@ -12,4 +26,78 @@ public class CargoDeliverAction {
 
 	@Autowired
 	private CargoDeliverService cargoDeliverService;
+	
+	@Autowired
+	private UserAuthoricationService userAuthoricationService;
+	
+	@Autowired
+	private OrderService orderService;
+	
+	private static final Integer ROWNUM=Integer.parseInt(ReadConfUtil.getProperty("rowNum"));
+	
+	/**
+	 * 
+	* @Title: queryOrdersByCarrier
+	* @Description: TODO(承运商查看订单信息)
+	{
+		"userId":"xxx",
+		"page":"1",
+		"orderId":"",
+		"carNo":"",
+		"statusId":"",
+		"startTime":"",
+		"endTime":""
+	}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年1月26日 下午1:51:37
+	* @throws
+	 */
+	@RequestMapping(value="/queryOrdersByCarrier",method=RequestMethod.POST)
+	public Map<String, Object> queryOrdersByCarrier(@RequestBody Param param){
+		try {
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(param.getUserId()), Role.SUPPLIER);
+			int page = ValidationUtil.checkMinAndAssignInt(param.getPage(), 1);
+			Long startTime=ValidationUtil.checkAndAssignDefaultLong(param.getStartTime(), 0L);
+			Long endTime=ValidationUtil.checkAndAssignDefaultLong(param.getEndTime(), Long.MAX_VALUE);
+			param.setStartTime(startTime);
+			if(startTime<=endTime) param.setEndTime(endTime);
+			else param.setEndTime(Long.MAX_VALUE);
+			param.setStartPage((page - 1) * ROWNUM);
+			param.setRowNum(ROWNUM);
+			PageDTO pageDto = cargoDeliverService.queryOrdersByCarrier(param);
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, pageDto);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	/**
+	 * 
+	* @Title: orderTracking
+	* @Description: TODO(承运商查看订单跟踪表)
+	{
+		"userId":"",
+		"orderId":""
+	}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年1月26日 下午2:07:25
+	* @throws
+	 */
+	@RequestMapping(value="/orderTracking",method=RequestMethod.POST)
+	public Map<String, Object> orderTracking(@RequestBody Param param){
+		try {
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(param.getUserId()),Role.CARRIER);//检测当前操作用户权限
+			Orders order = orderService.queryFullOrderByOrderId(ValidationUtil.checkAndAssignInt(param.getOrderId()));
+			param.setOrder(order);
+			Map<String, Object> map = cargoDeliverService.orderTracking(param);
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, map);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
 }

+ 148 - 0
saicLogistics/src/main/java/com/fuzamei/web/CargoTallyAction.java

@@ -1,10 +1,26 @@
 package com.fuzamei.web;
 
+import java.util.Map;
+
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.fuzamei.constant.HintMSG;
+import com.fuzamei.constant.Role;
+import com.fuzamei.constant.Status;
+import com.fuzamei.entity.Orders;
+import com.fuzamei.entity.Param;
+import com.fuzamei.entity.TallyOrder;
 import com.fuzamei.service.CargoTallyService;
+import com.fuzamei.service.OrderService;
+import com.fuzamei.service.UserAuthoricationService;
+import com.fuzamei.util.JSONUtil;
+import com.fuzamei.util.PageDTO;
+import com.fuzamei.util.ReadConfUtil;
+import com.fuzamei.util.ValidationUtil;
 
 @RestController
 @RequestMapping(path="/cargoTally")
@@ -12,4 +28,136 @@ public class CargoTallyAction {
 
 	@Autowired
 	private CargoTallyService cargoTallyService;
+	
+	@Autowired
+	private UserAuthoricationService userAuthoricationService;
+	
+	@Autowired
+	private OrderService orderService;
+	
+	private static final Integer ROWNUM=Integer.parseInt(ReadConfUtil.getProperty("rowNum"));
+	
+	/**
+	 * 
+	* @Title: queryOrdersByReceiver
+	* @Description: TODO(收货员查询订单信息)
+	{
+		"userId":"xxx",
+		"page":"1",
+		"orderId":"",
+		"carNo":"",
+		"startTime":"",
+		"endTime":""
+	}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年1月26日 下午2:12:02
+	* @throws
+	 */
+	@RequestMapping(value="/queryOrdersByReceiver",method=RequestMethod.POST)
+	public Map<String, Object> queryOrdersByReceiver(@RequestBody Param param){
+		try {
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(param.getUserId()), Role.STOCKER);
+			int page = ValidationUtil.checkMinAndAssignInt(param.getPage(), 1);
+			Long startTime=ValidationUtil.checkAndAssignDefaultLong(param.getStartTime(), 0L);
+			Long endTime=ValidationUtil.checkAndAssignDefaultLong(param.getEndTime(), Long.MAX_VALUE);
+			param.setStartTime(startTime);
+			if(startTime<=endTime) param.setEndTime(endTime);
+			else param.setEndTime(Long.MAX_VALUE);
+			param.setStartPage((page - 1) * ROWNUM);
+			param.setRowNum(ROWNUM);
+			PageDTO pageDto = cargoTallyService.queryOrdersByReceiver(param);
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, pageDto);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	/**
+	 * 
+	* @Title: searchNewOrderByOrderId
+	* @Description: TODO(售货员根据订单号点击下一步查询最新的点货订单)
+	{
+		"userId":"",
+		"orderId":""
+	}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年1月26日 下午2:24:02
+	* @throws
+	 */
+	@RequestMapping(value="/searchNewOrderByOrderId",method=RequestMethod.POST)
+	public Map<String, Object> searchNewOrderByOrderId(@RequestBody Param param){
+		try {
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(param.getUserId()), Role.STOCKER);
+			Orders order = orderService.queryFullOrderByOrderId(ValidationUtil.checkAndAssignInt(param.getOrderId()));
+			if(order==null) throw new RuntimeException("订单不存在");
+			if(!Status.DELIVERING.equals(order.getStatusId())) throw new RuntimeException("非法操作");
+			param.setOrder(order);
+			TallyOrder tallyOrder=cargoTallyService.searchNewOrderByOrderId(param);
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, tallyOrder);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	/**
+	 * 
+	* @Title: confirmOrReject
+	* @Description: TODO(收货员点击确认点货或拒收操作)
+	{
+		"userId":"",
+		"orderId":"",
+		"confirmId":""
+	}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年1月26日 下午2:35:06
+	* @throws
+	 */
+	@RequestMapping(value="/confirmOrReject",method=RequestMethod.POST)
+	public Map<String, Object> confirmOrReject(@RequestBody Param param){
+		try {
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(param.getUserId()), Role.STOCKER);
+			ValidationUtil.checkRangeAndAssignInt(param.getConfirmId(), 0, 1);//确认id只能是0和1
+			Orders order = orderService.queryFullOrderByOrderId(ValidationUtil.checkAndAssignInt(param.getOrderId()));
+			if(order==null) throw new RuntimeException("订单不存在");
+			if(!Status.DELIVERING.equals(order.getStatusId())) throw new RuntimeException("非法操作");
+			cargoTallyService.confirmOrReject(param);
+			return JSONUtil.getJsonMap(200, true, HintMSG.OPERATION_SUCCESS, null);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.OPERATION_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	/**
+	 * 
+	* @Title: orderTracking
+	* @Description: TODO(收货员查询订单跟踪信息)
+	{
+		"userId":"",
+		"orderId":""
+	}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年1月26日 下午2:48:12
+	* @throws
+	 */
+	@RequestMapping(value="/orderTracking",method=RequestMethod.POST)
+	public Map<String, Object> orderTracking(@RequestBody Param param){
+		try {
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(param.getUserId()),Role.STOCKER);//检测当前操作用户权限
+			Orders order = orderService.queryFullOrderByOrderId(ValidationUtil.checkAndAssignInt(param.getOrderId()));
+			param.setOrder(order);
+			Map<String, Object> map = cargoTallyService.orderTracking(param);
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, map);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
 }

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

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.fuzamei.constant.HintMSG;
 import com.fuzamei.constant.Role;
+import com.fuzamei.constant.Status;
 import com.fuzamei.entity.Box;
 import com.fuzamei.entity.Orders;
 import com.fuzamei.entity.Param;
@@ -41,7 +42,7 @@ public class OrdersIssueAction {
 	@Autowired
 	private BoxService boxService;
 	
-	public static final Integer rowNum=Integer.parseInt(ReadConfUtil.getProperty("rowNum"));
+	private static final Integer ROWNUM=Integer.parseInt(ReadConfUtil.getProperty("rowNum"));
 	
 	/**
 	 * 
@@ -70,8 +71,8 @@ public class OrdersIssueAction {
 			param.setStartTime(startTime);
 			if(startTime<=endTime) param.setEndTime(endTime);
 			else param.setEndTime(Long.MAX_VALUE);
-			param.setStartPage((page - 1) * rowNum);
-			param.setRowNum(rowNum);
+			param.setStartPage((page - 1) * ROWNUM);
+			param.setRowNum(ROWNUM);
 			PageDTO pageDto = ordersIssueService.queryOrdersByPlanner(param);
 			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, pageDto);
 		} catch (Exception e) {
@@ -79,6 +80,75 @@ public class OrdersIssueAction {
 		}
 	}
 	
+	/**
+	 * 
+	* @Title: queryOrdersBySupplier
+	* @Description: TODO(供应商查询订单信息)
+	{
+		"userId":"",
+		"page":"1",
+		"orderId":"",
+		"boxNo":"",
+		"statusId":"",
+		"startTime":"",
+		"endTime":""
+	}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年1月26日 上午10:34:41
+	* @throws
+	 */
+	@RequestMapping(value="/queryOrdersBySupplier",method=RequestMethod.POST)
+	public Map<String, Object> queryOrdersBySupplier(@RequestBody Param param){
+		try {
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(param.getUserId()), Role.SUPPLIER);
+			int page = ValidationUtil.checkMinAndAssignInt(param.getPage(), 1);
+			Long startTime=ValidationUtil.checkAndAssignDefaultLong(param.getStartTime(), 0L);
+			Long endTime=ValidationUtil.checkAndAssignDefaultLong(param.getEndTime(), Long.MAX_VALUE);
+			param.setStartTime(startTime);
+			if(startTime<=endTime) param.setEndTime(endTime);
+			else param.setEndTime(Long.MAX_VALUE);
+			param.setStartPage((page - 1) * ROWNUM);
+			param.setRowNum(ROWNUM);
+			PageDTO pageDto = ordersIssueService.queryOrdersBySupplier(param);
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, pageDto);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	/**
+	 * 
+	* @Title: Consignment
+	* @Description: TODO(供应商点击发货这个动作)
+	{
+		"userId":"xxx",
+		"orderId":"",
+		"carrierId":""
+	}
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年1月26日 上午11:07:58
+	* @throws
+	 */
+	@RequestMapping(value="/consignment",method=RequestMethod.POST)
+	public Map<String, Object> consignment(@RequestBody Param param){
+		try {
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(param.getUserId()), Role.SUPPLIER);
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(param.getCarrierId()), Role.CARRIER);
+			Orders order = orderService.queryFullOrderByOrderId(ValidationUtil.checkAndAssignInt(param.getOrderId()));
+			if(order==null) throw new RuntimeException("订单不存在");
+			if(!Status.UNSEND.equals(order.getStatusId())) throw new RuntimeException("非法操作");
+			if(!param.getUserId().equals(order.getSupplierId())) throw new RuntimeException("无权操作");
+			ordersIssueService.consignment(param);
+			return JSONUtil.getJsonMap(200, true, HintMSG.OPERATION_SUCCESS, null);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.OPERATION_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
 	/**
 	 * 
 	* @Title: addOrder
@@ -143,6 +213,7 @@ public class OrdersIssueAction {
 		}
 	}
 	
+	
 	/**
 	 * 
 	* @Title: showAllBoxNo

+ 1 - 0
saicLogistics/src/main/resources/conf.properties

@@ -4,4 +4,5 @@ block_port=46657
 #最大的公私钥对,前面私钥,后面是公钥
 privateKey=90b289fda1fb0439158f837bbe60cc1ec99616dd0bc6335d6fd0bf3d22888e20
 publicKey=b15a4f6c5c1163b5f80715c9bd87d5118ec4b5668cb29f148eeceec61ddeadc2
+#分页每页显示条数
 rowNum=10

+ 0 - 5
saicLogistics/src/test/java/com/fuzamei/web/UserDetailTest.java

@@ -21,9 +21,4 @@ public class UserDetailTest extends BaseJunit4Test{
 		UserDetail queryUserDetail = userAuthoricationService.queryUserDetail(1002, Role.PLANNER);
 		System.out.println(queryUserDetail);
 	}
-	@Test
-	public void test02(){
-		int rownum=ordersIssueAction.rowNum;
-		System.out.println(rownum);
-	}
 }