45 changed files with 1244 additions and 411 deletions
@ -0,0 +1,30 @@ |
|||
import request from '@/utils/request' |
|||
import qs from 'qs' |
|||
// 统一请求路径前缀
|
|||
const base = process.env.VUE_APP_URL |
|||
|
|||
// 文件上传接口
|
|||
export const uploadFile = '/api/file/upload' |
|||
// export const uploadFile = process.env.VUE_APP_BASE_API + '/customer/file/upload'
|
|||
|
|||
|
|||
|
|||
// 上传图片
|
|||
// export function imageUpload(data) {
|
|||
// return request({
|
|||
// url: '/portal/file/upload',
|
|||
// method: 'post',
|
|||
// data,
|
|||
// headers: { 'Content-Type': 'multipart/form-data' }
|
|||
// })
|
|||
// }
|
|||
|
|||
// 移除图片
|
|||
export function deleteFilesOss(data) { |
|||
return request({ |
|||
url: '/base/v1/baseVehicleAppendixs/deleteFilesOss', |
|||
method: 'post', |
|||
data: qs.stringify(data), |
|||
// headers: { 'Content-Type': 'multipart/form-data' }
|
|||
}) |
|||
} |
@ -1,222 +1,226 @@ |
|||
<template> |
|||
<div> |
|||
<el-upload ref="imgUpload" v-loading="loadding" class="avatar-uploader" :headers="accessToken" :action="uploadFile" :accept="accept" list-type="picture-card" :limit="limit" :file-list="files" :on-remove="removeImage" :on-preview="handlePictureCardPreview" :on-progress="uploadProgrees" :on-error="uploadError" :on-success="uploadImgSuccess_FuJian"> |
|||
<i class="el-icon-plus avatar-uploader-icon"/> |
|||
<el-upload ref="imgUpload" v-loading="loadding" class="avatar-uploader" :headers="accessToken" :action="uploadFile" |
|||
:accept="accept" list-type="picture-card" :file-list="files" :on-remove="removeImage" |
|||
:on-preview="handlePictureCardPreview" :on-progress="uploadProgrees" |
|||
:on-error="uploadError" :on-success="uploadImgSuccess_FuJian"> |
|||
<i class="el-icon-plus avatar-uploader-icon" /> |
|||
</el-upload> |
|||
<el-dialog :visible.sync="dialogVisible" title="查看图片"> |
|||
<el-dialog :visible.sync="dialogVisible" title="查看图片"> |
|||
<img width="100%" :src="dialogImageUrl" alt=""> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { uploadFile_yanchejiancha } from '@/api/portal/Upload' |
|||
import { getStorage } from '@/utils/auth.js' |
|||
import { |
|||
uploadFile |
|||
} from '@/api/portal/Upload' |
|||
import { |
|||
getStorage |
|||
} from '@/utils/auth.js' |
|||
|
|||
export default { |
|||
model: { |
|||
prop: 'name', |
|||
event: 'change' |
|||
}, |
|||
props: { |
|||
placeholder: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
bucket: { |
|||
type: String, |
|||
default: 'abc' |
|||
}, |
|||
// 长度 |
|||
width: { |
|||
type: String, |
|||
default: '270px' |
|||
}, |
|||
limit: { |
|||
type: Number, |
|||
default: '' |
|||
}, |
|||
accept: { |
|||
type: String, |
|||
default: '.jpg,.jpeg,.png,.JPG,.JPEG,' |
|||
}, |
|||
// 文件名称 |
|||
name: { |
|||
type: Array, |
|||
required: true |
|||
}, |
|||
uploadData: { |
|||
type: Object, |
|||
default: {} |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
dialogImageUrl: '', |
|||
dialogVisible: false, |
|||
accessToken: null, |
|||
uploadFile: uploadFile_yanchejiancha, |
|||
fileList_FuJian: [], |
|||
enclosure: '', |
|||
file_add: '', |
|||
file_catch: '', |
|||
files: [], |
|||
files_list: [], |
|||
filedUrl: '', |
|||
// fileUrl: fileUrl, |
|||
// showpicture:false, |
|||
isview: false, |
|||
nameArr: '', |
|||
loadding: false |
|||
} |
|||
}, |
|||
watch: { |
|||
name: { |
|||
deep: true, |
|||
immediate: true, |
|||
handler(newVal, oldVal) { |
|||
console.log('aaaa1', newVal) |
|||
this.files = newVal |
|||
console.log('aaaa2', this.files) |
|||
export default { |
|||
model: { |
|||
prop: 'name', |
|||
event: 'change' |
|||
}, |
|||
props: { |
|||
placeholder: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
bucket: { |
|||
type: String, |
|||
default: 'abc' |
|||
}, |
|||
// 长度 |
|||
width: { |
|||
type: String, |
|||
default: '270px' |
|||
}, |
|||
// limit: { |
|||
// type: Number, |
|||
// default: '' |
|||
// }, |
|||
accept: { |
|||
type: String, |
|||
default: '.jpg,.jpeg,.png,.JPG,.JPEG,' |
|||
}, |
|||
// 文件名称 |
|||
name: { |
|||
type: Array, |
|||
required: true |
|||
}, |
|||
uploadData: { |
|||
type: Object, |
|||
default: {} |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.Init() |
|||
}) |
|||
}, |
|||
created() { |
|||
this.uploadFile = uploadFile_yanchejiancha // 接口 |
|||
this.accessToken = { |
|||
token: getStorage() |
|||
} |
|||
}, |
|||
methods: { |
|||
showImg(imgList) { |
|||
this.files = imgList |
|||
console.log('123123123', this.files) |
|||
}, |
|||
view() { |
|||
// window.open(this.filedUrl) |
|||
}, |
|||
// 页面第一次加载 |
|||
Init() { |
|||
if (this.name !== undefined) { |
|||
this.files = [] |
|||
for (var i = 0; i < this.name.length; i++) { |
|||
this.files.push({ |
|||
name: this.name[i], |
|||
url: this.name[i] |
|||
}) |
|||
} |
|||
data() { |
|||
return { |
|||
dialogImageUrl: '', |
|||
dialogVisible: false, |
|||
accessToken: null, |
|||
uploadFile: uploadFile, |
|||
fileList_FuJian: [], |
|||
enclosure: '', |
|||
file_add: '', |
|||
file_catch: '', |
|||
files: [], |
|||
files_list: [], |
|||
filedUrl: '', |
|||
// fileUrl: fileUrl, |
|||
// showpicture:false, |
|||
isview: false, |
|||
nameArr: '', |
|||
loadding: false |
|||
} |
|||
}, |
|||
handlePictureCardPreview(file) { |
|||
this.dialogVisible = true |
|||
this.dialogImageUrl = file.url |
|||
}, |
|||
// 上传方案--成功后执行 |
|||
uploadImgSuccess_FuJian(response, file, fileList) { |
|||
console.log('您选择的file:', file) |
|||
if (file.response.code === '200') { |
|||
this.loadding = false |
|||
// 返显图片 |
|||
this.filedUrl = this.fileUrl + file.response.data |
|||
// var uid = file.response.data |
|||
this.files.push({ |
|||
name: file.response.data.sourceFileName, |
|||
url: file.response.data.fullUrl, |
|||
size: file.response.data.size |
|||
}) |
|||
this.$emit('change', this.files) |
|||
this.$emit('eett', this.files) |
|||
watch: { |
|||
name: { |
|||
deep: true, |
|||
immediate: true, |
|||
handler(newVal, oldVal) { |
|||
this.files = newVal |
|||
} |
|||
} |
|||
}, |
|||
|
|||
removeImage(file, ImageFileList) { |
|||
this.files.splice(this.files.indexOf(file), 1) |
|||
const imgFiles = [] |
|||
this.files.forEach((o) => { |
|||
imgFiles.push(o.url) |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.Init() |
|||
}) |
|||
this.$emit('fileChange', this.files) |
|||
}, |
|||
handleRemove(file, fileList) { |
|||
console.log('file:' + JSON.stringify(file)) |
|||
console.log('fileList:' + JSON.stringify(fileList)) |
|||
this.enclosure = '' |
|||
// 1. 保存新增文件id(this.file_add) |
|||
this.getNewFileId(fileList) |
|||
// 2. 保存数据库读取的已有文件id(this.file_catch) |
|||
this.getCatchFileId(file) |
|||
// 3. 保存并拼接id |
|||
this.getFileId() |
|||
// 4. 返回拼接id |
|||
this.$emit('change', this.enclosure) |
|||
}, |
|||
// 返回this.file_add(新上传文件的id拼接集合) |
|||
getNewFileId(fileList) { |
|||
// debugger |
|||
this.file_add = '' |
|||
for (var i = 0; i < fileList.length; i++) { |
|||
if (fileList[i].response && fileList[i].response.code === '200') { |
|||
this.file_add = this.file_add + fileList[i].response.data + ',' |
|||
} |
|||
created() { |
|||
this.uploadFile = uploadFile // 接口 |
|||
this.accessToken = { |
|||
token: getStorage() |
|||
} |
|||
if (this.file_add !== '') { |
|||
this.file_add = this.file_add.substring(0, this.file_add.length - 1) |
|||
} |
|||
// console.log('1. this.file_add: ' + this.file_add) |
|||
}, |
|||
// 返回this.file_catch(数库一寸照的文件的id的拼接集合) |
|||
getCatchFileId(file) { |
|||
for (var i = 0; i < this.files_list.length; i++) { |
|||
if (this.file_catch !== '') { |
|||
// 1. 检查当前删除的文件是否是修改文件列表里面的,如果是,将修改列表里去除此id |
|||
if (this.files_list[i].name === file.name) { |
|||
// 2. 拆开file_catch到fils_arry |
|||
var fils_arry = this.file_catch.split(',') |
|||
// 3. 从fils_arry去除 this.files_list[i].id |
|||
var arry = [] |
|||
fils_arry.forEach((element) => { |
|||
// 不加载文件里面的 |
|||
if (element !== this.files_list[i].id) { |
|||
arry.push(element) |
|||
} |
|||
methods: { |
|||
showImg(imgList) { |
|||
this.files = imgList |
|||
}, |
|||
view() { |
|||
// window.open(this.filedUrl) |
|||
}, |
|||
// 页面第一次加载 |
|||
Init() { |
|||
if (this.name !== undefined) { |
|||
this.files = [] |
|||
for (var i = 0; i < this.name.length; i++) { |
|||
this.files.push({ |
|||
name: this.name[i], |
|||
url: this.name[i] |
|||
}) |
|||
// 4. 重新拼接成file_catch |
|||
this.file_catch = arry.join(',') |
|||
} |
|||
} |
|||
} |
|||
// console.log('2. this.file_catch:' + this.file_catch) |
|||
}, |
|||
// 保存并拼接id |
|||
getFileId() { |
|||
// console.log('3. this.file_catch:' + this.file_catch + ',this.file_add:' + this.file_add) |
|||
if (this.file_catch !== '') { |
|||
}, |
|||
handlePictureCardPreview(file) { |
|||
this.dialogVisible = true |
|||
this.dialogImageUrl = file.url |
|||
}, |
|||
// 上传方案--成功后执行 |
|||
uploadImgSuccess_FuJian(response, file, fileList) { |
|||
console.log('您选择的file:', file) |
|||
if (file.response.code === '200') { |
|||
this.loadding = false |
|||
// 返显图片 |
|||
this.filedUrl = this.fileUrl + file.response.data |
|||
// var uid = file.response.data |
|||
this.files.push({ |
|||
name: file.response.data.sourceFileName, |
|||
url: file.response.data.fullUrl, |
|||
size: file.response.data.size |
|||
}) |
|||
this.$emit('change', this.files) |
|||
this.$emit('eett', this.files) |
|||
} |
|||
}, |
|||
|
|||
removeImage(file, ImageFileList) { |
|||
this.files.splice(this.files.indexOf(file), 1) |
|||
const imgFiles = [] |
|||
this.files.forEach((o) => { |
|||
imgFiles.push(o.url) |
|||
}) |
|||
this.$emit('fileChange', this.files) |
|||
}, |
|||
handleRemove(file, fileList) { |
|||
console.log('file:' + JSON.stringify(file)) |
|||
console.log('fileList:' + JSON.stringify(fileList)) |
|||
this.enclosure = '' |
|||
// 1. 保存新增文件id(this.file_add) |
|||
this.getNewFileId(fileList) |
|||
// 2. 保存数据库读取的已有文件id(this.file_catch) |
|||
this.getCatchFileId(file) |
|||
// 3. 保存并拼接id |
|||
this.getFileId() |
|||
// 4. 返回拼接id |
|||
this.$emit('change', this.enclosure) |
|||
}, |
|||
// 返回this.file_add(新上传文件的id拼接集合) |
|||
getNewFileId(fileList) { |
|||
// debugger |
|||
this.file_add = '' |
|||
for (var i = 0; i < fileList.length; i++) { |
|||
if (fileList[i].response && fileList[i].response.code === '200') { |
|||
this.file_add = this.file_add + fileList[i].response.data + ',' |
|||
} |
|||
} |
|||
if (this.file_add !== '') { |
|||
this.enclosure = this.file_catch + ',' + this.file_add |
|||
this.file_add = this.file_add.substring(0, this.file_add.length - 1) |
|||
} |
|||
// console.log('1. this.file_add: ' + this.file_add) |
|||
}, |
|||
// 返回this.file_catch(数库一寸照的文件的id的拼接集合) |
|||
getCatchFileId(file) { |
|||
for (var i = 0; i < this.files_list.length; i++) { |
|||
if (this.file_catch !== '') { |
|||
// 1. 检查当前删除的文件是否是修改文件列表里面的,如果是,将修改列表里去除此id |
|||
if (this.files_list[i].name === file.name) { |
|||
// 2. 拆开file_catch到fils_arry |
|||
var fils_arry = this.file_catch.split(',') |
|||
// 3. 从fils_arry去除 this.files_list[i].id |
|||
var arry = [] |
|||
fils_arry.forEach((element) => { |
|||
// 不加载文件里面的 |
|||
if (element !== this.files_list[i].id) { |
|||
arry.push(element) |
|||
} |
|||
}) |
|||
// 4. 重新拼接成file_catch |
|||
this.file_catch = arry.join(',') |
|||
} |
|||
} |
|||
} |
|||
// console.log('2. this.file_catch:' + this.file_catch) |
|||
}, |
|||
// 保存并拼接id |
|||
getFileId() { |
|||
// console.log('3. this.file_catch:' + this.file_catch + ',this.file_add:' + this.file_add) |
|||
if (this.file_catch !== '') { |
|||
if (this.file_add !== '') { |
|||
this.enclosure = this.file_catch + ',' + this.file_add |
|||
} else { |
|||
this.enclosure = this.file_catch |
|||
} |
|||
} else { |
|||
this.enclosure = this.file_catch |
|||
this.enclosure = this.file_add |
|||
} |
|||
} else { |
|||
this.enclosure = this.file_add |
|||
} |
|||
}, |
|||
// 上传失败 |
|||
uploadError() { |
|||
this.loadding = false |
|||
}, |
|||
uploadProgrees(event, file, fileList) { |
|||
if (Number(event.percent) > 0) { |
|||
this.loadding = true |
|||
}, |
|||
// 上传失败 |
|||
uploadError() { |
|||
this.loadding = false |
|||
}, |
|||
uploadProgrees(event, file, fileList) { |
|||
if (Number(event.percent) > 0) { |
|||
this.loadding = true |
|||
} |
|||
// console.log('event:', event) |
|||
} |
|||
// console.log('event:', event) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped></style> |
|||
|
@ -0,0 +1,12 @@ |
|||
-- 企业/集团信息 |
|||
INSERT INTO `enp_info` (`sid`, `name`, `code`) VALUES |
|||
('1001', '中鸿记', '1001'); |
|||
-- 企业品牌信息 |
|||
INSERT INTO `enp_brand` (`sid`, `name`, `code`, `enpSid`, `enpCode`, `enpName`) VALUES |
|||
('100101', '熟溢香', '100101', '1001', '1001', '中鸿记'), |
|||
('100102', '馍馍卤', '100102', '1001', '1001', '中鸿记'); |
|||
-- 企业门店信息 |
|||
INSERT INTO `enp_store` (`sid`, `name`, `code`, `enpSid`, `enpCode`, `enpName`, `brandSid`, `brandCode`, `brandName`) VALUES |
|||
('10010101', '熟溢香振头店', '10010101', '1001', '1001', '中鸿记','100101', '100101', '熟溢香'), |
|||
('10010102', '馍馍卤振岗店', '10010102', '1001', '1001', '中鸿记','100102', '100102', '馍馍卤'), |
|||
('10010103', '馍馍卤雅清街店', '10010103', '1001', '1001', '中鸿记','100102', '100102', '馍馍卤'); |
@ -1,7 +1,7 @@ |
|||
<?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.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand.EnpBrandMapper"> |
|||
<delete id="deleteEnpBrandBySid"> |
|||
delete from enp_brand where sid = #{sid} |
|||
</delete> |
|||
<select id="selectEnpBrandBEnpySid" resultType="com.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand.EnpBrand"> |
|||
select * from enp_brand where enpSid = #{sid} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,5 @@ |
|||
<?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.yxt.supervise.dbcenter.zhj.crawl.biz.enpInfo.EnpInfoMapper"> |
|||
|
|||
</mapper> |
@ -0,0 +1,112 @@ |
|||
package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
|
|||
/** |
|||
* @author shkstart |
|||
* @create 2023-05-11-11:03 |
|||
*/ |
|||
@ApiModel("企业门店信息 传输对象") |
|||
public class EnpStoreDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
|
|||
@ApiModelProperty("门店编码") |
|||
private String code; |
|||
@ApiModelProperty("门店名称") |
|||
private String name; |
|||
@ApiModelProperty("所属企业Sid") |
|||
private String enpSid; |
|||
@ApiModelProperty("所属企业编码") |
|||
private String enpCode; |
|||
@ApiModelProperty("所属企业名称") |
|||
private String enpName; |
|||
@ApiModelProperty("所属品牌Sid") |
|||
private String brandSid; |
|||
@ApiModelProperty("所属品牌编码") |
|||
private String brandCode; |
|||
@ApiModelProperty("所属品牌名称") |
|||
private String brandName; |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(String id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getSid() { |
|||
return sid; |
|||
} |
|||
|
|||
public void setSid(String sid) { |
|||
this.sid = sid; |
|||
} |
|||
|
|||
public String getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public void setCode(String code) { |
|||
this.code = code; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getEnpSid() { |
|||
return enpSid; |
|||
} |
|||
|
|||
public void setEnpSid(String enpSid) { |
|||
this.enpSid = enpSid; |
|||
} |
|||
|
|||
public String getEnpCode() { |
|||
return enpCode; |
|||
} |
|||
|
|||
public void setEnpCode(String enpCode) { |
|||
this.enpCode = enpCode; |
|||
} |
|||
|
|||
public String getEnpName() { |
|||
return enpName; |
|||
} |
|||
|
|||
public void setEnpName(String enpName) { |
|||
this.enpName = enpName; |
|||
} |
|||
|
|||
public String getBrandSid() { |
|||
return brandSid; |
|||
} |
|||
|
|||
public void setBrandSid(String brandSid) { |
|||
this.brandSid = brandSid; |
|||
} |
|||
|
|||
public String getBrandCode() { |
|||
return brandCode; |
|||
} |
|||
|
|||
public void setBrandCode(String brandCode) { |
|||
this.brandCode = brandCode; |
|||
} |
|||
|
|||
public String getBrandName() { |
|||
return brandName; |
|||
} |
|||
|
|||
public void setBrandName(String brandName) { |
|||
this.brandName = brandName; |
|||
} |
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @author shkstart |
|||
* @create 2023-05-11-11:11 |
|||
*/ |
|||
@Mapper |
|||
public interface EnpStoreMapper extends BaseMapper<EnpStore> { |
|||
EnpStore selectEnpStoreByEnpSid(@Param("sid") String sid); |
|||
|
|||
EnpStore selectEnpStoreByBrandSid(@Param("sid") String sid); |
|||
} |
@ -0,0 +1,11 @@ |
|||
<?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.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore.EnpStoreMapper"> |
|||
<select id="selectEnpStoreByEnpSid" resultType="com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore.EnpStore"> |
|||
select * from enp_store where enpSid = #{sid} |
|||
</select> |
|||
|
|||
<select id="selectEnpStoreByBrandSid" resultType="com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore.EnpStore"> |
|||
select * from enp_store where brandSid = #{sid} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,41 @@ |
|||
package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
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; |
|||
|
|||
/** |
|||
* @author shkstart |
|||
* @create 2023-05-11-11:07 |
|||
*/ |
|||
@Api("企业门店信息") |
|||
@RestController |
|||
@RequestMapping("dbCenter/enpStore") |
|||
public class EnpStoreRest { |
|||
|
|||
@Autowired |
|||
private EnpStoreService enpStoreService; |
|||
|
|||
@ApiOperation("新增企业门店信息") |
|||
@RequestMapping("/save") |
|||
public ResultBean save(@RequestBody EnpStoreDto dto){ |
|||
return enpStoreService.save(dto); |
|||
} |
|||
|
|||
@ApiOperation("删除企业门店信息") |
|||
@RequestMapping("/deleteEnpStore/{sid}") |
|||
public ResultBean deleteEnpStore(@PathVariable String sid){ |
|||
return enpStoreService.deleteEnpStore(sid); |
|||
} |
|||
|
|||
@ApiOperation("修改企业门店信息") |
|||
@RequestMapping("/alterEnpStore") |
|||
public ResultBean alterEnpStore(@RequestBody EnpStoreDto dto){ |
|||
return enpStoreService.alterEnpStore(dto); |
|||
} |
|||
} |
@ -0,0 +1,42 @@ |
|||
package com.yxt.supervise.dbcenter.zhj.crawl.biz.enpStore; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @author shkstart |
|||
* @create 2023-05-11-11:11 |
|||
*/ |
|||
@Service |
|||
public class EnpStoreService extends MybatisBaseService<EnpStoreMapper, EnpStore> { |
|||
|
|||
public ResultBean save(EnpStoreDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
EnpStore store = new EnpStore(); |
|||
BeanUtil.copyProperties(dto,store); |
|||
int insert = baseMapper.insert(store); |
|||
if (insert == 0){ |
|||
return rb.setMsg("新增失败"); |
|||
} |
|||
return rb.success().setMsg("新增成功"); |
|||
} |
|||
|
|||
public ResultBean deleteEnpStore(String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
int i = deleteBySid(sid); |
|||
return rb.success().setMsg("删除成功"); |
|||
} |
|||
|
|||
public ResultBean alterEnpStore(EnpStoreDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
EnpStore enpStore = fetchBySid(dto.getSid()); |
|||
BeanUtil.copyProperties(dto,enpStore,"id","sid"); |
|||
int i = baseMapper.updateById(enpStore); |
|||
if (i == 0){ |
|||
return rb.setMsg("修改失败"); |
|||
} |
|||
return rb.success().setMsg("修改成功"); |
|||
} |
|||
} |
@ -0,0 +1,72 @@ |
|||
package com.yxt.supervise.dbcenter.zhj.crawl.biz.materialInfo; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
|
|||
/** |
|||
* @author shkstart |
|||
* @create 2023-05-11-11:26 |
|||
*/ |
|||
@ApiModel("物料信息 传输对象") |
|||
public class MaterialInfoDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
|
|||
@ApiModelProperty("物料编码") |
|||
private String code; |
|||
@ApiModelProperty("物料名称") |
|||
private String name; |
|||
@ApiModelProperty("规格单位") |
|||
private String unit; |
|||
@ApiModelProperty("含税单位") |
|||
private String taxPrice; |
|||
|
|||
public String getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(String id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getSid() { |
|||
return sid; |
|||
} |
|||
|
|||
public void setSid(String sid) { |
|||
this.sid = sid; |
|||
} |
|||
|
|||
public String getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public void setCode(String code) { |
|||
this.code = code; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getUnit() { |
|||
return unit; |
|||
} |
|||
|
|||
public void setUnit(String unit) { |
|||
this.unit = unit; |
|||
} |
|||
|
|||
public String getTaxPrice() { |
|||
return taxPrice; |
|||
} |
|||
|
|||
public void setTaxPrice(String taxPrice) { |
|||
this.taxPrice = taxPrice; |
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.yxt.supervise.dbcenter.zhj.crawl.biz.materialInfo; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* @author shkstart |
|||
* @create 2023-05-11-11:35 |
|||
*/ |
|||
@Mapper |
|||
public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> { |
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.yxt.supervise.dbcenter.zhj.crawl.biz.materialInfo; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
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; |
|||
|
|||
/** |
|||
* @author shkstart |
|||
* @create 2023-05-11-11:28 |
|||
*/ |
|||
@Api("物料信息") |
|||
@RestController |
|||
@RequestMapping("dbCenter/materialInfo") |
|||
public class MaterialInfoRest { |
|||
|
|||
@Autowired |
|||
private MaterialInfoService materialInfoService; |
|||
|
|||
@ApiOperation("新增物料信息") |
|||
@RequestMapping("/save") |
|||
public ResultBean save(@RequestBody MaterialInfoDto dto){ |
|||
return materialInfoService.save(dto); |
|||
} |
|||
|
|||
@ApiOperation("删除物料信息") |
|||
@RequestMapping("/deleteMaterialInfo/{sid}") |
|||
public ResultBean deleteMaterialInfo(@PathVariable String sid){ |
|||
return materialInfoService.deleteMaterialInfo(sid); |
|||
} |
|||
|
|||
@ApiOperation("修改物料信息") |
|||
@RequestMapping("/alterMaterialInfo") |
|||
public ResultBean alterMaterialInfo(@RequestBody MaterialInfoDto dto){ |
|||
return materialInfoService.alterMaterialInfo(dto); |
|||
} |
|||
} |
@ -0,0 +1,42 @@ |
|||
package com.yxt.supervise.dbcenter.zhj.crawl.biz.materialInfo; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @author shkstart |
|||
* @create 2023-05-11-11:34 |
|||
*/ |
|||
@Service |
|||
public class MaterialInfoService extends MybatisBaseService<MaterialInfoMapper, MaterialInfo> { |
|||
|
|||
public ResultBean save(MaterialInfoDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
MaterialInfo info = new MaterialInfo(); |
|||
BeanUtil.copyProperties(dto,info); |
|||
int insert = baseMapper.insert(info); |
|||
if (insert == 0){ |
|||
return rb.setMsg("新增失败"); |
|||
} |
|||
return rb.success().setMsg("新增成功"); |
|||
} |
|||
|
|||
public ResultBean deleteMaterialInfo(String sid){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
int i = deleteBySid(sid); |
|||
return rb.success().setMsg("删除成功"); |
|||
} |
|||
|
|||
public ResultBean alterMaterialInfo(MaterialInfoDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
MaterialInfo materialInfo = fetchBySid(dto.getSid()); |
|||
BeanUtil.copyProperties(dto,materialInfo,"id","sid"); |
|||
int i = baseMapper.updateById(materialInfo); |
|||
if (i == 0){ |
|||
return rb.setMsg("修改失败"); |
|||
} |
|||
return rb.success().setMsg("修改成功"); |
|||
} |
|||
} |
Loading…
Reference in new issue