Antiloveg пре 8 година
родитељ
комит
32bec7617d

+ 2 - 2
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -2923,7 +2923,7 @@ public class AdminApiController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/listCognizance", method = RequestMethod.POST)
-	public Result listCognizance(String uid, String unitName, String locationProvince, String pageNo, String pageSize) {
+	public Result listCognizance(String contractId, String uid, String unitName, String locationProvince, String pageNo, String pageSize) {
 		Result res = new Result();
 		Integer pNo = 1;
 		Integer pSize = 10;
@@ -2934,7 +2934,7 @@ public class AdminApiController extends CertifyApiController {
 			pNo = Integer.parseInt(pageNo);
 		}
 
-		res.setData(orgCognizanceService.listCognizance(uid, unitName, locationProvince, pNo, pSize));
+		res.setData(orgCognizanceService.listCognizance(contractId, uid, unitName, locationProvince, pNo, pSize));
 		return res;
 	}
 

+ 2 - 2
src/main/java/com/goafanti/admin/controller/AdminTechProjectApiController.java

@@ -125,7 +125,7 @@ public class AdminTechProjectApiController extends CertifyApiController {
 	 */
 	@SuppressWarnings("unchecked")
 	@RequestMapping(value = "/listTechProject", method = RequestMethod.POST)
-	public Result listTechProject(String province, String unitName, String uid, String pageNo, String pageSize) {
+	public Result listTechProject(String contractId, String province, String unitName, String uid, String pageNo, String pageSize) {
 		Result res = new Result();
 		Integer pNo = 1;
 		Integer pSize = 10;
@@ -135,7 +135,7 @@ public class AdminTechProjectApiController extends CertifyApiController {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		Pagination<TechProjectManageListBo> t = techProjectService.listManageTechProject(province, unitName, uid, pNo,
+		Pagination<TechProjectManageListBo> t = techProjectService.listManageTechProject(contractId, province, unitName, uid, pNo,
 				pSize);
 		if (null != t) {
 			List<TechProjectManageListBo> l = (List<TechProjectManageListBo>) t.getList();

+ 10 - 0
src/main/java/com/goafanti/cognizance/bo/CognizanceBo.java

@@ -45,6 +45,16 @@ public class CognizanceBo {
 
 	private String	founder;
 
+	private String	contractId;
+
+	public String getContractId() {
+		return contractId;
+	}
+
+	public void setContractId(String contractId) {
+		this.contractId = contractId;
+	}
+
 	public String getFounder() {
 		return founder;
 	}

+ 2 - 2
src/main/java/com/goafanti/cognizance/controller/CognizanceApiController.java

@@ -2243,7 +2243,7 @@ public class CognizanceApiController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/listCognizance", method = RequestMethod.POST)
-	public Result listCognizance(String locationProvince, String pageNo, String pageSize) {
+	public Result listCognizance(String contractId, String locationProvince, String pageNo, String pageSize) {
 		Result res = new Result();
 
 		if (!checkUserLogin(res)) {
@@ -2263,7 +2263,7 @@ public class CognizanceApiController extends CertifyApiController {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		res.setData(orgCognizanceService.listCognizance(TokenManager.getUserId(), null, locationProvince, pNo, pSize));
+		res.setData(orgCognizanceService.listCognizance(contractId, TokenManager.getUserId(), null, locationProvince, pNo, pSize));
 
 		return res;
 	}

+ 1 - 1
src/main/java/com/goafanti/cognizance/service/OrgCognizanceService.java

@@ -22,7 +22,7 @@ public interface OrgCognizanceService {
 
 	OrgCognizance insert(OrgCognizance c);
 
-	Pagination<CognizanceBo> listCognizance(String uid, String unitName, String locationProvince, Integer pNo, Integer pSize);
+	Pagination<CognizanceBo> listCognizance(String contractId, String uid, String unitName, String locationProvince, Integer pNo, Integer pSize);
 
 	CognizanceOrgInfoBo selectCognizanceOrgInfoBoByUidAndCid(String uid, String cid);
 

+ 5 - 1
src/main/java/com/goafanti/cognizance/service/impl/OrgCognizanceServiceImpl.java

@@ -81,13 +81,17 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<CognizanceBo> listCognizance(String uid, String unitName, String locationProvince, Integer pageNo,
+	public Pagination<CognizanceBo> listCognizance(String contractId, String uid, String unitName, String locationProvince, Integer pageNo,
 			Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 
 		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			params.put("principal", TokenManager.getAdminId());
 		}
+		
+		if (!StringUtils.isBlank(contractId)) {
+			params.put("contractId", contractId);
+		}
 
 		if (!StringUtils.isBlank(unitName)) {
 			params.put("unitName", unitName);

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

@@ -415,5 +415,6 @@
     <if test="principal != null">
 	group by c.id
   </if>
+   order by c.serial_number desc
   </select>
 </mapper>

+ 9 - 4
src/main/java/com/goafanti/common/mapper/OrgCognizanceMapper.xml

@@ -318,7 +318,7 @@
   
   <select id="findCognizanceBoByPage" parameterType="String"  resultType="com.goafanti.cognizance.bo.CognizanceBo">
   	select  c.id as cid, c.uid as uid, c.serial_number as serialNumber, i.licence_province as locationProvince,
-	i.unit_name as unitName, c.contacts, c.create_time as createTime, 
+	i.unit_name as unitName, c.contacts, c.create_time as createTime, c.contract_id as contractId,
 	c.comment, c.state, c.certificate_number as certificateNumber, c.large_order as largeOrder,
 	c.issuing_date as issuingDate, c.year, a.name as consultant,
     CONCAT(i.first_contacts,'  ', i.first_mobile) as firstContacts,
@@ -330,7 +330,7 @@
 	LEFT JOIN admin a on c.consultant = a.id 
 	LEFT JOIN admin ad on c.founder = ad.id 
 	<if test="principal != null">
-		left join org_cognizance_log l on c.id=l.cid 
+		left join contract_log l on c.contract_id=l.cid 
 	</if>
 	where c.deleted_sign = 0
 	<if test="principal != null">
@@ -342,6 +342,9 @@
 	<if test="uid != null">
 		and c.uid = #{uid,jdbcType=VARCHAR}
 	</if>
+	<if test="contractId != null">
+		and c.contract_id = #{contractId,jdbcType=VARCHAR}
+	</if>
 	<if test="locationProvince != null">
 		and i.licence_province = #{locationProvince, jdbcType=VARCHAR}
 	</if>
@@ -359,13 +362,15 @@
 	from org_cognizance c 
 	LEFT JOIN organization_identity i on c.uid = i.uid
 	<if test="principal != null">
-		left join org_cognizance_log l on c.id=l.cid 
+		left join contract_log l on c.contract_id=l.cid 
 	</if>
 	where c.deleted_sign = 0  
 	<if test="principal != null">
 		and l.principal = #{principal,jdbcType=VARCHAR}
 	</if>
-	
+	<if test="contractId != null">
+		and c.contract_id = #{contractId,jdbcType=VARCHAR}
+	</if>
 	<if test="uid != null">
 		and c.uid = #{uid,jdbcType=VARCHAR}
 	</if>

+ 12 - 8
src/main/java/com/goafanti/common/mapper/PatentCostMapper.xml

@@ -171,12 +171,11 @@
 		c.funds as funds , c.reimbursement as reimbursement
 		from patent_info p
 		LEFT JOIN organization_identity o on o.uid = p.uid
-		LEFT JOIN patent_cost c on p.id = c.pid WHERE p.deleted_sign = 0
-		
+		LEFT JOIN patent_cost c on p.id = c.pid 
 		<if test="principal != null">
-			and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+			left join contract_log l on p.contract_id=l.cid
 		</if>
-		
+		WHERE p.deleted_sign = 0
 		<if test="locationProvince != null">
 			and o.licence_province = #{locationProvince,jdbcType=VARCHAR}
 		</if>
@@ -188,6 +187,9 @@
 			and p.patent_application_date <![CDATA[ < ]]>
 			#{pEnd,jdbcType=TIMESTAMP}
 		</if>
+		<if test="principal != null">
+			group by p.id
+		</if>
 		order by p.serial_number DESC
 		<if test="page_sql!=null">
 			${page_sql}
@@ -199,12 +201,11 @@
 		select count(1)
 		from patent_info p
 		LEFT JOIN organization_identity o on o.uid = p.uid
-		LEFT JOIN patent_cost c on p.id = c.pid WHERE p.deleted_sign = 0
-		
+		LEFT JOIN patent_cost c on p.id = c.pid
 		<if test="principal != null">
-			and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+			left join contract_log l on p.contract_id=l.cid
 		</if>
-		
+		 WHERE p.deleted_sign = 0
 		<if test="locationProvince != null">
 			and o.licence_province = #{locationProvince,jdbcType=VARCHAR}
 		</if>
@@ -216,6 +217,9 @@
 			and p.patent_application_date <![CDATA[ < ]]>
 			#{pEnd,jdbcType=TIMESTAMP}
 		</if>
+		<if test="principal != null">
+			group by p.id
+		</if>
 	</select>
 	
 	<insert id="batchInsert" parameterType="com.goafanti.common.model.PatentCost">

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

@@ -615,7 +615,7 @@
 		LEFT JOIN admin a on a.id = p.author
 		LEFT JOIN admin ad on ad.id = p.founder
 		<if test="principal != null">
-			left join patent_log l on p.id=l.pid
+			left join contract_log l on p.contract_id=l.cid
 		</if>
 		where p.deleted_sign = 0
 		<if test="principal != null">
@@ -693,7 +693,7 @@
 		p.uid = o.uid
 		LEFT JOIN admin a on a.id = p.author
 		<if test="principal != null">
-			left join patent_log l on p.id=l.pid
+			left join contract_log l on p.contract_id=l.cid
 		</if>
 		where p.deleted_sign = 0
 		<if test="principal != null">
@@ -771,7 +771,7 @@
 		LEFT JOIN patent_cost c on p.id = c.pid and c.annual_fee_state = 0
 		LEFT JOIN organization_identity o on p.uid = o.uid
 		<if test="principal != null">
-			left join patent_log l on p.id=l.pid
+			left join contract_log l on p.contract_id=l.cid
 		</if>
 		where p.deleted_sign = 0 and c.annual_fee_state = 0
 		<if test="principal != null">
@@ -798,7 +798,7 @@
 		INNER JOIN patent_cost c on p.id = c.pid
 		LEFT JOIN organization_identity o on p.uid = o.id 
 		<if test="principal != null">
-			left join patent_log l on p.id=l.pid
+			left join contract_log l on p.contract_id=l.cid
 		</if>
 		where p.deleted_sign = 0 and c.annual_fee_state = 0
 		<if test="principal != null">
@@ -827,7 +827,7 @@
 		LEFT JOIN organization_identity o ON o.uid = p.uid
     	LEFT JOIN admin a on a.id = p.author
     	<if test="principal != null">
-			left join patent_log l on p.id=l.pid
+			left join contract_log l on p.contract_id=l.cid
 		</if>
 		where p.patent_state in
 		(6,8) and p.deleted_sign = 0
@@ -884,7 +884,7 @@
 		LEFT JOIN organization_identity o ON o.uid = p.uid
     	LEFT JOIN admin a on a.id = p.author
     	<if test="principal != null">
-			left join patent_log l on p.id=l.pid
+			left join contract_log l on p.contract_id=l.cid
 		</if>
 		where p.patent_state in
 		(6,8) and p.deleted_sign = 0

+ 12 - 4
src/main/java/com/goafanti/common/mapper/PatentRegistrationMapper.xml

@@ -215,9 +215,13 @@
          r.certificate_tracking_number as certificateTrackingNumber, r.certificate_express_company as certificateExpressCompany
 		from patent_info p 
 		LEFT  JOIN patent_registration r  on p.id = r.pid
-		LEFT JOIN organization_identity o on o.uid = p.uid where p.deleted_sign = 0
+		LEFT JOIN organization_identity o on o.uid = p.uid
 		<if test="principal != null">
-			and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+			left join contract_log l on p.contract_id=l.cid
+		</if>
+		 where p.deleted_sign = 0
+		<if test="principal != null">
+			group by p.id
 		</if>
 		order by p.serial_number DESC
 		<if test="page_sql!=null">
@@ -229,9 +233,13 @@
   	select count(1)
 	from patent_info p 
 	LEFT  JOIN patent_registration r  on p.id = r.pid
-	LEFT JOIN organization_identity o on o.uid = p.uid where p.deleted_sign = 0
+	LEFT JOIN organization_identity o on o.uid = p.uid 
+	<if test="principal != null">
+		left join contract_log l on p.contract_id=l.cid
+	</if>
+	where p.deleted_sign = 0
 	<if test="principal != null">
-		and p.id in (SELECT l.pid FROM patent_log l where l.principal = #{principal,jdbcType=VARCHAR})
+			group by p.id
 	</if>
   </select>
   

+ 11 - 5
src/main/java/com/goafanti/common/mapper/TechProjectMapper.xml

@@ -364,7 +364,7 @@
   
   <select id ="findTechProjectManageListByPage" parameterType="java.lang.String" 
      resultType="com.goafanti.techproject.bo.TechProjectManageListBo">
-  	 select x.* from (select p.id, p.uid, i.licence_province as province, 
+  	 select x.* from (select p.id, p.uid, i.licence_province as province, p.contract_id as contractId,
 	        i.unit_name as unitName,  
 		    CONCAT(i.first_contacts,'  ', i.first_mobile) as firstContacts,
 		    CONCAT(i.second_contacts,'  ', i.second_mobile) as secondContacts,
@@ -379,7 +379,7 @@
 		LEFT JOIN admin ad on p.founder = ad.id 
    	    LEFT JOIN tech_website w on p.department = w.id 
     <if test="principal != null">
-		left join tech_project_log l on p.id=l.pid
+		left join contract_log l on p.contract_id=l.cid
 	</if>
 	 where p.deleted_sign = 0 
 	 <if test="principal != null">
@@ -389,7 +389,10 @@
 		group by p.id
 	</if>
     ) x where x.wd = 0 or x.wd is null
-    <if test="province != null">
+    <if test="contractId != null">
+    	and x.contractId = #{contractId,jdbcType=VARCHAR}
+    </if>
+      <if test="province != null">
     	and x.province = #{province,jdbcType=VARCHAR}
     </if>
      <if test="uid != null">
@@ -406,7 +409,7 @@
   
   <select id="findTechProjectManageCount" resultType="java.lang.Integer" parameterType="String">
  	select count(1) from ( select x.* from (select p.id, p.uid, i.licence_province as province, 
-	        i.unit_name as unitName,  
+	        i.unit_name as unitName,  p.contract_id as contractId,
 		    CONCAT(i.first_contacts,'  ', i.first_mobile) as firstContacts,
 		    CONCAT(i.second_contacts,'  ', i.second_mobile) as secondContacts,
 		    CONCAT(i.third_contacts,'  ', i.third_mobile) as thirdContacts, 
@@ -419,7 +422,7 @@
 		LEFT JOIN admin a on p.consultant = a.id 
     LEFT JOIN tech_website w on p.department = w.id 
     <if test="principal != null">
-		left join tech_project_log l on p.id=l.pid
+		left join contract_log l on p.contract_id=l.cid
 	</if>
 	 where p.deleted_sign = 0 
 	 <if test="principal != null">
@@ -429,6 +432,9 @@
 		group by p.id
 	</if> 
     ) x where x.wd = 0 or x.wd is null
+     <if test="contractId != null">
+    	and x.contractId = #{contractId,jdbcType=VARCHAR}
+    </if>
 	<if test="province != null">
     	and x.province = #{province,jdbcType=VARCHAR}
     </if>

+ 2 - 1
src/main/java/com/goafanti/contract/service/impl/ContractServiceImpl.java

@@ -7,6 +7,7 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.TreeMap;
 import java.util.UUID;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -268,7 +269,7 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
 			principal = TokenManager.getAdminId();
 		}
 		List<ContractSerialNumber> list = contractMapper.selectContractSerialNumber(principal);
-		Map<String, Integer> map = new HashMap<>();
+		Map<String, Integer> map = new TreeMap<>();
 		if (null != list && list.size() > 0) {
 			for (ContractSerialNumber c : list) {
 				map.put(c.getContractId(), c.getSerialNumber());

+ 9 - 1
src/main/java/com/goafanti/techproject/bo/TechProjectManageListBo.java

@@ -13,8 +13,16 @@ public class TechProjectManageListBo extends TechProjectClientListBo {
 	
 	private String founder;
 	
+	private String contractId;
 	
-	
+	public String getContractId() {
+		return contractId;
+	}
+
+	public void setContractId(String contractId) {
+		this.contractId = contractId;
+	}
+
 	public String getFounder() {
 		return founder;
 	}

+ 1 - 1
src/main/java/com/goafanti/techproject/service/TechProjectService.java

@@ -21,7 +21,7 @@ public interface TechProjectService {
 
 	TechProject saveTechProject(TechProject techProject, String salesman);
 
-	Pagination<TechProjectManageListBo> listManageTechProject(String province, String unitName, String uid, Integer pNo, Integer pSize);
+	Pagination<TechProjectManageListBo> listManageTechProject(String contractId, String province, String unitName, String uid, Integer pNo, Integer pSize);
 
 	TechProjectDetailBo selectProjectDetail(String pid);
 

+ 5 - 1
src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java

@@ -153,13 +153,17 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<TechProjectManageListBo> listManageTechProject(String province, String unitName, String uid,
+	public Pagination<TechProjectManageListBo> listManageTechProject(String contractId, String province, String unitName, String uid,
 			Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
 
 		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
 			params.put("principal", TokenManager.getAdminId());
 		}
+		
+		if (!StringUtils.isBlank(contractId)) {
+			params.put("contractId", contractId);
+		}
 
 		if (!StringUtils.isBlank(province)) {
 			params.put("province", province);