From 7e2117e6e7382d942d5cdbb2ac5d35b7d278a478 Mon Sep 17 00:00:00 2001 From: xin <1099200748@qq.com> Date: Tue, 03 Jun 2025 01:27:08 +0800 Subject: [PATCH] 重命名 --- oying-system/src/main/java/com/oying/modules/system/rest/MerchantController.java | 36 +++--- oying-system/src/main/resources/mapper/system/MerchantMapper.xml | 20 ++-- oying-system/src/main/java/com/oying/modules/system/service/impl/MerchantServiceImpl.java | 86 +++++++++++++++++ /dev/null | 86 ----------------- oying-system/src/main/java/com/oying/modules/system/domain/Merchant.java | 18 +- oying-system/src/main/java/com/oying/modules/system/service/MerchantService.java | 14 +- oying-system/src/main/java/com/oying/modules/system/mapper/MerchantMapper.java | 8 7 files changed, 134 insertions(+), 134 deletions(-) diff --git a/oying-system/src/main/java/com/oying/modules/system/domain/Merchants.java b/oying-system/src/main/java/com/oying/modules/system/domain/Merchant.java similarity index 80% rename from oying-system/src/main/java/com/oying/modules/system/domain/Merchants.java rename to oying-system/src/main/java/com/oying/modules/system/domain/Merchant.java index 139f7b5..5660ada 100644 --- a/oying-system/src/main/java/com/oying/modules/system/domain/Merchants.java +++ b/oying-system/src/main/java/com/oying/modules/system/domain/Merchant.java @@ -20,12 +20,12 @@ **/ @Getter @Setter -@TableName("sys_merchants") -public class Merchants extends BaseEntity implements Serializable { +@TableName("sys_merchant") +public class Merchant extends BaseEntity implements Serializable { - @TableId(value = "merchants_id", type = IdType.AUTO) + @TableId(value = "merchant_id", type = IdType.AUTO) @ApiModelProperty(value = "ID") - private Long merchantsId; + private Long merchantId; @NotBlank @ApiModelProperty(value = "名称") @@ -48,21 +48,21 @@ private String contactMobile; @ApiModelProperty(value = "排序") - private Integer merchantsSort; + private Integer merchantSort; @ApiModelProperty(value = "状态") private String enabled = "1"; @ApiModelProperty(value = "审核人") - private String authUser; + private String auditUser; @ApiModelProperty(value = "审核时间") - private Timestamp authTime; + private Timestamp auditTime; @ApiModelProperty(value = "审核信息") - private String authMessage; + private String auditMessage; - public void copy(Merchants source){ + public void copy(Merchant source){ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); } } diff --git a/oying-system/src/main/java/com/oying/modules/system/mapper/MerchantsMapper.java b/oying-system/src/main/java/com/oying/modules/system/mapper/MerchantMapper.java similarity index 60% rename from oying-system/src/main/java/com/oying/modules/system/mapper/MerchantsMapper.java rename to oying-system/src/main/java/com/oying/modules/system/mapper/MerchantMapper.java index c1ea786..09e82ae 100644 --- a/oying-system/src/main/java/com/oying/modules/system/mapper/MerchantsMapper.java +++ b/oying-system/src/main/java/com/oying/modules/system/mapper/MerchantMapper.java @@ -1,6 +1,6 @@ package com.oying.modules.system.mapper; -import com.oying.modules.system.domain.Merchants; +import com.oying.modules.system.domain.Merchant; import com.oying.modules.system.domain.dto.MerchantsQueryCriteria; import java.util.List; import org.apache.ibatis.annotations.Param; @@ -14,9 +14,9 @@ * @date 2025-05-29 **/ @Mapper -public interface MerchantsMapper extends BaseMapper<Merchants> { +public interface MerchantMapper extends BaseMapper<Merchant> { - IPage<Merchants> findAll(@Param("criteria") MerchantsQueryCriteria criteria, Page<Object> page); + IPage<Merchant> findAll(@Param("criteria") MerchantsQueryCriteria criteria, Page<Object> page); - List<Merchants> findAll(@Param("criteria") MerchantsQueryCriteria criteria); + List<Merchant> findAll(@Param("criteria") MerchantsQueryCriteria criteria); } diff --git a/oying-system/src/main/java/com/oying/modules/system/rest/MerchantsController.java b/oying-system/src/main/java/com/oying/modules/system/rest/MerchantController.java similarity index 66% rename from oying-system/src/main/java/com/oying/modules/system/rest/MerchantsController.java rename to oying-system/src/main/java/com/oying/modules/system/rest/MerchantController.java index b2cafc2..096a90c 100644 --- a/oying-system/src/main/java/com/oying/modules/system/rest/MerchantsController.java +++ b/oying-system/src/main/java/com/oying/modules/system/rest/MerchantController.java @@ -1,8 +1,8 @@ package com.oying.modules.system.rest; import com.oying.annotation.Log; -import com.oying.modules.system.domain.Merchants; -import com.oying.modules.system.service.MerchantsService; +import com.oying.modules.system.domain.Merchant; +import com.oying.modules.system.service.MerchantService; import com.oying.modules.system.domain.dto.MerchantsQueryCriteria; import lombok.RequiredArgsConstructor; import java.util.List; @@ -24,50 +24,50 @@ @RestController @RequiredArgsConstructor @Api(tags = "系统:商户信息") -@RequestMapping("/api/merchants") -public class MerchantsController { +@RequestMapping("/api/merchant") +public class MerchantController { - private final MerchantsService merchantsService; + private final MerchantService merchantService; @ApiOperation("导出数据") @GetMapping(value = "/download") - @PreAuthorize("@el.check('merchants:list')") + @PreAuthorize("@el.check('merchant:list')") public void exportMerchants(HttpServletResponse response, MerchantsQueryCriteria criteria) throws IOException { - merchantsService.download(merchantsService.queryAll(criteria), response); + merchantService.download(merchantService.queryAll(criteria), response); } @GetMapping @ApiOperation("查询商户信息") - @PreAuthorize("@el.check('merchants:list')") - public ResponseEntity<PageResult<Merchants>> queryMerchants(MerchantsQueryCriteria criteria){ + @PreAuthorize("@el.check('merchant:list')") + public ResponseEntity<PageResult<Merchant>> queryMerchants(MerchantsQueryCriteria criteria){ Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize()); - return new ResponseEntity<>(merchantsService.queryAll(criteria,page),HttpStatus.OK); + return new ResponseEntity<>(merchantService.queryAll(criteria,page),HttpStatus.OK); } @PostMapping @Log("新增商户信息") @ApiOperation("新增商户信息") - @PreAuthorize("@el.check('merchants:add')") - public ResponseEntity<Object> createMerchants(@Validated @RequestBody Merchants resources){ - merchantsService.create(resources); + @PreAuthorize("@el.check('merchant:add')") + public ResponseEntity<Object> createMerchants(@Validated @RequestBody Merchant resources){ + merchantService.create(resources); return new ResponseEntity<>(HttpStatus.CREATED); } @PutMapping @Log("修改商户信息") @ApiOperation("修改商户信息") - @PreAuthorize("@el.check('merchants:edit')") - public ResponseEntity<Object> updateMerchants(@Validated @RequestBody Merchants resources){ - merchantsService.update(resources); + @PreAuthorize("@el.check('merchant:edit')") + public ResponseEntity<Object> updateMerchants(@Validated @RequestBody Merchant resources){ + merchantService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @DeleteMapping @Log("删除商户信息") @ApiOperation("删除商户信息") - @PreAuthorize("@el.check('merchants:del')") + @PreAuthorize("@el.check('merchant:del')") public ResponseEntity<Object> deleteMerchants(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) { - merchantsService.deleteAll(ids); + merchantService.deleteAll(ids); return new ResponseEntity<>(HttpStatus.OK); } } diff --git a/oying-system/src/main/java/com/oying/modules/system/service/MerchantsService.java b/oying-system/src/main/java/com/oying/modules/system/service/MerchantService.java similarity index 70% rename from oying-system/src/main/java/com/oying/modules/system/service/MerchantsService.java rename to oying-system/src/main/java/com/oying/modules/system/service/MerchantService.java index c822ba9..5d1c847 100644 --- a/oying-system/src/main/java/com/oying/modules/system/service/MerchantsService.java +++ b/oying-system/src/main/java/com/oying/modules/system/service/MerchantService.java @@ -1,6 +1,6 @@ package com.oying.modules.system.service; -import com.oying.modules.system.domain.Merchants; +import com.oying.modules.system.domain.Merchant; import com.oying.modules.system.domain.dto.MerchantsQueryCriteria; import java.util.List; import java.io.IOException; @@ -14,7 +14,7 @@ * @author lixin * @date 2025-05-29 **/ -public interface MerchantsService extends IService<Merchants> { +public interface MerchantService extends IService<Merchant> { /** * 查询数据分页 @@ -22,26 +22,26 @@ * @param page 分页参数 * @return PageResult */ - PageResult<Merchants> queryAll(MerchantsQueryCriteria criteria, Page<Object> page); + PageResult<Merchant> queryAll(MerchantsQueryCriteria criteria, Page<Object> page); /** * 查询所有数据不分页 * @param criteria 条件参数 * @return List<MerchantsDto> */ - List<Merchants> queryAll(MerchantsQueryCriteria criteria); + List<Merchant> queryAll(MerchantsQueryCriteria criteria); /** * 创建 * @param resources / */ - void create(Merchants resources); + void create(Merchant resources); /** * 编辑 * @param resources / */ - void update(Merchants resources); + void update(Merchant resources); /** * 多选删除 @@ -55,5 +55,5 @@ * @param response / * @throws IOException / */ - void download(List<Merchants> all, HttpServletResponse response) throws IOException; + void download(List<Merchant> all, HttpServletResponse response) throws IOException; } diff --git a/oying-system/src/main/java/com/oying/modules/system/service/impl/MerchantServiceImpl.java b/oying-system/src/main/java/com/oying/modules/system/service/impl/MerchantServiceImpl.java new file mode 100644 index 0000000..abf98cf --- /dev/null +++ b/oying-system/src/main/java/com/oying/modules/system/service/impl/MerchantServiceImpl.java @@ -0,0 +1,86 @@ +package com.oying.modules.system.service.impl; + +import com.oying.modules.system.domain.Merchant; +import com.oying.modules.system.mapper.MerchantMapper; +import com.oying.utils.FileUtil; +import lombok.RequiredArgsConstructor; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.oying.modules.system.service.MerchantService; +import com.oying.modules.system.domain.dto.MerchantsQueryCriteria; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.oying.utils.PageUtil; +import java.util.List; +import java.util.Map; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import com.oying.utils.PageResult; + +/** +* @description 服务实现 +* @author lixin +* @date 2025-05-29 +**/ +@Service +@RequiredArgsConstructor +public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> implements MerchantService { + + private final MerchantMapper merchantMapper; + + @Override + public PageResult<Merchant> queryAll(MerchantsQueryCriteria criteria, Page<Object> page){ + return PageUtil.toPage(merchantMapper.findAll(criteria, page)); + } + + @Override + public List<Merchant> queryAll(MerchantsQueryCriteria criteria){ + return merchantMapper.findAll(criteria); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void create(Merchant resources) { + merchantMapper.insert(resources); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(Merchant resources) { + Merchant merchant = getById(resources.getMerchantId()); + merchant.copy(resources); + merchantMapper.updateById(merchant); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteAll(List<Long> ids) { + merchantMapper.deleteBatchIds(ids); + } + + @Override + public void download(List<Merchant> all, HttpServletResponse response) throws IOException { + List<Map<String, Object>> list = new ArrayList<>(); + for (Merchant merchant : all) { + Map<String, Object> map = new LinkedHashMap<>(); + map.put("名称", merchant.getMerchantName()); + map.put("商户编码", merchant.getMerchantCode()); + map.put("营业执照号", merchant.getBusinessLicense()); + map.put("营业执照号路径", merchant.getBusinessLicensePath()); + map.put("联系手机", merchant.getContactMobile()); + map.put("排序", merchant.getMerchantSort()); + map.put("状态", merchant.getEnabled()); + map.put("审核人", merchant.getAuditUser()); + map.put("审核时间", merchant.getAuditTime()); + map.put("审核信息", merchant.getAuditMessage()); + map.put("创建者", merchant.getCreateBy()); + map.put("更新者", merchant.getUpdateBy()); + map.put("创建日期", merchant.getCreateTime()); + map.put("更新时间", merchant.getUpdateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } +} diff --git a/oying-system/src/main/java/com/oying/modules/system/service/impl/MerchantsServiceImpl.java b/oying-system/src/main/java/com/oying/modules/system/service/impl/MerchantsServiceImpl.java deleted file mode 100644 index ca6c22c..0000000 --- a/oying-system/src/main/java/com/oying/modules/system/service/impl/MerchantsServiceImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.oying.modules.system.service.impl; - -import com.oying.modules.system.domain.Merchants; -import com.oying.utils.FileUtil; -import lombok.RequiredArgsConstructor; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.oying.modules.system.service.MerchantsService; -import com.oying.modules.system.domain.dto.MerchantsQueryCriteria; -import com.oying.modules.system.mapper.MerchantsMapper; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import com.oying.utils.PageUtil; -import java.util.List; -import java.util.Map; -import java.io.IOException; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import com.oying.utils.PageResult; - -/** -* @description 服务实现 -* @author lixin -* @date 2025-05-29 -**/ -@Service -@RequiredArgsConstructor -public class MerchantsServiceImpl extends ServiceImpl<MerchantsMapper, Merchants> implements MerchantsService { - - private final MerchantsMapper merchantsMapper; - - @Override - public PageResult<Merchants> queryAll(MerchantsQueryCriteria criteria, Page<Object> page){ - return PageUtil.toPage(merchantsMapper.findAll(criteria, page)); - } - - @Override - public List<Merchants> queryAll(MerchantsQueryCriteria criteria){ - return merchantsMapper.findAll(criteria); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(Merchants resources) { - merchantsMapper.insert(resources); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(Merchants resources) { - Merchants merchants = getById(resources.getMerchantsId()); - merchants.copy(resources); - merchantsMapper.updateById(merchants); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void deleteAll(List<Long> ids) { - merchantsMapper.deleteBatchIds(ids); - } - - @Override - public void download(List<Merchants> all, HttpServletResponse response) throws IOException { - List<Map<String, Object>> list = new ArrayList<>(); - for (Merchants merchants : all) { - Map<String, Object> map = new LinkedHashMap<>(); - map.put("名称", merchants.getMerchantName()); - map.put("商户编码", merchants.getMerchantCode()); - map.put("营业执照号", merchants.getBusinessLicense()); - map.put("营业执照号路径", merchants.getBusinessLicensePath()); - map.put("联系手机", merchants.getContactMobile()); - map.put("排序", merchants.getMerchantsSort()); - map.put("状态", merchants.getEnabled()); - map.put("审核人", merchants.getAuthUser()); - map.put("审核时间", merchants.getAuthTime()); - map.put("审核信息", merchants.getAuthMessage()); - map.put("创建者", merchants.getCreateBy()); - map.put("更新者", merchants.getUpdateBy()); - map.put("创建日期", merchants.getCreateTime()); - map.put("更新时间", merchants.getUpdateTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - } -} diff --git a/oying-system/src/main/resources/mapper/system/MerchantsMapper.xml b/oying-system/src/main/resources/mapper/system/MerchantMapper.xml similarity index 73% rename from oying-system/src/main/resources/mapper/system/MerchantsMapper.xml rename to oying-system/src/main/resources/mapper/system/MerchantMapper.xml index 526dea8..1c9d082 100644 --- a/oying-system/src/main/resources/mapper/system/MerchantsMapper.xml +++ b/oying-system/src/main/resources/mapper/system/MerchantMapper.xml @@ -1,32 +1,32 @@ <?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.oying.modules.system.mapper.MerchantsMapper"> - <resultMap id="BaseResultMap" type="com.oying.modules.system.domain.Merchants"> - <id column="merchants_id" property="merchantsId"/> +<mapper namespace="com.oying.modules.system.mapper.MerchantMapper"> + <resultMap id="BaseResultMap" type="com.oying.modules.system.domain.Merchant"> + <id column="merchant_id" property="merchantId"/> <result column="merchant_name" property="merchantName"/> <result column="merchant_code" property="merchantCode"/> <result column="business_license" property="businessLicense"/> <result column="business_license_path" property="businessLicensePath"/> <result column="contact_mobile" property="contactMobile"/> - <result column="merchants_sort" property="merchantsSort"/> + <result column="merchant_sort" property="merchantSort"/> <result column="enabled" property="enabled"/> <result column="create_by" property="createBy"/> <result column="update_by" property="updateBy"/> <result column="create_time" property="createTime"/> <result column="update_time" property="updateTime"/> - <result column="auth_user" property="authUser"/> - <result column="auth_time" property="authTime"/> - <result column="auth_message" property="authMessage"/> + <result column="audit_user" property="auditUser"/> + <result column="audit_time" property="auditTime"/> + <result column="audit_message" property="auditMessage"/> </resultMap> <sql id="Base_Column_List"> - merchants_id, merchant_name, merchant_code, business_license, business_license_path, contact_mobile, merchants_sort, enabled, create_by, update_by, create_time, update_time, auth_user, auth_time, auth_message + merchant_id, merchant_name, merchant_code, business_license, business_license_path, contact_mobile, merchant_sort, enabled, create_by, update_by, create_time, update_time, audit_user, audit_time, audit_message </sql> <select id="findAll" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> - from sys_merchants + from sys_merchant <where> <if test="criteria.blurry != null and criteria.blurry != ''"> and ( @@ -43,6 +43,6 @@ AND create_time BETWEEN #{criteria.createTime[0]} AND #{criteria.createTime[1]} </if> </where> - order by merchants_sort desc + order by merchant_sort desc </select> </mapper> -- Gitblit v1.9.3