| @@ -6,19 +6,19 @@ | |||
| <sourceOutputDir name="target/generated-sources/annotations" /> | |||
| <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> | |||
| <outputRelativeToContentRoot value="true" /> | |||
| <module name="suimangVideo" /> | |||
| <module name="suimangOcr" /> | |||
| <module name="mallinkCApi" /> | |||
| <module name="mallinkService" /> | |||
| <module name="suimangSchedule" /> | |||
| <module name="suimangService" /> | |||
| <module name="mallinkBApi" /> | |||
| <module name="mallinkAdmin" /> | |||
| <module name="mallinkService" /> | |||
| <module name="suimangVideo" /> | |||
| <module name="suimangCApi" /> | |||
| <module name="suimangAdmin" /> | |||
| <module name="mallinkBApi" /> | |||
| <module name="suimangCallback" /> | |||
| <module name="suimangMQConsumer" /> | |||
| <module name="mallinkCApi" /> | |||
| <module name="suimangService" /> | |||
| <module name="suimang-mybatis" /> | |||
| <module name="suimangCallback" /> | |||
| </profile> | |||
| </annotationProcessing> | |||
| </component> | |||
| @@ -0,0 +1,144 @@ | |||
| package com.iformall.controller.sm; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| 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.WxCouponChannel; | |||
| import com.iformall.domain.po.WxGame; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.sm.MouldPatch; | |||
| import com.iformall.domain.po.sm.MouldPatchSign; | |||
| import com.iformall.enums.EnumGameStatus; | |||
| import com.iformall.service.sm.MouldPatchService; | |||
| import com.iformall.service.sm.MouldPatchSignService; | |||
| import com.iformall.service.util.CouponCacheUtils; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.List; | |||
| @RestController | |||
| @RequestMapping("mouldPatch") | |||
| @Api(description = "模板接口") | |||
| public class MouldPatchController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private MouldPatchService mouldPatchService; | |||
| @Autowired | |||
| private MouldPatchSignService mouldPatchSignService; | |||
| @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 MouldPatch record, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] MouldPatchController::list"); | |||
| if (record == null) record = new MouldPatch(); | |||
| record.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||
| final PageInfo<MouldPatch> page = mouldPatchService.listAsPage(record, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("saveOrUpdate") | |||
| @SystemControllerLog(description = "-新增") | |||
| public ResultData saveOrUpdate(@RequestBody MouldPatch record) { | |||
| logger.debug("[" + getIpAddr() + "] MouldPatchController::saveOrUpdate"); | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| if(record.getType() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"模板类型为空"); | |||
| } | |||
| mouldPatchService.saveOrUpdate(record); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("上/下架") | |||
| @PostMapping("updateOnline") | |||
| @SystemControllerLog(description = "上/下架") | |||
| public ResultData updateOnline(@RequestBody MouldPatch record) { | |||
| logger.debug("[" + getIpAddr() + "] MouldPatchController::updateOnline"); | |||
| if(record.getId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"ID为空"); | |||
| } | |||
| if(record.getStatus() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"状态为空"); | |||
| } | |||
| mouldPatchService.updateOnline(record); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id删除接口") | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "删除") | |||
| public ResultData delete(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] MouldPatchController::delete"); | |||
| mouldPatchService.deleteById(id); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "查询") | |||
| public ResultData findById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] MouldPatchController::findById"); | |||
| MouldPatch mouldPatch = mouldPatchService.getById(id); | |||
| if(mouldPatch.getSceneSignList() != null && !mouldPatch.getSceneSignList().isEmpty()){ | |||
| MouldPatchSign signQ = new MouldPatchSign(); | |||
| signQ.setIds(mouldPatch.getSceneSignList()); | |||
| List<MouldPatchSign> signList = mouldPatchSignService.getList(signQ); | |||
| mouldPatch.setMouldPatchSign(signList); | |||
| } | |||
| return new ResultData(mouldPatch); | |||
| } | |||
| @ApiOperation("列表接口") | |||
| @GetMapping("signlist") | |||
| @ApiImplicitParams({}) | |||
| public ResultData signlist(@ModelAttribute MouldPatchSign record, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] MouldPatchController::signlist"); | |||
| if (record == null) record = new MouldPatchSign(); | |||
| record.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||
| final PageInfo<MouldPatchSign> page = mouldPatchSignService.listAsPage(record, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("saveOrUpdateSign") | |||
| @SystemControllerLog(description = "-新增") | |||
| public ResultData saveOrUpdateSign(@RequestBody MouldPatchSign record) { | |||
| logger.debug("[" + getIpAddr() + "] MouldPatchController::saveOrUpdateSign"); | |||
| if(StringUtils.isBlank(record.getTitle())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"标签为空"); | |||
| } | |||
| mouldPatchSignService.saveOrUpdate(record); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id删除接口") | |||
| @GetMapping("/signDel") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| @SystemControllerLog(description = "删除") | |||
| public ResultData signDel(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] MouldPatchController::signDel"); | |||
| mouldPatchSignService.deleteById(id); | |||
| return new ResultData(); | |||
| } | |||
| } | |||
| @@ -0,0 +1,67 @@ | |||
| package com.iformall.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.sm.MouldPatch; | |||
| import com.iformall.domain.po.sm.MouldPatchSign; | |||
| import com.iformall.enums.EnumMouldSendType; | |||
| import com.iformall.enums.EnumaMouldPatchStatus; | |||
| import com.iformall.service.sm.MouldPatchService; | |||
| import com.iformall.service.sm.MouldPatchSignService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.List; | |||
| @RestController | |||
| @RequestMapping("mouldPatch") | |||
| @Api(description = "模板接口") | |||
| public class MouldPatchController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private MouldPatchService mouldPatchService; | |||
| @Autowired | |||
| private MouldPatchSignService mouldPatchSignService; | |||
| @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 MouldPatch record, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] MouldPatchController::list"); | |||
| if (record == null) record = new MouldPatch(); | |||
| record.setSendType(EnumMouldSendType.auto.getCode()); | |||
| record.setStatus(EnumaMouldPatchStatus.put_on.getCode()); | |||
| record.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); | |||
| final PageInfo<MouldPatch> page = mouldPatchService.listAsPage(record, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData findById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] MouldPatchController::findById"); | |||
| MouldPatch mouldPatch = mouldPatchService.getById(id); | |||
| if(mouldPatch.getSceneSignList() != null && !mouldPatch.getSceneSignList().isEmpty()){ | |||
| MouldPatchSign signQ = new MouldPatchSign(); | |||
| signQ.setIds(mouldPatch.getSceneSignList()); | |||
| List<MouldPatchSign> signList = mouldPatchSignService.getList(signQ); | |||
| mouldPatch.setMouldPatchSign(signList); | |||
| } | |||
| return new ResultData(mouldPatch); | |||
| } | |||
| } | |||
| @@ -0,0 +1,120 @@ | |||
| package com.iformall.domain.po.sm; | |||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.common.SortColumn; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import java.math.BigDecimal; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @TableName(value = "mould_patch") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class MouldPatch extends TenantEntity { | |||
| protected Long id; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "sale_price") | |||
| private String salePriceStr; | |||
| @TableField(exist = false) | |||
| @SortColumn(column = "price") | |||
| private String priceStr; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-起始时间",name="startdate") | |||
| private Date startdate; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-结束时间",name="enddate") | |||
| private Date enddate; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumMouldPatchType",name="type") | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | |||
| private String coverImg; | |||
| @io.swagger.annotations.ApiModelProperty(value="多封面图",name="coverPicture") | |||
| private String coverPicture; | |||
| @io.swagger.annotations.ApiModelProperty(value="详情多图",name="detailPicture") | |||
| private String detailPicture; | |||
| @io.swagger.annotations.ApiModelProperty(value="名称",name="title") | |||
| @Excel(name="名称",width = 20,orderNum = "1") | |||
| private String title; | |||
| @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | |||
| private String subTitle; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumSex",name="sex") | |||
| private Integer sex; | |||
| @io.swagger.annotations.ApiModelProperty(value="年龄",name="age") | |||
| private Integer age; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumColour",name="colour") | |||
| private Integer colour; | |||
| @io.swagger.annotations.ApiModelProperty(value="标签",name="sceneSign") | |||
| private String sceneSign; | |||
| @TableField(exist = false) | |||
| private List<Long> sceneSignList; | |||
| public List<Long> getSceneSignList(){ | |||
| if(StringUtils.isNotBlank(this.getSceneSign())){ | |||
| try{ | |||
| List<Long> longs = JSONObject.parseArray(this.getSceneSign(), Long.class); | |||
| return longs; | |||
| }catch(Exception e){ | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| @TableField(exist = false) | |||
| private List<MouldPatchSign> mouldPatchSign; | |||
| @io.swagger.annotations.ApiModelProperty(value="售价",name="salePrice") | |||
| @Excel(name="售价(分)",width = 20,orderNum = "3") | |||
| private Integer salePrice; | |||
| @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") | |||
| private String detail; | |||
| @io.swagger.annotations.ApiModelProperty(value="原价",name="price") | |||
| @Excel(name="原价(分)",width = 20,orderNum = "2") | |||
| private Integer price; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumMouldSendType 1.系统模板",name="sendType") | |||
| private Integer sendType; | |||
| @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") | |||
| private String remark; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumaMouldPatchStatus 状态(-1:全部,0:草稿/待生效,1:已生效,2:已失效,3:已作废)",name="status") | |||
| private Integer status; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| public String getSalePriceStr() { | |||
| if(salePrice!=null) { | |||
| salePriceStr = new BigDecimal(salePrice).divide(new BigDecimal(100)).toString(); | |||
| } | |||
| return salePriceStr; | |||
| } | |||
| public String getPriceStr() { | |||
| if(price!=null) { | |||
| priceStr = new BigDecimal(price).divide(new BigDecimal(100)).toString(); | |||
| } | |||
| return priceStr; | |||
| } | |||
| } | |||
| @@ -0,0 +1,25 @@ | |||
| package com.iformall.domain.po.sm; | |||
| 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 = "mould_patch_sign") | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class MouldPatchSign extends BaseEntity { | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="券类型",name="title") | |||
| private String title; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| } | |||
| @@ -0,0 +1,40 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * 肤色 | |||
| */ | |||
| public enum EnumColour { | |||
| white(1, "白皮肤"), | |||
| yellow(2, "黄皮肤"), | |||
| black(3,"黑皮肤"), | |||
| ; | |||
| private EnumColour(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| public void setMessage(String message) { | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public void setCode(Integer code) { | |||
| this.code = code; | |||
| } | |||
| } | |||
| @@ -0,0 +1,52 @@ | |||
| package com.iformall.enums; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| /** | |||
| * | |||
| */ | |||
| public enum EnumMouldPatchType { | |||
| // 1:视频模板,2:声音模板,3:身体模板,4:背景模板 | |||
| video_mould(1, "视频模板"), | |||
| voice_mould(2, "声音模板"), | |||
| body_mould(3, "身体模板"), | |||
| background_mould(4, "背景模板"), | |||
| ; | |||
| public static EnumMouldPatchType getEnum(Integer code) { | |||
| for (EnumMouldPatchType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static List<Integer> getAllCodes(){ | |||
| List<Integer> codes = new ArrayList<>(); | |||
| for (EnumMouldPatchType value : values()) { | |||
| codes.add(value.getCode()); | |||
| } | |||
| return codes; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumMouldPatchType(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,36 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * | |||
| */ | |||
| public enum EnumMouldSendType { | |||
| auto(1,"系统模板"), | |||
| buy(2, "收费模板"), | |||
| ; | |||
| public static EnumMouldSendType getEnum(Integer code) { | |||
| for (EnumMouldSendType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumMouldSendType(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -1,13 +1,14 @@ | |||
| package com.iformall.enums; | |||
| public enum EnumCUserBaseInfoSex { | |||
| public enum EnumSex { | |||
| UNKNOWN(0, "保密"), | |||
| MALE(1, "男"), | |||
| FEMALE(2,"女"), | |||
| ; | |||
| private EnumCUserBaseInfoSex(Integer code, String message) { | |||
| private EnumSex(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| @@ -0,0 +1,38 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * | |||
| */ | |||
| public enum EnumaMouldPatchStatus { | |||
| // | |||
| draft(0, "草稿"), | |||
| put_on(1, "已上架"), | |||
| put_off(2, "已下架"), | |||
| ; | |||
| public static EnumaMouldPatchStatus getEnum(Integer code) { | |||
| for (EnumaMouldPatchStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumaMouldPatchStatus(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,22 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.sm.MouldPatch; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| public interface MouldPatchMapper extends CommonMapper<MouldPatch, Long> { | |||
| List<MouldPatch> findList(MouldPatch record); | |||
| int deleteById(@Param("id")Long id); | |||
| /** | |||
| * c端列表查询,尽量减少字段 | |||
| * @param record | |||
| * @return | |||
| */ | |||
| List<MouldPatch> findCList(MouldPatch record); | |||
| } | |||
| @@ -0,0 +1,15 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.sm.MouldPatchSign; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| public interface MouldPatchSignMapper extends CommonMapper<MouldPatchSign, String> { | |||
| List<MouldPatchSign> findList(MouldPatchSign record); | |||
| int deleteById(@Param("id")Long id); | |||
| } | |||
| @@ -1,28 +1,19 @@ | |||
| package com.iformall.service.helper; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxCUserBasicTagVo; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.WxCUserTagsService; | |||
| import com.iformall.service.WxTagsService; | |||
| import com.iformall.service.tags.TagsDeveloper; | |||
| import com.iformall.utils.DateUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.math.BigDecimal; | |||
| import java.math.RoundingMode; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.*; | |||
| import java.util.regex.Pattern; | |||
| @@ -183,9 +174,9 @@ public class WxCUserTagsServiceHelper{ | |||
| //类型打标 | |||
| public List<WxTags> assignTypeId1(WxCUserBasicInfo user, Integer sex, WxCUserTagsService wxCUserTagsService) { | |||
| List<WxTags> resList = null; | |||
| if (sex.equals(EnumCUserBaseInfoSex.MALE.getCode())) | |||
| if (sex.equals(EnumSex.MALE.getCode())) | |||
| resList = assign(user, EnumTag.ID_1,wxCUserTagsService); | |||
| if (sex.equals(EnumCUserBaseInfoSex.FEMALE.getCode())) | |||
| if (sex.equals(EnumSex.FEMALE.getCode())) | |||
| resList = assign(user, EnumTag.ID_2,wxCUserTagsService); | |||
| return resList; | |||
| } | |||
| @@ -12,20 +12,14 @@ 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.douyin.payv2.request.TtPayUnifiedOrderV2Request; | |||
| import com.iformall.douyin.payv2.result.TtPayOrderQueryV2Result; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.pay.*; | |||
| import com.iformall.service.*; | |||
| import com.iformall.service.helper.WxPayOrderServiceHelper; | |||
| import com.iformall.service.order.OrderAdapterService; | |||
| import com.iformall.service.order.OrderFactory; | |||
| import com.iformall.service.order.entity.WxComposeChildOrderPrice; | |||
| import com.iformall.service.order.entity.WxComposeChildOrderShare; | |||
| import com.iformall.service.order.entity.WxComposeOrder; | |||
| import com.iformall.service.order.util.OrderHelper; | |||
| import com.iformall.service.pay.PayServiceFactory; | |||
| import com.iformall.service.pay.entity.PayExtraParam; | |||
| import com.iformall.service.pay.service.pay.CDrivingPayService; | |||
| @@ -35,11 +29,9 @@ import com.iformall.service.pay.service.pay.entity.CreateUser; | |||
| import com.iformall.service.pay.service.pay.entity.PayAdapterResult; | |||
| import com.iformall.service.pay.service.pay.entity.PayQueryAdapterResult; | |||
| import com.iformall.service.pay.service.share.PayShareAdapterService; | |||
| import com.iformall.service.pay.service.share.entity.PayShareCalculateAmount; | |||
| import com.iformall.service.pay.service.share.entity.ShareNotifyAdapterResult; | |||
| import com.iformall.utils.*; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.flowable.job.service.JobHandler; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.aop.framework.AopContext; | |||
| @@ -1076,7 +1068,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| basicInfo.setId(basicUserId); | |||
| basicInfo.setPhone("1111111"+record.getTenantId()); | |||
| basicInfo.setNickName("商场["+record.getTenantId()+"]B端扫C端码支付专用账户"); | |||
| basicInfo.setSex(EnumCUserBaseInfoSex.UNKNOWN.getCode()); | |||
| basicInfo.setSex(EnumSex.UNKNOWN.getCode()); | |||
| basicInfo.setFinalTenantId(record.getFinalTenantId()); | |||
| basicInfo.setCreateDate(new Date()); | |||
| int count = wxCUserBasicInfoMapper.insert(basicInfo); | |||
| @@ -0,0 +1,53 @@ | |||
| package com.iformall.service.sm; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.sm.MouldPatch; | |||
| import com.iformall.domain.vo.WxCouponCVo; | |||
| import com.iformall.domain.vo.WxCouponStatisVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| public interface MouldPatchService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<MouldPatch> listAsPage(MouldPatch record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| MouldPatch getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| ResultData saveOrUpdate(MouldPatch record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| void updateOnline(MouldPatch record); | |||
| } | |||
| @@ -0,0 +1,50 @@ | |||
| package com.iformall.service.sm; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxCouponType; | |||
| import com.iformall.domain.po.sm.MouldPatchSign; | |||
| import java.util.List; | |||
| public interface MouldPatchSignService { | |||
| List<MouldPatchSign> getList(MouldPatchSign record); | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @return | |||
| */ | |||
| PageInfo<MouldPatchSign> listAsPage(MouldPatchSign record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| MouldPatchSign getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(MouldPatchSign record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| } | |||
| @@ -0,0 +1,90 @@ | |||
| package com.iformall.service.sm.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.sm.MouldPatch; | |||
| import com.iformall.enums.EnumCouponStatus; | |||
| import com.iformall.enums.EnumMouldSendType; | |||
| import com.iformall.enums.EnumaMouldPatchStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.sm.MouldPatchService; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.math.BigDecimal; | |||
| import java.util.*; | |||
| @Service | |||
| public class MouldPatchServiceImpl implements MouldPatchService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| MouldPatchMapper mouldPatchMapper; | |||
| @Override | |||
| public PageInfo<MouldPatch> listAsPage(MouldPatch record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> mouldPatchMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public MouldPatch getById(Long id) { | |||
| return mouldPatchMapper.selectById(id); | |||
| } | |||
| @Override | |||
| public ResultData saveOrUpdate(MouldPatch record) { | |||
| //金额处理 | |||
| if (StringUtils.isNotEmpty(record.getSalePriceStr())) { | |||
| record.setSalePrice(new BigDecimal(record.getSalePriceStr()).multiply(new BigDecimal(100)).intValue()); | |||
| } | |||
| if(record.getSalePrice() > 0){ | |||
| record.setSendType(EnumMouldSendType.buy.getCode()); | |||
| }else{ | |||
| record.setSendType(EnumMouldSendType.auto.getCode()); | |||
| } | |||
| if (StringUtils.isNotEmpty(record.getPriceStr())) { | |||
| record.setPrice(new BigDecimal(record.getPriceStr()).multiply(new BigDecimal(100)).intValue()); | |||
| } | |||
| Date now = new Date(); | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| if(record.getStatus() == null){ | |||
| record.setStatus(EnumaMouldPatchStatus.draft.getCode()); | |||
| } | |||
| record.setCreateDate(now); | |||
| record.setUpdateDate(now); | |||
| mouldPatchMapper.insert(record); | |||
| } else { | |||
| record.setUpdateDate(now); | |||
| mouldPatchMapper.updateById(record); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| mouldPatchMapper.deleteById(id); | |||
| } | |||
| @Override | |||
| public void updateOnline(MouldPatch record) { | |||
| MouldPatch mouldPatchUpd = new MouldPatch(); | |||
| mouldPatchUpd.setId(record.getId()); | |||
| mouldPatchUpd.setStatus(record.getStatus()); | |||
| mouldPatchUpd.setUpdateDate(new Date()); | |||
| mouldPatchMapper.updateById(mouldPatchUpd); | |||
| } | |||
| } | |||
| @@ -0,0 +1,61 @@ | |||
| package com.iformall.service.sm.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.sm.MouldPatchSign; | |||
| import com.iformall.mapper.MouldPatchSignMapper; | |||
| import com.iformall.service.sm.MouldPatchSignService; | |||
| 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 MouldPatchSignServiceImpl implements MouldPatchSignService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| MouldPatchSignMapper mouldPatchSignMapper; | |||
| @Override | |||
| public List<MouldPatchSign> getList(MouldPatchSign record) { | |||
| return mouldPatchSignMapper.findList(record); | |||
| } | |||
| @Override | |||
| public PageInfo<MouldPatchSign> listAsPage(MouldPatchSign record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> mouldPatchSignMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public MouldPatchSign getById(Long id) { | |||
| return mouldPatchSignMapper.selectById(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(MouldPatchSign record) { | |||
| Date now = new Date(); | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| record.setCreateDate(now); | |||
| record.setUpdateDate(now); | |||
| mouldPatchSignMapper.insert(record); | |||
| } else { | |||
| record.setUpdateDate(now); | |||
| mouldPatchSignMapper.updateById(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| mouldPatchSignMapper.deleteById(id); | |||
| } | |||
| } | |||
| @@ -0,0 +1,127 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.MouldPatchMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.sm.MouldPatch"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="cover_img" jdbcType="VARCHAR" property="coverImg"/> | |||
| <result column="cover_picture" jdbcType="VARCHAR" property="coverPicture"/> | |||
| <result column="detail_picture" jdbcType="VARCHAR" property="detailPicture"/> | |||
| <result column="title" jdbcType="VARCHAR" property="title"/> | |||
| <result column="sub_title" jdbcType="VARCHAR" property="subTitle"/> | |||
| <result column="sex" jdbcType="INTEGER" property="sex"/> | |||
| <result column="age" jdbcType="INTEGER" property="age"/> | |||
| <result column="colour" jdbcType="INTEGER" property="colour"/> | |||
| <result column="scene_sign" jdbcType="VARCHAR" property="sceneSign"/> | |||
| <result column="sale_price" jdbcType="INTEGER" property="salePrice"/> | |||
| <result column="price" jdbcType="INTEGER" property="price"/> | |||
| <result column="send_type" jdbcType="INTEGER" property="sendType"/> | |||
| <result column="detail" jdbcType="VARCHAR" property="detail"/> | |||
| <result column="remark" jdbcType="VARCHAR" property="remark"/> | |||
| <result column="mould_path" jdbcType="VARCHAR" property="mouldPath"/> | |||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`, `tenant_id`, `parent_tenant_id`, `type`, `cover_img`, `cover_picture`, `detail_picture`, | |||
| `title`, `sub_title`, `sex`, `age`, `colour`, `scene_sign`, `sale_price`, `price`, | |||
| `send_type`, `detail`, `remark`, `mould_path`, `status`, `create_date`, `update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where `is_del` = 0 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != title and ''!=title"> | |||
| and `title` like concat('%', #{title},'%') | |||
| </if> | |||
| <if test=" null != subTitle "> | |||
| and `sub_title` like concat('%', #{subTitle},'%') | |||
| </if> | |||
| <if test=" null != sex "> | |||
| and `sex` = #{sex} | |||
| </if> | |||
| <if test=" null != age "> | |||
| and `age` = #{age} | |||
| </if> | |||
| <if test=" null != sex "> | |||
| and `colour` = #{colour} | |||
| </if> | |||
| <if test=" null != sceneSign and '' != sceneSign"> | |||
| and JSON_CONTAINS(scene_sign,json_array(#{sceneSign})) | |||
| </if> | |||
| <if test=" null != salePrice "> | |||
| and `sale_price` = #{salePrice} | |||
| </if> | |||
| <if test=" null != sendType "> | |||
| and `send_type` = #{sendType} | |||
| </if> | |||
| <if test=" null != price "> | |||
| and `price` = #{price} | |||
| </if> | |||
| <if test=" null != status"> | |||
| and `status` = #{status} | |||
| </if> | |||
| <if test=" null != startdate and null!=enddate"> | |||
| and `create_date` between #{startdate} and #{enddate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.sm.MouldPatch" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from mould_patch | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <delete id="deleteById" parameterType="java.util.HashMap"> | |||
| update mould_patch set is_del = 1,update_date = now() where id = #{id} | |||
| </delete> | |||
| <select id="findCList" parameterType="com.iformall.domain.po.sm.MouldPatch" resultMap="BaseResultMap"> | |||
| select | |||
| `id``type`, `cover_img`, `cover_picture`, | |||
| `title`, `sub_title`, `sex`, `age`, `colour`, `scene_sign`, `sale_price`, `price`, | |||
| `send_type`, `status`, `create_date`, `update_date` | |||
| from mould_patch | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,43 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.MouldPatchSignMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.sm.MouldPatchSign"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="title" jdbcType="VARCHAR" property="title" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`title` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where `is_del` = 0 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != title "> | |||
| and `title` like concat('%', #{title},'%') | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.sm.MouldPatchSign" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from mould_patch_sign | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <delete id="deleteById" parameterType="java.util.HashMap"> | |||
| update mould_patch_sign set is_del = 1,update_date = now() where id = #{id} | |||
| </delete> | |||
| </mapper> | |||