diff --git a/src/main/java/com/letian/modules/base/dao/BoardDao.java b/src/main/java/com/letian/modules/base/dao/BoardDao.java index 594138f..5e6d8bf 100644 --- a/src/main/java/com/letian/modules/base/dao/BoardDao.java +++ b/src/main/java/com/letian/modules/base/dao/BoardDao.java @@ -1,9 +1,6 @@ package com.letian.modules.base.dao; -import com.letian.modules.base.entity.BoardConfigData; -import com.letian.modules.base.entity.DelNotifyBoardData; -import com.letian.modules.base.entity.NewScheduledData; -import com.letian.modules.base.entity.ScheduleListBoardData; +import com.letian.modules.base.entity.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -24,7 +21,7 @@ public interface BoardDao { */ List getRefreshTimeDefault(String boardName); - NewScheduledData getNewScheduledPieList(String date); + PieBoardData getNewScheduledPieList(String date); List getNewScheduledBarList(String date); diff --git a/src/main/java/com/letian/modules/base/entity/PieBoardData.java b/src/main/java/com/letian/modules/base/entity/PieBoardData.java new file mode 100644 index 0000000..7da323a --- /dev/null +++ b/src/main/java/com/letian/modules/base/entity/PieBoardData.java @@ -0,0 +1,76 @@ +package com.letian.modules.base.entity; + +public class PieBoardData { + private float qty1; //总日计划数 + private float qty2; //已入库数 + private float qty3; //已完成但未入库数 + private float qty4; //未完成数 + private float per1; + private float per2; //已入库数百分比 + private float per3; //已完成但未入库数百分比 + private float per4; //未完成数百分比 + + public float getQty1() { + return qty1; + } + + public void setQty1(float qty1) { + this.qty1 = qty1; + } + + public float getQty2() { + return qty2; + } + + public void setQty2(float qty2) { + this.qty2 = qty2; + } + + public float getQty3() { + return qty3; + } + + public void setQty3(float qty3) { + this.qty3 = qty3; + } + + public float getQty4() { + return qty4; + } + + public void setQty4(float qty4) { + this.qty4 = qty4; + } + + public float getPer1() { + return per1; + } + + public void setPer1(float per1) { + this.per1 = per1; + } + + public float getPer2() { + return per2; + } + + public void setPer2(float per2) { + this.per2 = per2; + } + + public float getPer3() { + return per3; + } + + public void setPer3(float per3) { + this.per3 = per3; + } + + public float getPer4() { + return per4; + } + + public void setPer4(float per4) { + this.per4 = per4; + } +} diff --git a/src/main/java/com/letian/modules/base/service/Impl/BoardServiceImpl.java b/src/main/java/com/letian/modules/base/service/Impl/BoardServiceImpl.java index 0348f1a..ab0789a 100644 --- a/src/main/java/com/letian/modules/base/service/Impl/BoardServiceImpl.java +++ b/src/main/java/com/letian/modules/base/service/Impl/BoardServiceImpl.java @@ -2,10 +2,7 @@ package com.letian.modules.base.service.Impl; import com.letian.common.utils.DateUtil; import com.letian.modules.base.dao.BoardDao; -import com.letian.modules.base.entity.BoardConfigData; -import com.letian.modules.base.entity.DelNotifyBoardData; -import com.letian.modules.base.entity.NewScheduledData; -import com.letian.modules.base.entity.ScheduleListBoardData; +import com.letian.modules.base.entity.*; import com.letian.modules.base.service.BoardService; import com.letian.modules.base.utils.DateUtils; import com.letian.modules.base.utils.WeekUtil; @@ -29,7 +26,7 @@ public class BoardServiceImpl implements BoardService { @Override public List getNewScheduledTableData(int number){ String date = DateUtil.getStringDate(new Date()); - // String date="2022-01-09"; + // String date="2022-05-22"; List tableList =boardDao.getNewScheduledTableList(date); if(tableList.size()==0){ NewScheduledData tableData = new NewScheduledData(); @@ -76,18 +73,23 @@ public class BoardServiceImpl implements BoardService { // List tableList=new ArrayList<>(); String date = DateUtil.getStringDate(new Date()); - // String date="2022-01-09"; - NewScheduledData pieData=boardDao.getNewScheduledPieList(date); + // String date="2022-05-22"; + PieBoardData pieData=boardDao.getNewScheduledPieList(date); List barList=boardDao.getNewScheduledBarList(date); // tableList=boardDao.getNewScheduledTableList(date,number); // pieList=boardDao.getNewScheduledPieList(date); // barList=boardDao.getNewScheduledBarList(date); // map.put("tableList",tableList); if(pieData==null){ - NewScheduledData pieData2 = new NewScheduledData(); - pieData2.setQtyPercent(0f); - pieData2.setQtyReported(1f); - pieData2.setQtyUnReported(0f); + PieBoardData pieData2 = new PieBoardData(); + pieData2.setQty1(0); + pieData2.setQty2(0); + pieData2.setQty3(0); + pieData2.setQty4(0); + pieData2.setPer1(0); + pieData2.setPer2(0); + pieData2.setPer3(0); + pieData2.setPer4(0); map.put("pieData",pieData2); }else { map.put("pieData",pieData); diff --git a/src/main/resources/mapper/base/BoardDao.xml b/src/main/resources/mapper/base/BoardDao.xml index 3d95e38..0482650 100644 --- a/src/main/resources/mapper/base/BoardDao.xml +++ b/src/main/resources/mapper/base/BoardDao.xml @@ -14,10 +14,12 @@ WHERE type='board_refresh' AND boardName = #{boardName} - + select Round(SUM(SR.QtyRequired),3) as qty1,Round(SUM(SR.QtyRequired),3)-Round(SUM(SR.QtyApprove),3) as qty4,Round(SUM(SR.QtyReported),3) as qty2, + Round(SUM(SR.QtyApprove),3) -Round(SUM(SR.QtyReported),3) as qty3,100 as per1, + Round(Round(SUM(SR.QtyReported),3) *100 /case when Round(SUM(SR.QtyRequired),3) =0 then 1 else Round(SUM(SR.QtyRequired),3) end ,1) as per2, + Round((Round(SUM(SR.QtyApprove),3) -Round(SUM(SR.QtyReported),3) ) *100 /case when Round(SUM(SR.QtyRequired),3) =0 then 1 else Round(SUM(SR.QtyRequired),3) end ,1) as per3, + Round((Round(SUM(SR.QtyRequired),3) -Round(SUM(SR.QtyApprove),3) ) *100 /case when Round(SUM(SR.QtyRequired),3) =0 then 1 else Round(SUM(SR.QtyRequired),3) end ,1) as per4 from SOScheduledRouting SR where S_ScheduledDate=#{date} diff --git a/src/main/resources/mapper/production/DailyPlanMapper.xml b/src/main/resources/mapper/production/DailyPlanMapper.xml index 3dc4863..40d5ebd 100644 --- a/src/main/resources/mapper/production/DailyPlanMapper.xml +++ b/src/main/resources/mapper/production/DailyPlanMapper.xml @@ -336,7 +336,7 @@ - delete from ScheduleSerialNoList where Site=#{site} and OrderNo=#{orderNo} and ScheduleDate=#{scheduleDate} and ShiftNo=#{shiftNo} and ItemNo=#{itemNo} and SeqNo=#{seqNo} + delete from ScheduleSerialNoList where Site=#{site} and SeqNo=#{seqNo}