| @@ -4,14 +4,14 @@ import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BusinessCircleBase; | |||
| import com.iformall.domain.po.WxCouponOrder; | |||
| import com.iformall.domain.po.WxCreditHistory; | |||
| import com.iformall.domain.vo.WxCardSpendVo; | |||
| import com.iformall.enums.EnumCouponType; | |||
| import com.iformall.enums.EnumShopStatus; | |||
| import com.iformall.service.*; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -22,7 +22,7 @@ import java.util.HashMap; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| * @author | |||
| */ | |||
| @RestController | |||
| @RequestMapping("map") | |||
| @@ -53,6 +53,82 @@ public class WxMapController extends BaseController { | |||
| @Autowired | |||
| private WxCreditHistoryService wxCreditHistoryService; | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findShopBySid") | |||
| @ApiImplicitParam(name = "sid", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "店铺管理-id查询") | |||
| public ResultData findShopBySid(String sid) { | |||
| logger.debug("[" + getIpAddr() + "] WxMapController::findShopBySid"); | |||
| Map<String, Object> resultObject = new HashMap<>(); | |||
| Map<String, Object> wxShopObject = wxShopService.detailBySid(getTenantInfo(), sid); | |||
| Map<String, Object> wxMerchantObject = new HashMap<>(); | |||
| Map<String, Object> wxRentContractObject = new HashMap<>(); | |||
| if(wxShopObject != null && !wxShopObject.isEmpty() | |||
| && EnumShopStatus.RENT.getCode().equals(wxShopObject.get("status").toString())){ | |||
| //已出租 | |||
| long shopId = Long.parseLong(wxShopObject.get("id").toString()); | |||
| wxMerchantObject = wxMerchantService.detailByShopId(getTenantInfo(), shopId); | |||
| if(wxMerchantObject != null && !wxMerchantObject.isEmpty()){ | |||
| long merchantId = Long.parseLong(wxMerchantObject.get("id").toString()); | |||
| wxRentContractObject = wxRentContractService.currentValidByMerchantId(getTenantInfo(),merchantId); | |||
| } | |||
| } | |||
| resultObject.put("wxShop",wxShopObject); | |||
| resultObject.put("wxMerchant",wxMerchantObject); | |||
| resultObject.put("wxRentContract",wxRentContractObject); | |||
| return new ResultData(Result.SUCCESS, "查询成功", resultObject); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findStatisticsBySid") | |||
| @ApiImplicitParam(name = "sid", value = "sid", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "店铺管理-id查询") | |||
| public ResultData findStatisticsBySid(String sid, Date startDate, Date endDate) { | |||
| logger.debug("[" + getIpAddr() + "] WxMapController::findStatisticsBySid"); | |||
| Map<String, Object> resultMap = new HashMap<>(); | |||
| Map<String, Object> wxShopObject = wxShopService.detailBySid(getTenantInfo(), sid); | |||
| if(wxShopObject != null && !wxShopObject.isEmpty() | |||
| && EnumShopStatus.RENT.getCode().equals(wxShopObject.get("status").toString())){ | |||
| //已出租 | |||
| long shopId = Long.parseLong(wxShopObject.get("id").toString()); | |||
| Map<String, Object> wxMerchantObject = wxMerchantService.detailByShopId(getTenantInfo(), shopId); | |||
| if(wxMerchantObject != null && !wxMerchantObject.isEmpty()){ | |||
| long merchantId = Long.parseLong(wxMerchantObject.get("id").toString()); | |||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| wxCouponOrder.updateTenantInfo(getTenantInfo()); | |||
| wxCouponOrder.setMerchantId(merchantId); | |||
| wxCouponOrder.setStartTime(startDate); | |||
| wxCouponOrder.setEndTime(endDate); | |||
| wxCouponOrderService.statisticsWriteOff(wxCouponOrder,resultMap); | |||
| WxCardSpendVo wxCardSpend = new WxCardSpendVo(); | |||
| wxCardSpend.updateTenantInfo(getTenantInfo()); | |||
| wxCardSpend.setMerchantId(merchantId); | |||
| wxCardSpend.setStartdate(startDate); | |||
| wxCardSpend.setEnddate(endDate); | |||
| resultMap.put("sumRealPayment",wxCardSpendService.sumRealPayment(wxCardSpend)); | |||
| BusinessCircleBase businessCircle = new BusinessCircleBase(); | |||
| businessCircle.updateTenantInfo(getTenantInfo()); | |||
| businessCircle.setMerchantId(merchantId); | |||
| businessCircle.setStartTime(startDate); | |||
| businessCircle.setEndTime(endDate); | |||
| Integer wxCircleSumPayment = wxBusinessCircleOrderService.sumCirclePayment(businessCircle); | |||
| Integer aliCircleSumPayment = aliBusinessCircleOrderService.sumCirclePayment(businessCircle); | |||
| resultMap.put("sumCirclePayment",wxCircleSumPayment + aliCircleSumPayment); | |||
| WxCreditHistory wxCreditHistory = new WxCreditHistory(); | |||
| wxCreditHistory.setTenantId(getTenantInfo().getFinalTenantId()); | |||
| wxCreditHistory.setMerchantId(merchantId); | |||
| wxCreditHistory.setStartTime(startDate); | |||
| wxCreditHistory.setEndTime(endDate); | |||
| resultMap.put("sumCreditAmount",wxCreditHistoryService.getIncrementCreditAmount(wxCreditHistory)); | |||
| } | |||
| } | |||
| return new ResultData(Result.SUCCESS, "查询成功", resultMap); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findShopById") | |||
| @@ -96,34 +172,33 @@ public class WxMapController extends BaseController { | |||
| parentTenantId = merchantByShop.get("parent_tenant_id").toString(); | |||
| } | |||
| Long mercherId = Long.parseLong(merchantByShop.get("id").toString()); | |||
| wxCouponOrderService.statisticsWriteOff(tenantId,mercherId,startDate,endDate,resultMap); | |||
| Long merchantId = Long.parseLong(merchantByShop.get("id").toString()); | |||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| wxCouponOrder.updateTenantInfo(getTenantInfo()); | |||
| wxCouponOrder.setMerchantId(merchantId); | |||
| wxCouponOrder.setStartTime(startDate); | |||
| wxCouponOrder.setEndTime(endDate); | |||
| wxCouponOrderService.statisticsWriteOff(wxCouponOrder,resultMap); | |||
| WxCardSpendVo wxCardSpend = new WxCardSpendVo(); | |||
| wxCardSpend.setTenantId(tenantId); | |||
| wxCardSpend.setMerchantId(mercherId); | |||
| wxCardSpend.updateTenantInfo(getTenantInfo()); | |||
| wxCardSpend.setMerchantId(merchantId); | |||
| wxCardSpend.setStartdate(startDate); | |||
| wxCardSpend.setEnddate(endDate); | |||
| resultMap.put("sumRealPayment",wxCardSpendService.sumRealPayment(wxCardSpend)); | |||
| Integer wxCircleSumPayment = wxBusinessCircleOrderService.sumCirclePayment(tenantId,mercherId,startDate,endDate); | |||
| Integer aliCircleSumPayment = aliBusinessCircleOrderService.sumCirclePayment(tenantId,mercherId,startDate,endDate); | |||
| BusinessCircleBase businessCircle = new BusinessCircleBase(); | |||
| businessCircle.updateTenantInfo(getTenantInfo()); | |||
| businessCircle.setMerchantId(merchantId); | |||
| businessCircle.setStartTime(startDate); | |||
| businessCircle.setEndTime(endDate); | |||
| Integer wxCircleSumPayment = wxBusinessCircleOrderService.sumCirclePayment(businessCircle); | |||
| Integer aliCircleSumPayment = aliBusinessCircleOrderService.sumCirclePayment(businessCircle); | |||
| resultMap.put("sumCirclePayment",wxCircleSumPayment + aliCircleSumPayment); | |||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| wxCouponOrder.setTenantId(tenantId); | |||
| wxCouponOrder.setSendMerchantId(mercherId); | |||
| wxCouponOrder.setStartTime(startDate); | |||
| wxCouponOrder.setEndTime(endDate); | |||
| wxCouponOrder.setCouponType(EnumCouponType.COUPON_TINGCHE.getCode()); | |||
| resultMap.put("countTingche",wxCouponOrderService.findCount(wxCouponOrder)); | |||
| WxCreditHistory wxCreditHistory = new WxCreditHistory(); | |||
| wxCreditHistory.setTenantId(tenantId); | |||
| if(StringUtils.isNotBlank(parentTenantId)){ | |||
| wxCreditHistory.setTenantId(parentTenantId); | |||
| } | |||
| wxCreditHistory.setMerchantId(mercherId); | |||
| wxCreditHistory.setTenantId(getTenantInfo().getFinalTenantId()); | |||
| wxCreditHistory.setMerchantId(merchantId); | |||
| wxCreditHistory.setStartTime(startDate); | |||
| wxCreditHistory.setEndTime(endDate); | |||
| resultMap.put("sumCreditAmount",wxCreditHistoryService.getIncrementCreditAmount(wxCreditHistory)); | |||
| @@ -125,6 +125,23 @@ public class WxShopController extends BaseController { | |||
| return wxShopService.hasShopNumber(wxShop); | |||
| } | |||
| @ApiOperation("查询商铺地图sid是否存在") | |||
| @GetMapping("hasShopSid") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "shopNumber", value = "shopNumber", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query"), | |||
| @ApiImplicitParam(name = "type", value = "type", dataType = "Integer", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "店铺管理-查询商铺号是否存在") | |||
| public ResultData hasShopSid(String shopSid, Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxShopController::hasShopSid"); | |||
| WxShop wxShop = new WxShop(); | |||
| wxShop.setSid(shopSid); | |||
| wxShop.setId(id); | |||
| wxShop.updateTenantInfo(getTenantInfo()); | |||
| return wxShopService.hasShopSid(wxShop); | |||
| } | |||
| @ApiOperation("分页列表接品-合同访问") | |||
| @GetMapping("listShopFromContract") | |||
| @@ -0,0 +1,3 @@ | |||
| ALTER TABLE `mallink`.`wx_shop` | |||
| ADD COLUMN `sid` varchar(50) COMMENT '店铺对应的sid' AFTER `y`, | |||
| ADD INDEX `sid_del`(`sid`, `is_del`) USING BTREE; | |||
| @@ -79,6 +79,9 @@ public class WxCouponOrder extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private Integer subBusinessId; | |||
| @TableField(exist = false) | |||
| private Long merchantId; | |||
| @TableField(exist = false) | |||
| private String merchantName; | |||
| @@ -76,6 +76,9 @@ public class WxShop extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="店铺相对位置y",name="y") | |||
| private BigDecimal y; | |||
| @io.swagger.annotations.ApiModelProperty(value="店铺对应地图的sid",name="sid") | |||
| private String sid; | |||
| @io.swagger.annotations.ApiModelProperty(value="地址",name="addr") | |||
| private String addr; | |||
| @@ -3,6 +3,7 @@ package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.AliBusinessCircleOrder; | |||
| import com.iformall.domain.po.BusinessCircleBase; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.Date; | |||
| @@ -43,6 +44,5 @@ public interface AliBusinessCircleOrderMapper extends CommonMapper<AliBusinessCi | |||
| */ | |||
| void updateOrderStatus(AliBusinessCircleOrder record); | |||
| Integer sumCirclePayment(@Param("tenantId")String tenantId, @Param("merchantId")Long mercherId, | |||
| @Param("startDate")Date startDate, @Param("endDate")Date endDate); | |||
| Integer sumCirclePayment(BusinessCircleBase record); | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.BusinessCircleBase; | |||
| import com.iformall.domain.po.WxBusinessCircleOrder; | |||
| import org.apache.ibatis.annotations.Param; | |||
| @@ -46,6 +47,5 @@ public interface WxBusinessCircleOrderMapper extends CommonMapper<WxBusinessCirc | |||
| */ | |||
| void updateOrderStatus(WxBusinessCircleOrder record); | |||
| Integer sumCirclePayment(@Param("tenantId")String tenantId, @Param("merchantId")Long mercherId, | |||
| @Param("startDate")Date startDate, @Param("endDate")Date endDate); | |||
| Integer sumCirclePayment(BusinessCircleBase record); | |||
| } | |||
| @@ -93,7 +93,5 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> { | |||
| //查询待延期的idList | |||
| List<Long> cardDeferCouponOrderId(@Param("couponId")Long couponId,@Param("tenantId")String tenantId); | |||
| Integer findWriteOffCount(@Param("tenantId")String tenantId, @Param("mercherId")Long mercherId, | |||
| @Param("startDate")Date startDate, @Param("endDate")Date endDate, | |||
| @Param("couponType")Integer couponType); | |||
| Integer findWriteOffCount(WxCouponOrder wxCouponOrder); | |||
| } | |||
| @@ -3,6 +3,7 @@ package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.dto.WxMerchantDto; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxMerchantTradeDetailVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| @@ -59,4 +60,6 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | |||
| int recordedAmount(WxMerchant record); | |||
| List<Map<String, Object>> findMerchantByShop(@Param("shopId")Long shopId); | |||
| List<Map<String, Object>> detailByShopId(@Param("tenantInfo")TenantEntity tenantInfo,@Param("shopId") Long shopId); | |||
| } | |||
| @@ -85,5 +85,8 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long> | |||
| List<Long> getMerchantIdsByStatuss(WxRentContract wxRentContract); | |||
| @Deprecated | |||
| List<Map<String, Object>> findRentByShop(@Param("shopId")Long shopId); | |||
| List<Map<String, Object>> currentValidByMerchantId(WxRentContract rentContract); | |||
| } | |||
| @@ -30,6 +30,7 @@ public interface WxShopMapper extends CommonMapper<WxShop, String> { | |||
| List<Map<String,Object>> listShopFromContract(WxShop wxShop); | |||
| int hasShopNumber(WxShop wxShop); | |||
| int hasShopSid(WxShop wxShop); | |||
| List<WxShopVo> findListWithMerchantMap(WxShop record); | |||
| @@ -44,4 +45,7 @@ public interface WxShopMapper extends CommonMapper<WxShop, String> { | |||
| Map<String,Object> detailById(@Param("id") Long id); | |||
| List<WxShop> selectBatchByIds(@Param("ids")List<Long> ids); | |||
| List<Map<String, Object>> detailBySid(WxShop wxShop); | |||
| } | |||
| @@ -3,12 +3,12 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.AliBusinessCircleOrder; | |||
| import com.iformall.domain.po.BusinessCircleBase; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| public interface AliBusinessCircleOrderService { | |||
| @@ -54,5 +54,5 @@ public interface AliBusinessCircleOrderService { | |||
| void exportData(AliBusinessCircleOrder circleOrder, HttpServletRequest request, HttpServletResponse response); | |||
| Integer sumCirclePayment(String tenantId, Long mercherId, Date startDate, Date endDate); | |||
| Integer sumCirclePayment(BusinessCircleBase circleOrder); | |||
| } | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.BusinessCircleBase; | |||
| import com.iformall.domain.po.WxBusinessCircleOrder; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| @@ -57,5 +58,5 @@ public interface WxBusinessCircleOrderService { | |||
| void exportData(WxBusinessCircleOrder circleOrder, HttpServletRequest request, HttpServletResponse response); | |||
| Integer sumCirclePayment(String tenantId, Long mercherId, Date startDate, Date endDate); | |||
| Integer sumCirclePayment(BusinessCircleBase circleOrder); | |||
| } | |||
| @@ -217,7 +217,7 @@ public interface WxCouponOrderService { | |||
| int findCount(WxCouponOrder wxCouponOrder,List<TenantEntity> tenantEntitys); | |||
| void statisticsWriteOff(String tenantId, Long mercherId, Date startDate, Date endDate, Map<String, Object> resultMap); | |||
| void statisticsWriteOff(WxCouponOrder wxCouponOrder, Map<String, Object> resultMap); | |||
| Integer findCount(WxCouponOrder wxCouponOrder); | |||
| } | |||
| @@ -178,5 +178,8 @@ public interface WxMerchantService { | |||
| ResultData ttstartusing(Long id); | |||
| @Deprecated | |||
| Map<String,Object> findMerchantByShop(Long shopId); | |||
| Map<String, Object> detailByShopId(TenantEntity tenantInfo, Long shopId); | |||
| } | |||
| @@ -125,5 +125,8 @@ public interface WxRentContractService { | |||
| */ | |||
| boolean hasOtherValidContractShop(WxRentContract wxRentContract); | |||
| @Deprecated | |||
| Map<String, Object> findRentByShop(Long shopId); | |||
| Map<String, Object> currentValidByMerchantId(TenantEntity tenantInfo, Long merchantId); | |||
| } | |||
| @@ -61,6 +61,7 @@ public interface WxShopService { | |||
| ResultData getMerchantShopByShopId(TenantEntity tenantEntity, String shopId); | |||
| ResultData hasShopNumber(WxShop wxShop); | |||
| ResultData hasShopSid(WxShop wxShop); | |||
| PageInfo<Map<String,Object>> listShopFromContract(WxShop wxShop, Integer pageNum, Integer pageSize); | |||
| @@ -80,5 +81,9 @@ public interface WxShopService { | |||
| */ | |||
| void exportNotRentShop(WxShop wxShop, HttpServletRequest request, HttpServletResponse response); | |||
| @Deprecated | |||
| Map<String,Object> detailById(Long id); | |||
| Map<String,Object> detailBySid(TenantEntity tenantInfo, String sid); | |||
| } | |||
| @@ -360,8 +360,8 @@ public class AliBusinessCircleOrderServiceImpl implements AliBusinessCircleOrder | |||
| } | |||
| @Override | |||
| public Integer sumCirclePayment(String tenantId, Long mercherId, Date startDate, Date endDate) { | |||
| Integer sumCirclePayment = aliBusinessCircleOrderMapper.sumCirclePayment(tenantId,mercherId,startDate,endDate); | |||
| public Integer sumCirclePayment(BusinessCircleBase circleOrder) { | |||
| Integer sumCirclePayment = aliBusinessCircleOrderMapper.sumCirclePayment(circleOrder); | |||
| return sumCirclePayment==null?0:sumCirclePayment; | |||
| } | |||
| @@ -373,8 +373,8 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe | |||
| } | |||
| @Override | |||
| public Integer sumCirclePayment(String tenantId, Long mercherId, Date startDate, Date endDate) { | |||
| Integer sumCirclePayment = wxBusinessCircleOrderMapper.sumCirclePayment(tenantId,mercherId,startDate,endDate); | |||
| public Integer sumCirclePayment(BusinessCircleBase circleOrder) { | |||
| Integer sumCirclePayment = wxBusinessCircleOrderMapper.sumCirclePayment(circleOrder); | |||
| return sumCirclePayment==null?0:sumCirclePayment; | |||
| } | |||
| @@ -1546,11 +1546,18 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| } | |||
| @Override | |||
| public void statisticsWriteOff(String tenantId, Long mercherId, Date startDate, Date endDate, Map<String, Object> resultMap) { | |||
| resultMap.put("couponWriteOff",wxCouponOrderMapper.findWriteOffCount(tenantId, mercherId, startDate, endDate, null)); | |||
| resultMap.put("groupWriteOff",wxCouponOrderMapper.findWriteOffCount(tenantId, mercherId, startDate, endDate, EnumCouponType.COUPON_GROUP.getCode())); | |||
| resultMap.put("pressWriteOff",wxCouponOrderMapper.findWriteOffCount(tenantId, mercherId, startDate, endDate, EnumCouponType.COUPON_PRESS.getCode())); | |||
| public void statisticsWriteOff(WxCouponOrder wxCouponOrder, Map<String, Object> resultMap) { | |||
| wxCouponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USED.getCode()); | |||
| resultMap.put("couponWriteOff",wxCouponOrderMapper.findWriteOffCount(wxCouponOrder)); | |||
| wxCouponOrder.setCouponType(EnumCouponType.COUPON_GROUP.getCode()); | |||
| resultMap.put("groupWriteOff",wxCouponOrderMapper.findWriteOffCount(wxCouponOrder)); | |||
| wxCouponOrder.setCouponType(EnumCouponType.COUPON_PRESS.getCode()); | |||
| resultMap.put("pressWriteOff",wxCouponOrderMapper.findWriteOffCount(wxCouponOrder)); | |||
| wxCouponOrder.setCouponType(EnumCouponType.COUPON_TINGCHE.getCode()); | |||
| wxCouponOrder.setSendMerchantId(wxCouponOrder.getMerchantId()); | |||
| wxCouponOrder.setMerchantId(null); | |||
| wxCouponOrder.setCouponOrderStatus(null); | |||
| resultMap.put("countTingche",wxCouponOrderMapper.findWriteOffCount(wxCouponOrder)); | |||
| } | |||
| @Override | |||
| @@ -1149,4 +1149,13 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| return null; | |||
| } | |||
| @Override | |||
| public Map<String, Object> detailByShopId(TenantEntity tenantInfo, Long shopId) { | |||
| List<Map<String, Object>> merchants = wxMerchantMapper.detailByShopId(tenantInfo,shopId); | |||
| if(merchants != null && merchants.size() > 0){ | |||
| return merchants.get(0); | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -3175,6 +3175,22 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| return null; | |||
| } | |||
| @Override | |||
| public Map<String, Object> currentValidByMerchantId(TenantEntity tenantInfo, Long merchantId) { | |||
| WxRentContract rentContract = new WxRentContract(); | |||
| rentContract.updateTenantInfo(tenantInfo); | |||
| rentContract.setMerchantId(merchantId); | |||
| List<Integer> statuss = new ArrayList<>(); | |||
| statuss.add(EnumRentContractStatus.READY_FOR_PAING.getCode()); | |||
| statuss.add(EnumRentContractStatus.PAING.getCode()); | |||
| rentContract.setStatuss(statuss); | |||
| List<Map<String, Object>> rentContracts = wxRentContractMapper.currentValidByMerchantId(rentContract); | |||
| if(rentContracts != null && rentContracts.size() > 0){ | |||
| return rentContracts.get(0); | |||
| } | |||
| return null; | |||
| } | |||
| public static void main(String[] args) { | |||
| String s = "{\"siteMoney\":\"2\",\"facilityMoney\":\"3\",\"administratorMoney\":\"4\"}"; | |||
| @@ -200,6 +200,12 @@ public class WxShopServiceImpl implements WxShopService { | |||
| return new ResultData(ResultData.SUCCESS, "查询成功", count > 0 ? true : false); | |||
| } | |||
| @Override | |||
| public ResultData hasShopSid(WxShop wxShop) { | |||
| int count = wxShopMapper.hasShopSid(wxShop); | |||
| return new ResultData(ResultData.SUCCESS, "查询成功", count > 0 ? true : false); | |||
| } | |||
| @Override | |||
| public PageInfo<Map<String, Object>> listShopFromContract(WxShop wxShop, Integer pageIndex, Integer pageSize) { | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| @@ -242,4 +248,16 @@ public class WxShopServiceImpl implements WxShopService { | |||
| public Map<String,Object> detailById(Long id) { | |||
| return wxShopMapper.detailById(id); | |||
| } | |||
| @Override | |||
| public Map<String, Object> detailBySid(TenantEntity tenantInfo, String sid) { | |||
| WxShop wxShop = new WxShop(); | |||
| wxShop.updateTenantInfo(tenantInfo); | |||
| wxShop.setSid(sid); | |||
| List<Map<String, Object>> shops = wxShopMapper.detailBySid(wxShop); | |||
| if(shops != null && shops.size() > 0){ | |||
| return shops.get(0); | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -212,17 +212,25 @@ | |||
| where `id` = #{id} and `tenant_id` = #{tenantId} | |||
| </update> | |||
| <select id="sumCirclePayment" parameterType="java.util.HashMap" resultType="Integer"> | |||
| <select id="sumCirclePayment" parameterType="com.iformall.domain.po.BusinessCircleBase" resultType="Integer"> | |||
| select | |||
| IFNULL(SUM(`pay_amount`),0) as sum_pay_amount | |||
| from ali_business_circle_order | |||
| where `tenant_id` = #{tenantId} | |||
| and `merchant_id` = #{merchantId} | |||
| <if test=" null != startDate "> | |||
| AND `time_end` >= #{startDate} | |||
| where 1=1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != endDate "> | |||
| AND `time_end` <= #{endDate} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != merchantId "> | |||
| and `merchant_id` = #{merchantId} | |||
| </if> | |||
| <if test=" null != startTime "> | |||
| and `time_end` >= #{startTime} | |||
| </if> | |||
| <if test=" null != endTime"> | |||
| and `time_end` < #{endTime} | |||
| </if> | |||
| </select> | |||
| @@ -245,17 +245,25 @@ | |||
| </update> | |||
| <select id="sumCirclePayment" parameterType="java.util.HashMap" resultType="Integer"> | |||
| <select id="sumCirclePayment" parameterType="com.iformall.domain.po.BusinessCircleBase" resultType="Integer"> | |||
| select | |||
| IFNULL(SUM(`pay_amount`),0) as sum_pay_amount | |||
| from wx_business_circle_order | |||
| where `tenant_id` = #{tenantId} | |||
| and `merchant_id` = #{merchantId} | |||
| <if test=" null != startDate "> | |||
| AND `time_end` >= #{startDate} | |||
| where 1=1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != endDate "> | |||
| AND `time_end` <= #{endDate} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != merchantId "> | |||
| and `merchant_id` = #{merchantId} | |||
| </if> | |||
| <if test=" null != startTime "> | |||
| and `time_end` >= #{startTime} | |||
| </if> | |||
| <if test=" null != endTime"> | |||
| and `time_end` < #{endTime} | |||
| </if> | |||
| </select> | |||
| @@ -1467,22 +1467,37 @@ | |||
| </select> | |||
| <select id="findWriteOffCount" parameterType="java.util.HashMap" resultType="java.lang.Integer"> | |||
| <select id="findWriteOffCount" parameterType="com.iformall.domain.po.WxCouponOrder" resultType="java.lang.Integer"> | |||
| select count(co.id) | |||
| from wx_coupon_order co | |||
| left join wx_merchant_b_user mbu on co.b_user_id = mbu.id | |||
| where co.tenant_id = #{tenantId} and co.coupon_order_status = 1 | |||
| and mbu.merchant_id = #{mercherId} | |||
| <if test=" null != startDate "> | |||
| AND co.update_date >= #{startDate} | |||
| where where 1 = 1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and co.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != endDate "> | |||
| AND co.update_date <= #{endDate} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and co.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != merchantId "> | |||
| and mbu.`merchant_id` = #{merchantId} | |||
| </if> | |||
| <if test=" null != couponType "> | |||
| and co.`coupon_type` = #{couponType} | |||
| </if> | |||
| <if test=" null != couponOrderStatus "> | |||
| and co.`coupon_order_status` = #{couponOrderStatus} | |||
| </if> | |||
| <if test=" null != sendMerchantId "> | |||
| and co.`send_merchant_id` = #{sendMerchantId} | |||
| </if> | |||
| <if test=" null != startTime "> | |||
| AND co.update_date >= #{startTime} | |||
| </if> | |||
| <if test=" null != endTime "> | |||
| AND co.update_date <= #{endTime} | |||
| </if> | |||
| </select> | |||
| </mapper> | |||
| @@ -723,4 +723,27 @@ | |||
| where s.`id` = #{shopId} | |||
| </select> | |||
| <select id="detailByShopId" parameterType="hashmap" resultType="hashmap"> | |||
| select | |||
| m.`id`,m.`tenant_id` tenantId,m.`parent_tenant_id` parentTenantId,m.`img_url`,m.`name`,m.`encode`,m.`link_phone`,m.`create_date`,m.`update_date`, | |||
| m.`car_vendor_type`,m.`car_params`,m.`status`,m.`link_person`, | |||
| m.`business_id`,m.`business_types`,m.`sub_business_id`,m.`shop_type`,m.`brand`,m.`type`,m.`is_public`,m.email,m.`title`,m.`cover_picture`,m.`is_admin`,m.`bill_setting`,m.`qr_code`, | |||
| m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.credit_locked,m.credit_locked, | |||
| b.name brandName,bu.title businessTitle,mc.corp_papers_register_number corpPapersRegisterNumber,mc.corp_papers_address corpPapersAddress | |||
| from wx_merchant m | |||
| left join wx_merchant_shop ms on ms.merchant_id = m.id and ms.is_del = 0 | |||
| left join wx_shop s on s.id = ms.shop_id | |||
| left join wx_brand b on m.brand = b.id | |||
| left join wx_business bu on m.business_id = bu.id | |||
| left join wx_merchant_corp mc on mc.merchant_id = m.id | |||
| where m.is_del = 0 | |||
| <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> | |||
| and m.`tenant_id` = #{tenantInfo.tenantId} | |||
| </if> | |||
| <if test=" null != tenantInfo.parentTenantId and '' != tenantInfo.parentTenantId"> | |||
| and m.`parent_tenant_id` = #{tenantInfo.parentTenantId} | |||
| </if> | |||
| and s.`id` = #{shopId} | |||
| </select> | |||
| </mapper> | |||
| @@ -793,6 +793,39 @@ | |||
| and rc.`rental_start_date` <= now() and rc.rental_end_date >= now() | |||
| order by rc.`updatetime` desc; | |||
| </select> | |||
| <select id="currentValidByMerchantId" parameterType="com.iformall.domain.po.WxRentContract" resultType="hashmap"> | |||
| select | |||
| rc.`id`,rc.`merchant_id`, | |||
| rc.`shop_type_sub`,rc.`lease_purpose`,rc.`contractual_rules`,rc.`delivery_date`,rc.`delivery_grace_period`,rc.`opening_date`,rc.`business_hours`,rc.`scope_metre`, | |||
| rc.`price`,rc.rent_area,rc.`rental_start_date`,rc.`rental_end_date`,rc.`sign_date`,rc.`receive_period`, | |||
| rc.`tenant_id`,rc.`parent_tenant_id`,rc.`filepath`,rc.`status`,rc.`contract_number`, | |||
| rc.`first_party_bank_info`,rc.`second_party_bank_info`,rc.`second_party_tax_info`, | |||
| rc.`property_name`,rc.`property_fee`,rc.`fee_cycle`,rc.`water_fee`,rc.`electricity_fees`, | |||
| rc.`deposit`,rc.cashtype_content_lsit,rc.cashtype_lsit,rc.`pay_date`,rc.`is_del`,rc.`merchant_name`, | |||
| rc.`brand`,rc.`business_id`,rc.`shop_type`,rc.`shop_type_str`,rc.`updatetime`,rc.`createtime`,rc.`link_person`,rc.`link_phone`,rc.`link_address`, | |||
| rc.`pay_account`,rc.`filename`,rc.`lease`,rc.`type`,rc.`revenue`,rc.`adjust_ratio`,rc.`adjust_period`,rc.`pay_ratio`, | |||
| rc.`start_date`,rc.`end_date`,rc.`shop_name`,rc.`from_id`, | |||
| rc.`apply_status`,rc.`bank_name`,rc.`rent_shop_type`,rc.`fix_start_date`,rc.`fix_end_date`, | |||
| rc.`business_type`,rc.`rent_info`, rc.`file_names`,rc.price_unit,rent_price,rc.other_rent_price_info,rc.`subject_name`,rc.rent_start_type, | |||
| rc.`rent_input_way`,rc.`adjust_ratio_way`,rc.`operation_type`,rc.late_pay_ratio,rc.late_pay_day,rc.bus_discount_ratio,rc.bus_discount_time | |||
| from wx_rent_contract rc | |||
| where rc.is_del = 0 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and rc.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and rc.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| and rc.`merchant_id` = #{merchantId} | |||
| and rc.`rental_start_date` <= now() and rc.rental_end_date >= now() | |||
| <if test=" null != statuss "> | |||
| and rc.`status` in | |||
| <foreach collection="statuss" index="index" item="statusItem" open="(" separator="," close=")"> | |||
| #{statusItem} | |||
| </foreach> | |||
| </if> | |||
| </select> | |||
| </mapper> | |||
| @@ -15,6 +15,7 @@ | |||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||
| <result column="x" jdbcType="DECIMAL" property="x"/> | |||
| <result column="y" jdbcType="DECIMAL" property="y"/> | |||
| <result column="sid" jdbcType="VARCHAR" property="sid"/> | |||
| <result column="addr" jdbcType="VARCHAR" property="addr"/> | |||
| <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/> | |||
| <result column="longitude" jdbcType="DECIMAL" property="longitude"/> | |||
| @@ -36,7 +37,7 @@ | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`shop_number`,`build_area`,`operation_area`,`building`,`floor`,`status`,`x`,`y`,`addr`, | |||
| `id`,`tenant_id`,`parent_tenant_id`,`shop_number`,`build_area`,`operation_area`,`building`,`floor`,`status`,`x`,`y`,`sid`,`addr`, | |||
| `baidu_poi`,`longitude`,`latitude`,`create_date`,`update_date`,`img_url`,`manager`,`manager_phone`, | |||
| `type`,`point_type`,`comments`,`is_del`,DATEDIFF(now(),create_date) freeDay,rent,rent_unit,business_id | |||
| </sql> | |||
| @@ -87,6 +88,10 @@ | |||
| and `y` = #{y} | |||
| </if> | |||
| <if test=" null != sid "> | |||
| and `sid` = #{sid} | |||
| </if> | |||
| <if test=" null != addr "> | |||
| and `addr` like concat('%', #{addr},'%') | |||
| </if> | |||
| @@ -143,7 +148,7 @@ | |||
| <select id="selectBatchByIds" resultMap="BaseResultMap"> | |||
| select | |||
| s.`id`,s.`tenant_id`,s.`parent_tenant_id`,s.`shop_number`,s.`build_area`,s.`operation_area`,s.building,b.building_name building_name,s.floor,f.floor_name floor_name,s.`status`,s.`x`,s.`y`,s.`addr`, | |||
| s.`id`,s.`tenant_id`,s.`parent_tenant_id`,s.`shop_number`,s.`build_area`,s.`operation_area`,s.building,b.building_name building_name,s.floor,f.floor_name floor_name,s.`status`,s.`x`,s.`y`,s.`sid`,s.`addr`, | |||
| s.`baidu_poi`,s.`longitude`,s.`latitude`,s.`create_date`,s.`update_date`,s.`img_url`,s.`manager`,s.`manager_phone`, | |||
| s.`type`,s.`point_type`,s.`comments`,s.`is_del`,DATEDIFF(now(),s.create_date) freeDay,s.rent,s.rent_unit,s.business_id | |||
| from wx_shop s | |||
| @@ -219,6 +224,10 @@ | |||
| and s.`y` = #{y} | |||
| </if> | |||
| <if test=" null != sid "> | |||
| and s.`sid` = #{sid} | |||
| </if> | |||
| <if test=" null != addr "> | |||
| and s.`addr` like concat('%', #{addr},'%') | |||
| </if> | |||
| @@ -318,6 +327,7 @@ | |||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||
| <result column="x" jdbcType="DECIMAL" property="x"/> | |||
| <result column="y" jdbcType="DECIMAL" property="y"/> | |||
| <result column="sid" jdbcType="VARCHAR" property="sid"/> | |||
| <result column="addr" jdbcType="VARCHAR" property="addr"/> | |||
| <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/> | |||
| <result column="longitude" jdbcType="DECIMAL" property="longitude"/> | |||
| @@ -405,6 +415,10 @@ | |||
| and s.`y` = #{y} | |||
| </if> | |||
| <if test=" null != sid "> | |||
| and s.`sid` = #{sid} | |||
| </if> | |||
| <if test=" null != addr "> | |||
| and s.`addr` like concat('%', #{addr},'%') | |||
| </if> | |||
| @@ -565,6 +579,20 @@ | |||
| and id != #{id} | |||
| </if> | |||
| </select> | |||
| <select id="hasShopSid" parameterType="com.iformall.domain.po.WxShop" resultType="Integer"> | |||
| select count(*) from wx_shop where sid=#{sid} | |||
| and is_del=0 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != id"> | |||
| and id != #{id} | |||
| </if> | |||
| </select> | |||
| <resultMap id="ShopVoResultMap" type="com.iformall.domain.vo.WxShopVo"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| @@ -674,4 +702,26 @@ | |||
| left join wx_business bu on s.business_id = bu.id | |||
| where s.`id` = #{id} | |||
| </select> | |||
| <select id="detailBySid" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap"> | |||
| select | |||
| s.id id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber, | |||
| CONVERT(s.build_area,DECIMAL(10,2)) buildArea, | |||
| s.img_url imgUrl,CONVERT(s.operation_area,DECIMAL(10,2)) operationArea, | |||
| s.status,b.building_name building,f.floor_name floor,s.manager,s.manager_phone managerPhone, | |||
| s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,rent,rent_unit, | |||
| s.business_id as businessId,bu.title businessName,s.create_date create_date | |||
| from wx_shop s | |||
| left join wx_mall_building b on s.building=b.id | |||
| left join wx_mall_floor f on s.floor=f.id | |||
| left join wx_business bu on s.business_id = bu.id | |||
| where s.`is_del` = 0 and s.`sid` = #{sid} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and s.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and s.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| </select> | |||
| </mapper> | |||