Merge branch 'master' into xin
2 files added
14 files modified
| | |
| | | @Data |
| | | public class ProductAuditQueryCriteria { |
| | | |
| | | @NotNull |
| | | private String blurry; |
| | | |
| | | @ApiModelProperty(value = "商品ID") |
| | | private Long productId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String productName; |
| | | |
| | | @ApiModelProperty(value = "商品标题") |
| | | private String productTitle; |
| | | |
| | | private String createBy; |
| | | |
| | | @NotBlank |
| | | @ApiModelProperty(value = "类型") |
| | | private String type; |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.oying.modules.pc.product.domain.ProductAudit; |
| | | import com.oying.modules.pc.product.domain.dto.ProductAuditQueryCriteria; |
| | | import com.oying.modules.pc.product.view.ProductAuditView; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | @Mapper |
| | | public interface ProductAuditMapper extends BaseMapper<ProductAudit> { |
| | | |
| | | IPage<ProductAudit> findAll(@Param("criteria") ProductAuditQueryCriteria criteria, Page<Object> page); |
| | | IPage<ProductAuditView> findAll(@Param("criteria") ProductAuditQueryCriteria criteria, Page<Object> page); |
| | | |
| | | List<ProductAudit> findAll(@Param("criteria") ProductAuditQueryCriteria criteria); |
| | | List<ProductAuditView> findAll(@Param("criteria") ProductAuditQueryCriteria criteria); |
| | | } |
| | |
| | | return ResponseEntity.noContent().build(); |
| | | } |
| | | |
| | | @PutMapping(value = "/verdict") |
| | | @PostMapping(value = "/verdict") |
| | | @ApiOperation("处理审核") |
| | | public ResponseEntity<?> submitAuditVerdict(@RequestBody ProductAudit resources) { |
| | | auditService.processVerdict(resources); |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.oying.modules.pc.product.domain.ProductAudit; |
| | | import com.oying.modules.pc.product.domain.dto.ProductAuditQueryCriteria; |
| | | import com.oying.modules.pc.product.view.ProductAuditView; |
| | | import com.oying.utils.PageResult; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | * @param page 分页参数 |
| | | * @return PageResult |
| | | */ |
| | | PageResult<ProductAudit> queryAll(ProductAuditQueryCriteria criteria, Page<Object> page); |
| | | PageResult<ProductAuditView> queryAll(ProductAuditQueryCriteria criteria, Page<Object> page); |
| | | |
| | | /** |
| | | * 查询所有数据不分页 |
| | |
| | | * @param criteria 条件参数 |
| | | * @return List<StoreRevisionDto> |
| | | */ |
| | | List<ProductAudit> queryAll(ProductAuditQueryCriteria criteria); |
| | | List<ProductAuditView> queryAll(ProductAuditQueryCriteria criteria); |
| | | |
| | | /** |
| | | * 商品ID查询修订数据, |
| | |
| | | import com.oying.modules.pc.product.events.ProductAuditVerdictEvent; |
| | | import com.oying.modules.pc.product.mapper.ProductAuditMapper; |
| | | import com.oying.modules.pc.product.service.ProductAuditService; |
| | | import com.oying.modules.pc.product.view.ProductAuditView; |
| | | import com.oying.modules.pc.store.domain.StoreAudit; |
| | | import com.oying.utils.FileUtil; |
| | | import com.oying.utils.PageResult; |
| | |
| | | private final ProductAuditMapper productAuditMapper; |
| | | |
| | | @Override |
| | | public PageResult<ProductAudit> queryAll(ProductAuditQueryCriteria criteria, Page<Object> page) { |
| | | public PageResult<ProductAuditView> queryAll(ProductAuditQueryCriteria criteria, Page<Object> page) { |
| | | return PageUtil.toPage(productAuditMapper.findAll(criteria, page)); |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductAudit> queryAll(ProductAuditQueryCriteria criteria) { |
| | | public List<ProductAuditView> queryAll(ProductAuditQueryCriteria criteria) { |
| | | return productAuditMapper.findAll(criteria); |
| | | } |
| | | |
| New file |
| | |
| | | package com.oying.modules.pc.product.view; |
| | | |
| | | import com.oying.base.BaseEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description / |
| | | * @author lzp |
| | | * @date 2025-07-01 |
| | | **/ |
| | | @Getter |
| | | @Setter |
| | | public class ProductAuditView extends BaseEntity implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "商品ID") |
| | | private Long productId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String productName; |
| | | |
| | | @ApiModelProperty(value = "商品标题") |
| | | private String productTitle; |
| | | |
| | | @ApiModelProperty(value = "审核ID") |
| | | private Long auditId; |
| | | |
| | | @ApiModelProperty(value = "类型") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value = "审核状态") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "审核原因") |
| | | private String reason; |
| | | |
| | | @ApiModelProperty(value = "审核人") |
| | | private String auditor; |
| | | |
| | | @ApiModelProperty(value = "审核时间") |
| | | private Date auditTime; |
| | | |
| | | @ApiModelProperty(value = "审核内容") |
| | | private String data; |
| | | |
| | | } |
| | |
| | | @Data |
| | | public class StoreAuditQueryCriteria { |
| | | |
| | | @NotNull |
| | | @ApiModelProperty(value = "店铺ID") |
| | | private String blurry; |
| | | |
| | | private Long storeId; |
| | | |
| | | private String storeName; |
| | | |
| | | private String createBy; |
| | | |
| | | @NotBlank |
| | | @ApiModelProperty(value = "类型") |
| | | private String type; |
| | |
| | | import com.oying.modules.pc.store.domain.StoreAudit; |
| | | import com.oying.modules.pc.store.domain.dto.StoreAuditQueryCriteria; |
| | | import java.util.List; |
| | | |
| | | import com.oying.modules.pc.store.view.StoreAuditView; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | @Mapper |
| | | public interface StoreAuditMapper extends BaseMapper<StoreAudit> { |
| | | |
| | | IPage<StoreAudit> findAll(@Param("criteria") StoreAuditQueryCriteria criteria, Page<Object> page); |
| | | IPage<StoreAuditView> findAll(@Param("criteria") StoreAuditQueryCriteria criteria, Page<Object> page); |
| | | |
| | | List<StoreAudit> findAll(@Param("criteria") StoreAuditQueryCriteria criteria); |
| | | List<StoreAuditView> findAll(@Param("criteria") StoreAuditQueryCriteria criteria); |
| | | } |
| | |
| | | public ResponseEntity<?> updateAddress(@PathVariable("storeId") Long storeId, |
| | | @Validated(value = StoreFieldUpdateRequest.UpdateStoreAddressGroup.class) |
| | | @RequestBody StoreFieldUpdateRequest request) { |
| | | storeService.updateAddress(storeId, request.getAddress(), request.getVersion()); |
| | | storeService.updateAddress(storeId, request.getAddress(), request.getLongitude(), request.getLatitude(), request.getVersion()); |
| | | return ResponseEntity.noContent().build(); |
| | | } |
| | | |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.oying.modules.pc.store.view.StoreAuditView; |
| | | import com.oying.utils.PageResult; |
| | | |
| | | /** |
| | |
| | | * @param page 分页参数 |
| | | * @return PageResult |
| | | */ |
| | | PageResult<StoreAudit> queryAll(StoreAuditQueryCriteria criteria, Page<Object> page); |
| | | PageResult<StoreAuditView> queryAll(StoreAuditQueryCriteria criteria, Page<Object> page); |
| | | |
| | | /** |
| | | * 查询所有数据不分页 |
| | | * @param criteria 条件参数 |
| | | * @return List<StoreRevisionDto> |
| | | */ |
| | | List<StoreAudit> queryAll(StoreAuditQueryCriteria criteria); |
| | | List<StoreAuditView> queryAll(StoreAuditQueryCriteria criteria); |
| | | |
| | | /** |
| | | * 店铺ID查询修订数据, |
| | |
| | | |
| | | boolean updateContactPhone(Long storeId, String contactPhone, Long version); |
| | | |
| | | boolean updateAddress(Long storeId, String address, Long version); |
| | | boolean updateAddress(Long storeId, String address, Double longitude, Double latitude, Long version); |
| | | |
| | | boolean updateLocation(Long storeId, Double longitude, Double latitude, Long version); |
| | | |
| | |
| | | package com.oying.modules.pc.store.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.oying.modules.pc.store.events.StoreAuditVerdictEvent; |
| | | import com.oying.modules.pc.store.mapper.StoreAuditMapper; |
| | | import com.oying.modules.pc.store.service.StoreAuditService; |
| | | import com.oying.utils.FileUtil; |
| | | import com.oying.utils.PageResult; |
| | | import com.oying.utils.PageUtil; |
| | | import com.oying.modules.pc.store.view.StoreAuditView; |
| | | import com.oying.utils.*; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author lzp |
| | |
| | | private final StoreAuditMapper storeAuditMapper; |
| | | |
| | | @Override |
| | | public PageResult<StoreAudit> queryAll(StoreAuditQueryCriteria criteria, Page<Object> page) { |
| | | public PageResult<StoreAuditView> queryAll(StoreAuditQueryCriteria criteria, Page<Object> page) { |
| | | return PageUtil.toPage(storeAuditMapper.findAll(criteria, page)); |
| | | } |
| | | |
| | | @Override |
| | | public List<StoreAudit> queryAll(StoreAuditQueryCriteria criteria) { |
| | | public List<StoreAuditView> queryAll(StoreAuditQueryCriteria criteria) { |
| | | return storeAuditMapper.findAll(criteria); |
| | | } |
| | | |
| | |
| | | throw new BadRequestException("审核状态错误"); |
| | | } |
| | | existingAudit.copy(resources); |
| | | existingAudit.setAuditor(SecurityUtils.getCurrentUsername()); |
| | | existingAudit.setAuditTime(new Date()); |
| | | storeAuditMapper.updateById(existingAudit); |
| | | eventPublisher.publishEvent(new StoreAuditVerdictEvent(existingAudit.getAuditId())); |
| | | } |
| | |
| | | package com.oying.modules.pc.store.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateAddress(Long storeId, String address, Long version) { |
| | | public boolean updateAddress(Long storeId, String address, Double longitude, Double latitude, Long version) { |
| | | Store existingStore = this.getOrThrow(storeId, version); |
| | | LambdaUpdateWrapper<Store> wrapper = this.createLambdaUpdateWrapper(storeId, existingStore.getVersion()) |
| | | .set(Store::getAddress, address); |
| | | if (ObjectUtil.isNotEmpty(longitude)) { |
| | | wrapper.set(Store::getLongitude, longitude); |
| | | } |
| | | if (ObjectUtil.isNotEmpty(latitude)) { |
| | | wrapper.set(Store::getLatitude, latitude); |
| | | } |
| | | return update(wrapper); |
| | | } |
| | | |
| New file |
| | |
| | | package com.oying.modules.pc.store.view; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.bean.copier.CopyOptions; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.oying.base.BaseEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description / |
| | | * @author lzp |
| | | * @date 2025-07-01 |
| | | **/ |
| | | @Getter |
| | | @Setter |
| | | public class StoreAuditView extends BaseEntity implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "店铺ID") |
| | | private Long storeId; |
| | | |
| | | @ApiModelProperty(value = "店铺名称") |
| | | private String storeName; |
| | | |
| | | @ApiModelProperty(value = "审核ID") |
| | | private Long auditId; |
| | | |
| | | @ApiModelProperty(value = "类型") |
| | | private String type; |
| | | |
| | | @ApiModelProperty(value = "审核状态") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "审核原因") |
| | | private String reason; |
| | | |
| | | @ApiModelProperty(value = "审核人") |
| | | private String auditor; |
| | | |
| | | @ApiModelProperty(value = "审核时间") |
| | | private Date auditTime; |
| | | |
| | | @ApiModelProperty(value = "审核内容") |
| | | private String data; |
| | | |
| | | } |
| | |
| | | <result column="update_time" property="updateTime"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="JoinResultMap" type="com.oying.modules.pc.product.view.ProductAuditView"> |
| | | <result column="product_id" property="productId"/> |
| | | <result column="product_name" property="productName"/> |
| | | <result column="product_title" property="productTitle"/> |
| | | <result column="audit_id" property="auditId"/> |
| | | <result column="type" property="type"/> |
| | | <result column="status" property="status"/> |
| | | <result column="data" property="data"/> |
| | | <result column="reason" property="reason"/> |
| | | <result column="auditor" property="auditor"/> |
| | | <result column="audit_time" property="auditTime"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | audit_id, product_id, type, status, reason, auditor, audit_time, data, create_by, create_time, update_by, update_time |
| | | </sql> |
| | | |
| | | <select id="findAll" resultMap="BaseResultMap"> |
| | | <sql id="Join_Column_List"> |
| | | p.name as product_name, p.title as product_title, |
| | | pa.audit_id, pa.product_id, pa.type, pa.status, pa.reason, pa.auditor, pa.audit_time, pa.data, pa.create_by, pa.create_time, pa.update_by, pa.update_time |
| | | </sql> |
| | | |
| | | <select id="findAll" resultMap="JoinResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from pc_product_audit |
| | | <include refid="Join_Column_List"/> |
| | | from pc_product_audit as pa left join pc_product as p on pa.product_id = p.product_id |
| | | <where> |
| | | <if test="criteria.blurry != null and criteria.blurry != ''"> |
| | | and p.name like concat('%', #{criteria.blurry}, '%') |
| | | </if> |
| | | <if test="criteria.productName != null and criteria.productName != ''"> |
| | | and p.name like concat('%', #{criteria.productName}, '%') |
| | | </if> |
| | | <if test="criteria.blurry != null and criteria.blurry != ''"> |
| | | and p.title like concat('%', #{criteria.blurry}, '%') |
| | | </if> |
| | | <if test="criteria.productTitle != null and criteria.productTitle != ''"> |
| | | and p.title like concat('%', #{criteria.productTitle}, '%') |
| | | </if> |
| | | <if test="criteria.productId != null"> |
| | | and product_id = #{criteria.productId} |
| | | and pa.product_id = #{criteria.productId} |
| | | </if> |
| | | <if test="criteria.type != null and criteria.type != ''"> |
| | | and type = #{criteria.type} |
| | | and pa.type = #{criteria.type} |
| | | </if> |
| | | <if test="criteria.status != null"> |
| | | and status = #{criteria.status} |
| | | and pa.status = #{criteria.status} |
| | | </if> |
| | | <if test="criteria.createBy != null and criteria.createBy != ''"> |
| | | and pa.create_by = #{criteria.createBy} |
| | | </if> |
| | | </where> |
| | | order by audit_id desc |
| | | order by pa.audit_id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="update_time" property="updateTime"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="JoinResultMap" type="com.oying.modules.pc.store.view.StoreAuditView"> |
| | | <result column="store_name" property="storeName"/> |
| | | <result column="audit_id" property="auditId"/> |
| | | <result column="store_id" property="storeId"/> |
| | | <result column="type" property="type"/> |
| | | <result column="status" property="status"/> |
| | | <result column="data" property="data"/> |
| | | <result column="reason" property="reason"/> |
| | | <result column="auditor" property="auditor"/> |
| | | <result column="audit_time" property="auditTime"/> |
| | | <result column="create_by" property="createBy"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_by" property="updateBy"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | audit_id, store_id, type, status, reason, auditor, audit_time, data, create_by, create_time, update_by, update_time |
| | | </sql> |
| | | |
| | | <select id="findAll" resultMap="BaseResultMap"> |
| | | <sql id="Join_Column_List"> |
| | | s.store_name, |
| | | sa.audit_id, sa.store_id, sa.type, sa.status, sa.reason, sa.auditor, sa.audit_time, sa.data, sa.create_by, sa.create_time, sa.update_by, sa.update_time |
| | | </sql> |
| | | |
| | | <select id="findAll" resultMap="JoinResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from pc_store_audit |
| | | <include refid="Join_Column_List"/> |
| | | from pc_store_audit as sa left join pc_store s on sa.store_id = s.store_id |
| | | <where> |
| | | <if test="criteria.blurry != null and criteria.blurry != ''"> |
| | | and s.store_name like concat('%', #{criteria.blurry}, '%') |
| | | </if> |
| | | <if test="criteria.storeName != null and criteria.storeName != ''"> |
| | | and s.store_name like concat('%', #{criteria.storeName}, '%') |
| | | </if> |
| | | <if test="criteria.storeId != null"> |
| | | and store_id = #{criteria.storeId} |
| | | and sa.store_id = #{criteria.storeId} |
| | | </if> |
| | | <if test="criteria.type != null and criteria.type != ''"> |
| | | and type = #{criteria.type} |
| | | and sa.type = #{criteria.type} |
| | | </if> |
| | | <if test="criteria.status != null"> |
| | | and status = #{criteria.status} |
| | | and sa.status = #{criteria.status} |
| | | </if> |
| | | <if test="criteria.createBy != null and criteria.createBy != ''"> |
| | | and sa.create_by = #{criteria.createBy} |
| | | </if> |
| | | </where> |
| | | order by audit_id desc |
| | | order by sa.audit_id desc |
| | | </select> |
| | | </mapper> |