29 changed files with 2233 additions and 374 deletions
-
104chenhai-admin/src/main/java/com/chenhai/web/controller/vet/MerchantInfoController.java
-
307chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetExperienceArticleController.java
-
6chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetKnowledgeController.java
-
3chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetNotificationController.java
-
6chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetPersonalInfoController.java
-
31chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetProductController.java
-
77chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetQualificationController.java
-
1chenhai-admin/src/main/java/com/chenhai/web/controller/vet/VetTrainingVideoController.java
-
406chenhai-system/src/main/java/com/chenhai/vet/CertificateRemindTask.java
-
146chenhai-system/src/main/java/com/chenhai/vet/domain/MerchantInfo.java
-
236chenhai-system/src/main/java/com/chenhai/vet/domain/VetExperienceArticle.java
-
61chenhai-system/src/main/java/com/chenhai/vet/mapper/MerchantInfoMapper.java
-
2chenhai-system/src/main/java/com/chenhai/vet/mapper/VetExperienceArticleMapper.java
-
2chenhai-system/src/main/java/com/chenhai/vet/mapper/VetQualificationMapper.java
-
61chenhai-system/src/main/java/com/chenhai/vet/service/IMerchantInfoService.java
-
10chenhai-system/src/main/java/com/chenhai/vet/service/IVetExperienceArticleService.java
-
8chenhai-system/src/main/java/com/chenhai/vet/service/IVetProductService.java
-
2chenhai-system/src/main/java/com/chenhai/vet/service/IVetQualificationService.java
-
93chenhai-system/src/main/java/com/chenhai/vet/service/impl/MerchantInfoServiceImpl.java
-
51chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetExperienceArticleServiceImpl.java
-
1chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetKnowledgeServiceImpl.java
-
186chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetNotificationServiceImpl.java
-
23chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetProductServiceImpl.java
-
150chenhai-system/src/main/java/com/chenhai/vet/service/impl/VetQualificationServiceImpl.java
-
86chenhai-system/src/main/resources/mapper/vet/MerchantInfoMapper.xml
-
137chenhai-system/src/main/resources/mapper/vet/VetExperienceArticleMapper.xml
-
5chenhai-system/src/main/resources/mapper/vet/VetQualificationMapper.xml
-
44chenhai-ui/src/api/vet/merchant.js
-
362chenhai-ui/src/views/vet/merchant/index.vue
@ -0,0 +1,104 @@ |
|||||
|
package com.chenhai.web.controller.vet; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import jakarta.servlet.http.HttpServletResponse; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.PutMapping; |
||||
|
import org.springframework.web.bind.annotation.DeleteMapping; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
import com.chenhai.common.annotation.Log; |
||||
|
import com.chenhai.common.core.controller.BaseController; |
||||
|
import com.chenhai.common.core.domain.AjaxResult; |
||||
|
import com.chenhai.common.enums.BusinessType; |
||||
|
import com.chenhai.vet.domain.MerchantInfo; |
||||
|
import com.chenhai.vet.service.IMerchantInfoService; |
||||
|
import com.chenhai.common.utils.poi.ExcelUtil; |
||||
|
import com.chenhai.common.core.page.TableDataInfo; |
||||
|
|
||||
|
/** |
||||
|
* 商家信息Controller |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2026-02-04 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/vet/merchant") |
||||
|
public class MerchantInfoController extends BaseController |
||||
|
{ |
||||
|
@Autowired |
||||
|
private IMerchantInfoService merchantInfoService; |
||||
|
|
||||
|
/** |
||||
|
* 查询商家信息列表 |
||||
|
*/ |
||||
|
@PreAuthorize("@ss.hasPermi('vet:merchant:list')") |
||||
|
@GetMapping("/list") |
||||
|
public TableDataInfo list(MerchantInfo merchantInfo) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<MerchantInfo> list = merchantInfoService.selectMerchantInfoList(merchantInfo); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出商家信息列表 |
||||
|
*/ |
||||
|
@PreAuthorize("@ss.hasPermi('vet:merchant:export')") |
||||
|
@Log(title = "商家信息", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
public void export(HttpServletResponse response, MerchantInfo merchantInfo) |
||||
|
{ |
||||
|
List<MerchantInfo> list = merchantInfoService.selectMerchantInfoList(merchantInfo); |
||||
|
ExcelUtil<MerchantInfo> util = new ExcelUtil<MerchantInfo>(MerchantInfo.class); |
||||
|
util.exportExcel(response, list, "商家信息数据"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取商家信息详细信息 |
||||
|
*/ |
||||
|
@PreAuthorize("@ss.hasPermi('vet:merchant:query')") |
||||
|
@GetMapping(value = "/{shopId}") |
||||
|
public AjaxResult getInfo(@PathVariable("shopId") Long shopId) |
||||
|
{ |
||||
|
return success(merchantInfoService.selectMerchantInfoByShopId(shopId)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增商家信息 |
||||
|
*/ |
||||
|
@PreAuthorize("@ss.hasPermi('vet:merchant:add')") |
||||
|
@Log(title = "商家信息", businessType = BusinessType.INSERT) |
||||
|
@PostMapping |
||||
|
public AjaxResult add(@RequestBody MerchantInfo merchantInfo) |
||||
|
{ |
||||
|
return toAjax(merchantInfoService.insertMerchantInfo(merchantInfo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改商家信息 |
||||
|
*/ |
||||
|
@PreAuthorize("@ss.hasPermi('vet:merchant:edit')") |
||||
|
@Log(title = "商家信息", businessType = BusinessType.UPDATE) |
||||
|
@PutMapping |
||||
|
public AjaxResult edit(@RequestBody MerchantInfo merchantInfo) |
||||
|
{ |
||||
|
return toAjax(merchantInfoService.updateMerchantInfo(merchantInfo)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除商家信息 |
||||
|
*/ |
||||
|
@PreAuthorize("@ss.hasPermi('vet:merchant:remove')") |
||||
|
@Log(title = "商家信息", businessType = BusinessType.DELETE) |
||||
|
@DeleteMapping("/{shopIds}") |
||||
|
public AjaxResult remove(@PathVariable Long[] shopIds) |
||||
|
{ |
||||
|
return toAjax(merchantInfoService.deleteMerchantInfoByShopIds(shopIds)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,146 @@ |
|||||
|
package com.chenhai.vet.domain; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
import org.apache.commons.lang3.builder.ToStringStyle; |
||||
|
import com.chenhai.common.annotation.Excel; |
||||
|
import com.chenhai.common.core.domain.BaseEntity; |
||||
|
|
||||
|
/** |
||||
|
* 商家信息对象 merchant_info |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2026-02-04 |
||||
|
*/ |
||||
|
public class MerchantInfo extends BaseEntity |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** 店铺ID,主键 */ |
||||
|
private Long shopId; |
||||
|
|
||||
|
/** 店铺名称 */ |
||||
|
@Excel(name = "店铺名称") |
||||
|
private String shopName; |
||||
|
|
||||
|
/** 店铺地址 */ |
||||
|
@Excel(name = "店铺地址") |
||||
|
private String shopAddress; |
||||
|
|
||||
|
/** 联系电话 */ |
||||
|
@Excel(name = "联系电话") |
||||
|
private String phone; |
||||
|
|
||||
|
/** 关联用户ID(店主) */ |
||||
|
@Excel(name = "关联用户ID", readConverterExp = "店=主") |
||||
|
private Long userId; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||
|
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") |
||||
|
private Date createdAt; |
||||
|
|
||||
|
/** 更新时间 */ |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||
|
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd") |
||||
|
private Date updatedAt; |
||||
|
|
||||
|
/** 是否启用(1启用,0禁用) */ |
||||
|
@Excel(name = "是否启用", readConverterExp = "1=启用,0禁用") |
||||
|
private Integer isActive; |
||||
|
|
||||
|
public void setShopId(Long shopId) |
||||
|
{ |
||||
|
this.shopId = shopId; |
||||
|
} |
||||
|
|
||||
|
public Long getShopId() |
||||
|
{ |
||||
|
return shopId; |
||||
|
} |
||||
|
|
||||
|
public void setShopName(String shopName) |
||||
|
{ |
||||
|
this.shopName = shopName; |
||||
|
} |
||||
|
|
||||
|
public String getShopName() |
||||
|
{ |
||||
|
return shopName; |
||||
|
} |
||||
|
|
||||
|
public void setShopAddress(String shopAddress) |
||||
|
{ |
||||
|
this.shopAddress = shopAddress; |
||||
|
} |
||||
|
|
||||
|
public String getShopAddress() |
||||
|
{ |
||||
|
return shopAddress; |
||||
|
} |
||||
|
|
||||
|
public void setPhone(String phone) |
||||
|
{ |
||||
|
this.phone = phone; |
||||
|
} |
||||
|
|
||||
|
public String getPhone() |
||||
|
{ |
||||
|
return phone; |
||||
|
} |
||||
|
|
||||
|
public void setUserId(Long userId) |
||||
|
{ |
||||
|
this.userId = userId; |
||||
|
} |
||||
|
|
||||
|
public Long getUserId() |
||||
|
{ |
||||
|
return userId; |
||||
|
} |
||||
|
|
||||
|
public void setCreatedAt(Date createdAt) |
||||
|
{ |
||||
|
this.createdAt = createdAt; |
||||
|
} |
||||
|
|
||||
|
public Date getCreatedAt() |
||||
|
{ |
||||
|
return createdAt; |
||||
|
} |
||||
|
|
||||
|
public void setUpdatedAt(Date updatedAt) |
||||
|
{ |
||||
|
this.updatedAt = updatedAt; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdatedAt() |
||||
|
{ |
||||
|
return updatedAt; |
||||
|
} |
||||
|
|
||||
|
public void setIsActive(Integer isActive) |
||||
|
{ |
||||
|
this.isActive = isActive; |
||||
|
} |
||||
|
|
||||
|
public Integer getIsActive() |
||||
|
{ |
||||
|
return isActive; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
||||
|
.append("shopId", getShopId()) |
||||
|
.append("shopName", getShopName()) |
||||
|
.append("shopAddress", getShopAddress()) |
||||
|
.append("phone", getPhone()) |
||||
|
.append("userId", getUserId()) |
||||
|
.append("createdAt", getCreatedAt()) |
||||
|
.append("updatedAt", getUpdatedAt()) |
||||
|
.append("isActive", getIsActive()) |
||||
|
.toString(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,61 @@ |
|||||
|
package com.chenhai.vet.mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.chenhai.vet.domain.MerchantInfo; |
||||
|
|
||||
|
/** |
||||
|
* 商家信息Mapper接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2026-02-04 |
||||
|
*/ |
||||
|
public interface MerchantInfoMapper |
||||
|
{ |
||||
|
/** |
||||
|
* 查询商家信息 |
||||
|
* |
||||
|
* @param shopId 商家信息主键 |
||||
|
* @return 商家信息 |
||||
|
*/ |
||||
|
public MerchantInfo selectMerchantInfoByShopId(Long shopId); |
||||
|
|
||||
|
/** |
||||
|
* 查询商家信息列表 |
||||
|
* |
||||
|
* @param merchantInfo 商家信息 |
||||
|
* @return 商家信息集合 |
||||
|
*/ |
||||
|
public List<MerchantInfo> selectMerchantInfoList(MerchantInfo merchantInfo); |
||||
|
|
||||
|
/** |
||||
|
* 新增商家信息 |
||||
|
* |
||||
|
* @param merchantInfo 商家信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertMerchantInfo(MerchantInfo merchantInfo); |
||||
|
|
||||
|
/** |
||||
|
* 修改商家信息 |
||||
|
* |
||||
|
* @param merchantInfo 商家信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateMerchantInfo(MerchantInfo merchantInfo); |
||||
|
|
||||
|
/** |
||||
|
* 删除商家信息 |
||||
|
* |
||||
|
* @param shopId 商家信息主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteMerchantInfoByShopId(Long shopId); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除商家信息 |
||||
|
* |
||||
|
* @param shopIds 需要删除的数据主键集合 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteMerchantInfoByShopIds(Long[] shopIds); |
||||
|
} |
||||
@ -0,0 +1,61 @@ |
|||||
|
package com.chenhai.vet.service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.chenhai.vet.domain.MerchantInfo; |
||||
|
|
||||
|
/** |
||||
|
* 商家信息Service接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2026-02-04 |
||||
|
*/ |
||||
|
public interface IMerchantInfoService |
||||
|
{ |
||||
|
/** |
||||
|
* 查询商家信息 |
||||
|
* |
||||
|
* @param shopId 商家信息主键 |
||||
|
* @return 商家信息 |
||||
|
*/ |
||||
|
public MerchantInfo selectMerchantInfoByShopId(Long shopId); |
||||
|
|
||||
|
/** |
||||
|
* 查询商家信息列表 |
||||
|
* |
||||
|
* @param merchantInfo 商家信息 |
||||
|
* @return 商家信息集合 |
||||
|
*/ |
||||
|
public List<MerchantInfo> selectMerchantInfoList(MerchantInfo merchantInfo); |
||||
|
|
||||
|
/** |
||||
|
* 新增商家信息 |
||||
|
* |
||||
|
* @param merchantInfo 商家信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertMerchantInfo(MerchantInfo merchantInfo); |
||||
|
|
||||
|
/** |
||||
|
* 修改商家信息 |
||||
|
* |
||||
|
* @param merchantInfo 商家信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateMerchantInfo(MerchantInfo merchantInfo); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除商家信息 |
||||
|
* |
||||
|
* @param shopIds 需要删除的商家信息主键集合 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteMerchantInfoByShopIds(Long[] shopIds); |
||||
|
|
||||
|
/** |
||||
|
* 删除商家信息信息 |
||||
|
* |
||||
|
* @param shopId 商家信息主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteMerchantInfoByShopId(Long shopId); |
||||
|
} |
||||
@ -0,0 +1,93 @@ |
|||||
|
package com.chenhai.vet.service.impl; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.chenhai.vet.mapper.MerchantInfoMapper; |
||||
|
import com.chenhai.vet.domain.MerchantInfo; |
||||
|
import com.chenhai.vet.service.IMerchantInfoService; |
||||
|
|
||||
|
/** |
||||
|
* 商家信息Service业务层处理 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2026-02-04 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class MerchantInfoServiceImpl implements IMerchantInfoService |
||||
|
{ |
||||
|
@Autowired |
||||
|
private MerchantInfoMapper merchantInfoMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询商家信息 |
||||
|
* |
||||
|
* @param shopId 商家信息主键 |
||||
|
* @return 商家信息 |
||||
|
*/ |
||||
|
@Override |
||||
|
public MerchantInfo selectMerchantInfoByShopId(Long shopId) |
||||
|
{ |
||||
|
return merchantInfoMapper.selectMerchantInfoByShopId(shopId); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询商家信息列表 |
||||
|
* |
||||
|
* @param merchantInfo 商家信息 |
||||
|
* @return 商家信息 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<MerchantInfo> selectMerchantInfoList(MerchantInfo merchantInfo) |
||||
|
{ |
||||
|
return merchantInfoMapper.selectMerchantInfoList(merchantInfo); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增商家信息 |
||||
|
* |
||||
|
* @param merchantInfo 商家信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int insertMerchantInfo(MerchantInfo merchantInfo) |
||||
|
{ |
||||
|
return merchantInfoMapper.insertMerchantInfo(merchantInfo); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改商家信息 |
||||
|
* |
||||
|
* @param merchantInfo 商家信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int updateMerchantInfo(MerchantInfo merchantInfo) |
||||
|
{ |
||||
|
return merchantInfoMapper.updateMerchantInfo(merchantInfo); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 批量删除商家信息 |
||||
|
* |
||||
|
* @param shopIds 需要删除的商家信息主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteMerchantInfoByShopIds(Long[] shopIds) |
||||
|
{ |
||||
|
return merchantInfoMapper.deleteMerchantInfoByShopIds(shopIds); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除商家信息信息 |
||||
|
* |
||||
|
* @param shopId 商家信息主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteMerchantInfoByShopId(Long shopId) |
||||
|
{ |
||||
|
return merchantInfoMapper.deleteMerchantInfoByShopId(shopId); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,86 @@ |
|||||
|
<?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.chenhai.vet.mapper.MerchantInfoMapper"> |
||||
|
|
||||
|
<resultMap type="MerchantInfo" id="MerchantInfoResult"> |
||||
|
<result property="shopId" column="shop_id" /> |
||||
|
<result property="shopName" column="shop_name" /> |
||||
|
<result property="shopAddress" column="shop_address" /> |
||||
|
<result property="phone" column="phone" /> |
||||
|
<result property="userId" column="user_id" /> |
||||
|
<result property="createdAt" column="created_at" /> |
||||
|
<result property="updatedAt" column="updated_at" /> |
||||
|
<result property="isActive" column="is_active" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectMerchantInfoVo"> |
||||
|
select shop_id, shop_name, shop_address, phone, user_id, created_at, updated_at, is_active from merchant_info |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectMerchantInfoList" parameterType="MerchantInfo" resultMap="MerchantInfoResult"> |
||||
|
<include refid="selectMerchantInfoVo"/> |
||||
|
<where> |
||||
|
<if test="shopName != null and shopName != ''"> and shop_name like concat('%', #{shopName}, '%')</if> |
||||
|
<if test="shopAddress != null and shopAddress != ''"> and shop_address = #{shopAddress}</if> |
||||
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if> |
||||
|
<if test="userId != null "> and user_id = #{userId}</if> |
||||
|
<if test="createdAt != null "> and created_at = #{createdAt}</if> |
||||
|
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if> |
||||
|
<if test="isActive != null "> and is_active = #{isActive}</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectMerchantInfoByShopId" parameterType="Long" resultMap="MerchantInfoResult"> |
||||
|
<include refid="selectMerchantInfoVo"/> |
||||
|
where shop_id = #{shopId} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="insertMerchantInfo" parameterType="MerchantInfo" useGeneratedKeys="true" keyProperty="shopId"> |
||||
|
insert into merchant_info |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="shopName != null and shopName != ''">shop_name,</if> |
||||
|
<if test="shopAddress != null and shopAddress != ''">shop_address,</if> |
||||
|
<if test="phone != null">phone,</if> |
||||
|
<if test="userId != null">user_id,</if> |
||||
|
<if test="createdAt != null">created_at,</if> |
||||
|
<if test="updatedAt != null">updated_at,</if> |
||||
|
<if test="isActive != null">is_active,</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="shopName != null and shopName != ''">#{shopName},</if> |
||||
|
<if test="shopAddress != null and shopAddress != ''">#{shopAddress},</if> |
||||
|
<if test="phone != null">#{phone},</if> |
||||
|
<if test="userId != null">#{userId},</if> |
||||
|
<if test="createdAt != null">#{createdAt},</if> |
||||
|
<if test="updatedAt != null">#{updatedAt},</if> |
||||
|
<if test="isActive != null">#{isActive},</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateMerchantInfo" parameterType="MerchantInfo"> |
||||
|
update merchant_info |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="shopName != null and shopName != ''">shop_name = #{shopName},</if> |
||||
|
<if test="shopAddress != null and shopAddress != ''">shop_address = #{shopAddress},</if> |
||||
|
<if test="phone != null">phone = #{phone},</if> |
||||
|
<if test="userId != null">user_id = #{userId},</if> |
||||
|
<if test="createdAt != null">created_at = #{createdAt},</if> |
||||
|
<if test="updatedAt != null">updated_at = #{updatedAt},</if> |
||||
|
<if test="isActive != null">is_active = #{isActive},</if> |
||||
|
</trim> |
||||
|
where shop_id = #{shopId} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deleteMerchantInfoByShopId" parameterType="Long"> |
||||
|
delete from merchant_info where shop_id = #{shopId} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteMerchantInfoByShopIds" parameterType="String"> |
||||
|
delete from merchant_info where shop_id in |
||||
|
<foreach item="shopId" collection="array" open="(" separator="," close=")"> |
||||
|
#{shopId} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
</mapper> |
||||
@ -0,0 +1,44 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
// 查询商家信息列表
|
||||
|
export function listMerchant(query) { |
||||
|
return request({ |
||||
|
url: '/vet/merchant/list', |
||||
|
method: 'get', |
||||
|
params: query |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询商家信息详细
|
||||
|
export function getMerchant(shopId) { |
||||
|
return request({ |
||||
|
url: '/vet/merchant/' + shopId, |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 新增商家信息
|
||||
|
export function addMerchant(data) { |
||||
|
return request({ |
||||
|
url: '/vet/merchant', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 修改商家信息
|
||||
|
export function updateMerchant(data) { |
||||
|
return request({ |
||||
|
url: '/vet/merchant', |
||||
|
method: 'put', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 删除商家信息
|
||||
|
export function delMerchant(shopId) { |
||||
|
return request({ |
||||
|
url: '/vet/merchant/' + shopId, |
||||
|
method: 'delete' |
||||
|
}) |
||||
|
} |
||||
@ -0,0 +1,362 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
||||
|
<el-form-item label="店铺名称" prop="shopName"> |
||||
|
<el-input |
||||
|
v-model="queryParams.shopName" |
||||
|
placeholder="请输入店铺名称" |
||||
|
clearable |
||||
|
@keyup.enter.native="handleQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="店铺地址" prop="shopAddress"> |
||||
|
<el-input |
||||
|
v-model="queryParams.shopAddress" |
||||
|
placeholder="请输入店铺地址" |
||||
|
clearable |
||||
|
@keyup.enter.native="handleQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="联系电话" prop="phone"> |
||||
|
<el-input |
||||
|
v-model="queryParams.phone" |
||||
|
placeholder="请输入联系电话" |
||||
|
clearable |
||||
|
@keyup.enter.native="handleQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="关联用户ID" prop="userId"> |
||||
|
<el-input |
||||
|
v-model="queryParams.userId" |
||||
|
placeholder="请输入关联用户ID" |
||||
|
clearable |
||||
|
@keyup.enter.native="handleQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建时间" prop="createdAt"> |
||||
|
<el-date-picker clearable |
||||
|
v-model="queryParams.createdAt" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="请选择创建时间"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="更新时间" prop="updatedAt"> |
||||
|
<el-date-picker clearable |
||||
|
v-model="queryParams.updatedAt" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="请选择更新时间"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="是否启用" prop="isActive"> |
||||
|
<el-input |
||||
|
v-model="queryParams.isActive" |
||||
|
placeholder="请输入是否启用" |
||||
|
clearable |
||||
|
@keyup.enter.native="handleQuery" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item> |
||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<el-row :gutter="10" class="mb8"> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
plain |
||||
|
icon="el-icon-plus" |
||||
|
size="mini" |
||||
|
@click="handleAdd" |
||||
|
v-hasPermi="['vet:merchant:add']" |
||||
|
>新增</el-button> |
||||
|
</el-col> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="success" |
||||
|
plain |
||||
|
icon="el-icon-edit" |
||||
|
size="mini" |
||||
|
:disabled="single" |
||||
|
@click="handleUpdate" |
||||
|
v-hasPermi="['vet:merchant:edit']" |
||||
|
>修改</el-button> |
||||
|
</el-col> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="danger" |
||||
|
plain |
||||
|
icon="el-icon-delete" |
||||
|
size="mini" |
||||
|
:disabled="multiple" |
||||
|
@click="handleDelete" |
||||
|
v-hasPermi="['vet:merchant:remove']" |
||||
|
>删除</el-button> |
||||
|
</el-col> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="warning" |
||||
|
plain |
||||
|
icon="el-icon-download" |
||||
|
size="mini" |
||||
|
@click="handleExport" |
||||
|
v-hasPermi="['vet:merchant:export']" |
||||
|
>导出</el-button> |
||||
|
</el-col> |
||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-table v-loading="loading" :data="merchantList" @selection-change="handleSelectionChange"> |
||||
|
<el-table-column type="selection" width="55" align="center" /> |
||||
|
<el-table-column label="店铺ID,主键" align="center" prop="shopId" /> |
||||
|
<el-table-column label="店铺名称" align="center" prop="shopName" /> |
||||
|
<el-table-column label="店铺地址" align="center" prop="shopAddress" /> |
||||
|
<el-table-column label="联系电话" align="center" prop="phone" /> |
||||
|
<el-table-column label="关联用户ID" align="center" prop="userId" /> |
||||
|
<el-table-column label="创建时间" align="center" prop="createdAt" width="180"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="更新时间" align="center" prop="updatedAt" width="180"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="是否启用" align="center" prop="isActive" /> |
||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-edit" |
||||
|
@click="handleUpdate(scope.row)" |
||||
|
v-hasPermi="['vet:merchant:edit']" |
||||
|
>修改</el-button> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-delete" |
||||
|
@click="handleDelete(scope.row)" |
||||
|
v-hasPermi="['vet:merchant:remove']" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<pagination |
||||
|
v-show="total>0" |
||||
|
:total="total" |
||||
|
:page.sync="queryParams.pageNum" |
||||
|
:limit.sync="queryParams.pageSize" |
||||
|
@pagination="getList" |
||||
|
/> |
||||
|
|
||||
|
<!-- 添加或修改商家信息对话框 --> |
||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
||||
|
<el-form-item label="店铺名称" prop="shopName"> |
||||
|
<el-input v-model="form.shopName" placeholder="请输入店铺名称" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="店铺地址" prop="shopAddress"> |
||||
|
<el-input v-model="form.shopAddress" placeholder="请输入店铺地址" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="联系电话" prop="phone"> |
||||
|
<el-input v-model="form.phone" placeholder="请输入联系电话" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="关联用户ID" prop="userId"> |
||||
|
<el-input v-model="form.userId" placeholder="请输入关联用户ID" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建时间" prop="createdAt"> |
||||
|
<el-date-picker clearable |
||||
|
v-model="form.createdAt" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="请选择创建时间"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="更新时间" prop="updatedAt"> |
||||
|
<el-date-picker clearable |
||||
|
v-model="form.updatedAt" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="请选择更新时间"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="是否启用" prop="isActive"> |
||||
|
<el-input v-model="form.isActive" placeholder="请输入是否启用" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
|
<el-button @click="cancel">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { listMerchant, getMerchant, delMerchant, addMerchant, updateMerchant } from "@/api/vet/merchant" |
||||
|
|
||||
|
export default { |
||||
|
name: "Merchant", |
||||
|
data() { |
||||
|
return { |
||||
|
// 遮罩层 |
||||
|
loading: true, |
||||
|
// 选中数组 |
||||
|
ids: [], |
||||
|
// 非单个禁用 |
||||
|
single: true, |
||||
|
// 非多个禁用 |
||||
|
multiple: true, |
||||
|
// 显示搜索条件 |
||||
|
showSearch: true, |
||||
|
// 总条数 |
||||
|
total: 0, |
||||
|
// 商家信息表格数据 |
||||
|
merchantList: [], |
||||
|
// 弹出层标题 |
||||
|
title: "", |
||||
|
// 是否显示弹出层 |
||||
|
open: false, |
||||
|
// 查询参数 |
||||
|
queryParams: { |
||||
|
pageNum: 1, |
||||
|
pageSize: 10, |
||||
|
shopName: null, |
||||
|
shopAddress: null, |
||||
|
phone: null, |
||||
|
userId: null, |
||||
|
createdAt: null, |
||||
|
updatedAt: null, |
||||
|
isActive: null |
||||
|
}, |
||||
|
// 表单参数 |
||||
|
form: {}, |
||||
|
// 表单校验 |
||||
|
rules: { |
||||
|
shopName: [ |
||||
|
{ required: true, message: "店铺名称不能为空", trigger: "blur" } |
||||
|
], |
||||
|
shopAddress: [ |
||||
|
{ required: true, message: "店铺地址不能为空", trigger: "blur" } |
||||
|
], |
||||
|
userId: [ |
||||
|
{ required: true, message: "关联用户ID不能为空", trigger: "blur" } |
||||
|
], |
||||
|
createdAt: [ |
||||
|
{ required: true, message: "创建时间不能为空", trigger: "blur" } |
||||
|
], |
||||
|
updatedAt: [ |
||||
|
{ required: true, message: "更新时间不能为空", trigger: "blur" } |
||||
|
], |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.getList() |
||||
|
}, |
||||
|
methods: { |
||||
|
/** 查询商家信息列表 */ |
||||
|
getList() { |
||||
|
this.loading = true |
||||
|
listMerchant(this.queryParams).then(response => { |
||||
|
this.merchantList = response.rows |
||||
|
this.total = response.total |
||||
|
this.loading = false |
||||
|
}) |
||||
|
}, |
||||
|
// 取消按钮 |
||||
|
cancel() { |
||||
|
this.open = false |
||||
|
this.reset() |
||||
|
}, |
||||
|
// 表单重置 |
||||
|
reset() { |
||||
|
this.form = { |
||||
|
shopId: null, |
||||
|
shopName: null, |
||||
|
shopAddress: null, |
||||
|
phone: null, |
||||
|
userId: null, |
||||
|
createdAt: null, |
||||
|
updatedAt: null, |
||||
|
isActive: null |
||||
|
} |
||||
|
this.resetForm("form") |
||||
|
}, |
||||
|
/** 搜索按钮操作 */ |
||||
|
handleQuery() { |
||||
|
this.queryParams.pageNum = 1 |
||||
|
this.getList() |
||||
|
}, |
||||
|
/** 重置按钮操作 */ |
||||
|
resetQuery() { |
||||
|
this.resetForm("queryForm") |
||||
|
this.handleQuery() |
||||
|
}, |
||||
|
// 多选框选中数据 |
||||
|
handleSelectionChange(selection) { |
||||
|
this.ids = selection.map(item => item.shopId) |
||||
|
this.single = selection.length!==1 |
||||
|
this.multiple = !selection.length |
||||
|
}, |
||||
|
/** 新增按钮操作 */ |
||||
|
handleAdd() { |
||||
|
this.reset() |
||||
|
this.open = true |
||||
|
this.title = "添加商家信息" |
||||
|
}, |
||||
|
/** 修改按钮操作 */ |
||||
|
handleUpdate(row) { |
||||
|
this.reset() |
||||
|
const shopId = row.shopId || this.ids |
||||
|
getMerchant(shopId).then(response => { |
||||
|
this.form = response.data |
||||
|
this.open = true |
||||
|
this.title = "修改商家信息" |
||||
|
}) |
||||
|
}, |
||||
|
/** 提交按钮 */ |
||||
|
submitForm() { |
||||
|
this.$refs["form"].validate(valid => { |
||||
|
if (valid) { |
||||
|
if (this.form.shopId != null) { |
||||
|
updateMerchant(this.form).then(response => { |
||||
|
this.$modal.msgSuccess("修改成功") |
||||
|
this.open = false |
||||
|
this.getList() |
||||
|
}) |
||||
|
} else { |
||||
|
addMerchant(this.form).then(response => { |
||||
|
this.$modal.msgSuccess("新增成功") |
||||
|
this.open = false |
||||
|
this.getList() |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
/** 删除按钮操作 */ |
||||
|
handleDelete(row) { |
||||
|
const shopIds = row.shopId || this.ids |
||||
|
this.$modal.confirm('是否确认删除商家信息编号为"' + shopIds + '"的数据项?').then(function() { |
||||
|
return delMerchant(shopIds) |
||||
|
}).then(() => { |
||||
|
this.getList() |
||||
|
this.$modal.msgSuccess("删除成功") |
||||
|
}).catch(() => {}) |
||||
|
}, |
||||
|
/** 导出按钮操作 */ |
||||
|
handleExport() { |
||||
|
this.download('vet/merchant/export', { |
||||
|
...this.queryParams |
||||
|
}, `merchant_${new Date().getTime()}.xlsx`) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue