Browse Source

1.兽医管理入驻审核页面图片显示功能

2.牧户行政区划保存接口优化
master
ma-zhongxu 3 months ago
parent
commit
ddfd6bf568
  1. 16
      chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuUserController.java
  2. 2
      chenhai-system/src/main/java/com/chenhai/system/mapper/SysUserMapper.java
  3. 1
      chenhai-system/src/main/java/com/chenhai/system/service/ISysUserService.java
  4. 5
      chenhai-system/src/main/java/com/chenhai/system/service/impl/SysUserServiceImpl.java
  5. 4
      chenhai-system/src/main/resources/mapper/system/SysUserMapper.xml
  6. 146
      chenhai-ui/src/views/system/vet/aduit/index.vue

16
chenhai-admin/src/main/java/com/chenhai/web/controller/muhu/MuhuUserController.java

@ -4,12 +4,10 @@ import com.chenhai.common.core.controller.BaseController;
import com.chenhai.common.core.domain.AjaxResult; import com.chenhai.common.core.domain.AjaxResult;
import com.chenhai.common.core.domain.entity.SysArea; import com.chenhai.common.core.domain.entity.SysArea;
import com.chenhai.system.service.ISysAreaService; import com.chenhai.system.service.ISysAreaService;
import com.chenhai.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
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.bind.annotation.*;
import java.util.List; import java.util.List;
@ -26,6 +24,9 @@ public class MuhuUserController extends BaseController
@Autowired @Autowired
private ISysAreaService sysAreaService; private ISysAreaService sysAreaService;
@Autowired
private ISysUserService sysUserService;
@PreAuthorize("@ss.hasRole('muhu')") @PreAuthorize("@ss.hasRole('muhu')")
@GetMapping("/areaChildren") @GetMapping("/areaChildren")
public AjaxResult getAreaChildren(@RequestParam(value = "parentCode", required = false, defaultValue = "152900") String parentCode) { public AjaxResult getAreaChildren(@RequestParam(value = "parentCode", required = false, defaultValue = "152900") String parentCode) {
@ -35,4 +36,11 @@ public class MuhuUserController extends BaseController
List<SysArea> list = sysAreaService.selectSysAreaList(query); List<SysArea> list = sysAreaService.selectSysAreaList(query);
return success(list); return success(list);
} }
@PreAuthorize("@ss.hasRole('muhu')")
@PutMapping("/saveUserAreaCode")
public AjaxResult getArea(@RequestParam(value = "areaCode") String areaCode) {
Long userId = getUserId();
return toAjax(sysUserService.updateUserAreaCode(userId, areaCode));
}
} }

2
chenhai-system/src/main/java/com/chenhai/system/mapper/SysUserMapper.java

@ -154,4 +154,6 @@ public interface SysUserMapper
* @return 结果 * @return 结果
*/ */
public SysUser checkEmailUnique(String email); public SysUser checkEmailUnique(String email);
public int updateUserAreaCode(@Param("userId") Long userId, @Param("areaCode") String areaCode);
} }

1
chenhai-system/src/main/java/com/chenhai/system/service/ISysUserService.java

@ -231,4 +231,5 @@ public interface ISysUserService
*/ */
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName); public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
public int updateUserAreaCode(Long userId, String areaCode);
} }

5
chenhai-system/src/main/java/com/chenhai/system/service/impl/SysUserServiceImpl.java

@ -574,4 +574,9 @@ public class SysUserServiceImpl implements ISysUserService
} }
return successMsg.toString(); return successMsg.toString();
} }
@Override
public int updateUserAreaCode(Long userId, String areaCode) {
return userMapper.updateUserAreaCode(userId, areaCode);
}
} }

4
chenhai-system/src/main/resources/mapper/system/SysUserMapper.xml

@ -282,4 +282,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<update id="updateUserAreaCode">
update sys_user set area_code = #{areaCode} where user_id = #{userId}
</update>
</mapper> </mapper>

146
chenhai-ui/src/views/system/vet/aduit/index.vue

@ -287,9 +287,9 @@
</div> </div>
<div class="image-preview"> <div class="image-preview">
<el-image <el-image
style="width: 200px; height: 150px; margin-right: 15px;"
:src="getImageUrl(cert.certImage)"
:preview-src-list="[getImageUrl(cert.certImage)]"
style="width: 200px; height: 150px;"
:src="baseUrl + cert.certImage"
:preview-src-list="[baseUrl + cert.certImage]"
fit="contain" fit="contain"
> >
<div slot="error" class="image-slot"> <div slot="error" class="image-slot">
@ -297,12 +297,6 @@
<div>图片加载失败</div> <div>图片加载失败</div>
</div> </div>
</el-image> </el-image>
<el-button
type="primary"
size="mini"
@click="viewImage(cert.certImage)"
icon="el-icon-zoom-in"
>查看大图</el-button>
</div> </div>
</div> </div>
@ -368,28 +362,6 @@
{{ submittingAll ? '提交中...' : '提交审核' }} {{ submittingAll ? '提交中...' : '提交审核' }}
</el-button> </el-button>
</div> </div>
<!-- 图片预览对话框 -->
<el-dialog
:visible.sync="imagePreviewVisible"
width="80%"
append-to-body
class="image-preview-dialog"
>
<el-image
style="width: 100%; max-height: 70vh;"
:src="previewImageUrl"
fit="contain"
>
<div slot="error" class="image-slot-large">
<i class="el-icon-picture-outline"></i>
<div>图片加载失败</div>
</div>
</el-image>
<span slot="footer" class="dialog-footer">
<el-button @click="imagePreviewVisible = false"> </el-button>
</span>
</el-dialog>
</el-dialog> </el-dialog>
<!-- 详情对话框 --> <!-- 详情对话框 -->
@ -439,12 +411,6 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="资质证书" name="certificates" v-if="detailCertificates && detailCertificates.length > 0"> <el-tab-pane label="资质证书" name="certificates" v-if="detailCertificates && detailCertificates.length > 0">
<div v-if="loadingCertDetail" class="tab-loading">
<i class="el-icon-loading"></i>
<div>加载证书信息...</div>
</div>
<div v-else>
<div class="certificate-section"> <div class="certificate-section">
<h3>资质证书列表 {{ detailCertificates.length }} 个证书</h3> <h3>资质证书列表 {{ detailCertificates.length }} 个证书</h3>
@ -486,9 +452,9 @@
</div> </div>
<div class="image-preview"> <div class="image-preview">
<el-image <el-image
style="width: 200px; height: 150px; margin-right: 15px;"
:src="getImageUrl(cert.certImage)"
:preview-src-list="[getImageUrl(cert.certImage)]"
style="width: 200px; height: 150px;"
:src="baseUrl + cert.certImage"
:preview-src-list="[baseUrl + cert.certImage]"
fit="contain" fit="contain"
> >
<div slot="error" class="image-slot"> <div slot="error" class="image-slot">
@ -496,12 +462,6 @@
<div>图片加载失败</div> <div>图片加载失败</div>
</div> </div>
</el-image> </el-image>
<el-button
type="primary"
size="mini"
@click="viewImage(cert.certImage)"
icon="el-icon-zoom-in"
>查看大图</el-button>
</div> </div>
</div> </div>
@ -518,7 +478,6 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
@ -545,6 +504,7 @@ export default {
showSearch: true, showSearch: true,
total: 0, total: 0,
infoList: [], infoList: [],
baseUrl: process.env.VUE_APP_BASE_API,
detailTitle: "", detailTitle: "",
detailVisible: false, detailVisible: false,
@ -862,19 +822,6 @@ export default {
return `${total} 个证书,已审核 ${audited} 个,其中通过 ${passed} 个,不通过 ${failed}` return `${total} 个证书,已审核 ${audited} 个,其中通过 ${passed} 个,不通过 ${failed}`
}, },
viewImage(imagePath) {
this.previewImageUrl = this.getImageUrl(imagePath)
this.imagePreviewVisible = true
},
getImageUrl(path) {
if (!path) return ''
if (path.startsWith('/')) {
return process.env.VUE_APP_BASE_API + path
}
return path
},
resetAuditData() { resetAuditData() {
this.basicInfo = {} this.basicInfo = {}
this.basicAuditForm = { this.basicAuditForm = {
@ -904,41 +851,37 @@ export default {
if (response.code === 200) { if (response.code === 200) {
this.detailData = response.data this.detailData = response.data
this.loadDetailCertificates(response.data.userId)
} else {
this.$message.error(response.msg || '获取详情失败')
}
}).catch(error => {
console.error('获取详情失败:', error)
this.$message.error('获取详情失败')
}).finally(() => {
this.loadingDetail = false
})
},
loadDetailCertificates(userId) {
if (!userId) return
this.loadingCertDetail = true
// 使
if (response.data.userId) {
const queryParams = { const queryParams = {
userId: userId,
userId: response.data.userId,
pageNum: 1, pageNum: 1,
pageSize: 1000 pageSize: 1000
} }
listQualification(queryParams).then(response => {
if (response.code === 200) {
this.detailCertificates = response.rows || []
listQualification(queryParams).then(certResponse => {
if (certResponse.code === 200) {
this.detailCertificates = certResponse.rows || []
if (this.detailCertificates.length > 0) { if (this.detailCertificates.length > 0) {
this.detailCertActiveTab = 'detailCert' + this.detailCertificates[0].qualificationId this.detailCertActiveTab = 'detailCert' + this.detailCertificates[0].qualificationId
} }
} }
}).catch(error => { }).catch(error => {
console.error('加载证书详情失败:', error) console.error('加载证书详情失败:', error)
this.$message.error('加载证书详情失败')
}).finally(() => { }).finally(() => {
this.loadingCertDetail = false
this.loadingDetail = false
})
} else {
this.loadingDetail = false
}
} else {
this.$message.error(response.msg || '获取详情失败')
this.loadingDetail = false
}
}).catch(error => {
console.error('获取详情失败:', error)
this.$message.error('获取详情失败')
this.loadingDetail = false
}) })
}, },
@ -1255,9 +1198,6 @@ export default {
} }
.image-preview { .image-preview {
display: flex;
align-items: center;
.el-image { .el-image {
border: 1px solid #dcdfe6; border: 1px solid #dcdfe6;
border-radius: 4px; border-radius: 4px;
@ -1306,40 +1246,6 @@ export default {
} }
} }
.image-preview-dialog {
:deep(.el-dialog__body) {
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
min-height: 400px;
.el-image {
max-height: 70vh;
}
.image-slot-large {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 400px;
background: #f5f7fa;
color: #909399;
i {
font-size: 40px;
margin-bottom: 10px;
}
div {
font-size: 14px;
}
}
}
}
.cert-audit-form { .cert-audit-form {
margin-top: 20px; margin-top: 20px;
padding-top: 20px; padding-top: 20px;

Loading…
Cancel
Save