Przeglądaj źródła

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

anderx 9 miesięcy temu
rodzic
commit
2cffa6eb6f

+ 2 - 9
src/main/java/com/goafanti/common/dao/OrganizationIdentityMapper.java

@@ -1,14 +1,7 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.OrganizationIdentity;
-import com.goafanti.user.bo.AuditorOrgIdentityDetailBo;
-import com.goafanti.user.bo.InputUserChannel;
-import com.goafanti.user.bo.OrgBasicInfoBo;
-import com.goafanti.user.bo.OrgIdentityBo;
-import com.goafanti.user.bo.OrgIdentityDetailBo;
-import com.goafanti.user.bo.OrgUnitNames;
-
-import java.util.List;
+import com.goafanti.user.bo.*;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -48,5 +41,5 @@ public interface OrganizationIdentityMapper {
 
     void insertBatch(List<InputUserChannel> list);
 
-    OrganizationIdentity selectByOrgCode(String orgCode);
+    List<OrganizationIdentity> selectByOrgCode(String orgCode);
 }

+ 12 - 2
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -1706,9 +1706,19 @@ public class AdminCustomerApiController extends BaseApiController{
 	@PostMapping("/updateAndReceiveCustomer")
 	public Result updateAndReceiveCustomer(InputUpdateAndReceiveCustomer in) {
 		Result res = new Result();
+		if (in.getOrgCode()!=null){
+			in.setOrgCode(in.getOrgCode().trim());
+			if (customerService.checkOrgCode(in.getOrgCode())){
+				res.getError().add(buildError("","统一信用代码已存在"));
+				return res;
+			}
+		}
+		Result result = receiveCustomer(in.getId(), null);
+		res.getError().addAll(result.getError());
+		if (!res.getError().isEmpty()){
+			return res;
+		}
 		customerService.updateAndReceiveCustomer(in);
-		receiveCustomer( in.getId(), null);
-		res.setData(1);
 		return res;
 	}
 }

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

@@ -1540,8 +1540,8 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 
 	@Override
 	public boolean checkOrgCode(String orgCode) {
-		OrganizationIdentity organizationIdentity = organizationIdentityMapper.selectByOrgCode(orgCode);
-		if (organizationIdentity!=null)return true;
+		List<OrganizationIdentity> list = organizationIdentityMapper.selectByOrgCode(orgCode);
+		if (!list.isEmpty()&&list.size()>1)return true;
 		return false;
 	}
 

+ 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);
 		}

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

@@ -1,12 +1,12 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
-kede.version=1.3.39
+kede.version=1.3.41
 static.host=//static.jishutao.com/${kede.version}
 #static.host=//172.16.1.199:3000/${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

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

@@ -1,5 +1,5 @@
 dev.name=test
-static.host=//static.jishutao.com/1.3.39
+static.host=//static.jishutao.com/1.3.41
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 jdbc.url=jdbc:mysql://127.0.0.1:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false