Преглед изворни кода

销售统计报表 内部拉账套2 调整金额小数

liuchaohui пре 2 година
родитељ
комит
470ed64872

+ 45 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/controller/SoSoDetailsController.java

@@ -199,7 +199,13 @@ public class SoSoDetailsController extends JeecgController<SoSoDetails, ISoSoDet
 		 Result<IPage<SoSoDetails>> result =new Result<>();
 		 Page<SoSoDetails> page = new Page<SoSoDetails>(pageNo, pageSize);
 		 try {
-			 IPage<SoSoDetails> list=soSoDetailsService.getSO_SOMainReport(page,map);
+			 IPage<SoSoDetails> list= new Page<>();
+			 if(vendorType.equals("外部")){
+				 list = soSoDetailsService.getSO_SOMainReport(page,map);
+			 }else {
+				 list = soSoDetailsService.getSO_SOMainReport2(page,map);
+			 }
+
 			 for (SoSoDetails so:list.getRecords()) {
 			 	if(oConvertUtils.isNotEmpty(so.getINatMoney())){
 					so.setINatMoney(so.getINatMoney().setScale(2, BigDecimal.ROUND_HALF_UP));
@@ -235,8 +241,25 @@ public class SoSoDetailsController extends JeecgController<SoSoDetails, ISoSoDet
 	 public Result<List<SoSoDetails>> QuerySO_SOMainReportBydepartment(String vendorType,String startYearMonth,String endYearMonth,
 														String department,String customer){
 		 Result<List<SoSoDetails>> result =new Result<>();
-		 List<SoSoDetails> list = soSoDetailsService.QuerySO_SOMainReportBydepartment(department,customer,vendorType, startYearMonth, endYearMonth);
-		 result.setResult(list);
+		 List<SoSoDetails> list = new ArrayList<>();
+		 if(vendorType.equals("外部")){
+			 list = soSoDetailsService.QuerySO_SOMainReportBydepartment(department,customer,vendorType, startYearMonth, endYearMonth);
+			 result.setResult(list);
+		 }else {
+			 list = soSoDetailsService.QuerySO_SOMainReportBydepartment2(department,customer,vendorType, startYearMonth, endYearMonth);
+			 result.setResult(list);
+		 }
+		 for (SoSoDetails so:list) {
+			 if(oConvertUtils.isNotEmpty(so.getINatMoney())){
+				 so.setINatMoney(so.getINatMoney().setScale(2, BigDecimal.ROUND_HALF_UP));
+			 }
+			 if(oConvertUtils.isNotEmpty(so.getINatUnitPrice())){
+				 so.setINatUnitPrice(so.getINatUnitPrice().setScale(2,BigDecimal.ROUND_HALF_UP));
+			 }
+			 if(oConvertUtils.isNotEmpty(so.getIQuantity())){
+				 so.setIQuantity(so.getIQuantity().setScale(2,BigDecimal.ROUND_HALF_UP));
+			 }
+		 }
 		 return result;
 	 }
 
@@ -255,8 +278,25 @@ public class SoSoDetailsController extends JeecgController<SoSoDetails, ISoSoDet
 	 public Result<List<SoSoDetails>> QuerySO_SOMainReportBycustomer(String vendorType,String startYearMonth,String endYearMonth,
 																	 String customer,String department){
 		 Result<List<SoSoDetails>> result =new Result<>();
-		 List<SoSoDetails> list = soSoDetailsService.QuerySO_SOMainReportBycustomer(customer,department,vendorType, startYearMonth, endYearMonth);
-		 result.setResult(list);
+		 List<SoSoDetails> list = new ArrayList<>();
+		if(vendorType.equals("外部")){
+			list = soSoDetailsService.QuerySO_SOMainReportBycustomer(customer,department,vendorType, startYearMonth, endYearMonth);
+			result.setResult(list);
+		}else {
+			list = soSoDetailsService.QuerySO_SOMainReportBycustomer2(customer,department,vendorType, startYearMonth, endYearMonth);
+			result.setResult(list);
+		}
+		 for (SoSoDetails so:list) {
+			 if(oConvertUtils.isNotEmpty(so.getINatMoney())){
+				 so.setINatMoney(so.getINatMoney().setScale(2, BigDecimal.ROUND_HALF_UP));
+			 }
+			 if(oConvertUtils.isNotEmpty(so.getINatUnitPrice())){
+				 so.setINatUnitPrice(so.getINatUnitPrice().setScale(2,BigDecimal.ROUND_HALF_UP));
+			 }
+			 if(oConvertUtils.isNotEmpty(so.getIQuantity())){
+				 so.setIQuantity(so.getIQuantity().setScale(2,BigDecimal.ROUND_HALF_UP));
+			 }
+		 }
 		 return result;
 	 }
 

+ 8 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/ISoSoDetailsService.java

@@ -26,4 +26,12 @@ public interface ISoSoDetailsService extends IService<SoSoDetails> {
 
     List<SoSoDetails> QuerySO_SOMainReportBycustomer(String customer,String department,
                                                      String vendorType,String startYearMonth,String endYearMonth);
+
+    IPage<SoSoDetails> getSO_SOMainReport2(IPage<SoSoDetails> page,Map<String, Object> map);
+
+    List<SoSoDetails> QuerySO_SOMainReportBydepartment2(String department,String customer,
+                                                       String vendorType,String startYearMonth,String endYearMonth);
+
+    List<SoSoDetails> QuerySO_SOMainReportBycustomer2(String customer,String department,
+                                                     String vendorType,String startYearMonth,String endYearMonth);
 }

+ 18 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/impl/SoSoDetailsServiceImpl.java

@@ -38,4 +38,22 @@ public class SoSoDetailsServiceImpl extends ServiceImpl<SoSoDetailsMapper, SoSoD
     public List<SoSoDetails> QuerySO_SOMainReportBycustomer(String customer,String department,String vendorType, String startYearMonth, String endYearMonth) {
         return this.baseMapper.QuerySO_SOMainReportBycustomer(customer,department,vendorType,startYearMonth,endYearMonth);
     }
+
+    @Override
+    @DS("multi-two")
+    public IPage<SoSoDetails> getSO_SOMainReport2(IPage<SoSoDetails> page,Map<String, Object> map) {
+        return this.baseMapper.getSO_SOMainReport(page,map);
+    }
+
+    @Override
+    @DS("multi-two")
+    public List<SoSoDetails> QuerySO_SOMainReportBydepartment2(String department,String customer,String vendorType, String startYearMonth, String endYearMonth) {
+        return this.baseMapper.QuerySO_SOMainReportBydepartment(department,customer,vendorType,startYearMonth,endYearMonth);
+    }
+
+    @Override
+    @DS("multi-two")
+    public List<SoSoDetails> QuerySO_SOMainReportBycustomer2(String customer,String department,String vendorType, String startYearMonth, String endYearMonth) {
+        return this.baseMapper.QuerySO_SOMainReportBycustomer(customer,department,vendorType,startYearMonth,endYearMonth);
+    }
 }