Antiloveg 8 years ago
parent
commit
e63fe24aab

+ 27 - 0
src/main/java/com/goafanti/admin/bo/AdminLocationBo.java

@@ -0,0 +1,27 @@
+package com.goafanti.admin.bo;
+
+public class AdminLocationBo {
+	private Integer province;
+	
+	private Integer city;
+
+	public Integer getProvince() {
+		return province;
+	}
+
+	public void setProvince(Integer province) {
+		this.province = province;
+	}
+
+	public Integer getCity() {
+		return city;
+	}
+
+	public void setCity(Integer city) {
+		this.city = city;
+	}
+
+	
+	
+
+}

File diff suppressed because it is too large
+ 42 - 387
src/main/java/com/goafanti/admin/controller/AdminApiController.java


+ 28 - 70
src/main/java/com/goafanti/admin/controller/AdminOrderApiController.java

@@ -1,5 +1,7 @@
 package com.goafanti.admin.controller;
 
+import java.util.Map.Entry;
+
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
@@ -11,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.alibaba.fastjson.JSONObject;
 import com.goafanti.achievement.bo.InputAchievementOrder;
 import com.goafanti.achievement.service.AchievementOrderLogService;
 import com.goafanti.achievement.service.AchievementOrderService;
@@ -52,33 +55,33 @@ public class AdminOrderApiController extends CertifyApiController {
 					AchievementOrderFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
-		
+
 		if (StringUtils.isBlank(order.getId())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技成果线索单/意向单ID", "科技成果线索单/意向单ID"));
 			return res;
 		}
-		
+
 		if (StringUtils.isBlank(order.getAchievementId())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技成果ID", "科技成果ID"));
 			return res;
 		}
-		
+
 		if (null == order.getStatus()) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技成果线索单/意向单状态", "科技成果线索单/意向单状态"));
 			return res;
 		}
-		
+
 		AchievementOrder ao = achievementOrderService.selectByPrimaryKey(order.getId());
-		if (null == ao){
+		if (null == ao) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技成果线索单/意向单ID"));
 			return res;
 		}
