|
|
@@ -623,37 +623,11 @@ public class BusinessPlanServiceImpl implements BusinessPlanService {
|
|
623
|
623
|
if (businessPlanV.getId().toString().equals(businessScedule.getJhId())) {
|
|
624
|
624
|
flag = true;
|
|
625
|
625
|
// 在出入库系统中,存在该计划对应的出入库数据,进行计算,得出完成比率.
|
|
626
|
|
-
|
|
627
|
|
-
|
|
|
626
|
+
|
|
628
|
627
|
//根据主表获取仓房货位信息
|
|
629
|
628
|
List<BusinessStoreWareDetail> storeWareDetailList= businessStoreWareDetailService.getByZidAndType(businessPlanV.getId(), StoreWareType.plan.getValue());
|
|
630
|
629
|
BigDecimal wcsl = new BigDecimal("0") ;
|
|
631
|
|
- BigDecimal sysl = new BigDecimal("0") ;//损益数量
|
|
632
|
630
|
List<BusinessScedule> businessSceduleSyList = new ArrayList<BusinessScedule>();
|
|
633
|
|
- for (BusinessStoreWareDetail businessStoreWareDetail : storeWareDetailList) {
|
|
634
|
|
- //根据单位仓房货位品种性质 获取损益的数量
|
|
635
|
|
- Map<String, Object> map = new HashMap<String, Object>();
|
|
636
|
|
- map.put("orgId", businessPlanV.getOrgId());
|
|
637
|
|
- map.put("grainKind", businessStoreWareDetail.getGrainKind());
|
|
638
|
|
- map.put("grainAttribute", businessStoreWareDetail.getGrainAttribute());
|
|
639
|
|
- if(businessStoreWareDetail.getHouseId()!=null && !businessStoreWareDetail.getHouseId().equals("0")){//粮食
|
|
640
|
|
- map.put("houseId", businessStoreWareDetail.getHouseId());
|
|
641
|
|
- map.put("warehouseId", businessStoreWareDetail.getWarehouseId());
|
|
642
|
|
- }else if(businessStoreWareDetail.getHouseId().equals("0")){//油
|
|
643
|
|
- map.put("houseId", businessStoreWareDetail.getHouseName());
|
|
644
|
|
- }
|
|
645
|
|
- //区分出库入库--损【1】就出库,益【0】就是入库
|
|
646
|
|
- if ("1".equals(businessScedule.getCrkLx())) {//入库
|
|
647
|
|
- map.put("lossProfit", 0);
|
|
648
|
|
- }else{
|
|
649
|
|
- map.put("lossProfit", 1);
|
|
650
|
|
- }
|
|
651
|
|
- businessSceduleSyList = businessSceduleService.getSyCount(map);
|
|
652
|
|
- if(businessSceduleSyList.size()>0){
|
|
653
|
|
- sysl = new BigDecimal(businessSceduleSyList.get(0).getSysl());
|
|
654
|
|
- }
|
|
655
|
|
- break;
|
|
656
|
|
- }
|
|
657
|
631
|
String crkLx = businessScedule.getCrkLx();
|
|
658
|
632
|
if (ParameterUtil.isequal("3156",businessPlanV.getExecuteType()) || ParameterUtil.isequal("7121",businessPlanV.getExecuteType())) {
|
|
659
|
633
|
// 入库数量.
|
|
|
@@ -665,18 +639,8 @@ public class BusinessPlanServiceImpl implements BusinessPlanService {
|
|
665
|
639
|
BigDecimal sumCkslD = new BigDecimal(sumCksl);
|
|
666
|
640
|
|
|
667
|
641
|
sumRkslD.add(sumCkslD);
|
|
668
|
|
- if(businessSceduleSyList.size()>0){
|
|
669
|
|
- if(businessSceduleSyList.get(0).getSycode().equals("1")){ //1是减少 0是增加
|
|
670
|
|
- wcsl = sumRkslD.add(sysl);
|
|
671
|
|
- businessPlanV.setRemainingAmount(sumRkslD.subtract(wcsl).add(sysl).stripTrailingZeros().toPlainString());
|
|
672
|
|
- }else if(businessSceduleSyList.get(0).getSycode().equals("0")){
|
|
673
|
|
- wcsl = sumRkslD.subtract(sysl);
|
|
674
|
|
- businessPlanV.setRemainingAmount(sumRkslD.subtract(wcsl).subtract(sysl).stripTrailingZeros().toPlainString());
|
|
675
|
|
- }
|
|
676
|
|
- }else{
|
|
677
|
|
- wcsl = sumRkslD;
|
|
678
|
|
- businessPlanV.setRemainingAmount(sumRkslD.subtract(wcsl).stripTrailingZeros().toPlainString());
|
|
679
|
|
- }
|
|
|
642
|
+ wcsl = sumRkslD;
|
|
|
643
|
+ businessPlanV.setRemainingAmount(sumRkslD.subtract(wcsl).stripTrailingZeros().toPlainString());
|
|
680
|
644
|
|
|
681
|
645
|
// 赋值:设置完成数量. stripTrailingZeros() 去除结尾的0
|
|
682
|
646
|
businessPlanV.setCompleteAmount(wcsl.stripTrailingZeros().toPlainString());
|
|
|
@@ -701,19 +665,9 @@ public class BusinessPlanServiceImpl implements BusinessPlanService {
|
|
701
|
665
|
String sumRksl = businessScedule.getSumWcsl();
|
|
702
|
666
|
BigDecimal sumRkslD = new BigDecimal(sumRksl);
|
|
703
|
667
|
|
|
704
|
|
- if(businessSceduleSyList.size()>0){
|
|
705
|
|
- if(businessSceduleSyList.get(0).getSycode().equals("1")){ //1是减少 0是增加
|
|
706
|
|
- wcsl = sumRkslD.add(sysl);
|
|
707
|
|
- businessPlanV.setRemainingAmount(sumRkslD.subtract(wcsl).add(sysl).stripTrailingZeros().toPlainString());
|
|
708
|
|
- }else if(businessSceduleSyList.get(0).getSycode().equals("0")){
|
|
709
|
|
- wcsl = sumRkslD.subtract(sysl);
|
|
710
|
|
- businessPlanV.setRemainingAmount(sumRkslD.subtract(wcsl).subtract(sysl).stripTrailingZeros().toPlainString());
|
|
711
|
|
- }
|
|
712
|
|
- }else{
|
|
713
|
|
- wcsl = sumRkslD;
|
|
714
|
|
- businessPlanV.setRemainingAmount(sumRkslD.subtract(wcsl).stripTrailingZeros().toPlainString());
|
|
715
|
|
- }
|
|
716
|
|
-
|
|
|
668
|
+ wcsl = sumRkslD;
|
|
|
669
|
+ businessPlanV.setRemainingAmount(sumRkslD.subtract(wcsl).stripTrailingZeros().toPlainString());
|
|
|
670
|
+
|
|
717
|
671
|
|
|
718
|
672
|
// 赋值:设置完成数量. stripTrailingZeros() 去除结尾的0
|
|
719
|
673
|
businessPlanV.setCompleteAmount(wcsl.stripTrailingZeros().toPlainString());
|
|
|
@@ -734,21 +688,9 @@ public class BusinessPlanServiceImpl implements BusinessPlanService {
|
|
734
|
688
|
String sumCksl = businessScedule.getSumWcsl();
|
|
735
|
689
|
BigDecimal sumCkslD = new BigDecimal(sumCksl);
|
|
736
|
690
|
|
|
737
|
|
- if(businessSceduleSyList.size()>0){
|
|
738
|
|
- if(businessSceduleSyList.get(0).getSycode().equals("1")){ //1是减少 0是增加
|
|
739
|
|
- wcsl = sumCkslD.add(sysl);
|
|
740
|
|
- businessPlanV.setRemainingAmount(sumCkslD.subtract(wcsl).add(sysl).stripTrailingZeros().toPlainString());
|
|
741
|
|
- }else if(businessSceduleSyList.get(0).getSycode().equals("0")){
|
|
742
|
|
- wcsl = sumCkslD.subtract(sysl);
|
|
743
|
|
- businessPlanV.setRemainingAmount(sumCkslD.subtract(wcsl).subtract(sysl).stripTrailingZeros().toPlainString());
|
|
744
|
|
- }
|
|
745
|
|
- }else{
|
|
746
|
|
- wcsl = sumCkslD;
|
|
747
|
|
- businessPlanV.setRemainingAmount(sumCkslD.subtract(wcsl).stripTrailingZeros().toPlainString());
|
|
748
|
|
- }
|
|
749
|
|
-
|
|
750
|
|
-
|
|
751
|
|
-
|
|
|
691
|
+ wcsl = sumCkslD;
|
|
|
692
|
+ businessPlanV.setRemainingAmount(sumCkslD.subtract(wcsl).stripTrailingZeros().toPlainString());
|
|
|
693
|
+
|
|
752
|
694
|
// 赋值:设置完成数量. stripTrailingZeros() 去除结尾的0
|
|
753
|
695
|
businessPlanV.setCompleteAmount(wcsl.stripTrailingZeros().toPlainString());
|
|
754
|
696
|
|