Просмотр исходного кода

四川项目相关开发BUG修改

anderx лет назад: 7
Родитель
Сommit
521cc26cf9

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

@@ -448,7 +448,7 @@
   
   <select id="selectById" parameterType="String" resultType="com.goafanti.sc.bo.inputAchievement">
 		select a.id,a.name,date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createDateFormat,a.summary,a.`type`,a.industry,
-c.name as industryName,a.introduce,a.owner_name as ownerName,
+c.name as industryName,a.introduce,a.owner_name as ownerName,b.introduce as pIntroduce,a.patent_number as patentNumber,
 a.publisher_id as publisherId,a.reserve_butt_mode as reserveButtMode,a.transfer_price as transferPrice,
 b.telephone,b.contacts as publisherName,b.email,b.zip_code as zipCode,b.province,b.city,d.name as provinceName,e.name as cityName
 from sc_achievement a left join sc_publisher b on a.publisher_id=b.id

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

@@ -412,17 +412,17 @@
   </update>
   
    <select id="findDemandListByPage" parameterType="String" resultType="com.goafanti.sc.bo.ScDemandListBo">
-		select a.id,a.name,a.industry,b.name as orgName,a.reserve_butt_unit as reserveButtUnit
+		select a.id,a.name,a.industry,b.name as orgName,a.reserve_butt_unit as reserveButtUnit,
+			b.contacts,b.telephone,b.address
 			from sc_demand a left join sc_publisher b on a.publisher_id=b.id
 			left join sc_organization c on b.id=c.publisher_id
 			left join industry_category d on a.industry=d.id
 			where a.delete_sign=0
-			
-  	<if test="type != null">
+	<if test="type != null">
   		and a.`type`= #{type,jdbcType=VARCHAR}
   	</if>
   	<if test="name != null">
