Sfoglia il codice sorgente

Merge branch 'master' of https://git.coding.net/aft/AFT.git

Antiloveg 9 anni fa
parent
commit
9746a9920a
33 ha cambiato i file con 2289 aggiunte e 108 eliminazioni
  1. 1 4
      schema/2017-03-14.sql
  2. 37 0
      schema/2017-03-15.sql
  3. 164 0
      src/main/java/com/goafanti/admin/controller/AdminCopyrightApiController.java
  4. 8 0
      src/main/java/com/goafanti/common/constant/AFTConstants.java
  5. 59 59
      src/main/java/com/goafanti/common/constant/ErrorConstants.java
  6. 56 4
      src/main/java/com/goafanti/common/controller/BaseApiController.java
  7. 2 1
      src/main/java/com/goafanti/common/controller/BaseController.java
  8. 47 0
      src/main/java/com/goafanti/common/controller/CertifyApiController.java
  9. 28 0
      src/main/java/com/goafanti/common/dao/CopyrightInfoMapper.java
  10. 17 0
      src/main/java/com/goafanti/common/dao/CopyrightLogMapper.java
  11. 47 0
      src/main/java/com/goafanti/common/enums/AttachmentType.java
  12. 61 0
      src/main/java/com/goafanti/common/enums/CopyrightFields.java
  13. 60 0
      src/main/java/com/goafanti/common/enums/CopyrightStatus.java
  14. 52 0
      src/main/java/com/goafanti/common/enums/UserLevel.java
  15. 52 0
      src/main/java/com/goafanti/common/enums/UserType.java
  16. 353 0
      src/main/java/com/goafanti/common/mapper/CopyrightInfoMapper.xml
  17. 117 0
      src/main/java/com/goafanti/common/mapper/CopyrightLogMapper.xml
  18. 6 3
      src/main/java/com/goafanti/common/model/BaseModel.java
  19. 231 0
      src/main/java/com/goafanti/common/model/CopyrightInfo.java
  20. 89 0
      src/main/java/com/goafanti/common/model/CopyrightLog.java
  21. 11 7
      src/main/java/com/goafanti/common/utils/FileUtils.java
  22. 89 0
      src/main/java/com/goafanti/copyright/bo/CopyrightInfoDetail.java
  23. 270 0
      src/main/java/com/goafanti/copyright/bo/CopyrightInfoSummary.java
  24. 135 0
      src/main/java/com/goafanti/copyright/bo/InputCopyright.java
  25. 64 0
      src/main/java/com/goafanti/copyright/controller/CopyrightApiController.java
  26. 27 0
      src/main/java/com/goafanti/copyright/service/CopyrightInfoService.java
  27. 15 0
      src/main/java/com/goafanti/copyright/service/CopyrightLogService.java
  28. 138 0
      src/main/java/com/goafanti/copyright/service/impl/CopyrightInfoServiceImpl.java
  29. 28 0
      src/main/java/com/goafanti/copyright/service/impl/CopyrightLogServiceImpl.java
  30. 14 0
      src/main/java/com/goafanti/core/shiro/token/TokenManager.java
  31. 0 25
      src/main/java/com/goafanti/user/controller/UserApiController.java
  32. 10 5
      src/main/resources/props/error.properties
  33. 1 0
      src/main/resources/spring/spring-mybatis.xml

+ 1 - 4
schema/2017-03-14.sql

@@ -1,4 +1 @@
-alter table admin MODIFY COLUMN `id` VARCHAR(36) NOT NULL ;
-
-
-
+alter table admin MODIFY COLUMN `id` VARCHAR(36) NOT NULL ;

+ 37 - 0
schema/2017-03-15.sql

@@ -0,0 +1,37 @@
+CREATE TABLE `copyright_info` (
+  `id` varchar(36) NOT NULL COMMENT '主键',
+  `uid` varchar(36) NOT NULL COMMENT '用户主键',
+  `serial_number` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `accept_time` datetime DEFAULT NULL COMMENT '受理时间',
+  `principal` varchar(36) DEFAULT NULL COMMENT '负责人',
+  `contact` int(1) DEFAULT NULL COMMENT '联系人',
+  `copyright_info` varchar(255) DEFAULT NULL COMMENT '软著简介',
+  `copyright_name` varchar(60) DEFAULT NULL COMMENT '软著名字',
+  `status` int(1) DEFAULT NULL COMMENT '申请状态',
+  `work_issue` varchar(128) DEFAULT NULL COMMENT '派单信息',
+  `comment` varchar(128) DEFAULT NULL COMMENT '备注',
+  `outsource` varchar(60) DEFAULT NULL COMMENT '外包公司',
+  `in_urgent` int(3) DEFAULT NULL COMMENT '加急天数',
+  `authorized_date` datetime DEFAULT NULL COMMENT '下证日',
+  `certificate_url` varchar(255) DEFAULT NULL COMMENT '证书附件地址',
+  `application_url` varchar(255) DEFAULT NULL COMMENT '申请书附件地址',
+  `delete_sign` int(1) NOT NULL DEFAULT '0' COMMENT '删除标记',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `serial_number_UNIQUE` (`serial_number`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
+
+
+CREATE TABLE `copyright_log` (
+  `id` varchar(36) NOT NULL COMMENT '主键',
+  `cid` varchar(36) NOT NULL COMMENT '软著申请id',
+  `record_time` datetime DEFAULT NULL COMMENT '状态流转时间',
+  `status` int(1) DEFAULT NULL COMMENT '状态',
+  `principal` varchar(36) DEFAULT NULL COMMENT '负责人',
+  `operator` varchar(36) DEFAULT NULL COMMENT '操作人',
+  `comment` varchar(45) DEFAULT NULL COMMENT '备注',
+  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '日志创建时间',
+  PRIMARY KEY (`id`),
+  KEY `fk_copyright_log_copyright_info1_idx` (`cid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+

+ 164 - 0
src/main/java/com/goafanti/admin/controller/AdminCopyrightApiController.java

@@ -0,0 +1,164 @@
+package com.goafanti.admin.controller;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.FieldError;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.CopyrightFields;
+import com.goafanti.common.enums.CopyrightStatus;
+import com.goafanti.common.model.CopyrightInfo;
+import com.goafanti.common.model.CopyrightLog;
+import com.goafanti.common.model.User;
+import com.goafanti.copyright.bo.InputCopyright;
+import com.goafanti.copyright.service.CopyrightInfoService;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.user.service.UserService;
+
+@RestController
+@RequestMapping(value = "/api/admin/copyright")
+public class AdminCopyrightApiController extends CertifyApiController {
+	@Resource
+	private CopyrightInfoService	copyrightInfoService;
+	@Resource
+	private UserService				userService;
+
+	@Value(value = "${upload.private.path}")
+	private String					uploadPrivatePath	= null;
+
+	@RequestMapping(value = "/apply", method = RequestMethod.POST)
+	public Result newApply(@Valid InputCopyright inputInfo, BindingResult bindingResult) {
+		Result res = new Result();
+		if (handleBindingError(res, bindingResult)) {
+			return res;
+		}
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isBlank(inputInfo.getUid())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
+			return res;
+		}
+		User curUser = userService.selectByPrimaryKey(inputInfo.getUid());
+		if (checkCertify(res, curUser)) {
+			return res;
+		}
+		CopyrightInfo ci = new CopyrightInfo();
+		BeanUtils.copyProperties(inputInfo, ci);
+		ci.setUid(curUser.getId());
+		if (StringUtils.isBlank(ci.getPrincipal())) {
+			ci.setStatus(CopyrightStatus.CREATE.getCode());
+			ci.setPrincipal(curUser.getAid());
+		} else {
+			ci.setStatus(CopyrightStatus.DELIVERD.getCode());
+		}
+		copyrightInfoService.insert(ci);
+		res.setData(ci);
+		return res;
+	}
+
+	@RequestMapping(value = "/modify", method = RequestMethod.POST)
+	public Result modify(String id, @Valid InputCopyright inputInfo, BindingResult bindingResult) {
+		Result res = new Result();
+		if (handleBindingError(res, bindingResult)) {
+			return res;
+		}
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到软著", "软著申请id"));
+			return res;
+		}
+		CopyrightInfo oci = copyrightInfoService.selectByPrimaryKey(id);
+		if (oci == null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "找不到软著", "软著申请"));
+			return res;
+		}
+
+		CopyrightInfo ci = new CopyrightInfo();
+		CopyrightLog cl = new CopyrightLog();
+		BeanUtils.copyProperties(inputInfo, ci);
+		BeanUtils.copyProperties(inputInfo, cl);
+		ci.setId(oci.getId());
+		ci.setUid(oci.getUid());
+		cl.setCid(oci.getId());
+		cl.setOperator(TokenManager.getAdminId());
+		copyrightInfoService.updateByPrimaryKeySelective(ci, cl);
+		res.setData(1);
+		return res;
+	}
+
+	@RequestMapping(value = "/upload", method = RequestMethod.POST)
+	public Result upload(String id, String sign, HttpServletRequest req) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+
+		res.setData(handleFile(res, "/copyright/", true, req, sign));
+		return res;
+	}
+
+	@RequestMapping(value = "/list", method = RequestMethod.GET)
+	public Result list(String province, String unitName, String copyrightName, String status, String pageNo,
+			String pageSize, @RequestParam(name = "createTime[]", required = false) String[] createTime,
+			@RequestParam(name = "acceptTime[]", required = false) String[] acceptTime,
+			@RequestParam(name = "authTime[]", required = false) String[] authTime) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		res.setData(copyrightInfoService.listCopyrightInfo(province, unitName, copyrightName,
+				CopyrightStatus.getStatus(status), createTime, acceptTime, authTime, getPageNo(pageNo),
+				getPageSize(pageSize)));
+		return res;
+	}
+
+	@RequestMapping(value = "/detail", method = RequestMethod.GET)
+	public Result detail(String id) {
+		Result res = new Result();
+		if (!checkAdminLogin(res)) {
+			return res;
+		}
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "公司"));
+		} else {
+			res.setData(copyrightInfoService.findByPrimaryKey(id));
+		}
+		return res;
+	}
+
+	private boolean handleBindingError(Result res, BindingResult bindingResult) {
+		if (bindingResult.hasErrors()) {
+			for (FieldError fe : bindingResult.getFieldErrors()) {
+				Class<?> clazz = bindingResult.getFieldType(fe.getField());
+				if (clazz != null && "java.util.Date".equals(clazz.getName())) {
+					res.getError()
+							.add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "日期格式错误",
+									CopyrightFields.getFieldDesc(fe.getField()), AFTConstants.DATE_FORMAT)
+											.buildField(fe.getField()));
+				} else {
+					res.getError()
+							.add(buildErrorByMsg(fe.getDefaultMessage(), CopyrightFields.getFieldDesc(fe.getField()))
+									.buildField(fe.getField()));
+				}
+			}
+			return true;
+		}
+		return false;
+	}
+}

+ 8 - 0
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -0,0 +1,8 @@
+package com.goafanti.common.constant;
+
+public class AFTConstants {
+	public static final String	DATE_FORMAT					= "yyyy-MM-dd HH:mm:ss";
+
+	public static final String	YYYYMMDD					= "yyyy-MM-dd";
+
+}

+ 59 - 59
src/main/java/com/goafanti/common/constant/ErrorConstants.java

@@ -2,64 +2,64 @@ package com.goafanti.common.constant;
 
 public class ErrorConstants {
 
-	public static final String NON_LOGIN = "NON_LOGIN";
-
-	public static final String VCODE_ERROR = "VCODE_ERROR";
-
-	public static final String EMAIL_SIZE_ERROR = "EMAIL_SIZE_ERROR";
-
-	public static final String EMAIL_PATTERN_ERROR = "EMAIL_PATTERN_ERROR";
-
-	public static final String DUNPLICATE_KAY_ERROR = "DUNPLICATE_KAY_ERROR";
-
-	public static final String PARAM_INTEGER_ERROR = "PARAM_INTEGER_ERROR";
-
-	public static final String PARAM_EMPTY_ERROR = "PARAM_EMPTY_ERROR";
-
-	public static final String PARAM_SIZE_ERROR = "PARAM_SIZE_ERROR";
-
-	public static final String PARAM_PATTERN_ERROR = "PARAM_PATTERN_ERROR";
-
-	public static final String DATA_EMPTY_ERROR = "DATA_EMPTY_ERROR";
-
-	public static final String PWD_NOT_MATCH_ERROR = "PWD_NOT_MATCH_ERROR";
-	
-	public static final String PWD_SAME_ERROR = "PWD_SAME_ERROR";
-	
-	public static final String USER_ALREADY_EXIST = "USER_ALREADY_EXIST";
-	
-	public static final String MOBILE_PATTERN_ERROR = "MOBILE_PATTERN_ERROR";
-	
-	public static final String MOBILE_SIZE_ERROR = "MOBILE_SIZE_ERROR";
-	
-	public static final String MOBILE_SAME_ERROR = "MOBILE_SAME_ERROR";
-	
-	public static final String MOBILE_EMPTY_ERROR = "MOBILE_EMPTY_ERROR";
-	
-	public static final String IDNUMBER_SIZE_ERROR = "IDNUMBER_SIZE_ERROR";
-	
-	public static final String IDNUMBER_PATTERN_ERROR = "IDNUMBER_PATTERN_ERROR";
-	
-	public static final String MCODE_ERROR = "MCODE_ERROR";
-	
-	public static final String MCODE_OVERTIME_ERROR = "MCODE_OVERTIME_ERROR";
-	
-	public static final String NON_REGISTER = "NON_REGISTER";
-	
-	public static final String RESET_CODE_ERROR = "RESET_CODE_ERROR";
-	
-	public static final String RESET_CODE_OVERTIME = "RESET_CODE_OVERTIME";
-	
-	public static final String FILE_NON_EXISTENT = "FILE_NON_EXISTENT";
-	
-	public static final String INSUFFICIENT_AUTHORITY_ERROR = "INSUFFICIENT_AUTHORITY_ERROR";
-	
-	public static final String NON_CERTIFIED = "NON_CERTIFIED";
-	
-	public static final String DUPLICATE_DATA_ERROR = "DUPLICATE_DATA_ERROR";
-	
-	public static final String FILE_PATTERN_ERROR = "FILE_PATTERN_ERROR";
-	
-	
+	public static final String	NON_LOGIN						= "NON_LOGIN";
+
+	public static final String	VCODE_ERROR						= "VCODE_ERROR";
+
+	public static final String	PARAM_ERROR						= "PARAM_ERROR";
+
+	public static final String	PARAM_INTEGER_ERROR				= "PARAM_INTEGER_ERROR";
+
+	public static final String	PARAM_EMPTY_ERROR				= "PARAM_EMPTY_ERROR";
+
+	public static final String	PARAM_SIZE_ERROR				= "PARAM_SIZE_ERROR";
+
+	public static final String	PARAM_PATTERN_ERROR				= "PARAM_PATTERN_ERROR";
+
+	public static final String	EMAIL_SIZE_ERROR				= "EMAIL_SIZE_ERROR";
+
+	public static final String	EMAIL_PATTERN_ERROR				= "EMAIL_PATTERN_ERROR";
+
+	public static final String	DUNPLICATE_KAY_ERROR			= "DUNPLICATE_KAY_ERROR";
+
+	public static final String	DATA_EMPTY_ERROR				= "DATA_EMPTY_ERROR";
+
+	public static final String	PWD_NOT_MATCH_ERROR				= "PWD_NOT_MATCH_ERROR";
+
+	public static final String	PWD_SAME_ERROR					= "PWD_SAME_ERROR";
+
+	public static final String	USER_ALREADY_EXIST				= "USER_ALREADY_EXIST";
+
+	public static final String	MOBILE_PATTERN_ERROR			= "MOBILE_PATTERN_ERROR";
+
+	public static final String	MOBILE_SIZE_ERROR				= "MOBILE_SIZE_ERROR";
+
+	public static final String	MOBILE_SAME_ERROR				= "MOBILE_SAME_ERROR";
+
+	public static final String	MOBILE_EMPTY_ERROR				= "MOBILE_EMPTY_ERROR";
+
+	public static final String	IDNUMBER_SIZE_ERROR				= "IDNUMBER_SIZE_ERROR";
+
+	public static final String	IDNUMBER_PATTERN_ERROR			= "IDNUMBER_PATTERN_ERROR";
+
+	public static final String	MCODE_ERROR						= "MCODE_ERROR";
+
+	public static final String	MCODE_OVERTIME_ERROR			= "MCODE_OVERTIME_ERROR";
+
+	public static final String	NON_REGISTER					= "NON_REGISTER";
+
+	public static final String	RESET_CODE_ERROR				= "RESET_CODE_ERROR";
+
+	public static final String	RESET_CODE_OVERTIME				= "RESET_CODE_OVERTIME";
+
+	public static final String	FILE_NON_EXISTENT				= "FILE_NON_EXISTENT";
+
+	public static final String	INSUFFICIENT_AUTHORITY_ERROR	= "INSUFFICIENT_AUTHORITY_ERROR";
+
+	public static final String	NON_CERTIFIED					= "NON_CERTIFIED";
+
+	public static final String	DUPLICATE_DATA_ERROR			= "DUPLICATE_DATA_ERROR";
+
+	public static final String	FILE_PATTERN_ERROR				= "FILE_PATTERN_ERROR";
 
 }

+ 56 - 4
src/main/java/com/goafanti/common/controller/BaseApiController.java

@@ -1,6 +1,7 @@
 package com.goafanti.common.controller;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -8,20 +9,26 @@ import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.commons.fileupload.servlet.ServletFileUpload;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartRequest;
 
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.utils.FileUtils;
+import com.goafanti.common.utils.LoggerUtils;
+import com.goafanti.core.shiro.token.TokenManager;
+
 @RestController
 @RequestMapping(value = "/api")
 public class BaseApiController extends BaseController {
 
 	@Value(value = "${upload.path}")
-	private String uploadPath = null;
+	private String	uploadPath			= null;
 	@Value(value = "${upload.private.path}")
-	private String uploadPrivatePath = null;
+	private String	uploadPrivatePath	= null;
 
 	/**
 	 * 
@@ -42,6 +49,35 @@ public class BaseApiController extends BaseController {
 
 	/**
 	 * 
+	 * @param res
+	 * @param path
+	 * @param isPrivate
+	 * @param req
+	 * @param sign
+	 * @return
+	 */
+	protected String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign) {
+		List<MultipartFile> files = getFiles(req);
+		MultipartFile mf = files.get(0);
+		String fileName = FileUtils.mosaicFileName(mf, isPrivate, sign, path, TokenManager.getUserId());
+		if (!files.isEmpty()) {
+			try {
+				mf.transferTo(isPrivate ? toPrivateFile(fileName) : toFile(fileName));
+				LoggerUtils.debug(getClass(), fileName + " 文件上传成功");
+			} catch (IllegalStateException | IOException e) {
+				LoggerUtils.error(getClass(), "文件上传失败", e);
+				res.getError().add(buildError("", "文件上传失败!"));
+				return "";
+			}
+		} else {
+			res.getError().add(buildError("", "文件上传失败!"));
+			return "";
+		}
+		return fileName;
+	}
+
+	/**
+	 * 
 	 * @param fileName
 	 * @return
 	 */
@@ -61,15 +97,31 @@ public class BaseApiController extends BaseController {
 		toFile.mkdirs();
 		return toFile;
 	}
-	
+
 	/**
 	 * 
 	 * @param fileName
 	 * @return
 	 */
 	protected File toAdminPrivateFile(String fileName) {
-		File toFile = new File(uploadPrivatePath + "/admin/"+ fileName);
+		File toFile = new File(uploadPrivatePath + "/admin/" + fileName);
 		toFile.mkdirs();
 		return toFile;
 	}
+
+	protected Integer getPageNo(String pageNo) {
+		if (StringUtils.isNumeric(pageNo)) {
+			Integer pn = Integer.parseInt(pageNo);
+			return pn < 1 ? 1 : pn;
+		}
+		return 1;
+	}
+
+	protected Integer getPageSize(String pageSize) {
+		if (StringUtils.isNumeric(pageSize)) {
+			Integer ps = Integer.parseInt(pageSize);
+			return ps > 50 ? 50 : (ps < 10 ? 10 : ps);
+		}
+		return 10;
+	}
 }

+ 2 - 1
src/main/java/com/goafanti/common/controller/BaseController.java

@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.InitBinder;
 import org.springframework.web.bind.annotation.ModelAttribute;
 
 import com.goafanti.common.bo.Error;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.User;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -84,7 +85,7 @@ public class BaseController {
 
 	@InitBinder
 	public void initBinder(WebDataBinder binder) {
-		DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		DateFormat dateFormat = new SimpleDateFormat(AFTConstants.DATE_FORMAT);
 		dateFormat.setLenient(true);
 		binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
 	}

+ 47 - 0
src/main/java/com/goafanti/common/controller/CertifyApiController.java

@@ -0,0 +1,47 @@
+package com.goafanti.common.controller;
+
+import javax.annotation.Resource;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.enums.UserLevel;
+import com.goafanti.common.model.User;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.user.service.OrganizationIdentityService;
+import com.goafanti.user.service.UserIdentityService;
+
+public class CertifyApiController extends BaseApiController {
+	@Resource
+	private OrganizationIdentityService	organizationIdentityService;
+	@Resource
+	private UserIdentityService			userIdentityService;
+
+	public boolean checkCertify(Result res, User user) {
+		if (user == null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "用户未指定", "用户"));
+			return false;
+		}
+		if (UserLevel.getStatus(user.getLvl()).equals(UserLevel.GENERAL)) {
+			res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
+			return false;
+		}
+		return true;
+	}
+
+	public boolean checkAdminLogin(Result res) {
+		if (TokenManager.getAdminToken() == null) {
+			res.getError().add(buildError(ErrorConstants.NON_LOGIN, "找不到登录信息"));
+			return false;
+		}
+		return true;
+	}
+
+	public boolean checkUserLogin(Result res) {
+		if (TokenManager.getUserToken() == null) {
+			res.getError().add(buildError(ErrorConstants.NON_LOGIN, "找不到登录信息"));
+			return false;
+		}
+		return true;
+	}
+
+}

+ 28 - 0
src/main/java/com/goafanti/common/dao/CopyrightInfoMapper.java

@@ -0,0 +1,28 @@
+package com.goafanti.common.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import com.goafanti.common.model.CopyrightInfo;
+import com.goafanti.copyright.bo.CopyrightInfoDetail;
+import com.goafanti.copyright.bo.CopyrightInfoSummary;
+
+public interface CopyrightInfoMapper {
+	int deleteByPrimaryKey(String id);
+
+	int insert(CopyrightInfo record);
+
+	int insertSelective(CopyrightInfo record);
+
+	CopyrightInfo selectByPrimaryKey(String id);
+
+	CopyrightInfoDetail findByPrimaryKey(String id);
+
+	int updateByPrimaryKeySelective(CopyrightInfo record);
+
+	int updateByPrimaryKey(CopyrightInfo record);
+
+	List<CopyrightInfoSummary> findListByPage(Map<String, Object> params);
+
+	int findListCount(Map<String, Object> params);
+}

+ 17 - 0
src/main/java/com/goafanti/common/dao/CopyrightLogMapper.java

@@ -0,0 +1,17 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.CopyrightLog;
+
+public interface CopyrightLogMapper {
+    int deleteByPrimaryKey(String id);
+
+    int insert(CopyrightLog record);
+
+    int insertSelective(CopyrightLog record);
+
+    CopyrightLog selectByPrimaryKey(String id);
+
+    int updateByPrimaryKeySelective(CopyrightLog record);
+
+    int updateByPrimaryKey(CopyrightLog record);
+}

+ 47 - 0
src/main/java/com/goafanti/common/enums/AttachmentType.java

@@ -0,0 +1,47 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum AttachmentType {
+	COPYRIGHT_AUTH("copyright_auth", "软著证书"), COPYRIGHT_APPLY("copyright_apply", "软著申请书"), DEFAULT("attachment", "附件");
+
+	private AttachmentType(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<String, AttachmentType> status = new HashMap<String, AttachmentType>();
+
+	static {
+		for (AttachmentType value : AttachmentType.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static AttachmentType getField(String code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return DEFAULT;
+	}
+
+	public static String getFieldDesc(String code) {
+		return getField(code).getDesc();
+	}
+
+	public static boolean containsType(String code) {
+		return status.containsKey(code);
+	}
+
+	private String	code;
+	private String	desc;
+
+	public String getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+}

+ 61 - 0
src/main/java/com/goafanti/common/enums/CopyrightFields.java

@@ -0,0 +1,61 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum CopyrightFields {
+
+	UID("uid", "用户id"),
+	ACCEPTTIME("acceptTime", "受理时间"),
+	PRINCIPAL("principal", "负责人"),
+	CONTACT("contact", "联系人"),
+	COPYRIGHTINFO("copyrightInfo", "软著简介"),
+	COPYRIGHTNAME("copyrightName", "软著名称"),
+	STATUS("status", "申请状态"),
+	WORKISSUE("workIssue", "派单信息"),
+	COMMENT("comment", "备注"),
+	OUTSOURCE("outsource", "外包单位"),
+	INURGENT("inUrgent", "加急天数"),
+	AUTHORIZEDDATE("authorizedDate", "下证日期"),
+	RECORDTIME("recordTime", "状态流转时间"),
+	OTHER("", "未知参数");
+
+	private CopyrightFields(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<String, CopyrightFields> status = new HashMap<String, CopyrightFields>();
+
+	static {
+		for (CopyrightFields value : CopyrightFields.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static CopyrightFields getField(String code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static String getFieldDesc(String code) {
+		return getField(code).getDesc();
+	}
+
+	public static boolean containsType(String code) {
+		return status.containsKey(code);
+	}
+
+	private String	code;
+	private String	desc;
+
+	public String getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+}

+ 60 - 0
src/main/java/com/goafanti/common/enums/CopyrightStatus.java

@@ -0,0 +1,60 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum CopyrightStatus {
+	CREATE(1, "创建"),
+	DELIVERD(2, "派单"),
+	SUBMIT(3, "材料提交"),
+	ACCEPT(4, "受理"),
+	AMEND(5, "补正"),
+	REJECT(6, "驳回"),
+	AUTHORIZED(7, "已下证"),
+	CALLBACK(8, "撤销"),
+	OTHER(9, "其他");
+
+	private CopyrightStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, CopyrightStatus> status = new HashMap<Integer, CopyrightStatus>();
+
+	static {
+		for (CopyrightStatus value : CopyrightStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static CopyrightStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static CopyrightStatus getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+}

+ 52 - 0
src/main/java/com/goafanti/common/enums/UserLevel.java

@@ -0,0 +1,52 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum UserLevel {
+	GENERAL(0, "普通会员"), CERTIFIED(1, "认证会员");
+
+	private UserLevel(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, UserLevel> status = new HashMap<Integer, UserLevel>();
+
+	static {
+		for (UserLevel value : UserLevel.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static UserLevel getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return GENERAL;
+	}
+
+	public static UserLevel getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return GENERAL;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+}

+ 52 - 0
src/main/java/com/goafanti/common/enums/UserType.java

@@ -0,0 +1,52 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum UserType {
+	PERSONAL(0, "个人账号"), ORGANIZATION(1, "组织账号");
+
+	private UserType(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, UserType> status = new HashMap<Integer, UserType>();
+
+	static {
+		for (UserType value : UserType.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static UserType getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return PERSONAL;
+	}
+
+	public static UserType getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return PERSONAL;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+}

+ 353 - 0
src/main/java/com/goafanti/common/mapper/CopyrightInfoMapper.xml

@@ -0,0 +1,353 @@
+<?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.goafanti.common.dao.CopyrightInfoMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.CopyrightInfo">
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="uid" jdbcType="VARCHAR" property="uid" />
+    <result column="serial_number" jdbcType="INTEGER" property="serialNumber" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="accept_time" jdbcType="TIMESTAMP" property="acceptTime" />
+    <result column="principal" jdbcType="VARCHAR" property="principal" />
+    <result column="contact" jdbcType="INTEGER" property="contact" />
+    <result column="copyright_info" jdbcType="VARCHAR" property="copyrightInfo" />
+    <result column="copyright_name" jdbcType="VARCHAR" property="copyrightName" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="work_issue" jdbcType="VARCHAR" property="workIssue" />
+    <result column="comment" jdbcType="VARCHAR" property="comment" />
+    <result column="outsource" jdbcType="VARCHAR" property="outsource" />
+    <result column="in_urgent" jdbcType="INTEGER" property="inUrgent" />
+    <result column="authorized_date" jdbcType="TIMESTAMP" property="authorizedDate" />
+    <result column="certificate_url" jdbcType="VARCHAR" property="certificateUrl" />
+    <result column="application_url" jdbcType="VARCHAR" property="applicationUrl" />
+    <result column="delete_sign" jdbcType="INTEGER" property="deleteSign" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, uid, serial_number, create_time, accept_time, principal, contact, copyright_info, 
+    copyright_name, status, work_issue, comment, outsource, in_urgent, authorized_date, 
+    certificate_url, application_url, delete_sign
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from copyright_info
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <select id="findByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.copyright.bo.CopyrightInfoDetail">
+    select ci.id,ci.serial_number as serialNumber, ci.create_time as createTime, 
+	ci.accept_time as acceptTime, ci.contact, ci.copyright_name as copyrightName, 
+	ci.status, ci.comment, ci.outsource, ci.in_urgent as inUrgent, ci.authorized_date as authorizedDate, 
+	ci.work_issue as workIssue,ci.application_url as applicationUrl,ci.certificate_url as certificateUrl,
+	oi.location_province as province, oi.location_city as city,oi.location_area as area, oi.postcode,
+	oi.unit_name as unitName, 
+	concat(oi.first_contacts,'  ', oi.first_mobile) as firstContact,
+	concat(oi.second_contacts,'  ', oi.second_mobile) as secondContact,
+	concat(oi.third_contacts,'  ', oi.third_mobile) as thirdContact,
+	a.name as principal
+	from copyright_info ci 
+	left join organization_identity oi on ci.uid = oi.uid
+	left join admin a on ci.principal = a.id
+    where ci.id = #{id,jdbcType=VARCHAR}
+  </select>
+  
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from copyright_info
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.CopyrightInfo">
+    insert into copyright_info (id, uid, serial_number, 
+      create_time, accept_time, principal, 
+      contact, copyright_info, copyright_name, 
+      status, work_issue, comment, 
+      outsource, in_urgent, authorized_date, 
+      certificate_url, application_url, delete_sign
+      )
+    values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{acceptTime,jdbcType=TIMESTAMP}, #{principal,jdbcType=VARCHAR}, 
+      #{contact,jdbcType=INTEGER}, #{copyrightInfo,jdbcType=VARCHAR}, #{copyrightName,jdbcType=VARCHAR}, 
+      #{status,jdbcType=INTEGER}, #{workIssue,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}, 
+      #{outsource,jdbcType=VARCHAR}, #{inUrgent,jdbcType=INTEGER}, #{authorizedDate,jdbcType=TIMESTAMP}, 
+      #{certificateUrl,jdbcType=VARCHAR}, #{applicationUrl,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.CopyrightInfo">
+    insert into copyright_info
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="uid != null">
+        uid,
+      </if>
+      <if test="serialNumber != null">
+        serial_number,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="acceptTime != null">
+        accept_time,
+      </if>
+      <if test="principal != null">
+        principal,
+      </if>
+      <if test="contact != null">
+        contact,
+      </if>
+      <if test="copyrightInfo != null">
+        copyright_info,
+      </if>
+      <if test="copyrightName != null">
+        copyright_name,
+      </if>
+      <if test="status != null">
+        status,
+      </if>
+      <if test="workIssue != null">
+        work_issue,
+      </if>
+      <if test="comment != null">
+        comment,
+      </if>
+      <if test="outsource != null">
+        outsource,
+      </if>
+      <if test="inUrgent != null">
+        in_urgent,
+      </if>
+      <if test="authorizedDate != null">
+        authorized_date,
+      </if>
+      <if test="certificateUrl != null">
+        certificate_url,
+      </if>
+      <if test="applicationUrl != null">
+        application_url,
+      </if>
+      <if test="deleteSign != null">
+        delete_sign,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="uid != null">
+        #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="serialNumber != null">
+        #{serialNumber,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="acceptTime != null">
+        #{acceptTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="principal != null">
+        #{principal,jdbcType=VARCHAR},
+      </if>
+      <if test="contact != null">
+        #{contact,jdbcType=INTEGER},
+      </if>
+      <if test="copyrightInfo != null">
+        #{copyrightInfo,jdbcType=VARCHAR},
+      </if>
+      <if test="copyrightName != null">
+        #{copyrightName,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="workIssue != null">
+        #{workIssue,jdbcType=VARCHAR},
+      </if>
+      <if test="comment != null">
+        #{comment,jdbcType=VARCHAR},
+      </if>
+      <if test="outsource != null">
+        #{outsource,jdbcType=VARCHAR},
+      </if>
+      <if test="inUrgent != null">
+        #{inUrgent,jdbcType=INTEGER},
+      </if>
+      <if test="authorizedDate != null">
+        #{authorizedDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="certificateUrl != null">
+        #{certificateUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="applicationUrl != null">
+        #{applicationUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteSign != null">
+        #{deleteSign,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.CopyrightInfo">
+    update copyright_info
+    <set>
+      <if test="uid != null">
+        uid = #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="serialNumber != null">
+        serial_number = #{serialNumber,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="acceptTime != null">
+        accept_time = #{acceptTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="principal != null">
+        principal = #{principal,jdbcType=VARCHAR},
+      </if>
+      <if test="contact != null">
+        contact = #{contact,jdbcType=INTEGER},
+      </if>
+      <if test="copyrightInfo != null">
+        copyright_info = #{copyrightInfo,jdbcType=VARCHAR},
+      </if>
+      <if test="copyrightName != null">
+        copyright_name = #{copyrightName,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        status = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="workIssue != null">
+        work_issue = #{workIssue,jdbcType=VARCHAR},
+      </if>
+      <if test="comment != null">
+        comment = #{comment,jdbcType=VARCHAR},
+      </if>
+      <if test="outsource != null">
+        outsource = #{outsource,jdbcType=VARCHAR},
+      </if>
+      <if test="inUrgent != null">
+        in_urgent = #{inUrgent,jdbcType=INTEGER},
+      </if>
+      <if test="authorizedDate != null">
+        authorized_date = #{authorizedDate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="certificateUrl != null">
+        certificate_url = #{certificateUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="applicationUrl != null">
+        application_url = #{applicationUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteSign != null">
+        delete_sign = #{deleteSign,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.CopyrightInfo">
+    update copyright_info
+    set uid = #{uid,jdbcType=VARCHAR},
+      serial_number = #{serialNumber,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      accept_time = #{acceptTime,jdbcType=TIMESTAMP},
+      principal = #{principal,jdbcType=VARCHAR},
+      contact = #{contact,jdbcType=INTEGER},
+      copyright_info = #{copyrightInfo,jdbcType=VARCHAR},
+      copyright_name = #{copyrightName,jdbcType=VARCHAR},
+      status = #{status,jdbcType=INTEGER},
+      work_issue = #{workIssue,jdbcType=VARCHAR},
+      comment = #{comment,jdbcType=VARCHAR},
+      outsource = #{outsource,jdbcType=VARCHAR},
+      in_urgent = #{inUrgent,jdbcType=INTEGER},
+      authorized_date = #{authorizedDate,jdbcType=TIMESTAMP},
+      certificate_url = #{certificateUrl,jdbcType=VARCHAR},
+      application_url = #{applicationUrl,jdbcType=VARCHAR},
+      delete_sign = #{deleteSign,jdbcType=INTEGER}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  
+  <select id="findListByPage" resultType="com.goafanti.copyright.bo.CopyrightInfoSummary"  parameterType="String">
+  	select ci.id,ci.serial_number as serialNumber, ci.create_time as createTime, 
+	ci.accept_time as acceptTime, ci.contact,
+	ci.copyright_name as copyrightName, ci.status, ci.comment, ci.outsource, ci.in_urgent as inUrgent, 
+	ci.authorized_date as authorizedDate, ci.work_issue as workIssue,
+	oi.location_province as province,oi.unit_name as unitName, 
+	concat(oi.first_contacts,'  ', oi.first_mobile) as firstContact,
+	concat(oi.second_contacts,'  ', oi.second_mobile) as secondContact,
+	concat(oi.third_contacts,'  ', oi.third_mobile) as thirdContact,
+	a.name as principal
+	from copyright_info ci 
+	left join organization_identity oi on ci.uid = oi.uid
+	left join admin a on ci.principal = a.id
+	where ci.delete_sign = 0
+	<if test="province != null">
+	    and oi.location_province =  #{province,jdbcType=VARCHAR}
+	</if>
+	<if test="status != null">
+	    and ci.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="unitName != null">
+	    and oi.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
+	</if>
+	<if test="copyrightName != null">
+	    and ci.copyright_name like CONCAT('%', #{copyrightName,jdbcType=VARCHAR}, '%')
+	</if>
+	<if test="createStartTime != null">
+	    and ci.create_time <![CDATA[ >= ]]> #{createStartTime,jdbcType=TIMESTAMP}
+	</if>
+	<if test="createEndTime != null">
+	    and ci.create_time <![CDATA[ < ]]> #{createEndTime,jdbcType=TIMESTAMP}
+	</if>
+	<if test="acceptStartTime != null">
+	    and ci.accept_time <![CDATA[ >= ]]> #{acceptStartTime,jdbcType=TIMESTAMP}
+	</if>
+	<if test="acceptEndTime != null">
+	    and ci.accept_time <![CDATA[ < ]]> #{acceptEndTime,jdbcType=TIMESTAMP}
+	</if>
+	<if test="authStartTime != null">
+	    and ci.authorized_date <![CDATA[ >= ]]> #{authStartTime,jdbcType=TIMESTAMP}
+	</if>
+	<if test="authEndTime != null">
+	    and ci.authorized_date <![CDATA[ < ]]> #{authEndTime,jdbcType=TIMESTAMP}
+	</if>
+	order by ci.serial_number desc
+  	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findListCount" resultType="java.lang.Integer"  parameterType="String">
+  	select count(*)
+	from copyright_info ci 
+	left join organization_identity oi on ci.uid = oi.uid
+	where ci.delete_sign = 0
+	<if test="province != null">
+	    and oi.location_province =  #{province,jdbcType=VARCHAR}
+	</if>
+	<if test="status != null">
+	    and ci.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="unitName != null">
+	    and oi.unit_name like CONCAT('%', #{unitName,jdbcType=VARCHAR}, '%')
+	</if>
+	<if test="copyrightName != null">
+	    and ci.copyright_name like CONCAT('%', #{copyrightName,jdbcType=VARCHAR}, '%')
+	</if>
+	<if test="createStartTime != null">
+	    and ci.create_time <![CDATA[ >= ]]> #{createStartTime,jdbcType=TIMESTAMP}
+	</if>
+	<if test="createEndTime != null">
+	    and ci.create_time <![CDATA[ < ]]> #{createEndTime,jdbcType=TIMESTAMP}
+	</if>
+	<if test="acceptStartTime != null">
+	    and ci.accept_time <![CDATA[ >= ]]> #{acceptStartTime,jdbcType=TIMESTAMP}
+	</if>
+	<if test="acceptEndTime != null">
+	    and ci.accept_time <![CDATA[ < ]]> #{acceptEndTime,jdbcType=TIMESTAMP}
+	</if>
+	<if test="authStartTime != null">
+	    and ci.authorized_date <![CDATA[ >= ]]> #{authStartTime,jdbcType=TIMESTAMP}
+	</if>
+	<if test="authEndTime != null">
+	    and ci.authorized_date <![CDATA[ < ]]> #{authEndTime,jdbcType=TIMESTAMP}
+	</if>
+  </select>
+  
+</mapper>

+ 117 - 0
src/main/java/com/goafanti/common/mapper/CopyrightLogMapper.xml

@@ -0,0 +1,117 @@
+<?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.goafanti.common.dao.CopyrightLogMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.CopyrightLog">
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="cid" jdbcType="VARCHAR" property="cid" />
+    <result column="record_time" jdbcType="TIMESTAMP" property="recordTime" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="principal" jdbcType="VARCHAR" property="principal" />
+    <result column="operator" jdbcType="VARCHAR" property="operator" />
+    <result column="comment" jdbcType="VARCHAR" property="comment" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, cid, record_time, status, principal, operator, comment
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from copyright_log
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from copyright_log
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.CopyrightLog">
+    insert into copyright_log (id, cid, record_time, 
+      status, principal, operator, 
+      comment)
+    values (#{id,jdbcType=VARCHAR}, #{cid,jdbcType=VARCHAR}, #{recordTime,jdbcType=TIMESTAMP}, 
+      #{status,jdbcType=INTEGER}, #{principal,jdbcType=VARCHAR}, #{operator,jdbcType=VARCHAR}, 
+      #{comment,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.CopyrightLog">
+    insert into copyright_log
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="cid != null">
+        cid,
+      </if>
+      <if test="recordTime != null">
+        record_time,
+      </if>
+      <if test="status != null">
+        status,
+      </if>
+      <if test="principal != null">
+        principal,
+      </if>
+      <if test="operator != null">
+        operator,
+      </if>
+      <if test="comment != null">
+        comment,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="cid != null">
+        #{cid,jdbcType=VARCHAR},
+      </if>
+      <if test="recordTime != null">
+        #{recordTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="principal != null">
+        #{principal,jdbcType=VARCHAR},
+      </if>
+      <if test="operator != null">
+        #{operator,jdbcType=VARCHAR},
+      </if>
+      <if test="comment != null">
+        #{comment,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.CopyrightLog">
+    update copyright_log
+    <set>
+      <if test="cid != null">
+        cid = #{cid,jdbcType=VARCHAR},
+      </if>
+      <if test="recordTime != null">
+        record_time = #{recordTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="status != null">
+        status = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="principal != null">
+        principal = #{principal,jdbcType=VARCHAR},
+      </if>
+      <if test="operator != null">
+        operator = #{operator,jdbcType=VARCHAR},
+      </if>
+      <if test="comment != null">
+        comment = #{comment,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.CopyrightLog">
+    update copyright_log
+    set cid = #{cid,jdbcType=VARCHAR},
+      record_time = #{recordTime,jdbcType=TIMESTAMP},
+      status = #{status,jdbcType=INTEGER},
+      principal = #{principal,jdbcType=VARCHAR},
+      operator = #{operator,jdbcType=VARCHAR},
+      comment = #{comment,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+</mapper>

+ 6 - 3
src/main/java/com/goafanti/common/model/BaseModel.java

@@ -10,9 +10,9 @@ public class BaseModel implements Serializable {
 	/**
 	 * 
 	 */
-	private static final long serialVersionUID = 1L;
+	private static final long	serialVersionUID	= 1L;
 
-	private String id;
+	private String				id;
 
 	@Override
 	public String toString() {
@@ -20,7 +20,10 @@ public class BaseModel implements Serializable {
 	}
 
 	public String getId() {
-		return id == null ? UUID.randomUUID().toString().replace("-", "") : "";
+		if (id == null) {
+			this.id = UUID.randomUUID().toString().replace("-", "");
+		}
+		return id;
 	}
 
 	public void setId(String id) {

+ 231 - 0
src/main/java/com/goafanti/common/model/CopyrightInfo.java

@@ -0,0 +1,231 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class CopyrightInfo extends BaseModel{
+    /**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+    /**
+    * 用户主键
+    */
+    private String uid;
+
+    /**
+    * 编号
+    */
+    private Integer serialNumber;
+
+    /**
+    * 创建时间
+    */
+    private Date createTime;
+
+    /**
+    * 受理时间
+    */
+    private Date acceptTime;
+
+    /**
+    * 负责人
+    */
+    private String principal;
+
+    /**
+    * 联系人
+    */
+    private Integer contact;
+
+    /**
+    * 软著简介
+    */
+    private String copyrightInfo;
+
+    /**
+    * 软著名字
+    */
+    private String copyrightName;
+
+    /**
+    * 申请状态
+    */
+    private Integer status;
+
+    /**
+    * 派单信息
+    */
+    private String workIssue;
+
+    /**
+    * 备注
+    */
+    private String comment;
+
+    /**
+    * 外包公司
+    */
+    private String outsource;
+
+    /**
+    * 加急天数
+    */
+    private Integer inUrgent;
+
+    /**
+    * 下证日
+    */
+    private Date authorizedDate;
+
+    /**
+    * 证书附件地址
+    */
+    private String certificateUrl;
+
+    /**
+    * 申请书附件地址
+    */
+    private String applicationUrl;
+
+    /**
+    * 删除标记
+    */
+    private Integer deleteSign;
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public Integer getSerialNumber() {
+        return serialNumber;
+    }
+
+    public void setSerialNumber(Integer serialNumber) {
+        this.serialNumber = serialNumber;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getAcceptTime() {
+        return acceptTime;
+    }
+
+    public void setAcceptTime(Date acceptTime) {
+        this.acceptTime = acceptTime;
+    }
+
+    public String getPrincipal() {
+        return principal;
+    }
+
+    public void setPrincipal(String principal) {
+        this.principal = principal;
+    }
+
+    public Integer getContact() {
+        return contact;
+    }
+
+    public void setContact(Integer contact) {
+        this.contact = contact;
+    }
+
+    public String getCopyrightInfo() {
+        return copyrightInfo;
+    }
+
+    public void setCopyrightInfo(String copyrightInfo) {
+        this.copyrightInfo = copyrightInfo;
+    }
+
+    public String getCopyrightName() {
+        return copyrightName;
+    }
+
+    public void setCopyrightName(String copyrightName) {
+        this.copyrightName = copyrightName;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getWorkIssue() {
+        return workIssue;
+    }
+
+    public void setWorkIssue(String workIssue) {
+        this.workIssue = workIssue;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
+
+    public String getOutsource() {
+        return outsource;
+    }
+
+    public void setOutsource(String outsource) {
+        this.outsource = outsource;
+    }
+
+    public Integer getInUrgent() {
+        return inUrgent;
+    }
+
+    public void setInUrgent(Integer inUrgent) {
+        this.inUrgent = inUrgent;
+    }
+
+    public Date getAuthorizedDate() {
+        return authorizedDate;
+    }
+
+    public void setAuthorizedDate(Date authorizedDate) {
+        this.authorizedDate = authorizedDate;
+    }
+
+    public String getCertificateUrl() {
+        return certificateUrl;
+    }
+
+    public void setCertificateUrl(String certificateUrl) {
+        this.certificateUrl = certificateUrl;
+    }
+
+    public String getApplicationUrl() {
+        return applicationUrl;
+    }
+
+    public void setApplicationUrl(String applicationUrl) {
+        this.applicationUrl = applicationUrl;
+    }
+
+    public Integer getDeleteSign() {
+        return deleteSign;
+    }
+
+    public void setDeleteSign(Integer deleteSign) {
+        this.deleteSign = deleteSign;
+    }
+}

+ 89 - 0
src/main/java/com/goafanti/common/model/CopyrightLog.java

@@ -0,0 +1,89 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class CopyrightLog extends BaseModel{
+    /**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	
+    /**
+    * 软著申请id
+    */
+    private String cid;
+
+    /**
+    * 操作时间
+    */
+    private Date recordTime;
+
+    /**
+    * 状态
+    */
+    private Integer status;
+
+    /**
+    * 负责人
+    */
+    private String principal;
+
+    /**
+    * 操作人
+    */
+    private String operator;
+
+    /**
+    * 备注
+    */
+    private String comment;
+
+    public String getCid() {
+        return cid;
+    }
+
+    public void setCid(String cid) {
+        this.cid = cid;
+    }
+
+    public Date getRecordTime() {
+        return recordTime;
+    }
+
+    public void setRecordTime(Date recordTime) {
+        this.recordTime = recordTime;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getPrincipal() {
+        return principal;
+    }
+
+    public void setPrincipal(String principal) {
+        this.principal = principal;
+    }
+
+    public String getOperator() {
+        return operator;
+    }
+
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
+
+}

+ 11 - 7
src/main/java/com/goafanti/common/utils/FileUtils.java

@@ -115,8 +115,7 @@ public class FileUtils {
 		if (StringUtils.isBlank(path) || path.lastIndexOf(".") < 0) {
 			return null;
 		}
-		String fileName = "";
-		String prefix = "";
+		String prefix = "附件";
 		String suffix = path.substring(path.lastIndexOf("."));
 		if (path.indexOf("patent_prory_statement") != -1) {
 			prefix = "专利代理委托书";
@@ -141,11 +140,11 @@ public class FileUtils {
 		if (path.indexOf("activity_cost_account") != -1) {
 			prefix = "研发活动费用台帐";
 		}
-		
+
 		if (path.indexOf("tech_product") != -1) {
 			prefix = "高新技术产品台帐";
 		}
-		
+
 		if (path.indexOf("property_ritht") != -1) {
 			prefix = "知识产权证书";
 		}
@@ -186,14 +185,19 @@ public class FileUtils {
 			prefix = "科技项目资料";
 		}
 
-		fileName = prefix + suffix;
-		return fileName;
+		return prefix + suffix;
+	}
+
+	public static String getSuffix(String path) {
+		if (StringUtils.isBlank(path) || path.lastIndexOf(".") < 0) {
+			return "";
+		}
+		return path.substring(path.lastIndexOf("."));
 	}
 
 	// year
 	private static String subStr(String s) {
 		return "企业" + s.substring(s.lastIndexOf("_") + 1, s.lastIndexOf("."));
 	}
-	
 
 }

+ 89 - 0
src/main/java/com/goafanti/copyright/bo/CopyrightInfoDetail.java

@@ -0,0 +1,89 @@
+package com.goafanti.copyright.bo;
+
+import org.apache.commons.lang3.StringUtils;
+
+import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.utils.FileUtils;
+
+public class CopyrightInfoDetail extends CopyrightInfoSummary {
+	private String	city;
+	private String	area;
+	private String	postcode;
+
+	/**
+	 * 证书附件地址
+	 */
+	private String	certificateUrl;
+
+	/**
+	 * 申请书附件地址
+	 */
+	private String	applicationUrl;
+
+	public String getCity() {
+		return city;
+	}
+
+	public void setCity(String city) {
+		this.city = city;
+	}
+
+	public String getArea() {
+		return area;
+	}
+
+	public void setArea(String area) {
+		this.area = area;
+	}
+
+	public String getPostcode() {
+		return postcode;
+	}
+
+	public void setPostcode(String postcode) {
+		this.postcode = postcode;
+	}
+
+	public String getCertificateUrl() {
+		return certificateUrl;
+	}
+
+	public void setCertificateUrl(String certificateUrl) {
+		this.certificateUrl = certificateUrl;
+	}
+
+	public String getApplicationUrl() {
+		return applicationUrl;
+	}
+
+	public void setApplicationUrl(String applicationUrl) {
+		this.applicationUrl = applicationUrl;
+	}
+
+	// 软著证书
+	public String getCertificateUrlDownloadFileName() {
+		if (StringUtils.isBlank(this.applicationUrl)) {
+			return "";
+		} else {
+			return AttachmentType.COPYRIGHT_AUTH.getDesc() + FileUtils.getSuffix(this.applicationUrl);
+		}
+	}
+
+	public void setCertificateUrlDownloadFileName(String certificateUrlDownloadFileName) {
+
+	}
+
+	// 软著申请书
+	public String getApplicationUrlDownloadFileName() {
+		if (StringUtils.isBlank(this.applicationUrl)) {
+			return "";
+		} else {
+			return AttachmentType.COPYRIGHT_APPLY.getDesc() + FileUtils.getSuffix(this.applicationUrl);
+		}
+	}
+
+	public void setApplicationUrlDownloadFileName(String applicationUrlDownloadFileName) {
+
+	}
+
+}

+ 270 - 0
src/main/java/com/goafanti/copyright/bo/CopyrightInfoSummary.java

@@ -0,0 +1,270 @@
+package com.goafanti.copyright.bo;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+
+public class CopyrightInfoSummary {
+
+	private String	id;
+	/**
+	 * 省份
+	 */
+	private String	province;
+
+	/**
+	 * 单位名称
+	 */
+	private String	unitName;
+	/**
+	 * 编号
+	 */
+	private Integer	serialNumber;
+
+	/**
+	 * 创建时间
+	 */
+	private Date	createTime;
+
+	/**
+	 * 受理时间
+	 */
+	private Date	acceptTime;
+
+	/**
+	 * 负责人
+	 */
+	private String	principal;
+
+	/**
+	 * 联系人
+	 */
+	private Integer	contact;
+
+	/**
+	 * 软著名字
+	 */
+	private String	copyrightName;
+
+	/**
+	 * 申请状态
+	 */
+	private Integer	status;
+
+	/**
+	 * 备注
+	 */
+	private String	comment;
+
+	/**
+	 * 派单详情
+	 */
+	private String	workIssue;
+
+	/**
+	 * 外包公司
+	 */
+	private String	outsource;
+
+	/**
+	 * 加急天数
+	 */
+	private Integer	inUrgent;
+
+	/**
+	 * 下证日
+	 */
+	private Date	authorizedDate;
+
+	private String	fisrtContact;
+
+	private String	secondContact;
+
+	private String	thirdContact;
+
+	public String getProvince() {
+		return province;
+	}
+
+	public void setProvince(String province) {
+		this.province = province;
+	}
+
+	public String getUnitName() {
+		return unitName;
+	}
+
+	public void setUnitName(String unitName) {
+		this.unitName = unitName;
+	}
+
+	public Integer getSerialNumber() {
+		return serialNumber;
+	}
+
+	public void setSerialNumber(Integer serialNumber) {
+		this.serialNumber = serialNumber;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Date getAcceptTime() {
+		return acceptTime;
+	}
+
+	public void setAcceptTime(Date acceptTime) {
+		this.acceptTime = acceptTime;
+	}
+
+	public String getPrincipal() {
+		return principal;
+	}
+
+	public void setPrincipal(String principal) {
+		this.principal = principal;
+	}
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getContact() {
+		return contact;
+	}
+
+	public void setContact(Integer contact) {
+		this.contact = contact;
+	}
+
+	public String getCopyrightName() {
+		return copyrightName;
+	}
+
+	public void setCopyrightName(String copyrightName) {
+		this.copyrightName = copyrightName;
+	}
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public String getComment() {
+		return comment;
+	}
+
+	public void setComment(String comment) {
+		this.comment = comment;
+	}
+
+	public String getOutsource() {
+		return outsource;
+	}
+
+	public void setOutsource(String outsource) {
+		this.outsource = outsource;
+	}
+
+	public Integer getInUrgent() {
+		return inUrgent;
+	}
+
+	public void setInUrgent(Integer inUrgent) {
+		this.inUrgent = inUrgent;
+	}
+
+	public Date getAuthorizedDate() {
+		return authorizedDate;
+	}
+
+	public void setAuthorizedDate(Date authorizedDate) {
+		this.authorizedDate = authorizedDate;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getFisrtContact() {
+		return fisrtContact;
+	}
+
+	public void setFisrtContact(String fisrtContact) {
+		this.fisrtContact = fisrtContact;
+	}
+
+	public String getSecondContact() {
+		return secondContact;
+	}
+
+	public void setSecondContact(String secondContact) {
+		this.secondContact = secondContact;
+	}
+
+	public String getThirdContact() {
+		return thirdContact;
+	}
+
+	public void setThirdContact(String thirdContact) {
+		this.thirdContact = thirdContact;
+	}
+
+	public String getAcceptTimeFormattedDate() {
+		if (this.acceptTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.acceptTime, "yyyy-MM-dd");
+		}
+	}
+
+	public void setAcceptTimeFormattedDate(String acceptTimeFormattedDate) {
+
+	}
+
+	public String getAuthorizedDateFormattedDate() {
+		if (this.authorizedDate == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.authorizedDate, "yyyy-MM-dd");
+		}
+	}
+
+	public void setAuthorizedDateFormattedDate(String authorizedDateFormattedDate) {
+
+	}
+
+	public String getCreateTimeFormattedDate() {
+		if (this.createTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.createTime, "yyyy-MM-dd");
+		}
+	}
+
+	public void setCreateTimeFormattedDate(String createTimeFormattedDate) {
+
+	}
+
+	public String getWorkIssue() {
+		return workIssue;
+	}
+
+	public void setWorkIssue(String workIssue) {
+		this.workIssue = workIssue;
+	}
+
+}

+ 135 - 0
src/main/java/com/goafanti/copyright/bo/InputCopyright.java

@@ -0,0 +1,135 @@
+package com.goafanti.copyright.bo;
+
+import java.util.Date;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Past;
+import javax.validation.constraints.Size;
+
+import com.goafanti.common.constant.ErrorConstants;
+
+public class InputCopyright {
+
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	uid;
+
+	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	principal;
+
+	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	contact;
+
+	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	copyrightInfo;
+
+	@Size(min = 0, max = 60, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	copyrightName;
+
+	@Max(value = 9, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	status;
+
+	@Size(min = 0, max = 128, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	workIssue;
+	@Size(min = 0, max = 128, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	comment;
+	@Size(min = 0, max = 60, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String	outsource;
+
+	@Max(value = 30, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Integer	inUrgent;
+
+	@Past(message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	private Date	recordTime;
+
+	public String getPrincipal() {
+		return principal;
+	}
+
+	public void setPrincipal(String principal) {
+		this.principal = principal;
+	}
+
+	public Integer getContact() {
+		return contact;
+	}
+
+	public void setContact(Integer contact) {
+		this.contact = contact;
+	}
+
+	public String getCopyrightInfo() {
+		return copyrightInfo;
+	}
+
+	public void setCopyrightInfo(String copyrightInfo) {
+		this.copyrightInfo = copyrightInfo;
+	}
+
+	public String getCopyrightName() {
+		return copyrightName;
+	}
+
+	public void setCopyrightName(String copyrightName) {
+		this.copyrightName = copyrightName;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public String getWorkIssue() {
+		return workIssue;
+	}
+
+	public void setWorkIssue(String workIssue) {
+		this.workIssue = workIssue;
+	}
+
+	public String getComment() {
+		return comment;
+	}
+
+	public void setComment(String comment) {
+		this.comment = comment;
+	}
+
+	public String getOutsource() {
+		return outsource;
+	}
+
+	public void setOutsource(String outsource) {
+		this.outsource = outsource;
+	}
+
+	public Integer getInUrgent() {
+		return inUrgent;
+	}
+
+	public void setInUrgent(Integer inUrgent) {
+		this.inUrgent = inUrgent;
+	}
+
+	public String getUid() {
+		return uid;
+	}
+
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+
+	public Date getRecordTime() {
+		return recordTime;
+	}
+
+	public void setRecordTime(Date recordTime) {
+		this.recordTime = recordTime;
+	}
+}

+ 64 - 0
src/main/java/com/goafanti/copyright/controller/CopyrightApiController.java

@@ -0,0 +1,64 @@
+package com.goafanti.copyright.controller;
+
+import javax.annotation.Resource;
+import javax.validation.Valid;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.CopyrightFields;
+import com.goafanti.common.enums.CopyrightStatus;
+import com.goafanti.common.model.CopyrightInfo;
+import com.goafanti.common.model.User;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.copyright.bo.InputCopyright;
+import com.goafanti.copyright.service.CopyrightInfoService;
+
+@RestController
+@RequestMapping(value = "/techservice/copyright")
+public class CopyrightApiController extends CertifyApiController {
+	@Resource
+	private CopyrightInfoService	copyrightInfoService;
+
+	@Value(value = "${upload.private.path}")
+	private String					uploadPrivatePath	= null;
+
+	@RequestMapping(value = "/apply", method = RequestMethod.POST)
+	public Result newApply(@Valid InputCopyright inputInfo, BindingResult bindingResult) {
+		Result res = new Result();
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
+					CopyrightFields.getFieldDesc(bindingResult.getFieldError().getField())));
+			return res;
+		}
+		User curUser = TokenManager.getUserToken();
+		if (curUser == null) {
+			res.getError().add(buildError(ErrorConstants.NON_LOGIN, "找不到用户登录信息"));
+			return res;
+		}
+		if (!checkCertify(res, curUser)) {
+			return res;
+		}
+		CopyrightInfo ci = new CopyrightInfo();
+		BeanUtils.copyProperties(inputInfo, ci);
+		ci.setUid(curUser.getId());
+		if (StringUtils.isBlank(ci.getPrincipal())) {
+			ci.setStatus(CopyrightStatus.CREATE.getCode());
+			ci.setPrincipal(curUser.getAid());
+		} else {
+			ci.setStatus(CopyrightStatus.DELIVERD.getCode());
+		}
+		copyrightInfoService.insert(ci);
+		res.setData(ci);
+		return res;
+	}
+
+}

+ 27 - 0
src/main/java/com/goafanti/copyright/service/CopyrightInfoService.java

@@ -0,0 +1,27 @@
+package com.goafanti.copyright.service;
+
+import java.util.List;
+
+import com.goafanti.common.enums.CopyrightStatus;
+import com.goafanti.common.model.CopyrightInfo;
+import com.goafanti.common.model.CopyrightLog;
+import com.goafanti.copyright.bo.CopyrightInfoDetail;
+import com.goafanti.core.mybatis.page.Pagination;
+
+public interface CopyrightInfoService {
+
+	CopyrightInfo insert(CopyrightInfo copyrightInfo);
+
+	void updateByPrimaryKeySelective(CopyrightInfo copyrightInfo, CopyrightLog copyrightLog);
+
+	CopyrightInfo selectByPrimaryKey(String id);
+	
+	CopyrightInfoDetail findByPrimaryKey(String id);
+
+	int batchDeleteByPrimaryKey(List<String> id);
+
+	Pagination<CopyrightInfo> listCopyrightInfo(String province, String unitName, String copyrightName,
+			CopyrightStatus status, String[] createTime, String[] acceptTime, String[] authTime, Integer pageNo,
+			Integer pageSize);
+
+}

+ 15 - 0
src/main/java/com/goafanti/copyright/service/CopyrightLogService.java

@@ -0,0 +1,15 @@
+package com.goafanti.copyright.service;
+
+import java.util.List;
+
+import com.goafanti.common.model.CopyrightLog;
+
+public interface CopyrightLogService {
+
+	CopyrightLog selectByPrimaryKey(String patentId);
+
+	List<CopyrightLog> selectProcessByCid(String copyrightId);
+
+	CopyrightLog insert(CopyrightLog copyrightLog);
+
+}

+ 138 - 0
src/main/java/com/goafanti/copyright/service/impl/CopyrightInfoServiceImpl.java

@@ -0,0 +1,138 @@
+package com.goafanti.copyright.service.impl;
+
+import java.text.ParseException;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.CopyrightInfoMapper;
+import com.goafanti.common.dao.CopyrightLogMapper;
+import com.goafanti.common.enums.CopyrightStatus;
+import com.goafanti.common.model.CopyrightInfo;
+import com.goafanti.common.model.CopyrightLog;
+import com.goafanti.copyright.bo.CopyrightInfoDetail;
+import com.goafanti.copyright.service.CopyrightInfoService;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+
+@Service
+public class CopyrightInfoServiceImpl extends BaseMybatisDao<CopyrightInfoMapper> implements CopyrightInfoService {
+	@Autowired
+	private CopyrightInfoMapper	copyrightInfoMapper;
+	@Autowired
+	private CopyrightLogMapper	copyrightLogMapper;
+
+	@Override
+	public CopyrightInfo insert(CopyrightInfo copyrightInfo) {
+		Calendar now = Calendar.getInstance();
+		now.set(Calendar.MILLISECOND, 0);
+		copyrightInfo.setCreateTime(now.getTime());
+		CopyrightLog log = new CopyrightLog();
+		log.setCid(copyrightInfo.getId());
+		log.setRecordTime(copyrightInfo.getCreateTime());
+		log.setComment(copyrightInfo.getComment());
+		log.setOperator(TokenManager.getAdminId());
+		log.setPrincipal(copyrightInfo.getPrincipal());
+		log.setStatus(copyrightInfo.getStatus());
+		copyrightInfoMapper.insertSelective(copyrightInfo);
+		copyrightLogMapper.insertSelective(log);
+		return copyrightInfo;
+	}
+
+	@Override
+	public void updateByPrimaryKeySelective(CopyrightInfo copyrightInfo, CopyrightLog copyrightLog) {
+		if (copyrightLog.getRecordTime() != null && copyrightLog.getStatus() != null
+				&& copyrightLog.getPrincipal() != null) {
+			copyrightLogMapper.insertSelective(copyrightLog);
+			if (CopyrightStatus.getStatus(copyrightLog.getStatus()) == CopyrightStatus.ACCEPT) {
+				copyrightInfo.setAcceptTime(copyrightLog.getRecordTime());
+			} else if (CopyrightStatus.getStatus(copyrightLog.getStatus()) == CopyrightStatus.AUTHORIZED) {
+				copyrightInfo.setAuthorizedDate(copyrightLog.getRecordTime());
+			} else if (CopyrightStatus.getStatus(copyrightLog.getStatus()) == CopyrightStatus.DELIVERD) {
+				copyrightInfo.setCreateTime(copyrightLog.getRecordTime());
+			}
+		}
+		copyrightInfoMapper.updateByPrimaryKeySelective(copyrightInfo);
+	}
+
+	@Override
+	public int batchDeleteByPrimaryKey(List<String> id) {
+		return 0;
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<CopyrightInfo> listCopyrightInfo(String province, String unitName, String copyrightName,
+			CopyrightStatus status, String[] createTime, String[] acceptTime, String[] authTime, Integer pageNo,
+			Integer pageSize) {
+		Map<String, Object> params = new HashMap<>();
+		if (StringUtils.isNotBlank(province)) {
+			params.put("province", province);
+		}
+		if (StringUtils.isNotBlank(unitName)) {
+			params.put("unitName", unitName);
+		}
+		if (StringUtils.isNotBlank(copyrightName)) {
+			params.put("copyrightName", copyrightName);
+		}
+		if (status != CopyrightStatus.OTHER) {
+			params.put("status", status.getCode());
+		}
+		if (createTime != null) {
+			try {
+				if (createTime.length > 0 && StringUtils.isNotBlank(createTime[0])) {
+					params.put("createStartTime", DateUtils.parseDate(createTime[0], AFTConstants.YYYYMMDD));
+				}
+				if (createTime.length > 1 && StringUtils.isNotBlank(createTime[1])) {
+					params.put("createEndTime",
+							DateUtils.addDays(DateUtils.parseDate(createTime[1], AFTConstants.YYYYMMDD), 1));
+				}
+			} catch (ParseException e) {
+			}
+		}
+		if (acceptTime != null) {
+			try {
+				if (acceptTime.length > 0 && StringUtils.isNotBlank(acceptTime[0])) {
+					params.put("acceptStartTime", DateUtils.parseDate(acceptTime[0], AFTConstants.YYYYMMDD));
+				}
+				if (acceptTime.length > 1 && StringUtils.isNotBlank(acceptTime[1])) {
+					params.put("acceptEndTime",
+							DateUtils.addDays(DateUtils.parseDate(acceptTime[1], AFTConstants.YYYYMMDD), 1));
+				}
+			} catch (ParseException e) {
+			}
+		}
+		if (authTime != null) {
+			try {
+				if (authTime.length > 0 && StringUtils.isNotBlank(authTime[0])) {
+					params.put("authStartTime", DateUtils.parseDate(authTime[0], AFTConstants.YYYYMMDD));
+				}
+				if (authTime.length > 1 && StringUtils.isNotBlank(authTime[1])) {
+					params.put("authEndTime",
+							DateUtils.addDays(DateUtils.parseDate(authTime[1], AFTConstants.YYYYMMDD), 1));
+				}
+			} catch (ParseException e) {
+			}
+		}
+		return (Pagination<CopyrightInfo>) findPage("findListByPage", "findListCount", params, pageNo, pageSize);
+	}
+
+	@Override
+	public CopyrightInfo selectByPrimaryKey(String id) {
+		return copyrightInfoMapper.selectByPrimaryKey(id);
+	}
+
+	@Override
+	public CopyrightInfoDetail findByPrimaryKey(String id) {
+		return copyrightInfoMapper.findByPrimaryKey(id);
+	}
+
+}

+ 28 - 0
src/main/java/com/goafanti/copyright/service/impl/CopyrightLogServiceImpl.java

@@ -0,0 +1,28 @@
+package com.goafanti.copyright.service.impl;
+
+import java.util.List;
+
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.model.CopyrightLog;
+import com.goafanti.copyright.service.CopyrightLogService;
+
+@Service
+public class CopyrightLogServiceImpl implements CopyrightLogService {
+
+	@Override
+	public CopyrightLog selectByPrimaryKey(String patentId) {
+		return null;
+	}
+
+	@Override
+	public List<CopyrightLog> selectProcessByCid(String copyrightId) {
+		return null;
+	}
+
+	@Override
+	public CopyrightLog insert(CopyrightLog copyrightLog) {
+		return null;
+	}
+
+}

+ 14 - 0
src/main/java/com/goafanti/core/shiro/token/TokenManager.java

@@ -77,6 +77,20 @@ public class TokenManager {
 	}
 
 	/**
+	 * 获取当前登录的普通用户对象
+	 * 
+	 * @return
+	 */
+	public static User getUserToken() {
+		AftUser u = getToken();
+		if (u instanceof User) {
+			return (User) u;
+		} else {
+			return null;
+		}
+	}
+	
+	/**
 	 * 获取当前登录的管理员对象
 	 * 
 	 * @return

+ 0 - 25
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -1,6 +1,5 @@
 package com.goafanti.user.controller;
 
-import java.io.IOException;
 import java.math.BigDecimal;
 import java.text.ParseException;
 import java.util.ArrayList;
@@ -17,7 +16,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.multipart.MultipartFile;
 
 import com.goafanti.cognizance.service.OrgRatepayService;
 import com.goafanti.common.bo.Result;
@@ -36,8 +34,6 @@ import com.goafanti.common.model.UserEdu;
 import com.goafanti.common.model.UserIdentity;
 import com.goafanti.common.model.UserInfo;
 import com.goafanti.common.utils.DateUtils;
-import com.goafanti.common.utils.FileUtils;
-import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
@@ -282,27 +278,6 @@ public class UserApiController extends BaseApiController {
 		return res;
 	}
 
-
-	private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign) {
-		List<MultipartFile> files = getFiles(req);
-		MultipartFile mf = files.get(0);
-		String fileName = FileUtils.mosaicFileName(mf, isPrivate, sign, path, TokenManager.getUserId());
-		if (!files.isEmpty()) {
-			try {
-				mf.transferTo(isPrivate ? toPrivateFile(fileName) : toFile(fileName));
-				LoggerUtils.debug(getClass(), fileName + " 文件上传成功");
-			} catch (IllegalStateException | IOException e) {
-				LoggerUtils.error(getClass(), "文件上传失败", e);
-				res.getError().add(buildError("", "文件上传失败!"));
-				return "";
-			}
-		} else {
-			res.getError().add(buildError("", "文件上传失败!"));
-			return "";
-		}
-		return fileName;
-	}
-
 	/**
 	 * 个人资料
 	 * 

+ 10 - 5
src/main/resources/props/error.properties

@@ -6,16 +6,13 @@ org.apache.shiro.authc.ExcessiveAttemptsException=\u5C1D\u8BD5\u6B21\u6570\u8FC7
 org.apache.shiro.session.ExpiredSessionException=\u767B\u5F55\u4FE1\u606F\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002
 org.springframework.dao.DataIntegrityViolationException=\u670D\u52A1\u5668\u6253\u4E86\u4E2A\u76F9\u513F\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6216\u7A0D\u540E\u518D\u8BD5\u3002
 org.springframework.jdbc.BadSqlGrammarException=\u6570\u636E\u5F02\u5E38\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6216\u7A0D\u540E\u518D\u8BD5\u3002
+java.text.ParseException=\u53C2\u6570\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u6838\u5BF9\u8F93\u5165\u6570\u636E\u540E\u518D\u8BD5\u3002
 
 NON_LOGIN=\u7528\u6237\u672A\u767B\u5F55\u3002
 
 VCODE_ERROR=\u9A8C\u8BC1\u7801\u8F93\u5165\u9519\u8BEF\uFF01
 
-EMAIL_SIZE_ERROR=\u90AE\u7BB1\u5730\u5740\u957F\u5EA6\u9519\u8BEF\uFF01
-
-EMAIL_PATTERN_ERROR=\u90AE\u7BB1\u5730\u5740\u683C\u5F0F\u9519\u8BEF\uFF01
-
-DUNPLICATE_KAY_ERROR={0}\u5DF2\u88AB\u4ED6\u4EBA\u6CE8\u518C\uFF01
+PARAM_ERROR={0}\u53C2\u6570\u9519\u8BEF
 
 PARAM_INTEGER_ERROR={0}\u53C2\u6570\u5FC5\u987B\u4E3A\u6570\u5B57\u3002
 
@@ -25,6 +22,14 @@ PARAM_SIZE_ERROR={0}\u53C2\u6570\u957F\u5EA6\u4E0D\u6B63\u786E\uFF0C\u5FC5\u987B
 
 PARAM_PATTERN_ERROR={0}\u53C2\u6570\u683C\u5F0F\u987B\u6B63\u786E\u6307\u5B9A{1}\u3002
 
+EMAIL_SIZE_ERROR=\u90AE\u7BB1\u5730\u5740\u957F\u5EA6\u9519\u8BEF\uFF01
+
+EMAIL_PATTERN_ERROR=\u90AE\u7BB1\u5730\u5740\u683C\u5F0F\u9519\u8BEF\uFF01
+
+DUNPLICATE_KAY_ERROR={0}\u5DF2\u88AB\u4ED6\u4EBA\u6CE8\u518C\uFF01
+
 DATA_EMPTY_ERROR=\u5F53\u524D{0}\u6CA1\u6709\u6570\u636E\u3002
 
 PWD_NOT_MATCH_ERROR=\u539F\u5BC6\u7801\u8F93\u5165\u4E0D\u5339\u914D\u3002
+
+NON_CERTIFIED=\u672A\u901A\u8FC7\u5B9E\u540D\u8BA4\u8BC1\uFF0C\u65E0\u6CD5\u64CD\u4F5C\uFF01

+ 1 - 0
src/main/resources/spring/spring-mybatis.xml

@@ -74,6 +74,7 @@
 			<tx:method name="update*" />
 			<tx:method name="insert*" />
 			<tx:method name="create*" />
+			<tx:method name="batch*" />
 			<tx:method name="del*" />
 			<tx:method name="load*" />
 			<tx:method name="init*" />