-		
-		if (AchievementOrderStatus.SHUTDOWN.getCode().equals(ao.getStatus())){
+
+		if (AchievementOrderStatus.SHUTDOWN.getCode().equals(ao.getStatus())) {
 			res.getError().add(buildError("", "当前科技成果线索单/意向单已关闭,无法修改!"));
 			return res;
 		}
-		
+
 		AchievementOrder achievementOrder = new AchievementOrder();
 		AchievementOrderLog aol = new AchievementOrderLog();
 		BeanUtils.copyProperties(order, achievementOrder);
@@ -88,35 +91,6 @@ public class AdminOrderApiController extends CertifyApiController {
 	}
 
 	/**
-	 * 关闭科技成果线索单/意向单
-	
-	@RequestMapping(value = "/achievementShutdown", method = RequestMethod.POST)
-	public Result achevementShutdown(String id) {
-		Result res = new Result();
-
-		if (StringUtils.isBlank(id)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技成果线索单/意向单ID", "科技成果线索单/意向单ID"));
-			return res;
-		}
-
-		AchievementOrder order = achievementOrderService.selectByPrimaryKey(id);
-		if (null == order) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "科技成果线索单/意向单ID"));
-			return res;
-		}
-		Boolean unSign = false;
-		if (AchievementOrderStatus.CREATE.getCode().equals(order.getStatus())
-				|| AchievementOrderStatus.INTENTIONMONEY.getCode().equals(order.getStatus())) {
-			unSign = true;
-		}
-
-		res.setData(achievementOrderService.updateShutdownByUser(order, unSign));
-
-		return res;
-	}
-	 */
-
-	/**
 	 * 科技成果线索单/意向单Log
 	 */
 	@RequestMapping(value = "/achievementOrderLog", method = RequestMethod.GET)
@@ -229,29 +203,29 @@ public class AdminOrderApiController extends CertifyApiController {
 					AchievementOrderFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
-		
+
 		if (StringUtils.isBlank(inputDemandOrder.getId())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技需求线索单/意向单ID", "科技需求线索单/意向单ID"));
 			return res;
 		}
-		
+
 		if (StringUtils.isBlank(inputDemandOrder.getDemandId())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技需求ID", "科技需求ID"));
 			return res;
 		}
-		
+
 		if (null == inputDemandOrder.getStatus()) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技需求状态", "科技需求状态"));
 			return res;
 		}
-		
+
 		DemandOrder demandOrder = demandOrderService.selectByPrimaryKey(inputDemandOrder.getId());
-		if (null == demandOrder){
+		if (null == demandOrder) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技需求线索单/意向单ID"));
 			return res;
 		}
-		
-		if (DemandOrderStatus.SHUTDOWN.getCode().equals(demandOrder.getStatus())){
+
+		if (DemandOrderStatus.SHUTDOWN.getCode().equals(demandOrder.getStatus())) {
 			res.getError().add(buildError("", "当前科技需求线索单/意向单已关闭,无法修改!"));
 			return res;
 		}
@@ -265,32 +239,6 @@ public class AdminOrderApiController extends CertifyApiController {
 	}
 
 	/**
-	 * 关闭科技需求线索单/意向单
-	
-	@RequestMapping(value = "/demandShutdown", method = RequestMethod.POST)
-	public Result shutdown(String id) {
-		Result res = new Result();
-		if (StringUtils.isBlank(id)) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到订单ID", "订单ID"));
-			return res;
-		}
-
-		DemandOrder order = demandOrderService.selectByPrimaryKey(id);
-		if (null == order) {
-			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "科技需求订单ID"));
-			return res;
-		}
-		Boolean unSign = false;
-		if (DemandOrderStatus.CREATE.getCode().equals(order.getStatus())
-				|| DemandOrderStatus.INTENTIONMONEY.getCode().equals(order.getStatus())) {
-			unSign = true;
-		}
-		res.setData(demandOrderService.updateShutdownByUser(order, unSign));
-		return res;
-	}
-	 */
-
-	/**
 	 * 下载科技需求线索单/意向单文件
 	 */
 	@RequestMapping(value = "/downloadDemandOrder", method = RequestMethod.GET)
@@ -311,4 +259,14 @@ public class AdminOrderApiController extends CertifyApiController {
 		downloadUnPrivateFile(response, order.getEnclosureDownloadFileName(), order.getEnclosureUrl());
 		return res;
 	}
+
+	public static void main(String[] args) {
+		String jsonStr = "{\"id\":\"id\",\"JACKIE_ZHANG\":\"张学友\",\"ANDY_LAU\":\"刘德华\"}";
+		JSONObject jsonObject = JSONObject.parseObject(jsonStr);
+		for (Entry<String, Object> entry : jsonObject.entrySet()) {
+			System.out.print(entry.getKey() + "-" + entry.getValue() + "\t");
+		}
+		System.out.println();
+	}
+
 }

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

@@ -237,6 +237,7 @@
   	left join user_identity ui on ui.uid = ao.uid
   	where ao.deleted_sign = 0 
   	and   a.deleted_sign = 0 
+  	and   a.owner_type= 0
   	and   a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
   	<if test="status != null">
   		and ao.status = #{status,jdbcType=INTEGER}
@@ -261,6 +262,7 @@
   	left join user_identity ui on ui.uid = ao.uid
   	where ao.deleted_sign = 0 
   	and   a.deleted_sign = 0 
+  	and   a.owner_type= 0
   	and   a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
   	<if test="status != null">
   		and ao.status = #{status,jdbcType=INTEGER}
@@ -287,6 +289,7 @@
   	left join organization_identity oi on oi.uid = ao.uid
   	where ao.deleted_sign = 0 
   	and   a.deleted_sign = 0 
+  	and   a.owner_type= 1
   	and   a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
   	<if test="status != null">
   		and ao.status = #{status,jdbcType=INTEGER}
@@ -311,6 +314,7 @@
   	left join organization_identity oi on oi.uid = ao.uid
   	where ao.deleted_sign = 0 
   	and   a.deleted_sign = 0 
+  	and   a.owner_type= 0
   	and   a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
   	<if test="status != null">
   		and ao.status = #{status,jdbcType=INTEGER}