ylx 7 年之前
父节点
当前提交
71f15ae218
共有 33 个文件被更改,包括 760 次插入22 次删除
  1. 26 0
      saicLogistics/src/main/java/com/fuzamei/constant/HintMSG.java
  2. 31 0
      saicLogistics/src/main/java/com/fuzamei/entity/Box.java
  3. 53 0
      saicLogistics/src/main/java/com/fuzamei/entity/History.java
  4. 26 0
      saicLogistics/src/main/java/com/fuzamei/entity/OperationType.java
  5. 152 0
      saicLogistics/src/main/java/com/fuzamei/entity/Orders.java
  6. 31 0
      saicLogistics/src/main/java/com/fuzamei/entity/Status.java
  7. 7 0
      saicLogistics/src/main/java/com/fuzamei/mapper/CargoConsignMapper.xml
  8. 7 0
      saicLogistics/src/main/java/com/fuzamei/mapper/CargoDeliverMapper.xml
  9. 7 0
      saicLogistics/src/main/java/com/fuzamei/mapper/CargoTallyMapper.xml
  10. 7 0
      saicLogistics/src/main/java/com/fuzamei/mapper/OrdersIssueMapper.xml
  11. 7 1
      saicLogistics/src/main/java/com/fuzamei/mapper/UserMapper.xml
  12. 5 0
      saicLogistics/src/main/java/com/fuzamei/mapperInterface/CargoConsignMapper.java
  13. 5 0
      saicLogistics/src/main/java/com/fuzamei/mapperInterface/CargoDeliverMapper.java
  14. 5 0
      saicLogistics/src/main/java/com/fuzamei/mapperInterface/CargoTallyMapper.java
  15. 5 0
      saicLogistics/src/main/java/com/fuzamei/mapperInterface/OrdersIssueMapper.java
  16. 5 0
      saicLogistics/src/main/java/com/fuzamei/mapperInterface/UserMapper.java
  17. 0 5
      saicLogistics/src/main/java/com/fuzamei/mapperInterface/UserMapperInterface.java
  18. 5 0
      saicLogistics/src/main/java/com/fuzamei/service/CargoConsignService.java
  19. 5 0
      saicLogistics/src/main/java/com/fuzamei/service/CargoDeliverService.java
  20. 5 0
      saicLogistics/src/main/java/com/fuzamei/service/CargoTallyService.java
  21. 6 0
      saicLogistics/src/main/java/com/fuzamei/service/OrdersIssueService.java
  22. 14 0
      saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/CargoConsignServiceImpl.java
  23. 14 0
      saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/CargoDeliverServiceImpl.java
  24. 14 0
      saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/CargoTallyServiceImpl.java
  25. 14 0
      saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/OrdersIssueServiceImpl.java
  26. 7 0
      saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/UserServiceImpl.java
  27. 224 15
      saicLogistics/src/main/java/com/fuzamei/util/FileTransferUtil.java
  28. 15 0
      saicLogistics/src/main/java/com/fuzamei/web/CargoConsignAction.java
  29. 15 0
      saicLogistics/src/main/java/com/fuzamei/web/CargoDeliverAction.java
  30. 15 0
      saicLogistics/src/main/java/com/fuzamei/web/CargoTallyAction.java
  31. 17 0
      saicLogistics/src/main/java/com/fuzamei/web/OrdersIssueAction.java
  32. 10 0
      saicLogistics/src/main/java/com/fuzamei/web/UserAction.java
  33. 1 1
      saicLogistics/src/main/resources/applicationContext.xml

+ 26 - 0
saicLogistics/src/main/java/com/fuzamei/constant/HintMSG.java

