Kaynağa Gözat

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

anderx 5 yıl önce
ebeveyn
işleme
71d734b6f3

+ 5 - 0
src/main/java/com/goafanti/common/dao/PersonnelMidMapper.java

@@ -2,6 +2,8 @@ package com.goafanti.common.dao;
 
 import com.goafanti.common.model.PersonnelMid;
 import com.goafanti.common.model.PersonnelMidExample;
+import com.goafanti.personnel.bo.IntpersonnelWelfareBo;
+
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
@@ -72,4 +74,7 @@ public interface PersonnelMidMapper {
 	 * @mbg.generated  Thu May 07 14:15:57 CST 2020
 	 */
 	int updateByPrimaryKey(PersonnelMid record);
+
+	void updateByidTime(@Param("m")PersonnelMid m, @Param("type")Integer type);
+
 }

+ 31 - 0
src/main/java/com/goafanti/common/mapper/PersonnelMidMapper.xml

@@ -491,4 +491,35 @@
       welfare_remarks = #{welfareRemarks,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
+  
+  <update id="updateByidTime" >
+   
+    update personnel_mid
+    <set>
+    	<if test="type==null">
+      <if test="m.welfareAnnexUrl != null">
+        welfare_annex_url = #{m.welfareAnnexUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="m.welfareAnnexName != null">
+        welfare_annex_name = #{m.welfareAnnexName,jdbcType=VARCHAR},
+      </if>
+       <if test="m.welfareRemarks != null">
+        welfare_remarks = #{welfareRemarks,jdbcType=VARCHAR},
+      </if>
+    	</if>
+      <if test="type==0">
+        insurance_start_time = #{m.insuranceStartTime,jdbcType=TIMESTAMP},
+        insurance_end_time = #{m.insuranceEndTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="type==1">
+        fund_start_time = #{m.fundStartTime,jdbcType=TIMESTAMP},
+        fund_end_time = #{m.fundEndTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="type==2">
+        employer_start_time = #{m.employerStartTime,jdbcType=TIMESTAMP},
+        employer_end_time = #{m.employerEndTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{m.id,jdbcType=INTEGER}
+  </update>
 </mapper>

+ 13 - 2
src/main/java/com/goafanti/common/task/PatentTask.java

@@ -30,6 +30,7 @@ import com.goafanti.common.model.PatentNew;
 import com.goafanti.common.model.PatentNewLog;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.SendEmailUtil;
