Browse Source

Accept Merge Request #289 更新生产 : (test -> prod)

Merge Request: 更新生产
Created By: @浅川
Accepted By: @浅川
URL: https://coding.net/t/aft/p/AFT/git/merge/289
浅川 8 years ago
parent
commit
0305b8052a

+ 2 - 0
src/main/java/com/goafanti/common/constant/ErrorConstants.java

@@ -129,4 +129,6 @@ public class ErrorConstants {
 	public static final String ORDER_NOT_EXIST						= "ORDER_NOT_EXIST";
 	
 	public static final String PAY_BEYOND_SIGN						= "PAY_BEYOND_SIGN";
+	
+	public static final String BILL_ALREADY_EXPIRE					= "BILL_ALREADY_EXPIRE";
 }

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

@@ -1329,7 +1329,7 @@
   	where a.deleted_sign = 0 
   	and ap.publish_client=0
 	and ap.publish_page='W02'
-	and bi.domain_name like '%#{url,jdbcType=VARCHAR}%'
+	and bi.domain_name like "%"#{url,jdbcType=VARCHAR}"%"
   	<if test="dataCategory != null and dataCategory != ''">
   		and a.data_category = #{dataCategory,jdbcType=INTEGER}
   	</if>

+ 0 - 2
src/main/java/com/goafanti/common/mapper/AchievementPublishMapper.xml

@@ -372,8 +372,6 @@ left join achievement a on ap.achievement_id=a.id
 left join admin ad on ap.publisher=ad.id
 left join branch_information bi on ap.publish_platform=bi.id
 where 1=1
-	and ap.publish_client = '1'
-	and ap.publish_page = 'W01'
 	<if test="name != null">
   	and a.name like "%"#{name,jdbcType=VARCHAR}"%"
   	</if>

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

@@ -729,6 +729,7 @@
 			commodity_mode,
 			commodity_type,
 			commodity_quantity,
+			task_status,
 			create_time
 		)
 	values
@@ -741,6 +742,7 @@
 		#{item.commodityMode,jdbcType=VARCHAR}, 
 		#{item.commodityType,jdbcType=INTEGER},
 		#{item.commodityQuantity,jdbcType=INTEGER},
+		#{item.taskStatus,jdbcType=INTEGER},
 		#{item.createTime,jdbcType=TIMESTAMP}
 	  )
     </foreach>

+ 7 - 0
src/main/java/com/goafanti/common/mapper/DemandPublishMapper.xml

@@ -383,6 +383,10 @@ where 1=1
 	<if test="publishClient != null">
 		and dp.publish_client = #{publishClient,jdbcType=INTEGER}
 	</if>
+	
+	<if test="publishPage != null">
+		and dp.publish_page =#{publishPage,jdbcType=INTEGER}
+	</if>
 	<if test="ifTop != null">
 		and dp.if_top =#{ifTop,jdbcType=INTEGER}
 
@@ -403,6 +407,9 @@ where 1=1
 <if test="name != null">
   	and d.name like "%"#{name,jdbcType=VARCHAR}"%"
   	</if>
+  	<if test="publishPage != null">
+		and dp.publish_page =#{publishPage,jdbcType=INTEGER}
+	</if>
   	<if test="userName != null">
   	and d.owner_name = = #{userName,jdbcType=VARCHAR}
   	</if>

+ 15 - 15
src/main/java/com/goafanti/common/mapper/MarketingManagementMapper.xml

@@ -354,7 +354,7 @@
   <select id="selectMarketList" resultType="com.goafanti.marketing.bo.MarketingManagementBo">
   	<if test="category == 1"> <!-- 成果 -->
   		select
-	x.id,
+	x.id as productId,
 	x.owner_type as ownerType,
 	x.summary,
 	x.name,
@@ -382,20 +382,20 @@ where x.audit_status = 3
 	and bi.domain_name like "%"#{url,jdbcType=VARCHAR}"%" 
   	</if>
   	<if test="category == 7"> <!-- 智者 -->