@@ -0,0 +1,26 @@
+package com.fuzamei.constant;
+
+/**
+ * 
+ * @author ylx
+ * @descibe: 提示信息的类
+ */
+public class HintMSG {
+	private HintMSG() {
+		throw new AssertionError("禁止实例化");
+	}
+	public static final String DOWNLOAD_SUCCESS="文件下载成功";
+	public static final String DOWNLOAD_FAIL="文件下载失败";
+	public static final String UPLOAD_SUCCESS="文件上传成功";
+	public static final String UPLOAD_FAIL="文件上传失败";
+	public static final String QUERY_SUCCESS="查询成功";
+	public static final String QUERY_FAIL="查询失败";
+	public static final String CHECK_SUCCESS="查看成功";
+	public static final String CHECK_FAIL="查看失败";
+	public static final String FILE_NOT_FOUND="文件不存在";
+	public static final String FILE_CANT_BE_NULL="文件不能为空";
+	public static final String OPERATION_SUCCESS="操作成功";
+	public static final String OPERATION_FAIL="操作失败";
+	public static final String DELETE_SUCCESS="删除成功";
+	public static final String DELETE_FAIL="删除失败";
+}

+ 31 - 0
saicLogistics/src/main/java/com/fuzamei/entity/Box.java

@@ -0,0 +1,31 @@
+package com.fuzamei.entity;
+/**
+ * 
+ * @className:Box[箱子实体类]
+ * @author:ylx--->[yanglingxiao2009@163.com]
+ * @date:2018年1月24日下午7:39:12
+ * @version v1.0
+ */
+public class Box {
+	private Integer id;			//主键id
+	private String boxNo;		//箱号
+	private String boxName;		//箱子名称
+	public Integer getId() {
+		return id;
+	}
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	public String getBoxNo() {
+		return boxNo;
+	}
+	public void setBoxNo(String boxNo) {
+		this.boxNo = boxNo;
+	}
+	public String getBoxName() {
+		return boxName;
+	}
+	public void setBoxName(String boxName) {
+		this.boxName = boxName;
+	}
+}

+ 53 - 0
saicLogistics/src/main/java/com/fuzamei/entity/History.java

@@ -0,0 +1,53 @@
+package com.fuzamei.entity;
+/**
+ * 
+ * @className:History[订单操作历史实体类]
+ * @author:ylx--->[yanglingxiao2009@163.com]
+ * @date:2018年1月24日下午7:38:53
+ * @version v1.0
+ */
+public class History {
+	private Integer id;					//主键id
+	private Integer orderId;			//订单编号
+	private Integer operationTypeId;	//操作类型id
+	private Integer operationTypeName;	//操作类型名
+	private Integer operatorId;			//操作人id
+	private Long operationTime;			//操作时间
+	public Integer getOrderId() {
+		return orderId;
+	}
+	public void setOrderId(Integer orderId) {
+		this.orderId = orderId;
+	}
+	public Integer getId() {
+		return id;
+	}
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	public Integer getOperationTypeId() {
+		return operationTypeId;
+	}
+	public void setOperationTypeId(Integer operationTypeId) {
+		this.operationTypeId = operationTypeId;
+	}
+	public Integer getOperationTypeName() {
+		return operationTypeName;
+	}
+	public void setOperationTypeName(Integer operationTypeName) {
+		this.operationTypeName = operationTypeName;
+	}
+	public Integer getOperatorId() {
+		return operatorId;
+	}
+	public void setOperatorId(Integer operatorId) {
+		this.operatorId = operatorId;
+	}
+	public Long getOperationTime() {
+		return operationTime;
+	}
+	public void setOperationTime(Long operationTime) {
+		this.operationTime = operationTime;
+	}
+	
+}

+ 26 - 0
saicLogistics/src/main/java/com/fuzamei/entity/OperationType.java

@@ -0,0 +1,26 @@
+package com.fuzamei.entity;
+
+public class OperationType {
+	private Integer id;					//主键id
+	private Integer operationTypeId;	//操作类型id
+	private String operationTypeName;	//操作类型名称
+	public Integer getId() {
+		return id;
+	}
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	public Integer getOperationTypeId() {
+		return operationTypeId;
+	}
+	public void setOperationTypeId(Integer operationTypeId) {
+		this.operationTypeId = operationTypeId;
+	}
+	public String getOperationTypeName() {
+		return operationTypeName;
+	}
+	public void setOperationTypeName(String operationTypeName) {
+		this.operationTypeName = operationTypeName;
+	}
+	
+}

+ 152 - 0
saicLogistics/src/main/java/com/fuzamei/entity/Orders.java

