Merge branch 'master' of https://gitee.com/a1536384743/erp_-override
| | |
| | | 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){ |
| | |
| | | |
| | | |
| | | //页面第一次加载 |
| | | request.get(`/BasicWarehouse/BasicWarehouseTypes/材料返库类型`).then((res) => { |
| | | request.get(`/BasicWarehouse/BasicWarehouseTypes/库存组织|材料返库类型`).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | titleSelectJson.value=deepClone(res.data) |
| | |
| | | getStoreWork() |
| | | |
| | | getStoreWorks() |
| | | getInventoryOrganization() |
| | | //getInventoryOrganization() |
| | | |
| | | |
| | | }else{ |
| | |
| | | //库存组织 |
| | | 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); |
| | |
| | | }) |
| | | } |
| | | |
| | | 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 |
| | | //添加列 |
| | |
| | | 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) |
| | |
| | | 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") |
| | |
| | | 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") |
| | |
| | | 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") |
| | |
| | | |
| | | |
| | | <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" |
| | |
| | | @Param("totalArea") Double totalArea, |
| | | @Param("returningWarehouseDetail") ReturningWarehouseDetail returningWarehouseDetail); |
| | | |
| | | Boolean updateMaterialInventoryArea(@Param("materialCode") Long materialCode,@Param("singlePieceArea") Double singlePieceArea); |
| | | |
| | | } |
| | |
| | | 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()); |
| | | } |
| | | }*/ |
| | | |
| | | } |
| | | } |
| | |
| | | if (!returningWarehouseDetailList.isEmpty()) { |
| | | for (ReturningWarehouseDetail returningWarehouseDetail : returningWarehouseDetailList) { |
| | | //修改物料库存数量 |
| | | materialInventoryMapper.updateMaterialInventoryAvailableInt(returningWarehouseDetail.getInventoryId(), returningWarehouseDetail.getReturnQuantity()); |
| | | materialInventoryMapper.updateMaterialInventoryInventoryInt(returningWarehouseDetail.getInventoryId(), returningWarehouseDetail.getReturnQuantity()); |
| | | } |
| | | } |
| | | materialInventoryMapper.updateReturningWarehouseToExamine(returningId,type,reviewed); |
| | |
| | | if (!returningWarehouseDetailList.isEmpty()) { |
| | | for (ReturningWarehouseDetail returningWarehouseDetail : returningWarehouseDetailList) { |
| | | //修改物料库存数量 |
| | | materialInventoryMapper.updateMaterialInventoryAvailableOut(returningWarehouseDetail.getInventoryId(), returningWarehouseDetail.getReturnQuantity()); |
| | | materialInventoryMapper.updateMaterialInventoryInventoryOut(returningWarehouseDetail.getInventoryId(), returningWarehouseDetail.getReturnQuantity()); |
| | | } |
| | | } |
| | | materialInventoryMapper.updateReturningWarehouseCounterExamination(returningId,type,reviewed); |
| | |
| | | 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; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | |
| | | public class MaterialStoreService { |
| | | @Autowired |
| | | MaterialStoreMapper materialStoreMapper; |
| | | @Autowired |
| | | MaterialInventoryMapper materialInventoryMapper; |
| | | @Autowired |
| | | BasicWarehouseTypeMapper basicWarehouseTypeMapper; |
| | | @Autowired |
| | |
| | | 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(); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | </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> |
| | | |
| | | |
| | |
| | | |
| | | <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> |
| | | |
| | |
| | | </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} |
| | |
| | | </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 |
| | |
| | | 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> |
| | |
| | | </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> |
| | | |
| | | |
| | |
| | | |
| | | <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> |
| | | |
| | |
| | | </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} |
| | |
| | | </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 |
| | |
| | | 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> |