-  		select 
-  		u.id,i.username,ua.ability_label as abilityLabel,
-  		c.achievement,u.head_portrait_url as headPortraitUrl,u.type,i.expert 
-  		from `user` u
-  		left join user_ability ua on u.id=ua.uid
-  		left join user_career c on u.id=c.uid
-  		left join user_identity i on u.id=i.uid
-  		right join expert_publish ep on ep.expert_id=u.id
-  		left join branch_information bi on bi.id=ep.publish_platform
-  		WHERE
-		u.type = 0 and 
-		i.expert = 1	
-		and ep.publish_client='0'
-		and ep.publish_page='W01'
+  		select
+                u.id,i.username,ua.ability_label as abilityLabel,
+                u.introduction as achievement,u.head_portrait_url as headPortraitUrl,u.type,i.expert
+                from `user` u
+                left join user_ability ua on u.id=ua.uid
+                left join user_career c on u.id=c.uid
+                left join user_identity i on u.id=i.uid
+                right join expert_publish ep on ep.expert_id=u.id
+                left join branch_information bi on bi.id=ep.publish_platform
+                WHERE
+                u.type = 0 and
+                i.expert = 1
+                and ep.publish_client='0'
+                and ep.publish_page='W01'
 		and bi.domain_name like "%"#{url,jdbcType=VARCHAR}"%" 
 		
   	</if>

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

@@ -902,11 +902,11 @@
     <include refid="Base_Column_List" />
     from t_order where delete_sign = 0
     <choose>
-    	<when test="intentionStatus == 0"><!-- 意向订单 -->
-    		and order_status = 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id =  #{uid,jdbcType=VARCHAR})
+    	<when test="orderStatus == 1"><!-- 意向订单 -->
+    		and order_status = 1 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id =  #{uid,jdbcType=VARCHAR})
     	</when>
     	<otherwise>
-    		and order_status != 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id =  #{uid,jdbcType=VARCHAR})
+    		and order_status != 1 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id =  #{uid,jdbcType=VARCHAR})
     	</otherwise>
     </choose>
     order by create_time desc
@@ -920,11 +920,11 @@
   		count(0) 
   	from t_order where delete_sign = 0
     <choose>
-    	<when test="intentionStatus == 0"><!-- 意向订单 -->
-    		and order_status = 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id =  #{uid,jdbcType=VARCHAR})
+    	<when test="orderStatus == 0"><!-- 意向订单 -->
+    		and order_status = 1 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id =  #{uid,jdbcType=VARCHAR})
     	</when>
     	<otherwise>
-    		and order_status != 0  and buyer_id = #{uid,jdbcType=VARCHAR}
+    		and order_status != 1  and buyer_id = #{uid,jdbcType=VARCHAR}
     	</otherwise>
     </choose>
   </select>

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

@@ -1041,6 +1041,7 @@
 				group by  seller_id ) o on t.uid=o.seller_id
 	where expert=1
 	and u.status !=1
+	and t.expert_audit =2
 	<if test="industry != null">
         and t.industry = #{industry,jdbcType=VARCHAR}
     </if>

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

@@ -31,7 +31,6 @@
 		left join industry_category c on b.industry = c.id
 		left join admin d on a.aid = d.id 		
 		where a.type = 0  and a.status != 1 and a.audit_status = 1	
-		AND a.audit_status=1
 		<if test="aid != null and aid !=''">
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
@@ -95,20 +94,22 @@
 	</select>
 	<select id="selectPersonalCustomerCount" resultType="java.lang.Integer">
 		select count(0)
-			from user a inner join user_identity b on a.id = b.uid
+		from user a inner join user_identity b on a.id = b.uid
 		left join district_glossory dg1 on b.province = dg1.id
 		left join district_glossory dg2 on b.city = dg2.id
 		left join district_glossory dg3 on b.area = dg3.id
 		left join industry_category c on b.industry = c.id
 		left join admin d on a.aid = d.id 		
 		where a.type = 0  and a.status != 1 and a.audit_status = 1	
