ylx hace 7 años
padre
commit
534db2206c

+ 3 - 0
saicLogistics/src/main/java/com/fuzamei/constant/OperationType.java

@@ -9,5 +9,8 @@ public class OperationType {
 	public static final Integer DELIVER = 3;//承运
 	public static final Integer CONFIRM = 4;//确认收货
 	public static final Integer REJECT = 5;//拒绝收货
+	public static final Integer EDIT = 6;//编辑
+	public static final Integer ADD = 7;//添加
+	public static final Integer DELETE = 8;//删除
 	
 }

+ 7 - 0
saicLogistics/src/main/java/com/fuzamei/entity/OperationHistory.java

@@ -12,6 +12,13 @@ public class OperationHistory {
 	private String operationTypeName;		//操作类型名
 	private String operatorName;			//操作人名
 	private Long operationTime;				//操作时间
+	private String hash;					//操作hash
+	public String getHash() {
+		return hash;
+	}
+	public void setHash(String hash) {
+		this.hash = hash;
+	}
 	public Integer getOrderId() {
 		return orderId;
 	}

+ 47 - 0
saicLogistics/src/main/java/com/fuzamei/entity/OperationHistoryAdmin.java

@@ -0,0 +1,47 @@
+package com.fuzamei.entity;
+
+public class OperationHistoryAdmin {
+	private Integer id;					//主键id
+	private Integer operatorId;			//操作人id
+	private Integer operationTypeId;	//操作类型id
+	private Integer beOperatedId;		//被操作人id
+	private Long operationTime;			//操作时间
+	private String hash;				//操作hash
+	public Integer getId() {
+		return id;
+	}
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	public Integer getOperatorId() {
+		return operatorId;
+	}
+	public void setOperatorId(Integer operatorId) {
+		this.operatorId = operatorId;
+	}
+	public Integer getOperationTypeId() {
+		return operationTypeId;
+	}
+	public void setOperationTypeId(Integer operationTypeId) {
+		this.operationTypeId = operationTypeId;
+	}
+	public Integer getBeOperatedId() {
+		return beOperatedId;
+	}
+	public void setBeOperatedId(Integer beOperatedId) {
+		this.beOperatedId = beOperatedId;
+	}
+	public Long getOperationTime() {
+		return operationTime;
+	}
+	public void setOperationTime(Long operationTime) {
+		this.operationTime = operationTime;
+	}
+	public String getHash() {
+		return hash;
+	}
+	public void setHash(String hash) {
+		this.hash = hash;
+	}
+	
+}

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

@@ -74,7 +74,7 @@
 			o.update_time,
 			s.status_name
 		from 
-			(select * from orders where status_id=2) o
+			(select * from orders where status_id!=1) o
 		left join 
 			status s
 		on 
@@ -102,7 +102,7 @@
 		select 
 			count(*)
 		from 
-			(select * from orders where status_id=2) o
+			(select * from orders where status_id!=1) o
 		<where>
 			o.carrier_id=#{userId}
 			<if test="orderId!=null">

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

@@ -74,7 +74,7 @@
 			o.update_time,
 			s.status_name
 		from 
-			(select * from orders where status_id=1) o
+			orders o
 		left join 
 			status s
 		on 
@@ -102,7 +102,7 @@
 		select 
 			count(*)
 		from 
-			(select * from orders where status_id=1) o
+			orders o
 		<where>
 			o.supplier_id=#{userId}
 			<if test="orderId!=null">

+ 79 - 2
saicLogistics/src/main/java/com/fuzamei/web/OperationHistoryAction.java

@@ -49,8 +49,41 @@ public class OperationHistoryAction {
 	* @date 2018年1月26日 下午6:34:22
 	* @throws
 	 */
-	@RequestMapping(value="/queryOperationHistory",method=RequestMethod.POST)
-	public Map<String, Object> queryOperationHistory(@RequestBody Params params){
+	@RequestMapping(value="/queryOperationHistoryByUser",method=RequestMethod.POST)
+	public Map<String, Object> queryOperationHistoryByUser(@RequestBody Params params){
+		try {
+			String userId = req.getHeader("Authorization").split("&")[1];
+			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(userId), Role.PLANNER,Role.SUPPLIER,Role.CARRIER,Role.STOCKER);
+			int page = ValidationUtil.checkMinAndAssignInt(params.getPage(), 1);
+			int rowNum=ValidationUtil.checkMinAndAssignInt(params.getRowNum(), 1);
+			Long startTime=ValidationUtil.checkAndAssignDefaultLong(params.getStartTime(), 0L);
+			Long endTime=ValidationUtil.checkAndAssignDefaultLong(params.getEndTime(), Long.MAX_VALUE);
+			params.setStartTime(startTime);
+			if(startTime<=endTime) params.setEndTime(endTime);
+			else params.setEndTime(Long.MAX_VALUE);
+			params.setStartPage((page - 1) * rowNum);
+			params.setRowNum(rowNum);
+			PageDTO pageDto = operationHistoryService.queryOperationHistory(params);
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, pageDto);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	
+	/**
+	 * 
+	* @Title: queryOperationHistoryByAdmin
+	* @Description: TODO(这里用一句话描述这个方法的作用)
+	* @param @param params
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年2月2日 下午5:08:43
+	* @throws
+	 */
+	@RequestMapping(value="/queryOperationHistoryByAdmin",method=RequestMethod.POST)
+	public Map<String, Object> queryOperationHistoryByAdmin(@RequestBody Params params){
 		try {
 			String userId = req.getHeader("Authorization").split("&")[1];
 			userAuthoricationService.queryUserAuthority(ValidationUtil.checkAndAssignInt(userId), Role.ADMIN);
@@ -69,4 +102,48 @@ public class OperationHistoryAction {
 			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
 		}
 	}
+	
+	/**
+	 * 
+	* @Title: showAllOperationTypeOfUser
+	* @Description: TODO(这里用一句话描述这个方法的作用)
+	* @param @param params
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年2月2日 下午5:32:53
+	* @throws
+	 */
+	@RequestMapping(value="/showAllOperationTypeOfUser",method=RequestMethod.POST)
+	public Map<String, Object> showAllOperationTypeOfUser(@RequestBody Params params){
+		try {
+			
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, null);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	/**
+	 * 
+	* @Title: showAllOperationTypeOfAdmin
+	* @Description: TODO(这里用一句话描述这个方法的作用)
+	* @param @param params
+	* @param @return    设定文件
+	* @return Map<String,Object>    返回类型
+	* @author ylx
+	* @date 2018年2月2日 下午5:32:57
+	* @throws
+	 */
+	@RequestMapping(value="/showAllOperationTypeOfAdmin",method=RequestMethod.POST)
+	public Map<String, Object> showAllOperationTypeOfAdmin(@RequestBody Params params){
+		try {
+			
+			return JSONUtil.getJsonMap(200, true, HintMSG.QUERY_SUCCESS, null);
+		} catch (Exception e) {
+			return JSONUtil.getJsonMap(500, false, HintMSG.QUERY_FAIL+":"+e.getMessage(), null);
+		}
+	}
+	
+	
 }

+ 2 - 2
saicLogistics/src/test/java/com/fuzamei/web/OperationHistoryActionTest.java

@@ -13,7 +13,7 @@ public class OperationHistoryActionTest extends BaseJunit4Test{
 	@Autowired
 	private OperationHistoryAction operationHistoryAction;
 	
-	@Test
+	/*@Test
 	public void test01(){
 		Params params=new Params();
 		params.setUserId(1001);
@@ -23,5 +23,5 @@ public class OperationHistoryActionTest extends BaseJunit4Test{
 		Map<String, Object> result = operationHistoryAction.queryOperationHistory(params);
 		String jsonString = JSON.toJSONString(result,true);
 		System.out.println(jsonString);
-	}
+	}*/
 }