diff --git a/gear-mat/src/main/java/com/gear/mat/controller/MatProductAdditionController.java b/gear-mat/src/main/java/com/gear/mat/controller/MatProductAdditionController.java index 1ac1cd3..227fbd6 100644 --- a/gear-mat/src/main/java/com/gear/mat/controller/MatProductAdditionController.java +++ b/gear-mat/src/main/java/com/gear/mat/controller/MatProductAdditionController.java @@ -8,6 +8,7 @@ import com.gear.common.core.controller.BaseController; import com.gear.mat.domain.bo.MatProductAdditionBo; import com.gear.mat.domain.vo.MatProductAdditionVo; import com.gear.mat.service.IMatProductAdditionService; +import lombok.Data; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -69,4 +70,19 @@ public class MatProductAdditionController extends BaseController { boolean result = productAdditionService.delProductAddition(addId); return R.ok(result); } + + @Log(title = "产品属性附加表", businessType = BusinessType.UPDATE) + @PostMapping("/batchSave") + public R batchSave(@RequestBody BatchSaveRequest payload) { + if (payload == null) { + return R.ok(false); + } + return R.ok(productAdditionService.batchSaveProductAddition(payload.getProductId(), payload.getItems())); + } + + @Data + public static class BatchSaveRequest { + private Long productId; + private List items; + } } diff --git a/gear-mat/src/main/java/com/gear/mat/controller/MatProductLaborController.java b/gear-mat/src/main/java/com/gear/mat/controller/MatProductLaborController.java index 05a92ac..bf06aeb 100644 --- a/gear-mat/src/main/java/com/gear/mat/controller/MatProductLaborController.java +++ b/gear-mat/src/main/java/com/gear/mat/controller/MatProductLaborController.java @@ -8,6 +8,7 @@ import com.gear.common.enums.BusinessType; import com.gear.mat.domain.bo.MatProductLaborBo; import com.gear.mat.domain.vo.MatProductLaborVo; import com.gear.mat.service.IMatProductLaborService; +import lombok.Data; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -46,4 +47,19 @@ public class MatProductLaborController extends BaseController { boolean result = productLaborService.delProductLabor(laborId); return R.ok(result); } + + @Log(title = "产品手动工价", businessType = BusinessType.UPDATE) + @PostMapping("/batchSave") + public R batchSave(@RequestBody BatchSaveRequest payload) { + if (payload == null) { + return R.ok(false); + } + return R.ok(productLaborService.batchSaveProductLabor(payload.getProductId(), payload.getItems())); + } + + @Data + public static class BatchSaveRequest { + private Long productId; + private List items; + } } diff --git a/gear-mat/src/main/java/com/gear/mat/domain/vo/MatMaterialVo.java b/gear-mat/src/main/java/com/gear/mat/domain/vo/MatMaterialVo.java index 832f0eb..5ce6f11 100644 --- a/gear-mat/src/main/java/com/gear/mat/domain/vo/MatMaterialVo.java +++ b/gear-mat/src/main/java/com/gear/mat/domain/vo/MatMaterialVo.java @@ -71,6 +71,11 @@ public class MatMaterialVo { @ExcelDictFormat(readConverterExp = "已=入库") private BigDecimal currentStock; + /** + * 单价(用于成本测算:默认取最新入库单价,其次取最新采购单价) + */ + private BigDecimal unitPrice; + /** * 备注 */ diff --git a/gear-mat/src/main/java/com/gear/mat/service/IMatProductAdditionService.java b/gear-mat/src/main/java/com/gear/mat/service/IMatProductAdditionService.java index 5fd2200..1ee23fd 100644 --- a/gear-mat/src/main/java/com/gear/mat/service/IMatProductAdditionService.java +++ b/gear-mat/src/main/java/com/gear/mat/service/IMatProductAdditionService.java @@ -44,4 +44,6 @@ public interface IMatProductAdditionService extends IService * @return 删除结果 */ boolean delProductAddition(Long addId); + + boolean batchSaveProductAddition(Long productId, List items); } diff --git a/gear-mat/src/main/java/com/gear/mat/service/IMatProductLaborService.java b/gear-mat/src/main/java/com/gear/mat/service/IMatProductLaborService.java index ea0431c..aa1fbe8 100644 --- a/gear-mat/src/main/java/com/gear/mat/service/IMatProductLaborService.java +++ b/gear-mat/src/main/java/com/gear/mat/service/IMatProductLaborService.java @@ -16,4 +16,6 @@ public interface IMatProductLaborService extends IService { boolean updateProductLabor(MatProductLaborBo productLaborBo); boolean delProductLabor(Long laborId); + + boolean batchSaveProductLabor(Long productId, List items); } diff --git a/gear-mat/src/main/java/com/gear/mat/service/impl/MatMaterialServiceImpl.java b/gear-mat/src/main/java/com/gear/mat/service/impl/MatMaterialServiceImpl.java index d7b5da0..a252bca 100644 --- a/gear-mat/src/main/java/com/gear/mat/service/impl/MatMaterialServiceImpl.java +++ b/gear-mat/src/main/java/com/gear/mat/service/impl/MatMaterialServiceImpl.java @@ -49,7 +49,41 @@ public class MatMaterialServiceImpl implements IMatMaterialService { */ @Override public MatMaterialVo queryById(Long materialId){ - return baseMapper.selectVoById(materialId); + MatMaterialVo vo = baseMapper.selectVoById(materialId); + if (vo == null) { + return null; + } + vo.setUnitPrice(resolveUnitPrice(materialId)); + return vo; + } + + private BigDecimal resolveUnitPrice(Long materialId) { + QueryWrapper inDetailQw = new QueryWrapper<>(); + inDetailQw.eq("material_id", materialId); + inDetailQw.eq("del_flag", 0); + inDetailQw.isNotNull("in_price"); + inDetailQw.orderByDesc("in_time"); + inDetailQw.orderByDesc("create_time"); + inDetailQw.last("LIMIT 1"); + MatPurchaseInDetail latestInDetail = matPurchaseInDetailMapper.selectOne(inDetailQw); + if (latestInDetail != null && latestInDetail.getInPrice() != null) { + return latestInDetail.getInPrice(); + } + + QueryWrapper purchaseQw = new QueryWrapper<>(); + purchaseQw.eq("material_id", materialId); + purchaseQw.eq("del_flag", 0); + purchaseQw.ne("status", 3); + purchaseQw.isNotNull("purchase_price"); + purchaseQw.orderByDesc("update_time"); + purchaseQw.orderByDesc("create_time"); + purchaseQw.last("LIMIT 1"); + MatPurchase latestPurchase = matPurchaseMapper.selectOne(purchaseQw); + if (latestPurchase != null && latestPurchase.getPurchasePrice() != null) { + return latestPurchase.getPurchasePrice(); + } + + return null; } /** diff --git a/gear-mat/src/main/java/com/gear/mat/service/impl/MatProductAdditionServiceImpl.java b/gear-mat/src/main/java/com/gear/mat/service/impl/MatProductAdditionServiceImpl.java index 8fa263d..8961219 100644 --- a/gear-mat/src/main/java/com/gear/mat/service/impl/MatProductAdditionServiceImpl.java +++ b/gear-mat/src/main/java/com/gear/mat/service/impl/MatProductAdditionServiceImpl.java @@ -9,7 +9,10 @@ import com.gear.mat.mapper.MatProductAdditionMapper; import com.gear.mat.service.IMatProductAdditionService; import com.gear.common.utils.BeanCopyUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; /** * 产品属性附加表Service实现类 @@ -51,4 +54,55 @@ public class MatProductAdditionServiceImpl extends ServiceImpl items) { + if (productId == null) { + return false; + } + + List exist = baseMapper.selectList(new LambdaQueryWrapper() + .select(MatProductAddition::getAddId) + .eq(MatProductAddition::getProductId, productId) + .eq(MatProductAddition::getDelFlag, 0)); + + Set existIds = exist.stream() + .map(MatProductAddition::getAddId) + .filter(id -> id != null && id > 0) + .collect(Collectors.toSet()); + + Set incomingIds = items == null ? java.util.Collections.emptySet() : items.stream() + .map(MatProductAdditionBo::getAddId) + .filter(id -> id != null && id > 0) + .collect(Collectors.toSet()); + + List deleteIds = existIds.stream() + .filter(id -> !incomingIds.contains(id)) + .collect(Collectors.toList()); + if (!deleteIds.isEmpty()) { + removeByIds(deleteIds); + } + + if (items == null || items.isEmpty()) { + return true; + } + + for (MatProductAdditionBo item : items) { + if (item == null) { + continue; + } + MatProductAddition addition = BeanCopyUtils.copy(item, MatProductAddition.class); + if (addition == null) { + continue; + } + addition.setProductId(productId); + if (addition.getAddId() == null) { + save(addition); + } else { + updateById(addition); + } + } + return true; + } } diff --git a/gear-mat/src/main/java/com/gear/mat/service/impl/MatProductLaborServiceImpl.java b/gear-mat/src/main/java/com/gear/mat/service/impl/MatProductLaborServiceImpl.java index d4a4157..287f588 100644 --- a/gear-mat/src/main/java/com/gear/mat/service/impl/MatProductLaborServiceImpl.java +++ b/gear-mat/src/main/java/com/gear/mat/service/impl/MatProductLaborServiceImpl.java @@ -9,8 +9,11 @@ import com.gear.mat.domain.vo.MatProductLaborVo; import com.gear.mat.mapper.MatProductLaborMapper; import com.gear.mat.service.IMatProductLaborService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; @Service public class MatProductLaborServiceImpl extends ServiceImpl implements IMatProductLaborService { @@ -42,4 +45,55 @@ public class MatProductLaborServiceImpl extends ServiceImpl items) { + if (productId == null) { + return false; + } + + List exist = baseMapper.selectList(new LambdaQueryWrapper() + .select(MatProductLabor::getLaborId) + .eq(MatProductLabor::getProductId, productId) + .eq(MatProductLabor::getDelFlag, 0)); + + Set existIds = exist.stream() + .map(MatProductLabor::getLaborId) + .filter(id -> id != null && id > 0) + .collect(Collectors.toSet()); + + Set incomingIds = items == null ? java.util.Collections.emptySet() : items.stream() + .map(MatProductLaborBo::getLaborId) + .filter(id -> id != null && id > 0) + .collect(Collectors.toSet()); + + List deleteIds = existIds.stream() + .filter(id -> !incomingIds.contains(id)) + .collect(Collectors.toList()); + if (!deleteIds.isEmpty()) { + removeByIds(deleteIds); + } + + if (items == null || items.isEmpty()) { + return true; + } + + for (MatProductLaborBo item : items) { + if (item == null) { + continue; + } + MatProductLabor labor = BeanCopyUtils.copy(item, MatProductLabor.class); + if (labor == null) { + continue; + } + labor.setProductId(productId); + if (labor.getLaborId() == null) { + save(labor); + } else { + updateById(labor); + } + } + return true; + } } diff --git a/gear-oa/src/main/java/com/gear/oa/domain/GearWageEntryDetail.java b/gear-oa/src/main/java/com/gear/oa/domain/GearWageEntryDetail.java index 8a7f699..e930885 100644 --- a/gear-oa/src/main/java/com/gear/oa/domain/GearWageEntryDetail.java +++ b/gear-oa/src/main/java/com/gear/oa/domain/GearWageEntryDetail.java @@ -57,6 +57,16 @@ public class GearWageEntryDetail extends BaseEntity { private String extraReason; + /** + * 明细计算金额(多行乘法合计) + */ + private BigDecimal calcAmount; + + /** + * 明细计算行JSON(两列乘法) + */ + private String calcDetail; + private BigDecimal totalAmount; /** diff --git a/gear-oa/src/main/java/com/gear/oa/domain/bo/GearWageEntryDetailBo.java b/gear-oa/src/main/java/com/gear/oa/domain/bo/GearWageEntryDetailBo.java index acd16de..2897809 100644 --- a/gear-oa/src/main/java/com/gear/oa/domain/bo/GearWageEntryDetailBo.java +++ b/gear-oa/src/main/java/com/gear/oa/domain/bo/GearWageEntryDetailBo.java @@ -59,6 +59,10 @@ public class GearWageEntryDetailBo extends BaseEntity { private String extraReason; + private BigDecimal calcAmount; + + private String calcDetail; + private BigDecimal totalAmount; private String isMakeup; diff --git a/gear-oa/src/main/java/com/gear/oa/domain/vo/GearWageEntryDetailVo.java b/gear-oa/src/main/java/com/gear/oa/domain/vo/GearWageEntryDetailVo.java index 0e705a2..1ad4350 100644 --- a/gear-oa/src/main/java/com/gear/oa/domain/vo/GearWageEntryDetailVo.java +++ b/gear-oa/src/main/java/com/gear/oa/domain/vo/GearWageEntryDetailVo.java @@ -63,6 +63,11 @@ public class GearWageEntryDetailVo { @ExcelProperty(value = "额外原因") private String extraReason; + @ExcelProperty(value = "明细计算金额") + private BigDecimal calcAmount; + + private String calcDetail; + @ExcelProperty(value = "总金额") private BigDecimal totalAmount; diff --git a/gear-oa/src/main/java/com/gear/oa/service/impl/GearWageEntryDetailServiceImpl.java b/gear-oa/src/main/java/com/gear/oa/service/impl/GearWageEntryDetailServiceImpl.java index 34dd447..3dc09e8 100644 --- a/gear-oa/src/main/java/com/gear/oa/service/impl/GearWageEntryDetailServiceImpl.java +++ b/gear-oa/src/main/java/com/gear/oa/service/impl/GearWageEntryDetailServiceImpl.java @@ -188,6 +188,7 @@ public class GearWageEntryDetailServiceImpl implements IGearWageEntryDetailServi private void fillAmountFields(GearWageEntryDetail entity) { BigDecimal workload = entity.getWorkload() == null ? BigDecimal.ZERO : entity.getWorkload(); BigDecimal extraAmount = entity.getExtraAmount() == null ? BigDecimal.ZERO : entity.getExtraAmount(); + BigDecimal calcAmount = entity.getCalcAmount() == null ? BigDecimal.ZERO : entity.getCalcAmount(); // 小时工/天工默认按1个计量单位计算基础金额(1小时或1天) if (("1".equals(entity.getBillingType()) || "3".equals(entity.getBillingType())) && workload.compareTo(BigDecimal.ZERO) <= 0) { @@ -212,7 +213,8 @@ public class GearWageEntryDetailServiceImpl implements IGearWageEntryDetailServi BigDecimal baseAmount = workload.multiply(unitPrice); entity.setBaseAmount(baseAmount); entity.setExtraAmount(extraAmount); - entity.setTotalAmount(baseAmount.add(extraAmount)); + entity.setCalcAmount(calcAmount); + entity.setTotalAmount(baseAmount.add(extraAmount).add(calcAmount)); } private void fillMakeupFields(GearWageEntryDetail entity) { diff --git a/gear-ui3/src/api/mat/productAddition.js b/gear-ui3/src/api/mat/productAddition.js index 298aef9..ba6e3fc 100644 --- a/gear-ui3/src/api/mat/productAddition.js +++ b/gear-ui3/src/api/mat/productAddition.js @@ -34,3 +34,11 @@ export function delProductAddition(addId) { method: 'delete' }) } + +export function batchSaveProductAddition(data) { + return request({ + url: '/api/mat/productAddition/batchSave', + method: 'post', + data + }) +} diff --git a/gear-ui3/src/api/mat/productLabor.js b/gear-ui3/src/api/mat/productLabor.js index a2636a5..6dd278e 100644 --- a/gear-ui3/src/api/mat/productLabor.js +++ b/gear-ui3/src/api/mat/productLabor.js @@ -31,3 +31,10 @@ export function delProductLabor(laborId) { }) } +export function batchSaveProductLabor(data) { + return request({ + url: '/api/mat/productLabor/batchSave', + method: 'post', + data + }) +} diff --git a/gear-ui3/src/views/mat/product/detail.vue b/gear-ui3/src/views/mat/product/detail.vue index 236a238..60b2b6a 100644 --- a/gear-ui3/src/views/mat/product/detail.vue +++ b/gear-ui3/src/views/mat/product/detail.vue @@ -1,167 +1,165 @@ - + @@ -238,8 +240,8 @@ import { useRouter } from 'vue-router'; import { listProduct, getProduct, delProduct, addProduct, updateProduct } from "@/api/mat/product"; import { listProductMaterialRelation } from "@/api/mat/productMaterialRelation"; import { getMaterial } from "@/api/mat/material"; -import { listProductAddition, addProductAddition, updateProductAddition, delProductAddition } from "@/api/mat/productAddition"; -import { listProductLabor, addProductLabor, updateProductLabor, delProductLabor } from "@/api/mat/productLabor"; +import { listProductAddition, batchSaveProductAddition } from "@/api/mat/productAddition"; +import { listProductLabor, batchSaveProductLabor } from "@/api/mat/productLabor"; import { listByIds, listOss } from "@/api/system/oss"; import bom from "@/views/mat/components/bom.vue"; import StickyDragContainer from "@/components/StickyDragContainer/index.vue"; @@ -672,41 +674,27 @@ function removeAdditionItem(index) { } function saveAdditions() { - // 过滤掉空的属性项 - const validAdditions = additionList.value.filter(item => item.attrName && item.attrName.trim()); - - // 保存附加属性 - validAdditions.forEach(item => { - const additionData = { - productId: currentProductId.value, - attrName: item.attrName.trim(), - attrValue: item.attrValue ? item.attrValue.trim() : '' - }; - - // 如果有addId,则是更新操作 - if (item.addId) { - additionData.addId = item.addId; - // 调用API更新附加属性 - updateProductAddition(additionData).then(response => { - if (response.code === 200) { - proxy.$modal.msgSuccess('保存成功'); - } else { - proxy.$modal.msgError('保存失败'); - } - }); + const items = (additionList.value || []) + .map(item => ({ + addId: item?.addId, + attrName: item?.attrName ? String(item.attrName).trim() : '', + attrValue: item?.attrValue ? String(item.attrValue).trim() : '' + })) + .filter(item => item.attrName); + + batchSaveProductAddition({ + productId: currentProductId.value, + items + }).then(res => { + if (res.code === 200 && res.data) { + proxy.$modal.msgSuccess('保存成功'); + additionOpen.value = false; } else { - // 调用API新增附加属性 - addProductAddition(additionData).then(response => { - if (response.code === 200) { - proxy.$modal.msgSuccess('保存成功'); - } else { - proxy.$modal.msgError('保存失败'); - } - }); + proxy.$modal.msgError('保存失败'); } + }).catch(() => { + proxy.$modal.msgError('保存失败'); }); - - additionOpen.value = false; } function handleLabor(row) { @@ -725,38 +713,28 @@ function addLaborItem() { } function removeLaborItem(index) { - const item = laborList.value[index]; - if (item && item.laborId) { - delProductLabor(item.laborId).finally(() => { - laborList.value.splice(index, 1); - }); - return; - } laborList.value.splice(index, 1); } async function saveLabors() { - const valid = laborList.value - .map(item => ({ - ...item, - laborName: item.laborName ? String(item.laborName).trim() : '' - })) - .filter(item => item.laborName); - - const tasks = valid.map(item => { - const data = { - laborId: item.laborId, - productId: currentProductId.value, - laborName: item.laborName, - laborPrice: item.laborPrice ?? 0 - }; - if (data.laborId) return updateProductLabor(data); - return addProductLabor(data); - }); - try { - await Promise.all(tasks); - proxy.$modal.msgSuccess('保存成功'); + const items = (laborList.value || []) + .map(item => ({ + laborId: item?.laborId, + laborName: item?.laborName ? String(item.laborName).trim() : '', + laborPrice: item?.laborPrice ?? 0 + })) + .filter(item => item.laborName); + + const res = await batchSaveProductLabor({ + productId: currentProductId.value, + items + }); + if (res.code === 200 && res.data) { + proxy.$modal.msgSuccess('保存成功'); + } else { + proxy.$modal.msgError('保存失败'); + } } catch (e) { proxy.$modal.msgError('保存失败'); } finally { @@ -787,4 +765,15 @@ getList(); :deep(.el-image-viewer__wrapper) { z-index: 9999 !important; } + +.product-op-actions { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 4px 10px; +} + +:deep(.product-op-actions .el-button + .el-button) { + margin-left: 0; +} diff --git a/gear-ui3/src/views/oms/wageEntryDetail/index.vue b/gear-ui3/src/views/oms/wageEntryDetail/index.vue index bd01eca..3080177 100644 --- a/gear-ui3/src/views/oms/wageEntryDetail/index.vue +++ b/gear-ui3/src/views/oms/wageEntryDetail/index.vue @@ -74,17 +74,54 @@ + + + - + + + +
+ 新增一行 +
合计:{{ calcTotal }} 元
+
+ + + + + + + + + + + + + + + +
@@ -167,13 +204,83 @@ function round2(v) { return Math.round(v * 100) / 100 } +const calcOpen = ref(false) +const calcTargetRow = ref(null) +const calcLines = ref([]) + +function safeParseCalcDetail(val) { + if (!val) return null + try { + return JSON.parse(val) + } catch (e) { + return null + } +} + +function openCalcDialog(row) { + calcTargetRow.value = row + const parsed = safeParseCalcDetail(row.calcDetail) + const items = parsed && Array.isArray(parsed.items) ? parsed.items : null + if (items && items.length) { + calcLines.value = items.map(i => ({ + a: i && i.a !== undefined && i.a !== null ? String(i.a) : '', + b: i && i.b !== undefined && i.b !== null ? String(i.b) : '' + })) + } else { + calcLines.value = [{ a: '', b: '' }] + } + calcOpen.value = true +} + +function addCalcLine() { + calcLines.value.push({ a: '', b: '' }) +} + +function removeCalcLine(index) { + if (calcLines.value.length <= 1) { + calcLines.value = [{ a: '', b: '' }] + return + } + calcLines.value.splice(index, 1) +} + +function lineAmount(line) { + return round2(toNumber(line?.a) * toNumber(line?.b)) +} + +const calcTotal = computed(() => { + const sum = calcLines.value.reduce((acc, line) => acc + lineAmount(line), 0) + return round2(sum) +}) + +function saveCalcToRow() { + const row = calcTargetRow.value + if (!row) { + calcOpen.value = false + return + } + const normalizedItems = calcLines.value + .map(l => ({ + a: l && l.a !== undefined && l.a !== null ? String(l.a).trim() : '', + b: l && l.b !== undefined && l.b !== null ? String(l.b).trim() : '' + })) + .filter(l => l.a !== '' || l.b !== '') + + row.calcAmount = calcTotal.value + row.calcDetail = JSON.stringify({ v: 1, items: normalizedItems }) + recalcRowAmount(row) + calcOpen.value = false + proxy.$modal.msgSuccess('明细已保存,请点击该行“保存”提交') +} + function recalcRowAmount(row) { const workload = toNumber(row.workload) const unitPrice = row.billingType === '2' ? toNumber(row.unitPrice) : toNumber(row.unitPrice) const extraAmount = toNumber(row.extraAmount) + const calcAmount = toNumber(row.calcAmount) const baseAmount = round2(workload * unitPrice) row.baseAmount = baseAmount - row.totalAmount = round2(baseAmount + extraAmount) + row.totalAmount = round2(baseAmount + extraAmount + calcAmount) // 重新计算累计金额 updateCumulativeAmounts() @@ -210,6 +317,8 @@ function getList() { workload: normalizeEditableValue(row.workload), unitPrice: normalizeEditableValue(row.unitPrice), extraAmount: normalizeEditableValue(row.extraAmount), + calcAmount: row.calcAmount ?? 0, + calcDetail: row.calcDetail, cumulativeAmount: cumulativeAmounts.value[row.empName] || 0 } recalcRowAmount(r) @@ -241,6 +350,9 @@ function buildRowPayload(row) { if (payload.extraAmount === '' || payload.extraAmount === null || payload.extraAmount === undefined) { payload.extraAmount = 0 } + if (payload.calcAmount === '' || payload.calcAmount === null || payload.calcAmount === undefined) { + payload.calcAmount = 0 + } if (payload.billingType !== '2') { payload.unitPrice = null } else if (payload.unitPrice === '' || payload.unitPrice === null || payload.unitPrice === undefined) { diff --git a/script/sql/mysql/update/update_v0.8.2~v0.8.3.sql b/script/sql/mysql/update/update_v0.8.2~v0.8.3.sql index 3603498..bb4bc95 100644 --- a/script/sql/mysql/update/update_v0.8.2~v0.8.3.sql +++ b/script/sql/mysql/update/update_v0.8.2~v0.8.3.sql @@ -119,7 +119,9 @@ CREATE TABLE gear_wage_entry_detail ( base_amount decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT '基础金额(工作量*单价)', extra_amount decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT '额外金额(高温/交通等)', extra_reason varchar(255) DEFAULT '' COMMENT '额外金额原因', - total_amount decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT '总金额(基础+额外)', + calc_amount decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT '明细计算金额(多行乘法合计)', + calc_detail text COMMENT '明细计算行JSON(两列乘法)', + total_amount decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT '总金额(基础+额外+明细计算)', is_makeup char(1) NOT NULL DEFAULT '0' COMMENT '是否补录(0否 1是)', source_detail_id bigint(20) DEFAULT NULL COMMENT '被补录/被修改的原始明细ID', makeup_responsible_id bigint(20) DEFAULT NULL COMMENT '补录责任人ID',