-  		and a.name  like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+  		and b.name  like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
   	<if test="reserveButtUnit != null">
   		and a.reserve_butt_unit like CONCAT('%',#{reserveButtUnit,jdbcType=VARCHAR},'%')
@@ -435,13 +435,13 @@
   
   <select id="findDemandCount" parameterType="String" resultType="java.lang.Integer">
   		select count(*)
-			from sc_demand a 
+			from sc_demand a left join sc_publisher b on a.publisher_id=b.id
 			where a.delete_sign=0
   	<if test="type != null">
   		and a.`type`= #{type,jdbcType=VARCHAR}
   	</if>
   	<if test="name != null">
-  		and a.name  like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+  		and b.name  like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
   	<if test="reserveButtUnit != null">
   		and a.reserve_butt_unit = #{reserveButtUnit,jdbcType=VARCHAR}

+ 29 - 13
src/main/java/com/goafanti/sc/bo/ScDemandListBo.java

@@ -11,6 +11,34 @@ public class ScDemandListBo {
 	
 	private String reserveButtUnit;
 
+	private String telephone;
+	private String address;
+	private String contacts;
+	public String getContacts() {
+		return contacts;
+	}
+
+	public void setContacts(String contacts) {
+		this.contacts = contacts;
+	}
+
+	public String getTelephone() {
+		return telephone;
+	}
+
+	public void setTelephone(String telephone) {
+		this.telephone = telephone;
+	}
+
+	public String getAddress() {
+		return address;
+	}
+
+	public void setAddress(String address) {
+		this.address = address;
+	}
+
+
 	public String getId() {
 		return id;
 	}
@@ -28,19 +56,7 @@ public class ScDemandListBo {
 	}
 
 	public String getIndustry() {
-		if (industry.equals("0")) {
-			return "先进制造与自动化";
-		}if (industry.equals("1")) {
-			return "电子信息技术";
-		}if (industry.equals("2")) {
-			return "新材料技术";
-		}if (industry.equals("3")) {
-			return "生物与新药";
-		}if (industry.equals("4")) {
-			return "资源与环境";
-		}if (industry.equals("5")) {
-			return "新能源";
-		}
+		
 		return industry;
 	}
 

+ 12 - 0
src/main/java/com/goafanti/sc/bo/inputAchievement.java

@@ -23,6 +23,8 @@ public class inputAchievement extends ScAchievement {
 	
 	private String createDateFormat;
 	
+	private String pIntroduce;
+	
 	private String industryName;
 	
 	private String provinceName;
@@ -124,4 +126,14 @@ public class inputAchievement extends ScAchievement {
 	public void setCityName(String cityName) {
 		this.cityName = cityName;
 	}
+
+	public String getpIntroduce() {
+		return pIntroduce;
+	}
+
+	public void setpIntroduce(String pIntroduce) {
+		this.pIntroduce = pIntroduce;
+	}
+
+
 }

+ 1 - 1
src/main/java/com/goafanti/sc/controller/ScAchievementApiController.java

@@ -109,7 +109,7 @@ public class ScAchievementApiController extends CertifyApiController {
      	 return res;
      }
      /**
-      * 删除成果
+      * 成果详情
       */
       @RequestMapping(value = "/AchievementDetails", method = RequestMethod.GET)
       private Result AchievementDetails(String id){

+ 0 - 25
src/main/java/com/goafanti/sc/controller/ScDemandApiController.java

@@ -29,18 +29,6 @@ public class ScDemandApiController extends CertifyApiController {
     @RequestMapping(value = "/addDemand", method = RequestMethod.POST)
     private Result addDemand(inputDemands a ) {
         Result res = new Result();
-        if (StringUtils.isBlank(a.getName())) {
-        	 res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "名称"));
-             return res;
-		}
-        if (StringUtils.isBlank(a.getIntroduce())) {
-       	 res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到介绍", "介绍"));
-            return res;
-		}
-       if (StringUtils.isBlank(a.getTelephone())) {
-         	 res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到负责人联系电话", "负责人联系电话"));
-              return res;
-  		}
        res.setData(ScDemandService.addDemands(a));
        return res;
     }
@@ -73,19 +61,6 @@ public class ScDemandApiController extends CertifyApiController {
      @RequestMapping(value = "/updateDemand", method = RequestMethod.POST)
      private Result updateDemand(inputDemands a){
      	Result res = new Result();
-     	 if (StringUtils.isBlank(a.getName())) {
-        	 res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "名称"));
-             return res;
-		}
-        if (StringUtils.isBlank(a.getIntroduce())) {
-       	 res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到介绍", "介绍"));
-            return res;
-		}
-        
-       if (StringUtils.isBlank(a.getTelephone())) {
-         	 res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到负责人联系电话", "负责人联系电话"));
-              return res;
-  		}
      	 res.setData(ScDemandService.updateDemand(a));
      	 return res;
      }

+ 0 - 2
src/main/java/com/goafanti/sc/service/ScDemandService.java

@@ -12,8 +12,6 @@ public interface ScDemandService {
 
 	int addDemands(inputDemands a);
 
-	
-
 	int delectDemand(String id);
 
 	int updateDemand(inputDemands a);

+ 4 - 3
src/main/java/com/goafanti/sc/service/impl/ScAchievementServiceImpl.java

@@ -30,16 +30,15 @@ public class ScAchievementServiceImpl extends BaseMybatisDao<ScAchievementMapper
 	@Override
 	public int addAchievements(inputAchievement a) {
 		ScPublisher s=new ScPublisher();
-		if(StringUtils.isNotBlank(a.getIntroduce()))s.setIntroduce(a.getIntroduce());
 		String pid=UUID.randomUUID().toString();
 		a.setId(UUID.randomUUID().toString());
 		a.setPublisherId(pid);
-		a.setIntroduce("");
 		scAchievementMapper.insertSelective(a);
 		s.setId(pid);
 		if(StringUtils.isNotBlank(a.getTelephone()))s.setTelephone(a.getTelephone());
 		if(StringUtils.isNotBlank(a.getEmail()))s.setEmail(a.getEmail());
 		if(StringUtils.isNotBlank(a.getZipCode()))s.setZipCode(a.getZipCode());
+		if(StringUtils.isNotBlank(a.getpIntroduce()))s.setIntroduce(a.getpIntroduce());
 		if(null!=a.getProvince())s.setProvince(a.getProvince());
 		if(null!=a.getCity())s.setCity(a.getCity());
 		if(StringUtils.isNotBlank(a.getPublisherName()))s.setContacts(a.getPublisherName());
@@ -79,11 +78,13 @@ public class ScAchievementServiceImpl extends BaseMybatisDao<ScAchievementMapper
 	@Override
 	public int updateAchievement(inputAchievement a) {
 		scAchievementMapper.updateByPrimaryKeySelective(a);
+		ScAchievement sa=scAchievementMapper.selectByPrimaryKey(a.getId());
 		ScPublisher s=new ScPublisher();
-		s.setId(a.getPublisherId());
+		s.setId(sa.getPublisherId());
 		if(StringUtils.isNotBlank(a.getTelephone()))s.setTelephone(a.getTelephone());
 		if(StringUtils.isNotBlank(a.getEmail()))s.setEmail(a.getEmail());
 		if(StringUtils.isNotBlank(a.getZipCode()))s.setZipCode(a.getZipCode());
+		if(StringUtils.isNotBlank(a.getpIntroduce()))s.setIntroduce(a.getpIntroduce());
 		if(null!=a.getProvince())s.setProvince(a.getProvince());
 		if(null!=a.getCity())s.setCity(a.getCity());
 		if(StringUtils.isNotBlank(a.getPublisherName()))s.setContacts(a.getPublisherName());

+ 23 - 1
src/main/java/com/goafanti/sc/service/impl/ScDmandServiceImpl.java

@@ -1,6 +1,7 @@
 package com.goafanti.sc.service.impl;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -16,6 +17,7 @@ import com.goafanti.common.model.ScPublisher;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.sc.bo.ScAchievementListBo;
 import com.goafanti.sc.bo.ScDemandListBo;
 import com.goafanti.sc.bo.inputAchievement;
@@ -44,9 +46,28 @@ public class ScDmandServiceImpl extends BaseMybatisDao<ScDemandMapper> implement
 		if(StringUtils.isNotBlank(name))params.put("name", name);
 		if(StringUtils.isNotBlank(reserveButtUnit))params.put("reserveButtUnit", reserveButtUnit);
 		if(StringUtils.isNotBlank(type))params.put("type", type);
-		return (Pagination<ScDemandListBo>) findPage("findDemandListByPage",
+		Pagination<ScDemandListBo>	p=	(Pagination<ScDemandListBo>) findPage("findDemandListByPage",
 				"findDemandCount",params,
 				pNo, pSize);
+		List<ScDemandListBo> l=(List<ScDemandListBo>) p.getList();
+		for (ScDemandListBo s : l) {
+		if(s!=null&&s.getIndustry()!=null){
+		if (s.getIndustry().equals("0")) {
+				s.setIndustry( "先进制造与自动化");
+		}if (s.getIndustry().equals("1")) {
+			s.setIndustry( "电子信息技术");
+		}if (s.getIndustry().equals("2")) {
+			s.setIndustry( "新材料技术");
+		}if (s.getIndustry().equals("3")) {
+			s.setIndustry( "生物与新药");
+		}if (s.getIndustry().equals("4")) {
+			s.setIndustry( "资源与环境");
+		}if (s.getIndustry().equals("5")) {
+			s.setIndustry( "新能源");
+			}
+		}
+		}
+				return p;
 	}
 
 	@Override
@@ -86,6 +107,7 @@ public class ScDmandServiceImpl extends BaseMybatisDao<ScDemandMapper> implement
 
 	@Override
 	public inputDemands demandDetails(String id) {
+		
 		return scDemandMapper.selectById(id);
 	}
 

+ 2 - 2
src/main/webapp/WEB-INF/views/sc/achievement.html

@@ -43,13 +43,13 @@
 			<div class="row">
 				<div class="col-xs-3">成果内容</div>
 				<div class="col-xs-9">
-				<span th:text="${achievementList.summary}?${achievementList.summary}:''"></span>	
+				<span th:text="${achievementList.introduce}?${achievementList.introduce}:''"></span>	
 				</div>
 			</div>
 			<div class="row">
 				<div class="col-xs-3">企业简介</div>
 				<div class="col-xs-9">
-					<span th:text="${achievementList.introduce}?${achievementList.introduce}:''"></span>
+					<span th:text="${achievementList.pIntroduce}?${achievementList.pIntroduce}:''"></span>
 				</div>
 			</div>
 			<div class="row">