Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | component: () => import('../views/sd/glassPrice/GlassPriceSet.vue') |
| | | }, |
| | | { |
| | | path: 'glassPriceList', |
| | | name: 'glassPriceList', |
| | | component: () => import('../views/sd/glassPrice/GlassPriceList.vue') |
| | | }, |
| | | { |
| | | name: 'GlassPrice1', |
| | | path: '', |
| | | redirect:'/main/glassPrice/producePriceCompute' |
| | |
| | | import GlassType from "@/components/sd/product/GlassType.vue" |
| | | import useProductGlassTypeStore from "@/stores/sd/product/productGlassType" |
| | | import {useI18n} from "vue-i18n"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | |
| | | const { t } = useI18n() |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | const value = ref('') |
| | | const userStore = useUserInfoStore() |
| | | const options = [ |
| | | { |
| | | value: t('ingredients.originalFilm'), |
| | |
| | | type:value.value, |
| | | json:productName, |
| | | width:BasicData.value[0].Type, |
| | | height:BasicData.value[1].Type |
| | | height:BasicData.value[1].Type, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | } |
| | | }else if(value.value===t('ingredients.accessories')){ |
| | | materialStore={ |
| | | id:ruleForm.value.id, |
| | | type:value.value, |
| | | json:productName, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | case 'delete':{ |
| | | let flowData = ref({ |
| | | id: row.id |
| | | id: row.id, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | }) |
| | | request.post("/materialStore/deleteMaterialStore",flowData.value).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | |
| | | let flowData = ref({ |
| | | materialOutboundDetail: selectRecords, |
| | | title: titleUploadData.value, |
| | | materialOutboundId: route.query.materialOutboundId |
| | | materialOutboundId: route.query.materialOutboundId, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | |
| | | }) |
| | | request.post("/materialInventory/saveMaterialOutbound", flowData.value).then((res) => { |
| | |
| | | case 'CounterExamination': { |
| | | let flowData = ref({ |
| | | materialOutboundId: route.query.materialOutboundId, |
| | | reviewed:userStore.user.userName, |
| | | type: 0 |
| | | |
| | | }) |
| | |
| | | } |
| | | case 'delete':{ |
| | | let flowData = ref({ |
| | | materialOutboundId:row.materialOutboundId |
| | | materialOutboundId:row.materialOutboundId, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | }) |
| | | request.post("/materialInventory/deleteMaterialOutbound",flowData.value).then((res) => { |
| | | if(res.code==200 && res.data===true){ |
| | |
| | | let flowData = ref({ |
| | | returningWarehouseDetail: selectRecords, |
| | | title: titleUploadData.value, |
| | | returningId: route.query.returningId |
| | | returningId: route.query.returningId, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | |
| | | }) |
| | | request.post("/materialInventory/saveReturningWarehouse", flowData.value).then((res) => { |
| | |
| | | case 'CounterExamination': { |
| | | let flowData = ref({ |
| | | returningId: route.query.returningId, |
| | | reviewed:userStore.user.userName, |
| | | type: 0 |
| | | |
| | | }) |
| | |
| | | totalArea: selectRecords.height*selectRecords.width/100000*titleUploadData.value.inventoryQuantity, |
| | | singlePieceArea: selectRecords.height*selectRecords.width/100000, |
| | | title: titleUploadData.value, |
| | | materialCode: selectRecords.id |
| | | materialCode: selectRecords.id, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | |
| | | }) |
| | | |
| | |
| | | import {ElMessage} from "element-plus"; |
| | | import deepClone from "@/utils/deepClone" |
| | | import { useI18n } from 'vue-i18n' |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | let produceList = ref([]) |
| | | const userStore = useUserInfoStore() |
| | | |
| | | |
| | | |
| | |
| | | }*/ |
| | | |
| | | let flowData = ref({ |
| | | customer: ruleForm |
| | | customer: ruleForm, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | }) |
| | | request.post("/customer/insertCustomer", flowData.value).then((res) => { |
| | | if(res.code==200 && res.data===true){ |
| | |
| | | }) |
| | | ruleForm.value.id=row.id |
| | | let flowData = ref({ |
| | | customer: ruleForm.value |
| | | customer: ruleForm.value, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | }) |
| | | |
| | | request.post("/customer/deleteCustomer", flowData.value).then((res) => { |
| | |
| | | case 'toExamine': { |
| | | let flowData = ref({ |
| | | deliveryId: route.query.deliveryID, |
| | | type: 2 |
| | | type: 2, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | |
| | | }) |
| | | request.post("/delivery/updateDeliveryToExamine", flowData.value).then((res) => { |
| | |
| | | case 'CounterExamination': { |
| | | let flowData = ref({ |
| | | deliveryId: route.query.deliveryID, |
| | | type: 0 |
| | | type: 0, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | |
| | | }) |
| | | request.post("/delivery/updateDeliveryToExamine", flowData.value).then((res) => { |
| | |
| | | } |
| | | case 'delete':{ |
| | | let flowData = ref({ |
| | | deliveryId:row.deliveryId |
| | | deliveryId:row.deliveryId, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | }) |
| | | request.post("/delivery/deleteDelivery",flowData.value).then((res) => { |
| | | if(res.code==200 && res.data===true){ |
| | |
| | | <el-breadcrumb :separator-icon="ArrowRight"> |
| | | <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/glassPrice/producePriceCompute' }">{{'玻璃报价'}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/glassPrice/glassPriceSet' }">{{'价格设置'}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(3)" :class="indexFlag===3?'indexTag':''" :to="{ path: '/main/glassPrice/glassPriceList' }">{{'价格列表'}}</el-breadcrumb-item> |
| | | <!-- <el-breadcrumb-item :to="{ path: '/main/product/test' }">测试</el-breadcrumb-item>--> |
| | | <!-- <el-breadcrumb-item :to="{ path: '/main/product/testSort11' }">测试</el-breadcrumb-item>--> |
| | | <el-breadcrumb-item v-show="false" /> |
| New file |
| | |
| | | <script setup> |
| | | import {onMounted, reactive, ref} from "vue" |
| | | import {useI18n} from "vue-i18n"; |
| | | import {changeFilterEvent, filterChanged} from "@/hook"; |
| | | import {useRouter,useRoute} from "vue-router" |
| | | import request from "@/utils/request"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | |
| | | |
| | | const { t } = useI18n() |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | loading:false, |
| | | showHeaderOverflow: false, |
| | | showFooterOverflow: false, |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | //virtualScroll: true, // 开启虚拟滚动功能 |
| | | id: 'glassPriceList', |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | //remote: true //远端筛选 |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | mouseConfig:{selected: true},//鼠标选中 |
| | | keyboardConfig:{ |
| | | isArrow: true, |
| | | isDel: true, |
| | | isEnter: true, |
| | | isTab: true, |
| | | isEdit: true, |
| | | isChecked: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'dblclick', |
| | | mode: 'cell', |
| | | showStatus: true, |
| | | showIcon:false |
| | | },//表头参数 |
| | | columns:[ |
| | | {title: t('basicData.operate'), width: 110, slots: { default: 'button_slot' },fixed:"left",}, |
| | | {type: 'seq',fixed:"left", title: t('basicData.Number'), width: 80 }, |
| | | {field: 'type', title: '类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'name', title: '名称',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'price', title: '价格' ,editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'createTime', title: '创建时间',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged} |
| | | |
| | | ], |
| | | |
| | | toolbarConfig: { |
| | | zoom: true, |
| | | custom: true |
| | | } |
| | | |
| | | |
| | | }) |
| | | |
| | | onMounted(() => { |
| | | request.post('/glassPriceBasic/searchGlassPrice').then(res => { |
| | | xGrid.value.reloadData(res.data) |
| | | }) |
| | | }) |
| | | |
| | | const getTableRow = (row,type) => { |
| | | switch (type) { |
| | | case 'edit': { |
| | | ElMessageBox.prompt( '', { |
| | | confirmButtonText: t('basicData.save'), |
| | | cancelButtonText: t('basicData.cancelButtonText'), |
| | | inputPattern:/^.{1,20}$/, |
| | | inputErrorMessage: t('components.message') |
| | | }).then(({ value }) => { |
| | | alert(value) |
| | | }) |
| | | break |
| | | } |
| | | case 'delete': { |
| | | request.post(`/glassPriceBasic/deleteGlassPriceById/${row.id}`).then((res) => { |
| | | if(res.code==200){ |
| | | ElMessage.success(t('searchOrder.msgDeleteSuccess')) |
| | | router.push({path:'/main/glassPrice/glassPriceList',query:{random:Math.random()}}) |
| | | }else{ |
| | | ElMessage.warning(t('searchOrder.msgDeleteFail')) |
| | | } |
| | | }) |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div id="main-div"> |
| | | <vxe-grid |
| | | height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | > |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="text" |
| | | v-model="option.data" |
| | | @keyup.enter.native="$panel.confirmFilter()" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" |
| | | link |
| | | type="primary" |
| | | size="small"> |
| | | {{ $t('basicData.edit') }} |
| | | </el-button> |
| | | <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')"> |
| | | <template #reference> |
| | | <el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button> |
| | | </template> |
| | | </el-popconfirm> |
| | | </template> |
| | | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | #main-div{ |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | </style> |
| | |
| | | import {onMounted, ref} from "vue"; |
| | | import request from "@/utils/request"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {useRouter,useRoute} from "vue-router" |
| | | let BasicData = ref({ |
| | | stuffColor:null, |
| | | stuffCraft:null, |
| | |
| | | |
| | | }) |
| | | let tabsValue = ref(1) |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | |
| | | onMounted( async () => { |
| | | await request.get(`/basicData/BasicDataByType/product`).then((res) => { |
| | |
| | | return |
| | | } |
| | | } |
| | | |
| | | request.post(`/glassPriceBasic/save`,value).then((res) => { |
| | | if(res.code==='200' && res.data===true){ |
| | | ElMessage.success("数据保存成功") |
| | | router.push({path:'/main/glassPrice/glassPriceList'}) |
| | | }else{ |
| | | ElMessage.warning("此膜系已经存在,请重新选择") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | </script> |
| | |
| | | import {VXETable} from "vxe-table"; |
| | | import {ElMessage} from "element-plus"; |
| | | import request from "@/utils/request"; |
| | | import router from "@/router"; |
| | | const { t } = useI18n() |
| | | let dialogVisible = ref(false) |
| | | const xGrid = ref() |
| | |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | //virtualScroll: true, // 开启虚拟滚动功能 |
| | | id: 'CreateOrder', |
| | | id: 'CreateOrder123', |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | showOverflow:true, |
| | | menuConfig: { |
| | | body: { |
| | | options: [ |
| | | [ |
| | | { code: 'addRow', name: t('basicData.add'), prefixIcon: 'vxe-icon-square-plus', visible: true, disabled: false }, |
| | | { code: 'deleteRow', name: t('basicData.delete'), prefixIcon: 'vxe-icon-delete', visible: true, disabled: false }, |
| | | { code: 'copyChecked', name: t('basicData.selectSame'), prefixIcon: 'vxe-icon-copy', visible: true, disabled: false }, |
| | | { code: 'copyAll', name: t('basicData.sameAfterwards'), prefixIcon: 'vxe-icon-feedback', visible: true, disabled: false }, |
| | | { code: 'clearChecked', name: t('basicData.clearSelection'), prefixIcon: 'vxe-icon-indicator', visible: true, disabled: false }, |
| | | { code: 'computedMoney', name: t('basicData.calculateAmount'), prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: true }, |
| | | { code: 'incrementalAll', name: t('basicData.incrementalAll'), prefixIcon: 'vxe-icon-feedback', visible: true, disabled: false }, |
| | | { code: 'incrementalChecked', name: t('basicData.incrementalChecked'), prefixIcon: 'vxe-icon-copy', visible: true, disabled: false }, |
| | | { code: 'errorArea', name: t('basicData.errorSettlementArea'), prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: false }, |
| | | { code: 'otherMoney', name: t('basicData.otherAmounts'), prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: false }, |
| | | { code: 'sizeCheck', name: t('basicData.sizeReview'), prefixIcon: 'vxe-icon-eye-fill', visible: true, disabled: false }, |
| | | { code: 'updateOrderId', name: '修改订单号', prefixIcon: 'vxe-icon-eye-fill', visible: true, disabled: false } |
| | | ] |
| | | ] |
| | | } |
| | | }, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {'code': 'addProducts', 'name': '选择产品',disabled: false}, |
| | | {'code': 'saveOrder', 'name': '转订单',status: 'primary',icon: 'vxe-icon-save',disabled: false}, |
| | | {'code': 'reorder', 'name': '转订单',status: 'primary',icon: 'vxe-icon-save',disabled: false}, |
| | | |
| | | ], |
| | | zoom: true, |
| | |
| | | dialogVisible.value = true |
| | | break |
| | | } |
| | | case 'reorder': { |
| | | if($grid.getTableData().fullData.length === 0){ |
| | | ElMessage.warning("请先添加产品") |
| | | return |
| | | } |
| | | router.push({ |
| | | path: '/main/order/createOrder', |
| | | query:{ |
| | | produceList: JSON.stringify($grid.getTableData().fullData) |
| | | } |
| | | }) |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | const getChildData = (data) => { |
| | | alert(1) |
| | | const getChildData = (data,product) => { |
| | | data.productId = product.id |
| | | data.productName =product.productName |
| | | request.post(`/glassPriceBasic/glassPriceComputed/${product.id}`).then(res => { |
| | | if (res.code === '200' ) { |
| | | data.price = res.data |
| | | xGrid.value.insertAt(data) |
| | | dialogVisible.value = false |
| | | } |
| | | }) |
| | | } |
| | | |
| | | </script> |
| | |
| | | } |
| | | } |
| | | let datas = data.data |
| | | datas.id = xGrid.value.getRadioRecord().id |
| | | emit('getChildData',datas) |
| | | emit('getChildData',datas,xGrid.value.getRadioRecord()) |
| | | } |
| | | } |
| | | |
| | |
| | | }, |
| | | formConfig: { |
| | | data: { |
| | | name: '', |
| | | role: '', |
| | | age: '' |
| | | width: '', |
| | | height: '', |
| | | quantity: '' |
| | | }, |
| | | items: [ |
| | | { field: 'width', title: '宽:', itemRender: { name: 'VxeInput' } }, |
| | |
| | | |
| | | //启用表格拖动选中 |
| | | addListener(xGrid.value,gridOptions) |
| | | let productData = route.query.produceList |
| | | if (!(typeof productData === 'undefined' || productData == null || productData === '' || productData === '\n' || productData === '\r')){ |
| | | xGrid.value.insertAt(JSON.parse(productData)) |
| | | } |
| | | |
| | | const str = route.query.orderId || history.state.orderId |
| | | if (typeof str === 'undefined' || str === null || str === '' || str === '\n' || str === '\r'){ |
| | | gridOptions.menuConfig.body.options[0][11].disabled = true |
| New file |
| | |
| | | package com.example.erp.controller.sd; |
| | | |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.sd.GlassPriceBasic; |
| | | import com.example.erp.service.sd.GlassPriceBasicService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 产品价格计算 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/glassPriceBasic") |
| | | @Api(value="产品价格controller",tags={"产品价格计算操作接口"}) |
| | | public class GlassPriceBasicController { |
| | | private final GlassPriceBasicService glassPriceBasicService; |
| | | |
| | | public GlassPriceBasicController(GlassPriceBasicService glassPriceBasicService) { |
| | | this.glassPriceBasicService = glassPriceBasicService; |
| | | } |
| | | |
| | | @ApiOperation("保存产品价格数据") |
| | | @PostMapping("/save") |
| | | public Result save(@RequestBody Map<String,Object> prams ){ |
| | | |
| | | return Result.seccess(glassPriceBasicService.save(prams)); |
| | | } |
| | | |
| | | @ApiOperation("计算成品价格") |
| | | @PostMapping("/glassPriceComputed/{productId}") |
| | | public Result glassPriceComputed(@PathVariable String productId){ |
| | | return Result.seccess(glassPriceBasicService.glassPriceComputed(productId)); |
| | | } |
| | | |
| | | @ApiOperation("玻璃价格查询") |
| | | @PostMapping("/searchGlassPrice") |
| | | public Result searchGlassPrice(){ |
| | | return Result.seccess(glassPriceBasicService.searchGlassPrice()); |
| | | } |
| | | |
| | | @ApiOperation("玻璃价格修改") |
| | | @PostMapping("/updateGlassPriceById") |
| | | public Result updateGlassPriceById(@RequestBody GlassPriceBasic glassPriceBasic){ |
| | | return Result.seccess(glassPriceBasicService.updateGlassPriceById(glassPriceBasic)); |
| | | } |
| | | |
| | | @ApiOperation("玻璃价格删除") |
| | | @PostMapping("/deleteGlassPriceById/{id}") |
| | | public Result deleteGlassPriceById(@PathVariable String id){ |
| | | return Result.seccess(glassPriceBasicService.deleteGlassPriceById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.example.erp.entity.sd; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class GlassPriceBasic { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | private String type; |
| | | private Double thickness; |
| | | private String name; |
| | | private Double price; |
| | | private String json; |
| | | private LocalDateTime createTime; |
| | | } |
| New file |
| | |
| | | package com.example.erp.mapper.sd; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.sd.GlassPriceBasic; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface GlassPriceBasicMapper extends BaseMapper<GlassPriceBasic> { |
| | | } |
| | |
| | | Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint(); |
| | | try { |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | //获取对象集合循环进行新增修改 |
| | | List<FinishedOperateLog> finishedOperateLogslist = JSONArray.parseArray(JSONObject.toJSONString(object.get("orderDetail")), FinishedOperateLog.class); |
| | |
| | | materialOutboundId = object.get("materialOutboundId").toString(); |
| | | } |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | try { |
| | | MaterialOutbound materialOutbound = JSONObject.parseObject(JSONObject.toJSONString(object.get("title")), MaterialOutbound.class); |
| | |
| | | materialCode = Long.valueOf(object.get("materialCode").toString()); |
| | | } |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | |
| | | MaterialInventory materialInventory = JSONObject.parseObject(JSONObject.toJSONString(object.get("title")), MaterialInventory.class); |
| | |
| | | } |
| | | Log log = new Log(); |
| | | log.setContent(object.toString()); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setFunction("deleteMaterialOutbound删除:"+materialOutboundId); |
| | | logService.saveLog(log); |
| | | |
| | |
| | | returningId = object.get("returningId").toString(); |
| | | } |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | |
| | | ReturningWarehouse returningWarehouse = JSONObject.parseObject(JSONObject.toJSONString(object.get("title")), ReturningWarehouse.class); |
| | |
| | | } |
| | | |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | |
| | | DecimalFormat decimalFormat = new DecimalFormat("#0.00"); |
| | |
| | | |
| | | } |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | log.setFunction("deleteMaterialStore删除:"+id); |
| | | logService.saveLog(log); |
| | |
| | | public Boolean insertCustomer(Map<String,Object> object) { |
| | | boolean saveState = true; |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | //设置回滚点 |
| | | Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint(); |
| | |
| | | customerMapper.deleteCustomer(customer); |
| | | } |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | log.setFunction("deleteCustomer删除"); |
| | | logService.saveLog(log); |
| | |
| | | deliveryMapper.updateDeliveryToExamine(deliveryId,type); |
| | | |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | log.setFunction("updateDeliveryToExamine修改:"+deliveryId); |
| | | logService.saveLog(log); |
| | |
| | | deliveryMapper.deleteDelivery(deliveryId); |
| | | |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | log.setFunction("deleteDelivery删除:"+deliveryId); |
| | | logService.saveLog(log); |
| New file |
| | |
| | | package com.example.erp.service.sd; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.example.erp.entity.sd.GlassPriceBasic; |
| | | import com.example.erp.entity.sd.ProductDetail; |
| | | import com.example.erp.mapper.sd.GlassPriceBasicMapper; |
| | | import com.example.erp.mapper.sd.ProductDetailMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | @Service |
| | | @DS("sd") |
| | | public class GlassPriceBasicService { |
| | | private final GlassPriceBasicMapper glassPriceBasicMapper; |
| | | @Autowired |
| | | private ProductDetailMapper productDetailMapper; |
| | | |
| | | public GlassPriceBasicService(GlassPriceBasicMapper glassPriceBasicMapper) { |
| | | this.glassPriceBasicMapper = glassPriceBasicMapper; |
| | | } |
| | | |
| | | //保存玻璃价格 |
| | | public Boolean save(Map<String, Object> prams) { |
| | | GlassPriceBasic glassPriceBasic = new GlassPriceBasic(); |
| | | glassPriceBasic.setThickness( |
| | | Double.parseDouble(prams.get("thickness").toString().replaceAll("[^0-9\\.]", "")) |
| | | ); |
| | | glassPriceBasic.setPrice(Double.parseDouble(prams.get("price").toString())); |
| | | glassPriceBasic.setJson(prams.toString()); |
| | | glassPriceBasic.setType(prams.get("type").toString()); |
| | | String type = prams.get("type").toString(); |
| | | //判断 是哪种类型 |
| | | if(Objects.equals(type, "glass")) { |
| | | glassPriceBasic.setName(prams.get("thickness").toString() + prams.get("color").toString()); |
| | | }else if(Objects.equals(type, "hollow")){ |
| | | glassPriceBasic.setName( |
| | | prams.get("thickness").toString() |
| | | + prams.get("gasType").toString() |
| | | + prams.get("types").toString()); |
| | | } else if (Objects.equals(type, "interlayer")) { |
| | | glassPriceBasic.setName( |
| | | prams.get("thickness").toString() |
| | | + prams.get("color").toString() |
| | | + prams.get("types").toString()); |
| | | } |
| | | GlassPriceBasic glassPriceBasic1 = glassPriceBasicMapper.selectOne(new QueryWrapper<GlassPriceBasic>().eq("name", glassPriceBasic.getName())); |
| | | if(glassPriceBasic1 != null){ |
| | | return false; |
| | | } |
| | | return glassPriceBasicMapper.insert(glassPriceBasic)>0; |
| | | } |
| | | |
| | | public Double glassPriceComputed(String productId) { |
| | | List<ProductDetail> productDetails = productDetailMapper |
| | | .selectList(new QueryWrapper<ProductDetail>().eq("prod_id", productId)); |
| | | |
| | | final Double[] money = {0.0}; |
| | | productDetails.forEach(productDetail -> { |
| | | Map<String,String> separation = JSON.parseObject( |
| | | productDetail.getSeparation(), new TypeReference<Map<String, String>>(){}); |
| | | String name = ""; |
| | | switch (productDetail.getDetailType()) { |
| | | case "glass": |
| | | name = separation.get("thickness") + separation.get("color"); |
| | | break; |
| | | case "hollow": |
| | | name = separation.get("thickness") + separation.get("gasType") + separation.get("type"); |
| | | break; |
| | | case "interlayer": |
| | | name = separation.get("thickness") + separation.get("color") + separation.get("type"); |
| | | break; |
| | | } |
| | | GlassPriceBasic glassPriceBasic = glassPriceBasicMapper |
| | | .selectOne(new QueryWrapper<GlassPriceBasic>().eq("name", name)); |
| | | if(glassPriceBasic == null) { |
| | | money[0]= 0.0; |
| | | return; |
| | | } |
| | | money[0] += glassPriceBasic.getPrice(); |
| | | }); |
| | | return money[0]; |
| | | } |
| | | |
| | | public List<GlassPriceBasic> searchGlassPrice() { |
| | | return glassPriceBasicMapper.selectList(null); |
| | | } |
| | | |
| | | public Boolean updateGlassPriceById(GlassPriceBasic glassPriceBasic) { |
| | | return glassPriceBasicMapper.update( |
| | | null, |
| | | new LambdaUpdateWrapper<>(GlassPriceBasic.class) |
| | | .setSql("price = " + glassPriceBasic.getPrice()) |
| | | .eq(GlassPriceBasic::getId, glassPriceBasic.getId()) |
| | | )>0; |
| | | } |
| | | |
| | | public Boolean deleteGlassPriceById(String id) { |
| | | return glassPriceBasicMapper.deleteById(id)>0; |
| | | } |
| | | } |