-		AND b.expert_audit=2
 		<if test="aid != null and aid !=''">
 			and a.aid = #{aid,jdbcType=VARCHAR}
 		</if>
 		<if test="name != null and name != ''">
 			and a.identify_name like concat('%',#{name},'%')
 		</if>
+		<if test="expertAudit != null and expertAudit !=''">
+			and b.expert_audit = #{expertAudit,jdbcType=VARCHAR}
+		</if>
 		<if test="shareType != null">
 			and a.share_type = #{shareType,jdbcType=VARCHAR}
 		</if>
@@ -912,7 +913,6 @@
 		left join admin d on a.aid = d.id
 		LEFT JOIN department_management dm on dm.id = d.department_id 		
 		where a.type = 0  and a.status != 1 and a.audit_status = 1
-		AND a.audit_status=1
 		and a.share_type =0
 		<if test="aid != null and aid !=''">
 			and (a.aid = #{aid,jdbcType=VARCHAR} or d.department_id=(select department_id from admin where id=#{aid,jdbcType=VARCHAR}))

+ 1 - 2
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -51,7 +51,7 @@ import com.goafanti.customer.bo.UserDetailBo;
 import com.goafanti.customer.service.CustomerService;
 
 @RestController
-@RequestMapping("api/admin/customer")
+@RequestMapping("/api/admin/customer")
 public class AdminCustomerApiController extends BaseApiController{
 	@Resource
 	private CustomerService customerService;
@@ -89,7 +89,6 @@ public class AdminCustomerApiController extends BaseApiController{
 	@RequestMapping(value = "/listAllManagePersonalCustomer" , method = RequestMethod.POST)
 	public Result listAllManagePersonalCustomer(CustomerListIn cli,Integer pageNo, Integer pageSize){
 		Result res = new Result();
-		cli.setAid(TokenManager.getAdminId());
 		res.setData(customerService.listAllManagePersonalCustomer(cli, pageNo, pageSize));
 		return res;
 	}

+ 0 - 2
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -97,7 +97,6 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 	@Override
 	public Pagination<CustomerListOut> listPublicPersonalCustomer(CustomerListIn cli, Integer pageNo,Integer pageSize) {
 		cli.setType(AFTConstants.USER_TYPE_PERSONAL);
-		cli.setAid(TokenManager.getAdminId());
 		cli.setShareType(String.valueOf(AFTConstants.USER_SHARE_PUBLIC));
 		Map<String,Object> params = disposeParams(cli);
 		@SuppressWarnings("unchecked")
@@ -108,7 +107,6 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 	@Override
 	public Pagination<CustomerListOut> listAllPersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize) {
 		cli.setType(AFTConstants.USER_TYPE_PERSONAL);
-		cli.setAid(TokenManager.getAdminId());
 		cli.setShareType(String.valueOf(AFTConstants.USER_SHARE_PRIVATE));
 		Map<String,Object> params = disposeParams(cli);
 		if(null!=cli.getExpertAudit())params.put("expertAudit", cli.getExpertAudit());

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

@@ -235,31 +235,24 @@ public class AdminOrderApiController extends CertifyApiController {
 		return res;
 	}
 	
-	
 	/**
 	 * 修改订单商品
 	 * @param detailId
 	 * @param orderNo
-	 * @param oldCommodityPrice
-	 * @param oldDiscountPrice
-	 * @param oldCommodityQuantity
-	 * @param newCommodityId
-	 * @param newCommodityPrice
-	 * @param newDiscountPrice
-	 * @param newCommodityQuantity
-	 * @param newRemarks
+	 * @param discountPrice
+	 * @param discountFirstPayment
+	 * @param commodityQuantity
+	 * @param remarks
 	 * @return
 	 */
-	public Result updateOrderCommodity(String detailId,String orderNo,String oldCommodityPrice,String oldDiscountPrice,Integer oldCommodityQuantity,
-			String commodityId, String commodityName,String commodityMode, Integer commodityQuantity,Integer commodityType,
-			String commodityPrice, String discountPrice,String commodityFirstPayment,String discountFirstPayment,String remarks){
+	@RequestMapping(value = "/updateOrderCommodity", method = RequestMethod.POST)
+	public Result updateOrderCommodity(String detailId,String discountPrice,String discountFirstPayment,Integer commodityQuantity,String remarks){
 		Result res = new Result();
 		if(StringUtils.isBlank(detailId)){
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","详情编号"));
 			return res;
 		}
-		orderServiceImpl.updateOrderCommodity(detailId, commodityId, commodityName, commodityMode, commodityQuantity, 
-				commodityType, commodityPrice, discountPrice, commodityFirstPayment, discountFirstPayment, remarks);
+		orderServiceImpl.updateOrderCommodity(detailId,discountPrice, discountFirstPayment,commodityQuantity, remarks);
 		return res;
 	}
 	

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

@@ -172,22 +172,15 @@ public interface OrderService {
 			String commodityPrice, String discountPrice,String commodityFirstPayment,String discountFirstPayment, String remarks);
 	
 	/**
-	 * 修改订单商品
+	 * 修改商品信息
 	 * @param detailId
-	 * @param commodityId
-	 * @param commodityName
-	 * @param commodityMode
-	 * @param commodityQuantity
-	 * @param commodityType
-	 * @param commodityPrice
+	 * @param orderNo
 	 * @param discountPrice
-	 * @param commodityFirstPayment
 	 * @param discountFirstPayment
 	 * @param remarks
 	 * @return
 	 */
-	int updateOrderCommodity(String detailId,String commodityId, String commodityName,String commodityMode, Integer commodityQuantity,Integer commodityType,
-			String commodityPrice, String discountPrice,String commodityFirstPayment,String discountFirstPayment,String remarks);
+	int updateOrderCommodity(String detailId,String discountPrice,String discountFirstPayment,Integer commodityQuantity,String remarks);
 
 	/**
 	 * 删除订单商品

+ 40 - 50
src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java

@@ -117,7 +117,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	}
 
 	/**
-	 * to update 18
+	 * 只能购买一份
 	 * 后期规则:自营服务订单 、需求订单、其他订单不能同时加入购物车
 	 */
 	@Override
@@ -130,7 +130,6 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				: new BigDecimal(Double.valueOf(bo.getCommodityFirstPayment()));
 		BigDecimal discountPrice = commodityPrice.multiply(new BigDecimal(DEFAULT_COMMODITY_DISCOUNT));
 		BigDecimal discountFirstPayment = commodityFirstPayment.multiply(new BigDecimal(DEFAULT_COMMODITY_DISCOUNT));
-		BigDecimal orderAmount = discountPrice.multiply(new BigDecimal(commodityQuantity));
 		TOrder tOrder = new TOrder();
 		tOrder.setOrderNo(orderNo);	
 		tOrder.setCreater(DEFAULT_CREATER);
@@ -144,13 +143,17 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		}
 		tOrder.setOrderType(commodityType);
 		tOrder.setBrokerageAmount(discountPrice.multiply(new BigDecimal(DEFAULT_BROKERAGE_PROPORTION)));
-		tOrder.setFirstPayment(DEFAULT_FIRST_PAYMENT);
-		tOrder.setOrderAmount(orderAmount);
-		tOrder.setOrderRemarks(remarks);
+		tOrder.setOrderAmount(commodityPrice);
+		tOrder.setFirstPayment(commodityFirstPayment);
+		tOrder.setSignTotalAmount(discountPrice);
+		tOrder.setSignFirstPayment(discountFirstPayment);
+		tOrder.setSignBrokerageAmount(discountPrice.multiply(new BigDecimal(DEFAULT_BROKERAGE_PROPORTION)));
+		tOrder.setSignWithdrawAmount(discountPrice.subtract(discountPrice.multiply(new BigDecimal(DEFAULT_BROKERAGE_PROPORTION))));
 		tOrder.setDeleteSign(DeleteStatus.UNDELETE.getCode());
 		tOrder.setOrderChannel(OrderChannel.APP.getCode());
 		tOrder.setApproval(ApprovalState.NORMAL.getCode());
 		tOrder.setSalesmanId(getSalesmanIdByUid(TokenManager.getAdminId()));
+		tOrder.setOrderRemarks(remarks);
 		setOrderState(OrderAction.ADD_INTENTION, new BigDecimal(0), tOrder, false);
 		
 		TOrderDetail tOrderDetail = new TOrderDetail();
@@ -190,13 +193,9 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			tOrder.setOrderStage(OrderStage.INTENTION.getCode());
 			tOrder.setProjectStage(ProjectStage.NOT_SATISFY_CONDITION.getCode());
 			tOrder.setLiquidationStatus(LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode());
-			tOrder.setSignFirstPayment(initial);
 			tOrder.setActuallyFirstPayment(initial);
-			tOrder.setSignBrokerageAmount(initial);
 			tOrder.setActuallyBrokerageAmount(initial);
-			tOrder.setSignTotalAmount(initial);
 			tOrder.setActuallyTotalAmount(initial);
-			tOrder.setSignWithdrawAmount(initial);
 			tOrder.setActuallyWithdrawAmount(initial);
 		}else if(orderAction == OrderAction.CONFIRM_INTENTION){ //确认意向订单 (用户确认)
 			if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_CONFIRM.getCode()){
@@ -217,21 +216,25 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			if(boundary2 == 1){
 				throw new BusinessException(new Error(ErrorConstants.PAY_BEYOND_SIGN,"支付首付款"));
 			}else if(boundary2 == 0){ //全付清
+				System.out.println("-----------全付清-------------");
 				tOrder.setActuallyTotalAmount(tOrder.getSignTotalAmount());
 				tOrder.setActuallyFirstPayment(tOrder.getSignFirstPayment());
 				tOrder.setLiquidationStatus(LiquidationState.ALREADY_PAY.getCode());
 				tOrder.setProjectStage(ProjectStage.WAIT_SET_UP.getCode());
 			}else if(boundary == 1){ //超过首付未达尾款
+				System.out.println("-----------超过首付未达尾款-------------");
 				tOrder.setActuallyTotalAmount(tOrder.getActuallyTotalAmount().add(changeAmount));
 				tOrder.setActuallyFirstPayment(tOrder.getSignFirstPayment());
 				tOrder.setLiquidationStatus(LiquidationState.WAIT_PAY_LAST_BALANCE.getCode());
 				tOrder.setProjectStage(ProjectStage.WAIT_SET_UP.getCode());
 			}else if(boundary == -1){ //首付待付清
+				System.out.println("-----------首付待付清-------------");
 				tOrder.setActuallyTotalAmount(tOrder.getActuallyTotalAmount().add(changeAmount));
 				tOrder.setActuallyFirstPayment(tOrder.getActuallyFirstPayment().add(changeAmount));
 			}else if(boundary == 0){ //首付已结清
+				System.out.println("-----------首付已结清-------------");
 				tOrder.setActuallyTotalAmount(tOrder.getActuallyTotalAmount().add(changeAmount));
-				tOrder.setActuallyFirstPayment(tOrder.getActuallyFirstPayment().add(changeAmount));
+				tOrder.setActuallyFirstPayment(tOrder.getSignFirstPayment());
 				tOrder.setLiquidationStatus(LiquidationState.WAIT_PAY_LAST_BALANCE.getCode());
 				tOrder.setProjectStage(ProjectStage.WAIT_SET_UP.getCode());
 			}
@@ -241,7 +244,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			}
 			int boundary = tOrder.getActuallyTotalAmount().add(changeAmount).compareTo(tOrder.getSignTotalAmount());
 			if(boundary == 1){
-				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"支付尾款"));
+				throw new BusinessException(new Error(ErrorConstants.PAY_BEYOND_SIGN,"支付尾款"));
 			}else if(boundary == -1){
 				tOrder.setActuallyTotalAmount(tOrder.getActuallyTotalAmount().add(changeAmount));
 			}else if(boundary == 0){
@@ -267,7 +270,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		}else if(orderAction == OrderAction.APPLY_FOR_CANCEL){ //取消订单
 			boolean flag = true;
 			if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_CONFIRM.getCode()
-					|| tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()){
+					&& tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()){
 				flag = false;
 			}
 			if(tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()
@@ -287,12 +290,12 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				if(TokenManager.getUserId().equals(tOrder.getSellerId())){
 					if(tOrder.getOrderStatus() == OrderState.WAIT_FOR_CONFIRM.getCode())
 						tOrder.setOrderStatus(OrderState.SELLER_REFUSE_BEFORE_SIGNL.getCode());
-					if( tOrder.getOrderStatus() == OrderState.WAIT_FOR_SIGN.getCode())
+					if( tOrder.getOrderStatus() == OrderState.ALREADY_SIGN.getCode())
 						tOrder.setOrderStatus(OrderState.SELLER_CANCEL_AFTER_SIGN.getCode());
 				}else if(TokenManager.getUserId().equals(tOrder.getBuyerId())){
 					if(tOrder.getOrderStatus() == OrderState.WAIT_FOR_CONFIRM.getCode())
 						tOrder.setOrderStatus(OrderState.BUYER_CANCEL_BEFORE_SIGN.getCode());
-					if( tOrder.getOrderStatus() == OrderState.WAIT_FOR_SIGN.getCode())
+					if( tOrder.getOrderStatus() == OrderState.ALREADY_SIGN.getCode())
 						tOrder.setOrderStatus(OrderState.BUYER_CANCEL_AFTER_SIGN.getCode());
 				}
 			}		
@@ -389,12 +392,14 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					active.setConfirmIntention(false);
 					active.setRefuseIntention(false);
 				}
-				if (tOrder.getLiquidationStatus() == LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()) {
+				if ((tOrder.getOrderStatus() == OrderState.WAIT_FOR_SIGN.getCode() || tOrder.getOrderStatus() == OrderState.ALREADY_SIGN.getCode())
+						&& tOrder.getLiquidationStatus() == LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()) {
 					active.setPayForFirst(true); //支付首付
 				} else {
 					active.setPayForFirst(false); //支付首付
 				}
-				if (tOrder.getLiquidationStatus() == LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()) {
+				if ((tOrder.getOrderStatus() == OrderState.WAIT_FOR_SIGN.getCode() || tOrder.getOrderStatus() == OrderState.ALREADY_SIGN.getCode())
+						&& tOrder.getLiquidationStatus() == LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()) {
 					active.setPayForLast(true); //支付尾款
 				} else {
 					active.setPayForLast(false); //支付尾款
@@ -624,8 +629,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		addFundRecord(orderNo, TokenManager.getUserToken().getNickname(), DEFAULT_PLATFORM_ID, TokenManager.getUserId(), remarks, 
 				TransactionSubject.SUPPLY_PAY,PayChannel.UNIONPAY, fundAmount, TransactionMode.OFFLINE, AuditState.WAIT_AUDIT);
 		tOrder.setUpdateTime(new Date());
-		tOrderMapper.updateByPrimaryKeySelective(tOrder);
-		return 1;
+		return tOrderMapper.updateByPrimaryKeySelective(tOrder);
 	}
 
 	@Override
@@ -634,17 +638,15 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		addFundRecord(orderNo, TokenManager.getUserToken().getNickname(), DEFAULT_PLATFORM_ID, TokenManager.getUserId(), remarks, 
 				TransactionSubject.SUPPLY_PAY,PayChannel.UNIONPAY, fundAmount, TransactionMode.OFFLINE, AuditState.WAIT_AUDIT);
 		tOrder.setUpdateTime(new Date());
-		tOrderMapper.updateByPrimaryKeySelective(tOrder);
-		return 1;
+		return tOrderMapper.updateByPrimaryKeySelective(tOrder);
 	}
 
 	@SuppressWarnings("unchecked")
 	@Override
-	//to update 18
 	public Pagination<C2BOrderDetailBo> selectOrderList(boolean confirm,Integer pageNo,Integer pageSize) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		Pagination<C2BOrderDetailBo> result = new Pagination<C2BOrderDetailBo>();
-		//if(!confirm) params.put("intentionStatus", IntentionSate.WAIT_SELLER_CONFIRM.getCode()); //购买意向
+		if(!confirm) params.put("orderStatus", OrderState.WAIT_FOR_CONFIRM.getCode()); //购买意向
 		params.put("uid", TokenManager.getUserId());
 		Pagination<TOrder> data = (Pagination<TOrder>)findPage("selectOrderListByPage", "selectOrderListCount", params, pageNo, pageSize);
 		List<TOrder> list = (List<TOrder>)data.getList();
@@ -958,8 +960,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 
 	@Override
 	@Transactional
-	public int updateOrderCommodity(String detailId,String commodityId, String commodityName,String commodityMode, Integer commodityQuantity,Integer commodityType,
-			String commodityPrice, String discountPrice,String commodityFirstPayment,String discountFirstPayment,String remarks) {
+	public int updateOrderCommodity(String detailId,String discountPrice,String discountFirstPayment,Integer commodityQuantity,String remarks) {
 		TOrderDetail oldDetail = tOrderDetailMapper.selectByPrimaryKey(detailId);
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(oldDetail.getOrderNo());
 		checkOrder(tOrder);
@@ -969,34 +970,17 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			TOrderDetail detail = new TOrderDetail();
 			detail.setId(detailId);
 			detail.setOrderNo(oldDetail.getOrderNo());
-			detail.setCommodityId(commodityId);
 			detail.setCommodityQuantity(commodityQuantity);
-			detail.setCommodityType(commodityType);
-			detail.setCommodityMode(StringUtils.isBlank(commodityMode) ? DEFAULT_COMMODITY_MODE : commodityMode);
-			detail.setCommodityPrice(new BigDecimal(commodityPrice));
 			detail.setDiscountPrice(new BigDecimal(discountPrice));
-			detail.setCommodityFirstPayment(new BigDecimal(commodityFirstPayment));
 			detail.setDiscountFirstPayment(new BigDecimal(discountFirstPayment));
 			detail.setRemarks(remarks);
-			tOrderDetailMapper.insert(detail);
-			new BigDecimal(discountFirstPayment).multiply(new BigDecimal(commodityQuantity)).subtract(
-					oldDetail.getDiscountFirstPayment().multiply(new BigDecimal(oldDetail.getCommodityQuantity())));
-			// 订单市场价总额
-			BigDecimal totalAmountChange = new BigDecimal(commodityPrice).multiply(new BigDecimal(commodityQuantity))
-					.subtract(oldDetail.getCommodityPrice().multiply(new BigDecimal(oldDetail.getCommodityQuantity())));
-			// 订单市场价首付金额
-			BigDecimal firstPaymentChange = new BigDecimal(commodityFirstPayment)
-					.multiply(new BigDecimal(commodityQuantity)).subtract(oldDetail.getCommodityFirstPayment()
-							.multiply(new BigDecimal(oldDetail.getCommodityQuantity())));
+			tOrderDetailMapper.updateByPrimaryKeySelective(detail);
 			// 订单签单总额
 			BigDecimal signTotalAmountChange = new BigDecimal(discountPrice).multiply(new BigDecimal(commodityQuantity))
 					.subtract(oldDetail.getDiscountPrice().multiply(new BigDecimal(oldDetail.getCommodityQuantity())));
 			// 订单签单首付金额
-			BigDecimal signFirstPaymentChange = new BigDecimal(discountFirstPayment)
-					.multiply(new BigDecimal(commodityQuantity)).subtract(oldDetail.getDiscountFirstPayment()
-							.multiply(new BigDecimal(oldDetail.getCommodityQuantity())));
-			tOrder.setOrderAmount(tOrder.getOrderAmount().add(totalAmountChange));
-			tOrder.setFirstPayment(tOrder.getFirstPayment().add(firstPaymentChange));
+			BigDecimal signFirstPaymentChange = new BigDecimal(discountFirstPayment).multiply(new BigDecimal(commodityQuantity))
+					.subtract(oldDetail.getDiscountFirstPayment().multiply(new BigDecimal(oldDetail.getCommodityQuantity())));
 			tOrder.setSignTotalAmount(tOrder.getSignTotalAmount().add(signTotalAmountChange));
 			tOrder.setSignFirstPayment(tOrder.getSignFirstPayment().add(signFirstPaymentChange));
 			tOrder.setUpdateTime(new Date());
@@ -1283,14 +1267,20 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				bill.setConfirmTime(confirmTime);
 				bill.setConfirmSign(AuditState.AUDIT_SUCCESS.getCode());
 				checkOrder(order);
-				if(order.getLiquidationStatus() == LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode())
-					setOrderState(OrderAction.CONFIRM_PAY_FOR_FIRST, bill.getTransactionAmount(), order, false);
-				if(order.getLiquidationStatus() == LiquidationState.WAIT_PAY_LAST_BALANCE.getCode())
+				if(order.getLiquidationStatus() == LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()
+						&& bill.getTransactionSubject() == TransactionSubject.SUPPLY_PAY.getCode()) //代付+首付状态
+					setOrderState(OrderAction.CONFIRM_PAY_FOR_FIRST, bill.getTransactionAmount(), order, false); 
+				else if(order.getLiquidationStatus() == LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()
+						&& bill.getTransactionSubject() == TransactionSubject.SUPPLY_PAY.getCode()) //代付+尾款状态
 					setOrderState(OrderAction.CONFIRM_PAY_FOR_LAST, bill.getTransactionAmount(), order, false);
-				if(order.getLiquidationStatus() == LiquidationState.AGREE_REFUND.getCode())
+				else if(order.getLiquidationStatus() == LiquidationState.AGREE_REFUND.getCode()
+						&& bill.getTransactionSubject() == TransactionSubject.REFUND.getCode()) //待退+退款状态
 					setOrderState(OrderAction.COMPLETE_REFUND, bill.getTransactionAmount(), order, false);
-				if(order.getLiquidationStatus() == LiquidationState.WAIT_FOR_WITHDRAW.getCode())
-					setOrderState(OrderAction.CONFIRM_WITHDRAW, bill.getTransactionAmount(), order, false);
+				else if(order.getLiquidationStatus() == LiquidationState.WAIT_FOR_WITHDRAW.getCode()
+						&& bill.getTransactionSubject() == TransactionSubject.SUPPLY_COLLECT.getCode()) //代收+提现状态
+					setOrderState(OrderAction.CONFIRM_WITHDRAW, bill.getTransactionAmount(), order, false); 
+				else 
+					throw new BusinessException(new Error(ErrorConstants.BILL_ALREADY_EXPIRE, billNo , ""));
 				order.setUpdateTime(new Date());
 				tOrderMapper.updateByPrimaryKeySelective(order);
 			}else if(confrim == AFTConstants.NO){

+ 16 - 13
src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java

@@ -352,19 +352,22 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 	@Override
 	public int addProjectTask(String contractId,String commodityId,String commodityName, Integer commodityQuantity, 
 			String commodityMode, String taskComment) {
-		ContractTask task = new ContractTask();
-		task.setId(UUID.randomUUID().toString().replace("-", ""));
-		task.setCommodityId(commodityId);
-		task.setCommodityMode(StringUtils.isBlank(commodityMode)?"NO_MODE":commodityMode);
-		task.setCommodityName(commodityName);
-		task.setCommodityType(CommodityType.SERVICE.getTypeCode());
-		task.setCommodityQuantity(1);
-		task.setCreateTime(new Date());
-		task.setContractId(contractId);
-		task.setTaskStatus(TaskState.UN_DISTRIBUTION.getCode());
-		task.setDeleteSign(DeleteStatus.LOCKING.getCode());
-		task.setTaskComment(taskComment);
-		return contractTaskMapper.insert(task);
+		for(int i=0;i<commodityQuantity;i++){
+			ContractTask task = new ContractTask();
+			task.setId(UUID.randomUUID().toString().replace("-", ""));
+			task.setCommodityId(commodityId);
+			task.setCommodityMode(StringUtils.isBlank(commodityMode)?"NO_MODE":commodityMode);
+			task.setCommodityName(commodityName);
+			task.setCommodityType(CommodityType.SERVICE.getTypeCode());
+			task.setCommodityQuantity(1);
+			task.setCreateTime(new Date());
+			task.setContractId(contractId);
+			task.setTaskStatus(TaskState.UN_DISTRIBUTION.getCode());
+			task.setDeleteSign(DeleteStatus.LOCKING.getCode());
+			task.setTaskComment(taskComment);
+			contractTaskMapper.insert(task);
+		}
+		return 1;
 	}
 
 	@Override

+ 3 - 1
src/main/resources/props/error.properties

@@ -115,4 +115,6 @@ ORDER_ALREADY_REVOKE = \u8BE5\u8BA2\u5355\u5DF2\u7ECF\u5E9F\u9664{0}
 
 ORDER_NOT_EXIST = \u8BA2\u5355\u4E0D\u5B58\u5728{0}
 
-PAY_BEYOND_SIGN = \u652F\u4ED8\u91D1\u989D\u8D85\u8FC7\u5408\u540C\u4EF7\u683C
+PAY_BEYOND_SIGN = \u652F\u4ED8\u91D1\u989D\u8D85\u8FC7\u5408\u540C\u4EF7\u683C
+
+BILL_ALREADY_EXPIRE = \u8BE5\u6D41\u6C34\u5DF2\u8FC7\u671F