Browse Source

Merge branch 'test' of jishutao/kede-server into prod

anderx 4 years ago
parent
commit
3cd6ec7c5a
49 changed files with 2839 additions and 1034 deletions
  1. 0 16
      .vscode/launch.json
  2. 5 12
      src/main/java/com/goafanti/admin/service/impl/AttachmentServiceImpl.java
  3. 27 22
      src/main/java/com/goafanti/common/bo/EmailBo.java
  4. 4 0
      src/main/java/com/goafanti/common/controller/BaseApiController.java
  5. 2 1
      src/main/java/com/goafanti/common/controller/PublicController.java
  6. 0 1
      src/main/java/com/goafanti/common/dao/OfficialFeePriceMapper.java
  7. 27 7
      src/main/java/com/goafanti/common/dao/PatentNewMapper.java
  8. 65 0
      src/main/java/com/goafanti/common/dao/PatentPaymentDetailsMapper.java
  9. 57 0
      src/main/java/com/goafanti/common/dao/PatentYearPaymentMapper.java
  10. 0 1
      src/main/java/com/goafanti/common/dao/PaymentLogMapper.java
  11. 0 2
      src/main/java/com/goafanti/common/dao/TOrderOutsourceMapper.java
  12. 3 0
      src/main/java/com/goafanti/common/dao/TOrderTaskMapper.java
  13. 0 4
      src/main/java/com/goafanti/common/dao/ThirdPartyCompanyMapper.java
  14. 1 0
      src/main/java/com/goafanti/common/enums/AttachmentType.java
  15. 0 1
      src/main/java/com/goafanti/common/enums/OfficialPatentType.java
  16. 1 0
      src/main/java/com/goafanti/common/mapper/PatentNewLogMapper.xml
  17. 645 507
      src/main/java/com/goafanti/common/mapper/PatentNewMapper.xml
  18. 187 0
      src/main/java/com/goafanti/common/mapper/PatentPaymentDetailsMapper.xml
  19. 153 0
      src/main/java/com/goafanti/common/mapper/PatentYearPaymentMapper.xml
  20. 7 0
      src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml
  21. 0 6
      src/main/java/com/goafanti/common/mapper/ThirdPartyCompanyMapper.xml
  22. 1 1
      src/main/java/com/goafanti/common/mapper/UserLockReleaseMapper.xml
  23. 119 95
      src/main/java/com/goafanti/common/model/PatentNew.java
  24. 287 0
      src/main/java/com/goafanti/common/model/PatentPaymentDetails.java
  25. 251 0
      src/main/java/com/goafanti/common/model/PatentYearPayment.java
  26. 1 5
      src/main/java/com/goafanti/common/task/OrderDunTask.java
  27. 124 194
      src/main/java/com/goafanti/common/task/PatentTask.java
  28. 39 42
      src/main/java/com/goafanti/common/task/ReleaseUserTask.java
  29. 23 3
      src/main/java/com/goafanti/common/utils/AsyncUtils.java
  30. 20 1
      src/main/java/com/goafanti/common/utils/ExcelUtils.java
  31. 7 1
      src/main/java/com/goafanti/common/utils/FileUtils.java
  32. 1 1
      src/main/java/com/goafanti/common/utils/SendEmailUtil.java
  33. 4 5
      src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java
  34. 1 0
      src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java
  35. 4 23
      src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java
  36. 12 2
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
  37. 2 2
      src/main/java/com/goafanti/order/service/impl/OrderReceivablesServiceImpl.java
  38. 0 1
      src/main/java/com/goafanti/organization/bo/outPaymentListFinance.java
  39. 7 1
      src/main/java/com/goafanti/organization/service/impl/OrganizationServiceImpl.java
  40. 4 9
      src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java
  41. 46 16
      src/main/java/com/goafanti/patent/bo/PatentNewBo.java
  42. 80 16
      src/main/java/com/goafanti/patent/controller/AdminPatentNewApiController.java
  43. 78 0
      src/main/java/com/goafanti/patent/enums/PatentType.java
  44. 25 3
      src/main/java/com/goafanti/patent/service/PatentNewService.java
  45. 513 22
      src/main/java/com/goafanti/patent/service/impl/PatentNewServiceImpl.java
  46. 1 0
      src/main/java/com/goafanti/weChat/bo/OutPublicDtails.java
  47. 1 7
      src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java
  48. 3 3
      src/main/resources/props/config_local.properties
  49. 1 1
      src/main/resources/props/config_test.properties

+ 0 - 16
.vscode/launch.json

@@ -1,16 +0,0 @@
-// Use IntelliSense to learn about possible attributes.
-// Hover to view descriptions of existing attributes.
-// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
-{
-  "version": "0.2.0",
-  "configurations": [
-    {
-      "name": "Launch Chrome 127.0.0.1",
-      "type": "chrome",
-      "request": "launch",
-      "port": 9276,
-      "webRoot": "${workspaceFolder}",
-      "url": "http://127.0.0.1:50939/p/kede-server/src/main/webapp/WEB-INF/views/common.html?_cmAuth\u003dxdspwawfnr"
-    }
-  ]
-}

+ 5 - 12
src/main/java/com/goafanti/admin/service/impl/AttachmentServiceImpl.java

@@ -22,17 +22,10 @@ public class AttachmentServiceImpl implements AttachmentService {
 
 	@Override
 	public Attachment selectByReceivbles(String sign) {
-		if (sign.equals("receivbles_template")) {
-			Attachment a=new Attachment();
-			a.setFileName("模板.xls");
-			a.setFilePath("/tmp/receivbles_template.xls");
-			return a;
-		}else if (sign.equals("user_channel")) {
-			Attachment a=new Attachment();
-			a.setFileName("模板.xls");
-			a.setFilePath("/tmp/user_channel.xls");
-			return a;
-		}
-		return null;
+		Attachment a=new Attachment();
+		String url=String.format("/tmp/%s%s", sign,".xls");
+		a.setFileName("模板.xls");
+		a.setFilePath(url);
+		return a;
 	}
 }

+ 27 - 22
src/main/java/com/goafanti/common/bo/EmailBo.java

@@ -1,5 +1,10 @@
 package com.goafanti.common.bo;
 
