| | |
| | | trim: true |
| | | }) |
| | | } |
| | | |
| | | export function detail (id) { |
| | | return request.get(`/business/goods/${id}`) |
| | | } |
| | | // å建 |
| | | export function create (data) { |
| | | return request.post('/business/goods/create', data) |
| | |
| | | export function updateById (data) { |
| | | return request.post('/business/goods/updateById', data) |
| | | } |
| | | export function updateStatus (data) { |
| | | return request.post('/business/goods/updateStatus', data) |
| | | } |
| | | |
| | | export function findListByParentCategory (data) { |
| | | return request.post('/business/goods/findListByParentCategory', data) |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export function getPlatformConfig () { |
| | | return request.get('/system/dictData/getPlatformConfig' ,{}) |
| | | } |
| | | // ä¿®æ¹ |
| | | export function updPlatformConfig (data) { |
| | | return request.post('/system/dictData/updPlatformConfig', data) |
| | | } |
| | | |
| | |
| | | <el-form-item label="åååç§°" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请è¾å
¥åååç§°" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.type==2" label="ååæ ç¾" prop="labels"> |
| | | <el-input v-model="form.labels" placeholder="请è¾å
¥æ ç¾ï¼å¤ä¸ªç¨â,âéå¼ï¼ä¸è¶
è¿5个" v-trim/> |
| | | <el-form-item label="åååç±»" prop="categoryId"> |
| | | <el-select v-model="form.categoryId" placeholder="è¯·éæ©æå±åç±»" clearable filterable > |
| | | <el-option |
| | | v-for="item in labels()" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <template v-else> |
| | | <el-form-item label="åååç±»" prop="categoryId"> |
| | | <el-select |
| | | v-model="form.categoryId" |
| | | placeholder="è¯·éæ©æå±åç±»" |
| | | > |
| | | <el-option |
| | | v-for="item in labels()" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åååç" prop="brandId"> |
| | | <el-select |
| | | v-model="form.brandId" |
| | | placeholder="è¯·éæ©åååç" |
| | | > |
| | | <el-option |
| | | v-for="item in brands()" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </template> |
| | | <el-form-item label="åååç" prop="brandId"> |
| | | <el-select v-model="form.brandId" placeholder="è¯·éæ©åååç" clearable filterable > |
| | | <el-option |
| | | v-for="item in brands()" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åå主å¾" prop="imgurl"> |
| | | <UploadAvatarImage |
| | | :file="{ 'imgurlfull': form.imgurlfull, 'imgurl': form.imgurl }" |
| | | @uploadSuccess="uploadAvatarSuccess" |
| | | @uploadEnd="isUploading = false" |
| | | @uploadBegin="isUploading = true" |
| | | /> |
| | | <div style="display: flex; align-items: center;justify-content: center; height: 100%; width: 100%"> |
| | | <UploadAvatarImage |
| | | :file="{ 'imgurlfull': form.imgurlfull, 'imgurl': form.imgurl}" |
| | | :uploadData="{folder:'goods'}" |
| | | @uploadSuccess="uploadAvatarSuccess" |
| | | @uploadEnd="isUploading = false" |
| | | @uploadBegin="isUploading = true" |
| | | style=" width: 120px;" |
| | | /> |
| | | <div class="tip-warn" style=" margin-left: 20px; margin-top: 30px;"> |
| | | 建议尺寸ï¼100px X 100px |
| | | æ¯æpngãjpgãjpegæ ¼å¼ï¼å¤§å°ä¸è¶
è¿2Mï¼ä¸ä¼ å¾çä¸å
许æ¶åæ¿æ²»ææä¸è²æ
|
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.type==2" label="åè±é£å³" prop="fileList"> |
| | | <UploadAvatarImage |
| | | :file="{ 'imgurlfull': form.imgurlfull, 'imgurl': form.imgurl }" |
| | | @uploadSuccess="uploadAvatarSuccess" |
| | | @uploadEnd="isUploading = false" |
| | | @uploadBegin="isUploading = true" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item v-else label="ååè½®æå¾" prop="fileList"> |
| | | <el-form-item label="ååè½®æå¾" prop="fileList"> |
| | | <UploadImage |
| | | :fileList="form.fileList" |
| | | :uploadData="{folder:'goods'}" |
| | | @beginUpload="isUploading=true" |
| | | @endUpload="isUploading=false"/> |
| | | <p class="tip-warn"> |
| | | 建议尺寸ï¼750px X 750pxï¼ä¸é6å¼ |
| | | æ¯æpngãjpgãjpegæ ¼å¼ï¼å¤§å°ä¸è¶
è¿2Mï¼ä¸ä¼ å¾çä¸å
许æ¶åæ¿æ²»ææä¸è²æ
, |
| | | </p> |
| | | </el-form-item> |
| | | <el-form-item label="å±ç¤ºä»·æ ¼" prop="price"> |
| | | <el-input v-model="form.price" placeholder="请è¾å
¥å±ç¤ºä»·æ ¼" v-trim> |
| | | <template slot="append">{{ form.type != 1 ? 'å
' : 'åè±' }}</template> |
| | | <el-form-item label="åºåä»·ï¼å
ï¼" prop="price"> |
| | | <el-input type="number" v-model="form.price" placeholder="请è¾å
¥åºåä»·" v-trim> <template slot="append"> å
</template> </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="éå®ä»·ï¼å
ï¼" prop="skuPrice"> |
| | | <el-input type="number" v-model="form.skuPrice" placeholder="请è¾å
¥éå®ä»·" v-trim> <template slot="append"> å
</template> </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å线价ï¼å
ï¼" prop="showPrice"> |
| | | <el-input type="number" v-model="form.showPrice" placeholder="请è¾å
¥çº¿ä»·" v-trim> <template slot="append"> å
</template> </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç§¯åæµæ£é¢åº¦" prop="deductRata"> |
| | | <el-input type="number" v-model="form.deductRata" placeholder="请è¾å
¥ç§¯åæµæ£é¢åº¦" v-trim> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | <p class="tip-warn" style="margin-bottom: 1px;"><i class="el-icon-warning"></i>æéï¼ç§¯å坿µæ£éé¢å ååé¶å®ä»·çç¾åæ¯ï¼0.1%ï½100%ä¹é´ </p> |
| | | </el-form-item> |
| | | <el-form-item label="åºåé" prop="stockNum"> |
| | | <el-input type="number" v-model="form.stockNum" placeholder="请è¾å
¥åååºåé" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="åååä½" prop="unitName"> |
| | | <el-input v-model="form.unitName" placeholder="请è¾å
¥åååä½" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="åå§éé" prop="salenum"> |
| | | <el-input type="number" v-model="form.salenum" placeholder="请è¾å
¥åå§éé" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="ååéé" prop="weight"> |
| | | <el-input type="number" v-model="form.weight" placeholder="请è¾å
¥ååéé" v-trim> |
| | | <template slot="append">kg</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="form.type!=2" label="åå§éé" prop="salenum"> |
| | | <el-input v-model="form.salenum" placeholder="请è¾å
¥åå§éé" v-trim/> |
| | | <el-form-item label="æ¯å¦ä¸æ¶" prop="status"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio :value="1" :label="1" >䏿¶</el-radio> |
| | | <el-radio :value="0" :label="0" >䏿¶</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="使ç¨åååç" prop="brandIdList"> |
| | | <el-select v-model="form.brandIdList" placeholder="è¯·éæ©åååç" clearable multiple @change="changeBrand"> |
| | | <el-option |
| | | v-for="item in applyBrands" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <div v-if="form.brandIdList && form.brandIdList.length" style="border:1px solid #f2f2f2; margin-left: 150px;width: 700px;padding: 20px 0 0px 0;margin-bottom: 20px;" class="el-form-item__content"> |
| | | <!-- |
| | | <span style="line-height: 32px;font-size: 14px;"><b style="color: #F56C6C;margin-right: 4px;font-size: 11px;">*</b>{{'ã'+(item.name)+'ãç³»åï¼'}}</span> |
| | | --> |
| | | <el-form-item v-for="(item,index) in applyBrands" v-if="item.show" :key="'warning_'+index" style="display: block;width: 100%;" :label="'ã'+(item.name)+'ãç³»å'" > |
| | | <el-select v-model="item.childIdList" filterable multiple style=" width: 500px;" clearable placeholder="è¯·éæ©åçç³»å" > |
| | | <el-option v-for="item in item.childList" :label="item.name" :value="item.id" :key="'brand_'+index+item.id"> </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- |
| | | <el-button type="danger" style="margin-left: 10px;height: 32px; " @click="delDo(index)" v-if="index>0 || form.detailList.length>1">å é¤</el-button> |
| | | --> |
| | | </div> |
| | | <el-form-item label="åå详æ
" prop="content"> |
| | | <RichEditor :content="{ content : form.content}" @edit="form.content=$event" /> |
| | | <RichEditor :richData="form.content" :styleEditor="'border: 1px solid #ccc;display: inline-block;height:500px;'" @getWangedditor="getWangedditor" :readonly="false"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </GlobalWindow> |
| | |
| | | import UploadImage from '@/components/common/UploadImage' |
| | | import UploadAvatarImage from '@/components/common/UploadAvatarImage' |
| | | import RichEditor from '@/components/common/RichEditor' |
| | | import { findAll as labelList } from '@/api/business/labels' |
| | | export default { |
| | | name: 'OperaGoodsWindow', |
| | | extends: BaseOpera, |
| | |
| | | imgurlfull: '', |
| | | salenum: '', |
| | | type: 0, |
| | | creator: '', |
| | | createDate: '', |
| | | editor: '', |
| | | editDate: '', |
| | | isdeleted: '', |
| | | remark: '', |
| | | info: '', |
| | | content: '', |
| | | sortnum: '', |
| | | looknum: '', |
| | | type: '', |
| | | status: '', |
| | | isrec: '', |
| | | styleImg: '', |
| | | labels: '' |
| | | skuPrice: null, |
| | | status: 1, |
| | | showPrice: null, |
| | | deductRata: null, |
| | | weight: null, |
| | | unitName: '', |
| | | stockNum: null, |
| | | brandIdList: [], |
| | | brandList: [] |
| | | }, |
| | | applyBrands: [], |
| | | // éªè¯è§å |
| | | rules: { |
| | | name: [{ required: true, message: '请è¾å
¥åååç§°', tigger: 'blur' }], |
| | | categoryId: [{ required: true, message: 'è¯·éæ©æå±åç±»' }], |
| | | brandIdList: [{ required: true, message: '请å½å
¥éç¨åçåç³»åä¿¡æ¯' }], |
| | | weight: [{ required: true, message: '请è¾å
¥ååéé' }], |
| | | price: [{ required: true, message: '请è¾å
¥åååºåä»·' }], |
| | | skuPrice: [{ required: true, message: '请è¾å
¥ååé¶å®ä»·' }], |
| | | deductRata: [{ required: true, message: '请è¾å
¥ç§¯åæµæ£æ¯ä¾' }], |
| | | status: [{ required: true, message: 'è¯·éæ©æ¯å¦ä¸æ¶' }] |
| | | } |
| | | } |
| | | }, |
| | |
| | | api: '/business/goods', |
| | | 'field.id': 'id' |
| | | }) |
| | | this.loadBrandList() |
| | | }, |
| | | methods: { |
| | | isSeletedBrand (val) { |
| | | var r = false |
| | | if (!this.form.brandIdList || !this.form.brandIdList.length) { |
| | | return false |
| | | } |
| | | this.form.brandIdList.forEach(item => { |
| | | if (item === val.id) { |
| | | r = true |
| | | } |
| | | }) |
| | | return r |
| | | }, |
| | | changeBrand () { |
| | | this.applyBrands.forEach(item => { |
| | | item.show = this.isSeletedBrand(item) |
| | | }) |
| | | console.log(this.form.brandIdList, this.applyBrands) |
| | | }, |
| | | loadBrandList () { |
| | | labelList({ |
| | | type: 14 // éåºåååç |
| | | }) |
| | | .then(res => { |
| | | this.applyBrands = res |
| | | this.applyBrands.forEach(item => { |
| | | item.show = this.isSeletedBrand(item) |
| | | }) |
| | | }) |
| | | }, |
| | | getWangedditor (val) { |
| | | this.form.content = val |
| | | }, |
| | | open (title, target, type) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.form.brandIdList = [] |
| | | this.form.fileList = [] |
| | | this.form.imgurl='' |
| | | this.form.imgurlfull='' |
| | | // debugger |
| | | // æ°å»º |
| | | if (target == null) { |
| | |
| | | this.form[this.configData['field.id']] = null |
| | | this.form.type = type |
| | | }) |
| | | this.loadBrandList() |
| | | return |
| | | } |
| | | // ç¼è¾ |
| | | this.$nextTick(() => { |
| | | this.$nextTick(async () => { |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | } |
| | | this.form.type = type |
| | | await this.loadInfo(this.form.id) |
| | | if (this.form.imgurl) { |
| | | this.form.imgurlfull = target.resourcePath + target.imgurl |
| | | } |
| | | }) |
| | | }, |
| | | uploadAvatarSuccess(file) { |
| | | loadInfo () { |
| | | this.form.brandIdList =[] |
| | | this.form.fileList =[] |
| | | this.api.detail(this.form.id).then(res => { |
| | | if (res && res.brandList) { |
| | | this.form.brandList = res.brandList |
| | | res.brandList.forEach(item => { |
| | | this.form.brandIdList.push(item.id) |
| | | }) |
| | | } |
| | | if (res.fileList && res.fileList.length) { |
| | | res.fileList.forEach(item => { |
| | | this.form.fileList.push( |
| | | { |
| | | fileurl: item.fileurl, |
| | | name: item.fileName, |
| | | url: res.resourcePath + item.fileurl |
| | | } |
| | | ) |
| | | }) |
| | | console.log(this.form.fileList) |
| | | } |
| | | this.loadBrandList() |
| | | }) |
| | | }, |
| | | uploadAvatarSuccess (file) { |
| | | this.form.imgurlfull = file.imgurlfull |
| | | this.form.imgurl = file.imgurl |
| | | }, |
| | | confirm () { |
| | | this.form.brandList = [] |
| | | this.applyBrands.forEach(item => { |
| | | if (item.show) { |
| | | this.form.brandList.push(item) |
| | | } |
| | | }) |
| | | if (this.form.id == null || this.form.id === '') { |
| | | this.__confirmCreate() |
| | | return |
| | | } |
| | | this.__confirmEdit() |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | width: 100%; |
| | | } |
| | | } |
| | | ::v-deep .el-form-item__label{ |
| | | width: 150px !important; |
| | | } |
| | | </style> |
| | |
| | | </span> |
| | | </div> |
| | | </el-upload> |
| | | <el-image-viewer |
| | | v-if="showViewer" |
| | | <el-image-viewer |
| | | v-if="showViewer" |
| | | :on-close="closeViewer" |
| | | :initialIndex="tempIndex" |
| | | :url-list="srcList" |
| | | :z-index="3000" |
| | | /> |
| | | </div> |
| | | |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | maxNum: { |
| | | type: Number, |
| | | default: () => null |
| | | }, |
| | | uploadData: Object, |
| | | }, |
| | | data() { |
| | | return { |
| | | uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/public/uploadPicture', |
| | | |
| | | realList: [], |
| | | srcList: [], |
| | | tempIndex: 0, |
| | |
| | | watch: { |
| | | fileList: { |
| | | handler(val) { |
| | | console.log(val); |
| | | console.log("===================",val); |
| | | if (val.length==0) { |
| | | this.realList = [] |
| | | this.srcList = [] |
| | | }else{ |
| | | this.realList=val |
| | | val.forEach(item =>{ |
| | | this.srcList.push(item.url) |
| | | }) |
| | | } |
| | | |
| | | console.log("==================srcList=",this.srcList); |
| | | } |
| | | |
| | | |
| | | } |
| | | }, |
| | | methods: { |
| | | beforeUpload(file) { |
| | | |
| | | this.$emit('beginUpload') |
| | | return true |
| | | }, |
| | | // ä¸ä¼ å¾çæå |
| | | uploadSuccess (res, file, fileList) { |
| | | // console.log('this.fileList', this.fileList); |
| | | uploadSuccess (res, file, fileList) { |
| | | console.log('this.fileList', this.fileList); |
| | | // console.log('fileList', fileList); |
| | | this.$emit('endUpload') |
| | | this.realList = fileList |
| | | this.srcList.push(res.data.url) |
| | | // this.realList = fileList |
| | | // this.srcList.push(res.data.url) |
| | | // console.log('file', file); |
| | | if (res.code === 200) { |
| | | this.fileList.push( |
| | |
| | | this.$message.error('ä¸ä¼ 失败') |
| | | }, |
| | | handlePictureCardPreview(file) { |
| | | this.tempIndex = this.srcList.findIndex(item => item == file.response.data.url ) |
| | | this.tempIndex = this.srcList.findIndex(item => item == file.url ) |
| | | this.showViewer = true |
| | | }, |
| | | closeViewer() { |
| | |
| | | }, |
| | | handleRemove(file) { |
| | | console.log(this.fileList); |
| | | let tempIndex = this.realList.findIndex(item => item.fileurl === file.response.data.imgaddr) |
| | | let tempIndex = this.realList.findIndex(item => item.fileurl === file.fileurl) |
| | | // debugger |
| | | this.realList.splice(tempIndex, 1) |
| | | this.fileList.splice(tempIndex, 1) |
| | | this.srcList.splice(tempIndex, 1) |
| | | |
| | | |
| | | }, |
| | | }, |
| | | } |
| | |
| | | import pkg from '../../package' |
| | | import { trim } from './util' |
| | | import cache from '../plugins/cache' |
| | | import { Message } from 'element-ui' |
| | | |
| | | axios.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8' |
| | | const axiosInstance = axios.create({ |
| | |
| | | |
| | | // æ°å»ºè¯·æ±æ¦æªå¨ |
| | | axiosInstance.interceptors.request.use(config => { |
| | | console.log(config); |
| | | console.log(config) |
| | | // debugger |
| | | // åæ°å»ç©ºæ ¼ |
| | | if (config.trim === true) { |
| | |
| | | |
| | | // æ°å»ºååºæ¦æªå¨ |
| | | axiosInstance.interceptors.response.use((response) => { |
| | | // debugger |
| | | // 请æ±å¤±è´¥ |
| | | if (response.status !== 200) { |
| | | return Promise.reject(new Error('æå¡å¨ç¹å¿ï¼è¯·ç¨ååè¯')) |
| | |
| | | } |
| | | // ä¸å¡å¤±è´¥ |
| | | if (!response.data.success) { |
| | | Message.error(response.data.message) |
| | | return Promise.reject(response.data) |
| | | } |
| | | return response.data.data |
| | |
| | | <el-form-item label="åç±»åç§°" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请è¾å
¥åç±»åç§°" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="æå±æ¿å" prop="module"> |
| | | <el-select |
| | | v-model="searchForm.module" |
| | | placeholder="è¯·éæ©æå±æ¿å" |
| | | > |
| | | <el-option |
| | | :key="0" |
| | | :value="0" |
| | | label="å¹³å°åå" |
| | | ></el-option> |
| | | <el-option |
| | | :key="1" |
| | | :value="1" |
| | | label="åè±åå" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item>--> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:productlabel:create', 'business:productlabel:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaProductLabelWindow.open('æ°å»ºååæ ç¾ä¿¡æ¯è¡¨')" icon="el-icon-plus" v-permissions="['business:productlabel:create']">æ°å»º</el-button></li> |
| | | <li><el-button type="primary" @click="$refs.operaProductLabelWindow.open('æ°å»ºåååç±»')" icon="el-icon-plus" v-permissions="['business:productlabel:create']">æ°å»º</el-button></li> |
| | | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:productlabel:delete']">å é¤</el-button></li> |
| | | </ul> |
| | | <el-table |
| | |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="module" label="æå±æ¿å" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | {{ row.module==0?'å¹³å°åå':'åè±åå' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="åç±»åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="name" label="åååç±»" min-width="100px"></el-table-column> |
| | | <el-table-column prop="sortnum" label="æåºç (ååº)" min-width="100px"></el-table-column> |
| | | <el-table-column prop="createDate" label="å建æ¶é´" min-width="100px"></el-table-column> |
| | | <el-table-column prop="status" label="ç¶æ" min-width="100px"> |
| | |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaProductLabelWindow.open('ç¼è¾ååæ ç¾ä¿¡æ¯è¡¨', row)" icon="el-icon-edit" v-permissions="['business:productlabel:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="$refs.operaProductLabelWindow.open('ç¼è¾åååç±»', row)" icon="el-icon-edit" v-permissions="['business:productlabel:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:productlabel:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: 'ååæ ç¾ä¿¡æ¯è¡¨', |
| | | module: 'ååå类信æ¯è¡¨', |
| | | api: '/business/labels', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="box" style="max-height:calc(100% - 60px);margin-bottom:50px;overflow-y: auto" > |
| | | <el-form :model="form" ref="form"> |
| | | <div class="header"> |
| | | <span style="font-size: 15px; font-weight: bold">ã1ãæ³¨åå¥å±</span> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="积åå¥å±" label-width="150px" prop="regIntegralRewardStatus"> |
| | | <el-switch v-model="form.regIntegralRewardStatus" :active-value="0" :inactive-value="1" active-color="#13ce66" inactive-color="#ff4949" ></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="æ°äººæ³¨åé" label-width="250px" prop="regIntegralReward"> |
| | | <el-input style="width: 200px;margin: 0px 20px" type="number" v-model="form.regIntegralReward" placeholder="请è¾å
¥" v-trim> |
| | | <template slot="append">积å</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="伿 å¸å¥å±" label-width="150px" prop="regCouponRewardStatus"> |
| | | <el-switch v-model="form.regCouponRewardStatus" :active-value="0" :inactive-value="1" active-color="#13ce66" inactive-color="#ff4949" ></el-switch> |
| | | </el-form-item> |
| | | <div > |
| | | <el-form-item label="æ°äººæ³¨åé伿 å¸" label-width="250px" prop="regCouponRewardList"> |
| | | </el-form-item> |
| | | <div style="margin-left: 150px;border: 1px solid #f2f2f2"> |
| | | <el-table style="width: 600px;" :data="form.regCouponRewardList"> |
| | | <el-table-column prop="shopPrice" label="伿 å¸" min-width="300px" align="center"> |
| | | <template slot-scope="{row}" > |
| | | <el-select v-model="row.couponId" style="width: 200px;margin: 0px 20px" clearable filterable placeholder="è¯·éæ©ä¼æ å¸" > |
| | | <el-option v-for="item in couponList" :label="item.name" :value="item.id"> </el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="num" label="æ°é" min-width="200px" align="center"> |
| | | <template slot-scope="{row}" > |
| | | <el-input style="width: 100px;margin: 0px 20px" type="number" v-model="row.num" placeholder="请è¾å
¥æ°é" v-trim/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" min-width="100px" align="center"> |
| | | <template slot-scope="scope" > |
| | | <el-button style="color: red;border: none;" @click="delCoupon(0,scope.$index)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-button s type="primary" icon="el-icon-plus" @click="addCoupon(0)" style="height: 30px;margin: 10px;">æ·»å </el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="header"> |
| | | <span style="font-size: 15px; font-weight: bold">ã2ãé请好åå¥å±</span> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="积åå¥å±" label-width="150px" prop="shareIntegralRewardStatus"> |
| | | <el-switch v-model="form.shareIntegralRewardStatus" :active-value="0" :inactive-value="1" active-color="#13ce66" inactive-color="#ff4949" ></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="好åæå注åéé请人" label-width="250px" prop="shareIntegralReward"> |
| | | <el-input style="width: 200px;margin: 0px 20px" type="number" v-model="form.shareIntegralReward" placeholder="请è¾å
¥" v-trim> |
| | | <template slot="append">积å</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="伿 å¸å¥å±" label-width="150px" prop="shareCouponRewardStatus"> |
| | | <el-switch v-model="form.shareCouponRewardStatus" :active-value="0" :inactive-value="1" active-color="#13ce66" inactive-color="#ff4949" ></el-switch> |
| | | </el-form-item> |
| | | <div > |
| | | <el-form-item label="好å宿é¦åééè¯·äººä¼æ å¸" label-width="250px" prop="shareCouponRewardList"> |
| | | </el-form-item> |
| | | <div style="margin-left: 150px;border: 1px solid #f2f2f2"> |
| | | <el-table style="width: 600px;" :data="form.shareCouponRewardList"> |
| | | <el-table-column prop="couponId" label="伿 å¸" min-width="300px" align="center"> |
| | | <template slot-scope="{row}" > |
| | | <el-select v-model="row.couponId" style="width: 200px;margin: 0px 20px" clearable filterable placeholder="è¯·éæ©ä¼æ å¸" > |
| | | <el-option v-for="item in couponList" :label="item.name" :value="item.id"> </el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="num" label="æ°é" min-width="200px" align="center"> |
| | | <template slot-scope="{row}" > |
| | | <el-input style="width: 100px;margin: 0px 20px" type="number" v-model="row.num" placeholder="请è¾å
¥æ°é" v-trim/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" min-width="100px" align="center"> |
| | | <template slot-scope="scope" > |
| | | <el-button style="color: red;border: none;" @click="delCoupon(1,scope.$index)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-button s type="primary" icon="el-icon-plus" @click="addCoupon(1)" style="height: 30px;margin: 10px;">æ·»å </el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="header"> |
| | | <span style="font-size: 15px; font-weight: bold">ã3ãæ¶è´¹è¿ç§¯å</span> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="è¿ç¨æ·ç§¯å" label-width="150px" prop="returnMemberIntegralStatus"> |
| | | <el-switch v-model="form.returnMemberIntegralStatus" :active-value="0" :inactive-value="1" active-color="#13ce66" inactive-color="#ff4949" ></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="订åå®ä»é颿¯æ»¡" label-width="250px" prop="returnMemberIntegral"> |
| | | <el-input style="width: 250px;margin: 0px 20px" type="number" v-model="form.returnMemberIntegral" placeholder="请è¾å
¥" v-trim> |
| | | <template slot="append">å
è¿ç¨æ·1积å</template> |
| | | </el-input> |
| | | <p class="tip-warn" style="margin-bottom: 1px;"><i class="el-icon-warning"></i>æéï¼å®ä»éé¢å»é¤è¿è´¹</p> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="è¿ç»éå积å" label-width="150px" prop="returnShopIntegralStatus"> |
| | | <el-switch v-model="form.returnShopIntegralStatus" :active-value="0" :inactive-value="1" active-color="#13ce66" inactive-color="#ff4949" ></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="订åå®ä»é颿¯æ»¡" label-width="250px" prop="returnShopIntegral"> |
| | | <el-input style="width: 250px;margin: 0px 20px" type="number" v-model="form.returnShopIntegral" placeholder="请è¾å
¥" v-trim> |
| | | <template slot="append">å
è¿ç»éå1积å</template> |
| | | </el-input> |
| | | <p class="tip-warn" style="margin-bottom: 1px;"><i class="el-icon-warning"></i>æéï¼å®ä»éé¢å»é¤è¿è´¹</p> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="header"> |
| | | <span style="font-size: 15px; font-weight: bold">ã4ãåè®¡ä¼æ æ¿æ
æ¯ä¾</span> |
| | | </div> |
| | | <div class="item-content"> |
| | | <el-form-item label="æ»é¨æ¿æ
" label-width="150px" prop="totalRate"> |
| | | <el-input style="width: 200px;margin: 0px 20px" type="number" v-model="form.totalRate" placeholder="请è¾å
¥" v-trim> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | <p class="tip-warn" style="margin-bottom: 1px;"><i class="el-icon-warning"></i>æéï¼è®¾ç½®æ»é¨åç»éåå¨è®¢ååè®¡ä¼æ éé¢ä¸ï¼ä¼æ å¸+ç§¯åæµæ£ï¼åèªæ¿æ
çæ¯ä¾</p> |
| | | </el-form-item> |
| | | </div> |
| | | <el-form-item style="margin-top: 100px;width: 100%;text-align: center"> |
| | | <el-button type="primary" style="width: 300px" :loading="working" @click="submit">ä¿åé
置项</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getPlatformConfig, updPlatformConfig } from '@/api/system/dictData' |
| | | import {allList} from '@/api/business/coupon' |
| | | export default { |
| | | name: '', |
| | | data () { |
| | | return { |
| | | uploadData: { |
| | | folder: '' |
| | | }, |
| | | isUploading: false, |
| | | working: false, |
| | | couponList: [], |
| | | form: { |
| | | regIntegralRewardStatus: 0, |
| | | shareIntegralRewardStatus: 0, |
| | | regCouponRewardStatus: 0, |
| | | shareCouponRewardStatus: 0, |
| | | regIntegralReward: 0, |
| | | shareIntegralReward: 0, |
| | | regCouponRewardList: [], |
| | | shareCouponRewardList: [], |
| | | returnMemberIntegralStatus: 0, |
| | | returnShopIntegralStatus: 0, |
| | | returnMemberIntegral: 0, |
| | | returnShopIntegral: 0, |
| | | totalRate: 0 |
| | | } |
| | | } |
| | | }, |
| | | |
| | | created () { |
| | | this.getCouponList() |
| | | this.getData() |
| | | }, |
| | | |
| | | methods: { |
| | | getCouponList () { |
| | | allList({}) |
| | | .then(res => { |
| | | if (res) { |
| | | this.couponList = res || [] |
| | | } |
| | | }) |
| | | }, |
| | | delCoupon(type,index){ |
| | | if(type ===0){ |
| | | this.form.regCouponRewardList.splice(index,1) |
| | | }else if(type ===1){ |
| | | this.form.shareCouponRewardList.splice(index,1) |
| | | } |
| | | }, |
| | | addCoupon(type){ |
| | | if(type ===0){ |
| | | this.form.regCouponRewardList.push({couponId:null,num:null}) |
| | | }else if(type ===1){ |
| | | this.form.shareCouponRewardList.push({couponId:null,num:null}) |
| | | } |
| | | |
| | | }, |
| | | getData () { |
| | | getPlatformConfig({}) |
| | | .then(res => { |
| | | if (res) { |
| | | this.form = { |
| | | regIntegralRewardStatus: res.regIntegralRewardStatus || 0, |
| | | shareIntegralRewardStatus: res.shareIntegralRewardStatus || 0, |
| | | regCouponRewardStatus: res.regCouponRewardStatus || 0, |
| | | shareCouponRewardStatus: res.shareCouponRewardStatus || 0, |
| | | regIntegralReward: res.regIntegralReward || 0, |
| | | shareIntegralReward: res.shareIntegralReward || 0, |
| | | regCouponRewardList: res.regCouponRewardList || [], |
| | | shareCouponRewardList: res.shareCouponRewardList || [], |
| | | returnMemberIntegralStatus: res.returnMemberIntegralStatus || 0, |
| | | returnShopIntegralStatus: res.returnShopIntegralStatus || 0, |
| | | returnMemberIntegral: res.returnMemberIntegral || 0, |
| | | returnShopIntegral: res.returnShopIntegral || 0, |
| | | totalRate: res.totalRate || 0 |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | submit () { |
| | | console.log(this.form) |
| | | this.$refs.form.validate((valid) => { |
| | | if (!valid) { |
| | | return |
| | | } |
| | | // è°ç¨æ°å»ºæ¥å£ |
| | | this.isWorking = true |
| | | updPlatformConfig(this.form).then(res => { |
| | | this.$message.success('ä¿åæå') |
| | | this.getData() |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .el-container /deep/ .el-main{ |
| | | width: 100%; |
| | | overflow-y: auto !important ; |
| | | height: calc(100% - 94px); |
| | | } |
| | | .item-content{ |
| | | display: flex; |
| | | width: 100%; |
| | | } |
| | | .header{ |
| | | margin: 20px 0 20px 0;padding:10px;background-color: rgba(140,147,157,0.61); |
| | | } |
| | | /deep/ .el-main{ |
| | | width: 100%; |
| | | //height: 100%; |
| | | overflow-y: auto !important ; |
| | | height: calc(100% - 94px); |
| | | } |
| | | .box { |
| | | width: 100%; |
| | | padding: 30px; |
| | | box-sizing: border-box; |
| | | background: #ffffff; |
| | | } |
| | | </style> |
| | |
| | | <TableLayout :permissions="['business:goods:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-tabs v-model="activeName" @tab-click="handleClick"> |
| | | <!-- <el-tabs v-model="activeName" @tab-click="handleClick"> |
| | | <el-tab-pane label="å
¨é¨åå" name="first"></el-tab-pane> |
| | | <el-tab-pane label="å·²å®ç½åå" name="second"></el-tab-pane> |
| | | <el-tab-pane label="åæ¶ç«åå" name="third"></el-tab-pane> |
| | | </el-tabs> |
| | | </el-tabs>--> |
| | | <el-form-item label="åååç§°" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请è¾å
¥åååç§°" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | <el-button @click="$refs.operaPlatformGoodsSkuWindow.open('å¹³å°SKU')">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:goods:create', 'business:goods:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaGoodsWindow.open('æ°å»ºåå', null, 0)" v-permissions="['business:goods:create']">æ°å»º</el-button></li> |
| | | <li><el-button type="primary" @click="issued(0)">䏿¶</el-button></li> |
| | | <li><el-button type="primary" @click="soldOut(1)">䏿¶</el-button></li> |
| | | <li><el-button type="primary" icon="el-icon-plus" @click="$refs.operaGoodsWindow.open('æ°å»ºåå', null, 0)" v-permissions="['business:goods:create']">æ°å»º</el-button></li> |
| | | <li><el-button type="primary" icon="el-icon-edit" @click="issued(0)">䏿¶</el-button></li> |
| | | <li><el-button type="danger" icon="el-icon-edit" @click="issued(1)">䏿¶</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="imgurl" label="ååä¿¡æ¯" min-width="200px"> |
| | | <el-table-column prop="imgurl" label="ååä¿¡æ¯" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <el-image v-if="row.imgurl" :src="row.resourcePath+row.imgurl" :preview-src-list="[row.resourcePath+row.imgurl]"></el-image> |
| | | {{ row.name }} |
| | | <el-image style="width: 80px;height: 80px;" v-if="row.imgurl && row.imgurl!=''" :src="row.resourcePath+row.imgurl" :preview-src-list="[row.resourcePath+row.imgurl]"></el-image> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="id" label="ååID" min-width="150px" ></el-table-column> |
| | |
| | | <el-table-column prop="stockNum" label="å©ä½åºåé" min-width="100px"></el-table-column> |
| | | <el-table-column prop="salesVolume" label="å®é
éé" min-width="100px"></el-table-column> |
| | | <el-table-column prop="skuPrice" label="é¶å®ä»·(å
)" min-width="100px"></el-table-column> |
| | | <el-table-column prop="shopPrice" label="ä¾è´§ä»·è®¾ç½®" min-width="100px" align="center"> |
| | | <template slot-scope="{row}" > |
| | | <div @click="goPriceSet(row)" style="cursor:pointer;"><span class="red"> {{row.shopPriceNum||0}}</span> / <span class="green"> {{row.shopNum||0}}</span> </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="editDate" label="æè¿æ´æ°æ¶é´" min-width="100px"></el-table-column> |
| | | <el-table-column prop="status" label="ç¶æ" min-width="100px"> |
| | | <el-table-column prop="status" label="ä¸ä¸æ¶ç¶æ" min-width="100px" fixed="right" align="center"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch |
| | | v-model="row.status" |
| | | :active-value="1" |
| | | :inactive-value="0" |
| | | :active-value="0" |
| | | :inactive-value="1" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949" |
| | | @change="statusChange(row)" |
| | |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | min-width="120" |
| | | min-width="250" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaGoodsWindow.open('ç¼è¾åå', row, 0)" v-permissions="['business:goods:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="deleteById(row)" v-permissions="['business:goods:delete']">å é¤</el-button> |
| | | <el-button type="text" @click="$refs.operaGoodsDetailWindow.open('åå详æ
', row, 0)">æ¥ç详æ
</el-button> |
| | | <el-button type="text" @click="$refs.operaGoodsWindow.open('ç¼è¾åå', row, 0)" v-permissions="['business:goods:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="goPriceSet(row)">ä¾è´§ä»·</el-button> |
| | | <el-button type="text" style="color: red;" @click="deleteById(row)" v-permissions="['business:goods:delete']">å é¤</el-button> |
| | | <!-- <el-button type="text" @click="$refs.operaGoodsDetailWindow.open('åå详æ
', row, 0)">æ¥ç详æ
</el-button>--> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | import OperaGoodsWindow from '@/components/business/OperaGoodsWindow' |
| | | import OperaGoodsDetailWindow from '@/components/business/OperaGoodsDetailWindow' |
| | | import OperaPlatformGoodsSkuWindow from '@/components/business/OperaPlatformGoodsSkuWindow' |
| | | import { fetchList as labelList } from '@/api/business/labels' |
| | | import { updateById } from '@/api/business/goods' |
| | | import { findAll as labelList } from '@/api/business/labels' |
| | | export default { |
| | | name: 'Goods', |
| | | extends: BaseTable, |
| | |
| | | labels: '' |
| | | }, |
| | | labels: [], |
| | | brands: [], |
| | | serials: [], |
| | | brands: [] |
| | | } |
| | | }, |
| | | provide() { |
| | | provide () { |
| | | return { |
| | | labels: () => this.labels, |
| | | brands: () => this.brands, |
| | | brands: () => this.brands |
| | | } |
| | | }, |
| | | created () { |
| | |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | |
| | | labelList({ |
| | | capacity: 999, |
| | | model: { |
| | | type: 0 //åååç±» |
| | | } |
| | | type: 0 // åååç±» |
| | | }).then(res => { |
| | | this.labels = res |
| | | }) |
| | | labelList({ |
| | | type: 1 // åååç |
| | | }) |
| | | .then(res => { |
| | | this.labels = res.records |
| | | }) |
| | | labelList({ |
| | | capacity: 999, |
| | | model: { |
| | | type: 1 //åååç |
| | | } |
| | | }) |
| | | .then(res => { |
| | | this.brands = res.records |
| | | this.brands = res |
| | | }) |
| | | }, |
| | | methods: { |
| | | handleClick(val) { |
| | | goPriceSet(row){ |
| | | |
| | | }, |
| | | handleClick (val) { |
| | | }, |
| | | /** |
| | | * |
| | | * @param {ä¸ä¸ç¶æ} status 0䏿¶ 1䏿¶ |
| | | */ |
| | | issued(status) { |
| | | issued (status) { |
| | | if (this.tableData.selectedRows.length === 0) { |
| | | this.$tip.warning('请è³å°éæ©ä¸æ¡æ°æ®') |
| | | return |
| | | } |
| | | let message = `确认${status==0?'䏿¶':'䏿¶'}éä¸çååä¹?` |
| | | const message = `确认${status === 0 ? '䏿¶' : '䏿¶'}éä¸çååä¹?` |
| | | this.$dialog.messageWaring(message) |
| | | .then(() => { |
| | | |
| | | }) |
| | | }, |
| | | |
| | | statusChange(row) { |
| | | updateById(row) |
| | | statusChange (row) { |
| | | this.statusChangeBiz([row]) |
| | | }, |
| | | statusChangeBiz (rows) { |
| | | this.api.updateStatus(rows) |
| | | .then(() => { |
| | | this.$message.success('æä½æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | this.$message.error('æä½æå') |
| | | }) |
| | | .then(() => { |
| | | this.handlePageChange() |
| | | this.search() |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | public ApiResponse<PageData<Coupon>> findPage (@RequestBody PageWrap<Coupon> pageWrap) { |
| | | return ApiResponse.success(couponService.findPage(pageWrap)); |
| | | } |
| | | @ApiOperation("å表æ¥è¯¢") |
| | | @PostMapping("/list") |
| | | @RequiresPermissions("business:coupon:query") |
| | | public ApiResponse<List<Coupon>> findList (@RequestBody Coupon pageWrap) { |
| | | return ApiResponse.success(couponService.findList(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | |
| | | @RestController |
| | | @RequestMapping("/business/goods") |
| | | public class GoodsController extends BaseController { |
| | | |
| | | @Autowired |
| | | private GoodsService goodsService; |
| | | |
| | |
| | | |
| | | |
| | | @ApiOperation("ååä¸ä¸æ¶ç¶æä¿®æ¹") |
| | | @PostMapping("/updateStatusById") |
| | | @PostMapping("/updateStatus") |
| | | @RequiresPermissions("business:goods:update") |
| | | public ApiResponse updateStatusById(@RequestBody List<Goods> list) { |
| | | public ApiResponse updateStatus(@RequestBody List<Goods> list) { |
| | | goodsService.updateStatusById(list); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.system.dto.PlatformConfigDTO; |
| | | import com.doumee.dao.system.dto.QuerySystemDictDataDTO; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.dao.system.vo.SystemDictDataListVO; |
| | |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("è·åå¹³å°é
置项") |
| | | @GetMapping("/getPlatformConfig") |
| | | public ApiResponse<PlatformConfigDTO> getPlatformConfig () { |
| | | return ApiResponse.success(systemDictDataService.getPlatformConfigDTO()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("æ´æ°å¹³å°é
置项") |
| | | @PostMapping("/updPlatformConfig") |
| | | public ApiResponse updPlatformConfig (@RequestBody PlatformConfigDTO platformConfigDTO) { |
| | | systemDictDataService.updPlatformConfig(platformConfigDTO); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | } |
| | |
| | | public static final int THREE = 3 ; |
| | | public static final int FOUR = 4 ; |
| | | public static final String LABELS_IMG ="LABELS_IMG" ; |
| | | public static final String ORDERSET_REG_INTEGRAL_REWARD_STATUS = "ORDERSET_REG_INTEGRAL_REWARD_STATUS"; |
| | | public static final String ORDERSET_SHARE_INTEGRAL_REWARD_STATUS="ORDERSET_SHARE_INTEGRAL_REWARD_STATUS"; |
| | | public static final String ORDERSET_REG_COUPON_REWARD_STATUS="ORDERSET_REG_COUPON_REWARD_STATUS"; |
| | | public static final String ORDERSET_SHARE_COUPON_REWARD_STATUS="ORDERSET_SHARE_COUPON_REWARD_STATUS"; |
| | | public static final String ORDERSET_REG_INTEGRAL_REWARD="ORDERSET_REG_INTEGRAL_REWARD"; |
| | | public static final String ORDERSET_SHARE_INTEGRAL_REWARD="ORDERSET_SHARE_INTEGRAL_REWARD"; |
| | | public static final String ORDERSET_REG_COUPON_REWARD_LIST="ORDERSET_REG_COUPON_REWARD_LIST"; |
| | | public static final String ORDERSET_SHARE_COUPON_REWARD_LIST="ORDERSET_SHARE_COUPON_REWARD_LIST"; |
| | | public static final String ORDERSET_RETURN_MEMBER_INTEGRAL_STATUS="ORDERSET_RETURN_MEMBER_INTEGRAL_STATUS"; |
| | | public static final String ORDERSET_RETURN_SHOP_INTEGRAL_STATUS="ORDERSET_RETURN_SHOP_INTEGRAL_STATUS"; |
| | | public static final String ORDERSET_RETURN_MEMBER_INTEGRAL="ORDERSET_RETURN_MEMBER_INTEGRAL"; |
| | | public static final String ORDERSET_RETURN_SHOP_INTEGRAL="ORDERSET_RETURN_SHOP_INTEGRAL"; |
| | | public static final String ORDERSET_TOTAL_RATE="ORDERSET_TOTAL_RATE"; |
| | | public static final String ORDER_SET ="ORDER_SET" ; |
| | | |
| | | /** |
| | | * mq tag |
| | |
| | | @ApiModelProperty(value = "skuéé¢", hidden = true) |
| | | @TableField(exist = false) |
| | | private BigDecimal skuPrice; |
| | | @ApiModelProperty(value = "skuæ¾ç¤ºä»·æ ¼", hidden = true) |
| | | @TableField(exist = false) |
| | | private BigDecimal showPrice; |
| | | |
| | | @ApiModelProperty(value = "skuæ»éé¢", hidden = true) |
| | | @TableField(exist = false) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.system.dto; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2023/3/23 9:50 |
| | | */ |
| | | @Data |
| | | @ApiModel("ç³»ç»è®¢åé
ç½®") |
| | | public class PlatformConfigDTO { |
| | | |
| | | @ApiModelProperty(value = "注å积åå¥å±ç¶æ 0å¼å¯ 1å
³é") |
| | | private Integer regIntegralRewardStatus; |
| | | @ApiModelProperty(value = "é请好å积åå¥å±ç¶æ 0å¼å¯ 1å
³é") |
| | | private Integer shareIntegralRewardStatus; |
| | | @ApiModelProperty(value = "注å伿 å¸å¥å±ç¶æ 0å¼å¯ 1å
³é") |
| | | private Integer regCouponRewardStatus; |
| | | @ApiModelProperty(value = "é请好å伿 å¸å¥å±ç¶æ 0å¼å¯ 1å
³é") |
| | | private Integer shareCouponRewardStatus; |
| | | |
| | | @ApiModelProperty(value = "注å积åå¥å±æ°é") |
| | | private BigDecimal regIntegralReward; |
| | | @ApiModelProperty(value = "é请好å积åå¥å±æ°é") |
| | | private BigDecimal shareIntegralReward; |
| | | |
| | | @ApiModelProperty(value = "注å伿 å¸å¥å±éå") |
| | | private List<JSONObject> regCouponRewardList; |
| | | @ApiModelProperty(value = "é请好å伿 å¸å¥å±éå") |
| | | private List<JSONObject> shareCouponRewardList; |
| | | |
| | | @ApiModelProperty(value = "æ¶è´¹è¿ç§¯å-è¿ç¨æ·ç§¯åç¶æ 0å¼å¯ 1å
³é") |
| | | private Integer returnMemberIntegralStatus; |
| | | @ApiModelProperty(value = "æ¶è´¹è¿ç§¯å-è¿ç»éå积åç¶æ 0å¼å¯ 1å
³é") |
| | | private Integer returnShopIntegralStatus; |
| | | @ApiModelProperty(value = "æ¶è´¹è¿ç§¯å-è¿ç¨æ·ç§¯åæ°é") |
| | | private BigDecimal returnMemberIntegral; |
| | | @ApiModelProperty(value = "æ¶è´¹è¿ç§¯å-è¿ç»éåç§¯åæ°é") |
| | | private BigDecimal returnShopIntegral; |
| | | @ApiModelProperty(value = "åè®¡ä¼æ æ¿æ
æ¯ä¾ï¼%ï¼") |
| | | private BigDecimal totalRate; |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Coupon> findList(Coupon coupon) { |
| | | QueryWrapper<Coupon> wrapper = new QueryWrapper<>(coupon); |
| | | return couponMapper.selectList(wrapper); |
| | | public List<Coupon> findList(Coupon pageWrap) { |
| | | MPJLambdaWrapper<Coupon> queryWrapper = new MPJLambdaWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap ); |
| | | queryWrapper.selectAll(Coupon.class); |
| | | queryWrapper.like(StringUtils.isNotBlank(pageWrap. getName()),Coupon::getName,pageWrap.getName()); |
| | | queryWrapper.eq(Coupon::getIsdeleted,Constants.ZERO); |
| | | queryWrapper.orderByDesc(Coupon::getCreateDate); |
| | | List<Coupon> result = couponJoinMapper.selectList( queryWrapper); |
| | | for(Coupon model:result){ |
| | | initCouponStatus(model); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | |
| | | goodsSku.setGoodsId(goods.getId()); |
| | | goodsSku.setName(goods.getName()); |
| | | goodsSku.setPrice(goods.getSkuPrice()); |
| | | goodsSku.setShowPrice(goods.getPrice()); |
| | | goodsSku.setShowPrice(goods.getShowPrice()); |
| | | goodsSku.setStock(goods.getStockNum()); |
| | | goodsSku.setIntegralRate(goods.getDeductRata()); |
| | | goodsSku.setUnitName(goods.getUnitName()); |
| | |
| | | || goods.getBrandList() == null |
| | | || goods.getBrandList().size() == 0 |
| | | || goods.getWeight() == null |
| | | || goods.getDeductRata() == null |
| | | || goods.getPrice() == null |
| | | || goods.getSkuPrice() == null |
| | | || StringUtils.isBlank(goods.getImgurl()) |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), ResponseStatus.BAD_REQUEST.getMessage()); |
| | | } |
| | | |
| | | if(goods.getDeductRata().compareTo(new BigDecimal(0.1)) <Constants.ZERO || |
| | | goods.getDeductRata().compareTo(new BigDecimal(100)) >Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对ä¸èµ·ï¼ç§¯å坿µæ£é颿¯ä¾è¯·è®¾ç½®[0.1,100]ä¹é´~"); |
| | | } |
| | | //æ¥è¯¢åç±» |
| | | Labels cate = labelsMapper.selectById(goods.getCategoryId()); |
| | | if(cate == null || Constants.equalsInteger(cate.getIsdeleted(),Constants.ONE) |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对ä¸èµ·ï¼å类信æ¯ä¸åå¨"); |
| | | } |
| | | if(goods.getBrandId()!=null){ |
| | | Labels brand = labelsMapper.selectById(goods.getCategoryId()); |
| | | Labels brand = labelsMapper.selectById(goods.getBrandId()); |
| | | if(brand == null || Constants.equalsInteger(brand.getIsdeleted(),Constants.ONE) |
| | | ||! Constants.equalsInteger(brand.getType(),Constants.LabelsType.GOODSBRAND.getKey())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对ä¸èµ·ï¼åçä¿¡æ¯ä¸åå¨"); |
| | |
| | | List<Integer> bIds = new ArrayList<>(); |
| | | for(Labels b : goods.getBrandList()){ |
| | | bIds.add(b.getId()); |
| | | if(b.getChildIdList() == null || b.getChildIdList().size() ==0){ |
| | | if(b.getChildIdList() != null && b.getChildIdList().size() >=0){ |
| | | bIds.addAll(b.getChildIdList()); |
| | | } |
| | | } |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对ä¸èµ·ï¼è¯·éæ©æ£ç¡®çéç¨åç"); |
| | | } |
| | | idsBrand.add("["+b.getId()+"]"); |
| | | if(b.getChildIdList() == null || b.getChildIdList().size() ==0){ |
| | | if(b.getChildIdList()!= null && b.getChildIdList().size() >=0){ |
| | | for(Integer c :b.getChildIdList()){ |
| | | Labels cb = findLabelFromListByid(allBrands,b.getId(),Constants.LabelsType.SERIES_BRAND.getKey(),b.getId()); |
| | | Labels cb = findLabelFromListByid(allBrands,c,Constants.LabelsType.SERIES_BRAND.getKey(),b.getId()); |
| | | if(cb == null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对ä¸èµ·ï¼åçã"+tb.getName() +"ã䏿å±ç³»å䏿£ç¡®"); |
| | | } |
| | |
| | | if(idsSerial.size()>0){ |
| | | goods.setSerialIds(String.join(",",idsSerial)); |
| | | } |
| | | |
| | | } |
| | | |
| | | private Labels findLabelFromListByid(List<Labels> allBrands, Integer id, int type,Integer parentId) { |
| | |
| | | } |
| | | for(Labels labels:allBrands){ |
| | | if(!Constants.equalsInteger(id,labels.getId())){ |
| | | return null; |
| | | continue; |
| | | } |
| | | if(!Constants.equalsInteger(type,labels.getType())){ |
| | | return null; |
| | | continue; |
| | | } |
| | | if(parentId !=null && !Constants.equalsInteger(parentId,labels.getParentId())){ |
| | | return null; |
| | | continue; |
| | | } |
| | | return labels; |
| | | } |
| | |
| | | skuMapper.update(null,new UpdateWrapper<Sku>().lambda() |
| | | .set(Sku::getIsdeleted,Constants.ONE) |
| | | .eq(Sku::getIsdeleted,Constants.ZERO) |
| | | .eq(Sku::getGoodsId,goods.getSkuId())); |
| | | .eq(Sku::getGoodsId,goods.getId())); |
| | | goodsSkuMapper.update(null,new UpdateWrapper<GoodsSku>().lambda() |
| | | .set(GoodsSku::getIsdeleted,Constants.ONE) |
| | | .eq(GoodsSku::getIsdeleted,Constants.ZERO) |
| | | .eq(GoodsSku::getGoodsId,goods.getSkuId())); |
| | | .eq(GoodsSku::getGoodsId,goods.getId())); |
| | | dealDefaultGoodsSku(goods);//æ°å»ºskuä¿¡æ¯ |
| | | dealBatchMultiFiles(goods, goods.getFileList(), user,true); |
| | | } |
| | |
| | | @Override |
| | | public Goods findById(Integer id) { |
| | | MPJLambdaWrapper<Goods> queryWrapper = new MPJLambdaWrapper<>(); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() + systemDictDataBiz.queryByCode(Constants.OSS, Constants.ACTIVITY_FILE).getCode(); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_FILE).getCode(); |
| | | |
| | | queryWrapper.eq(Goods::getId,id); |
| | | queryWrapper.selectAll(Goods.class); |
| | |
| | | //é»è®¤skuä¿¡æ¯ |
| | | GoodsSku goodsSku = goodsSkuList.get(0); |
| | | goods.setSkuPrice(goodsSku.getPrice()); |
| | | goods.setShowPrice(goodsSku.getShowPrice()); |
| | | goods.setWeight(goodsSku.getWeight()); |
| | | goods.setStockNum(goodsSku.getStock()); |
| | | goods.setUnitName(goodsSku.getUnitName()); |
| | |
| | | } |
| | | } |
| | | } |
| | | goods.setBrandList(brandList); |
| | | } |
| | | } |
| | | |
| | |
| | | queryWrapper.leftJoin(Labels.class,Labels::getId,Goods::getBrandId); |
| | | queryWrapper.leftJoin(Labels.class,Labels::getId,Goods::getParentCategoryId); |
| | | //åºåé |
| | | queryWrapper.select("(select sum(STOCK) from goods_sku where ISDELETED=0 and GOODS_ID=t.id) as stockNum "); |
| | | queryWrapper.select("(select sum(STOCK) from goods_sku where ISDELETED=0 and GOODS_ID=t.id) as stockNum "); |
| | | //å®é
éé |
| | | queryWrapper.select("(select sum(gd.GOODS_NUM) from goodsorder_detail gd" + |
| | | " inner join goods_sku gs on gs.id=gd.GOODS_SKU_ID" + |
| | |
| | | if (list == null || list.size() == 0) { |
| | | return; |
| | | } |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() + systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_FILE).getCode(); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.GOODS_FILE).getCode(); |
| | | for (Goods goods : list) { |
| | | goods.setResourcePath(path); |
| | | //æ¥è¯¢sku |
| | |
| | | //é»è®¤skuä¿¡æ¯ |
| | | goods.setSkuPrice(goodsSku.getPrice()); |
| | | goods.setWeight(goodsSku.getWeight()); |
| | | goods.setShowPrice(goodsSku.getShowPrice()); |
| | | goods.setStockNum(goodsSku.getStock()); |
| | | goods.setUnitName(goodsSku.getUnitName()); |
| | | } |
| | | // initGoodsApplyBrandAndSerial(goods); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<Labels> findList(Labels labels) { |
| | | |
| | | |
| | | MPJLambdaWrapper<Labels> query = new MPJLambdaWrapper<>(); |
| | | |
| | | if(labels!=null&&labels.getParentId()!=null){ |
| | | query.eq(Labels::getParentId,labels.getParentId()); |
| | | }else{ |
| | |
| | | } |
| | | query.eq(Labels::getIsdeleted,Constants.ZERO); |
| | | query.eq(labels.getType()!=null,Labels::getType,labels.getType()); |
| | | query.orderByAsc(Labels::getSortnum); |
| | | List<Labels> list= labelsJoinMapper.selectList(query); |
| | | List<Labels> childList= null; |
| | | if(Constants.equalsInteger(labels.getType(),Constants.LabelsType.APPLICABLE_BRAND.getKey())){ |
| | | childList= labelsJoinMapper.selectList(new QueryWrapper<Labels>().lambda() |
| | | .eq(Labels::getIsdeleted,Constants.ZERO) |
| | | .eq(Labels::getType,Constants.LabelsType.SERIES_BRAND.getKey()) |
| | | .orderByAsc(Labels::getSortnum)); |
| | | } |
| | | for(Labels model:list){ |
| | | if(Constants.equalsInteger(model.getType(),Constants.LabelsType.BIG_AREA.getKey())){ |
| | | //妿æ¯å¤§åºä¿¡æ¯ï¼æ¥è¯¢ææç»å®é¢çä»½ä¿¡æ¯ |
| | |
| | | .eq(Areas::getIsdeleted,Constants.ZERO) |
| | | .eq(Areas::getBigAreaId,model.getId()))); |
| | | } |
| | | if(Constants.equalsInteger(labels.getType(),Constants.LabelsType.APPLICABLE_BRAND.getKey()) |
| | | &&Constants.equalsInteger(model.getType(),Constants.LabelsType.APPLICABLE_BRAND.getKey())){ |
| | | //妿æ¯éåºåçï¼åæ¥è¯¢ä¸çº§ç³»å |
| | | model.setChildList(getChildListbyParentId(childList,model.getId())); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | private List<Labels> getChildListbyParentId(List<Labels> childList, Integer id) { |
| | | List<Labels> list = new ArrayList<>(); |
| | | if(childList!=null && childList.size()>0){ |
| | | for(Labels labels : childList){ |
| | | if(Constants.equalsInteger(labels.getParentId(),id)){ |
| | | list.add(labels); |
| | | } |
| | | } |
| | | |
| | | } |
| | | return list; |
| | | } |
| | |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.system.dto.PlatformConfigDTO; |
| | | import com.doumee.dao.system.dto.QuerySystemDictDataDTO; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.dao.system.vo.SystemDictDataListVO; |
| | |
| | | List<SystemDictData> findList(Integer dicId,List<String> codes); |
| | | |
| | | |
| | | PlatformConfigDTO getPlatformConfigDTO(); |
| | | |
| | | void updPlatformConfig(PlatformConfigDTO platformConfigDTO); |
| | | |
| | | } |
| | |
| | | package com.doumee.service.system.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.system.SystemDictMapper; |
| | | import com.doumee.dao.system.dto.PlatformConfigDTO; |
| | | import com.doumee.dao.system.model.SystemDict; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private SystemDictDataMapper systemDictDataMapper; |
| | | @Autowired |
| | | private SystemDictMapper systemDictMapper; |
| | | |
| | | @Override |
| | | public Integer create(SystemDictData systemDictData) { |
| | |
| | | .in(SystemDictData::getLabel,codes); |
| | | return systemDictDataMapper.selectList(wrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public PlatformConfigDTO getPlatformConfigDTO(){ |
| | | PlatformConfigDTO platformConfigDTO = new PlatformConfigDTO(); |
| | | platformConfigDTO.setRegIntegralReward(new BigDecimal(0)); |
| | | platformConfigDTO.setRegCouponRewardStatus(0); |
| | | platformConfigDTO.setRegCouponRewardList(new ArrayList<>()); |
| | | platformConfigDTO.setRegIntegralRewardStatus(0); |
| | | |
| | | platformConfigDTO.setShareIntegralReward(new BigDecimal(0)); |
| | | platformConfigDTO.setShareCouponRewardList(new ArrayList<>()); |
| | | platformConfigDTO.setShareIntegralRewardStatus(0); |
| | | platformConfigDTO.setShareCouponRewardStatus(0); |
| | | |
| | | platformConfigDTO.setReturnMemberIntegral(new BigDecimal(0)); |
| | | platformConfigDTO.setReturnShopIntegral(new BigDecimal(0)); |
| | | platformConfigDTO.setReturnMemberIntegralStatus(0); |
| | | platformConfigDTO.setReturnShopIntegralStatus(0); |
| | | |
| | | platformConfigDTO.setTotalRate(new BigDecimal(0)); |
| | | |
| | | SystemDict dict = systemDictMapper.selectOne(new QueryWrapper<SystemDict>().lambda() |
| | | .eq(SystemDict::getCode,Constants.ORDER_SET).last("limit 1")); |
| | | if(dict == null){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æ°æ®åå
¸é
ç½®æ°æ®æè¯¯ï¼è¯·è系系ç»ç®¡çåå¤çï¼"); |
| | | } |
| | | |
| | | List<SystemDictData> systemDictDataList = systemDictDataMapper.selectList(new QueryWrapper<SystemDictData>() |
| | | .lambda().eq(SystemDictData::getDictId,dict.getId()) |
| | | .in(SystemDictData::getLabel |
| | | , Constants.ORDERSET_REG_INTEGRAL_REWARD_STATUS |
| | | , Constants.ORDERSET_SHARE_INTEGRAL_REWARD_STATUS |
| | | , Constants.ORDERSET_REG_COUPON_REWARD_STATUS |
| | | , Constants.ORDERSET_SHARE_COUPON_REWARD_STATUS |
| | | , Constants.ORDERSET_REG_INTEGRAL_REWARD |
| | | , Constants.ORDERSET_SHARE_INTEGRAL_REWARD |
| | | , Constants.ORDERSET_REG_COUPON_REWARD_LIST |
| | | , Constants.ORDERSET_SHARE_COUPON_REWARD_LIST |
| | | , Constants.ORDERSET_RETURN_MEMBER_INTEGRAL_STATUS |
| | | , Constants.ORDERSET_RETURN_SHOP_INTEGRAL_STATUS |
| | | , Constants.ORDERSET_RETURN_MEMBER_INTEGRAL |
| | | , Constants.ORDERSET_RETURN_SHOP_INTEGRAL |
| | | ,Constants.ORDERSET_TOTAL_RATE ) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(systemDictDataList)){ |
| | | for (SystemDictData systemDictData:systemDictDataList) { |
| | | if(systemDictData.getLabel().equals(Constants.ORDERSET_REG_INTEGRAL_REWARD)){ |
| | | platformConfigDTO.setRegIntegralReward(getDecimalValByStr(systemDictData.getCode())); |
| | | }else if(systemDictData.getLabel().equals(Constants.ORDERSET_REG_COUPON_REWARD_STATUS)){ |
| | | platformConfigDTO.setRegCouponRewardStatus(getIntegerValByStr(systemDictData.getCode())); |
| | | }else if(systemDictData.getLabel().equals(Constants.ORDERSET_REG_COUPON_REWARD_LIST)){ |
| | | platformConfigDTO.setRegCouponRewardList(getListValByStr(systemDictData.getCode())); |
| | | }else if(systemDictData.getLabel().equals(Constants.ORDERSET_REG_INTEGRAL_REWARD_STATUS)){ |
| | | platformConfigDTO.setRegIntegralRewardStatus(getIntegerValByStr(systemDictData.getCode())); |
| | | }else if(systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_INTEGRAL_REWARD)){ |
| | | platformConfigDTO.setShareIntegralReward(getDecimalValByStr(systemDictData.getCode())); |
| | | }else if(systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_COUPON_REWARD_LIST)){ |
| | | platformConfigDTO.setShareCouponRewardList(getListValByStr(systemDictData.getCode())); |
| | | }else if(systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_INTEGRAL_REWARD_STATUS)){ |
| | | platformConfigDTO.setShareIntegralRewardStatus(getIntegerValByStr(systemDictData.getCode())); |
| | | }else if(systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_COUPON_REWARD_STATUS)){ |
| | | platformConfigDTO.setShareCouponRewardStatus(getIntegerValByStr(systemDictData.getCode())); |
| | | }else if(systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_MEMBER_INTEGRAL)){ |
| | | platformConfigDTO.setReturnMemberIntegral(getDecimalValByStr(systemDictData.getCode())); |
| | | }else if(systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_SHOP_INTEGRAL)){ |
| | | platformConfigDTO.setReturnShopIntegral(getDecimalValByStr(systemDictData.getCode())); |
| | | }else if(systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_MEMBER_INTEGRAL_STATUS)){ |
| | | platformConfigDTO.setReturnMemberIntegralStatus(getIntegerValByStr(systemDictData.getCode())); |
| | | }else if(systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_SHOP_INTEGRAL_STATUS)){ |
| | | platformConfigDTO.setReturnShopIntegralStatus(getIntegerValByStr(systemDictData.getCode())); |
| | | }else if(systemDictData.getLabel().equals(Constants.ORDERSET_TOTAL_RATE)) { |
| | | platformConfigDTO.setTotalRate(getDecimalValByStr(systemDictData.getCode())); |
| | | } |
| | | } |
| | | } |
| | | return platformConfigDTO; |
| | | } |
| | | |
| | | private Integer getIntegerValByStr(String code) { |
| | | try { |
| | | return Integer.parseInt(code); |
| | | }catch (Exception e){ |
| | | } |
| | | return 0; |
| | | } |
| | | private BigDecimal getDecimalValByStr(String code) { |
| | | try { |
| | | return new BigDecimal(code); |
| | | }catch (Exception e){ |
| | | } |
| | | return new BigDecimal(0); |
| | | } |
| | | private List<JSONObject> getListValByStr(String code) { |
| | | try { |
| | | return JSONObject.parseObject(code,new TypeReference<List<JSONObject>>(){}); |
| | | }catch (Exception e){ |
| | | } |
| | | return new ArrayList(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class, BusinessException.class}) |
| | | public void updPlatformConfig(PlatformConfigDTO platformConfigDTO) { |
| | | SystemDict dict = systemDictMapper.selectOne(new QueryWrapper<SystemDict>().lambda() |
| | | .eq(SystemDict::getCode, Constants.ORDER_SET).last("limit 1")); |
| | | if (dict == null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "æ°æ®åå
¸é
ç½®æ°æ®æè¯¯ï¼è¯·è系系ç»ç®¡çåå¤çï¼"); |
| | | } |
| | | List<SystemDictData> systemDictDataList = systemDictDataMapper.selectList(new QueryWrapper<SystemDictData>() |
| | | .lambda() |
| | | .eq(SystemDictData::getDictId, dict.getId()) |
| | | .in(SystemDictData::getLabel |
| | | , Constants.ORDERSET_REG_INTEGRAL_REWARD_STATUS |
| | | , Constants.ORDERSET_SHARE_INTEGRAL_REWARD_STATUS |
| | | , Constants.ORDERSET_REG_COUPON_REWARD_STATUS |
| | | , Constants.ORDERSET_SHARE_COUPON_REWARD_STATUS |
| | | , Constants.ORDERSET_REG_INTEGRAL_REWARD |
| | | , Constants.ORDERSET_SHARE_INTEGRAL_REWARD |
| | | , Constants.ORDERSET_REG_COUPON_REWARD_LIST |
| | | , Constants.ORDERSET_SHARE_COUPON_REWARD_LIST |
| | | , Constants.ORDERSET_RETURN_MEMBER_INTEGRAL_STATUS |
| | | , Constants.ORDERSET_RETURN_SHOP_INTEGRAL_STATUS |
| | | , Constants.ORDERSET_RETURN_MEMBER_INTEGRAL |
| | | , Constants.ORDERSET_RETURN_SHOP_INTEGRAL |
| | | , Constants.ORDERSET_TOTAL_RATE) |
| | | ); |
| | | if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(systemDictDataList)) { |
| | | for (SystemDictData systemDictData : systemDictDataList) { |
| | | if (systemDictData.getLabel().equals(Constants.ORDERSET_REG_INTEGRAL_REWARD_STATUS)) { |
| | | systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getRegIntegralRewardStatus()) + ""); |
| | | } else if (systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_INTEGRAL_REWARD_STATUS)) { |
| | | systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getShareIntegralRewardStatus()) + ""); |
| | | } else if (systemDictData.getLabel().equals(Constants.ORDERSET_REG_COUPON_REWARD_STATUS)) { |
| | | systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getRegCouponRewardStatus()) + ""); |
| | | } else if (systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_COUPON_REWARD_STATUS)) { |
| | | systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getShareCouponRewardStatus()) + ""); |
| | | } else if (systemDictData.getLabel().equals(Constants.ORDERSET_REG_INTEGRAL_REWARD)) { |
| | | systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getRegIntegralReward()).doubleValue() + ""); |
| | | } else if (systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_INTEGRAL_REWARD)) { |
| | | systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getShareIntegralReward()).doubleValue() + ""); |
| | | } else if (systemDictData.getLabel().equals(Constants.ORDERSET_REG_COUPON_REWARD_LIST)) { |
| | | systemDictData.setCode(JSONObject.toJSONString(platformConfigDTO.getRegCouponRewardList() == null ? new ArrayList() : platformConfigDTO.getRegCouponRewardList())); |
| | | } else if (systemDictData.getLabel().equals(Constants.ORDERSET_SHARE_COUPON_REWARD_LIST)) { |
| | | systemDictData.setCode(JSONObject.toJSONString(platformConfigDTO.getShareCouponRewardList() == null ? new ArrayList() : platformConfigDTO.getShareCouponRewardList())); |
| | | } else if (systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_MEMBER_INTEGRAL_STATUS)) { |
| | | systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getReturnMemberIntegralStatus()) + ""); |
| | | } else if (systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_SHOP_INTEGRAL_STATUS)) { |
| | | systemDictData.setCode(Constants.formatIntegerNum(platformConfigDTO.getReturnShopIntegralStatus()) + ""); |
| | | } else if (systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_MEMBER_INTEGRAL)) { |
| | | systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getReturnMemberIntegral()).doubleValue() + ""); |
| | | } else if (systemDictData.getLabel().equals(Constants.ORDERSET_RETURN_SHOP_INTEGRAL)) { |
| | | systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getReturnShopIntegral()).doubleValue() + ""); |
| | | } else if (systemDictData.getLabel().equals(Constants.ORDERSET_TOTAL_RATE)) { |
| | | systemDictData.setCode(Constants.formatBigdecimal(platformConfigDTO.getTotalRate()).doubleValue() + ""); |
| | | } |
| | | systemDictDataMapper.update(new UpdateWrapper<SystemDictData>().lambda() |
| | | .set(SystemDictData::getCode, systemDictData.getCode()) |
| | | .eq(SystemDictData::getId, systemDictData.getId())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |