Browse Source

achievement&demand order update

Antiloveg 8 years ago
parent
commit
85faf31480

+ 5 - 5
src/main/java/com/goafanti/achievement/service/impl/AchievementOrderServiceImpl.java

@@ -82,7 +82,7 @@ public class AchievementOrderServiceImpl extends BaseMybatisDao<AchievementOrder
 	@Override
 	public int updateShutdownByUser(AchievementOrder order) {
 		order.setStatus(AchievementOrderStatus.SHUTDOWN.getCode());
-		
+
 		AchievementOrderLog aol = new AchievementOrderLog();
 		aol.setId(UUID.randomUUID().toString());
 		aol.setStatus(AchievementOrderStatus.SHUTDOWN.getCode());
@@ -129,7 +129,7 @@ public class AchievementOrderServiceImpl extends BaseMybatisDao<AchievementOrder
 		return (Pagination<OrgAchievementOrderListBo>) findPage("findOrgAchievementOrderListByPage",
 				"findOrgAchievementOrderCount", disposeAchievementOrder(uid, null, unitName, status, true), pNo, pSize);
 	}
-	
+
 	@Override
 	public int updateAchievementOrder(AchievementOrder achievementOrder, AchievementOrderLog aol,
 			String recordTimeFormattedDate) {
@@ -148,7 +148,6 @@ public class AchievementOrderServiceImpl extends BaseMybatisDao<AchievementOrder
 		return achievementOrderMapper.updateByPrimaryKeySelective(achievementOrder);
 	}
 
-
 	private Map<String, Object> disposeAchievementOrder(String uid, String username, String unitName, Integer status,
 			Boolean flag) {
 		Map<String, Object> params = new HashMap<>();
@@ -170,7 +169,9 @@ public class AchievementOrderServiceImpl extends BaseMybatisDao<AchievementOrder
 		}
 
 		if (flag) {
-			params.put("techBrokerId", TokenManager.getAdminId());
+			if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+				params.put("techBrokerId", TokenManager.getAdminId());
+			}
 		} else {
 			params.put("uid", TokenManager.getUserId());
 		}
@@ -178,5 +179,4 @@ public class AchievementOrderServiceImpl extends BaseMybatisDao<AchievementOrder
 		return params;
 	}
 
-	
 }

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

@@ -239,7 +239,9 @@
   	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="techBrokerId != null">
+  		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and ao.status = #{status,jdbcType=INTEGER}
   	</if>
@@ -264,7 +266,9 @@
   	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="techBrokerId != null">
+  		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and ao.status = #{status,jdbcType=INTEGER}
   	</if>
@@ -291,7 +295,9 @@
   	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="techBrokerId != null">
+  		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and ao.status = #{status,jdbcType=INTEGER}
   	</if>
@@ -316,7 +322,9 @@
   	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="techBrokerId != null">
+  		and a.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and ao.status = #{status,jdbcType=INTEGER}
   	</if>

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

@@ -251,7 +251,9 @@
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
   	and   d.data_category = 0
-  	and   d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	<if test="techBrokerId != null">
+  		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and do.status = #{status,jdbcType=INTEGER}
   	</if>
@@ -276,7 +278,9 @@
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
   	and   d.data_category = 0
-  	and   d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	<if test="techBrokerId != null">
+  		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and do.status = #{status,jdbcType=INTEGER}
   	</if>
@@ -303,7 +307,9 @@
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
   	and   d.data_category = 1
-  	and   d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	<if test="techBrokerId != null">
+  		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and do.status = #{status,jdbcType=INTEGER}
   	</if>
@@ -328,7 +334,9 @@
   	where do.deleted_sign = 0 
   	and   d.deleted_sign = 0 
   	and   d.data_category = 1
-  	and   d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	<if test="techBrokerId != null">
+  		and d.tech_broker_id = #{techBrokerId,jdbcType=VARCHAR}
+  	</if>
   	<if test="status != null">
   		and do.status = #{status,jdbcType=INTEGER}
   	</if>

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

@@ -82,7 +82,7 @@ public class DemandOrderServiceImpl extends BaseMybatisDao<DemandOrderMapper> im
 	@Override
 	public int updateShutdownByUser(DemandOrder order) {
 		order.setStatus(DemandOrderStatus.SHUTDOWN.getCode());
-		
+
 		DemandOrderLog dol = new DemandOrderLog();
 		Calendar now = Calendar.getInstance();
 		now.set(Calendar.MILLISECOND, 0);
@@ -167,7 +167,9 @@ public class DemandOrderServiceImpl extends BaseMybatisDao<DemandOrderMapper> im
 			params.put("unitName", unitName);
 		}
 		if (flag) {
-			params.put("techBrokerId", TokenManager.getAdminId());
+			if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
+				params.put("techBrokerId", TokenManager.getAdminId());
+			}
 		} else {
 			params.put("uid", TokenManager.getUserId());
 		}