From 36687535b718552706053f350d3d231efb8ff7f9 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Wed, 25 Oct 2023 13:17:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fuintAdmin/src/views/member/fixingLevel.vue | 89 +++++++++++++++---- .../convenienceSore/entity/CvsGoods.java | 14 ++- .../mapper/CvsGoodsMapper.java | 2 +- .../service/CvsGoodsService.java | 30 ++++++- .../service/impl/CvsGoodsServiceImpl.java | 1 - .../controller/FileUploadController.java | 41 --------- .../impl/CertifiedMemberServiceImpl.java | 13 +-- 7 files changed, 120 insertions(+), 70 deletions(-) delete mode 100644 fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/FileUploadController.java diff --git a/fuintAdmin/src/views/member/fixingLevel.vue b/fuintAdmin/src/views/member/fixingLevel.vue index ce6ab0b1d..931581b35 100644 --- a/fuintAdmin/src/views/member/fixingLevel.vue +++ b/fuintAdmin/src/views/member/fixingLevel.vue @@ -94,6 +94,8 @@ + +
@@ -356,8 +363,7 @@ @@ -452,14 +458,15 @@
- +
@@ -469,14 +476,15 @@
- +
@@ -486,14 +494,15 @@
- +
@@ -812,11 +821,15 @@ import { updateCertifiedMember } from "@/api/staff/user/certifiedmember"; import {getUser, getUserMobile, listUser} from "@/api/staff/user/user"; +import {getToken} from "@/utils/auth"; export default { dicts: ['yhlx','yes_or_no','zhzt','yhhdz','rzzt'], data() { return { + headers: { + 'Access-Token': getToken(), + }, result:{}, isEdit:false, // 上传图片信息 @@ -1074,16 +1087,48 @@ export default { this.title = "新增用户认证"; }, handleAvatarSuccess1(res, file) { - // this.imageUrl.imageUrl1 = `/dev-api/uploadImages/certifiedImage/file.jpg` - this.imageUrl.imageUrl1 = URL.createObjectURL(file.raw); + // this.imageUrl.imageUrl1 = URL.createObjectURL(file.raw); + this.imageUrl.imageUrl1 = res.data.fileName; }, handleAvatarSuccess2(res, file) { - this.imageUrl.imageUrl2 = URL.createObjectURL(file.raw); + this.imageUrl.imageUrl2 = res.data.fileName; }, handleAvatarSuccess3(res, file) { - this.imageUrl.imageUrl3 = URL.createObjectURL(file.raw); + this.imageUrl.imageUrl3 = res.data.fileName; }, - onChange (file,fileList) { + onChange1 (file,fileList) { + if(file){ + const suffix = file.name.split('.')[1] + const size = file.size / 1024 / 1024 < 2 + if(['png','jpeg','jpg'].indexOf(suffix) < 0){ + this.$message.error('上传图片只支持 png、jpeg、jpg 格式!') + this.$refs.upload.clearFiles() + return false + } + if(!size){ + this.$message.error('上传文件大小不能超过 2MB!') + return false + } + return file + } + }, + onChange2 (file,fileList) { + if(file){ + const suffix = file.name.split('.')[1] + const size = file.size / 1024 / 1024 < 2 + if(['png','jpeg','jpg'].indexOf(suffix) < 0){ + this.$message.error('上传图片只支持 png、jpeg、jpg 格式!') + this.$refs.upload.clearFiles() + return false + } + if(!size){ + this.$message.error('上传文件大小不能超过 2MB!') + return false + } + return file + } + }, + onChange3 (file,fileList) { if(file){ const suffix = file.name.split('.')[1] const size = file.size / 1024 / 1024 < 2 @@ -1123,7 +1168,9 @@ export default { this.form1 = response.data; this.openMember = true; this.title = "编辑用户认证"; - this.imageUrl = JSON.parse(this.form1.attestationData) + if (this.form1.attestationData!=null && this.form1.attestationData!=""){ + this.imageUrl = JSON.parse(this.form1.attestationData) + } }); }, // 取消按钮 @@ -1310,4 +1357,10 @@ export default { width: 100%; height: 100%; } + .attImg{ + width: 40px; + height: 40px; + margin: 2px; + border-radius: 50%; + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/CvsGoods.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/CvsGoods.java index 1469355f3..4d6b2465f 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/CvsGoods.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/entity/CvsGoods.java @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fuint.framework.entity.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @@ -14,25 +16,35 @@ import lombok.Data; */ @Data @TableName("cvs_goods") +@ApiModel(value = "CvsGoods对象", description = "便利店表") public class CvsGoods extends BaseEntity { //主键 - @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty("自增ID") + @TableId(value = "ID", type = IdType.AUTO) private Integer id; //父分类id + @ApiModelProperty("父分类id") private Integer pid; + @ApiModelProperty("店铺id") + private Integer storeId; + //编码 + @ApiModelProperty("编码") private String code; //商品分类 + @ApiModelProperty("商品分类") private String categoryName; //商品排序 + @ApiModelProperty("商品排序") private Integer sorted; //商品状态 + @ApiModelProperty("商品状态") private String status; @TableField(exist = false) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/CvsGoodsMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/CvsGoodsMapper.java index 0ed71270a..4558d171a 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/CvsGoodsMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/mapper/CvsGoodsMapper.java @@ -12,7 +12,7 @@ import java.util.List; /** * @author :admin * @date : 2023/10/16 - * 便利店商品管理接口 + * 便利店商品管理 mapper层 */ @Mapper public interface CvsGoodsMapper extends BaseMapper { diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/CvsGoodsService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/CvsGoodsService.java index a71be9e08..89a31f8e9 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/CvsGoodsService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/CvsGoodsService.java @@ -9,17 +9,41 @@ import io.swagger.models.auth.In; import java.util.List; /** - * @author :admin - * @date : 2023/10/16 + * 便利店商品信息 业务层 */ public interface CvsGoodsService { - + /** + * 添加商品信息 + * @param cvsGoods + * @return + */ int insertCvsGoods(CvsGoods cvsGoods); + /** + * 根据条件分页查询商品信息 + * @param page + * @param goods + * @return + */ IPage selectTree(Page page, CvsGoods goods); + /** + * + * @param goods + * @return + */ List selectCvsGoodsList(CvsGoods goods); + /** + * 根据id查询商品信息 + * @param id + * @return + */ CvsGoods selectParentById(Integer id); + + /** + * 根据id删除商品信息 + * @param id + */ void deleteByIdVo(Integer id); } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/CvsGoodsServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/CvsGoodsServiceImpl.java index e65c930ad..a2d163fc5 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/CvsGoodsServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/convenienceSore/service/impl/CvsGoodsServiceImpl.java @@ -38,7 +38,6 @@ public class CvsGoodsServiceImpl extends ServiceImpl im baseMapper.updateById(cvsGoods); return insertGoods; } - } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/FileUploadController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/FileUploadController.java deleted file mode 100644 index 6b05b677c..000000000 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/controller/FileUploadController.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.fuint.business.userManager.controller; - -import com.fuint.framework.web.BaseController; -import com.fuint.framework.web.ResponseObject; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -import java.io.FileOutputStream; -import java.util.UUID; - -@RestController -@RequestMapping("/picture") -public class FileUploadController extends BaseController { - @PostMapping("/upload") - public ResponseObject handleFileUpload(@RequestParam("file") MultipartFile file) { - if (!file.isEmpty()) { - try { - byte[] bytes = file.getBytes(); - // 保存文件到服务器 - String filePath = "D:/workspaces/oilSystem/fuintBackend/fuint-application/src/main/resources/static/uploadImages/certifiedImage/"; - String imgName = UUID.randomUUID().toString().replace("-","").substring(0,6); -// String imgName = file.getName(); - String path = filePath+imgName+".jpg"; - FileOutputStream fos = new FileOutputStream(path); - fos.write(bytes); - fos.close(); - - return getSuccessResult("上传成功"); - } catch (Exception e) { - return getSuccessResult("上传失败:" + e.getMessage()); - } - } else { - return getSuccessResult("上传失败:文件为空"); - } - // 处理文件上传逻辑 -// return getSuccessResult("上传成功"); - } -} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/CertifiedMemberServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/CertifiedMemberServiceImpl.java index 357e28e22..117433c92 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/CertifiedMemberServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/userManager/service/impl/CertifiedMemberServiceImpl.java @@ -18,6 +18,8 @@ import com.fuint.common.util.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Collections; + /** * 认证会员 业务层 */ @@ -34,11 +36,12 @@ public class CertifiedMemberServiceImpl extends ServiceImpl selectCertifiedMemberList(Page page, CertifiedMember certifiedMember) { IPage fixingLevelIPage = baseMapper.selectCertifiedMemberList(page, certifiedMember); -// for (CertifiedMember record : fixingLevelIPage.getRecords()) { -// if (StringUtils.isNotEmpty(record.getAttestationData())){ -// record.setImgUrlList(JSONArray.parseArray(record.getAttestationData(), JSONObject.class)); -// } -// } + for (CertifiedMember record : fixingLevelIPage.getRecords()) { + if (StringUtils.isNotEmpty(record.getAttestationData())){ +// record.setImgUrlList(JSONArray.parseArray(record.getAttestationData(), JSONObject.class)); + record.setImgUrlList(Collections.singletonList(JSONObject.parseObject(record.getAttestationData(), JSONObject.class))); + } + } return fixingLevelIPage; }