Browse Source

修改t_banner.supdated,t_zone.supdated,t_zone_industry.supdated,t_zone_domain.supdated,t_banner_operator.supdated,t_target_show.updated类型为Long

jun.zhou 9 years ago
parent
commit
53d5f9a555

+ 3 - 3
src/main/java/com/cloudcross/ssp/model/Banner.java

@@ -33,7 +33,7 @@ public class Banner {
 	//最后更新时间
 	private Date updated;
 	//新增及状态更新时间
-	private Date supdated;
+	private Long supdated;
 	//创建bannerTemplate对象
 	BannerTemplate bannerTemplate;
 
@@ -110,10 +110,10 @@ public class Banner {
 	public void setUpdated(Date updated) {
 		this.updated = updated;
 	}
-	public Date getSupdated() {
+	public Long getSupdated() {
 		return supdated;
 	}
-	public void setSupdated(Date supdated) {
+	public void setSupdated(Long supdated) {
 		this.supdated = supdated;
 	}
 	public BannerTemplate getBannerTemplate() {

+ 3 - 4
src/main/java/com/cloudcross/ssp/model/Direct.java

@@ -6,7 +6,6 @@
  * @author luohongyu
  */
 
-import java.util.Date;
 
 public class Direct {
 	private Long id ;
@@ -18,7 +17,7 @@ public class Direct {
 	private String backShow;
 	//用来给rv_acls字段存值
 	private String  data;
-	private Date updated;
+	private Long updated;
 	public Long getId() {
 		return id;
 	}
@@ -51,10 +50,10 @@ public class Direct {
 	public void setData(String data) {
 		this.data = data;
 	}
-	public Date getUpdated() {
+	public Long getUpdated() {
 		return updated;
 	}
-	public void setUpdated(Date updated) {
+	public void setUpdated(Long updated) {
 		this.updated = updated;
 	}
 }

+ 4 - 4
src/main/java/com/cloudcross/ssp/model/Zone.java

@@ -1,6 +1,6 @@
 package com.cloudcross.ssp.model;
 
-import java.util.Arrays;
+
 import java.util.Date;
 import java.util.List;
 
@@ -17,7 +17,7 @@ public class Zone implements ISelector{
 	private String domain;
 	private Integer status;
 	private Date updated;
-	private Date supdated;
+	private Long supdated;
 	private Integer recheck;
 	private String default_path;
 	private String default_url;
@@ -26,10 +26,10 @@ public class Zone implements ISelector{
 	private String industry;
 	private String default_path_small;
 	
-	public Date getSupdated() {
+	public Long getSupdated() {
 		return supdated;
 	}
-	public void setSupdated(Date supdated) {
+	public void setSupdated(Long supdated) {
 		this.supdated = supdated;
 	}
 	public Long getSizeId() {

+ 3 - 6
src/main/java/com/cloudcross/ssp/model/ZoneDomain.java

@@ -1,18 +1,15 @@
 package com.cloudcross.ssp.model;
 
-import java.util.Date;
-import java.util.List;
-
 public class ZoneDomain {
 	private Long id;
 	private Long zoneId;
 	private String domain;
-	private Date supdated;
+	private Long supdated;
 	private Integer status;
-	public Date getSupdated() {
+	public Long getSupdated() {
 		return supdated;
 	}
-	public void setSupdated(Date supdated) {
+	public void setSupdated(Long supdated) {
 		this.supdated = supdated;
 	}
 	public Integer getStatus() {

+ 3 - 5
src/main/java/com/cloudcross/ssp/model/ZoneIndustry.java

@@ -1,13 +1,11 @@
 package com.cloudcross.ssp.model;
 
-import java.util.Date;
-import java.util.List;
 
 public class ZoneIndustry {
 	private Long id;
 	private Long zoneId;
 	private Long industryId;
-	private Date supdated;
+	private Long supdated;
 	private Integer status;
 	
 	public Long getId() {
@@ -28,10 +26,10 @@ public class ZoneIndustry {
 	public void setIndustryId(Long industryId) {
 		this.industryId = industryId;
 	}
-	public Date getSupdated() {
+	public Long getSupdated() {
 		return supdated;
 	}
-	public void setSupdated(Date supdated) {
+	public void setSupdated(Long supdated) {
 		this.supdated = supdated;
 	}
 	public Integer getStatus() {

+ 0 - 5
src/main/java/com/cloudcross/ssp/model/mapper/ad-group.sql.xml

@@ -239,11 +239,6 @@
 		</foreach>
 	</update>
 	
-	<update id="updatedSupdated" parameterType="Long">
-		update t_adgroup 
-		set supdated=NOW()
-		where id = #{adGroupId}
-	</update>
 	
 	<select id="findByCampaignId" parameterType="long" resultType="com.cloudcross.ssp.model.AdGroup">
 	    select

+ 1 - 1
src/main/java/com/cloudcross/ssp/model/mapper/zone-domain.sql.xml

@@ -20,7 +20,7 @@
 	</update>
 	
 	<update id="editZoneDomain" parameterType="com.cloudcross.ssp.model.ZoneDomain">
-		update t_zone_domain set  domain=#{domain} where zone_id = #{zone_id}
+		update t_zone_domain set  domain=#{domain} ,supdated=#{supdated} where zone_id = #{zone_id}
 	</update>
 	
 	<select id="selectById"  parameterType="int" resultType="com.cloudcross.ssp.model.ZoneDomain">

+ 1 - 1
src/main/java/com/cloudcross/ssp/model/mapper/zone-industry.sql.xml

@@ -16,7 +16,7 @@
 	
 	<update id="editZoneIndustry" parameterType="com.cloudcross.ssp.model.ZoneIndustry">
 		update t_zone_industry
-		set  zone_id=#{zoneId},industry_id=#{industryId},status=0;
+		set  zone_id=#{zoneId},industry_id=#{industryId},status=0,supdated=#{supdated}
 		where zone_id = #{zoneId}
 			
 	</update>

+ 2 - 2
src/main/java/com/cloudcross/ssp/service/impl/AdvertiserService.java

@@ -352,7 +352,7 @@ public class AdvertiserService implements IAdvertiserService, ISelectorProvider{
 	public boolean updateSupdatedAll(List<Long> advertiserIdList, Date date) {
 		List<Long>list = new ArrayList<Long>();
 		//更新广告主的所有投放的supdate
-		 Boolean adGroupFlag = this.adGroupService.updateSupdatedByAdvertiserId(advertiserIdList, date);
+		 //Boolean adGroupFlag = this.adGroupService.updateSupdatedByAdvertiserId(advertiserIdList, date);
 		for(Long l:advertiserIdList){
 			list.addAll(adGroupService.findAllAdGroudByAdvertiserId(l));
 		}
@@ -365,7 +365,7 @@ public class AdvertiserService implements IAdvertiserService, ISelectorProvider{
 			System.out.println("投放下没有创意");
 		}
 		
-		return adGroupFlag&&bannerFlag;
+		return bannerFlag;
 	}
 	@Override
 	public boolean updateStatusAll(List<Long> advertiserIdList, int status) {

+ 1 - 1
src/main/java/com/cloudcross/ssp/service/impl/AuditBannerService.java

@@ -120,7 +120,7 @@ public class AuditBannerService implements IAuditBannerService {
 		myBatisDao.save("auditBannerSqlMapper.updateOperatorBannerTime",
 				MapBuilder.create(HashMap.class)
 					.add("auditBannerIdList", auditBannerIdList)
-					.add("supdated", date)
+					.add("supdated", date.getTime()/1000)
 					.map());			
 		return true;
 	}

+ 18 - 14
src/main/java/com/cloudcross/ssp/service/impl/BannerService.java

@@ -66,7 +66,7 @@ public class BannerService implements IBannerService {
 	public boolean add(Banner t) {
 		Date date = new Date();
 		t.setUpdated(date);
-		t.setSupdated(date);
+		t.setSupdated(date.getTime()/1000);
 		myBatisDao.save("bannerSqlMapper.addBanner", t);
 		return true;
 	}
@@ -76,7 +76,7 @@ public class BannerService implements IBannerService {
 	public boolean edit(Banner t) {
 		Date date = new Date();
 		t.setUpdated(date);
-		t.setSupdated(date);
+		t.setSupdated(date.getTime()/1000);
 		t.getBannerTemplate().setUpdated(date);
 		myBatisDao.save("bannerSqlMapper.editBanner", t);
 		
@@ -87,14 +87,15 @@ public class BannerService implements IBannerService {
 	@Override
 	public boolean updata(Banner t) {
 		Date date = new Date();
+		Long supdated = date.getTime()/1000;
 		t.setUpdated(date);
-		t.setSupdated(date);
+		t.setSupdated(supdated);
 		t.getBannerTemplate().setUpdated(date);
 		myBatisDao.save("bannerSqlMapper.updataBanner", t);
 		Long id[]={t.getId()};
 		myBatisDao.save("bannerSqlMapper.updataOperatorBanner", MapBuilder.create(HashMap.class)
 				.add("idList", id)
-				.add("supdated", date)
+				.add("supdated", supdated)
 				.map());
 		
 		return true;
@@ -113,13 +114,14 @@ public class BannerService implements IBannerService {
 	@Override
 	public boolean updateStatus(List<Long> idList, int status) {
 		Date date = new Date();
+		Long supdated = date.getTime()/1000;
 		//更新创意与创意模板状态
 		myBatisDao.save("bannerSqlMapper.updateBannerStatus",
 						MapBuilder.create(HashMap.class)
 						.add("status", status)
 						.add("idList", idList)
 						.add("updated", date)
-						.add("supdated", date)
+						.add("supdated", supdated)
 						.map());
 		/**下面为创意物理删除,暂先保留
 		//删除选择创意
@@ -130,7 +132,7 @@ public class BannerService implements IBannerService {
 			*/
 		myBatisDao.save("bannerSqlMapper.updataOperatorBanner", MapBuilder.create(HashMap.class)
 				.add("idList", idList)
-				.add("supdated", date)
+				.add("supdated", supdated)
 				.map());
 		return true;
 	}
@@ -161,8 +163,9 @@ public class BannerService implements IBannerService {
 		banner.setChecked(1);
 		banner.setStatus(bannerTemplate.getStatus());
 		Date date = new Date();
+		Long supdated = date.getTime()/1000;
 		banner.setUpdated(date);
-		banner.setSupdated(date);
+		banner.setSupdated(supdated);
 		banner.setBannerTemplate(bannerTemplate);
 		
 		LOG.debug("banner====qqq=="+banner);
@@ -200,7 +203,7 @@ public class BannerService implements IBannerService {
 		myBatisDao.save("bannerSqlMapper.updateBannerSupdated",
 				MapBuilder.create(HashMap.class)
 					.add("adGroupIdList", adGroupIdList)
-					.add("modifyDate",date ).map());
+					.add("modifyDate",date.getTime()/1000 ).map());
 		return true;
 	}
 	
@@ -208,7 +211,7 @@ public class BannerService implements IBannerService {
 		myBatisDao.save("bannerSqlMapper.updateBannerSupdatedByOrderId",
 				MapBuilder.create(HashMap.class)
 					.add("orderIdList", orderIdList)
-					.add("modifyDate", date).map());
+					.add("modifyDate", date.getTime()/1000).map());
 		
 		return true;
 	}
@@ -218,7 +221,7 @@ public class BannerService implements IBannerService {
 		myBatisDao.save("bannerSqlMapper.updateBannerSupdatedByCampaignId",
 				MapBuilder.create(HashMap.class)
 					.add("campaignIdList", campaignIdList)
-					.add("modifyDate", date).map());
+					.add("modifyDate", date.getTime()/1000).map());
 		
 		return true;
 	}
@@ -276,15 +279,16 @@ public class BannerService implements IBannerService {
 	@Override
 	public boolean updateStatus1(List<Long> idList, int status) {
 		Date date = new Date();
+		Long supdated = date.getTime()/1000;
 		myBatisDao.save("bannerSqlMapper.updateBannerStatus",MapBuilder.create(HashMap.class)
 				.add("status", status)
 				.add("idList", idList)
 				.add("updated", date)
-				.add("supdated", date)
+				.add("supdated", supdated)
 				.map());
 		myBatisDao.save("bannerSqlMapper.updateOperatorBannerTime",MapBuilder.create(HashMap.class)
 				.add("idList", idList)
-				.add("supdated", new Date())
+				.add("supdated", supdated)
 				.map());
 		return true;
 	}
@@ -352,7 +356,7 @@ public class BannerService implements IBannerService {
 				MapBuilder.create(HashMap.class)
 					.add("operatorId", operatorId)
 					.add("bannerId",bannerId)
-					.add("supdated", new Date())
+					.add("supdated", new Date().getTime()/1000)
 					.add("operatorChecked", status).map());
 		return true;
 	}
@@ -361,7 +365,7 @@ public class BannerService implements IBannerService {
 				MapBuilder.create(HashMap.class)
 					.add("operatorId", operatorId)
 					.add("bannerId",bannerId)
-					.add("supdated", new Date())
+					.add("supdated", new Date().getTime()/1000)
 					.add("operatorChecked", status).map());
 		return true;
 	}

+ 3 - 2
src/main/java/com/cloudcross/ssp/service/impl/BannerTemplateService.java

@@ -107,14 +107,15 @@ public class BannerTemplateService implements IBannerTemplateService {
 				.add("updated", date)
 				.map());
 		//更形创意时间
+		Long supdated = date.getTime()/1000;
 		myBatisDao.save("bannerTemplateSqlMapper.updateBannerTime", MapBuilder.create(HashMap.class)
 				.add("idList", idList)
-				.add("updataTime", date)
+				.add("updataTime", supdated)
 				.map());
 		//更形素材运营商素材审核时间
 		myBatisDao.save("bannerTemplateSqlMapper.updateBannerOperatorTime", MapBuilder.create(HashMap.class)
 						.add("idList", idList)
-						.add("updataTime", date)
+						.add("updataTime", supdated)
 						.map());
 		return true;
 

+ 2 - 2
src/main/java/com/cloudcross/ssp/service/impl/CampaignService.java

@@ -197,9 +197,9 @@ public class CampaignService implements ICampaignService,ISelectorProvider{
 	}
 	
 	public boolean updateSupdatedAll(List<Long> campaignIdList, Date date) {
-		Boolean adgroupFlag = this.adGroupService.updateSupdatedByCampaignId(campaignIdList, date);
+		//Boolean adgroupFlag = this.adGroupService.updateSupdatedByCampaignId(campaignIdList, date);
 		Boolean bannerFlag = this.bannerService.updateSupdatedByCampaignId(campaignIdList, date);
-		return adgroupFlag&&bannerFlag;
+		return bannerFlag;
 	}
 	@Override
 	public boolean updateStatusByAdvertiserId(List<Long> advertiserIdList,int status) {

+ 2 - 2
src/main/java/com/cloudcross/ssp/service/impl/OrderService.java

@@ -181,9 +181,9 @@ public class OrderService implements IOrderService,ISelectorProvider {
 	}
 	@Override
 	public boolean updateSupdatedAll(List<Long> orderIdList, Date date) {
-		Boolean adgroupFlag = this.adGroupService.updateSupdatedByOrderId(orderIdList, date);
+		//Boolean adgroupFlag = this.adGroupService.updateSupdatedByOrderId(orderIdList, date);
 		Boolean bannerFlag = this.bannerService.updateSupdatedByOrderId(orderIdList, date);
-		return adgroupFlag&&bannerFlag;
+		return bannerFlag;
 	}
 
 	@Override

+ 3 - 3
src/main/java/com/cloudcross/ssp/service/impl/ZoneDomainService.java

@@ -36,7 +36,7 @@ public class ZoneDomainService implements IZoneDomainService {
 
 	@Override
 	public boolean add(ZoneDomain t) {
-		t.setSupdated(new Date());
+		t.setSupdated(new Date().getTime()/1000);
 		// TODO Auto-generated method stub
 		myBatisDao.save("zoneDomainSqlMapper.addZoneDomain", t);
 		return false;
@@ -57,7 +57,7 @@ public class ZoneDomainService implements IZoneDomainService {
 	
 	@Override
 	public boolean delete(Zone t) {
-		t.setSupdated(new Date());
+		t.setSupdated(new Date().getTime()/1000);
 		myBatisDao.save("zoneDomainSqlMapper.deleteZoneDomain", t);
 		
 		return true;
@@ -65,7 +65,7 @@ public class ZoneDomainService implements IZoneDomainService {
 
 	@Override
 	public boolean edit(ZoneDomain zoneDomain) {
-		zoneDomain.setSupdated(new Date());
+		zoneDomain.setSupdated(new Date().getTime()/1000);
 		myBatisDao.save("zoneDomainSqlMapper.editZoneDomain", zoneDomain);
 		return true;
 	}

+ 3 - 3
src/main/java/com/cloudcross/ssp/service/impl/ZoneIndustryService.java

@@ -28,7 +28,7 @@ public class ZoneIndustryService implements IZoneIndustryService {
 	
 	@Override
 	public boolean delete(Zone t) {
-		t.setSupdated(new Date());
+		t.setSupdated(new Date().getTime()/1000);
 		myBatisDao.save("zoneIndustrySqlMapper.deleteZoneIndustry",t);
 		
 		return true;
@@ -36,14 +36,14 @@ public class ZoneIndustryService implements IZoneIndustryService {
 	
 	@Override
 	public boolean add(ZoneIndustry t) {
-		t.setSupdated(new Date());
+		t.setSupdated(new Date().getTime()/1000);
 		myBatisDao.save("zoneIndustrySqlMapper.addZoneIndustry", t);
 		return true;
 	}
 
 	@Override
 	public boolean edit(ZoneIndustry t) {
-		t.setSupdated(new Date());
+		t.setSupdated(new Date().getTime()/1000);
 		myBatisDao.save("zoneIndustrySqlMapper.editZoneIndustry", t);
 		return true;
 	}

+ 2 - 2
src/main/java/com/cloudcross/ssp/service/impl/ZoneService.java

@@ -42,7 +42,7 @@ import com.cloudcross.ssp.web.widget.SelectorController.ISelectorProvider;
 	public boolean add( Zone t) {
 		Date date = new Date();
 		t.setUpdated(date);
-		t.setSupdated(date);
+		t.setSupdated(date.getTime()/1000);
 		myBatisDao.save("zoneSqlMapper.addZone", t);		
 		return true;
 	}
@@ -69,7 +69,7 @@ import com.cloudcross.ssp.web.widget.SelectorController.ISelectorProvider;
 	public boolean edit(Zone zone) {
 		Date date = new Date();
 		zone.setUpdated(date);
-		zone.setSupdated(date);
+		zone.setSupdated(date.getTime()/1000);
 		myBatisDao.save("zoneSqlMapper.editZone", zone);
 		return true;
 	}