develop # Conflicts: # mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.javarelease_toaliyun_real
| @@ -1,6 +1,7 @@ | |||||
| .idea/** | .idea/** | ||||
| */target/** | */target/** | ||||
| logs/** | logs/** | ||||
| */logs/** | |||||
| logPath_IS_UNDEFINED/** | logPath_IS_UNDEFINED/** | ||||
| uploads/** | uploads/** | ||||
| .gitignore | .gitignore | ||||
| @@ -0,0 +1,14 @@ | |||||
| package com.iformall.annotation; | |||||
| import java.lang.annotation.*; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| @Target({ElementType.METHOD}) | |||||
| @Retention(RetentionPolicy.RUNTIME) | |||||
| @Documented | |||||
| public @interface UserDataRuleAnnotation { | |||||
| String value() default ""; | |||||
| } | |||||
| @@ -1,8 +1,10 @@ | |||||
| package com.iformall.controller.basic; | package com.iformall.controller.basic; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.WxMallFloor; | |||||
| import com.iformall.service.WxMallBuildingService; | import com.iformall.service.WxMallBuildingService; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -26,5 +28,23 @@ public class WxMallBuildingController extends BaseController { | |||||
| return wxMallBuildingService.getbuildingfloorlist(getTenantId()); | return wxMallBuildingService.getbuildingfloorlist(getTenantId()); | ||||
| } | } | ||||
| @ApiOperation("保存楼层楼座面积") | |||||
| @PostMapping("saveFloorArea") | |||||
| @SystemControllerLog(description = "商城-楼座/楼层-保存面积") | |||||
| public ResultData saveFloorArea(@RequestBody WxMallFloor record) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMallBuildingController::addBuildingAndFloor"); | |||||
| if(record == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| if (record.getId() == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| if (record.getTotalArea() == null && record.getOperatingArea() == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| record.setTenantId(getTenantId()); | |||||
| wxMallBuildingService.saveFloorArea(record); | |||||
| return new ResultData(); | |||||
| } | |||||
| } | } | ||||
| @@ -2,6 +2,7 @@ package com.iformall.controller.basic; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| @@ -18,12 +19,13 @@ import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| /** | |||||
| /**w | |||||
| * @author gongbiao | * @author gongbiao | ||||
| */ | */ | ||||
| @RestController | @RestController | ||||
| @@ -37,6 +39,7 @@ public class WxMerchantController extends BaseController { | |||||
| private QrCodeService qrCodeService; | private QrCodeService qrCodeService; | ||||
| @UserDataRuleAnnotation("merchant_list") | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("listVo") | @GetMapping("listVo") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -57,7 +60,8 @@ public class WxMerchantController extends BaseController { | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||||
| }) | |||||
| @SystemControllerLog(description = "商户-列表") | @SystemControllerLog(description = "商户-列表") | ||||
| public ResultData list(@ModelAttribute WxMerchant wxMerchant, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxMerchant wxMerchant, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::list"); | logger.debug("[" + getIpAddr() + "] WxMerchantController::list"); | ||||
| @@ -208,6 +212,7 @@ public class WxMerchantController extends BaseController { | |||||
| return new ResultData(wxMerchant); | return new ResultData(wxMerchant); | ||||
| } | } | ||||
| @UserDataRuleAnnotation("merchant_list") | |||||
| @ApiOperation("商户数据导出") | @ApiOperation("商户数据导出") | ||||
| @GetMapping("/exportData") | @GetMapping("/exportData") | ||||
| @SystemControllerLog(description = "商户-商户数据导出") | @SystemControllerLog(description = "商户-商户数据导出") | ||||
| @@ -1,10 +1,14 @@ | |||||
| package com.iformall.controller.contract; | package com.iformall.controller.contract; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.*; | |||||
| 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.EnumIsPreview; | import com.iformall.enums.EnumIsPreview; | ||||
| import com.iformall.enums.EnumRentStartType; | import com.iformall.enums.EnumRentStartType; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| @@ -38,7 +42,8 @@ public class WxPropertyContractController extends BaseController { | |||||
| private Logger logger = LoggerFactory.getLogger(WxPropertyContractController.class); | private Logger logger = LoggerFactory.getLogger(WxPropertyContractController.class); | ||||
| @GetMapping("list") | |||||
| @UserDataRuleAnnotation("property_contract_list") | |||||
| @GetMapping("/list") | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| @@ -1,22 +1,23 @@ | |||||
| package com.iformall.controller.contract; | package com.iformall.controller.contract; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.enums.EnumBillAction; | |||||
| import com.iformall.enums.EnumFromType; | import com.iformall.enums.EnumFromType; | ||||
| import com.iformall.enums.EnumIsPreview; | import com.iformall.enums.EnumIsPreview; | ||||
| import com.iformall.enums.EnumRentStartType; | import com.iformall.enums.EnumRentStartType; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxBillActionMapper; | |||||
| import com.iformall.mapper.WxBillPropertyMapper; | import com.iformall.mapper.WxBillPropertyMapper; | ||||
| import com.iformall.mapper.WxBillRentMapper; | import com.iformall.mapper.WxBillRentMapper; | ||||
| import com.iformall.mapper.WxRentContractMapper; | import com.iformall.mapper.WxRentContractMapper; | ||||
| import com.iformall.service.*; | |||||
| import com.iformall.service.WxBillRentService; | |||||
| import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.service.WxPayAccountBillService; | |||||
| import com.iformall.service.WxRentContractService; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -28,9 +29,11 @@ import org.springframework.web.bind.annotation.*; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.math.BigDecimal; | |||||
| import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
| import java.util.*; | |||||
| import java.util.Date; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| /** | /** | ||||
| * @author gongbiao | * @author gongbiao | ||||
| @@ -88,7 +91,8 @@ public class WxRentContractController extends BaseController { | |||||
| return new ResultData(map); | return new ResultData(map); | ||||
| } | } | ||||
| @GetMapping("list") | |||||
| @UserDataRuleAnnotation("rent_contract_list") | |||||
| @GetMapping("/list") | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| @@ -126,7 +130,9 @@ public class WxRentContractController extends BaseController { | |||||
| @SystemControllerLog(description = "租赁合同-添加") | @SystemControllerLog(description = "租赁合同-添加") | ||||
| public ResultData add(@RequestBody WxRentContract wxRentContract) { | public ResultData add(@RequestBody WxRentContract wxRentContract) { | ||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::add"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::add"); | ||||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | |||||
| wxRentContract.setBusDiscountTime(new Integer(0)); | |||||
| } | |||||
| WxMerchant wxMerchant = new WxMerchant(); | WxMerchant wxMerchant = new WxMerchant(); | ||||
| wxMerchant.setName(wxRentContract.getMerchantName()); | wxMerchant.setName(wxRentContract.getMerchantName()); | ||||
| wxMerchant.setId(wxRentContract.getMerchantId()); | wxMerchant.setId(wxRentContract.getMerchantId()); | ||||
| @@ -165,6 +171,10 @@ public class WxRentContractController extends BaseController { | |||||
| @SystemControllerLog(description = "租赁合同-更新") | @SystemControllerLog(description = "租赁合同-更新") | ||||
| public ResultData update(@RequestBody WxRentContract wxRentContract) { | public ResultData update(@RequestBody WxRentContract wxRentContract) { | ||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::update"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::update"); | ||||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | |||||
| wxRentContract.setBusDiscountTime(new Integer(0)); | |||||
| } | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxRentContract.setTenantId(user.getTenantId()); | wxRentContract.setTenantId(user.getTenantId()); | ||||
| wxRentContract.setAdjustPeriodHandle(); | wxRentContract.setAdjustPeriodHandle(); | ||||
| @@ -191,6 +201,9 @@ public class WxRentContractController extends BaseController { | |||||
| @SystemControllerLog(description = "租赁合同-更新金额") | @SystemControllerLog(description = "租赁合同-更新金额") | ||||
| public ResultData updateMoney(@RequestBody WxRentContract wxRentContract) { | public ResultData updateMoney(@RequestBody WxRentContract wxRentContract) { | ||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateMoney"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::updateMoney"); | ||||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | |||||
| wxRentContract.setBusDiscountTime(new Integer(0)); | |||||
| } | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxRentContract.setTenantId(user.getTenantId()); | wxRentContract.setTenantId(user.getTenantId()); | ||||
| wxRentContract.setAdjustPeriodHandle(); | wxRentContract.setAdjustPeriodHandle(); | ||||
| @@ -206,6 +219,9 @@ public class WxRentContractController extends BaseController { | |||||
| @SystemControllerLog(description = "租赁合同-更新文件") | @SystemControllerLog(description = "租赁合同-更新文件") | ||||
| public ResultData updateFile(@RequestBody WxRentContract wxRentContract) { | public ResultData updateFile(@RequestBody WxRentContract wxRentContract) { | ||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateFile"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::updateFile"); | ||||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | |||||
| wxRentContract.setBusDiscountTime(new Integer(0)); | |||||
| } | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxRentContract.setTenantId(user.getTenantId()); | wxRentContract.setTenantId(user.getTenantId()); | ||||
| wxRentContract.setAdjustPeriodHandle(); | wxRentContract.setAdjustPeriodHandle(); | ||||
| @@ -2,6 +2,7 @@ package com.iformall.controller.contract; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| @@ -27,7 +28,8 @@ public class WxRentPropertyContractController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxRentPropertyContractService wxRentPropertyContractService; | private WxRentPropertyContractService wxRentPropertyContractService; | ||||
| @GetMapping("list") | |||||
| @UserDataRuleAnnotation("rent_property_contract_list") | |||||
| @GetMapping("/list") | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| @@ -52,7 +52,7 @@ public class WxChartDataController extends BaseController { | |||||
| "rentOwe 租赁总额 propertyOwe物业总额 otherOwe其他总额 depositOwe押金总额 totalOwe欠缴总额"+ | "rentOwe 租赁总额 propertyOwe物业总额 otherOwe其他总额 depositOwe押金总额 totalOwe欠缴总额"+ | ||||
| "--------------------------------------"+ | "--------------------------------------"+ | ||||
| "chart=51首页场景发卷:" + | "chart=51首页场景发卷:" + | ||||
| "carStopHistory停车发卷 couponVerifyHistory核销发卷 orderHistory交易发卷 micropayHistory收银台发卷"+ | |||||
| "carStopHistory停车发卷 couponVerifyHistory核销发卷 orderHistory交易发卷 micropayHistory收银台发卷 merchantHistory商户发券"+ | |||||
| "--------------------------------------"+ | "--------------------------------------"+ | ||||
| "chart=52营销数据:" + | "chart=52营销数据:" + | ||||
| "当前”券交易数据“替换为”营销数据“:cardHistory卡营销历史 pressSendHistory砍价营销历史 groupHistory拼团营销历史 couponHistory卷营销历史," + | "当前”券交易数据“替换为”营销数据“:cardHistory卡营销历史 pressSendHistory砍价营销历史 groupHistory拼团营销历史 couponHistory卷营销历史," + | ||||
| @@ -2,6 +2,7 @@ package com.iformall.controller.datatower; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| @@ -30,33 +31,22 @@ public class WxMerchantTradeDailyController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxMerchantTradeDailyService wxMerchantTradeDailyService; | private WxMerchantTradeDailyService wxMerchantTradeDailyService; | ||||
| @ApiOperation("获得指定日期的解单,默认不传reportDate为当天") | |||||
| @GetMapping("/getVolume") | |||||
| @SystemControllerLog(description = "解单-获得指定日期的解单") | |||||
| public ResultData getVolume(WxMerchantTradeDaily wxMerchantTradeDaily) { | |||||
| wxMerchantTradeDaily.setTenantId(getTenantId()); | |||||
| return wxMerchantTradeDailyService.getVolume(wxMerchantTradeDaily,getUser().getId()); | |||||
| } | |||||
| @UserDataRuleAnnotation("merchant_trade") | |||||
| @ApiOperation("获得解单列表") | @ApiOperation("获得解单列表") | ||||
| @GetMapping("/list") | @GetMapping("/list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| @SystemControllerLog(description = "商户-获得昨日解单列表") | @SystemControllerLog(description = "商户-获得昨日解单列表") | ||||
| public ResultData list(@ModelAttribute WxMerchantTradeDailyVo wxMerchantTradeDaily, Integer pageNum, Integer pageSize) { | |||||
| public ResultData list(@ModelAttribute WxMerchantTradeDaily wxMerchantTradeDaily, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::listYesterday"); | logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::listYesterday"); | ||||
| if (wxMerchantTradeDaily == null) | if (wxMerchantTradeDaily == null) | ||||
| wxMerchantTradeDaily = new WxMerchantTradeDailyVo(); | |||||
| wxMerchantTradeDaily = new WxMerchantTradeDaily(); | |||||
| wxMerchantTradeDaily.setTenantId(getTenantId()); | wxMerchantTradeDaily.setTenantId(getTenantId()); | ||||
| if (wxMerchantTradeDaily.getReportDate() == null) { | |||||
| SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); | |||||
| wxMerchantTradeDaily.setReportDate(fmt.format(new Date())); | |||||
| } | |||||
| wxMerchantTradeDaily.setSortColumns(BaseEntity.SortField.MerchantId_DESC); | |||||
| wxMerchantTradeDaily.setSortColumns(BaseEntity.SortField.ReportDate_DESC,BaseEntity.SortField.MerchantId_DESC); | |||||
| PageInfo<WxMerchantTradeDailyVo> page = wxMerchantTradeDailyService.listAsPageVo(wxMerchantTradeDaily, pageNum, pageSize); | PageInfo<WxMerchantTradeDailyVo> page = wxMerchantTradeDailyService.listAsPageVo(wxMerchantTradeDaily, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| @@ -81,7 +71,7 @@ public class WxMerchantTradeDailyController extends BaseController { | |||||
| @ApiOperation("更新解单数据") | @ApiOperation("更新解单数据") | ||||
| @PostMapping("/update") | @PostMapping("/update") | ||||
| @SystemControllerLog(description = "商户-更新解单数据") | @SystemControllerLog(description = "商户-更新解单数据") | ||||
| public ResultData update(@RequestBody WxMerchantTradeDailyVo wxMerchantTradeDaily) { | |||||
| public ResultData update(@RequestBody WxMerchantTradeDaily wxMerchantTradeDaily) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::updateYesterday"); | logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::updateYesterday"); | ||||
| if (wxMerchantTradeDaily == null || | if (wxMerchantTradeDaily == null || | ||||
| wxMerchantTradeDaily.getMerchantId() == null || | wxMerchantTradeDaily.getMerchantId() == null || | ||||
| @@ -98,25 +88,22 @@ public class WxMerchantTradeDailyController extends BaseController { | |||||
| @ApiOperation("查询解单数据") | @ApiOperation("查询解单数据") | ||||
| @GetMapping("/queryTradeDaily") | @GetMapping("/queryTradeDaily") | ||||
| @SystemControllerLog(description = "商户-查询解单数据") | @SystemControllerLog(description = "商户-查询解单数据") | ||||
| public ResultData queryTradeDaily(@ModelAttribute WxMerchantTradeDailyVo wxMerchantTradeDaily) { | |||||
| public ResultData queryTradeDaily(@ModelAttribute WxMerchantTradeDaily wxMerchantTradeDaily) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::queryTradeDaily"); | logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::queryTradeDaily"); | ||||
| wxMerchantTradeDaily.setTenantId(getTenantId()); | wxMerchantTradeDaily.setTenantId(getTenantId()); | ||||
| return wxMerchantTradeDailyService.queryTradeDaily(wxMerchantTradeDaily); | return wxMerchantTradeDailyService.queryTradeDaily(wxMerchantTradeDaily); | ||||
| } | } | ||||
| @UserDataRuleAnnotation("merchant_trade") | |||||
| @GetMapping("exportData") | @GetMapping("exportData") | ||||
| @SystemControllerLog(description = "商户解单数据-导出数据") | @SystemControllerLog(description = "商户解单数据-导出数据") | ||||
| public void exportData(@ModelAttribute WxMerchantTradeDailyVo wxMerchantTradeDaily, HttpServletRequest request, HttpServletResponse response) { | |||||
| public void exportData(@ModelAttribute WxMerchantTradeDaily wxMerchantTradeDaily, HttpServletRequest request, HttpServletResponse response) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::exportData"); | logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::exportData"); | ||||
| if (null == wxMerchantTradeDaily) { | if (null == wxMerchantTradeDaily) { | ||||
| wxMerchantTradeDaily = new WxMerchantTradeDailyVo(); | |||||
| wxMerchantTradeDaily = new WxMerchantTradeDaily(); | |||||
| } | } | ||||
| wxMerchantTradeDaily.setTenantId(getTenantId()); | wxMerchantTradeDaily.setTenantId(getTenantId()); | ||||
| if (wxMerchantTradeDaily.getReportDate() == null) { | |||||
| SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); | |||||
| wxMerchantTradeDaily.setReportDate(fmt.format(new Date())); | |||||
| } | |||||
| wxMerchantTradeDaily.setSortColumns(BaseEntity.SortField.MerchantId_DESC); | |||||
| wxMerchantTradeDaily.setSortColumns(BaseEntity.SortField.ReportDate_DESC,BaseEntity.SortField.MerchantId_DESC); | |||||
| wxMerchantTradeDailyService.exportData(wxMerchantTradeDaily, request, response); | wxMerchantTradeDailyService.exportData(wxMerchantTradeDaily, request, response); | ||||
| } | } | ||||
| @@ -7,11 +7,10 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | import com.iformall.domain.dto.WxCUserBasicInfoDto; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.KwMeterDataVo; | |||||
| import com.iformall.domain.vo.UserCountVo; | |||||
| import com.iformall.domain.vo.UserStructureVo; | import com.iformall.domain.vo.UserStructureVo; | ||||
| import com.iformall.enums.EnumAgeInfo; | |||||
| import com.iformall.enums.EnumCUserBaseInfoSex; | |||||
| import com.iformall.enums.EnumScoreType; | |||||
| import com.iformall.enums.EnumTag; | |||||
| import com.iformall.enums.*; | |||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -261,27 +260,51 @@ public class WxUserStructureController extends BaseController { | |||||
| } | } | ||||
| /********************************会员数据**************************************/ | /********************************会员数据**************************************/ | ||||
| private Date addDay(Date date , int addDayAmount) { | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.setTime(date); | |||||
| c.add(Calendar.DATE, addDayAmount); | |||||
| Date result = c.getTime(); | |||||
| return result; | |||||
| } | |||||
| private Date addMonth(Date date, int addMountAmount) { | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.setTime(date); | |||||
| c.add(Calendar.MONTH, addMountAmount); | |||||
| Date result = c.getTime(); | |||||
| return result; | |||||
| } | |||||
| private Date addYear(Date date, int addYearAmount) { | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.setTime(date); | |||||
| c.add(Calendar.YEAR, addYearAmount); | |||||
| Date result = c.getTime(); | |||||
| return result; | |||||
| } | |||||
| @ApiOperation("查询会员数量") | @ApiOperation("查询会员数量") | ||||
| @GetMapping("/findUserDataCount") | @GetMapping("/findUserDataCount") | ||||
| @SystemControllerLog(description = "会员管理-查询会员数量") | @SystemControllerLog(description = "会员管理-查询会员数量") | ||||
| public ResultData findUserCount(Date startTime, Date endTime) { | |||||
| final int daysBefore = 29; | |||||
| public ResultData findUserCount(Date startTime, Date endTime, Integer reportType) { | |||||
| logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserCount"); | logger.debug("[" + getIpAddr() + "] WxUserStructureController::findUserCount"); | ||||
| //昨日同比 | |||||
| Map<String, Object> map = new HashMap<>(); | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | ||||
| dto.setTenantId(getTenantId()); | dto.setTenantId(getTenantId()); | ||||
| dto.setStartTime(startTime); | |||||
| dto.setEndTime(endTime); | |||||
| if (endTime != null) { | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.setTime(endTime); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| endTime = c.getTime(); | |||||
| } | |||||
| dto.setEndTime(new Date()); | |||||
| //微信用户数据 | //微信用户数据 | ||||
| long wxallCount = wxCUserService.findCount(dto);//总量 | |||||
| //会员数据 | |||||
| Map<String,Object> member=getMemberData(dto); | |||||
| long wxTotalCount = wxCUserService.findCount(dto);//总量 | |||||
| //微信用户数据 | |||||
| long memTotalCount = wxCUserBasicInfoService.findCount(dto);//总量 | |||||
| map.put("wxTotalCount",wxTotalCount); | |||||
| map.put("memTotalCount",memTotalCount); | |||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| @@ -290,46 +313,12 @@ public class WxUserStructureController extends BaseController { | |||||
| Date today = c.getTime(); | Date today = c.getTime(); | ||||
| dto.setStartTime(today); | dto.setStartTime(today); | ||||
| dto.setEndTime(null); | dto.setEndTime(null); | ||||
| long wxtodayCount = wxCUserService.findCount(dto);//今天新增 | |||||
| List<UserStructureVo> wxnewCountVos = new ArrayList<>();//每日新增会员数 | |||||
| int j = 1; | |||||
| for (int i = daysBefore; i >= 0; i--) { | |||||
| c.clear(); | |||||
| c.setTime(today); | |||||
| c.add(Calendar.DAY_OF_YEAR, -i); | |||||
| dto.setStartTime(c.getTime()); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| dto.setEndTime(c.getTime()); | |||||
| long count = wxCUserService.findCount(dto); | |||||
| UserStructureVo vo = new UserStructureVo(); | |||||
| vo.setSortNum(j); | |||||
| j++; | |||||
| vo.setName(new SimpleDateFormat("MM/dd").format(dto.getStartTime())); | |||||
| vo.setCount(count); | |||||
| wxnewCountVos.add(vo); | |||||
| } | |||||
| List<UserStructureVo> wxallCountVos = new ArrayList<>();//累计会员数 | |||||
| c.clear(); | |||||
| c.setTime(today); | |||||
| c.add(Calendar.DAY_OF_YEAR, -daysBefore); | |||||
| dto.setEndTime(c.getTime()); | |||||
| dto.setStartTime(null); | |||||
| long firstDay = wxCUserService.findCount(dto);//统计的第一天总数 | |||||
| int i = 0; | |||||
| long sumCount = 0; | |||||
| for (UserStructureVo v : wxnewCountVos) { | |||||
| UserStructureVo vo = new UserStructureVo(); | |||||
| sumCount += v.getCount(); | |||||
| vo.setCount(firstDay + sumCount); | |||||
| vo.setName(v.getName()); | |||||
| vo.setSortNum(i + 1); | |||||
| wxallCountVos.add(vo); | |||||
| i++; | |||||
| } | |||||
| long wxTodayCount = wxCUserService.findCount(dto);//今天新增 | |||||
| long memTodayCount = wxCUserBasicInfoService.findCount(dto);//今天新增 | |||||
| map.put("wxTodayCount",wxTodayCount); | |||||
| map.put("memTodayCount",memTodayCount); | |||||
| //昨日同比 | |||||
| Map<String, Object> map = new HashMap<>(); | |||||
| //昨日同比 | //昨日同比 | ||||
| c.clear(); | c.clear(); | ||||
| c.setTime(today); | c.setTime(today); | ||||
| @@ -337,98 +326,136 @@ public class WxUserStructureController extends BaseController { | |||||
| dto.setStartTime(c.getTime()); | dto.setStartTime(c.getTime()); | ||||
| c.add(Calendar.DAY_OF_YEAR, 1); | c.add(Calendar.DAY_OF_YEAR, 1); | ||||
| dto.setEndTime(c.getTime()); | dto.setEndTime(c.getTime()); | ||||
| long yesterdayCount = wxCUserService.findCount(dto); | |||||
| if(yesterdayCount>0){ | |||||
| double yesterday=(double) (wxtodayCount-yesterdayCount)/yesterdayCount*100; | |||||
| long wxYesterdayCount = wxCUserService.findCount(dto); | |||||
| long memYesterdayCount = wxCUserBasicInfoService.findCount(dto); | |||||
| if (wxYesterdayCount > 0) { | |||||
| double yesterday = (double) (wxTodayCount - wxYesterdayCount) / wxYesterdayCount * 100; | |||||
| double zrhb = new BigDecimal(yesterday).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | double zrhb = new BigDecimal(yesterday).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | ||||
| map.put("wxhb",zrhb+"%"); | |||||
| }else{ | |||||
| map.put("wxhb","--%"); | |||||
| map.put("wxhb", zrhb + "%"); | |||||
| } else { | |||||
| map.put("wxhb", "--%"); | |||||
| } | |||||
| if (memYesterdayCount > 0) { | |||||
| double yesterday = (double) (wxTodayCount - memYesterdayCount) / memYesterdayCount * 100; | |||||
| double zrhb = new BigDecimal(yesterday).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | |||||
| map.put("memhb", zrhb + "%"); | |||||
| } else { | |||||
| map.put("memhb", "--%"); | |||||
| } | } | ||||
| map.put("wxallCount", wxallCount);//累计会员总数 | |||||
| map.put("wxtodayCount", wxtodayCount);//今日新增会员数 | |||||
| map.put("wxallCountVos", wxallCountVos);//累计会员列表( 日期和数量list) | |||||
| map.put("wxnewCountVos", wxnewCountVos);//新增会员列表(日期和数量list) | |||||
| map.putAll(member); | |||||
| return new ResultData(map); | |||||
| } | |||||
| private Map<String,Object> getMemberData(WxCUserBasicInfoDto dto) { | |||||
| final int daysBefore = 29; | |||||
| long allCount = wxCUserBasicInfoService.findCount(dto);//总量 | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.set(Calendar.HOUR_OF_DAY, 0); | |||||
| c.set(Calendar.MINUTE, 0); | |||||
| c.set(Calendar.SECOND, 0); | |||||
| Date today = c.getTime(); | |||||
| dto.setStartTime(today); | |||||
| dto.setEndTime(null); | |||||
| long todayCount = wxCUserBasicInfoService.findCount(dto);//今天新增 | |||||
| List<UserStructureVo> newCountVos = new ArrayList<>();//每日新增会员数 | |||||
| int j = 1; | |||||
| for (int i = daysBefore; i >= 0; i--) { | |||||
| c.clear(); | |||||
| c.setTime(today); | |||||
| c.add(Calendar.DAY_OF_YEAR, -i); | |||||
| dto.setStartTime(c.getTime()); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| dto.setEndTime(c.getTime()); | |||||
| long count = wxCUserBasicInfoService.findCount(dto); | |||||
| UserStructureVo vo = new UserStructureVo(); | |||||
| vo.setSortNum(j); | |||||
| j++; | |||||
| vo.setName(new SimpleDateFormat("MM/dd").format(dto.getStartTime())); | |||||
| vo.setCount(count); | |||||
| newCountVos.add(vo); | |||||
| if (startTime == null || endTime == null) { | |||||
| startTime = addMonth(new Date(), -1); | |||||
| endTime = new Date(); | |||||
| reportType = EnumUserCountReportType.DAY.getCode(); | |||||
| } | } | ||||
| List<UserStructureVo> allCountVos = new ArrayList<>();//累计会员数 | |||||
| c.clear(); | |||||
| c.setTime(today); | |||||
| c.add(Calendar.DAY_OF_YEAR, -daysBefore); | |||||
| dto.setEndTime(c.getTime()); | |||||
| dto.setStartTime(null); | |||||
| long firstDay = wxCUserBasicInfoService.findCount(dto);//统计的第一天总数 | |||||
| int i = 0; | |||||
| long sumCount = 0; | |||||
| for (UserStructureVo v : newCountVos) { | |||||
| UserStructureVo vo = new UserStructureVo(); | |||||
| sumCount += v.getCount(); | |||||
| vo.setCount(firstDay + sumCount); | |||||
| vo.setName(v.getName()); | |||||
| vo.setSortNum(i + 1); | |||||
| allCountVos.add(vo); | |||||
| i++; | |||||
| dto.setTenantId(getTenantId()); | |||||
| dto.setStartTime(startTime); | |||||
| dto.setEndTime(endTime); | |||||
| dto.setReportType(reportType); | |||||
| List<UserCountVo> wxCountList = new ArrayList<>();//每日新增会员数 | |||||
| List<UserCountVo> wxCounts = wxCUserService.findCountHistory(dto);//每日新增会员数 | |||||
| List<UserCountVo> memCountList = new ArrayList<>();//每日新增会员数 | |||||
| List<UserCountVo> memCounts = wxCUserBasicInfoService.findCountHistory(dto);//每日新增会员数 | |||||
| SimpleDateFormat sdf; | |||||
| SimpleDateFormat fsdf; | |||||
| if (reportType.equals(EnumUserCountReportType.YEAR.getCode())) { | |||||
| sdf = new SimpleDateFormat("yyyy"); | |||||
| fsdf = new SimpleDateFormat("yyyy"); | |||||
| }else if (reportType.equals(EnumUserCountReportType.MONTH.getCode())) { | |||||
| sdf = new SimpleDateFormat("yyyy-MM"); | |||||
| fsdf = new SimpleDateFormat("yyyy-MM"); | |||||
| }else { | |||||
| sdf = new SimpleDateFormat("yyyy-MM-dd"); | |||||
| fsdf = new SimpleDateFormat("MM-dd"); | |||||
| } | } | ||||
| Date curTime = new Date(startTime.getTime()); | |||||
| do { | |||||
| UserCountVo wxUc = new UserCountVo(); | |||||
| UserCountVo memUc = new UserCountVo(); | |||||
| wxUc.setReportTime(fsdf.format(curTime)); | |||||
| memUc.setReportTime(fsdf.format(curTime)); | |||||
| final Date ct = new Date(curTime.getTime()); | |||||
| if (ct.before(new Date()) || ct.equals(new Date())) { | |||||
| //用户 | |||||
| Optional<UserCountVo> opWxUserCountVo = | |||||
| wxCounts.stream().filter(md -> md.getReportTime().equals(sdf.format(ct))).findFirst(); | |||||
| if (opWxUserCountVo.isPresent()) { | |||||
| wxUc.setIncCount(opWxUserCountVo.get().getIncCount()); | |||||
| wxUc.setTotalCount(opWxUserCountVo.get().getTotalCount()); | |||||
| } else { | |||||
| wxUc.setIncCount(0L); | |||||
| wxUc.setTotalCount(0L); | |||||
| } | |||||
| Map<String, Object> map = new HashMap<>(); | |||||
| //昨日同比 | |||||
| c.clear(); | |||||
| c.setTime(today); | |||||
| c.add(Calendar.DAY_OF_YEAR, -1); | |||||
| dto.setStartTime(c.getTime()); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| dto.setEndTime(c.getTime()); | |||||
| long yesterdayCount = wxCUserService.findCount(dto); | |||||
| if(yesterdayCount>0){ | |||||
| double yesterday=(double) (todayCount-yesterdayCount)/yesterdayCount*100; | |||||
| double zrhb = new BigDecimal(yesterday).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | |||||
| map.put("hb",zrhb+"%"); | |||||
| }else{ | |||||
| map.put("hb","--%"); | |||||
| } | |||||
| //会员 | |||||
| Optional<UserCountVo> opMemUserCountVo = | |||||
| memCounts.stream().filter(md -> md.getReportTime().equals(sdf.format(ct))).findFirst(); | |||||
| if (opMemUserCountVo.isPresent()) { | |||||
| memUc.setIncCount(opMemUserCountVo.get().getIncCount()); | |||||
| memUc.setTotalCount(opMemUserCountVo.get().getTotalCount()); | |||||
| } else { | |||||
| memUc.setIncCount(0L); | |||||
| memUc.setTotalCount(0L); | |||||
| } | |||||
| } | |||||
| memCountList.add(memUc); | |||||
| wxCountList.add(wxUc); | |||||
| if (reportType.equals(EnumUserCountReportType.YEAR.getCode())) { | |||||
| curTime = addYear(curTime, 1); | |||||
| } else if (reportType.equals(EnumUserCountReportType.MONTH.getCode())) { | |||||
| curTime = addMonth(curTime, 1); | |||||
| } else { | |||||
| curTime = addDay(curTime, 1); | |||||
| } | |||||
| }while (curTime.before(endTime) || curTime.equals(endTime)); | |||||
| map.put("allCount", allCount);//累计会员总数 | |||||
| map.put("todayCount", todayCount);//今日新增会员数 | |||||
| map.put("allCountVos", allCountVos);//累计会员列表( 日期和数量list) | |||||
| map.put("newCountVos", newCountVos);//新增会员列表(日期和数量list) | |||||
| return map; | |||||
| if (wxCountList.size() > 0 | |||||
| && wxCountList.get(0).getTotalCount() != null | |||||
| && wxCountList.get(0).getTotalCount() == 0) { | |||||
| WxCUserBasicInfoDto pdto = new WxCUserBasicInfoDto(); | |||||
| pdto.setTenantId(getTenantId()); | |||||
| pdto.setEndTime(startTime); | |||||
| wxCountList.get(0).setTotalCount(wxCUserService.findCount(pdto)); | |||||
| } | |||||
| for (int i = 1; i < wxCountList.size(); i++){ | |||||
| if (wxCountList.get(i).getTotalCount() != null && | |||||
| wxCountList.get(i-1).getTotalCount() != null && | |||||
| wxCountList.get(i).getTotalCount() < wxCountList.get(i-1).getTotalCount()){ | |||||
| wxCountList.get(i).setTotalCount(wxCountList.get(i-1).getTotalCount()); | |||||
| } | |||||
| } | |||||
| if (memCountList.size() > 0 | |||||
| && memCountList.get(0).getTotalCount() != null | |||||
| && memCountList.get(0).getTotalCount() == 0) { | |||||
| WxCUserBasicInfoDto pdto = new WxCUserBasicInfoDto(); | |||||
| pdto.setTenantId(getTenantId()); | |||||
| pdto.setEndTime(startTime); | |||||
| memCountList.get(0).setTotalCount(wxCUserBasicInfoService.findCount(pdto)); | |||||
| } | |||||
| for (int i = 1; i < memCountList.size(); i++){ | |||||
| if ( memCountList.get(i).getTotalCount() != null && | |||||
| memCountList.get(i-1).getTotalCount() != null && | |||||
| memCountList.get(i).getTotalCount() < memCountList.get(i-1).getTotalCount()){ | |||||
| memCountList.get(i).setTotalCount(memCountList.get(i-1).getTotalCount()); | |||||
| } | |||||
| } | |||||
| map.put("wxCountList", wxCountList);//累计/新增用户列表( 日期和数量list) | |||||
| map.put("memCountList", memCountList);//累计/新增会员列表( 日期和数量list) | |||||
| return new ResultData(map); | |||||
| } | } | ||||
| @ApiOperation("拓客分析") | @ApiOperation("拓客分析") | ||||
| @GetMapping("/findUserByChannel") | @GetMapping("/findUserByChannel") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -90,7 +90,11 @@ public class KwBoxController extends BaseController { | |||||
| if (kwBox == null) | if (kwBox == null) | ||||
| return new ResultData(ErrorCode.DEVICE_NOT_FOUND); | return new ResultData(ErrorCode.DEVICE_NOT_FOUND); | ||||
| kwBox.setMeters(kwBoxService.findMeters(kwBox)); | |||||
| KwMeter kwMeter = new KwMeter(); | |||||
| kwMeter.setBoxId(kwBox.getId()); | |||||
| kwMeter.setBindStatus(EnumMeterBindStatus.BIND.getCode()); | |||||
| kwMeter.setStatus(EnumMeterStatus.VALID.getCode()); | |||||
| kwBox.setMeters(kwMeterService.findVoList(kwMeter)); | |||||
| return new ResultData(kwBox); | return new ResultData(kwBox); | ||||
| } | } | ||||
| @@ -5,14 +5,10 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.dto.KwMerchantMeterDto; | import com.iformall.domain.dto.KwMerchantMeterDto; | ||||
| import com.iformall.domain.dto.KwMeterDataDto; | |||||
| import com.iformall.domain.po.KwMerchantMeter; | import com.iformall.domain.po.KwMerchantMeter; | ||||
| import com.iformall.domain.po.KwMeter; | |||||
| import com.iformall.domain.vo.KwMerchantMeterVo; | import com.iformall.domain.vo.KwMerchantMeterVo; | ||||
| import com.iformall.enums.EnumMerchantMeterStatus; | import com.iformall.enums.EnumMerchantMeterStatus; | ||||
| import com.iformall.enums.EnumMerchantStatus; | |||||
| import com.iformall.service.kw.KwMerchantMeterService; | import com.iformall.service.kw.KwMerchantMeterService; | ||||
| import com.iformall.service.kw.KwMeterDataService; | import com.iformall.service.kw.KwMeterDataService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| @@ -24,8 +20,6 @@ import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.util.List; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("kwMerchantMeter") | @RequestMapping("kwMerchantMeter") | ||||
| @@ -107,4 +101,12 @@ public class KwMerchantMeterController extends BaseController { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation("商户电表列表") | |||||
| @GetMapping("getMechantMeter") | |||||
| @SystemControllerLog(description = "商户列表") | |||||
| public ResultData getMechantMeter() { | |||||
| return new ResultData(kwMerchantMeterService.getMerchantMeter(getTenantId())); | |||||
| } | |||||
| } | } | ||||
| @@ -17,6 +17,9 @@ import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | |||||
| /** | /** | ||||
| * Created by syf on 2018/8/29. | * Created by syf on 2018/8/29. | ||||
| */ | */ | ||||
| @@ -86,5 +89,13 @@ public class MarkingDataReportController extends BaseController { | |||||
| return new ResultData(markingDataReportService.getTouchUsersReportList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | return new ResultData(markingDataReportService.getTouchUsersReportList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | ||||
| } | } | ||||
| @ApiOperation("触达用户数数据导出") | |||||
| @GetMapping("/exportTouchUsersData") | |||||
| @SystemControllerLog(description = "券数据-触达用户数数据导出") | |||||
| public void exportTouchUsersData(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, HttpServletRequest request, HttpServletResponse response) { | |||||
| markingCouponDataReportDto.setTenantId(getTenantId()); | |||||
| markingDataReportService.exportTouchUsersData(request, response, markingCouponDataReportDto); | |||||
| } | |||||
| } | } | ||||
| @@ -6,6 +6,8 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.WxCouponSendConfig; | import com.iformall.domain.po.WxCouponSendConfig; | ||||
| import com.iformall.enums.EnumCouponSendSendType; | |||||
| import com.iformall.enums.EnumValidStatus; | |||||
| import com.iformall.service.WxCouponSendConfigService; | import com.iformall.service.WxCouponSendConfigService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| @@ -37,8 +39,13 @@ public class WxCouponSendConfigController extends BaseController { | |||||
| PageInfo<WxCouponSendConfig> page = wxCouponSendConfigService.listAsPage(wxCouponSendConfig, 1, 1); | PageInfo<WxCouponSendConfig> page = wxCouponSendConfigService.listAsPage(wxCouponSendConfig, 1, 1); | ||||
| if (page.getSize() > 0) { | if (page.getSize() > 0) { | ||||
| return new ResultData(page.getList().get(0)); | return new ResultData(page.getList().get(0)); | ||||
| } else { | |||||
| //配置不存在,添加默认配置(停用) | |||||
| wxCouponSendConfig.setRemark(EnumCouponSendSendType.getEnum(wxCouponSendConfig.getSendType()).getMessage() + "开关"); | |||||
| wxCouponSendConfig.setValue(1); | |||||
| wxCouponSendConfigService.saveOrUpdate(wxCouponSendConfig); | |||||
| return new ResultData(wxCouponSendConfig); | |||||
| } | } | ||||
| return new ResultData(); | |||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.controller.market; | package com.iformall.controller.market; | ||||
| import com.alibaba.fastjson.JSONObject; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| @@ -10,6 +11,7 @@ import com.iformall.domain.po.BaseEntity; | |||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import com.iformall.domain.po.WxCouponSend; | import com.iformall.domain.po.WxCouponSend; | ||||
| import com.iformall.domain.vo.WxCouponSendVo; | import com.iformall.domain.vo.WxCouponSendVo; | ||||
| import com.iformall.enums.EnumCouponSendSendType; | |||||
| import com.iformall.enums.EnumCouponSendStatus; | import com.iformall.enums.EnumCouponSendStatus; | ||||
| import com.iformall.enums.EnumCouponSendType; | import com.iformall.enums.EnumCouponSendType; | ||||
| import com.iformall.enums.EnumCouponStatus; | import com.iformall.enums.EnumCouponStatus; | ||||
| @@ -25,7 +27,9 @@ import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import javax.validation.constraints.NotNull; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.Objects; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCouponSend") | @RequestMapping("wxCouponSend") | ||||
| @@ -44,22 +48,52 @@ public class WxCouponSendController extends BaseController { | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "merchantName", value = "商户名,模糊查询", dataType = "String", paramType = "query"), | |||||
| @ApiImplicitParam(name = "merchantId", value = "商户Id", dataType = "String", paramType = "query"), | |||||
| }) | |||||
| @SystemControllerLog(description = "注券-列表") | @SystemControllerLog(description = "注券-列表") | ||||
| public ResultData list(@ModelAttribute WxCouponSend wxCouponSend, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxCouponSend wxCouponSend, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCouponSendController::list"); | logger.debug("[" + getIpAddr() + "] WxCouponSendController::list"); | ||||
| if (null == wxCouponSend) wxCouponSend = new WxCouponSend(); | if (null == wxCouponSend) wxCouponSend = new WxCouponSend(); | ||||
| wxCouponSend.setTenantId(getTenantId()); | wxCouponSend.setTenantId(getTenantId()); | ||||
| wxCouponSend.setStatus(EnumCouponSendStatus.VALID.getCode()); | |||||
| wxCouponSend.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||||
| final PageInfo<WxCouponSendVo> page = wxCouponSendService.listAsPage(wxCouponSend, pageNum, pageSize); | |||||
| for (WxCouponSendVo cs:page.getList()) | |||||
| cs.setSendCount(wxCouponActionLogService.getCountByChannelId(getTenantId(), cs.getSendType(), cs.getId())); | |||||
| // if (Objects.equals(EnumCouponSendSendType.MERCHANT.getCode(), wxCouponSend.getSendType())) { | |||||
| // if (Objects.nonNull(wxCouponSend.getStatus())) { | |||||
| // valid = wxCouponSend.getStatus(); | |||||
| // } else { | |||||
| // wxCouponSend.setStatus(null); | |||||
| // } | |||||
| // } | |||||
| PageInfo<WxCouponSendVo> page = wxCouponSendService.listAsPage(wxCouponSend, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("注券-添加配置") | |||||
| @GetMapping("config/add") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "beforeDays", value = "提前n天发券", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "sendType", value = "注券类型(生日券=8)", dataType = "int", paramType = "query", required = true), | |||||
| }) | |||||
| @SystemControllerLog(description = "注券-添加或更新配置") | |||||
| public ResultData addConfig(@NotNull Integer beforeDays, @NotNull Integer sendType) { | |||||
| if(!Objects.equals(sendType,EnumCouponSendSendType.BIRTHDAY.getCode())) { | |||||
| return new ResultData(ErrorCode.COUPON_VALID_NOT_SUPPORTED); | |||||
| } | |||||
| wxCouponSendService.saveOrUpdateConfig(beforeDays, sendType, getTenantId()); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("注券-获取配置") | |||||
| @GetMapping("config/get") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "sendType", value = "注券类型(生日券=8)", dataType = "int", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "注券-获取配置") | |||||
| public ResultData getConfig(@NotNull Integer sendType) { | |||||
| WxCouponSend wxCouponSend = wxCouponSendService.getConfig(sendType, getTenantId()); | |||||
| return new ResultData(Objects.isNull(wxCouponSend) ? null : wxCouponSend.getConditions()); | |||||
| } | |||||
| @ApiOperation("新增接口") | @ApiOperation("新增接口") | ||||
| @PostMapping("add") | @PostMapping("add") | ||||
| @SystemControllerLog(description = "注券-新增") | @SystemControllerLog(description = "注券-新增") | ||||
| @@ -68,18 +102,19 @@ public class WxCouponSendController extends BaseController { | |||||
| if (null == wxCouponSend) { | if (null == wxCouponSend) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | ||||
| } | } | ||||
| WxCoupon wxCoupon = wxCouponService.getById(wxCouponSend.getCouponId()); | WxCoupon wxCoupon = wxCouponService.getById(wxCouponSend.getCouponId()); | ||||
| if (!wxCoupon.getStatus().equals(EnumCouponStatus.COUPON_STATUS_THROW_IN.getCode()) ){ | |||||
| if (!EnumCouponStatus.COUPON_STATUS_THROW_IN.getCode().equals(wxCoupon.getStatus())) { | |||||
| return new ResultData(ErrorCode.COUPON_IS_TAKE_OFF); | return new ResultData(ErrorCode.COUPON_IS_TAKE_OFF); | ||||
| } | } | ||||
| if (!wxCoupon.getSendType().equals(EnumCouponSendType.PASSIVE.getCode())) { | |||||
| if (!EnumCouponSendType.PASSIVE.getCode().equals(wxCoupon.getSendType())) { | |||||
| return new ResultData(ErrorCode.COUPON_TYPE_IS_NOT_PASSIVE); | return new ResultData(ErrorCode.COUPON_TYPE_IS_NOT_PASSIVE); | ||||
| } | } | ||||
| wxCouponSend.setTenantId(wxCoupon.getTenantId()); | wxCouponSend.setTenantId(wxCoupon.getTenantId()); | ||||
| wxCouponSend.setTitle(wxCoupon.getTitle()); | wxCouponSend.setTitle(wxCoupon.getTitle()); | ||||
| wxCouponSend.setCreateDate(new Date()); | wxCouponSend.setCreateDate(new Date()); | ||||
| wxCouponSend.setUpdateDate(new Date()); | wxCouponSend.setUpdateDate(new Date()); | ||||
| @@ -87,28 +122,30 @@ public class WxCouponSendController extends BaseController { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| @SystemControllerLog(description = "注券-更新") | |||||
| public ResultData update(@RequestBody WxCouponSend wxCouponSend) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponSendController::update"); | |||||
| wxCouponSend.setTenantId(getTenantId()); | |||||
| wxCouponSendService.saveOrUpdate(wxCouponSend); | |||||
| return new ResultData(); | |||||
| } | |||||
| // @ApiOperation("根据id更新接口") | |||||
| // @PostMapping("update") | |||||
| // @SystemControllerLog(description = "注券-更新") | |||||
| // public ResultData update(@RequestBody WxCouponSend wxCouponSend) { | |||||
| // logger.debug("[" + getIpAddr() + "] WxCouponSendController::update"); | |||||
| // wxCouponSend.setTenantId(getTenantId()); | |||||
| // wxCouponSendService.saveOrUpdate(wxCouponSend); | |||||
| // return new ResultData(); | |||||
| // } | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "sendType", value = "注券类型(会员生日券时必传)", dataType = "int", paramType = "query") | |||||
| }) | |||||
| @SystemControllerLog(description = "注券-删除") | @SystemControllerLog(description = "注券-删除") | ||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCouponSendController::delete"); | logger.debug("[" + getIpAddr() + "] WxCouponSendController::delete"); | ||||
| WxCouponSend wxCouponSend = wxCouponSendService.getById(id); | WxCouponSend wxCouponSend = wxCouponSendService.getById(id); | ||||
| if (wxCouponSend == null) | |||||
| if (wxCouponSend == null) { | |||||
| return new ResultData(ErrorCode.COUPON_SEND_IS_INVALID); | return new ResultData(ErrorCode.COUPON_SEND_IS_INVALID); | ||||
| wxCouponSend.setStatus(EnumCouponSendStatus.INVALID.getCode()); | |||||
| wxCouponSend.setUpdateDate(new Date()); | |||||
| wxCouponSendService.saveOrUpdate(wxCouponSend); | |||||
| } | |||||
| wxCouponSendService.updateInvalid(wxCouponSend); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -0,0 +1,85 @@ | |||||
| package com.iformall.controller.market; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| 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.WxMerchantPowerBillConfig; | |||||
| import com.iformall.service.WxMerchantPowerBillConfigService; | |||||
| 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("wxMerchantPowerBillConfig") | |||||
| @Api(description = "商户电费生成配置") | |||||
| public class WxMerchantPowerBillConfigController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxMerchantPowerBillConfigService wxMerchantPowerBillConfigService; | |||||
| @ApiOperation("查询数据列表") | |||||
| @GetMapping("/list") | |||||
| @SystemControllerLog(description = "查询数据列表") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData findCouponDataList(@ModelAttribute WxMerchantPowerBillConfig wxMerchantPowerBillConfig, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantPowerBillConfigController::list"); | |||||
| wxMerchantPowerBillConfig.setTenantId(getTenantId()); | |||||
| wxMerchantPowerBillConfig.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||||
| final PageInfo<WxMerchantPowerBillConfig> page = wxMerchantPowerBillConfigService.listAsPage(wxMerchantPowerBillConfig, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增") | |||||
| @PostMapping("/add") | |||||
| @SystemControllerLog(description = "新增") | |||||
| public ResultData add(@RequestBody WxMerchantPowerBillConfig wxMerchantPowerBillConfig) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantPowerBillConfigController::add"); | |||||
| return wxMerchantPowerBillConfigService.saveOrUpdate(wxMerchantPowerBillConfig); | |||||
| } | |||||
| @ApiOperation("更新") | |||||
| @PostMapping("/update") | |||||
| @SystemControllerLog(description = "更新") | |||||
| public ResultData update(@RequestBody WxMerchantPowerBillConfig wxMerchantPowerBillConfig) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantPowerBillConfigController::update"); | |||||
| return wxMerchantPowerBillConfigService.saveOrUpdate(wxMerchantPowerBillConfig); | |||||
| } | |||||
| @ApiOperation("删除") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "删除") | |||||
| public ResultData delete(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantPowerBillConfigController::delete"); | |||||
| wxMerchantPowerBillConfigService.deleteById(id); | |||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||||
| } | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "id查询") | |||||
| public ResultData findById(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantPowerBillConfigController::findById"); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxMerchantPowerBillConfigService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,67 @@ | |||||
| package com.iformall.controller.market; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| 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.WxPowerBillAutoConfig; | |||||
| import com.iformall.service.WxPowerBillAutoConfigService; | |||||
| 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("wxPowerBillAutoConfig") | |||||
| @Api(description = "电费自动生成配置") | |||||
| public class WxPowerBillAutoConfigController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxPowerBillAutoConfigService wxPowerBillAutoConfigService; | |||||
| @ApiOperation("查询数据列表") | |||||
| @GetMapping("/list") | |||||
| @SystemControllerLog(description = "查询数据列表") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData findCouponDataList(@ModelAttribute WxPowerBillAutoConfig wxPowerBillAutoConfig, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxPowerBillAutoConfigController::list"); | |||||
| wxPowerBillAutoConfig.setTenantId(getTenantId()); | |||||
| wxPowerBillAutoConfig.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||||
| final PageInfo<WxPowerBillAutoConfig> page = wxPowerBillAutoConfigService.listAsPage(wxPowerBillAutoConfig, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("修改") | |||||
| @PostMapping("/modify") | |||||
| @SystemControllerLog(description = "修改") | |||||
| public ResultData add(@RequestBody WxPowerBillAutoConfig wxPowerBillAutoConfig) { | |||||
| logger.debug("[" + getIpAddr() + "] WxPowerBillAutoConfigController::modify"); | |||||
| return wxPowerBillAutoConfigService.modify(wxPowerBillAutoConfig); | |||||
| } | |||||
| @ApiOperation("得到配置信息") | |||||
| @GetMapping("/getConfig") | |||||
| @SystemControllerLog(description = "id查询") | |||||
| public ResultData getConfig() { | |||||
| logger.debug("[" + getIpAddr() + "] WxPowerBillAutoConfigController::getConfig"); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxPowerBillAutoConfigService.getConfig(getTenantId())); | |||||
| } | |||||
| } | |||||
| @@ -26,6 +26,7 @@ import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| import java.io.File; | import java.io.File; | ||||
| import java.math.BigDecimal; | |||||
| import java.util.*; | import java.util.*; | ||||
| import java.util.concurrent.TimeUnit; | import java.util.concurrent.TimeUnit; | ||||
| import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
| @@ -153,7 +154,7 @@ public class ImportTemplateTask { | |||||
| public void importBillDataOther(File file, MallUserInfo user, String importKey, String tenantId) { | public void importBillDataOther(File file, MallUserInfo user, String importKey, String tenantId) { | ||||
| ImportParams params = new ImportParams(); | ImportParams params = new ImportParams(); | ||||
| // 需要验证 | // 需要验证 | ||||
| params.setImportFields(new String[]{"商户名*", "费用类型*", "费用名称*", "费用所属期-开始时间*", "费用所属期-结束时间*", "实际应收金额(元)*", "收款金额(元)*", "收款日期*", "截止缴款日*", "收款方式"}); | |||||
| params.setImportFields(new String[]{"商户名*", "费用类型*", "费用名称*", "费用所属期-开始时间*", "费用所属期-结束时间*", "实际应收金额(元)*", "收款金额(元)*", "收款日期", "截止缴款日*", "收款方式"}); | |||||
| params.setNeedVerify(true); | params.setNeedVerify(true); | ||||
| ExcelImportResult<WxBillExcelTemplateOther> datalist = null; | ExcelImportResult<WxBillExcelTemplateOther> datalist = null; | ||||
| @@ -199,19 +200,24 @@ public class ImportTemplateTask { | |||||
| //3 计失败条数 | //3 计失败条数 | ||||
| List<WxBillExcelTemplateOther> billSuccessList = new ArrayList<>(); | List<WxBillExcelTemplateOther> billSuccessList = new ArrayList<>(); | ||||
| successList.parallelStream().forEach(s -> { | successList.parallelStream().forEach(s -> { | ||||
| if (StringUtils.isNotEmpty(s.getMerchantName()) && null != s.getBillType() | |||||
| boolean flag = StringUtils.isNotEmpty(s.getMerchantName()) && null != s.getBillType() | |||||
| && StringUtils.isNotEmpty(s.getBillAttr()) && null != s.getStarttime() | && StringUtils.isNotEmpty(s.getBillAttr()) && null != s.getStarttime() | ||||
| && null != s.getEndtime() && StringUtils.isNotEmpty(s.getPayStr()) | && null != s.getEndtime() && StringUtils.isNotEmpty(s.getPayStr()) | ||||
| && null != s.getPayDate() && null != s.getReceiveDate() | |||||
| && StringUtils.isNotEmpty(s.getReceivePayStr())) { | |||||
| WxMerchant wxMerchant = merchantMap.get(s.getMerchantName()); | |||||
| if (wxMerchant != null) { | |||||
| Long merchantId = wxMerchant.getId(); | |||||
| if (merchantId != null) { | |||||
| s.setMerchantId(merchantId); | |||||
| Integer type = wxMerchant.getType(); | |||||
| s.setMerchantType(type); | |||||
| billSuccessList.add(s); | |||||
| && null != s.getReceiveDate() && StringUtils.isNotEmpty(s.getReceivePayStr()); | |||||
| if (flag) { | |||||
| double pay = new BigDecimal(s.getPayStr()).doubleValue(); | |||||
| //付款大于0且付款日期不为空说明是更新账单 或者 付款为0且付款日期为空是新增账单 满足其一即可继续 | |||||
| flag = (pay > 0 && null != s.getPayDate()) || (pay == 0 && null == s.getPayDate()); | |||||
| if (flag) { | |||||
| WxMerchant wxMerchant = merchantMap.get(s.getMerchantName()); | |||||
| if (wxMerchant != null) { | |||||
| Long merchantId = wxMerchant.getId(); | |||||
| if (merchantId != null) { | |||||
| s.setMerchantId(merchantId); | |||||
| Integer type = wxMerchant.getType(); | |||||
| s.setMerchantType(type); | |||||
| billSuccessList.add(s); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -46,11 +46,12 @@ public class WxCreditHistoryController extends BaseController { | |||||
| @GetMapping("findByMerchantIdAndSpend") | @GetMapping("findByMerchantIdAndSpend") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "merchantId", value = "商户ID", dataType = "long", paramType = "query", required = true), | @ApiImplicitParam(name = "merchantId", value = "商户ID", dataType = "long", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "spend", value = "消费金额", dataType = "int", paramType = "query", required = true)}) | |||||
| @ApiImplicitParam(name = "spend", value = "消费金额", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "userId", value = "会员Id", dataType = "long", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "积分历史-根据商户ID和消费金额获取所增加积分") | @SystemControllerLog(description = "积分历史-根据商户ID和消费金额获取所增加积分") | ||||
| public ResultData findByMerchantIdAndSpend(@RequestParam Long merchantId, @RequestParam String spendStr) { | |||||
| public ResultData findByMerchantIdAndSpend(@RequestParam Long merchantId, @RequestParam String spendStr,@RequestParam Long userId) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCreditHistoryController::findByMerchantIdAndSpend"); | logger.debug("[" + getIpAddr() + "] WxCreditHistoryController::findByMerchantIdAndSpend"); | ||||
| return new ResultData(wxCreditHistoryService.findByMerchantIdAndSpend(merchantId, spendStr, getTenantId())); | |||||
| return new ResultData(wxCreditHistoryService.findByMerchantIdAndSpend(merchantId, spendStr, userId,getTenantId())); | |||||
| } | } | ||||
| @ApiOperation("新增接口") | @ApiOperation("新增接口") | ||||
| @@ -97,4 +98,13 @@ public class WxCreditHistoryController extends BaseController { | |||||
| wxCreditHistoryService.exportData(request, response, wxCreditHistory); | wxCreditHistoryService.exportData(request, response, wxCreditHistory); | ||||
| } | } | ||||
| @ApiOperation("积分统计概览") | |||||
| @GetMapping("getCreditSummary") | |||||
| @SystemControllerLog(description = "积分历史-积分统计概览") | |||||
| public ResultData getCreditSummary(@ModelAttribute WxCreditHistory wxCreditHistory) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCreditHistoryController::getCreditSummary"); | |||||
| wxCreditHistory.setTenantId(getTenantId()); | |||||
| return wxCreditHistoryService.getCreditSummary(wxCreditHistory); | |||||
| } | |||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.controller.rent; | package com.iformall.controller.rent; | ||||
| import com.alibaba.fastjson.JSONArray; | |||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| @@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.*; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.util.ArrayList; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| /** | /** | ||||
| @@ -51,10 +53,37 @@ public class WxBillAllController extends BaseController { | |||||
| wxBillAll = new WxBillAll(); | wxBillAll = new WxBillAll(); | ||||
| } | } | ||||
| wxBillAll.setTenantId(getTenantId()); | wxBillAll.setTenantId(getTenantId()); | ||||
| if(StringUtils.isNotBlank(wxBillAll.getStatusListStr())){ | |||||
| wxBillAll.setStatusList(new ArrayList<>()); | |||||
| JSONArray jsonArray = JSONArray.parseArray(wxBillAll.getStatusListStr()); | |||||
| for (int i = 0; i <jsonArray.size() ; i++) { | |||||
| Integer o = (Integer) jsonArray.get(i); | |||||
| wxBillAll.getStatusList().add(o); | |||||
| } | |||||
| } | |||||
| if(StringUtils.isNotBlank(wxBillAll.getTypeListStr())){ | |||||
| wxBillAll.setTypeList(new ArrayList<>()); | |||||
| JSONArray jsonArray = JSONArray.parseArray(wxBillAll.getTypeListStr()); | |||||
| for (int i = 0; i <jsonArray.size() ; i++) { | |||||
| Integer o = (Integer) jsonArray.get(i); | |||||
| wxBillAll.getTypeList().add(o); | |||||
| } | |||||
| } | |||||
| Map<String, Object> result = wxBillAllService.listAsPage(wxBillAll, pageNum, pageSize); | Map<String, Object> result = wxBillAllService.listAsPage(wxBillAll, pageNum, pageSize); | ||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| @GetMapping("allDepositList") | |||||
| @SystemControllerLog(description = "账单总览-所有押金列表") | |||||
| public ResultData allDepositList(@ModelAttribute WxBillAll wxBillAll) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillAllController::allDepositList"); | |||||
| if (null == wxBillAll) { | |||||
| wxBillAll = new WxBillAll(); | |||||
| } | |||||
| wxBillAll.setTenantId(getTenantId()); | |||||
| return new ResultData(wxBillAllService.allDepositList(wxBillAll)); | |||||
| } | |||||
| @GetMapping("exportBill") | @GetMapping("exportBill") | ||||
| @SystemControllerLog(description = "账单总览-导出") | @SystemControllerLog(description = "账单总览-导出") | ||||
| public void exportBill(@ModelAttribute WxBillAll wxBillAll, HttpServletRequest request, HttpServletResponse response) { | public void exportBill(@ModelAttribute WxBillAll wxBillAll, HttpServletRequest request, HttpServletResponse response) { | ||||
| @@ -97,6 +126,46 @@ public class WxBillAllController extends BaseController { | |||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| /** | |||||
| * 应收、承付商户列表 | |||||
| * @param wxBillAll | |||||
| * @param pageNum | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| @GetMapping("receiveAndPayMerchantlist") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "账单管理-应收、承付商户列表") | |||||
| @ApiOperation("应收、承付商户列表") | |||||
| public ResultData receiveAndPayMerchantlist(@ModelAttribute WxBillAll wxBillAll, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillAllController::receiveAndPayMerchantlist"); | |||||
| if (null == wxBillAll) { | |||||
| wxBillAll = new WxBillAll(); | |||||
| } | |||||
| wxBillAll.setTenantId(getTenantId()); | |||||
| Map<String, Object> result = wxBillAllService.getReceiveAndPayBillAsPage(wxBillAll, pageNum, pageSize); | |||||
| return new ResultData(result); | |||||
| } | |||||
| /** | |||||
| * 导出应收、承付商户列表 | |||||
| * @param wxBillAll | |||||
| * @return | |||||
| */ | |||||
| @GetMapping("exportReceiveAndPayMerchantlist") | |||||
| @SystemControllerLog(description = "账单管理-导出应收、承付商户列表") | |||||
| @ApiOperation("导出应收、承付商户列表") | |||||
| public void exportReceiveAndPayMerchantlist(@ModelAttribute WxBillAll wxBillAll,HttpServletRequest request, HttpServletResponse response) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillAllController::exportReceiveAndPayMerchantlist"); | |||||
| if (null == wxBillAll) { | |||||
| wxBillAll = new WxBillAll(); | |||||
| } | |||||
| wxBillAll.setTenantId(getTenantId()); | |||||
| wxBillAllService.exportReceiveAndPayBillAsPage(wxBillAll, request,response); | |||||
| } | |||||
| @ApiOperation("导出欠缴商户列表") | @ApiOperation("导出欠缴商户列表") | ||||
| @GetMapping("/exportOweMerchantlist") | @GetMapping("/exportOweMerchantlist") | ||||
| @@ -10,6 +10,7 @@ import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.controller.mem.BillDailyAsyncTask; | import com.iformall.controller.mem.BillDailyAsyncTask; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxBillDaily; | import com.iformall.domain.po.WxBillDaily; | ||||
| import com.iformall.enums.EnumBillDailyBuildWay; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxBillDailyService; | import com.iformall.service.WxBillDailyService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| @@ -75,6 +76,7 @@ public class WxBillDailyController extends BaseController { | |||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxBillDaily.setTenantId(user.getTenantId()); | wxBillDaily.setTenantId(user.getTenantId()); | ||||
| wxBillDaily.setUserId(user.getId()); | wxBillDaily.setUserId(user.getId()); | ||||
| wxBillDaily.setBuildWay(EnumBillDailyBuildWay.HAND.getCode()); | |||||
| return wxBillDailyService.saveOrUpdate(wxBillDaily, user); | return wxBillDailyService.saveOrUpdate(wxBillDaily, user); | ||||
| } | } | ||||
| @@ -0,0 +1,96 @@ | |||||
| package com.iformall.controller.rent; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| 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.WxBillSettle; | |||||
| import com.iformall.domain.po.WxBillSettleRecord; | |||||
| import com.iformall.service.WxBillAllService; | |||||
| import com.iformall.service.WxBillSettleRecordService; | |||||
| import com.iformall.service.WxBillSettleService; | |||||
| 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.*; | |||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | |||||
| /** | |||||
| * @author luozukai | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("wxBillSettle") | |||||
| public class WxBillSettleController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxBillSettleService wxBillSettleService; | |||||
| @Autowired | |||||
| private WxBillSettleRecordService wxBillSettleRecordService; | |||||
| @Autowired | |||||
| private WxBillAllService wxBillAllService; | |||||
| @GetMapping("list") | |||||
| @ApiOperation("账单管理-结算对冲列表") | |||||
| @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 WxBillSettle wxBillSettle, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillSettleController::list"); | |||||
| if (null == wxBillSettle) { | |||||
| wxBillSettle = new WxBillSettle(); | |||||
| } | |||||
| wxBillSettle.setTenantId(getTenantId()); | |||||
| wxBillSettle.setSortColumns(BaseEntity.SortField.Createtime_DESC,BaseEntity.SortField.Id_DESC); | |||||
| final PageInfo<WxBillSettle> page = wxBillSettleService.listAsPage(wxBillSettle, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| @ApiOperation("账单管理-结算单-id查找") | |||||
| @SystemControllerLog(description = "账单管理-结算单-id查找") | |||||
| public ResultData findById(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillSettleController::findById"); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxBillSettleService.getById(id)); | |||||
| } | |||||
| @PostMapping("addOrUpdate") | |||||
| @ApiOperation("账单管理-结算单-新增或编辑") | |||||
| @SystemControllerLog(description = "账单管理-结算单-新增或编辑") | |||||
| public ResultData addOrUpdate(@RequestBody WxBillSettle wxBillSettle) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillSettleController::addOrUpdate"); | |||||
| wxBillSettle.setTenantId(getTenantId()); | |||||
| return wxBillSettleService.saveOrUpdate(wxBillSettle,getUser()); | |||||
| } | |||||
| @PostMapping("settle") | |||||
| @ApiOperation("账单管理-结算单-结算") | |||||
| @SystemControllerLog(description = "账单管理-结算单-结算") | |||||
| public ResultData settle(@RequestBody WxBillSettleRecord wxBillSettleRecord) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillSettleController::settle"); | |||||
| wxBillSettleRecord.setTenantId(getTenantId()); | |||||
| return wxBillSettleRecordService.saveOrUpdate(wxBillSettleRecord,getUser(),null); | |||||
| } | |||||
| @GetMapping("exportSettle") | |||||
| @SystemControllerLog(description = "账单管理-结算单-导出") | |||||
| public void exportBill(@ModelAttribute WxBillSettle wxBillSettle, HttpServletRequest request, HttpServletResponse response) { | |||||
| wxBillSettle.setTenantId(getTenantId()); | |||||
| wxBillSettleService.exportBill(request, response, wxBillSettle); | |||||
| } | |||||
| @GetMapping("downloadSettle") | |||||
| @SystemControllerLog(description = "账单管理-结算单-下载") | |||||
| public void downloadSettle(@ModelAttribute WxBillSettle wxBillSettle, HttpServletRequest request, HttpServletResponse response) { | |||||
| wxBillSettle.setTenantId(getTenantId()); | |||||
| wxBillAllService.exportSettleBill(wxBillSettle,request,response); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,57 @@ | |||||
| package com.iformall.controller.sys; | |||||
| 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.WxDataRuleTarget; | |||||
| import com.iformall.service.WxDataRuleTargetService; | |||||
| 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.GetMapping; | |||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import java.util.List; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("wxDataRuleTarget") | |||||
| @Api(description = "数据权限目标") | |||||
| public class WxDataRuleTargetController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxDataRuleTargetService wxDataRuleTargetService; | |||||
| @ApiOperation("列表接口") | |||||
| @GetMapping("list") | |||||
| @SystemControllerLog(description = "数据权限目标-列表接口") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxDataRuleTarget wxDataRuleTarget, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] wxDataRuleTarget::list"); | |||||
| final PageInfo<WxDataRuleTarget> page = wxDataRuleTargetService.listAsPage(wxDataRuleTarget, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("获取全部") | |||||
| @GetMapping("getList") | |||||
| @SystemControllerLog(description = "数据权限目标-获取全部") | |||||
| public ResultData getList() { | |||||
| logger.debug("[" + getIpAddr() + "] wxDataRuleTarget::getList"); | |||||
| List<WxDataRuleTarget> datalist = wxDataRuleTargetService.getList(); | |||||
| return new ResultData(datalist); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,56 @@ | |||||
| package com.iformall.controller.sys; | |||||
| 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.MallUserInfo; | |||||
| import com.iformall.domain.po.WxUserDataRule; | |||||
| import com.iformall.enums.EnumUserAdmin; | |||||
| import com.iformall.service.WxUserDataRuleService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| 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("wxUserDataRule") | |||||
| @Api(description = "用户数据权限") | |||||
| public class WxUserDataRuleController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxUserDataRuleService wxUserDataRuleService; | |||||
| @ApiOperation("编辑") | |||||
| @PostMapping("/modify") | |||||
| @SystemControllerLog(description = "用户数据权限-新增") | |||||
| public ResultData modify(@RequestBody WxUserDataRule wxUserDataRule) { | |||||
| logger.debug("[" + getIpAddr() + "] wxDataRuleTarget::modify"); | |||||
| MallUserInfo currentUser = getUser(); | |||||
| // 系统管理员才能修改信息 | |||||
| if (!currentUser.getIsAdmin().equals(EnumUserAdmin.ADMIN.getCode())) { | |||||
| return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "系统管理员才能修改信息"); | |||||
| } | |||||
| wxUserDataRuleService.modify(wxUserDataRule); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据用户ID查看") | |||||
| @GetMapping("/findByUserId") | |||||
| @ApiImplicitParam(name = "userId", value = "userId", dataType = "Long", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "用户数据权限-根据用户ID查看") | |||||
| public ResultData findByUserId(Long userId) { | |||||
| logger.debug("[" + getIpAddr() + "] wxDataRuleTarget::modify"); | |||||
| WxUserDataRule wxUserDataRule = wxUserDataRuleService.findByUserId(userId); | |||||
| return new ResultData(wxUserDataRule); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,108 @@ | |||||
| 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.MallUserInfo; | |||||
| import com.iformall.domain.po.WxUserDataRule; | |||||
| import com.iformall.mapper.WxRentContractMapper; | |||||
| import com.iformall.service.WxUserDataRuleService; | |||||
| import com.iformall.shiro.UserSession; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.aspectj.lang.JoinPoint; | |||||
| import org.aspectj.lang.annotation.Aspect; | |||||
| import org.aspectj.lang.annotation.Before; | |||||
| import org.aspectj.lang.annotation.Pointcut; | |||||
| import org.aspectj.lang.reflect.MethodSignature; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Component; | |||||
| import org.springframework.web.context.request.RequestContextHolder; | |||||
| import org.springframework.web.context.request.ServletRequestAttributes; | |||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import java.lang.reflect.Method; | |||||
| import java.util.HashSet; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| @Aspect | |||||
| @Component | |||||
| public class UserDataRuleAspect { | |||||
| private static final Logger logger = LoggerFactory.getLogger(UserDataRuleAspect.class); | |||||
| @Autowired | |||||
| private WxUserDataRuleService wxUserDataRuleService; | |||||
| @Autowired | |||||
| private WxRentContractMapper wxRentContractMapper; | |||||
| @Pointcut("@annotation(com.iformall.annotation.UserDataRuleAnnotation)") | |||||
| public void userDataRulePointcut() { | |||||
| } | |||||
| @Before("userDataRulePointcut()") | |||||
| public void doBefore(JoinPoint joinPoint) { | |||||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |||||
| MallUserInfo user = (MallUserInfo) request.getSession().getAttribute(UserSession.userInfo); | |||||
| if (user == null) { | |||||
| logger.error("session 获取 user 失败"); | |||||
| return; | |||||
| } | |||||
| //得到用户的数据权限 | |||||
| WxUserDataRule byUserId = wxUserDataRuleService.findByUserId(user.getId()); | |||||
| if (byUserId == null) { | |||||
| logger.info("用户的数据权限未配置"); | |||||
| return; | |||||
| } | |||||
| String buildingFloor = byUserId.getBuildingFloor(); | |||||
| if (StringUtils.isNotEmpty(buildingFloor)) { | |||||
| Object[] data = JSONArray.parseArray(buildingFloor).toArray(); | |||||
| buildingFloor = StringUtils.join(data, ","); | |||||
| } | |||||
| String businessForRule = byUserId.getBusiness(); | |||||
| if (StringUtils.isNotEmpty(businessForRule)) { | |||||
| Object[] data = JSONArray.parseArray(businessForRule).toArray(); | |||||
| businessForRule = StringUtils.join(data, ","); | |||||
| } | |||||
| HashSet<String> targetSet = new HashSet(); | |||||
| String target = byUserId.getTarget(); | |||||
| if (StringUtils.isNotEmpty(target)) { | |||||
| JSONArray objects = JSONArray.parseArray(target); | |||||
| for (int i = 0; i < objects.size(); i++) { | |||||
| JSONObject jsonObject = objects.getJSONObject(i); | |||||
| targetSet.add(jsonObject.getString("tag")); | |||||
| } | |||||
| } | |||||
| //得到注释的名称 | |||||
| MethodSignature signature = (MethodSignature) joinPoint.getSignature(); | |||||
| //判断tag是否在用户权限中 如果存在加入参数查询 | |||||
| Method method = signature.getMethod(); | |||||
| String value = method.getAnnotation(UserDataRuleAnnotation.class).value(); | |||||
| if (targetSet.contains(value)) { | |||||
| //得到方法的参数 | |||||
| Object[] args = joinPoint.getArgs(); | |||||
| if (args[0] instanceof BaseEntity) { | |||||
| BaseEntity baseEntity = (BaseEntity) args[0]; | |||||
| baseEntity.setFloorForRule(buildingFloor); | |||||
| baseEntity.setBusinessForRule(businessForRule); | |||||
| String contract = "contract"; | |||||
| if (StringUtils.isNotEmpty(buildingFloor) && value.contains(contract)) { | |||||
| int count = wxRentContractMapper.getShopCountMax(); | |||||
| String[] tempShop = new String[count]; | |||||
| baseEntity.setTempShop(tempShop); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -20,14 +20,16 @@ public class PasswordHelper { | |||||
| } | } | ||||
| /* | |||||
| public static void main(String[] args) { | public static void main(String[] args) { | ||||
| MallUserInfo user = new MallUserInfo(); | MallUserInfo user = new MallUserInfo(); | ||||
| user.setUsername("fmkjadmin"); | |||||
| user.setPassword("fmkjadmin790"); | |||||
| user.setUsername("admin"); | |||||
| user.setPassword("admin123"); | |||||
| PasswordHelper passwordHelper = new PasswordHelper(); | PasswordHelper passwordHelper = new PasswordHelper(); | ||||
| passwordHelper.encryptPassword(user); | passwordHelper.encryptPassword(user); | ||||
| System.out.println(user); | System.out.println(user); | ||||
| System.out.println(user.getPassword()); | System.out.println(user.getPassword()); | ||||
| } | } | ||||
| */ | |||||
| } | } | ||||
| @@ -75,6 +75,9 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| if ("wx_msg_record".equals(tableName)) { | if ("wx_msg_record".equals(tableName)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| if ("wx_data_rule_target".equals(tableName)) { | |||||
| return true; | |||||
| } | |||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -126,6 +129,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| return true; | return true; | ||||
| if ("com.iformall.mapper.WxBillPropertyMapper.insertBillAction".equals(ms.getId())) | if ("com.iformall.mapper.WxBillPropertyMapper.insertBillAction".equals(ms.getId())) | ||||
| return true; | return true; | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,3 +0,0 @@ | |||||
| alter table `wx_shop` | |||||
| add column business int(11) default 0 COMMENT '预置业态', | |||||
| add column rent bigint(12) default 0 COMMENT '参与租金'; | |||||
| @@ -1 +0,0 @@ | |||||
| alter table wx_shop add index b_f(building,floor); | |||||
| @@ -1 +0,0 @@ | |||||
| alter table wx_shop add index t_i_t_s_b_f_c(tenant_id,is_del,type,status,building,floor,create_date); | |||||
| @@ -1 +0,0 @@ | |||||
| alter table wx_shop add column `rent_unit` TINYINT(4) DEFAULT '1' COMMENT '租金单位1日2月3年'; | |||||
| @@ -1 +0,0 @@ | |||||
| alter table wx_shop change column `business` business_id int(11) default 0 COMMENT '预置业态'; | |||||
| @@ -1,20 +0,0 @@ | |||||
| update wx_flow_config set name = '商铺租金合同签约' where name = '商铺合同签约'; | |||||
| update wx_flow_config set name = '多经点位租金合同签约' where name = '多径点位合同签约'; | |||||
| update wx_flow_config set name = '商铺租金合同终止' where name = '商铺合同终止'; | |||||
| update wx_flow_config set name = '多经点位租金合同终止' where name = '多经点位合同终止'; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '456', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '456', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '456', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '456', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| @@ -1,97 +0,0 @@ | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '789', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '789', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '789', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '789', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '790', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '790', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '790', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '790', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1001', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1001', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1001', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1001', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1002', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1002', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1002', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1002', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1003', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1003', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1003', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1003', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1004', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1004', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1004', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1004', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1005', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1005', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1005', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1005', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1006', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1006', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1006', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1006', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1007', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1007', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1007', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1007', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1008', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1008', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1008', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1008', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1009', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1009', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1009', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1009', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1010', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1010', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1010', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1010', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1011', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1011', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1011', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1011', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1012', '商铺物业合同签约', 13, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 5), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1012', '商铺物业合同终止', 14, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 6), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1012', '多经点位物业合同签约', 15, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 7), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1012', '多经点位物业合同终止', 16, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 8); | |||||
| @@ -1,104 +0,0 @@ | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '456', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '456', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '456', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '456', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '789', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '789', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '789', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '789', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '790', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '790', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '790', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '790', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1001', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1001', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1001', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1001', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1002', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1002', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1002', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1002', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1003', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1003', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1003', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1003', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1004', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1004', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1004', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1004', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1005', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1005', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1005', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1005', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1006', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1006', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1006', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1006', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1007', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1007', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1007', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1007', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1008', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1008', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1008', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1008', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1009', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1009', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1009', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1009', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1010', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1010', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1010', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1010', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1011', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1011', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1011', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1011', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`) | |||||
| VALUES | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1012', '商铺租赁合同签约', 17, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 9), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1012', '商铺租赁合同终止', 18, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 10), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1012', '多经点位商铺租赁合同签约', 19, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 11), | |||||
| ((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1561009249, '1012', '多经点位商铺租赁合同终止', 20, 0, '2019-06-11 14:02:42', '2019-07-11 21:06:31', 12); | |||||
| @@ -1,7 +0,0 @@ | |||||
| ALTER TABLE `wx_car_pay_record` add unique(`syn_id`); | |||||
| alter table wx_car_cmd_log | |||||
| add column syn_id VARCHAR(50) GENERATED ALWAYS AS (`cmd_json` ->> '$.synId') NULL; | |||||
| alter table wx_car_cmd_log | |||||
| add column order_id VARCHAR(50) GENERATED ALWAYS AS (`cmd_json` ->> '$.orderId') NULL; | |||||
| @@ -1,2 +0,0 @@ | |||||
| alter table wx_car_cmd_log | |||||
| add column fee_time VARCHAR(50) GENERATED ALWAYS AS (`cmd_json` ->> '$.time') NULL; | |||||
| @@ -1,2 +0,0 @@ | |||||
| alter table wx_msg_validationcode_model | |||||
| add column open SMALLINT(1) default 0 COMMENT '发送开关 0开1关'; | |||||
| @@ -1,4 +0,0 @@ | |||||
| ALTER TABLE `push_limit` | |||||
| ADD COLUMN `time_enable` TINYINT(2) NULL DEFAULT 0 COMMENT '是否启用,0:Enable,1:Disable' after `coupon_day`; | |||||
| Update `push_limit` set `time_enable` = 0; | |||||
| @@ -1 +0,0 @@ | |||||
| alter table wx_shop modify `rent` varchar(20) DEFAULT '' COMMENT '参与租金'; | |||||
| @@ -1,11 +0,0 @@ | |||||
| ALTER TABLE `wx_rent_contract` | |||||
| ADD COLUMN `late_pay_ratio` INT(10) NULL DEFAULT 0 COMMENT '滞纳金费率'; | |||||
| ALTER TABLE `wx_rent_contract` | |||||
| ADD COLUMN `late_pay_day` INT(10) NULL DEFAULT NULL COMMENT 'n天后开始计算滞纳金'; | |||||
| ALTER TABLE `wx_property_contract` | |||||
| ADD COLUMN `late_pay_ratio` INT(10) NULL DEFAULT 0 COMMENT '滞纳金费率'; | |||||
| ALTER TABLE `wx_property_contract` | |||||
| ADD COLUMN `late_pay_day` INT(10) NULL DEFAULT NULL COMMENT 'n天后开始计算滞纳金'; | |||||
| @@ -1,9 +0,0 @@ | |||||
| #父级业态 | |||||
| insert into `wx_business` ( `id`, `title`, `type`, `create_date`, `update_date`) values ( '11', '数码家电', '1', now(), now()); | |||||
| #子级业态 | |||||
| insert into `wx_sub_business` ( `id`, `title`, `business_id`, `business_title`, `create_date`, `update_date`) values | |||||
| ( '59', '家用电器', '11', '数码家电', now(), now()), | |||||
| ( '60', '数码产品', '11', '数码家电', now(), now()), | |||||
| ( '61', '手机通信', '11', '数码家电', now(), now()), | |||||
| ( '62', '电脑办公', '11', '数码家电', now(), now()), | |||||
| ( '63', '影音娱乐', '11', '数码家电', now(), now()); | |||||
| @@ -1 +0,0 @@ | |||||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '145', '数码家电', '3', '消费偏好', '14', '消费类别'); | |||||
| @@ -1,2 +0,0 @@ | |||||
| insert into `wx_tags` ( `id`, `name`, `group_id`, `group_name`, `type_id`, `type_name`) values ( '146', '手机通信', '3', '消费偏好', '16', '品牌偏好'); | |||||
| update wx_tags set name ='数码产品' where id=86; | |||||
| @@ -1,3 +0,0 @@ | |||||
| UPDATE `mall_permission` SET `name` = '采集设备' WHERE (`id` = '966'); | |||||
| UPDATE `mall_permission` SET `name` = '电能采集' WHERE (`id` = '952'); | |||||
| UPDATE `mall_permission` SET `name` = '电能数据' WHERE (`id` = '108'); | |||||
| @@ -1,2 +0,0 @@ | |||||
| UPDATE `mall_permission` SET `icon` = 'icon-iconfontchangemeter-copy' WHERE (`id` = '108'); | |||||
| UPDATE `mall_permission` SET `icon` = 'icon-dianbiao' WHERE (`id` = '952'); | |||||
| @@ -1 +0,0 @@ | |||||
| alter table wx_credit_history add column ticket_number varchar(50) DEFAULT '' COMMENT '小票号'; | |||||
| @@ -1,2 +0,0 @@ | |||||
| alter table wx_rent_contract modify `late_pay_ratio` varchar(100) DEFAULT NULL; | |||||
| alter table wx_property_contract modify `late_pay_ratio` varchar(100) DEFAULT NULL; | |||||
| @@ -1,2 +0,0 @@ | |||||
| alter table wx_bill_action modify `user_id` BIGINT(20) NULL DEFAULT NULL; | |||||
| alter table wx_bill_action modify `phone` VARCHAR(50) NULL DEFAULT NULL; | |||||
| @@ -1,87 +0,0 @@ | |||||
| CREATE TABLE IF NOT EXISTS `kw_box` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, | |||||
| `imei` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '设备编号', | |||||
| `iccid` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'SIM卡编号', | |||||
| `place` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '位置', | |||||
| `fw_version` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '固件版本号', | |||||
| `hd_version` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '硬件版本号', | |||||
| `register_status` smallint(2) NOT NULL DEFAULT '0' COMMENT '注册状态0出厂已注册1', | |||||
| `online_status` smallint(2) NOT NULL DEFAULT '0' COMMENT '在线状态1在线0离线', | |||||
| `register_time` datetime DEFAULT NULL COMMENT '注册时间', | |||||
| `last_online_time` datetime DEFAULT NULL COMMENT '最后一次在线时间', | |||||
| `config` json DEFAULT NULL COMMENT '配置', | |||||
| `create_time` datetime NOT NULL COMMENT '创建时间', | |||||
| `update_time` datetime NOT NULL COMMENT '更新时间', | |||||
| `com_key` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||||
| `status` smallint(2) NOT NULL DEFAULT '0', | |||||
| `max_tag_num` smallint(2) NOT NULL DEFAULT '16', | |||||
| PRIMARY KEY (`id`), | |||||
| KEY `id_index` (`id`) | |||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='盒子表'; | |||||
| CREATE TABLE IF NOT EXISTS `kw_box_cmd_history` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||||
| `imei` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '设备编号', | |||||
| `iccid` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'SIM卡编号', | |||||
| `cmd` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '命令类型', | |||||
| `content` json DEFAULT NULL COMMENT '信息', | |||||
| `device_time` datetime NOT NULL COMMENT '设备命令上传记录时间', | |||||
| `create_time` datetime NOT NULL COMMENT '创建时间', | |||||
| PRIMARY KEY (`id`), | |||||
| KEY `id_index` (`id`) | |||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='命令历史表'; | |||||
| CREATE TABLE IF NOT EXISTS `kw_merchant_meter` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||||
| `meter_id` bigint(20) NOT NULL COMMENT '电表ID', | |||||
| `merchant_id` bigint(20) NOT NULL COMMENT '商户ID', | |||||
| `status` smallint(2) NOT NULL COMMENT '状态1历史0在用', | |||||
| `create_time` datetime NOT NULL COMMENT '创建时间', | |||||
| `update_time` datetime NOT NULL COMMENT '更新时间', | |||||
| PRIMARY KEY (`id`), | |||||
| KEY `id_index` (`id`) | |||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='商户电表关联表'; | |||||
| CREATE TABLE IF NOT EXISTS `kw_meter` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||||
| `address` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '电表编号', | |||||
| `brand` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '品牌', | |||||
| `model` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '型号', | |||||
| `place` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '位置', | |||||
| `last_online_time` datetime DEFAULT NULL, | |||||
| `total_power` int(10) DEFAULT NULL, | |||||
| `online_status` smallint(2) NOT NULL DEFAULT '0' COMMENT '在线状态1在线0离线', | |||||
| `config` json DEFAULT NULL COMMENT '配置', | |||||
| `create_time` datetime NOT NULL COMMENT '创建时间', | |||||
| `update_time` datetime NOT NULL COMMENT '更新时间', | |||||
| `status` smallint(2) NOT NULL, | |||||
| `box_id` bigint(20) DEFAULT NULL, | |||||
| `bind_status` smallint(2) NOT NULL DEFAULT '0' COMMENT '0已绑定 1未绑定', | |||||
| PRIMARY KEY (`id`), | |||||
| KEY `id_index` (`id`) | |||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='电表表'; | |||||
| CREATE TABLE IF NOT EXISTS `kw_meter_data` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, | |||||
| `meter_id` bigint(20) NOT NULL COMMENT '电表ID', | |||||
| `box_id` bigint(20) NOT NULL COMMENT '盒子ID', | |||||
| `address` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '电表编号', | |||||
| `total_power` int(10) DEFAULT NULL COMMENT '总消耗电能', | |||||
| `device_time` datetime NOT NULL COMMENT '设备命令上传记录时间', | |||||
| `create_time` datetime NOT NULL COMMENT '创建时间', | |||||
| `used_power` int(10) DEFAULT NULL, | |||||
| `last_device_time` datetime DEFAULT NULL, | |||||
| `last_total_power` int(10) DEFAULT NULL, | |||||
| PRIMARY KEY (`id`), | |||||
| KEY `id_index` (`id`), | |||||
| KEY `meter_box_index` (`meter_id`,`box_id`,`tenant_id`,`device_time`,`create_time`) | |||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='电表数据表'; | |||||
| @@ -1,2 +0,0 @@ | |||||
| alter table wx_bill_action modify `createtime` DATETIME NULL DEFAULT CURRENT_TIMESTAMP; | |||||
| alter table wx_bill_action modify `updatetime` DATETIME NULL DEFAULT CURRENT_TIMESTAMP; | |||||
| @@ -1,13 +0,0 @@ | |||||
| ALTER TABLE `wx_msg_validationcode_model` | |||||
| ADD COLUMN `msg_type` INT(1) NULL DEFAULT 0 COMMENT '1短信2邮件'; | |||||
| ALTER TABLE `wx_msg_validationcode_model` | |||||
| ADD COLUMN `role_type` INT(1) NULL DEFAULT 0 COMMENT '0通用1管理员2商户端3消费者'; | |||||
| update wx_msg_validationcode_model set msg_type = 1 where content not like '<%'; | |||||
| update wx_msg_validationcode_model set msg_type = 2 where content like '<%'; | |||||
| update wx_msg_validationcode_model set role_type = 2 where name in('账单待缴模板','账单欠缴模板','商户分账账户新增通知商户','商户分账账户变更通知商户','商户分账账户删除提醒','待缴账单通知','限时活动报名成功','限时活动参加提醒','欠缴账单通知'); | |||||
| update wx_msg_validationcode_model set role_type = 3 where name in('场景投放','限时活动报名成功','限时活动参加提醒',''); | |||||
| update wx_msg_validationcode_model set role_type = 1 where name in('审批通过通知','审批通知','待办通知','驳回通知','审批通知','代办通知','通过审批通知','审批通过通知'); | |||||
| update wx_msg_validationcode_model set role_type = 0 where name in('验证码'); | |||||
| @@ -1,4 +0,0 @@ | |||||
| update wx_weapp_basic_set | |||||
| set template_info= | |||||
| "{\"verify_fail\": {\"id\": \"AT1824\", \"custom_param\": \"{\\\"index\\\":[\\\"keyword1\\\",\\\"keyword2\\\",\\\"keyword3\\\",\\\"keyword4\\\",\\\"keyword5\\\",\\\"keyword6\\\",\\\"keyword7\\\"],\\\"emphasis\\\":\\\"keyword1.DATA\\\",\\\"keyword1\\\":\\\"可抵{keyword1}元\\\",\\\"keyword2\\\":\\\"{keyword2}\\\",\\\"keyword3\\\":\\\"{keyword3}\\\",\\\"keyword4\\\":\\\"{keyword4}\\\",\\\"keyword5\\\":\\\"{keyword5}元\\\",\\\"keyword6\\\":\\\"{keyword6}\\\",\\\"keyword7\\\":\\\"猜也猜不到的优惠,只有幸运的人才能看到,就是你,{keyword7}\\n☟☟☟☟☟☟☟\\n☞ 快看看 ☜\\n☝︎☝︎☝︎☝︎☝︎☝︎☝︎\\n\\\"}\", \"keyword_id_list\": [1, 3, 4, 5]}, \"press_success\": {\"id\": \"AT1173\", \"custom_param\": \"{\\\"index\\\":[\\\"keyword1\\\",\\\"keyword2\\\",\\\"keyword3\\\",\\\"keyword4\\\",\\\"keyword5\\\",\\\"keyword6\\\"],\\\"emphasis\\\":\\\"keyword5.DATA\\\",\\\"keyword1\\\":\\\"{keyword1}\\\",\\\"keyword2\\\":\\\"{keyword2}元\\\",\\\"keyword3\\\":\\\"{keyword3}\\\",\\\"keyword4\\\":\\\"{keyword4}\\\",,\\\"keyword5\\\":\\\"{keyword5}元\\\",\\\"keyword6\\\":\\\"请于一小时内尽快支付,过期将无法以底价购买。\\\"}\", \"keyword_id_list\": [1, 17, 22, 23, 4, 3]}, \"verify_success\": {\"id\": \"AT0423\", \"custom_param\": \"{\\\"index\\\":[\\\"keyword1\\\",\\\"keyword2\\\",\\\"keyword3\\\",\\\"keyword4\\\"],\\\"emphasis\\\":\\\"keyword1.DATA\\\",\\\"keyword1\\\":\\\"可抵{keyword1}元\\\",\\\"keyword2\\\":\\\"{keyword2}\\\",\\\"keyword3\\\":\\\"{keyword3}\\\",\\\"keyword4\\\":\\\"猜也猜不到的优惠,只有幸运的人才能看到,就是你,{keyword4}\\n☟☟☟☟☟☟☟\\n☞ 快看看 ☜\\n☝︎☝︎☝︎☝︎☝︎☝︎☝︎\\n\\\"}\", \"keyword_id_list\": [14, 15, 16, 7, 10, 3, 9]}}" | |||||
| where type = 2; | |||||
| @@ -1,5 +0,0 @@ | |||||
| update wx_score_rules set rules =JSON_ARRAY_INSERT(rules,'$[1].childs[9]',json_object('desc','线上交易0元','step',1,'limit',0,'score',0,'title','数码家电','businessId',11)) | |||||
| where type=2 and json_contains_path(rules,'one','$[1].childs')=1; | |||||
| update wx_score_rules set rules =JSON_ARRAY_INSERT(rules,'$[1].childs[9]',json_object('desc','线上交易0元','step',1,'limit',0,'score',0,'title','数码家电','businessId',11)) | |||||
| where type=1 and json_contains_path(rules,'one','$[1].childs')=1; | |||||
| @@ -1,2 +0,0 @@ | |||||
| alter table wx_rent_contract modify `late_pay_day` INT(10) DEFAULT 0; | |||||
| alter table wx_property_contract modify `late_pay_day` INT(10) DEFAULT 0; | |||||
| @@ -1,2 +0,0 @@ | |||||
| ALTER TABLE `wx_score_history` | |||||
| CHANGE COLUMN `create_date` `create_date` DATETIME NOT NULL COMMENT '创建日期' ; | |||||
| @@ -0,0 +1,3 @@ | |||||
| ALTER TABLE wx_activity_join add column telphone varchar(15) DEFAULT '' COMMENT '联系电话'; | |||||
| @@ -0,0 +1 @@ | |||||
| ALTER TABLE wx_activity add column selectques json DEFAULT NULL COMMENT '常见问题选择'; | |||||
| @@ -0,0 +1 @@ | |||||
| ALTER TABLE wx_activity_join change column name name varchar(20) DEFAULT '' COMMENT '姓名'; | |||||
| @@ -0,0 +1,45 @@ | |||||
| CREATE TABLE `th_dev_info` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `dev_id` varchar(30) NOT NULL COMMENT '开发者ID', | |||||
| `name` varchar(30) NOT NULL COMMENT '名称', | |||||
| `type` smallint(2) NOT NULL COMMENT '类型(0:自用, 1:东软POS)', | |||||
| `req_key` varchar(128) NOT NULL COMMENT '请求私钥', | |||||
| `res_key` varchar(128) NOT NULL COMMENT '响应私钥', | |||||
| `state` tinyint(6) NOT NULL DEFAULT '0' COMMENT '商户状态,0-使用中,1-禁用', | |||||
| `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||||
| `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', | |||||
| PRIMARY KEY (`id`) | |||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='第三方开发者信息表'; | |||||
| ALTER TABLE `th_dev_info` ADD INDEX `idx_DevId` (`dev_id` ASC); | |||||
| create table pos_coupon_order_verify ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(10) NOT NULL COMMENT '租户ID', | |||||
| `coupon_order_id` bigint(20) NOT NULL COMMENT '券包ID', | |||||
| `pos_order_id` bigint(20) NULL COMMENT 'POS订单ID', | |||||
| `state` tinyint(6) NOT NULL DEFAULT '0' COMMENT '状态,0-使用中,1-禁用', | |||||
| `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||||
| `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', | |||||
| PRIMARY KEY (`id`) | |||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='POS核销记录'; | |||||
| alter table wx_order | |||||
| add `pos_order_id` bigint(20) NULL COMMENT 'POS订单ID', | |||||
| change `type` `type` tinyint(6) NOT NULL DEFAULT '0' COMMENT '支付类型(0:券1:付款码支付,2:C扫码支付,3,储值卡,4积分支付 9:B端POS支付 10:东软POS支付)'; | |||||
| alter table wx_pay_order | |||||
| add `type` tinyint(6) NOT NULL DEFAULT '0' COMMENT '支付类型(0:微信支付, 9:B端POS支付 10:东软POS同步)', | |||||
| add `pos_pay_id` bigint(20) NULL COMMENT 'POS支付订单ID'; | |||||
| create table pos_mall_config ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(10) NOT NULL COMMENT '租户ID', | |||||
| `discount` tinyint(6) NOT NULL DEFAULT '0' COMMENT '会员折扣状态,0-使用中,1-禁用', | |||||
| `coupon` tinyint(6) NOT NULL DEFAULT '0' COMMENT '会员优惠券状态,0-使用中,1-禁用', | |||||
| `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||||
| `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', | |||||
| PRIMARY KEY (`id`) | |||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='POS优惠设置'; | |||||
| alter table wx_mall | |||||
| add column `pos_qrcode_rule` varchar(50) DEFAULT '' COMMENT 'pos小票二维码规则'; | |||||
| @@ -1,11 +1,7 @@ | |||||
| INSERT INTO `mall_permission` | INSERT INTO `mall_permission` | ||||
| (`id`,`name`, `parent_id`,`available`,`permission`,`resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`,`sort`) | (`id`,`name`, `parent_id`,`available`,`permission`,`resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`,`sort`) | ||||
| VALUES | VALUES | ||||
| (952, '智能电表', 9, 'Y', null, 0, null, null, 'meterManage', 'icon-navicon-yhgl', 0, 952), | |||||
| (965, '电表管理', 952, 'Y', null, 1, null, null, 'meterManage', null, 0, 965), | |||||
| (966, '盒子管理', 952, 'Y', null, 1, null, null, 'boxManage', null, 0, 966), | |||||
| (967, '商户电表', 952, 'Y', null, 1, null, null, 'merMeterManage', null, 0, 967), | |||||
| (108, '电表数据', 1, 'Y', NULL, 1, NULL, NULL, 'meterData', 'icon-wifi', 0, 108); | |||||
| (695, '商户发券', 608, 'Y', null, 0, null, null, 'merchantCoupon', null, 0, 695); | |||||
| DROP TABLE IF EXISTS `mall_sale_type` ; | DROP TABLE IF EXISTS `mall_sale_type` ; | ||||
| CREATE TABLE `mall_sale_type` ( | CREATE TABLE `mall_sale_type` ( | ||||
| @@ -22,13 +18,14 @@ INSERT INTO `mall_sale_type` | |||||
| (`id`,`name`, `type`, `period`, `menus`) | (`id`,`name`, `type`, `period`, `menus`) | ||||
| VALUES | VALUES | ||||
| (1, '尊享全能版', 1, 12, | (1, '尊享全能版', 1, 12, | ||||
| '[1,2,3,4,5,6,7,8,9,10,50,101,102,103,104,105,106,107,108,201,202,203,204,205,206,211,212,221,222,251,301,302,303,304,305,306,401,402,403,404,405,406,407,408,409,410,411,412,413,501,502,503,504,505,506,507,508,509,511,512,513,521,522,523,531,532,533,591,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,681,682,683,684,685,691,692,693,694,701,702,711,712,713,901,902,903,931,932,951,952,961,962,965,966,967]' | |||||
| '[1,2,3,4,5,6,7,8,9,10,50,101,102,103,104,105,106,107,108,201,202,203,204,205,206,211,212,221,222,251,301,302,303,304,305,306,401,402,403,404,405,406,407,408,409,410,411,412,413,501,502,503,504,505,506,507,508,509,511,512,513,521,522,523,531,532,533,591,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932,951,952,961,962,965,966,967]' | |||||
| ), | ), | ||||
| (2, '尊享营销版', 2, 12, | (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,501,502,503,504,505,506,507,508,509,511,512,513,521,522,523,531,532,533,591,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,681,682,683,684,685,691,692,693,694,701,702,711,712,713,901,902,903,931,932,951,961]' | |||||
| '[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,501,502,503,504,505,506,507,508,509,511,512,513,521,522,523,531,532,533,591,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932,951,961]' | |||||
| ), | ), | ||||
| (3, '速享版', 3, 1, | (3, '速享版', 3, 1, | ||||
| '[2,4,5,6,7,10,50,201,202,205,211,212,221,222,251,409,410,411,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,681,682,683,684,685,691,692,693,694,701,702,711,712,713,901,902,903,931,932]' | |||||
| '[2,4,5,6,7,10,50,201,202,205,211,212,221,222,251,409,410,411,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932]' | |||||
| ) | ) | ||||
| ; | |||||
| ; | |||||
| ALTER TABLE `wx_level_config` ADD COLUMN `scale` tinyint NOT NULL DEFAULT 10 COMMENT '积分倍率' AFTER `capability`; | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table wx_rent_contract | |||||
| add column `bus_discount_ratio` json NULL DEFAULT NULL COMMENT '联营扣点率'; | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table wx_rent_contract | |||||
| add column `bus_discount_time` SMALLINT(1) NULL DEFAULT 0 COMMENT '1年2月3周期'; | |||||
| @@ -0,0 +1,2 @@ | |||||
| ALTER TABLE `wx_level_config` CHANGE COLUMN `scale` `scale` smallint UNSIGNED NOT NULL DEFAULT 10 COMMENT '会员等级积分倍率'; | |||||
| ALTER TABLE `wx_score_rules` ADD COLUMN `scale` smallint UNSIGNED COMMENT '会员生日积分倍率' AFTER `clear_year`; | |||||
| @@ -0,0 +1,4 @@ | |||||
| ALTER TABLE `wx_mall_floor` | |||||
| ADD COLUMN `operating_area` decimal(10,2) NULL COMMENT '营业面积', | |||||
| ADD COLUMN `total_area` decimal(10,2) NULL COMMENT '总面积' | |||||
| ; | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table pos_mall_config | |||||
| add column `card` tinyint(6) NOT NULL DEFAULT '0' COMMENT '会员优惠券状态,0-使用中,1-禁用'; | |||||
| @@ -0,0 +1,6 @@ | |||||
| ALTER TABLE `wx_card_spend` | |||||
| ADD `from` tinyint(6) NOT NULL DEFAULT '0' COMMENT '来源(0:C端小程序扫一扫, 1:B端POS, 2:东软POS)', | |||||
| ADD `pos_refund_status` tinyint(6) NULL COMMENT 'pos状态(1:POS线下退款开始, 2:POS线下退款成功)', | |||||
| ADD COLUMN `pos_order_id` bigint(20) NULL COMMENT 'POS订单账号', | |||||
| CHANGE COLUMN `ip` `ip` varchar(20) COMMENT 'ip地址', | |||||
| CHANGE COLUMN `pay_status` `pay_status` smallint(2) NOT NULL DEFAULT 0 COMMENT '支付状态(0:未分帐, 1:已分账, 2:已人工分账, 10:预支付(POS))'; | |||||
| @@ -0,0 +1,14 @@ | |||||
| CREATE TABLE `pos_action_log` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `url` varchar (100) NOT NULL COMMENT '访问url', | |||||
| `ip` varchar (20) NOT NULL COMMENT 'ip地址', | |||||
| `method` varchar (10) NOT NULL COMMENT 'http访问', | |||||
| `start_time` bigint(20) NOT NULL COMMENT 'api发起时间', | |||||
| `end_time` bigint(20) NOT NULL COMMENT 'api发起时间', | |||||
| `cost_time` INTEGER NOT NULL COMMENT '访问花费时间', | |||||
| `req_json` json DEFAULT NULL COMMENT '命令请求JSON', | |||||
| `res_json` json DEFAULT NULL COMMENT '返回结果', | |||||
| PRIMARY KEY (`id`) | |||||
| ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='POS访问LOG' CHECKSUM=0 DELAY_KEY_WRITE=0; | |||||
| ALTER TABLE `pos_action_log` ADD INDEX `idx_Index` (`url`, `ip`, `method`, `start_time`); | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table `pos_action_log` | |||||
| add column `dev_id` VARCHAR(50) GENERATED ALWAYS AS (`req_json` ->> '$.dev_id') NULL; | |||||
| @@ -0,0 +1,25 @@ | |||||
| DROP TABLE IF EXISTS wx_merchant_power_bill_config; | |||||
| CREATE TABLE wx_merchant_power_bill_config( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(10) NOT NULL COMMENT '租户ID', | |||||
| `merchant_id` bigint(20) NOT NULL COMMENT '商户ID', | |||||
| `merchant_name` varchar(50) NOT NULL COMMENT '商户名称', | |||||
| `merchant_type` smallint(2) NOT NULL COMMENT '商户类型1店铺2点位', | |||||
| `build_way` tinyint(2) NOT NULL default 0 COMMENT '生成方式1按电表2固定金额', | |||||
| `price` varchar(10) NOT NULL COMMENT '金额(电表计费时为单价)', | |||||
| `create_date` datetime NOT NULL COMMENT '创建时间', | |||||
| `update_date` datetime NOT NULL COMMENT '更新时间', | |||||
| PRIMARY KEY (`id`) | |||||
| ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='电费自动生成规则' CHECKSUM=0 DELAY_KEY_WRITE=0; | |||||
| DROP TABLE IF EXISTS wx_power_bill_auto_config; | |||||
| CREATE TABLE wx_power_bill_auto_config( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(10) NOT NULL COMMENT '租户ID', | |||||
| `unit_price` varchar(10) NOT NULL COMMENT '单价', | |||||
| `build_day` tinyint(3) NOT NULL COMMENT '每月多少日拉取上月数据', | |||||
| `receive_day` tinyint(3) NOT NULL COMMENT '截止缴款日', | |||||
| `create_date` datetime NOT NULL COMMENT '创建时间', | |||||
| `update_date` datetime NOT NULL COMMENT '更新时间', | |||||
| PRIMARY KEY (`id`) | |||||
| ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='电费自动生成规则' CHECKSUM=0 DELAY_KEY_WRITE=0; | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table wx_coupon_order | |||||
| add `verify_type` tinyint(6) NULL COMMENT '核销类型(0:B端核销, 1:POS独立核销 2:POS交易核销)'; | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table wx_rent_contract | |||||
| modify column `bus_discount_ratio` varchar(1000) NULL DEFAULT NULL COMMENT '联营扣点率'; | |||||
| @@ -1,7 +1,9 @@ | |||||
| update mall_permission set name = '账单催缴' where name = '商户账单'; | |||||
| INSERT INTO `mall_permission` | INSERT INTO `mall_permission` | ||||
| (`id`,`name`, `parent_id`,`available`,`permission`,`resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`,`sort`) | (`id`,`name`, `parent_id`,`available`,`permission`,`resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`,`sort`) | ||||
| VALUES | VALUES | ||||
| (592, '短信管理', 50, 'Y', null, 1, null, null, 'dreamSend', 'icon-navicon-dxgl', 0, 592); | |||||
| (414, '商户账单', 4, 'Y', null, 1, null, null, 'merchantBillList', 'icon-icon-test2', 0, 402); | |||||
| DROP TABLE IF EXISTS `mall_sale_type` ; | DROP TABLE IF EXISTS `mall_sale_type` ; | ||||
| CREATE TABLE `mall_sale_type` ( | CREATE TABLE `mall_sale_type` ( | ||||
| @@ -18,13 +20,12 @@ INSERT INTO `mall_sale_type` | |||||
| (`id`,`name`, `type`, `period`, `menus`) | (`id`,`name`, `type`, `period`, `menus`) | ||||
| VALUES | VALUES | ||||
| (1, '尊享全能版', 1, 12, | (1, '尊享全能版', 1, 12, | ||||
| '[1,2,3,4,5,6,7,8,9,10,50,101,102,103,104,105,106,107,108,201,202,203,204,205,206,211,212,221,222,251,301,302,303,304,305,306,401,402,403,404,405,406,407,408,409,410,411,412,413,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,681,682,683,684,685,691,692,693,694,701,702,711,712,713,901,902,903,931,932,951,952,961,962,965,966,967]' | |||||
| '[1,2,3,4,5,6,7,8,9,10,50,101,102,103,104,105,106,107,108,201,202,203,204,205,206,211,212,221,222,251,301,302,303,304,305,306,401,402,403,404,405,406,407,408,409,410,411,412,413,414,501,502,503,504,505,506,507,508,509,511,512,513,521,522,523,531,532,533,591,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932,951,952,961,962,965,966,967]' | |||||
| ), | ), | ||||
| (2, '尊享营销版', 2, 12, | (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,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,681,682,683,684,685,691,692,693,694,701,702,711,712,713,901,902,903,931,932,951,961]' | |||||
| '[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,501,502,503,504,505,506,507,508,509,511,512,513,521,522,523,531,532,533,591,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932,951,961]' | |||||
| ), | ), | ||||
| (3, '速享版', 3, 1, | (3, '速享版', 3, 1, | ||||
| '[2,4,5,6,7,10,50,201,202,205,211,212,221,222,251,409,410,411,501,502,503,504,505,506,507,508,511,512,513,521,522,523,531,532,533,591,592,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,681,682,683,684,685,691,692,693,694,701,702,711,712,713,901,902,903,931,932]' | |||||
| '[2,4,5,6,7,10,50,201,202,205,211,212,221,222,251,409,410,411,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932]' | |||||
| ) | ) | ||||
| ; | |||||
| ; | |||||
| @@ -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 | |||||
| (968, '电费管理', 952, 'Y', NULL, 1, NULL, NULL, 'meterFee', NULL, 0, 968); | |||||
| 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,50,101,102,103,104,105,106,107,108,201,202,203,204,205,206,211,212,221,222,251,301,302,303,304,305,306,401,402,403,404,405,406,407,408,409,410,411,412,413,414,501,502,503,504,505,506,507,508,509,511,512,513,521,522,523,531,532,533,591,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932,951,952,961,962,965,966,967,968]' | |||||
| ), | |||||
| (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,501,502,503,504,505,506,507,508,509,511,512,513,521,522,523,531,532,533,591,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,681,682,683,684,685,691,692,693,694,695,701,702,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,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932]' | |||||
| ) | |||||
| ; | |||||
| @@ -0,0 +1,41 @@ | |||||
| create table `pos_order` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(10) NOT NULL COMMENT '租户ID', | |||||
| `pos_order_no` varchar(20) NULL COMMENT 'POS订单ID', | |||||
| `type` tinyint(6) NOT NULL DEFAULT 0 COMMENT '支付类型(1: 独立核销, 2:支付)', | |||||
| `order_status` tinyint(6) NOT NULL DEFAULT '0' COMMENT '订单状态:0-待付款/待核销;1-已支付;2-已取消(限定时间内未付款);3-待退款;4-已退款;5-退款失败', | |||||
| `bu_user_id` bigint(20) DEFAULT NULL COMMENT 'b端用户', | |||||
| `payment_type` smallint(2) NOT NULL COMMENT '0: 付款 1: 退款 2:自动退款 3:A端退款 10:独立核销', | |||||
| `payment` int(11) default NULL COMMENT '支付金额:允许有负数,退款时为负值。核销时,金额可以不填写', | |||||
| `create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||||
| `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', | |||||
| PRIMARY KEY (`id`) | |||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='POS订单'; | |||||
| CREATE TABLE `pos_pay_order` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(10) NOT NULL COMMENT '租户ID', | |||||
| `create_time` datetime NOT NULL COMMENT '创建时间', | |||||
| `update_time` datetime NOT NULL COMMENT '更新时间', | |||||
| `order_id` bigint(20) NOT NULL COMMENT '订单ID', | |||||
| `bu_user_id` bigint(20) DEFAULT NULL COMMENT 'b端用户', | |||||
| `type` tinyint(6) NOT NULL DEFAULT 0 COMMENT '支付类型(1:独立核销 2:支付核销 3:现金支付)', | |||||
| `pay_from` tinyint(6) NOT NULL DEFAULT 0 COMMENT '支付来源(0: 现金, 1:微信 2:支付核销 3:现金支付)', | |||||
| `pay_amount` int(11) NOT NULL COMMENT '支付金额(分)', | |||||
| `pay_time_start` datetime NOT NULL COMMENT '支付发起时间', | |||||
| `pay_time_end` datetime NOT NULL COMMENT '支付结束时间', | |||||
| `prepay_id` varchar(64) DEFAULT NULL COMMENT '微信预支付交易会话标识-发模板信息使用', | |||||
| `transaction_id` varchar(36) DEFAULT NULL COMMENT '微信生成的订单号', | |||||
| `pay_vendor` int(11) NOT NULL DEFAULT 0 COMMENT '支付渠道: 0-微信 1-支付宝 2-银联 ', | |||||
| `pay_order_no` varchar(36) DEFAULT '' COMMENT '支付订单号', | |||||
| `pay_order_status` int(11) NOT NULL DEFAULT 0 COMMENT '支付状态: 0-支付中;1-支付成功;2-支付失败', | |||||
| `share` smallint(2) DEFAULT NULL COMMENT '是否支持分账(0:不支持,1:支持)', | |||||
| `share_amount` int(11) DEFAULT NULL COMMENT '分账金额(总金额扣掉手续费后的金额)', | |||||
| `rate_amount` int(11) DEFAULT NULL COMMENT '分账实际通道费', | |||||
| `fail_reason` varchar(50) DEFAULT '' COMMENT '支付失败原因', | |||||
| `auth_code` varchar(128) DEFAULT NULL COMMENT '扫码支付授权码', | |||||
| `open_id` varchar(128) DEFAULT NULL COMMENT '微信支付后获取的open_id', | |||||
| `pay_end_from` smallint(2) DEFAULT NULL COMMENT '支付后结果来源(0:callback, 1:query)', | |||||
| PRIMARY KEY (`id`), | |||||
| UNIQUE `id_UNIQUE` USING BTREE (`id`) comment '' | |||||
| ) ENGINE=`InnoDB` DEFAULT CHARSET=utf8mb4 COMMENT='POS支付订单'; | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table wx_bill_rent | |||||
| add column `pay_ratio` int(5) NULL DEFAULT NULL COMMENT '连营扣点跳点率'; | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table `pos_order` | |||||
| add `remain_amount` int(11) default NULL COMMENT '支付金额:允许有负数,退款时为负值。核销时,金额可以不填写' after `payment`; | |||||
| @@ -0,0 +1 @@ | |||||
| ALTER TABLE `wx_c_user_basic_info` ADD COLUMN `score_date` datetime COMMENT '生日倍率日期' AFTER `act_record`; | |||||
| @@ -0,0 +1,35 @@ | |||||
| drop table if exists wx_user_data_rule; | |||||
| CREATE TABLE wx_user_data_rule ( | |||||
| `id` bigint(20) NOT NULL, | |||||
| `tenant_id` varchar(10) NOT NULL COMMENT '租户ID', | |||||
| `user_id` bigint(20) NOT NULL COMMENT '角色名称', | |||||
| `type` tinyint(3) NOT NULL COMMENT '权限类型1系统全部数据2楼层及业态', | |||||
| `building_floor` json DEFAULT NULL COMMENT '楼层楼座', | |||||
| `business` json DEFAULT NULL COMMENT '业态', | |||||
| `target` json DEFAULT NULL COMMENT '数据范围', | |||||
| `create_time` datetime DEFAULT NULL COMMENT '创建时间', | |||||
| `update_time` datetime DEFAULT NULL COMMENT '更新时间', | |||||
| PRIMARY KEY (`id`), | |||||
| UNIQUE `id_UNIQUE` USING BTREE (`id`) comment '' | |||||
| ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ROW_FORMAT=DYNAMIC COMMENT='用户数据权限' CHECKSUM=0 DELAY_KEY_WRITE=0; | |||||
| drop table if exists wx_data_rule_target; | |||||
| CREATE TABLE wx_data_rule_target ( | |||||
| `id` bigint(20) NOT NULL, | |||||
| `parent` bigint(20) NOT NULL COMMENT '父级', | |||||
| `name` varchar(50) NOT NULL COMMENT '名称', | |||||
| `tag` varchar(50) DEFAULT NULL COMMENT '标签', | |||||
| `create_time` datetime DEFAULT NULL COMMENT '创建时间', | |||||
| `update_time` datetime DEFAULT NULL COMMENT '更新时间', | |||||
| PRIMARY KEY (`id`), | |||||
| UNIQUE `id_UNIQUE` USING BTREE (`id`) comment '' | |||||
| ) ENGINE=`InnoDB` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ROW_FORMAT=DYNAMIC COMMENT='数据权限目标' CHECKSUM=0 DELAY_KEY_WRITE=0; | |||||
| insert into `wx_data_rule_target` ( `id`, `parent`, `name`, `tag`, `create_time`, `update_time`) values ( '1', '0', '商户商铺', '', '2019-08-26 13:23:25', '2019-08-26 13:23:27'); | |||||
| insert into `wx_data_rule_target` ( `id`, `parent`, `name`, `tag`, `create_time`, `update_time`) values ( '2', '0', '合同管理', '', '2019-08-26 13:32:04', '2019-08-26 13:32:07'); | |||||
| insert into `wx_data_rule_target` ( `id`, `parent`, `name`, `tag`, `create_time`, `update_time`) values ( '101','1', '商户列表', 'merchant_list', '2019-08-26 13:32:17', '2019-08-26 13:32:19'); | |||||
| insert into `wx_data_rule_target` ( `id`, `parent`, `name`, `tag`, `create_time`, `update_time`) values ( '102','1', '解单数据', 'merchant_trade', '2019-08-26 13:33:24', '2019-08-26 13:33:25'); | |||||
| insert into `wx_data_rule_target` ( `id`, `parent`, `name`, `tag`, `create_time`, `update_time`) values ( '201','2', '租金合同', 'rent_contract_list', '2019-08-26 13:34:17', '2019-08-26 13:34:20'); | |||||
| insert into `wx_data_rule_target` ( `id`, `parent`, `name`, `tag`, `create_time`, `update_time`) values ( '202','2', '物业合同', 'property_contract_list', '2019-08-26 13:34:45', '2019-08-26 13:34:47'); | |||||
| insert into `wx_data_rule_target` ( `id`, `parent`, `name`, `tag`, `create_time`, `update_time`) values ( '203','2', '租金物业合同', 'rent_property_contract_list', '2019-08-26 13:36:23', '2019-08-26 13:36:25'); | |||||
| @@ -0,0 +1 @@ | |||||
| alter table wx_user_data_rule add unique uni_user(user_id); | |||||
| @@ -0,0 +1,13 @@ | |||||
| alter table wx_order | |||||
| add `pos_order_create_time` bigint(20) NULL COMMENT 'POS系统订单创建时间'; | |||||
| alter table wx_pay_order | |||||
| add `pos_pay_order_time` bigint(20) NULL COMMENT '支付订单创建时间,来源于POS', | |||||
| add `pos_pay_order_no` varchar(20) NULL COMMENT '支付订单流水号, 来源于POS, 第三方(微信、支付宝、富茂预付卡)支付订单流水号,富茂优惠券ID,现金和富茂会员折扣时为空', | |||||
| add `pos_pay_desc` varchar(100) NULL COMMENT 'POS支付描述', | |||||
| modify `pos_pay_id` bigint(20) NULL COMMENT '支付订单号,来源于POS'; | |||||
| alter table pos_mall_config | |||||
| modify `discount` tinyint(6) NOT NULL DEFAULT '0' COMMENT '会员折扣是否开启,0-禁用,1-可用', | |||||
| modify `coupon` tinyint(6) NOT NULL DEFAULT '0' COMMENT '会员优惠券是否开启,0-禁用,1-单选可用,2-多选可用', | |||||
| modify `card` tinyint(6) NOT NULL DEFAULT '0' COMMENT '会员消费卡是否开启,0-禁用,1-可用' after `coupon`; | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table wx_pay_order | |||||
| change column `pos_pay_desc` `pos_pay_des` varchar(100) NULL COMMENT 'POS支付描述'; | |||||
| @@ -0,0 +1,81 @@ | |||||
| alter table wx_flow_config modify `parent_id` BIGINT(20) NULL DEFAULT NULL; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 789) parent_id, | |||||
| '789' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 790) parent_id, | |||||
| '790' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1000) parent_id, | |||||
| '1000' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1001) parent_id, | |||||
| '1001' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1002) parent_id, | |||||
| '1002' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1003) parent_id, | |||||
| '1003' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1004) parent_id, | |||||
| '1004' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1005) parent_id, | |||||
| '1005' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1006) parent_id, | |||||
| '1006' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1007) parent_id, | |||||
| '1007' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1008) parent_id, | |||||
| '1008' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1009) parent_id, | |||||
| '1009' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1010) parent_id, | |||||
| '1010' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1011) parent_id, | |||||
| '1011' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1012) parent_id, | |||||
| '1012' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `sort`) | |||||
| select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, | |||||
| (select id from wx_flow_config where name = '账单审批' and tenant_id = 1013) parent_id, | |||||
| '1013' tenant_id, '结算单审核' name, 10 type, 0 model_id, 2 sort from dual; | |||||
| @@ -0,0 +1 @@ | |||||
| update mall_permission set parent_id=5,icon='icon-quanyiguanli-' where id=513; | |||||
| @@ -0,0 +1,5 @@ | |||||
| alter table wx_pay_order | |||||
| add `pos_payment_type` tinyint(6) NULL COMMENT '支付方式: 0微信;1支付宝;2现金;3会员折扣;4优惠券;5预付卡;6银行卡,来源于POS' after `pay_from`, | |||||
| modify `ip` varchar(20) NULL COMMENT 'ip地址', | |||||
| change column `pos_pay_id` `pos_pay_order_id` bigint(20) NULL COMMENT 'POS支付订单ID', | |||||
| change column `type` `pay_from` tinyint(6) NULL COMMENT '支付类型(0:C端微信支付, 1:POS支付)'; | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table wx_bill_rent | |||||
| add column `bus_discount_ratio` varchar(500) NULL DEFAULT NULL COMMENT '联营扣点率'; | |||||
| @@ -0,0 +1,28 @@ | |||||
| INSERT INTO `mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) | |||||
| VALUES | |||||
| (417, '结算管理', 415, 'Y', NULL, 1, NULL, NULL, 'auditManage', 'icon-jiesuan', 0, 417); | |||||
| 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,50,101,102,103,104,105,106,107,108,201,202,203,204,205,206,211,212,221,222,251,301,302,303,304,305,306,401,402,403,404,405,406,407,408,409,410,411,412,413,414,417,501,502,503,504,505,506,507,508,509,511,512,513,521,522,523,531,532,533,591,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932,951,952,961,962,965,966,967,968]' | |||||
| ), | |||||
| (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,501,502,503,504,505,506,507,508,509,511,512,513,521,522,523,531,532,533,591,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,681,682,683,684,685,691,692,693,694,695,701,702,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,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932]' | |||||
| ) | |||||
| ; | |||||
| @@ -0,0 +1 @@ | |||||
| update `mall_sale_type` set `menus`='[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 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, 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, 681, 682, 683, 684, 685, 691, 692, 693, 694, 695, 701, 702, 711, 712, 713, 901, 902, 903, 931, 932, 951, 952, 961, 962, 965, 966, 967, 968]' where `id`='1'; | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table wx_rent_contract modify adjust_ratio_way smallint(2) default 1 comment '年租金调整方式1按比例2按金额3自定义'; | |||||
| alter table wx_property_contract modify adjust_ratio_way smallint(2) default 1 comment '年租金调整方式1按比例2按金额3自定义'; | |||||
| @@ -0,0 +1,21 @@ | |||||
| alter table wx_bill_rent | |||||
| add column `freeze` SMALLINT (1) NULL DEFAULT 0 COMMENT '0正常1冻结'; | |||||
| alter table wx_bill_rent_deposit | |||||
| add column `freeze` SMALLINT (1) NULL DEFAULT 0 COMMENT '0正常1冻结'; | |||||
| alter table wx_bill_property | |||||
| add column `freeze` SMALLINT (1) NULL DEFAULT 0 COMMENT '0正常1冻结'; | |||||
| alter table wx_bill_property_deposit | |||||
| add column `freeze` SMALLINT (1) NULL DEFAULT 0 COMMENT '0正常1冻结'; | |||||
| alter table wx_bill_daily | |||||
| add column `freeze` SMALLINT (1) NULL DEFAULT 0 COMMENT '0正常1冻结'; | |||||
| alter table wx_bill_other | |||||
| add column `freeze` SMALLINT (1) NULL DEFAULT 0 COMMENT '0正常1冻结'; | |||||
| alter table wx_bill_other_deposit | |||||
| add column `freeze` SMALLINT (1) NULL DEFAULT 0 COMMENT '0正常1冻结'; | |||||
| @@ -0,0 +1,24 @@ | |||||
| 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,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,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932,951,952,961,962,965,966,967,968]' | |||||
| ), | |||||
| (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,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,681,682,683,684,685,691,692,693,694,695,701,702,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932]' | |||||
| ) | |||||
| ; | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table wx_bill_rent | |||||
| add column `join_rent_price` SMALLINT (1) NULL DEFAULT 0 COMMENT '联营租金'; | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table wx_bill_rent | |||||
| modify column `join_rent_price` BIGINT(20) NULL DEFAULT NULL COMMENT '联营扣点率'; | |||||
| @@ -0,0 +1,24 @@ | |||||
| 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,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932,951,952,961,962,965,966,967,968]' | |||||
| ), | |||||
| (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,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,681,682,683,684,685,691,692,693,694,695,701,702,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,681,682,683,684,685,691,692,693,694,695,701,702,711,712,713,901,902,903,931,932]' | |||||
| ) | |||||
| ; | |||||
| @@ -0,0 +1,2 @@ | |||||
| alter table wx_bill_settle_record | |||||
| add column `desc` VARCHAR (800) NULL DEFAULT NULL COMMENT '描述'; | |||||
| @@ -0,0 +1,3 @@ | |||||
| alter table wx_merchant_subsidy | |||||
| add column `freeze` SMALLINT (1) NULL DEFAULT 0 COMMENT '0正常1冻结'; | |||||
| @@ -0,0 +1,3 @@ | |||||
| ALTER TABLE `wx_card_spend` | |||||
| change `from` `pay_from` tinyint(6) NOT NULL DEFAULT '0' COMMENT '来源(0:C端小程序扫一扫, 1:POS)', | |||||
| drop column `pos_refund_status`; | |||||
| @@ -0,0 +1 @@ | |||||
| update wx_flow_config set type=21 where name = '结算单审核'; | |||||
| @@ -0,0 +1 @@ | |||||
| alter table wx_bill_daily add column build_way tinyint(3) default 1 comment '创建方式1手动2自动3导入'; | |||||
| @@ -0,0 +1,2 @@ | |||||
| ALTER TABLE `wx_credit_history` | |||||
| CHANGE COLUMN `business_id` `business_id` integer(11) DEFAULT NULL COMMENT '业态ID(计算新增积分时使用)'; | |||||