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

+ 16 - 0
src/main/java/com/goafanti/admin/controller/AdminDemandApiController.java

@@ -29,6 +29,22 @@ public class AdminDemandApiController extends CertifyApiController {
 	@Resource
 	private DemandService demandService;
 	
+	/**
+	 * 个人需求详情
+	 */
+	@RequestMapping(value = "/userDemandDeatail", method = RequestMethod.GET)
+	public Result userDemandDetail(String id){
+		Result res = new Result();
+		
+		if (StringUtils.isBlank(id)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
+			return res;
+		}
+		
+		res.setData(demandService.selectUserDemandDetail(id));
+		return res;
+	}
+	
 	
 	/**
 	 * 需求资料--图片上传

+ 3 - 0
src/main/java/com/goafanti/common/dao/DemandMapper.java

@@ -1,6 +1,7 @@
 package com.goafanti.common.dao;
 
 import com.goafanti.common.model.Demand;
+import com.goafanti.demand.bo.DemandManageDetailBo;
 
 public interface DemandMapper {
     int deleteByPrimaryKey(String id);
@@ -14,4 +15,6 @@ public interface DemandMapper {
     int updateByPrimaryKeySelective(Demand record);
 
     int updateByPrimaryKey(Demand record);
+
+	DemandManageDetailBo selectUserDemandDetail(String id);
 }

+ 17 - 0
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -690,4 +690,21 @@
 	</if>
   </select>
   
+  <select id="selectUserDemandDetail" parameterType="java.lang.String" resultType="com.goafanti.demand.bo.DemandManageDetailBo">
+  	select 
+  		d.id, d.serial_number as serialNumber, d.data_category as dataCategory,
+  		d.name, d.keyword, d.info_sources as infoSources,
+  		ui.username, d.demand_type as demandType, d.validity_period as validityPeriod,
+  		ui.province, d.status, d.release_status as releaseStatus,
+  		d.release_date as releaseDate, a.name as principalId, d.industry_category_a as industryCategoryA,
+  		d.industry_category_b as industryCategoryB, d.problem_des as problemDes, d.technical_requirements as technicalRequirements,
+  		d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
+  		d.budget_cost as budgetCost, d.fixed_cycle as fixedCycle, d.people_number as peopleNumber,
+  		d.fixed_scheme as fixedScheme, d.cost_escrow as costEscrow, d.employer_id as employerId
+  	from demand d 
+  	left join user_identity ui on ui.uid = d.employer_id
+  	left join admin a on a.id = d.principal_id
+  	where d.data_category = 0 and d.id = #{id,jdbcType=VARCHAR}
+  </select>
+  
 </mapper>

+ 144 - 0
src/main/java/com/goafanti/demand/bo/DemandManageDetailBo.java

@@ -0,0 +1,144 @@
+package com.goafanti.demand.bo;
+
+import java.math.BigDecimal;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+
+public class DemandManageDetailBo extends DemandManageListBo {
+
+	private Integer		industryCategoryA;
+
+	private Integer		industryCategoryB;
+
+	private String		problemDes;
+
+	private String		technicalRequirements;
+
+	private String		pictureUrl;
+
+	private String		textFileUrl;
+
+	private String		videoUrl;
+
+	private BigDecimal	budgetCost;
+
+	private String		fixedCycle;
+
+	private Integer		peopleNumber;
+
+	private String		fixedScheme;
+
+	private BigDecimal	costEscrow;
+
+	private String		employerId;
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getIndustryCategoryA() {
+		return industryCategoryA;
+	}
+
+	public void setIndustryCategoryA(Integer industryCategoryA) {
+		this.industryCategoryA = industryCategoryA;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getIndustryCategoryB() {
+		return industryCategoryB;
+	}
+
+	public void setIndustryCategoryB(Integer industryCategoryB) {
+		this.industryCategoryB = industryCategoryB;
+	}
+
+	public String getProblemDes() {
+		return problemDes;
+	}
+
+	public void setProblemDes(String problemDes) {
+		this.problemDes = problemDes;
+	}
+
+	public String getTechnicalRequirements() {
+		return technicalRequirements;
+	}
+
+	public void setTechnicalRequirements(String technicalRequirements) {
+		this.technicalRequirements = technicalRequirements;
+	}
+
+	public String getPictureUrl() {
+		return pictureUrl;
+	}
+
+	public void setPictureUrl(String pictureUrl) {
+		this.pictureUrl = pictureUrl;
+	}
+
+	public String getTextFileUrl() {
+		return textFileUrl;
+	}
+
+	public void setTextFileUrl(String textFileUrl) {
+		this.textFileUrl = textFileUrl;
+	}
+
+	public String getVideoUrl() {
+		return videoUrl;
+	}
+
+	public void setVideoUrl(String videoUrl) {
+		this.videoUrl = videoUrl;
+	}
+
+	public BigDecimal getBudgetCost() {
+		return budgetCost;
+	}
+
+	public void setBudgetCost(BigDecimal budgetCost) {
+		this.budgetCost = budgetCost;
+	}
+
+	public String getFixedCycle() {
+		return fixedCycle;
+	}
+
+	public void setFixedCycle(String fixedCycle) {
+		this.fixedCycle = fixedCycle;
+	}
+
+	public Integer getPeopleNumber() {
+		return peopleNumber;
+	}
+
+	public void setPeopleNumber(Integer peopleNumber) {
+		this.peopleNumber = peopleNumber;
+	}
+
+	public String getFixedScheme() {
+		return fixedScheme;
+	}
+
+	public void setFixedScheme(String fixedScheme) {
+		this.fixedScheme = fixedScheme;
+	}
+
+	public BigDecimal getCostEscrow() {
+		return costEscrow;
+	}
+
+	public void setCostEscrow(BigDecimal costEscrow) {
+		this.costEscrow = costEscrow;
+	}
+
+	public String getEmployerId() {
+		return employerId;
+	}
+
+	public void setEmployerId(String employerId) {
+		this.employerId = employerId;
+	}
+	
+	
+
+}

+ 3 - 0
src/main/java/com/goafanti/demand/service/DemandService.java

@@ -2,6 +2,7 @@ package com.goafanti.demand.service;
 
 import com.goafanti.common.model.Demand;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.demand.bo.DemandManageDetailBo;
 import com.goafanti.demand.bo.DemandManageListBo;
 
 public interface DemandService {
@@ -20,4 +21,6 @@ public interface DemandService {
 
 	int updateUserDemandByManager(Demand d, String validityPeriodFormattedDate);
 
+	DemandManageDetailBo selectUserDemandDetail(String id);
+
 }

+ 6 - 0
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -24,6 +24,7 @@ import com.goafanti.common.utils.DateUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.demand.bo.DemandManageDetailBo;
 import com.goafanti.demand.bo.DemandManageListBo;
 import com.goafanti.demand.service.DemandService;
 
@@ -352,4 +353,9 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		}
 		return demandMapper.updateByPrimaryKeySelective(d);
 	}
+
+	@Override
+	public DemandManageDetailBo selectUserDemandDetail(String id) {
+		return demandMapper.selectUserDemandDetail(id);
+	}
 }