Browse Source

订单管理

wanghui 7 years ago
parent
commit
5aef023a41

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

@@ -1021,6 +1021,7 @@
 			a.order_no as orderNo,
 			a.order_type as orderType,
 			date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
+			date_format(a.sign_time,'%Y-%m-%d') as signTime,
 			a.sign_total_amount as signTotalAmount,
 			a.actually_total_amount as actuallyTotalAmount,
 			a.order_status as orderStatus,
@@ -1179,7 +1180,7 @@
 			a.order_no as orderNo,
 			a.order_type as orderType,
 			date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
-			date_format(a.sign_time,'%Y-%m-%d %H:%i:%S') as signTime,
+			date_format(a.sign_time,'%Y-%m-%d') as signTime,
 			date_format(a.set_up_time,'%Y-%m-%d %H:%i:%S') as setUpTime,
 			date_format(a.settlement_time,'%Y-%m-%d %H:%i:%S') as settlementTime,
 			a.order_amount as orderAmount,
@@ -1189,6 +1190,7 @@
 			a.actually_total_amount as actuallyTotalAmount,
 			a.order_status as orderStatus,
 			a.order_stage as orderStage,
+			a.project_stage as projectStage,
 			a.delete_sign as deleteSign,
 			a.liquidation_status as liquidationStatus,
 			a.approval,
@@ -1198,6 +1200,7 @@
 			a.buyer_id as buyerId,
 			a.seller_id as sellerId,
 			a.buyer_id as buyerId,
+			b.type as buyerType,
 			b.nickname as buyerName,
 			c.name as salesmanName,
 			a.finance_id as financeId,

+ 8 - 0
src/main/java/com/goafanti/order/bo/OrderListBo.java

@@ -14,6 +14,8 @@ public class OrderListBo {
 	private String projectType;
 	/** 订单创建时间 **/
 	private String createTime;
+	/** 签单时间 **/
+	private String signTime;
 	/** 合同首付金额 **/
 	private String signFirstPayment;
 	/** 合同订单金额 **/
@@ -76,6 +78,12 @@ public class OrderListBo {
 	public void setCreateTime(String createTime) {
 		this.createTime = createTime;
 	}
+	public String getSignTime() {
+		return signTime;
+	}
+	public void setSignTime(String signTime) {
+		this.signTime = signTime;
+	}
 	public String getSignFirstPayment() {
 		return signFirstPayment;
 	}

+ 8 - 0
src/main/java/com/goafanti/order/bo/ServiceOrderDetailBo.java

@@ -17,6 +17,8 @@ public class ServiceOrderDetailBo extends OrderListBo{
 	private String contractPictureUrl;
 	/** 买家 id **/
 	private String buyerId;
+	/** 买家类型 **/
+	private int buyerType;
 	/** 订单负责人 **/
 	private String salesmanId;
 	/** 财务负责人 **/
@@ -75,6 +77,12 @@ public class ServiceOrderDetailBo extends OrderListBo{
 	public void setBuyerId(String buyerId) {
 		this.buyerId = buyerId;
 	}
+	public int getBuyerType() {
+		return buyerType;
+	}
+	public void setBuyerType(int buyerType) {
+		this.buyerType = buyerType;
+	}
 	public String getSalesmanId() {
 		return salesmanId;
 	}

+ 2 - 2
src/main/java/com/goafanti/order/controller/AdminOrderApiController.java

@@ -92,7 +92,7 @@ public class AdminOrderApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value = "/signServiceOrder", method = RequestMethod.POST)
 	public Result signServiceOrder(String orderNo,String contractNo,String signFirstPayment,String signTotalAmount,
-			String approval,String orderRemarks){
+			String approval,String orderRemarks,String signTime){
 		Result res = new Result();
 		if(StringUtils.isBlank(orderNo)){
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "订单编号"));
@@ -106,7 +106,7 @@ public class AdminOrderApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "特批状态"));
 			return res;
 		}
-		orderServiceImpl.updateSignServiceOrder(orderNo,contractNo,signFirstPayment,signTotalAmount,approval,orderRemarks);
+		orderServiceImpl.updateSignServiceOrder(orderNo,contractNo,signFirstPayment,signTotalAmount,approval,orderRemarks,signTime);
 		return res;
 	}
 	

+ 1 - 1
src/main/java/com/goafanti/order/service/OrderService.java

@@ -148,7 +148,7 @@ public interface OrderService {
 	 * @return
 	 */
 	int updateSignServiceOrder(String orderNo,String contractNo,String signFirstPayment, String signTotalAmount,
-			String approval,String orderRemarks);
+			String approval,String orderRemarks,String signTime);
 
 	/**
 	 * 作废订单

+ 10 - 6
src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java

@@ -868,21 +868,24 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 
 	@Override
 	public int updateSignServiceOrder(String orderNo,String contractNo, String signFirstPayment, String signTotalAmount,
-			String approval,String orderRemarks) {
+			String approval,String orderRemarks,String signTime) {
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
 		checkOrder(tOrder);
 		if (tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()) {
 			throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT, orderNo, ""));
 		} else {
-			Date signTime = new Date();
 			tOrder.setSignFirstPayment(new BigDecimal(signFirstPayment));
 			tOrder.setSignTotalAmount(new BigDecimal(signTotalAmount));
 			tOrder.setOrderStage(OrderStage.SIGNED.getCode());
 			tOrder.setOrderStatus(OrderState.ALREADY_SIGN.getCode());
 			tOrder.setProjectStage(ProjectStage.WAIT_SET_UP.getCode());
 			tOrder.setApproval(Integer.valueOf(approval));
-			tOrder.setUpdateTime(signTime);
-			tOrder.setSignTime(signTime);
+			tOrder.setUpdateTime(new Date());
+			try {
+				tOrder.setSignTime(DateUtils.parseDate(signTime, AFTConstants.YYYYMMDD));
+			} catch (ParseException e) {
+				e.printStackTrace();
+			}
 			tOrder.setOrderRemarks(orderRemarks);
 			tOrder.setContractNo(contractNo);
 			tOrderMapper.updateByPrimaryKeySelective(tOrder);
@@ -1361,6 +1364,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	@Transactional
 	public int updateSetUpProject(String orderNo, String signComment) {
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
+		Date createTime = new Date();
 		checkOrder(tOrder);
 		boolean flag = false;
 		if(tOrder.getOrderStatus() == OrderState.ALREADY_SIGN.getCode()){
@@ -1374,13 +1378,13 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		if(!flag) 
 			throw new BusinessException(new Error(ErrorConstants.ORDER_CAN_NOT_MODIFY, orderNo, ""));
 		tOrder.setProjectStage(ProjectStage.ALREADY_SET_UP.getCode());
-		tOrder.setUpdateTime(new Date());
+		tOrder.setUpdateTime(createTime);
+		tOrder.setSignTime(createTime);
 		tOrderMapper.updateByPrimaryKeySelective(tOrder);
 		//-------------- 查询订单详情 --------------------------
 		List<TOrderDetail> detailList = tOrderMapper.selectOrderCommodity(orderNo);
 		List<ContractTask> taskList = new ArrayList<>();
 		ContractTask task = null;
-		Date createTime = new Date();
 		Contract contract = new Contract();
 		String contractId = UUID.randomUUID().toString().replace("-", "");
 		contract.setId(contractId);