@@ -0,0 +1,152 @@
+package com.fuzamei.entity;
+
+/**
+ * 
+ * @className:Orders[订单实体类]
+ * @author:ylx--->[yanglingxiao2009@163.com]
+ * @date:2018年1月24日下午5:19:48
+ * @version v1.0
+ */
+public class Orders {
+	private Integer id;				//主键id
+	private Integer orderId;		//订单id
+	private String partNo;			//零件号
+	private String boxNo;			//箱号
+	private String boxName;			//箱号名
+	private Integer boxQty;			//箱子数量
+	private Integer inboxQty;		//箱中零件数量
+	private Long requireTime;		//订单需求时间
+	private Long sendTime;			//订单发货时间
+	private Integer plannerId;		//计划员id
+	private Integer supplierId;		//供应商id
+	private Integer carrierId;		//承运商id
+	private Integer receiverId;		//收货员id
+	private Long transportTime;		//承运时间
+	private Long tallyTime;			//点货时间
+	private String carNo;			//车牌号
+	private Integer statusId;		//状态id
+	private String statusName;		//状态名
+	private Long createTime;        //订单创建时间
+	private Long updateTime;        //订单更新时间
+	public String getBoxName() {
+		return boxName;
+	}
+	public void setBoxName(String boxName) {
+		this.boxName = boxName;
+	}
+	public Integer getId() {
+		return id;
+	}
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	public Integer getOrderId() {
+		return orderId;
+	}
+	public void setOrderId(Integer orderId) {
+		this.orderId = orderId;
+	}
+	public String getPartNo() {
+		return partNo;
+	}
+	public void setPartNo(String partNo) {
+		this.partNo = partNo;
+	}
+	public String getBoxNo() {
+		return boxNo;
+	}
+	public void setBoxNo(String boxNo) {
+		this.boxNo = boxNo;
+	}
+	public Integer getBoxQty() {
+		return boxQty;
+	}
+	public void setBoxQty(Integer boxQty) {
+		this.boxQty = boxQty;
+	}
+	public Integer getInboxQty() {
+		return inboxQty;
+	}
+	public void setInboxQty(Integer inboxQty) {
+		this.inboxQty = inboxQty;
+	}
+	public Long getRequireTime() {
+		return requireTime;
+	}
+	public void setRequireTime(Long requireTime) {
+		this.requireTime = requireTime;
+	}
+	public Long getSendTime() {
+		return sendTime;
+	}
+	public void setSendTime(Long sendTime) {
+		this.sendTime = sendTime;
+	}
+	public Integer getPlannerId() {
+		return plannerId;
+	}
+	public void setPlannerId(Integer plannerId) {
+		this.plannerId = plannerId;
+	}
+	public Integer getSupplierId() {
+		return supplierId;
+	}
+	public void setSupplierId(Integer supplierId) {
+		this.supplierId = supplierId;
+	}
+	public Integer getCarrierId() {
+		return carrierId;
+	}
+	public void setCarrierId(Integer carrierId) {
+		this.carrierId = carrierId;
+	}
+	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 getCarNo() {
+		return carNo;
+	}
+	public void setCarNo(String carNo) {
+		this.carNo = carNo;
+	}
+	public Integer getStatusId() {
+		return statusId;
+	}
+	public void setStatusId(Integer statusId) {
+		this.statusId = statusId;
+	}
+	public String getStatusName() {
+		return statusName;
+	}
+	public void setStatusName(String statusName) {
+		this.statusName = statusName;
+	}
+	public Long getCreateTime() {
+		return createTime;
+	}
+	public void setCreateTime(Long createTime) {
+		this.createTime = createTime;
+	}
+	public Long getUpdateTime() {
+		return updateTime;
+	}
+	public void setUpdateTime(Long updateTime) {
+		this.updateTime = updateTime;
+	}
+	
+}

+ 31 - 0
saicLogistics/src/main/java/com/fuzamei/entity/Status.java

