| @@ -0,0 +1,36 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * Created by Stormeye on 2018/08/09. | |||||
| */ | |||||
| public enum EnumShopStatus { | |||||
| NOT_RENT(0, "未出租"), | |||||
| RENT(1, "已出租"), | |||||
| ; | |||||
| public static EnumShopStatus getEnum(Integer code) { | |||||
| for (EnumShopStatus value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumShopStatus(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -6,6 +6,7 @@ import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxMerchantTradeDaily; | import com.iformall.domain.po.WxMerchantTradeDaily; | ||||
| import com.iformall.domain.po.WxShop; | import com.iformall.domain.po.WxShop; | ||||
| import com.iformall.enums.EnumCarCmd; | import com.iformall.enums.EnumCarCmd; | ||||
| import com.iformall.enums.EnumShopStatus; | |||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.DataTowerService; | import com.iformall.service.DataTowerService; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| @@ -53,9 +54,9 @@ public class DataTowerServiceImpl implements DataTowerService { | |||||
| public Map<String, Object> queryRunning(String tenantId) { | public Map<String, Object> queryRunning(String tenantId) { | ||||
| WxShop wxShop = new WxShop(); | WxShop wxShop = new WxShop(); | ||||
| wxShop.setTenantId(tenantId); | wxShop.setTenantId(tenantId); | ||||
| wxShop.setStatus(1); | |||||
| wxShop.setStatus(EnumShopStatus.RENT.getCode()); | |||||
| List<WxShop> yczlist = wxShopMapper.findList(wxShop); | List<WxShop> yczlist = wxShopMapper.findList(wxShop); | ||||
| wxShop.setStatus(0); | |||||
| wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode()); | |||||
| List<WxShop> wczlist = wxShopMapper.findList(wxShop); | List<WxShop> wczlist = wxShopMapper.findList(wxShop); | ||||
| //出租与未出租 | //出租与未出租 | ||||
| @@ -6,6 +6,7 @@ import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.enums.EnumAppType; | import com.iformall.enums.EnumAppType; | ||||
| import com.iformall.enums.EnumCarVendor; | import com.iformall.enums.EnumCarVendor; | ||||
| import com.iformall.enums.EnumShopStatus; | |||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxProfitSharingReceiverService; | import com.iformall.service.WxProfitSharingReceiverService; | ||||
| @@ -130,7 +131,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| //更新商铺状态 | //更新商铺状态 | ||||
| WxShop wxShop = new WxShop(); | WxShop wxShop = new WxShop(); | ||||
| wxShop.setId(merchantShop.getShopId()); | wxShop.setId(merchantShop.getShopId()); | ||||
| wxShop.setStatus(0);//未出租 | |||||
| wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode());//未出租 | |||||
| WxShopMapper.updateByPrimaryKeySelective(wxShop); | WxShopMapper.updateByPrimaryKeySelective(wxShop); | ||||
| } | } | ||||
| } | } | ||||
| @@ -192,7 +193,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| //更新商铺状态 | //更新商铺状态 | ||||
| WxShop wxShop = new WxShop(); | WxShop wxShop = new WxShop(); | ||||
| wxShop.setId(shopid); | wxShop.setId(shopid); | ||||
| wxShop.setStatus(1);//已出租 | |||||
| wxShop.setStatus(EnumShopStatus.RENT.getCode());//已出租 | |||||
| WxShopMapper.updateByPrimaryKeySelective(wxShop); | WxShopMapper.updateByPrimaryKeySelective(wxShop); | ||||
| } | } | ||||
| @@ -254,7 +255,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| //更新商铺状态 | //更新商铺状态 | ||||
| WxShop wxShop = new WxShop(); | WxShop wxShop = new WxShop(); | ||||
| wxShop.setId(merchantShop.getShopId()); | wxShop.setId(merchantShop.getShopId()); | ||||
| wxShop.setStatus(0);//未出租 | |||||
| wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode());//未出租 | |||||
| WxShopMapper.updateByPrimaryKeySelective(wxShop); | WxShopMapper.updateByPrimaryKeySelective(wxShop); | ||||
| } | } | ||||
| @@ -277,7 +278,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| //更新商铺状态 | //更新商铺状态 | ||||
| WxShop wxShop = new WxShop(); | WxShop wxShop = new WxShop(); | ||||
| wxShop.setId(shopid); | wxShop.setId(shopid); | ||||
| wxShop.setStatus(1);//已出租 | |||||
| wxShop.setStatus(EnumShopStatus.RENT.getCode());//已出租 | |||||
| WxShopMapper.updateByPrimaryKeySelective(wxShop); | WxShopMapper.updateByPrimaryKeySelective(wxShop); | ||||
| } | } | ||||
| @@ -7,6 +7,7 @@ import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxShop; | import com.iformall.domain.po.WxShop; | ||||
| import com.iformall.enums.EnumShopStatus; | |||||
| import com.iformall.mapper.WxShopMapper; | import com.iformall.mapper.WxShopMapper; | ||||
| import com.iformall.service.WxShopService; | import com.iformall.service.WxShopService; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -45,7 +46,7 @@ public class WxShopServiceImpl implements WxShopService { | |||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setStatus(0); | |||||
| record.setStatus(EnumShopStatus.NOT_RENT.getCode()); | |||||
| Date date = new Date(); | Date date = new Date(); | ||||
| record.setUpdateDate(date); | record.setUpdateDate(date); | ||||
| record.setCreateDate(date); | record.setCreateDate(date); | ||||