廖井涛
2024-04-16 2aad6e3010f685359e45c216afcbce984d659604
物料资料编辑面积修改
9个文件已修改
139 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/mm/mainIngredient/CreateIngredients.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/ReturnToStorageCreate.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/mm/MaterialInventoryMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialStoreService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/mm/BasicWarehouseType.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/mm/BasicWarehouseType.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/mm/MaterialInventory.xml 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/mainIngredient/CreateIngredients.vue
@@ -87,8 +87,11 @@
  let materialStore={
    id:ruleForm.value.id,
    type:value.value,
    json:productName
    json:productName,
    width:BasicData.value[0].Type,
    height:BasicData.value[1].Type
  }
  console.log(materialStore)
  if(isBool){
    request.post("/MaterialStore/saveMaterialStore", materialStore).then((res) => {
      if(res.code==200){
north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/ReturnToStorageCreate.vue
@@ -98,7 +98,7 @@
//页面第一次加载
request.get(`/BasicWarehouse/BasicWarehouseTypes/材料返库类型`).then((res) => {
request.get(`/BasicWarehouse/BasicWarehouseTypes/库存组织|材料返库类型`).then((res) => {
  if(res.code==200){
    titleSelectJson.value=deepClone(res.data)
@@ -186,7 +186,7 @@
        getStoreWork()
        getStoreWorks()
        getInventoryOrganization()
        //getInventoryOrganization()
      }else{
@@ -201,9 +201,10 @@
//库存组织
const getInventoryOrganization=()=>{
  //页面第一次加载
  request.get(`/BasicWarehouse/BasicWarehouseTypes/库存组织`).then((res) => {
  request.get(`/BasicWarehouse/BasicWarehouseTypes/库存组织|材料返库类型`).then((res) => {
    if(res.code==200){
      console.log(res.data)
      titleSelectJson.value=deepClone(res.data)
      // for(let i=0;i<titleSelectJson.value.inventoryOrganization.length;i++){
      //   this.$set(this.produceList[i], "inventoryOrganization", titleSelectJson.value["inventoryOrganization"][i].operateTypeName);
@@ -216,12 +217,17 @@
  })
}
const getWork = () => {
  getStoreWork()
  getStoreWorks()
}
//列查询
const getStoreWork = () => {
  filterData.value.type=value.value
  request.get(`/BasicWarehouse/BasicWarehouseType/${value.value}`).then((res) => {
    if(res.code==200){
      console.log(res.data)
      gridOptions.columns=[]
      BasicData.value = res.data
      //添加列
@@ -261,9 +267,16 @@
        materialStore.value[i].json=(JSON.parse(res.data.data[i].json))
      }
      materialStore.value.forEach(item => {
        item['inventoryOrganization'] = titleSelectJson.value["inventoryOrganization"][0].operateTypeName
      })
      if(value.value==='原片'){
        materialStore.value.forEach(item => {
          item['inventoryOrganization'] = titleSelectJson.value["inventoryOrganization"][0].operateTypeName
        })
      }else if(value.value==='辅料'){
        materialStore.value.forEach(item => {
          item['inventoryOrganization'] = titleSelectJson.value["inventoryOrganization"][1].operateTypeName
        })
      }
      produceList = deepClone(materialStore.value)
@@ -340,7 +353,7 @@
          request.post("/MaterialInventory/saveReturningWarehouse", flowData.value).then((res) => {
            if(res.code==200){
              ElMessage.success('保存成功')
              router.push({path: '/main/ingredientsStock/MaterialOutbound', query:{random:Math.random()}})
              router.push({path: '/main/ingredientsStock/ReturnToStorage', query:{random:Math.random()}})
            }else{
              ElMessage.warning(res.msg)
              router.push("/login")
@@ -359,7 +372,7 @@
          request.post("/MaterialInventory/updateReturningWarehouseToExamine", flowData.value).then((res) => {
            if (res.code == 200) {
              ElMessage.success(t('basicData.msg.ReviewSuccess'))
              router.push({path: '/main/ingredientsStock/MaterialOutbound', query:{random:Math.random()}})
              router.push({path: '/main/ingredientsStock/ReturnToStorage', query:{random:Math.random()}})
            } else {
              ElMessage.warning(res.msg)
              router.push("/login")
@@ -377,7 +390,7 @@
          request.post("/MaterialInventory/updateReturningWarehouseToExamine", flowData.value).then((res) => {
            if (res.code == 200) {
              ElMessage.success(t('basicData.msg.cancelReviewSuccess'))
              router.push({path: '/main/ingredientsStock/MaterialOutbound', query:{random:Math.random()}})
              router.push({path: '/main/ingredientsStock/ReturnToStorage', query:{random:Math.random()}})
            } else {
              ElMessage.warning(res.msg)
              router.push("/login")
@@ -546,7 +559,7 @@
      <el-row>
        <el-select v-model="value" placeholder="请选择类别" @change="getStoreWork" style="margin-top: 10px;border: #181818 1px solid;">
        <el-select v-model="value" placeholder="请选择类别" @change="getWork" style="margin-top: 10px;border: #181818 1px solid;">
          <el-option
              v-for="item in options"
              :key="item.value"
north-glass-erp/src/main/java/com/example/erp/mapper/mm/MaterialInventoryMapper.java
@@ -185,4 +185,6 @@
                                    @Param("totalArea") Double totalArea,
                                    @Param("returningWarehouseDetail") ReturningWarehouseDetail returningWarehouseDetail);
    Boolean updateMaterialInventoryArea(@Param("materialCode") Long materialCode,@Param("singlePieceArea") Double singlePieceArea);
}
north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java
@@ -55,13 +55,15 @@
                List<MaterialOutboundDetail> materialOutboundDetailLists = materialInventoryMapper.getIsNotMaterialOutboundDetail(materialOutboundId);
                if (!materialOutboundDetailLists.isEmpty()) {
                    for (MaterialOutboundDetail materialOutboundDetail : materialOutboundDetailLists) {
                        if(materialOutboundDetail.getUseId()!=null){
                        //还原物料库存数
                        materialInventoryMapper.updateMaterialInventoryAvailableInt(materialOutboundDetail.getId(), materialOutboundDetail.getOutboundQuantity());
                        /*if(materialOutboundDetail.getUseId()!=null){
                            //还原优化工程库存数
                            materialInventoryMapper.updateMaterialInventoryAvailableOptInt(materialOutboundDetail.getUseId(), materialOutboundDetail.getOutboundQuantity());
                        }else{
                            //还原物料库存数
                            materialInventoryMapper.updateMaterialInventoryAvailableInt(materialOutboundDetail.getId(), materialOutboundDetail.getOutboundQuantity());
                        }
                        }*/
                    }
                }
@@ -465,7 +467,7 @@
                if (!returningWarehouseDetailList.isEmpty()) {
                    for (ReturningWarehouseDetail returningWarehouseDetail : returningWarehouseDetailList) {
                        //修改物料库存数量
                        materialInventoryMapper.updateMaterialInventoryAvailableInt(returningWarehouseDetail.getInventoryId(), returningWarehouseDetail.getReturnQuantity());
                        materialInventoryMapper.updateMaterialInventoryInventoryInt(returningWarehouseDetail.getInventoryId(), returningWarehouseDetail.getReturnQuantity());
                    }
                }
                materialInventoryMapper.updateReturningWarehouseToExamine(returningId,type,reviewed);
@@ -474,7 +476,7 @@
                if (!returningWarehouseDetailList.isEmpty()) {
                    for (ReturningWarehouseDetail returningWarehouseDetail : returningWarehouseDetailList) {
                        //修改物料库存数量
                        materialInventoryMapper.updateMaterialInventoryAvailableOut(returningWarehouseDetail.getInventoryId(), returningWarehouseDetail.getReturnQuantity());
                        materialInventoryMapper.updateMaterialInventoryInventoryOut(returningWarehouseDetail.getInventoryId(), returningWarehouseDetail.getReturnQuantity());
                    }
                }
                materialInventoryMapper.updateReturningWarehouseCounterExamination(returningId,type,reviewed);
north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialStoreService.java
@@ -4,6 +4,7 @@
import com.example.erp.entity.mm.MaterialStore;
import com.example.erp.entity.userInfo.SysError;
import com.example.erp.mapper.mm.BasicWarehouseTypeMapper;
import com.example.erp.mapper.mm.MaterialInventoryMapper;
import com.example.erp.mapper.mm.MaterialStoreMapper;
import com.example.erp.service.userInfo.SysErrorService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -11,6 +12,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.text.DecimalFormat;
import java.util.*;
@Service
@@ -19,6 +21,8 @@
public class MaterialStoreService {
    @Autowired
    MaterialStoreMapper materialStoreMapper;
    @Autowired
    MaterialInventoryMapper materialInventoryMapper;
    @Autowired
    BasicWarehouseTypeMapper basicWarehouseTypeMapper;
    @Autowired
@@ -29,6 +33,9 @@
            String id = "";
            String type = "";
            String json = "";
            double width = 0.0;
            double height = 0.0;
            double singlePieceArea=0.0;
            if (object.get("id") != null) {
                id = object.get("id").toString();
            }
@@ -38,8 +45,19 @@
            if (object.get("json") != null) {
                json = object.get("json").toString();
            }
            if (object.get("width") != null) {
                width = Double.parseDouble(object.get("width").toString());
            }
            if (object.get("height") != null) {
                height = Double.parseDouble(object.get("height").toString());
            }
            DecimalFormat decimalFormat = new DecimalFormat("#0.00");
            singlePieceArea= Double.parseDouble(decimalFormat.format(width * height / 100000));
            if(Long.parseLong(id)>0){
                materialStoreMapper.updateMaterialStore(type,json, Long.valueOf(id));
                if (Objects.equals(type, "原片")){
                    materialInventoryMapper.updateMaterialInventoryArea(Long.valueOf(id),singlePieceArea);
                }
            }else{
                materialStoreMapper.insertMaterialStore(type,json);
            }
north-glass-erp/src/main/resources/mapper/mm/BasicWarehouseType.xml
@@ -17,7 +17,7 @@
    </select>
    <select id="getBasicWarehouse" >
        select operate_type from mm.basic_warehouse_type where type=#{type};
        select operate_type from mm.basic_warehouse_type where type regexp #{type};
    </select>
north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
@@ -678,25 +678,25 @@
    <update id="updateMaterialInventoryInventoryOut">
        update mm.material_inventory
        set inventory_quantity=inventory_quantity-#{quantity},plan_quantity=if(plan_quantity-#{quantity}>=0,plan_quantity-#{quantity},0)
        set inventory_quantity=inventory_quantity-#{quantity},plan_quantity=if(plan_quantity-#{quantity}>=0,plan_quantity-#{quantity},0),total_area=inventory_quantity*single_piece_area
        where id=#{inventoryId}
    </update>
    <update id="updateMaterialInventoryInventoryInt">
        update mm.material_inventory
        set inventory_quantity=inventory_quantity+#{quantity},plan_quantity=plan_quantity+#{quantity}
        set inventory_quantity=inventory_quantity+#{quantity},plan_quantity=plan_quantity+#{quantity},total_area=inventory_quantity*single_piece_area
        where id=#{inventoryId}
    </update>
    <update id="updateMaterialInventoryAvailableInventoryOut">
        update mm.material_inventory
        set available_quantity=available_quantity-#{quantity},inventory_quantity=inventory_quantity-#{quantity}
        set available_quantity=available_quantity-#{quantity},inventory_quantity=inventory_quantity-#{quantity},total_area=inventory_quantity*single_piece_area
        where id=#{inventoryId}
    </update>
    <update id="updateMaterialInventoryAvailableInventoryInt">
        update mm.material_inventory
        set available_quantity=available_quantity+#{quantity},inventory_quantity=inventory_quantity+#{quantity}
        set available_quantity=available_quantity+#{quantity},inventory_quantity=inventory_quantity+#{quantity},total_area=inventory_quantity*single_piece_area
        where id=#{inventoryId}
    </update>
@@ -729,7 +729,7 @@
    </update>
    <update id="updateMaterialInventoryReturning" >
        update mm.material_inventory set inventory_quantity=inventory_quantity+#{returningWarehouseDetail.returnQuantity},
        update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity},
                                         total_area=total_area+#{totalArea}
       where  material_code=#{materialCode} and
                date_of_manufacture=#{returningWarehouseDetail.dateOfManufacture}
@@ -738,7 +738,7 @@
    </update>
    <update id="updateMaterialInventoryReturningNull" >
        update mm.material_inventory set inventory_quantity=inventory_quantity+#{returningWarehouseDetail.returnQuantity},
        update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity},
                                         total_area=total_area+#{totalArea}
        where  material_code=#{materialCode} and
            date_of_manufacture is null
@@ -751,5 +751,11 @@
        where  returning_id=#{number} and returning_number=#{returningWarehouseNumber}
    </update>
    <update id="updateMaterialInventoryArea" >
        update mm.material_inventory set single_piece_area=#{singlePieceArea},
                                         total_area=inventory_quantity*#{singlePieceArea}
        where  material_code=#{materialCode}
    </update>
</mapper>
north-glass-erp/target/classes/mapper/mm/BasicWarehouseType.xml
@@ -17,7 +17,7 @@
    </select>
    <select id="getBasicWarehouse" >
        select operate_type from mm.basic_warehouse_type where type=#{type};
        select operate_type from mm.basic_warehouse_type where type regexp #{type};
    </select>
north-glass-erp/target/classes/mapper/mm/MaterialInventory.xml
@@ -4,6 +4,37 @@
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.erp.mapper.mm.MaterialInventoryMapper">
    <resultMap id="selectMaterialOutboundDetail" type="com.example.erp.entity.mm.MaterialOutboundDetail" >
        <id column="id" property="id"/>
        <result column="material_outbound_id" property="materialOutboundId"/>
        <result column="material_outbound_number" property="materialOutboundNumber"/>
        <result column="inventory_id" property="inventoryId"/>
        <result column="inventory_organization" property="inventoryOrganization"/>
        <result column="material_code" property="materialCode"/>
        <result column="material_name" property="materialName"/>
        <result column="use_id" property="useId"/>
        <result column="producer" property="producer"/>
        <result column="unit" property="unit"/>
        <result column="width" property="width"/>
        <result column="height" property="height"/>
        <result column="thickness" property="thickness"/>
        <result column="outbound_quantity" property="outboundQuantity"/>
        <result column="single_piece_area" property="singlePieceArea"/>
        <result column="inventory_area" property="inventoryArea"/>
        <result column="date_of_manufacture" property="dateOfManufacture"/>
        <result column="remarks" property="remarks"/>
        <result column="material_requisition_personnel" property="materialOutbound.materialRequisitionPersonnel"/>
        <result column="material_requisition_team" property="materialOutbound.materialRequisitionTeam"/>
        <result column="order_id" property="materialOutbound.orderId"/>
        <result column="outbound_type" property="materialOutbound.outboundType"/>
        <result column="warehouse_manager" property="materialOutbound.warehouseManager"/>
        <result column="material_requisition_date" property="materialOutbound.materialRequisitionDate"/>
        <result column="reviewed" property="materialOutbound.reviewed"/>
        <result column="reviewed_time" property="materialOutbound.reviewedTime"/>
    </resultMap>
    <select id="getSelectMaterialInventoryDate">
@@ -647,25 +678,25 @@
    <update id="updateMaterialInventoryInventoryOut">
        update mm.material_inventory
        set inventory_quantity=inventory_quantity-#{quantity},plan_quantity=if(plan_quantity-#{quantity}>=0,plan_quantity-#{quantity},0)
        set inventory_quantity=inventory_quantity-#{quantity},plan_quantity=if(plan_quantity-#{quantity}>=0,plan_quantity-#{quantity},0),total_area=inventory_quantity*single_piece_area
        where id=#{inventoryId}
    </update>
    <update id="updateMaterialInventoryInventoryInt">
        update mm.material_inventory
        set inventory_quantity=inventory_quantity+#{quantity},plan_quantity=plan_quantity+#{quantity}
        set inventory_quantity=inventory_quantity+#{quantity},plan_quantity=plan_quantity+#{quantity},total_area=inventory_quantity*single_piece_area
        where id=#{inventoryId}
    </update>
    <update id="updateMaterialInventoryAvailableInventoryOut">
        update mm.material_inventory
        set available_quantity=available_quantity-#{quantity},inventory_quantity=inventory_quantity-#{quantity}
        set available_quantity=available_quantity-#{quantity},inventory_quantity=inventory_quantity-#{quantity},total_area=inventory_quantity*single_piece_area
        where id=#{inventoryId}
    </update>
    <update id="updateMaterialInventoryAvailableInventoryInt">
        update mm.material_inventory
        set available_quantity=available_quantity+#{quantity},inventory_quantity=inventory_quantity+#{quantity}
        set available_quantity=available_quantity+#{quantity},inventory_quantity=inventory_quantity+#{quantity},total_area=inventory_quantity*single_piece_area
        where id=#{inventoryId}
    </update>
@@ -698,7 +729,7 @@
    </update>
    <update id="updateMaterialInventoryReturning" >
        update mm.material_inventory set inventory_quantity=inventory_quantity+#{returningWarehouseDetail.returnQuantity},
        update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity},
                                         total_area=total_area+#{totalArea}
       where  material_code=#{materialCode} and
                date_of_manufacture=#{returningWarehouseDetail.dateOfManufacture}
@@ -707,7 +738,7 @@
    </update>
    <update id="updateMaterialInventoryReturningNull" >
        update mm.material_inventory set inventory_quantity=inventory_quantity+#{returningWarehouseDetail.returnQuantity},
        update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity},
                                         total_area=total_area+#{totalArea}
        where  material_code=#{materialCode} and
            date_of_manufacture is null
@@ -720,5 +751,11 @@
        where  returning_id=#{number} and returning_number=#{returningWarehouseNumber}
    </update>
    <update id="updateMaterialInventoryArea" >
        update mm.material_inventory set single_piece_area=#{singlePieceArea},
                                         total_area=inventory_quantity*#{singlePieceArea}
        where  material_code=#{materialCode}
    </update>
</mapper>