albertshaw 8 years ago
parent
commit
8f80a30367

+ 13 - 0
src/main/java/com/goafanti/activityUser/controller/UserActivityUserApiController.java

@@ -50,4 +50,17 @@ public class UserActivityUserApiController extends BaseApiController {
 		}
 		return res.data(activityUserService.batchDeleteByPrimaryKey(aid, TokenManager.getUserId()));
 	}
+
+	/**
+	 * 取消报名
+	 */
+	@RequestMapping(value = "/isSigned", method = RequestMethod.GET)
+	public Result isSigned(Long aid) {
+		Result res = new Result();
+		if (null == aid) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "活动ID"));
+			return res;
+		}
+		return res.data(activityUserService.selectByAidAndUid(aid, TokenManager.getUserId()) != null);
+	}
 }

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

@@ -250,7 +250,8 @@
   		and ao.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="username != null">
-  		and ui.username = #{username,jdbcType=VARCHAR}
+  		and (oi.unit_name = #{username,jdbcType=VARCHAR}
+  		or ui.username = #{username,jdbcType=VARCHAR})
   	</if>
   	order by ao.serial_number desc
   	<if test="page_sql!=null">
@@ -264,6 +265,7 @@
   	from achievement_order ao
   	left join achievement a on a.id = ao.achievement_id
   	left join user_identity ui on ui.uid = ao.uid
+  	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
@@ -277,7 +279,8 @@
   		and ao.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="username != null">
-  		and ui.username = #{username,jdbcType=VARCHAR}
+  		and (oi.unit_name = #{username,jdbcType=VARCHAR}
+  		or ui.username = #{username,jdbcType=VARCHAR})
   	</if>
   </select>
   
@@ -307,7 +310,8 @@
   		and ao.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="unitName != null">
-  		and oi.unit_name = #{unitName,jdbcType=VARCHAR}
+  		and (oi.unit_name = #{unitName,jdbcType=VARCHAR}
+  		or ui.username = #{unitName,jdbcType=VARCHAR})
   	</if>
   	order by ao.serial_number desc
   	<if test="page_sql!=null">
@@ -320,6 +324,7 @@
   		count(1)
   	from achievement_order ao
   	left join achievement a on a.id = ao.achievement_id
+  	left join user_identity ui on ui.uid = ao.uid
   	left join organization_identity oi on oi.uid = ao.uid
   	where ao.deleted_sign = 0 
   	and   a.deleted_sign = 0 
@@ -334,7 +339,8 @@
   		and ao.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="unitName != null">
-  		and oi.unit_name = #{unitName,jdbcType=VARCHAR}
+  		and (oi.unit_name = #{unitName,jdbcType=VARCHAR}
+  		or ui.username = #{unitName,jdbcType=VARCHAR})
   	</if>
   </select>
 </mapper>

+ 19 - 13
src/main/java/com/goafanti/common/mapper/DemandOrderMapper.xml

@@ -244,10 +244,11 @@
   		do.intention_money as intentionMoney, do.contract_money as contractMoney, do.commission,
   		do.service_money as serviceMoney, d.name, d.serial_number as demandSerialNumber,
   		d.deleted_sign as deletedSign, d.audit_status as auditStatus,
-  		do.uid, ui.nickname as username
+  		do.uid, ui.username, oi.unit_name as unitName
   	from demand_order do
   	left join demand d on d.id = do.demand_id
-  	left join user ui on ui.id = do.uid
+  	left join user_identity ui on ui.uid = do.uid
+  	left join organization_identity oi on oi.uid = do.uid
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
   	and   d.data_category = 0
@@ -261,7 +262,8 @@
   		and d.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="username != null">
-  		and ui.nickname = #{username,jdbcType=VARCHAR}
+  		and (oi.unit_name = #{username,jdbcType=VARCHAR}
+  		or ui.username = #{username,jdbcType=VARCHAR})
   	</if>
   	order by do.serial_number desc
   	<if test="page_sql!=null">
@@ -274,7 +276,8 @@
   		count(1)
   	from demand_order do
   	left join demand d on d.id = do.demand_id
-  	left join user ui on ui.id = do.uid
+  	left join user_identity ui on ui.uid = do.uid
+  	left join organization_identity oi on oi.uid = do.uid
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
   	and   d.data_category = 0
@@ -288,7 +291,8 @@
   		and d.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="username != null">
-  		and ui.nickname = #{username,jdbcType=VARCHAR}
+  		and (oi.unit_name = #{username,jdbcType=VARCHAR}
+  		or ui.username = #{username,jdbcType=VARCHAR})
   	</if>
   </select>
   
@@ -300,10 +304,11 @@
   		do.intention_money as intentionMoney, do.contract_money as contractMoney, do.commission,
   		do.service_money as serviceMoney, d.name, d.serial_number as demandSerialNumber,
   		d.deleted_sign as deletedSign, d.audit_status as auditStatus,
-  		do.uid, oi.nickname as unitName
+  		do.uid, oi.unit_name as unitName, ui.username
   	from demand_order do
   	left join demand d on d.id = do.demand_id
-  	left join user oi on u.id = do.uid
+  	left join organization_identity oi on oi.uid = do.uid
+  	left join user_identity ui on ui.uid = do.uid
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
   	and   d.data_category = 1
@@ -317,7 +322,8 @@
   		and d.uid = #{uid,jdbcType=VARCHAR}
   	</if>
   	<if test="unitName != null">
-  		and oi.nickname = #{unitName,jdbcType=VARCHAR}
+  		and (oi.unit_name = #{unitName,jdbcType=VARCHAR}
+  		or ui.username = #{unitName,jdbcType=VARCHAR})
   	</if>
   	order by do.serial_number desc
   	<if test="page_sql!=null">
@@ -330,7 +336,8 @@
   		count(1)
   	from demand_order do
   	left join demand d on d.id = do.demand_id
-  	left join user oi on oi.id = do.uid
+  	left join organization_identity oi on oi.uid = do.uid
+  	left join user_identity ui on ui.uid = do.uid
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
   	and   d.data_category = 1
@@ -344,10 +351,9 @@
   		and d.uid = #{uid,jdbcType=VARCHAR}
   	</if>
     <if test="unitName != null">
-  		and oi.nickname = #{unitName,jdbcType=VARCHAR}
+  		and (oi.unit_name = #{unitName,jdbcType=VARCHAR}
+  		or ui.username = #{unitName,jdbcType=VARCHAR})
   	</if>
   </select>
-  
-  
-  
+
 </mapper>

+ 10 - 0
src/main/java/com/goafanti/demand/bo/OrgDemandOrderListBo.java

@@ -4,6 +4,8 @@ public class OrgDemandOrderListBo extends DemandOrderListBo {
 	private String uid;
 	
 	private String unitName;
+	
+	private String username;
 
 	public String getUid() {
 		return uid;
@@ -20,6 +22,14 @@ public class OrgDemandOrderListBo extends DemandOrderListBo {
 	public void setUnitName(String unitName) {
 		this.unitName = unitName;
 	}
+
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
 	
 	
 

+ 10 - 0
src/main/java/com/goafanti/demand/bo/UserDemandOrderListBo.java

@@ -4,6 +4,8 @@ public class UserDemandOrderListBo extends DemandOrderListBo {
 	private String username;
 	
 	private String uid;
+	
+	private String unitName;
 
 	public String getUsername() {
 		return username;
@@ -20,6 +22,14 @@ public class UserDemandOrderListBo extends DemandOrderListBo {
 	public void setUid(String uid) {
 		this.uid = uid;
 	}
+
+	public String getUnitName() {
+		return unitName;
+	}
+
+	public void setUnitName(String unitName) {
+		this.unitName = unitName;
+	}