@@ -0,0 +1,31 @@
+package com.fuzamei.entity;
+/**
+ * 
+ * @className:Status[状态实体类]
+ * @author:ylx--->[yanglingxiao2009@163.com]
+ * @date:2018年1月24日下午7:39:29
+ * @version v1.0
+ */
+public class Status {
+	private Integer id;			//主键id
+	private Integer statusId;	//状态id
+	private String statusName;	//状态名
+	public Integer getId() {
+		return id;
+	}
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	public Integer getStatusId() {
+		return statusId;
+	}
+	public void setStatusId(Integer statusId) {
+		this.statusId = statusId;
+	}
+	public String getStatusName() {
+		return statusName;
+	}
+	public void setStatusName(String statusName) {
+		this.statusName = statusName;
+	}
+}

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

@@ -0,0 +1,7 @@
+<?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.fuzamei.mapperInterface.CargoConsignMapper">
+	
+	
+	
+</mapper>

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

@@ -0,0 +1,7 @@
+<?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.fuzamei.mapperInterface.CargoDeliverMapper">
+	
+	
+	
+</mapper>

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

@@ -0,0 +1,7 @@
+<?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.fuzamei.mapperInterface.CargoTallyMapper">
+	
+	
+	
+</mapper>

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

@@ -0,0 +1,7 @@
+<?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.fuzamei.mapperInterface.OrdersIssueMapper">
+	
+	
+	
+</mapper>

+ 7 - 1
saicLogistics/src/main/java/com/fuzamei/mapper/UserMapper.xml

@@ -1 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?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.fuzamei.mapperInterface.UserMapper">
+	
+	
+	
+</mapper>

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

@@ -0,0 +1,5 @@
+package com.fuzamei.mapperInterface;
+
+public interface CargoConsignMapper {
+
+}

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

@@ -0,0 +1,5 @@
+package com.fuzamei.mapperInterface;
+
+public interface CargoDeliverMapper {
+
+}

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

@@ -0,0 +1,5 @@
+package com.fuzamei.mapperInterface;
+
+public interface CargoTallyMapper {
+
+}

+ 5 - 0
saicLogistics/src/main/java/com/fuzamei/mapperInterface/OrdersIssueMapper.java

@@ -0,0 +1,5 @@
+package com.fuzamei.mapperInterface;
+
+public interface OrdersIssueMapper {
+
+}

+ 5 - 0
saicLogistics/src/main/java/com/fuzamei/mapperInterface/UserMapper.java

@@ -0,0 +1,5 @@
+package com.fuzamei.mapperInterface;
+
+public interface UserMapper {
+
+}

+ 0 - 5
saicLogistics/src/main/java/com/fuzamei/mapperInterface/UserMapperInterface.java

@@ -1,5 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-public interface UserMapperInterface {
-
-}

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

@@ -0,0 +1,5 @@
+package com.fuzamei.service;
+
+public interface CargoConsignService {
+
+}

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

@@ -0,0 +1,5 @@
+package com.fuzamei.service;
+
+public interface CargoDeliverService {
+
+}

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

@@ -0,0 +1,5 @@
+package com.fuzamei.service;
+
+public interface CargoTallyService {
+
+}

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

@@ -0,0 +1,6 @@
+package com.fuzamei.service;
+
+public interface OrdersIssueService {
+	
+	
+}

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

@@ -0,0 +1,14 @@
+package com.fuzamei.service.serviceImpl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.fuzamei.mapperInterface.CargoConsignMapper;
+import com.fuzamei.service.CargoConsignService;
+
+@Service
+public class CargoConsignServiceImpl implements CargoConsignService {
+
+	@Autowired
+	private CargoConsignMapper cargoConsignMapper;
+}

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

@@ -0,0 +1,14 @@
+package com.fuzamei.service.serviceImpl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.fuzamei.mapperInterface.CargoDeliverMapper;
+import com.fuzamei.service.CargoDeliverService;
+
+@Service
+public class CargoDeliverServiceImpl implements CargoDeliverService {
+
+	@Autowired
+	private CargoDeliverMapper cargoDeliverMapper;
+}

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

@@ -0,0 +1,14 @@
+package com.fuzamei.service.serviceImpl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.fuzamei.mapperInterface.CargoTallyMapper;
+import com.fuzamei.service.CargoTallyService;
+
+@Service
+public class CargoTallyServiceImpl implements CargoTallyService {
+
+	@Autowired
+	private CargoTallyMapper cargoTallyMapper;
+}

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

