|
@@ -869,45 +869,16 @@ public class BusinessDeliveryStorageNoticeServiceImpl implements BusinessDeliver
|
869
|
869
|
PageInfo<BusinessDeliveryStorageNoticeAuditVO> pageInfo = new PageInfo<BusinessDeliveryStorageNoticeAuditVO>();
|
870
|
870
|
// 分页.
|
871
|
871
|
if (pageNum != null && pageSize != null) {
|
872
|
|
- PageHelper.startPage(pageNum, pageSize);
|
873
|
|
- }
|
|
872
|
+ PageHelper.startPage(pageNum, pageSize);
|
|
873
|
+ }
|
874
|
874
|
|
875
|
875
|
List<BusinessDeliveryStorageNoticeAuditVO> noticeList = businessDeliveryStorageNoticeMapper.selectByExampleToVO(example);
|
876
|
|
-
|
877
|
|
- //提货单
|
878
|
|
- /*if(!((deliveryStorageNotice.getRootContractBid() != null || deliveryStorageNotice.getPlanBid() != null) && noticeList.size()>0)){
|
879
|
|
- //合同里面的进度要查看通知单 如果有RootContractBid 并且noticeList 有值 则说明是通知单表的 则不执行查询提货单的
|
880
|
|
- BusinessLadingExample exampleLading = new BusinessLadingExample();
|
881
|
|
- List<BusinessLading> list = ladingService.queryByExample(exampleLading);
|
882
|
|
- if(list.size()>0 && list!=null){
|
883
|
|
- for (int i = 0; i < list.size(); i++) {
|
884
|
|
- BusinessDeliveryStorageNoticeAuditVO businessAuditVO = new BusinessDeliveryStorageNoticeAuditVO();
|
885
|
|
- businessAuditVO.setId(list.get(i).getId());
|
886
|
|
- businessAuditVO.setBillNumber(list.get(i).getLadingNumber());
|
887
|
|
- businessAuditVO.setAgreeTime(list.get(i).getBillDate());
|
888
|
|
- BigDecimal js = new BigDecimal(list.get(i).getUnloadNumber().toString());
|
889
|
|
- BigDecimal zl = new BigDecimal(list.get(i).getSalesDepartment());
|
890
|
|
- businessAuditVO.setShipingCount(js.multiply(zl).toString());//要求数量
|
891
|
|
- noticeList.add(businessAuditVO);
|
892
|
|
- }
|
893
|
|
- }
|
894
|
|
- }*/
|
895
|
|
-
|
896
|
|
-
|
897
|
|
-
|
898
|
|
-
|
|
876
|
+
|
899
|
877
|
if (noticeList != null && noticeList.size() > 0) {
|
900
|
|
- // 拼接通知单id.
|
|
878
|
+ // 拼接通知单id.去出入库查询通知单进度信息.
|
901
|
879
|
StringBuffer sb = new StringBuffer();
|
902
|
|
- //StringBuffer thdNumber = new StringBuffer();
|
903
|
880
|
sb.append("(");
|
904
|
|
- //thdNumber.append("(");
|
905
|
881
|
for (BusinessDeliveryStorageNoticeAuditVO businessDeliveryStorageNoticeV : noticeList) {
|
906
|
|
- /*if(businessDeliveryStorageNoticeV.getBillType()!=null){//通知单
|
907
|
|
- sb.append("\"" + businessDeliveryStorageNoticeV.getId() + "\"").append(",");
|
908
|
|
- }else{//提货单
|
909
|
|
- thdNumber.append("\"" + businessDeliveryStorageNoticeV.getBillNumber() + "\"").append(",");
|
910
|
|
- }*/
|
911
|
882
|
sb.append("\"" + businessDeliveryStorageNoticeV.getId() + "\"").append(",");
|
912
|
883
|
}
|
913
|
884
|
|
|
@@ -918,20 +889,7 @@ public class BusinessDeliveryStorageNoticeServiceImpl implements BusinessDeliver
|
918
|
889
|
sb.append(")");
|
919
|
890
|
businessSceduleList = feignAgileService.getNoticeSceduleInNoticeId(sb.toString());
|
920
|
891
|
}
|
921
|
|
- /*String thdNumberString = thdNumber.substring(0, thdNumber.length() - 1);
|
922
|
|
- thdNumber = new StringBuffer(thdNumberString);
|
923
|
|
- if(thdNumber.length()!=0){
|
924
|
|
- thdNumber.append(")");
|
925
|
|
- List<BusinessScedule> thdSceduleList = feignAgileService.getThdInNumber(thdNumber.toString());
|
926
|
|
- for (BusinessScedule thd : thdSceduleList) {
|
927
|
|
- if(thd!=null){
|
928
|
|
- businessSceduleList.add(thd);
|
929
|
|
- }
|
930
|
|
- }
|
931
|
|
- } */
|
932
|
|
-
|
933
|
|
-
|
934
|
|
-
|
|
892
|
+
|
935
|
893
|
// 通过通知单id,去出入库查询.
|
936
|
894
|
if (businessSceduleList != null && businessSceduleList.size() > 0) {
|
937
|
895
|
// 循环通知单list.
|
|
@@ -939,90 +897,65 @@ public class BusinessDeliveryStorageNoticeServiceImpl implements BusinessDeliver
|
939
|
897
|
// 循环出入库,查询的list.
|
940
|
898
|
Boolean flag = false;
|
941
|
899
|
for (BusinessScedule businessScedule : businessSceduleList) {
|
942
|
|
- if(businessScedule!=null){
|
943
|
|
-
|
944
|
|
- /*if(businessScedule.getCrkLx()==null){//提货单
|
945
|
|
- if(businessDeliveryStorageNoticeV.getBillNumber().equals(businessScedule.getThdh())){
|
946
|
|
- flag = true;
|
947
|
|
- // 在出入库系统中,获取完成数量
|
948
|
|
- String sumThdsl = businessScedule.getSumWcsl();
|
949
|
|
- BigDecimal sumThdslD = new BigDecimal(sumThdsl);
|
950
|
|
- // 赋值:设置完成数量. stripTrailingZeros() 去除结尾的0
|
951
|
|
- businessDeliveryStorageNoticeV.setCompleteAmount(sumThdslD.stripTrailingZeros().toPlainString());
|
952
|
|
- // 通知单要求数量.
|
953
|
|
- String demandAmount = businessDeliveryStorageNoticeV.getShipingCount();
|
954
|
|
- BigDecimal demandAmountD = new BigDecimal(demandAmount);
|
955
|
|
-
|
956
|
|
- // 除法. 已完成数量/要求数量
|
957
|
|
- BigDecimal complete = sumThdslD.divide(demandAmountD, 4, BigDecimal.ROUND_HALF_DOWN);
|
958
|
|
- // 乘以100,得到的是百分比.
|
959
|
|
- BigDecimal completeRate = complete.multiply(new BigDecimal("100"));
|
960
|
|
- // 赋值:设置完成百分比.
|
961
|
|
- businessDeliveryStorageNoticeV.setCompleteRate(completeRate.stripTrailingZeros().toPlainString());
|
962
|
|
- }
|
963
|
|
- // 在出入库list中删除该数据,这样下次循环数量就会减少了.
|
964
|
|
- businessSceduleList.remove(businessScedule);
|
965
|
|
- // 跳出当前的出入库循环.
|
966
|
|
- break;
|
967
|
|
- }else{
|
968
|
|
-
|
969
|
|
- } */ //通知单
|
970
|
|
- if (businessDeliveryStorageNoticeV.getId().toString().equals(businessScedule.getTzdId())) {
|
971
|
|
- flag = true;
|
972
|
|
- // 在出入库系统中,存在该通知单对应的出入库数据,进行计算,得出完成比率.
|
973
|
|
- String crkLx = businessScedule.getCrkLx();
|
974
|
|
- if ("1".equals(crkLx)) {
|
975
|
|
- // 入库
|
976
|
|
- // 入库数量.
|
977
|
|
- String sumRksl = businessScedule.getSumWcsl();
|
978
|
|
- BigDecimal s = new BigDecimal(1000);
|
979
|
|
- BigDecimal sumRkslss = new BigDecimal(sumRksl);
|
980
|
|
- BigDecimal sumRkslD = sumRkslss.divide(s);
|
981
|
|
-
|
982
|
|
- // 赋值:设置完成数量. stripTrailingZeros() 去除结尾的0
|
983
|
|
- businessDeliveryStorageNoticeV.setCompleteAmount(sumRkslD.stripTrailingZeros().toPlainString());
|
984
|
|
- // 通知单要求数量.
|
985
|
|
- String demandAmount = businessDeliveryStorageNoticeV.getShipingCount();
|
986
|
|
- BigDecimal demandAmountD = new BigDecimal(demandAmount);
|
987
|
|
-
|
988
|
|
- // 除法. 已完成数量/要求数量
|
989
|
|
- BigDecimal complete = sumRkslD.divide(demandAmountD, 4, BigDecimal.ROUND_HALF_DOWN);
|
990
|
|
- // 乘以100,得到的是百分比.
|
991
|
|
- BigDecimal completeRate = complete.multiply(new BigDecimal("100"));
|
992
|
|
- // 赋值:设置完成百分比.
|
993
|
|
- businessDeliveryStorageNoticeV.setCompleteRate(completeRate.stripTrailingZeros().toPlainString());
|
994
|
|
- } else if ("3".equals(crkLx)) {
|
995
|
|
- // 出库
|
996
|
|
- // 出库数量.
|
997
|
|
- String sumCksl = businessScedule.getSumWcsl();
|
998
|
|
- BigDecimal s = new BigDecimal(1000);
|
999
|
|
- BigDecimal sumCkslss = new BigDecimal(sumCksl);
|
1000
|
|
- BigDecimal sumCkslD = sumCkslss.divide(s);
|
1001
|
|
-
|
1002
|
|
-
|
1003
|
|
- // 赋值:设置完成数量. stripTrailingZeros() 去除结尾的0
|
1004
|
|
- businessDeliveryStorageNoticeV.setCompleteAmount(sumCkslD.stripTrailingZeros().toPlainString());
|
1005
|
|
-
|
1006
|
|
- // 通知单要求数量.
|
1007
|
|
- String demandAmount = businessDeliveryStorageNoticeV.getShipingCount();
|
1008
|
|
- BigDecimal demandAmountD = new BigDecimal(demandAmount);
|
1009
|
|
-
|
1010
|
|
- // 除法. 已完成数量/要求数量
|
1011
|
|
- BigDecimal complete = sumCkslD.divide(demandAmountD, 4, BigDecimal.ROUND_HALF_DOWN);
|
1012
|
|
- // 乘以100,得到的是百分比.
|
1013
|
|
- BigDecimal completeRate = complete.multiply(new BigDecimal("100"));
|
1014
|
|
- // 赋值:设置完成百分比.
|
1015
|
|
- businessDeliveryStorageNoticeV.setCompleteRate(completeRate.stripTrailingZeros().toPlainString());
|
1016
|
|
- }
|
1017
|
|
- // 在出入库list中删除该数据,这样下次循环数量就会减少了.
|
1018
|
|
- businessSceduleList.remove(businessScedule);
|
1019
|
|
- // 跳出当前的出入库循环.
|
1020
|
|
- break;
|
1021
|
|
- }
|
1022
|
|
- //}
|
|
900
|
+ if (businessScedule!=null) {
|
|
901
|
+ //通知单
|
|
902
|
+ if (businessDeliveryStorageNoticeV.getId().toString().equals(businessScedule.getTzdId())) {
|
|
903
|
+ flag = true;
|
|
904
|
+ // 在出入库系统中,存在该通知单对应的出入库数据,进行计算,得出完成比率.
|
|
905
|
+ String crkLx = businessScedule.getCrkLx();
|
|
906
|
+ if ("1".equals(crkLx)) {
|
|
907
|
+ // 入库
|
|
908
|
+ // 入库数量.
|
|
909
|
+ String sumRksl = businessScedule.getSumWcsl();
|
|
910
|
+ BigDecimal s = new BigDecimal(1000);
|
|
911
|
+ BigDecimal sumRkslss = new BigDecimal(sumRksl);
|
|
912
|
+ BigDecimal sumRkslD = sumRkslss.divide(s);
|
|
913
|
+
|
|
914
|
+ // 赋值:设置完成数量. stripTrailingZeros() 去除结尾的0
|
|
915
|
+ businessDeliveryStorageNoticeV.setCompleteAmount(sumRkslD.stripTrailingZeros().toPlainString());
|
|
916
|
+ // 通知单要求数量.
|
|
917
|
+ String demandAmount = businessDeliveryStorageNoticeV.getShipingCount();
|
|
918
|
+ BigDecimal demandAmountD = new BigDecimal(demandAmount);
|
|
919
|
+
|
|
920
|
+ // 除法. 已完成数量/要求数量
|
|
921
|
+ BigDecimal complete = sumRkslD.divide(demandAmountD, 4, BigDecimal.ROUND_HALF_DOWN);
|
|
922
|
+ // 乘以100,得到的是百分比.
|
|
923
|
+ BigDecimal completeRate = complete.multiply(new BigDecimal("100"));
|
|
924
|
+ // 赋值:设置完成百分比.
|
|
925
|
+ businessDeliveryStorageNoticeV.setCompleteRate(completeRate.stripTrailingZeros().toPlainString());
|
|
926
|
+ businessDeliveryStorageNoticeV.setSysl(businessScedule.getSumSysl());
|
|
927
|
+ } else if ("3".equals(crkLx)) {
|
|
928
|
+ // 出库
|
|
929
|
+ // 出库数量.
|
|
930
|
+ String sumCksl = businessScedule.getSumWcsl();
|
|
931
|
+ BigDecimal s = new BigDecimal(1000);
|
|
932
|
+ BigDecimal sumCkslss = new BigDecimal(sumCksl);
|
|
933
|
+ BigDecimal sumCkslD = sumCkslss.divide(s);
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+ // 赋值:设置完成数量. stripTrailingZeros() 去除结尾的0
|
|
937
|
+ businessDeliveryStorageNoticeV.setCompleteAmount(sumCkslD.stripTrailingZeros().toPlainString());
|
|
938
|
+
|
|
939
|
+ // 通知单要求数量.
|
|
940
|
+ String demandAmount = businessDeliveryStorageNoticeV.getShipingCount();
|
|
941
|
+ BigDecimal demandAmountD = new BigDecimal(demandAmount);
|
|
942
|
+
|
|
943
|
+ // 除法. 已完成数量/要求数量
|
|
944
|
+ BigDecimal complete = sumCkslD.divide(demandAmountD, 4, BigDecimal.ROUND_HALF_DOWN);
|
|
945
|
+ // 乘以100,得到的是百分比.
|
|
946
|
+ BigDecimal completeRate = complete.multiply(new BigDecimal("100"));
|
|
947
|
+ // 赋值:设置完成百分比.
|
|
948
|
+ businessDeliveryStorageNoticeV.setCompleteRate(completeRate.stripTrailingZeros().toPlainString());
|
|
949
|
+ businessDeliveryStorageNoticeV.setSysl(businessScedule.getSumSysl());
|
|
950
|
+ }
|
|
951
|
+ // 在出入库list中删除该数据,这样下次循环数量就会减少了.
|
|
952
|
+ businessSceduleList.remove(businessScedule);
|
|
953
|
+ // 跳出当前的出入库循环.
|
|
954
|
+ break;
|
|
955
|
+ }
|
1023
|
956
|
}
|
1024
|
957
|
}
|
1025
|
|
- if (!flag) {
|
|
958
|
+ if (!flag) {
|
1026
|
959
|
// 进行到这里,说明出入库系统中,不存在该通知单对应的出入库数据. 设置完成数量,和完成比例为0.
|
1027
|
960
|
businessDeliveryStorageNoticeV.setCompleteAmount("0");
|
1028
|
961
|
businessDeliveryStorageNoticeV.setCompleteRate("0");
|
|
@@ -1033,14 +966,11 @@ public class BusinessDeliveryStorageNoticeServiceImpl implements BusinessDeliver
|
1033
|
966
|
for (BusinessDeliveryStorageNoticeAuditVO businessDeliveryStorageNoticeV : noticeList) {
|
1034
|
967
|
businessDeliveryStorageNoticeV.setCompleteAmount("0");
|
1035
|
968
|
businessDeliveryStorageNoticeV.setCompleteRate("0");
|
|
969
|
+ businessDeliveryStorageNoticeV.setSysl("0");
|
1036
|
970
|
}
|
1037
|
971
|
}
|
1038
|
972
|
|
1039
|
973
|
pageInfo = new PageInfo<BusinessDeliveryStorageNoticeAuditVO>(noticeList);
|
1040
|
|
- /* if(pageInfo.getTotal()>0){
|
1041
|
|
- pageInfo.setStartRow(pageInfo.getStartRow()+1);
|
1042
|
|
- pageInfo.setEndRow(pageInfo.getEndRow()+1);
|
1043
|
|
- }*/
|
1044
|
974
|
}
|
1045
|
975
|
return pageInfo;
|
1046
|
976
|
}
|