diff --git a/mallinkAdmin/pom.xml b/mallinkAdmin/pom.xml index b4e69011d..3b9d17bd9 100644 --- a/mallinkAdmin/pom.xml +++ b/mallinkAdmin/pom.xml @@ -47,13 +47,15 @@ 5.2.4 - + - net.sourceforge.tess4j - tess4j - 4.5.2 + com.iformall + mallinkOcr + 1.0 + + diff --git a/mallinkAdmin/src/main/java/com/iformall/UserApplication.java b/mallinkAdmin/src/main/java/com/iformall/UserApplication.java index 8562fc985..ae89ad797 100644 --- a/mallinkAdmin/src/main/java/com/iformall/UserApplication.java +++ b/mallinkAdmin/src/main/java/com/iformall/UserApplication.java @@ -34,6 +34,9 @@ public class UserApplication { @Value("${fm.upload_dir}") private String uploadDir; + @Value("${fm.ocr_data}") + private String ocrData; + @Bean public boolean isFmException() { return fmException; @@ -53,6 +56,11 @@ public class UserApplication { public String fmUploadDir() { return uploadDir; } + + @Bean + public String ocrData() { + return ocrData; + } public static void main(String[] args) { SpringApplication.run(UserApplication.class, args); diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMallBuildingController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMallBuildingController.java index 6d5722c5a..32e377604 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMallBuildingController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMallBuildingController.java @@ -4,14 +4,21 @@ 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.WxMallBuilding; import com.iformall.domain.po.WxMallFloor; import com.iformall.service.WxMallBuildingService; +import com.iformall.utils.Constant; +import com.iformall.utils.RedisCacheUtils; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.web.bind.annotation.*; +import java.util.List; + @RestController @RequestMapping("wxMallBuilding") public class WxMallBuildingController extends BaseController { @@ -20,6 +27,10 @@ public class WxMallBuildingController extends BaseController { @Autowired private WxMallBuildingService wxMallBuildingService; + @Autowired + @Qualifier("objectCommonRedisTemplate") + RedisTemplate objectCommonRedisTemplate; + @ApiOperation("获取楼层楼座数据") @GetMapping("getbuildingfloorlist") @SystemControllerLog(description = "商城-楼座-获取楼层楼座数据") @@ -28,6 +39,33 @@ public class WxMallBuildingController extends BaseController { return wxMallBuildingService.getBuildingFloorList(getTenantInfo()); } + @ApiOperation("保存楼层楼座地图") + @PostMapping("saveFloorImg") + @SystemControllerLog(description = "商城-楼座/楼层-保存地图") + public ResultData saveFloorImg(@RequestBody List record) { + logger.debug("[" + getIpAddr() + "] WxMallBuildingController::addBuildingAndFloor"); + if(record == null && record.size() > 0) { + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); + } + for (WxMallBuilding building: record) { + List floors = building.getFloors(); + if(floors != null && floors.size() > 0){ + for (WxMallFloor floor:floors) { + if (floor.getId() == null) { + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); + } + floor.updateTenantInfo(getTenantInfo()); + wxMallBuildingService.saveFloorImg(floor); + + } + } + } + + String key = Constant.mallBuildingPrev + getTenantInfo().getTenantId(); + RedisCacheUtils.removeCache(objectCommonRedisTemplate, key); + return new ResultData(); + } + @ApiOperation("保存楼层楼座面积") @PostMapping("saveFloorArea") @SystemControllerLog(description = "商城-楼座/楼层-保存面积") diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java index e2c34cb06..5104a37c2 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java @@ -552,6 +552,23 @@ public class WxRentContractController extends WxContractBaseController { return new ResultData(Result.ERROR,e.getMessage()); } + //如果是租金+物业合同,如果没有物业合同或者物业合同不是草稿状态,不能提交审核 + if (contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { + if (null == wxRentContract.getPropertyId()) { + return new ResultData(Result.ERROR,"未创建物业合同,请先完善。"); + } + WxPropertyContract property = wxPropertyContractService.getSimpleDetail(wxRentContract.getPropertyId()); + if (null == property) { + return new ResultData(Result.ERROR,"未创建物业合同,请先完善。"); + } + if (property.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue()) { + return new ResultData(Result.ERROR,"物业合同未完善,请先完善。"); + } + if (property.getStatus().intValue() != EnumRentContractStatus.DRAFT.getCode().intValue()) { + return new ResultData(Result.ERROR,"物业合同当前状态不能直接生效。"); + } + } + wxRentContractService.updateRentContractStatus(wxRentContract.getId(),false); if(contract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()) { wxPropertyContractService.updatePropertyContractStatus(wxRentContract.getPropertyId()); @@ -634,12 +651,6 @@ public class WxRentContractController extends WxContractBaseController { if (property.getStatus().intValue() != EnumRentContractStatus.DRAFT.getCode().intValue()) { return new ResultData(Result.ERROR,"物业合同当前状态不能提交审批。"); } - - WxPropertyContract wpc = new WxPropertyContract(); - wpc.setStatus(EnumRentContractStatus.DRAFT.getCode()); - wpc.setRentContractId(rentContract.getId()); - wpc.setOperationType(EnumRentShopType.SHOP.getCode()); - List list = wxPropertyContractService.findList(wpc); } if(rentContract.getOperationType().intValue() == EnumContractOperationType.PART.getCode().intValue()) { diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/datatower/DataTowerController.java b/mallinkAdmin/src/main/java/com/iformall/controller/datatower/DataTowerController.java index a24b97ce8..468e87106 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/datatower/DataTowerController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/datatower/DataTowerController.java @@ -80,6 +80,17 @@ public class DataTowerController extends BaseController { return new ResultData(data); } + + @ApiOperation("新版本查询客流") + @GetMapping("/queryCustomerNewVersion") + @SystemControllerLog(description = "数据塔台-新版本查询客流") + public ResultData queryCustomerNewVersion() { + logger.debug("[" + getIpAddr() + "] DataTowerController::queryCustomerNewVersion"); + + Map data = dataTowerService.queryCustomerNewVersion(getTenantInfo()); + + return new ResultData(data); + } @ApiOperation("查询客流") @GetMapping("/queryCustomerData") diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityController.java index 5ef94bdb3..87c71911f 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityController.java @@ -105,4 +105,12 @@ public class WxActivityController extends BaseController { return wxActivityService.sendToCampaign(id); } + @ApiOperation("从宣传页下线") + @PostMapping("offLineCampaign") + @SystemControllerLog(description = "活动-更新状态") + public ResultData offLineCampaign(@RequestBody WxActivity wxActivity) { + logger.debug("[" + getIpAddr() + "] WxActivityController::updateStatus"); + return wxActivityService.offLineCampaign(wxActivity); + } + } diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityJoinController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityJoinController.java index f53198f9b..a9bd6bb82 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityJoinController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityJoinController.java @@ -65,7 +65,11 @@ public class WxActivityJoinController extends BaseController { if (wxActivityJoin.getStatus() == null) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "status不能为空"); } - return wxActivityJoinService.modifyStatus(wxActivityJoin); + try { + return wxActivityJoinService.modifyStatus(wxActivityJoin); + } catch (MallinkException e) { + return new ResultData(e.getErrorCode(), e.getMessage()); + } } @ApiOperation("导出报名表") diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserFromController.java b/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserFromController.java new file mode 100644 index 000000000..d3de03d04 --- /dev/null +++ b/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserFromController.java @@ -0,0 +1,79 @@ +package com.iformall.controller.mem; + +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.WxCUserFrom; +import com.iformall.domain.vo.WxCUserFromVo; +import com.iformall.enums.EnumCUserFrom; +import com.iformall.service.WxCUserFromService; +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; + +@RestController +@RequestMapping("wxCUserFrom") +public class WxCUserFromController extends BaseController { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + private WxCUserFromService wxCUserFromService; + + @ApiOperation("分页列表接口") + @GetMapping("list") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) + @SystemControllerLog(description = "分享-列表") + public ResultData list(@ModelAttribute WxCUserFrom wxCUserFrom, Integer pageNum, Integer pageSize) { + logger.debug("[" + getIpAddr() + "] WxCUserCarController::list"); + if (null == wxCUserFrom) wxCUserFrom = new WxCUserFrom(); + wxCUserFrom.updateTenantInfo(getTenantInfo()); + final PageInfo page = wxCUserFromService.listAsPage(wxCUserFrom, pageNum, pageSize); + return new ResultData(page); + } + + @ApiOperation("根据id查询接口") + @GetMapping("/visits") + @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) + @SystemControllerLog(description = "分享-列表") + public ResultData visits(@ModelAttribute WxCUserFromVo wxCUserFromVo,Integer pageNum, Integer pageSize) { + logger.debug("[" + getIpAddr() + "] WxCUserCarController::findById"); + if (null == wxCUserFromVo) wxCUserFromVo = new WxCUserFromVo(); + if(wxCUserFromVo.getFromType() == null){ + wxCUserFromVo.setFromType(EnumCUserFrom.FROM_C_USER_BASIC_INFO.getCode()); + } + wxCUserFromVo.updateTenantInfo(getTenantInfo()); + final PageInfo page = wxCUserFromService.listAsVisitsPage(wxCUserFromVo, pageNum, pageSize); + return new ResultData(page); + } + + @GetMapping("/exportData") + @SystemControllerLog(description = "导出数据") + public void exportData(@ModelAttribute WxCUserFrom wxCUserFrom, HttpServletRequest request, HttpServletResponse response) { + if (null == wxCUserFrom) wxCUserFrom = new WxCUserFrom(); + wxCUserFrom.updateTenantInfo(getTenantInfo()); + wxCUserFromService.exportData(request, response, wxCUserFrom); + } + + @GetMapping("/exportDataVisits") + @SystemControllerLog(description = "导出数据") + public void exportDataVisits(@ModelAttribute WxCUserFromVo wxCUserFromVo, HttpServletRequest request, HttpServletResponse response) { + if (null == wxCUserFromVo) wxCUserFromVo = new WxCUserFromVo(); + wxCUserFromVo.updateTenantInfo(getTenantInfo()); + if(wxCUserFromVo.getFromType() == null){ + wxCUserFromVo.setFromType(EnumCUserFrom.FROM_C_USER_BASIC_INFO.getCode()); + } + wxCUserFromService.exportDataVisits(request, response, wxCUserFromVo); + } + + +} diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCreditHistoryController.java b/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCreditHistoryController.java index b0b22090c..1ec84780c 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCreditHistoryController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCreditHistoryController.java @@ -11,6 +11,7 @@ import com.iformall.domain.po.MallUserInfo; import com.iformall.domain.po.WxCreditHistory; import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.vo.MerchantCreditRankingVo; import com.iformall.domain.vo.WxCreditHistoryVo; import com.iformall.enums.EnumMerchantStatus; import com.iformall.enums.EnumScoreType; @@ -73,7 +74,7 @@ public class WxCreditHistoryController extends BaseController { } try { - Map result = wxCreditHistoryService.findByMerchantIdAndSpend(merchantId, spendStr, userId, getTenantInfo().getFinalTenantId()) ; + Map result = wxCreditHistoryService.findByMerchantIdAndSpend(merchantId, spendStr, userId) ; return new ResultData(result); } catch (MallinkException e) { return new ResultData(e.getErrorCode(),e.getMessage()); @@ -109,7 +110,7 @@ public class WxCreditHistoryController extends BaseController { wxCreditHistory.setChangePurpose(desc); try { wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId(),getTenantInfo()) ; - WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory); + WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory,getTenantInfo().getTenantId()); return new ResultData(Result.SUCCESS, "操作成功", credit); } catch (MallinkException e) { logger.error(e.getMessage()); @@ -173,4 +174,19 @@ public class WxCreditHistoryController extends BaseController { return new ResultData(Result.SUCCESS); } + @ApiOperation("门店排行榜") + @GetMapping("merchantCreditRanking") + @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 merchantCreditRanking(@ModelAttribute WxCreditHistory wxCreditHistory, Integer pageNum, Integer pageSize) { + logger.debug("[" + getIpAddr() + "] WxCreditHistoryController::merchantCreditRanking"); + if (null == wxCreditHistory) wxCreditHistory = new WxCreditHistory(); + TenantEntity tenantInfo = getTenantInfo(); + wxCreditHistory.updateTenantInfo(tenantInfo); + final PageInfo page = wxCreditHistoryService.listAsPageMcrv(wxCreditHistory, pageNum, pageSize); + return new ResultData(page); + } + } diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxScoreRulesController.java b/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxScoreRulesController.java index a0be99868..4ec4a677e 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxScoreRulesController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/mem/WxScoreRulesController.java @@ -4,9 +4,13 @@ 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.WxMall; import com.iformall.domain.po.WxScoreRules; import com.iformall.domain.po.base.TenantEntity; import com.iformall.enums.EnumCreditLockedStatus; +import com.iformall.enums.EnumGroupSupport; +import com.iformall.enums.EnumScoreRules; +import com.iformall.service.WxMallService; import com.iformall.service.WxScoreRulesService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -25,6 +29,9 @@ public class WxScoreRulesController extends BaseController { @Autowired private WxScoreRulesService wxScoreRulesService; + @Autowired + private WxMallService wxMallService; + @ApiOperation("成长值配置") @GetMapping("setting") @SystemControllerLog(description = "成长值-配置") @@ -42,11 +49,27 @@ public class WxScoreRulesController extends BaseController { @SystemControllerLog(description = "成长值-积分-配置-新增") public ResultData add(@RequestBody WxScoreRules wxScoreRules) { logger.debug("[" + getIpAddr() + "] WxScoreRulesController::add"); - TenantEntity tenantEntity = ifParentUpdateTenantInfo(); - if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { - return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); + if(wxScoreRules.getType() != null){ + if(wxScoreRules.getType().equals(EnumScoreRules.SCORE.getCode()) || wxScoreRules.getType().equals(EnumScoreRules.CREDIT.getCode())){ + TenantEntity tenantEntity = ifParentUpdateTenantInfo(); + if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { + return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "广场用户无此权限"); + } + wxScoreRules.updateTenantInfo(tenantEntity); + }else if(wxScoreRules.getType().equals(EnumScoreRules.CREDIT_DOUBLE.getCode())){ + TenantEntity tenantEntity = getTenantInfo(); + WxMall mall = wxMallService.getByTenantId(getUser().getTenantId()); + if((mall.getGroupSupport().equals(EnumGroupSupport.SUPPORT.getCode()) && StringUtils.isBlank(getUser().getParentTenantId())) || + StringUtils.isBlank(tenantEntity.getTenantId())){ + return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(), "集团用户无此权限"); + } + wxScoreRules.updateTenantInfo(tenantEntity); + }else{ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"type"); + } + }else{ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL,"type"); } - wxScoreRules.updateTenantInfo(tenantEntity); wxScoreRulesService.saveOrUpdate(wxScoreRules); return new ResultData(); } @@ -55,11 +78,23 @@ public class WxScoreRulesController extends BaseController { @GetMapping("/credit_rules") @SystemControllerLog(description = "积分-配置") public ResultData creditRulesList() { - logger.debug("[" + getIpAddr() + "] WxScoreRulesController::list"); + logger.debug("[" + getIpAddr() + "] creditRulesList::list"); WxScoreRules scoreRules = wxScoreRulesService.getCreditRules(getTenantInfo().getFinalTenantId()); return new ResultData(scoreRules); } + @ApiOperation("积分倍率") + @GetMapping("/credit_double") + @SystemControllerLog(description = "积分-配置") + public ResultData creditDoubleRulesList() { + logger.debug("[" + getIpAddr() + "] creditDoubleRulesList::list"); + if(StringUtils.isBlank(getTenantInfo().getTenantId())){ + return new ResultData(ErrorCode.USER_NO_PERMISSION,"集团用户无此权限"); + } + WxScoreRules scoreRules = wxScoreRulesService.getCreditDoubleRules(getTenantInfo().getTenantId()); + return new ResultData(scoreRules); + } + @ApiOperation("更新积分开关状态") @PostMapping("updateCreditLocked") @SystemControllerLog(description = "更新积分开关状态") diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/ocr/WxOcrController.java b/mallinkAdmin/src/main/java/com/iformall/controller/ocr/WxOcrController.java new file mode 100644 index 000000000..33e10eee1 --- /dev/null +++ b/mallinkAdmin/src/main/java/com/iformall/controller/ocr/WxOcrController.java @@ -0,0 +1,223 @@ +package com.iformall.controller.ocr; + +import com.github.pagehelper.PageInfo; +import com.iformall.annotation.SystemControllerLog; +import com.iformall.common.ErrorCode; +import com.iformall.common.Result; +import com.iformall.common.ResultData; +import com.iformall.controller.base.BaseController; +import com.iformall.domain.po.MallUserInfo; +import com.iformall.domain.po.WxMall; +import com.iformall.domain.po.WxMerchant; +import com.iformall.domain.po.WxMerchantOcrModel; +import com.iformall.domain.po.WxOcrModel; +import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.po.base.BaseEntity.SortField; +import com.iformall.enums.EnumFromType; +import com.iformall.enums.EnumRentStartType; +import com.iformall.ocr.FormallTess4j; +import com.iformall.ocr.FormallTess4jTrain; +import com.iformall.service.WxMallService; +import com.iformall.service.WxMerchantService; +import com.iformall.service.WxOcrService; + +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Date; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +@RestController +@RequestMapping("ocr") +public class WxOcrController extends BaseController { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + private WxOcrService ocrService; + @Autowired + private WxMerchantService merchantService; + @Autowired + private String ocrData; + + /** + * 模板列表 + * @param wxRentContract + * @param pageNum + * @param pageSize + * @return + */ + @GetMapping("/modelList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) + public ResultData modelList(@ModelAttribute WxOcrModel ocrModel, Integer pageNum, Integer pageSize) { + if (null == ocrModel) { + ocrModel = new WxOcrModel(); + } + ocrModel.setSortColumns(SortField.Createtime_DESC); + PageInfo page = ocrService.listOcrModelAsPage(ocrModel, pageNum, pageSize); + return new ResultData(page); + } + + /** + * 更新模板 + * @param wxRentContract + * @return + */ + @PostMapping("updateModel") + public ResultData updateModel(@RequestBody WxOcrModel ocrModel) { + return ocrService.saveOrUpdateOcrModel(ocrModel); + } + + /** + * 根据商户查询模板 + * @param wxRentContract + * @return + */ + @GetMapping("merchantModel") + @ApiImplicitParams({ + @ApiImplicitParam(name = "merchantId", value = "商户编号", dataType = "Long", paramType = "query", required = true) + }) + public ResultData merchantModel(Long merchantId) { + WxMerchant merchant = merchantService.getById(merchantId); + if (null == merchant) { + return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"商户数据不存在"); + } + return new ResultData(ocrService.getMerchantOcrModel(merchantId, merchant.getTenantId(), merchant.getParentTenantId())); + } + + /** + * 更新商户模板 + * @param wxRentContract + * @return + */ + @PostMapping("updateMerchantModel") + public ResultData updateMerchantModel(@RequestBody WxMerchantOcrModel merchantModel) { + return ocrService.saveOrUpdateMerchantOcrModel(merchantModel); + } + + /** + * 删除商户模板 + * @param wxRentContract + * @return + */ + @PostMapping("deleteMerchantModel") + public ResultData deleteMerchantModel(@RequestBody WxMerchantOcrModel merchantModel) { + return ocrService.deleteMerchantOcrModel(merchantModel.getId()); + } + + /** + * 获取训练步骤 + * @return + */ + @GetMapping("getTrainSteps") + @ApiImplicitParams({ + @ApiImplicitParam(name = "modelId", value = "模板编号", dataType = "Long", paramType = "query", required = true) + }) + public ResultData getTrainSteps(Long modelId) { + WxOcrModel model = ocrService.getOcrModelById(modelId); + if (null == model) { + return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"ocr模板不存在"); + } + return new ResultData(FormallTess4jTrain.getTrainSteps(model.getLangCode(), model.getFontName())); + } + + /** + *测试训练结果 + * @return + */ + @PostMapping(value = "/testTrain", consumes = "multipart/*", headers = "content-type=multipart/form-data") + public ResultData testTrain(@RequestParam("file") MultipartFile multiReq,@RequestParam("modelId") Long modelId) { + try { + WxOcrModel model = ocrService.getOcrModelById(modelId); + if (null == model) { + return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"ocr模板不存在"); + } + File file = multipartFileToFile(multiReq); + + String result = FormallTess4j.testDoOCR_File(ocrData, file, model.getFontName()); + + file.delete(); + + return new ResultData(result); + + } catch (Exception e) { + logger.error("testTrain error.",e); + return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR.getCode(),"解析失败。"+e.getMessage()); + } + } + + + private File multipartFileToFile(MultipartFile file) { + File toFile = null; + if (file.equals("") || file.getSize() <= 0) { + file = null; + } else { + InputStream ins = null; + try { + ins = file.getInputStream(); + toFile = new File(file.getOriginalFilename()); + inputStreamToFile(ins, toFile); + ins.close(); + } catch (IOException e) { + logger.error("multipartFileToFile error.",e); + }finally { + if (null != ins) { + try { + ins.close(); + } catch (IOException e) { + logger.error("multipartFileToFile error.",e); + } + } + } + } + return toFile; + } + + private void inputStreamToFile(InputStream ins, File file) { + OutputStream os = null; + try { + os = new FileOutputStream(file); + int bytesRead = 0; + byte[] buffer = new byte[8192]; + while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) { + os.write(buffer, 0, bytesRead); + } + os.close(); + ins.close(); + } catch (Exception e) { + logger.error("inputStreamToFile error.",e); + }finally { + if (null != os) { + try { + os.close(); + } catch (IOException e) { + logger.error("inputStreamToFile error.",e); + } + } + if (null != ins) { + try { + ins.close(); + } catch (IOException e) { + logger.error("inputStreamToFile error.",e); + } + } + } + } + + + +} diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/sys/UploadController.java b/mallinkAdmin/src/main/java/com/iformall/controller/sys/UploadController.java index f3d91fadb..77b59c2af 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/sys/UploadController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/sys/UploadController.java @@ -119,7 +119,7 @@ public class UploadController extends BaseController { return data; } catch (Exception e) { - logger.error(e.getMessage()); + logger.error("解析图片",e); return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR); } } diff --git a/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java b/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java index c23177ae6..b4fba9dd5 100644 --- a/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java +++ b/mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java @@ -41,12 +41,14 @@ public class TenantInfoImpl implements TenantInfo { "wx_level_config", "wx_c_user_basic_info", "wx_c_user_basic_child", + "wx_c_user_basic_sign", "wx_credit_history", "wx_score_history", "wx_c_user_tags", "wx_weapp_ext_set", "wx_msg_validationcode_model", - "sys_notice"}; + "sys_notice", + "wx_ocr_model"}; private static String[] filterSubTables = new String[] { "wx_mall", @@ -72,9 +74,11 @@ public class TenantInfoImpl implements TenantInfo { "wx_weapp_release_status", "wx_c_user_basic_info", "wx_c_user_basic_child", + "wx_c_user_basic_sign", "mem_coupon_from_dsp", "wx_msg_validationcode_model", - "sys_notice"}; + "sys_notice", + "wx_ocr_model"}; @Override public String getTenantId() { diff --git a/mallinkAdmin/src/main/resources/application-dev.yml b/mallinkAdmin/src/main/resources/application-dev.yml index ede46d98e..3609692ca 100644 --- a/mallinkAdmin/src/main/resources/application-dev.yml +++ b/mallinkAdmin/src/main/resources/application-dev.yml @@ -163,11 +163,12 @@ jasypt: password: oRqdnDbK5pj3eMmB fm: - exception: false - exception_emails: zhengfangyuan@iformall.com,xuxiaohu@iformall.com + exception: true + exception_emails: xuxiaohu@iformall.com deploy: 1 open: true upload_dir: /home/test/server/uploads/ + ocr_data: /root/ocr_data/ ueditor: config: config.json diff --git a/mallinkAdmin/src/main/resources/application-prod.yml b/mallinkAdmin/src/main/resources/application-prod.yml index 20157d021..ccf85c8ad 100644 --- a/mallinkAdmin/src/main/resources/application-prod.yml +++ b/mallinkAdmin/src/main/resources/application-prod.yml @@ -124,6 +124,7 @@ fm: deploy: 3 open: true upload_dir: /root/uploads/ + ocr_data: /root/ocr_data/ ueditor: config: config.json diff --git a/mallinkAdmin/src/main/resources/db/migration/V202101120001__ADD_wx_mall_floor.sql b/mallinkAdmin/src/main/resources/db/migration/V202101120001__ADD_wx_mall_floor.sql new file mode 100644 index 000000000..7d139160e --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V202101120001__ADD_wx_mall_floor.sql @@ -0,0 +1,2 @@ +ALTER TABLE `wx_mall_floor` +ADD COLUMN `floor_map` json COMMENT '地图' AFTER `total_area`; \ No newline at end of file diff --git a/mallinkAdmin/src/main/resources/db/migration/V202101130001__ADD_wx_c_user_basic_info.sql b/mallinkAdmin/src/main/resources/db/migration/V202101130001__ADD_wx_c_user_basic_info.sql new file mode 100644 index 000000000..48faf2326 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V202101130001__ADD_wx_c_user_basic_info.sql @@ -0,0 +1,299 @@ +ALTER TABLE `wx_c_user_basic_info_0` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_1` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_2` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_3` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_4` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_5` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_6` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_7` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_8` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_9` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_10` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_11` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_12` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_13` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_14` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_15` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_16` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_17` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_18` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_19` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_20` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_21` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_22` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_23` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_24` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_25` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_26` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_27` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_28` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_29` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_30` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_31` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_32` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_33` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_34` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_35` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_36` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_37` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_38` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_39` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_40` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_41` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_42` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_43` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_44` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_45` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_46` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_47` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_48` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_49` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_50` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_51` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_52` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_53` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_54` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_55` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_56` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_57` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_58` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_59` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_60` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_61` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_62` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_63` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_64` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_65` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_66` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_67` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_68` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_69` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_70` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_71` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_72` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_73` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_74` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_75` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_76` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_77` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_78` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_79` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_80` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_81` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_82` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_83` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_84` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_85` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_86` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_87` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_88` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_89` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_90` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_91` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_92` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_93` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_94` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_95` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_96` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_97` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_98` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; + +ALTER TABLE `wx_c_user_basic_info_99` +ADD COLUMN `qr_code` varchar(500) COMMENT '二维码地址' AFTER `tag_scan_time`; diff --git a/mallinkAdmin/src/main/resources/db/migration/V202101140001__memberImport.sql b/mallinkAdmin/src/main/resources/db/migration/V202101140001__memberImport.sql new file mode 100644 index 000000000..2a79bbaa9 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V202101140001__memberImport.sql @@ -0,0 +1,16 @@ +--加推广菜单 +INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (514, '推广数据', 5, 'Y', NULL, 1, NULL, NULL, 'memberImport', 'icon-tuiguang', 0, 503); + +--销售类型加权限 +update mall_sale_type set menus = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 201, 202, 203, 204, 205, 206, 209, 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, 418, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 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, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004]' where id=1; +update mall_sale_type set menus = '[1, 2, 4, 5, 6, 7, 8, 9, 10, 50, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205, 209, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 501, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 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, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 931, 932, 951, 961]' where id=2; +update mall_sale_type set menus = '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 514, 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, 646, 651, 661, 662, 663, 664, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 901, 902, 903, 904, 905, 931, 932]' where id=3; +update mall_sale_type set menus = '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 212, 221, 222, 251, 409, 410, 411, 416, 418, 501, 502, 503, 504, 505, 506, 507, 508, 511, 512, 513, 514, 521, 522, 523, 531, 532, 591, 601, 602, 604, 605, 606, 607, 608, 610, 611, 612, 622, 623, 624, 625, 626, 641, 642, 643, 644, 661, 662, 663, 664, 671, 672, 674, 675, 681, 682, 684, 685, 686, 691, 692, 693, 694, 695, 711, 901, 902, 904, 905, 931, 932]' where id=4; + +--所有广场管理员角色加权限 +INSERT INTO `mall_role_permission`(`id`, `tenant_id`, `parent_tenant_id`, `permission_id`, `role_id`) + select CEILING(RAND()*90000000000+10000000000) ,mui.tenant_id,mui.parent_tenant_id, 514,mur.role_id +from mall_user_info mui +left join mall_user_role mur on mui.id = mur.uid +where mui.is_admin = 1 and mur.role_id is not null GROUP BY mur.role_id; + diff --git a/mallinkAdmin/src/main/resources/db/migration/V202101190001__wx_score_rules.sql b/mallinkAdmin/src/main/resources/db/migration/V202101190001__wx_score_rules.sql new file mode 100644 index 000000000..562929495 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V202101190001__wx_score_rules.sql @@ -0,0 +1,5 @@ +INSERT INTO `mallink`.`wx_score_rules`(`id`, `tenant_id`, `type`, `scale`) +select CEILING(RAND()*90000000000+10000000000),`tenant_id`,4,`scale` from wx_score_rules where type = 2 and scale > 10; + +--集团版手动处理,(集团版不存在这类数据,子集团生日倍率数据与原集团规则相等) +--目前集团版(1008-1020-----1028)(1026-1027-----1025) \ No newline at end of file diff --git a/mallinkAdmin/src/main/resources/db/migration/V202101210001__wx_c_user_basic_sign.sql b/mallinkAdmin/src/main/resources/db/migration/V202101210001__wx_c_user_basic_sign.sql new file mode 100644 index 000000000..b9e94193b --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V202101210001__wx_c_user_basic_sign.sql @@ -0,0 +1,1999 @@ +CREATE TABLE `wx_c_user_basic_sign_0` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_1` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_2` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_3` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_4` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_5` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_6` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_7` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_8` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_9` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_10` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_11` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_12` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_13` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_14` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_15` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_16` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_17` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_18` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_19` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_20` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_21` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_22` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_23` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_24` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_25` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_26` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_27` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_28` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_29` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_30` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_31` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_32` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_33` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_34` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_35` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_36` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_37` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_38` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_39` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_40` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_41` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_42` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_43` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_44` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_45` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_46` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_47` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_48` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_49` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_50` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_51` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_52` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_53` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_54` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_55` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_56` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_57` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_58` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_59` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_60` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_61` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_62` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_63` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_64` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_65` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_66` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_67` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_68` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_69` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_70` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_71` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_72` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_73` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_74` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_75` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_76` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_77` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_78` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_79` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_80` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_81` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_82` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_83` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_84` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_85` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_86` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_87` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_88` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_89` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_90` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_91` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_92` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_93` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_94` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_95` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_96` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_97` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_98` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `wx_c_user_basic_sign_99` ( + `id` bigint(20) NOT NULL, + `tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `parent_tenant_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `type` smallint(1) NOT NULL DEFAULT 1 COMMENT '1:签到', + `signin_date` datetime(0) NOT NULL COMMENT '签到时间', + `create_date` datetime(0) NOT NULL, + `update_date` datetime(0) NOT NULL, + `continue_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月连续签到天数', + `count_month_sign` int(11) NOT NULL COMMENT '截止当前签到时间当月累计签到天数', + `continue_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年连续签到天数', + `count_year_sign` int(11) NOT NULL COMMENT '截止当前签到时间当年累计签到天数', + `continue_sign` int(11) NOT NULL COMMENT '截止当前签到时间连续签到天数', + `count_sign` int(11) NOT NULL COMMENT '截止当前签到时间累计签到天数', + `mark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `tenant_id`(`tenant_id`, `user_id`, `signin_date`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic; diff --git a/mallinkAdmin/src/main/resources/db/migration/V202101250001__user_sign_update_wx_score_rules.sql b/mallinkAdmin/src/main/resources/db/migration/V202101250001__user_sign_update_wx_score_rules.sql new file mode 100644 index 000000000..968e4f502 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V202101250001__user_sign_update_wx_score_rules.sql @@ -0,0 +1,12 @@ +--type=2 积分规则,追加签到规则 +update wx_score_rules set rules = JSON_ARRAY_APPEND(rules, '$',CAST('{"id": 17, "desc": "每日签到", "step": 1, "limit": 1, "score": 0}' AS JSON)) +where type = 2; +update wx_score_rules set rules = JSON_ARRAY_APPEND(rules, '$',CAST('{"id": 18, "desc": "连续签到7天奖励", "step": 1, "limit": 1, "score": 0}' AS JSON)) +where type = 2; +update wx_score_rules set rules = JSON_ARRAY_APPEND(rules, '$',CAST('{"id": 19, "desc": "连续签到14天奖励", "step": 1, "limit": 1, "score": 0}' AS JSON)) +where type = 2; +update wx_score_rules set rules = JSON_ARRAY_APPEND(rules, '$',CAST('{"id": 20, "desc": "连续签到28天奖励", "step": 1, "limit": 1, "score": 0}' AS JSON)) +where type = 2; + +--type=2 积分规则,每日登陆去掉-- 缓存--缓存--缓存 +update wx_score_rules set rules = JSON_REMOVE(rules, "$[0]") where type = 2; \ No newline at end of file diff --git a/mallinkAdmin/src/main/resources/db/migration/V202101260001__ocr.sql b/mallinkAdmin/src/main/resources/db/migration/V202101260001__ocr.sql new file mode 100644 index 000000000..9300cdfa2 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V202101260001__ocr.sql @@ -0,0 +1,43 @@ +CREATE TABLE `wx_merchant_ocr_model` ( + `id` bigint(20) NOT NULL, + `merchant_id` bigint(20) NOT NULL COMMENT '商户编号', + `ocr_model_id` bigint(20) NOT NULL COMMENT 'ocr模板编号', + `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `tenant_id` varchar(5) DEFAULT NULL COMMENT '租户id', + `parent_tenant_id` varchar(5) DEFAULT NULL, + `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `UNIQUE` (`merchant_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE `wx_ocr_model` ( + `id` bigint(20) NOT NULL, + `lang_code` varchar(20) NOT NULL DEFAULT 'iformallLang' COMMENT '语言定义', + `font_name` varchar(20) NOT NULL COMMENT '字库名称', + `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `remark` text COMMENT '说明', + `status` tinyint(1) DEFAULT '0' COMMENT '0-有效 1-无效', + PRIMARY KEY (`id`), + UNIQUE KEY `UNIQUE` (`font_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + + +CREATE TABLE `wx_mall_ocr_model` ( + `id` bigint(20) NOT NULL, + `mall_id` bigint(20) NOT NULL COMMENT '商户编号', + `ocr_model_id` bigint(20) NOT NULL COMMENT 'ocr模板编号', + `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `tenant_id` varchar(5) DEFAULT NULL COMMENT '租户id', + `parent_tenant_id` varchar(5) DEFAULT NULL, + `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `UNIQUE` (`mall_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + + +ALTER TABLE `wx_wiwide_info` ADD COLUMN `user_name` VARCHAR(100) COMMENT '登陆账号,首次初始化wiwideId和key用'; +ALTER TABLE `wx_wiwide_info` ADD COLUMN `password` VARCHAR(100) COMMENT '登陆密码'; +ALTER TABLE `wx_wiwide_info` ADD COLUMN `old_plat` int(1) NOT NULL DEFAULT 0 COMMENT '是否是老平台 0-老平台 1-新平台'; +ALTER TABLE `wx_wiwide_info` ADD COLUMN `sign_key` VARCHAR(100) COMMENT '加密key,新版本接口需要' AFTER `wiwide_key`; + diff --git a/mallinkAdmin/src/main/resources/db/migration/V202101280001__wx_miniapp_theme.sql b/mallinkAdmin/src/main/resources/db/migration/V202101280001__wx_miniapp_theme.sql new file mode 100644 index 000000000..42927ede8 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V202101280001__wx_miniapp_theme.sql @@ -0,0 +1,28 @@ +update wx_miniapp_theme_deploy set default_icon = "https://formall.oss-accelerate.aliyuncs.com/cimg/new_kanjia.png" where id = 4444; +update wx_miniapp_theme_deploy set default_icon = "https://formall.oss-accelerate.aliyuncs.com/cimg/new_pintuan.png" where id = 4455; +update wx_miniapp_theme_deploy set default_icon = "https://formall.oss-accelerate.aliyuncs.com/cimg/zhibo.png" where id = 4466; +update wx_miniapp_theme_deploy set default_icon = "https://formall.oss-accelerate.aliyuncs.com/cimg/new_xiaofeika.png" where id = 4477; +update wx_miniapp_theme_deploy set default_icon = "https://formall.oss-accelerate.aliyuncs.com/cimg/jifen.png" where id = 4488; + +INSERT INTO `wx_miniapp_theme_deploy`(`id`, `name`, `remarks`, `theme_type`, `default_icon`, `default_style`) VALUES (4499, "sy_qd", "首页签到图标", 2, "https://formall.oss-accelerate.aliyuncs.com/cimg/qiandao.png", NULL); +INSERT INTO `wx_miniapp_theme_deploy`(`id`, `name`, `remarks`, `theme_type`, `default_icon`, `default_style`) VALUES (5500, "sy_hd", "首页活动图标", 2, "https://formall.oss-accelerate.aliyuncs.com/cimg/huodong.png", NULL); +INSERT INTO `wx_miniapp_theme_deploy`(`id`, `name`, `remarks`, `theme_type`, `default_icon`, `default_style`) VALUES (5511, "sy_yx", "首页游戏图标", 2, "https://formall.oss-accelerate.aliyuncs.com/cimg/youxi.png", NULL); + +INSERT INTO `wx_miniapp_theme_value`(`id`, `miniapp_theme_id`, `miniapp_deploy_id`, `icon`, `style_class`) VALUES (1010, 2, 4499, NULL, NULL); +INSERT INTO `wx_miniapp_theme_value`(`id`, `miniapp_theme_id`, `miniapp_deploy_id`, `icon`, `style_class`) VALUES (1020, 2, 5500, NULL, NULL); +INSERT INTO `wx_miniapp_theme_value`(`id`, `miniapp_theme_id`, `miniapp_deploy_id`, `icon`, `style_class`) VALUES (1030, 2, 5511, NULL, NULL); + +INSERT INTO `wx_miniapp_theme_value`(`id`, `miniapp_theme_id`, `miniapp_deploy_id`, `icon`, `style_class`) VALUES (3010, 3, 4499, NULL, NULL); +INSERT INTO `wx_miniapp_theme_value`(`id`, `miniapp_theme_id`, `miniapp_deploy_id`, `icon`, `style_class`) VALUES (3020, 3, 5500, NULL, NULL); +INSERT INTO `wx_miniapp_theme_value`(`id`, `miniapp_theme_id`, `miniapp_deploy_id`, `icon`, `style_class`) VALUES (3030, 3, 5511, NULL, NULL); + + +update wx_miniapp_theme_value set icon = "https://formall.oss-accelerate.aliyuncs.com/cimg/new_kanjia_red.png" where miniapp_theme_id = 3 and miniapp_deploy_id = 4444; +update wx_miniapp_theme_value set icon = "https://formall.oss-accelerate.aliyuncs.com/cimg/new_pintuan_red.png" where miniapp_theme_id = 3 and miniapp_deploy_id = 4455; +update wx_miniapp_theme_value set icon = "https://formall.oss-accelerate.aliyuncs.com/cimg/zhibo_red.png" where miniapp_theme_id = 3 and miniapp_deploy_id = 4466; +update wx_miniapp_theme_value set icon = "https://formall.oss-accelerate.aliyuncs.com/cimg/new_xiaofeika_red.png" where miniapp_theme_id = 3 and miniapp_deploy_id = 4477; +update wx_miniapp_theme_value set icon = "https://formall.oss-accelerate.aliyuncs.com/cimg/jifen_red.png" where miniapp_theme_id = 3 and miniapp_deploy_id = 4488; +update wx_miniapp_theme_value set icon = "https://formall.oss-accelerate.aliyuncs.com/cimg/qiandao_red.png" where miniapp_theme_id = 3 and miniapp_deploy_id = 4499; +update wx_miniapp_theme_value set icon = "https://formall.oss-accelerate.aliyuncs.com/cimg/huodong_red.png" where miniapp_theme_id = 3 and miniapp_deploy_id = 5500; +update wx_miniapp_theme_value set icon = "https://formall.oss-accelerate.aliyuncs.com/cimg/youxi_red.png" where miniapp_theme_id = 3 and miniapp_deploy_id = 5511; + diff --git a/mallinkAdmin/src/main/resources/db/migration/V202101290001__wx_activity_update.sql b/mallinkAdmin/src/main/resources/db/migration/V202101290001__wx_activity_update.sql new file mode 100644 index 000000000..418a2d070 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V202101290001__wx_activity_update.sql @@ -0,0 +1,13 @@ +ALTER TABLE `wx_activity` +ADD COLUMN `activity_type` smallint(2) NOT NULL DEFAULT 1 COMMENT '活动类型(是否需要报名1是0否)' AFTER `html`, +ADD COLUMN `signup_examine` smallint(2) NOT NULL DEFAULT 1 COMMENT '报名审核 1是0否(activity_type=1时必填)' AFTER `person_limit`, +MODIFY COLUMN `person_limit` int(11) COMMENT '报名人数(activity_type=1时必填)' AFTER `activity_type`, +MODIFY COLUMN `start_time` datetime(0) COMMENT '活动报名开始时间(activity_type=1时必填)' AFTER `status`, +MODIFY COLUMN `end_time` datetime(0) COMMENT '活动报名结束时间(activity_type=1时必填)' AFTER `start_time`, +MODIFY COLUMN `question` json COMMENT '问题' AFTER `end_time`; + + + + +ALTER TABLE `wx_activity_join` +ADD UNIQUE INDEX `user_activity_id`(`tenant_id`, `user_id`, `activity_id`) USING BTREE; \ No newline at end of file diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxCUserController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxCUserController.java index 32b2665b7..8e1dda69d 100755 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxCUserController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxCUserController.java @@ -279,7 +279,7 @@ public class WxCUserController extends BaseController { wxCreditHistory.setChangePurpose("商户端["+wxMerchant.getName()+"]操作完善个人信息"); wxCreditHistory.setOperatorType(EnumUserType.BUSER.getCode()); wxCreditHistory.setOperatorId(bUser.getId()); - wxCreditHistoryService.saveOrUpdate(wxCreditHistory); + wxCreditHistoryService.saveOrUpdate(wxCreditHistory,wxMerchant.getTenantId()); } diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java index 5044bf850..f11d8adff 100644 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java @@ -71,7 +71,7 @@ public class WxCreditHistoryController extends BaseController { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL) ; } try { - Map result = wxCreditHistoryService.findByMerchantIdAndSpend(merchantId, spendStr, userId, getTenantInfo().getFinalTenantId()); + Map result = wxCreditHistoryService.findByMerchantIdAndSpend(merchantId, spendStr, userId); return new ResultData(result); } catch (MallinkException e) { return new ResultData(e.getErrorCode(), e.getMessage()); @@ -132,7 +132,7 @@ public class WxCreditHistoryController extends BaseController { if (null != getLoginBUser().getBuserId()) { wxCreditHistory.setBuserId(getLoginBUser().getBuserId()); } - WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory); + WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory,tenantInfo.getTenantId()); //更新标签 if (wxCreditHistory.getTags() != null && !wxCreditHistory.getTags().isEmpty()) { wxCUserTagsService.updateTagByUserId(wxCreditHistory.getCUserId(),tenantInfo, wxCreditHistory.getTags()); diff --git a/mallinkBApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java b/mallinkBApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java index c01d7beff..1afac3a93 100644 --- a/mallinkBApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java +++ b/mallinkBApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java @@ -36,6 +36,7 @@ public class TenantInfoImpl implements TenantInfo { "wx_level_config", "wx_c_user_basic_info", "wx_c_user_basic_child", + "wx_c_user_basic_sign", "wx_credit_history", "wx_score_history", "wx_c_user_tags", @@ -50,6 +51,7 @@ public class TenantInfoImpl implements TenantInfo { "wx_c_user", "wx_c_user_basic_info", "wx_c_user_basic_child", + "wx_c_user_basic_sign", "wx_c_user_car", "wx_c_user_from_b", "wx_c_user_tags", diff --git a/mallinkBApi/src/main/resources/application-dev.yml b/mallinkBApi/src/main/resources/application-dev.yml index 76fe4f591..b9f321d7e 100644 --- a/mallinkBApi/src/main/resources/application-dev.yml +++ b/mallinkBApi/src/main/resources/application-dev.yml @@ -155,8 +155,8 @@ wechat: min-idle: 10 fm: - exception: false - exception_emails: houtaikaifa@iformall.com + exception: true + exception_emails: xuxiaohu@iformall.com deploy: 1 open: true upload_dir: /home/test/server/uploads diff --git a/mallinkCApi/pom.xml b/mallinkCApi/pom.xml index 9c71414ee..a65c4b7e4 100644 --- a/mallinkCApi/pom.xml +++ b/mallinkCApi/pom.xml @@ -16,6 +16,17 @@ com.iformall mallinkService 1.0 + + + com.iformall + mallinkOcr + 1.0 + + + + com.iformall + mallinkOcr + 1.0 diff --git a/mallinkCApi/src/main/java/com/iformall/CApplication.java b/mallinkCApi/src/main/java/com/iformall/CApplication.java index 4e5aeb268..4c5fe2ce7 100644 --- a/mallinkCApi/src/main/java/com/iformall/CApplication.java +++ b/mallinkCApi/src/main/java/com/iformall/CApplication.java @@ -32,6 +32,9 @@ public class CApplication { @Value("${fm.upload_dir}") private String uploadDir; + + @Value("${fm.ocr_data}") + private String ocrData; @Bean public boolean isFmException() { @@ -52,6 +55,11 @@ public class CApplication { public String fmUploadDir() { return uploadDir; } + + @Bean + public String ocrData() { + return ocrData; + } public static void main(String[] args) { diff --git a/mallinkCApi/src/main/java/com/iformall/controller/BaseController.java b/mallinkCApi/src/main/java/com/iformall/controller/BaseController.java index c5367b197..6e45feff7 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/BaseController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/BaseController.java @@ -64,7 +64,7 @@ public class BaseController { @Autowired @Qualifier("objectCommonRedisTemplate") - RedisTemplate cuserBasicInfoTemplate; + RedisTemplate objectCommonRedisTemplate; @InitBinder public void InitBinder(WebDataBinder dataBinder) { @@ -156,7 +156,7 @@ public class BaseController { private WxCUserBasicInfo getCacheMember(Long memberId,String finalTenantId,String key,long seconds) throws Exception { // 缓存 - WxCUserBasicInfo member = RedisCacheUtils.getCacheObject(cuserBasicInfoTemplate, key, WxCUserBasicInfo.class); + WxCUserBasicInfo member = RedisCacheUtils.getCacheObject(objectCommonRedisTemplate, key, WxCUserBasicInfo.class); if(null == member) { member = wxCUserBasicInfoService.getById(memberId,finalTenantId); if (member == null) { @@ -164,7 +164,7 @@ public class BaseController { } setCUserBasicChild(member); - RedisCacheUtils.cache(cuserBasicInfoTemplate, key, member, seconds); + RedisCacheUtils.cache(objectCommonRedisTemplate, key, member, seconds); } return member; } @@ -183,9 +183,9 @@ public class BaseController { public void removeCacheMember(Long memberId) { String key = "webapp:member:"+memberId; - RedisCacheUtils.removeCache(cuserBasicInfoTemplate, key); + RedisCacheUtils.removeCache(objectCommonRedisTemplate, key); String shortKey = "webapp:short:member:"+memberId; - RedisCacheUtils.removeCache(cuserBasicInfoTemplate, shortKey); + RedisCacheUtils.removeCache(objectCommonRedisTemplate, shortKey); } public WxAppinfo getAppInfo(String appId) { diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxActivityController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxActivityController.java index 55f39e052..cb859ff60 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxActivityController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxActivityController.java @@ -1,20 +1,27 @@ package com.iformall.controller; +import com.github.pagehelper.PageInfo; import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.domain.po.WxActivity; +import com.iformall.domain.po.base.BaseEntity; +import com.iformall.enums.EnumActivityStatus; import com.iformall.service.WxActivityService; +import com.iformall.utils.DateUtils; 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 javax.servlet.http.HttpServletResponse; +import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -30,6 +37,38 @@ public class WxActivityController extends BaseController { @Autowired private WxActivityService wxActivityService; + @ApiOperation("分页列表接口") + @GetMapping("list") + @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 WxActivity wxActivity, Integer pageNum, Integer pageSize) { + logger.debug("[" + getIpAddr() + "] WxActivityController::list"); + if (null == wxActivity) wxActivity = new WxActivity(); + wxActivity.setStatus(EnumActivityStatus.INJECT_ONLINES.getCode()); + wxActivity.updateTenantInfo(getTenantInfo()); + wxActivity.setSortColumns(BaseEntity.SortField.ActivityStartTime_DESC,BaseEntity.SortField.Id_DESC); + final PageInfo page = wxActivityService.listAsPage(wxActivity, pageNum, pageSize); + return new ResultData(page); + } + + @ApiOperation("") + @GetMapping("listStatus") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) + public ResultData listStatus(@ModelAttribute WxActivity wxActivity) { + logger.debug("[" + getIpAddr() + "] WxActivityController::list"); + if (null == wxActivity) wxActivity = new WxActivity(); + wxActivity.setStatus(EnumActivityStatus.INJECT_ONLINES.getCode()); + wxActivity.updateTenantInfo(getTenantInfo()); + wxActivity.setSortColumns(BaseEntity.SortField.ActivityStartTime_DESC,BaseEntity.SortField.Id_DESC); + if(wxActivity.getStartDate() == null || wxActivity.getEndDate() == null){ + wxActivity.setStartDate(DateUtils.getFirstDayForCurrMonth()); + wxActivity.setEndDate(DateUtils.getLastDayForMonth(new Date())); + } + return wxActivityService.getListStatus(wxActivity); + } @ApiOperation("查询活动状态") @GetMapping("/queryStatus") @@ -55,10 +94,12 @@ public class WxActivityController extends BaseController { } catch (Exception e) { return new ResultData(Result.ERROR,e.getMessage()); } - Integer status = wxActivityService.queryStatus(id, memberId); + Integer activityStatus = wxActivityService.queryActivityStatus(id); + Integer joinStatus = wxActivityService.queryJoinStatus(id, memberId); Map data = new HashMap<>(); data.put("activity", wxActivity); - data.put("status", status); + data.put("activityStatus", activityStatus); + data.put("joinStatus", joinStatus); return new ResultData(Result.SUCCESS, "查询成功", data); } diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCUserBasicSignController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCUserBasicSignController.java new file mode 100644 index 000000000..d4956c5de --- /dev/null +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCUserBasicSignController.java @@ -0,0 +1,189 @@ +package com.iformall.controller; + +import com.github.pagehelper.PageInfo; +import com.iformall.common.ErrorCode; +import com.iformall.common.ResultData; +import com.iformall.domain.po.WxCUserBasicSign; +import com.iformall.domain.po.WxCreditHistory; +import com.iformall.enums.EnumScoreType; +import com.iformall.exception.MallinkException; +import com.iformall.service.WxCUserBasicSignService; +import com.iformall.utils.DateUtils; +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.*; + +import java.util.Date; +import java.util.Map; + +@RestController +@RequestMapping("/api/userSign") +@Api(description = "签到接口") +public class WxCUserBasicSignController extends BaseController { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + private WxCUserBasicSignService wxCUserBasicSignService; + + @ApiOperation("用户签到列表") + @GetMapping("list") + @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 WxCUserBasicSign wxCUserBasicSign, Integer pageNum, Integer pageSize) { + logger.debug("[" + getIpAddr() + "] WxCUserBasicSignController::list"); + if (null == wxCUserBasicSign){ + wxCUserBasicSign = new WxCUserBasicSign(); + } + Long memberId; + try { + memberId = getMemberId(); + } catch (MallinkException me) { + return new ResultData(ErrorCode.getByCode(me.getErrorCode())); + } +// wxCUserBasicSign.updateTenantInfo(getTenantInfo()); + wxCUserBasicSign.setTenantId(getTenantInfo().getFinalTenantId()); + wxCUserBasicSign.setUserId(memberId); + final PageInfo page = wxCUserBasicSignService.listAsPage(wxCUserBasicSign, pageNum, pageSize); + return new ResultData(page); + } + + @ApiOperation("") + @GetMapping("listStatus") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) + public ResultData listStatus(@ModelAttribute WxCUserBasicSign wxCUserBasicSign) { + logger.debug("[" + getIpAddr() + "] WxCUserBasicSignController::listStatus"); + if (null == wxCUserBasicSign){ + wxCUserBasicSign = new WxCUserBasicSign(); + } + Long memberId; + try { + memberId = getMemberId(); + } catch (MallinkException me) { + return new ResultData(ErrorCode.getByCode(me.getErrorCode())); + } +// wxCUserBasicSign.updateTenantInfo(getTenantInfo()); + wxCUserBasicSign.setTenantId(getTenantInfo().getFinalTenantId()); + wxCUserBasicSign.setUserId(memberId); + + if(wxCUserBasicSign.getStartDate() == null || wxCUserBasicSign.getEndDate() == null){ + wxCUserBasicSign.setStartDate(DateUtils.getFirstDayForCurrMonth()); + wxCUserBasicSign.setEndDate(DateUtils.getLastDayForMonth(new Date())); + } + return wxCUserBasicSignService.getListStatus(wxCUserBasicSign); + } + + @ApiOperation("签到") + @PostMapping("signIn") + @ApiImplicitParams({ + @ApiImplicitParam(name = "", value = "", dataType = "", paramType = "", required = true)}) + public ResultData signIn(@RequestBody WxCUserBasicSign wxCUserBasicSign) { + logger.debug("[" + getIpAddr() + "] WxCUserBasicSignController::signIn"); + if (null == wxCUserBasicSign){ + wxCUserBasicSign = new WxCUserBasicSign(); + } + Long memberId; + try { + memberId = getMemberId(); + } catch (MallinkException me) { + return new ResultData(ErrorCode.getByCode(me.getErrorCode())); + } +// wxCUserBasicSign.updateTenantInfo(getTenantInfo()); + wxCUserBasicSign.setTenantId(getTenantInfo().getFinalTenantId()); + wxCUserBasicSign.setUserId(memberId); + + WxCUserBasicSign todaySign = wxCUserBasicSignService.getTodaySignIn(wxCUserBasicSign); + if(todaySign == null){ + try { + todaySign = wxCUserBasicSignService.signIn(wxCUserBasicSign); + }catch(Exception e){ + return new ResultData(ErrorCode.SYS_SERVER_ERROR); + } + if(todaySign == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"type"); + } + return new ResultData(todaySign); + }else{ + return new ResultData(ErrorCode.MEM_IS_SIGNIN,todaySign); + } + + } + + @ApiOperation("签到状态") + @GetMapping("signInStatus") + @ApiImplicitParams({ + @ApiImplicitParam(name = "", value = "", dataType = "", paramType = "", required = true)}) + public ResultData signInStatus() { + logger.debug("[" + getIpAddr() + "] WxCUserBasicSignController::signIn"); + WxCUserBasicSign wxCUserBasicSign = new WxCUserBasicSign(); + Long memberId; + try { + memberId = getMemberId(); + } catch (MallinkException me) { + return new ResultData(ErrorCode.getByCode(me.getErrorCode())); + } +// wxCUserBasicSign.updateTenantInfo(getTenantInfo()); + wxCUserBasicSign.setTenantId(getTenantInfo().getFinalTenantId()); + wxCUserBasicSign.setUserId(memberId); + Map map = wxCUserBasicSignService.getLastSignIn(wxCUserBasicSign); + return new ResultData(map); + } + + @ApiOperation("签到领取") + @PostMapping("signInCredit") + @ApiImplicitParams({ + @ApiImplicitParam(name = "", value = "", dataType = "", paramType = "", required = true)}) + public ResultData signInCredit(@RequestBody WxCreditHistory wxCreditHistory) { + logger.debug("[" + getIpAddr() + "] WxCUserBasicSignController::signIn"); + if (null == wxCreditHistory){ + wxCreditHistory = new WxCreditHistory(); + } + Long memberId; + try { + memberId = getMemberId(); + } catch (MallinkException me) { + return new ResultData(ErrorCode.getByCode(me.getErrorCode())); + } + WxCUserBasicSign wxCUserBasicSign = new WxCUserBasicSign(); + wxCUserBasicSign.setTenantId(getFinalTenantId()); + wxCUserBasicSign.setUserId(memberId); + Map map = wxCUserBasicSignService.getLastSignIn(wxCUserBasicSign); + int continueMonthSign = map.get("continueMonthSign");//本月连续签到天数 + int continueSign = map.get("continueSign");//连续签到天数 + int signInSevenDay = map.get("signInSevenDay");//7日连续奖励 + int signInFTDay = map.get("signInFTDay");//14日连续奖励 + int signInTEDay = map.get("signInTEDay");//28日连续奖励 + + if(wxCreditHistory.getCreditType().equals(EnumScoreType.SIGN_IN_SEVENDAY.getCode())){ + if(continueSign >= 7 && signInSevenDay == 0){ + wxCUserBasicSignService.signInCreditHistory(wxCUserBasicSign,EnumScoreType.SIGN_IN_SEVENDAY); + return new ResultData(); + } + return new ResultData(ErrorCode.MEM_MONTH_IS_USED); + }else if(wxCreditHistory.getCreditType().equals(EnumScoreType.SIGN_IN_FTDAY.getCode())){ + if(continueSign >= 14 && signInFTDay == 0){ + wxCUserBasicSignService.signInCreditHistory(wxCUserBasicSign,EnumScoreType.SIGN_IN_FTDAY); + return new ResultData(); + } + return new ResultData(ErrorCode.MEM_MONTH_IS_USED); + }else if(wxCreditHistory.getCreditType().equals(EnumScoreType.SIGN_IN_TEDAY.getCode())){ + if(continueSign >= 28 && signInTEDay == 0){ + wxCUserBasicSignService.signInCreditHistory(wxCUserBasicSign,EnumScoreType.SIGN_IN_TEDAY); + return new ResultData(); + } + return new ResultData(ErrorCode.MEM_MONTH_IS_USED); + }else{ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"creditType"); + } + + } + +} diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java index 3a46339ce..adc5a609e 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCreditHistoryController.java @@ -4,15 +4,13 @@ import com.github.pagehelper.PageInfo; import com.iformall.common.ErrorCode; import com.iformall.common.Result; import com.iformall.common.ResultData; -import com.iformall.domain.po.MallUserInfo; -import com.iformall.domain.po.WxCUser; -import com.iformall.domain.po.WxMerchant; +import com.iformall.domain.po.*; import com.iformall.domain.po.base.BaseEntity; -import com.iformall.domain.po.WxCreditHistory; import com.iformall.enums.EnumScoreType; import com.iformall.enums.EnumUserType; import com.iformall.exception.MallinkException; import com.iformall.service.WxCreditHistoryService; +import com.iformall.service.WxScoreRulesService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -35,6 +33,9 @@ public class WxCreditHistoryController extends BaseController{ @Autowired private WxCreditHistoryService wxCreditHistoryService; + @Autowired + private WxScoreRulesService wxScoreRulesService; + @ApiOperation("用户积分列表") @GetMapping("list") @ApiImplicitParams({ @@ -83,7 +84,7 @@ public class WxCreditHistoryController extends BaseController{ try { wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId(),getTenantInfo()) ; - WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory); + WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory,getTenantInfo().getTenantId()); removeCacheCUser(); return new ResultData(Result.SUCCESS, "操作成功", credit); } catch (MallinkException e) { @@ -92,4 +93,12 @@ public class WxCreditHistoryController extends BaseController{ } } + @ApiOperation("积分配置") + @GetMapping("/credit_rules") + public ResultData creditRulesList() { + logger.debug("[" + getIpAddr() + "] creditRulesList::list"); + WxScoreRules scoreRules = wxScoreRulesService.getCreditRules(getTenantInfo().getFinalTenantId()); + return new ResultData(scoreRules); + } + } diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxMiniappThemeController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxMiniappThemeController.java index fb2c4e929..3de1356da 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxMiniappThemeController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxMiniappThemeController.java @@ -1,18 +1,14 @@ package com.iformall.controller; -import com.github.pagehelper.PageInfo; import com.iformall.annotation.RedisCache; import com.iformall.annotation.TenantIgnore; import com.iformall.common.ErrorCode; -import com.iformall.common.Result; import com.iformall.common.ResultData; -import com.iformall.domain.po.WxMiniappTheme; import com.iformall.domain.po.WxMiniappThemeValue; import com.iformall.domain.po.WxThemeMall; import com.iformall.enums.EnumThemeType; import com.iformall.service.WxMiniappThemeService; import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxOcrController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxOcrController.java new file mode 100644 index 000000000..ceac8a1f4 --- /dev/null +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxOcrController.java @@ -0,0 +1,82 @@ +package com.iformall.controller; + +import com.iformall.common.ErrorCode; +import com.iformall.common.ResultData; +import com.iformall.domain.po.WxMall; +import com.iformall.domain.po.WxMallOcrModel; +import com.iformall.domain.po.WxMerchantOcrModel; +import com.iformall.domain.po.WxOcrModel; +import com.iformall.domain.po.base.TenantEntity; +import com.iformall.ocr.FormallTess4j; +import com.iformall.service.WxMallService; +import com.iformall.service.WxOcrService; +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.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author gongbiao + */ +@RestController +@RequestMapping("/api/wxOcr") +@Api(description = "ocr") +public class WxOcrController extends BaseController { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + private WxOcrService ocrService; + @Autowired + private WxMallService mallService; + + + @Autowired + private String ocrData; + + @ApiOperation("分析图片信息") + @GetMapping("/analyImage") + @ApiImplicitParams({ + @ApiImplicitParam(name = "merchantId", value = "商户编号", dataType = "Long", paramType = "query", required = true), + @ApiImplicitParam(name = "imageUrl", value = "小票图片url", dataType = "String", paramType = "query", required = true), + }) + public ResultData analyImage(Long merchantId,String imageUrl) { + TenantEntity tenantEntity = getTenantInfo(); + Long modelId = null; + WxMerchantOcrModel MerchantModel = ocrService.getMerchantOcrModel(merchantId, tenantEntity.getTenantId(), tenantEntity.getParentTenantId()); + if (null == MerchantModel) { + WxMall mall = mallService.getByTenantId(tenantEntity.getTenantId()); + if (null == mall) { + return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(), "当前登陆信息未查询倒Mall."); + } + WxMallOcrModel mallModel = ocrService.getMallOcrModel(mall.getId(), mall.getTenantId(), mall.getParentTenantId()); + if (null == mallModel) { + return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(), "当前商户没有配置OCR模板,并且当前Mall也未配置OCR模板."); + }else { + modelId = mallModel.getOcrModelId(); + } + }else { + modelId = MerchantModel.getOcrModelId(); + } + WxOcrModel ocrModel = ocrService.getOcrModelById(modelId); + if (null == ocrModel) { + return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(), "OCR模板未查询到:"+modelId); + } + String result; + try { + result = FormallTess4j.ocrNetImgFile(ocrData,imageUrl,ocrModel.getFontName()); + return new ResultData(result); + } catch (Exception e) { + logger.error("ocr识别失败。",e); + return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(), "ocr识别失败。"+e.getMessage()); + } + + } + + +} diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java index 2fd039e80..142382cc9 100755 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java @@ -21,6 +21,7 @@ import com.iformall.service.*; import com.iformall.service.wechat.FmOpenService; import com.iformall.utils.Constant; import com.iformall.utils.IPUtil; +import com.iformall.utils.RedisCacheUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import me.chanjar.weixin.common.error.WxErrorException; @@ -92,6 +93,9 @@ public class WxUserGrantController extends BaseController { @Autowired WxMallService mallService; + + @Autowired + private QrCodeService qrCodeService; @Autowired private CUserTokenService cUserTokenService; @@ -142,13 +146,43 @@ public class WxUserGrantController extends BaseController { Map resultMap = new HashMap(); + WxCUserFrom wxCUserFrom = new WxCUserFrom(); + String appId = map.get("appId"); String code = map.get("code"); String sceneAddress = map.get("sceneAddress"); String scene = map.get("scene"); + + if (StringUtils.isNotBlank(scene) && + !scene.equals(Constant.UNDEFINED)) { // from pages/index/index onLoad.options.scene + wxCUserFrom.setScene(scene); + } + if (StringUtils.isNotBlank(sceneAddress) && + !sceneAddress.equalsIgnoreCase(Constant.UNDEFINED)) { // from app.js onLaunch.options.scene + wxCUserFrom.setSceneAddress(sceneAddress); + } + String longitude = map.get("longitude"); String latitude = map.get("latitude"); String systemInfo = map.get("systemInfo"); + + try { + String basicUserId = map.get("UId"); + String merchantId = map.get("MId"); + if(StringUtils.isNotBlank(basicUserId)){ + wxCUserFrom.setFromType(EnumCUserFrom.FROM_C_USER_BASIC_INFO.getCode()); + wxCUserFrom.setFromId(Long.parseLong(basicUserId)); + }else if(StringUtils.isNotBlank(merchantId)){ + wxCUserFrom.setFromType(EnumCUserFrom.FROM_MERCHANT.getCode()); + wxCUserFrom.setFromId(Long.parseLong(merchantId)); + }else{ + + } + } catch (NumberFormatException e) { + logger.error("分享参数错误",e); + } + + //登录凭证不能为空 if (StringUtils.isBlank(appId)) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "appId不能为空"); @@ -183,6 +217,7 @@ public class WxUserGrantController extends BaseController { if(wxMall == null){ return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND); } + wxCUserFrom.updateTenantInfo(wxMall); resultMap.put("selectedMall", wxMall.getTenantId()); // 集团版,获取子集团list @@ -268,17 +303,11 @@ public class WxUserGrantController extends BaseController { oldUser.setAppId(appId); oldUser.setOpenId(openId); oldUser.setUnionId(unionId); + if (StringUtils.isNotBlank(wxAuthorizerInfo.getOpenAppid())) { oldUser.setOpenAppId(wxAuthorizerInfo.getOpenAppid()); } - if (StringUtils.isBlank(oldUser.getSceneAddress()) || - oldUser.getSceneAddress().equalsIgnoreCase(Constant.UNDEFINED)) { // from app.js onLaunch.options.scene - oldUser.setSceneAddress(sceneAddress); - } - if (StringUtils.isBlank(oldUser.getScene()) || - oldUser.getScene().equals(Constant.UNDEFINED)) { // from pages/index/index onLoad.options.scene - oldUser.setScene(scene); - } + if (StringUtils.isNotBlank(longitude)) { oldUser.setLongitude(BigDecimal.valueOf(Double.valueOf(longitude))); } @@ -298,8 +327,11 @@ public class WxUserGrantController extends BaseController { request.setAttribute(Constant.LOGIN_USER_KEY, oldUser.getId()); updateCacheCUser(token, oldUser); + // 登录后处理 - wxCUserService.actionMsgAfterLogin(oldUser); + wxCUserFrom.setCUserId(oldUser.getId()); + wxCUserFrom.setIsNewUser(EnumYesOrNo.NO.getCode()); + wxCUserService.actionMsgAfterLogin(wxCUserFrom); } else { // 新用户 @@ -311,14 +343,9 @@ public class WxUserGrantController extends BaseController { resultMap.put("token", token); newUser.setRegisterIp(ipaddress); - if (StringUtils.isNotBlank(sceneAddress) && - !sceneAddress.equalsIgnoreCase(Constant.UNDEFINED)) { // from app.js onLaunch.options.scene - newUser.setSceneAddress(sceneAddress); - } - if (StringUtils.isNotBlank(scene) && - !scene.equals(Constant.UNDEFINED)) { // from pages/index/index onLoad.options.scene - newUser.setScene(scene); - } + newUser.setSceneAddress(wxCUserFrom.getSceneAddress()); + newUser.setScene(wxCUserFrom.getScene()); + newUser.setSessionKey(session_key); if (StringUtils.isNotBlank(longitude)) { newUser.setLongitude(BigDecimal.valueOf(Double.valueOf(longitude))); @@ -339,7 +366,9 @@ public class WxUserGrantController extends BaseController { updateCacheCUser(token, newUser); // 登录后处理 - wxCUserService.actionMsgAfterLogin(newUser); + wxCUserFrom.setCUserId(newUser.getId()); + wxCUserFrom.setIsNewUser(EnumYesOrNo.YES.getCode()); + wxCUserService.actionMsgAfterLogin(wxCUserFrom); } @@ -580,6 +609,7 @@ public class WxUserGrantController extends BaseController { try { // 解密 WxMaPhoneNumberInfo phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(session_key, encryptedData, iv); + logger.info(phoneNoInfo.toString()); if (null != phoneNoInfo) { logger.debug(phoneNoInfo.toString()); user.setPhone(phoneNoInfo.getPhoneNumber()); @@ -897,7 +927,7 @@ public class WxUserGrantController extends BaseController { wxCreditHistory.setChangePurpose(EnumScoreType.COMPLETE_INFO.getMessage()); wxCreditHistory.setOperatorType(EnumUserType.CUSERBASIC.getCode()); wxCreditHistory.setOperatorId(memberId); - wxCreditHistoryService.saveOrUpdate(wxCreditHistory); + wxCreditHistoryService.saveOrUpdate(wxCreditHistory,tenantEntity.getTenantId()); wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, record,tenantEntity); removeCacheCUser(); @@ -952,4 +982,50 @@ public class WxUserGrantController extends BaseController { return new ResultData(); } + @ApiOperation("获取当前用户二维码") + @GetMapping("/userinfoQrCode") + public ResultData getUserinfoQrCode() { + WxCUser user = getWxCUser(); + if(user.basicInfoIs()){ + String key = Constant.cuserQr+ getTenantInfo().getTenantId() + ":" +user.getUserId(); + String qrCode = RedisCacheUtils.getCacheString(objectCommonRedisTemplate, key); + if(StringUtils.isBlank(qrCode)){ + WxCUserBasicInfo wxCUserBasicInfo; + try { + wxCUserBasicInfo = getShortCacheMember(user.getUserId(),getFinalTenantId()); + if(StringUtils.isBlank(getTenantInfo().getParentTenantId()) + && StringUtils.isNotBlank(wxCUserBasicInfo.getQrCode())){ + qrCode = wxCUserBasicInfo.getQrCode(); + }else{ + String param = wxCUserBasicInfo.getWeappScene(); + ResultData resultData = qrCodeService.uploadQrcode(getTenantInfo(), 1, Constant.mainPageUrl, param, 0, "", "", "用户分享",EnumPayWay.PAY_WAY_WECHAT); +// String weappPath = wxCUserBasicInfo.getWeappPath(); +// ResultData resultData = qrCodeService.uploadQrcode(getTenantInfo(), 0, weappPath, "", 0, "", "", "用户分享",EnumPayWay.PAY_WAY_WECHAT); + Map map = (Map) resultData.data; + if(map!=null && map.get("url") !=null) { + String url = map.get("url"); + qrCode = url; + }else{ + logger.error("getUserinfoQrCode error."+resultData.toString()); + return new ResultData(ErrorCode.DEVICE_QRCODE_GET_FAILED); + } + if(StringUtils.isBlank(getTenantInfo().getParentTenantId())){ + wxCUserBasicInfo.setQrCode(qrCode); + wxCUserBasicInfoService.updateQrCode(wxCUserBasicInfo); + } + } + RedisCacheUtils.cache(objectCommonRedisTemplate, key, qrCode, 0); + + } catch (Exception e) { + logger.error("getUserinfoQrCode error.",e); + return new ResultData(ErrorCode.SYS_SERVER_ERROR); + } + } + return new ResultData(qrCode); + + }else{ + return new ResultData(ErrorCode.USER_IS_NOT_MEMBER); + } + } + } diff --git a/mallinkCApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java b/mallinkCApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java index b9360b06a..2ab65bf5f 100644 --- a/mallinkCApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java +++ b/mallinkCApi/src/main/java/com/iformall/tenant/TenantInfoImpl.java @@ -36,6 +36,7 @@ public class TenantInfoImpl implements TenantInfo { "wx_level_config", "wx_c_user_basic_info", "wx_c_user_basic_child", + "wx_c_user_basic_sign", "wx_credit_history", "wx_score_history", "wx_c_user_tags", @@ -50,6 +51,7 @@ public class TenantInfoImpl implements TenantInfo { "wx_c_user", "wx_c_user_basic_info", "wx_c_user_basic_child", + "wx_c_user_basic_sign", "wx_c_user_car", "wx_c_user_from_b", "wx_c_user_tags", diff --git a/mallinkCApi/src/main/resources/application-dev.yml b/mallinkCApi/src/main/resources/application-dev.yml index b2b606aad..4afa59113 100644 --- a/mallinkCApi/src/main/resources/application-dev.yml +++ b/mallinkCApi/src/main/resources/application-dev.yml @@ -155,11 +155,12 @@ jasypt: password: oRqdnDbK5pj3eMmB fm: - exception: false - exception_emails: houtaikaifa@iformall.com + exception: true + exception_emails: xuxiaohu@iformall.com deploy: 1 open: true upload_dir: /home/test/server/uploads/ + ocr_data: /root/ocr_data/ logging: level: diff --git a/mallinkCApi/src/main/resources/application-prod.yml b/mallinkCApi/src/main/resources/application-prod.yml index cb6c367fc..86d1a247c 100644 --- a/mallinkCApi/src/main/resources/application-prod.yml +++ b/mallinkCApi/src/main/resources/application-prod.yml @@ -115,6 +115,7 @@ fm: deploy: 3 open: true upload_dir: /root/uploads/ + ocr_data: /root/ocr_data/ logging: level: diff --git a/mallinkCApi/src/main/resources/application-test.yml-bak b/mallinkCApi/src/main/resources/application-test.yml-bak index 4aa4daf72..e75ea2d83 100644 --- a/mallinkCApi/src/main/resources/application-test.yml-bak +++ b/mallinkCApi/src/main/resources/application-test.yml-bak @@ -93,6 +93,7 @@ fm: deploy: 2 open: true upload_dir: /home/ec2-user/server/uploads/ + ocr_data: /home/ec2-user/server/ocr_data/ logging: level: diff --git a/mallinkCallback/src/main/resources/application-dev.yml b/mallinkCallback/src/main/resources/application-dev.yml index dbbcb8bf7..386d2a3b0 100644 --- a/mallinkCallback/src/main/resources/application-dev.yml +++ b/mallinkCallback/src/main/resources/application-dev.yml @@ -161,8 +161,8 @@ jasypt: password: oRqdnDbK5pj3eMmB fm: - exception: false - exception_emails: houtaikaifa@iformall.com + exception: true + exception_emails: xuxiaohu@iformall.com deploy: 1 open: true upload_dir: /home/test/server/uploads/ diff --git a/mallinkMQConsumer/src/main/resources/application-dev.yml b/mallinkMQConsumer/src/main/resources/application-dev.yml index 20c8a10d1..46fb6fb84 100644 --- a/mallinkMQConsumer/src/main/resources/application-dev.yml +++ b/mallinkMQConsumer/src/main/resources/application-dev.yml @@ -156,8 +156,8 @@ jasypt: password: oRqdnDbK5pj3eMmB fm: - exception: false - exception_emails: houtaikaifa@iformall.com + exception: true + exception_emails: xuxiaohu@iformall.com deploy: 1 open: true upload_dir: /home/test/server/uploads/ diff --git a/mallinkOcr/pom.xml b/mallinkOcr/pom.xml new file mode 100644 index 000000000..e0177547c --- /dev/null +++ b/mallinkOcr/pom.xml @@ -0,0 +1,41 @@ + + + + mallink + com.iformall + 1.0 + + 4.0.0 + + mallinkOcr + + + + net.java.dev.jna + jna + 5.3.1 + + + net.sourceforge.tess4j + tess4j + 4.4.0 + + + commons-io + commons-io + + + commons-logging + commons-logging + + + jna + net.java.dev.jna + + + + + + \ No newline at end of file diff --git a/mallinkOcr/src/main/java/com/iformall/ocr/FormallTess4j.java b/mallinkOcr/src/main/java/com/iformall/ocr/FormallTess4j.java new file mode 100644 index 000000000..50b457b9e --- /dev/null +++ b/mallinkOcr/src/main/java/com/iformall/ocr/FormallTess4j.java @@ -0,0 +1,289 @@ +package com.iformall.ocr; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLConnection; + +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.recognition.software.jdeskew.ImageDeskew; +import net.sourceforge.tess4j.ITessAPI.TessPageIteratorLevel; +import net.sourceforge.tess4j.ITesseract; +import net.sourceforge.tess4j.ITesseract.RenderedFormat; +import net.sourceforge.tess4j.Tesseract; +import net.sourceforge.tess4j.Word; +import net.sourceforge.tess4j.util.ImageHelper; +import net.sourceforge.tess4j.util.LoggHelper; +import net.sourceforge.tess4j.util.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * https://www.cnblogs.com/pejsidney/p/9487881.html + * Tess4J是对Tesseract OCR API.的Java JNA 封装。使java能够通过调用Tess4J的API来使用Tesseract OCR。支持的格式:TIFF,JPEG,GIF,PNG,BMP,JPEG,and PDF + Tesseract 的github地址:https://github.com/tesseract-ocr/tesseract + Tess4J的github地址:https://github.com/nguyenq/tess4j + + Tess4J API 提供的功能: + 1、直接识别支持的文件 + 2、识别图片流 + 3、识别图片的某块区域 + 4、将识别结果保存为 TEXT/ HOCR/ PDF/ UNLV/ BOX + 5、通过设置取词的等级,提取识别出来的文字 + 6、获得每一个识别区域的具体坐标范围 + 7、调整倾斜的图片 + 8、裁剪图片 + 9、调整图片分辨率 + 10、从粘贴板获得图像 + 11、克隆一个图像(目的:创建一份一模一样的图片,与原图在操作修改上,不相 互影响) + 12、图片转换为二进制、黑白图像、灰度图像 + 13、反转图片颜色 + * @author alascor + */ +public class FormallTess4j { + + + private static final Logger logger = LoggerFactory.getLogger(new LoggHelper().toString()); + static final double MINIMUM_DESKEW_THRESHOLD = 0.05d; + + private static final String datapath = "src/main/resources"; + private static final String testResourcesLanguagePath = datapath+"/tessdata"; + private static final String tempfile = "/ocrtempfile/"; + + private static ITesseract instance = new Tesseract(); + + static { + instance.setDatapath(new File(datapath).getPath()); + } + + private static File urlImgToFile(String fileUrl) { + InputStream ins = null; + OutputStream os = null; + try { + URL url = new URL(fileUrl); + URLConnection c = url.openConnection(); + ins = c.getInputStream(); + File folder = new File (tempfile) ; + if (!folder.exists()) { + folder.mkdirs(); + } + File f = new File(tempfile+System.currentTimeMillis()+"-"+IdWorker.get32UUID()+".jpg"); + if (f.exists()) { + f.delete(); + } + f.createNewFile(); + os = new FileOutputStream(f); + int bytesRead = 0; + byte[] buffer = new byte[8192]; + while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) { + os.write(buffer, 0, bytesRead); + } + os.close(); + ins.close(); + return f; + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + }finally { + if (null != os) { + try { + os.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (null != ins) { + try { + ins.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return null; + } + + private static void deletetempFile(File file) { + if (file.exists()) { + file.delete(); + } + } + + private static String ocrLocalImgFile(String languagePath,String filePath,String fontName) throws Exception { + File imageFile = new File(filePath,fontName); + String result = testDoOCR_File(languagePath,imageFile,fontName); + deletetempFile(imageFile); + return result; + } + + public static String ocrNetImgFile(String languagePath,String fileUrl,String fontName) throws Exception { + File imageFile = urlImgToFile(fileUrl); + String result = testDoOCR_File(languagePath,imageFile,fontName); + deletetempFile(imageFile); + return result; + } + + /** + * Test of doOCR method, of class Tesseract. + * 根据图片文件进行识别 + * @throws Exception while processing image. + */ + public static String testDoOCR_File(String languagePath,File imageFile,String fontName) throws Exception { + logger.info("doOCR on a jpg image"); + //set language + instance.setDatapath(languagePath); + instance.setLanguage(fontName); + String result = instance.doOCR(imageFile); + return result; + } + + + public static void main(String[] args) { + try { + System.out.println(ocrNetImgFile(testResourcesLanguagePath,"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.my0832.com%2Fattachments%2Fbbs%2F20140424%2F201442413083356803_740_1186.jpg&refer=http%3A%2F%2Fimg.my0832.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1613903848&t=985fc4c6c7b7ee82cb98f97ab5bf1459","test1")); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +// +// /** +// * Test of doOCR method, of class Tesseract. +// * 根据图片流进行识别 +// * @throws Exception while processing image. +// */ +// public void testDoOCR_BufferedImage() throws Exception { +// logger.info("doOCR on a buffered image of a PNG"); +// File imageFile = new File(this.testResourcesDataPath, "ocr.png"); +// BufferedImage bi = ImageIO.read(imageFile); +// +// //set language +// instance.setDatapath(testResourcesLanguagePath); +// instance.setLanguage("chi_sim"); +// +// String result = instance.doOCR(bi); +// logger.info(result); +// } +// +// /** +// * Test of getSegmentedRegions method, of class Tesseract. +// * 得到每一个划分区域的具体坐标 +// * @throws java.lang.Exception +// */ +// public void testGetSegmentedRegions() throws Exception { +// logger.info("getSegmentedRegions at given TessPageIteratorLevel"); +// File imageFile = new File(testResourcesDataPath, "ocr.png"); +// BufferedImage bi = ImageIO.read(imageFile); +// int level = TessPageIteratorLevel.RIL_SYMBOL; +// logger.info("PageIteratorLevel: " + Utils.getConstantName(level, TessPageIteratorLevel.class)); +// List result = instance.getSegmentedRegions(bi, level); +// for (int i = 0; i < result.size(); i++) { +// Rectangle rect = result.get(i); +// logger.info(String.format("Box[%d]: x=%d, y=%d, w=%d, h=%d", i, rect.x, rect.y, rect.width, rect.height)); +// } +// +// assertTrue(result.size() > 0); +// } +// +// +// /** +// * Test of doOCR method, of class Tesseract. +// * 根据定义坐标范围进行识别 +// * @throws Exception while processing image. +// */ +// public void testDoOCR_File_Rectangle() throws Exception { +// logger.info("doOCR on a BMP image with bounding rectangle"); +// File imageFile = new File(this.testResourcesDataPath, "ocr.png"); +// //设置语言库 +// instance.setDatapath(testResourcesLanguagePath); +// instance.setLanguage("chi_sim"); +// //划定区域 +// // x,y是以左上角为原点,width和height是以xy为基础 +// Rectangle rect = new Rectangle(84, 21, 15, 13); +// String result = instance.doOCR(imageFile, rect); +// logger.info(result); +// } +// +// /** +// * Test of createDocuments method, of class Tesseract. +// * 存储结果 +// * @throws java.lang.Exception +// */ +// public void testCreateDocuments() throws Exception { +// logger.info("createDocuments for png"); +// File imageFile = new File(this.testResourcesDataPath, "ocr.png"); +// String outputbase = "target/test-classes/docrenderer-2"; +// List formats = new ArrayList(Arrays.asList(RenderedFormat.HOCR, RenderedFormat.TEXT)); +// +// //设置语言库 +// instance.setDatapath(testResourcesLanguagePath); +// instance.setLanguage("chi_sim"); +// +// instance.createDocuments(new String[]{imageFile.getPath()}, new String[]{outputbase}, formats); +// } +// +// /** +// * Test of getWords method, of class Tesseract. +// * 取词方法 +// * @throws java.lang.Exception +// */ +// public void testGetWords() throws Exception { +// logger.info("getWords"); +// File imageFile = new File(this.testResourcesDataPath, "ocr.png"); +// +// //设置语言库 +// instance.setDatapath(testResourcesLanguagePath); +// instance.setLanguage("chi_sim"); +// +// //按照每个字取词 +// int pageIteratorLevel = TessPageIteratorLevel.RIL_SYMBOL; +// logger.info("PageIteratorLevel: " + Utils.getConstantName(pageIteratorLevel, TessPageIteratorLevel.class)); +// BufferedImage bi = ImageIO.read(imageFile); +// List result = instance.getWords(bi, pageIteratorLevel); +// +// //print the complete result +// for (Word word : result) { +// logger.info(word.toString()); +// } +// } +// +// /** +// * Test of Invalid memory access. +// * 处理倾斜 +// * @throws Exception while processing image. +// */ +// public void testDoOCR_SkewedImage() throws Exception { +// //设置语言库 +// instance.setDatapath(testResourcesLanguagePath); +// instance.setLanguage("chi_sim"); +// +// logger.info("doOCR on a skewed PNG image"); +// File imageFile = new File(this.testResourcesDataPath, "ocr_skewed.jpg"); +// BufferedImage bi = ImageIO.read(imageFile); +// ImageDeskew id = new ImageDeskew(bi); +// double imageSkewAngle = id.getSkewAngle(); // determine skew angle +// if ((imageSkewAngle > MINIMUM_DESKEW_THRESHOLD || imageSkewAngle < -(MINIMUM_DESKEW_THRESHOLD))) { +// bi = ImageHelper.rotateImage(bi, -imageSkewAngle); // deskew image +// } +// +// String result = instance.doOCR(bi); +// logger.info(result); +// } + +} diff --git a/mallinkOcr/src/main/java/com/iformall/ocr/FormallTess4jTrain.java b/mallinkOcr/src/main/java/com/iformall/ocr/FormallTess4jTrain.java new file mode 100644 index 000000000..db27abb96 --- /dev/null +++ b/mallinkOcr/src/main/java/com/iformall/ocr/FormallTess4jTrain.java @@ -0,0 +1,135 @@ +package com.iformall.ocr; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.LineNumberReader; + +/** + * 训练 + * @author iformall + */ +public class FormallTess4jTrain { + + private static final String newFileFolder = "C:\\Users\\iformall\\Desktop\\newfile"; + + private static final String huanhangstr = " \n "; + + private static String getprefix(String lang,String fontName) { + String realFileName = lang+"."+fontName+".exp0"; + return realFileName; + } + + private static String createBoxFile(String tifFileName,String lang,String fontName) { + String prefix = getprefix(lang,fontName); + String realFileName = prefix+".tif"; + if (tifFileName.equals(realFileName)) { + String cmdstr = "tesseract "+tifFileName+" "+prefix+" -l chi_sim batch.nochop makebox"; + return cmdstr; + //String result = executeLocalCmd(cmdstr, null); + + //System.out.println("Done createBoxFile"+result); + }else { + return "文件必须是.tif"; + } + } + + private static String createTranFile(String lang,String fontName) { + String prefix = getprefix(lang,fontName); + String realFileName = prefix+".tif"; + String trainCmdstr = "tesseract "+realFileName+" "+prefix+" nobatch box.train"; + return trainCmdstr; + } + + private static String getBoxFont(String lang,String fontName) { + String prefix = getprefix(lang,fontName); + String extractorCmdstr = "unicharset_extractor "+prefix+".box"; + return extractorCmdstr; + } + + /** + * 第六步,执行完成后生成以下几个文件加前缀 + * unicharset、inttemp、pffmtable、shapetable、normproto 添加这几个文件的前缀为fontName + * @param lang + * @param fontName + * @return + */ + private static String renameTrainFiles(String fontName) { + StringBuffer sb = new StringBuffer(); + String renCmdstr = "REN unicharset "+fontName+".unicharset"; + sb.append(renCmdstr).append(huanhangstr); + + renCmdstr = "REN inttemp "+fontName+".inttemp"; + sb.append(renCmdstr).append(huanhangstr); + + renCmdstr = "REN pffmtable "+fontName+".pffmtable"; + sb.append(renCmdstr).append(huanhangstr); + + renCmdstr = "REN shapetable "+fontName+".shapetable"; + sb.append(renCmdstr).append(huanhangstr); + + renCmdstr = "REN normproto "+fontName+".normproto"; + sb.append(renCmdstr).append(huanhangstr); + return sb.toString(); + } + + /** + * 第七步:合并5个文件 + * @param lang + * @param fontName + * @return + */ + private static String mergeTrainFiles(String fontName) { + String mergeCmdstr = "combine_tessdata "+fontName+"."; + return mergeCmdstr; + } + + + public static String getTrainSteps(String lang,String fontName) { + + StringBuffer sb = new StringBuffer("请先安装tess4j(4.0以上),配置好环境变量. 下载jTessBoxEditor(用于训练,带FX的支持中文)").append(huanhangstr); + sb.append("请进入到样本图片文件夹用doc命令执行.").append(huanhangstr); + sb.append("第一步,用jTessBoxEditor --> Tools --> Merge 多选图片,保存为tif格式 .命名格式为[lang].[fontName].exp0.tif. 命名:").append(lang).append(".").append(fontName).append(".exp0.tif ").append(huanhangstr); + sb.append("............ ").append(huanhangstr); + sb.append("第二步,用tif生成box ").append(huanhangstr); + sb.append(createBoxFile(lang+"."+fontName+".exp0.tif", lang, fontName)).append(huanhangstr); + sb.append("............ ").append(huanhangstr); + sb.append("第三步,用jTessBoxEditor 打开.box文件进行矫正 ").append(huanhangstr); + sb.append("............ ").append(huanhangstr); + sb.append("第四步:用box文件生成。tr文件 ").append(huanhangstr); + sb.append(createTranFile(lang,fontName)).append(huanhangstr); + sb.append("............ ").append(huanhangstr); + sb.append("第五步:提取box字符 ").append(huanhangstr); + sb.append(getBoxFont(lang,fontName)).append(huanhangstr); + sb.append("............ ").append(huanhangstr); + sb.append("@@@!!!!从此处开始,可以处理多个字库处理。如原来的字库现在做升级,需要把老的字库的。tif,.box,.tr文件重新命名也放到同目录文件夹, ").append(huanhangstr); + sb.append("............ ").append(huanhangstr); + sb.append("第六步:新建font_properties(没有.txt后缀), 把所有box对应的字体特征加进去。").append(huanhangstr); + sb.append("fontname为字体名称,保持和 图片集文件 .tif 和.box文件的前缀名一致 .的取值为1或0,表示字体是否具有这些属性。 ").append(huanhangstr); + sb.append("如以下内容: ").append(huanhangstr); + sb.append("fontName1 0 0 0 0 0 ").append(huanhangstr); + sb.append("fontName2 0 1 0 0 0 ").append(huanhangstr); + sb.append("fontName3 1 1 0 0 0 ").append(huanhangstr); + sb.append("............ ").append(huanhangstr); + sb.append("第六步:批量执行系列命令。多个文件在后面累加。 ").append(huanhangstr); + String prefix = getprefix(lang,fontName); + String shapeCmdStr = "shapeclustering -F font_properties -U unicharset "+prefix+".tr [other .tr files...] "; + sb.append(shapeCmdStr).append(huanhangstr); + String mftraingCmdstr = "mftraining -F font_properties -U unicharset -O unicharset "+prefix+".tr [other .tr files...] "; + sb.append(mftraingCmdstr).append(huanhangstr); + String cntrainCmdstr = "cntraining "+prefix+".tr [other .tr files...] "; + sb.append(cntrainCmdstr).append(huanhangstr); + sb.append("............ ").append(huanhangstr); + sb.append("第七步,执行完成后生成以下几个文件加前缀: unicharset、inttemp、pffmtable、shapetable、normproto 添加这几个文件的前缀为[fontName] ").append(huanhangstr); + sb.append(renameTrainFiles(fontName)); + sb.append("............ ").append(huanhangstr); + sb.append("第七步:合并5个文件").append(huanhangstr); + sb.append(mergeTrainFiles(fontName)).append(huanhangstr); + sb.append("............ ").append(huanhangstr); + sb.append("第八步:将").append(fontName).append(".traineddata 文件拷贝到后端服务器ocr_data(项目配置fm.ocr_data)目录下。 .tif、。box、。tr文件也需要保留,后面如果这个字库有更新,需要用到这些文件。").append(huanhangstr); + return sb.toString(); + } + +} diff --git a/mallinkOcr/src/main/resources/Read.txt b/mallinkOcr/src/main/resources/Read.txt new file mode 100644 index 000000000..9a470fa25 --- /dev/null +++ b/mallinkOcr/src/main/resources/Read.txt @@ -0,0 +1,14 @@ +https://www.cnblogs.com/wj-1314/p/9454656.html + +https://www.cnblogs.com/pejsidney/p/9487881.html + + +https://digi.bib.uni-mannheim.de/tesseract/ + +https://blog.csdn.net/qq_40147863/article/details/82290015 + +https://blog.csdn.net/boonya/article/details/81325997 + + +合并字库 https://www.cnblogs.com/c2soft/articles/10415236.html +完整教程 https://www.cnblogs.com/wpcnblog/p/12850590.html diff --git a/mallinkOcr/src/main/resources/tessdata/chi_sim.traineddata b/mallinkOcr/src/main/resources/tessdata/chi_sim.traineddata new file mode 100644 index 000000000..eeb66cfbd Binary files /dev/null and b/mallinkOcr/src/main/resources/tessdata/chi_sim.traineddata differ diff --git a/mallinkOcr/src/main/resources/tessdata/eng.traineddata b/mallinkOcr/src/main/resources/tessdata/eng.traineddata new file mode 100644 index 000000000..f4744c201 Binary files /dev/null and b/mallinkOcr/src/main/resources/tessdata/eng.traineddata differ diff --git a/mallinkOcr/src/main/resources/tessdata/osd.traineddata b/mallinkOcr/src/main/resources/tessdata/osd.traineddata new file mode 100644 index 000000000..183644aa5 Binary files /dev/null and b/mallinkOcr/src/main/resources/tessdata/osd.traineddata differ diff --git a/mallinkOcr/src/main/resources/tessdata/pdf.ttf b/mallinkOcr/src/main/resources/tessdata/pdf.ttf new file mode 100644 index 000000000..c33bafe3b --- /dev/null +++ b/mallinkOcr/src/main/resources/tessdata/pdf.ttf @@ -0,0 +1 @@ +tessconfigs/pdf.ttf \ No newline at end of file diff --git a/mallinkOcr/src/main/resources/tessdata/test1.traineddata b/mallinkOcr/src/main/resources/tessdata/test1.traineddata new file mode 100644 index 000000000..a07542f43 Binary files /dev/null and b/mallinkOcr/src/main/resources/tessdata/test1.traineddata differ diff --git a/mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java b/mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java index c6c4daa73..94ff2dead 100644 --- a/mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java +++ b/mallinkPosApi/src/main/java/com/iformall/service/impl/PosServiceImpl.java @@ -1376,7 +1376,7 @@ public class PosServiceImpl implements PosService { //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 creditHistory.setMerchantId(wxMerchant.getId()); creditHistory.setChangePurpose("pos消费:消费商户["+wxMerchant.getName()+"] 卷名称["+coupon.getTitle()+"("+creditHistory.getSpendStr()+"元)] "); - creditHistory = creditHistoryService.saveOrUpdate(creditHistory); + creditHistory = creditHistoryService.saveOrUpdate(creditHistory,couponOrderCVo.getTenantId()); if (creditHistory.getCreditNum() != null) { return creditHistory.getCreditNum(); } else { @@ -1405,7 +1405,7 @@ public class PosServiceImpl implements PosService { //如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户 creditHistory.setMerchantId(merchant.getId()); creditHistory.setChangePurpose("pos消费:消费商户["+merchant.getName()+"] 消费金额["+creditHistory.getSpendStr()+"元]"); - creditHistory = creditHistoryService.saveOrUpdate(creditHistory); + creditHistory = creditHistoryService.saveOrUpdate(creditHistory,merchant.getTenantId()); if (creditHistory.getCreditNum() != null) { return creditHistory.getCreditNum(); } else { diff --git a/mallinkPosApi/src/main/resources/application-dev.yml b/mallinkPosApi/src/main/resources/application-dev.yml index c7930118a..088229df9 100644 --- a/mallinkPosApi/src/main/resources/application-dev.yml +++ b/mallinkPosApi/src/main/resources/application-dev.yml @@ -155,8 +155,8 @@ wechat: min-idle: 10 fm: - exception: false - exception_emails: houtaikaifa@iformall.com + exception: true + exception_emails: xuxiaohu@iformall.com deploy: 1 open: true upload_dir: /home/test/server/uploads diff --git a/mallinkPublicApi/pom.xml b/mallinkPublicApi/pom.xml new file mode 100644 index 000000000..14ec5fb04 --- /dev/null +++ b/mallinkPublicApi/pom.xml @@ -0,0 +1,154 @@ + + + 4.0.0 + + mallink + com.iformall + 1.0 + + + mallinkPublicApi + + + + com.iformall + mallinkService + 1.0 + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + ZIP + + antlr, + cn.afterturn, + ch.qos.logback, + com.alibaba, + com.amazonaws, + com.baomidou, + com.mchange, + com.fasterxml.jackson.core, + com.fasterxml.jackson.dataformat, + com.fasterxml.jackson.datatype, + com.fasterxml.jackson.module, + com.fasterxml.uuid, + com.fasterxml, + com.github.axet, + com.github.jsqlparser, + com.github.pagehelper, + com.github.ulisesbocchio, + com.github.virtuald, + com.google.code.findbugs, + com.google.code.gson, + com.google.errorprone, + com.google.guava, + com.google.protobuf, + com.google.zxing, + com.jayway.jsonpath, + com.jhlabs, + com.puppycrawl.tools, + com.rabbitmq, + com.squareup.okhttp3, + com.squareup.okio, + com.sun, + com.sun.mail, + com.thoughtworks.xstream, + com.zaxxer, + commons-beanutils, + commons-cli, + commons-codec, + commons-collections, + commons-fileupload, + commons-io, + commons-logging, + io.lettuce, + io.netty, + io.projectreactor, + io.springfox, + io.swagger, + io.undertow, + javax.activation, + javax.annotation, + javax.mail, + javax.persistence, + javax.servlet, + javax.validation, + javax.xml.bind, + javax.xml.soap, + javax.xml.ws, + joda-time, + junit, + mysql, + net.bytebuddy, + net.minidev, + net.sf.dozer, + net.sf.saxon, + ognl, + org.antlr, + org.apache.commons, + org.apache.httpcomponents, + org.apache.logging.log4j, + org.apache.poi, + org.apache.poi.wso2, + org.apache.rocketmq, + org.apache.shiro, + org.apache.tomcat.embed, + org.apache.xmlbeans, + org.aspectj, + org.assertj, + org.bouncycastle, + org.checkerframework, + org.codehaus.mojo, + org.crazycake, + org.dom4j, + org.flowable, + org.flywaydb, + org.glassfish, + org.hibernate.validator, + org.jasypt, + org.javassist, + org.jboss.logging, + org.jboss.spec.javax.annotation, + org.jboss.spec.javax.websocket, + org.jboss.xnio, + org.jdom, + org.jodd, + org.jvnet.mimepull, + org.jvnet.staxex, + org.mapstruct, + org.mockito, + org.mybatis, + org.mybatis.generator, + org.mybatis.spring.boot, + org.ow2.asm, + org.projectlombok, + org.quartz-scheduler, + org.reactivestreams, + org.reflections, + org.rocketmq.spring.boot, + org.slf4j, + org.springframework, + org.springframework.amqp, + org.springframework.boot, + org.springframework.data, + org.springframework.retry, + org.springframework.ws, + org.yaml, + redis.clients, + software.amazon.ion, + tk.mybatis, + xmlpull, + xpp3 + + + + + + \ No newline at end of file diff --git a/mallinkPublicApi/src/main/java/com/iformall/PublicApiApplication.java b/mallinkPublicApi/src/main/java/com/iformall/PublicApiApplication.java new file mode 100644 index 000000000..bb2e930a5 --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/PublicApiApplication.java @@ -0,0 +1,60 @@ +package com.iformall; + +import org.mybatis.spring.annotation.MapperScan; +import org.rocketmq.starter.annotation.EnableRocketMQ; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.EnableAspectJAutoProxy; + +import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties; + +/** + * @author chenkx + * @date 2017-12-26 + */ +@SpringBootApplication +@MapperScan(basePackages = {"com.iformall.mapper"}) +@EnableEncryptableProperties +@EnableRocketMQ +@EnableAspectJAutoProxy(exposeProxy = true) +public class PublicApiApplication { + + @Value("${fm.exception}") + private boolean fmException; + + @Value("${fm.exception_emails}") + private String fmExceptionEmails; + + @Value("${fm.open}") + private boolean fmOpen; + + @Value("${fm.upload_dir}") + private String uploadDir; + + @Bean + public boolean isFmException() { + return fmException; + } + + @Bean + public String fmExceptionEmails() { + return fmExceptionEmails; + } + + @Bean + public boolean isFmOpen() { + return fmOpen; + } + + @Bean + public String fmUploadDir() { + return uploadDir; + } + + + public static void main(String[] args) { + SpringApplication.run(PublicApiApplication.class, args); + } +} diff --git a/mallinkPublicApi/src/main/java/com/iformall/annotation/RedisCache.java b/mallinkPublicApi/src/main/java/com/iformall/annotation/RedisCache.java new file mode 100644 index 000000000..185736606 --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/annotation/RedisCache.java @@ -0,0 +1,53 @@ +package com.iformall.annotation; + + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.concurrent.TimeUnit; + + +/** + * - /api/wxCouponChannel/change + * - /api/user/userinfo + * - /api/wxBusiness/listAll + * - /api/wxCampaign/list + * - /api/mall/mallInfo + * - /api/mall/getAppIcon + * - /api/mall/getWeapNote + */ +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface RedisCache { + + /** + * 缓存key的名称 + * @return + */ + String key() default ""; + + /** + * 自动生成key + * @return + */ + boolean autoKey() default true; + + /** + * 参数md5,解决key过长问题 + * @return + */ + boolean md5() default true ; + + /** + * key 过期日期默认60秒 + * @return + */ + int expireTime() default 60; + + /** + * 时间单位默认为秒 + * @return + */ + TimeUnit dateUnit() default TimeUnit.SECONDS; +} diff --git a/mallinkPublicApi/src/main/java/com/iformall/aop/RedisCacheAspect.java b/mallinkPublicApi/src/main/java/com/iformall/aop/RedisCacheAspect.java new file mode 100644 index 000000000..f001c7912 --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/aop/RedisCacheAspect.java @@ -0,0 +1,161 @@ +package com.iformall.aop; + + +import com.alibaba.fastjson.JSONObject; +import com.iformall.annotation.RedisCache; +import com.iformall.common.ErrorCode; +import com.iformall.domain.po.WxCUser; +import com.iformall.domain.po.base.BaseCUserEntity; +import com.iformall.exception.MallinkException; +import com.iformall.service.CUserTokenService; +import com.iformall.utils.HashUtil; +import com.iformall.utils.RedisLock; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +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.Arrays; +import java.util.Objects; + +@Slf4j +@Aspect +@Component +public class RedisCacheAspect { + + /** + * 参数分隔符 param1|param2|param3 + **/ + private static final String DELIMITER_PARAMS = "|"; + + /** + * key 分隔符 + */ + private static final String DELIMITER_KEY = ":"; + + @Autowired + private StringRedisTemplate stringRedisTemplate; + + @Autowired + RedisLock redisLock; + + @Autowired + private CUserTokenService cUserTokenService; + + @Pointcut("@annotation(com.iformall.annotation.RedisCache)") + public void cacheAspect() { + } + + @Around("cacheAspect()") + public Object round(ProceedingJoinPoint jp) throws Throwable { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + // 查询token信息 + //从header中获取token + String token = request.getHeader("token"); + //如果header中不存在token,则从参数中获取token + if (StringUtils.isBlank(token)) { + token = request.getParameter("token"); + } + if(StringUtils.isBlank(token) || "null".equals(token) || "undefined".equals(token)){ + token=""; + //throw new MallinkException(ErrorCode.NET_TOKEN_EMPTY.getCode(),"token为空["+token+"]"); + } + log.info("token>>>>>>>>>>>>>>>"+token); + String tenantId; + BaseCUserEntity cUser = null ; + if(StringUtils.isNotBlank(token)) { + cUser = cUserTokenService.getByToken(token); + } + if (Objects.isNull(cUser) || cUser.getExpireTime().getTime() < System.currentTimeMillis()) { + tenantId = "0"; + } else { + tenantId = cUser.getTenantId(); + } + + // 请求参数 + Object[] args = jp.getArgs(); + // 接口 返回结果 + Object result; + String redisKey; + + //得到注释的名称 + MethodSignature signature = (MethodSignature) jp.getSignature(); + //判断tag是否在用户权限中 如果存在加入参数查询 + Method method = signature.getMethod(); + RedisCache cache = method.getAnnotation(RedisCache.class) ; + if (cache.autoKey()) { + // 构建 redisKey => reqPath:tenantId:md5(param1_param2_param3) + String requestUrl = request.getRequestURI(); + // 接口路径 reqPath => /api/xxx + String reqPath = requestUrl.substring(requestUrl.indexOf("/api/")); + if (cache.md5()) { + String md5Before = StringUtils.join(args, DELIMITER_PARAMS); + redisKey = StringUtils.join(reqPath, DELIMITER_KEY, tenantId, DELIMITER_KEY, HashUtil.md5(StringUtils.join(token, md5Before, DELIMITER_PARAMS))); + } else { + redisKey = StringUtils.join(reqPath, DELIMITER_KEY, tenantId, DELIMITER_KEY, StringUtils.join(token,args, DELIMITER_PARAMS)); + } + } else { + redisKey = cache.key(); + } + + // redisKey 不存在,获取接口数据并返回 + if (StringUtils.isBlank(redisKey)) { + result = jp.proceed(args); + } else { + ValueOperations valueOperations = stringRedisTemplate.opsForValue(); + String value = valueOperations.get(redisKey); + if (value == null) { + String lockKey = StringUtils.join(redisKey, ":", "lock"); + long time = System.currentTimeMillis() + 2000; + String timeStr = String.valueOf(time); + try { + //分布式锁,保证一个线程读DB,其它线程排队 + if (redisLock.lock2(lockKey, timeStr)) { + log.debug("CacheAspect 读库中, key:{}: " + lockKey); + result = jp.proceed(args); + String json_data = JSONObject.toJSONString(result); + valueOperations.set(redisKey, json_data, cache.expireTime(), cache.dateUnit()); + log.debug("CacheAspect 缓存不存在,获取接口数据并放入缓存,key:{}, expire:{}", redisKey, cache.expireTime()); + } else { + log.debug("CacheAspect 读库等待中, key:{}: " + lockKey); + Thread.sleep(2000); + value = valueOperations.get(redisKey); + result = parseCache(jp, redisKey, value); + } + } catch (Throwable throwable) { + log.error("CacheAspect proceed error , Illegal argument: {} in {}.{}()", Arrays.toString(jp.getArgs()), + jp.getSignature().getDeclaringTypeName(), jp.getSignature().getName(), throwable); + throw throwable; + } finally { + redisLock.unlock(lockKey, timeStr); + } + } else { + result = parseCache(jp, redisKey, value); + } + // 计数器 + stringRedisTemplate.opsForHash().increment("hotapi", redisKey, 1); + } + return result; + } + + private Object parseCache(ProceedingJoinPoint jp, String redisKey, String value) { + if (StringUtils.isBlank(value)) { + log.debug("CacheAspect 缓存不存在,解析缓存数据为空:{},key:{}", value, redisKey); + return null; + } + Class returnType = ((MethodSignature) jp.getSignature()).getReturnType(); + log.debug("CacheAspect 缓存存在,解析缓存并返回,key:{}", redisKey); + return JSONObject.parseObject(value, returnType); + } +} diff --git a/mallinkPublicApi/src/main/java/com/iformall/config/MyBatisConfiguration.java b/mallinkPublicApi/src/main/java/com/iformall/config/MyBatisConfiguration.java new file mode 100644 index 000000000..f58a1dd3b --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/config/MyBatisConfiguration.java @@ -0,0 +1,24 @@ +package com.iformall.config; + +import com.iformall.plugin.MyBatisItercepters; +import com.iformall.plugin.MyBatisPlus; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class MyBatisConfiguration extends BaseMyBatisConfiguration { + + @Bean + public MyBatisItercepters intercepters() { + MyBatisItercepters intercepters = new MyBatisItercepters(); + List plugins = new ArrayList(); + plugins.add(baseShardingSpherePlugin()); + + intercepters.setPlugins(plugins); + return intercepters; + } +} diff --git a/mallinkPublicApi/src/main/java/com/iformall/config/RedisConfig.java b/mallinkPublicApi/src/main/java/com/iformall/config/RedisConfig.java new file mode 100644 index 000000000..02e61114a --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/config/RedisConfig.java @@ -0,0 +1,335 @@ +package com.iformall.config; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.github.pagehelper.PageInfo; +import com.iformall.domain.po.*; +import com.iformall.domain.po.base.BaseCUserEntity; +import com.iformall.domain.vo.WxCouponCVo; +import com.iformall.domain.vo.WxCouponChannelVo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.cache.RedisCacheConfiguration; +import org.springframework.data.redis.cache.RedisCacheManager; +import org.springframework.data.redis.cache.RedisCacheWriter; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +import java.time.Duration; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by Stormeye on 2018/10/1. + */ +@Configuration +@EnableCaching +public class RedisConfig extends CachingConfigurerSupport { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + //缓存管理器 + @Bean + public CacheManager cacheManager(RedisConnectionFactory connectionFactory) { + //user信息缓存配置 + RedisCacheConfiguration userCacheConfiguration = RedisCacheConfiguration.defaultCacheConfig().entryTtl(Duration.ofSeconds(10)).disableCachingNullValues().prefixKeysWith("user"); + Map redisCacheConfigurationMap = new HashMap<>(); + redisCacheConfigurationMap.put("user", userCacheConfiguration); + //初始化一个RedisCacheWriter + RedisCacheWriter redisCacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory); + // 设置CacheManager的值序列化方式为JdkSerializationRedisSerializer,但其实RedisCacheConfiguration默认就是使用StringRedisSerializer序列化key,JdkSerializationRedisSerializer序列化value,所以以下注释代码为默认实现 + // ClassLoader loader = this.getClass().getClassLoader(); + // JdkSerializationRedisSerializer jdkSerializer = new JdkSerializationRedisSerializer(loader); + // RedisSerializationContext.SerializationPair pair = RedisSerializationContext.SerializationPair.fromSerializer(jdkSerializer); + // RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig().serializeValuesWith(pair); + RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig(); + //设置默认超过期时间是30秒 + defaultCacheConfig.entryTtl(Duration.ofSeconds(30)); + //初始化RedisCacheManager + RedisCacheManager cacheManager = new RedisCacheManager(redisCacheWriter, defaultCacheConfig, redisCacheConfigurationMap); + return cacheManager; + } + + @Bean("pushLimitRedisTemplate") + public RedisTemplate getPushLimitRedisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate(); + template.setConnectionFactory(connectionFactory); + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(PushLimit.class); + ObjectMapper om = new ObjectMapper(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + j.setObjectMapper(om); + // value值的序列化 + template.setValueSerializer(j); + template.setHashValueSerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + + return template; + } + + @Bean("scoreRuleRedisTemplate") + public RedisTemplate getScoreRuleRedisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate(); + template.setConnectionFactory(connectionFactory); + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(WxScoreRules.class); + ObjectMapper om = new ObjectMapper(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + j.setObjectMapper(om); + // value值的序列化 + template.setValueSerializer(j); + template.setHashValueSerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + + return template; + } + + @Bean("cuserTokenRedisTemplate") + public RedisTemplate getCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate(); + template.setConnectionFactory(connectionFactory); + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(WxCUser.class); + + ObjectMapper om = new ObjectMapper(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + j.setObjectMapper(om); + + // value值的序列化 + template.setValueSerializer(j); + template.setHashValueSerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + + return template; + } + + @Bean("baseCUserTokenRedisTemplate") + public RedisTemplate getBaseCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate(); + + template.setConnectionFactory(connectionFactory); + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(BaseCUserEntity.class); + + ObjectMapper om = new ObjectMapper(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + j.setObjectMapper(om); + + // value值的序列化 + template.setValueSerializer(j); + template.setHashValueSerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + + return template; + } + + @Bean("cUserBasicInfoRedisTemplate") + public RedisTemplate getCUserBasicInfoRedisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate(); + template.setConnectionFactory(connectionFactory); + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(WxCUserBasicInfo.class); + + ObjectMapper om = new ObjectMapper(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + j.setObjectMapper(om); + // value值的序列化 + template.setValueSerializer(j); + template.setHashValueSerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + + return template; + } + + @Bean("mallRedisTemplate") + public RedisTemplate getMallRedisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate(); + template.setConnectionFactory(connectionFactory); + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(WxMall.class); + + ObjectMapper om = new ObjectMapper(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + j.setObjectMapper(om); + // value值的序列化 + template.setValueSerializer(j); + template.setHashValueSerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + + return template; + } + + @Bean("subMallListRedisTemplate") + public RedisTemplate> getSubMallListRedisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate> template = new RedisTemplate>(); + template.setConnectionFactory(connectionFactory); + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(List.class); + ObjectMapper om = new ObjectMapper(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + j.setObjectMapper(om); + // value值的序列化 + template.setValueSerializer(j); + template.setHashValueSerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + + return template; + } + + @Bean("couponDetailRedisTemplate") + public RedisTemplate getCouponDetailRedisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate(); + template.setConnectionFactory(connectionFactory); + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(WxCouponCVo.class); + ObjectMapper om = new ObjectMapper(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + j.setObjectMapper(om); + // value值的序列化 + template.setValueSerializer(j); + template.setHashValueSerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + + return template; + } + + @Bean("couponChannelRedisTemplate") + public RedisTemplate> getCouponChannelRedisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate> template = new RedisTemplate<>(); + template.setConnectionFactory(connectionFactory); + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(PageInfo.class); + ObjectMapper om = new ObjectMapper(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + j.setObjectMapper(om); + + // value值的序列化 + template.setValueSerializer(j); + template.setHashValueSerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + + return template; + } + + @Bean("buserTokenRedisTemplate") + public RedisTemplate getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate(); + template.setConnectionFactory(connectionFactory); + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(WxBuser.class); + ObjectMapper om = new ObjectMapper(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + j.setObjectMapper(om); + + // value值的序列化 + template.setValueSerializer(j); + template.setHashValueSerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + + return template; + } + + @Bean("pressOrderRedisTemplate") + public RedisTemplate getPressOrderRedisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate<>(); + template.setConnectionFactory(connectionFactory); + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(WxOrder.class); + ObjectMapper om = new ObjectMapper(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + j.setObjectMapper(om); + + // value值的序列化 + template.setValueSerializer(j); + template.setHashValueSerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + + return template; + } + + @Bean("stringValueOperations") + public ValueOperations getStringValueOperations(RedisConnectionFactory connectionFactory) { + StringRedisTemplate template = new StringRedisTemplate(); + template.setConnectionFactory(connectionFactory); + template.afterPropertiesSet(); + return template.opsForValue(); + } + + @Bean("objectCommonRedisTemplate") + public RedisTemplate getObjectValueOperations(RedisConnectionFactory connectionFactory) { + RedisTemplate template = new RedisTemplate<>(); + template.setConnectionFactory(connectionFactory); + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(Object.class); + ObjectMapper om = new ObjectMapper(); + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + j.setObjectMapper(om); + + // value值的序列化 + template.setValueSerializer(j); + template.setHashValueSerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + template.afterPropertiesSet(); + return template; + } +} diff --git a/mallinkPublicApi/src/main/java/com/iformall/config/Swagger2Config.java b/mallinkPublicApi/src/main/java/com/iformall/config/Swagger2Config.java new file mode 100644 index 000000000..2118b9dbd --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/config/Swagger2Config.java @@ -0,0 +1,61 @@ +package com.iformall.config; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.ParameterBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.schema.ModelRef; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Parameter; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.paths.RelativePathProvider; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import javax.servlet.ServletContext; +import java.util.ArrayList; +import java.util.List; + +//参考:http://blog.csdn.net/catoop/article/details/50668896 +@Configuration +@EnableSwagger2 +public class Swagger2Config { + + @Autowired + private ServletContext servletContext; + + @Bean + public Docket createRestApi() { + ParameterBuilder tokenPar = new ParameterBuilder(); + List pars = new ArrayList(); + //增加一个request的header参数 + tokenPar.name("token").description("令牌").modelRef(new ModelRef("string")).parameterType("header").required(false).build(); + pars.add(tokenPar.build()); + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + .select() + .apis(RequestHandlerSelectors.basePackage("com.iformall.controller")) + .paths(PathSelectors.any()) + .build() + .globalOperationParameters(pars) + .pathProvider(new RelativePathProvider(servletContext) { + @Override + public String getApplicationBasePath() { + return "/api"; + } + }); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("c端 api") + .description("c api") + .termsOfServiceUrl("http://localhost:7000") + .version("2.0") + .build(); + } + +} \ No newline at end of file diff --git a/mallinkPublicApi/src/main/java/com/iformall/config/WebMvcConfig.java b/mallinkPublicApi/src/main/java/com/iformall/config/WebMvcConfig.java new file mode 100644 index 000000000..1b2a21515 --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/config/WebMvcConfig.java @@ -0,0 +1,106 @@ +package com.iformall.config; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationConfig; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.iformall.interceptor.AuthorizationInterceptor; +import com.iformall.interceptor.HttpServletRequestWrapperFilter; +import com.iformall.interceptor.RequestInterceptor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.web.method.support.HandlerMethodArgumentResolver; +import org.springframework.web.servlet.config.annotation.*; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.text.SimpleDateFormat; +import java.util.List; + +/** + * MVC配置 + * + * @author stormeye.wu + * @email wugq@mippoint.com + * @date 2017-04-20 22:30 + */ +@Configuration +@EnableWebMvc +public class WebMvcConfig implements WebMvcConfigurer { + @Autowired + private AuthorizationInterceptor authorizationInterceptor; + @Autowired + private RequestInterceptor requestInterceptor; + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(authorizationInterceptor).addPathPatterns("/api/**"); + registry.addInterceptor(requestInterceptor).addPathPatterns("/api/**"); + } + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("swagger-ui.html") + .addResourceLocations("classpath:/META-INF/resources/"); + registry.addResourceHandler("/webjars/**") + .addResourceLocations("classpath:/META-INF/resources/webjars/"); + //registry.addResourceHandler("/app/**").addResourceLocations("classpath:/app/"); + + } + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/api/**") + .allowedOrigins("*") + .allowCredentials(true) + .allowedMethods("GET", "POST", "DELETE", "PUT") + .maxAge(3600); + } + + @Override + public void configureMessageConverters(List> converters) { + MappingJackson2HttpMessageConverter jackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter(); + //ObjectMapper 是Jackson库的主要类。它提供一些功能将转换成Java对象匹配JSON结构,反之亦然 + ObjectMapper objectMapper = new ObjectMapper(); + SimpleModule simpleModule = new SimpleModule(); + + //不显示为null的字段 + objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + + DeserializationConfig dc = objectMapper.getDeserializationConfig(); + // 设置反序列化日期格式、忽略不存在get、set的属性 + objectMapper.setConfig( + dc.with(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")) + .without(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + ); + //序列化将Long转String类型 + simpleModule.addSerializer(Long.class, ToStringSerializer.instance); + simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); + SimpleModule bigIntegerModule = new SimpleModule(); + //序列化将BigInteger转String类型 + bigIntegerModule.addSerializer(BigInteger.class, ToStringSerializer.instance); + SimpleModule bigDecimalModule = new SimpleModule(); + //序列化将BigDecimal转String类型 + bigDecimalModule.addSerializer(BigDecimal.class, ToStringSerializer.instance); + objectMapper.registerModule(simpleModule); + objectMapper.registerModule(bigDecimalModule); + objectMapper.registerModule(bigIntegerModule); + jackson2HttpMessageConverter.setObjectMapper(objectMapper); + converters.add(jackson2HttpMessageConverter); + } + + @Bean + public FilterRegistrationBean Filters() { + FilterRegistrationBean registrationBean = new FilterRegistrationBean(); + registrationBean.setFilter(new HttpServletRequestWrapperFilter()); + registrationBean.addUrlPatterns("/*"); + registrationBean.setName("koalaSignFilter"); + return registrationBean; + } +} \ No newline at end of file diff --git a/mallinkPublicApi/src/main/java/com/iformall/controller/BaseController.java b/mallinkPublicApi/src/main/java/com/iformall/controller/BaseController.java new file mode 100644 index 000000000..56a157ed5 --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/controller/BaseController.java @@ -0,0 +1,57 @@ +package com.iformall.controller; + +import com.iformall.utils.IPUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.web.bind.WebDataBinder; +import org.springframework.web.bind.annotation.InitBinder; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.beans.PropertyEditorSupport; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +@RestController +public class BaseController { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + @Qualifier("objectCommonRedisTemplate") + RedisTemplate objectCommonRedisTemplate; + + @InitBinder + public void InitBinder(WebDataBinder dataBinder) { + dataBinder.registerCustomEditor(Date.class, new PropertyEditorSupport() { + public void setAsText(String value) { + try { + setValue(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(value)); + } catch (ParseException e) { + try { + setValue(new SimpleDateFormat("yyyy-MM-dd ").parse(value)); + } catch (ParseException e1) { + setValue(null); + } + } + } + + public String getAsText() { + return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((Date) getValue()); + } + + }); + } + + public String getIpAddr() { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String ipaddress = IPUtil.getIpAddr(request); + return ipaddress; + } +} diff --git a/mallinkPublicApi/src/main/java/com/iformall/interceptor/AuthorizationInterceptor.java b/mallinkPublicApi/src/main/java/com/iformall/interceptor/AuthorizationInterceptor.java new file mode 100644 index 000000000..f19903526 --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/interceptor/AuthorizationInterceptor.java @@ -0,0 +1,68 @@ +package com.iformall.interceptor; + + +import com.iformall.common.ErrorCode; +import com.iformall.exception.MallinkException; +import com.iformall.utils.HashUtil; +import com.iformall.utils.RedisCacheUtils; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * 权限(Token)验证 + * @author stormeye.wu + * @email wuguoqiang@iformall.com + * @date 2017-03-23 15:38 + */ +@Component +public class AuthorizationInterceptor extends HandlerInterceptorAdapter { + + + @Autowired + @Qualifier("objectCommonRedisTemplate") + RedisTemplate redisTemplate; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + String cid = request.getParameter("cId");//调用方ID + String nonceStr = request.getParameter("nonceStr");//随机字符串 + String signKey = request.getParameter("signKey");//随机字符串 + + if(StringUtils.isBlank(cid) || "null".equals(cid) || "undefined".equals(cid)){ + throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"cId为空["+cid+"]"); + } + + if(StringUtils.isBlank(nonceStr) || "null".equals(nonceStr) || "undefined".equals(nonceStr)){ + throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"nonceStr为空["+nonceStr+"]"); + } + + if(StringUtils.isBlank(signKey) || "null".equals(signKey) || "undefined".equals(signKey)){ + throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"signKey为空["+signKey+"]"); + } + + //nonceStr必须唯一,为防止接口盗刷,每次只能调用一次 + Integer cache = RedisCacheUtils.getCacheInteger(redisTemplate, "publicApi:"+nonceStr); + if (null != cache) { + throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"不能重复调用"); + } + + + //TODO singnKey是根据cid+cid对应的密钥+nonceStr + String secretKey = "";//TODO 根据cid查询密钥,缓存 + String signstr = HashUtil.md5(cid+secretKey+nonceStr); + if (!signKey.equals(signstr)) { + throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"加密串校验失败"); + } + + RedisCacheUtils.cache(redisTemplate, "publicApi:"+nonceStr, 1, 600); + return true; + } +} diff --git a/mallinkPublicApi/src/main/java/com/iformall/interceptor/BodyReaderHttpServletRequestWrapper.java b/mallinkPublicApi/src/main/java/com/iformall/interceptor/BodyReaderHttpServletRequestWrapper.java new file mode 100644 index 000000000..38aec3039 --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/interceptor/BodyReaderHttpServletRequestWrapper.java @@ -0,0 +1,76 @@ +package com.iformall.interceptor; + +import javax.servlet.ReadListener; +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import java.io.*; + +public class BodyReaderHttpServletRequestWrapper extends XssHttpServletRequestWrapper { + private final String body; + + public BodyReaderHttpServletRequestWrapper(HttpServletRequest request) throws IOException { + super(request); + StringBuilder stringBuilder = new StringBuilder(); + BufferedReader bufferedReader = null; + try { + InputStream inputStream = request.getInputStream(); + if (inputStream != null) { + bufferedReader = new BufferedReader(new InputStreamReader(inputStream,"utf-8")); + char[] charBuffer = new char[1024]; + int bytesRead = -1; + while ((bytesRead = bufferedReader.read(charBuffer)) > 0) { + stringBuilder.append(charBuffer, 0, bytesRead); + } + } else { + stringBuilder.append(""); + } + } catch (IOException ex) { + throw ex; + } finally { + if (bufferedReader != null) { + try { + bufferedReader.close(); + } catch (IOException ex) { + throw ex; + } + } + } + body = stringBuilder.toString(); + } + + @Override + public ServletInputStream getInputStream() throws IOException { + final ByteArrayInputStream byteArrayInputStream = + new ByteArrayInputStream(body.getBytes("utf-8")); + return new ServletInputStream() { + @Override + public boolean isFinished() { + return false; + } + + @Override + public boolean isReady() { + return false; + } + + @Override + public void setReadListener(ReadListener readListener) { + + } + + @Override + public int read() throws IOException { + return byteArrayInputStream.read(); + } + }; + } + + @Override + public BufferedReader getReader() throws IOException { + return new BufferedReader(new InputStreamReader(this.getInputStream())); + } + + public String getBody() { + return this.body; + } +} diff --git a/mallinkPublicApi/src/main/java/com/iformall/interceptor/HttpServletRequestWrapperFilter.java b/mallinkPublicApi/src/main/java/com/iformall/interceptor/HttpServletRequestWrapperFilter.java new file mode 100644 index 000000000..ec4e7cb7d --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/interceptor/HttpServletRequestWrapperFilter.java @@ -0,0 +1,70 @@ +package com.iformall.interceptor; + +import com.iformall.utils.UrlCheck; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.servlet.*; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; + +public class HttpServletRequestWrapperFilter implements Filter { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + // 多个跨域域名设置 + // public static final String[] ALLOW_DOMAIN = {"https://admin.malls.iformall.com"}; + @Override + public void init(FilterConfig filterConfig) throws ServletException { + + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException { + logger.debug("doFilter start"); + long start = System.currentTimeMillis(); + ServletRequest requestWrapper = null; + + /* // 跨域访问 + HttpServletRequest req = (HttpServletRequest) request; + HttpServletResponse res = (HttpServletResponse) response; + String originHeader = req.getHeader("Origin"); + + if (Arrays.asList(ALLOW_DOMAIN).contains(originHeader)) { + //通过在响应 header 中设置 ‘*’ 来允许来自所有域的跨域请求访问。 + res.setHeader("Access-Control-Allow-Origin", originHeader); + //通过对 Credentials 参数的设置,就可以保持跨域 Ajax 时的 Cookie + //设置了Allow-Credentials,Allow-Origin就不能为*,需要指明具体的url域 + res.setHeader("Access-Control-Allow-Credentials", "true"); + //请求方式 + res.setHeader("Access-Control-Allow-Methods", "*"); + //(预检请求)的返回结果(即 Access-Control-Allow-Methods 和Access-Control-Allow-Headers 提供的信息) 可以被缓存多久 + res.setHeader("Access-Control-Max-Age", "86400"); + //首部字段用于预检请求的响应。其指明了实际请求中允许携带的首部字段 + //res.setHeader("Access-Control-Allow-Headers", "*"); + res.setHeader("Access-Control-Allow-Headers", + "Timestamp,Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With,userId,token,Access-Control-Allow-Headers"); + } + */ + + //sql,xss过滤 + XssHttpServletRequestWrapper xssHttpServletRequestWrapper = new XssHttpServletRequestWrapper((HttpServletRequest)request); + String url = ""; + if (request instanceof HttpServletRequest) { + url = ((HttpServletRequest) request).getRequestURI(); + if (!UrlCheck.checkUrl(url)) { + requestWrapper = new BodyReaderHttpServletRequestWrapper((HttpServletRequest) request); + } + } + if (null == requestWrapper) { + chain.doFilter(xssHttpServletRequestWrapper, response); + } else { + chain.doFilter(requestWrapper, response); + } + logger.debug("doFilter end: " + url + " "+ (System.currentTimeMillis()- start) + "ms"); + } + + @Override + public void destroy() { + + } +} diff --git a/mallinkPublicApi/src/main/java/com/iformall/interceptor/RequestInterceptor.java b/mallinkPublicApi/src/main/java/com/iformall/interceptor/RequestInterceptor.java new file mode 100644 index 000000000..ff7e81880 --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/interceptor/RequestInterceptor.java @@ -0,0 +1,123 @@ +package com.iformall.interceptor; + +import com.iformall.common.ErrorCode; +import com.iformall.exception.MallinkException; +import com.iformall.utils.HashUtil; +import com.iformall.utils.IPUtil; +import com.iformall.utils.UrlCheck; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.dao.DataAccessException; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; +import redis.clients.jedis.Protocol; +import redis.clients.jedis.util.SafeEncoder; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.util.Enumeration; +import java.util.concurrent.TimeUnit; + +/** + * 幂等检查 + * @author stormeye.wu + * @email wuguoqiang@iformall.com + * @date 2017-03-23 15:38 + */ +@Component +public class RequestInterceptor extends HandlerInterceptorAdapter { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Resource + private RedisTemplate redisTemplate; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + logger.debug("preHandle start"); + if ("GET".equalsIgnoreCase(request.getMethod())) { + // 获取不检查幂等 + logger.debug("preHandle start 1"); + return true; + } + String ipaddress = IPUtil.getIpAddr(request); + String url = request.getRequestURL().toString(); + if (UrlCheck.checkUrl(url)) { + // pvlog不检查幂等 + // awsFileUpload不检查幂等 + // stopFee + return true; + } + StringBuilder sb = new StringBuilder(); + + sb.append(url); + + sb.append("method=").append(request.getMethod()).append("&"); + + sb.append("ip=").append(ipaddress).append("&"); + + final Enumeration parameterNames = request.getParameterNames(); + while (parameterNames.hasMoreElements()) { + String key = (String) parameterNames.nextElement(); + if(key.equalsIgnoreCase("ran")) // 跳过ran + continue; + String parameter = request.getParameter(key); + sb.append(key).append("=").append(parameter).append("&"); + } + + InputStream inStream = request.getInputStream(); + ByteArrayOutputStream outSteam = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024]; + int len = 0; + while ((len = inStream.read(buffer)) != -1) { + outSteam.write(buffer, 0, len); + } + String resultBody = new String(outSteam.toByteArray(), Charset.forName("UTF-8")); + inStream.close(); + outSteam.close(); + + sb.append(resultBody); + + String key = "request:C:" + HashUtil.md5(sb.toString()); + Boolean isAbsent = redisTemplate.execute(new RedisCallback() { + @Override + public Boolean doInRedis(RedisConnection connection) throws DataAccessException { + RedisSerializer valueSerializer = redisTemplate.getValueSerializer(); + RedisSerializer keySerializer = redisTemplate.getKeySerializer(); + Object obj = connection.execute("set", keySerializer.serialize(key), + valueSerializer.serialize(key), + SafeEncoder.encode("NX"), + SafeEncoder.encode("EX"), + Protocol.toByteArray(3)); // 3s + return obj != null; + } + }); + if (isAbsent) { + logger.info(key + ": 第一次提交"); + logger.debug("preHandle start 2"); + return true; + } + logger.info(key + ": 第二次提交"); + logger.debug("preHandle start 3"); + throw new MallinkException(ErrorCode.SYS_REPEAT_SUBMIT_EXCEPTION); + } + + @Override + public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { + logger.debug("postHandle"); + } + + @Override + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { + logger.debug("afterCompletion"); + } +} diff --git a/mallinkPublicApi/src/main/java/com/iformall/interceptor/WebLogAspect.java b/mallinkPublicApi/src/main/java/com/iformall/interceptor/WebLogAspect.java new file mode 100644 index 000000000..c66aeef83 --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/interceptor/WebLogAspect.java @@ -0,0 +1,72 @@ +package com.iformall.interceptor; + +import com.iformall.utils.IPUtil; +import lombok.Data; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +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.util.Arrays; + +@Aspect +@Component +public class WebLogAspect { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Data + private class MethodInfo { + Long startTime; + String url; + String ip; + String method; + String classMethod; + } + + ThreadLocal startInfo = new ThreadLocal<>(); + + + @Pointcut("execution(public * com.iformall.controller..*.*(..))") + public void webLog() {} + + @Before("webLog()") + public void doBefore(JoinPoint joinPoint) throws Throwable { + logger.debug("aspect start"); + // 接收到请求,记录请求内容 + ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletRequest request = attributes.getRequest(); + + MethodInfo info = new MethodInfo(); + info.setUrl(request.getRequestURL().toString()); + info.setStartTime(System.currentTimeMillis()); + info.setIp(IPUtil.getIpAddr(request)); + info.setMethod(request.getMethod()); + info.setClassMethod(joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName()); + startInfo.set(info); + logger.debug("aspect start ..."); + } + + @AfterReturning(returning = "ret", pointcut = "webLog()") + public void doAfterReturning(Object ret) throws Throwable { + logger.debug("aspect after"); + // 处理完请求,返回内容 + MethodInfo info = startInfo.get(); + StringBuilder sb = new StringBuilder(); + sb.append("URL: ").append(info.getUrl()) + .append(", METHOD: ").append(info.getMethod()) + .append(", DO: ").append(info.getClassMethod()) + .append(", IP: ").append(info.getIp()) + .append(", SPEND TIME: ").append(System.currentTimeMillis() -info.getStartTime()).append("ms"); + logger.info(sb.toString()); + logger.debug("aspect after .."); + } + + +} diff --git a/mallinkPublicApi/src/main/java/com/iformall/interceptor/XssHttpServletRequestWrapper.java b/mallinkPublicApi/src/main/java/com/iformall/interceptor/XssHttpServletRequestWrapper.java new file mode 100644 index 000000000..1d954d163 --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/interceptor/XssHttpServletRequestWrapper.java @@ -0,0 +1,125 @@ +package com.iformall.interceptor; + + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.util.StringUtils; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * 防止sql注入,xss攻击 + * 前端可以对输入信息做预处理,后端也可以做处理。 + */ +public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { + private final Logger log = LoggerFactory.getLogger(getClass()); + private static String key = "and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare|;|or|-|+"; + private static Set notAllowedKeyWords = new HashSet(0); + private static String replacedString="INVALID"; + static { + String keyStr[] = key.split("\\|"); + for (String str : keyStr) { + notAllowedKeyWords.add(str); + } + } + + private String currentUrl; + + public XssHttpServletRequestWrapper(HttpServletRequest servletRequest) { + super(servletRequest); + currentUrl = servletRequest.getRequestURI(); + } + + + /**覆盖getParameter方法,将参数名和参数值都做xss过滤。 + * 如果需要获得原始的值,则通过super.getParameterValues(name)来获取 + * getParameterNames,getParameterValues和getParameterMap也可能需要覆盖 + */ + @Override + public String getParameter(String parameter) { + String value = super.getParameter(parameter); + if (value == null) { + return null; + } + return cleanXSS(value); + } + @Override + public String[] getParameterValues(String parameter) { + String[] values = super.getParameterValues(parameter); + if (values == null) { + return null; + } + int count = values.length; + String[] encodedValues = new String[count]; + for (int i = 0; i < count; i++) { + encodedValues[i] = cleanXSS(values[i]); + } + return encodedValues; + } + @Override + public Map getParameterMap(){ + Map values=super.getParameterMap(); + if (values == null) { + return null; + } + Map result=new HashMap<>(); + for(String key:values.keySet()){ + String encodedKey=cleanXSS(key); + int count=values.get(key).length; + String[] encodedValues = new String[count]; + for (int i = 0; i < count; i++){ + encodedValues[i]=cleanXSS(values.get(key)[i]); + } + result.put(encodedKey,encodedValues); + } + return result; + } + /** + * 覆盖getHeader方法,将参数名和参数值都做xss过滤。 + * 如果需要获得原始的值,则通过super.getHeaders(name)来获取 + * getHeaderNames 也可能需要覆盖 + */ + @Override + public String getHeader(String name) { + if(name.equalsIgnoreCase("user-agent")) { + return super.getHeader(name); + } + String value = super.getHeader(name); + if (value == null) { + return null; + } + return cleanXSS(value); + } + + private String cleanXSS(String valueP) { + // You'll need to remove the spaces from the html entities below + String value = valueP.replaceAll("<", "<").replaceAll(">", ">"); + value = value.replaceAll("<", "& lt;").replaceAll(">", "& gt;"); + value = value.replaceAll("\\(", "& #40;").replaceAll("\\)", "& #41;"); + value = value.replaceAll("'", "& #39;"); + value = value.replaceAll("eval\\((.*)\\)", ""); + value = value.replaceAll("[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']", "\"\""); + value = value.replaceAll("script", ""); + value = cleanSqlKeyWords(value); + return value; + } + + private String cleanSqlKeyWords(String value) { + String paramValue = value; + for (String keyword : notAllowedKeyWords) { + if (paramValue.length() > keyword.length() + 4 + && (paramValue.contains(" "+keyword)||paramValue.contains(keyword+" ")||paramValue.contains(" "+keyword+" "))) { + paramValue = StringUtils.replace(paramValue, keyword, replacedString); + log.error(this.currentUrl + "已被过滤,因为参数中包含不允许sql的关键词(" + keyword + + ")"+";参数:"+value+";过滤后的参数:"+paramValue); + } + } + return paramValue; + } + +} diff --git a/mallinkPublicApi/src/main/java/com/iformall/utils/ImgIdeaUtil.java b/mallinkPublicApi/src/main/java/com/iformall/utils/ImgIdeaUtil.java new file mode 100644 index 000000000..16ebb8d46 --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/utils/ImgIdeaUtil.java @@ -0,0 +1,175 @@ +package com.iformall.utils; + +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; +import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; +import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; +import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.util.ResourceUtils; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.InputStream; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Locale; + +public class ImgIdeaUtil { + + private static final Logger logger = LoggerFactory.getLogger(ImgIdeaUtil.class); + + //模板图片 + private static final String imgTempPath = "imgTemp/gertificate.jpg"; + //字体路径 + private static final String fontPath = "opt/HWLS.TTF"; + + /** + * 生成图片证书 + * @return + */ + public static byte[] imgGertificate(String name, String englishName, LocalDateTime date){ + if(StringUtils.isBlank(name)){ + logger.error("名字为空,无法生成证书"); + return null; + } + if(name.length() == 2){ + name = name.replaceAll("(\\S)", "$0 "); + } + if(StringUtils.isBlank(englishName)){ + englishName = getUpEname(name); + } + if(date == null){ + date = LocalDateTime.now(); + } + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dMMM yyyy", Locale.UK); + String dateFormat = date.format(formatter); + + try { + + InputStream backImgUrl = ClassLoader.getSystemResourceAsStream(imgTempPath); + //InputStream backImgUrl = ImgIdeaUtil.class.getClassLoader().getResourceAsStream(imgTempPath); + + Font font = Font.createFont(Font.TRUETYPE_FONT, ResourceUtils.getFile("classpath:"+fontPath)); + BufferedImage backImg = ImageIO.read(backImgUrl); + Graphics g = backImg.getGraphics(); + + //图片加中文名 + Font fTxtBottomName = font.deriveFont(Font.PLAIN, 170); + //Font fTxtBottomName = new Font("华文隶书", Font.PLAIN, 170); + FontMetrics metricsName = g.getFontMetrics(fTxtBottomName); + int xName = (backImg.getWidth() - metricsName.stringWidth(name)) / 2; + Color myColorTxtBottomName = Color.BLACK; //颜色 + g.setColor(myColorTxtBottomName); + g.setFont(fTxtBottomName); + g.drawString(name, xName , 1150);//g.drawString(文字, x 位置, y 位置); + + //图片加英文名 + Font fTxtBottomEname = font.deriveFont(Font.PLAIN, 120); + //Font fTxtBottomEname = new Font("华文隶书", Font.PLAIN, 120); + FontMetrics metricsEname = g.getFontMetrics(fTxtBottomEname); + int xEname = (backImg.getWidth() - metricsEname.stringWidth(englishName)) / 2; + Color myColorTxtBottomEname = Color.BLACK; + g.setColor(myColorTxtBottomEname); + g.setFont(fTxtBottomEname); + g.drawString(englishName, xEname, 1300); + + //图片加日期 + Font fTxtBottomDate = font.deriveFont(Font.PLAIN, 90); + //Font fTxtBottomDate = new Font("华文隶书", Font.PLAIN, 90); + Color myColorTxtBottomDate = Color.BLACK; + g.setColor(myColorTxtBottomDate); + g.setFont(fTxtBottomDate); + g.drawString(dateFormat, 440, 2100); + + //调这个方法就是开始这个整合 (可以多张图片,多个文字整合成一张图片,只有把他们放在这方法里面就行) + g.dispose(); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ImageIO.write(backImg, "png", out); + + return out.toByteArray(); + } catch (Exception e) { + e.printStackTrace(); + logger.error("生成证书异常", e.getMessage()); + } + return null; + } + + /** + * //姓、名的第一个字母需要为大写 + * @param name + * @return + */ + public static String getUpEname(String name) { + char[] strs = name.toCharArray(); + String newname = null; + + if (strs.length == 2) { + newname = toUpCase(getEname("" + strs[0])) + " " + toUpCase(getEname("" + strs[1])); + } else if (strs.length == 3){ + newname = toUpCase(getEname("" + strs[0])) + " " + + toUpCase(getEname("" + strs[1] + strs[2])); + }else if (strs.length == 4){ + newname = toUpCase(getEname("" + strs[0] + strs[1])) + " " + + toUpCase(getEname("" + strs[2] + strs[3])); + } else{ + newname = toUpCase(getEname(name)); + } + return newname; + } + + + /** + * //将中文转换为英文 + * @param name + * @return + */ + public static String getEname(String name){ + HanyuPinyinOutputFormat pyFormat = new HanyuPinyinOutputFormat(); + pyFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE); + pyFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); + pyFormat.setVCharType(HanyuPinyinVCharType.WITH_V); + String s = ""; + try { + s = PinyinHelper.toHanyuPinyinString(name, pyFormat, ""); + } catch (BadHanyuPinyinOutputFormatCombination badHanyuPinyinOutputFormatCombination) { + badHanyuPinyinOutputFormatCombination.printStackTrace(); + } + return s; + } + /** + * 首字母大写 + * @param str + * @return + */ + private static String toUpCase(String str) { + StringBuffer newstr = new StringBuffer(); + newstr.append((str.substring(0, 1)).toUpperCase()).append( + str.substring(1, str.length())); + return newstr.toString(); + } + + +// public static void main(String[] args) { +// String serverUploadImgUrl = "C:/Users/xiaohu/Desktop/img"; // 图片保存路径 +// try { +// byte[] bytes = imgGertificate("郑方元", null, null); +// ByteArrayInputStream bais = new ByteArrayInputStream(bytes); +// BufferedImage bi1 =ImageIO.read(bais); +// +// ImageIO.write(bi1, "png", new File(serverUploadImgUrl+"/0.png")); +// +// } catch (Exception e) { +// e.printStackTrace(); +// } +// System.out.println("结束"); +// } +} diff --git a/mallinkPublicApi/src/main/java/com/iformall/utils/UrlCheck.java b/mallinkPublicApi/src/main/java/com/iformall/utils/UrlCheck.java new file mode 100644 index 000000000..e3961ad71 --- /dev/null +++ b/mallinkPublicApi/src/main/java/com/iformall/utils/UrlCheck.java @@ -0,0 +1,14 @@ +package com.iformall.utils; + +/** + * @author gongbiao + */ +public class UrlCheck { + + public static boolean checkUrl(String url) { + return url.contains("awsFileUpload") + || url.contains("awsFilesUpload") + || url.contains("getCarStopFee"); + } + +} diff --git a/mallinkPublicApi/src/main/resources/application-dev.yml b/mallinkPublicApi/src/main/resources/application-dev.yml new file mode 100644 index 000000000..f4f0cd3f9 --- /dev/null +++ b/mallinkPublicApi/src/main/resources/application-dev.yml @@ -0,0 +1,167 @@ +spring: + profiles: + #include: aliyunRocketMQ + include: rabbitMQ + # JDBC + datasource: + url: jdbc:mysql://101.200.130.134:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true + username: root + password: fm2020test + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + filters: stat + maxActive: 20 + initialSize: 1 + maxWait: 60000 + minIdle: 1 + timeBetweenEvictionRunsMillis: 28000 + minEvictableIdleTimeMillis: 28000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + #jackson: + #date-format: yyyy-MM-dd HH:mm:ss + + # REDIS + redis: + host: 101.200.130.134 + port: 6379 + password: iF0rm@2l2ol9 + timeout: 3600 + expire: 1800 #30分钟 + database: 5 + jedis: + pool: + max-active: 200 + max-idle: 100 + max-wait: -1 + min-idle: 0 + + # SMS + aliyun: + sms: + accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V + accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry + product: Dysmsapi + domain: dysmsapi.aliyuncs.com + regionId: cn-hangzhou + dateFormat: yyyyMMdd + endpointName: cn-hangzhou + + oss: + endpoint: oss-cn-beijing.aliyuncs.com + keyid: LTAI4G7ixY4AhvM35F8o3W3V + keysecret: VfWqGb83qIQrS9us45utskl8itd7ry + bucketname: formall + filehost: malinkcapi + filedomain: https://formall.oss-accelerate.aliyuncs.com + + # EMAIL + mail: + host: smtp.exmail.qq.com + username: service@iformall.com + password: jGvApygXN7wc5SzN # 授权密码 + properties: + mail: + smtp: + auth: true + starttls: + enable: true + socketFactory: + port: 465 + class: javax.net.ssl.SSLSocketFactory + # ROCKETMQ + rocketmq: + nameServer: 127.0.0.1:9876 + producer: + retry-times-when-send-async-failed: 0 + send-msg-timeout: 300000 + compress-msg-body-over-howmuch: 4096 + max-message-size: 4194304 + retry-another-broker-when-not-store-ok: false + retry-times-when-send-failed: 2 + # RABBITMQ + rabbitmq: + host: 101.200.130.134 + port: 5672 + username: fumao + password: f9l98 + publisher-confirms: true + publisher-returns: false + virtual-host: / + aliyunRocketmq: + accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" + accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" + groupId: "GID_P_1" + namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" + +aws: + clientRegion: cn-northwest-1 + bucketName: iformall-net + access: ENC(3gx5ghDFBqGrEhO3Wf8aYmXsnwHO7Cj3HNKJGOeUj0o=) + secret: ENC(HVKIJwCJKVXLlUpGlQPwNqJOlnpxn4xYuy91SH0seTSm2uAttIQHvA49fXWWax90v5wloIk0QuU=) + +#wechat: +# open: +# componentAppId: "wxdfc8fb4e62d6b52b" +# componentSecret: "98daa62b316dd6feabaad708327ce233" +# componentToken: "formall2018" +# componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" +# redis: +# host: 101.201.103.81 +# port: 6379 +# password: ENC(xPFDlgd6v8zUhJMbcKc0KmmQiqs9qHtk) +# timeout: 3600 +# expire: 1800 #30分钟 +# database: 2 +# defaultExpiration: 2592000 # 默认生命周期30天 +# jedis: +# pool: +# max-active: 100 +# max-idle: 500 +# max-wait: -1 +# min-idle: 10 + +wechat: + web: + appId: "wx091907dd0bfd3f6b" + secret: "2a2ca10738998b9ef92c1fe8a4d366a6" + url: "https://admintest.malls.iformall.com" + open: + componentAppId: wxdfc8fb4e62d6b52b + componentSecret: 98daa62b316dd6feabaad708327ce233 + componentToken: formall2018 + componentAesKey: htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN + redis: + host: 101.200.130.134 + port: 6379 + password: iF0rm@2l2ol9 + timeout: 3600 + expire: 1800 #30分钟 + database: 2 + defaultExpiration: 2592000 # 默认生命周期30天 + jedis: + pool: + max-active: 100 + max-idle: 100 + max-wait: -1 + min-idle: 10 + +jasypt: + encryptor: + password: oRqdnDbK5pj3eMmB + +fm: + exception: true + exception_emails: xuxiaohu@iformall.com + deploy: 1 + open: true + upload_dir: /home/test/server/uploads/ + +logging: + level: + com.iformall: debug + path: ./logs/c \ No newline at end of file diff --git a/mallinkPublicApi/src/main/resources/application-prod.yml b/mallinkPublicApi/src/main/resources/application-prod.yml new file mode 100644 index 000000000..cb6c367fc --- /dev/null +++ b/mallinkPublicApi/src/main/resources/application-prod.yml @@ -0,0 +1,122 @@ +spring: + profiles: + include: aliyunRocketMQ + # JDBC + datasource: + url: jdbc:mysql://zc349w82qvn56ftl5e64-rw4rm.rwlb.rds.aliyuncs.com:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true + username: ENC(nUefcxWYlMS/1cDxikIKwA==) + password: ENC(neToS+hzeFjgSFB/7UEl5qYnW2rUjrPq) + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + filters: stat + maxActive: 20 + initialSize: 1 + maxWait: 60000 + minIdle: 1 + timeBetweenEvictionRunsMillis: 28000 + minEvictableIdleTimeMillis: 28000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + # REDIS + redis: + host: r-2zeaglwf13qqmnllj5.redis.rds.aliyuncs.com + port: 6379 + password: mallone:iF0rm@2l2ol9 + timeout: 3600 + expire: 1800 #30分钟 + database: 1 + defaultExpiration: 2592000 # 默认生命周期30天 + jedis: + pool: + max-active: 100 + max-idle: 100 + max-wait: -1 + min-idle: 10 + # SMS + aliyun: + sms: + accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V + accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry + product: Dysmsapi + domain: dysmsapi.aliyuncs.com + regionId: cn-hangzhou + dateFormat: yyyyMMdd + endpointName: cn-hangzhou + oss: + endpoint: oss-cn-beijing.aliyuncs.com + keyid: LTAI4G7ixY4AhvM35F8o3W3V + keysecret: VfWqGb83qIQrS9us45utskl8itd7ry + bucketname: formall + filehost: malinkadmin + filedomain: https://formall.oss-accelerate.aliyuncs.com + + # EMAIL + mail: + host: smtp.exmail.qq.com + username: sysadministor@iformall.com # 登陆密码sysAdmin1231 + password: SWqPekCEmhUYuYCd # 授权密码 + properties: + mail: + smtp: + auth: true + starttls: + enable: true + socketFactory: + port: 465 + class: javax.net.ssl.SSLSocketFactory + # RABBITMQ + rabbitmq: + host: localhost + port: 5672 + username: ENC(lRmLd6EzgeY1RT5ktcHv9g==) + password: ENC(gBI8mCjr3OC0v57jcnSb660Ux7mW03K2oePgvohhg7w=) + publisher-confirms: true + publisher-returns: false + virtual-host: / + aliyunRocketmq: + accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" + accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" + groupId: "GID_P_1" + namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" +aws: + clientRegion: cn-northwest-1 + bucketName: iformall-net + access: ENC(a6SN1sZ1enNL49ypiOXkg/pPPAnZD8H4buQFTTKN08s=) + secret: ENC(5P5ff4bTMJUbXVR4ZsM03UHzOKZ4+Zg5Iutcdkyp/Quny/oXg+A4KpfwEyGarlLu3vQMJahGP5M=) + +wechat: + open: + componentAppId: ENC(b3JG0MUZgQfz5Zj+DC2ZM1zDeLOiGTmmeokfe2O8kaM=) + componentSecret: ENC(QVyc4BPGdnSjXGs2ivgpDBE1v8wPWHLLRMYI7Vv8uYwC0SiZHQz0QpyyQV/b48Pb) + componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) + componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) + redis: + host: r-2zeaglwf13qqmnllj5.redis.rds.aliyuncs.com + port: 6379 + password: mallone:iF0rm@2l2ol9 + timeout: 3600 + expire: 1800 #30分钟 + database: 2 + defaultExpiration: 2592000 # 默认生命周期30天 + jedis: + pool: + max-active: 100 + max-idle: 100 + max-wait: -1 + min-idle: 10 + +fm: + exception: true + exception_emails: houtaikaifa@iformall.com + deploy: 3 + open: true + upload_dir: /root/uploads/ + +logging: + level: + com.iformall: debug + path: ./logs/c \ No newline at end of file diff --git a/mallinkPublicApi/src/main/resources/application-prodDetry.yml b/mallinkPublicApi/src/main/resources/application-prodDetry.yml new file mode 100644 index 000000000..39184ddd5 --- /dev/null +++ b/mallinkPublicApi/src/main/resources/application-prodDetry.yml @@ -0,0 +1,145 @@ +spring: + profiles: + include: aliyunRocketMQ + # JDBC + datasource: + url: jdbc:mysql://rm-2zel9i9t555zy7lftmo.mysql.rds.aliyuncs.com:3306/mallink?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true&allowMultiQueries=true + username: mallone + password: m@l9oNEl20#@ + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + filters: stat + maxActive: 20 + initialSize: 1 + maxWait: 60000 + minIdle: 1 + timeBetweenEvictionRunsMillis: 28000 + minEvictableIdleTimeMillis: 28000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + connectionProperties: "druid.stat.mergeSql=true;druid.stat.slowSqlMillis=60000" + # REDIS + redis: + host: r-2zeaglwf13qqmnllj5pd.redis.rds.aliyuncs.com + port: 6379 + password: mallone:iF0rm@2l2ol9 + timeout: 3600 + expire: 1800 #30分钟 + database: 1 + defaultExpiration: 2592000 # 默认生命周期30天 + jedis: + pool: + max-active: 100 + max-idle: 20 + max-wait: -1 + min-idle: 0 + + # SMS + aliyun: + sms: + accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V + accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry + product: Dysmsapi + domain: dysmsapi.aliyuncs.com + regionId: cn-hangzhou + dateFormat: yyyyMMdd + endpointName: cn-hangzhou + oss: + endpoint: oss-cn-beijing.aliyuncs.com + keyid: LTAI4G7ixY4AhvM35F8o3W3V + keysecret: VfWqGb83qIQrS9us45utskl8itd7ry + bucketname: formall + filehost: malinkadmin + filedomain: https://formall.oss-accelerate.aliyuncs.com + # EMAIL + mail: + host: smtp.exmail.qq.com + username: zhengfangyuan@iformall.com + password: xnydCeUzofB2h8qp # 授权密码 + properties: + mail: + smtp: + auth: true + starttls: + enable: true + socketFactory: + port: 465 + class: javax.net.ssl.SSLSocketFactory + # RABBITMQ + rabbitmq: + host: localhost + port: 5672 + username: admin + password: ibh2D9R3v2DEN3gk + #username: ENC(lRmLd6EzgeY1RT5ktcHv9g==) + #password: ENC(gBI8mCjr3OC0v57jcnSb660Ux7mW03K2oePgvohhg7w=) + publisher-confirms: true + publisher-returns: false + virtual-host: / + # + aliyunRocketmq: + accessKeyId: "LTAI4G7ixY4AhvM35F8o3W3V" + accessKeySecret: "VfWqGb83qIQrS9us45utskl8itd7ry" + groupId: "GID_P_1" + namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" + flyway: + enabled: false + +aws: + clientRegion: cn-northwest-1 + bucketName: iformall-net + access: AKIAOEHX2MJVBURWTB3Q + secret: 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 + #access: ENC(a6SN1sZ1enNL49ypiOXkg/pPPAnZD8H4buQFTTKN08s=) + #secret: ENC(5P5ff4bTMJUbXVR4ZsM03UHzOKZ4+Zg5Iutcdkyp/Quny/oXg+A4KpfwEyGarlLu3vQMJahGP5M=) + +wechat: + web: + appId: "wx9cc4ca09eb20fe03" + secret: "af1d7f7a1268022a73cb4ce0b9cf0985" + url: "https://admin.malls.iformall.com" + open: + componentAppId: wx7f58f461ec1e2b4f + componentSecret: 7eb9b795606739b5526dd7f61d923f5a + componentToken: formall2018 + componentAesKey: htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN + #componentAppId: ENC(b3JG0MUZgQfz5Zj+DC2ZM1zDeLOiGTmmeokfe2O8kaM=) + #componentSecret: ENC(QVyc4BPGdnSjXGs2ivgpDBE1v8wPWHLLRMYI7Vv8uYwC0SiZHQz0QpyyQV/b48Pb) + #componentToken: ENC(rkxj0733WxFFDLgA9x01m2s5Fi2L+0PC) + #componentAesKey: ENC(EIbJUBpbYOrLb4YQ/HXLQmxlxgAqIp2ZmpnGICC8pu5xiTz3Cqfkbwd2S8raCcK/IvYcX2GmedI=) + redis: + host: r-2zeaglwf13qqmnllj5pd.redis.rds.aliyuncs.com + port: 6379 + password: mallone:iF0rm@2l2ol9 + timeout: 3600 + expire: 1800 #30分钟 + database: 2 + defaultExpiration: 2592000 # 默认生命周期30天 + jedis: + pool: + max-active: 100 + max-idle: 100 + max-wait: -1 + min-idle: 10 + +fm: + exception: true + exception_emails: houtaikaifa@iformall.com + deploy: 3 + open: true + upload_dir: /root/uploads/ + +ueditor: + config: config.json + unified: true + upload-path: ./upload/ + url-prefix: "" + +logging: + level: + com.iformall.mapper: debug + path: ./logs/admin \ No newline at end of file diff --git a/mallinkPublicApi/src/main/resources/application-test.yml-bak b/mallinkPublicApi/src/main/resources/application-test.yml-bak new file mode 100644 index 000000000..4aa4daf72 --- /dev/null +++ b/mallinkPublicApi/src/main/resources/application-test.yml-bak @@ -0,0 +1,100 @@ +spring: + profiles: + include: rabbitMQ + # JDBC + datasource: + url: jdbc:mysql://formalldb.cfqyqflkdlit.rds.cn-northwest-1.amazonaws.com.cn:3306/mallinkTest?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false&useAffectedRows=true + username: ENC(Uc0AjgkytxHHCwZrmDASWg==) + password: ENC(nV4Mi3bEbBx0Fj7uUyYH55eTaqsFMjKvmNzagicH4pc=) + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + filters: stat + maxActive: 20 + initialSize: 1 + maxWait: 60000 + minIdle: 1 + timeBetweenEvictionRunsMillis: 28000 + minEvictableIdleTimeMillis: 28000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + # REDIS + redis: + host: 127.0.0.1 + port: 6379 + password: ENC(QFwqv3NshvvGhFPiP8rwhvbnxk+rFSqhJi8Pw6TogSg=) + timeout: 3600 + expire: 1800 #30分钟 + database: 1 + defaultExpiration: 2592000 # 默认生命周期30天 + jedis: + pool: + max-active: 8 + max-idle: 8 + max-wait: -1 + min-idle: 0 + # EMAIL + mail: + host: smtp.exmail.qq.com + username: ENC(TtJQE2C4cWo8CpVGMMl5hiy5eykepd96J5XjsW3Kj5fgP+6+5ctDNQ==) + password: ENC(Zh6A6kRtA2ABtH6nzdvsqQSO1/8p3mparJr8neI2BLU=) # 授权密码 + properties: + mail: + smtp: + auth: true + starttls: + enable: true + socketFactory: + port: 465 + class: javax.net.ssl.SSLSocketFactory + # RABBITMQ + rabbitmq: + host: 127.0.0.1 + port: 5672 + username: ENC(aSRr6mnSryEqzHHz1hJf1g==) + password: ENC(GnjF/mdqKdvmDYC0tIIso7+20/jBALPw39tiWCYJ4iw=) + publisher-confirms: true + publisher-returns: false + virtual-host: / + +aws: + clientRegion: cn-northwest-1 + bucketName: iformall-net + access: ENC(NCLcmjwKpAWdn/abD17OKIY7yKepVLWzEpqRYUlURCw=) + secret: ENC(TRcZqql0Rq5PExlMeH/4WiZ/i02b8FXKmLTBChJmbluTa1uoLS9LrHyNEMrqe1DK+QgOAdvqGBo=) + +wechat: + open: + componentAppId: ENC(hnH31XdNzArfMfikKgBFpqQuJUl6rVOPFFcAVyb595o=) + componentSecret: ENC(t/GUVX5L+U7LCwSvZ5WmxAnmTMrc/Uy1nljsrokuzzsBL2j6BEVnrS/n7DCdGc/G) + componentToken: ENC(gUF1m0YgCCI2IY54fX6sGLZVlCswA8tG) + componentAesKey: ENC(TYHcrIkICtfrCfGq4HW6s1b/pHf7OD2uyPN11SzJNB0acqJ/4JVX1nuljo/cAtgMG4O05TImLQc=) + redis: + host: 127.0.0.1 + port: 6379 + password: ENC(QFwqv3NshvvGhFPiP8rwhvbnxk+rFSqhJi8Pw6TogSg=) + timeout: 3600 + expire: 1800 #30分钟 + database: 2 + defaultExpiration: 2592000 # 默认生命周期30天 + jedis: + pool: + max-active: 100 + max-idle: 100 + max-wait: -1 + min-idle: 10 + +fm: + exception: true + exception_emails: houtaikaifa@iformall.com + deploy: 2 + open: true + upload_dir: /home/ec2-user/server/uploads/ + +logging: + level: + com.iformall: debug + path: ./logs/c \ No newline at end of file diff --git a/mallinkPublicApi/src/main/resources/application.yml b/mallinkPublicApi/src/main/resources/application.yml new file mode 100644 index 000000000..324f91cde --- /dev/null +++ b/mallinkPublicApi/src/main/resources/application.yml @@ -0,0 +1,54 @@ +server: + port: 7000 + servlet: + context-path: /C + +spring: + application: + name: mallink + profiles: + active: dev + jackson: + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + default-property-inclusion: non_null +# rocketmq: +# nameServer: 127.0.0.1:9876 +# producer: +# retry-times-when-send-async-failed: 0 +# send-msg-timeout: 300000 +# compress-msg-body-over-howmuch: 4096 +# max-message-size: 4194304 +# retry-another-broker-when-not-store-ok: false +# retry-times-when-send-failed: 2 + +# MybatisPlus +mybatis-plus: + mapper-locations: classpath:mapper/*Mapper.xml + global-config: + db-config: + id-type: id_worker + field-strategy: not_null + db-type: mysql + configuration: + jdbc-type-for-null: 'null' + cache-enabled: false + call-setters-on-nulls: true + type-aliases-package: com.iformall.domain.po + type-enums-package: com.iformall.enums + +# PageHelper +pagehelper: + helperDialect: mysql + reasonable: false + supportMethodsArguments: true + params: count=countSql + offset-as-page-num: true + page-size-zero: true + row-bounds-with-count: true + +mapper: + mappers: + - com.iformall.common.CommonMapper + +version: @project.version@ \ No newline at end of file diff --git a/mallinkPublicApi/src/main/resources/imgTemp/gertificate.jpg b/mallinkPublicApi/src/main/resources/imgTemp/gertificate.jpg new file mode 100644 index 000000000..6766d3149 Binary files /dev/null and b/mallinkPublicApi/src/main/resources/imgTemp/gertificate.jpg differ diff --git a/mallinkPublicApi/src/main/resources/logback-spring.xml b/mallinkPublicApi/src/main/resources/logback-spring.xml new file mode 100644 index 000000000..3a54d117d --- /dev/null +++ b/mallinkPublicApi/src/main/resources/logback-spring.xml @@ -0,0 +1,100 @@ + + + + + + + + [%date{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] --%mdc{client}%msg%n + + + + + ${logPath}/trace.log + + ${logPath}/daily/trace.%d{yyyy-MM-dd}.log + 30 + + + [%date{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%logger:%line]--%mdc{client} %msg%n + + + + + ${logPath}/info.log + + ${logPath}/daily/info.%d{yyyy-MM-dd}.log + 30 + + + [%date{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%logger:%line]--%mdc{client} %msg%n + + + INFO + ACCEPT + DENY + + + + + ${logPath}/debug.log + + ${logPath}/daily/debug.%d{yyyy-MM-dd}.log + 30 + + + [%date{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%logger:%line]--%mdc{client} %msg%n + + + DEBUG + ACCEPT + DENY + + + + + + ${logPath}/warn.log + + ${logPath}/daily/warn.%d{yyyy-MM-dd}.log + 30 + + + [%date{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%logger:%line]--%mdc{client} %msg%n + + + WARN + ACCEPT + DENY + + + + + + + ${logPath}/error.log + + ${logPath}/daily/error.%d{yyyy-MM-dd}.log + 30 + + + [%date{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%logger:%line]--%mdc{client} %msg%n + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mallinkPublicApi/src/main/resources/opt/HWLS.TTF b/mallinkPublicApi/src/main/resources/opt/HWLS.TTF new file mode 100644 index 000000000..bd038fd18 Binary files /dev/null and b/mallinkPublicApi/src/main/resources/opt/HWLS.TTF differ diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/ActivitySchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/ActivitySchedule.java index 3d8024f43..bfc212e69 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/ActivitySchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/ActivitySchedule.java @@ -95,7 +95,7 @@ public class ActivitySchedule { public void activityExipred() { logger.info("活动报名结束任务"); WxActivity activity = new WxActivity(); - activity.setStatus(EnumActivityStatus.INJECT_CAMPAIGN.getCode()); +// activity.setStatus(EnumActivityStatus.INJECT_CAMPAIGN.getCode()); activity.setIsExpired(EnumActivityExpired.YES.getCode()); activity.setUpdateTime(new Date()); wxActivityMapper.activityExipred(activity); @@ -105,30 +105,30 @@ public class ActivitySchedule { /** * 5分钟一次 */ - @Scheduled(cron = "0 */5 * * * ?") - public void activityCompletion() { - logger.info("活动结束任务"); - WxActivity activity = new WxActivity(); - activity.setStatus(EnumActivityStatus.STATUS_TAKE_OFFF.getCode()); - activity.setUpdateTime(new Date()); - wxActivityMapper.activityCompletion(activity); - List activityList = new ArrayList(); - //宣传页下线 - WxCampaign campaign = new WxCampaign(); - campaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); - campaign.setType(EnumCampaignType.PAGEPATH.getCode()); - campaign.setProduceType(EnumCampaignProductType.ACTIVITY_JOIN.getCode()); - List campaignList = wxCampaignMapper.selectList(new QueryWrapper(campaign)); - for (WxCampaign wxCampaign : campaignList) { - WxActivity wxActivity = wxActivityMapper.selectById(wxCampaign.getProduceId()); - if (wxActivity.getStatus().equals(EnumActivityStatus.STATUS_TAKE_OFFF.getCode())) { - activityList.add(wxActivity); - wxCampaign.setStatus(EnumCampaignStatus.STATUS_TAKE_OFFF.getCode()); - wxCampaign.setUpdateTime(new Date()); - wxCampaignMapper.updateById(wxCampaign); - } - } - } +// @Scheduled(cron = "0 */5 * * * ?") +// public void activityCompletion() { +// logger.info("活动结束任务"); +// WxActivity activity = new WxActivity(); +// activity.setStatus(EnumActivityStatus.STATUS_TAKE_OFFF.getCode()); +// activity.setUpdateTime(new Date()); +// wxActivityMapper.activityCompletion(activity); +// List activityList = new ArrayList(); +// //宣传页下线 +// WxCampaign campaign = new WxCampaign(); +// campaign.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); +// campaign.setType(EnumCampaignType.PAGEPATH.getCode()); +// campaign.setProduceType(EnumCampaignProductType.ACTIVITY_JOIN.getCode()); +// List campaignList = wxCampaignMapper.selectList(new QueryWrapper(campaign)); +// for (WxCampaign wxCampaign : campaignList) { +// WxActivity wxActivity = wxActivityMapper.selectById(wxCampaign.getProduceId()); +// if (wxActivity.getStatus().equals(EnumActivityStatus.STATUS_TAKE_OFFF.getCode())) { +// activityList.add(wxActivity); +// wxCampaign.setStatus(EnumCampaignStatus.STATUS_TAKE_OFFF.getCode()); +// wxCampaign.setUpdateTime(new Date()); +// wxCampaignMapper.updateById(wxCampaign); +// } +// } +// } } \ No newline at end of file diff --git a/mallinkSchedule/src/main/resources/application-dev.yml b/mallinkSchedule/src/main/resources/application-dev.yml index a34e14dc6..0e10fac9e 100644 --- a/mallinkSchedule/src/main/resources/application-dev.yml +++ b/mallinkSchedule/src/main/resources/application-dev.yml @@ -155,8 +155,8 @@ jasypt: password: oRqdnDbK5pj3eMmB fm: - exception: false - exception_emails: houtaikaifa@iformall.com + exception: true + exception_emails: xuxiaohu@iformall.com deploy: 1 open: true upload_dir: /home/test/server/uploads/ diff --git a/mallinkService/pom.xml b/mallinkService/pom.xml index 29d293544..8a019e55a 100644 --- a/mallinkService/pom.xml +++ b/mallinkService/pom.xml @@ -34,8 +34,7 @@ com.iformall mybatis-multi-tenancy 1.0 - - + \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java index c2d161a16..44409512e 100644 --- a/mallinkService/src/main/java/com/iformall/common/ErrorCode.java +++ b/mallinkService/src/main/java/com/iformall/common/ErrorCode.java @@ -396,6 +396,8 @@ public enum ErrorCode{ CREDIT_NOT_ENOUGH(13101, "积分不够扣减值"), USER_NOT_MEMBER(13102, "该用户不是小程序会员"), OUT_OF_CREDIT(13103, "超出最大积分"), + MEM_IS_SIGNIN(13104, "该用户已签到"), + MEM_MONTH_IS_USED(13105, "该用户本月已领取或未到领取条件"), /** @@ -538,6 +540,16 @@ public enum ErrorCode{ ACTIVITY_TIME_ERROR(30005, "活动报名结束时间不能大于活动结束时间"), ACTIVITY_WAIT_CONFIRMED(30006, "您报名的活动还在审核中"), ACTIVITY_EXPIRED(30007, "您报名的活动已过期"), + ACTIVITY_SEND_ERROR_NOONLINE(30008, "活动投放到宣传页失败,活动未上线!"), + ACTIVITY_NOT_FOND(30009, "活动未找到!"), + ACTIVITY_JOIN_TIME_START(30010, "活动报名时间未开始!"), + ACTIVITY_JOIN_END_TIME_BEFORE(30011, "活动报名结束时间不能小于当前时间"), + ACTIVITY_END_TIME_BEFORE(30012, "活动结束时间不能小于当前时间"), + ACTIVITY_NOT_JOIN(30013, "该活动不需要报名!"), + ACTIVITY_JOIN_IS_SIGNIN(30014, "用户已签到!"), + ACTIVITY_JOIN_NOT_FOND(30015, "活动报名未找到!"), + ACTIVITY_NOT_UPDATE(30016, "下线状态,不允许修改!"), + ACTIVITY_TIME_END(30017, "活动已结束"), /** * 文件上传 diff --git a/mallinkService/src/main/java/com/iformall/config/BaseMyBatisConfiguration.java b/mallinkService/src/main/java/com/iformall/config/BaseMyBatisConfiguration.java index b0e7342a8..c3663f209 100644 --- a/mallinkService/src/main/java/com/iformall/config/BaseMyBatisConfiguration.java +++ b/mallinkService/src/main/java/com/iformall/config/BaseMyBatisConfiguration.java @@ -76,6 +76,13 @@ public class BaseMyBatisConfiguration { basicInfoSharding.setRule(EnumShardingRule.HASH.getCode()); shardingList.add(basicInfoSharding); + ShardingSphere basicSignSharding = new ShardingSphere(); + basicSignSharding.setColumn("tenant_id"); + basicSignSharding.setTableName("wx_c_user_basic_sign"); + basicSignSharding.setCount(100); + basicSignSharding.setRule(EnumShardingRule.HASH.getCode()); + shardingList.add(basicSignSharding); + ShardingSphere wxbasicChildSharding = new ShardingSphere(); wxbasicChildSharding.setColumn("tenant_id"); wxbasicChildSharding.setTableName("wx_c_user_basic_child"); diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxActivity.java b/mallinkService/src/main/java/com/iformall/domain/po/WxActivity.java index 872a6ed78..00ef12db9 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxActivity.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxActivity.java @@ -35,6 +35,13 @@ public class WxActivity extends TenantEntity { private Integer personLimit; @io.swagger.annotations.ApiModelProperty(value = "活动正文", name = "detail") private String detail; + + @io.swagger.annotations.ApiModelProperty(value = "活动类型(是否需要报名1是0否)", name = "activityType") + private Integer activityType; + + @io.swagger.annotations.ApiModelProperty(value = "报名审核 1是0否(activity_type=1时必填)", name = "signupExamine") + private Integer signupExamine; + @io.swagger.annotations.ApiModelProperty(value = "活动开始报名时间", name = "startTime") private Date startTime; @io.swagger.annotations.ApiModelProperty(value = "活动结束报名时间", name = "endTime") @@ -72,11 +79,11 @@ public class WxActivity extends TenantEntity { @TableField(exist = false) @io.swagger.annotations.ApiModelProperty(value = "开始时间", name = "starttime") - private Date starttime; + private Date startDate; @TableField(exist = false) @io.swagger.annotations.ApiModelProperty(value = "结束时间", name = "endtime") - private Date endtime; + private Date endDate; @TableField(exist = false) @@ -115,5 +122,9 @@ public class WxActivity extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "常见问题选择", name = "selectques") private String selectques; + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value = "报名状态", name = "joinStatus") + private Integer joinStatus; + } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java index 8ab9d34a8..4e136566d 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicInfo.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.po.base.TenantEntityWithoutFinalTenantId; +import com.iformall.utils.Constant; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -24,6 +25,7 @@ import java.util.Objects; @EqualsAndHashCode(callSuper = true) public class WxCUserBasicInfo extends TenantEntityWithoutFinalTenantId { + @Excel(name="会员码",width = 20,orderNum = "1") protected Long id; @JsonIgnore @@ -43,45 +45,45 @@ public class WxCUserBasicInfo extends TenantEntityWithoutFinalTenantId { return shardFinalTableSuffix; } - @Excel(name="姓名",width = 20,orderNum = "1") + @Excel(name="姓名",width = 20,orderNum = "2") @NotNull @io.swagger.annotations.ApiModelProperty(value="用户姓名",name="name") private String name; - @Excel(name="性别",width = 20,replace = { "保密_0", "男_1", "女_2"},orderNum = "2") + @Excel(name="性别",width = 20,replace = { "保密_0", "男_1", "女_2"},orderNum = "3") @NotNull @io.swagger.annotations.ApiModelProperty(value="性别:0:保密 1.男 2女",name="sex") private Integer sex; - @Excel(name = "手机号*", width = 20, orderNum = "3") + @Excel(name = "手机号*", width = 20, orderNum = "4") @io.swagger.annotations.ApiModelProperty(value="微信用户绑定的手机号",name="phone") @NotNull private String phone; - @Excel(name="微信昵称",width = 20,orderNum = "4") + @Excel(name="微信昵称",width = 20,orderNum = "5") @io.swagger.annotations.ApiModelProperty(value="用户昵称",name="nickName") private String nickName; @io.swagger.annotations.ApiModelProperty(value="用户头像地址",name="avatarUrl") private String avatarUrl; - @Excel(name="学历",width = 20,orderNum = "5") + @Excel(name="学历",width = 20,orderNum = "6") @NotNull @io.swagger.annotations.ApiModelProperty(value="学历",name="education") private String education; - @Excel(name="生日",width = 20,format="yyyy-MM-dd",orderNum = "6") + @Excel(name="生日",width = 20,format="yyyy-MM-dd",orderNum = "7") @NotNull @io.swagger.annotations.ApiModelProperty(value="出生日期",name="birthdate") private Date birthdate; - @Excel(name="地址",width = 20,orderNum = "7") + @Excel(name="地址",width = 20,orderNum = "8") @TableField(exist = false) private String addressStr; @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") private Date updateDate; - @Excel(name="上次活跃时间",width = 20,format="yyyy-MM-dd", orderNum = "8") + @Excel(name="上次活跃时间",width = 20,format="yyyy-MM-dd", orderNum = "9") @io.swagger.annotations.ApiModelProperty(value="上次活跃时间",name="activeTime") private Date activeTime; @TableField(exist = false) @@ -89,7 +91,7 @@ public class WxCUserBasicInfo extends TenantEntityWithoutFinalTenantId { @TableField(exist = false) private Date activeEndTime; - @Excel(name="注册时间",width = 20,format="yyyy-MM-dd", orderNum = "9") + @Excel(name="注册时间",width = 20,format="yyyy-MM-dd", orderNum = "10") @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") private Date createDate; @@ -116,12 +118,12 @@ public class WxCUserBasicInfo extends TenantEntityWithoutFinalTenantId { @io.swagger.annotations.ApiModelProperty(value="积分",name="credit") private Integer credit; - @Excel(name="扣减总积分",width = 20, orderNum = "12") + @Excel(name="扣减总积分",width = 20, orderNum = "13") @io.swagger.annotations.ApiModelProperty(value="扣减积分",name="lesCredit") @TableField(exist = false) private Integer lesCredit; - @Excel(name="增长总积分",width = 20, orderNum = "12") + @Excel(name="增长总积分",width = 20, orderNum = "14") @io.swagger.annotations.ApiModelProperty(value="增加积分",name="addCredit") @TableField(exist = false) private Integer addCredit; @@ -132,8 +134,23 @@ public class WxCUserBasicInfo extends TenantEntityWithoutFinalTenantId { @io.swagger.annotations.ApiModelProperty(value = "状态0正常1锁定", name = "status") private Integer status; + @io.swagger.annotations.ApiModelProperty(value="二维码",name="qrCode") + private String qrCode; + + public String getWeappPath() { + if(id == null) + return Constant.mainPageUrl; + return Constant.mainPageUrl + "?type=in&UId=" + id; + } + + public String getWeappScene() { + if(id == null) + return ""; + return "t:in_u:" + id; + } + @TableField(exist = false) - @Excel(name="标签",width = 50,orderNum = "10") + @Excel(name="标签",width = 50,orderNum = "15") private String tagNames; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicSign.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicSign.java new file mode 100644 index 000000000..6acd8f893 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserBasicSign.java @@ -0,0 +1,71 @@ +package com.iformall.domain.po; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.domain.po.base.TenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.util.Date; + +@TableName(value = "wx_c_user_basic_sign") +@Data +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +public class WxCUserBasicSign extends TenantEntity { + + @TableField(exist = false) + public static final Integer SIGNIN_TYPE = 1; + + protected Long id; + + @io.swagger.annotations.ApiModelProperty(value="userId",name="userId") + private Long userId; + + @io.swagger.annotations.ApiModelProperty(value="1:签到",name="type") + private Integer type; + + @io.swagger.annotations.ApiModelProperty(value="签到时间",name="signinDate") + private Date signinDate; + @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") + private Date createDate; + @io.swagger.annotations.ApiModelProperty(value="修改时间",name="updateDate") + private Date updateDate; + + @io.swagger.annotations.ApiModelProperty(value="截止当前签到时间当月连续签到天数",name="continueMonthSign") + private Integer continueMonthSign; + @io.swagger.annotations.ApiModelProperty(value="截止当前签到时间当月累计签到天数",name="countMonthSign") + private Integer countMonthSign; + + @io.swagger.annotations.ApiModelProperty(value="截止当前签到时间当年连续签到天数",name="continueYearSign") + private Integer continueYearSign; + @io.swagger.annotations.ApiModelProperty(value="截止当前签到时间当年累计签到天数",name="countYearSign") + private Integer countYearSign; + + @io.swagger.annotations.ApiModelProperty(value="截止当前签到时间连续签到天数",name="continueSign") + private Integer continueSign; + @io.swagger.annotations.ApiModelProperty(value="截止当前签到时间累计签到天数",name="countSign") + private Integer countSign; + + @io.swagger.annotations.ApiModelProperty(value="备注",name="mark") + private String mark; + + + + @TableField(exist = false) + private Date startDate; + + @TableField(exist = false) + private Date endDate; + + @TableField(exist = false) + private Integer begin; + + @TableField(exist = false) + private Integer limit; + + @TableField(exist = false) + private Integer credit; + +} diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCUserFrom.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserFrom.java index 7680239ac..7634a1948 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCUserFrom.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCUserFrom.java @@ -1,8 +1,8 @@ package com.iformall.domain.po; +import cn.afterturn.easypoi.excel.annotation.Excel; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.iformall.domain.po.base.TenantEntity; import com.iformall.enums.EnumCUserFrom; import com.iformall.enums.EnumUserType; @@ -14,30 +14,17 @@ import lombok.ToString; import java.util.Date; @TableName(value = "wx_c_user_from") -@JsonIgnoreProperties(ignoreUnknown = true) @Data @ToString(callSuper = true) @EqualsAndHashCode(callSuper = true) public class WxCUserFrom extends TenantEntity { - @io.swagger.annotations.ApiModelProperty(value="cUserId",name="cUserId") - protected Long cUserId; - @TableField(exist = false) - @io.swagger.annotations.ApiModelProperty(value="cUserNickName",name="cUserNickName") - protected String cUserNickName; - - @io.swagger.annotations.ApiModelProperty(value="二维码来源,小程序",name="scene") - private String scene; - - @io.swagger.annotations.ApiModelProperty(value="渠道,小程序",name="sceneAddress") - private String sceneAddress; - @TableField(exist = false) - @io.swagger.annotations.ApiModelProperty(value="sceneAddress描述",name="sceneAddressDesc") - private String sceneAddressDesc; + protected Long id; @io.swagger.annotations.ApiModelProperty(value="EnumCUserFrom",name="fromType") private Integer fromType; @TableField(exist = false) + @Excel(name = "来源", width = 20, orderNum = "1") @io.swagger.annotations.ApiModelProperty(value="fromType描述",name="fromTypeDesc") private String fromTypeDesc; public String getFromTypeDesc(){ @@ -50,20 +37,45 @@ public class WxCUserFrom extends TenantEntity { return fromTypeDesc; } + @io.swagger.annotations.ApiModelProperty(value="cUserId",name="cUserId") + private Long cUserId; + @TableField(exist = false) + @Excel(name = "用户昵称", width = 20, orderNum = "2") + @io.swagger.annotations.ApiModelProperty(value="userNickName",name="userNickName") + private String userNickName; + @TableField(exist = false) + @Excel(name = "用户电话", width = 20, orderNum = "3") + @io.swagger.annotations.ApiModelProperty(value="userPhone",name="userPhone") + private String userPhone; + + @io.swagger.annotations.ApiModelProperty(value="二维码来源,小程序",name="scene") + private String scene; + + @io.swagger.annotations.ApiModelProperty(value="渠道,小程序",name="sceneAddress") + private String sceneAddress; + @TableField(exist = false) + @Excel(name = "用户来源方式", width = 20, orderNum = "4") + @io.swagger.annotations.ApiModelProperty(value="sceneAddress描述",name="sceneAddressDesc") + private String sceneAddressDesc; + @io.swagger.annotations.ApiModelProperty(value="来源ID",name="fromId") - protected Long fromId; + private Long fromId; @TableField(exist = false) @io.swagger.annotations.ApiModelProperty(value="来源Name",name="fromName") - protected String fromName; + private String fromName; + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="来源phone",name="fromPhone") + private String fromPhone; @io.swagger.annotations.ApiModelProperty(value="是否新用户(0:否1:是)EnumYesOrNo",name="isNewUser") private Integer isNewUser; @TableField(exist = false) + @Excel(name = "是否新用户", width = 20, orderNum = "5") @io.swagger.annotations.ApiModelProperty(value="是否新用户",name="isNewUserStr") private String isNewUserStr; public String getIsNewUserStr(){ if(this.getIsNewUser() != null){ - EnumYesOrNo anEnum = EnumYesOrNo.getEnum(this.getFromType()); + EnumYesOrNo anEnum = EnumYesOrNo.getEnum(this.getIsNewUser()); if(anEnum != null){ isNewUserStr = anEnum.getMessage(); } @@ -78,7 +90,7 @@ public class WxCUserFrom extends TenantEntity { private String shareUserTypeDesc; public String getShareUserTypeDesc(){ if(this.getShareUserType() != null){ - EnumUserType anEnum = EnumUserType.getEnum(this.getFromType()); + EnumUserType anEnum = EnumUserType.getEnum(this.getShareUserType()); if(anEnum != null){ shareUserTypeDesc = anEnum.getMessage(); } @@ -87,18 +99,26 @@ public class WxCUserFrom extends TenantEntity { } @io.swagger.annotations.ApiModelProperty(value="分享者",name="shareUser") - protected Long shareUser; + private Long shareUser; @TableField(exist = false) @io.swagger.annotations.ApiModelProperty(value="分享者",name="shareUserName") - protected String shareUserName; + private String shareUserName; + @Excel(name = "进入时间", width = 20, format="yyyy-MM-dd HH:mm:ss", orderNum = "6") @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") private Date createDate; + + @TableField(exist = false) + private Date startDate; + + @TableField(exist = false) + private Date endDate; + @TableField(exist = false) - protected Date startDate; + private Integer begin; @TableField(exist = false) - protected Date endDate; + private Integer limit; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMallFloor.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMallFloor.java index 1060ab8ee..b97b5f556 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxMallFloor.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMallFloor.java @@ -1,9 +1,13 @@ package com.iformall.domain.po; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; +import com.google.gson.JsonObject; import com.iformall.domain.po.base.TenantEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import org.apache.commons.lang3.StringUtils; import java.math.BigDecimal; import java.util.*; @@ -31,5 +35,21 @@ public class WxMallFloor extends TenantEntity { private Date createDate; @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") private Date updateDate; + + @io.swagger.annotations.ApiModelProperty(value="地图",name="floorMap") + private String floorMap; + + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="",name="") + private List floorMaps; + + public List getFloorMaps(){ + if(StringUtils.isNotBlank(floorMap)){ + if(floorMaps == null || floorMaps.size() == 0){ + floorMaps = JSONArray.parseArray(floorMap,Map.class); + } + } + return floorMaps; + } } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMallOcrModel.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMallOcrModel.java new file mode 100644 index 000000000..ee7c97148 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMallOcrModel.java @@ -0,0 +1,25 @@ +package com.iformall.domain.po; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.domain.po.base.TenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.util.Date; + +@TableName(value = "wx_mall_ocr_model") +@Data +@EqualsAndHashCode(callSuper = true) +public class WxMallOcrModel extends TenantEntity { + private static final long serialVersionUID = 1L; + + protected Long id; + @io.swagger.annotations.ApiModelProperty(value="商户编号",name="mallId") + private Long mallId; + @io.swagger.annotations.ApiModelProperty(value="ocr模板编号",name="ocrModelId") + private Long ocrModelId; + @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") + private Date createTime; + @io.swagger.annotations.ApiModelProperty(value="创建时间",name="updateTime") + private Date updateTime; + +} diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchantOcrModel.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchantOcrModel.java new file mode 100644 index 000000000..d98f628c3 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchantOcrModel.java @@ -0,0 +1,25 @@ +package com.iformall.domain.po; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.domain.po.base.TenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.util.Date; + +@TableName(value = "wx_merchant_ocr_model") +@Data +@EqualsAndHashCode(callSuper = true) +public class WxMerchantOcrModel extends TenantEntity { + private static final long serialVersionUID = 1L; + + protected Long id; + @io.swagger.annotations.ApiModelProperty(value="商户编号",name="merchantId") + private Long merchantId; + @io.swagger.annotations.ApiModelProperty(value="ocr模板编号",name="ocrModelId") + private Long ocrModelId; + @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") + private Date createTime; + @io.swagger.annotations.ApiModelProperty(value="创建时间",name="updateTime") + private Date updateTime; + +} diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxOcrModel.java b/mallinkService/src/main/java/com/iformall/domain/po/WxOcrModel.java new file mode 100644 index 000000000..c407d7390 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxOcrModel.java @@ -0,0 +1,28 @@ +package com.iformall.domain.po; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.domain.po.base.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.util.Date; + +@TableName(value = "wx_ocr_model") +@Data +@EqualsAndHashCode(callSuper = true) +public class WxOcrModel extends BaseEntity { + private static final long serialVersionUID = 1L; + + protected Long id; + @io.swagger.annotations.ApiModelProperty(value="语言定义,默认iformallLang",name="langCode") + private String langCode; + @io.swagger.annotations.ApiModelProperty(value="字库名称",name="fontName") + private String fontName; + @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") + private Date createTime; + @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateTime") + private Date updateTime; + @io.swagger.annotations.ApiModelProperty(value="备注",name="remark") + private String remark; + @io.swagger.annotations.ApiModelProperty(value="0-有效 1-无效",name="status") + private Integer status; +} diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxScoreRules.java b/mallinkService/src/main/java/com/iformall/domain/po/WxScoreRules.java index 13321e35e..3b04c477a 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxScoreRules.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxScoreRules.java @@ -48,7 +48,6 @@ public class WxScoreRules extends BaseTenantEntity { " {\"businessId\":6,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}" + "]}," + "{\"id\":3,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"绑定车牌1个\"}," + - "{\"id\":5,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"授权个人信息\"}," + "{\"id\":6,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"授权手机号\"}," + "{\"id\":7,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"编辑个人信息\"}" + "]"; @@ -56,7 +55,7 @@ public class WxScoreRules extends BaseTenantEntity { @TableField(exist = false) private static final String creditDefaultRules = "[" + - "{\"id\":1,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"每日登陆\"}," + +// "{\"id\":1,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"每日登陆\"}," + "{\"id\":2,\"childs\":[" + " {\"businessId\":1,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + " {\"businessId\":2,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + @@ -71,10 +70,12 @@ public class WxScoreRules extends BaseTenantEntity { " {\"businessId\":6,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}" + "]}," + "{\"id\":3,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"绑定车牌1个\"}," + - "{\"id\":5,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"授权个人信息\"}," + "{\"id\":6,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"授权手机号\"}," + "{\"id\":7,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"编辑个人信息\"}," + - "{\"id\":8,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"编辑个人信息\"}" + + "{\"id\": 17, \"desc\": \"每日签到\", \"step\": 1, \"limit\": 1, \"score\": 0},"+ + "{\"id\": 18, \"desc\": \"连续签到7天\", \"step\": 1, \"limit\": 1, \"score\": 0},"+ + "{\"id\": 19, \"desc\": \"连续签到14天\", \"step\": 1, \"limit\": 1, \"score\": 0},"+ + "{\"id\": 20, \"desc\": \"连续签到28天\", \"step\": 1, \"limit\": 1, \"score\": 0},"+ "]"; @TableField(exist = false) @@ -86,6 +87,15 @@ public class WxScoreRules extends BaseTenantEntity { @TableField(exist = false) public static final String SCORE = "score"; + @TableField(exist = false) + public static final String CYCLE = "cycle";//EnumScoreScaleRules会员日周期(1:周;2:月;3:年) + @TableField(exist = false) + public static final String CYCLE_START = "cycleStart";//周期开始 + @TableField(exist = false) + public static final String CYCLE_END = "cycleEnd";//周期结束 + @TableField(exist = false) + public static final String CYCLE_SCALE = "cycleScale";//倍率 + protected Long id; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxWiWideInfo.java b/mallinkService/src/main/java/com/iformall/domain/po/WxWiWideInfo.java index 08da0f17e..76029dfe1 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxWiWideInfo.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxWiWideInfo.java @@ -19,6 +19,15 @@ public class WxWiWideInfo extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="迈外迪key",name="wiwideKey") private String wiwideKey; + + @io.swagger.annotations.ApiModelProperty(value="加密key,新版本接口需要",name="signKey") + private String signKey; + + @io.swagger.annotations.ApiModelProperty(value="登陆username",name="userName") + private String userName; + + @io.swagger.annotations.ApiModelProperty(value="登陆password",name="password") + private String password; @io.swagger.annotations.ApiModelProperty(value="迈外迪url",name="wiwideUrl") private String wiwideUrl; @@ -31,5 +40,8 @@ public class WxWiWideInfo extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="迈外迪信息类型列表,1,支持客流 2,支持wifi",name="capability") private String capability; - + + @io.swagger.annotations.ApiModelProperty(value="是否是老平台 0-老平台 1-新平台",name="oldPlat") + private Integer oldPlat; + } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/base/BaseEntity.java b/mallinkService/src/main/java/com/iformall/domain/po/base/BaseEntity.java index 67e94f9f0..9220fad65 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/base/BaseEntity.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/base/BaseEntity.java @@ -205,6 +205,10 @@ public class BaseEntity implements Serializable { ReportDate_ASC("`report_date` ASC"), ReportDate_DESC("`report_date` DESC"), + + ActivityStartTime_ASC("`activity_start_time` ASC"), + ActivityStartTime_DESC("`activity_start_time` DESC"), + ; private String value; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/base/BaseTenantEntity.java b/mallinkService/src/main/java/com/iformall/domain/po/base/BaseTenantEntity.java index 62b45c963..2ed5a3d92 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/base/BaseTenantEntity.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/base/BaseTenantEntity.java @@ -1,6 +1,7 @@ package com.iformall.domain.po.base; import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -26,7 +27,7 @@ public class BaseTenantEntity extends BaseEntity { protected String finalTenantId; public String getFinalTenantId() { - if (!StringUtils.isBlank(parentTenantId)) { + if (StringUtils.isNotBlank(parentTenantId)) { return parentTenantId; } return tenantId; @@ -35,6 +36,17 @@ public class BaseTenantEntity extends BaseEntity { public void setFinalTenantId(String finalTenantId) { this.finalTenantId = finalTenantId; } + + @JsonIgnore + @TableField(exist = false) + protected String shardFinalTableSuffix; + + public String getShardFinalTableSuffix(){ + if(StringUtils.isNotBlank(getFinalTenantId())){ + shardFinalTableSuffix = "_" + Integer.parseInt(getFinalTenantId())%100; + } + return shardFinalTableSuffix; + } @TableField(exist = false) @JsonProperty(access = JsonProperty.Access.READ_ONLY) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/msg/FmInsideCLoginMsg.java b/mallinkService/src/main/java/com/iformall/domain/po/msg/FmInsideCLoginMsg.java index 4f397fbe2..c6b86fe20 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/msg/FmInsideCLoginMsg.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/msg/FmInsideCLoginMsg.java @@ -1,5 +1,6 @@ package com.iformall.domain.po.msg; +import com.iformall.domain.po.WxCUserFrom; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -11,15 +12,7 @@ public class FmInsideCLoginMsg extends BaseMsg{ private static final long serialVersionUID = 1L; - @io.swagger.annotations.ApiModelProperty(value = "id", name = "id") - private Long id; - - @io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId") - private String tenantId; - @io.swagger.annotations.ApiModelProperty(value="父租户id",name="parentTenantId") - private String parentTenantId; - @io.swagger.annotations.ApiModelProperty(value = "用户ID", name = "userId") - private Long userId; + private WxCUserFrom wxCUserFrom; } diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/MerchantCreditRankingVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/MerchantCreditRankingVo.java new file mode 100644 index 000000000..7d3274c49 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/vo/MerchantCreditRankingVo.java @@ -0,0 +1,32 @@ +package com.iformall.domain.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; + +@Data +public class MerchantCreditRankingVo { + + private Long merchantId; + + @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") + protected String tenantId; + + @io.swagger.annotations.ApiModelProperty(value="父租户ID",name="parentTenantId") + protected String parentTenantId; + + @io.swagger.annotations.ApiModelProperty(value = "商户名", name = "merchantName") + private String merchantName; + + @io.swagger.annotations.ApiModelProperty(value = "增加总积分", name = "sumAddCredit") + private Integer sumAddCredit; + + @io.swagger.annotations.ApiModelProperty(value = "消耗总积分", name = "sumLesCredit") + private Integer sumLesCredit; + + @io.swagger.annotations.ApiModelProperty(value = "增加总人数", name = "countAddCreditUser") + private Integer countAddCreditUser; + + @io.swagger.annotations.ApiModelProperty(value = "消耗总人数", name = "countLesCreditUser") + private Integer countLesCreditUser; + +} diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxCUserFromVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxCUserFromVo.java new file mode 100644 index 000000000..b33112c61 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCUserFromVo.java @@ -0,0 +1,81 @@ +package com.iformall.domain.vo; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.baomidou.mybatisplus.annotation.TableField; +import com.iformall.domain.po.base.TenantEntity; +import com.iformall.enums.EnumCUserFrom; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +import java.util.Date; + +@Data +@ToString(callSuper = true) +@EqualsAndHashCode(callSuper = true) +public class WxCUserFromVo extends TenantEntity { + + + @io.swagger.annotations.ApiModelProperty(value="EnumCUserFrom",name="fromType") + private Integer fromType; + @Excel(name = "来源", width = 20, orderNum = "1") + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="fromType描述",name="fromTypeDesc") + private String fromTypeDesc; + public String getFromTypeDesc(){ + if(this.getFromType() != null){ + EnumCUserFrom anEnum = EnumCUserFrom.getEnum(this.getFromType()); + if(anEnum != null){ + fromTypeDesc = anEnum.getMessage(); + } + } + return fromTypeDesc; + } + + @io.swagger.annotations.ApiModelProperty(value="来源ID",name="fromId") + private Long fromId; + @Excel(name = "用户昵称/店铺名称", width = 20, orderNum = "2") + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="来源Name",name="fromName") + private String fromName; + @Excel(name = "(用户/店铺)联系方式", width = 20, orderNum = "3") + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="来源phone",name="fromPhone") + private String fromPhone; + @Excel(name = "推广人次", width = 20, orderNum = "4") + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="推广人次",name="visits") + private Integer visits; + @Excel(name = "触达用户", width = 20, orderNum = "5") + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="触达用户",name="reachUser") + private Integer reachUser; + @Excel(name = "触达新用户", width = 20, orderNum = "6") + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="触达新用户",name="newUser") + private Integer newUser; + @Excel(name = "触达老用户", width = 20, orderNum = "7") + @TableField(exist = false) + @io.swagger.annotations.ApiModelProperty(value="触达老用户",name="oldUser") + private Integer oldUser; + public Integer getOldUser(){ + if(this.getReachUser() != null && this.getNewUser() != null){ + oldUser = this.getReachUser() - this.getNewUser(); + } + return oldUser; + } + + + @TableField(exist = false) + private Date startDate; + + @TableField(exist = false) + private Date endDate; + + @TableField(exist = false) + private Integer begin; + + @TableField(exist = false) + private Integer limit; + +} diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumActivityEnrollStatus.java b/mallinkService/src/main/java/com/iformall/enums/EnumActivityEnrollStatus.java index cce6c94b3..423b0ef81 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumActivityEnrollStatus.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumActivityEnrollStatus.java @@ -6,10 +6,17 @@ package com.iformall.enums; */ public enum EnumActivityEnrollStatus { + JOINED(3, "已报名"), + NOJOINED(4, "未报名"), + NOT_START(0, "报名未开始"), NORMAL(1, "正常报名"), END(2, "报名结束"), - JOINED(3, "已报名"),; + ACTIVITY_NOT_LINE(5, "活动未上线"), + ACTIVITY_NOT(6, "活动下线"), + ACTIVITY_END(7, "活动结束"), + + NOT_JOIN(8, "不需要报名"),; public static EnumActivityEnrollStatus getEnum(Integer code) { for (EnumActivityEnrollStatus value : values()) { diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumActivityStatus.java b/mallinkService/src/main/java/com/iformall/enums/EnumActivityStatus.java index d97f28f98..2ec131ed5 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumActivityStatus.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumActivityStatus.java @@ -8,7 +8,9 @@ public enum EnumActivityStatus { STATUS_THROW_IN(0, "已保存"), STATUS_TAKE_OFFF(1, "已下线"), - INJECT_CAMPAIGN(2, "已投放"),; + INJECT_CAMPAIGN(2, "已投放"), + INJECT_ONLINE(3, "已上线"), + INJECT_ONLINES(4, "上过线"),;//查询状态 public static EnumActivityStatus getEnum(Integer code) { for (EnumActivityStatus value : values()) { diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumCacheKey.java b/mallinkService/src/main/java/com/iformall/enums/EnumCacheKey.java index 0f55628e9..6d608fd99 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumCacheKey.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumCacheKey.java @@ -9,7 +9,8 @@ import java.util.Map; public enum EnumCacheKey { C_INDEX_PAGE_LIST(0, "couponChannelList_"), - COUPON_STOCK(1,"couponStock:couponStock_") + COUPON_STOCK(1,"couponStock:couponStock_"), + ACTIVITY_STOCK(2,"activityStock:activityStock_") ; private static Map map = new HashMap(); static { diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumScoreRules.java b/mallinkService/src/main/java/com/iformall/enums/EnumScoreRules.java index 8c1167f68..3d2cdf373 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumScoreRules.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumScoreRules.java @@ -3,7 +3,8 @@ package com.iformall.enums; public enum EnumScoreRules { SCORE(1, "成长值"), - CREDIT(2, "积分") + CREDIT(2, "积分"), + CREDIT_DOUBLE(4, "积分倍率") ; public static EnumScoreRules getEnum(Integer code) { diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumScoreScaleRules.java b/mallinkService/src/main/java/com/iformall/enums/EnumScoreScaleRules.java new file mode 100644 index 000000000..5fa9d811e --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/enums/EnumScoreScaleRules.java @@ -0,0 +1,34 @@ +package com.iformall.enums; + +public enum EnumScoreScaleRules { + + WEEK(1, "周"), + MONTH(2, "月"), + YEAR(3, "年") + ; + + public static EnumScoreScaleRules getEnum(Integer code) { + for (EnumScoreScaleRules value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + private Integer code; + private String message; + + EnumScoreScaleRules(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } +} diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumScoreType.java b/mallinkService/src/main/java/com/iformall/enums/EnumScoreType.java index 8544c22d5..8624cff4d 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumScoreType.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumScoreType.java @@ -20,7 +20,12 @@ public enum EnumScoreType { ACTIVITY_JOIN(13, "活动报名"), CLEAN_CREDIT(14, "积分清零计划"), GAME_LES_CREDIT(15, "游戏消耗积分"), - GAME_ADD_CREDIT(16, "游戏奖励积分"),; + GAME_ADD_CREDIT(16, "游戏奖励积分"), + + SIGN_IN_DAY(17, "每日签到"), + SIGN_IN_SEVENDAY(18, "连续签到7天"), + SIGN_IN_FTDAY(19, "连续签到14天"), + SIGN_IN_TEDAY(20, "连续签到28天"),; public static EnumScoreType getEnum(Integer code) { for (EnumScoreType value : values()) { diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxActivityJoinMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxActivityJoinMapper.java index bd130e2dc..d12a0cbe5 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxActivityJoinMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxActivityJoinMapper.java @@ -18,7 +18,7 @@ public interface WxActivityJoinMapper extends CommonMapper void updateSendMsg(Map param); - void updateStatus(List wxActivity); +// void updateStatus(List wxActivity); void activityExpired(); } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java index 807ce6ce7..319b5030f 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java @@ -26,6 +26,8 @@ public interface WxCUserBasicInfoMapper extends CommonMapper { + + List findList(WxCUserBasicSign record); + + WxCUserBasicSign getLastSignIn(WxCUserBasicSign record); +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCUserFromMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCUserFromMapper.java index 4605ef943..296b979f4 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCUserFromMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCUserFromMapper.java @@ -2,6 +2,7 @@ package com.iformall.mapper; import com.iformall.common.CommonMapper; import com.iformall.domain.po.WxCUserFrom; +import com.iformall.domain.vo.WxCUserFromVo; import java.util.List; @@ -9,4 +10,5 @@ public interface WxCUserFromMapper extends CommonMapper{ List findList(WxCUserFrom record); + List visits(WxCUserFromVo record); } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCreditHistoryMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCreditHistoryMapper.java index 580d1ebb4..64a61dd62 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCreditHistoryMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCreditHistoryMapper.java @@ -2,6 +2,7 @@ package com.iformall.mapper; import com.iformall.common.CommonMapper; import com.iformall.domain.po.WxCreditHistory; +import com.iformall.domain.vo.MerchantCreditRankingVo; import com.iformall.domain.vo.WxCreditHistoryNewIdVo; import com.iformall.domain.vo.WxCreditHistoryVo; import org.apache.ibatis.annotations.Param; @@ -38,4 +39,8 @@ public interface WxCreditHistoryMapper extends CommonMapper merchantCreditRanking(WxCreditHistory record); + + int monthCount(WxCreditHistory record); } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxMallOcrModelMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxMallOcrModelMapper.java new file mode 100644 index 000000000..2a5b55eeb --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/mapper/WxMallOcrModelMapper.java @@ -0,0 +1,14 @@ +package com.iformall.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.iformall.domain.po.WxMallOcrModel; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface WxMallOcrModelMapper extends BaseMapper { + + List findList(WxMallOcrModel merchantOcrModel); +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxMerchantOcrModelMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxMerchantOcrModelMapper.java new file mode 100644 index 000000000..51766acda --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/mapper/WxMerchantOcrModelMapper.java @@ -0,0 +1,14 @@ +package com.iformall.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.iformall.domain.po.WxMerchantOcrModel; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface WxMerchantOcrModelMapper extends BaseMapper { + + List findList(WxMerchantOcrModel merchantOcrModel); +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxOcrModelMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxOcrModelMapper.java new file mode 100644 index 000000000..d2a5bdbfc --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/mapper/WxOcrModelMapper.java @@ -0,0 +1,14 @@ +package com.iformall.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.iformall.domain.po.WxOcrModel; + +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface WxOcrModelMapper extends BaseMapper { + + List findList(WxOcrModel ocrModel); +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxWiwideInfoMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxWiwideInfoMapper.java index 81966fff1..5156e8cf4 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxWiwideInfoMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxWiwideInfoMapper.java @@ -11,5 +11,7 @@ public interface WxWiwideInfoMapper extends CommonMapper { void updateToken(WxWiWideInfo wxWiWideInfo); + + void updateSercret(WxWiWideInfo wxWiWideInfo); } diff --git a/mallinkService/src/main/java/com/iformall/service/DataTowerService.java b/mallinkService/src/main/java/com/iformall/service/DataTowerService.java index 0d2d8bbc2..5c5ee3144 100644 --- a/mallinkService/src/main/java/com/iformall/service/DataTowerService.java +++ b/mallinkService/src/main/java/com/iformall/service/DataTowerService.java @@ -16,6 +16,8 @@ public interface DataTowerService { Map queryCar(TenantEntity tenantEntity); Map queryCustomer(TenantEntity tenantEntity); + + Map queryCustomerNewVersion(TenantEntity tenantEntity); ResultData queryCustomerData(TenantEntity tenantEntity, Map params); diff --git a/mallinkService/src/main/java/com/iformall/service/WxActivityService.java b/mallinkService/src/main/java/com/iformall/service/WxActivityService.java index 4ed660f41..8a2ad98c4 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxActivityService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxActivityService.java @@ -46,4 +46,11 @@ public interface WxActivityService { Integer queryStatus(Long id, Long userId); + ResultData offLineCampaign(WxActivity wxActivity); + + ResultData getListStatus(WxActivity wxActivity); + + Integer queryActivityStatus(Long id); + + Integer queryJoinStatus(Long id, Long memberId); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java b/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java index 79257c1e2..b7dba4986 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCUserBasicInfoService.java @@ -172,5 +172,6 @@ public interface WxCUserBasicInfoService { void cuserOldToNew(Long oldCuserId, Long newCuserId,TenantEntity tenantinfo); + void updateQrCode(WxCUserBasicInfo wxCUserBasicInfo); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCUserBasicSignService.java b/mallinkService/src/main/java/com/iformall/service/WxCUserBasicSignService.java new file mode 100644 index 000000000..036c10ec1 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/service/WxCUserBasicSignService.java @@ -0,0 +1,31 @@ +package com.iformall.service; + +import com.github.pagehelper.PageInfo; +import com.iformall.common.ResultData; +import com.iformall.domain.po.WxCUserBasicSign; +import com.iformall.enums.EnumScoreType; + +import java.util.Map; + +public interface WxCUserBasicSignService { + + /** + * 根据实体查询分页列表 + * + * @param record + * @param pageIndex + * @param pageSize + * @return + */ + PageInfo listAsPage(WxCUserBasicSign record, Integer pageIndex, Integer pageSize); + + WxCUserBasicSign signIn(WxCUserBasicSign record); + + WxCUserBasicSign getTodaySignIn(WxCUserBasicSign record); + + Map getLastSignIn(WxCUserBasicSign record); + + int signInCreditHistory(WxCUserBasicSign record, EnumScoreType enumScoreType); + + ResultData getListStatus(WxCUserBasicSign wxCUserBasicSign); +} diff --git a/mallinkService/src/main/java/com/iformall/service/WxCUserFromService.java b/mallinkService/src/main/java/com/iformall/service/WxCUserFromService.java index 465776dcb..71cba8023 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCUserFromService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCUserFromService.java @@ -2,6 +2,10 @@ package com.iformall.service; import com.github.pagehelper.PageInfo; import com.iformall.domain.po.WxCUserFrom; +import com.iformall.domain.vo.WxCUserFromVo; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; public interface WxCUserFromService { @@ -15,5 +19,12 @@ public interface WxCUserFromService { */ PageInfo listAsPage(WxCUserFrom record, Integer pageIndex, Integer pageSize); + PageInfo listAsVisitsPage(WxCUserFromVo record, Integer pageIndex, Integer pageSize); + + void save(WxCUserFrom wxCUserFrom); + + + void exportData(HttpServletRequest request, HttpServletResponse response, WxCUserFrom record); + void exportDataVisits(HttpServletRequest request, HttpServletResponse response, WxCUserFromVo record); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCUserService.java b/mallinkService/src/main/java/com/iformall/service/WxCUserService.java index cbdc2bd04..72a0babec 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCUserService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCUserService.java @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; import com.iformall.domain.dto.WxCUserBasicInfoDto; import com.iformall.domain.po.WxAuthorizerInfo; import com.iformall.domain.po.WxCUser; +import com.iformall.domain.po.WxCUserFrom; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.vo.UserCountVo; import com.iformall.enums.EnumScoreType; @@ -125,7 +126,7 @@ public interface WxCUserService { * 登录后发消息 * @param user */ - void actionMsgAfterLogin(WxCUser user); + void actionMsgAfterLogin(WxCUserFrom wxCUserFrom); /** * 登录后处理 diff --git a/mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java b/mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java index e69815d94..60b3e1cb5 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; import com.iformall.common.ResultData; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.po.WxCreditHistory; +import com.iformall.domain.vo.MerchantCreditRankingVo; import com.iformall.domain.vo.WxCreditHistoryVo; import javax.servlet.http.HttpServletRequest; @@ -53,7 +54,7 @@ public interface WxCreditHistoryService { * * @param record */ - WxCreditHistory saveOrUpdate(WxCreditHistory record); + WxCreditHistory saveOrUpdate(WxCreditHistory record,String tenantId); /** * 积分历史回退 @@ -69,7 +70,7 @@ public interface WxCreditHistoryService { */ //void deleteById(Long id); - Map findByMerchantIdAndSpend(Long merchantId, String spendStr, Long userId, String tenantId); + Map findByMerchantIdAndSpend(Long merchantId, String spendStr, Long userId); void clearCreditByYear(); @@ -82,4 +83,7 @@ public interface WxCreditHistoryService { Integer getAddCreditSummary(WxCreditHistory wxCreditHistory); Integer getLesCreditSummary(WxCreditHistory wxCreditHistory); + + PageInfo listAsPageMcrv(WxCreditHistory record, Integer pageIndex, Integer pageSize); + } diff --git a/mallinkService/src/main/java/com/iformall/service/WxMallBuildingService.java b/mallinkService/src/main/java/com/iformall/service/WxMallBuildingService.java index 8de2c765f..5471dd4ff 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxMallBuildingService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxMallBuildingService.java @@ -69,4 +69,6 @@ public interface WxMallBuildingService { void saveFloorArea(WxMallFloor record); void deleteByTenantId(String tenantId); + + void saveFloorImg(WxMallFloor floor); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxOcrService.java b/mallinkService/src/main/java/com/iformall/service/WxOcrService.java new file mode 100644 index 000000000..e5e81d5af --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/service/WxOcrService.java @@ -0,0 +1,39 @@ +package com.iformall.service; + +import com.github.pagehelper.PageInfo; +import com.iformall.common.ResultData; +import com.iformall.domain.po.WxActivity; +import com.iformall.domain.po.WxMallOcrModel; +import com.iformall.domain.po.WxMerchantOcrModel; +import com.iformall.domain.po.WxOcrModel; +import com.iformall.enums.EnumPayWay; + +import java.util.List; + +import javax.servlet.http.HttpServletResponse; + +/** + * @author gongbiao + */ +public interface WxOcrService { + + PageInfo listOcrModelAsPage(WxOcrModel record, Integer pageIndex, Integer pageSize); + + WxOcrModel getOcrModelById(Long id); + + ResultData saveOrUpdateOcrModel(WxOcrModel record); + + WxMerchantOcrModel getMerchantOcrModel(Long merchantId,String tenantId,String parentTenantId); + + ResultData saveOrUpdateMerchantOcrModel(WxMerchantOcrModel record); + + ResultData deleteMerchantOcrModel(Long id); + + WxMallOcrModel getMallOcrModel(Long mallId,String tenantId,String parentTenantId); + + ResultData saveOrUpdateMallOcrModel(WxMallOcrModel record); + + ResultData deleteMallOcrModel(Long id); + + +} diff --git a/mallinkService/src/main/java/com/iformall/service/WxScoreRulesService.java b/mallinkService/src/main/java/com/iformall/service/WxScoreRulesService.java index b8fcb6ac5..801db890a 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxScoreRulesService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxScoreRulesService.java @@ -62,4 +62,5 @@ public interface WxScoreRulesService { void updateCreditLocked(WxScoreRules wxScoreRules); + WxScoreRules getCreditDoubleRules(String tenantId); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java index f23aa21e2..89ec91369 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java @@ -15,6 +15,8 @@ import com.iformall.service.DataTowerService; import com.iformall.service.WxCUserCarService; import com.iformall.service.WxCouponChannelService; import com.iformall.service.WxCouponOrderService; +import com.iformall.sms.wiwide.WiwideEntry; +import com.iformall.sms.wiwide.WiwideSercret; import com.iformall.sms.wiwide.WiwideUtil; import com.iformall.utils.DateUtils; import org.apache.commons.lang3.StringUtils; @@ -781,6 +783,23 @@ public class DataTowerServiceImpl implements DataTowerService { } return datamap; } + + @Override + public Map queryCustomerNewVersion(TenantEntity tenantEntity) { + WxWiWideInfo wiWideInfo = new WxWiWideInfo(); + wiWideInfo.updateTenantInfo(tenantEntity); + List list = wxWiwideInfoMapper.findList(wiWideInfo); + Map datamap = new HashMap<>(2); + if(list.size()>0){ + wiWideInfo = list.get(0); + String wiwideUrl = wiWideInfo.getWiwideUrl(); + datamap.put("token", getWiwideSercret(wiWideInfo)); + datamap.put("sign", WiwideEntry.encrypt(wiWideInfo)); + datamap.put("url", wiwideUrl); + datamap.put("capability", wiWideInfo.getCapability()); + } + return datamap; + } private void updateToken(WxWiWideInfo wiWideInfo, String token) { Calendar instance = Calendar.getInstance(); @@ -798,22 +817,51 @@ public class DataTowerServiceImpl implements DataTowerService { logger.info("更新TOKEN失败:商场" + wiWideInfo.getTenantId()); } } + + private void updateSercret(WxWiWideInfo wiWideInfo,WiwideSercret sercret) { + WxWiWideInfo record = new WxWiWideInfo(); + record.setId(wiWideInfo.getId()); + record.setWiwideId(sercret.getSecretId()); + record.setWiwideKey(sercret.getSecretKey()); + try { + logger.info("要更新的数据before>>>>>>>>>>"+JSONObject.toJSONString(record)); + wxWiwideInfoMapper.updateSercret(record); + logger.info("要更新的数据after>>>>>>>>>>"+JSONObject.toJSONString(record)); + } catch (MallinkException e) { + logger.info("更新TOKEN失败:商场" + wiWideInfo.getTenantId()); + } + } - private String getWiwideToken(WxWiWideInfo wiWideInfo) { - Date expiredTime = wiWideInfo.getExpiredTime(); - String token = wiWideInfo.getToken(); - logger.info("wiwideinfo:"+JSONObject.toJSONString(wiWideInfo)); -// if (StringUtils.isEmpty(token) || expiredTime == null || expiredTime.before(new Date())) { - String data = WiwideUtil.queryToken(wiWideInfo); - logger.info("bid:"+wiWideInfo.getWiwideId()+",newdata:"+data); - if (data == null) - return null; - token = (String) JSONObject.parseObject(data).get("data"); - updateToken(wiWideInfo, token); -// } + /** + * 测试: http://140.143.33.245/ fm_test/Wiwide123 + * @param wiWideInfo + * @return + */ + private String getWiwideToken(WxWiWideInfo wiWideInfo) { + Date expiredTime = wiWideInfo.getExpiredTime(); + String token = wiWideInfo.getToken(); + logger.info("wiwideinfo:"+JSONObject.toJSONString(wiWideInfo)); +// if (StringUtils.isEmpty(token) || expiredTime == null || expiredTime.before(new Date())) { + String data = WiwideUtil.queryToken(wiWideInfo); + logger.info("bid:"+wiWideInfo.getWiwideId()+",newdata:"+data); + if (data == null) + return null; + token = (String) JSONObject.parseObject(data).get("data"); + updateToken(wiWideInfo, token); +// } logger.info("返回的token:"+token); return token; } + + private WiwideSercret getWiwideSercret(WxWiWideInfo wiWideInfo) { + if((!StringUtils.isBlank(wiWideInfo.getWiwideId())) && (!StringUtils.isBlank(wiWideInfo.getWiwideKey()))) { + return new WiwideSercret(wiWideInfo.getWiwideId(), wiWideInfo.getWiwideKey()); + }else { + WiwideSercret data = WiwideUtil.querySercret(wiWideInfo); + updateSercret(wiWideInfo, data); + return data; + } + } @Override public ResultData queryCustomerData(TenantEntity tenantEntity, Map params) { @@ -838,7 +886,7 @@ public class DataTowerServiceImpl implements DataTowerService { } logger.info("迈外迪访问接口参数:" + params); String res = WiwideUtil.queryData(wiWideInfo, getWiwideToken(wiWideInfo), params); - logger.info("迈外迪访问接口结果:" + res); + //logger.info("迈外迪访问接口结果:" + res); JSONObject result = JSONObject.parseObject(res); if (result == null) return new ResultData(ErrorCode.WIWIDE_INFO_NOT_READY); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java index 3b988ed87..a055c4f7d 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityJoinServiceImpl.java @@ -9,16 +9,17 @@ import com.iformall.common.IdWorker; import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.domain.po.*; -import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.po.msg.WxMsgRecord; import com.iformall.domain.vo.WxActivityJoinQuestionAnswer; import com.iformall.enums.*; +import com.iformall.exception.MallinkException; import com.iformall.mapper.*; import com.iformall.mq.MqBaseProducer; import com.iformall.service.ExcelService; import com.iformall.service.WxActivityJoinService; import com.iformall.service.WxCreditHistoryService; import com.iformall.utils.DateUtils; +import com.iformall.utils.RedisLock; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,8 +40,12 @@ import java.util.Map; */ @Service public class WxActivityJoinServiceImpl implements WxActivityJoinService { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + @Autowired + RedisLock redisLock; + @Autowired WxActivityJoinMapper wxActivityJoinMapper; @@ -72,20 +77,27 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { } @Override + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) public ResultData modifyStatus(WxActivityJoin wxActivityJoin) { + WxActivityJoin wxActivityJoin1 = wxActivityJoinMapper.selectById(wxActivityJoin.getId()); + if(wxActivityJoin1 == null){ + return new ResultData(ErrorCode.ACTIVITY_JOIN_NOT_FOND); + } if (wxActivityJoin.getStatus().equals(EnumActivityJoinStatus.CONFIRMED.getCode())) { - WxActivity wxActivity = wxActivityMapper.selectById(wxActivityJoin.getActivityId()); - Integer personLimit = wxActivity.getPersonLimit(); - WxActivityJoin params = new WxActivityJoin(); - params.updateTenantInfo(wxActivity); - params.setActivityId(wxActivity.getId()); - params.setStatus(EnumActivityJoinStatus.CONFIRMED.getCode()); - int count = wxActivityJoinMapper.selectCount(new QueryWrapper(params)); - if (personLimit.equals(count)) { - return new ResultData(ErrorCode.ACTIVITY_PERSON_LIMITED, count); + + activityJoinRedisLock(wxActivityJoin.getActivityId()); + }else{ + if(wxActivityJoin1.getSignIn().equals(EnumActivityJoinSignStatus.YES.getCode())){ + return new ResultData(ErrorCode.ACTIVITY_JOIN_IS_SIGNIN); } } wxActivityJoinMapper.updateById(wxActivityJoin); + if(wxActivityJoin.getStatus().equals(EnumActivityJoinStatus.CONFIRMED.getCode())){ + long stock = redisLock.decrease(EnumCacheKey.ACTIVITY_STOCK.getMessage()+wxActivityJoin.getActivityId(), 1); + if (stock < 0 ) { + throw new MallinkException(ErrorCode.ACTIVITY_PERSON_LIMITED.getCode(),"活动报名人数已满!"); + } + } return new ResultData(Result.SUCCESS, "操作成功"); } @@ -163,9 +175,26 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { } - @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) @Override + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) public ResultData join(WxActivityJoin wxActivityJoin) { + WxActivity wxActivity = wxActivityMapper.selectById(wxActivityJoin.getActivityId()); + if(wxActivity == null){ + return new ResultData(ErrorCode.ACTIVITY_NOT_FOND); + } + Date date = new Date(); + if(wxActivity.getActivityType().equals(EnumDelFlag.YES.getCode())){ + if(date.getTime() < wxActivity.getStartTime().getTime()){ + return new ResultData(ErrorCode.ACTIVITY_JOIN_TIME_START); + } + if(date.getTime() > wxActivity.getEndTime().getTime()){ + return new ResultData(ErrorCode.ACTIVITY_JOIN_TIME_END); + } + + }else{ + return new ResultData(ErrorCode.ACTIVITY_NOT_JOIN); + } + WxActivityJoin joinQuery = new WxActivityJoin(); joinQuery.setUserId(wxActivityJoin.getUserId()); joinQuery.setActivityId(wxActivityJoin.getActivityId()); @@ -173,10 +202,29 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { if (count > 0) { return new ResultData(ErrorCode.ACTIVITY_JOINED); } + if(wxActivity.getSignupExamine().equals(EnumDelFlag.YES.getCode())){ + wxActivityJoin.setStatus(EnumActivityJoinStatus.NOT_CONFIRMED.getCode()); + }else{ + + activityJoinRedisLock(wxActivityJoin.getActivityId()); + wxActivityJoin.setStatus(EnumActivityJoinStatus.CONFIRMED.getCode()); + } WxCUserBasicInfo user = wxCUserBasicInfoMapper.selectById(wxActivityJoin.getUserId(),wxActivityJoin.getFinalTenantId()); + //保存到报名表中 + final IdWorker idWorker = IdWorker.get(); + wxActivityJoin.setId(idWorker.nextId()); + wxActivityJoin.setPhone(user.getPhone()); + wxActivityJoin.setCreateTime(date); + wxActivityJoin.setUpdateTime(date); + wxActivityJoinMapper.insert(wxActivityJoin); + if(wxActivityJoin.getStatus().equals(EnumActivityJoinStatus.CONFIRMED.getCode())){ + long stock = redisLock.decrease(EnumCacheKey.ACTIVITY_STOCK.getMessage()+wxActivityJoin.getActivityId(), 1); + if (stock < 0 ) { + throw new MallinkException(ErrorCode.ACTIVITY_PERSON_LIMITED.getCode(),"活动报名人数已满!"); + } + } + //查询是否消耗积分 - WxActivity wxActivity = wxActivityMapper.selectById(wxActivityJoin.getActivityId()); - Date date = new Date(); if (wxActivity.getUseCredit().equals(EnumActivityUseCreditStatus.YES.getCode())) { Integer credit = wxActivity.getCredit(); //积分历史 @@ -190,15 +238,9 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { wxCreditHistory.setChangePurpose(EnumScoreType.ACTIVITY_JOIN.getMessage()+"["+wxActivity.getTitle()+"]"); wxCreditHistory.setOperatorType(EnumUserType.CUSERBASIC.getCode()); wxCreditHistory.setOperatorId(wxActivityJoin.getUserId()); - wxCreditHistoryService.saveOrUpdate(wxCreditHistory); + wxCreditHistoryService.saveOrUpdate(wxCreditHistory,wxActivity.getTenantId()); } - //保存到报名表中 - final IdWorker idWorker = IdWorker.get(); - wxActivityJoin.setId(idWorker.nextId()); - wxActivityJoin.setPhone(user.getPhone()); - wxActivityJoin.setCreateTime(date); - wxActivityJoin.setUpdateTime(date); - wxActivityJoinMapper.insert(wxActivityJoin); + return new ResultData(); } @@ -251,4 +293,46 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { } + private void activityJoinRedisLock(Long activityId){ + + if(!redisLock.hasCouponStockCache(activityId)) { + //此处需要加锁,防止并发设置 + long time = System.currentTimeMillis() + RedisLock.TIMEOUT; + String timeStr = String.valueOf(time); + boolean stocksetlock = redisLock.lock("activityLockStockSet_" + activityId, timeStr); + if (stocksetlock) { + if (!redisLock.hasActivityStockCache(activityId)) { + WxActivity wxActivity = wxActivityMapper.selectById(activityId); + if (wxActivity != null && wxActivity.getPersonLimit() != null) { + Integer personLimit = wxActivity.getPersonLimit(); + WxActivityJoin params = new WxActivityJoin(); + params.updateTenantInfo(wxActivity); + params.setActivityId(wxActivity.getId()); + params.setStatus(EnumActivityJoinStatus.CONFIRMED.getCode()); + int count = wxActivityJoinMapper.selectCount(new QueryWrapper(params)); + int i = personLimit.intValue() - count; + try { + redisLock.setActivityStock(activityId, i ); + } catch (Exception e) { + logger.error("set activitystock to redis fail.", e); + throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(), "redis设置活动报名失败" + activityId); + } finally { + redisLock.unlock("activityLockStockSet_" + activityId, timeStr); + } + } else { + redisLock.unlock("activityLockStockSet_" + activityId, timeStr); + throw new MallinkException(ErrorCode.ACTIVITY_NOT_FOND.getCode(),"活动未找到或不需要报名!"+activityId); + } + }else{ + redisLock.unlock("activityLockStockSet_" + activityId, timeStr); + } + } + } + long redisStock = redisLock.getActivityStock(activityId); + if (redisStock <= 0) { + throw new MallinkException(ErrorCode.ACTIVITY_PERSON_LIMITED.getCode(),"报名人数已满!:"+activityId); + } + + } + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityServiceImpl.java index adee61af0..0cf499bc8 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxActivityServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxActivityServiceImpl.java @@ -17,6 +17,7 @@ import com.iformall.mapper.WxActivityMapper; import com.iformall.mapper.WxCampaignMapper; import com.iformall.service.WxActivityService; import com.iformall.service.WxCampaignService; +import com.iformall.utils.DateUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,7 +31,7 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; -import java.util.Date; +import java.util.*; /** * @author gongbiao @@ -92,23 +93,59 @@ public class WxActivityServiceImpl implements WxActivityService { return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "图文内容过大无法保存"); } } else { - return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"type"); } - wxActivity.setStatus(EnumActivityStatus.STATUS_THROW_IN.getCode()); - if (wxActivity.getEndTime().before(new Date())) { - throw new MallinkException(ErrorCode.ACTIVITY_JOIN_TIME_END); + + if(wxActivity.getActivityStartTime() == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "活动开始时间不能为空"); } - if (wxActivity.getEndTime().after(wxActivity.getActivityEndTime())) { - throw new MallinkException(ErrorCode.ACTIVITY_TIME_ERROR); + if(wxActivity.getActivityEndTime() == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "活动结束时间不能为空"); } + + if(wxActivity.getActivityType() == null){ + wxActivity.setActivityType(EnumDelFlag.YES.getCode()); + } + if(wxActivity.getActivityType().equals(EnumDelFlag.YES.getCode())){ + if(wxActivity.getSignupExamine() == null){ + wxActivity.setSignupExamine(EnumDelFlag.YES.getCode()); + } + if(wxActivity.getPersonLimit() == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "报名人数不能为空"); + } + if(wxActivity.getStartTime() == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "报名开始时间不能为空"); + } + if(wxActivity.getEndTime() == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "报名结束时间不能为空"); + } + if (wxActivity.getEndTime().before(new Date())) { + throw new MallinkException(ErrorCode.ACTIVITY_JOIN_END_TIME_BEFORE); + } + if (wxActivity.getEndTime().after(wxActivity.getActivityEndTime())) { + throw new MallinkException(ErrorCode.ACTIVITY_TIME_ERROR); + } + }else if(wxActivity.getActivityType().equals(EnumDelFlag.NO.getCode())){ + if (wxActivity.getActivityEndTime().before(new Date())) { + throw new MallinkException(ErrorCode.ACTIVITY_END_TIME_BEFORE); + } + }else{ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"activityType"); + } + + wxActivity.setStatus(EnumActivityStatus.STATUS_THROW_IN.getCode()); Date date = new Date(); - wxActivity.setCreateTime(date); wxActivity.setUpdateTime(date); if (wxActivity.getId() == null) { final IdWorker idWorker = IdWorker.get(); wxActivity.setId(idWorker.nextId()); + wxActivity.setCreateTime(date); wxActivityMapper.insert(wxActivity); } else { + WxActivity wxActivity1 = wxActivityMapper.selectById(wxActivity.getId()); + if(wxActivity1.getStatus().equals(EnumActivityStatus.STATUS_TAKE_OFFF.getCode())){ + return new ResultData(ErrorCode.ACTIVITY_NOT_UPDATE); + } wxActivityMapper.updateById(wxActivity); } return new ResultData(Result.SUCCESS, "操作成功"); @@ -121,14 +158,30 @@ public class WxActivityServiceImpl implements WxActivityService { if (activity == null) { return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); } + if (wxActivity.getStatus().equals(EnumActivityStatus.INJECT_ONLINE.getCode())){ + if(activity.getActivityType().equals(EnumDelFlag.YES.getCode())){ + if (activity.getEndTime().before(new Date())) { + throw new MallinkException(ErrorCode.ACTIVITY_JOIN_TIME_END); + } + }else if(activity.getActivityType().equals(EnumDelFlag.NO.getCode())){ + if (activity.getActivityEndTime().before(new Date())) { + throw new MallinkException(ErrorCode.ACTIVITY_TIME_END); + } + }else{ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"activityType"); + } + } + wxActivity.setUpdateTime(new Date()); wxActivityMapper.updateById(wxActivity); if (wxActivity.getStatus().equals(EnumActivityStatus.STATUS_TAKE_OFFF.getCode())) { WxCampaign campaign = new WxCampaign(); campaign.setProduceId(wxActivity.getId()); WxCampaign wxCampaign = wxCampaignMapper.selectOne(new QueryWrapper(campaign)); - wxCampaign.setStatus(EnumCampaignStatus.STATUS_TAKE_OFFF.getCode()); - wxCampaignMapper.updateById(wxCampaign); + if(wxCampaign != null){ + wxCampaign.setStatus(EnumCampaignStatus.STATUS_TAKE_OFFF.getCode()); + wxCampaignMapper.updateById(wxCampaign); + } } return new ResultData(Result.SUCCESS, "操作成功"); } @@ -169,8 +222,21 @@ public class WxActivityServiceImpl implements WxActivityService { } //修改投放状态 WxActivity wxActivity = wxActivityMapper.selectById(id); - if (wxActivity.getEndTime().before(new Date())) { - return new ResultData(ErrorCode.ACTIVITY_JOIN_TIME_END); + if (wxActivity.getStatus().equals(EnumActivityStatus.INJECT_ONLINE.getCode())){ + if(wxActivity.getActivityType().equals(EnumDelFlag.YES.getCode())){ + if (wxActivity.getEndTime().before(new Date())) { + throw new MallinkException(ErrorCode.ACTIVITY_JOIN_TIME_END); + } + }else if(wxActivity.getActivityType().equals(EnumDelFlag.NO.getCode())){ + if (wxActivity.getActivityEndTime().before(new Date())) { + throw new MallinkException(ErrorCode.ACTIVITY_TIME_END); + } + }else{ + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"activityType"); + } + } + if(!wxActivity.getStatus().equals(EnumActivityStatus.INJECT_ONLINE.getCode())){ + return new ResultData(ErrorCode.ACTIVITY_SEND_ERROR_NOONLINE); } wxActivity.setStatus(EnumActivityStatus.INJECT_CAMPAIGN.getCode()); wxActivity.setUpdateTime(new Date()); @@ -206,26 +272,34 @@ public class WxActivityServiceImpl implements WxActivityService { activityJoin.setUserId(userId); activityJoin.setActivityId(id); activityJoin.updateTenantInfo(wxActivity); - //查询是否已参加报名 - //下线 就是 结束 - if (wxActivity.getStatus().equals(EnumActivityStatus.STATUS_TAKE_OFFF.getCode())) { - return EnumActivityEnrollStatus.END.getCode(); - } - //未投放 就是 未开始 - if (wxActivity.getStatus().equals(EnumActivityStatus.STATUS_THROW_IN.getCode())) { - return EnumActivityEnrollStatus.NOT_START.getCode(); - } - Date date = new Date(); - if (wxActivity.getStatus().equals(EnumActivityStatus.INJECT_CAMPAIGN.getCode())) { - //报名未开始 - if (wxActivity.getStartTime().after(date)) { + + if(wxActivity.getActivityType().equals(EnumDelFlag.YES.getCode())){ + //查询是否已参加报名 + //下线 就是 结束 + if (wxActivity.getStatus().equals(EnumActivityStatus.STATUS_TAKE_OFFF.getCode())) { + return EnumActivityEnrollStatus.END.getCode(); + } + //未投放 就是 未开始 + if (wxActivity.getStatus().equals(EnumActivityStatus.STATUS_THROW_IN.getCode())) { return EnumActivityEnrollStatus.NOT_START.getCode(); } - if (wxActivity.getEndTime().before(date)) { - //报名结束 - return EnumActivityEnrollStatus.END.getCode(); + + Date date = new Date(); + if (wxActivity.getStatus().equals(EnumActivityStatus.INJECT_CAMPAIGN.getCode()) + || wxActivity.getStatus().equals(EnumActivityStatus.INJECT_ONLINE.getCode())) { + //报名未开始 + if (wxActivity.getStartTime().after(date)) { + return EnumActivityEnrollStatus.NOT_START.getCode(); + } + if (wxActivity.getEndTime().before(date)) { + //报名结束 + return EnumActivityEnrollStatus.END.getCode(); + } } + }else{ + return EnumActivityEnrollStatus.NOT_JOIN.getCode(); } + int count = wxActivityJoinMapper.selectCount(new QueryWrapper(activityJoin)); if (count > 0) { return EnumActivityEnrollStatus.JOINED.getCode(); @@ -233,5 +307,120 @@ public class WxActivityServiceImpl implements WxActivityService { return EnumActivityEnrollStatus.NORMAL.getCode(); } + @Override + public ResultData offLineCampaign(WxActivity wxActivity) { + WxActivity activity = wxActivityMapper.selectById(wxActivity.getId()); + if (activity == null) { + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); + } + activity.setStatus(EnumActivityStatus.INJECT_ONLINE.getCode()); + activity.setUpdateTime(new Date()); + wxActivityMapper.updateById(activity); + if (wxActivity.getStatus().equals(EnumActivityStatus.STATUS_TAKE_OFFF.getCode())) { + WxCampaign campaign = new WxCampaign(); + campaign.setProduceId(wxActivity.getId()); + WxCampaign wxCampaign = wxCampaignMapper.selectOne(new QueryWrapper(campaign)); + wxCampaign.setStatus(EnumCampaignStatus.STATUS_TAKE_OFFF.getCode()); + wxCampaignMapper.updateById(wxCampaign); + } + return new ResultData(Result.SUCCESS, "操作成功"); + } + + @Override + public ResultData getListStatus(WxActivity wxActivity) { + List list = new ArrayList(); + List activityList = wxActivityMapper.findList(wxActivity); + if(activityList != null){ + for (WxActivity activity:activityList) { + + Date start = DateUtils.getDateZero(activity.getActivityStartTime()); + Date end = DateUtils.getDateZero(activity.getActivityEndTime()); + + Calendar dd = Calendar.getInstance(); + dd.setTime(start); + while (start.getTime() <= end.getTime()) { + if(start.getTime() >= wxActivity.getStartDate().getTime() + && start.getTime() <= wxActivity.getEndDate().getTime()){ + Map map = new HashMap<>(); + map.put("yyyy", DateUtils.getYear(start)); + map.put("mm", DateUtils.getMonth(start)); + map.put("dd", DateUtils.getMonthOfDate(start)); + list.add(map); + } + + // 天数加上1 + dd.add(Calendar.DAY_OF_MONTH, 1); + start = dd.getTime(); + } + } + } + if(list.size() > 0){ + HashSet h = new HashSet(list); + list.clear(); + list.addAll(h); + } + return new ResultData(list); + } + + @Override + public Integer queryActivityStatus(Long id) { + + WxActivity wxActivity = wxActivityMapper.selectById(id); + + if(wxActivity.getActivityType().equals(EnumDelFlag.YES.getCode())){ + //查询是否已参加报名 + + //未投放 就是 未开始 + if (wxActivity.getStatus().equals(EnumActivityStatus.STATUS_THROW_IN.getCode())) { + return EnumActivityEnrollStatus.ACTIVITY_NOT_LINE.getCode(); + } + //下线 就是 结束 + if (wxActivity.getStatus().equals(EnumActivityStatus.STATUS_TAKE_OFFF.getCode())) { + return EnumActivityEnrollStatus.ACTIVITY_NOT.getCode(); + } + Date date = new Date(); + + if(wxActivity.getActivityEndTime().before(date)){ + return EnumActivityEnrollStatus.ACTIVITY_END.getCode(); + } + + if (wxActivity.getStatus().equals(EnumActivityStatus.INJECT_CAMPAIGN.getCode()) + || wxActivity.getStatus().equals(EnumActivityStatus.INJECT_ONLINE.getCode())) { + //报名未开始 + if (wxActivity.getStartTime().after(date)) { + return EnumActivityEnrollStatus.NOT_START.getCode(); + } + if (wxActivity.getEndTime().before(date)) { + //报名结束 + return EnumActivityEnrollStatus.END.getCode(); + } + } + + }else{ + return EnumActivityEnrollStatus.NOT_JOIN.getCode(); + } + return EnumActivityEnrollStatus.NORMAL.getCode(); + } + + @Override + public Integer queryJoinStatus(Long id, Long memberId) { + WxActivity wxActivity = wxActivityMapper.selectById(id); + if(wxActivity.getActivityType().equals(EnumDelFlag.YES.getCode())){ + WxActivityJoin activityJoin = new WxActivityJoin(); + activityJoin.setUserId(memberId); + activityJoin.setActivityId(id); + activityJoin.updateTenantInfo(wxActivity); + int count = wxActivityJoinMapper.selectCount(new QueryWrapper(activityJoin)); + if (count > 0) { + return EnumActivityEnrollStatus.JOINED.getCode(); + }else{ + return EnumActivityEnrollStatus.NOJOINED.getCode(); + } + }else{ + return EnumActivityEnrollStatus.NOT_JOIN.getCode(); + } + + } + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java index 3fc051b3a..63a38b5f6 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java @@ -633,6 +633,11 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc wxCUserBasicInfoMapper.updateScore(record); } + @Override + public void updateQrCode(WxCUserBasicInfo record) { + wxCUserBasicInfoMapper.updateQrCode(record); + } + @Override public WxCUserBasicInfo getById(Long id,String finalTenantId) { return wxCUserBasicInfoMapper.selectById(id,finalTenantId); @@ -1127,7 +1132,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc } wxCreditHistory.setCreditAmount(credit); wxCreditHistory.setCreditNum(credit); - wxCreditHistoryService.saveOrUpdate(wxCreditHistory); + wxCreditHistoryService.saveOrUpdate(wxCreditHistory,mallUserInfo.getTenantId()); } } catch (Exception e) { logger.error(e.getMessage()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicSignServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicSignServiceImpl.java new file mode 100644 index 000000000..1e90bb1c1 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicSignServiceImpl.java @@ -0,0 +1,265 @@ +package com.iformall.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.iformall.common.IdWorker; +import com.iformall.common.ResultData; +import com.iformall.domain.po.WxCUserBasicSign; +import com.iformall.domain.po.WxCreditHistory; +import com.iformall.enums.EnumScoreType; +import com.iformall.enums.EnumUserType; +import com.iformall.mapper.WxCUserBasicSignMapper; +import com.iformall.mapper.WxCreditHistoryMapper; +import com.iformall.service.WxCUserBasicSignService; +import com.iformall.service.WxCreditHistoryService; +import com.iformall.utils.DateUtils; +import lombok.extern.slf4j.Slf4j; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; + +import static java.util.Calendar.DAY_OF_MONTH; + +@Service +@Slf4j +public class WxCUserBasicSignServiceImpl implements WxCUserBasicSignService { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + WxCUserBasicSignMapper wxCUserBasicSignMapper; + + @Autowired + WxCreditHistoryService wxCreditHistoryService; + + @Autowired + WxCreditHistoryMapper wxCreditHistoryMapper; + + @Override + public PageInfo listAsPage(WxCUserBasicSign record, Integer pageIndex, Integer pageSize) { + return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserBasicSignMapper.findList(record)); + } + + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) + @Override + public WxCUserBasicSign signIn(WxCUserBasicSign record) { + if(record.getType() == null){ + record.setType(WxCUserBasicSign.SIGNIN_TYPE); + } + + final IdWorker idWorker = IdWorker.get(); + record.setId(idWorker.nextId()); + + Date today = new Date(); + record.setCreateDate(today); + record.setUpdateDate(today); + + if(record.getType().equals(WxCUserBasicSign.SIGNIN_TYPE)){ + record.setSigninDate(DateUtils.getDateZero(today)); + WxCUserBasicSign lastSignIn = wxCUserBasicSignMapper.getLastSignIn(record); + if(lastSignIn == null){ + + record.setContinueMonthSign(1); + record.setCountMonthSign(1); + record.setContinueYearSign(1); + record.setCountYearSign(1); + record.setContinueSign(1); + record.setCountSign(1); + wxCUserBasicSignMapper.insert(record); + }else{ + long daysL = DateUtils.startToEnd(lastSignIn.getSigninDate(), today); + int daysI = new Long(daysL).intValue(); + if(daysI == 0){ + return lastSignIn; + } + + record.setCountSign(lastSignIn.getCountSign() + 1); + if(daysI == 1){ + record.setContinueSign(lastSignIn.getContinueSign() + 1); + }else{ + record.setContinueSign(1); + } + + if(DateUtils.getYear(today) == DateUtils.getYear(lastSignIn.getSigninDate())){ + record.setCountYearSign(lastSignIn.getCountYearSign() + 1); + if(daysI == 1){ + record.setContinueYearSign(lastSignIn.getContinueYearSign() + 1); + }else{ + record.setContinueYearSign(1); + } + if(DateUtils.getMonth(today) == DateUtils.getMonth(lastSignIn.getSigninDate())){ + record.setCountMonthSign(lastSignIn.getCountMonthSign() + 1); + if(daysI == 1){ + record.setContinueMonthSign(lastSignIn.getContinueMonthSign() + 1); + }else{ + record.setContinueMonthSign(1); + } + }else{ + record.setCountMonthSign(1); + record.setContinueMonthSign(1); + } + }else{ + record.setContinueMonthSign(1); + record.setCountMonthSign(1); + record.setContinueYearSign(1); + record.setCountYearSign(1); + } + wxCUserBasicSignMapper.insert(record); + } + int inCredit = signInCreditHistory(record, EnumScoreType.SIGN_IN_DAY); + int continueIn = continueSignInAddCredit(record); + record.setCredit(inCredit + continueIn); + return record; + }else{ + //补签 + return null; + } + } + + @Override + public WxCUserBasicSign getTodaySignIn(WxCUserBasicSign record) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + Date today = calendar.getTime();//今天零点 + calendar.set(Calendar.HOUR_OF_DAY, 23); + calendar.set(Calendar.MINUTE, 59); + calendar.set(Calendar.SECOND, 59); + Date tomorrow =calendar.getTime();//明天零点 + + record.setStartDate(today); + record.setEndDate(tomorrow); + List list = wxCUserBasicSignMapper.findList(record); + if(list != null && list.size() == 1){ + return list.get(0); + }else if(list.size() > 1){ + DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + String todayString = format.format(today); + logger.error("用户签到数据异常{}"+record.getUserId()+"时间{}"+todayString); + return list.get(0); + } + return null; + } + + @Override + public Map getLastSignIn(WxCUserBasicSign record) { + Map map = new HashMap<>(); + WxCUserBasicSign lastSignIn = wxCUserBasicSignMapper.getLastSignIn(record); + if(lastSignIn != null){ + long daysL = DateUtils.startToEnd(lastSignIn.getSigninDate(), new Date()); + int daysI = new Long(daysL).intValue(); + if(daysI == 0){ + int i = lastSignIn.getContinueSign() % 28; + if(i == 0){ + i=28; + } + map.put("continueSign",i); + map.put("signInDay",1);//今日已签到 + }else if(daysI == 1){ + map.put("continueSign",lastSignIn.getContinueSign()%28); + map.put("signInDay",0); + }else{ + map.put("continueSign",0); + map.put("signInDay",0); + } + }else{ + map.put("continueSign",0); + map.put("signInDay",0); + } + + +// if(lastSignIn != null && DateUtils.isSameMonth(lastSignIn.getSigninDate(),new Date())){ +// //本月连续签到天数 +// map.put("continueMonthSign",lastSignIn.getContinueMonthSign()); +// }else{ +// map.put("continueMonthSign",0); +// } +// WxCreditHistory wxCreditHistory = new WxCreditHistory(); +// wxCreditHistory.setTenantId(record.getFinalTenantId()); +// wxCreditHistory.setCUserId(record.getUserId()); +// wxCreditHistory.setCreditType(EnumScoreType.SIGN_IN_DAY.getCode()); +// //每日签到 +// if(wxCreditHistoryMapper.loginCount(wxCreditHistory) > 0){ +// map.put("signInDay",1); +// }else{ +// map.put("signInDay",0); +// } +// //7日连续 +// wxCreditHistory.setCreditType(EnumScoreType.SIGN_IN_SEVENDAY.getCode()); +// if(wxCreditHistoryMapper.monthCount(wxCreditHistory) > 0 ){ +// map.put("signInSevenDay",1); +// }else{ +// map.put("signInSevenDay",0); +// } +// //14日连续 +// wxCreditHistory.setCreditType(EnumScoreType.SIGN_IN_FTDAY.getCode()); +// if(wxCreditHistoryMapper.monthCount(wxCreditHistory) > 0 ){ +// map.put("signInFTDay",1); +// }else{ +// map.put("signInFTDay",0); +// } +// //28日连续 +// wxCreditHistory.setCreditType(EnumScoreType.SIGN_IN_TEDAY.getCode()); +// if(wxCreditHistoryMapper.monthCount(wxCreditHistory) > 0 ){ +// map.put("signInTEDay",1); +// }else{ +// map.put("signInTEDay",0); +// } + return map; + } + + @Override + public int signInCreditHistory(WxCUserBasicSign record, EnumScoreType enumScoreType){ + WxCreditHistory wxCreditHistory = new WxCreditHistory(); + wxCreditHistory.setCUserId(record.getUserId()); + wxCreditHistory.setTenantId(record.getFinalTenantId()); + wxCreditHistory.setCreateDate(new Date()); + wxCreditHistory.setCreditType(enumScoreType.getCode()); + wxCreditHistory.setChangePurpose(enumScoreType.getMessage()); + wxCreditHistory.setOperatorType(EnumUserType.CUSERBASIC.getCode()); + wxCreditHistory.setOperatorId(record.getUserId()); + WxCreditHistory wxCreditHistory1 = wxCreditHistoryService.saveOrUpdate(wxCreditHistory, null); + if(wxCreditHistory1.getCreditNum() == null){ + return 0; + } + return wxCreditHistory1.getCreditNum(); + } + + @Override + public ResultData getListStatus(WxCUserBasicSign record) { + List list = new ArrayList(); + List recordList = wxCUserBasicSignMapper.findList(record); + if(recordList != null){ + for (WxCUserBasicSign sign:recordList) { + Map map = new HashMap<>(); + map.put("yyyy", DateUtils.getYear(sign.getSigninDate())); + map.put("mm", DateUtils.getMonth(sign.getSigninDate())); + map.put("dd", DateUtils.getMonthOfDate(sign.getSigninDate())); + list.add(map); + } + } + return new ResultData(list); + } + + private int continueSignInAddCredit(WxCUserBasicSign record){ + int i = record.getContinueSign() % 28; + if(record.getContinueSign() > 0 && i == 0){ + return signInCreditHistory(record, EnumScoreType.SIGN_IN_TEDAY); + }else if(i == 7){ + return signInCreditHistory(record,EnumScoreType.SIGN_IN_SEVENDAY); + }else if(i == 14){ + return signInCreditHistory(record,EnumScoreType.SIGN_IN_FTDAY); + } + return 0; + } + +} diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromServiceImpl.java index dd20aef4f..d7b2fa755 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserFromServiceImpl.java @@ -1,9 +1,12 @@ package com.iformall.service.impl; - +import cn.afterturn.easypoi.handler.inter.IExcelExportServer; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.iformall.common.IdWorker; import com.iformall.domain.po.*; +import com.iformall.domain.vo.WxCUserFromVo; +import com.iformall.enums.EnumCUserFrom; import com.iformall.mapper.*; import com.iformall.service.*; import lombok.extern.slf4j.Slf4j; @@ -12,18 +15,109 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.*; + @Service @Slf4j -public class WxCUserFromServiceImpl implements WxCUserFromService { +public class WxCUserFromServiceImpl implements WxCUserFromService, IExcelExportServer { private final Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired WxCUserFromMapper wxCUserFromMapper; + @Autowired + WxCUserBasicInfoMapper wxCUserBasicInfoMapper; + + @Autowired + WxMerchantMapper wxMerchantMapper; + + @Autowired + ExcelService excelService; + @Override public PageInfo listAsPage(WxCUserFrom record, Integer pageIndex, Integer pageSize) { return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserFromMapper.findList(record)); } + @Override + public PageInfo listAsVisitsPage(WxCUserFromVo record, Integer pageIndex, Integer pageSize) { + return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserFromMapper.visits(record)); + } + + @Override + public void save(WxCUserFrom wxCUserFrom) { + final IdWorker idWorker = IdWorker.get(); + wxCUserFrom.setId(idWorker.nextId()); + if(wxCUserFrom.getCreateDate() == null){ + wxCUserFrom.setCreateDate(new Date()); + } + wxCUserFromMapper.insert(wxCUserFrom); + } + + @Override + public void exportData(HttpServletRequest request, HttpServletResponse response, WxCUserFrom record) { + String sheetName = "门店(用户)分享明细"; + if(record.getFromType() != null && record.getFromType().equals(EnumCUserFrom.FROM_C_USER_BASIC_INFO.getCode())){ + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(record.getFromId(), record.getFinalTenantId()); + if(wxCUserBasicInfo != null){ + sheetName = "用户["+wxCUserBasicInfo.getPhone()+"]分享明细"; + }else{ + sheetName = "用户分享明细"; + } + }else if(record.getFromType() != null && record.getFromType().equals(EnumCUserFrom.FROM_MERCHANT.getCode())){ + WxMerchant wxMerchant = wxMerchantMapper.selectById(record.getFromId()); + if(wxMerchant != null){ + sheetName = "门店["+wxMerchant.getName()+"]分享明细"; + }else{ + sheetName = "门店分享明细"; + } + } + String fileName = sheetName + ".xlsx"; + excelService.exportBigExcel(this,record, null, sheetName, WxCUserFrom.class, fileName, response, false); +// List list = wxCUserFromMapper.findList(record); +// excelService.exportExcel(list, null, "门店/用户分享记录", WxCUserFrom.class, "门店/用户分享记录.xlsx", response, false); + } + + @Override + public void exportDataVisits(HttpServletRequest request, HttpServletResponse response, WxCUserFromVo record) { + String sheetName = "门店(用户)分享报表"; + if(record.getFromType() != null && record.getFromType().equals(EnumCUserFrom.FROM_C_USER_BASIC_INFO.getCode())){ + sheetName = "用户分享报表"; + }else if(record.getFromType() != null && record.getFromType().equals(EnumCUserFrom.FROM_MERCHANT.getCode())){ + sheetName = "门店分享报表"; + } + String fileName = sheetName + ".xlsx"; + excelService.exportBigExcel(this,record, null, sheetName, WxCUserFromVo.class, fileName, response, false); +// List visits = wxCUserFromMapper.visits(record); +// excelService.exportExcel(visits, null, "门店/用户分享报表", WxCUserFromVo.class, "门店/用户分享报表.xlsx", response, false); + } + + @Override + public List selectListForExcelExport(Object queryParams, int page) { + if(queryParams instanceof WxCUserFromVo){ + WxCUserFromVo record = (WxCUserFromVo) queryParams; + record.setBegin((page-1)*10000); + record.setLimit(10000); + List visits = wxCUserFromMapper.visits(record); + if (null != visits && visits.size() > 0 ) { + List retList = new ArrayList(); + retList.addAll(visits); + return retList; + } + }else if(queryParams instanceof WxCUserFrom){ + WxCUserFrom record = (WxCUserFrom) queryParams; + record.setBegin((page-1)*10000); + record.setLimit(10000); + List list = wxCUserFromMapper.findList(record); + if (null != list && list.size() > 0 ) { + List retList = new ArrayList(); + retList.addAll(list); + return retList; + } + } + return null; + } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java index b2a67d993..9bbcd3857 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserServiceImpl.java @@ -5,10 +5,7 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.iformall.common.IdWorker; import com.iformall.domain.dto.WxCUserBasicInfoDto; -import com.iformall.domain.po.WxAuthorizerInfo; -import com.iformall.domain.po.WxCUser; -import com.iformall.domain.po.WxCUserBasicInfo; -import com.iformall.domain.po.WxCreditHistory; +import com.iformall.domain.po.*; import com.iformall.domain.po.base.BaseCUserEntity; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.po.msg.FmInsideCLoginMsg; @@ -253,12 +250,12 @@ public class WxCUserServiceImpl implements WxCUserService { } @Override - public void actionMsgAfterLogin(WxCUser user) { + public void actionMsgAfterLogin(WxCUserFrom wxCUserFrom) { + wxCUserFrom.setCreateDate(new Date()); FmInsideCLoginMsg loginMsg = new FmInsideCLoginMsg(); - loginMsg.setId(user.getId()); + loginMsg.updateTenantInfo(wxCUserFrom); loginMsg.setMsgType(EnumMsgRecordType.INSIDE_C_LOGIN.getCode()); - loginMsg.updateTenantInfo(user); - loginMsg.setUserId(user.getUserId()); + loginMsg.setWxCUserFrom(wxCUserFrom); mqBaseProducer.sendMessage(loginMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); } @@ -276,14 +273,14 @@ public class WxCUserServiceImpl implements WxCUserService { logger.error("c_user 成长值 " + e.getMessage()); } // 积分 - try { - credit = addCredit(user, EnumScoreType.LOGIN); - logger.info("user_id:" + user.getId() + " 登录新增积分:" + credit); - } catch (MallinkException e) { - logger.error("c_user 积分 " + e.getMessage()); - } catch (Exception e) { - logger.error("c_user 积分 " + e.getMessage()); - } +// try { +// credit = addCredit(user, EnumScoreType.LOGIN); +// logger.info("user_id:" + user.getId() + " 登录新增积分:" + credit); +// } catch (MallinkException e) { +// logger.error("c_user 积分 " + e.getMessage()); +// } catch (Exception e) { +// logger.error("c_user 积分 " + e.getMessage()); +// } // 用户登陆后 更新最后一次活跃时间 if (user.getUserId() != null) { @@ -334,7 +331,7 @@ public class WxCUserServiceImpl implements WxCUserService { wxCreditHistory.setChangePurpose(enumScoreType.getMessage()); wxCreditHistory.setOperatorType(EnumUserType.CUSERBASIC.getCode()); wxCreditHistory.setOperatorId(user.getUserId()); - WxCreditHistory record = wxCreditHistoryService.saveOrUpdate(wxCreditHistory); + WxCreditHistory record = wxCreditHistoryService.saveOrUpdate(wxCreditHistory,user.getTenantId()); return record.getCreditAmount(); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java index c1901cd70..515ad889a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java @@ -312,7 +312,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { creditHistory.setMerchantId(record.getMerchantId()); WxMerchant wxMerchant = wxMerchantMapper.selectById(record.getMerchantId()); creditHistory.setChangePurpose("卡消费:消费商户["+wxMerchant.getName()+"] 金额["+creditHistory.getSpendStr()+"元]"); - wxCreditHistoryService.saveOrUpdate(creditHistory); + wxCreditHistoryService.saveOrUpdate(creditHistory,record.getTenantId()); } catch (Exception e) { logger.error("积分值:" + e.getMessage()); } @@ -935,7 +935,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { creditHistory.setMerchantId(record.getMerchantId()); // WxMerchant wxMerchant = wxMerchantMapper.selectById(record.getMerchantId()); creditHistory.setChangePurpose("pos卡消费:消费商户["+merchant.getName()+"] 金额["+creditHistory.getSpendStr()+"元]"); - creditHistory = wxCreditHistoryService.saveOrUpdate(creditHistory); + creditHistory = wxCreditHistoryService.saveOrUpdate(creditHistory,record.getTenantId()); if (creditHistory != null) { scoreCreditCalc.setCredit(scoreCreditCalc.getCredit() + creditHistory.getCreditNum()); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java index 328bfe8bb..4fc8560ab 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java @@ -467,7 +467,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { creditHistory.setBuserId(bUser.getBuserId()); WxMerchant wxMerchant = wxMerchantMapper.selectById(bUser.getMerchantId()); creditHistory.setChangePurpose("商户核销增加积分:商户名称["+wxMerchant.getName()+"] 券名称["+wxCoupon.getTitle()+"("+creditHistory.getSpendStr()+"元)] "); - wxCreditHistoryService.saveOrUpdate(creditHistory); + wxCreditHistoryService.saveOrUpdate(creditHistory,couponOrder.getTenantId()); } catch (Exception e) { logger.error("积分值:" + e.getMessage()); } @@ -498,7 +498,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { creditHistory.setBusinessId(wxCoupon.getBusiness()); creditHistory.setSpend(couponOrder.getCouponPrice()); creditHistory.setChangePurpose("核销停车劵["+wxCoupon.getTitle()+"("+creditHistory.getSpendStr()+"元)] "); - wxCreditHistoryService.saveOrUpdate(creditHistory); + wxCreditHistoryService.saveOrUpdate(creditHistory,couponOrder.getTenantId()); } catch (Exception e) { logger.error("积分值:" + e.getMessage()); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java index 3e5a17e6d..3ec88f721 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java @@ -11,6 +11,7 @@ import com.iformall.common.IdWorker; import com.iformall.common.ResultData; import com.iformall.domain.po.*; import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.vo.MerchantCreditRankingVo; import com.iformall.domain.vo.WxCreditHistoryVo; import com.iformall.enums.*; import com.iformall.exception.MallinkException; @@ -144,6 +145,11 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { return wxCreditHistoryMapper.getLesCreditSummary(wxCreditHistory); } + @Override + public PageInfo listAsPageMcrv(WxCreditHistory record, Integer pageIndex, Integer pageSize) { + return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCreditHistoryMapper.merchantCreditRanking(record)); + } + @Override public PageInfo listAsPage(WxCreditHistory record, Integer pageIndex, Integer pageSize) { return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCreditHistoryMapper.findList(record)); @@ -234,7 +240,7 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { @Override @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) - public WxCreditHistory saveOrUpdate(WxCreditHistory record) { + public WxCreditHistory saveOrUpdate(WxCreditHistory record,String tenantId) { WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(record.getCUserId(),record.getTenantId()); if (wxCUserBasicInfo == null) { //验证此用户是否存在 @@ -261,7 +267,7 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { if (record.getCreditType().equals(EnumScoreType.CONSUMPTION.getCode()) || record.getCreditType().equals(EnumScoreType.SPEND_CREDIT.getCode())) { //等级积分配置 try { - creditChangeNum = CreditUtil.calUserCredit(creditChangeNumOrigin, wxCUserBasicInfo, wxScoreRulesService,wxLevelConfigMapper); + creditChangeNum = CreditUtil.calUserCredit(creditChangeNumOrigin, wxCUserBasicInfo, tenantId, wxScoreRulesService,wxLevelConfigMapper); if (Objects.nonNull(CreditUtil.getIsBirthDayScale())) { hasBirthDateCredit = true; } @@ -348,23 +354,29 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { // } @Override - public Map findByMerchantIdAndSpend(Long merchantId, String spendStr, Long userId, String tenantId) { + public Map findByMerchantIdAndSpend(Long merchantId, String spendStr, Long userId) { WxMerchant wxMerchant = wxMerchantMapper.selectById(merchantId); Map creditMap = Maps.newHashMap(); if (wxMerchant != null && wxMerchant.getBusinessId() != null) { WxCreditHistory wxCreditHistory = new WxCreditHistory(); wxCreditHistory.setBusinessId(wxMerchant.getBusinessId()); //wxCreditHistory.updateTenantInfo(tenantEntity); - wxCreditHistory.setTenantId(tenantId); - wxCreditHistory.setFinalTenantId(tenantId); + wxCreditHistory.setTenantId(wxMerchant.getFinalTenantId()); + wxCreditHistory.setFinalTenantId(wxMerchant.getFinalTenantId()); int credit; int creditNew = 0 ; if (StringUtils.isNotBlank(spendStr)) { wxCreditHistory.setSpend(new BigDecimal(spendStr).multiply(new BigDecimal(100)).intValue()); credit = payAddCredit(wxCreditHistory); if (Objects.nonNull(userId)) { - WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(userId,tenantId); - creditNew = CreditUtil.calUserCredit(credit, wxCUserBasicInfo, wxScoreRulesService,wxLevelConfigMapper); + WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(userId,wxMerchant.getFinalTenantId()); + try { + creditNew = CreditUtil.calUserCredit(credit, wxCUserBasicInfo, wxMerchant.getTenantId(), wxScoreRulesService,wxLevelConfigMapper); + } catch (Exception e) { + logger.error("积分倍率计算异常",e); + } finally { + CreditUtil.clear(); + } } else { creditNew = credit; } @@ -379,7 +391,8 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { private int creditIncrement(WxCreditHistory record) { //查找C端用户的成长值 if (record.getCreditType() == EnumScoreType.LOGIN.getCode()) { - return loginAddCredit(record); +// return loginAddCredit(record);//登陆加积分取消 + return 0; } if (record.getCreditType() == EnumScoreType.BIND_CAR.getCode()) { return bindCarAddCredit(record); @@ -418,6 +431,19 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { return record.getCreditNum(); } + if (record.getCreditType() == EnumScoreType.SIGN_IN_DAY.getCode()) { + return signinCredit(record); + } + if (record.getCreditType() == EnumScoreType.SIGN_IN_SEVENDAY.getCode()) { + return signinMonthCredit(record,EnumScoreType.SIGN_IN_SEVENDAY); + } + if (record.getCreditType() == EnumScoreType.SIGN_IN_FTDAY.getCode()) { + return signinMonthCredit(record,EnumScoreType.SIGN_IN_FTDAY); + } + if (record.getCreditType() == EnumScoreType.SIGN_IN_TEDAY.getCode()) { + return signinMonthCredit(record,EnumScoreType.SIGN_IN_TEDAY); + } + return 0; } @@ -437,6 +463,28 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { return wxScoreRules.getRule(EnumScoreType.LOGIN, WxScoreRules.SCORE); } + private int signinCredit(WxCreditHistory record) { + //如果当天已经登录过则跳过 + if (wxCreditHistoryMapper.loginCount(record) > 0) { + return 0; + } + // 1. 获取当前租户下积分的增加规则 + WxScoreRules wxScoreRules = wxScoreRulesService.getCreditRules(record.getTenantId()); + // 2. 增长的积分 + return wxScoreRules.getRule(EnumScoreType.SIGN_IN_DAY, WxScoreRules.SCORE); + } + + private int signinMonthCredit(WxCreditHistory record,EnumScoreType enumScoreType) { + //签到周期按月来 +// if (wxCreditHistoryMapper.monthCount(record) > 0) { +// return 0; +// } + // 1. 获取当前租户下积分的增加规则 + WxScoreRules wxScoreRules = wxScoreRulesService.getCreditRules(record.getTenantId()); + // 2. 增长的积分 + return wxScoreRules.getRule(enumScoreType, WxScoreRules.SCORE); + } + private int bindCarAddCredit(WxCreditHistory record) { if (wxCreditHistoryMapper.countList(record) > 0) { return 0; @@ -489,7 +537,7 @@ public class WxCreditHistoryServiceImpl implements WxCreditHistoryService { throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); } //根据商户id和花费金额计算需要新增的积分 - Map map = findByMerchantIdAndSpend(record.getMerchantId(), record.getSpendStr(), null,record.getTenantId()); + Map map = findByMerchantIdAndSpend(record.getMerchantId(), record.getSpendStr(), null); return map.get("credit"); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java index 5c7effabd..0d8dd703c 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java @@ -474,7 +474,7 @@ public class WxGameServiceImpl implements WxGameService { wxCreditHistory.setCreditType(EnumScoreType.GAME_ADD_CREDIT.getCode()); wxCreditHistory.setChangePurpose(EnumScoreType.GAME_ADD_CREDIT.getMessage()); wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId(),wxGame) ; - wxCreditHistoryService.saveOrUpdate(wxCreditHistory); + wxCreditHistoryService.saveOrUpdate(wxCreditHistory,wxGame.getTenantId()); addCredit = credit; orderId = Constant.creditPlayOrderIdTab; }else{ @@ -521,7 +521,7 @@ public class WxGameServiceImpl implements WxGameService { wxCreditHistory.setCreditType(EnumScoreType.GAME_LES_CREDIT.getCode()); wxCreditHistory.setChangePurpose(EnumScoreType.GAME_LES_CREDIT.getMessage()); wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId(),wxGame) ; - wxCreditHistoryService.saveOrUpdate(wxCreditHistory); + wxCreditHistoryService.saveOrUpdate(wxCreditHistory,wxGame.getTenantId()); return this.luckDraw(gameId,userId,wxGame.getPlayCredit()); }else{ diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMallBuildingServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMallBuildingServiceImpl.java index a05fdfa39..0bf7f9a15 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMallBuildingServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMallBuildingServiceImpl.java @@ -7,6 +7,7 @@ import com.github.pagehelper.PageInfo; import com.iformall.common.IdWorker; import com.iformall.common.ResultData; import com.iformall.domain.dto.WxMallBuildingFloorDto; +import com.iformall.domain.po.WxCUserBasicInfo; import com.iformall.domain.po.WxMall; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.po.WxMallBuilding; @@ -16,15 +17,15 @@ import com.iformall.mapper.WxMallFloorMapper; import com.iformall.service.WxMallBuildingService; import com.iformall.service.WxMallService; import com.iformall.utils.Constant; +import com.iformall.utils.RedisCacheUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; @Service @@ -40,6 +41,10 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { @Autowired WxMallFloorMapper wxMallFloorMapper; + @Autowired + @Qualifier("objectCommonRedisTemplate") + RedisTemplate objectCommonRedisTemplate; + @Override public void wxMallBuildingInit(String tenantId, String mallBuildingJSONstr) { WxMall byTenantId = wxMallService.getByTenantId(tenantId); @@ -70,6 +75,8 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { wxMallFloorMapper.insert(wxMallFloor); } } + String key = Constant.mallBuildingPrev + tenantId; + RedisCacheUtils.removeCache(objectCommonRedisTemplate, key); } @Override @@ -113,10 +120,16 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { @Override public ResultData getBuildingFloorList(TenantEntity tenantEntity) { + String key = Constant.mallBuildingPrev + tenantEntity.getTenantId(); + List wxMallBuildings = RedisCacheUtils.getCacheListObject(objectCommonRedisTemplate, key, WxMallBuilding.class); + if(wxMallBuildings != null){ + return new ResultData(wxMallBuildings); + } + wxMallBuildings = new ArrayList(); WxMallBuilding wxMallBuilding = new WxMallBuilding(); wxMallBuilding.updateTenantInfo(tenantEntity); List buildings = wxMallBuildingMapper.findList(wxMallBuilding); - List wxMallBuildings = buildings.stream().map(b -> { + wxMallBuildings = buildings.stream().map(b -> { WxMallBuilding tempb = new WxMallBuilding(); tempb.setId(b.getId()); tempb.setTenantId(b.getTenantId()); @@ -136,6 +149,7 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { tempf.setParentTenantId(f.getParentTenantId()); tempf.setFloorName(f.getFloorName()); tempf.setBackgroundImg(f.getBackgroundImg()); + tempf.setFloorMaps(f.getFloorMaps()); if (f.getTotalArea() != null) { tempf.setTotalArea(f.getTotalArea()); } @@ -145,8 +159,8 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { return tempf; }).collect(Collectors.toList()); building.setFloors(wxMallFloors); - } + RedisCacheUtils.cache(objectCommonRedisTemplate, key, wxMallBuildings, Constant.EXPIRE); return new ResultData(wxMallBuildings); } @@ -177,6 +191,10 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { }}; wxMallFloorMapper.insert(mallFloor); } + + String key = Constant.mallBuildingPrev + record.getTenantId(); + RedisCacheUtils.removeCache(objectCommonRedisTemplate, key); + } @Override @@ -192,6 +210,9 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { } }}; wxMallFloorMapper.updateById(mallFloor); + + String key = Constant.mallBuildingPrev + record.getTenantId(); + RedisCacheUtils.removeCache(objectCommonRedisTemplate, key); } @Override @@ -199,5 +220,19 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { wxMallBuildingMapper.deleteByTenantId(tenantId); } + @Override + public void saveFloorImg(WxMallFloor record) { + WxMallFloor mallFloor = new WxMallFloor() {{ + setId(record.getId()); + updateTenantInfo(record); + if(record.getFloorMaps() == null || record.getFloorMaps().size() == 0){ + setFloorMap("[]"); + }else{ + setFloorMap(JSON.toJSONString(record.getFloorMaps())); + } + }}; + wxMallFloorMapper.updateById(mallFloor); + } + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java index e24fb4eec..3d0b2f872 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMallServiceImpl.java @@ -150,6 +150,7 @@ public class WxMallServiceImpl implements WxMallService { tempf.setFloorName(f.getFloorName()); tempf.setTotalArea(f.getTotalArea()); tempf.setOperatingArea(f.getOperatingArea()); + tempf.setFloorMaps(f.getFloorMaps()); return tempf; }).collect(Collectors.toList()); building.setFloors(wxMallFloors); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeModelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeModelServiceImpl.java index c8fd705a8..f6f9afee9 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeModelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeModelServiceImpl.java @@ -57,7 +57,12 @@ public class WxMsgValidationcodeModelServiceImpl implements WxMsgValidationcodeM " ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '商户分账账户变更通知商户', '富茂', '您于{time}将{merchant}商户的收款账户变更为[{account}],后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, null)," + " ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '商户分账账户不使用回执', '富茂', '商管已同意[{account}]作为{merchant}商户的收款账户。后续的销售分成及营销补贴将存入此账户', '" + nowTimestr + "', '1', '0', null, null)," + " ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '商户分账账户使用回执', '富茂', '商管拒绝将[{account}]作为{merchant}商户的收款账户。如有疑问请联系商管', '" + nowTimestr + "', '1', '0', null, null)," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '16', '商户分账账户删除提醒', '富茂', '{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户', '" + nowTimestr + "', '1', '0', null, null);"; + " ( '" + idWorker.nextId() + "', '" + tenantId + "', '16', '商户分账账户删除提醒', '富茂', '{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户', '" + nowTimestr + "', '1', '0', null, null)," + + " ( '" + idWorker.nextId() + "', '" + tenantId + "', '17', '限时活动报名成功', '富茂', '亲爱的{person},您已成功报名{party},盼望您于{time}到场参加活动,谢谢。', '" + nowTimestr + "', '1', '0', null, 'SMS_194900027')," + + " ( '" + idWorker.nextId() + "', '" + tenantId + "', '18', '限时活动参加提醒', '富茂', '亲爱的{person},{party}活动将在{time}准时开始,感谢您能够抽出宝贵时间准时到活动现场参与,谢谢。', '" + nowTimestr + "', '1', '0', null, 'SMS_194920016')," + + " ( '" + idWorker.nextId() + "', '" + tenantId + "', '28', '会员生日券开启', '富茂', '亲到的{userName},在您的生日到来之际,我们精心的为您准备了一份生日礼物,并在生日当天消费领取{creditScale}倍积分,赶快打开{mallName}微信小程序领取您的专属生日礼物吧!', '" + nowTimestr + "', '1', '0', null, 'SMS_194915025')," + + " ( '" + idWorker.nextId() + "', '" + tenantId + "', '29', '会员生日券未开启', '富茂', '亲到的{userName},在您的生日到来之际,我们精心的为您准备了一份生日礼物,赶快打开{mallName}微信小程序领取您的专属生日礼物吧!', '" + nowTimestr + "', '1', '0', null, 'SMS_194900031')," + + " ( '" + idWorker.nextId() + "', '" + tenantId + "', '30', '系统发卡', '富茂', '亲爱的,您收到一张【{title}】,兑换码:{pw}。请于30天内打开微信小程序:{app}兑换!进店详询。', '" + nowTimestr + "', '1', '0', null, 'SMS_194920021');"; wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql); String initSql1 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`)" + "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '10', '审批通过通知', '富茂', " + diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOcrServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOcrServiceImpl.java new file mode 100644 index 000000000..48d5a2ba9 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOcrServiceImpl.java @@ -0,0 +1,126 @@ +package com.iformall.service.impl; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.iformall.common.IdWorker; +import com.iformall.common.Result; +import com.iformall.common.ResultData; +import com.iformall.domain.po.WxMallOcrModel; +import com.iformall.domain.po.WxMerchantOcrModel; +import com.iformall.domain.po.WxOcrModel; +import com.iformall.mapper.WxMallOcrModelMapper; +import com.iformall.mapper.WxMerchantOcrModelMapper; +import com.iformall.mapper.WxOcrModelMapper; +import com.iformall.service.WxOcrService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.Date; +import java.util.List; + +@Service +public class WxOcrServiceImpl implements WxOcrService { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + WxMerchantOcrModelMapper merchantOcrModelMapper; + @Autowired + WxOcrModelMapper ocrModelMapper; + @Autowired + WxMallOcrModelMapper mallOcrModelMapper; + + @Override + public PageInfo listOcrModelAsPage(WxOcrModel record, Integer pageIndex, Integer pageSize) { + return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> ocrModelMapper.findList(record)); + } + + @Override + public WxOcrModel getOcrModelById(Long id) { + return ocrModelMapper.selectById(id); + } + + @Override + public ResultData saveOrUpdateOcrModel(WxOcrModel record) { + Date date = new Date(); + if (record.getId() == null) { + final IdWorker idWorker = IdWorker.get(); + record.setId(idWorker.nextId()); + record.setCreateTime(date); + ocrModelMapper.insert(record); + } else { + record.setUpdateTime(date); + ocrModelMapper.updateById(record); + } + return new ResultData(Result.SUCCESS, "操作成功"); + } + + @Override + public WxMerchantOcrModel getMerchantOcrModel(Long merchantId,String tenantId,String parentTenantId) { + WxMerchantOcrModel query = new WxMerchantOcrModel(); + query.setMerchantId(merchantId); + query.setTenantId(tenantId); + query.setParentTenantId(parentTenantId); + List models = merchantOcrModelMapper.findList(query); + if (null == models || models.size() <= 0) { + return null; + } + return models.get(0); + } + + @Override + public ResultData saveOrUpdateMerchantOcrModel(WxMerchantOcrModel record) { + Date date = new Date(); + if (record.getId() == null) { + final IdWorker idWorker = IdWorker.get(); + record.setId(idWorker.nextId()); + record.setCreateTime(date); + merchantOcrModelMapper.insert(record); + } else { + record.setUpdateTime(date); + merchantOcrModelMapper.updateById(record); + } + return new ResultData(Result.SUCCESS, "操作成功"); + } + + @Override + public ResultData deleteMerchantOcrModel(Long id) { + merchantOcrModelMapper.deleteById(id); + return new ResultData(Result.SUCCESS, "操作成功"); + } + + @Override + public WxMallOcrModel getMallOcrModel(Long mallId, String tenantId, String parentTenantId) { + WxMallOcrModel query = new WxMallOcrModel(); + query.setMallId(mallId); + query.setTenantId(tenantId); + query.setParentTenantId(parentTenantId); + List models = mallOcrModelMapper.findList(query); + if (null == models || models.size() <= 0) { + return null; + } + return models.get(0); + } + + @Override + public ResultData saveOrUpdateMallOcrModel(WxMallOcrModel record) { + Date date = new Date(); + if (record.getId() == null) { + final IdWorker idWorker = IdWorker.get(); + record.setId(idWorker.nextId()); + record.setCreateTime(date); + mallOcrModelMapper.insert(record); + } else { + record.setUpdateTime(date); + mallOcrModelMapper.updateById(record); + } + return new ResultData(Result.SUCCESS, "操作成功"); + } + + @Override + public ResultData deleteMallOcrModel(Long id) { + mallOcrModelMapper.deleteById(id); + return new ResultData(Result.SUCCESS, "操作成功"); + } + +} diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java index c8e5f10f5..231e9a758 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -1542,7 +1542,7 @@ public class WxOrderServiceImpl implements WxOrderService { creditHistory.setChangePurpose("付款码消费:消费商户["+wxMerchant.getName()+"] 金额["+creditHistory.getSpendStr()+"元]"); - wxCreditHistoryService.saveOrUpdate(creditHistory); + wxCreditHistoryService.saveOrUpdate(creditHistory,wxMerchant.getTenantId()); } catch (Exception e) { logger.error("积分值:" + e.getMessage()); } @@ -2181,7 +2181,7 @@ public class WxOrderServiceImpl implements WxOrderService { creditHistory.setChangePurpose("积分兑换"+"["+coupon.getTitle()+"]"); } - wxCreditHistoryService.saveOrUpdate(creditHistory); + wxCreditHistoryService.saveOrUpdate(creditHistory,coupon.getTenantId()); } @Override diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxProjectConfigServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxProjectConfigServiceImpl.java index 3a5880555..e2654b38e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxProjectConfigServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxProjectConfigServiceImpl.java @@ -1,21 +1,20 @@ package com.iformall.service.impl; import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; import com.iformall.domain.po.*; import com.iformall.mapper.*; import com.iformall.service.*; import com.iformall.utils.Constant; -import com.iformall.utils.PasswordHelper; +import com.iformall.utils.RedisCacheUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.*; @Service @@ -68,6 +67,10 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { @Autowired MallUserInfoService userInfoService; + @Autowired + @Qualifier("objectCommonRedisTemplate") + RedisTemplate objectCommonRedisTemplate; + @Override @Transactional(rollbackFor = {Exception.class}) public void initProjectConfig(Long id) { @@ -159,21 +162,24 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { @Override @Transactional(rollbackFor = {Exception.class}) public void initBuilding(List wxMallBuildings) { - wxMallBuildingService.deleteByTenantId(wxMallBuildings.get(0).getTenantId()); - wxMallFloorService.deleteByTenantId(wxMallBuildings.get(0).getTenantId()); +// wxMallBuildingService.deleteByTenantId(wxMallBuildings.get(0).getTenantId()); +// wxMallFloorService.deleteByTenantId(wxMallBuildings.get(0).getTenantId()); for (WxMallBuilding wxMallBuilding:wxMallBuildings) { - wxMallBuilding.setId(null); +// wxMallBuilding.setId(null); wxMallBuilding.setMallId(Long.parseLong(wxMallBuilding.getTenantId())); if(wxMallBuilding.getFloors() != null && wxMallBuilding.getFloors().size() > 0){ wxMallBuilding.setFloorNumber(wxMallBuilding.getFloors().size()); wxMallBuildingService.saveOrUpdate(wxMallBuilding); for (WxMallFloor wxMallFloor:wxMallBuilding.getFloors()) { - wxMallFloor.setId(null); +// wxMallFloor.setId(null); wxMallFloor.setTenantId(wxMallBuilding.getTenantId()); wxMallFloor.setParentTenantId(wxMallBuilding.getParentTenantId()); wxMallFloor.setMallId(Long.parseLong(wxMallBuilding.getTenantId())); wxMallFloor.setBuildingId(wxMallBuilding.getId()); wxMallFloor.setBackgroundImg(Constant.floor_back_img); + if(null != wxMallFloor.getFloorMaps() && wxMallFloor.getFloorMaps().size() > 0) { + wxMallFloor.setFloorMap(JSON.toJSONString(wxMallFloor.getFloorMaps())); + } wxMallFloorService.saveOrUpdate(wxMallFloor); } }else{ @@ -182,6 +188,8 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { wxMallFloorService.deleteByBuildingId(wxMallBuilding.getId()); } } + String key = Constant.mallBuildingPrev + wxMallBuildings.get(0).getTenantId(); + RedisCacheUtils.removeCache(objectCommonRedisTemplate, key); } @Override diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java index 376b599bc..ac9dcdad7 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java @@ -52,50 +52,18 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { public void wxScoreRulesInit(String tenantId) { WxScoreRules wxScoreRules = new WxScoreRules(); wxScoreRules.setTenantId(tenantId); - wxScoreRules.setRules("[{\"id\": 1, \"desc\": \"每日登陆\", \"step\": 1, \"limit\": 0, \"score\": 0}," + - " {\"id\": 2, \"score\": null, \"childs\": " + - "[{\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"餐饮\", \"businessId\": 1}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"娱乐\", \"businessId\": 2}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"服饰\", \"businessId\": 3}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"亲子\", \"businessId\": 4}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"超市\", \"businessId\": 5}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"美妆\", \"businessId\": 7}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"珠宝\", \"businessId\": 8}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"服务\", \"businessId\": 9}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"家居\", \"businessId\": 10}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"数码家电\", \"businessId\": 11}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"其他\", \"businessId\": 6}]}," + - " {\"id\": 3, \"desc\": \"绑定车牌1个\", \"step\": 1, \"limit\": 1, \"score\": 0}," + - " {\"id\": 6, \"desc\": \"授权手机号\", \"step\": 1, \"limit\": 1, \"score\": 0}," + - " {\"id\": 7, \"desc\": \"编辑个人信息\", \"step\": 1, \"limit\": 1, \"score\": 0}]"); + wxScoreRules.setRules(WxScoreRules.getCreditDefaultRules()); wxScoreRules.setCreateDate(new Date()); wxScoreRules.setUpdateDate(new Date()); - wxScoreRules.setType(2); - wxScoreRules.setClearYear(1); - wxScoreRules.setScale(10); + wxScoreRules.setType(EnumScoreRules.CREDIT.getCode()); wxScoreRules.setCreditLocked(1); wxScoreRulesMapper.insert(wxScoreRules); wxScoreRules = new WxScoreRules(); wxScoreRules.setTenantId(tenantId); - wxScoreRules.setRules("[{\"id\": 1, \"desc\": \"每日登陆\", \"step\": 1, \"limit\": 0, \"score\": 0}," + - " {\"id\": 2, \"score\": 0, \"childs\": " + - "[{\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"餐饮\", \"businessId\": 1}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"娱乐\", \"businessId\": 2}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"服饰\", \"businessId\": 3}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"亲子\", \"businessId\": 4}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"超市\", \"businessId\": 5}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"美妆\", \"businessId\": 7}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"珠宝\", \"businessId\": 8}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"服务\", \"businessId\": 9}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"家居\", \"businessId\": 10}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"数码家电\", \"businessId\": 11}," + - " {\"desc\": \"线上交易1元\", \"step\": 1, \"limit\": 0, \"score\": 0, \"title\": \"其他\", \"businessId\": 6}]}," + - " {\"id\": 3, \"desc\": \"绑定车牌1个\", \"step\": 1, \"limit\": 1, \"score\": 0}," + - " {\"id\": 6, \"desc\": \"授权手机号\", \"step\": 1, \"limit\": 1, \"score\": 0}," + - " {\"id\": 7, \"desc\": \"编辑个人信息\", \"step\": 1, \"limit\": 1, \"score\": 0}]"); + wxScoreRules.setRules(WxScoreRules.getScoreDefaultRules()); wxScoreRules.setCreateDate(new Date()); wxScoreRules.setUpdateDate(new Date()); - wxScoreRules.setType(1); + wxScoreRules.setType(EnumScoreRules.SCORE.getCode()); wxScoreRules.setCreditLocked(0); wxScoreRulesMapper.insert(wxScoreRules); } @@ -145,9 +113,18 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { //当成长值或积分规则新增时,将新增的数据一并返回给接口调用端 private String getScoreRulesNew(String scoreRules,EnumScoreRules enumScoreRules){ //getJSONObject(1) 为EnumScoreType.CONSUMPTION(2, "消费")的下标值 - JSONArray jsonArrayOld = JSONArray.parseArray(scoreRules).getJSONObject(1).getJSONArray("childs"); - String defaultRules = enumScoreRules.equals(EnumScoreRules.SCORE) ? WxScoreRules.getScoreDefaultRules() : WxScoreRules.getCreditDefaultRules(); - JSONArray jsonArrayDefault = JSONArray.parseArray(defaultRules).getJSONObject(1).getJSONArray("childs"); + JSONArray jsonArrayOld = new JSONArray(); + JSONArray jsonArrayDefault = new JSONArray(); + if(enumScoreRules.equals(EnumScoreRules.SCORE)){ + jsonArrayOld = JSONArray.parseArray(scoreRules).getJSONObject(1).getJSONArray("childs"); + String defaultRules = WxScoreRules.getScoreDefaultRules(); + jsonArrayDefault = JSONArray.parseArray(defaultRules).getJSONObject(1).getJSONArray("childs"); + }else if(enumScoreRules.equals(EnumScoreRules.CREDIT)){ + jsonArrayOld = JSONArray.parseArray(scoreRules).getJSONObject(0).getJSONArray("childs"); + String defaultRules = WxScoreRules.getCreditDefaultRules(); + jsonArrayDefault = JSONArray.parseArray(defaultRules).getJSONObject(0).getJSONArray("childs"); + } + if (jsonArrayOld.size() < jsonArrayDefault.size()) { JSONArray childsJsonArray = new JSONArray(); JSONObject otherJSONObject = new JSONObject(); @@ -255,6 +232,15 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { logger.info("WxScoreRulesServiceImpl.saveOrUpdate() : 从缓存中删除积分设置 >> " + record.toString()); } } + if (record != null && record.getType().equals(EnumScoreRules.CREDIT_DOUBLE.getCode())) { + // 缓存存在,删除缓存 + String key = Constant.CREDIT_DOUBLE_RULES_KEY_PREV + record.getTenantId(); + boolean hasKey = scoreRulesRedisTemplate.hasKey(key); + if (hasKey) { + scoreRulesRedisTemplate.delete(key); + logger.info("WxScoreRulesServiceImpl.saveOrUpdate() : 从缓存中删除积分设置 >> " + record.toString()); + } + } //更新商户数据 //updateMerchantCreditLocked(record); @@ -679,6 +665,32 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { updateMerchantCreditLocked(wxScoreRules); } + @Override + public WxScoreRules getCreditDoubleRules(String tenantId) { + String key = Constant.CREDIT_DOUBLE_RULES_KEY_PREV + tenantId; + + // 缓存存在 + if (scoreRulesRedisTemplate.hasKey(key)) { + WxScoreRules wScoreRules = scoreRulesRedisTemplate.opsForValue().get(key); + logger.info("WxScoreRulesServiceImpl.getScoreRules() : 从缓存中获取了积分倍率设置 >> " + wScoreRules.toString()); + return wScoreRules; + } + + WxScoreRules scoreRules = new WxScoreRules(); + scoreRules.setTenantId(tenantId); + scoreRules.setType(EnumScoreRules.CREDIT_DOUBLE.getCode()); + List list = wxScoreRulesMapper.findList(scoreRules); + if (list.size() > 0) { + scoreRules = list.get(0); + // 插入缓存 + scoreRulesRedisTemplate.opsForValue().set(key, scoreRules); + logger.info("WxScoreRulesServiceImpl.getScoreRules() : 积分设置插入缓存 >> " + scoreRules.toString()); + } else{ + return null; + } + return scoreRules; + } + public void updateMerchantCreditLocked(WxScoreRules wxScoreRules) { WxMerchant wxMerchant = new WxMerchant(); wxMerchant.updateTenantInfo(wxScoreRules); diff --git a/mallinkService/src/main/java/com/iformall/service/msg/impl/FmInsideCLoginMsgServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/msg/impl/FmInsideCLoginMsgServiceImpl.java index 74e717502..645eb7fb7 100644 --- a/mallinkService/src/main/java/com/iformall/service/msg/impl/FmInsideCLoginMsgServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/msg/impl/FmInsideCLoginMsgServiceImpl.java @@ -6,12 +6,10 @@ import com.iformall.domain.po.msg.BaseMsg; import com.iformall.domain.po.msg.FmInsideCLoginMsg; import com.iformall.domain.po.msg.FmInsideCouponVerifyMsg; import com.iformall.enums.EnumAssignTagsTrigger; +import com.iformall.enums.EnumCUserFrom; import com.iformall.enums.EnumScoreType; import com.iformall.exception.MallinkException; -import com.iformall.service.WxCUserService; -import com.iformall.service.WxCouponOrderService; -import com.iformall.service.WxMerchantBUserService; -import com.iformall.service.WxScoreRulesService; +import com.iformall.service.*; import com.iformall.service.msg.MsgSendService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,14 +30,28 @@ public class FmInsideCLoginMsgServiceImpl implements MsgSendService { @Autowired private WxCUserService userService; + @Autowired + private WxCUserFromService wxCUserFromService; + @Override public void send(BaseMsg baseMsg) throws Exception { FmInsideCLoginMsg msg = (FmInsideCLoginMsg)baseMsg; - WxCUser user = userService.getById(msg.getId(),msg.getTenantId()); - if(user == null) { - logger.error("用户ID未找到: " + msg.getId()); - throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), "用户ID未找到" + msg.getId()); + + if(msg.getWxCUserFrom() != null && msg.getWxCUserFrom().getCUserId() != null){ + WxCUserFrom wxCUserFrom = msg.getWxCUserFrom(); + Long cUserId = wxCUserFrom.getCUserId(); + WxCUser user = userService.getById(cUserId,msg.getTenantId()); + if(user == null) { + logger.error("用户ID未找到: " + cUserId); + throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(), "用户ID未找到" + cUserId); + } + userService.actionAfterLogin(user); + if(wxCUserFrom.getFromType() != null + && !(wxCUserFrom.getFromType().equals(EnumCUserFrom.FROM_C_USER.getCode()) && wxCUserFrom.getFromId().equals(user.getId())) + && !(wxCUserFrom.getFromType().equals(EnumCUserFrom.FROM_C_USER_BASIC_INFO.getCode()) && user.getUserId() != null && wxCUserFrom.getFromId().equals(user.getUserId()))){ + wxCUserFromService.save(wxCUserFrom); + } } - userService.actionAfterLogin(user); + } } diff --git a/mallinkService/src/main/java/com/iformall/service/park/impl/jieshun/JieShunParkService.java b/mallinkService/src/main/java/com/iformall/service/park/impl/jieshun/JieShunParkService.java index 8145c8209..2b37e4d51 100644 --- a/mallinkService/src/main/java/com/iformall/service/park/impl/jieshun/JieShunParkService.java +++ b/mallinkService/src/main/java/com/iformall/service/park/impl/jieshun/JieShunParkService.java @@ -151,6 +151,8 @@ public class JieShunParkService extends BaseParkService implements ParkAdapterSe if (carNumber.equals("鄂AAAAAA")) { return new ResultData(new ParkStopFee("-111",jieshun.utcToLocal("2020-12-16 00:00:00"),jieshun.utcToLocal("2020-12-17 00:00:00"), "0.01","wx24b70f0ad2a9a89a","payPath",null,"测试车牌,仅测试用")); + }else if(carNumber.equals("鄂AAAAAB")) { + return new ResultData(21000,"车辆未入场"); } //下订单; diff --git a/mallinkService/src/main/java/com/iformall/service/park/impl/util/ParkHelper.java b/mallinkService/src/main/java/com/iformall/service/park/impl/util/ParkHelper.java index 5e05636e8..5f545ed01 100644 --- a/mallinkService/src/main/java/com/iformall/service/park/impl/util/ParkHelper.java +++ b/mallinkService/src/main/java/com/iformall/service/park/impl/util/ParkHelper.java @@ -88,7 +88,7 @@ public class ParkHelper { wxCreditHistory.setChangePurpose(EnumScoreType.BIND_CAR.getMessage()); wxCreditHistory.setOperatorType(EnumUserType.CUSERBASIC.getCode()); wxCreditHistory.setOperatorId(cuUserId); - wxCreditHistoryService.saveOrUpdate(wxCreditHistory); + wxCreditHistoryService.saveOrUpdate(wxCreditHistory,park.getTenantId()); } public ResultData unbindCar(Map paramMap, WxPark park, Long cuUserId) { diff --git a/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideEntry.java b/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideEntry.java new file mode 100644 index 000000000..b90a22c57 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideEntry.java @@ -0,0 +1,173 @@ +package com.iformall.sms.wiwide; + +import java.io.UnsupportedEncodingException; +import java.io.UnsupportedEncodingException; +import java.security.Key; +import java.util.Calendar; + +import javax.crypto.Cipher; +import javax.crypto.spec.SecretKeySpec; + +import com.iformall.common.ErrorCode; +import com.iformall.domain.po.WxWiWideInfo; +import com.iformall.exception.MallinkException; +import com.iformall.utils.Base64Util; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class WiwideEntry { + + private static final String AESTYPE = "AES/ECB/NoPadding"; + private static final String ENCRYPT_MODEL = "AES"; + private static final String TAG = "WIWIDE"; + + /** + * encrypt function + * + * @param keyStr + * @param plainText + * @return string(encrypt data) + * @throws UnsupportedEncodingException + */ + public static String encrypt(String keyStr, String plainText) throws Exception { + if(keyStr.length()!=32){ + throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "invalid signKey"); + } + byte[] encrypt = null; + byte[] bytes = plainText.getBytes(); // + byte[] type = new byte[]{0,0,0,0}; // + byte[] len = intToByteArray(bytes.length); // + byte[] orilen = intToByteArray(bytes.length + 8); // + byte[] fix = TAG.getBytes(); // + int dataLen = type.length + len.length + bytes.length + orilen.length + fix.length; + //16 + int mod = dataLen % 16; + String padding = ""; + if(mod != 0){ + int paddingLen = 16 - mod; + dataLen = dataLen + paddingLen; + for(int i = 0; i < paddingLen ; i++){ + padding += "0"; + } + } + byte[] nBytes = new byte[dataLen]; + System.arraycopy(type, 0, nBytes, 0, type.length); + System.arraycopy(len, 0, nBytes, type.length, len.length); + System.arraycopy(bytes, 0, nBytes, (type.length + len.length), bytes.length); + System.arraycopy(orilen, 0, nBytes, (type.length + len.length + bytes.length), orilen.length); + System.arraycopy(fix, 0, nBytes, (type.length + len.length + bytes.length + orilen.length), fix.length); + if(!"".equals(padding)){ + byte[] paddingByte = padding.getBytes("ISO-8859-1"); + System.arraycopy(paddingByte, 0, nBytes, (type.length + len.length + bytes.length + orilen.length + fix.length), paddingByte.length); + } + try{ + Key key = generateKey(keyStr.substring(8, 24)); + Cipher cipher = Cipher.getInstance(AESTYPE); + cipher.init(Cipher.ENCRYPT_MODE, key); + encrypt = cipher.doFinal(nBytes); + }catch(Exception e){ + e.printStackTrace(); + } + return new String(Base64Util.encode(encrypt)); + } + /** + * decrypt function + * + * @param keyStr + * @param encryptData + * @return string(base data) + * @throws UnsupportedEncodingException + */ + public static String decrypt(String keyStr, String encryptData) throws UnsupportedEncodingException { + if(keyStr.length()!=32){ + throw new MallinkException(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "invalid signKey"); + } + byte[] decrypt = null; + try{ + Key key = generateKey(keyStr.substring(8, 24)); + Cipher cipher = Cipher.getInstance(AESTYPE); + cipher.init(Cipher.DECRYPT_MODE, key); + decrypt = cipher.doFinal(Base64Util.decode(encryptData)); + }catch(Exception e){ + e.printStackTrace(); + } + byte[] type = new byte[]{0,0,0,0}; + byte[] len = intToByteArray(decrypt.length); + byte[] orilen = intToByteArray(decrypt.length + 8); + String buffDecrypt = new String(decrypt,("ISO-8859-1")); + buffDecrypt = buffDecrypt.substring(0, buffDecrypt.lastIndexOf(TAG)); + int start = type.length + len.length; + int end = orilen.length; + int length = buffDecrypt.getBytes("ISO-8859-1").length - start - end; + byte[] endDecrypt = new byte[length]; + System.arraycopy(buffDecrypt.getBytes("ISO-8859-1"), start, endDecrypt, 0, length); + return new String(endDecrypt); + } + /** + * get the generateKey + * + * @param key + * @return Object (Key) + * @throws Exception + */ + private static Key generateKey(String key)throws Exception{ + try{ + SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), ENCRYPT_MODEL); + return keySpec; + }catch(Exception e){ + e.printStackTrace(); + throw e; + } + } + /** + * integer to + * + * @param i + * @return byte[] + */ + public static byte[] intToByteArray(int i) { + byte[] result = new byte[4]; + result[0] = (byte)((i >> 24) & 0xFF); + result[1] = (byte)((i >> 16) & 0xFF); + result[2] = (byte)((i >> 8) & 0xFF); + result[3] = (byte)(i & 0xFF); + return result; + } + + + public static void main(String[] args) throws Exception{ + /** + * Signature签名生成规则为:SecretId+&_&+SecretKey+&_&+秒级时间戳【默认过期时间为5分钟】 + * Signature参数为每个接口请求必传参数【获取开发者id与令牌接口可不传】,放入Cookie中 + */ + String plainText = "vbq9KQsf&_&6cff3a09a27e745300882d60c08b82c11617ef6c&_&1606311935";// + String keyStr = "191ffbbb437946318bfecb373e694a13";//KEY + String encText = encrypt(keyStr, plainText);//: + String decString = decrypt(keyStr, encText);// + System.out.print("base data:"); + System.out.println(plainText); + System.out.print("encrypt data:"); + System.out.println(encText); + System.out.print("decrypt data:"); + System.out.println(decString); + } + + public static String encrypt(String signKey,String secretId,String secretKey,long seconds) { + String plainText = secretId+"&_&"+secretKey+"&_&"+String.valueOf(seconds);// + try { + return encrypt(signKey,plainText); + } catch (Exception e) { + log.error("wiwide encrypt error.",e); + return e.getMessage(); + } + } + + public static String encrypt(WxWiWideInfo wiWideInfo) { + Calendar calendar=Calendar.getInstance(); + int seconds=calendar.get(Calendar.SECOND); + return encrypt(wiWideInfo.getSignKey(), wiWideInfo.getWiwideId(), wiWideInfo.getWiwideKey(), seconds); + } + + +} diff --git a/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideSercret.java b/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideSercret.java new file mode 100644 index 000000000..7c51ef6e8 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideSercret.java @@ -0,0 +1,33 @@ +package com.iformall.sms.wiwide; + +import java.io.Serializable; + +public class WiwideSercret implements Serializable{ + + private static final long serialVersionUID = -5462040922824432499L; + + public WiwideSercret() { + + } + + public WiwideSercret(String secretId,String secretKey) { + this.secretId = secretId; + this.secretKey = secretKey; + } + + + private String secretKey; + private String secretId; + public String getSecretKey() { + return secretKey; + } + public void setSecretKey(String secretKey) { + this.secretKey = secretKey; + } + public String getSecretId() { + return secretId; + } + public void setSecretId(String secretId) { + this.secretId = secretId; + } +} diff --git a/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideUtil.java b/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideUtil.java index dd27c0c27..39953cbb8 100644 --- a/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideUtil.java +++ b/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideUtil.java @@ -173,11 +173,54 @@ public class WiwideUtil implements SMSExcutor { logger.info("商场:" + wiWideInfo.getTenantId() + ",返回TOKEN" + token); return token; } + + public static WiwideSercret querySercret(WxWiWideInfo wiWideInfo) { + logger.info("获取WiwideSercret"); + String username = wiWideInfo.getWiwideId(); + String password = wiWideInfo.getPassword(); + if(StringUtils.isEmpty(username)){ + logger.error("商场:" + wiWideInfo.getTenantId() + ",wiwide info : wiwideId为空" ); + return null; + } + + if(StringUtils.isEmpty(password)){ + logger.error("商场:" + wiWideInfo.getTenantId() + ",wiwide info : password为空" ); + return null; + } + + Map params = new HashMap<>(2); + params.put("username", username); + params.put("password", password); + String wiwideUrl = wiWideInfo.getWiwideUrl(); + String token = HttpUtil.doPost(wiwideUrl + "/api/user/auth", params); + logger.info("商场:" + wiWideInfo.getTenantId() + ",wiwide 返回sercret" + token); + JSONObject result = JSONObject.parseObject(token); + if (null != result ) { + String msg = result.getString("msg"); + JSONObject data = result.getJSONObject("data"); + if(null != data) { + String secretKey = data.getString("SecretKey"); + String secretId = data.getString("SecretId"); + return new WiwideSercret(secretId, secretKey); + }else { + throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"wiwide getSercret error."+msg); + } + } + return null; + } public static String queryData(WxWiWideInfo wiWideInfo, String token, Map params) { String data = HttpUtil.doPostWiwide(wiWideInfo.getWiwideUrl() + "/reports/data", token, params); return data; } + + public static void main(String[] args) { + Map params = new HashMap<>(2); + params.put("username", "lianhua"); + params.put("password", "widash1234"); + String token = HttpUtil.doPost("http://140.143.33.245/api/user/auth", params); + System.out.println(token); + } } diff --git a/mallinkService/src/main/java/com/iformall/utils/Constant.java b/mallinkService/src/main/java/com/iformall/utils/Constant.java index 0cf5eb9d8..a6612c247 100644 --- a/mallinkService/src/main/java/com/iformall/utils/Constant.java +++ b/mallinkService/src/main/java/com/iformall/utils/Constant.java @@ -24,6 +24,8 @@ public class Constant { public static final String mainPageUrl = "pages/main/index"; + public static final String indexPageUrl = "pages/index/index"; + // 1小时过期, public final static int H_EXPIRE = 3600000; @@ -38,6 +40,8 @@ public class Constant { public static final String TOKEN_WXC_END = ":wx-cuser"; + public static final String cuserQr = "weapp:cuser-qr:"; + public static final String LOGIN_USER_KEY = "LOGIN_USER_KEY"; public static final String LOGIN_MEMBER_KEY = "LOGIN_MEMBER_KEY"; public static final String TENANT_ID = "TENANT_ID"; @@ -61,6 +65,8 @@ public class Constant { public static final String SCORE_RULES_KEY_PREV = "setting:scorerules:"; // 积分规则 key prev public static final String CREDIT_RULES_KEY_PREV = "setting:creditrules:"; + // 倍率规则 key prev + public static final String CREDIT_DOUBLE_RULES_KEY_PREV = "setting:creditdoublerules:"; // 导入会员 public static final String importMemPrev = "importmem:"; @@ -76,4 +82,6 @@ public class Constant { public static final String levelConfigPrev = "levelConfig:"; + public static final String mallBuildingPrev = "mallBuilding:"; + } diff --git a/mallinkService/src/main/java/com/iformall/utils/CreditUtil.java b/mallinkService/src/main/java/com/iformall/utils/CreditUtil.java index 81f9cf8df..5079a9f84 100644 --- a/mallinkService/src/main/java/com/iformall/utils/CreditUtil.java +++ b/mallinkService/src/main/java/com/iformall/utils/CreditUtil.java @@ -1,13 +1,18 @@ package com.iformall.utils; +import com.alibaba.fastjson.JSONObject; +import com.aliyun.oss.common.utils.DateUtil; import com.iformall.domain.po.*; import com.iformall.domain.po.base.TenantEntity; +import com.iformall.enums.EnumScoreScaleRules; import com.iformall.mapper.WxLevelConfigMapper; import com.iformall.service.WxScoreRulesService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import java.math.BigDecimal; +import java.util.Date; +import java.util.List; import java.util.Objects; @Slf4j @@ -24,21 +29,26 @@ public class CreditUtil { * @param wxLevelConfigMapper * @return */ - public static int calUserCredit(int creditOrigin, WxCUserBasicInfo wxCUserBasicInfo, WxScoreRulesService wxScoreRulesService, WxLevelConfigMapper wxLevelConfigMapper) { + public static int calUserCredit(int creditOrigin, WxCUserBasicInfo wxCUserBasicInfo, String tenantId, WxScoreRulesService wxScoreRulesService, WxLevelConfigMapper wxLevelConfigMapper) { Long userId = wxCUserBasicInfo.getId(); Integer score = wxCUserBasicInfo.getPoins(); - String tenantId = wxCUserBasicInfo.getFinalTenantId(); + String finalTenantId = wxCUserBasicInfo.getFinalTenantId(); Integer levelScaleConfig = WxLevelConfig.DEFAULT_SCALE ; - levelScaleConfig = wxLevelConfigMapper.getScale(tenantId, score) ; + levelScaleConfig = wxLevelConfigMapper.getScale(finalTenantId, score) ; // 获取等级积分倍率, int levelScale = getLevelScale(score, levelScaleConfig); // 获取生日积分倍率: - int birthdayScale = getBirthdayScale(wxCUserBasicInfo, wxScoreRulesService); + int birthdayScale = getBirthdayScale(wxCUserBasicInfo, tenantId, wxScoreRulesService); + + // 获取会员日倍率: + int memberDayScale = getMemberDayScale(tenantId, wxScoreRulesService); int creditNew = new BigDecimal(creditOrigin) .multiply(new BigDecimal(levelScale)) .multiply(new BigDecimal(birthdayScale)) + .multiply(new BigDecimal(memberDayScale)) + .divide(new BigDecimal(WxScoreRules.DEFAULT_SCALE)) .divide(new BigDecimal(WxScoreRules.DEFAULT_SCALE)) .divide(new BigDecimal(WxLevelConfig.DEFAULT_SCALE) , BigDecimal.ROUND_HALF_UP).intValue(); @@ -76,7 +86,7 @@ public class CreditUtil { * @param wxScoreRulesService * @return */ - private static int getBirthdayScale(WxCUserBasicInfo wxCUserBasicInfo, WxScoreRulesService wxScoreRulesService) { + private static int getBirthdayScale(WxCUserBasicInfo wxCUserBasicInfo,String tenantId, WxScoreRulesService wxScoreRulesService) { int birthdayScale = WxScoreRules.DEFAULT_SCALE; if (Objects.isNull(wxCUserBasicInfo) || StringUtils.isBlank(wxCUserBasicInfo.getPhone())) { return 0; @@ -85,16 +95,28 @@ public class CreditUtil { //没有发过生日券的用户或者没有享受过生日积分倍率的用户 if(Objects.isNull(wxCUserBasicInfo.getScoreDate())) { //设置过生日的用户 - if (Objects.nonNull(wxCUserBasicInfo.getBirthdate()) && DateUtils.birthdaysBetween(wxCUserBasicInfo.getBirthdate()) == 0) { - birthdayScale = getBirthdayScoreScale(wxCUserBasicInfo.getFinalTenantId(),wxScoreRulesService); + if (Objects.nonNull(wxCUserBasicInfo.getBirthdate()) && DateUtils.isBirthdays(wxCUserBasicInfo.getBirthdate())) { + birthdayScale = getBirthdayScoreScale(tenantId,wxScoreRulesService); } else { log.info("积分倍率计算:未设置生日或生日条件未匹配={}", wxCUserBasicInfo.getScoreDate()); } } else { - //发过生日券的用户或者享受过生日积分倍率的用户 - if (Objects.nonNull(wxCUserBasicInfo.getScoreDate()) && DateUtils.birthdaysBetween(wxCUserBasicInfo.getScoreDate()) == 0) { - birthdayScale = getBirthdayScoreScale(wxCUserBasicInfo.getFinalTenantId(), wxScoreRulesService); + if(Objects.nonNull(wxCUserBasicInfo.getScoreDate())){ + int scoreYear = DateUtils.getYear(wxCUserBasicInfo.getScoreDate()); + int year = DateUtils.getYear(new Date()); + if(scoreYear == year){ + if(DateUtils.isBirthdays(wxCUserBasicInfo.getScoreDate())){ + birthdayScale = getBirthdayScoreScale(tenantId, wxScoreRulesService); + } + }else{ + if (Objects.nonNull(wxCUserBasicInfo.getBirthdate()) && DateUtils.isBirthdays(wxCUserBasicInfo.getBirthdate())) { + birthdayScale = getBirthdayScoreScale(tenantId,wxScoreRulesService); + } else { + log.info("积分倍率计算:未设置生日或生日条件未匹配={}", wxCUserBasicInfo.getScoreDate()); + } + } } + } //配置了生日积分倍率,保存到上下文 @@ -113,7 +135,7 @@ public class CreditUtil { */ public static int getBirthdayScoreScale(String tenantId, WxScoreRulesService wxScoreRulesService) { int birthdayScale = WxScoreRules.DEFAULT_SCALE; - WxScoreRules rules = wxScoreRulesService.getCreditRules(tenantId); + WxScoreRules rules = wxScoreRulesService.getCreditDoubleRules(tenantId); if (Objects.nonNull(rules) && Objects.nonNull(rules.getScale())) { //规则存使用积分倍率 birthdayScale = rules.getScale(); @@ -125,6 +147,87 @@ public class CreditUtil { return birthdayScale; } + /** + * 获取会员日倍率 + * + * @param + * @param wxScoreRulesService + * @return + */ + private static int getMemberDayScale(String tenantId, WxScoreRulesService wxScoreRulesService) { + int memberDayScale = WxScoreRules.DEFAULT_SCALE; + + WxScoreRules rules = wxScoreRulesService.getCreditDoubleRules(tenantId); + if (Objects.nonNull(rules) && Objects.nonNull(rules.getRules())) { + Date date = new Date(); + int weekDay = DateUtils.getWeekOfDate(date); + int monthDay = DateUtils.getMonthOfDate(date); + int month = DateUtils.getMonth(date); + //会员日积分规则 + List ruleList = JSONObject.parseArray(rules.getRules(), JSONObject.class); + for (JSONObject rule:ruleList) { + Integer cycle = rule.getInteger(WxScoreRules.CYCLE); + String cycleStart = rule.getString(WxScoreRules.CYCLE_START); + String cycleEnd = rule.getString(WxScoreRules.CYCLE_END); + Integer cycleScale = rule.getInteger(WxScoreRules.CYCLE_SCALE); + if(cycle == null || StringUtils.isBlank(cycleStart) || StringUtils.isBlank(cycleEnd) || cycleScale == null){ + break; + } + if(cycleScale > memberDayScale){ + if(cycle.equals(EnumScoreScaleRules.WEEK.getCode())){ + try { + int start = Integer.parseInt(cycleStart); + int end = Integer.parseInt(cycleEnd); + if(weekDay >= start && weekDay <=end){ + memberDayScale = cycleScale; + } + } catch (NumberFormatException e) { + break; + } + }else if(cycle.equals(EnumScoreScaleRules.MONTH.getCode())){ + try { + int start = Integer.parseInt(cycleStart); + int end = Integer.parseInt(cycleEnd); + if(monthDay >= start && monthDay <=end){ + memberDayScale = cycleScale; + } + } catch (NumberFormatException e) { + break; + } + }else if(cycle.equals(EnumScoreScaleRules.YEAR.getCode())){ + try { + if(cycleStart.contains("-") && cycleEnd.contains("-")){ + String[] cycleStarts = cycleStart.split("-"); + String[] cycleEnds = cycleEnd.split("-"); + int monthStart = Integer.parseInt(cycleStarts[1]); + int monthEnd = Integer.parseInt(cycleEnds[1]); + if(month >= monthStart && month <= monthEnd){ + int dayStart = Integer.parseInt(cycleStarts[2]); + int dayEnd = Integer.parseInt(cycleEnds[2]); + if(month == monthStart && monthDay < dayStart){ + break; + } + if(month == monthEnd && monthDay > dayEnd){ + break; + } + memberDayScale = cycleScale; + } + } + } catch (NumberFormatException e) { + break; + } + } + } + } + + } else { + //没有配置积分规则 + //log.info("积分倍率计算:会员生日积分倍率配置=null"); + } + log.info("会员日积分倍率配置:{}", memberDayScale); + return memberDayScale; + } + public static Long getIsBirthDayScale() { return isBirthDayScale.get(); } diff --git a/mallinkService/src/main/java/com/iformall/utils/DateUtils.java b/mallinkService/src/main/java/com/iformall/utils/DateUtils.java index 5bc1e01e2..625872b0b 100755 --- a/mallinkService/src/main/java/com/iformall/utils/DateUtils.java +++ b/mallinkService/src/main/java/com/iformall/utils/DateUtils.java @@ -1288,4 +1288,94 @@ public class DateUtils { } } return age; } + + /** + * 获取当前日期是星期几
+ * + * @param date + * @return 当前日期是星期几 + */ + public static int getWeekOfDate(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + int w = cal.get(Calendar.DAY_OF_WEEK) ; + if (w == 1) + w = 7; + return w - 1; + } + + /** + * 获取当前日期是当前月的第几天
+ * + * @param date + * @return 获取当前日期是当前月的第几天 + */ + public static int getMonthOfDate(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + int m = cal.get(Calendar.DAY_OF_MONTH); + return m; + } + + /** + * 获取当前日期是几月
+ * + * @param date + * @return 获取当前日期是几月 + */ + public static int getMonth(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + int month = cal.get(Calendar.MONTH) + 1; + return month; + } + + /** + * 获取当前日期是哪年
+ * + * @param date + * @return 获取当前日期是哪年 + */ + public static int getYear(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + int year = cal.get(Calendar.YEAR); + return year; + } + + /** + * 判断生日 + * @param date + * @return + */ + public static boolean isBirthdays(Date date) { + Calendar todayCal = Calendar.getInstance(); + int todayMonth = todayCal.get(Calendar.MONTH) + 1; + int todayDay = todayCal.get(Calendar.DAY_OF_MONTH); + Calendar birthdayCal = Calendar.getInstance(); + birthdayCal.setTime(date); + int birthMonth = birthdayCal.get(Calendar.MONTH) + 1; + int birthDay = birthdayCal.get(Calendar.DAY_OF_MONTH); + if(todayMonth == birthMonth && todayDay == birthDay){ + return true; + } + return false; + } + + /** + * 获取当前日期零点
+ * + * @param date + * @return 获取当前日期零点 + */ + public static Date getDateZero(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + return cal.getTime(); + } + } diff --git a/mallinkService/src/main/java/com/iformall/utils/HttpUtil.java b/mallinkService/src/main/java/com/iformall/utils/HttpUtil.java index 7f5ed3a43..ee8e3e6c0 100644 --- a/mallinkService/src/main/java/com/iformall/utils/HttpUtil.java +++ b/mallinkService/src/main/java/com/iformall/utils/HttpUtil.java @@ -6,12 +6,14 @@ import okhttp3.Request; import okhttp3.RequestBody; import org.apache.commons.io.IOUtils; import org.apache.http.*; +import org.apache.http.client.CookieStore; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.BasicCookieStore; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.message.BasicNameValuePair; @@ -144,6 +146,9 @@ public class HttpUtil { * @return */ public static String doPostWiwide(String url, String token, Map params){ + + //CookieStore store= new BasicCookieStore(); + //HttpClients.custom().setDefaultCookieStore(store).build(); // 定义HttpClient CloseableHttpClient client = HttpClients.createDefault(); diff --git a/mallinkService/src/main/java/com/iformall/utils/RedisLock.java b/mallinkService/src/main/java/com/iformall/utils/RedisLock.java index c90d1cceb..9dddc9788 100644 --- a/mallinkService/src/main/java/com/iformall/utils/RedisLock.java +++ b/mallinkService/src/main/java/com/iformall/utils/RedisLock.java @@ -154,5 +154,32 @@ public class RedisLock { Long rs = stringRedisTemplate.opsForValue().increment("orderGroup:complete:"+String.valueOf(orderGroupId), 1); return rs <= 1L; } + + + //------------------------------------------------------------------------------------------------------- + // 时间紧迫,,,后面再做封装 + + public boolean hasActivityStockCache(long activityId) { + //如果库存为零,这个时候同步一下数据库的库存,因为有的时候系统报错事务会胡滚,但是redis扣减库存执行了,所以为0的时候,跟数据库的同步一下 + boolean booleanHasCache = stringRedisTemplate.hasKey(EnumCacheKey.ACTIVITY_STOCK.getMessage()+String.valueOf(activityId)); + if (booleanHasCache) { + long stockvalue = getActivityStock(activityId); + if (stockvalue > 0) { + return true; + }else { + return false; + } + } + return false; + } + + public long getActivityStock(long activityId) { + String longstr = stringRedisTemplate.opsForValue().get(EnumCacheKey.ACTIVITY_STOCK.getMessage()+String.valueOf(activityId)); + return Long.parseLong(longstr); + } + + public void setActivityStock(long activityId,int number) { + stringRedisTemplate.opsForValue().set(EnumCacheKey.ACTIVITY_STOCK.getMessage()+String.valueOf(activityId), String.valueOf(number)); + } } diff --git a/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml b/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml index b22de08d0..6b0c8df46 100644 --- a/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml @@ -80,8 +80,12 @@ diff --git a/mallinkService/src/main/resources/mapper/WxActivityMapper.xml b/mallinkService/src/main/resources/mapper/WxActivityMapper.xml index af6e248f2..7cdf59a4d 100644 --- a/mallinkService/src/main/resources/mapper/WxActivityMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxActivityMapper.xml @@ -17,6 +17,8 @@ + + @@ -31,7 +33,7 @@ - `id`,`tenant_id`,`parent_tenant_id`,`cover_img`,`title`,`sub_title`,`detail`,`html`,`person_limit`,`activity_start_time`,`activity_end_time`, + `id`,`tenant_id`,`parent_tenant_id`,`cover_img`,`title`,`sub_title`,`detail`,`html`,`activity_type`,`signup_examine`,`person_limit`,`activity_start_time`,`activity_end_time`, `use_credit`,`credit`,`type`,`status`,`start_time`,`end_time`,`question`,`is_expired`,`create_time`,`update_time`,`use_img`, `img_detail`,`send_msg`,`selectques` @@ -65,10 +67,25 @@ and `type` = #{type} + + + and `activity_type` = #{activityType} + + + and `signup_examine` = #{signupExamine} + - + and `status` = #{status} + + + and `status` >= 2 and `status` <= 3 + + + + and `status` > 0 + and `create_time` = #{createTime} @@ -85,8 +102,15 @@ and `is_expired` = #{isExpired} - - and `create_time` between #{starttime} and #{endtime} + + + + + + and not(`activity_end_time` < #{startDate, jdbcType=TIMESTAMP} or `activity_start_time` > #{endDate, jdbcType=TIMESTAMP}) + @@ -118,7 +142,7 @@ - update wx_activity set is_expired=${isExpired},update_time=#{updateTime} where status=${status} and now()>end_time + update wx_activity set is_expired=${isExpired},update_time=#{updateTime} where status > 0 and now()>end_time diff --git a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml index 4f45cdf79..36a8eead2 100644 --- a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml @@ -26,13 +26,14 @@ + distinct wcubi.`id`,wcubi.`phone`,wcubi.`birthdate`,wcubi.`education`,wcubi.`sex`,wcubi.`email`, wcubi.`address`,wcubi.`poins`,wcubi.`tag_id`,wcubi.`create_date`,wcubi.`update_date`, wcubi.`final_tenant_id`,wcubi.`tenant_id`,wcubi.`parent_tenant_id`,wcubi.`name`,wcubi.`nick_name`, - wcubi.`avatar_url`,wcubi.`credit`,wcubi.`active_time`,wcubi.`login_count`,wcubi.`act_record` + wcubi.`avatar_url`,wcubi.`credit`,wcubi.`active_time`,wcubi.`login_count`,wcubi.`act_record`,wcubi.`qr_code` ,(select level from wx_level_config where poins >= points and tenant_id=wcubi.final_tenant_id order by points desc limit 1 ) level,wcubi.score_date,wcubi.status @@ -265,6 +266,12 @@ update wx_c_user_basic_info set poins=#{poins} where id=#{id} + + + update wx_c_user_basic_info set qr_code=#{qrCode} + where id=#{id} + + update wx_c_user_basic_info set poins=poins+#{poins} where id=#{id} diff --git a/mallinkService/src/main/resources/mapper/WxCUserBasicSignMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserBasicSignMapper.xml new file mode 100644 index 000000000..7849f3a16 --- /dev/null +++ b/mallinkService/src/main/resources/mapper/WxCUserBasicSignMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + `id`,`tenant_id`,`parent_tenant_id`,`user_id`,`type`,`signin_date`,`create_date`,`update_date`, + `continue_month_sign`,`count_month_sign`,`continue_year_sign`,`count_year_sign`, + `continue_sign`,`count_sign`,`mark` + + + + where 1 = 1 + + and `id` = #{id} + + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + and `user_id` = #{userId} + + + and `type` = #{type} + + + + and `signin_date` >= #{startDate} + + + and `signin_date` <= #{endDate} + + + + and id in + + #{idItem} + + + order by `signin_date` desc + + + + + + + + diff --git a/mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml index 0cb8d9cea..c28c58138 100644 --- a/mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml @@ -7,7 +7,8 @@ - + + @@ -59,9 +60,9 @@ and wcuf.`from_id` = #{fromId} - + and wcuf.`share_user_type` = #{shareUserType} @@ -69,11 +70,11 @@ and wcuf.`share_user` = #{shareUser} - - and wcuf.`create_date` >= #{startTime} + + and wcuf.`create_date` >= #{startDate} - - and wcuf.`create_date` <= #{endTime} + + and wcuf.`create_date` <= #{endDate} @@ -82,28 +83,116 @@ #{idItem} - order by wcuf.`create_date` desc + + + diff --git a/mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml b/mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml index bba2d6f98..2db0f2d08 100644 --- a/mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml @@ -184,6 +184,18 @@ and DATEDIFF(`create_date`,now())=0 + + + select wm.id merchantId,wm.tenant_id tenantId,wm.parent_tenant_id parentTenantId,wm.name merchantName,IFNULL(a.sum_credit_num,0) sumAddCredit, + IFNULL(b.sum_credit_num,0) sumLesCredit,IFNULL(c.count_c_user_id,0) countAddCreditUser, + IFNULL(d.count_c_user_id,0) countLesCreditUser + from + ( + select id,tenant_id,parent_tenant_id,name from wx_merchant + where is_del = 0 + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + ) wm + left join + ( + select credit.merchant_id,sum(credit.credit_num) sum_credit_num from wx_credit_history${shardFinalTableSuffix} credit + INNER JOIN wx_c_user_basic_info${shardFinalTableSuffix} basic ON basic.id = credit.c_user_id + where credit.merchant_id is not null and credit.merchant_id != -1 and credit.credit_num > 0 + + and credit.create_date >= #{startTime} + + + and credit.create_date < #{endTime} + + GROUP BY credit.merchant_id + ) a on a.merchant_id = wm.id + left join + ( + select credit.merchant_id,sum(credit.credit_num) sum_credit_num from wx_credit_history${shardFinalTableSuffix} credit + INNER JOIN wx_c_user_basic_info${shardFinalTableSuffix} basic ON basic.id = credit.c_user_id + where credit.merchant_id is not null and credit.merchant_id != -1 and credit.credit_num < 0 + + and credit.create_date >= #{startTime} + + + and credit.create_date < #{endTime} + + GROUP BY credit.merchant_id + ) b on b.merchant_id = wm.id + left join + ( + select credit.merchant_id,count(distinct credit.c_user_id) count_c_user_id from wx_credit_history${shardFinalTableSuffix} credit + INNER JOIN wx_c_user_basic_info${shardFinalTableSuffix} basic ON basic.id = credit.c_user_id + where credit.merchant_id is not null and credit.merchant_id != -1 and credit.credit_num > 0 + + and credit.create_date >= #{startTime} + + + and credit.create_date < #{endTime} + + GROUP BY credit.merchant_id + ) c on c.merchant_id = wm.id + left join + ( + select credit.merchant_id,count(distinct credit.c_user_id) count_c_user_id from wx_credit_history${shardFinalTableSuffix} credit + INNER JOIN wx_c_user_basic_info${shardFinalTableSuffix} basic ON basic.id = credit.c_user_id + where credit.merchant_id is not null and credit.merchant_id != -1 and credit.credit_num < 0 + + and credit.create_date >= #{startTime} + + + and credit.create_date <= #{endTime} + + GROUP BY credit.merchant_id + ) d on d.merchant_id = wm.id + where (IFNULL(a.sum_credit_num,0) > 0 or IFNULL(b.sum_credit_num,0) < 0) + ORDER BY sumAddCredit desc + + + diff --git a/mallinkService/src/main/resources/mapper/WxMallFloorMapper.xml b/mallinkService/src/main/resources/mapper/WxMallFloorMapper.xml index ddf4fd1d2..83f2d8aaf 100644 --- a/mallinkService/src/main/resources/mapper/WxMallFloorMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMallFloorMapper.xml @@ -13,10 +13,13 @@ + + + - `id`,`tenant_id`,`parent_tenant_id`,`mall_id`,`building_id`,`floor_name`,`background_img`,`create_date`,`update_date`,`total_area`,`operating_area` + `id`,`tenant_id`,`parent_tenant_id`,`mall_id`,`building_id`,`floor_name`,`background_img`,`create_date`,`update_date`,`total_area`,`operating_area`,`floor_map` diff --git a/mallinkService/src/main/resources/mapper/WxMallOcrModelMapper.xml b/mallinkService/src/main/resources/mapper/WxMallOcrModelMapper.xml new file mode 100644 index 000000000..3f36961fa --- /dev/null +++ b/mallinkService/src/main/resources/mapper/WxMallOcrModelMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + id,tenant_id,parent_tenant_id,mall_id,ocr_model_id,create_time,update_time + + + + where 1 = 1 + + + and `id` = #{id} + + + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + + and `mall_id` = #{mallId} + + + + and `ocr_model_id` = #{ocrModelId} + + + and id in + + #{idItem} + + + order by ${sortColumns} + + + + + \ No newline at end of file diff --git a/mallinkService/src/main/resources/mapper/WxMerchantMapper.xml b/mallinkService/src/main/resources/mapper/WxMerchantMapper.xml index 4aa8444a2..af87ebc03 100644 --- a/mallinkService/src/main/resources/mapper/WxMerchantMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMerchantMapper.xml @@ -610,4 +610,5 @@ order by create_date desc + diff --git a/mallinkService/src/main/resources/mapper/WxMerchantOcrModelMapper.xml b/mallinkService/src/main/resources/mapper/WxMerchantOcrModelMapper.xml new file mode 100644 index 000000000..dd7639483 --- /dev/null +++ b/mallinkService/src/main/resources/mapper/WxMerchantOcrModelMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + id,tenant_id,parent_tenant_id,merchant_id,ocr_model_id,create_time,update_time + + + + where 1 = 1 + + + and `id` = #{id} + + + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + + and `merchant_id` = #{merchantId} + + + + and `ocr_model_id` = #{ocrModelId} + + + and id in + + #{idItem} + + + order by ${sortColumns} + + + + + \ No newline at end of file diff --git a/mallinkService/src/main/resources/mapper/WxOcrModelMapper.xml b/mallinkService/src/main/resources/mapper/WxOcrModelMapper.xml new file mode 100644 index 000000000..7427ca049 --- /dev/null +++ b/mallinkService/src/main/resources/mapper/WxOcrModelMapper.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + id,lang_code,font_name,remark,status,create_time,updateTime + + + + where 1 = 1 + + + and `id` = #{id} + + + + and `lang_code` = #{langCode} + + + and `font_name` = #{fontName} + + + + and `status` = #{status} + + + + and id in + + #{idItem} + + + order by ${sortColumns} + + + + + \ No newline at end of file diff --git a/mallinkService/src/main/resources/mapper/WxWiwideInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxWiwideInfoMapper.xml index 8ce7b3b77..80ea4e26f 100644 --- a/mallinkService/src/main/resources/mapper/WxWiwideInfoMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxWiwideInfoMapper.xml @@ -7,14 +7,18 @@ + + + + - `id`,`tenant_id`,`parent_tenant_id`,`wiwide_id`,`wiwide_key`,`wiwide_url`, `token`,`expired_time`,`capability` + `id`,`tenant_id`,`parent_tenant_id`,`wiwide_id`,`wiwide_key`,`sign_key`,`wiwide_url`, `token`,`expired_time`,`capability`,`user_name`,`password`,`old_plat` @@ -34,6 +38,11 @@ and `wiwide_id` like concat('%', #{wiwideId},'%') + + + and `old_plat` = #{oldPlat} + + and id in @@ -51,7 +60,11 @@ - update wx_wiwide_info set token=#{token},expired_time=#{expiredTime} where id=#{id} + update wx_wiwide_info set token=#{token},expired_time=#{expiredTime} where id=#{id} + + + + update wx_wiwide_info set wiwide_id=#{wiwideId},wiwide_key=#{wiwideKey} where id=#{id} diff --git a/mallinkSysAdmin/pom.xml b/mallinkSysAdmin/pom.xml index 9544ca12d..d595fe242 100644 --- a/mallinkSysAdmin/pom.xml +++ b/mallinkSysAdmin/pom.xml @@ -39,6 +39,13 @@ com.github.axet kaptcha 0.0.9 + + + + + com.iformall + mallinkOcr + 1.0 diff --git a/mallinkSysAdmin/src/main/java/com/iformall/SysApplication.java b/mallinkSysAdmin/src/main/java/com/iformall/SysApplication.java index 787b04e1d..756d85e7d 100644 --- a/mallinkSysAdmin/src/main/java/com/iformall/SysApplication.java +++ b/mallinkSysAdmin/src/main/java/com/iformall/SysApplication.java @@ -34,6 +34,9 @@ public class SysApplication { @Value("${fm.upload_dir}") private String uploadDir; + @Value("${fm.ocr_data}") + private String ocrData; + @Bean public boolean isFmException() { return fmException; @@ -53,6 +56,11 @@ public class SysApplication { public String fmUploadDir() { return uploadDir; } + + @Bean + public String ocrData() { + return ocrData; + } public static void main(String[] args) { SpringApplication.run(SysApplication.class, args); diff --git a/mallinkSysAdmin/src/main/java/com/iformall/controller/datafix/DataInitController.java b/mallinkSysAdmin/src/main/java/com/iformall/controller/datafix/DataInitController.java index a385a71c8..65285f239 100644 --- a/mallinkSysAdmin/src/main/java/com/iformall/controller/datafix/DataInitController.java +++ b/mallinkSysAdmin/src/main/java/com/iformall/controller/datafix/DataInitController.java @@ -216,7 +216,7 @@ public class DataInitController extends BaseController { creditHistory.setMerchantId(buUser.getMerchantId()); WxMerchant wxMerchant = merchantService.getById(buUser.getMerchantId()); creditHistory.setChangePurpose("核销积分数据修复:消费商户["+wxMerchant.getName()+"] 卷名称["+coupon.getTitle()+"("+creditHistory.getSpendStr()+"元)] "); - creditHistoryService.saveOrUpdate(creditHistory); + creditHistoryService.saveOrUpdate(creditHistory,co.getTenantId()); }); } diff --git a/mallinkSysAdmin/src/main/java/com/iformall/controller/ocr/WxOcrController.java b/mallinkSysAdmin/src/main/java/com/iformall/controller/ocr/WxOcrController.java new file mode 100644 index 000000000..33e10eee1 --- /dev/null +++ b/mallinkSysAdmin/src/main/java/com/iformall/controller/ocr/WxOcrController.java @@ -0,0 +1,223 @@ +package com.iformall.controller.ocr; + +import com.github.pagehelper.PageInfo; +import com.iformall.annotation.SystemControllerLog; +import com.iformall.common.ErrorCode; +import com.iformall.common.Result; +import com.iformall.common.ResultData; +import com.iformall.controller.base.BaseController; +import com.iformall.domain.po.MallUserInfo; +import com.iformall.domain.po.WxMall; +import com.iformall.domain.po.WxMerchant; +import com.iformall.domain.po.WxMerchantOcrModel; +import com.iformall.domain.po.WxOcrModel; +import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.po.base.BaseEntity.SortField; +import com.iformall.enums.EnumFromType; +import com.iformall.enums.EnumRentStartType; +import com.iformall.ocr.FormallTess4j; +import com.iformall.ocr.FormallTess4jTrain; +import com.iformall.service.WxMallService; +import com.iformall.service.WxMerchantService; +import com.iformall.service.WxOcrService; + +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Date; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +@RestController +@RequestMapping("ocr") +public class WxOcrController extends BaseController { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + private WxOcrService ocrService; + @Autowired + private WxMerchantService merchantService; + @Autowired + private String ocrData; + + /** + * 模板列表 + * @param wxRentContract + * @param pageNum + * @param pageSize + * @return + */ + @GetMapping("/modelList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) + public ResultData modelList(@ModelAttribute WxOcrModel ocrModel, Integer pageNum, Integer pageSize) { + if (null == ocrModel) { + ocrModel = new WxOcrModel(); + } + ocrModel.setSortColumns(SortField.Createtime_DESC); + PageInfo page = ocrService.listOcrModelAsPage(ocrModel, pageNum, pageSize); + return new ResultData(page); + } + + /** + * 更新模板 + * @param wxRentContract + * @return + */ + @PostMapping("updateModel") + public ResultData updateModel(@RequestBody WxOcrModel ocrModel) { + return ocrService.saveOrUpdateOcrModel(ocrModel); + } + + /** + * 根据商户查询模板 + * @param wxRentContract + * @return + */ + @GetMapping("merchantModel") + @ApiImplicitParams({ + @ApiImplicitParam(name = "merchantId", value = "商户编号", dataType = "Long", paramType = "query", required = true) + }) + public ResultData merchantModel(Long merchantId) { + WxMerchant merchant = merchantService.getById(merchantId); + if (null == merchant) { + return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"商户数据不存在"); + } + return new ResultData(ocrService.getMerchantOcrModel(merchantId, merchant.getTenantId(), merchant.getParentTenantId())); + } + + /** + * 更新商户模板 + * @param wxRentContract + * @return + */ + @PostMapping("updateMerchantModel") + public ResultData updateMerchantModel(@RequestBody WxMerchantOcrModel merchantModel) { + return ocrService.saveOrUpdateMerchantOcrModel(merchantModel); + } + + /** + * 删除商户模板 + * @param wxRentContract + * @return + */ + @PostMapping("deleteMerchantModel") + public ResultData deleteMerchantModel(@RequestBody WxMerchantOcrModel merchantModel) { + return ocrService.deleteMerchantOcrModel(merchantModel.getId()); + } + + /** + * 获取训练步骤 + * @return + */ + @GetMapping("getTrainSteps") + @ApiImplicitParams({ + @ApiImplicitParam(name = "modelId", value = "模板编号", dataType = "Long", paramType = "query", required = true) + }) + public ResultData getTrainSteps(Long modelId) { + WxOcrModel model = ocrService.getOcrModelById(modelId); + if (null == model) { + return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"ocr模板不存在"); + } + return new ResultData(FormallTess4jTrain.getTrainSteps(model.getLangCode(), model.getFontName())); + } + + /** + *测试训练结果 + * @return + */ + @PostMapping(value = "/testTrain", consumes = "multipart/*", headers = "content-type=multipart/form-data") + public ResultData testTrain(@RequestParam("file") MultipartFile multiReq,@RequestParam("modelId") Long modelId) { + try { + WxOcrModel model = ocrService.getOcrModelById(modelId); + if (null == model) { + return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"ocr模板不存在"); + } + File file = multipartFileToFile(multiReq); + + String result = FormallTess4j.testDoOCR_File(ocrData, file, model.getFontName()); + + file.delete(); + + return new ResultData(result); + + } catch (Exception e) { + logger.error("testTrain error.",e); + return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR.getCode(),"解析失败。"+e.getMessage()); + } + } + + + private File multipartFileToFile(MultipartFile file) { + File toFile = null; + if (file.equals("") || file.getSize() <= 0) { + file = null; + } else { + InputStream ins = null; + try { + ins = file.getInputStream(); + toFile = new File(file.getOriginalFilename()); + inputStreamToFile(ins, toFile); + ins.close(); + } catch (IOException e) { + logger.error("multipartFileToFile error.",e); + }finally { + if (null != ins) { + try { + ins.close(); + } catch (IOException e) { + logger.error("multipartFileToFile error.",e); + } + } + } + } + return toFile; + } + + private void inputStreamToFile(InputStream ins, File file) { + OutputStream os = null; + try { + os = new FileOutputStream(file); + int bytesRead = 0; + byte[] buffer = new byte[8192]; + while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) { + os.write(buffer, 0, bytesRead); + } + os.close(); + ins.close(); + } catch (Exception e) { + logger.error("inputStreamToFile error.",e); + }finally { + if (null != os) { + try { + os.close(); + } catch (IOException e) { + logger.error("inputStreamToFile error.",e); + } + } + if (null != ins) { + try { + ins.close(); + } catch (IOException e) { + logger.error("inputStreamToFile error.",e); + } + } + } + } + + + +} diff --git a/mallinkSysAdmin/src/main/resources/application-dev.yml b/mallinkSysAdmin/src/main/resources/application-dev.yml index b86a317f0..d6c58379e 100644 --- a/mallinkSysAdmin/src/main/resources/application-dev.yml +++ b/mallinkSysAdmin/src/main/resources/application-dev.yml @@ -3,11 +3,7 @@ spring: include: rabbitMQ # JDBC datasource: -<<<<<<< HEAD - url: jdbc:mysql://202.165.179.86:3306/mallink_share?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true -======= url: jdbc:mysql://101.200.130.134:3306/mallink?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useUnicode=true&useSSL=false&useAffectedRows=true ->>>>>>> release_real_202010 username: root password: fm2020test type: com.alibaba.druid.pool.DruidDataSource @@ -160,11 +156,12 @@ jasypt: password: oRqdnDbK5pj3eMmB fm: - exception: false - exception_emails: houtaikaifa@iformall.com + exception: true + exception_emails: xuxiaohu@iformall.com deploy: 1 open: true upload_dir: /home/test/server/uploads/ + ocr_data: /root/ocr_data/ ueditor: config: config.json diff --git a/mallinkSysAdmin/src/main/resources/application-prod.yml b/mallinkSysAdmin/src/main/resources/application-prod.yml index 9edbe54a1..3cf2ecd0b 100644 --- a/mallinkSysAdmin/src/main/resources/application-prod.yml +++ b/mallinkSysAdmin/src/main/resources/application-prod.yml @@ -122,12 +122,14 @@ fm: deploy: 3 open: true upload_dir: /root/uploads/ + ocr_data: /root/ocr_data/ ueditor: config: config.json unified: true upload-path: ./upload/ url-prefix: "" + logging: level: diff --git a/mallinkSysAdmin/src/main/resources/application-test.yml-bak b/mallinkSysAdmin/src/main/resources/application-test.yml-bak index d560852c6..2bbf9ef4d 100644 --- a/mallinkSysAdmin/src/main/resources/application-test.yml-bak +++ b/mallinkSysAdmin/src/main/resources/application-test.yml-bak @@ -100,6 +100,7 @@ fm: deploy: 2 open: true upload_dir: /home/ec2-user/server/uploads/ + ocr_data: /home/ec2-user/server/ocr_data/ ueditor: config: config.json diff --git a/mallinkWebSocketServer/src/main/resources/application-dev.yml b/mallinkWebSocketServer/src/main/resources/application-dev.yml index 3d077efcd..8105d910f 100644 --- a/mallinkWebSocketServer/src/main/resources/application-dev.yml +++ b/mallinkWebSocketServer/src/main/resources/application-dev.yml @@ -155,8 +155,8 @@ jasypt: password: oRqdnDbK5pj3eMmB fm: - exception: false - exception_emails: houtaikaifa@iformall.com + exception: true + exception_emails: xuxiaohu@iformall.com deploy: 1 open: true upload_dir: /home/test/server/uploads/ diff --git a/pom.xml b/pom.xml index b4f017391..e26b008e2 100644 --- a/pom.xml +++ b/pom.xml @@ -11,6 +11,7 @@ 1.0 + mallinkOcr mybatis-multi-tenancy mallinkService mallinkCallback @@ -22,6 +23,7 @@ mallinkSchedule mallinkMQConsumer mallinkWebSocketServer + mallinkPublicApi @@ -394,6 +396,13 @@ 1.4 + + + com.twelvemonkeys.imageio + imageio-jpeg + 3.6 + +