develop # Conflicts: # mallinkAdmin/src/main/java/com/iformall/config/RedisConfig.java # mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponChannelController.java # mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPasswordController.java # mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponPresentController.java # mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java # mallinkBApi/src/main/java/com/iformall/config/RedisConfig.java # mallinkCApi/src/main/java/com/iformall/config/RedisConfig.java # mallinkCApi/src/main/java/com/iformall/controller/WxCarController.java # mallinkCApi/src/main/java/com/iformall/controller/WxCouponPasswordController.java # mallinkCallback/src/main/java/com/iformall/config/RedisConfig.java # mallinkCallback/src/main/java/com/iformall/controller/callback/WxCarETCPCallBackController.java # mallinkCallback/src/main/java/com/iformall/controller/callback/WxCarTJDCallBackController.java # mallinkMQConsumer/src/main/java/com/iformall/config/RedisConfig.java # mallinkPosApi/src/main/java/com/iformall/config/RedisConfig.java # mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java # mallinkSchedule/src/main/java/com/iformall/config/RedisConfig.java # mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java # mallinkService/src/main/java/com/iformall/domain/po/WxCouponPassword.java # mallinkService/src/main/java/com/iformall/domain/po/WxCouponPresent.java # mallinkService/src/main/java/com/iformall/domain/po/WxPayAccount.java # mallinkService/src/main/java/com/iformall/service/WxCouponPasswordService.java # mallinkService/src/main/java/com/iformall/service/WxCouponService.java # mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java # mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java # mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java # mallinkService/src/main/java/com/iformall/service/impl/WxCouponPresentServiceImpl.java # mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java # mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java # mallinkService/src/main/java/com/iformall/service/impl/WxMsgCallbackServiceImpl.java # mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java # mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java # mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java # mallinkService/src/main/java/com/iformall/service/impl/WxSubsidyServiceImpl.java # mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmsServiceImpl.java # mallinkService/src/main/resources/mapper/WxCouponMapper.xml # mallinkSysAdmin/src/main/java/com/iformall/config/RedisConfig.java # mallinkWebSocketServer/src/main/java/com/iformall/config/RedisConfig.javarelease_toaliyun_real
| @@ -68,6 +68,7 @@ | |||
| ch.qos.logback, | |||
| com.alibaba, | |||
| com.amazonaws, | |||
| com.baomidou, | |||
| com.mchange, | |||
| com.fasterxml.jackson.core, | |||
| com.fasterxml.jackson.dataformat, | |||
| @@ -117,6 +118,8 @@ | |||
| javax.servlet, | |||
| javax.validation, | |||
| javax.xml.bind, | |||
| javax.xml.soap, | |||
| javax.xml.ws, | |||
| joda-time, | |||
| junit, | |||
| mysql, | |||
| @@ -154,6 +157,8 @@ | |||
| org.jboss.xnio, | |||
| org.jdom, | |||
| org.jodd, | |||
| org.jvnet.mimepull, | |||
| org.jvnet.staxex, | |||
| org.mapstruct, | |||
| org.mockito, | |||
| org.mybatis, | |||
| @@ -162,6 +167,7 @@ | |||
| org.ow2.asm, | |||
| org.projectlombok, | |||
| org.quartz-scheduler, | |||
| org.reactivestreams, | |||
| org.reflections, | |||
| org.rocketmq.spring.boot, | |||
| org.slf4j, | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall; | |||
| import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties; | |||
| import org.mybatis.spring.annotation.MapperScan; | |||
| import org.rocketmq.starter.annotation.EnableRocketMQ; | |||
| import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.boot.SpringApplication; | |||
| @@ -8,7 +9,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.scheduling.annotation.EnableAsync; | |||
| import springfox.documentation.swagger2.annotations.EnableSwagger2; | |||
| import tk.mybatis.spring.annotation.MapperScan; | |||
| /** | |||
| * @author chenkx | |||
| @@ -1,15 +1,19 @@ | |||
| package com.iformall.config; | |||
| import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor; | |||
| import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; | |||
| import com.iformall.plugin.MultiTenancy; | |||
| import org.apache.ibatis.reflection.MetaObject; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.transaction.annotation.EnableTransactionManagement; | |||
| import java.util.Properties; | |||
| @EnableTransactionManagement | |||
| @Configuration | |||
| public class MyBatisConfiguration { | |||
| @Bean | |||
| public MultiTenancy multiTenancy() { | |||
| MultiTenancy multiTenancy = new MultiTenancy(); | |||
| @@ -20,4 +24,16 @@ public class MyBatisConfiguration { | |||
| multiTenancy.setProperties(properties); | |||
| return multiTenancy; | |||
| } | |||
| @Bean | |||
| public PaginationInterceptor paginationInterceptor() { | |||
| PaginationInterceptor page = new PaginationInterceptor(); | |||
| page.setDialectType("mysql"); | |||
| return page; | |||
| } | |||
| @Bean | |||
| public OptimisticLockerInterceptor optimisticLockerInterceptor() { | |||
| return new OptimisticLockerInterceptor(); | |||
| } | |||
| } | |||
| @@ -1,10 +1,7 @@ | |||
| package com.iformall.config; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.PushLimit; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxMall; | |||
| import com.iformall.domain.po.WxScoreRules; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.WxCouponChannelVo; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| @@ -15,7 +12,6 @@ import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.data.redis.cache.RedisCacheConfiguration; | |||
| import org.springframework.data.redis.cache.RedisCacheManager; | |||
| import org.springframework.data.redis.cache.RedisCacheWriter; | |||
| import org.springframework.data.redis.connection.RedisConnectionFactory; | |||
| import org.springframework.data.redis.core.RedisTemplate; | |||
| import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; | |||
| @@ -167,6 +163,25 @@ public class RedisConfig extends CachingConfigurerSupport { | |||
| RedisTemplate<String, PageInfo<WxCouponChannelVo>> template = new RedisTemplate<>(); | |||
| Jackson2JsonRedisSerializer<PageInfo> j = new Jackson2JsonRedisSerializer<PageInfo>(PageInfo.class); | |||
| // value值的序列化 | |||
| template.setValueSerializer(j); | |||
| template.setHashKeySerializer(j); | |||
| // key的序列化 | |||
| template.setKeySerializer(new StringRedisSerializer()); | |||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||
| template.setConnectionFactory(connectionFactory); | |||
| return template; | |||
| } | |||
| @Bean("buserTokenRedisTemplate") | |||
| public RedisTemplate<String, WxBuser> getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { | |||
| RedisTemplate<String, WxBuser> template = new RedisTemplate(); | |||
| Jackson2JsonRedisSerializer<WxBuser> j = new Jackson2JsonRedisSerializer(WxBuser.class); | |||
| // value值的序列化 | |||
| template.setValueSerializer(j); | |||
| template.setHashKeySerializer(j); | |||
| @@ -55,12 +55,12 @@ public class WxAppinfoController extends BaseController { | |||
| @Override | |||
| public void run() { | |||
| String param = merchant.getWeappScene(); | |||
| ResultData resultData = qrCodeService.exportQrcode(null, null, merchant.getTenantId(), 1, pageUrl, param, 0, "", "", "店铺详情", true); | |||
| ResultData resultData = qrCodeService.uploadQrcode(merchant.getTenantId(), 1, pageUrl, param, 0, "", "", "店铺详情"); | |||
| Map<String, String> map = (Map) resultData.data; | |||
| if(map!=null && map.get("url") !=null) { | |||
| String url = map.get("url"); | |||
| merchant.setQrCode(url); | |||
| wxMerchantMapper.updateByPrimaryKeySelective(merchant); | |||
| wxMerchantMapper.updateById(merchant); | |||
| } | |||
| } | |||
| }); | |||
| @@ -81,12 +81,12 @@ public class WxAppinfoController extends BaseController { | |||
| @Override | |||
| public void run() { | |||
| String param = couponChannel.getWeappScene(); | |||
| ResultData resultData = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); | |||
| ResultData resultData = qrCodeService.uploadQrcode(couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||
| Map<String,String> map = (Map)resultData.data; | |||
| if(map!=null && map.get("url") !=null) { | |||
| String url = map.get("url"); | |||
| couponChannel.setQrCode(url); | |||
| wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); | |||
| wxCouponChannelMapper.updateById(couponChannel); | |||
| } | |||
| } | |||
| }); | |||
| @@ -124,7 +124,7 @@ public class WxAppinfoController extends BaseController { | |||
| qrCodeService.exportQrcode(request, response, | |||
| getTenantId(), type, pageUrl, sceneParam, | |||
| withText, text1, text2, | |||
| name,false); | |||
| name); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| throw new MallinkException(Result.ERROR, "下载异常"); | |||
| @@ -5,7 +5,7 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxBrand; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.enums.EnumDelFlag; | |||
| @@ -6,12 +6,15 @@ import com.iformall.annotation.UserDataRuleAnnotation; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxProfitSharingReceiver; | |||
| import com.iformall.domain.vo.WxMerchantTradeDetailVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import com.iformall.service.QrCodeService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxScoreRulesService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @@ -37,7 +40,8 @@ public class WxMerchantController extends BaseController { | |||
| private WxMerchantService wxMerchantService; | |||
| @Autowired | |||
| private QrCodeService qrCodeService; | |||
| @Autowired | |||
| private WxScoreRulesService wxScoreRulesService; | |||
| @UserDataRuleAnnotation("merchant_list") | |||
| @ApiOperation("分页列表接口") | |||
| @@ -101,7 +105,6 @@ public class WxMerchantController extends BaseController { | |||
| public ResultData findById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::findById"); | |||
| WxMerchant wxMerchant = wxMerchantService.getById(id); | |||
| return new ResultData(wxMerchant); | |||
| } | |||
| @@ -128,7 +131,7 @@ public class WxMerchantController extends BaseController { | |||
| //加载二维码图片 | |||
| String pageUrl = "pages/index/index"; | |||
| String param = "t:md:"+resultData.data; | |||
| ResultData resultQrCode = qrCodeService.exportQrcode(null,null,wxMerchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情",true); | |||
| ResultData resultQrCode = qrCodeService.uploadQrcode(wxMerchant.getTenantId(),1,pageUrl,param,0,"","","店铺详情"); | |||
| Map<String,String> map = (Map)resultQrCode.data; | |||
| if(map!=null && map.get("url") !=null) { | |||
| String url = map.get("url"); | |||
| @@ -185,7 +188,7 @@ public class WxMerchantController extends BaseController { | |||
| return wxMerchantService.updateMerchantTax(wxMerchant); | |||
| } | |||
| @ApiOperation("更新会员等级权益接口") | |||
| @ApiOperation("商户信息设置接口") | |||
| @PostMapping("updateMerchantLevel") | |||
| @SystemControllerLog(description = "商户-更新会员等级权益") | |||
| public ResultData updateMerchantLevel(@RequestBody WxMerchant wxMerchant) { | |||
| @@ -250,4 +253,43 @@ public class WxMerchantController extends BaseController { | |||
| return new ResultData(has); | |||
| } | |||
| @ApiOperation("商户会员消费分页列表接口") | |||
| @GetMapping("userTradeList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "商户-消费列表") | |||
| public ResultData userTradeList(@ModelAttribute WxMerchant wxMerchant, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::list"); | |||
| if (null == wxMerchant) wxMerchant = new WxMerchant(); | |||
| wxMerchant.setTenantId(getTenantId()); | |||
| wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC); | |||
| final PageInfo<WxMerchantTradeVo> page = wxMerchantService.userTradeList(wxMerchant, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("商户会员消费明细列表接口") | |||
| @GetMapping("userTradeDetailList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "商户-商户会员消费明细列表接口") | |||
| public ResultData userTradeDetailList(@ModelAttribute WxMerchant wxMerchant, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::list"); | |||
| if (null == wxMerchant) wxMerchant = new WxMerchant(); | |||
| wxMerchant.setTenantId(getTenantId()); | |||
| final PageInfo<WxMerchantTradeDetailVo> page = wxMerchantService.userTradeDetailList(wxMerchant, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("导出商户会员消费分页列表") | |||
| @GetMapping("exportUserTradeDetailList") | |||
| @SystemControllerLog(description = "导出商户会员消费分页列表") | |||
| public void exportUserTradeList(@ModelAttribute WxMerchant wxMerchant,HttpServletRequest request, HttpServletResponse response) throws Exception{ | |||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::exportUserTradeDetailList"); | |||
| if (null == wxMerchant) wxMerchant = new WxMerchant(); | |||
| wxMerchant.setTenantId(getTenantId()); | |||
| wxMerchantService.exportUserTradeList(wxMerchant, request,response); | |||
| } | |||
| } | |||
| @@ -5,7 +5,7 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.service.WxShopService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -260,7 +260,7 @@ public class WxCarController extends BaseController { | |||
| //投放审批 | |||
| wc.setPutApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); | |||
| } | |||
| wxCouponMapper.updateByPrimaryKeySelective(wc); | |||
| wxCouponMapper.updateById(wc); | |||
| } | |||
| return new ResultData(coupon.getId()); | |||
| @@ -9,12 +9,14 @@ import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillProperty; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.enums.EnumContractType; | |||
| import com.iformall.enums.EnumIsPreview; | |||
| import com.iformall.enums.EnumRentStartType; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxPropertyContractMapper; | |||
| import com.iformall.service.WxBillPropertyService; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import com.iformall.service.WxRentPropertyContractService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import org.slf4j.Logger; | |||
| @@ -39,6 +41,8 @@ public class WxPropertyContractController extends BaseController { | |||
| private WxBillPropertyService wxBillPropertyService; | |||
| @Autowired | |||
| private WxPropertyContractMapper wxPropertyContractMapper; | |||
| @Autowired | |||
| private WxRentPropertyContractService wxRentPropertyContractService; | |||
| private Logger logger = LoggerFactory.getLogger(WxPropertyContractController.class); | |||
| @@ -65,7 +69,8 @@ public class WxPropertyContractController extends BaseController { | |||
| MallUserInfo user = getUser(); | |||
| wxPropertyContract.setTenantId(user.getTenantId()); | |||
| wxPropertyContract.setAdjustPeriodHandle(); | |||
| Integer contractType = wxRentPropertyContractService.getContractType(wxPropertyContract.getRentShopType(), wxPropertyContract.getOperationType(), EnumContractType.PROPERTY.getCode()); | |||
| wxPropertyContract.setContractType(contractType); | |||
| if(wxPropertyContract.getRentStartType()!=null && wxPropertyContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| wxPropertyContract.setRentalStartDate(wxPropertyContract.getStartDate()); | |||
| } | |||
| @@ -76,7 +81,7 @@ public class WxPropertyContractController extends BaseController { | |||
| @SystemControllerLog(description = "物业合同-更新租赁开始日期") | |||
| public ResultData updateRentStartTime(@RequestBody WxPropertyContract wxPropertyContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::updateRentStartTime"); | |||
| WxPropertyContract propertyContract = wxPropertyContractMapper.selectByPrimaryKey(wxPropertyContract.getId()); | |||
| WxPropertyContract propertyContract = wxPropertyContractMapper.selectById(wxPropertyContract.getId()); | |||
| MallUserInfo user = getUser(); | |||
| propertyContract.setTenantId(user.getTenantId()); | |||
| propertyContract.setAdjustPeriodHandle(); | |||
| @@ -194,7 +199,7 @@ public class WxPropertyContractController extends BaseController { | |||
| @SystemControllerLog(description = "物业合同-生成账单列表金额") | |||
| public ResultData buildBillPriceList(@RequestBody WxPropertyContract wxPropertyContract) throws Exception{ | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::buildBillPriceList"); | |||
| WxPropertyContract dbRent = wxPropertyContractMapper.selectByPrimaryKey(wxPropertyContract.getId()); | |||
| WxPropertyContract dbRent = wxPropertyContractMapper.selectById(wxPropertyContract.getId()); | |||
| dbRent.setPreviewBillRentList(wxPropertyContract.getPreviewBillRentList()); | |||
| if(dbRent.getRentStartType()!=null && dbRent.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| dbRent.setRentalStartDate(dbRent.getStartDate()); | |||
| @@ -7,6 +7,7 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.enums.EnumContractType; | |||
| import com.iformall.enums.EnumFromType; | |||
| import com.iformall.enums.EnumIsPreview; | |||
| import com.iformall.enums.EnumRentStartType; | |||
| @@ -14,10 +15,7 @@ import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxBillPropertyMapper; | |||
| import com.iformall.mapper.WxBillRentMapper; | |||
| import com.iformall.mapper.WxRentContractMapper; | |||
| import com.iformall.service.WxBillRentService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxPayAccountBillService; | |||
| import com.iformall.service.WxRentContractService; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.DateUtils; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| @@ -59,6 +57,10 @@ public class WxRentContractController extends BaseController { | |||
| WxBillRentMapper wxBillRentMapper; | |||
| @Autowired | |||
| WxBillPropertyMapper wxBillPropertyMapper; | |||
| @Autowired | |||
| private WxRentPropertyContractService wxRentPropertyContractService; | |||
| @GetMapping("autolatePay") | |||
| @SystemControllerLog(description = "autolatePay") | |||
| public ResultData autolatePay(String startDate, String endDate) throws Exception{ | |||
| @@ -116,7 +118,7 @@ public class WxRentContractController extends BaseController { | |||
| @SystemControllerLog(description = "租赁合同-生成账单列表金额") | |||
| public ResultData buildBillPriceList(@RequestBody WxRentContract wxRentContract) throws Exception{ | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::buildBillPriceList"); | |||
| WxRentContract dbRent = wxRentContractMapper.selectByPrimaryKey(wxRentContract.getId()); | |||
| WxRentContract dbRent = wxRentContractMapper.selectById(wxRentContract.getId()); | |||
| dbRent.setPreviewBillRentList(wxRentContract.getPreviewBillRentList()); | |||
| if(dbRent.getRentStartType()!=null && dbRent.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| @@ -130,6 +132,8 @@ public class WxRentContractController extends BaseController { | |||
| @SystemControllerLog(description = "租赁合同-添加") | |||
| public ResultData add(@RequestBody WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::add"); | |||
| Integer contractType = wxRentPropertyContractService.getContractType(wxRentContract.getRentShopType(), wxRentContract.getOperationType(), EnumContractType.RENT.getCode()); | |||
| wxRentContract.setContractType(contractType); | |||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | |||
| wxRentContract.setBusDiscountTime(new Integer(0)); | |||
| } | |||
| @@ -154,7 +158,7 @@ public class WxRentContractController extends BaseController { | |||
| @SystemControllerLog(description = "租赁合同-更新租赁开始日期") | |||
| public ResultData updateRentStartTime(@RequestBody WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentStartTime"); | |||
| WxRentContract rentContract = wxRentContractMapper.selectByPrimaryKey(wxRentContract.getId()); | |||
| WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||
| rentContract.setRentalStartDate(wxRentContract.getRentalStartDate()); | |||
| Date oldDate = wxRentContract.getRentalStartDate(); | |||
| if(wxRentContract.getRentStartType()!=null && wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||
| @@ -326,6 +330,11 @@ public class WxRentContractController extends BaseController { | |||
| if(StringUtils.isNotBlank(payAccountBill.getBankAccountName()) && StringUtils.isNotBlank(payAccountBill.getBankCardId())) { | |||
| map.put("bankAccountName", payAccountBill.getBankAccountName()); | |||
| map.put("bankCardId", payAccountBill.getBankCardId()); | |||
| if(payAccountBill.getServiceChargeRate() == null){ | |||
| map.put("serviceChargeRate", "0"); | |||
| }else{ | |||
| map.put("serviceChargeRate", payAccountBill.getServiceChargeRate()+""); | |||
| } | |||
| } | |||
| return new ResultData(map); | |||
| } | |||
| @@ -340,10 +349,14 @@ public class WxRentContractController extends BaseController { | |||
| if(StringUtils.isBlank(payAccountBill.getBankCardId())) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "甲方银行账户卡号未填写"); | |||
| } | |||
| if (payAccountBill.getServiceChargeRate() == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "手续费费率未填写"); | |||
| } | |||
| String tenantId = getTenantId(); | |||
| WxPayAccountBill payAccountBillNew = payAccountBillService.getByTenantId(tenantId); | |||
| payAccountBillNew.setBankAccountName(payAccountBill.getBankAccountName()); | |||
| payAccountBillNew.setBankCardId(payAccountBill.getBankCardId()); | |||
| payAccountBillNew.setServiceChargeRate(payAccountBill.getServiceChargeRate()); | |||
| payAccountBillService.saveOrUpdate(payAccountBillNew); | |||
| return new ResultData(); | |||
| } | |||
| @@ -6,7 +6,7 @@ import com.iformall.annotation.UserDataRuleAnnotation; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxMerchantTradeDaily; | |||
| import com.iformall.domain.vo.WxMerchantTradeDailyVo; | |||
| import com.iformall.service.WxMerchantTradeDailyService; | |||
| @@ -52,6 +52,14 @@ public class WxMerchantTradeDailyController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("数据汇总") | |||
| @GetMapping("/summary") | |||
| @SystemControllerLog(description = "商户解单-数据汇总") | |||
| public ResultData summary(@ModelAttribute WxMerchantTradeDaily wxMerchantTradeDaily) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::summary"); | |||
| return wxMerchantTradeDailyService.summary(wxMerchantTradeDaily); | |||
| } | |||
| @ApiOperation("获商户得近30日解单") | |||
| @GetMapping("/detail") | |||
| @SystemControllerLog(description = "商户-获商户得近30日解单detail") | |||
| @@ -7,7 +7,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.KwMeterDataVo; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.vo.UserCountVo; | |||
| import com.iformall.domain.vo.UserStructureVo; | |||
| import com.iformall.enums.*; | |||
| @@ -0,0 +1,99 @@ | |||
| package com.iformall.controller.invest; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.InvestResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.vo.invest.InvestUserContext; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.invest.InvestHelper; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.web.bind.WebDataBinder; | |||
| import org.springframework.web.bind.annotation.InitBinder; | |||
| import java.beans.PropertyEditor; | |||
| import java.beans.PropertyEditorSupport; | |||
| import java.util.function.BiConsumer; | |||
| import java.util.function.Consumer; | |||
| import java.util.function.Function; | |||
| @Slf4j | |||
| public class InvestBaseController extends BaseController { | |||
| @InitBinder | |||
| public void InitBinder(WebDataBinder dataBinder) { | |||
| super.InitBinder(dataBinder); | |||
| registerEnumEditor(dataBinder, EnumCustomerType.class, "customerType") ; | |||
| registerEnumEditor(dataBinder, EnumCustomerRatingType.class, "customerRatingType") ; | |||
| registerEnumEditor(dataBinder, EnumTaskStatus.class, "taskStatus") ; | |||
| registerEnumEditor(dataBinder, EnumFollowType.class, "type") ; | |||
| } | |||
| public <R, T> InvestResultData<R> execute(T params, Function<T, R> function) { | |||
| try { | |||
| log.debug("[" + getIpAddr() + "] request , params : {}", JSON.toJSONString(params)); | |||
| setUserRule(); | |||
| InvestUserContext.setUser(getUser()); | |||
| R r = function.apply(params); | |||
| return new InvestResultData(r); | |||
| } catch (MallinkException e) { | |||
| log.error("execute error", e); | |||
| return new InvestResultData(e.getErrorCode(), e.getMessage()); | |||
| } catch (NullPointerException e) { | |||
| ErrorCode errorCode = ErrorCode.SYS_NULLPOINTER_ERROR ; | |||
| log.error("execute error {}", errorCode.getMessage()); | |||
| return new InvestResultData(errorCode); | |||
| } finally { | |||
| InvestUserContext.remove(); | |||
| } | |||
| } | |||
| public <T, U> void exportData(T t, U u, BiConsumer<T, U> action) { | |||
| try { | |||
| log.debug("[" + getIpAddr() + "] request , params : {}", JSON.toJSONString(t)); | |||
| InvestUserContext.setUser(getUser()); | |||
| action.accept(t, u); | |||
| } finally { | |||
| InvestUserContext.remove(); | |||
| } | |||
| } | |||
| public <T> void importData(T t, Consumer<T> action) { | |||
| try { | |||
| log.debug("[" + getIpAddr() + "] request , params : {}", JSON.toJSONString(t)); | |||
| InvestUserContext.setUser(getUser()); | |||
| action.accept(t); | |||
| } finally { | |||
| InvestUserContext.remove(); | |||
| } | |||
| } | |||
| private void setUserRule() { | |||
| EnumInvestUserType investUserType = EnumInvestUserType.getEnum(getUser().getInvestRule()) ; | |||
| InvestUserContext.setInvestUserType(investUserType); | |||
| } | |||
| private <T extends Enum<T>> void registerEnumEditor(WebDataBinder binder, Class<T> clz, String propertyName) { | |||
| binder.registerCustomEditor(clz, propertyName, newEnumEditor(clz)); | |||
| } | |||
| private <T extends Enum<T>> PropertyEditor newEnumEditor(Class<T> clz) { | |||
| return new PropertyEditorSupport() { | |||
| @Override | |||
| public void setAsText(String text) { | |||
| try { | |||
| if (StringUtils.isBlank(text)) { | |||
| setValue(null); | |||
| } else { | |||
| setValue(InvestHelper.codeOf(clz, text)); | |||
| } | |||
| } catch (Exception NumberFormatException) { | |||
| setValue(InvestHelper.valueOf(clz, text)); | |||
| } | |||
| } | |||
| }; | |||
| } | |||
| } | |||
| @@ -0,0 +1,38 @@ | |||
| package com.iformall.controller.invest; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.InvestResultData; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.service.invest.InvestBizService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.PostMapping; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import java.util.Collection; | |||
| @Slf4j | |||
| @RestController | |||
| @RequestMapping("invest") | |||
| @Api(tags = "招商模块-其它接口") | |||
| public class InvestController extends InvestBaseController { | |||
| @Autowired | |||
| private InvestBizService bizService ; | |||
| /** | |||
| * 招商人员列表 | |||
| */ | |||
| @ApiOperation("招商人员列表") | |||
| @SystemControllerLog(description = "招商人员列表") | |||
| @GetMapping("/users") | |||
| public InvestResultData<Collection<MallUserInfo>> userList() { | |||
| return execute(null, p -> bizService.queryUserList()); | |||
| } | |||
| } | |||
| @@ -0,0 +1,111 @@ | |||
| package com.iformall.controller.invest; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.annotation.SystemServiceLog; | |||
| import com.iformall.common.InvestResultData; | |||
| import com.iformall.domain.dto.InvestDemandDto; | |||
| import com.iformall.domain.vo.invest.InvestDemandQuery; | |||
| import com.iformall.domain.vo.invest.InvestDemandVo; | |||
| import com.iformall.domain.vo.invest.InvestPageResult; | |||
| import com.iformall.service.invest.InvestBizService; | |||
| import com.iformall.service.invest.InvestCustomerService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.List; | |||
| /** | |||
| * 招商模块-客户管理 | |||
| * | |||
| * @author | |||
| * @date 2019-09-23 18:40:43 | |||
| */ | |||
| @Slf4j | |||
| @RestController | |||
| @RequestMapping("invest/customer") | |||
| @Api(tags = "招商模块-客户信息") | |||
| public class InvestCustomerController extends InvestBaseController{ | |||
| @Autowired | |||
| private InvestBizService investBizService; | |||
| @Autowired | |||
| private InvestCustomerService investCustomerService; | |||
| /** | |||
| * 客户列表 | |||
| */ | |||
| @ApiOperation("客户信息列表") | |||
| @SystemControllerLog(description = "客户信息列表") | |||
| @GetMapping("/list/simple") | |||
| public InvestResultData<List<InvestDemandVo>> listSimple() { | |||
| return execute(null, p -> investBizService.queryCustomer()); | |||
| } | |||
| /** | |||
| * 分页列表 | |||
| */ | |||
| @SystemServiceLog | |||
| @ApiOperation(value = "分页列表接口") | |||
| @GetMapping("/list") | |||
| public InvestResultData<InvestPageResult<InvestDemandVo>> list(InvestDemandQuery params) { | |||
| return execute(params, p -> investBizService.queryPageDemand(p)); | |||
| } | |||
| /** | |||
| * 信息 | |||
| */ | |||
| @SystemServiceLog | |||
| @GetMapping("/info/{id}") | |||
| public InvestResultData<InvestDemandVo> info(@PathVariable("id") Long id) { | |||
| return execute(id, p -> investBizService.findDemandById(p)); | |||
| } | |||
| /** | |||
| * 保存 | |||
| */ | |||
| @SystemServiceLog | |||
| @PostMapping("/save") | |||
| public InvestResultData save(@RequestBody InvestDemandDto investDemand) { | |||
| return execute(investDemand, p -> investBizService.saveCustomerAndDemand(p)); | |||
| } | |||
| /** | |||
| * 修改 | |||
| */ | |||
| @SystemServiceLog | |||
| @PostMapping("/update") | |||
| public InvestResultData update(@RequestBody InvestDemandDto customerDto) { | |||
| return execute(customerDto, p -> investBizService.updateCustomerAndDemand(p)); | |||
| } | |||
| @ApiOperation("导出客户信息") | |||
| @GetMapping("/exportCustomer") | |||
| @SystemControllerLog(description = "招商管理-导出客户信息") | |||
| public void exportCustomer(InvestDemandQuery params, HttpServletResponse response) { | |||
| exportData(params, response, (p, u) -> investBizService.exportCustomer(p, u)); | |||
| } | |||
| @ApiOperation("导出客户信息模板") | |||
| @GetMapping("/exportCustomerTemplate") | |||
| @SystemControllerLog(description = "招商管理-导出客户信息模板") | |||
| public void exportCustomerTemplate(HttpServletResponse response) { | |||
| exportData(null, response, (p, u) -> investBizService.exportCustomerTemplate(u)); | |||
| } | |||
| @ApiOperation("导入客户信息") | |||
| @GetMapping("/importCustomer") | |||
| @SystemControllerLog(description = "招商管理-导入客户信息") | |||
| public void importCustomer(@RequestParam("file") MultipartFile mFile) { | |||
| importData(mFile, p -> investBizService.importCustomer(p)); | |||
| } | |||
| } | |||
| @@ -0,0 +1,36 @@ | |||
| package com.iformall.controller.invest; | |||
| import com.iformall.common.InvestResultData; | |||
| import com.iformall.service.invest.InvestCustomerService; | |||
| import io.swagger.annotations.Api; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Arrays; | |||
| /** | |||
| * 招商模块-客户需求 | |||
| * | |||
| * @author | |||
| * @date 2019-09-23 18:40:42 | |||
| */ | |||
| @Slf4j | |||
| @RestController | |||
| @RequestMapping("invest/demand") | |||
| @Api(tags = "招商模块-客户需求") | |||
| public class InvestDemandController extends InvestBaseController { | |||
| @Autowired | |||
| private InvestCustomerService customerService; | |||
| /** | |||
| * 删除 | |||
| */ | |||
| //@GetMapping("/delete") | |||
| public InvestResultData delete(@RequestBody Long[] ids) { | |||
| return execute(ids, p -> customerService.removeByIds(Arrays.asList(p))); | |||
| } | |||
| } | |||
| @@ -0,0 +1,83 @@ | |||
| package com.iformall.controller.invest; | |||
| import com.iformall.annotation.SystemServiceLog; | |||
| import com.iformall.common.InvestResultData; | |||
| import com.iformall.domain.po.invest.InvestFollowRecordEntity; | |||
| import com.iformall.domain.vo.invest.InvestFollowQuery; | |||
| import com.iformall.domain.vo.invest.InvestFollowRecordVo; | |||
| import com.iformall.domain.vo.invest.InvestPageResult; | |||
| import com.iformall.service.invest.InvestBizService; | |||
| import com.iformall.service.invest.InvestFollowRecordService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Arrays; | |||
| /** | |||
| * 招商模块-跟踪记录 | |||
| * | |||
| * @author | |||
| * @date 2019-09-23 18:40:43 | |||
| */ | |||
| @Slf4j | |||
| @RestController | |||
| @RequestMapping("invest/followrecord") | |||
| @Api(tags = "招商模块-跟踪记录") | |||
| public class InvestFollowRecordController extends InvestBaseController { | |||
| @Autowired | |||
| private InvestFollowRecordService investFollowRecordService; | |||
| @Autowired | |||
| private InvestBizService bizService ; | |||
| /** | |||
| * 分页列表 | |||
| */ | |||
| @SystemServiceLog | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("/list") | |||
| public InvestResultData<InvestPageResult<InvestFollowRecordVo>> list(InvestFollowQuery params) { | |||
| return execute(params, p -> bizService.queryPageFollowRecord(p)); | |||
| } | |||
| /** | |||
| * 信息 | |||
| */ | |||
| @SystemServiceLog | |||
| @GetMapping("/info/{id}") | |||
| public InvestResultData<InvestFollowRecordVo> info(@PathVariable("id") Long id){ | |||
| return execute(id, p -> bizService.findFollowRecordById(p)); | |||
| } | |||
| /** | |||
| * 保存 | |||
| */ | |||
| @SystemServiceLog | |||
| @PostMapping("/save") | |||
| public InvestResultData save(@RequestBody InvestFollowRecordEntity investFollowRecord){ | |||
| return execute(investFollowRecord, p -> investFollowRecordService.save(p)); | |||
| } | |||
| /** | |||
| * 修改 | |||
| */ | |||
| //@PostMapping("/update") | |||
| public InvestResultData update(@RequestBody InvestFollowRecordEntity investFollowRecord){ | |||
| return execute(investFollowRecord, p -> investFollowRecordService.updateById(p)); | |||
| } | |||
| /** | |||
| * 删除 | |||
| */ | |||
| //@GetMapping("/delete") | |||
| public InvestResultData delete(@RequestBody Long[] ids){ | |||
| return execute(ids, p -> investFollowRecordService.removeByIds(Arrays.asList(p))); | |||
| } | |||
| } | |||
| @@ -0,0 +1,93 @@ | |||
| package com.iformall.controller.invest; | |||
| import com.iformall.annotation.SystemServiceLog; | |||
| import com.iformall.common.InvestResultData; | |||
| import com.iformall.domain.po.invest.InvestMessageEntity; | |||
| import com.iformall.domain.vo.invest.InvestMessageQuery; | |||
| import com.iformall.domain.vo.invest.InvestPageResult; | |||
| import com.iformall.service.invest.InvestBizService; | |||
| import com.iformall.service.invest.InvestMessageService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Arrays; | |||
| /** | |||
| * 招商模块-消息提醒 | |||
| * | |||
| * @author | |||
| * @date 2019-09-23 18:40:43 | |||
| */ | |||
| @Slf4j | |||
| @RestController | |||
| @RequestMapping("invest/message") | |||
| @Api(tags = "招商模块-消息提醒") | |||
| public class InvestMessageController extends InvestBaseController { | |||
| @Autowired | |||
| private InvestMessageService investRemindService; | |||
| @Autowired | |||
| private InvestBizService bizService; | |||
| /** | |||
| * 分页列表 | |||
| */ | |||
| @SystemServiceLog | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("/list") | |||
| public InvestResultData<InvestPageResult<InvestMessageEntity>> list(InvestMessageQuery params) { | |||
| return execute(params, p -> bizService.queryPageMessage(p)); | |||
| } | |||
| /** | |||
| * 信息 | |||
| */ | |||
| @SystemServiceLog | |||
| @GetMapping("/info/{id}") | |||
| public InvestResultData<InvestMessageEntity> info(@PathVariable("id") Long id) { | |||
| return execute(id, p -> investRemindService.getByIdNotNull(p)); | |||
| } | |||
| /** | |||
| * 保存 | |||
| */ | |||
| //@RequiresPermissions("investFollowRecordEdit") | |||
| @SystemServiceLog | |||
| //@PostMapping("/save") | |||
| public InvestResultData save(@RequestBody InvestMessageEntity messageEntity) { | |||
| return execute(messageEntity, p -> investRemindService.save(p)); | |||
| } | |||
| /** | |||
| * 修改 | |||
| */ | |||
| @SystemServiceLog | |||
| //@PostMapping("/update") | |||
| public InvestResultData update(@RequestBody InvestMessageEntity messageEntity) { | |||
| return execute(messageEntity, p -> investRemindService.updateById(p)); | |||
| } | |||
| /** | |||
| * 删除 | |||
| */ | |||
| @SystemServiceLog | |||
| @PostMapping("/delete") | |||
| public InvestResultData delete(@RequestBody Long[] ids) { | |||
| return execute(ids, p -> investRemindService.removeByIds(Arrays.asList(p))); | |||
| } | |||
| /** | |||
| * 删除登录用户全部提醒 | |||
| */ | |||
| @SystemServiceLog | |||
| @PostMapping("/deleteAll") | |||
| public InvestResultData deleteAll() { | |||
| return execute(null, p -> investRemindService.removeAll()); | |||
| } | |||
| } | |||
| @@ -0,0 +1,93 @@ | |||
| package com.iformall.controller.invest; | |||
| import com.iformall.annotation.SystemServiceLog; | |||
| import com.iformall.common.InvestResultData; | |||
| import com.iformall.domain.po.invest.InvestOperateRecordEntity; | |||
| import com.iformall.domain.vo.invest.InvestOperateRecordQuery; | |||
| import com.iformall.domain.vo.invest.InvestOperateRecordVo; | |||
| import com.iformall.domain.vo.invest.InvestPageQuery; | |||
| import com.iformall.domain.vo.invest.InvestPageResult; | |||
| import com.iformall.service.invest.InvestBizService; | |||
| import com.iformall.service.invest.InvestOperateRecordService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Arrays; | |||
| import java.util.Collection; | |||
| /** | |||
| * 招商模块-操作记录 | |||
| * | |||
| * @author | |||
| * @date 2019-09-23 18:40:43 | |||
| */ | |||
| @Slf4j | |||
| @RestController | |||
| @RequestMapping("invest/operaterecord") | |||
| @Api(tags = "招商模块-操作记录") | |||
| public class InvestOperateRecordController extends InvestBaseController { | |||
| @Autowired | |||
| private InvestOperateRecordService investOperateRecordService; | |||
| @Autowired | |||
| private InvestBizService bizService; | |||
| /** | |||
| * 分页列表 | |||
| */ | |||
| @SystemServiceLog | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("/list") | |||
| public InvestResultData<InvestPageResult<InvestOperateRecordEntity>> list(InvestPageQuery<InvestOperateRecordEntity> params) { | |||
| return execute(params, p -> investOperateRecordService.queryPage(p)); | |||
| } | |||
| /** | |||
| * 信息 | |||
| */ | |||
| @GetMapping("/listById") | |||
| public InvestResultData<InvestPageResult<InvestOperateRecordVo>> listById(InvestOperateRecordQuery params) { | |||
| return execute(params, p -> bizService.findOperateListById(p)); | |||
| } | |||
| /** | |||
| * 信息 | |||
| */ | |||
| @GetMapping("/info") | |||
| public InvestResultData<Collection<InvestOperateRecordVo>> info(InvestOperateRecordQuery params) { | |||
| return execute(params, p -> bizService.findOperateById(p)); | |||
| } | |||
| /** | |||
| * 保存 | |||
| */ | |||
| @SystemServiceLog | |||
| //@PostMapping("/save") | |||
| public InvestResultData save(@RequestBody InvestOperateRecordEntity investOperateRecord){ | |||
| return execute(investOperateRecord, p -> investOperateRecordService.save(p)); | |||
| } | |||
| /** | |||
| * 修改 | |||
| */ | |||
| @SystemServiceLog | |||
| //@PostMapping("/update") | |||
| public InvestResultData update(@RequestBody InvestOperateRecordEntity investOperateRecord){ | |||
| return execute(investOperateRecord, p -> investOperateRecordService.updateById(p)); | |||
| } | |||
| /** | |||
| * 删除 | |||
| */ | |||
| @SystemServiceLog | |||
| //@GetMapping("/delete") | |||
| public InvestResultData delete(@RequestBody Long[] ids){ | |||
| return execute(ids, p -> investOperateRecordService.removeByIds(Arrays.asList(p))); | |||
| } | |||
| } | |||
| @@ -0,0 +1,98 @@ | |||
| package com.iformall.controller.invest; | |||
| import com.iformall.annotation.SystemServiceLog; | |||
| import com.iformall.common.InvestResultData; | |||
| import com.iformall.domain.po.invest.InvestRemindEntity; | |||
| import com.iformall.domain.vo.invest.InvestPageQuery; | |||
| import com.iformall.domain.vo.invest.InvestPageResult; | |||
| import com.iformall.domain.vo.invest.InvestRemindQuery; | |||
| import com.iformall.domain.vo.invest.InvestRemindVo; | |||
| import com.iformall.service.invest.InvestBizService; | |||
| import com.iformall.service.invest.InvestRemindService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.shiro.authz.annotation.RequiresPermissions; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Arrays; | |||
| /** | |||
| * 招商模块-预约提醒 | |||
| * | |||
| * @author | |||
| * @date 2019-09-23 18:40:43 | |||
| */ | |||
| @Slf4j | |||
| @RestController | |||
| @RequestMapping("invest/remind") | |||
| @Api(tags = "招商模块-预约提醒") | |||
| public class InvestRemindController extends InvestBaseController { | |||
| @Autowired | |||
| private InvestRemindService investRemindService; | |||
| @Autowired | |||
| private InvestBizService bizService; | |||
| /** | |||
| * 分页列表 | |||
| */ | |||
| @SystemServiceLog | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("/list") | |||
| public InvestResultData<InvestPageResult<InvestRemindVo>> list(InvestRemindQuery params) { | |||
| return execute(params, p -> bizService.queryPageRemind(p)); | |||
| } | |||
| /** | |||
| * 信息 | |||
| */ | |||
| @SystemServiceLog | |||
| @GetMapping("/info/{id}") | |||
| public InvestResultData<InvestRemindEntity> info(@PathVariable("id") Long id) { | |||
| return execute(id, p -> bizService.findRemindById(p)); | |||
| } | |||
| /** | |||
| * 保存 | |||
| */ | |||
| //@RequiresPermissions("investFollowRecordEdit") | |||
| @SystemServiceLog | |||
| @PostMapping("/save") | |||
| public InvestResultData save(@RequestBody InvestRemindEntity investRemind) { | |||
| return execute(investRemind, p -> investRemindService.save(p)); | |||
| } | |||
| /** | |||
| * 修改 | |||
| */ | |||
| @SystemServiceLog | |||
| @PostMapping("/update") | |||
| public InvestResultData update(@RequestBody InvestRemindEntity investRemind) { | |||
| return execute(investRemind, p -> investRemindService.updateById(p)); | |||
| } | |||
| /** | |||
| * 删除 | |||
| */ | |||
| @SystemServiceLog | |||
| @PostMapping("/delete") | |||
| public InvestResultData delete(@RequestBody Long[] ids) { | |||
| return execute(ids, p -> investRemindService.removeByIds(Arrays.asList(p))); | |||
| } | |||
| /** | |||
| * 删除登录用户全部提醒 | |||
| */ | |||
| @SystemServiceLog | |||
| //@PostMapping("/deleteAll") | |||
| public InvestResultData deleteAll() { | |||
| return execute(null, p -> investRemindService.removeAll()); | |||
| } | |||
| } | |||
| @@ -0,0 +1,84 @@ | |||
| package com.iformall.controller.invest; | |||
| import com.iformall.annotation.SystemServiceLog; | |||
| import com.iformall.common.InvestResultData; | |||
| import com.iformall.domain.po.invest.InvestTaskEntity; | |||
| import com.iformall.domain.vo.invest.*; | |||
| import com.iformall.service.invest.InvestBizService; | |||
| import com.iformall.service.invest.InvestTaskService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.shiro.authz.annotation.RequiresPermissions; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Arrays; | |||
| /** | |||
| * 招商模块-招商任务 | |||
| * | |||
| * @author | |||
| * @date 2019-09-23 18:40:43 | |||
| */ | |||
| @Slf4j | |||
| @RestController | |||
| @RequestMapping("invest/task") | |||
| @Api(tags = "招商模块-招商任务") | |||
| public class InvestTaskController extends InvestBaseController { | |||
| @Autowired | |||
| private InvestTaskService investTaskService; | |||
| @Autowired | |||
| private InvestBizService bizService; | |||
| /** | |||
| * 分页列表 | |||
| */ | |||
| //@RequiresPermissions("InvestTaskQuery") | |||
| @SystemServiceLog | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("/list") | |||
| public InvestResultData<InvestPageResult<InvestTaskVo>> list(InvestTaskQuery params) { | |||
| return execute(params, p -> bizService.queryPageTask(p)); | |||
| } | |||
| /** | |||
| * 信息 | |||
| */ | |||
| @SystemServiceLog | |||
| @GetMapping("/info/{id}") | |||
| public InvestResultData<InvestTaskVo> info(@PathVariable("id") Long id) { | |||
| return execute(id, p -> bizService.findTaskById(id)); | |||
| } | |||
| /** | |||
| * 保存 | |||
| */ | |||
| //@RequiresPermissions("investTaskEdit") | |||
| @SystemServiceLog | |||
| @PostMapping("/save") | |||
| public InvestResultData save(@RequestBody InvestTaskEntity investTask) { | |||
| return execute(investTask, p -> bizService.saveTask(p)); | |||
| } | |||
| /** | |||
| * 修改 | |||
| */ | |||
| @SystemServiceLog | |||
| @PostMapping("/update") | |||
| public InvestResultData update(@RequestBody InvestTaskEntity investTask) { | |||
| return execute(investTask, p -> bizService.updateTask(p)); | |||
| } | |||
| /** | |||
| * 删除 | |||
| */ | |||
| @SystemServiceLog | |||
| @PostMapping("/delete") | |||
| public InvestResultData delete(@RequestBody Long[] ids) { | |||
| return execute(ids, p -> investTaskService.removeByIds(Arrays.asList(p))); | |||
| } | |||
| } | |||
| @@ -5,7 +5,7 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxActivity; | |||
| import com.iformall.enums.EnumActivityStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| @@ -5,7 +5,7 @@ import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxActivityJoin; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxActivityJoinService; | |||
| @@ -8,7 +8,7 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxCampaign; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxCouponChannel; | |||
| @@ -10,7 +10,8 @@ import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.dto.WxCouponChannelDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.WxCouponChannelVo; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.vo.WxCouponChannelVo; | |||
| import com.iformall.mapper.WxCouponChannelMapper; | |||
| import com.iformall.service.QrCodeService; | |||
| import com.iformall.service.WxCouponChannelService; | |||
| @@ -80,12 +81,12 @@ public class WxCouponChannelController extends BaseController { | |||
| if(couponChannel!=null){ | |||
| String pageUrl = "pages/index/index"; | |||
| String param = couponChannel.getWeappScene(); | |||
| ResultData resultDataQ = qrCodeService.exportQrcode(null,null,couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷",true); | |||
| ResultData resultDataQ = qrCodeService.uploadQrcode(couponChannel.getTenantId(),1,pageUrl,param,0,"","","卷"); | |||
| Map<String,String> map = (Map)resultDataQ.data; | |||
| if(map!=null && map.get("url") !=null) { | |||
| String url = map.get("url"); | |||
| couponChannel.setQrCode(url); | |||
| wxCouponChannelMapper.updateByPrimaryKeySelective(couponChannel); | |||
| wxCouponChannelMapper.updateById(couponChannel); | |||
| } | |||
| } | |||
| return resultData; | |||
| @@ -6,7 +6,7 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxCouponInject; | |||
| import com.iformall.service.WxCouponInjectService; | |||
| @@ -4,7 +4,7 @@ import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxCouponPassword; | |||
| import com.iformall.domain.vo.WxCouponPasswordCountInfoVO; | |||
| import com.iformall.service.WxCouponPasswordService; | |||
| @@ -6,6 +6,7 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.enums.EnumCouponPasswordStatus; | |||
| import com.iformall.enums.EnumCouponStatus; | |||
| import com.iformall.enums.EnumCouponValidType; | |||
| @@ -1,18 +1,15 @@ | |||
| package com.iformall.controller.market; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxCouponSend; | |||
| import com.iformall.domain.vo.WxCouponSendVo; | |||
| import com.iformall.enums.EnumCouponSendSendType; | |||
| import com.iformall.enums.EnumCouponSendStatus; | |||
| import com.iformall.enums.EnumCouponSendType; | |||
| import com.iformall.enums.EnumCouponStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| @@ -28,7 +25,6 @@ import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import javax.validation.constraints.NotNull; | |||
| import java.util.Date; | |||
| import java.util.Objects; | |||
| @@ -78,7 +74,7 @@ public class WxCouponSendController extends BaseController { | |||
| }) | |||
| @SystemControllerLog(description = "注券-添加或更新配置") | |||
| public ResultData addConfig(Integer beforeDays, Integer sendType) { | |||
| if(!Objects.equals(sendType,EnumCouponSendSendType.BIRTHDAY.getCode())) { | |||
| if (!Objects.equals(sendType, EnumCouponSendSendType.BIRTHDAY.getCode())) { | |||
| return new ResultData(ErrorCode.COUPON_VALID_NOT_SUPPORTED); | |||
| } | |||
| try { | |||
| @@ -158,9 +154,9 @@ public class WxCouponSendController extends BaseController { | |||
| return new ResultData(ErrorCode.COUPON_SEND_IS_INVALID); | |||
| } | |||
| try { | |||
| wxCouponSendService.updateInvalid(wxCouponSend); | |||
| wxCouponSendService.updateInvalid(wxCouponSend); | |||
| } catch (MallinkException e) { | |||
| return new ResultData(e.getErrorCode(),e.getMessage()) ; | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @@ -0,0 +1,92 @@ | |||
| package com.iformall.controller.market; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxFloatingLayer; | |||
| import com.iformall.domain.vo.WxFloatingLayerVO; | |||
| import com.iformall.enums.EnumFloatingLayerStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxFloatingLayerService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @RestController | |||
| @RequestMapping("wxFloatingLayer") | |||
| @Api(description = "首页浮层展示") | |||
| public class WxFloatingLayerController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxFloatingLayerService wxFloatingLayerService; | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("/list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "列表") | |||
| public ResultData list(@ModelAttribute WxFloatingLayer wxFloatingLayer, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::list"); | |||
| wxFloatingLayer.setTenantId(getTenantId()); | |||
| wxFloatingLayer.setSortColumns(BaseEntity.SortField.CreateTime_DESC, BaseEntity.SortField.Id_DESC); | |||
| final PageInfo<WxFloatingLayerVO> page = wxFloatingLayerService.listAsPage(wxFloatingLayer, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("/add") | |||
| @SystemControllerLog(description = "新增") | |||
| public ResultData add(@RequestBody WxFloatingLayer wxFloatingLayer) { | |||
| logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::add"); | |||
| wxFloatingLayer.setStatus(EnumFloatingLayerStatus.STATUS_THROW_IN.getCode()); | |||
| wxFloatingLayer.setTenantId(getTenantId()); | |||
| try { | |||
| return wxFloatingLayerService.saveOrUpdate(wxFloatingLayer); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("/updateStatus") | |||
| @SystemControllerLog(description = "id更新") | |||
| public ResultData updateStatus(@RequestBody WxFloatingLayer wxFloatingLayer) { | |||
| logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::updateStatus"); | |||
| if (wxFloatingLayer.getId() == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "id不能为空"); | |||
| } | |||
| try { | |||
| wxFloatingLayer.setStatus(EnumFloatingLayerStatus.STATUS_TAKE_OFFF.getCode()); | |||
| return wxFloatingLayerService.updateStatus(wxFloatingLayer); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "活动-查询") | |||
| public ResultData findById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::findById"); | |||
| WxFloatingLayer wxFloatingLayer = wxFloatingLayerService.getById(id); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxFloatingLayer); | |||
| } | |||
| } | |||
| @@ -6,7 +6,7 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxGame; | |||
| import com.iformall.enums.EnumGameStatus; | |||
| import com.iformall.service.WxGameService; | |||
| @@ -5,7 +5,7 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxMerchantPowerBillConfig; | |||
| import com.iformall.service.WxMerchantPowerBillConfigService; | |||
| import io.swagger.annotations.Api; | |||
| @@ -5,9 +5,7 @@ import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxMerchantSubsidy; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.vo.WxMerchantSubsidyVo; | |||
| import com.iformall.enums.EnumMerchantSubsidyStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| @@ -90,6 +88,19 @@ public class WxMerchantSubsidyController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("交易列表") | |||
| @GetMapping("summary") | |||
| @SystemControllerLog(description = "结算-总计") | |||
| public ResultData summary(@ModelAttribute WxMerchantSubsidyVo wxMerchantSubsidy) { | |||
| logger.debug("[" + getIpAddr() + "] subsidy::summary"); | |||
| if (null == wxMerchantSubsidy) { | |||
| wxMerchantSubsidy = new WxMerchantSubsidyVo(); | |||
| } | |||
| wxMerchantSubsidy.setTenantId(getTenantId()); | |||
| Map<String, Long> data = wxMerchantSubsidyService.summary(wxMerchantSubsidy); | |||
| return new ResultData(data); | |||
| } | |||
| @ApiOperation("更新补贴记录") | |||
| @PostMapping("updateSubsidied") | |||
| @SystemControllerLog(description = "商户-更新补贴记录") | |||
| @@ -7,7 +7,12 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.dto.OrderSaveDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxCouponChannel; | |||
| import com.iformall.domain.po.WxOrder; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.vo.WxMerchantSubsidyVo; | |||
| import com.iformall.domain.vo.WxOrderQueryVo; | |||
| import com.iformall.enums.EnumCouponChannelStatus; | |||
| import com.iformall.enums.EnumCouponChannelType; | |||
| @@ -27,7 +32,11 @@ import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @RestController | |||
| @@ -58,7 +67,9 @@ public class WxOrderController extends BaseController { | |||
| @SystemControllerLog(description = "订单管理-列表") | |||
| public ResultData list(@ModelAttribute WxOrder wxOrder, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxOrderController::list"); | |||
| if (null == wxOrder) wxOrder = new WxOrder(); | |||
| if (null == wxOrder) { | |||
| wxOrder = new WxOrder(); | |||
| } | |||
| wxOrder.setTenantId(getTenantId()); | |||
| wxOrder.setSortColumns(BaseEntity.SortField.CreateDate_DESC,BaseEntity.SortField.Id_DESC); | |||
| final PageInfo<WxOrder> page = wxOrderService.listAsPage(wxOrder, pageNum, pageSize); | |||
| @@ -143,7 +154,9 @@ public class WxOrderController extends BaseController { | |||
| } | |||
| WxCouponChannel wxCouponChannel = wxCouponChannelService.getById(orderSaveDto.getCouponChannelId()); | |||
| ResultData resultData = couponChannelCheck(orderSaveDto, wxCouponChannel); | |||
| if (resultData != null) return resultData; | |||
| if (resultData != null) { | |||
| return resultData; | |||
| } | |||
| Long couponId = orderSaveDto.getCouponId() == null ? wxCouponChannel.getCouponId() : orderSaveDto.getCouponId(); | |||
| if (couponId == null) { | |||
| @@ -161,8 +174,9 @@ public class WxOrderController extends BaseController { | |||
| if (coupon == null) { | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | |||
| } | |||
| if (!wxOrderService.checkCouponIsFree(coupon)) | |||
| if (!wxOrderService.checkCouponIsFree(coupon)) { | |||
| return new ResultData(ErrorCode.COUPON_IS_NOT_FREE); | |||
| } | |||
| // 免费券 | |||
| order = wxOrderService.saveFreeOrderForCoupon(user, coupon, orderSaveDto.getCouponChannelId(), orderSaveDto.getFormId(), null); | |||
| return new ResultData(order); | |||
| @@ -200,4 +214,42 @@ public class WxOrderController extends BaseController { | |||
| return null; | |||
| } | |||
| @ApiOperation("查看明细") | |||
| @GetMapping("/detail") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "订单管理-id查询") | |||
| public ResultData detail(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxOrderController::detail"); | |||
| WxOrder order = new WxOrder(); | |||
| order.setId(id); | |||
| order.setTenantId(getTenantId()); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxOrderService.detailCUserVo(order)); | |||
| } | |||
| @ApiOperation("交易列表") | |||
| @GetMapping("summary") | |||
| @SystemControllerLog(description = "订单管理-总计") | |||
| public ResultData summary(@ModelAttribute WxOrderQueryVo wxOrderQueryVo) { | |||
| logger.debug("[" + getIpAddr() + "] WxOrderController::summary"); | |||
| if (null == wxOrderQueryVo) { | |||
| wxOrderQueryVo = new WxOrderQueryVo(); | |||
| } | |||
| wxOrderQueryVo.setTenantId(getTenantId()); | |||
| Map<String, Long> data = wxOrderService.summary(wxOrderQueryVo); | |||
| return new ResultData(data); | |||
| } | |||
| @ApiOperation("导出") | |||
| @GetMapping("/exportData") | |||
| @SystemControllerLog(description = "导出") | |||
| public void exportData(@ModelAttribute WxOrderQueryVo wxOrderQueryVo, HttpServletRequest request, HttpServletResponse response) { | |||
| logger.info("[" + getIpAddr() + "] WxOrderController/exportData"); | |||
| if (null == wxOrderQueryVo) { | |||
| wxOrderQueryVo = new WxOrderQueryVo(); | |||
| } | |||
| wxOrderQueryVo.setTenantId(getTenantId()); | |||
| wxOrderService.exportData(wxOrderQueryVo, request, response); | |||
| } | |||
| } | |||
| @@ -5,7 +5,7 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxPowerBillAutoConfig; | |||
| import com.iformall.service.WxPowerBillAutoConfigService; | |||
| import io.swagger.annotations.Api; | |||
| @@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.ImportParams; | |||
| import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; | |||
| import cn.afterturn.easypoi.handler.impl.ExcelDataHandlerDefaultImpl; | |||
| import cn.afterturn.easypoi.handler.inter.IExcelDataHandler; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.vo.WxBillDailyVo; | |||
| @@ -104,7 +105,7 @@ public class BillDailyAsyncTask { | |||
| shop.setType(vo.getRentShopType()); | |||
| shop.setStatus(EnumShopStatus.RENT.getCode()); | |||
| shop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| WxShop wxShop = wxShopMapper.selectOne(shop); | |||
| WxShop wxShop = wxShopMapper.selectOne(new QueryWrapper(shop)); | |||
| if (wxShop == null) { | |||
| logger.error("店铺不存在", vo.toString()); | |||
| fail++; | |||
| @@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.ImportParams; | |||
| import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; | |||
| import cn.afterturn.easypoi.handler.impl.ExcelDataHandlerDefaultImpl; | |||
| import cn.afterturn.easypoi.handler.inter.IExcelDataHandler; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxTags; | |||
| @@ -96,7 +97,7 @@ public class ImportTemplateTask { | |||
| wxMerchantQuery.setTenantId(tenantId); | |||
| wxMerchantQuery.setName(merchantName); | |||
| wxMerchantQuery.setStatus(EnumMerchantStatus.VALID.getCode()); | |||
| WxMerchant wxMerchant = wxMerchantMapper.selectOne(wxMerchantQuery); | |||
| WxMerchant wxMerchant = wxMerchantMapper.selectOne(new QueryWrapper(wxMerchantQuery)); | |||
| if (wxMerchant != null) { | |||
| merchantMap.put(merchantName, wxMerchant); | |||
| } | |||
| @@ -192,7 +193,7 @@ public class ImportTemplateTask { | |||
| wxMerchantQuery.setTenantId(tenantId); | |||
| wxMerchantQuery.setName(merchantName); | |||
| wxMerchantQuery.setStatus(EnumMerchantStatus.VALID.getCode()); | |||
| WxMerchant wxMerchant = wxMerchantMapper.selectOne(wxMerchantQuery); | |||
| WxMerchant wxMerchant = wxMerchantMapper.selectOne(new QueryWrapper(wxMerchantQuery)); | |||
| if (wxMerchant != null) { | |||
| merchantMap.put(merchantName, wxMerchant); | |||
| } | |||
| @@ -11,10 +11,15 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.dto.WxCUserBasicInfoFilterDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.vo.UserTradeRecordVo; | |||
| import com.iformall.enums.EnumAssignTagsTrigger; | |||
| import com.iformall.enums.EnumCouponOrderStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxMerchantMapper; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.DateUtils; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| @@ -33,7 +38,9 @@ import java.io.BufferedInputStream; | |||
| import java.io.File; | |||
| import java.io.FileOutputStream; | |||
| import java.io.IOException; | |||
| import java.math.BigDecimal; | |||
| import java.util.ArrayList; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.concurrent.TimeUnit; | |||
| @@ -75,6 +82,12 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| @Autowired | |||
| private AsyncTask asyncTask; | |||
| @Autowired | |||
| private ExcelService excelService; | |||
| @Autowired | |||
| private WxMerchantMapper wxMerchantMapper; | |||
| private void setUserInfoLevel(WxCUserBasicInfo info) { | |||
| if (info.getPoins() == null || info.getPoins() == 0) { | |||
| @@ -236,11 +249,56 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| WxCoupon coupon = wxCouponService.getById(c.getCouponId()); | |||
| c.setCouponName(coupon.getTitle()); | |||
| c.setSalePrice(coupon.getPrice()); | |||
| if(c.getCouponId() != null) { | |||
| HashMap<String, String> param = new HashMap<>(); | |||
| param.put("id", c.getCouponId() + ""); | |||
| WxMerchant w = wxMerchantMapper.findByTrade(param); | |||
| if (w != null) | |||
| c.setMerchantName(w.getName()); | |||
| } | |||
| } | |||
| } | |||
| return new ResultData(Result.SUCCESS, "查询成功", page); | |||
| } | |||
| @ApiOperation("导出根据userId查询交易记录接口") | |||
| @GetMapping("/exportOrderCouponByUserId") | |||
| @ApiImplicitParam(name = "userId", value = "userId", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "会员管理-userId查询交易记录") | |||
| public void exportOrderCouponByUserId(HttpServletRequest request, HttpServletResponse response,Long userId) { | |||
| logger.debug("[" + getIpAddr() + "] WxCUserBasicInfoController::exportOrderCouponByUserId"); | |||
| WxCouponOrder corder = new WxCouponOrder(); | |||
| corder.setCUserId(userId); | |||
| corder.setTenantId(getTenantId()); | |||
| corder.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||
| PageInfo<WxCouponOrder> page = wxCouponOrderService.listAsPage(corder, 1, Integer.MAX_VALUE); | |||
| if (page.getSize() > 0) { | |||
| List<WxCouponOrder> list = page.getList(); | |||
| for (WxCouponOrder c : list) { | |||
| WxCoupon coupon = wxCouponService.getById(c.getCouponId()); | |||
| c.setCouponName(coupon.getTitle()); | |||
| c.setSalePrice(coupon.getPrice()); | |||
| } | |||
| List<UserTradeRecordVo> datalist = new ArrayList<>(); | |||
| for (WxCouponOrder wxCouponOrder:list) { | |||
| UserTradeRecordVo userTradeRecordVo = new UserTradeRecordVo(); | |||
| userTradeRecordVo.setCouponName(wxCouponOrder.getCouponName()); | |||
| BigDecimal b = new BigDecimal(wxCouponOrder.getSalePrice()); | |||
| userTradeRecordVo.setPrice(b.divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP).toString()); | |||
| b = new BigDecimal(wxCouponOrder.getCouponPrice()); | |||
| userTradeRecordVo.setSale(b.divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP).toString()); | |||
| userTradeRecordVo.setStatus(EnumCouponOrderStatus.getEnum(wxCouponOrder.getCouponOrderStatus()).getMessage()); | |||
| userTradeRecordVo.setTradeTime(DateUtils.formatDateTime(wxCouponOrder.getCreateDate())); | |||
| datalist.add(userTradeRecordVo); | |||
| } | |||
| excelService.exportExcel(datalist, null, "会员交易记录", UserTradeRecordVo.class, "会员交易记录.xlsx", response, false); | |||
| } | |||
| } | |||
| @ApiOperation("会员记录导出总数") | |||
| @GetMapping("/exportDataCount") | |||
| @SystemControllerLog(description = "会员管理-会员记录导出总数") | |||
| @@ -497,5 +555,18 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| return new ResultData(wxCUserBasicInfoService.listByFilter(getTenantId(),filterList)); | |||
| } | |||
| @ApiOperation("根据ID锁定") | |||
| @PostMapping("/updateStatus") | |||
| @SystemControllerLog(description = "会员管理-根据ID锁定") | |||
| public ResultData updateStatus(@RequestBody WxCUserBasicInfo wxCUserBasicInfo) { | |||
| logger.debug("[" + getIpAddr() + "] WxCUserBasicInfoController::updateStatus"); | |||
| if (null == wxCUserBasicInfo.getId()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "id不能为空"); | |||
| } | |||
| if (null == wxCUserBasicInfo.getStatus()) { | |||
| } | |||
| return wxCUserBasicInfoService.updateStatus(wxCUserBasicInfo); | |||
| } | |||
| } | |||
| @@ -3,7 +3,7 @@ package com.iformall.controller.mem; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -2,10 +2,14 @@ package com.iformall.controller.mem; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.WxScoreHistory; | |||
| import com.iformall.enums.EnumCUserBasicInfoStatus; | |||
| import com.iformall.service.WxCUserBasicInfoService; | |||
| import com.iformall.service.WxScoreHistoryService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| @@ -23,6 +27,10 @@ public class WxScoreHistoryController extends BaseController { | |||
| @Autowired | |||
| private WxScoreHistoryService wxScoreHistoryService; | |||
| @Autowired | |||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @@ -43,6 +51,9 @@ public class WxScoreHistoryController extends BaseController { | |||
| logger.debug("[" + getIpAddr() + "] WxScoreHistoryController::add"); | |||
| //Assert.notNull(wxScoreHistory.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| if (checkMemberStatus(wxScoreHistory.getCUserId())) { | |||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | |||
| } | |||
| wxScoreHistoryService.saveOrUpdate(wxScoreHistory); | |||
| return new ResultData(); | |||
| } | |||
| @@ -52,10 +63,22 @@ public class WxScoreHistoryController extends BaseController { | |||
| @SystemControllerLog(description = "成长值-更新") | |||
| public ResultData update(@RequestBody WxScoreHistory wxScoreHistory) { | |||
| logger.debug("[" + getIpAddr() + "] WxScoreHistoryController::update"); | |||
| if (checkMemberStatus(wxScoreHistory.getCUserId())) { | |||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | |||
| } | |||
| wxScoreHistoryService.saveOrUpdate(wxScoreHistory); | |||
| return new ResultData(); | |||
| } | |||
| public boolean checkMemberStatus(Long userId) { | |||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(userId); | |||
| if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { | |||
| logger.info("会员权益被锁定:cUserId:" + userId); | |||
| return true; | |||
| } | |||
| return false; | |||
| } | |||
| @ApiOperation("根据id删除接口") | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @@ -1,9 +1,11 @@ | |||
| package com.iformall.controller.mem; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.WxScoreRules; | |||
| import com.iformall.enums.EnumCreditLockedStatus; | |||
| import com.iformall.service.WxScoreRulesService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @@ -27,6 +29,9 @@ public class WxScoreRulesController extends BaseController { | |||
| public ResultData list() { | |||
| logger.debug("[" + getIpAddr() + "] WxScoreRulesController::list"); | |||
| WxScoreRules scoreRules = wxScoreRulesService.getScoreRules(getTenantId()); | |||
| if (scoreRules.getCreditLocked() == null) { | |||
| scoreRules.setCreditLocked(EnumCreditLockedStatus.OPEN.getCode()); | |||
| } | |||
| return new ResultData(scoreRules); | |||
| } | |||
| @@ -48,4 +53,25 @@ public class WxScoreRulesController extends BaseController { | |||
| WxScoreRules scoreRules = wxScoreRulesService.getCreditRules(getTenantId()); | |||
| return new ResultData(scoreRules); | |||
| } | |||
| @ApiOperation("更新积分开关状态") | |||
| @PostMapping("updateCreditLocked") | |||
| @SystemControllerLog(description = "更新积分开关状态") | |||
| public ResultData 更新积分开关状态(@RequestBody WxScoreRules wxScoreRules) { | |||
| logger.debug("[" + getIpAddr() + "] WxScoreRulesController::updateCreditLocked"); | |||
| if (null == wxScoreRules.getId()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "id不能为空"); | |||
| } | |||
| if (null == wxScoreRules.getCreditLocked()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "creditLocked不能为空"); | |||
| } | |||
| wxScoreRules.setTenantId(getTenantId()); | |||
| try { | |||
| wxScoreRulesService.updateCreditLocked(wxScoreRules); | |||
| } catch (Exception e) { | |||
| return new ResultData(ErrorCode.DB_FAIL.getCode(), "更新积分开关状态失败"); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| } | |||
| @@ -5,7 +5,7 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxMsgCallback; | |||
| import com.iformall.service.WxMsgCallbackService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -16,8 +16,6 @@ import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Map; | |||
| @RestController | |||
| @RequestMapping("msgCallback") | |||
| public class WxMsgCallbackController extends BaseController { | |||
| @@ -5,10 +5,9 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.msg.WxMsg; | |||
| import com.iformall.service.WxMsgService; | |||
| import com.iformall.utils.Constant; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @@ -5,7 +5,7 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxMsgModel; | |||
| import com.iformall.service.WxMsgModelService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -5,7 +5,7 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxMsgSignature; | |||
| import com.iformall.service.WxMsgSignatureService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -7,6 +7,7 @@ import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.vo.WxBillAll; | |||
| import com.iformall.domain.vo.WxBillExcelTemplate; | |||
| import com.iformall.service.WxBillAllService; | |||
| import com.iformall.service.WxPayAccountBillService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @@ -32,6 +33,9 @@ public class WxBillAllController extends BaseController { | |||
| private Logger logger = LoggerFactory.getLogger(WxBillAllController.class); | |||
| @Autowired | |||
| WxPayAccountBillService wxPayAccountBillService; | |||
| @GetMapping("oweBillCount") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "contractId", value = "合同id", dataType = "long", paramType = "query", required = true), | |||
| @@ -14,8 +14,6 @@ import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @@ -38,7 +36,7 @@ public class WxBillDepositController extends BaseController { | |||
| wxBillDeposit = new WxBillDeposit(); | |||
| } | |||
| wxBillDeposit.setTenantId(getTenantId()); | |||
| final PageInfo<Map<String, Object>> page = wxBillDepositService.listAsPage(wxBillDeposit, pageNum, pageSize); | |||
| final PageInfo<WxBillDeposit> page = wxBillDepositService.listAsPage(wxBillDeposit, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -5,9 +5,8 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxBillProperty; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.service.WxBillPropertyService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| @@ -14,8 +14,6 @@ import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @@ -38,7 +36,7 @@ public class WxBillPropertyDepositController extends BaseController { | |||
| wxBillPropertyDeposit = new WxBillPropertyDeposit(); | |||
| } | |||
| wxBillPropertyDeposit.setTenantId(getTenantId()); | |||
| PageInfo<Map<String, Object>> result = wxBillPropertyDepositService.listAsPage(wxBillPropertyDeposit, pageNum, pageSize); | |||
| PageInfo<WxBillPropertyDeposit> result = wxBillPropertyDepositService.listAsPage(wxBillPropertyDeposit, pageNum, pageSize); | |||
| return new ResultData(result); | |||
| } | |||
| @@ -5,7 +5,7 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.service.WxBillRentService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -5,7 +5,7 @@ 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.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.WxBillSettle; | |||
| import com.iformall.domain.po.WxBillSettleRecord; | |||
| import com.iformall.enums.EnumFilterSettle; | |||
| @@ -7,6 +7,7 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.enums.EnumUserAdmin; | |||
| import com.iformall.service.MallRolePermissionService; | |||
| import com.iformall.service.MallRoleService; | |||
| @@ -16,11 +17,9 @@ import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.apache.shiro.authz.annotation.RequiresPermissions; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.util.Assert; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.ArrayList; | |||
| @@ -7,9 +7,9 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.enums.EnumMallUserStatus; | |||
| import com.iformall.enums.EnumUserAdmin; | |||
| import com.iformall.enums.EnumFlowPermissionType; | |||
| import com.iformall.service.*; | |||
| import com.iformall.shiro.PasswordHelper; | |||
| import com.iformall.shiro.UserSession; | |||
| @@ -17,7 +17,6 @@ import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.collections.map.HashedMap; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.apache.shiro.SecurityUtils; | |||
| import org.slf4j.Logger; | |||
| @@ -27,7 +26,6 @@ import org.springframework.util.Assert; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| @@ -72,10 +70,6 @@ public class MallUserInfoController extends BaseController { | |||
| public ResultData listAsPage(MallUserInfo userInfo, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::listAsPage"); | |||
| if(userInfo.getWithWechatNotFormat() != null){ | |||
| userInfo.setWithWechatForQuery(userInfo.getWithWechatNotFormat()); | |||
| } | |||
| userInfo.setTenantId(getTenantId()); | |||
| userInfo.setSortColumns(BaseEntity.SortField.CreateTime_DESC,BaseEntity.SortField.Id_DESC); | |||
| final PageInfo<MallUserInfo> page = userInfoService.listAsPage(userInfo, pageNum, pageSize); | |||
| @@ -301,6 +295,15 @@ public class MallUserInfoController extends BaseController { | |||
| return new ResultData(info); | |||
| } | |||
| @ApiOperation(value = "获取菜单") | |||
| @GetMapping("/getMenu") | |||
| @SystemControllerLog(description = "用户管理-获取菜单") | |||
| public ResultData getMenu() { | |||
| MallUserInfo info = getUser(); | |||
| String menu = userRoleService.getPermissionsByUser(info); | |||
| return new ResultData(menu); | |||
| } | |||
| @ApiOperation(value = "用户密码发送验证码") | |||
| @GetMapping("sendvalidationcode") | |||
| @ApiImplicitParams({ | |||
| @@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RequestParam; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import java.io.*; | |||
| import java.util.*; | |||
| import java.util.List; | |||
| @@ -45,7 +46,7 @@ public class UploadController extends BaseController { | |||
| @PostMapping(value = "/awsFileUpload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | |||
| @ApiOperation("上传文件") | |||
| @SystemControllerLog(description = "文件上传") | |||
| public ResultData awsfileUpload(@RequestParam("file") MultipartFile multiReq) throws Exception{ | |||
| public ResultData awsfileUpload(@RequestParam("file") MultipartFile multiReq) throws Exception { | |||
| logger.info("[" + getIpAddr() + "] UploadController::awsfileUpload"); | |||
| ObjectMetadata metadata = new ObjectMetadata(); | |||
| @@ -66,7 +67,6 @@ public class UploadController extends BaseController { | |||
| } | |||
| /** | |||
| * 图片上传 | |||
| * | |||
| @@ -77,7 +77,7 @@ public class UploadController extends BaseController { | |||
| @PostMapping(value = "/awsImgUpload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | |||
| @ApiOperation("上传图片") | |||
| @SystemControllerLog(description = "上传图片") | |||
| public ResultData awsImgUpload(@RequestParam("file") MultipartFile multiReq) throws Exception{ | |||
| public ResultData awsImgUpload(@RequestParam("file") MultipartFile multiReq) { | |||
| logger.info("[" + getIpAddr() + "] UploadController::awsImgUpload"); | |||
| long size = multiReq.getSize(); | |||
| final long length = 2097152; | |||
| @@ -85,7 +85,7 @@ public class UploadController extends BaseController { | |||
| return new ResultData(ErrorCode.PICTURE_SIZE_EXCEED); | |||
| } | |||
| String fileName = UUID.randomUUID().toString(); | |||
| String tempFileName = fileName; | |||
| String tempFileName = fileName; | |||
| String fileFormat = ""; | |||
| int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | |||
| @@ -98,40 +98,45 @@ public class UploadController extends BaseController { | |||
| System.out.println(fileName); | |||
| FileOutputStream fos = null; | |||
| String imgFormat = ImgUtil.getImgFormat(fileFormat); | |||
| if(StringUtils.isNotBlank(imgFormat)) { | |||
| String localImgFileName = fmUploadDir + tempFileName + "-1" + fileFormat; | |||
| String localNewImgFileName = fmUploadDir + tempFileName + fileFormat; | |||
| BufferedInputStream fs = null; | |||
| File localFile = new File(localImgFileName); | |||
| fos = new FileOutputStream(localFile); | |||
| fs = (BufferedInputStream) multiReq.getInputStream(); | |||
| byte[] buffer = new byte[1024]; | |||
| int len = 0; | |||
| while ((len = fs.read(buffer)) != -1) { | |||
| fos.write(buffer, 0, len); | |||
| try { | |||
| FileOutputStream fos = null; | |||
| String imgFormat = ImgUtil.getImgFormat(fileFormat); | |||
| if (StringUtils.isNotBlank(imgFormat)) { | |||
| String localImgFileName = fmUploadDir + tempFileName + "-1" + fileFormat; | |||
| String localNewImgFileName = fmUploadDir + tempFileName + fileFormat; | |||
| BufferedInputStream fs = null; | |||
| File localFile = new File(localImgFileName); | |||
| fos = new FileOutputStream(localFile); | |||
| fs = (BufferedInputStream) multiReq.getInputStream(); | |||
| byte[] buffer = new byte[1024]; | |||
| int len = 0; | |||
| while ((len = fs.read(buffer)) != -1) { | |||
| fos.write(buffer, 0, len); | |||
| } | |||
| fos.close(); | |||
| fs.close(); | |||
| logger.info("local file: " + localImgFileName); | |||
| File newFile = ImgUtil.thinImage(localImgFileName, localNewImgFileName, imgFormat); | |||
| logger.info("local new file: " + localNewImgFileName); | |||
| // 删除本地缓存 | |||
| localFile.delete(); | |||
| ObjectMetadata metadata = new ObjectMetadata(); | |||
| metadata.setContentType(multiReq.getContentType()); | |||
| metadata.setContentLength(newFile.length()); | |||
| ResultData data = qrCodeService.awsUpload(new FileInputStream(newFile), metadata, fileName, getTenantId()); | |||
| // 删除本地缓存 | |||
| newFile.delete(); | |||
| return data; | |||
| } else { | |||
| ObjectMetadata metadata = new ObjectMetadata(); | |||
| metadata.setContentType(multiReq.getContentType()); | |||
| metadata.setContentLength(size); | |||
| ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, getTenantId()); | |||
| return data; | |||
| } | |||
| fos.close(); | |||
| fs.close(); | |||
| logger.info("local file: " + localImgFileName); | |||
| File newFile = ImgUtil.thinImage(localImgFileName, localNewImgFileName, imgFormat); | |||
| logger.info("local new file: " + localNewImgFileName); | |||
| // 删除本地缓存 | |||
| localFile.delete(); | |||
| ObjectMetadata metadata = new ObjectMetadata(); | |||
| metadata.setContentType(multiReq.getContentType()); | |||
| metadata.setContentLength(newFile.length()); | |||
| ResultData data = qrCodeService.awsUpload(new FileInputStream(newFile), metadata, fileName, getTenantId()); | |||
| // 删除本地缓存 | |||
| newFile.delete(); | |||
| return data; | |||
| } else { | |||
| ObjectMetadata metadata = new ObjectMetadata(); | |||
| metadata.setContentType(multiReq.getContentType()); | |||
| metadata.setContentLength(size); | |||
| ResultData data = qrCodeService.awsUpload(multiReq.getInputStream(), metadata, fileName, getTenantId()); | |||
| return data; | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR); | |||
| } | |||
| } | |||
| @@ -145,13 +150,13 @@ public class UploadController extends BaseController { | |||
| @PostMapping(value = "/awsFilesUpload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | |||
| @ApiOperation("多文件上传") | |||
| @SystemControllerLog(description = "多文件上传") | |||
| public ResultData awsFilesUpload(@RequestParam("files") MultipartFile[] files) throws Exception{ | |||
| public ResultData awsFilesUpload(@RequestParam("files") MultipartFile[] files) throws Exception { | |||
| logger.info("[" + getIpAddr() + "] UploadController::awsFilesUpload"); | |||
| if(files.length > 0){ | |||
| if (files.length > 0) { | |||
| ResultData data = new ResultData(); | |||
| List<Map<String,String>> dataList = new ArrayList<Map<String,String>>(); | |||
| for(MultipartFile multipartFile: files) { | |||
| List<Map<String, String>> dataList = new ArrayList<Map<String, String>>(); | |||
| for (MultipartFile multipartFile : files) { | |||
| Map<String, String> map = new HashMap<>(); | |||
| ObjectMetadata metadata = new ObjectMetadata(); | |||
| @@ -172,8 +177,8 @@ public class UploadController extends BaseController { | |||
| } | |||
| ResultData data1 = qrCodeService.awsUpload(multipartFile.getInputStream(), metadata, fileName, getTenantId()); | |||
| if(data1.code == ResultData.SUCCESS) { | |||
| Map _data = (Map)data1.data; | |||
| if (data1.code == ResultData.SUCCESS) { | |||
| Map _data = (Map) data1.data; | |||
| map.put("url", (String) _data.get("url")); | |||
| dataList.add(map); | |||
| } else { | |||
| @@ -200,7 +205,7 @@ public class UploadController extends BaseController { | |||
| */ | |||
| @PostMapping(value = "/cimgUpload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | |||
| @ApiOperation("内部接口-C端上传图片文件") | |||
| public ResultData cimgUpload(@RequestParam("file") MultipartFile multiReq) throws Exception{ | |||
| public ResultData cimgUpload(@RequestParam("file") MultipartFile multiReq) throws Exception { | |||
| logger.info("[" + getIpAddr() + "] UploadController::cimgUpload"); | |||
| ObjectMetadata metadata = new ObjectMetadata(); | |||
| @@ -25,6 +25,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpSession; | |||
| import java.lang.reflect.Method; | |||
| import java.util.Arrays; | |||
| import java.util.Date; | |||
| @Aspect | |||
| @@ -142,6 +143,8 @@ public class SystemLogAspect { | |||
| } | |||
| } | |||
| } | |||
| //TODO 调试使用 | |||
| //return String.format("%s%s",description, Arrays.asList(arguments)); | |||
| return description; | |||
| } | |||
| @@ -0,0 +1,208 @@ | |||
| package com.iformall.log; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.google.common.collect.MapDifference; | |||
| import com.google.common.collect.Maps; | |||
| import com.iformall.common.LogColumn; | |||
| import com.iformall.domain.po.invest.InvestBaseEntity; | |||
| import com.iformall.domain.po.invest.InvestOperateRecordEntity; | |||
| import com.iformall.domain.vo.invest.TableTriple; | |||
| import com.iformall.enums.EnumTableOperateType; | |||
| import com.iformall.service.invest.InvestHelper; | |||
| import com.iformall.service.invest.InvestOperateRecordService; | |||
| import com.iformall.service.invest.impl.InvestBaseServiceImpl; | |||
| import com.iformall.utils.SpringContextUtils; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.commons.collections.CollectionUtils; | |||
| import org.apache.commons.compress.utils.Lists; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.apache.commons.lang3.reflect.FieldUtils; | |||
| import org.aspectj.lang.ProceedingJoinPoint; | |||
| import org.aspectj.lang.annotation.Around; | |||
| import org.aspectj.lang.annotation.Aspect; | |||
| import org.aspectj.lang.annotation.Pointcut; | |||
| import org.aspectj.lang.reflect.MethodSignature; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Component; | |||
| import java.io.Serializable; | |||
| import java.lang.reflect.Field; | |||
| import java.lang.reflect.ParameterizedType; | |||
| import java.util.*; | |||
| /** | |||
| * | |||
| */ | |||
| @Slf4j | |||
| @Aspect | |||
| @Component | |||
| public class TableOperateAspect { | |||
| @Autowired | |||
| private InvestOperateRecordService operateRecordService; | |||
| @Pointcut("@annotation(com.iformall.common.TableLog)") | |||
| public void pointcut() { | |||
| } | |||
| @Around("pointcut()") | |||
| public Object round(ProceedingJoinPoint joinPoint) { | |||
| MethodSignature signature = (MethodSignature) joinPoint.getSignature(); | |||
| log.debug("before , {}.{}() with argument[s] = {}", signature.getDeclaringType(), | |||
| signature.getName(), Arrays.toString(joinPoint.getArgs())); | |||
| Object result = null; | |||
| Object entity = null; | |||
| Map<String, Object> beforeMap = null; | |||
| Long tid = null; | |||
| try { | |||
| entity = joinPoint.getArgs()[0]; | |||
| tid = getId(entity); | |||
| beforeMap = getFeildMap(getById(signature, tid)); | |||
| } catch (Exception e) { | |||
| log.error("before ", e); | |||
| } | |||
| try { | |||
| result = joinPoint.proceed(); | |||
| } catch (Throwable throwable) { | |||
| log.error("proceed error , Illegal argument: {} in {}.{}()", Arrays.toString(joinPoint.getArgs()), | |||
| joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(), throwable); | |||
| } finally { | |||
| log.debug("after , result: {}", result); | |||
| } | |||
| try { | |||
| saveRecord(signature, beforeMap, entity, tid); | |||
| } catch (Exception e) { | |||
| log.error("save table Record ", e); | |||
| } | |||
| return result; | |||
| } | |||
| private Long getId(Object entity) { | |||
| Long tid; | |||
| if (entity instanceof InvestBaseEntity) { | |||
| tid = ((InvestBaseEntity) entity).getId(); | |||
| } else { | |||
| tid = (Long) entity; | |||
| } | |||
| return tid; | |||
| } | |||
| private void saveRecord(MethodSignature signature, Map<String, Object> beforeMap, Object arg, Long tid) throws IllegalAccessException { | |||
| EnumTableOperateType operateType = getOperateType(signature.getName()); | |||
| if (Objects.equals(operateType, EnumTableOperateType.DELETE)) { | |||
| arg = null; | |||
| } | |||
| if (Objects.isNull(tid)) { | |||
| tid = getId(arg); | |||
| } | |||
| Map<String, Object> afterMap = getFeildMap(arg); | |||
| List content = getContent(beforeMap, afterMap); | |||
| log.debug("operate content: {}", JSON.toJSONString(content)); | |||
| if (CollectionUtils.isEmpty(content)) { | |||
| return; | |||
| } | |||
| List<InvestOperateRecordEntity> toSaveRecord = new ArrayList<>() ; | |||
| for (Object o : content) { | |||
| InvestOperateRecordEntity recordEntity = new InvestOperateRecordEntity(); | |||
| recordEntity.setContent(JSON.toJSONString(o)); | |||
| recordEntity.setOperateType(operateType); | |||
| recordEntity.setTbl(getTbl(signature)); | |||
| recordEntity.setTid(tid); | |||
| toSaveRecord.add(recordEntity) ; | |||
| } | |||
| operateRecordService.saveBatch(toSaveRecord); | |||
| log.debug("saveRecord: {}", JSON.toJSONString(content)); | |||
| } | |||
| private String getTbl(MethodSignature signature) { | |||
| ParameterizedType type = (ParameterizedType) signature.getDeclaringType().getGenericSuperclass(); | |||
| Class clazz = (Class) type.getActualTypeArguments()[1]; | |||
| TableName tableName = (TableName) clazz.getAnnotation(TableName.class); | |||
| return tableName.value(); | |||
| } | |||
| private EnumTableOperateType getOperateType(String methodName) { | |||
| if (StringUtils.contains(methodName, "update")) { | |||
| return EnumTableOperateType.UPDATE; | |||
| } else if (StringUtils.contains(methodName, "remove")) { | |||
| return EnumTableOperateType.DELETE; | |||
| } | |||
| return EnumTableOperateType.ADD; | |||
| } | |||
| private Map<String, Object> getFeildMap(Object entity) throws IllegalAccessException { | |||
| if (Objects.isNull(entity)) { | |||
| return null; | |||
| } | |||
| Map<String, Object> map = new HashMap<>(); | |||
| List<Field> fields = FieldUtils.getFieldsListWithAnnotation(entity.getClass(), LogColumn.class); | |||
| for (Field field : fields) { | |||
| String annotationVal = field.getAnnotation(LogColumn.class).value(); | |||
| Object value = FieldUtils.readDeclaredField(entity, field.getName(), true); | |||
| if (field.getType().isEnum()) { | |||
| value = InvestHelper.getEnumVal(InvestHelper.valueOf(value.getClass(), ((Enum) value).name())); | |||
| } | |||
| if (Objects.equals(annotationVal, InvestBaseEntity.COLUMN_TYPE)) { | |||
| value = JSON.parseObject((String) value, Map.class); | |||
| } | |||
| map.put(field.getName(), value); | |||
| } | |||
| return map; | |||
| } | |||
| private List<TableTriple<String, Object, Object>> getContent(Map<String, Object> before, Map<String, Object> after) { | |||
| if (Objects.isNull(before) || Objects.isNull(after)) { | |||
| return mapToList(before, after); | |||
| } | |||
| MapDifference<String, Object> diffInner = Maps.difference(before, after); | |||
| List<TableTriple<String, Object, Object>> diffRows = Lists.newArrayList(); | |||
| if (diffInner.areEqual()) { | |||
| return diffRows; | |||
| } | |||
| Map<String, MapDifference.ValueDifference<Object>> differenceMap = diffInner.entriesDiffering(); | |||
| for (Map.Entry<String, MapDifference.ValueDifference<Object>> entry : differenceMap.entrySet()) { | |||
| String s = entry.getKey(); | |||
| MapDifference.ValueDifference<Object> objectValueDifference = entry.getValue(); | |||
| Object innerBefore = objectValueDifference.leftValue(); | |||
| Object innerAfter = objectValueDifference.rightValue(); | |||
| if (innerBefore instanceof Map) { | |||
| diffRows.addAll(getContent((Map<String, Object>) innerBefore, (Map<String, Object>) innerAfter)); | |||
| } else { | |||
| diffRows.add(new TableTriple(s, innerBefore, innerAfter)); | |||
| } | |||
| } | |||
| return diffRows; | |||
| } | |||
| private List<TableTriple<String, Object, Object>> mapToList(Map<String, Object> before, Map<String, Object> after) { | |||
| List<TableTriple<String, Object, Object>> list = Lists.newArrayList(); | |||
| Set<String> keys = Objects.isNull(before) ? after.keySet() : before.keySet(); | |||
| for (String key : keys) { | |||
| if (Objects.isNull(before)) { | |||
| Object innerAfter = after.get(key); | |||
| if (innerAfter instanceof Map) { | |||
| list.addAll(mapToList(null, (Map<String, Object>) innerAfter)); | |||
| } else { | |||
| list.add(new TableTriple(key, "", innerAfter)); | |||
| } | |||
| } else { | |||
| Object innerBefore = before.get(key); | |||
| if (innerBefore instanceof Map) { | |||
| list.addAll(mapToList((Map<String, Object>) innerBefore, null)); | |||
| } else { | |||
| list.add(new TableTriple(key, innerBefore, "")); | |||
| } | |||
| } | |||
| } | |||
| return list; | |||
| } | |||
| private <T> T getById(MethodSignature signature, Serializable id) { | |||
| Class service = signature.getDeclaringType(); | |||
| QueryWrapper<T> wrapper = new QueryWrapper<>(); | |||
| wrapper.eq("id", id); | |||
| return (T) ((InvestBaseServiceImpl) SpringContextUtils.getBean(service)).getOne(wrapper); | |||
| } | |||
| } | |||
| @@ -4,7 +4,7 @@ package com.iformall.log; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxUserDataRule; | |||
| import com.iformall.mapper.WxRentContractMapper; | |||
| @@ -78,6 +78,10 @@ public class TenantInfoImpl implements TenantInfo { | |||
| if ("wx_data_rule_target".equals(tableName)) { | |||
| return true; | |||
| } | |||
| if ("wx_logic_permission".equals(tableName)) { | |||
| return true; | |||
| } | |||
| return false; | |||
| } | |||
| @@ -131,6 +135,8 @@ public class TenantInfoImpl implements TenantInfo { | |||
| return true; | |||
| if ("com.iformall.mapper.WxCouponPasswordMapper.updateStatus".equals(ms.getId())) | |||
| return true; | |||
| if ("com.iformall.mapper.WxBillAllMapper.getReceiveAndPayBillAsPage".equals(ms.getId())) | |||
| return true; | |||
| return false; | |||
| } | |||
| } | |||
| @@ -125,6 +125,5 @@ ueditor: | |||
| logging: | |||
| level: | |||
| tk.mybatis: debug | |||
| com.iformall: debug | |||
| path: ./logs/admin | |||
| @@ -49,21 +49,22 @@ spring: | |||
| baseline-version: 1 | |||
| # @{link} https://github.com/abel533 | |||
| #Mybatis | |||
| mybatis: | |||
| type-aliases-package: com.iformall.domain.po | |||
| # MybatisPlus | |||
| mybatis-plus: | |||
| mapper-locations: classpath:mapper/*Mapper.xml | |||
| global-config: | |||
| db-config: | |||
| id-type: id_worker | |||
| field-strategy: not_null | |||
| db-type: mysql | |||
| configuration: | |||
| map-underscore-to-camel-case: true | |||
| cache-enabled: true | |||
| lazy-loading-enabled: true | |||
| use-generated-keys: true | |||
| default-fetch-size: 100 | |||
| default-statement-timeout: 10000 | |||
| jdbc-type-for-null: 'null' | |||
| cache-enabled: false | |||
| call-setters-on-nulls: true | |||
| type-aliases-package: com.iformall.domain.po | |||
| type-enums-package: com.iformall.enums | |||
| #PageHelper | |||
| # PageHelper | |||
| pagehelper: | |||
| helperDialect: mysql | |||
| reasonable: false | |||
| @@ -0,0 +1,7 @@ | |||
| alter table wx_mall | |||
| add column parking_space varchar(20) DEFAULT 0 not null comment '停车位', | |||
| add column business_hours json not null comment '营业时间', | |||
| add column introduction varchar(255) DEFAULT '' not null comment '简介', | |||
| add column img varchar(255) DEFAULT '' not null comment '图片'; | |||
| update wx_mall set business_hours = JSON_ARRAY(); | |||
| @@ -0,0 +1,22 @@ | |||
| create table wx_floting_layer( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||
| `cover_img` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图', | |||
| `produce_id` bigint(20) DEFAULT NULL COMMENT '产品ID', | |||
| `page_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '小程序跳转路径', | |||
| `status` smallint(2) DEFAULT NULL COMMENT '0上线 1下线', | |||
| `create_time` datetime DEFAULT CURRENT_TIMESTAMP, | |||
| `update_time` datetime DEFAULT CURRENT_TIMESTAMP, | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE KEY `id_UNIQUE` (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='首页浮层'; | |||
| create table wx_cuser_floting_layer( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||
| `user_id` bigint(20) DEFAULT NULL COMMENT 'C端用户ID', | |||
| `create_time` datetime DEFAULT CURRENT_TIMESTAMP, | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE KEY `id_UNIQUE` (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='用户首页浮层记录'; | |||
| @@ -0,0 +1,2 @@ | |||
| ALTER TABLE `wx_screen_ad` | |||
| ADD COLUMN `ext_info` JSON NULL DEFAULT NULL AFTER `target_id`; | |||
| @@ -0,0 +1,25 @@ | |||
| DROP TABLE IF EXISTS wx_floting_layer; | |||
| DROP TABLE IF EXISTS wx_cuser_floting_layer; | |||
| create table wx_floating_layer( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||
| `cover_img` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图', | |||
| `produce_id` bigint(20) DEFAULT NULL COMMENT '产品ID', | |||
| `page_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '小程序跳转路径', | |||
| `status` smallint(2) DEFAULT NULL COMMENT '0上线 1下线', | |||
| `create_time` datetime DEFAULT CURRENT_TIMESTAMP, | |||
| `update_time` datetime DEFAULT CURRENT_TIMESTAMP, | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE KEY `id_UNIQUE` (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='首页浮层'; | |||
| create table wx_cuser_floating_layer( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||
| `user_id` bigint(20) DEFAULT NULL COMMENT 'C端用户ID', | |||
| `create_time` datetime DEFAULT CURRENT_TIMESTAMP, | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE KEY `id_UNIQUE` (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='用户首页浮层记录'; | |||
| @@ -0,0 +1,55 @@ | |||
| DROP TABLE IF EXISTS wx_buser; | |||
| CREATE TABLE `wx_buser` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||
| `open_id` varchar(28) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '微信openId', | |||
| `union_id` varchar(29) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '微信unionId', | |||
| `nick_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户昵称', | |||
| `gender` tinyint(4) DEFAULT '0' COMMENT '性别 0未知 1男 2女', | |||
| `avatar_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户头像地址', | |||
| `phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户绑定的手机号', | |||
| `pure_phone` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户没有区号的手机号', | |||
| `city` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户所在城市', | |||
| `province` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户所在省份', | |||
| `language` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户所在语言', | |||
| `country_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户手机区号', | |||
| `register_ip` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户注册IP', | |||
| `verify_code_phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手输验证后的手机号', | |||
| `qrcode_source` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '注册时记录用户扫码渠道,如朋友圈广告', | |||
| `scene` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '二维码来源,小程序', | |||
| `scene_address` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '渠道,小程序', | |||
| `score` int(11) DEFAULT NULL COMMENT '成长值', | |||
| `update_date` datetime DEFAULT NULL COMMENT '更新时间', | |||
| `open_app_id` varchar(18) COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||
| `mp_open_id` varchar(28) COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||
| `mp_app_id` varchar(18) COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||
| `mp_subscribe` tinyint(2) DEFAULT NULL, | |||
| `mp_subscribe_time` datetime DEFAULT NULL, | |||
| `mp_subscribe_scene` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||
| `subs_open_id` varchar(28) COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||
| `subs_app_id` varchar(18) COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||
| `subs_subscribe` tinyint(2) DEFAULT NULL, | |||
| `subs_subscribe_time` datetime DEFAULT NULL, | |||
| `subs_subscribe_scene` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||
| `create_date` datetime DEFAULT NULL COMMENT '创建时间', | |||
| `app_id` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '小程序的appId', | |||
| `session_key` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'session key for 微信小程序', | |||
| `token` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户登录用token', | |||
| `expire_time` datetime DEFAULT NULL COMMENT '用户过期时间', | |||
| `latitude` decimal(10,5) DEFAULT NULL COMMENT '维度', | |||
| `longitude` decimal(10,5) DEFAULT NULL COMMENT '经度', | |||
| `login_count` int(11) DEFAULT '0' COMMENT '登录次数', | |||
| `extra_info` json DEFAULT NULL, | |||
| `is_subscribe` tinyint(2) DEFAULT '0' COMMENT '是否关联公众号(0:否,1:关联)', | |||
| `credit` int(11) DEFAULT '0' COMMENT '积分', | |||
| `active_time` datetime DEFAULT NULL COMMENT '最后一次活跃时间', | |||
| `user_id` bigint(20) DEFAULT 0 NOT NULL COMMENT '登录用户ID', | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE KEY `id_UNIQUE` (`id`), | |||
| KEY `open_id_index` (`tenant_id`,`open_id`), | |||
| KEY `user_id_index` (`open_id`,`app_id`), | |||
| KEY `union_id_index` (`tenant_id`,`union_id`), | |||
| KEY `union_open_app_index` (`union_id`,`open_app_id`), | |||
| KEY `open_app_index` (`open_id`,`app_id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='B端微信用户信息'; | |||
| @@ -0,0 +1 @@ | |||
| alter table wx_c_user_basic_info add column `status` smallint(2) default 0 not null comment '0正常1锁定'; | |||
| @@ -0,0 +1 @@ | |||
| alter table wx_merchant add column credit_locked tinyint(2) default 0 not null comment '0开放1锁定'; | |||
| @@ -0,0 +1 @@ | |||
| alter table wx_score_rules add column credit_locked tinyint(2) default 0 not null comment '0开放1锁定'; | |||
| @@ -0,0 +1 @@ | |||
| alter table wx_credit_history add column buserId bigint(20) default 0 not null comment 'B端微信用户ID'; | |||
| @@ -0,0 +1,27 @@ | |||
| insert into `mall_permission` ( `id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) values ( '675', '浮层广告', '605', 'Y', null, '1', null, null, 'advertisementList', null, '0', '675'); | |||
| DROP TABLE IF EXISTS `mall_sale_type` ; | |||
| CREATE TABLE `mall_sale_type` ( | |||
| `id` bigint(64) NOT NULL, | |||
| `name` varchar(32) DEFAULT NULL COMMENT '销售类型', | |||
| `type` tinyint(2) DEFAULT NULL COMMENT '资源类型1:尊享全能版 2:尊享营销版 3.速享版', | |||
| `period` tinyint(2) DEFAULT NULL COMMENT '有效期(单位月)', | |||
| `menus` json DEFAULT NULL COMMENT '菜单列表', | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE `id_UNIQUE` USING BTREE (`id`) comment '' | |||
| ) ENGINE=`InnoDB` ROW_FORMAT=DYNAMIC COMMENT='系统销售表' CHECKSUM=0 DELAY_KEY_WRITE=0; | |||
| INSERT INTO `mall_sale_type` | |||
| (`id`,`name`, `type`, `period`, `menus`) | |||
| VALUES | |||
| (1, '尊享全能版', 1, 12, | |||
| '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 201, 202, 203, 204, 205, 206, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 651, 661, 662, 663, 671, 672, 673,674, 675, 681, 682, 683, 684, 685, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 952, 961, 962, 965, 966, 967, 968, 1001, 1002, 1003, 1004]' | |||
| ), | |||
| (2, '尊享营销版', 2, 12, | |||
| '[1, 2, 4, 5, 6, 7, 8, 9, 10, 50, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 961]' | |||
| ), | |||
| (3, '速享版', 3, 1, | |||
| '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 641, 642, 643, 644, 645, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932]' | |||
| ) | |||
| ; | |||
| @@ -0,0 +1 @@ | |||
| alter table wx_mall drop column parking_space; | |||
| @@ -0,0 +1,23 @@ | |||
| insert into `wx_tags_type` ( `id`, `name`, `group_id`, `group_name`, `flag`) values ( '27', '服饰尺码', '1', '基础属性', '1'); | |||
| insert into `wx_tags_type` ( `id`, `name`, `group_id`, `group_name`, `flag`) values ( '28', '鞋尺码', '1', '基础属性', '1'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '147', 'XS', '1', '基础属性', '27', '服饰尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '148', 'S', '1', '基础属性', '27', '服饰尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '149', 'M', '1', '基础属性', '27', '服饰尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '150', 'L', '1', '基础属性', '27', '服饰尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '151', 'XL', '1', '基础属性', '27', '服饰尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '152', 'XXL', '1', '基础属性', '27', '服饰尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '153', 'XXXL', '1', '基础属性', '27', '服饰尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '154', '34', '1', '基础属性', '28', '鞋尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '155', '35', '1', '基础属性', '28', '鞋尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '156', '36', '1', '基础属性', '28', '鞋尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '157', '37', '1', '基础属性', '28', '鞋尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '158', '38', '1', '基础属性', '28', '鞋尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '159', '39', '1', '基础属性', '28', '鞋尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '160', '40', '1', '基础属性', '28', '鞋尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '161', '41', '1', '基础属性', '28', '鞋尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '162', '42', '1', '基础属性', '28', '鞋尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '163', '43', '1', '基础属性', '28', '鞋尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '164', '44', '1', '基础属性', '28', '鞋尺码'); | |||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '165', '45', '1', '基础属性', '28', '鞋尺码'); | |||
| @@ -0,0 +1,29 @@ | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (963, '商户会员消费列表', 2, 'Y', NULL, 1, NULL, NULL, 'merchantConsumeList', 'icon-xiaofeijilu', 0, 963); | |||
| DROP TABLE IF EXISTS `mall_sale_type` ; | |||
| CREATE TABLE `mall_sale_type` ( | |||
| `id` bigint(64) NOT NULL, | |||
| `name` varchar(32) DEFAULT NULL COMMENT '销售类型', | |||
| `type` tinyint(2) DEFAULT NULL COMMENT '资源类型1:尊享全能版 2:尊享营销版 3.速享版', | |||
| `period` tinyint(2) DEFAULT NULL COMMENT '有效期(单位月)', | |||
| `menus` json DEFAULT NULL COMMENT '菜单列表', | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE `id_UNIQUE` USING BTREE (`id`) comment '' | |||
| ) ENGINE=`InnoDB` ROW_FORMAT=DYNAMIC COMMENT='系统销售表' CHECKSUM=0 DELAY_KEY_WRITE=0; | |||
| INSERT INTO `mall_sale_type` | |||
| (`id`,`name`, `type`, `period`, `menus`) | |||
| VALUES | |||
| (1, '尊享全能版', 1, 12, | |||
| '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 201, 202, 203, 204, 205, 206, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 651, 661, 662, 663, 671, 672, 673,674, 675, 681, 682, 683, 684, 685, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 952, 961, 962,963, 965, 966, 967, 968, 1001, 1002, 1003, 1004]' | |||
| ), | |||
| (2, '尊享营销版', 2, 12, | |||
| '[1, 2, 4, 5, 6, 7, 8, 9, 10, 50, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 961]' | |||
| ), | |||
| (3, '速享版', 3, 1, | |||
| '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 641, 642, 643, 644, 645, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932]' | |||
| ) | |||
| ; | |||
| @@ -0,0 +1 @@ | |||
| update mall_permission set module_color='#ad368a',module_color_num='173,54,138' where name = '招商管理'; | |||
| @@ -0,0 +1,2 @@ | |||
| alter table wx_mall | |||
| change column `introduction` `introduction` varchar(1024) DEFAULT '' not null COMMENT '简介'; | |||
| @@ -0,0 +1 @@ | |||
| alter table wx_credit_history change column buserId buser_id bigint(20) default 0 not null comment 'B端微信用户ID'; | |||
| @@ -0,0 +1,2 @@ | |||
| alter table wx_pay_account_bill | |||
| add column `service_charge_rate` INT (5) NULL DEFAULT 0 COMMENT '手续费费率'; | |||
| @@ -0,0 +1,20 @@ | |||
| alter table wx_bill_daily | |||
| add column `service_charge_pay` BIGINT (12) NULL DEFAULT 0 COMMENT '手续费费'; | |||
| alter table wx_bill_other | |||
| add column `service_charge_pay` BIGINT (12) NULL DEFAULT 0 COMMENT '手续费费'; | |||
| alter table wx_bill_other_deposit | |||
| add column `service_charge_pay` BIGINT (12) NULL DEFAULT 0 COMMENT '手续费费'; | |||
| alter table wx_bill_property | |||
| add column `service_charge_pay` BIGINT (12) NULL DEFAULT 0 COMMENT '手续费费'; | |||
| alter table wx_bill_property_deposit | |||
| add column `service_charge_pay` BIGINT (12) NULL DEFAULT 0 COMMENT '手续费费'; | |||
| alter table wx_bill_rent | |||
| add column `service_charge_pay` BIGINT (12) NULL DEFAULT 0 COMMENT '手续费费'; | |||
| alter table wx_bill_rent_deposit | |||
| add column `service_charge_pay` BIGINT (12) NULL DEFAULT 0 COMMENT '手续费费'; | |||
| @@ -0,0 +1,30 @@ | |||
| update `mall_role_permission` set permission_id = 207 where permission_id = 962; | |||
| update `mall_permission` set id = 207 where id = 962; | |||
| update `mall_role_permission` set permission_id = 208 where permission_id = 963; | |||
| update `mall_permission` set id = 208, sort = 208 where id = 963; | |||
| DROP TABLE IF EXISTS `mall_sale_type` ; | |||
| CREATE TABLE `mall_sale_type` ( | |||
| `id` bigint(64) NOT NULL, | |||
| `name` varchar(32) DEFAULT NULL COMMENT '销售类型', | |||
| `type` tinyint(2) DEFAULT NULL COMMENT '资源类型1:尊享全能版 2:尊享营销版 3.速享版', | |||
| `period` tinyint(2) DEFAULT NULL COMMENT '有效期(单位月)', | |||
| `menus` json DEFAULT NULL COMMENT '菜单列表', | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE `id_UNIQUE` USING BTREE (`id`) comment '' | |||
| ) ENGINE=`InnoDB` ROW_FORMAT=DYNAMIC COMMENT='系统销售表' CHECKSUM=0 DELAY_KEY_WRITE=0; | |||
| INSERT INTO `mall_sale_type` | |||
| (`id`,`name`, `type`, `period`, `menus`) | |||
| VALUES | |||
| (1, '尊享全能版', 1, 12, | |||
| '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 201, 202, 203, 204, 205, 206, 207, 208, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 651, 661, 662, 663, 671, 672, 673,674, 675, 681, 682, 683, 684, 685, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 952, 961, 965, 966, 967, 968, 1001, 1002, 1003, 1004]' | |||
| ), | |||
| (2, '尊享营销版', 2, 12, | |||
| '[1, 2, 4, 5, 6, 7, 8, 9, 10, 50, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932, 951, 961]' | |||
| ), | |||
| (3, '速享版', 3, 1, | |||
| '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 521, 522, 523, 531, 532, 533, 591, 592, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 621, 622, 623, 624, 625, 626, 641, 642, 643, 644, 645, 651, 661, 662, 663, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 691, 692, 693, 694, 695, 701, 702, 703, 711, 712, 713, 901, 902, 903, 931, 932]' | |||
| ) | |||
| ; | |||
| @@ -0,0 +1 @@ | |||
| alter table wx_merchant_subsidy add column type tinyint(2) not null default 1 comment '结算类型1线上2线下3银行卡转账'; | |||
| @@ -0,0 +1,2 @@ | |||
| alter table wx_merchant_subsidy modify column type tinyint(2) not null default 1 comment '结算类型1微信结算2自主结算'; | |||
| alter table wx_merchant_subsidy add column source tinyint(2) not null default 0 comment '结算来源1卡消费2券核销3砍价核销4拼团核销5收银分账'; | |||
| @@ -0,0 +1,2 @@ | |||
| alter table wx_merchant_subsidy modify column type tinyint(2) not null default 1 comment '结算类型1自主结算2微信结算'; | |||
| alter table wx_merchant_subsidy modify column source tinyint(2) not null default 0 comment '结算来源0结账1卡消费2券核销3砍价核销4拼团核销5收银分账'; | |||
| @@ -0,0 +1,3 @@ | |||
| update mall_permission set name = '线上交易' where id=409; | |||
| update mall_permission set name = '线上自动分账' where id=410; | |||
| update mall_permission set name = '营销结算' where id=411; | |||
| @@ -0,0 +1,2 @@ | |||
| ALTER TABLE `wx_order` | |||
| ADD COLUMN `total_payment` int(11) NULL COMMENT '总支付金额'; | |||
| @@ -0,0 +1,2 @@ | |||
| ALTER TABLE `wx_order` | |||
| CHANGE COLUMN `total_payment` `real_payment` int(11) NULL COMMENT '实际支付金额'; | |||
| @@ -0,0 +1,2 @@ | |||
| ALTER TABLE `pos_coupon_order_verify` | |||
| ADD COLUMN `order_from` int(11) NULL COMMENT '来源,0-inside,1-POS' after `pos_order_id`; | |||
| @@ -0,0 +1,14 @@ | |||
| alter table wx_rent_contract | |||
| add column contract_type smallint(2) not null default 0 comment '合同类型1店铺租金合同5店铺租金物业合同3多经租金合同6多经租金物业合同'; | |||
| alter table wx_property_contract | |||
| add column contract_type smallint(2) not null default 0 comment '合同类型2店铺物业合同4多经物业合同5店铺租金物业合同6多经租金物业合同'; | |||
| update wx_rent_contract set contract_type=1 where rent_shop_type=1 and operation_type=1; | |||
| update wx_rent_contract set contract_type=3 where rent_shop_type=2 and operation_type=1; | |||
| update wx_rent_contract set contract_type=5 where rent_shop_type=1 and operation_type=2; | |||
| update wx_rent_contract set contract_type=6 where rent_shop_type=2 and operation_type=2; | |||
| update wx_property_contract set contract_type=2 where rent_shop_type=1 and operation_type=1; | |||
| update wx_property_contract set contract_type=4 where rent_shop_type=2 and operation_type=1; | |||
| update wx_property_contract set contract_type=5 where rent_shop_type=1 and operation_type=2; | |||
| update wx_property_contract set contract_type=6 where rent_shop_type=2 and operation_type=2; | |||
| @@ -0,0 +1,123 @@ | |||
| -- 招商任务 | |||
| CREATE TABLE `invest_task` ( | |||
| `id` BIGINT(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` VARCHAR(10) NOT NULL COMMENT '租户ID', | |||
| `owner` json DEFAULT NULL COMMENT '负责人', | |||
| `status` TINYINT(6) NOT NULL DEFAULT '0' COMMENT '任务状态:-1-关闭;0-待分配;1-洽谈中;2-意向签约;3-已完成', | |||
| `target_type` SMALLINT(2) NOT NULL DEFAULT '0' COMMENT '目标类型:0-商铺招租;1-其他', | |||
| `target_id` BIGINT(20) NOT NULL COMMENT '目标ID', | |||
| `content` json DEFAULT NULL COMMENT '任务设定条件', | |||
| `last_time` DATETIME NOT NULL COMMENT '最晚出租时间', | |||
| `create_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||
| `update_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |||
| PRIMARY KEY (`id`), | |||
| KEY `idx_status_target` (`tenant_id`,`status`,`target_type`) | |||
| ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='招商任务'; | |||
| -- 客户需求 | |||
| CREATE TABLE `invest_demand` ( | |||
| `id` BIGINT(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` VARCHAR(10) NOT NULL COMMENT '租户ID', | |||
| `owner` BIGINT(20) DEFAULT NULL COMMENT '负责人', | |||
| `customer_id` BIGINT(20) NOT NULL COMMENT '客户ID', | |||
| `intent` json DEFAULT NULL COMMENT '客户意向', | |||
| `target_type` SMALLINT(2) NOT NULL DEFAULT '0' COMMENT '目标类型:0-商铺招租;1-其他', | |||
| `target_id` BIGINT(20) NOT NULL COMMENT '目标ID', | |||
| `create_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||
| `update_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |||
| PRIMARY KEY (`id`), | |||
| KEY `idx_owner_customer_target` (`tenant_id`,`owner`,`customer_id`,`target_type`) | |||
| ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='客户需求'; | |||
| -- 客户列表 | |||
| CREATE TABLE `invest_customer` ( | |||
| `id` BIGINT(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` VARCHAR(10) NOT NULL COMMENT '租户ID', | |||
| `name` VARCHAR(30) NOT NULL COMMENT '客户名称', | |||
| `phone` VARCHAR(20) NOT NULL COMMENT '电话', | |||
| `business_id` int(11) NOT NULL COMMENT '经营业态', | |||
| `brand_id` BIGINT(20) NOT NULL COMMENT '品牌ID', | |||
| `type` TINYINT(6) NOT NULL DEFAULT '0' COMMENT '客户分类:0-潜在客户;1-意向客户;2-合作客户;3-谈判失败', | |||
| `rating` TINYINT(6) NOT NULL DEFAULT '0' COMMENT '客户预评级:0-无;1-主力店;2-次主力店;3-甲;4-乙;5-丙' , | |||
| `invest_channel` VARCHAR(10) NOT NULL COMMENT '招商渠道:0-无;1-电视;2-广播;3-报纸;4-刊物;5-物联网;6-招商活动;7-中介机构;8-自定义渠道', | |||
| `create_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||
| `update_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |||
| PRIMARY KEY (`id`), | |||
| KEY `idx_buss_type` (`tenant_id`,`business_id`,`type`) | |||
| ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='客户列表'; | |||
| -- 招商提醒 | |||
| CREATE TABLE `invest_remind` ( | |||
| `id` BIGINT(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` VARCHAR(10) NOT NULL COMMENT '租户ID', | |||
| `owner` BIGINT(20) NOT NULL COMMENT '提醒用户', | |||
| `content` json DEFAULT NULL COMMENT '提醒内容', | |||
| `minute` BIGINT(6) NOT NULL COMMENT '提醒时间', | |||
| `begin_date` DATETIME NOT NULL COMMENT '开始时间', | |||
| `end_date` DATETIME NOT NULL COMMENT '结束时间', | |||
| `create_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||
| `update_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |||
| PRIMARY KEY (`id`), | |||
| KEY `idx_owner` (`tenant_id`,`owner`) | |||
| ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='招商提醒'; | |||
| -- 跟踪记录 | |||
| CREATE TABLE `invest_follow_record` ( | |||
| `id` BIGINT(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` VARCHAR(10) NOT NULL COMMENT '租户ID', | |||
| `owner` BIGINT(20) NOT NULL COMMENT '主谈人', | |||
| `customer_id` BIGINT(20) NOT NULL COMMENT '客户ID', | |||
| `content` json NOT NULL COMMENT '洽谈内容', | |||
| `type` SMALLINT(2) NOT NULL COMMENT '跟踪类型:0-招商任务;1-客户需求', | |||
| `follow_id` BIGINT(20) NOT NULL COMMENT '跟踪类型的主键ID', | |||
| `operator` BIGINT(20) NOT NULL DEFAULT '0' COMMENT '操作人:0-系统;其它', | |||
| `follow_date` TIMESTAMP NOT NULL COMMENT '跟踪时间', | |||
| `create_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||
| `update_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |||
| PRIMARY KEY (`id`), | |||
| KEY `idx_owner_cus_follow` (`tenant_id`,`owner`,`customer_id`,`follow_id`) | |||
| ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='跟踪记录'; | |||
| -- 操作记录 | |||
| CREATE TABLE `invest_operate_record` ( | |||
| `id` BIGINT(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` VARCHAR(10) NOT NULL COMMENT '租户ID', | |||
| `tbl` VARCHAR(30) DEFAULT NULL COMMENT '表名称', | |||
| `tid` BIGINT(20) NOT NULL COMMENT '主键ID', | |||
| `operator` BIGINT(20) NOT NULL DEFAULT '0' COMMENT '操作人:0-系统;其它', | |||
| `operate_type` TINYINT(6) NOT NULL DEFAULT '0' COMMENT '操作类型:0-ADD;1-UPDATE;2-DELETE', | |||
| `content` json DEFAULT NULL COMMENT '更新内容', | |||
| `create_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||
| PRIMARY KEY (`id`), | |||
| KEY `idx_tbl_tid_operator` (`tenant_id`,`tbl`,`tid`,`operator`) | |||
| ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='操作记录'; | |||
| -- 消息提醒 | |||
| CREATE TABLE `invest_message` ( | |||
| `id` BIGINT(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` VARCHAR(10) NOT NULL COMMENT '租户ID', | |||
| `owner` BIGINT(20) NOT NULL COMMENT '主谈人', | |||
| `tid` BIGINT(20) NOT NULL COMMENT '数据主键ID', | |||
| `type` SMALLINT(2) NOT NULL COMMENT '消息类型:0-招商任务;1-客户需求', | |||
| `tag` SMALLINT(2) NOT NULL COMMENT '消息标签:0-创建任务提醒;1-创建客户提醒;2-一个月内没完成任务;3-一周没有跟进客户', | |||
| `message` VARCHAR(500) DEFAULT NULL COMMENT '消息内容', | |||
| `deleted` smallint(1) DEFAULT '0' COMMENT '是否删除:0-否;1-是', | |||
| `create_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||
| `update_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |||
| PRIMARY KEY (`id`), | |||
| KEY `idx_owner_tid_type_tag` (`tenant_id`,`owner`,`tid`,`type`,`tag`) | |||
| ) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT='操作记录'; | |||
| -- 逻辑功能权限,保存模块或角色组合权限 | |||
| CREATE TABLE `wx_logic_permission` ( | |||
| `id` bigint(20) NOT NULL, | |||
| `name` VARCHAR(30) NOT NULL COMMENT '名称', | |||
| `parent_id` bigint(20) NOT NULL COMMENT '权限父ID', | |||
| `permission` json DEFAULT NULL COMMENT '权限列表', | |||
| `create_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||
| `update_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |||
| PRIMARY KEY (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='逻辑权限表'; | |||
| ALTER TABLE `mall_user_info` ADD COLUMN `invest_rule` tinyint(2) NOT NULL DEFAULT -1 COMMENT '招商用户角色:0-招商管理人员;1-招商人员' AFTER `is_admin`; | |||
| @@ -0,0 +1,70 @@ | |||
| -- 二级菜单 | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (11, '招商管理', 0, 'Y', NULL, 0, '#d4237a', '212,35,122', NULL, NULL, 0, 2); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1001, '招商概览', 11, 'Y', NULL, 1, '#d4237a', '212,35,122', 'InvestPromotion', 'icon-gailan1', 0, 1); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1002, '招商任务', 11, 'Y', NULL, 1, '#d4237a', '212,35,122', 'InvestTask', 'icon-renwu1', 0, 2); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1003, '客户管理', 11, 'Y', NULL, 1, '#d4237a', '212,35,122', 'InvestCustomer', 'icon-kehu', 0, 3); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1004, '品牌库', 11, 'Y', NULL, 1, '#d4237a', '212,35,122', 'brandlist', 'icon-pinpai1', 0, 4); | |||
| -- 按钮权限 | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1005, '查询负责人', 11, 'Y', 'investCustomerOwnerQuery', 2, '#d4237a', '212,35,122', NULL, NULL, 0, 0); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1006, '导入导出', 11, 'Y', 'investCustomerIO', 2, '#d4237a', '212,35,122', NULL, NULL, 0, 0); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1007, '编辑客户', 11, 'Y', 'investCustomerEdit', 2, '#d4237a', '212,35,122', NULL, NULL, 0, 0); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1008, '私有客户', 11, 'Y', 'privateCustomer', 2, '#d4237a', '212,35,122', NULL, NULL, 0, 0); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1009, '编辑跟踪记录', 11, 'Y', 'investFollowRecordEdit', 2, '#d4237a', '212,35,122', NULL, NULL, 0, 0); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1010, '查看跟踪记录', 11, 'Y', 'investFollowRecordQuery', 2, '#d4237a', '212,35,122', NULL, NULL, 0, 0); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1011, '编辑品牌库', 11, 'Y', 'investBrandEdit', 2, '#d4237a', '212,35,122', NULL, NULL, 0, 0); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1012, '编辑招商任务', 11, 'Y', 'investTaskEdit', 2, '#d4237a', '212,35,122', NULL, NULL, 0, 0); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1013, '编辑预约', 11, 'Y', 'investRemindEdit', 2, '#d4237a', '212,35,122', NULL, NULL, 0, 0); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1014, '查看预约', 11, 'Y', 'investRemindQuery', 2, '#d4237a', '212,35,122', NULL, NULL, 0, 0); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1015, '编辑客户(用户)', 11, 'Y', 'investCustomerEdit:user', 2, '#d4237a', '212,35,122', NULL, NULL, 0, 0); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1016, '查看预约(用户)', 11, 'Y', 'investRemindQuery:user', 2, '#d4237a', '212,35,122', NULL, NULL, 0, 0); | |||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||
| VALUES | |||
| (1017, '查看跟踪记录(用户)', 11, 'Y', 'investFollowRecordQuery:user', 2, '#d4237a', '212,35,122', NULL, NULL, 0, 0); | |||
| -- 逻辑权限 | |||
| INSERT INTO `wx_logic_permission` (`id`, `name`, `parent_id`, `permission`) | |||
| VALUES (1, '招商管理人员', 11, '[1005,1006,1007,1010,1011,1012,1014]'); | |||
| INSERT INTO `wx_logic_permission` (`id`, `name`, `parent_id`, `permission`) | |||
| VALUES (2, '招商人员', 11, '[1008,1009,1013,1015,1016,1017]'); | |||
| @@ -1,157 +0,0 @@ | |||
| package com.iformall.service.test; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.msg.WxMsgRecord; | |||
| import com.iformall.domain.vo.WxBillAll; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.mapper.WxBillSettleMapper; | |||
| import com.iformall.mq.MqBaseProducer; | |||
| import com.iformall.service.*; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.JsonUtil; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.shiro.SecurityUtils; | |||
| import org.apache.shiro.authc.UsernamePasswordToken; | |||
| import org.apache.shiro.subject.Subject; | |||
| import org.apache.shiro.util.ThreadContext; | |||
| import org.apache.shiro.web.subject.WebSubject; | |||
| import org.junit.Before; | |||
| import org.junit.FixMethodOrder; | |||
| import org.junit.runner.RunWith; | |||
| import org.junit.runners.MethodSorters; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; | |||
| import org.springframework.boot.test.context.SpringBootTest; | |||
| import org.springframework.mock.web.MockHttpServletRequest; | |||
| import org.springframework.mock.web.MockHttpServletResponse; | |||
| import org.springframework.mock.web.MockHttpSession; | |||
| import org.springframework.test.context.ActiveProfiles; | |||
| import org.springframework.test.context.junit4.SpringRunner; | |||
| import org.springframework.test.web.servlet.MockMvc; | |||
| import org.springframework.test.web.servlet.setup.MockMvcBuilders; | |||
| import org.springframework.web.context.WebApplicationContext; | |||
| import javax.annotation.Resource; | |||
| import java.math.BigDecimal; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.Map; | |||
| @Slf4j | |||
| @AutoConfigureMockMvc | |||
| @FixMethodOrder(MethodSorters.JVM) | |||
| @ActiveProfiles("dev") | |||
| @RunWith(SpringRunner.class) | |||
| @SpringBootTest | |||
| public class Test { | |||
| private static final String TENANT_ID = "456"; | |||
| @Resource | |||
| private org.apache.shiro.mgt.SecurityManager securityManager; | |||
| @Resource | |||
| private WebApplicationContext webApplicationContext; | |||
| private MockHttpServletRequest mockHttpServletRequest; | |||
| private MockHttpServletResponse mockHttpServletResponse; | |||
| @Autowired | |||
| WxLevelConfigService levelConfigService; | |||
| @Autowired | |||
| WxCouponSendService wxCouponSendService; | |||
| @Autowired | |||
| WxScoreRulesService wxScoreRulesService ; | |||
| private MockMvc mockMvc; | |||
| @Autowired | |||
| MqBaseProducer mqBaseProducer; | |||
| @Autowired | |||
| private WxBillSettleService wxBillSettleService; | |||
| @Autowired | |||
| private WxBillAllService wxBillAllService; | |||
| @Autowired | |||
| private WxBillSettleMapper wxBillSettleMapper; | |||
| @Autowired | |||
| private WxBillSettleRecordService wxBillSettleRecordService; | |||
| @Autowired | |||
| private WxBillPropertyService wxBillPropertyService; | |||
| @Before | |||
| public void setUp() { | |||
| mockHttpServletRequest = new MockHttpServletRequest(webApplicationContext.getServletContext()); | |||
| mockHttpServletResponse = new MockHttpServletResponse(); | |||
| MockHttpSession mockHttpSession = new MockHttpSession(webApplicationContext.getServletContext()); | |||
| mockHttpServletRequest.setSession(mockHttpSession); | |||
| SecurityUtils.setSecurityManager(securityManager); | |||
| mockMvc = MockMvcBuilders | |||
| .webAppContextSetup(webApplicationContext) | |||
| .build(); | |||
| login("yftest", "123456zz"); | |||
| } | |||
| private void login(String username, String password) { | |||
| Subject subject = new WebSubject.Builder(mockHttpServletRequest, mockHttpServletResponse) | |||
| .buildWebSubject(); | |||
| UsernamePasswordToken token = new UsernamePasswordToken(username, password, true); | |||
| subject.login(token); | |||
| ThreadContext.bind(subject); | |||
| } | |||
| @org.junit.Test | |||
| public void levelList() { | |||
| // WxBillSettle settle = wxBillSettleService.getById(328411851323572224l); | |||
| // log.debug("data:{}", JSON.toJSONString(settle)); | |||
| // WxBillAll wxBillAll = new WxBillAll(); | |||
| // wxBillAll.setMerchantId(324754110547066880l); | |||
| // wxBillAll.setTenantId("456"); | |||
| // wxBillAll.setBillTypeValue(10); | |||
| // log.debug("data:{}", JSON.toJSONString( wxBillAllService.listBill(wxBillAll))); | |||
| // WxBillSettle wxBillSettle = wxBillSettleService.getById(330875180045271040l); | |||
| // | |||
| // | |||
| // WxBillSettleRecord settleRecord = new WxBillSettleRecord(); | |||
| // settleRecord.setSettleId(wxBillSettle.getId()); | |||
| // settleRecord.setSettleMoney(wxBillSettle.getBalance()); | |||
| // settleRecord.setSettleTime(new Date()); | |||
| // settleRecord.setSettleWay(EnumSettleRecordWay.WEBCAT.getCode()); | |||
| // settleRecord.setTenantId(wxBillSettle.getTenantId()); | |||
| // | |||
| // BigDecimal money = new BigDecimal(settleRecord.getSettleMoney()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP); | |||
| // settleRecord.setDetail(EnumSettleRecordWay.getEnum(settleRecord.getSettleWay()).getMessage()+"收款"+money.toString()+"元"); | |||
| // wxBillSettleRecordService.saveOrUpdate(settleRecord,null,wxBillSettle.getId()); | |||
| // | |||
| // wxBillSettle.setUpdatetime(new Date()); | |||
| // wxBillSettle.setStatus(EnumSettleStatus.FINISH.getCode()); | |||
| // wxBillSettleMapper.updateByPrimaryKeySelective(wxBillSettle); | |||
| } | |||
| @org.junit.Test | |||
| public void testmq(){ | |||
| Map<String,String> dynamicContentMap = new HashMap<>(); | |||
| dynamicContentMap.put("page", Constant.adminPage); | |||
| WxMsgRecord wxMsgRecord = new WxMsgRecord(); | |||
| wxMsgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||
| wxMsgRecord.setModelType(EnumMsgModel.FLOW_ASSIGNEE_NODIFY.getCode()); | |||
| wxMsgRecord.setReceiver("18601973448"); | |||
| wxMsgRecord.setTenantId("456"); | |||
| wxMsgRecord.setDynamicContentMap(dynamicContentMap); | |||
| mqBaseProducer.sendMessage(wxMsgRecord, EnumMsgMqTopic.DEFAULT.getCode(),EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); | |||
| } | |||
| @org.junit.Test | |||
| public void testmq2(){ | |||
| } | |||
| @org.junit.Test | |||
| public void testPro(){ | |||
| System.out.println("--------"+JsonUtil.obj2Json(wxBillPropertyService.detail(329481088662077445l))); | |||
| } | |||
| } | |||
| @@ -1,198 +0,0 @@ | |||
| package com.iformall.service.test; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.fasterxml.jackson.databind.ObjectMapper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.enums.EnumCouponSendSendType; | |||
| import com.iformall.enums.EnumCouponSendStatus; | |||
| import com.iformall.enums.EnumCouponSendType; | |||
| import com.iformall.mapper.WxCouponMapper; | |||
| import com.iformall.service.WxCouponSendService; | |||
| import com.iformall.service.WxLevelConfigService; | |||
| import com.iformall.service.WxScoreRulesService; | |||
| import lombok.extern.slf4j.Slf4j; | |||
| import org.apache.shiro.SecurityUtils; | |||
| import org.apache.shiro.authc.UsernamePasswordToken; | |||
| import org.apache.shiro.subject.Subject; | |||
| import org.apache.shiro.util.ThreadContext; | |||
| import org.apache.shiro.web.subject.WebSubject; | |||
| import org.junit.Before; | |||
| import org.junit.FixMethodOrder; | |||
| import org.junit.Test; | |||
| import org.junit.runner.RunWith; | |||
| import org.junit.runners.MethodSorters; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; | |||
| import org.springframework.boot.test.context.SpringBootTest; | |||
| import org.springframework.http.MediaType; | |||
| import org.springframework.mock.web.MockHttpServletRequest; | |||
| import org.springframework.mock.web.MockHttpServletResponse; | |||
| import org.springframework.mock.web.MockHttpSession; | |||
| import org.springframework.test.context.ActiveProfiles; | |||
| import org.springframework.test.context.junit4.SpringRunner; | |||
| import org.springframework.test.web.servlet.MockMvc; | |||
| import org.springframework.test.web.servlet.MvcResult; | |||
| import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; | |||
| import org.springframework.test.web.servlet.result.MockMvcResultHandlers; | |||
| import org.springframework.test.web.servlet.result.MockMvcResultMatchers; | |||
| import org.springframework.test.web.servlet.setup.MockMvcBuilders; | |||
| import org.springframework.web.context.WebApplicationContext; | |||
| import tk.mybatis.mapper.entity.Example; | |||
| import javax.annotation.Resource; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @Slf4j | |||
| @AutoConfigureMockMvc | |||
| @FixMethodOrder(MethodSorters.JVM) | |||
| @ActiveProfiles("dev") | |||
| @RunWith(SpringRunner.class) | |||
| @SpringBootTest | |||
| public class WebTest { | |||
| private static final String TENANT_ID = "456"; | |||
| @Resource | |||
| private org.apache.shiro.mgt.SecurityManager securityManager; | |||
| @Resource | |||
| private WebApplicationContext webApplicationContext; | |||
| private MockHttpServletRequest mockHttpServletRequest; | |||
| private MockHttpServletResponse mockHttpServletResponse; | |||
| @Autowired | |||
| WxLevelConfigService levelConfigService; | |||
| @Autowired | |||
| WxCouponSendService wxCouponSendService; | |||
| @Autowired | |||
| WxScoreRulesService wxScoreRulesService ; | |||
| private MockMvc mockMvc; | |||
| @Autowired | |||
| WxCouponMapper wxCouponMapper ; | |||
| @Before | |||
| public void setUp() { | |||
| mockHttpServletRequest = new MockHttpServletRequest(webApplicationContext.getServletContext()); | |||
| mockHttpServletResponse = new MockHttpServletResponse(); | |||
| MockHttpSession mockHttpSession = new MockHttpSession(webApplicationContext.getServletContext()); | |||
| mockHttpServletRequest.setSession(mockHttpSession); | |||
| SecurityUtils.setSecurityManager(securityManager); | |||
| mockMvc = MockMvcBuilders | |||
| .webAppContextSetup(webApplicationContext) | |||
| .build(); | |||
| login("yftest", "123456zz"); | |||
| } | |||
| private void login(String username, String password) { | |||
| Subject subject = new WebSubject.Builder(mockHttpServletRequest, mockHttpServletResponse) | |||
| .buildWebSubject(); | |||
| UsernamePasswordToken token = new UsernamePasswordToken(username, password, true); | |||
| subject.login(token); | |||
| ThreadContext.bind(subject); | |||
| } | |||
| @Test | |||
| public void levelList() { | |||
| WxLevelConfig wxLevelConfig = new WxLevelConfig(); | |||
| wxLevelConfig.setTenantId(TENANT_ID); | |||
| wxLevelConfig.setSortColumns(BaseEntity.SortField.Points_ASC); | |||
| PageInfo<WxLevelConfig> data = levelConfigService.listAsPage(wxLevelConfig, 1, 999); | |||
| log.debug("data:{}", JSON.toJSONString(data)); | |||
| } | |||
| /** | |||
| * 投放列表 | |||
| */ | |||
| @Test | |||
| public void list() { | |||
| WxCouponSend query = new WxCouponSend(); | |||
| query.setSendType(EnumCouponSendSendType.MERCHANT.getCode()); | |||
| query.setStatus(EnumCouponSendStatus.VALID.getCode()); | |||
| query.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||
| List pageInfo = wxCouponSendService.listAsPage(query, 0, 10).getList(); | |||
| log.info("couponSend list = {}", JSON.toJSONString(pageInfo)); | |||
| } | |||
| /** | |||
| * 商户注券,添加conditions: {limit:888} | |||
| */ | |||
| @Test | |||
| public void listCouponSend() throws Exception { | |||
| MvcResult result = mockMvc.perform( | |||
| MockMvcRequestBuilders.get("/wxCouponSend/list") | |||
| .param("pageNum", "1") | |||
| .param("pageSize", "10") | |||
| .param("sortColumn", "createDate") | |||
| .param("sortOrder", "desc") | |||
| .param("status", "1") | |||
| //.param("expired", "1") | |||
| .param("sendType", EnumCouponSendSendType.MERCHANT.getCode() + "") | |||
| ) | |||
| .andExpect(MockMvcResultMatchers.status().isOk()) | |||
| .andDo(MockMvcResultHandlers.print()) | |||
| .andReturn(); | |||
| String responseStr = result.getResponse().getContentAsString(); | |||
| ObjectMapper mapper = new ObjectMapper(); | |||
| Map<String, String> respMap = mapper.readValue(responseStr, Map.class); | |||
| log.info("respMap -> {}", JSON.toJSONString(respMap)); | |||
| } | |||
| /** | |||
| * 商户注券,添加conditions: {limit:888} | |||
| */ | |||
| @Test | |||
| public void addCouponSend() throws Exception { | |||
| WxCouponSend wxCouponSend = new WxCouponSend(); | |||
| wxCouponSend.setSendType(EnumCouponSendSendType.MERCHANT.getCode()); | |||
| wxCouponSend.setCouponId(267460814401699840L); | |||
| wxCouponSend.setTenantId(TENANT_ID); | |||
| wxCouponSend.setTitle("口红666"); | |||
| wxCouponSend.setCreateDate(new Date()); | |||
| wxCouponSend.setUpdateDate(new Date()); | |||
| JSONObject jo = new JSONObject(); | |||
| jo.put(WxCouponSend.KEY_MERCHANT_LNVENTORY, 994); | |||
| wxCouponSend.setConditions(jo.toJSONString()); | |||
| MvcResult result = mockMvc.perform( | |||
| MockMvcRequestBuilders.post("/wxCouponSend/add") | |||
| .contentType(MediaType.APPLICATION_JSON) | |||
| .content(JSON.toJSONString(wxCouponSend))) | |||
| .andExpect(MockMvcResultMatchers.status().isOk()) | |||
| .andDo(MockMvcResultHandlers.print()) | |||
| .andReturn(); | |||
| String responseStr = result.getResponse().getContentAsString(); | |||
| ObjectMapper mapper = new ObjectMapper(); | |||
| Map<String, String> respMap = mapper.readValue(responseStr, Map.class); | |||
| log.info("respMap -> {}", JSON.toJSONString(respMap)); | |||
| } | |||
| @Test | |||
| public void add() throws Exception { | |||
| Map<String, Object> params = new HashMap<>(); | |||
| params.put("creditNum", "1"); | |||
| params.put("creditType", "12"); | |||
| params.put("cuserId", "329879374400159744"); | |||
| params.put("operatorType", "4"); | |||
| MvcResult result = mockMvc.perform( | |||
| MockMvcRequestBuilders.post("/wxCreditHistory/add") | |||
| .contentType(MediaType.APPLICATION_JSON_UTF8) | |||
| .content(JSON.toJSONString(params)) | |||
| ) | |||
| .andExpect(MockMvcResultMatchers.status().isOk()) | |||
| .andDo(MockMvcResultHandlers.print()) | |||
| .andReturn(); | |||
| String responseStr = result.getResponse().getContentAsString(); | |||
| ObjectMapper mapper = new ObjectMapper(); | |||
| Map<String, String> respMap = mapper.readValue(responseStr, Map.class); | |||
| log.info("respMap -> {}", JSON.toJSONString(respMap)); | |||
| } | |||
| } | |||
| @@ -37,6 +37,7 @@ | |||
| ch.qos.logback, | |||
| com.alibaba, | |||
| com.amazonaws, | |||
| com.baomidou, | |||
| com.mchange, | |||
| com.fasterxml.jackson.core, | |||
| com.fasterxml.jackson.dataformat, | |||
| @@ -86,6 +87,8 @@ | |||
| javax.servlet, | |||
| javax.validation, | |||
| javax.xml.bind, | |||
| javax.xml.soap, | |||
| javax.xml.ws, | |||
| joda-time, | |||
| junit, | |||
| mysql, | |||
| @@ -123,6 +126,8 @@ | |||
| org.jboss.xnio, | |||
| org.jdom, | |||
| org.jodd, | |||
| org.jvnet.mimepull, | |||
| org.jvnet.staxex, | |||
| org.mapstruct, | |||
| org.mockito, | |||
| org.mybatis, | |||
| @@ -131,6 +136,7 @@ | |||
| org.ow2.asm, | |||
| org.projectlombok, | |||
| org.quartz-scheduler, | |||
| org.reactivestreams, | |||
| org.reflections, | |||
| org.rocketmq.spring.boot, | |||
| org.slf4j, | |||
| @@ -1,12 +1,12 @@ | |||
| package com.iformall; | |||
| import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties; | |||
| import org.mybatis.spring.annotation.MapperScan; | |||
| import org.rocketmq.starter.annotation.EnableRocketMQ; | |||
| import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.boot.SpringApplication; | |||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |||
| import org.springframework.context.annotation.Bean; | |||
| import tk.mybatis.spring.annotation.MapperScan; | |||
| /** | |||
| * @author chenkx | |||
| @@ -1,10 +1,7 @@ | |||
| package com.iformall.config; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.PushLimit; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxMall; | |||
| import com.iformall.domain.po.WxScoreRules; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.WxCouponChannelVo; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| @@ -141,4 +138,20 @@ public class RedisConfig extends CachingConfigurerSupport { | |||
| return template; | |||
| } | |||
| @Bean("buserTokenRedisTemplate") | |||
| public RedisTemplate<String, WxBuser> getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { | |||
| RedisTemplate<String, WxBuser> template = new RedisTemplate(); | |||
| Jackson2JsonRedisSerializer<WxBuser> j = new Jackson2JsonRedisSerializer(WxBuser.class); | |||
| // value值的序列化 | |||
| template.setValueSerializer(j); | |||
| template.setHashKeySerializer(j); | |||
| // key的序列化 | |||
| template.setKeySerializer(new StringRedisSerializer()); | |||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||
| template.setConnectionFactory(connectionFactory); | |||
| return template; | |||
| } | |||
| } | |||
| @@ -9,14 +9,12 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | |||
| import com.iformall.interceptor.AuthorizationInterceptor; | |||
| import com.iformall.interceptor.HttpServletRequestWrapperFilter; | |||
| import com.iformall.interceptor.RequestInterceptor; | |||
| import com.iformall.resolver.LoginUserHandlerMethodArgumentResolver; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.boot.web.servlet.FilterRegistrationBean; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.http.converter.HttpMessageConverter; | |||
| import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; | |||
| import org.springframework.web.method.support.HandlerMethodArgumentResolver; | |||
| import org.springframework.web.servlet.config.annotation.*; | |||
| import java.math.BigDecimal; | |||
| @@ -38,8 +36,6 @@ public class WebMvcConfig implements WebMvcConfigurer { | |||
| private AuthorizationInterceptor authorizationInterceptor; | |||
| @Autowired | |||
| private RequestInterceptor requestInterceptor; | |||
| @Autowired | |||
| private LoginUserHandlerMethodArgumentResolver loginUserHandlerMethodArgumentResolver; | |||
| @Override | |||
| public void addInterceptors(InterceptorRegistry registry) { | |||
| @@ -47,11 +43,6 @@ public class WebMvcConfig implements WebMvcConfigurer { | |||
| registry.addInterceptor(requestInterceptor).addPathPatterns("/api/**"); | |||
| } | |||
| @Override | |||
| public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) { | |||
| argumentResolvers.add(loginUserHandlerMethodArgumentResolver); | |||
| } | |||
| @Override | |||
| public void addResourceHandlers(ResourceHandlerRegistry registry) { | |||
| registry.addResourceHandler("swagger-ui.html") | |||
| @@ -1,16 +1,13 @@ | |||
| package com.iformall.controller; | |||
| import java.beans.PropertyEditorSupport; | |||
| import java.text.ParseException; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Date; | |||
| import cn.binarywang.wx.miniapp.api.WxMaService; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.WxBuser; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxAppinfoService; | |||
| import com.iformall.service.WxBuserService; | |||
| import com.iformall.service.WxMerchantBUserService; | |||
| import com.iformall.service.wechat.FmOpenService; | |||
| import com.iformall.utils.Constant; | |||
| @@ -24,6 +21,10 @@ import org.springframework.web.context.request.RequestContextHolder; | |||
| import org.springframework.web.context.request.ServletRequestAttributes; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import java.beans.PropertyEditorSupport; | |||
| import java.text.ParseException; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Date; | |||
| @RestController | |||
| public class BaseController { | |||
| @@ -38,6 +39,9 @@ public class BaseController { | |||
| @Autowired | |||
| private FmOpenService openService; | |||
| @Autowired | |||
| private WxBuserService wxBuserService; | |||
| @InitBinder | |||
| public void InitBinder(WebDataBinder dataBinder) { | |||
| dataBinder.registerCustomEditor(Date.class, new PropertyEditorSupport() { | |||
| @@ -60,20 +64,31 @@ public class BaseController { | |||
| }); | |||
| } | |||
| public Long getUserId() { | |||
| public Long getBuserId() { | |||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |||
| Long bUserId = (Long) request.getAttribute(Constant.LOGIN_USER_KEY); | |||
| return bUserId; | |||
| Long id = (Long) request.getAttribute(Constant.LOGIN_USER_KEY); | |||
| return id; | |||
| } | |||
| public WxMerchantBUser getUser() { | |||
| Long bUserId = getUserId(); | |||
| WxMerchantBUser user = wxMerchantBUserService.getById(bUserId); | |||
| if (user == null) | |||
| Long userId = getBuser().getUserId(); | |||
| WxMerchantBUser user = wxMerchantBUserService.getById(userId); | |||
| if (user == null) { | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||
| } | |||
| return user; | |||
| } | |||
| public WxBuser getBuser() { | |||
| Long id = getBuserId(); | |||
| WxBuser user = wxBuserService.getById(id); | |||
| if (user == null) { | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||
| } | |||
| return user; | |||
| } | |||
| public String getTenantId() { | |||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |||
| String tenantId = (String) request.getAttribute(Constant.TENANT_ID); | |||
| @@ -1,14 +1,19 @@ | |||
| package com.iformall.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.AuthIgnore; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||
| import com.iformall.domain.po.WxCouponOrder; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.vo.WxCouponOrderCVo; | |||
| import com.iformall.enums.EnumCouponVerifyType; | |||
| import com.iformall.enums.EnumCreditLockedStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxCUserBasicInfoService; | |||
| import com.iformall.service.WxCUserService; | |||
| import com.iformall.service.WxCouponOrderService; | |||
| import com.iformall.service.WxMerchantBUserService; | |||
| import io.swagger.annotations.Api; | |||
| @@ -21,7 +26,10 @@ import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.math.BigDecimal; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @RestController | |||
| @@ -36,6 +44,13 @@ public class WxCouponOrderController extends BaseController { | |||
| @Autowired | |||
| private WxMerchantBUserService wxMerchantBUserService; | |||
| @Autowired | |||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||
| @Autowired | |||
| private WxCUserService wxCUserService; | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @@ -127,6 +142,10 @@ public class WxCouponOrderController extends BaseController { | |||
| if (wxCouponOrderCVo == null) | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(wxCouponOrderCVo.getcUserId()); | |||
| if (wxCUserBasicInfo != null && EnumCreditLockedStatus.CLOSE.getCode().equals(wxCUserBasicInfo.getStatus())) { | |||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | |||
| } | |||
| if (wxCouponOrderCVo.getValidStartDate() != null && wxCouponOrderCVo.getValidEndDate() != null ) { | |||
| Date now = new Date(); | |||
| @@ -146,12 +165,12 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| } | |||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserService.getById(getUserId()); | |||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserService.getById(getUser().getId()); | |||
| if (wxMerchantBUser == null) { | |||
| logger.error("核销员ID不存在:" + getUserId()); | |||
| logger.error("核销员ID不存在:" + getUser().getId()); | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), "核销员ID不存在或者无权限"); | |||
| } | |||
| wxMerchantBUser.setBuserId(getBuserId()); | |||
| WxCouponOrder couponOrder = null; | |||
| try { | |||
| couponOrder = wxCouponOrderService.verify(wxCouponOrder, wxMerchantBUser); | |||
| @@ -200,4 +219,8 @@ public class WxCouponOrderController extends BaseController { | |||
| return new ResultData(); | |||
| } | |||
| } | |||
| @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.vo.WxCouponActionLogVo; | |||
| import com.iformall.domain.vo.WxCouponSendVo; | |||
| import com.iformall.enums.EnumCouponSendSendType; | |||
| @@ -81,7 +82,7 @@ public class WxCouponSendController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| Object cUserId = params.get("cUserId") ; | |||
| String cUserId = (String) params.get("cUserId"); | |||
| if (!params.containsKey("wxCouponSendIds")) { | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | |||
| @@ -98,12 +99,12 @@ public class WxCouponSendController extends BaseController { | |||
| wxCouponSend.setSendType(EnumCouponSendSendType.MERCHANT.getCode()); | |||
| wxCouponSend.setStatus(EnumCouponSendStatus.VALID.getCode()); | |||
| try { | |||
| wxCouponSendService.handSel(wxCouponSend, cUserId); | |||
| wxCouponSendService.handSel(wxCouponSend, Long.parseLong(cUserId)); | |||
| } catch (MallinkException e) { | |||
| logger.error("注券异常: " + e.getMessage()); | |||
| logger.error("注券异常: ", e); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } catch (Exception e) { | |||
| logger.error("注券异常: " + e.getMessage()); | |||
| logger.error("注券异常: ", e); | |||
| return new ResultData(ErrorCode.COUPON_HANDSEL_VERIFY, e.getMessage()); | |||
| } | |||
| return new ResultData(); | |||
| @@ -9,13 +9,15 @@ import com.iformall.domain.po.WxCreditHistory; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.vo.WxCreditHistoryVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.enums.EnumMerchantStatus; | |||
| import com.iformall.enums.EnumScoreType; | |||
| import com.iformall.enums.EnumUserType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxCUserBasicInfoService; | |||
| import com.iformall.service.WxCUserTagsService; | |||
| import com.iformall.service.WxCreditHistoryService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.utils.UserUtil; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| @@ -44,6 +46,9 @@ public class WxCreditHistoryController extends BaseController { | |||
| @Autowired | |||
| private WxMerchantService wxMerchantService; | |||
| @Autowired | |||
| private WxCUserTagsService wxCUserTagsService; | |||
| @ApiOperation("根据商户ID和消费金额获取所增加积分 取data里credit的值, 服务台会查询一般商户的信息,普通商户只会调用自己的id") | |||
| @GetMapping("/findByMerchantIdAndSpend") | |||
| @ApiImplicitParams({ | |||
| @@ -114,7 +119,12 @@ public class WxCreditHistoryController extends BaseController { | |||
| wxCreditHistory.setOperatorType(EnumUserType.BUSER.getCode()); | |||
| try { | |||
| wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId()); | |||
| wxCreditHistory.setBuserId(getBuser().getId()); | |||
| WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | |||
| //更新标签 | |||
| if (wxCreditHistory.getTags() != null && !wxCreditHistory.getTags().isEmpty()) { | |||
| wxCUserTagsService.updateTagByUserId(wxCreditHistory.getCUserId(), wxCreditHistory.getTags()); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "操作成功", credit); | |||
| } catch (MallinkException e) { | |||
| log.error(e.getMessage()); | |||