Antiloveg лет назад: 8
Родитель
Сommit
c7198bfe34

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

@@ -35,4 +35,6 @@ public interface TechProjectMapper {
 	void batchInsert(List<TechProject> tp);
 
 	Integer findTechProjectNumByUid(String uid);
+
+	int batchDeleteByContractId(List<String> id);
 }

+ 10 - 2
src/main/java/com/goafanti/common/mapper/TechProjectMapper.xml

@@ -523,7 +523,7 @@
 		#{item.approvedDate,jdbcType=TIMESTAMP}, #{item.recordTime,jdbcType=TIMESTAMP},
 		#{item.deletedSign,jdbcType=INTEGER}, #{item.founder,jdbcType=VARCHAR}, #{item.contractId,jdbcType=VARCHAR},
 		#{item.principal,jdbcType=VARCHAR}
-		)
+	 )
   </foreach>
   </insert>
   
@@ -535,6 +535,14 @@
   		deleted_sign = 0
   	and uid = #{uid,jdbcType=VARCHAR}
   </select>
-	
+
+  <update id="batchDeleteByContractId" parameterType="java.util.List">
+		update tech_project set deleted_sign = 1
+		where contract_id in
+		<foreach item="item" index="index" collection="list" open="("
+			separator="," close=")">
+			#{item}
+		</foreach>
+  </update>
 	
 </mapper>

+ 6 - 10
src/main/java/com/goafanti/contract/bo/InputContactLog.java

@@ -7,16 +7,16 @@ import javax.validation.constraints.Size;
 import com.goafanti.common.constant.ErrorConstants;
 
 public class InputContactLog {
-	
+
 	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-    private String cid;	
-	
+	private String	cid;
+
 	@Size(min = 0, max = 128, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String comment;
-	
+	private String	comment;
+
 	@Max(value = 3, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	private Integer status;
+	private Integer	status;
 
 	public String getCid() {
 		return cid;
@@ -41,9 +41,5 @@ public class InputContactLog {
 	public void setStatus(Integer status) {
 		this.status = status;
 	}
-	
-	
-	
-	
 
 }

+ 4 - 4
src/main/java/com/goafanti/contract/service/impl/ContractLogServiceImpl.java

@@ -39,7 +39,7 @@ public class ContractLogServiceImpl implements ContractLogService {
 	private NoticeMapper		noticeMapper;
 	@Autowired
 	private UserMapper			userMapper;
-	
+
 	@Override
 	public List<ContractLog> selectContractLogByCid(String cid) {
 		return contractLogMapper.selectContractLogByCid(cid);
@@ -54,7 +54,7 @@ public class ContractLogServiceImpl implements ContractLogService {
 			} catch (ParseException e) {
 			}
 		}
-		if (ContractStatus.COMPLETE.getCode() == icl.getStatus()) {
+		if (ContractStatus.COMPLETE.getCode().equals(icl.getStatus())) {
 			Contract c = contractMapper.selectByPrimaryKey(icl.getCid());
 			c.setStatus(icl.getStatus());
 			c.setCompleteDate(recordTime);
@@ -62,8 +62,9 @@ public class ContractLogServiceImpl implements ContractLogService {
 		}
 		List<ContractLog> logs = new ArrayList<>();
 		List<Notice> notice = new ArrayList<>();
+		ContractLog cl = null;
 		for (int i = 0; i < principals.length; i++) {
-			ContractLog cl = new ContractLog();
+			cl = new ContractLog();
 			BeanUtils.copyProperties(icl, cl);
 			cl.setId(UUID.randomUUID().toString());
 			cl.setOperator(TokenManager.getAdminId());
@@ -101,5 +102,4 @@ public class ContractLogServiceImpl implements ContractLogService {
 		return n;
 	}
 
-	
 }

+ 4 - 0
src/main/java/com/goafanti/contract/service/impl/ContractServiceImpl.java

@@ -19,6 +19,7 @@ import com.goafanti.common.dao.CopyrightInfoMapper;
 import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.OrgCognizanceMapper;
 import com.goafanti.common.dao.PatentInfoMapper;
+import com.goafanti.common.dao.TechProjectMapper;
 import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.enums.ContractBusinessStatus;
 import com.goafanti.common.enums.ContractStatus;
@@ -57,6 +58,8 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
 	private CopyrightInfoMapper	copyrightInfoMapper;
 	@Autowired
 	private OrgCognizanceMapper	orgCognizanceMapper;
+	@Autowired
+	private TechProjectMapper	techProjectMapper;
 
 	@SuppressWarnings("unchecked")
 	@Override
@@ -238,6 +241,7 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
 		patentInfoMapper.batchDeleteByContractId(id);
 		copyrightInfoMapper.batchDeleteByContractId(id);
 		orgCognizanceMapper.batchDeleteByContractId(id);
+		techProjectMapper.batchDeleteByContractId(id);
 		return contractMapper.batchDeleteByPrimaryKey(id);
 	}
 

+ 1 - 1
src/main/java/com/goafanti/patent/bo/InputPatentInfo.java

@@ -29,7 +29,7 @@ public class InputPatentInfo {
 	@Size(min = 0, max = 16, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String	patentNumber;
 
-	@Max(value = 9, message = "{" + ErrorConstants.PARAM_ERROR + "}")
+	@Max(value = 19, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer	patentField;