Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | </template> |
| | | |
| | | <template #toolbar_buttons="{ $grid }"> |
| | | |
| | | <vxe-select @change="changeOrderType" v-model="values" > |
| | | <vxe-option value="1" label="汇总"></vxe-option> |
| | | <vxe-option value="2" label="明细"></vxe-option> |
| | |
| | | let produceList = ref([]) |
| | | const dialogTableVisible = ref(false) |
| | | |
| | | const data = ref({ |
| | | printList: [] |
| | | }) |
| | | //表单验证 |
| | | const ruleFormRef = ref() |
| | | const ruleForm = reactive({ |
| | | MaterialId:'', |
| | | MaterialName:'', |
| | | type: '', |
| | | consume: '', |
| | | price: '', |
| | |
| | | |
| | | const submitForm = (formEl) => { |
| | | if (!formEl) return |
| | | data.value.printList = ruleForm |
| | | request.post(`/BomData/saveMaterialBomData`,ruleForm).then((res) => { |
| | | if (res.code == 200 && res.data === true) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | load() |
| | | } |
| | | }) |
| | | |
| | | formEl.validate((valid) => { |
| | | if (valid) { |
| | | console.log('submit!') |
| | |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | ruleForm.MaterialId=row.id |
| | | ruleForm.MaterialName=row.name |
| | | dialogTableVisible.value = true |
| | | return |
| | | } |
| | |
| | | let arr = [ |
| | | {title: t('basicData.operate'), width: '110', slots: { default: 'button_slot' },fixed:'left'}, |
| | | { type: 'seq',fixed:'left', title: t('basicData.Number'), width: '80' }, |
| | | {field: 'id', width: '150',title: t('ingredients.materialCode'), sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged} |
| | | {field: 'id', width: '150',title: t('ingredients.materialCode'), sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'bomType',title: '类型', showOverflow:'ellipsis' }, |
| | | {field: 'consume',title: '消耗量',showOverflow:'ellipsis' }, |
| | | {field: 'price',title: '使用价格',showOverflow:'ellipsis' } |
| | | ] |
| | | const bomTitle = [ |
| | | {field: 'type',title: '类型', showOverflow:'ellipsis' }, |
| | | {field: 'consume',title: '消耗量',showOverflow:'ellipsis' }, |
| | | {price: '使用价格',title: '使用价格',showOverflow:'ellipsis' } |
| | | |
| | | ] |
| | | |
| | | //第一次加载默认 |
| | |
| | | for (let i=0;i<res.data.data.length;i++){ |
| | | materialStore.value[i]= JSON.parse(res.data.data[i].json) |
| | | materialStore.value[i].id= res.data.data[i].id |
| | | materialStore.value[i].consume= res.data.data[i].consume |
| | | switch (res.data.data[i].bomType) { |
| | | case '1': |
| | | materialStore.value[i].bomType = '面积'; |
| | | break; |
| | | case '2': |
| | | materialStore.value[i].bomType = '周长'; |
| | | break; |
| | | case "3": |
| | | materialStore.value[i].bomType = '数量'; |
| | | break; |
| | | default: |
| | | materialStore.value[i].bomType = res.data.data[i].bomType; // 保留原值 |
| | | } |
| | | materialStore.value[i].price= res.data.data[i].price |
| | | } |
| | | |
| | | total.dataTotal = res.data.total.total*1 |
| New file |
| | |
| | | package com.example.erp.controller.sd; |
| | | |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.sd.BasicData; |
| | | import com.example.erp.entity.sd.BomBase; |
| | | import com.example.erp.service.sd.BasicDataService; |
| | | import com.example.erp.service.sd.BomDataService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/BomData") |
| | | @Api(value="BOM相关controller",tags={"BOM相关操作接口"}) |
| | | public class BomDataController { |
| | | final |
| | | BomDataService bomDataService; |
| | | |
| | | public BomDataController(BomDataService bomDataService) { |
| | | this.bomDataService = bomDataService; |
| | | } |
| | | @ApiOperation("更新基础数据") |
| | | @PostMapping("saveMaterialBomData") |
| | | public Result saveMaterialBomData(@RequestBody Map<String, Object> object){ |
| | | return Result.seccess(bomDataService.saveMaterialBomDataSv(object)); |
| | | } |
| | | |
| | | } |
| | |
| | | private String json; |
| | | private LocalDate createTime; |
| | | |
| | | private String consume; |
| | | private String bomType; |
| | | private String price; |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.example.erp.entity.sd; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import org.apache.poi.hpsf.Decimal; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | @TableName("sd.bom_base") |
| | | public class BomBase { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | private Integer materialId; |
| | | private String material; |
| | | private Integer status; |
| | | private Integer type; |
| | | private Decimal price; |
| | | private Double consume; |
| | | private LocalDate createTime; |
| | | |
| | | } |
| | |
| | | |
| | | List<FinishedGlassShelfInformation> getSelectFinishedGlassShelfInformation(@Param("finishedGlassShelfInformation") FinishedGlassShelfInformation finishedGlassShelfInformation); |
| | | |
| | | List<FinishedGlassShelfInformation> getSelectFinishedGlassShelfInformationInventoryArea(@Param("inventoryArea")String inventoryArea); |
| | | Integer getSelectFinishedGlassShelfInformationInventoryArea(@Param("inventoryArea")String inventoryArea); |
| | | |
| | | boolean insetFinishedGlassShelfInformation(@Param("finishedGlassShelfInformation") FinishedGlassShelfInformation finishedGlassShelfInformation,String inventoryAreaNumber); |
| | | |
| New file |
| | |
| | | package com.example.erp.mapper.sd; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.sd.BasicData; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface BomDataMapper extends BaseMapper<BasicData> { |
| | | |
| | | |
| | | Boolean saveMaterialBomDataMp(Integer id, String name, Object consume, Object price, Integer type); |
| | | |
| | | Integer getMaterialId(Integer id); |
| | | |
| | | Boolean updateMaterialBomDataMp(Integer id, String name, Object consume, Object price, Integer type); |
| | | } |
| | |
| | | finishedGlassShelfMapper.updateFinishedGlassShelfInformation(finishedGlassShelfInformation,finishedGlassShelfInformation.getId()); |
| | | log.setFunction("saveFinishedGlassShelf修改1"); |
| | | }else{ |
| | | List<FinishedGlassShelfInformation> list=finishedGlassShelfMapper |
| | | .getSelectFinishedGlassShelfInformationInventoryArea(inventoryArea); |
| | | int index=list.size(); |
| | | int index=finishedGlassShelfMapper.getSelectFinishedGlassShelfInformationInventoryArea(inventoryArea); |
| | | for (int i=1;i<=quantity;i++){ |
| | | index++; |
| | | finishedGlassShelfMapper.insetFinishedGlassShelfInformation(finishedGlassShelfInformation,inventoryArea+index); |
| New file |
| | |
| | | package com.example.erp.service.sd; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.example.erp.entity.sd.BasicData; |
| | | import com.example.erp.entity.sd.BasicOtherMoney; |
| | | import com.example.erp.entity.sd.BomBase; |
| | | import com.example.erp.entity.sd.Customer; |
| | | import com.example.erp.mapper.sd.BomDataMapper; |
| | | import com.example.erp.mapper.sd.BasicOtherMoneyMapper; |
| | | import com.example.erp.mapper.sd.CustomerMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | @DS("sd") |
| | | public class BomDataService { |
| | | private final BomDataMapper bomDataMapper; |
| | | |
| | | private final CustomerMapper customerMapper; |
| | | private final BasicOtherMoneyMapper basicOtherMoneyMapper; |
| | | |
| | | public BomDataService(BomDataMapper bomDataMapper, CustomerMapper customerMapper, BasicOtherMoneyMapper basicOtherMoneyMapper) { |
| | | this.bomDataMapper = bomDataMapper; |
| | | this.customerMapper = customerMapper; |
| | | this.basicOtherMoneyMapper = basicOtherMoneyMapper; |
| | | } |
| | | |
| | | |
| | | public Boolean saveMaterialBomDataSv(Map<String, Object> object) { |
| | | Integer id = (Integer) object.get("MaterialId"); |
| | | String name = (String) object.get("MaterialName"); |
| | | Object consume = object.get("consume"); |
| | | Object price = object.get("price"); |
| | | Integer type = (Integer) object.get("type"); |
| | | |
| | | if (id!=null){ |
| | | //查询物料编号是否已存在 |
| | | Integer countId = bomDataMapper.getMaterialId(id); |
| | | if (countId == 0){ |
| | | bomDataMapper.saveMaterialBomDataMp(id,name,consume,price,type); |
| | | }else { |
| | | bomDataMapper.updateMaterialBomDataMp(id,name,consume,price,type); |
| | | } |
| | | |
| | | return true; |
| | | }else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | </select> |
| | | |
| | | <select id="getSelectFinishedGlassShelfInformationInventoryArea"> |
| | | select |
| | | * |
| | | from |
| | | mm.finished_glass_shelf_information |
| | | where |
| | | SELECT |
| | | MAX(CAST(REGEXP_REPLACE(glass_shelf_number, '[^0-9]', '')AS UNSIGNED)) AS maxDindex |
| | | FROM |
| | | finished_glass_shelf_information |
| | | WHERE |
| | | glass_shelf_number regexp #{inventoryArea} |
| | | |
| | | |
| | | </select> |
| | | |
| | |
| | | |
| | | <select id="getSelectMaterialStore"> |
| | | select |
| | | * |
| | | m.id,m.type,m.json,m.create_time,bb.consume,bb.type as bomType,bb.price |
| | | from |
| | | mm.material_store m |
| | | left join sd.bom_base as bb on bb.material_id=m.id |
| | | <where> |
| | | <if test="materialStore.id != null and materialStore.id != ''"> |
| | | and m.id regexp #{materialStore.id} |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.example.erp.mapper.sd.BomDataMapper"> |
| | | |
| | | <insert id="saveMaterialBomDataMp"> |
| | | insert into sd.bom_base |
| | | (material_id, material, status, type, consume, price,create_time) |
| | | values |
| | | (#{id}, #{name}, 0, #{type}, #{consume},#{price}, now()) |
| | | </insert> |
| | | |
| | | <select id="getMaterialId"> |
| | | select count(*) from sd.bom_base where material_id= #{id} |
| | | </select> |
| | | |
| | | <update id="updateMaterialBomDataMp"> |
| | | update sd.bom_base |
| | | set type=#{type},consume=#{consume},price=#{price},create_time=now() |
| | | where material_id = #{id} |
| | | </update> |
| | | </mapper> |