+import java.util.Date;
+
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.utils.DateUtils;
+
 public class EmailBo {
 	
 	//收件地址
@@ -38,25 +43,21 @@ public class EmailBo {
 	 * @param amount
 	 * @param date
 	 */
+	
 	public  EmailBo(String subject, String address, String addressee,
-			String deptname, String sender,String patentName,String patentNo,String amount,String date,Integer status) {
+			String deptname, String sender,String patentName,String patentNo,String amount,Date date) {
 		this.subject = subject;
 		this.address = address;
 		this.addressee = addressee;
 		this.deptname = deptname;
 		this.sender = sender;
-		Integer days=0;
-		if (status==1) days=90;
-		else if (status==2) days=30;
-		else if (status==3) days=20;
-		else if (status==4) days=10;
-		else if (status==5) days=3;
-		else if (status==6) days=2;
-		else if (status==7) days=1;
-		this.content=setPatentFormat( addressee, sender, patentName, patentNo, amount, date,days);
-		
-		
+		long now = new Date().getTime(); 
+		long end = date.getTime(); 
+		String endStr=DateUtils.formatDate(date, AFTConstants.YYYYMMDD);
+		Integer days = (int)((end - now) / (1000 * 60 * 60 *24)); 
+		this.content=setPatentFormat( addressee, sender, patentName, patentNo, amount, endStr,days);
 	}
+	
 	/**
 	 *  
 	 * @param subject	标题
@@ -84,6 +85,7 @@ public class EmailBo {
 		if(type==1)this.content=setDunFormat( addressee, sender, deptname,orderNo, date , dunStatusName,adminName,userName,0);
 		if(type==2)this.content=setDunFormat( addressee, sender, deptname,orderNo, date , dunStatusName,adminName,userName,1);
 	}
+	
 	/**
 	 * 通用模版
 	 * @param subject
@@ -114,6 +116,12 @@ public class EmailBo {
 	}
 
 
+	
+
+
+	
+
+
 	public String setDunFormat(String addressee,String sender,String deptname,String orderNo,String date ,String dunStatusName,String adminName,
 			String userName,int i) {
 		String str1 = "",str2= "",str3= "";
@@ -191,7 +199,7 @@ public class EmailBo {
 				"              </tr>\r\n" + 
 				"              \r\n" + 
 				"		               	<tr>\r\n" + 
-				"		                	<td width=\"720\" height=\"14\" colspan=\"2\" style=\"padding-bottom:16px; border-bottom:1px dashed #e5e5e5;font-family:'Microsoft YaHei';\"><a href=\"http://www.kedexinxi.com/\">湖南科德信息咨询有限公司</a></td>\r\n" + 
+				"		                	<td width=\"720\" height=\"14\" colspan=\"2\" style=\"padding-bottom:16px; border-bottom:1px dashed #e5e5e5;font-family:'Microsoft YaHei';\"><a href=\"http://www.kedexinxi.com/\">湖南科德信息咨询集团有限公司</a></td>\r\n" + 
 				"		              	</tr>\r\n" + 
 				"		               	<tr>\r\n" + 
 				"		                	<td width=\"720\" height=\"14\" colspan=\"2\" style=\"padding:8px 0 28px;color:#999999; font-size:12px;font-family:'Microsoft YaHei';\">此为系统邮件请勿回复</td>\r\n" + 
@@ -248,7 +256,7 @@ public class EmailBo {
 				"              </tr>\r\n" + 
 				"              \r\n" + 
 				"		               	<tr>\r\n" + 
-				"		                	<td width=\"720\" height=\"14\" colspan=\"2\" style=\"padding-bottom:16px; border-bottom:1px dashed #e5e5e5;font-family:'Microsoft YaHei';\"><a href=\"http://www.kedexinxi.com/\">湖南科德信息咨询有限公司</a></td>\r\n" + 
+				"		                	<td width=\"720\" height=\"14\" colspan=\"2\" style=\"padding-bottom:16px; border-bottom:1px dashed #e5e5e5;font-family:'Microsoft YaHei';\"><a href=\"http://www.kedexinxi.com/\">湖南科德信息咨询集团有限公司</a></td>\r\n" + 
 				"		              	</tr>\r\n" + 
 				"		               	<tr>\r\n" + 
 				"		                	<td width=\"720\" height=\"14\" colspan=\"2\" style=\"padding:8px 0 28px;color:#999999; font-size:12px;font-family:'Microsoft YaHei';\">此为系统邮件请勿回复</td>\r\n" + 
@@ -337,14 +345,14 @@ public class EmailBo {
 				"		            \r\n" + 
 				"		        <table width=\"800\" border=\"0\" align=\"left\" cellpadding=\"0\" cellspacing=\"0\" style=\" border:1px solid #edecec; border-top:none; padding:0 20px;font-size:14px;color:#333333;\">\r\n" + 
 				"	               		<tbody><tr>\r\n" + 
-				"                <td width=\"760\" height=\"56\" border=\"0\" align=\"left\" colspan=\"2\" style=\" font-size:16px;vertical-align:bottom;\">尊敬的" + userName + ":</td>\r\n" + 
+				"                <td width=\"760\" height=\"56\" border=\"0\" align=\"left\" colspan=\"2\" style=\" font-size:16px;vertical-align:bottom;\">尊敬的客户 [" + userName + "]:</td>\r\n" + 
 				"              </tr>\r\n" + 
 				"               <tr>\r\n" + 
 				"                <td width=\"760\" height=\"30\" border=\"0\" align=\"left\" colspan=\"2\" style=\"text-indent: 2em\">您好!</td>\r\n" + 
 				"              </tr>\r\n" + 
 				"                      <tr>\r\n" + 
 				"                <td width=\"40\" height=\"32\" border=\"0\" align=\"left\" valign=\"middle\" style=\" width:40px; text-align:left;vertical-align:middle; line-height:32px; float:left;\">&nbsp;</td>\r\n" + 
-				"                <td width=\"720\" height=\"32\" border=\"0\" align=\"left\" style=\" width:720px; text-align:left;vertical-align:middle;line-height:32px;\"><span style=\"font-weight: 900\">科德集团</span>【" + adminName + "】向您发起了专利缴费提醒!<span style=\"color: red\">如已缴费,请您忽略此短信!</span></td>\r\n" + 
+				"                <td width=\"720\" height=\"32\" border=\"0\" align=\"left\" style=\" width:720px; text-align:left;vertical-align:middle;line-height:32px;\"><span style=\"font-weight: 900\">科德集团</span>【" + adminName + "】向您发起了专利缴费提醒!<span style=\"color: red\">如已缴费,请您忽略此邮件!</span></td>\r\n" + 
 				"              </tr>\r\n" + 
 				"              <tr>\r\n" + 
 				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\"><span style=\"font-weight: 900\">专利信息</span></td>\r\n" + 
@@ -352,15 +360,12 @@ public class EmailBo {
 				"              \r\n" + 
 				"              <tr>\r\n" + 
 				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">专利名称:" + patentName + "</td>\r\n" + 
-				"              </tr>\r\n" + 
-				"              <tr>\r\n" + 
-				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">客户名称:" + userName + "</td>\r\n" + 
-				"              </tr>\r\n" + 
+				"              </tr>\r\n" +
 				"               <tr>\r\n" + 
 				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">专利编号:" + patentNo + "</td>\r\n" + 
 				"              </tr>\r\n" + 
 				"               <tr>\r\n" + 
-				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">金额:" + amount + " <span style=\"color: red\">(本缴费金额仅供参考,实际缴费金额,请登录国知局官方网址<a href=\"http://cpquery.sipo.gov.cn/\">cpquery.sipo.gov.cn</a>查询)</span></td>\r\n" + 
+				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">金额:" + amount + " <span style=\"color: red\">(本缴费金额仅供参考,实际缴费金额,请登录国知局官方网址<a href=\"http://cpquery.cnipa.gov.cn/\">cpquery.sipo.gov.cn</a>查询)</span></td>\r\n" + 
 				"              </tr>\r\n" +
 				"               <tr>\r\n" + 
 				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">剩余天数:" + days + "</td>\r\n" + 
@@ -391,7 +396,7 @@ public class EmailBo {
 				"              </tr>\r\n" + 
 				"              \r\n" + 
 				"		               	<tr>\r\n" + 
-				"		                	<td width=\"720\" height=\"14\" colspan=\"2\" style=\"padding-bottom:16px; border-bottom:1px dashed #e5e5e5;font-family:'Microsoft YaHei';\"><a href=\"http://www.kedexinxi.com/\">湖南科德信息咨询有限公司</a></td>\r\n" + 
+				"		                	<td width=\"720\" height=\"14\" colspan=\"2\" style=\"padding-bottom:16px; border-bottom:1px dashed #e5e5e5;font-family:'Microsoft YaHei';\"><a href=\"http://www.kedexinxi.com/\">湖南科德信息咨询集团有限公司</a></td>\r\n" + 
 				"		              	</tr>\r\n" + 
 				"		               	<tr>\r\n" + 
 				"		                	<td width=\"720\" height=\"14\" colspan=\"2\" style=\"padding:8px 0 28px;color:#999999; font-size:12px;font-family:'Microsoft YaHei';\">此为系统邮件请勿回复</td>\r\n" + 

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

@@ -114,11 +114,15 @@ public class BaseApiController extends BaseController {
 	 */
 	protected void downloadFile(HttpServletResponse res, String fileName, String filePath) {
 		FileUtils.downloadFile(res, fileName,  uploadPath+ filePath);
+		
 	}
 
 	protected void downloadUnPrivateFile(HttpServletResponse res, String fileName, String filePath) {
 		FileUtils.downloadFile(res, fileName, uploadPrivatePath + filePath);
 	}
+	
+	
+	
 
 	private File buildFile(String filePath) {
 		File toFile = new File(filePath);

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

@@ -708,7 +708,7 @@ public class PublicController extends CertifyApiController {
               {
                   if (!FileUtils.checkAllowDownload(fileName))
                   {
-                      throw new Exception("文件名称({})非法,不允许下载。 ");
+                      throw new Exception("文件名称非法,不允许下载。 ");
                   }
                   String realFileName =DateUtils.parseDateToStr(AFTConstants.YYYYMMDDHHMMSS, new Date())+fileName.substring(fileName.indexOf("_") + 1);
                   String filePath = uploadPath +"/"+ fileName;
@@ -716,6 +716,7 @@ public class PublicController extends CertifyApiController {
                   response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
                   FileUtils.setAttachmentResponseHeader(response, realFileName);
                   FileUtils.writeBytes(filePath, response.getOutputStream());
+                  if(delete==null)delete=true;
                   if (delete)
                   {
                       FileUtils.deleteFile(filePath);

+ 0 - 1
src/main/java/com/goafanti/common/dao/OfficialFeePriceMapper.java

@@ -1,7 +1,6 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.OfficialFeePrice;
-import com.goafanti.common.model.OfficialFeePriceExample;
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
 

+ 27 - 7
src/main/java/com/goafanti/common/dao/PatentNewMapper.java

@@ -2,6 +2,7 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.PatentNew;
 import com.goafanti.common.model.PatentNewLog;
+import com.goafanti.patent.bo.PatentNewBo;
 
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
@@ -10,41 +11,41 @@ public interface PatentNewMapper {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table patent_new
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	int deleteByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table patent_new
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	int insert(PatentNew record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table patent_new
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	int insertSelective(PatentNew record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table patent_new
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	PatentNew selectByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table patent_new
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	int updateByPrimaryKeySelective(PatentNew record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table patent_new
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	int updateByPrimaryKey(PatentNew record);
 
-	List<PatentNew> AllselectStartPatentNew();
+	List<PatentNewBo> AllselectStartPatentNew();
 	
 	List<PatentNew> AllselectEndPatentNew();
 
@@ -52,4 +53,23 @@ public interface PatentNewMapper {
 
 
 	void insertLogBatch(List<PatentNewLog> list);
+
+	void insertBatch(List<PatentNew> list2);
+
+	int selectByPatenNo(String patentNo);
+
+	List<PatentNew> selectByYear(int i);
+
+	void updateBatch(@Param("list") List<String> list);
+
+
+	List<PatentNew> selectByids(List<String> s);
+
+	String selectUserNameByTid(Integer tid);
+
+	void updateBatchByid(@Param("list")List<String> list, @Param("status")Integer status, @Param("aid")String aid);
+
+	List<PatentNew> selectByTid(Integer tid);
+
+
 }

+ 65 - 0
src/main/java/com/goafanti/common/dao/PatentPaymentDetailsMapper.java

@@ -0,0 +1,65 @@
+package com.goafanti.common.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
+import com.goafanti.common.model.PatentPaymentDetails;
+
+public interface PatentPaymentDetailsMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_payment_details
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_payment_details
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    int insert(PatentPaymentDetails record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_payment_details
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    int insertSelective(PatentPaymentDetails record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_payment_details
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    PatentPaymentDetails selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_payment_details
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    int updateByPrimaryKeySelective(PatentPaymentDetails record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_payment_details
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    int updateByPrimaryKey(PatentPaymentDetails record);
+
+	void insertBatch(List<PatentPaymentDetails> list);
+
+	List<PatentPaymentDetails> selectByPid(Integer id);
+
+	void deleteByPid(Integer pid);
+
+	PatentPaymentDetails selectByPidAndYear(@Param("pid") Integer pid, @Param("year")Integer year);
+}

+ 57 - 0
src/main/java/com/goafanti/common/dao/PatentYearPaymentMapper.java

@@ -0,0 +1,57 @@
+package com.goafanti.common.dao;
+
+import java.util.List;
+
+import com.goafanti.common.model.PatentYearPayment;
+
+public interface PatentYearPaymentMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_year_payment
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_year_payment
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    int insert(PatentYearPayment record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_year_payment
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    int insertSelective(PatentYearPayment record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_year_payment
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    PatentYearPayment selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_year_payment
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    int updateByPrimaryKeySelective(PatentYearPayment record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_year_payment
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    int updateByPrimaryKey(PatentYearPayment record);
+
+	List<PatentYearPayment> selectAll();
+}

+ 0 - 1
src/main/java/com/goafanti/common/dao/PaymentLogMapper.java

@@ -1,7 +1,6 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.PaymentLog;
-import com.goafanti.common.model.PaymentLogExample;
 import com.goafanti.organization.bo.OutPaymentLog;
 
 import java.util.List;

+ 0 - 2
src/main/java/com/goafanti/common/dao/TOrderOutsourceMapper.java

@@ -1,11 +1,9 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.TOrderOutsource;
-import com.goafanti.common.model.TOrderOutsourceExample;
 import com.goafanti.order.bo.OrderOutsourceDtails;
 import com.goafanti.organization.bo.outProjectBo;
 
-import java.util.List;
 
 import org.apache.ibatis.annotations.Param;
 

+ 3 - 0
src/main/java/com/goafanti/common/dao/TOrderTaskMapper.java

@@ -6,6 +6,7 @@ import com.goafanti.common.model.TOrderTask;
 import com.goafanti.order.bo.TOrderTaskBo;
 import com.goafanti.order.bo.TOrderTaskDetailBo;
 import com.goafanti.order.bo.TOrderTaskListBo;
+import com.goafanti.organization.bo.ProjectTypePuls;
 
 import java.math.BigDecimal;
 import java.util.List;
@@ -88,4 +89,6 @@ public interface TOrderTaskMapper {
 
 	OrderOperator selectAidByParam(@Param("tid")Integer tid);
 
+	ProjectTypePuls selectByTidGetDtails(Integer tid);
+
 }

+ 0 - 4
src/main/java/com/goafanti/common/dao/ThirdPartyCompanyMapper.java

@@ -80,10 +80,6 @@ public interface ThirdPartyCompanyMapper {
 	List<OutThirdPartyCompany> selectByTid(Integer tid);
 
 
-	ProjectTypePuls selectByTidGetDtails(Integer tid);
-	
-
 	void deleteByTid(Integer id);
 
-	List<ProjectTypePuls>  selectByTidGetListDtails(Integer tid);
 }

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

@@ -41,6 +41,7 @@ public enum AttachmentType {
 	DEMAND_TEMPLATE("demand_template", "科技需求批量导入模板"),
 	ACHIEVEMENT_TEMPLATE("achievement_template", "科技成果批量导入模板"),
 	RECEIVABLES_TEMPLATE("receivbles_template", "收款批量导入模板"),
+	NEW_PATENT_TEMPLATE("new_patent_template", "新专利导入模板"),
 	USER_CHANNEL("user_channel", "渠道客户导入模板"),
 	DEMAND_ORDER_FILE("demand_order_file", "科技需求意向单/交易单附件"),
 	DEMAND_COVER_PICTURE("demand_cover_picture","科技需求封面图"),

+ 0 - 1
src/main/java/com/goafanti/common/enums/OfficialPatentType.java

@@ -6,7 +6,6 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.collections4.map.HashedMap;
 import org.apache.commons.lang3.StringUtils;
 
 public enum OfficialPatentType {

+ 1 - 0
src/main/java/com/goafanti/common/mapper/PatentNewLogMapper.xml

@@ -282,5 +282,6 @@
     <include refid="Base_Column_List" />
     from patent_new_log
     where pid = #{id,jdbcType=INTEGER}
+    order by create_time desc
   </select>
 </mapper>

File diff suppressed because it is too large
+ 645 - 507
src/main/java/com/goafanti/common/mapper/PatentNewMapper.xml


+ 187 - 0
src/main/java/com/goafanti/common/mapper/PatentPaymentDetailsMapper.xml

@@ -0,0 +1,187 @@
+<?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.PatentPaymentDetailsMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.PatentPaymentDetails">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:00:19 CST 2021.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="pid" jdbcType="INTEGER" property="pid" />
+    <result column="years" jdbcType="INTEGER" property="years" />
+    <result column="patent_amount" jdbcType="DECIMAL" property="patentAmount" />
+    <result column="end_date" jdbcType="DATE" property="endDate" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:00:19 CST 2021.
+    -->
+    id, pid, `years`, patent_amount, end_date, `status`, create_time
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:00:19 CST 2021.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from patent_payment_details
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:00:19 CST 2021.
+    -->
+    delete from patent_payment_details
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.PatentPaymentDetails">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:00:19 CST 2021.
+    -->
+    insert into patent_payment_details (id, pid, `years`, 
+      patent_amount, end_date, `status`, 
+      create_time)
+    values (#{id,jdbcType=INTEGER}, #{pid,jdbcType=INTEGER}, #{years,jdbcType=INTEGER}, 
+      #{patentAmount,jdbcType=DECIMAL}, #{endDate,jdbcType=DATE}, #{status,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.PatentPaymentDetails">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:00:19 CST 2021.
+    -->
+    insert into patent_payment_details
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="pid != null">
+        pid,
+      </if>
+      <if test="years != null">
+        `years`,
+      </if>
+      <if test="patentAmount != null">
+        patent_amount,
+      </if>
+      <if test="endDate != null">
+        end_date,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="pid != null">
+        #{pid,jdbcType=INTEGER},
+      </if>
+      <if test="years != null">
+        #{years,jdbcType=INTEGER},
+      </if>
+      <if test="patentAmount != null">
+        #{patentAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="endDate != null">
+        #{endDate,jdbcType=DATE},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PatentPaymentDetails">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:00:19 CST 2021.
+    -->
+    update patent_payment_details
+    <set>
+      <if test="pid != null">
+        pid = #{pid,jdbcType=INTEGER},
+      </if>
+      <if test="years != null">
+        `years` = #{years,jdbcType=INTEGER},
+      </if>
+      <if test="patentAmount != null">
+        patent_amount = #{patentAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="endDate != null">
+        end_date = #{endDate,jdbcType=DATE},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PatentPaymentDetails">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:00:19 CST 2021.
+    -->
+    update patent_payment_details
+    set pid = #{pid,jdbcType=INTEGER},
+      `years` = #{years,jdbcType=INTEGER},
+      patent_amount = #{patentAmount,jdbcType=DECIMAL},
+      end_date = #{endDate,jdbcType=DATE},
+      `status` = #{status,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  
+  <insert id="insertBatch" >
+    insert into patent_payment_details ( pid, `years`, 
+      patent_amount, end_date, `status`
+      )
+    values
+     <foreach collection="list" index="index" item="item" separator=",">
+    ( #{item.pid,jdbcType=INTEGER}, #{item.years,jdbcType=INTEGER}, 
+      #{item.patentAmount,jdbcType=DECIMAL}, #{item.endDate,jdbcType=DATE}, #{item.status,jdbcType=INTEGER}
+      )
+     </foreach> 
+  </insert>
+  
+    <select id="selectByPid" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from patent_payment_details
+    where pid = #{pid,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPid" >
+  delete from patent_payment_details
+    where pid = #{pid,jdbcType=INTEGER}
+  </delete>
+  
+  <select id="selectByPidAndYear" resultMap="BaseResultMap">
+     select 
+    <include refid="Base_Column_List" />
+    from patent_payment_details
+    where pid = #{pid,jdbcType=INTEGER} and years= #{year,jdbcType=INTEGER}
+  </select>
+</mapper>

+ 153 - 0
src/main/java/com/goafanti/common/mapper/PatentYearPaymentMapper.xml

@@ -0,0 +1,153 @@
+<?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.PatentYearPaymentMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.PatentYearPayment">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:52:32 CST 2021.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="year" jdbcType="INTEGER" property="year" />
+    <result column="patent_amount" jdbcType="DECIMAL" property="patentAmount" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="reduction_amount" jdbcType="DECIMAL" property="reductionAmount" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:52:32 CST 2021.
+    -->
+    id, `type`, `year`, patent_amount, create_time, reduction_amount
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:52:32 CST 2021.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from patent_year_payment
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:52:32 CST 2021.
+    -->
+    delete from patent_year_payment
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.PatentYearPayment">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:52:32 CST 2021.
+    -->
+    insert into patent_year_payment (id, `type`, `year`, 
+      patent_amount, create_time, reduction_amount
+      )
+    values (#{id,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{year,jdbcType=INTEGER}, 
+      #{patentAmount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{reductionAmount,jdbcType=DECIMAL}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.PatentYearPayment">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:52:32 CST 2021.
+    -->
+    insert into patent_year_payment
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="year != null">
+        `year`,
+      </if>
+      <if test="patentAmount != null">
+        patent_amount,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="reductionAmount != null">
+        reduction_amount,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
+      <if test="year != null">
+        #{year,jdbcType=INTEGER},
+      </if>
+      <if test="patentAmount != null">
+        #{patentAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="reductionAmount != null">
+        #{reductionAmount,jdbcType=DECIMAL},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PatentYearPayment">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:52:32 CST 2021.
+    -->
+    update patent_year_payment
+    <set>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
+      <if test="year != null">
+        `year` = #{year,jdbcType=INTEGER},
+      </if>
+      <if test="patentAmount != null">
+        patent_amount = #{patentAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="reductionAmount != null">
+        reduction_amount = #{reductionAmount,jdbcType=DECIMAL},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PatentYearPayment">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Fri Aug 06 15:52:32 CST 2021.
+    -->
+    update patent_year_payment
+    set `type` = #{type,jdbcType=INTEGER},
+      `year` = #{year,jdbcType=INTEGER},
+      patent_amount = #{patentAmount,jdbcType=DECIMAL},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      reduction_amount = #{reductionAmount,jdbcType=DECIMAL}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  
+    <select id="selectAll" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from patent_year_payment
+    where 1=1
+  </select>
+</mapper>

+ 7 - 0
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -2154,4 +2154,11 @@ inner join department de on x.department_id=de.id left join business_category bc
 			and a.id= #{tid}
 		</if>
 	</select>
+	
+	  <select id="selectByTidGetDtails" resultType="com.goafanti.organization.bo.ProjectTypePuls">
+ select a.id,a.official_cost officialCost,a.cost_reduction costReduction ,a.commodity_quantity quantity ,a.patent_type patentType,b.patent_name_type projectType,
+ c.amount officialAmount,c.proportion85 from t_order_task a left join t_order_outsource b on a.id=b.tid
+left join official_fee_price c on a.patent_type =c.patent_type and b.patent_name_type =c.`type`  
+where a.id= #{tid}
+  </select>
 </mapper>

+ 0 - 6
src/main/java/com/goafanti/common/mapper/ThirdPartyCompanyMapper.xml

@@ -541,12 +541,6 @@ where x.id=  #{tid}
   </select>
   
   
-    <select id="selectByTidGetDtails" resultType="com.goafanti.organization.bo.ProjectTypePuls">
- select a.id,a.official_cost officialCost,a.cost_reduction costReduction ,a.commodity_quantity quantity ,a.patent_type patentType,b.patent_name_type projectType,
- c.amount officialAmount,c.proportion85 from t_order_task a left join t_order_outsource b on a.id=b.tid
-left join official_fee_price c on a.patent_type =c.patent_type and b.patent_name_type =c.`type`  
-where a.id= #{tid}
-  </select>
    <select id="selectPaymentList" resultType="com.goafanti.organization.bo.outPaymentList">
 		    select a.id, c.contract_no contractNo,b.order_no orderNo,d.buyer_name userName, d.dep_name depName,f.party_amount costAmount,
 		a.choose_type chooseType,a.payment_amount paymentAmount,a.application_amount applicationAmount,a.tid,a.company_name companyName, 

+ 1 - 1
src/main/java/com/goafanti/common/mapper/UserLockReleaseMapper.xml

@@ -388,7 +388,7 @@
 	left join user u on t0.uid=u.id
 	where u.channel=0
 	<if test="type==0">
-	 and datediff(now(),if(t0.lock_time &lt; t1.last_follow_time,t1.last_follow_time,t1.t0.lock_time))>30
+	 and datediff(now(),if(t0.lock_time &lt; t1.last_follow_time,t1.last_follow_time,t0.lock_time))>30
 	</if>
 	<if test="type==1">
 	 and datediff(now(),t0.lock_time)>270

+ 119 - 95
src/main/java/com/goafanti/common/model/PatentNew.java

@@ -8,149 +8,154 @@ public class PatentNew implements Serializable {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.id
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private Integer id;
 	/**
 	 * Database Column Remarks: 专利编号 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.patent_no
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private String patentNo;
 	/**
 	 * Database Column Remarks: 名称 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.name
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private String name;
 	/**
-	 * Database Column Remarks: 类型 0发明专利 1使用新型 2外观设计 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.type
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * Database Column Remarks: 专利名称 0实用新型 1发明专利 2外观专利 3 其他 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.type
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private Integer type;
 	/**
 	 * Database Column Remarks: 状态 0 未提醒 1 剩余90天 2剩余30天 3剩余20天 4剩余10天 5剩余3天 6剩余2天 7剩余1天 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.status
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private Integer status;
 	/**
 	 * Database Column Remarks: 申请时间 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.apply_date
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private Date applyDate;
 	/**
 	 * Database Column Remarks: 授权时间 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.authorization_date
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private Date authorizationDate;
 	/**
 	 * Database Column Remarks: 金额 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.patent_amount
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private BigDecimal patentAmount;
 	/**
 	 * Database Column Remarks: 申请人 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.applicant
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private String applicant;
 	/**
 	 * Database Column Remarks: 所在地-省份 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.province
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private Integer province;
 	/**
 	 * Database Column Remarks: 联系方式 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.contact_mobile
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private String contactMobile;
 	/**
 	 * Database Column Remarks: 邮箱 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.email
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private String email;
 	/**
 	 * Database Column Remarks: 证件URL This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.certificate_url
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private String certificateUrl;
 	/**
 	 * Database Column Remarks: 创建时间 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.create_time
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private Date createTime;
 	/**
 	 * Database Column Remarks: 更新时间 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.update_time
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private Date updateTime;
 	/**
 	 * Database Column Remarks: 操作人 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.aid
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private String aid;
 	/**
 	 * Database Column Remarks: 年份 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.years
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private Integer years;
 	/**
 	 * Database Column Remarks: 客户编号 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.uid
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private String uid;
 	/**
 	 * Database Column Remarks: 权利人 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.holders
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private String holders;
 	/**
 	 * Database Column Remarks: 发明人 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.inventor
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private String inventor;
 	/**
 	 * Database Column Remarks: 年费状态 0无信息 1代缴费 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.annual_fee_status
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private Integer annualFeeStatus;
 	/**
 	 * Database Column Remarks: 营销员是否提醒 0未通知 1已通知 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.salesman_remind
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private Integer salesmanRemind;
 	/**
 	 * Database Column Remarks: 项目编号 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.tid
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private Integer tid;
 	/**
 	 * Database Column Remarks: 是否为新专利 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.new_type
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private Integer newType;
 	/**
 	 * Database Column Remarks: 滞纳金 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.delaying_amount
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private BigDecimal delayingAmount;
 	/**
 	 * Database Column Remarks: 恢复金 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.recovery_amount
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private BigDecimal recoveryAmount;
 	/**
-	 * Database Column Remarks: 录入人 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.input_name
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * Database Column Remarks: 录入人 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.input_id
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
-	private String inputName;
+	private String inputId;
+	/**
+	 * Database Column Remarks: 结束时间 This field was generated by MyBatis Generator. This field corresponds to the database column patent_new.end_date
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
+	 */
+	private Date endDate;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table patent_new
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	private static final long serialVersionUID = 1L;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.id
 	 * @return  the value of patent_new.id
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public Integer getId() {
 		return id;
@@ -159,7 +164,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.id
 	 * @param id  the value for patent_new.id
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setId(Integer id) {
 		this.id = id;
@@ -168,7 +173,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.patent_no
 	 * @return  the value of patent_new.patent_no
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public String getPatentNo() {
 		return patentNo;
@@ -177,7 +182,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.patent_no
 	 * @param patentNo  the value for patent_new.patent_no
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setPatentNo(String patentNo) {
 		this.patentNo = patentNo == null ? null : patentNo.trim();
@@ -186,7 +191,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.name
 	 * @return  the value of patent_new.name
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public String getName() {
 		return name;
@@ -195,7 +200,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.name
 	 * @param name  the value for patent_new.name
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setName(String name) {
 		this.name = name == null ? null : name.trim();
@@ -204,7 +209,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.type
 	 * @return  the value of patent_new.type
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public Integer getType() {
 		return type;
@@ -213,7 +218,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.type
 	 * @param type  the value for patent_new.type
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setType(Integer type) {
 		this.type = type;
@@ -222,7 +227,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.status
 	 * @return  the value of patent_new.status
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public Integer getStatus() {
 		return status;
@@ -231,7 +236,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.status
 	 * @param status  the value for patent_new.status
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setStatus(Integer status) {
 		this.status = status;
@@ -240,7 +245,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.apply_date
 	 * @return  the value of patent_new.apply_date
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public Date getApplyDate() {
 		return applyDate;
@@ -249,7 +254,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.apply_date
 	 * @param applyDate  the value for patent_new.apply_date
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setApplyDate(Date applyDate) {
 		this.applyDate = applyDate;
@@ -258,7 +263,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.authorization_date
 	 * @return  the value of patent_new.authorization_date
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public Date getAuthorizationDate() {
 		return authorizationDate;
@@ -267,7 +272,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.authorization_date
 	 * @param authorizationDate  the value for patent_new.authorization_date
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setAuthorizationDate(Date authorizationDate) {
 		this.authorizationDate = authorizationDate;
@@ -276,7 +281,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.patent_amount
 	 * @return  the value of patent_new.patent_amount
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public BigDecimal getPatentAmount() {
 		return patentAmount;
@@ -285,7 +290,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.patent_amount
 	 * @param patentAmount  the value for patent_new.patent_amount
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setPatentAmount(BigDecimal patentAmount) {
 		this.patentAmount = patentAmount;
@@ -294,7 +299,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.applicant
 	 * @return  the value of patent_new.applicant
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public String getApplicant() {
 		return applicant;
@@ -303,7 +308,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.applicant
 	 * @param applicant  the value for patent_new.applicant
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setApplicant(String applicant) {
 		this.applicant = applicant == null ? null : applicant.trim();
@@ -312,7 +317,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.province
 	 * @return  the value of patent_new.province
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public Integer getProvince() {
 		return province;
@@ -321,7 +326,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.province
 	 * @param province  the value for patent_new.province
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setProvince(Integer province) {
 		this.province = province;
@@ -330,7 +335,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.contact_mobile
 	 * @return  the value of patent_new.contact_mobile
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public String getContactMobile() {
 		return contactMobile;
@@ -339,7 +344,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.contact_mobile
 	 * @param contactMobile  the value for patent_new.contact_mobile
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setContactMobile(String contactMobile) {
 		this.contactMobile = contactMobile == null ? null : contactMobile.trim();
@@ -348,7 +353,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.email
 	 * @return  the value of patent_new.email
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public String getEmail() {
 		return email;
@@ -357,7 +362,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.email
 	 * @param email  the value for patent_new.email
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setEmail(String email) {
 		this.email = email == null ? null : email.trim();
@@ -366,7 +371,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.certificate_url
 	 * @return  the value of patent_new.certificate_url
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public String getCertificateUrl() {
 		return certificateUrl;
@@ -375,7 +380,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.certificate_url
 	 * @param certificateUrl  the value for patent_new.certificate_url
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setCertificateUrl(String certificateUrl) {
 		this.certificateUrl = certificateUrl == null ? null : certificateUrl.trim();
@@ -384,7 +389,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.create_time
 	 * @return  the value of patent_new.create_time
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public Date getCreateTime() {
 		return createTime;
@@ -393,7 +398,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.create_time
 	 * @param createTime  the value for patent_new.create_time
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
@@ -402,7 +407,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.update_time
 	 * @return  the value of patent_new.update_time
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public Date getUpdateTime() {
 		return updateTime;
@@ -411,7 +416,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.update_time
 	 * @param updateTime  the value for patent_new.update_time
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setUpdateTime(Date updateTime) {
 		this.updateTime = updateTime;
@@ -420,7 +425,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.aid
 	 * @return  the value of patent_new.aid
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public String getAid() {
 		return aid;
@@ -429,7 +434,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.aid
 	 * @param aid  the value for patent_new.aid
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setAid(String aid) {
 		this.aid = aid == null ? null : aid.trim();
@@ -438,7 +443,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.years
 	 * @return  the value of patent_new.years
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public Integer getYears() {
 		return years;
@@ -447,7 +452,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.years
 	 * @param years  the value for patent_new.years
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setYears(Integer years) {
 		this.years = years;
@@ -456,7 +461,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.uid
 	 * @return  the value of patent_new.uid
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public String getUid() {
 		return uid;
@@ -465,7 +470,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.uid
 	 * @param uid  the value for patent_new.uid
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setUid(String uid) {
 		this.uid = uid == null ? null : uid.trim();
@@ -474,7 +479,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.holders
 	 * @return  the value of patent_new.holders
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public String getHolders() {
 		return holders;
@@ -483,7 +488,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.holders
 	 * @param holders  the value for patent_new.holders
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setHolders(String holders) {
 		this.holders = holders == null ? null : holders.trim();
@@ -492,7 +497,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.inventor
 	 * @return  the value of patent_new.inventor
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public String getInventor() {
 		return inventor;
@@ -501,7 +506,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.inventor
 	 * @param inventor  the value for patent_new.inventor
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setInventor(String inventor) {
 		this.inventor = inventor == null ? null : inventor.trim();
@@ -510,7 +515,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.annual_fee_status
 	 * @return  the value of patent_new.annual_fee_status
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public Integer getAnnualFeeStatus() {
 		return annualFeeStatus;
@@ -519,7 +524,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.annual_fee_status
 	 * @param annualFeeStatus  the value for patent_new.annual_fee_status
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setAnnualFeeStatus(Integer annualFeeStatus) {
 		this.annualFeeStatus = annualFeeStatus;
@@ -528,7 +533,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.salesman_remind
 	 * @return  the value of patent_new.salesman_remind
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public Integer getSalesmanRemind() {
 		return salesmanRemind;
@@ -537,7 +542,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.salesman_remind
 	 * @param salesmanRemind  the value for patent_new.salesman_remind
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setSalesmanRemind(Integer salesmanRemind) {
 		this.salesmanRemind = salesmanRemind;
@@ -546,7 +551,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.tid
 	 * @return  the value of patent_new.tid
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public Integer getTid() {
 		return tid;
@@ -555,7 +560,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.tid
 	 * @param tid  the value for patent_new.tid
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setTid(Integer tid) {
 		this.tid = tid;
@@ -564,7 +569,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.new_type
 	 * @return  the value of patent_new.new_type
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public Integer getNewType() {
 		return newType;
@@ -573,7 +578,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.new_type
 	 * @param newType  the value for patent_new.new_type
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setNewType(Integer newType) {
 		this.newType = newType;
@@ -582,7 +587,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.delaying_amount
 	 * @return  the value of patent_new.delaying_amount
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public BigDecimal getDelayingAmount() {
 		return delayingAmount;
@@ -591,7 +596,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.delaying_amount
 	 * @param delayingAmount  the value for patent_new.delaying_amount
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setDelayingAmount(BigDecimal delayingAmount) {
 		this.delayingAmount = delayingAmount;
@@ -600,7 +605,7 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.recovery_amount
 	 * @return  the value of patent_new.recovery_amount
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public BigDecimal getRecoveryAmount() {
 		return recoveryAmount;
@@ -609,33 +614,51 @@ public class PatentNew implements Serializable {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.recovery_amount
 	 * @param recoveryAmount  the value for patent_new.recovery_amount
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	public void setRecoveryAmount(BigDecimal recoveryAmount) {
 		this.recoveryAmount = recoveryAmount;
 	}
 
 	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.input_name
-	 * @return  the value of patent_new.input_name
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.input_id
+	 * @return  the value of patent_new.input_id
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
+	 */
+	public String getInputId() {
+		return inputId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.input_id
+	 * @param inputId  the value for patent_new.input_id
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
+	 */
+	public void setInputId(String inputId) {
+		this.inputId = inputId == null ? null : inputId.trim();
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column patent_new.end_date
+	 * @return  the value of patent_new.end_date
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
-	public String getInputName() {
-		return inputName;
+	public Date getEndDate() {
+		return endDate;
 	}
 
 	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.input_name
-	 * @param inputName  the value for patent_new.input_name
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column patent_new.end_date
+	 * @param endDate  the value for patent_new.end_date
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
-	public void setInputName(String inputName) {
-		this.inputName = inputName == null ? null : inputName.trim();
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
 	}
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table patent_new
-	 * @mbg.generated  Thu Aug 05 17:02:04 CST 2021
+	 * @mbg.generated  Mon Aug 09 14:41:21 CST 2021
 	 */
 	@Override
 	public String toString() {
@@ -669,7 +692,8 @@ public class PatentNew implements Serializable {
 		sb.append(", newType=").append(newType);
 		sb.append(", delayingAmount=").append(delayingAmount);
 		sb.append(", recoveryAmount=").append(recoveryAmount);
-		sb.append(", inputName=").append(inputName);
+		sb.append(", inputId=").append(inputId);
+		sb.append(", endDate=").append(endDate);
 		sb.append(", serialVersionUID=").append(serialVersionUID);
 		sb.append("]");
 		return sb.toString();

+ 287 - 0
src/main/java/com/goafanti/common/model/PatentPaymentDetails.java

@@ -0,0 +1,287 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ *
+ * This class was generated by MyBatis Generator.
+ * This class corresponds to the database table patent_payment_details
+ */
+public class PatentPaymentDetails implements Serializable {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column patent_payment_details.id
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    private Integer id;
+
+    /**
+     * Database Column Remarks:
+     *   专利id
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column patent_payment_details.pid
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    private Integer pid;
+
+    /**
+     * Database Column Remarks:
+     *   年份
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column patent_payment_details.years
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    private Integer years;
+
+    /**
+     * Database Column Remarks:
+     *   金额
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column patent_payment_details.patent_amount
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    private BigDecimal patentAmount;
+
+    /**
+     * Database Column Remarks:
+     *   截止时间
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column patent_payment_details.end_date
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    private Date endDate;
+
+    /**
+     * Database Column Remarks:
+     *   状态 0未缴费 1已缴费
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column patent_payment_details.status
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    private Integer status;
+
+    /**
+     * Database Column Remarks:
+     *   发起时间
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column patent_payment_details.create_time
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    private Date createTime;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table patent_payment_details
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column patent_payment_details.id
+     *
+     * @return the value of patent_payment_details.id
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column patent_payment_details.id
+     *
+     * @param id the value for patent_payment_details.id
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column patent_payment_details.pid
+     *
+     * @return the value of patent_payment_details.pid
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public Integer getPid() {
+        return pid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column patent_payment_details.pid
+     *
+     * @param pid the value for patent_payment_details.pid
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public void setPid(Integer pid) {
+        this.pid = pid;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column patent_payment_details.years
+     *
+     * @return the value of patent_payment_details.years
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public Integer getYears() {
+        return years;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column patent_payment_details.years
+     *
+     * @param years the value for patent_payment_details.years
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public void setYears(Integer years) {
+        this.years = years;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column patent_payment_details.patent_amount
+     *
+     * @return the value of patent_payment_details.patent_amount
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public BigDecimal getPatentAmount() {
+        return patentAmount;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column patent_payment_details.patent_amount
+     *
+     * @param patentAmount the value for patent_payment_details.patent_amount
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public void setPatentAmount(BigDecimal patentAmount) {
+        this.patentAmount = patentAmount;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column patent_payment_details.end_date
+     *
+     * @return the value of patent_payment_details.end_date
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public Date getEndDate() {
+        return endDate;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column patent_payment_details.end_date
+     *
+     * @param endDate the value for patent_payment_details.end_date
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public void setEndDate(Date endDate) {
+        this.endDate = endDate;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column patent_payment_details.status
+     *
+     * @return the value of patent_payment_details.status
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public Integer getStatus() {
+        return status;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column patent_payment_details.status
+     *
+     * @param status the value for patent_payment_details.status
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column patent_payment_details.create_time
+     *
+     * @return the value of patent_payment_details.create_time
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column patent_payment_details.create_time
+     *
+     * @param createTime the value for patent_payment_details.create_time
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_payment_details
+     *
+     * @mbg.generated Fri Aug 06 15:00:19 CST 2021
+     */
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", pid=").append(pid);
+        sb.append(", years=").append(years);
+        sb.append(", patentAmount=").append(patentAmount);
+        sb.append(", endDate=").append(endDate);
+        sb.append(", status=").append(status);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 251 - 0
src/main/java/com/goafanti/common/model/PatentYearPayment.java

@@ -0,0 +1,251 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ *
+ * This class was generated by MyBatis Generator.
+ * This class corresponds to the database table patent_year_payment
+ */
+public class PatentYearPayment implements Serializable {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column patent_year_payment.id
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    private Integer id;
+
+    /**
+     * Database Column Remarks:
+     *   专利分类 0实用新型 1发明专利 2外观专利 
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column patent_year_payment.type
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    private Integer type;
+
+    /**
+     * Database Column Remarks:
+     *   年份
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column patent_year_payment.year
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    private Integer year;
+
+    /**
+     * Database Column Remarks:
+     *   金额
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column patent_year_payment.patent_amount
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    private BigDecimal patentAmount;
+
+    /**
+     * Database Column Remarks:
+     *   发起时间
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column patent_year_payment.create_time
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    private Date createTime;
+
+    /**
+     * Database Column Remarks:
+     *   费减金额
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column patent_year_payment.reduction_amount
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    private BigDecimal reductionAmount;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table patent_year_payment
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column patent_year_payment.id
+     *
+     * @return the value of patent_year_payment.id
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column patent_year_payment.id
+     *
+     * @param id the value for patent_year_payment.id
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column patent_year_payment.type
+     *
+     * @return the value of patent_year_payment.type
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    public Integer getType() {
+        return type;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column patent_year_payment.type
+     *
+     * @param type the value for patent_year_payment.type
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column patent_year_payment.year
+     *
+     * @return the value of patent_year_payment.year
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    public Integer getYear() {
+        return year;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column patent_year_payment.year
+     *
+     * @param year the value for patent_year_payment.year
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    public void setYear(Integer year) {
+        this.year = year;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column patent_year_payment.patent_amount
+     *
+     * @return the value of patent_year_payment.patent_amount
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    public BigDecimal getPatentAmount() {
+        return patentAmount;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column patent_year_payment.patent_amount
+     *
+     * @param patentAmount the value for patent_year_payment.patent_amount
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    public void setPatentAmount(BigDecimal patentAmount) {
+        this.patentAmount = patentAmount;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column patent_year_payment.create_time
+     *
+     * @return the value of patent_year_payment.create_time
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column patent_year_payment.create_time
+     *
+     * @param createTime the value for patent_year_payment.create_time
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column patent_year_payment.reduction_amount
+     *
+     * @return the value of patent_year_payment.reduction_amount
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    public BigDecimal getReductionAmount() {
+        return reductionAmount;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column patent_year_payment.reduction_amount
+     *
+     * @param reductionAmount the value for patent_year_payment.reduction_amount
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    public void setReductionAmount(BigDecimal reductionAmount) {
+        this.reductionAmount = reductionAmount;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table patent_year_payment
+     *
+     * @mbg.generated Fri Aug 06 15:52:32 CST 2021
+     */
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", type=").append(type);
+        sb.append(", year=").append(year);
+        sb.append(", patentAmount=").append(patentAmount);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", reductionAmount=").append(reductionAmount);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 1 - 5
src/main/java/com/goafanti/common/task/OrderDunTask.java

@@ -141,11 +141,7 @@ public class OrderDunTask {
   		
   		} catch (Exception e) {
   			EmailBo emailBo = new EmailBo( "催款处理失败",  AFTConstants.ADMIN_EMAIL,  "超管", "平台",  "系统", devName+"催款处理失败");
-			try {
-				asyncUtils.send(emailBo);
-			} catch (UnsupportedEncodingException | MessagingException e1) {
-				e1.printStackTrace();
-			}
+  			asyncUtils.send(emailBo);
   			LoggerUtils.error(getClass(), "=============================================");
 			LoggerUtils.error(getClass(), "新催款的信息处理失败", e);
 			LoggerUtils.error(getClass(), "=============================================");

+ 124 - 194
src/main/java/com/goafanti/common/task/PatentTask.java

@@ -1,8 +1,6 @@
 package com.goafanti.common.task;
 
-import java.math.BigDecimal;
 import java.util.ArrayList;
-import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.UUID;
@@ -10,9 +8,7 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import javax.annotation.Resource;
-import javax.mail.SendFailedException;
 
-import org.apache.commons.lang3.time.DateFormatUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
@@ -21,20 +17,16 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.goafanti.admin.service.AdminService;
-import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.enums.NoticeStatus;
-import com.goafanti.common.enums.PatentCategoryStatus;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Notice;
-import com.goafanti.common.model.PatentNew;
 import com.goafanti.common.model.PatentNewLog;
-import com.goafanti.common.model.User;
 import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.SendEmailUtil;
+import com.goafanti.patent.bo.PatentNewBo;
 import com.goafanti.patent.service.PatentNewService;
 
 
@@ -49,8 +41,6 @@ public class PatentTask {
 	@Resource
 	private AdminService adminService;
 	@Autowired
-	private UserMapper	userMapper;
-	@Autowired
 	private AsyncUtils	asyncUtils;
 	
 	
@@ -79,86 +69,59 @@ public class PatentTask {
 	public void patentRemind() {
 		LoggerUtils.debug(getClass(), "====================开始检查专利提醒==================");
 		try {
-			List<PatentNew> l = patentNewService.AllselectStartPatentNew();
+			List<PatentNewBo> l = patentNewService.AllselectStartPatentNew();
 			List<Notice> nlist = new ArrayList<>();
 			List<PatentNewLog> logList = new ArrayList<>();
-			for (PatentNew p : l) {
-				//因为改成数据关联字段修改
-				String userName ="";
-				
-				if (p.getUid()!=null) {
-					User u =userMapper.selectByPrimaryKey(p.getUid());
-					if (u!=null) {
-						userName=u.getNickname();
-					}else {
-						userName=p.getApplicant();
-					}
-				}else {
-					userName=p.getApplicant();
-				}
-				// 申请时间
-				Calendar sq = Calendar.getInstance();
-				sq.setTime(p.getApplyDate());
-				Integer status = 0;
-				// 当前时间
-				Calendar now = Calendar.getInstance();
-				now.setTime(new Date());
-				now.set(Calendar.MILLISECOND, 0);
-				now.set(Calendar.HOUR_OF_DAY, 0);
-				now.clear(Calendar.MINUTE);
-				now.clear(Calendar.SECOND);
-				Date date=new Date();
-				// 提醒
-				Calendar ted = Calendar.getInstance();
-				// 先获取到目前多少天数,再计算出年限
-				int d = (int) ((now.getTimeInMillis() - sq.getTimeInMillis()) / (1000 * 3600 * 24));
-				int y = d / 365;
-				if (d % 365 > 0)
-					y++;
-				ted.setTime(sq.getTime());
-				ted.add(Calendar.YEAR, y);
+			List<String> s1=new ArrayList<String>();
+			List<String> s2=new ArrayList<String>();
+			List<String> s3=new ArrayList<String>();
+			List<String> s4=new ArrayList<String>();
+			List<String> s5=new ArrayList<String>();
+			List<String> s6=new ArrayList<String>();
+			Date date=new Date();
+			for (PatentNewBo p : l) {
+				Integer status=0;
 				// 计算相差日期
-				int count = (int) ((ted.getTimeInMillis() - now.getTimeInMillis()) / (1000 * 3600 * 24));
-				Notice n = new Notice();
-				n.setId(UUID.randomUUID().toString());
-				n.setCreateTime(date);
-				n.setReaded(0);// 未读
-				n.setNoticeType(NoticeStatus.TASK_PATENT_ERROR.getCode());
+				int count = patentNewService.countDays(p.getEndDate());
+				
 				boolean flag=false;
-				if (count > 30 && count <= 90&&p.getStatus()!=1) {
+				if (count > 60 && count <= 90&&p.getStatus()!=1) {
 					flag=true;
 					status = 1;
-				} else if (count > 20 && count <= 30&&p.getStatus()!=2) {
+					s1.add(p.getId().toString());
+				} else if (count > 30 && count <= 60&&p.getStatus()!=2) {
 					flag=true;
 					status = 2;
-				}else if (count > 10 && count <= 20&&p.getStatus()!=3) {
+					s2.add(p.getId().toString());
+				}else if (count > 15 && count <= 30&&p.getStatus()!=3) {
 					flag=true;
 					status = 3;
-				}else if (count > 3 && count <= 10&&p.getStatus()!=4) {
+					s3.add(p.getId().toString());
+				}else if (count > 7 && count <= 15&&p.getStatus()!=4) {
 					flag=true;
 					status = 4;
+					s4.add(p.getId().toString());
+				}else if (count>0&&count <= 7&&p.getStatus()!=5) {
+					flag=true;
+					status = 5;
+					s5.add(p.getId().toString());
+				}else if(count<0&&p.getSalesmanRemind()==1) {
+					s6.add(p.getId().toString());
 				}
-				//取消3天,2天,1天提醒
-//				else if (count == 3&&p.getStatus()!=5) {
-//					flag=true;
-//					status = 5;
-//				}else if (count == 2&&p.getStatus()!=6) {
-//					flag=true;
-//					status = 6;
-//				}else if (count == 1&&p.getStatus()!=7) {
-//					flag=true;
-//					status = 7;
-//				}
 				if (flag) {
+					Notice n = new Notice();
+					n.setId(UUID.randomUUID().toString());
+					n.setCreateTime(date);
+					n.setReaded(0);// 未读
+					n.setNoticeType(NoticeStatus.TASK_PATENT_ERROR.getCode());
 					Admin a = adminService.selectByPrimaryKey(p.getAid());
 					StringBuffer str2 = new StringBuffer();
-					str2.append("专利编号=").append(p.getPatentNo()).append("名称=").append(p.getName()).append(",email=")
-							.append(p.getEmail());
-					n.setContent(str2.toString());
+					str2.append("专利编号[").append(p.getPatentNo()).append("],名称[").append(p.getName()).append("],email[")
+							.append(p.getEmail().trim()).append("]");
 					if (a == null) {
 						str2.append(",aid=").append(p.getAid()).append(",找不到管理员。");
-						n.setContent(str2.toString());
 						n.setAid("1");
+						n.setContent(str2.toString());
 						nlist.add(n);
 						continue;
 					} else if (!SendEmailUtil.isEmail(p.getEmail().trim())) {
@@ -177,60 +140,29 @@ public class PatentTask {
 						nlist.add(n2);
 						continue;
 					} else {
-						// 计算出年费金额,然后存入数据库
-						BigDecimal money = countMoney(y, p.getType());
-						
-						EmailBo emailBo = new EmailBo("专利提醒", p.getEmail().trim(),userName, "科德集团", a.getName(),
-								p.getName(), p.getPatentNo(), money.toString(), DateFormatUtils.format(ted, "yyyy-MM-dd"),status);
-						n.setNoticeType(NoticeStatus.TASK_PATENT_REMIND.getCode());
-						String title = "专利提醒成功!";
-						p.setStatus(status);// 提醒中
-						try {
-							asyncUtils.patentSend(emailBo);
-						} catch (SendFailedException e) {
-							// 如果邮件发送失败提醒
-							n.setNoticeType(NoticeStatus.TASK_PATENT_ERROR.getCode());
-							title = "提醒失败!对方邮箱不存在或者拒收!";
-							p.setStatus(0);
-						}
-						p.setPatentAmount(money);
-						p.setYears(y);
-						patentNewService.updatePatenNew(p);
 						PatentNewLog pl = new PatentNewLog();
-						String str = StrToString(title, p.getEmail().trim(), userName ,p.getName(),date,status);
+						String str = StrToString(str2,p.getEndDate(),status);
 						pl.setContent(str);
 						pl.setCreateTime(new Date());
 						pl.setPid(p.getId());
 						logList.add(pl);
 						n.setAid(p.getAid());
+						n.setNoticeType(NoticeStatus.TASK_PATENT_REMIND.getCode());
 						n.setContent(str);
 						nlist.add(n);
 					}
 				}
 			}
-			if (!nlist.isEmpty()) {
-				List<Notice> newList = new ArrayList<>();
-				for (int i = 0; i < nlist.size(); i++) {
-					newList.add(nlist.get(i));
-					if (pointsDataLimit == newList.size() || i == nlist.size() - 1) {
-						if (newList.size() > 0) asyncUtils.addNoticeBatch(newList);
-						Thread.sleep(2000);
-						newList.clear();
-					}
-				}
-			}
-			if (!logList.isEmpty()) {
-				List<PatentNewLog> logList2 = new ArrayList<>();
-				for (int i = 0; i < logList.size(); i++) {
-					logList2.add(logList.get(i));
-					if (pointsDataLimit == logList2.size() || i == logList.size() - 1) {
-						if (logList2.size() > 0) patentNewService.insertLogBatch(logList2);
-						logList2.clear();
-						Thread.sleep(2000);
-					}
-				}
-
-			}
+			pushNotice(nlist);
+			pushPatentLog(logList);
+			//将不同状态的修改成不同状态
+			updatePatentNew(s1,1);
+			updatePatentNew(s2,2);
+			updatePatentNew(s3,3);
+			updatePatentNew(s4,4);
+			updatePatentNew(s5,5);
+			pushPatentNewStatus(s6);
+			
 		} catch (Exception e) {
 			LoggerUtils.debug(getClass(), "=====================专利提醒失败======================");
 			Notice n = new Notice(UUID.randomUUID().toString(), new Date(), 0, "1",
@@ -241,68 +173,92 @@ public class PatentTask {
 
 		LoggerUtils.debug(getClass(), "=====================专利提醒结束======================");
 	}
-	
 
-	private String StrToString(String title, String email, String userName, String pname, Date date, Integer status) {
-		//状态 0 未提醒 1 剩余90天 2剩余30天 3剩余20天 4剩余10天 5剩余3天 6剩余2天 7剩余1天
-		Integer days=0;
-		StringBuffer sb=new StringBuffer().append(title).append("客户[").append(userName).append("]专利[")
-				.append(pname).append("]");
-		if (status==1) days=90;
-		else if (status==2) days=30;
-		else if (status==3) days=20;
-		else if (status==4) days=10;
-		else if (status==5) days=3;
-		else if (status==6) days=2;
-		else if (status==7) days=1;
-		if(days>0) {
-			sb.append(",续费时间还剩").append(days).append("天");
+
+	private void pushPatentNewStatus(List<String> s6) throws InterruptedException {
+		List<PatentNewLog> logs = new ArrayList<>();
+		for (String string : s6) {
+			PatentNewLog log=new PatentNewLog();
+			log.setContent("超过时间重置状态并计算下一年");
+			log.setCreateTime(new Date());
+			log.setPid(Integer.valueOf(string));
+			logs.add(log);
+		}
+		pushPatentLog(logs);
+		patentNewService.pushResetPatentNew(s6);
+	}
+
+
+
+
+	private void pushNotice(List<Notice> nlist) throws InterruptedException {
+		if (!nlist.isEmpty()) {
+			List<Notice> newList = new ArrayList<>();
+			for (int i = 0; i < nlist.size(); i++) {
+				newList.add(nlist.get(i));
+				if (pointsDataLimit == newList.size() || i == nlist.size() - 1) {
+					if (newList.size() > 0) asyncUtils.addNoticeBatch(newList);
+					Thread.sleep(2000);
+					newList.clear();
+				}
+			}
+		}
+	}
+
+
+	private void pushPatentLog(List<PatentNewLog> logList) throws InterruptedException {
+		if (!logList.isEmpty()) {
+			List<PatentNewLog> logList2 = new ArrayList<>();
+			for (int i = 0; i < logList.size(); i++) {
+				logList2.add(logList.get(i));
+				if (pointsDataLimit == logList2.size() || i == logList.size() - 1) {
+					if (logList2.size() > 0) patentNewService.insertLogBatch(logList2);
+					Thread.sleep(2000);
+					logList2.clear();
+				}
+			}
+
 		}
-		sb.append(",已于").append(DateUtils.formatDate(date, AFTConstants.YYYYMMDDHHMMSS)).append("发送专利提醒至邮箱")
-			.append(email).append("!");
-				
-		
-		return sb.toString();
 	}
 	
+
 	/**
-	 * 
-	 * @param 年份
-	 * @param 分类
-	 * @return 金额
+	 * 修改专利状态
+	 * @param s1
+	 * @param status
+	 * @throws InterruptedException 
 	 */
-	
-	private static BigDecimal countMoney(Integer y, Integer type) {
-		int money=0;
-		if (type==PatentCategoryStatus.INVENTION.getCode()) {
-			if (y>0&&y<4) {
-				money=900;
-			}else if (y>3&&y<7) {
-				money=1200;
-			}else if (y>6&&y<10) {
-				money=2000;
-			}else if (y>9&&y<13) {
-				money=4000;
-			}else if (y>12&&y<16) {
-				money=6000;
-			}else if (y>15&&y<21) {
-				money=8000;
-			}
-		} else {
-			if (y>0&&y<4) {
-				money=600;
-			}else if (y>3&&y<6) {
-				money=900;
-			}else if (y>5&&y<9) {
-				money=1200;
-			}else if (y>8&&y<11) {
-				money=2000;
+	private void updatePatentNew(List<String> list, Integer status) throws InterruptedException {
+		if (!list.isEmpty()) {
+			List<String> l2 = new ArrayList<>();
+			for (int i = 0; i < list.size(); i++) {
+				l2.add(list.get(i));
+				if (pointsDataLimit == l2.size() || i == list.size() - 1) {
+					if (l2.size() > 0) patentNewService.updateBatchStatusByid(l2, status);
+					l2.clear();
+					Thread.sleep(2000);
+				}
 			}
 		}
-		
-		return new BigDecimal(money);
+	}
+
+
+	private String StrToString(StringBuffer str, Date date, Integer status) {
+		//状态 0 未提醒 1 剩余90天 2剩余30天 3剩余20天 4剩余10天 5剩余3天 6剩余2天 7剩余1天
+		Integer days=0;
+		if (status==1) days=90;
+		else if (status==2) days=60;
+		else if (status==3) days=30;
+		else if (status==4) days=15;
+		else if (status==5) days=7;
+		if(days>0) {
+			str.append(",续费时间还剩").append(days).append("天");
+		}
+		str.append(",截止时间[").append(DateUtils.formatDate(date, AFTConstants.YYYYMMDD)).append("]请在截止时间前通知客户!");
+		return str.toString();
 	}
 	
+
 	
 	
 	
@@ -334,31 +290,5 @@ public class PatentTask {
             htmlStr = delHTMLTag(htmlStr);
             htmlStr = htmlStr.replaceAll("&nbsp;", "");
             return htmlStr;
-        }
-        
-        
-        public static void main(String[] args) {
-        	// 申请时间一月份是0。
-			Calendar sq = Calendar.getInstance();
-			sq.set(2020, 7, 29);
-			System.out.println(DateUtils.formatDate(sq.getTime(), AFTConstants.YYYYMMDD));
-			// 当前时间
-			Calendar now = Calendar.getInstance();
-			now.setTime(new Date());
-			now.set(Calendar.MILLISECOND, 0);
-			// 提醒
-			Calendar ted = Calendar.getInstance();
-			// 先获取到目前多少天数,再计算出年限
-			int d = (int) ((now.getTimeInMillis() - sq.getTimeInMillis()) / (1000 * 3600 * 24));
-			System.out.println(d);
-			int y = d / 365;
-			if (d % 365 > 0)y++;
-			System.out.println(y);
-			ted.setTime(sq.getTime());
-			ted.add(Calendar.YEAR, y);
-			System.out.println(DateUtils.formatDate(ted.getTime(), AFTConstants.YYYYMMDD));
-			// 计算相差日期
-			int count = (int) ((ted.getTimeInMillis() - now.getTimeInMillis()) / (1000 * 3600 * 24));
-			System.out.println(count);
-		}
+        }       
 }

+ 39 - 42
src/main/java/com/goafanti/common/task/ReleaseUserTask.java

@@ -1,13 +1,11 @@
 package com.goafanti.common.task;
 
-import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.UUID;
 
 import javax.annotation.Resource;
-import javax.mail.MessagingException;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -127,6 +125,7 @@ public class ReleaseUserTask {
 					if (StringUtils.isNotBlank(u.getId())) {
 						// 获取30天释放
 						userTmpList = customerService.selectWaitReleaseCustomer(u.getId(), 0);
+						customerService.pushReleaseLog(userTmpList, 0);
 						// 获取270天释放
 						if(!u.getId().equals("734092ad-6564-4021-b7ab-aab5af3a1537")){
 							userTmpList2 = customerService.selectWaitReleaseCustomer(u.getId(), 1);
@@ -134,7 +133,6 @@ public class ReleaseUserTask {
 						}
 						addUserNotice(userTmpList,userTmpList2);
 						//
-						customerService.pushReleaseLog(userTmpList, 0);
 						if (userTmpList != null && !userTmpList.isEmpty())
 							lockUserList.addAll(userTmpList);
 						if (userTmpList2 != null && !userTmpList2.isEmpty())
@@ -155,55 +153,54 @@ public class ReleaseUserTask {
 					}
 				}
 			}
-			// 获取超过90天客户,判断是否回收过,未回收则回收,已回收则释放为公共客户
-			List<userDaysBo> userChannelList =null;
-			List<userDaysBo> count =new ArrayList<userDaysBo>();
-			if (userList != null && !userList.isEmpty()) {
-				for (User u : userList) {
-					userChannelList=customerService.selectChannelUserDays(u.getId());
-					if (userChannelList!=null) {
-						count.addAll(userChannelList);
-					}
-				}
-			}
-			List<userDaysBo> hsList=new ArrayList<>();
-			List<userDaysBo> sfList=new ArrayList<>();
-			if (count != null && count.size() > 0) {
-				for (int i = 0; i < count.size(); i++) {
-					//回收
-					if (count.get(i).getRecovery()==0) {
-						hsList.add(count.get(i));
-					}else {
-						sfList.add(count.get(i));
-					}
-					if (pointsDataLimit == (hsList.size()+sfList.size()) || i == count.size() - 1) {
-						if(!hsList.isEmpty())userService.pushReleaseUserChannel(hsList,0);
-						if(!sfList.isEmpty())userService.pushReleaseUserChannel(sfList,1);
-						addChannelNotice(hsList,sfList);
-						hsList.clear();
-						sfList.clear();
-						Thread.sleep(2000);
-					}
-				}
-			}
-			List<LockingReleaseBo> lockList = customerService.selectPendinglockUserList();
-			if (lockList.size() > 0)
-				customerService.updateReleaseLock(releaseTime);
+			pushChannel(releaseTime, userList);
 		} catch (Exception e) {
 			Notice n = new Notice(UUID.randomUUID().toString(), new Date(), 0, "1",
 					NoticeStatus.TASK_PATENT_ERROR.getCode(), "==============客户释放失败================",null);
 			addNotice(n);
 			EmailBo emailBo = new EmailBo("释放客户失败", AFTConstants.ADMIN_EMAIL, "超管", "平台", "系统", devName+"释放客户失败");
-			try {
-				asyncUtils.send(emailBo);
-			} catch (UnsupportedEncodingException | MessagingException e1) {
-				e1.printStackTrace();
-			}
+			asyncUtils.send(emailBo);
 			LoggerUtils.error(getClass(), "====================客户释放失败=================");
 			LoggerUtils.error(getClass(), "客户释放失败", e);
 		}
 		LoggerUtils.debug(getClass(), "==============客户释放完成============");
 	}
+	private void pushChannel(Date releaseTime, List<User> userList) throws InterruptedException {
+		// 获取超过90天客户,判断是否回收过,未回收则回收,已回收则释放为公共客户
+		List<userDaysBo> userChannelList =null;
+		List<userDaysBo> count =new ArrayList<userDaysBo>();
+		if (userList != null && !userList.isEmpty()) {
+			for (User u : userList) {
+				userChannelList=customerService.selectChannelUserDays(u.getId());
+				if (userChannelList!=null) {
+					count.addAll(userChannelList);
+				}
+			}
+		}
+		List<userDaysBo> hsList=new ArrayList<>();
+		List<userDaysBo> sfList=new ArrayList<>();
+		if (count != null && count.size() > 0) {
+			for (int i = 0; i < count.size(); i++) {
+				//回收
+				if (count.get(i).getRecovery()==0) {
+					hsList.add(count.get(i));
+				}else {
+					sfList.add(count.get(i));
+				}
+				if (pointsDataLimit == (hsList.size()+sfList.size()) || i == count.size() - 1) {
+					if(!hsList.isEmpty())userService.pushReleaseUserChannel(hsList,0);
+					if(!sfList.isEmpty())userService.pushReleaseUserChannel(sfList,1);
+					addChannelNotice(hsList,sfList);
+					hsList.clear();
+					sfList.clear();
+					Thread.sleep(2000);
+				}
+			}
+		}
+		List<LockingReleaseBo> lockList = customerService.selectPendinglockUserList();
+		if (lockList.size() > 0)
+			customerService.updateReleaseLock(releaseTime);
+	}
 	
 	public void addNotice(Notice n ) {
 		n.setType(NoticeTypes.getType(n.getNoticeType()));

+ 23 - 3
src/main/java/com/goafanti/common/utils/AsyncUtils.java

@@ -21,15 +21,32 @@ public class AsyncUtils {
 	@Autowired
 	private NoticeMapper noticeMapper;
 	
+	
 
 	
 	public void patentSend(EmailBo bo) throws UnsupportedEncodingException, MessagingException {
-		SendEmailUtil.getInstance().patentSend(bo);
+		
 	}
 	
+	public void sendList(List<EmailBo> list) {
+		for (EmailBo emailBo : list) {
+				try {
+					SendEmailUtil.getInstance().patentSend(emailBo);
+				} catch (UnsupportedEncodingException | MessagingException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+		}
+		
+	}
 	
-	public void send(EmailBo bo) throws UnsupportedEncodingException, MessagingException {
-		SendEmailUtil.getInstance().send(bo);
+	
+	public void send(EmailBo bo){
+		try {
+			SendEmailUtil.getInstance().send(bo);
+		} catch (UnsupportedEncodingException | MessagingException e) {
+			e.printStackTrace();
+		}
 	}
 	
 	public void addNotice(Notice n ) {
@@ -59,4 +76,7 @@ public class AsyncUtils {
 		
 	}
 
+
+	
+
 }

+ 20 - 1
src/main/java/com/goafanti/common/utils/ExcelUtils.java

@@ -19,6 +19,7 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.web.multipart.MultipartFile;
 
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.customer.bo.CustomerExcelBo;
 import com.goafanti.order.bo.OrderReportBo;
 import org.apache.commons.lang3.StringUtils;
@@ -747,7 +748,7 @@ public class ExcelUtils {
                     if (HSSFDateUtil.isCellDateFormatted(cell)) {
                         Date date = cell.getDateCellValue();
                         if (date != null) {
-                            value = new SimpleDateFormat("yyyy-MM-dd").format(date);//日期格式化
+                            value = new SimpleDateFormat("yyyy/MM/dd").format(date);//日期格式化
                         } else {
                             value = "";
                         }
@@ -774,6 +775,23 @@ public class ExcelUtils {
         }
         return value.trim();
     }
+    
+	public static Date getCellDate(Cell cell) {
+		Date date=new Date();
+		  if (cell != null) {
+	            switch (cell.getCellTypeEnum()) {
+	            	case NUMERIC:  //数字
+	            		 date = cell.getDateCellValue();
+	                     break;
+	                case STRING://字符串
+	                	date = DateUtils.StringToDate(cell.getStringCellValue(), AFTConstants.YYYYMMDD);
+	                default:
+	                    date = new Date();
+	            }
+		  }
+		return date;
+
+	}
 
 	
     public static Workbook getWorkBook(MultipartFile file) {
@@ -786,6 +804,7 @@ public class ExcelUtils {
         if(file.getOriginalFilename().matches("^.+\\.(?i)(xls)$"))workbook = new HSSFWorkbook(is);
         if(file.getOriginalFilename().matches("^.+\\.(?i)(xlsx)$"))workbook = new XSSFWorkbook(is);
         } catch (IOException e) {
+        	e.getLocalizedMessage();
         }
         return workbook;
         }

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

@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.multipart.MultipartFile;
 
 import com.goafanti.common.enums.AttachmentType;
+import com.goafanti.common.error.BusinessException;
 
 public class FileUtils {
 	@Value(value = "${upload.private.path}")
@@ -273,6 +274,9 @@ public class FileUtils {
 		OutputStream out = null;
 		byte[] buffer = new byte[8 * 1024];
 		try {
+			if(!com.goafanti.common.utils.excel.FileUtils.checkAllowDownload(realFilePath)){
+                throw new BusinessException("文件名称非法,不允许下载。 ");
+            }
 			File file = new File(realFilePath);
 			in = new FileInputStream(file);
 			out = response.getOutputStream();
@@ -288,7 +292,9 @@ public class FileUtils {
 				}
 				out.write(buffer, 0, bytes);
 			}
-		} catch (IOException e) {
+		}catch (BusinessException e) {
+			LoggerUtils.fmtError(FileUtils.class, e, "名称错误:%s", e.getMessage());
+        } catch (IOException e) {
 			LoggerUtils.fmtError(FileUtils.class, e, "IO错误:%s", e.getMessage());
 		} finally {
 			try {

+ 1 - 1
src/main/java/com/goafanti/common/utils/SendEmailUtil.java

@@ -38,7 +38,7 @@ public class SendEmailUtil {
   }
 	public static final String HOST = "smtp.163.com";
 	public static final String PORT = "465";
-	public static final String AUTH_USER_NICKNAME = "湖南科德信息咨询有限公司";
+	public static final String AUTH_USER_NICKNAME = "湖南科德信息咨询集团有限公司";
 	public static final String FROM = "13875952633@163.com";// 发件人的email
 	public static final String PWD = "kede2018";// 发件人密码
 	public static final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";

+ 4 - 5
src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java

@@ -52,7 +52,6 @@ import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
 import org.apache.poi.xssf.usermodel.XSSFDataValidation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
 
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
@@ -74,7 +73,6 @@ public class NewExcelUtil<T> {
 	 */
 	public static final int sheetSize = 65536;
 	
-	@Value(value = "upload.path")
 	public  String downloadPath = "";
 	
 	
@@ -184,7 +182,8 @@ public class NewExcelUtil<T> {
 		try {
 			OutputStream out = response.getOutputStream();
 			// 取出一共有多少个sheet.
-			double sheetNo = Math.ceil(list.size() / sheetSize);
+			int sheetNo = (int) Math.ceil(list.size() / sheetSize);
+			
 			String dateFilename =DateFilename(sheetName);
 			for (int index = 0; index <= sheetNo; index++) {
 				createSheet(sheetNo, index);
@@ -252,7 +251,7 @@ public class NewExcelUtil<T> {
 		OutputStream out = null;
 		try {
 			// 取出一共有多少个sheet.
-			double sheetNo = Math.ceil(list.size() / sheetSize);
+			int sheetNo = (int) Math.ceil(list.size() / sheetSize);
 			for (int index = 0; index <= sheetNo; index++) {
 				createSheet(sheetNo, index);
 				// 产生一行
@@ -807,7 +806,7 @@ public class NewExcelUtil<T> {
 	 * @param sheetNo sheet数量
 	 * @param index   序号
 	 */
-	public void createSheet(double sheetNo, int index) {
+	public void createSheet(int sheetNo, int index) {
 		this.sheet = wb.createSheet();
 		this.styles = createStyles(wb);
 		// 设置工作表的名称.

+ 1 - 0
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -1155,6 +1155,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			user.setShareType(AFTConstants.USER_SHARE_PRIVATE);
 			user.setInformationMaintainer(TokenManager.getAdminId());
 			user.setSource(2);// 客户来源设置为领取
+			user.setTransferTime(now);
 			flag = addUserLock(uid, TokenManager.getAdminId(), now, uList); // 指定用户锁定客户
 			addUserTransferLog(uid, TokenManager.getAdminId(), 1, null, now, uList);
 			if (flag <= 0)

+ 4 - 23
src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java

@@ -1,6 +1,5 @@
 package com.goafanti.order.service.impl;
 
-import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Calendar;
@@ -10,7 +9,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
-import javax.mail.MessagingException;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -351,13 +349,8 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 			if(StringUtils.isNotBlank(o.getEmail())){
 				
 				EmailBo emailBo = new EmailBo("同意退单", o.getEmail(), o.getSalesmanName(), a.getDepartmentName(), a.getName(), content);
-				try {
-					asyncUtils.send(emailBo);
-				} catch (UnsupportedEncodingException e) {
-					e.printStackTrace();
-				} catch (MessagingException e) {
-					e.printStackTrace();
-				}
+				asyncUtils.send(emailBo);
+				
 			}
 			//发送站内消息
 			//addNotic(o.getOrderNo(),NoticeStatus.ORDER_REFUND.getCode(),o.getSalesmanId());//给营销员
@@ -369,13 +362,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 					//发邮件给技术员
 					if(StringUtils.isNotBlank(tOrderTask.getEmail())){
 						EmailBo emailBo = new EmailBo("同意退单", tOrderTask.getEmail(), tOrderTask.getName(), a.getDepartmentName(), a.getName(), content);
-						try {
-							asyncUtils.send(emailBo);
-						} catch (UnsupportedEncodingException e) {
-							e.printStackTrace();
-						} catch (MessagingException e) {
-							e.printStackTrace();
-						}
+						asyncUtils.send(emailBo);
 					}
 				}
 			}
@@ -395,13 +382,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 				sale = sale.substring(0,sale.indexOf(","));
 				if(email.matches("[\\w\\.\\-]+@([\\w\\-]+\\.)+[\\w\\-]+")){//email格式校验
 					EmailBo emailBo = new EmailBo("拒绝退单",email, sale, a.getDepartmentName(), a.getName(), content);
-					try {
-						asyncUtils.send(emailBo);
-					} catch (UnsupportedEncodingException e) {
-						e.printStackTrace();
-					} catch (MessagingException e) {
-						e.printStackTrace();
-					}
+					asyncUtils.send(emailBo);
 				}
 			}
 		}

+ 12 - 2
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -129,6 +129,7 @@ import com.goafanti.organization.bo.OrganizationListOut;
 import com.goafanti.organization.bo.OutPaymentNode;
 import com.goafanti.organization.bo.OutThirdPartyCompany;
 import com.goafanti.organization.bo.ProjectTypePuls;
+import com.goafanti.patent.service.PatentNewService;
 
 @Service
 @EnableAsync
@@ -188,6 +189,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Autowired
 	private OfficialFeePriceMapper	officialFeePriceMapper;
 	@Autowired
+	private PatentNewService	patentNewService;
+	@Autowired
 	private AsyncUtils	asyncUtils;
 	
 	@Value(value = "${mobileRemindCodeTemplate}")
@@ -274,6 +277,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Override
 	public int updateOrderTask(TOrderTask t) {
 		TOrderTask use=tOrderTaskMapper.selectByPrimaryKey(t.getId());
+		boolean flag=false;
 		if(use.getCheckStatus()==1) {
 			t.setCheckStatus(2);
 			ProjcetCheckLog log=new ProjcetCheckLog();
@@ -290,9 +294,11 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				}
 				if (t.getOfficialCost()!=null&&use.getOfficialCost()!=t.getOfficialCost()) {
 					str.append(",").append("有无官费");
+						flag=true;
 				}
 				if (t.getCostReduction()!=null&&use.getCostReduction()!=t.getCostReduction()) {
 					str.append(",").append("有无费减");
+						flag=true;
 				}
 					str.append("。");
 			}
@@ -311,7 +317,11 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			}
 			projcetCheckLogMapper.insertSelective(log);
 		}
-		return tOrderTaskMapper.updateByPrimaryKeySelective(t);
+		int  i=tOrderTaskMapper.updateByPrimaryKeySelective(t);
+		if (flag) {
+			patentNewService.updateCostReduction(t.getId());
+		}
+		return i; 
 	}
 
 
@@ -1349,7 +1359,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			tCount=tCount.add(new BigDecimal(op.getTotalAmount()));
 		}
 		if(type==1) {
-			ProjectTypePuls tt=thirdPartyCompanyMapper.selectByTidGetDtails(tid);
+			ProjectTypePuls tt=tOrderTaskMapper.selectByTidGetDtails(tid);
 			if (tt.getOfficialCost()==1) {
 				if (tt.getCostReduction()==1) {
 					tCount=tCount.add(tt.getProportion85().multiply(new BigDecimal(tt.getQuantity())));

+ 2 - 2
src/main/java/com/goafanti/order/service/impl/OrderReceivablesServiceImpl.java

@@ -12,6 +12,7 @@ import javax.annotation.Resource;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
@@ -333,7 +334,6 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
 	
 	
 	
-	@SuppressWarnings("deprecation")
 	@Override
 	public void batchListReceivables(MultipartFile file) {
 		 //获得Workbook工作薄对象
@@ -361,7 +361,7 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
     			}
     			boolean flag = false;
     			for(Cell c:r){
-    				if(c.getCellType() != Cell.CELL_TYPE_BLANK){
+    				if(c.getCellTypeEnum() != CellType.BLANK){
     					flag = true;
     					break;
     				}

+ 0 - 1
src/main/java/com/goafanti/organization/bo/outPaymentListFinance.java

@@ -3,7 +3,6 @@ package com.goafanti.organization.bo;
 import java.math.BigDecimal;
 
 import com.goafanti.common.utils.excel.Excel;
-import com.goafanti.common.utils.excel.ExcelConstant;
 
 public class outPaymentListFinance extends outPaymentList {
 		

+ 7 - 1
src/main/java/com/goafanti/organization/service/impl/OrganizationServiceImpl.java

@@ -1,5 +1,6 @@
 package com.goafanti.organization.service.impl;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -25,6 +26,8 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
 	private OrganizationManagementMapper organizationManagementMapper;
 	@Autowired
 	private TOrderMidMapper	tOrderMidMapper;
+	
+	List<OrganizationListOut> depList =new ArrayList<OrganizationListOut>();
 	@Override
 	public Pagination<OrganizationListOut> listOrganizationManagement(OrganizationListOut olo, Integer pageNo,
 			Integer pageSize) {
@@ -52,7 +55,10 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
 	}
 	@Override
 	public List<OrganizationListOut> selectSuperId(Integer i) {
-		return organizationManagementMapper.selectSuperId(i);
+		if (depList.isEmpty()) {
+			depList=organizationManagementMapper.selectSuperId(i);
+		}
+		return depList;
 	}
 	/**
 	 *   XXIn form 提交 ,bo包中

+ 4 - 9
src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java

@@ -1,6 +1,5 @@
 package com.goafanti.organization.service.impl;
 
-import java.io.UnsupportedEncodingException;
 import java.lang.reflect.InvocationTargetException;
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -11,7 +10,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
-import javax.mail.MessagingException;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.beanutils.BeanUtils;
@@ -112,6 +110,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 	@Autowired
 	private AsyncUtils	asyncUtils;
 	
+	
 
 
 	@Override
@@ -361,7 +360,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 			op.setInitialUnitPrice(pn.getUnitPrice().toString());
 			op.setInitialPaymentAmount(pn.getPartyAmount().toString());
 		}else if (type==2) {
-			ProjectTypePuls tt=thirdPartyCompanyMapper.selectByTidGetDtails(tp.getTid());
+			ProjectTypePuls tt=tOrderTaskMapper.selectByTidGetDtails(tp.getTid());
 			op.setInitialQuantity(tt.getQuantity());
 			if (tt.getCostReduction()==1) {
 				op.setInitialUnitPrice(tt.getProportion85().toEngineeringString());
@@ -530,11 +529,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 		n.setReaded(0);//未读
 		asyncUtils.addNotice(n);
 		if(StringUtils.isNotBlank(a.getEmail())) {
-			try {
-				asyncUtils.send(bo);
-			} catch (UnsupportedEncodingException | MessagingException e) {
-				e.printStackTrace();
-			}
+			asyncUtils.send(bo);
 		}
 	}
 
@@ -938,7 +933,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 				PaymentNode pn=paymentNodeMapper.selectByPrimaryKey(p.getNodeId());
 				count=pn.getUnitPrice().multiply(new BigDecimal(p.getQuantity()));
 			}else if (p.getChooseType()==2) {
-				ProjectTypePuls ot=thirdPartyCompanyMapper.selectByTidGetDtails(p.getTid());
+				ProjectTypePuls ot=tOrderTaskMapper.selectByTidGetDtails(p.getTid());
 				if (ot.getCostReduction()==0) {
 					count=ot.getOfficialAmount().multiply(new BigDecimal(p.getQuantity()));
 				}else {

+ 46 - 16
src/main/java/com/goafanti/patent/bo/PatentNewBo.java

@@ -16,10 +16,9 @@ public class PatentNewBo extends PatentNew{
 
 	@Excel(name = "专利编号")
 	private String patentNo;
-	
 	@Excel(name = "专利名称")
 	private String name;
-	@Excel(name = "类型", readConverterExp="0=发明专利,1=使用新型,2=外观设计")
+	@Excel(name = "类型", readConverterExp="0=发明专利,1=用新型,2=外观设计")
 	private Integer type;
 	@Excel(name = "申请日期")
 	private String applyDates;
@@ -35,14 +34,20 @@ public class PatentNewBo extends PatentNew{
 	private Integer salesmanRemind;
 	@Excel(name = "email")
 	private String email;
-	@Excel(name = "年费/滞纳金/恢复")
-	private BigDecimal amountCount;
+	@Excel(name = "年费")
+	private BigDecimal patentAmount;
+	@Excel(name = "滞纳金")
+	private BigDecimal delayingAmount;
+	@Excel(name = "恢复金")
+	private BigDecimal recoveryAmount;
 	@Excel(name = "客户名称")
 	private String userName;
 	@Excel(name = "项目名称")
 	private String projectName;
 	@Excel(name = "项目编号")
 	private Integer tid;
+	@Excel(name = "费减",readConverterExp = "0=无费减,1=有费减")
+	private Integer costReduction;
 	@Excel(name = "营销员")
 	private String salesmanName;
 	@Excel(name = "咨询师")
@@ -57,12 +62,36 @@ public class PatentNewBo extends PatentNew{
 	private String aname;
 	private String updateTimes;
 	private String startDate;
-	private String endDate;
+	private String endDates;
 	private String departmentId;
 	private String createStart;
 	private String createEnd;
+	private Integer isFollow;
 	
-	
+	public Integer getCostReduction() {
+		return costReduction;
+	}
+	public void setCostReduction(Integer costReduction) {
+		this.costReduction = costReduction;
+	}
+	public BigDecimal getPatentAmount() {
+		return patentAmount;
+	}
+	public void setPatentAmount(BigDecimal patentAmount) {
+		this.patentAmount = patentAmount;
+	}
+	public BigDecimal getDelayingAmount() {
+		return delayingAmount;
+	}
+	public void setDelayingAmount(BigDecimal delayingAmount) {
+		this.delayingAmount = delayingAmount;
+	}
+	public BigDecimal getRecoveryAmount() {
+		return recoveryAmount;
+	}
+	public void setRecoveryAmount(BigDecimal recoveryAmount) {
+		this.recoveryAmount = recoveryAmount;
+	}
 	public String getPatentNo() {
 		return patentNo;
 	}
@@ -111,12 +140,7 @@ public class PatentNewBo extends PatentNew{
 	public void setEmail(String email) {
 		this.email = email;
 	}
-	public BigDecimal getAmountCount() {
-		return amountCount;
-	}
-	public void setAmountCount(BigDecimal amountCount) {
-		this.amountCount = amountCount;
-	}
+	
 	public String getProjectName() {
 		return projectName;
 	}
@@ -171,11 +195,11 @@ public class PatentNewBo extends PatentNew{
 	public void setStartDate(String startDate) {
 		this.startDate = startDate;
 	}
-	public String getEndDate() {
-		return endDate;
+	public String getEndDates() {
+		return endDates;
 	}
-	public void setEndDate(String endDate) {
-		this.endDate = endDate;
+	public void setEndDates(String endDates) {
+		this.endDates = endDates;
 	}
 	public String getDepName() {
 		return depName;
@@ -219,4 +243,10 @@ public class PatentNewBo extends PatentNew{
 	public void setTechName(String techName) {
 		this.techName = techName;
 	}
+	public Integer getIsFollow() {
+		return isFollow;
+	}
+	public void setIsFollow(Integer isFollow) {
+		this.isFollow = isFollow;
+	}
 }

+ 80 - 16
src/main/java/com/goafanti/patent/controller/AdminPatentNewApiController.java

@@ -5,6 +5,7 @@ import java.text.SimpleDateFormat;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -12,12 +13,15 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.multipart.MultipartFile;
 
+import com.goafanti.admin.service.AttachmentService;
 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.AttachmentType;
+import com.goafanti.common.model.Attachment;
+import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.StringUtils;
-import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.patent.bo.PatentNewBo;
 import com.goafanti.patent.service.PatentNewService;
 
@@ -28,6 +32,8 @@ public class AdminPatentNewApiController extends CertifyApiController {
 
 	@Resource
 	private PatentNewService patentNewService;
+	@Resource
+	private AttachmentService	attachmentService;
  
 	
 	/**
@@ -66,20 +72,15 @@ public class AdminPatentNewApiController extends CertifyApiController {
 	@RequestMapping(value = "/updatePatentNew", method = RequestMethod.POST)
 	public Result updatePatentNew(PatentNewBo p){
 		Result res = new Result();
-		if (StringUtils.isBlank(p.getPatentNo())|| StringUtils.isBlank(p.getName())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "专利", "专利"));
-			return res;
+		if (p.getApplyDates()!=null) {
+			p.setApplyDate(DateUtils.StringToDate(p.getApplyDates(),AFTConstants.YYYYMMDD));
 		}
-		if ( StringUtils.isBlank(p.getEmail())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "邮箱", "邮箱"));
-			return res;
+		if(p.getAuthorizationDates()!=null) {
+			p.setAuthorizationDate(DateUtils.StringToDate(p.getAuthorizationDates(),AFTConstants.YYYYMMDD));
 		}
-		SimpleDateFormat sdf = new SimpleDateFormat( AFTConstants.YYYYMMDD);
-		try {
-			p.setApplyDate(sdf.parse(p.getApplyDates()));
-			p.setAuthorizationDate(sdf.parse(p.getAuthorizationDates()));
-		} catch (ParseException e) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "时间", "时间"));
+		if (p.getTid()!=null&&patentNewService.checkTid(p.getTid())) {
+			StringBuffer str=new StringBuffer("项目").append("[").append(p.getTid()).append("]"); 
+			res.getError().add(buildError(ErrorConstants.DATA_EMPTY_ERROR, str.toString(), str.toString()));
 			return res;
 		}
 		return res.data(patentNewService.updatePatenNew(p));
@@ -95,7 +96,7 @@ public class AdminPatentNewApiController extends CertifyApiController {
 	
 	
 	/**
-	 * 专利列表
+	 * 专利日志列表
 	 */
 	@RequestMapping(value = "/selectPatentNewLog", method = RequestMethod.GET)
 	public Result selectPatentNew(Integer id){
@@ -116,7 +117,7 @@ public class AdminPatentNewApiController extends CertifyApiController {
 	}
 	
 	/**
-	 * 专利列表
+	 * 导出专利列表
 	 */
 	@RequestMapping(value = "/export", method = RequestMethod.GET)
 	public Result export(PatentNewBo p,Integer pageSize,Integer pageNo){
@@ -125,6 +126,30 @@ public class AdminPatentNewApiController extends CertifyApiController {
 	}
 	
 	/**
+	 * 导出专利列表
+	 */
+	@RequestMapping(value = "/exportTemplate", method = RequestMethod.GET)
+	public Result export(HttpServletResponse response, String sign){
+        Result res = new Result();
+        AttachmentType attachmentType = AttachmentType.getField(sign);
+        if (attachmentType == AttachmentType.NEW_PATENT_TEMPLATE) {
+            String fileName = "";
+            Attachment af = attachmentService.selectByReceivbles(sign);
+            if (null == af) {
+                res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "", "找不到文件!"));
+            } else {
+                String path = af.getFilePath();
+                String suffix = path.substring(path.lastIndexOf("."));
+                fileName = AttachmentType.NEW_PATENT_TEMPLATE.getDesc() + suffix;
+                downloadFile(response, fileName, path);
+            }
+        } else {
+            res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
+        }
+        return res;
+    }
+	
+	/**
 	 * 	Excel批量导入专利
      * 
      * @param response
@@ -143,9 +168,48 @@ public class AdminPatentNewApiController extends CertifyApiController {
         	  res.getError().add(buildError("格式不正确","格式不正确"));
         	  return res;
           }
-    	patentNewService.importTemplate(file);
+    	patentNewService.pushImportTemplate(file);
          res.data(1); 
     	return res;
     }
+    
+    
+    /**
+     * 专利缴费详情
+     * @param id
+     * @return
+     */
+    @RequestMapping(value = "/patentPaymentDetails",method = RequestMethod.GET)
+    public Result patentPaymentDetails(Integer id) {
+    	Result res =new Result();
+    	if (id==null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"编号"));
+			return res;
+		}
+    	res.data(patentNewService.pushPatentPaymentDetails(id));
+    	return res;
+    }
+    
+    /**
+     * 批量操作
+     * @param ids
+     * @param type 0 标记已通知 1批量发邮件 2转给营销员
+     * @return
+     */
+    @RequestMapping(value = "/updateBatch",method = RequestMethod.POST)
+    public Result updateBatch(String ids,Integer type,String aid) {
+    	Result res =new Result();
+    	if (ids==null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"编号"));
+			return res;
+		}
+    	if (type==null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"操作类型"));
+			return res;
+		}
+    	res.data(patentNewService.updateBatch(ids, type,aid));
+    	return res;
+    }
+    
 	
 }

+ 78 - 0
src/main/java/com/goafanti/patent/enums/PatentType.java

@@ -0,0 +1,78 @@
+package com.goafanti.patent.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum PatentType {
+	/**0实用新型 1发明专利 2外观专利**/
+	 SYXX(0,"实用新型"),
+	 /** 已分派 **/
+	 FMZL(1,"发明专利"),
+	 /** 材料已启动 **/
+	 WGZL(2,"外观专利"),
+	/** 无效 **/
+	NOT(10, "无效");
+	
+	private PatentType(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, PatentType> status = new HashMap<Integer, PatentType>();
+
+	static {
+		for (PatentType value : PatentType.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	public static PatentType getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return NOT;
+	}
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+	public static String getValueByCode(Integer code){
+        for(PatentType patentType:PatentType.values()){
+            if(code.equals(patentType.getCode())){
+                return patentType.getDesc();
+            }
+        }
+        return  null;
+    }
+	
+	public static Integer getCodeByDesc(String desc){
+        for(PatentType patentType:PatentType.values()){
+            if(desc.equals(patentType.getDesc())){
+                return patentType.getCode();
+            }
+        }
+        return  NOT.code;
+    }
+	
+	public static String getCountStr() {
+		StringBuffer str=new StringBuffer();
+		for (PatentType value : PatentType.values()) {
+			str.append(value.getCode()).append("=").append(value.getDesc()).append(",");
+		}
+		return str.substring(0, str.length()-1);
+		
+	}
+	private Integer	code;
+	private String	desc;
+	public Integer getCode() {
+		return code;
+	}
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+	public String getDesc() {
+		return desc;
+	}
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+	
+}

+ 25 - 3
src/main/java/com/goafanti/patent/service/PatentNewService.java

@@ -1,5 +1,6 @@
 package com.goafanti.patent.service;
 
+import java.util.Date;
 import java.util.List;
 
 import org.springframework.web.multipart.MultipartFile;
@@ -13,11 +14,11 @@ public interface PatentNewService {
 
 	int addPatenNew(PatentNew p);
 
-	int updatePatenNew(PatentNew p);
+	int updatePatenNew(PatentNewBo p);
 
 	Pagination<PatentNewBo> selectPatentNew(PatentNewBo p,Integer pageSize, Integer pageNo);
 	
-	List<PatentNew> AllselectStartPatentNew();
+	List<PatentNewBo> AllselectStartPatentNew();
 	
 	
 	int addPatenNewLog(PatentNewLog pl);
@@ -29,8 +30,29 @@ public interface PatentNewService {
 
 	List<PatentNewLog> selectPatentNewLog(Integer id);
 
-	void importTemplate(MultipartFile file);
 
 	Object export(PatentNewBo p, Integer pageSize, Integer pageNo);
 
+	void pushImportTemplate(MultipartFile file);
+
+
+	Object pushPatentPaymentDetails(Integer id);
+
+	  
+	Object updateBatch(String ids, Integer type,String aid);
+
+	void updateBatchStatusByid(List<String> l2, Integer status);
+
+	void pushResetPatentNew(List<String> list);
+
+	boolean checkTid(Integer tid);
+
+	int countDays(Date endDate);
+	
+	Integer getSatus(Date endDate);
+
+	void updateCostReduction(Integer id);
+
+
+
 }

+ 513 - 22
src/main/java/com/goafanti/patent/service/impl/PatentNewServiceImpl.java

@@ -3,41 +3,77 @@ package com.goafanti.patent.service.impl;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
+import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.PatentNewLogMapper;
 import com.goafanti.common.dao.PatentNewMapper;
+import com.goafanti.common.dao.PatentPaymentDetailsMapper;
+import com.goafanti.common.dao.PatentYearPaymentMapper;
+import com.goafanti.common.dao.TOrderTaskMapper;
+import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.error.BusinessException;
+import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.PatentNew;
 import com.goafanti.common.model.PatentNewLog;
+import com.goafanti.common.model.PatentPaymentDetails;
+import com.goafanti.common.model.PatentYearPayment;
+import com.goafanti.common.model.TOrderTask;
+import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.ExcelUtils;
+import com.goafanti.common.utils.SendEmailUtil;
 import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.order.bo.TemporaryReceivablesBo;
 import com.goafanti.patent.bo.PatentNewBo;
+import com.goafanti.patent.enums.PatentType;
 import com.goafanti.patent.service.PatentNewService;
+
+import cn.jiguang.common.utils.StringUtils;
+
 @Service
 public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> implements PatentNewService {
 	@Autowired
 	private PatentNewMapper patentNewMapper;
 	@Autowired
 	private PatentNewLogMapper patentNewLogMapper;
+	@Autowired
+	private TOrderTaskMapper	tOrderTaskMapper;
+	@Autowired
+	private PatentPaymentDetailsMapper	patentPaymentDetailsMapper;
+	@Autowired
+	private PatentYearPaymentMapper	patentYearPaymentMapper;
+	@Autowired
+	private AsyncUtils asyncUtils;
+	@Autowired
+	private AdminMapper	adminMapper;
+	
+	private List<PatentYearPayment> patentYear=new ArrayList<PatentYearPayment>(); 
+
+	@Value(value = "${upload.path}")
+	private String uploadPath=null;
 
 	@Override
 	public int addPatenNew(PatentNew p) {
@@ -47,9 +83,107 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 	}
 
 	@Override
-	public int updatePatenNew(PatentNew p) {
+	public int updatePatenNew(PatentNewBo p) {
+		Admin a = adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
+		PatentNew pn=patentNewMapper.selectByPrimaryKey(p.getId());
+		StringBuffer str=new StringBuffer(a.getName());
+		if (!p.getApplyDate().equals(pn.getApplyDate()) 
+				|| p.getType() != pn.getType()
+				|| ! p.getTid().equals(pn.getTid())) {
+			p.setYears(getyear(p));
+			p.setPatentAmount(sumAmout(p.getType(),p.getTid(),p.getYears()));
+			 if(p.getPatentAmount()==null) {
+		        	throw new BusinessException(new Error("年份超过最大可提醒日期。"));
+		        }
+			p.setStatus(getSatus(p.getEndDate()));
+			sumYears(p);
+		}
+		addPatentNewLog(p,pn,str);
 		return patentNewMapper.updateByPrimaryKeySelective(p);
 	}
+	
+	private void addPatentNewLog(PatentNewBo p, PatentNew pn, StringBuffer str) {
+		PatentNewLog pl = new PatentNewLog();
+		pl.setPid(p.getId());
+		boolean flag=false;
+		StringBuffer s=new StringBuffer();
+		if (p.getPatentNo()!=null&&!p.getPatentNo().equals(pn.getPatentNo())) {
+			s.append("[专利号:").append(pn.getPatentNo()).append(" => ").append(p.getPatentNo()).append("],");
+			flag=true;
+		}
+		if (p.getName()!=null&&!p.getName().equals(pn.getName())) {
+			s.append("[专利名称:").append(pn.getName()).append(" => ").append(p.getName()).append("],");
+			flag=true;
+		}
+		if (p.getType()!=null&&!p.getType().equals(pn.getType())) {
+			// 0=发明专利,1=使用新型,2=外观设计
+			String type = getPatentType(p.getType());
+			String type1 = getPatentType(pn.getType());
+			s.append("[专利类型:").append(type1).append(" => ").append(type).append("],");
+			flag=true;
+		}
+		if (p.getTid()!=null&&!p.getTid().equals(pn.getTid())) {
+			s.append("[项目编号:").append(pn.getTid()).append(" => ").append(p.getTid()).append("],");
+			flag=true;
+		}
+		if (p.getApplyDate()!=null&&!p.getApplyDate().equals(pn.getApplyDate())) {
+			String date = DateUtils.formatDate(p.getApplyDate(), AFTConstants.YYYYMMDD);
+			String date1="";
+			if(pn.getApplyDate()!=null) {
+				date1 = DateUtils.formatDate(pn.getApplyDate(), AFTConstants.YYYYMMDD);
+			}
+			s.append("[申请日期:").append(date1).append(" => ").append(date).append("],");
+			flag=true;
+		}
+		if (p.getAuthorizationDate()!=null&&!p.getAuthorizationDate().equals(pn.getAuthorizationDate())) {
+			String date = DateUtils.formatDate(p.getAuthorizationDate(), AFTConstants.YYYYMMDD);
+			String date1="";
+			if(pn.getAuthorizationDate()!=null) {
+				date1 = DateUtils.formatDate(pn.getAuthorizationDate(), AFTConstants.YYYYMMDD);
+			}
+			s.append("[授权日期:").append(date1).append(" => ").append(date).append("],");
+			flag=true;
+		}
+		if (p.getEmail()!=null&&!p.getEmail().equals(pn.getEmail())) {
+			s.append("[Email:").append(pn.getEmail()).append(" => ").append(p.getEmail()).append("],");
+			flag=true;
+		}
+		if (p.getDelayingAmount()!=null&&p.getDelayingAmount().compareTo(pn.getDelayingAmount()) != 0) {
+			s.append("[滞纳金:").append(pn.getDelayingAmount().stripTrailingZeros().toPlainString()).append(" => ")
+					.append(p.getDelayingAmount().stripTrailingZeros().toPlainString()).append("],");
+			flag=true;
+		}
+		if (p.getRecoveryAmount()!=null&&p.getRecoveryAmount().compareTo(pn.getRecoveryAmount()) != 0) {
+			s.append("[权利恢复费:").append(pn.getRecoveryAmount().stripTrailingZeros().toPlainString()).append(" => ")
+					.append(p.getRecoveryAmount().stripTrailingZeros().toPlainString()).append("],");
+			flag=true;
+		}
+		if (p.getAnnualFeeStatus()!=null&&!p.getAnnualFeeStatus().equals(pn.getAnnualFeeStatus())) {
+			s.append("[年费状态:").append(pn.getAnnualFeeStatus() == 1 ? "已缴费" : "未缴费").append(" => ")
+					.append(p.getAnnualFeeStatus() == 1 ? "已缴费" : "未缴费").append("],");
+			flag=true;
+		}
+		if (p.getHolders()!=null&&!p.getHolders().equals(pn.getHolders())) {
+			s.append("[权利人:").append(pn.getHolders()).append(" => ").append(p.getHolders()).append("],");
+			flag=true;
+		}
+		if (p.getInventor()!=null&&!p.getInventor().equals(pn.getInventor())) {
+			s.append("[发明人:").append(pn.getInventor()).append(" => ").append(p.getInventor()).append("],");
+			flag=true;
+		}
+		if (flag) {
+			str.append("修改了:").append(s);
+			pl.setContent(str.toString().substring(0, str.toString().length()-1));
+			patentNewLogMapper.insertSelective(pl);
+		}
+	}
+
+	private String getPatentType(Integer type) {
+		if (type==0) return "发明专利";
+		else if (type==1) return "实用新型";
+		else if (type==2) return "外观设计";
+		return null;
+	}
 
 	@SuppressWarnings("unchecked")
 	@Override
@@ -58,8 +192,18 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		if (pageNo == null || pageNo < 0) pageNo = 1;
 		if (pageSize == null || pageSize < 0)	pageSize = 10;
 		pushParams(p, params);
-		return (Pagination<PatentNewBo>) findPage("selectPatentNewList", "selectPatentNewCount", params, pageNo,
+		Pagination<PatentNewBo> pa=(Pagination<PatentNewBo>) findPage("selectPatentNewList", "selectPatentNewCount", params, pageNo,
 				pageSize);
+		List<PatentNewBo> list=(List<PatentNewBo>) pa.getList();
+		 String aid=TokenManager.getAdminId();
+		for (PatentNewBo pn : list) {
+			if (aid.equals(pn.getAid())) {
+				pn.setIsFollow(1);
+			}else {
+				pn.setIsFollow(0);
+			}
+		}
+		return pa;
 	}
 
 	private void pushParams(PatentNewBo p, Map<String, Object> params) {
@@ -73,6 +217,15 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		if(p.getCreateStart()!=null)params.put("createStart", p.getCreateStart());
 		if(p.getCreateEnd()!=null)params.put("createEnd", p.getCreateEnd()+" 23:59:59");
 		if(p.getType()!=null)params.put("type", p.getType());
+		if(p.getDepName()!=null)params.put("depName", p.getDepName());
+		if(p.getAnnualFeeStatus()!=null)params.put("annualFeeStatus", p.getAnnualFeeStatus());
+		if(p.getUserName()!=null)params.put("userName", p.getUserName());
+		if(p.getSalesmanRemind()!=null)params.put("salesmanRemind", p.getSalesmanRemind());
+		if(p.getIsFollow()!=null) {
+			params.put("isFollow", p.getIsFollow());
+		}else {
+			params.put("isFollow", 0);
+		}
 		params.put("aid", TokenManager.getAdminId());
 		if (TokenManager.hasRole(AFTConstants.SUPERADMIN) || TokenManager.hasRole(AFTConstants.PATENT_AUDITOR)) {
 			params.put("shiro", 2);
@@ -84,7 +237,7 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 	}
 
 	@Override
-	public List<PatentNew> AllselectStartPatentNew() {
+	public List<PatentNewBo> AllselectStartPatentNew() {
 		return patentNewMapper.AllselectStartPatentNew();
 	}
 
@@ -109,18 +262,16 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 	}
 
 	@Override
-	public void importTemplate(MultipartFile file) {
+	public void pushImportTemplate(MultipartFile file) {
 		 //获得Workbook工作薄对象
         Workbook workbook = ExcelUtils.getWorkBook(file);
         //创建一个对象,用来存储数据
-        List<TemporaryReceivablesBo> list=new ArrayList<>();
         if(workbook != null){
         	//获得当前sheet工作表
     		Sheet sheet = workbook.getSheetAt(0);
     		if(sheet == null){
     			return;
     		}
-    		
     		//获得当前sheet的开始行
     		int firstRowNum = sheet.getFirstRowNum();
     		//获得当前sheet的结束行
@@ -135,7 +286,7 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
     			}
     			boolean flag = false;
     			for(Cell c:r){
-    				if(c.getCellType() != Cell.CELL_TYPE_BLANK){
+    				if(c.getCellTypeEnum() != CellType._NONE){
     					flag = true;
     					break;
     				}
@@ -154,6 +305,9 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
     		if (lastRowNum<2) {
     			throw new BusinessException(new Error("未找到正确的参数。"));
 			}
+    		List<PatentNew> list=new ArrayList<>();
+    		List<Notice> nl=new ArrayList<Notice>();
+    		String str= new String();
     		//循环除了第2行的所有行
     		for(int rowNum = firstRowNum+2;rowNum <= lastRowNum;rowNum++){
         		//获得当前行
@@ -166,43 +320,238 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 	        	//获得当前行的列数
 	        	int lastCellNum = row.getLastCellNum();
 		        //循环当前行 cellNum = (firstCellNum+1) 则是除开第一例
-	        	TemporaryReceivablesBo trb=new TemporaryReceivablesBo();
+	        	PatentNew trb=new PatentNew();
 		        for(int cellNum = (firstCellNum); cellNum < lastCellNum;cellNum++){
 			        Cell cell = row.getCell(cellNum);
 			    	try {
 			        switch (cellNum) {
 					case 0:
-						trb.setFinancialPayNo(ExcelUtils.getCellValue(cell));
+						trb.setPatentNo(ExcelUtils.getCellValue(cell));
 						break;
 					case 1:
-						trb.setOrderNo(ExcelUtils.getCellValue(cell).trim());
+						trb.setName(ExcelUtils.getCellValue(cell).trim());
 						break;
 					case 2:
-						trb.setCorporateName(ExcelUtils.getCellValue(cell));
+						trb.setType(PatentType.getCodeByDesc(ExcelUtils.getCellValue(cell)));
 						break;
 					case 3:
-						trb.setAmount(new BigDecimal((ExcelUtils.getCellValue(cell).equals("")?"0":ExcelUtils.getCellValue(cell))));
+						trb.setApplyDate(ExcelUtils.getCellDate(cell));
 						break;
 					case 4:
-						trb.setReceivablesTime(DateUtils.StringToDate(ExcelUtils.getCellValue(cell), AFTConstants.YYYYMMDD));
+						trb.setHolders(ExcelUtils.getCellValue(cell));
 						break;
 					case 5:
-						trb.setRemarks(ExcelUtils.getCellValue(cell));
+							trb.setAuthorizationDate(ExcelUtils.getCellDate(cell));
 						break;
-					}
+					case 6:
+						trb.setInventor(ExcelUtils.getCellValue(cell));
+						break;
+					case 7:
+						trb.setEmail(ExcelUtils.getCellValue(cell));
+						break;
+					case 8:
+						str=ExcelUtils.getCellValue(cell);
+						if (StringUtils.isNotEmpty(str)) {
+							trb.setTid(Integer.parseInt(str));
+						}
+						break;
+					
+			        }
 			    	} catch (Exception e) {
-			    		throw new BusinessException(new Error("表格第"+(rowNum+1)+"行输入内容不正确。"));
+			    		e.printStackTrace();
+			    		throw new BusinessException(new Error("表格第"+(rowNum+1)+"行"+cellNum+"列输入内容不正确。"));
+					}
+			    	if (cellNum==0&&trb.getPatentNo()!=null) {
+						int i=patentNewMapper.selectByPatenNo(trb.getPatentNo());
+						if (i>0) {
+							throw new BusinessException(new Error("表格第"+(rowNum+1)+"行[专利编号]系统已存在。"));
+						}
 					}
 		        }
+		        for (PatentNew pt : list) {
+		        	if (pt.getPatentNo().equals(trb.getPatentNo())) {
+		        		throw new BusinessException(new Error("表格第"+(rowNum+1)+"行[专利编号]重复导入。"));
+		        	}
+		        }
+		        if (trb.getType()==10) {
+		        	throw new BusinessException(new Error("表格第"+(rowNum+1)+"专利类型错误。"));
+				}
+		        Date date=new Date();
 		        trb.setAid(TokenManager.getAdminId());
-		        trb.setCreateTime(new Date());
-		        trb.setStatus(0);
+		        trb.setInputId(trb.getAid());
+		        trb.setCreateTime(date);
+		        trb.setNewType(1);
+		        trb.setYears(getyear(trb));
+		        trb.setStatus(getSatus(trb.getEndDate()));
+		        trb.setPatentAmount(sumAmout(trb.getType(),trb.getTid(),trb.getYears()));
+		        if(trb.getPatentAmount()==null) {
+		        	throw new BusinessException(new Error("表格第"+(rowNum+1)+"行年份超过最大可提醒日期。"));
+		        }
 		        list.add(trb);
+		        if (trb.getStatus()!=0) {
+		        	Notice n = addNotice(trb); 
+		        	n.setId(UUID.randomUUID().toString());
+		        	n.setCreateTime(date);
+		        	n.setReaded(0);// 未读
+		        	n.setNoticeType(NoticeStatus.TASK_PATENT_ERROR.getCode());
+					nl.add(n);
+				}
+		    }
+    		
+    		List<PatentNew> list2=new ArrayList<>();
+    		for (int i = 0; i < list.size(); i++) {
+    			list2.add(list.get(i));
+    			if (50 == list2.size() || i == list.size() - 1) {
+    				if (list2.size() > 0) {
+    					patentNewMapper.insertBatch(list2);
+    				}
+    				list2.clear();
+    				
+    			}
     		}
+    		asyncUtils.addNoticeBatch(nl);
         }
         
     }
 
+	private Notice addNotice(PatentNew p) {
+		Notice n = new Notice();
+		Date date=new Date();
+		n.setId(UUID.randomUUID().toString());
+		n.setCreateTime(date);
+		n.setReaded(0);// 未读
+		n.setNoticeType(NoticeStatus.TASK_PATENT_ERROR.getCode());
+		Admin a = adminMapper.selectByPrimaryKey(p.getAid());
+		StringBuffer str2 = new StringBuffer();
+		str2.append("专利编号[").append(p.getPatentNo()).append("],名称[").append(p.getName()).append("],email[")
+				.append(p.getEmail().trim()).append("]");
+		if (a == null) {
+			str2.append(",aid=").append(p.getAid()).append(",找不到管理员。");
+			n.setAid("1");
+			n.setContent(str2.toString());
+		} else if (!SendEmailUtil.isEmail(p.getEmail().trim())) {
+			str2.append(",管理员=").append(a.getName()).append(",邮箱不正确。");
+			n.setAid("1");
+			n.setContent(str2.toString());
+		} else {
+			PatentNewLog pl = new PatentNewLog();
+			String str = StrToString(str2,p.getEndDate(),p.getStatus());
+			pl.setContent(str);
+			pl.setCreateTime(new Date());
+			pl.setPid(p.getId());
+			patentNewLogMapper.insertSelective(pl);
+			n.setAid(p.getAid());
+			n.setNoticeType(NoticeStatus.TASK_PATENT_REMIND.getCode());
+			n.setContent(str);
+		}
+		return n;
+	}
+	
+	private String StrToString(StringBuffer str, Date date, Integer status) {
+		//状态 0 未提醒 1 剩余90天 2剩余30天 3剩余20天 4剩余10天 5剩余3天 6剩余2天 7剩余1天
+		Integer days=0;
+		if (status==1) days=90;
+		else if (status==2) days=60;
+		else if (status==3) days=30;
+		else if (status==4) days=15;
+		else if (status==5) days=7;
+		if(days>0) {
+			str.append(",续费时间还剩").append(days).append("天");
+		}
+		str.append(",截止时间[").append(DateUtils.formatDate(date, AFTConstants.YYYYMMDD)).append("]请在截止时间前通知客户!");
+		return str.toString();
+	}
+
+	public Integer getSatus(Date endDate) {
+		int count=countDays(endDate);
+		int status=0;
+		if (count > 60 && count <= 90) {
+			status=1;
+		} else if (count > 30 && count <= 60) {
+			status=2;
+		}else if (count > 15 && count <= 30) {
+			status=3;
+		}else if (count > 7 && count <= 15) {
+			status=4;
+		}else if (count>0&&count <= 7) {
+			status=5;
+		}
+		return status;
+	}
+
+	private Integer getyear(PatentNew p) {
+		Calendar c=Calendar.getInstance();
+		c.setTime(p.getApplyDate());
+		int x=c.get(Calendar.YEAR);
+		Calendar now=Calendar.getInstance();
+		int y=now.get(Calendar.YEAR);
+		int z=y-x;
+		if (z==0) z=1;
+		Calendar end=Calendar.getInstance();
+		end.setTime(p.getApplyDate());
+		end.add(Calendar.YEAR, z);
+		p.setEndDate(end.getTime());
+		return z;
+	}
+
+	private List<PatentPaymentDetails> sumYears(PatentNew trb) {
+		if (trb.getApplyDate()!=null) {
+			Calendar apply =Calendar.getInstance();
+			apply.setTime(trb.getApplyDate());
+			List<PatentPaymentDetails> list =new ArrayList<PatentPaymentDetails>();
+			
+			for (int i = 1; i < 21; i++) {
+				PatentPaymentDetails pd=new PatentPaymentDetails();
+				if ((trb.getType()==0||trb.getType()==2)&&i<11) {
+						addParam(trb, apply, i, pd);
+						list.add(pd);
+				}else if (trb.getType()==1) {
+					
+					addParam(trb, apply, i, pd);
+					list.add(pd);
+				}
+			}
+			patentPaymentDetailsMapper.deleteByPid(trb.getId());
+			patentPaymentDetailsMapper.insertBatch(list);
+			return list;
+		}
+		return null;
+		
+	}
+
+	private void addParam(PatentNew trb, Calendar apply, int i, PatentPaymentDetails pd) {
+		Calendar end=Calendar.getInstance();
+		end.setTime(apply.getTime());
+		end.add(Calendar.YEAR, i);
+		pd.setPid(trb.getId());
+		pd.setEndDate(end.getTime());
+		pd.setPatentAmount(sumAmout(trb.getType(),trb.getTid(),i));
+		pd.setStatus(0);
+		pd.setYears(i);
+	}
+
+	
+
+	
+
+	private BigDecimal sumAmout(Integer type,Integer tid,Integer year) {
+		if (patentYear.isEmpty()) {
+			patentYear=patentYearPaymentMapper.selectAll();
+		}
+		for (PatentYearPayment p : patentYear) {
+			if (type==p.getType()&&year==p.getYear()) {
+				TOrderTask t=tOrderTaskMapper.selectByPrimaryKey(tid);
+				if (t!=null&&t.getCostReduction()!=null&& t.getCostReduction()==1) {
+					return p.getReductionAmount();
+				}else {
+					return p.getPatentAmount();
+				}
+				
+			}
+		}
+		return null;
+	}
+
 	@SuppressWarnings("unchecked")
 	@Override
 	public Object export(PatentNewBo p, Integer pageSize, Integer pageNo) {
@@ -213,10 +562,152 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		pushParams(p, params);
 		List<PatentNewBo> list= (List<PatentNewBo>) findList("selectPatentNewList", params, pageNo,
 				pageSize);
-		return excel.exportExcel(list, "专利列表");
+		return excel.exportExcel(list, "专利列表",uploadPath);
 	}
 
+	@Override
+	public Object pushPatentPaymentDetails(Integer id) {
+		List<PatentPaymentDetails> list =patentPaymentDetailsMapper.selectByPid(id);
+		if (list==null||list.isEmpty()) {
+			PatentNew pt=patentNewMapper.selectByPrimaryKey(id);
+			return sumYears(pt);
+		}
+		return list;
+	}
+
+	/** @param type 0 标记已通知 1批量发邮件 2转给营销员
+	   */
+	@Override
+	public Object updateBatch(String ids, Integer type, String aid) {
+		String[] s = ids.split(",");
+		List<String> ls = Arrays.asList(s);
+		addPatentNewLog(type, ls, aid);
+		if (type == 1) {
+			List<PatentNew> lp = patentNewMapper.selectByids(ls);
+			List<EmailBo> list = new ArrayList<EmailBo>();
+			for (PatentNew patentNew : lp) {
+				if (patentNew.getStatus() == 0) {
+					throw new BusinessException("专利号[" + patentNew.getPatentNo() + "]未达到距离截止时间90天,不允许发送邮件");
+				}
+				if (!SendEmailUtil.isEmail(patentNew.getEmail())) {
+					throw new BusinessException("专利号[" + patentNew.getPatentNo() + "]的邮箱不正确。");
+				}
+			}
+			for (PatentNew patentNew : lp) {
+				Admin a = adminMapper.selectByPrimaryKey(patentNew.getAid());
+				String userName = patentNewMapper.selectUserNameByTid(patentNew.getTid());
+				BigDecimal amout = patentNew.getPatentAmount().multiply(new BigDecimal(10000));
+				EmailBo emailBo = new EmailBo("专利提醒", patentNew.getEmail().trim(), userName, "科德集团", a.getName(),
+						patentNew.getName(), patentNew.getPatentNo(), amout.stripTrailingZeros().toPlainString(),
+						patentNew.getEndDate());
+				list.add(emailBo);
+			}
+			asyncUtils.sendList(list);
+		}
+		if (type == 0 || type == 1) {
+			patentNewMapper.updateBatch(ls);
+		} else if (type == 2) {
+			patentNewMapper.updateBatchByid(ls, null, aid);
+		}
+		return 1;
+	}
+
+	/**
+	 * 批量添加专利日志
+	 * @param type
+	 * @param ls
+	 */
+	private void addPatentNewLog(Integer type, List<String> ls,String aid) {
+		List<PatentNewLog> log=new ArrayList<PatentNewLog>();
+		Date date=new Date();
+		Admin a=adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
+		Admin s=adminMapper.selectByPrimaryKey(aid);
+		for (String str : ls) {
+			PatentNewLog pl=new PatentNewLog();
+			pl.setPid(Integer.valueOf(str));
+			pl.setCreateTime(date);
+			String content="[%s]批量将专利%s";
+			if(type==0)str=String.format(content,a.getName(),"标记已通知。");
+			else if(type==1)str=String.format(content,a.getName(),"发送邮件。");
+			else if(type==2)str=String.format(content,a.getName(),"转交给["+s.getName()+"]。");
+			pl.setContent(str);
+			log.add(pl);
+		}
+		patentNewLogMapper.insertLogBatch(log);
+	}
+
+	@Override
+	public void updateBatchStatusByid(List<String> l2, Integer status) {
+		patentNewMapper.updateBatchByid(l2,status,null);
+		
+	}
 	
-	
-	
+	/**
+	 * 超过时间重置到第二年
+	 */
+	@Override
+	public void pushResetPatentNew(List<String> list) {
+		for (String ids : list) {
+			PatentNew pn=patentNewMapper.selectByPrimaryKey(Integer.valueOf(ids));
+			int year=pn.getYears()+1;
+			PatentPaymentDetails ppd=patentPaymentDetailsMapper.selectByPidAndYear(pn.getId(),year);
+			if (ppd==null) {
+				sumYears(pn);
+				ppd=patentPaymentDetailsMapper.selectByPidAndYear(pn.getId(),year);
+			}
+			PatentNew n=new PatentNew();
+			n.setId(pn.getId());
+			n.setStatus(0);
+			n.setSalesmanRemind(0);
+			n.setYears(ppd.getYears());
+			n.setEndDate(ppd.getEndDate());
+			n.setPatentAmount(sumAmout(pn.getType(),pn.getTid(),pn.getYears()));
+			patentNewMapper.updateByPrimaryKeySelective(n);
+		}
+	}
+
+	@Override
+	public boolean checkTid(Integer tid) {
+		TOrderTask task=tOrderTaskMapper.selectByPrimaryKey(tid);
+		if (task==null) {
+			return true;
+		}
+		return false;
+	}
+
+	@Override
+	public int countDays(Date endDate) {
+		// 申请时间
+		Calendar end = Calendar.getInstance();
+		end.setTime(endDate);
+		// 当前时间
+		Calendar now = Calendar.getInstance();
+		now.setTime(new Date());
+		now.set(Calendar.MILLISECOND, 0);
+		now.set(Calendar.HOUR_OF_DAY, 0);
+		now.clear(Calendar.MINUTE);
+		now.clear(Calendar.SECOND);
+		int days=(int) ((end.getTimeInMillis() - now.getTimeInMillis()) / (1000 * 3600 * 24));
+		return days;
+	}
+
+	@Override
+	public void updateCostReduction(Integer id) {
+		List<PatentNew> list =patentNewMapper.selectByTid(id);
+		Admin	a=	adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
+		for (PatentNew p : list) {
+			PatentNew pn=new PatentNew();
+			pn.setId(p.getId());
+			pn.setPatentAmount(sumAmout(p.getType(), id, p.getYears()));
+			sumYears(p);
+			PatentNewLog pl = new PatentNewLog();
+			pl.setPid(p.getId());
+			StringBuffer str=new StringBuffer();
+			str.append(a.getName()).append("修改了有无费减");
+			pl.setContent(str.toString());
+			patentNewLogMapper.insertSelective(pl);
+			patentNewMapper.updateByPrimaryKeySelective(pn);
+		}
+		
+	}
 }

+ 1 - 0
src/main/java/com/goafanti/weChat/bo/OutPublicDtails.java

@@ -6,6 +6,7 @@ public class OutPublicDtails {
 
 	@Excel(name = "客户名称")
 	private String nickname;
+	@Excel(name = "公出地点")
 	private String userName;
 	@Excel(name = "公出申请人")
 	private String aname;

+ 1 - 7
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -1,6 +1,5 @@
 package com.goafanti.weChat.service.impl;
 
-import java.io.UnsupportedEncodingException;
 import java.text.ParseException;
 import java.util.Date;
 import java.util.HashMap;
@@ -8,7 +7,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
-import javax.mail.MessagingException;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -137,11 +135,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		else if (type==2) title="外出申请同意提醒";
 		if (SendEmailUtil.isEmail(a.getEmail())) {
 			EmailBo email=new EmailBo(title,a.getEmail() , my.getDepartmentName(), my.getName(),"详情请登录微信打卡小程序查看,谢谢!") ;
-			try {
-				asyncUtils.send(email);
-			} catch (UnsupportedEncodingException | MessagingException e) {
-				e.printStackTrace();
-			}
+			asyncUtils.send(email);
 		}
 	}
 	

+ 3 - 3
src/main/resources/props/config_local.properties

@@ -2,7 +2,7 @@ dev.name=local
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #本地
-#jdbc.url=jdbc\:mysql://localhost:3306/aft20210528?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.username=root
 #jdbc.password=123456
 •#
@@ -65,12 +65,12 @@ user_remind_days=15
 portal.host=//sf.jishutao.com/portal/2.0.6
 avatar.upload.host=//sb.jishutao.com/upload
 #连接开发
-#static.host=//172.16.0.253/1.1.78
+#static.host=//172.16.0.253/1.1.83
 #avatar.host=//172.16.0.253
 
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.1.81
+static.host=//static.jishutao.com/1.1.83
 
 wx.appId=wxff2f5720ed7d7f63
 wx.appSecret=081744369d42405be58fe37f892631f7

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -60,7 +60,7 @@ user.private.max=1000
 #客户释放提醒
 user_remind_days=15
 
-static.host=//static.jishutao.com/1.1.81
+static.host=//static.jishutao.com/1.1.83
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload