Browse Source

Merge branch 'test' into test2

# Conflicts:
#	src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java
anderx 9 months ago
parent
commit
9b89a1c0ae

+ 6 - 2
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java

@@ -35,6 +35,7 @@ import com.itextpdf.text.pdf.PdfPCell;
 import com.itextpdf.text.pdf.PdfPRow;
 import com.itextpdf.text.pdf.PdfPTable;
 import com.itextpdf.text.pdf.PdfWriter;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.cache.annotation.Cacheable;
@@ -146,8 +147,8 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
             if (i==1){
                 if (a.getExpenseSuperExamine()==1){
                     //新增一级
-                    String examineId;
-                    String examineName;
+                    String examineId=null;
+                    String examineName=null;
                     //正常用上级,没有的情况下就是自己
                     if (a.getSuperId()!=null){
                         examineId=a.getSuperId();
@@ -235,6 +236,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
             in.setProcessStatus(in.getProcessStatus()+1);
         }else {
             if (admin.getSuperiorId()==null||admin.getId().equals(admin.getSuperiorId())){
+
                 String str2=String.format("%s跳过[%s]。",admin.getSuperiorId()==null?"发起人无上级":"发起人与上级同人",EAProcessStatus.getDesc(in.getProcessStatus()));
                 Date date=new Date();
                 date.setTime(date.getTime()+1000L);
@@ -1079,6 +1081,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
 
     /**
      * 审核流程推送,只要不是完成状态就继续判断是否跳过
+     * @param newEa
      */
     private void examineByprocess( ExpenseAccount newEa,AdminListBo admin,OrganizationListOut dep,List<ExpenseConfigDetails> list) {
         List<ExpenseAccountExamine> examineList;
@@ -1498,6 +1501,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
                     }
 
                 }
+
                 //获取未归集的订单
                 List<BigDecimal> orderNoNotCountAmount = expenseAccountMapper.getOrderNoNotCountAmount(e.getOrderNo());
                 BigDecimal countAmount = orderNoNotCountAmount.stream().reduce(BigDecimal.ZERO, BigDecimal::add);

+ 17 - 30
src/main/java/com/goafanti/patent/service/impl/PatentNewServiceImpl.java

@@ -70,7 +70,7 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		PatentNew pn=patentNewMapper.selectByPrimaryKey(p.getId());
 		StringBuffer str=new StringBuffer(a.getName());
 		if (!p.getApplyDate().equals(pn.getApplyDate())
-				|| p.getType() != pn.getType()) {
+				|| !Objects.equals(p.getType(), pn.getType())) {
 			p.setYears(getyear(p));
 			p.setPatentAmount(sumAmout(p.getType(),p.getTid(),p.getYears()));
 			 if(p.getPatentAmount()==null) {
@@ -87,7 +87,7 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		PatentNewLog pl = new PatentNewLog();
 		pl.setPid(p.getId());
 		boolean flag=false;
-		StringBuffer s=new StringBuffer();
+		StringBuilder s=new StringBuilder();
 		if (p.getPatentNo()!=null&&!p.getPatentNo().equals(pn.getPatentNo())) {
 			s.append("[专利号:").append(pn.getPatentNo()).append(" => ").append(p.getPatentNo()).append("],");
 			flag=true;
@@ -154,7 +154,7 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		}
 		if (flag) {
 			str.append("修改了:").append(s);
-			pl.setContent(str.toString().substring(0, str.toString().length()-1));
+			pl.setContent(str.substring(0, str.toString().length()-1));
 			patentNewLogMapper.insertSelective(pl);
 		}
 	}
@@ -166,7 +166,6 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		return null;
 	}
 
-	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<PatentNewBo> selectPatentNew(PatentNewBo p,Integer pageSize, Integer pageNo) {
 		Map<String, Object> params = new HashMap<>();
@@ -178,12 +177,10 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		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);
-			}
-		}
+            if (aid != null && aid.equals(pn.getAid())) {
+                pn.setIsFollow(1);
+            }
+        }
 		return pa;
 	}
 
@@ -296,8 +293,8 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
     			throw new BusinessException(new Error("未找到正确的参数。"));
 			}
     		List<PatentNew> list=new ArrayList<>();
-    		List<Notice> nl=new ArrayList<Notice>();
-    		String str= new String();
+    		List<Notice> nl= new ArrayList<>();
+    		String str= "";
     		//循环除了第2行的所有行
     		for(int rowNum = firstRowNum+2;rowNum <= lastRowNum;rowNum++){
         		//获得当前行
@@ -392,10 +389,8 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
     		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();
+                    patentNewMapper.insertBatch(list2);
+                    list2.clear();
 
     			}
     		}
@@ -526,7 +521,7 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 			patentYear=patentYearPaymentMapper.selectAll();
 		}
 		for (PatentYearPayment p : patentYear) {
-			if (type==p.getType()&&year==p.getYear()) {
+			if (Objects.equals(type, p.getType()) && Objects.equals(year, p.getYear())) {
 				if (tid==null){
 					return p.getPatentAmount();
 				}else{
@@ -612,8 +607,6 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 
 	/**
 	 * 批量添加专利日志
-	 * @param type
-	 * @param ls
 	 */
 	private void addPatentNewLog(Integer type, List<String> ls,String aid) {
 		List<PatentNewLog> log=new ArrayList<PatentNewLog>();
@@ -683,7 +676,7 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 			for (int i = 0; i < logList.size(); i++) {
 				logList2.add(logList.get(i));
 				if (50 == logList2.size() || i == logList.size() - 1) {
-					if (logList2.size() > 0) insertLogBatch(logList2);
+                    insertLogBatch(logList2);
 					Thread.sleep(2000);
 					logList2.clear();
 				}
@@ -695,11 +688,8 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 	@Override
 	public boolean checkTid(Integer tid) {
 		TOrderTask task=tOrderTaskMapper.queryById(tid);
-		if (task==null) {
-			return true;
-		}
-		return false;
-	}
+        return task == null;
+    }
 
 	@Override
 	public int countDays(Date endDate) {
@@ -713,8 +703,7 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 		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;
+        return (int) ((end.getTimeInMillis() - now.getTimeInMillis()) / (1000 * 3600 * 24));
 	}
 
 	@Override
@@ -728,9 +717,7 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 			sumYears(p);
 			PatentNewLog pl = new PatentNewLog();
 			pl.setPid(p.getId());
-			StringBuffer str=new StringBuffer();
-			str.append(a.getName()).append("修改了有无费减");
-			pl.setContent(str.toString());
+            pl.setContent(a.getName() + "修改了有无费减");
 			patentNewLogMapper.insertSelective(pl);
 			patentNewMapper.updateByPrimaryKeySelective(pn);
 		}

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

@@ -6,7 +6,7 @@ static.host=//static.jishutao.com/${kede.version}
 #static.host=//172.16.1.187/${kede.version}
 #avatar.host=//172.16.1.199:3000
 
-#jdbc.url=jdbc\:mysql://localhost:3306/aft20241122?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.url=jdbc\:mysql://localhost:3306/aft20250313?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