标准件成本
This commit is contained in:
parent
15d7c63608
commit
782649276f
@ -14,6 +14,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrder
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.orderys.OrderYsDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderSubDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storage.StorageDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.orderys.OrderYsMapper;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.BusinesTypeEnum;
|
||||
@ -21,6 +22,7 @@ import com.chanko.yunxi.mes.module.heli.manager.CrossOrderManager;
|
||||
import com.chanko.yunxi.mes.module.heli.service.deliverorder.DeliverOrderService;
|
||||
import com.chanko.yunxi.mes.module.heli.service.orderys.OrderYsService;
|
||||
import com.chanko.yunxi.mes.module.heli.service.projectorder.ProjectOrderService;
|
||||
import com.chanko.yunxi.mes.module.heli.service.storage.StorageService;
|
||||
import com.chanko.yunxi.mes.module.heli.service.taskdispatch.TaskDispatchService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@ -65,6 +67,8 @@ public class ProjectOrderController {
|
||||
private DeliverOrderService deliverOrderService;
|
||||
@Resource
|
||||
private TaskDispatchService taskDispatchService;
|
||||
@Resource
|
||||
private StorageService storageService;
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建项目订单")
|
||||
@PreAuthorize("@ss.hasPermission('heli:project-order:create')")
|
||||
@ -161,6 +165,13 @@ public class ProjectOrderController {
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
projectOrderDO.setJiaGongShiCost(totalAmount);
|
||||
}
|
||||
List<StorageDO> list1= storageService.getList(projectOrderDO.getId(),projectOrderDO.getProjectSubId());
|
||||
if (list1!=null&&list1.size()>0){
|
||||
BigDecimal totalAmount = list1.stream()
|
||||
.map(StorageDO -> StorageDO.getCaiGouMoney() != null ?StorageDO.getCaiGouMoney() : BigDecimal.ZERO)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
projectOrderDO.setBiaoZhunJianCost(totalAmount);
|
||||
}
|
||||
}
|
||||
return success(BeanUtils.toBean(pageResult, ProjectOrderCostRespVO.class));
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.storage;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.outsourcestockboom.vo.OutsourceStockBoomSaveReqVO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.deliverorder.DeliverOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelog.StorageLogDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageLogNowDO;
|
||||
@ -300,5 +301,12 @@ public class StorageController {
|
||||
ExcelUtils.write(response, "入/出库.xls", "数据", StorageRespVO.class,
|
||||
BeanUtils.toBean(list, StorageRespVO.class));
|
||||
}
|
||||
@GetMapping("/getList")
|
||||
@Operation(summary = "获得标准件成本")
|
||||
@PreAuthorize("@ss.hasPermission('heli:deliver-order:query')")
|
||||
public CommonResult<List<StorageDO>> getList(@RequestParam("id") Long id, @RequestParam("projectSubId") Long projectSubId ) {
|
||||
List<StorageDO> list = storageService.getList(id, projectSubId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -283,6 +283,8 @@ public class ProjectOrderDO extends BaseDO {
|
||||
private BigDecimal yunFeiCost;
|
||||
@TableField(exist = false)
|
||||
private BigDecimal jiaGongShiCost;
|
||||
@TableField(exist = false)
|
||||
private BigDecimal biaoZhunJianCost;
|
||||
/**
|
||||
* 变更的字段列表
|
||||
* */
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.chanko.yunxi.mes.module.heli.dal.dataobject.storage;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
@ -106,6 +108,20 @@ public class StorageDO extends BaseDO {
|
||||
private Integer pickmode;
|
||||
private Integer pickcar;
|
||||
private Integer projectNo;
|
||||
@TableField(exist = false)
|
||||
private String materialCode;
|
||||
@TableField(exist = false)
|
||||
private String materialName;
|
||||
@TableField(exist = false)
|
||||
private String materialType;
|
||||
@TableField(exist = false)
|
||||
private String materialSpec;
|
||||
@TableField(exist = false)
|
||||
private String amount;
|
||||
@TableField(exist = false)
|
||||
private String unit;
|
||||
@TableField(exist = false)
|
||||
private BigDecimal caiGouMoney;
|
||||
|
||||
|
||||
}
|
@ -9,6 +9,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.customer.CustomerDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storage.StorageDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageMaterialDO;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO;
|
||||
import com.chanko.yunxi.mes.module.heli.enums.YesOrNoEnum;
|
||||
import com.chanko.yunxi.mes.module.system.dal.dataobject.dept.DeptDO;
|
||||
@ -75,4 +76,20 @@ public interface StorageMapper extends BaseMapperX<StorageDO> {
|
||||
// .orderByDesc(StorageDO::getId));
|
||||
}
|
||||
|
||||
default List<StorageDO> getList(Long id, Long projectSubId){
|
||||
MPJLambdaWrapper<StorageDO> query = new MPJLambdaWrapper<>();
|
||||
query.selectAll(StorageDO.class)
|
||||
.select("mat.code as materialCode","mat.name as materialName","mat.material_type as materialType","mat.unit as unit","mat.spec as materialSpec")
|
||||
.select("COALESCE(ROUND(sm.storage_ok_qty * sm.price, 2), 0) AS caiGouMoney","sm.storage_ok_qty as amount")
|
||||
.leftJoin(StorageMatDO.class, "sm", StorageMatDO::getStockId, StorageDO::getId)
|
||||
.leftJoin(MaterialDO.class, "mat", MaterialDO::getId, StorageMatDO::getMatId)
|
||||
.disableSubLogicDel()
|
||||
.orderByDesc(StorageDO::getCreateTime);
|
||||
|
||||
query.eq(StorageDO::getProjectNo,projectSubId)
|
||||
.eq(StorageDO::getStockType,2)
|
||||
.eq(StorageMatDO::getDeleted,0)
|
||||
.eq(MaterialDO::getDeleted,0);
|
||||
return selectList(query);
|
||||
}
|
||||
}
|
@ -71,4 +71,5 @@ public interface StorageService {
|
||||
*/
|
||||
PageResult<StorageDO> getStoragePage(StoragePageReqVO pageReqVO);
|
||||
|
||||
List<StorageDO> getList(Long id, Long projectSubId);
|
||||
}
|
||||
|
@ -390,4 +390,9 @@ private StorageLogService storageLogService;
|
||||
return storageMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StorageDO> getList(Long id, Long projectSubId) {
|
||||
return storageMapper.getList(id,projectSubId);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -31,3 +31,7 @@ export const getListYf = async (id: number,projectSubId: number) => {
|
||||
export const getListJg = async (id: number,projectSubId: number) => {
|
||||
return await request.get({ url: `/heli/task-dispatch/getListJg?id=`+id+`&projectSubId=`+projectSubId })
|
||||
}
|
||||
//查询标准件成本
|
||||
export const getList = async (id: number,projectSubId: number) => {
|
||||
return await request.get({ url: `/heli/storage/getList?id=`+id+`&projectSubId=`+projectSubId })
|
||||
}
|
||||
|
@ -602,7 +602,7 @@ const handleInitPlanSub = async () => {
|
||||
})
|
||||
|
||||
formData.value.projectPlanSubs = (await PlanSubApi.getPlanSubPage(queryParams)).list
|
||||
|
||||
console.log( formData.value.projectPlanSubs)
|
||||
// formData.value.projectOrderSubs.forEach((item) => {
|
||||
// if (formData.value.projectPlanSubs.filter((sub) => sub.projectSubId == item.id).length > 0) {
|
||||
// var subTemp = formData.value.projectPlanSubs.find((sub) => sub.projectSubId == item.id)
|
||||
|
@ -102,18 +102,27 @@
|
||||
<el-table-column v-if="false" label="ID" align="center" prop="id" width="240px" />
|
||||
<el-table-column label="物料编号" align="center" prop="materialCode" width="240px" />
|
||||
<el-table-column label="物料名称" align="center" prop="materialName" width="240px"/>
|
||||
<el-table-column label="物料类型" align="center" prop="materialType" width="240px"/>
|
||||
|
||||
<!-- <el-table-column label="物料类型" align="center" prop="materialType" width="240px"/>-->
|
||||
<el-table-column label="物料类型" align="center" prop="materialType" width="150px">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.materialType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格型号" align="center" prop="materialSpec" />
|
||||
<el-table-column label="领料数量" align="center" prop="amount" />
|
||||
<el-table-column label="系统单位" align="center" prop="unit" />
|
||||
<el-table-column label="平均采购价(暂估)" align="center" prop="zanGuMoney" />
|
||||
<el-table-column label="平均采购价(实际)" align="center" >
|
||||
<template v-slot="scope">
|
||||
<el-input v-model="scope.row.shiJiMoney" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购金额(实际)" align="center" prop="caiGouMoney" />
|
||||
<!-- <el-table-column label="系统单位" align="center" prop="unit" />-->
|
||||
<el-table-column label="系统单位" align="center" prop="unit" width="100px">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.unit" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="平均采购价(暂估)" align="center" prop="zanGuMoney" />-->
|
||||
<!-- <el-table-column label="平均采购价(实际)" align="center" >-->
|
||||
<!-- <template v-slot="scope">-->
|
||||
<!-- <el-input v-model="scope.row.shiJiMoney" />-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="库存价格(元)" align="center" prop="caiGouMoney" width="200px"/>
|
||||
|
||||
|
||||
</el-table>
|
||||
@ -123,18 +132,27 @@
|
||||
<template #header>
|
||||
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">其他材料成本</span>
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="listYcl" :stripe="true" :show-overflow-tooltip="true" border class="hl-table">
|
||||
<el-table v-loading="loading" :data="listqt" :stripe="true" :show-overflow-tooltip="true" border class="hl-table">
|
||||
<el-table-column type="index" min-width="60" fixed label="序号" align="center" />
|
||||
|
||||
|
||||
<el-table-column v-if="false" label="ID" align="center" prop="id" width="240px" />
|
||||
<el-table-column label="物料编号" align="center" prop="materialCode" width="240px" />
|
||||
<el-table-column label="物料名称" align="center" prop="materialName" width="240px"/>
|
||||
<el-table-column label="物料类型" align="center" prop="materialType" width="240px"/>
|
||||
|
||||
<!-- <el-table-column label="物料类型" align="center" prop="materialType" width="240px">-->
|
||||
<el-table-column label="物料类型" align="center" prop="materialType" width="240px">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.materialType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格型号" align="center" prop="materialSpec" />
|
||||
<el-table-column label="领料数量" align="center" prop="amount" />
|
||||
<el-table-column label="系统单位" align="center" prop="unit" />
|
||||
<!-- <el-table-column label="系统单位" align="center" prop="unit" />-->
|
||||
<el-table-column label="系统单位" align="center" prop="unit" width="240px">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.unit" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="平均采购价(暂估)" align="center" prop="zanGuMoney" />
|
||||
<el-table-column label="平均采购价(实际)" align="center" >
|
||||
<template v-slot="scope">
|
||||
@ -208,8 +226,8 @@
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="总加工工时" align="center" prop="amount" />
|
||||
<el-table-column label="所属岗位" align="center" prop="name" />
|
||||
<el-table-column label="工时单价" align="center" prop="shiJiMoney"/>
|
||||
<el-table-column label="加工费用" align="center" prop="zanGuMoney" />
|
||||
<el-table-column label="工时单价(元)" align="center" prop="shiJiMoney"/>
|
||||
<el-table-column label="加工费用(元)" align="center" prop="zanGuMoney" />
|
||||
|
||||
|
||||
</el-table>
|
||||
@ -242,7 +260,7 @@
|
||||
<el-table-column type="index" min-width="60" fixed label="序号" align="center" />
|
||||
<el-table-column v-if="false" label="ID" align="center" prop="id" width="240px" />
|
||||
<el-table-column label="发货时间" align="center" prop="deliverDate" width="240px" :formatter="dateFormatter2"/>
|
||||
<el-table-column label="运费成本" align="center" prop="yunFeiMoney" />
|
||||
<el-table-column label="运费成本(元)" align="center" prop="yunFeiMoney" />
|
||||
|
||||
|
||||
|
||||
@ -271,7 +289,7 @@
|
||||
const reload = inject('reload')
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const list = ref([]) // 标准件数据
|
||||
const listYcl = ref([]) // 原材料
|
||||
const listqt = ref([]) // 原材料
|
||||
// const listFzc = ref([]) // 副资材
|
||||
// const loading = ref(true) // 列表的加载中
|
||||
|
||||
@ -312,8 +330,11 @@
|
||||
listYf.value=listYfData
|
||||
const listJgData = await SaleeOrderCost.getListJg(query.id,query.projectSubId)
|
||||
listJg.value=listJgData
|
||||
const listData = await SaleeOrderCost.getList(query.id,query.projectSubId)
|
||||
list.value=listData
|
||||
formData.value.yunFeiCost=0
|
||||
formData.value.jiaGongShiCost=0
|
||||
formData.value.biaoZhunJianCost=0
|
||||
if (listYf.value!=null){
|
||||
listYf.value.map((item)=>{
|
||||
formData.value.yunFeiCost+=item.yunFeiMoney
|
||||
@ -323,6 +344,11 @@
|
||||
listJg.value.map((item)=>{
|
||||
formData.value.jiaGongShiCost+=Number(item.zanGuMoney)
|
||||
})
|
||||
}
|
||||
if (list.value!=null){
|
||||
list.value.map((item)=>{
|
||||
formData.value.biaoZhunJianCost+=Number(item.caiGouMoney)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -272,7 +272,8 @@ ref="subFormRef" :model="formData.taskDispatchDetails" :rules="subFormRules"
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="顺序号" align="center" prop="sort" width="160">
|
||||
<template #default="{ row, $index }">
|
||||
<template #header> <span class="hl-table_header">*</span>顺序号</template>
|
||||
<template #default="{ row, $index }">
|
||||
<el-form-item :prop="`${$index}.sort`" :rules="subFormRules.sort" class="mb-0px!">
|
||||
<el-input-number
|
||||
min="0" :precision="0" class="!w-240px"
|
||||
@ -822,6 +823,11 @@ const resetForm = () => {
|
||||
}
|
||||
const subFormLoading = ref(false) // 子表单的加载中
|
||||
const subFormRules = reactive({
|
||||
sort: [{
|
||||
required: true,
|
||||
message: '工序不能为空',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
procedureId: [{
|
||||
required: true,
|
||||
message: '工序不能为空',
|
||||
@ -888,6 +894,7 @@ const sureToCancle = () =>{
|
||||
submitForm('CANCEL_SUBMIT');
|
||||
}
|
||||
const submitForm = async (operate) => {
|
||||
|
||||
formData.value.active = operate
|
||||
// 校验子表单
|
||||
await subFormRef.value.validate()
|
||||
|
Loading…
Reference in New Issue
Block a user