+import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.patent.service.PatentNewService;
 
 
@@ -47,8 +48,10 @@ public class PatentTask {
 	
 	
 	
+	
+	
 
-    
+	int pointsDataLimit=50;
     
     private static final String regEx_script = "<script[^>]*?>[\\s\\S]*?<\\/script>"; // 定义script的正则表达式
     private static final String regEx_style = "<style[^>]*?>[\\s\\S]*?<\\/style>"; // 定义style的正则表达式
@@ -132,7 +135,15 @@ public class PatentTask {
 			 Thread.sleep(2000);
 		}
 		if (!nlist.isEmpty()) {
-			noticeMapper.insertBatch(nlist);	
+			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) noticeMapper.insertBatch(newList);	
+						  newList.clear();
+						  Thread.sleep(2000);
+					  }  
+			}
 		}
 		List<PatentNew> ls=patentNewService.AllselectEndPatentNew();
 		for (PatentNew p : ls) {

+ 6 - 2
src/main/java/com/goafanti/common/task/ReleaseUserTask.java

@@ -9,9 +9,13 @@ import java.util.UUID;
 import javax.annotation.Resource;
 import javax.mail.MessagingException;
 
+import org.apache.log4j.LogSF;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 
 import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.constant.AFTConstants;
@@ -26,7 +30,7 @@ import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.customer.service.CustomerService;
 import com.goafanti.user.service.UserService;
 @Component
-//@Controller
+@Controller
 public class ReleaseUserTask {
 	@Resource
 	private CustomerService customerServiceImpl;
@@ -42,7 +46,7 @@ public class ReleaseUserTask {
 	 */
 	
 	@Scheduled(cron = "0 0 1  * * ?") 
-//	@RequestMapping(value = "/open/updateUser", method = RequestMethod.GET)
+	@RequestMapping(value = "/open/updateUser", method = RequestMethod.GET)
 	public void updateUser(){
 		LoggerUtils.debug(getClass(), "==============客户释放开始============");
 		Date releaseTime = new Date();

+ 10 - 2
src/main/java/com/goafanti/personnel/controller/AdminPersonnelApiController.java

@@ -223,8 +223,16 @@ public class AdminPersonnelApiController extends CertifyApiController {
 			return res;
 		}
 		try {
-			if ( !StringUtils.isBlank(i.getStartTimes()))i.setStartTime(DateUtils.StringToDate(i.getStartTimes(), AFTConstants.YYYYMMDD));
-			if ( !StringUtils.isBlank(i.getEndTimes()))i.setEndTime(DateUtils.StringToDate(i.getEndTimes(), AFTConstants.YYYYMMDD));
+			if ( !StringUtils.isBlank(i.getStartTimes())) {
+				i.setStartTime(DateUtils.StringToDate(i.getStartTimes(), AFTConstants.YYYYMMDD));
+			}else {
+				i.setStartTime(null);
+			}
+			if ( !StringUtils.isBlank(i.getEndTimes())) {
+				i.setEndTime(DateUtils.StringToDate(i.getEndTimes(), AFTConstants.YYYYMMDD));
+			}else {
+				i.setEndTime(null);
+			}
 		} catch (ParseException e) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "日期", "日期"));
 			return res;

+ 10 - 14
src/main/java/com/goafanti/personnel/service/impl/PersonnelServiceImpl.java

@@ -432,10 +432,14 @@ public class PersonnelServiceImpl  extends BaseMybatisDao<PersonnelDossierMapper
 				personnelWelfareMapper.insertSelective(i);
 			}
 		}else {
-			personnelWelfareMapper.updateByPrimaryKeySelective(i);
+			personnelWelfareMapper.updateByPrimaryKey(i);
 		}
 		PersonnelMid m=new PersonnelMid();
 		m.setId(i.getPdId());
+		m.setWelfareAnnexUrl(i.getAnnexUrl());
+		m.setWelfareAnnexName(i.getAnnexName());
+		m.setWelfareRemarks(i.getRemarks());
+		PersonnelMid pm=personnelMidMapper.selectByPrimaryKey(i.getPdId());
 		if (i.getType()!=null) {
 			if (i.getType()==0) {
 				m.setInsuranceStartTime(i.getStartTime());
@@ -448,20 +452,12 @@ public class PersonnelServiceImpl  extends BaseMybatisDao<PersonnelDossierMapper
 				m.setEmployerEndTime(i.getEndTime());
 			}
 		}
-		m.setWelfareAnnexUrl(i.getAnnexUrl());
-		m.setWelfareAnnexName(i.getAnnexName());
-		m.setWelfareRemarks(i.getRemarks());
-		if (m.getInsuranceStartTime()!=null||m.getFundStartTime()!=null||m.getEmployerStartTime()!=null||
-				m.getWelfareAnnexUrl()!=null||m.getWelfareRemarks()!=null) {
-			PersonnelMid pm=personnelMidMapper.selectByPrimaryKey(i.getPdId());
-			if (pm==null||pm.getId()==null) {
-				personnelMidMapper.insertSelective(m);
-			}else {
-				personnelMidMapper.updateByPrimaryKeySelective(m);
-				
-			}
+		if (pm==null||pm.getId()==null) {
+			personnelMidMapper.insertSelective(m);
+		}else {
+			personnelMidMapper.updateByidTime(m,i.getType());
+			
 		}
-		
 		return 1;
 	}
 }