Commit b49af9b560563d5c345caf202979f689589dda3e

Authored by 房远帅
1 parent 81e0d31b

过磅码单-自测问题修改

@@ -176,7 +176,7 @@ public class ProcurementWeighingTicketController extends DefaultBaseController { @@ -176,7 +176,7 @@ public class ProcurementWeighingTicketController extends DefaultBaseController {
176 * @param templateType 模板类型 NO_REMARK-无备注,其他/默认-有备注 176 * @param templateType 模板类型 NO_REMARK-无备注,其他/默认-有备注
177 */ 177 */
178 @ApiOperation("打印过磅码单(exportType=PDF导出PDF文件,默认Excel;templateType=NO_REMARK无备注模板,默认有备注)") 178 @ApiOperation("打印过磅码单(exportType=PDF导出PDF文件,默认Excel;templateType=NO_REMARK无备注模板,默认有备注)")
179 - @HasPermission({"warehouse-manage:weight-ticket:print"}) 179 + @HasPermission({"warehouse-manage:weight-ticket:print1","warehouse-manage:weight-ticket:print2"})
180 @GetMapping("/export") 180 @GetMapping("/export")
181 public void export(@NotBlank(message = "ID不能为空!") String id, String exportType, String templateType, 181 public void export(@NotBlank(message = "ID不能为空!") String id, String exportType, String templateType,
182 HttpServletResponse response) throws IOException { 182 HttpServletResponse response) throws IOException {
@@ -652,9 +652,9 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla @@ -652,9 +652,9 @@ public class ProcurementPlanServiceImpl extends BaseMpServiceImpl<ProcurementPla
652 if (plan == null || plan.getTotalQuantity() == null) { 652 if (plan == null || plan.getTotalQuantity() == null) {
653 continue; 653 continue;
654 } 654 }
655 - // 差值(吨)= 计划总数量(吨)- 已过磅数量(公斤转吨) 655 + // 差值(吨)= 计划总数量(吨)- 已过磅数量(公斤转吨:小数点左移3位)
656 BigDecimal total = plan.getTotalQuantity(); 656 BigDecimal total = plan.getTotalQuantity();
657 - BigDecimal weighed = sumMap.getOrDefault(plan.getId(), BigDecimal.ZERO).movePointRight(3); 657 + BigDecimal weighed = sumMap.getOrDefault(plan.getId(), BigDecimal.ZERO).movePointLeft(3);
658 BigDecimal diff = total.subtract(weighed); 658 BigDecimal diff = total.subtract(weighed);
659 659
660 // 容差:计划总数量10吨以内差值1吨、10吨以上差值2吨;差值绝对值在容差内不显示 660 // 容差:计划总数量10吨以内差值1吨、10吨以上差值2吨;差值绝对值在容差内不显示
@@ -376,19 +376,16 @@ public class ProcurementWeighingTicketServiceImpl @@ -376,19 +376,16 @@ public class ProcurementWeighingTicketServiceImpl
376 Object examStatusObj = map.get("examStatus"); 376 Object examStatusObj = map.get("examStatus");
377 String examStatus = examStatusObj == null ? null : String.valueOf(examStatusObj); 377 String examStatus = examStatusObj == null ? null : String.valueOf(examStatusObj);
378 378
379 - // 业务ID(过磅码单ID),兼容前端流程回调 variables 子 map 包裹  
380 String bizId = null; 379 String bizId = null;
381 - Object bizIdObj = map.get("bizId");  
382 - if (bizIdObj != null) { 380 + //主键
  381 + Object i = map.get("id");
  382 + bizId = String.valueOf(i);
  383 + log.info("bizId====" + bizId);
  384 + // 业务ID(过磅码单ID),兼容前端流程回调 variables 子 map 包裹
  385 +
  386 + if (bizId == null) {
  387 + Object bizIdObj = map.get("bizId");
383 bizId = String.valueOf(bizIdObj); 388 bizId = String.valueOf(bizIdObj);
384 - } else {  
385 - Object varsObj = map.get("variables");  
386 - if (varsObj instanceof Map) {  
387 - Object bizIdInVar = ((Map<?, ?>) varsObj).get("bizId");  
388 - if (bizIdInVar != null) {  
389 - bizId = String.valueOf(bizIdInVar);  
390 - }  
391 - }  
392 } 389 }
393 390
394 if (StringUtil.isBlank(bizId)) { 391 if (StringUtil.isBlank(bizId)) {
@@ -410,9 +407,6 @@ public class ProcurementWeighingTicketServiceImpl @@ -410,9 +407,6 @@ public class ProcurementWeighingTicketServiceImpl
410 .set(inspectorNode, ProcurementWeighingTicket::getQualityInspectorName, SecurityUtil.getCurrentUser().getName()) 407 .set(inspectorNode, ProcurementWeighingTicket::getQualityInspectorName, SecurityUtil.getCurrentUser().getName())
411 .set(inspectorNode, ProcurementWeighingTicket::getQualityInspectorId, SecurityUtil.getCurrentUser().getId()) 408 .set(inspectorNode, ProcurementWeighingTicket::getQualityInspectorId, SecurityUtil.getCurrentUser().getId())
412 .eq(ProcurementWeighingTicket::getId, bizId)); 409 .eq(ProcurementWeighingTicket::getId, bizId));
413 -  
414 - // 回填操作日志  
415 - OpLogUtil.setVariable("id", bizId);  
416 } 410 }
417 } 411 }
418 } catch (Exception ex) { 412 } catch (Exception ex) {