@@ -0,0 +1,14 @@
+package com.fuzamei.service.serviceImpl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.fuzamei.mapperInterface.OrdersIssueMapper;
+import com.fuzamei.service.OrdersIssueService;
+
+@Service
+public class OrdersIssueServiceImpl implements OrdersIssueService {
+	
+	@Autowired
+	private OrdersIssueMapper ordersIssueMapper;
+}

+ 7 - 0
saicLogistics/src/main/java/com/fuzamei/service/serviceImpl/UserServiceImpl.java

@@ -1,7 +1,14 @@
 package com.fuzamei.service.serviceImpl;
 
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.fuzamei.mapperInterface.UserMapper;
 import com.fuzamei.service.UserService;
 
+@Service
 public class UserServiceImpl  implements  UserService{
 
+	@Autowired
+	private UserMapper userMapper;
 }

+ 224 - 15
saicLogistics/src/main/java/com/fuzamei/util/FileTransferUtil.java

@@ -1,58 +1,267 @@
 package com.fuzamei.util;
 
+import java.io.Closeable;
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.springframework.web.multipart.MultipartFile;
 
+import com.fuzamei.constant.HintMSG;
 import com.mchange.util.AssertException;
 
 public final class FileTransferUtil {
-	private static final String SP = File.separator;
-	
 	private FileTransferUtil(){
 		throw new AssertException("instaniation is not permitted");
 	}
 	
 	/**
 	 * 完成上传文件的功能
+	 * @attention 只针对单个文件上传
 	 * @param multipartFile	上传过来的文件对象
-	 * @param modifiedFilename	被修改后的文件名并且是要被添加到文件夹路径后面的名字
+	 * @param attachmentFile	被修改后的文件名并且是要被添加到File文件对象
 	 * @param directoryPath	文件夹路径
 	 */
-	public static final void transfer(MultipartFile multipartFile, String modifiedFilename, String directoryPath){
+	public static final void transferSingle(MultipartFile multipartFile, File attachmentFile, String directoryPath){
 		File dir = new File(directoryPath);
-		if(!dir.isDirectory()){
-			throw new RuntimeException("路径需要是文件夹路径");
-		}
 		if(!dir.exists()){
 			dir.mkdirs();
 		}
-		String filePath = directoryPath + modifiedFilename;
-		File newFile = new File(filePath);
+		if(!dir.isDirectory()){
+			throw new RuntimeException("路径需要是文件夹路径");
+		}
 		try {
-			multipartFile.transferTo(newFile);
+			multipartFile.transferTo(attachmentFile);
 		} catch (Exception e) {
-			if(newFile!=null){
-				newFile.delete();
+			if(null!=attachmentFile){
+				attachmentFile.delete();
 			}
-			throw new RuntimeException("文件上传出现异常:"+e.getMessage());
+			throw new RuntimeException(HintMSG.UPLOAD_FAIL+":"+e.getMessage());
 		}
 	}
 	
 	/**
-	 * 
+	 * @author ylx
 	 * @return 返回false说明没有重复的文件名,返回true说明有重复的文件名
 	 */
 	public static final boolean checkIfHasSameFileName(MultipartFile...files){
 		int count = files.length;
-		Set<String> set = new HashSet<>();
+		Set<String> set = new HashSet<String>();
 		for (MultipartFile file : files) {
 			set.add(file.getOriginalFilename());
 		}
 		int identity = set.size();
 		return identity==count?false:true;
 	}
+	
+	/**
+	 * @author ylx
+	 * @return 有空文件直接报错
+	 */
+	public static final void checkIfHasEmptyFile(MultipartFile...files){
+		if(files.length==0){
+			throw new RuntimeException("必须要有文件");
+		}
+		for (MultipartFile file : files) {
+			if(null==file || file.isEmpty()){
+				throw new RuntimeException(HintMSG.FILE_CANT_BE_NULL);
+			}
+		}
+	}
+	
+	/**
+	* @Title: transferMultiple
+	* @Description: TODO(针对多个文件上传的功能,一旦出现异常将所有文件全部删除,防止出现垃圾文件)
+	* @param @param files	客户端传过来的MultipartFile对象
+	* @param @param attachmentFileList	已经设定好的File的集合对象
+	* @param @param directoryPath   主文件夹目录
+	* @return void    返回类型
+	* @author ylx
+	* @date 2018年1月11日 下午7:47:43
+	 */
+	public static final void transferMultiple(MultipartFile[] files, List<File> attachmentFileList, String directoryPath) {
+		File dir = new File(directoryPath);
+		if(!dir.exists()){
+			dir.mkdirs();
+		}
+		if(!dir.isDirectory()){
+			throw new RuntimeException("路径需要是文件夹路径");
+		}
+		for (int i = 0; i < files.length; i++) {
+			if(files[i]==null) continue;
+			File destinationFile = attachmentFileList.get(i);
+			if(destinationFile==null) continue;
+			try {
+				files[i].transferTo(destinationFile);
+			} catch (Exception e) {
+				for (File file : attachmentFileList) {//文件一旦上传失败将所有文件全部删除
+					if(null!=file){
+						file.delete();
+					}
+				}
+				throw new RuntimeException(e.getMessage());
+			}
+		}
+	}
+	
+	/**
+	* @Title: checkSingleUploadFileSuffixes
+	* @Description: TODO(检查上传文件格式是否正确)
+	* @param @param file 上传的单个文件对象MultipartFile
+	* @param @param suffixes    上传文件的后缀名格式
+	* @return void    返回类型
+	* @author ylx
+	* @date 2018年1月12日 上午11:23:18
+	 */
+	public static final void checkSingleUploadFileSuffixes(MultipartFile file, String... suffixes){
+		if(suffixes.length==0){
+			throw new RuntimeException("必须确定文件后缀名");
+		}
+		boolean flag=false;
+		String filename = file.getOriginalFilename();
+		for (String suffix : suffixes) {
+			flag = flag || (filename.endsWith(suffix));
+		}
+		if(!flag){
+			throw new RuntimeException("文件格式错误");
+		}
+	}
+	
+	/**
+	* @Title: checkMultipleUploadFilesSuffixes
+	* @Description: TODO(检查上传文件格式是否正确)
+	* @param @param files 上传的文件数组对象MultipartFile[]
+	* @param @param suffixes    上传文件的后缀名格式
+	* @return void    返回类型
+	* @author ylx
+	* @date 2018年1月12日 上午11:23:18
+	 */
+	public static final void checkMultipleUploadFilesSuffixes(MultipartFile[] files, String... suffixes){
+		if(suffixes.length==0){
+			throw new RuntimeException("必须确定文件后缀名");
+		}
+		for (MultipartFile file : files) {
+			boolean flag=false;
+			String filename = file.getOriginalFilename();
+			for (String suffix : suffixes) {
+				flag = flag || (filename.endsWith(suffix));
+			}
+			if(!flag){
+				throw new RuntimeException("文件格式错误");
+			}
+		}
+	}
+	
+	/**
+	 * 
+	 * @title closeStream
+	 * @param c 各种可关闭对象
+	 * @author ylx977
+	 * @date 2018年1月13日 下午3:04:43
+	 *
+	 */
+	public static final void closeStream(Closeable...c){//关闭流的内部方法
+		for (Closeable closeable : c) {
+			if(closeable!=null){
+				try {
+					closeable.close();
+				} catch (IOException e) {
+					closeable=null;
+				}
+			}
+		}
+	}
+	
+	/**
+	 * 
+	* @Title: checkSingleUploadFileAndSuffixed
+	* @Description: TODO(如果文件为空就返回null,但是后缀名错误就报错)
+	* @param @param file
+	* @param @param suffixes
+	* @param @return    设定文件
+	* @return MultipartFile    返回类型
+	* @author ylx
+	* @date 2018年1月15日 下午8:15:40
+	* @throws
+	 */
+	public static final MultipartFile checkSingleUploadFileAndSuffixes(MultipartFile file,String...suffixes){
+		if(suffixes.length==0){
+			throw new RuntimeException("必须确定文件后缀名");
+		}
+		if(null == file||file.isEmpty()){
+			return null;//如果无内容直接返回null
+		}
+		boolean flag=false;
+		String filename = file.getOriginalFilename();
+		for (String suffix : suffixes) {
+			flag = flag || (filename.endsWith(suffix));
+		}
+		if(!flag){
+			throw new RuntimeException("文件格式错误");
+		}
+		return file;
+	}
+
+	/**
+	 * 
+	* @Title: checkMultiUploadFilesAndSuffixes
+	* @Description: TODO(如果数组文件为空就返回null,数组中文件都为空也返回null,但是后缀名错误就报错)
+	* @param @param f3
+	* @param @param suffixes
+	* @param @return    设定文件
+	* @return MultipartFile[]    返回类型
+	* @author ylx
+	* @date 2018年1月15日 下午8:18:20
+	* @throws
+	 */
+	public static MultipartFile[] checkMultiUploadFilesAndSuffixes(MultipartFile[] files,String...suffixes) {
+		if(suffixes.length == 0){
+			throw new RuntimeException("必须确定文件后缀名");
+		}
+		if(files == null||files.length == 0){
+			return null;
+		}
+		List<MultipartFile> list=new ArrayList<MultipartFile>();
+		for (MultipartFile file : files) {
+			boolean flag = false;
+			String filename = file.getOriginalFilename();
+			for (String suffix : suffixes) {
+				flag = flag || (filename.endsWith(suffix));
+			}
+			if(!flag){
+				throw new RuntimeException("文件格式错误");
+			}
+//			MultipartFile checked = checkEmptyFileAndReturn(file);
+//			if(checked!=null){
+//				list.add(checked);
+//			}	
+			list.add(checkEmptyFileAndReturn(file));
+		}
+		if(list.size()==0){
+			return null;
+		}
+		return list.toArray(new MultipartFile[0]);
+	}
+
+	/**
+	 * 
+	* @Title: checkEmptyFileAndReturn
+	* @Description: TODO(如果是空文件或者文件为null返回null)
+	* @param @param file
+	* @param @return    设定文件
+	* @return MultipartFile    返回类型
+	* @author ylx
+	* @date 2018年1月16日 上午10:55:34
+	* @throws
+	 */
+	public static final MultipartFile checkEmptyFileAndReturn(MultipartFile file){
+		if(file==null||file.isEmpty()){
+			return null;
+		}
+		return file;
+	}
+	
 }

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

@@ -0,0 +1,15 @@
+package com.fuzamei.web;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.fuzamei.service.CargoConsignService;
+
+@RestController
+@RequestMapping(path="/cargoConsign")
+public class CargoConsignAction {
+
+	@Autowired
+	private CargoConsignService cargoConsignService;
+}

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

@@ -0,0 +1,15 @@
+package com.fuzamei.web;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.fuzamei.service.CargoDeliverService;
+
+@RestController
+@RequestMapping(path="/cargoDeliver")
+public class CargoDeliverAction {
+
+	@Autowired
+	private CargoDeliverService cargoDeliverService;
+}

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

@@ -0,0 +1,15 @@
+package com.fuzamei.web;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.fuzamei.service.CargoTallyService;
+
+@RestController
+@RequestMapping(path="/cargoTally")
+public class CargoTallyAction {
+
+	@Autowired
+	private CargoTallyService cargoTallyService;
+}

+ 17 - 0
saicLogistics/src/main/java/com/fuzamei/web/OrdersIssueAction.java

@@ -0,0 +1,17 @@
+package com.fuzamei.web;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.fuzamei.service.OrdersIssueService;
+
+@RestController
+@RequestMapping(path="/ordersIssue")
+public class OrdersIssueAction {
+
+	@Autowired
+	private OrdersIssueService ordersIssueService;
+	
+	
+}

+ 10 - 0
saicLogistics/src/main/java/com/fuzamei/web/UserAction.java

@@ -1,5 +1,15 @@
 package com.fuzamei.web;
 
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.fuzamei.service.UserService;
+
+@RestController
+@RequestMapping(path="/user")
 public class UserAction {
 
+	@Autowired
+	private UserService userService;
 }

+ 1 - 1
saicLogistics/src/main/resources/applicationContext.xml

@@ -31,7 +31,7 @@
 	</bean>
 	
 	<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">                                         
-        <property name="basePackage" value="com.fuzamei.mapperInterface" />                                      
+        <property name="basePackage" value="com.fuzamei.mapperInterface"/>
     </bean>
     
 </beans>