|
@@ -71,51 +71,56 @@ public class FbsWorkshopDispatchListServiceImpl extends ServiceImpl<FbsWorkshopD
|
|
|
|
|
|
Calendar cale = Calendar.getInstance();
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- String firstday, lastday;
|
|
|
- if(fbsWorkshopDispatchListWhere.getYear()==null){
|
|
|
-
|
|
|
- cale = Calendar.getInstance();
|
|
|
- cale.add(Calendar.MONTH, 0);
|
|
|
- cale.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
- firstday = format.format(cale.getTime());
|
|
|
-
|
|
|
- cale = Calendar.getInstance();
|
|
|
- cale.add(Calendar.MONTH, 1);
|
|
|
- cale.set(Calendar.DAY_OF_MONTH, 0);
|
|
|
- lastday = format.format(cale.getTime());
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }else{
|
|
|
- Calendar cal = Calendar.getInstance();
|
|
|
-
|
|
|
- cal.set(Calendar.YEAR,Integer.parseInt(fbsWorkshopDispatchListWhere.getYear()));
|
|
|
-
|
|
|
- cal.set(Calendar.MONTH, Integer.parseInt(fbsWorkshopDispatchListWhere.getMonth())-1);
|
|
|
-
|
|
|
- int firstDay = cal.getActualMinimum(Calendar.DAY_OF_MONTH);
|
|
|
-
|
|
|
- cal.set(Calendar.DAY_OF_MONTH, firstDay);
|
|
|
- firstday=format.format(cal.getTime());
|
|
|
-
|
|
|
- int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
|
|
|
- cal.set(Calendar.DAY_OF_MONTH, lastDay);
|
|
|
- lastday=format.format(cal.getTime());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ List<String> codeList=new ArrayList<>();
|
|
|
+ for(FbsMomOrderdetail fbsMomOrderdetail:fbsMomOrderdetailList){
|
|
|
+ codeList.add(fbsMomOrderdetail.getMocode());
|
|
|
}
|
|
|
- String startTime = firstday;
|
|
|
- String endTime = lastday;
|
|
|
- List<FbsWorkshopDispatchList> fbsWorkshopDispatchListList=fbsWorkshopDispatchListMapper.getDispatchClose(startTime,endTime);
|
|
|
+ List<FbsWorkshopDispatchList> fbsWorkshopDispatchListList=fbsWorkshopDispatchListMapper.getDispatchClose("startTime","endTime",codeList);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- List<Date> dateList=startDateAndEndDate(startTime,endTime);
|
|
|
+
|
|
|
|
|
|
|
|
|
- if(fbsWorkshopDispatchListListSum!=null&&fbsWorkshopDispatchListList!=null&&dateList!=null){
|
|
|
+
|
|
|
+ if(fbsWorkshopDispatchListListSum!=null&&fbsWorkshopDispatchListList!=null){
|
|
|
+
|
|
|
for(FbsWorkshopDispatchList dispatchListSum:fbsWorkshopDispatchListListSum){
|
|
|
Integer quantityCompletedTotal=0;
|
|
|
BigDecimal manHoursCompletedTotal=new BigDecimal(0.00);
|
|
|
List<FbsWorkshopDispatchList> dispatchListAdd=new ArrayList<>();
|
|
|
- for(Date date:dateList){
|
|
|
- String dateString=fmt.format(date);
|
|
|
+
|
|
|
+
|
|
|
boolean isorder=false;
|
|
|
FbsWorkshopDispatchList fbsWorkshopDispatchList=new FbsWorkshopDispatchList();
|
|
|
BigDecimal number_of_tasks=new BigDecimal(0.00);
|
|
@@ -132,7 +137,9 @@ public class FbsWorkshopDispatchListServiceImpl extends ServiceImpl<FbsWorkshopD
|
|
|
String pro=dispatchList.getProductId();
|
|
|
|
|
|
|
|
|
- if(orderIdSum.equals(orderId)&&dateString.equals(dispatchDate)&&proSum.equals(pro)){
|
|
|
+
|
|
|
+
|
|
|
+ if(orderIdSum.equals(orderId)&&proSum.equals(pro)){
|
|
|
if(dispatchList.getQualifiedNumber()!=null){
|
|
|
quantityCompletedTotal+=dispatchList.getQualifiedNumber();
|
|
|
}
|
|
@@ -162,9 +169,9 @@ public class FbsWorkshopDispatchListServiceImpl extends ServiceImpl<FbsWorkshopD
|
|
|
}
|
|
|
|
|
|
if(isorder==false){
|
|
|
- FbsWorkshopDispatchList fbsWorkshopDispatchList2=new FbsWorkshopDispatchList();
|
|
|
- fbsWorkshopDispatchList2.setFinalTime(date);
|
|
|
- dispatchListAdd.add(fbsWorkshopDispatchList2);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}else{
|
|
|
if(fbsWorkshopDispatchList.getQualifiedNumber()==null||fbsWorkshopDispatchList.getQualifiedNumber()==0){
|
|
|
fbsWorkshopDispatchList.setProductionEfficiency("0.0");
|
|
@@ -182,7 +189,7 @@ public class FbsWorkshopDispatchListServiceImpl extends ServiceImpl<FbsWorkshopD
|
|
|
dispatchListAdd.add(fbsWorkshopDispatchList);
|
|
|
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
if(quantityCompletedTotal!=0){
|
|
|
dispatchListSum.setQuantityCompletedTotal(quantityCompletedTotal);
|
|
@@ -238,7 +245,8 @@ public class FbsWorkshopDispatchListServiceImpl extends ServiceImpl<FbsWorkshopD
|
|
|
mergeLines(fbsWorkshopDispatchListListSum);
|
|
|
|
|
|
if(fbsWorkshopDispatchListListSum!=null&&fbsWorkshopDispatchListListSum.size()>0){
|
|
|
- getStatisticsTotal(fbsWorkshopDispatchListListSum,dateList);
|
|
|
+
|
|
|
+ getStatisticsTotal(fbsWorkshopDispatchListListSum,null);
|
|
|
}
|
|
|
return fbsWorkshopDispatchListListSum;
|
|
|
}
|
|
@@ -446,53 +454,53 @@ public class FbsWorkshopDispatchListServiceImpl extends ServiceImpl<FbsWorkshopD
|
|
|
List<FbsWorkshopDispatchList> fbsWorkshopDispatchListListTotal=new ArrayList<>();
|
|
|
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
- for(Date date:dateList){
|
|
|
- String dateN=fmt.format(date);
|
|
|
- BigDecimal numberOfTasks=new BigDecimal("0.0");
|
|
|
- Integer qualifiedNumber=0;
|
|
|
- BigDecimal standardWorkingHours=new BigDecimal(0.00);
|
|
|
- BigDecimal manHoursCompleted=new BigDecimal(0.00);
|
|
|
-
|
|
|
- for(FbsWorkshopDispatchList workshopDispatchList:fbsWorkshopDispatchListList){
|
|
|
- if(workshopDispatchList.getFbsWorkshopDispatchListList()!=null){
|
|
|
- for(FbsWorkshopDispatchList workshopDispatchListC:workshopDispatchList.getFbsWorkshopDispatchListList()){
|
|
|
- String endDate=fmt.format(workshopDispatchListC.getFinalTime());
|
|
|
-
|
|
|
- if(dateN.equals(endDate)){
|
|
|
- if(workshopDispatchListC.getNumberOfTasks()!=null){
|
|
|
- numberOfTasks=numberOfTasks.add(workshopDispatchListC.getNumberOfTasks());
|
|
|
- }
|
|
|
- if(workshopDispatchListC.getQualifiedNumber()!=null){
|
|
|
- qualifiedNumber+=workshopDispatchListC.getQualifiedNumber();
|
|
|
- }
|
|
|
- if(isNumber(workshopDispatchListC.getStandardWorkingHours())){
|
|
|
- standardWorkingHours=standardWorkingHours.add(getDecimal(Double.valueOf(workshopDispatchListC.getStandardWorkingHours())));
|
|
|
- }
|
|
|
- if(isNumber(workshopDispatchListC.getManHoursCompleted())){
|
|
|
- manHoursCompleted=manHoursCompleted.add(getDecimal(Double.valueOf(workshopDispatchListC.getManHoursCompleted())));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- FbsWorkshopDispatchList fbsWorkshopDispatchList=new FbsWorkshopDispatchList();
|
|
|
- fbsWorkshopDispatchList.setNumberOfTasks(numberOfTasks);
|
|
|
- fbsWorkshopDispatchList.setQualifiedNumber(qualifiedNumber);
|
|
|
- fbsWorkshopDispatchList.setStandardWorkingHours(formatDouble5(standardWorkingHours.doubleValue())+"");
|
|
|
- fbsWorkshopDispatchList.setManHoursCompleted(formatDouble5(manHoursCompleted.doubleValue())+"");
|
|
|
- Double achievement=0.0;
|
|
|
- if(qualifiedNumber!=0||numberOfTasks.doubleValue()!=0){
|
|
|
- achievement=qualifiedNumber.doubleValue()/numberOfTasks.doubleValue();
|
|
|
- }
|
|
|
- fbsWorkshopDispatchList.setAchievementRate(formatDouble5((achievement*100.0)));
|
|
|
- Double production=0.0;
|
|
|
- if(standardWorkingHours.doubleValue()>0&&manHoursCompleted.doubleValue()>0){
|
|
|
- production=standardWorkingHours.divide(manHoursCompleted,2, RoundingMode.HALF_UP).multiply(getDecimal(100.0)).doubleValue();
|
|
|
- }
|
|
|
- fbsWorkshopDispatchList.setProductionEfficiency(production+"");
|
|
|
- fbsWorkshopDispatchListListTotal.add(fbsWorkshopDispatchList);
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|