Antiloveg 8 years ago
parent
commit
7f46afc0b3

+ 18 - 9
src/main/java/com/goafanti/common/mapper/DemandOrderMapper.xml

@@ -193,15 +193,21 @@
     where uid = #{0} and demand_id = #{1}
   </select>
   
-  <select id="findDemandOrderListByPage" parameterType="String" resultMap="BaseResultMap">
+  <select id="findDemandOrderListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandOrderListBo">
   	select 
-  	<include refid="Base_Column_List" />
-  	from demand_order 
-  	where deleted_sign = 0 and uid = #{uid,jdbcType=VARCHAR}
+  		do.id, do.serial_number as serialNumber, do.demand_id as demandId,
+  		do.create_time as createTime, do.enclosure_url as enclosureUrl, do.status,
+  		do.intention_money as intentionMoney, do.contract_money as contractMoney, do.commission,
+  		do.service_money as serviceMoney, d.name, d.serial_number as demandSerialNumber
+  	from demand_order do
+  	left join demand d on d.id = do.demand_id
+  	where do.deleted_sign = 0 
+  	and   d.deleted_sign = 0 
+  	and   do.uid = #{uid,jdbcType=VARCHAR}
   	<if test="status != null">
-  		and status = #{status,jdbcType=INTEGER}
+  		and do.status = #{status,jdbcType=INTEGER}
   	</if>
-  	order by serial_number desc
+  	order by do.serial_number desc
   	<if test="page_sql!=null">
 		${page_sql}
 	</if>
@@ -210,10 +216,13 @@
   <select id="findDemandOrderCount" parameterType="String" resultType="java.lang.Integer">
   	select 
   		count(1)
-  	from demand_order
-  	where deleted_sign = 0 and uid = #{uid,jdbcType=VARCHAR}
+  	from demand_order do
+  	left join demand d on d.id = do.demand_id
+  	where do.deleted_sign = 0 
+  	and   d.deleted_sign 
+  	and   do.uid = #{uid,jdbcType=VARCHAR}
   	<if test="status != null">
-  		and status = #{status,jdbcType=INTEGER}
+  		and do.status = #{status,jdbcType=INTEGER}
   	</if>
   </select>
 </mapper>

+ 180 - 0
src/main/java/com/goafanti/demand/bo/DemandOrderListBo.java

@@ -0,0 +1,180 @@
+package com.goafanti.demand.bo;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+import com.goafanti.common.constant.AFTConstants;
+
+public class DemandOrderListBo {
+	private String	id;
+
+	/**
+	 * 编号
+	 */
+	private Integer	serialNumber;
+
+	/**
+	 * 科技需求ID
+	 */
+	private String	demandId;
+
+
+	/**
+	 * 接单时间
+	 */
+	private Date	createTime;
+
+	/**
+	 * 附件URL
+	 */
+	private String	enclosureUrl;
+
+	/**
+	 * 流程变动(0--初始意向,1--意向金,2--签订合同,3--合同金,4--佣金,5--服务金,6--关闭)
+	 */
+	private Integer	status;
+
+	/**
+	 * 意向金
+	 */
+	private Integer	intentionMoney;
+
+	/**
+	 * 合同金
+	 */
+	private Integer	contractMoney;
+
+	/**
+	 * 佣金
+	 */
+	private Integer	commission;
+
+	/**
+	 * 服务金
+	 */
+	private Integer	serviceMoney;
+	
+	/**
+	 * 科技需求名称
+	 */
+	private String name;
+	
+	/**
+	 * 科技需求编号
+	 */
+	private Integer demandSerialNumber;
+	
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Integer getDemandSerialNumber() {
+		return demandSerialNumber;
+	}
+
+	public void setDemandSerialNumber(Integer demandSerialNumber) {
+		this.demandSerialNumber = demandSerialNumber;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public Integer getSerialNumber() {
+		return serialNumber;
+	}
+
+	public void setSerialNumber(Integer serialNumber) {
+		this.serialNumber = serialNumber;
+	}
+
+	public String getDemandId() {
+		return demandId;
+	}
+
+	public void setDemandId(String demandId) {
+		this.demandId = demandId;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getEnclosureUrl() {
+		return enclosureUrl;
+	}
+
+	public void setEnclosureUrl(String enclosureUrl) {
+		this.enclosureUrl = enclosureUrl;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Integer getIntentionMoney() {
+		return intentionMoney;
+	}
+
+	public void setIntentionMoney(Integer intentionMoney) {
+		this.intentionMoney = intentionMoney;
+	}
+
+	public Integer getContractMoney() {
+		return contractMoney;
+	}
+
+	public void setContractMoney(Integer contractMoney) {
+		this.contractMoney = contractMoney;
+	}
+
+	public Integer getCommission() {
+		return commission;
+	}
+
+	public void setCommission(Integer commission) {
+		this.commission = commission;
+	}
+
+	public Integer getServiceMoney() {
+		return serviceMoney;
+	}
+
+	public void setServiceMoney(Integer serviceMoney) {
+		this.serviceMoney = serviceMoney;
+	}
+
+	public String getCreateTimeFormattedDate() {
+		if (this.createTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDD);
+		}
+	}
+
+	public void setCreateTimeFormattedDate(String createTimeFormattedDate) {
+
+	}
+
+}

+ 2 - 1
src/main/java/com/goafanti/demand/service/DemandOrderService.java

@@ -3,6 +3,7 @@ package com.goafanti.demand.service;
 import com.goafanti.common.model.DemandOrder;
 import com.goafanti.common.model.DemandOrderLog;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.demand.bo.DemandOrderListBo;
 
 public interface DemandOrderService {
 
@@ -12,7 +13,7 @@ public interface DemandOrderService {
 
 	DemandOrder selectByPrimaryKey(String id);
 
-	Pagination<DemandOrder> listOrderList(Integer status, Integer pNo, Integer pSize);
+	Pagination<DemandOrderListBo> listOrderList(Integer status, Integer pNo, Integer pSize);
 
 	int updateShutdownByUser(DemandOrder order);
 

+ 3 - 2
src/main/java/com/goafanti/demand/service/impl/DemandOrderServiceImpl.java

@@ -17,6 +17,7 @@ import com.goafanti.common.model.DemandOrderLog;
 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.DemandOrderListBo;
 import com.goafanti.demand.service.DemandOrderService;
 
 @Service
@@ -57,7 +58,7 @@ public class DemandOrderServiceImpl extends BaseMybatisDao<DemandOrderMapper> im
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<DemandOrder> listOrderList(Integer status, Integer pNo, Integer pSize) {
+	public Pagination<DemandOrderListBo> listOrderList(Integer status, Integer pNo, Integer pSize) {
 		Map<String, Object> params = new HashMap<>();
 
 		if (null != status) {
@@ -73,7 +74,7 @@ public class DemandOrderServiceImpl extends BaseMybatisDao<DemandOrderMapper> im
 		if (pSize == null || pSize < 0 || pSize > 10) {
 			pSize = 10;
 		}
-		return (Pagination<DemandOrder>) findPage("findDemandOrderListByPage",
+		return (Pagination<DemandOrderListBo>) findPage("findDemandOrderListByPage",
 				"findDemandOrderCount", params, pNo, pSize);
 	}