Showing
12 changed files
with
47 additions
and
75 deletions
| @@ -63,6 +63,7 @@ | @@ -63,6 +63,7 @@ | ||
| 63 | 63 | ||
| 64 | **坑**:只改了 entity,XML resultMap/SELECT、Vo、Bo 漏改,导致查询列缺失或保存丢字段。 | 64 | **坑**:只改了 entity,XML resultMap/SELECT、Vo、Bo 漏改,导致查询列缺失或保存丢字段。 |
| 65 | **正确做法**:按 `skill/.trae/skills/新增字段` 清单走:base.sql(ALTER 追加)→ entity → XML(resultMap+SELECT) → QueryVo/CreateVo/UpdateVo → GetBo;BeanUtil.copyProperties / BaseBo 构造按同名字段自动映射,**字段名必须对齐**。 | 65 | **正确做法**:按 `skill/.trae/skills/新增字段` 清单走:base.sql(ALTER 追加)→ entity → XML(resultMap+SELECT) → QueryVo/CreateVo/UpdateVo → GetBo;BeanUtil.copyProperties / BaseBo 构造按同名字段自动映射,**字段名必须对齐**。 |
| 66 | +**实证**:diff_quantity_exceeded 上线时实体/Vo/Bo/DDL 全改了,唯独漏了 ProcurementPlanMapper.xml 的 resultMap+SELECT,列表/详情查不出值——XML 自定义查询列是最易漏的一环,加列后 Grep 列名自查 XML 是否覆盖。 | ||
| 66 | 67 | ||
| 67 | ## 12. 非持久化展示字段用 @TableField(exist = false) | 68 | ## 12. 非持久化展示字段用 @TableField(exist = false) |
| 68 | 69 |
| @@ -2614,7 +2614,11 @@ ALTER TABLE procurement_weighing_ticket | @@ -2614,7 +2614,11 @@ ALTER TABLE procurement_weighing_ticket | ||
| 2614 | 2614 | ||
| 2615 | -- 采购计划:差值标识(审核通过初始化为"少 总数量吨",过磅码单完成/作废时重算,供应管理科主管可手动修改) | 2615 | -- 采购计划:差值标识(审核通过初始化为"少 总数量吨",过磅码单完成/作废时重算,供应管理科主管可手动修改) |
| 2616 | ALTER TABLE procurement_plan | 2616 | ALTER TABLE procurement_plan |
| 2617 | - ADD COLUMN diff_quantity_flag varchar(50) DEFAULT NULL COMMENT '差值标识(多x吨/少x吨,null=差值在容差范围内不显示)'; | 2617 | + ADD COLUMN diff_quantity_flag varchar(50) DEFAULT NULL COMMENT '差值标识(多x吨/少x吨,始终返回)'; |
| 2618 | + | ||
| 2619 | +-- 采购计划:是否超过差值容差(计划总数量10吨以内容差1吨、10吨以上容差2吨;过磅码单变动时重算,供应管理科主管可手动修改) | ||
| 2620 | +ALTER TABLE procurement_plan | ||
| 2621 | + ADD COLUMN diff_quantity_exceeded tinyint(1) DEFAULT NULL COMMENT '是否超过差值容差(true-超差 false-未超差)'; | ||
| 2618 | 2622 | ||
| 2619 | -- 过磅码单:复磅功能(复磅=新增一张码单关联原单、编号为F+原编号,复磅单审核通过后原码单作废) | 2623 | -- 过磅码单:复磅功能(复磅=新增一张码单关联原单、编号为F+原编号,复磅单审核通过后原码单作废) |
| 2620 | ALTER TABLE procurement_weighing_ticket | 2624 | ALTER TABLE procurement_weighing_ticket |
| @@ -250,12 +250,18 @@ public class GetProcurementPlanBo extends BaseBo<ProcurementPlan> { | @@ -250,12 +250,18 @@ public class GetProcurementPlanBo extends BaseBo<ProcurementPlan> { | ||
| 250 | private BigDecimal totalQuantity; | 250 | private BigDecimal totalQuantity; |
| 251 | 251 | ||
| 252 | /** | 252 | /** |
| 253 | - * 差值标识(多x吨/少x吨,null=差值在容差范围内不显示) | 253 | + * 差值标识(多x吨/少x吨,始终返回) |
| 254 | */ | 254 | */ |
| 255 | - @ApiModelProperty("差值标识(多x吨/少x吨,null=差值在容差范围内不显示)") | 255 | + @ApiModelProperty("差值标识(多x吨/少x吨)") |
| 256 | private String diffQuantityFlag; | 256 | private String diffQuantityFlag; |
| 257 | 257 | ||
| 258 | /** | 258 | /** |
| 259 | + * 是否超过差值容差(true-超差 false-未超差;计划总数量10吨以内容差1吨、10吨以上容差2吨) | ||
| 260 | + */ | ||
| 261 | + @ApiModelProperty("是否超过差值容差(true-超差 false-未超差)") | ||
| 262 | + private Boolean diffQuantityExceeded; | ||
| 263 | + | ||
| 264 | + /** | ||
| 259 | * 备注 | 265 | * 备注 |
| 260 | */ | 266 | */ |
| 261 | @ApiModelProperty("备注") | 267 | @ApiModelProperty("备注") |
| @@ -21,7 +21,6 @@ import com.lframework.xingyun.sc.procurement.service.buyout.ProcurementBuyoutApp | @@ -21,7 +21,6 @@ import com.lframework.xingyun.sc.procurement.service.buyout.ProcurementBuyoutApp | ||
| 21 | import com.lframework.xingyun.sc.procurement.service.plan.ProcurementPlanService; | 21 | import com.lframework.xingyun.sc.procurement.service.plan.ProcurementPlanService; |
| 22 | import com.lframework.xingyun.sc.procurement.vo.plan.CreateProcurementPlanVo; | 22 | import com.lframework.xingyun.sc.procurement.vo.plan.CreateProcurementPlanVo; |
| 23 | import com.lframework.xingyun.sc.procurement.vo.plan.QueryProcurementPlanVo; | 23 | import com.lframework.xingyun.sc.procurement.vo.plan.QueryProcurementPlanVo; |
| 24 | -import com.lframework.xingyun.sc.procurement.vo.plan.UpdatePlanDiffFlagVo; | ||
| 25 | import com.lframework.xingyun.sc.procurement.vo.plan.UpdateProcurementPlanVo; | 24 | import com.lframework.xingyun.sc.procurement.vo.plan.UpdateProcurementPlanVo; |
| 26 | import com.lframework.xingyun.sc.utils.ExcelUtil; | 25 | import com.lframework.xingyun.sc.utils.ExcelUtil; |
| 27 | import io.swagger.annotations.Api; | 26 | import io.swagger.annotations.Api; |
| @@ -45,6 +44,7 @@ import org.springframework.web.bind.annotation.RestController; | @@ -45,6 +44,7 @@ import org.springframework.web.bind.annotation.RestController; | ||
| 45 | import javax.servlet.http.HttpServletResponse; | 44 | import javax.servlet.http.HttpServletResponse; |
| 46 | import javax.validation.Valid; | 45 | import javax.validation.Valid; |
| 47 | import javax.validation.constraints.NotBlank; | 46 | import javax.validation.constraints.NotBlank; |
| 47 | +import javax.validation.constraints.NotNull; | ||
| 48 | import java.io.FileNotFoundException; | 48 | import java.io.FileNotFoundException; |
| 49 | import java.io.IOException; | 49 | import java.io.IOException; |
| 50 | import java.io.InputStream; | 50 | import java.io.InputStream; |
| @@ -159,13 +159,14 @@ public class ProcurementPlanController extends DefaultBaseController { | @@ -159,13 +159,14 @@ public class ProcurementPlanController extends DefaultBaseController { | ||
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | /** | 161 | /** |
| 162 | - * 修改差值标识(供应管理科主管手动更改,传空清除) | 162 | + * 修改是否超过差值(供应管理科主管手动更改;过磅码单变动时会自动重算覆盖) |
| 163 | */ | 163 | */ |
| 164 | - @ApiOperation("修改差值标识(供应管理科主管)") | ||
| 165 | - @HasPermission({"plan-manage:domestic-plan:updateDiffFlag"}) | ||
| 166 | - @PutMapping("/diffFlag") | ||
| 167 | - public InvokeResult<Void> updateDiffFlag(@RequestBody @Valid UpdatePlanDiffFlagVo vo) { | ||
| 168 | - procurementPlanService.updateDiffFlag(vo.getId(), vo.getDiffQuantityFlag()); | 164 | + @ApiOperation("修改是否超过差值(供应管理科主管)") |
| 165 | + @HasPermission({"plan-manage:domestic-plan:change"}) | ||
| 166 | + @PutMapping("/diffQuantityExceeded") | ||
| 167 | + public InvokeResult<Void> updateDiffQuantityExceeded(@NotBlank(message = "ID不能为空!") String id, | ||
| 168 | + @NotNull(message = "diffQuantityExceeded不能为空!") Boolean diffQuantityExceeded) { | ||
| 169 | + procurementPlanService.updateDiffQuantityExceeded(id, diffQuantityExceeded); | ||
| 169 | return InvokeResultBuilder.success(); | 170 | return InvokeResultBuilder.success(); |
| 170 | } | 171 | } |
| 171 | 172 |
| @@ -214,11 +214,16 @@ public class ProcurementPlan extends BaseEntity implements BaseDto { | @@ -214,11 +214,16 @@ public class ProcurementPlan extends BaseEntity implements BaseDto { | ||
| 214 | private BigDecimal totalQuantity; | 214 | private BigDecimal totalQuantity; |
| 215 | 215 | ||
| 216 | /** | 216 | /** |
| 217 | - * 差值标识(多x吨/少x吨,null=差值在容差范围内不显示;审核通过初始化,过磅码单完成/作废时重算,供应管理科主管可手动修改) | 217 | + * 差值标识(多x吨/少x吨,始终返回;审核通过初始化,过磅码单完成/作废时重算,供应管理科主管可手动修改) |
| 218 | */ | 218 | */ |
| 219 | private String diffQuantityFlag; | 219 | private String diffQuantityFlag; |
| 220 | 220 | ||
| 221 | /** | 221 | /** |
| 222 | + * 是否超过差值容差(true-超差 false-未超差;计划总数量10吨以内容差1吨、10吨以上容差2吨;过磅码单变动时重算,供应管理科主管可手动修改) | ||
| 223 | + */ | ||
| 224 | + private Boolean diffQuantityExceeded; | ||
| 225 | + | ||
| 226 | + /** | ||
| 222 | * 备注 | 227 | * 备注 |
| 223 | */ | 228 | */ |
| 224 | private String remark; | 229 | private String remark; |
| @@ -257,8 +257,6 @@ public class ProcurementPlanChangeServiceImpl extends | @@ -257,8 +257,6 @@ public class ProcurementPlanChangeServiceImpl extends | ||
| 257 | .set(ProcurementPlan::getPlanType, "变") | 257 | .set(ProcurementPlan::getPlanType, "变") |
| 258 | .eq(ProcurementPlan::getId, vo.getProcurementPlanId()); | 258 | .eq(ProcurementPlan::getId, vo.getProcurementPlanId()); |
| 259 | procurementPlanService.update(parentWrapper); | 259 | procurementPlanService.update(parentWrapper); |
| 260 | - // 子计划变更完成(流程状态已完成):重算差值标识 | ||
| 261 | - procurementPlanService.recalcDiffFlags(Collections.singletonList(vo.getProcurementPlanId())); | ||
| 262 | //修改分厂 | 260 | //修改分厂 |
| 263 | Wrapper<ProcurementPlanLine> lineWrapper = Wrappers.lambdaUpdate(ProcurementPlanLine.class) | 261 | Wrapper<ProcurementPlanLine> lineWrapper = Wrappers.lambdaUpdate(ProcurementPlanLine.class) |
| 264 | .set(ProcurementPlanLine::getWorkshopId, vo.getLines().get(0).getWorkshopId()) | 262 | .set(ProcurementPlanLine::getWorkshopId, vo.getLines().get(0).getWorkshopId()) |
| @@ -295,8 +293,6 @@ public class ProcurementPlanChangeServiceImpl extends | @@ -295,8 +293,6 @@ public class ProcurementPlanChangeServiceImpl extends | ||
| 295 | .set(ProcurementPlan::getPlanType, planType) | 293 | .set(ProcurementPlan::getPlanType, planType) |
| 296 | .eq(ProcurementPlan::getId, vo.getProcurementPlanId()); | 294 | .eq(ProcurementPlan::getId, vo.getProcurementPlanId()); |
| 297 | procurementPlanService.update(parentWrapper); | 295 | procurementPlanService.update(parentWrapper); |
| 298 | - // 主计划变更完成(流程状态已完成):重算差值标识 | ||
| 299 | - procurementPlanService.recalcDiffFlags(Collections.singletonList(vo.getProcurementPlanId())); | ||
| 300 | //修改含运到厂价、修改主计划明细表开票品名 | 296 | //修改含运到厂价、修改主计划明细表开票品名 |
| 301 | List<ProcurementPlanLine> lineList = procurementPlanLineService.list( | 297 | List<ProcurementPlanLine> lineList = procurementPlanLineService.list( |
| 302 | Wrappers.lambdaQuery(ProcurementPlanLine.class) | 298 | Wrappers.lambdaQuery(ProcurementPlanLine.class) |
| @@ -325,9 +321,6 @@ public class ProcurementPlanChangeServiceImpl extends | @@ -325,9 +321,6 @@ public class ProcurementPlanChangeServiceImpl extends | ||
| 325 | .eq(ProcurementPlan::getFrozen, false) | 321 | .eq(ProcurementPlan::getFrozen, false) |
| 326 | .eq(ProcurementPlan::getParentId, vo.getProcurementPlanId()); | 322 | .eq(ProcurementPlan::getParentId, vo.getProcurementPlanId()); |
| 327 | procurementPlanService.update(sonWrapper); | 323 | procurementPlanService.update(sonWrapper); |
| 328 | - // 子计划变更完成(流程状态已完成):重算差值标识 | ||
| 329 | - procurementPlanService.recalcDiffFlags(list.stream() | ||
| 330 | - .map(ProcurementPlan::getId).collect(Collectors.toList())); | ||
| 331 | 324 | ||
| 332 | //先修改子计划中明细表开票品名数据 | 325 | //先修改子计划中明细表开票品名数据 |
| 333 | for (ProcurementPlan procurementPlan : list) { | 326 | for (ProcurementPlan procurementPlan : list) { |
| @@ -376,8 +369,6 @@ public class ProcurementPlanChangeServiceImpl extends | @@ -376,8 +369,6 @@ public class ProcurementPlanChangeServiceImpl extends | ||
| 376 | .set(ProcurementPlan::getProcessNode, null) | 369 | .set(ProcurementPlan::getProcessNode, null) |
| 377 | .eq(ProcurementPlan::getId, vo.getProcurementPlanId()); | 370 | .eq(ProcurementPlan::getId, vo.getProcurementPlanId()); |
| 378 | procurementPlanService.update(parentWrapper); | 371 | procurementPlanService.update(parentWrapper); |
| 379 | - // 主计划变更完成(流程状态已完成):重算差值标识 | ||
| 380 | - procurementPlanService.recalcDiffFlags(Collections.singletonList(vo.getProcurementPlanId())); | ||
| 381 | //修改含运到厂价、开票品名 | 372 | //修改含运到厂价、开票品名 |
| 382 | List<ProcurementPlanLine> lineList = procurementPlanLineService.list( | 373 | List<ProcurementPlanLine> lineList = procurementPlanLineService.list( |
| 383 | Wrappers.lambdaQuery(ProcurementPlanLine.class) | 374 | Wrappers.lambdaQuery(ProcurementPlanLine.class) |
| @@ -861,9 +852,6 @@ public class ProcurementPlanChangeServiceImpl extends | @@ -861,9 +852,6 @@ public class ProcurementPlanChangeServiceImpl extends | ||
| 861 | .set(ProcurementPlan::getApprovalPassTime, LocalDateTime.now()) | 852 | .set(ProcurementPlan::getApprovalPassTime, LocalDateTime.now()) |
| 862 | .eq(ProcurementPlan::getId, planId)); | 853 | .eq(ProcurementPlan::getId, planId)); |
| 863 | 854 | ||
| 864 | - // 主计划变更完成(流程状态已完成):重算差值标识 | ||
| 865 | - procurementPlanService.recalcDiffFlags(Collections.singletonList(planId)); | ||
| 866 | - | ||
| 867 | //作废合同 | 855 | //作废合同 |
| 868 | procurementContractService.deleteById(planId); | 856 | procurementContractService.deleteById(planId); |
| 869 | //生成新合同 | 857 | //生成新合同 |
| @@ -587,11 +587,6 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | @@ -587,11 +587,6 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | ||
| 587 | .eq(ProcurementPlan::getId, id); | 587 | .eq(ProcurementPlan::getId, id); |
| 588 | getBaseMapper().update(wrapper); | 588 | getBaseMapper().update(wrapper); |
| 589 | 589 | ||
| 590 | - // 计划流程状态变为已完成:重算差值标识(无过磅记录时即"少 总数量吨") | ||
| 591 | - if ("PASS".equals(approvalStatus)) { | ||
| 592 | - recalcDiffFlags(Collections.singletonList(id)); | ||
| 593 | - } | ||
| 594 | - | ||
| 595 | //如果是子计划且审核通过,检查主计划下所有子计划是否都已通过 | 590 | //如果是子计划且审核通过,检查主计划下所有子计划是否都已通过 |
| 596 | if ("PASS".equals(approvalStatus)) { | 591 | if ("PASS".equals(approvalStatus)) { |
| 597 | 592 | ||
| @@ -614,9 +609,6 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | @@ -614,9 +609,6 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | ||
| 614 | .set(ProcurementPlan::getApprovalPassTime, LocalDateTime.now()) | 609 | .set(ProcurementPlan::getApprovalPassTime, LocalDateTime.now()) |
| 615 | .eq(ProcurementPlan::getId, parentId); | 610 | .eq(ProcurementPlan::getId, parentId); |
| 616 | getBaseMapper().update(parentWrapper); | 611 | getBaseMapper().update(parentWrapper); |
| 617 | - | ||
| 618 | - // 主计划流程状态变为已完成:重算差值标识 | ||
| 619 | - recalcDiffFlags(Collections.singletonList(parentId)); | ||
| 620 | } | 612 | } |
| 621 | } | 613 | } |
| 622 | } | 614 | } |
| @@ -657,22 +649,23 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | @@ -657,22 +649,23 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | ||
| 657 | BigDecimal weighed = sumMap.getOrDefault(plan.getId(), BigDecimal.ZERO).movePointLeft(3); | 649 | BigDecimal weighed = sumMap.getOrDefault(plan.getId(), BigDecimal.ZERO).movePointLeft(3); |
| 658 | BigDecimal diff = total.subtract(weighed); | 650 | BigDecimal diff = total.subtract(weighed); |
| 659 | 651 | ||
| 660 | - // 容差:计划总数量10吨以内差值1吨、10吨以上差值2吨;差值绝对值在容差内不显示 | 652 | + // 容差:计划总数量10吨以内差值1吨、10吨以上差值2吨 |
| 661 | BigDecimal tolerance = total.compareTo(BigDecimal.TEN) <= 0 ? BigDecimal.ONE : BigDecimal.valueOf(2); | 653 | BigDecimal tolerance = total.compareTo(BigDecimal.TEN) <= 0 ? BigDecimal.ONE : BigDecimal.valueOf(2); |
| 662 | - String flag = null; | ||
| 663 | - if (diff.abs().compareTo(tolerance) > 0) { | ||
| 664 | - flag = (diff.signum() > 0 ? "少 " : "多 ") + diff.abs().stripTrailingZeros().toPlainString() + "吨"; | ||
| 665 | - } | 654 | + boolean exceeded = diff.abs().compareTo(tolerance) > 0; |
| 655 | + | ||
| 656 | + // 差值标识始终返回(多x吨/少x吨),是否超差单独标记 | ||
| 657 | + String flag = (diff.signum() > 0 ? "少 " : "多 ") + diff.abs().stripTrailingZeros().toPlainString() + "吨"; | ||
| 666 | 658 | ||
| 667 | this.update(Wrappers.lambdaUpdate(ProcurementPlan.class) | 659 | this.update(Wrappers.lambdaUpdate(ProcurementPlan.class) |
| 668 | .set(ProcurementPlan::getDiffQuantityFlag, flag) | 660 | .set(ProcurementPlan::getDiffQuantityFlag, flag) |
| 661 | + .set(ProcurementPlan::getDiffQuantityExceeded, exceeded) | ||
| 669 | .eq(ProcurementPlan::getId, plan.getId())); | 662 | .eq(ProcurementPlan::getId, plan.getId())); |
| 670 | } | 663 | } |
| 671 | } | 664 | } |
| 672 | 665 | ||
| 673 | @Transactional(rollbackFor = Exception.class) | 666 | @Transactional(rollbackFor = Exception.class) |
| 674 | @Override | 667 | @Override |
| 675 | - public void updateDiffFlag(String id, String diffQuantityFlag) { | 668 | + public void updateDiffQuantityExceeded(String id, Boolean diffQuantityExceeded) { |
| 676 | if (StringUtils.isBlank(id)) { | 669 | if (StringUtils.isBlank(id)) { |
| 677 | throw new DefaultClientException("采购计划ID不能为空!"); | 670 | throw new DefaultClientException("采购计划ID不能为空!"); |
| 678 | } | 671 | } |
| @@ -681,10 +674,9 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | @@ -681,10 +674,9 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla | ||
| 681 | throw new DefaultClientException("采购计划不存在!"); | 674 | throw new DefaultClientException("采购计划不存在!"); |
| 682 | } | 675 | } |
| 683 | 676 | ||
| 684 | - // 传空表示清除标识(显式 set null,避免 MyBatis-Plus NOT_NULL 策略忽略) | 677 | + // 显式 set(null 也写入,避免 MyBatis-Plus NOT_NULL 策略忽略) |
| 685 | getBaseMapper().update(Wrappers.lambdaUpdate(ProcurementPlan.class) | 678 | getBaseMapper().update(Wrappers.lambdaUpdate(ProcurementPlan.class) |
| 686 | - .set(ProcurementPlan::getDiffQuantityFlag, | ||
| 687 | - StringUtils.isBlank(diffQuantityFlag) ? null : diffQuantityFlag.trim()) | 679 | + .set(ProcurementPlan::getDiffQuantityExceeded, diffQuantityExceeded) |
| 688 | .eq(ProcurementPlan::getId, id)); | 680 | .eq(ProcurementPlan::getId, id)); |
| 689 | } | 681 | } |
| 690 | 682 |
| @@ -568,12 +568,6 @@ public class ProcurementPlanReplenishServiceImpl | @@ -568,12 +568,6 @@ public class ProcurementPlanReplenishServiceImpl | ||
| 568 | } | 568 | } |
| 569 | } | 569 | } |
| 570 | 570 | ||
| 571 | - // 补单完成:主计划与子计划流程状态均为已完成,重算差值标识(无过磅记录时即"少 总数量吨") | ||
| 572 | - List<String> diffFlagPlanIds = new ArrayList<>(); | ||
| 573 | - diffFlagPlanIds.add(archivedMain.getId()); | ||
| 574 | - procurementPlanService.listSubPlan(archivedMain.getId()) | ||
| 575 | - .forEach(p -> diffFlagPlanIds.add(p.getId())); | ||
| 576 | - procurementPlanService.recalcDiffFlags(diffFlagPlanIds); | ||
| 577 | } else if ("REFUSE".equals(approvalStatus)) { | 571 | } else if ("REFUSE".equals(approvalStatus)) { |
| 578 | List<SysRole> roles = sysRoleService.getByUserId(entity.getCreateById()); | 572 | List<SysRole> roles = sysRoleService.getByUserId(entity.getCreateById()); |
| 579 | List<String> roleCodes = CollectionUtil.isEmpty(roles) ? new java.util.ArrayList<>() | 573 | List<String> roleCodes = CollectionUtil.isEmpty(roles) ? new java.util.ArrayList<>() |
| @@ -145,21 +145,22 @@ public interface ProcurementPlanService extends BaseMpService<ProcurementPlan> { | @@ -145,21 +145,22 @@ public interface ProcurementPlanService extends BaseMpService<ProcurementPlan> { | ||
| 145 | void updateApprovalStatus(String id, String approvalStatus); | 145 | void updateApprovalStatus(String id, String approvalStatus); |
| 146 | 146 | ||
| 147 | /** | 147 | /** |
| 148 | - * 重算差值标识(多x吨/少x吨):计划流程状态变为已完成(首次审核通过/变更完成/补单完成)时调用 | 148 | + * 重算差值标识(多x吨/少x吨):仅在过磅码单第一次完成(首次上传签字凭证记录完成时间)、码单作废、复磅作废原单时调用; |
| 149 | + * 计划流程完成(首次审核通过/变更完成/补单完成)不计算,差值字段保持为空(或上次计算的值) | ||
| 149 | * 口径:已过磅数量 = 未作废且已完成(完成时间不为空)的过磅码单的过磅明细数量合计(公斤转吨) | 150 | * 口径:已过磅数量 = 未作废且已完成(完成时间不为空)的过磅码单的过磅明细数量合计(公斤转吨) |
| 150 | - * 差值 = 总数量 - 已过磅数量;总数量10吨以内容差1吨、10吨以上容差2吨,容差内不显示(置空) | 151 | + * 差值 = 总数量 - 已过磅数量;总数量10吨以内容差1吨、10吨以上容差2吨,差值标识始终返回,是否超差单独记录 |
| 151 | * | 152 | * |
| 152 | * @param planIds 采购计划ID集合 | 153 | * @param planIds 采购计划ID集合 |
| 153 | */ | 154 | */ |
| 154 | void recalcDiffFlags(List<String> planIds); | 155 | void recalcDiffFlags(List<String> planIds); |
| 155 | 156 | ||
| 156 | /** | 157 | /** |
| 157 | - * 修改差值标识(供应管理科主管手动更改,传空清除) | 158 | + * 手动修改是否超过差值(供应管理科主管;过磅码单变动时会被自动重算覆盖) |
| 158 | * | 159 | * |
| 159 | - * @param id 采购计划ID | ||
| 160 | - * @param diffQuantityFlag 差值标识(多x吨/少x吨) | 160 | + * @param id 采购计划ID |
| 161 | + * @param diffQuantityExceeded 是否超过差值容差 | ||
| 161 | */ | 162 | */ |
| 162 | - void updateDiffFlag(String id, String diffQuantityFlag); | 163 | + void updateDiffQuantityExceeded(String id, Boolean diffQuantityExceeded); |
| 163 | 164 | ||
| 164 | void updateExamine(String id); | 165 | void updateExamine(String id); |
| 165 | 166 |
| @@ -69,7 +69,7 @@ public interface ProcurementWeighingTicketService extends BaseMpService<Procurem | @@ -69,7 +69,7 @@ public interface ProcurementWeighingTicketService extends BaseMpService<Procurem | ||
| 69 | /** | 69 | /** |
| 70 | * 重算采购计划差值标识(多x吨/少x吨) | 70 | * 重算采购计划差值标识(多x吨/少x吨) |
| 71 | * 口径:已过磅数量 = 关联该计划的、未作废且已完成(完成时间不为空)的过磅码单的过磅明细数量合计(公斤转吨) | 71 | * 口径:已过磅数量 = 关联该计划的、未作废且已完成(完成时间不为空)的过磅码单的过磅明细数量合计(公斤转吨) |
| 72 | - * 差值 = 计划总数量 - 已过磅数量;计划总数量10吨以内容差1吨、10吨以上容差2吨,差值绝对值在容差内不显示 | 72 | + * 差值 = 计划总数量 - 已过磅数量;计划总数量10吨以内容差1吨、10吨以上容差2吨,差值标识始终返回,是否超差单独记录 |
| 73 | * | 73 | * |
| 74 | * @param planIds 采购计划ID集合 | 74 | * @param planIds 采购计划ID集合 |
| 75 | */ | 75 | */ |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/procurement/vo/plan/UpdatePlanDiffFlagVo.java
deleted
100644 → 0
| 1 | -package com.lframework.xingyun.sc.procurement.vo.plan; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import lombok.Data; | ||
| 6 | - | ||
| 7 | -import java.io.Serializable; | ||
| 8 | -import javax.validation.constraints.NotBlank; | ||
| 9 | - | ||
| 10 | -@Data | ||
| 11 | -@ApiModel("修改采购计划差值标识Vo") | ||
| 12 | -public class UpdatePlanDiffFlagVo implements Serializable { | ||
| 13 | - | ||
| 14 | - private static final long serialVersionUID = 1L; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty("采购计划ID") | ||
| 17 | - @NotBlank(message = "采购计划ID不能为空!") | ||
| 18 | - private String id; | ||
| 19 | - | ||
| 20 | - @ApiModelProperty("差值标识(多x吨/少x吨,传空清除标识)") | ||
| 21 | - private String diffQuantityFlag; | ||
| 22 | -} |
| @@ -42,6 +42,7 @@ | @@ -42,6 +42,7 @@ | ||
| 42 | <result column="invoice_type_status" property="invoiceTypeStatus"/> | 42 | <result column="invoice_type_status" property="invoiceTypeStatus"/> |
| 43 | <result column="total_quantity" property="totalQuantity"/> | 43 | <result column="total_quantity" property="totalQuantity"/> |
| 44 | <result column="diff_quantity_flag" property="diffQuantityFlag"/> | 44 | <result column="diff_quantity_flag" property="diffQuantityFlag"/> |
| 45 | + <result column="diff_quantity_exceeded" property="diffQuantityExceeded"/> | ||
| 45 | <result column="remark" property="remark"/> | 46 | <result column="remark" property="remark"/> |
| 46 | <result column="material_condition_enabled" property="materialConditionEnabled"/> | 47 | <result column="material_condition_enabled" property="materialConditionEnabled"/> |
| 47 | <result column="material_condition_copper_rice" property="materialConditionCopperRice"/> | 48 | <result column="material_condition_copper_rice" property="materialConditionCopperRice"/> |
| @@ -120,6 +121,7 @@ | @@ -120,6 +121,7 @@ | ||
| 120 | pp.invoice_type_status, | 121 | pp.invoice_type_status, |
| 121 | pp.total_quantity, | 122 | pp.total_quantity, |
| 122 | pp.diff_quantity_flag, | 123 | pp.diff_quantity_flag, |
| 124 | + pp.diff_quantity_exceeded, | ||
| 123 | pp.remark, | 125 | pp.remark, |
| 124 | pp.material_condition_enabled, | 126 | pp.material_condition_enabled, |
| 125 | pp.material_condition_copper_rice, | 127 | pp.material_condition_copper_rice, |