change 4 gadi atpakaļ
vecāks
revīzija
0234c6a397

+ 44 - 37
zhongzheng-api/src/main/resources/templates/word.ftl

@@ -11,13 +11,13 @@
         <o:Author>Administrator</o:Author>
         <o:LastAuthor>初學者</o:LastAuthor>
         <o:Created>2021-11-16T06:37:00Z</o:Created>
-        <o:LastSaved>2021-12-20T08:24:55Z</o:LastSaved>
-        <o:TotalTime>20160</o:TotalTime>
+        <o:LastSaved>2021-12-20T12:06:39Z</o:LastSaved>
+        <o:TotalTime>0</o:TotalTime>
         <o:Version>14</o:Version>
     </o:DocumentProperties>
     <o:CustomDocumentProperties>
         <o:KSOProductBuildVer dt:dt="string">2052-11.1.0.11115</o:KSOProductBuildVer>
-        <o:ICV dt:dt="string">FE4B635F6E4E4AA9A75EA1C284E7E3E6</o:ICV>
+        <o:ICV dt:dt="string">55C38C70D21F4CD2AA50247A169F90C6</o:ICV>
     </o:CustomDocumentProperties>
     <w:fonts>
         <w:defaultFonts w:ascii="Times New Roman" w:fareast="宋体" w:h-ansi="Times New Roman" w:cs="Times New Roman"/>
@@ -85,14 +85,6 @@
             <w:sig w:usb-0="E4002EFF" w:usb-1="C000247B" w:usb-2="00000009" w:usb-3="00000000" w:csb-0="200001FF"
                    w:csb-1="00000000"/>
         </w:font>
-        <w:font w:name="Arial">
-            <w:panose-1 w:val="020B0604020202020204"/>
-            <w:charset w:val="00"/>
-            <w:family w:val="Auto"/>
-            <w:pitch w:val="Default"/>
-            <w:sig w:usb-0="E0002EFF" w:usb-1="C000785B" w:usb-2="00000009" w:usb-3="00000000" w:csb-0="400001FF"
-                   w:csb-1="FFFF0000"/>
-        </w:font>
         <w:font w:name="方正小标宋简体">
             <w:altName w:val="方正舒体"/>
             <w:panose-1 w:val="00000000000000000000"/>
@@ -135,13 +127,13 @@
             <w:sig w:usb-0="00000000" w:usb-1="00000000" w:usb-2="00000000" w:usb-3="00000000" w:csb-0="00000000"
                    w:csb-1="00000000"/>
         </w:font>
-        <w:font w:name="Tahoma">
-            <w:panose-1 w:val="020B0604030504040204"/>
+        <w:font w:name="Arial">
+            <w:panose-1 w:val="020B0604020202020204"/>
             <w:charset w:val="00"/>
             <w:family w:val="Auto"/>
             <w:pitch w:val="Default"/>
-            <w:sig w:usb-0="E1002EFF" w:usb-1="C000605B" w:usb-2="00000029" w:usb-3="00000000" w:csb-0="200101FF"
-                   w:csb-1="20280000"/>
+            <w:sig w:usb-0="E0002EFF" w:usb-1="C000785B" w:usb-2="00000009" w:usb-3="00000000" w:csb-0="400001FF"
+                   w:csb-1="FFFF0000"/>
         </w:font>
     </w:fonts>
     <w:styles>
@@ -712,7 +704,7 @@
     </w:bgPict>
     <w:docPr>
         <w:view w:val="print"/>
-        <w:zoom w:percent="80"/>
+        <w:zoom w:percent="110"/>
         <w:characterSpacingControl w:val="DontCompress"/>
         <w:documentProtection w:enforcement="off"/>
         <w:doNotEmbedSystemFonts/>
@@ -1699,8 +1691,7 @@
                                     <w:sz w:val="24"/>
                                     <w:sz-cs w:val="24"/>
                                 </w:rPr>
-                                <w:t>
-                                    本人已仔细阅读《广东省住房和城乡建设厅关于推进住房和城乡建设领域施工现场专业人员职业培训工作的通知〉的通知》全部内容并知晓和理解,本人的学历证书、身份证、工作年限、相片等所有资料完全真实、符合报名条件、资格审查要求和相关规定,本人在报名、审查、培训、测试等有关的事项中会严格遵守相关规定和要求,如有虚假或与实际规定不符等情况造成的一切后果由本人承担。
+                                <w:t>本人已仔细阅读《广东省住房和城乡建设厅关于推进住房和城乡建设领域施工现场专业人员职业培训工作的通知〉的通知》全部内容并知晓和理解,本人的学历证书、身份证、工作年限、相片等所有资料完全真实、符合报名条件、资格审查要求和相关规定,本人在报名、审查、培训、测试等有关的事项中会严格遵守相关规定和要求,如有虚假或与实际规定不符等情况造成的一切后果由本人承担。
                                 </w:t>
                             </w:r>
                         </w:p>
@@ -1746,11 +1737,17 @@
                                     <w:sz-cs w:val="24"/>
                                 </w:rPr>
                             </w:pPr>
+                            <w:r>
+                                <w:rPr>
+                                    <w:rFonts w:hint="fareast"/>
+                                    <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
+                                </w:rPr>
+                                <w:t></w:t>
+                            </w:r>
                         </w:p>
                         <w:p>
                             <w:pPr>
                                 <w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
-                                <w:ind w:first-line="480" w:first-line-chars="200"/>
                                 <w:rPr>
                                     <w:rFonts w:ascii="黑体" w:h-ansi="黑体" w:fareast="黑体" w:hint="fareast"/>
                                     <w:color w:val="000000"/>
@@ -1771,14 +1768,25 @@
                             <aml:annotation aml:id="0" w:type="Word.Bookmark.Start" w:name="signimg"/>
                             <aml:annotation aml:id="0" w:type="Word.Bookmark.End"/>
                             <w:r>
-                                <w:rPr>
-                                    <w:rFonts w:ascii="黑体" w:h-ansi="黑体" w:fareast="黑体" w:hint="fareast"/>
-                                    <w:color w:val="000000"/>
-                                    <w:sz w:val="24"/>
-                                    <w:sz-cs w:val="24"/>
-                                    <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
-                                </w:rPr>
-                                <w:t>${image}</w:t>
+                                <w:t></w:t>
+                            </w:r>
+                            <w:r>
+                                <w:pict>
+                                    <w:binData w:name="wordml://1.png">
+                                        ${image}
+                                    </w:binData>
+                                    <v:shape id="_x0000_s1026" o:spt="75" alt="" type="#_x0000_t75"
+                                             style="height:21.75pt;width:109.5pt;" filled="f" o:preferrelative="t"
+                                             stroked="f" coordsize="21600,21600">
+                                        <v:path/>
+                                        <v:fill on="f" focussize="0,0"/>
+                                        <v:stroke on="f"/>
+                                        <v:imagedata src="wordml://1.png" o:title=""/>
+                                        <o:lock v:ext="edit" aspectratio="t"/>
+                                        <w10:wrap type="none"/>
+                                        <w10:anchorlock/>
+                                    </v:shape>
+                                </w:pict>
                             </w:r>
                             <w:r>
                                 <w:t></w:t>
@@ -1788,10 +1796,10 @@
                                     <w:rFonts w:hint="fareast"/>
                                     <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
                                 </w:rPr>
-                                <w:t>${y}</w:t>
+                                <w:t>       ${y}</w:t>
                             </w:r>
                             <w:r>
-                                <w:t> 年</w:t>
+                                <w:t>年</w:t>
                             </w:r>
                             <w:r>
                                 <w:rPr>
@@ -1801,14 +1809,14 @@
                                 <w:t>${m}</w:t>
                             </w:r>
                             <w:r>
-                                <w:t> 月</w:t>
+                                <w:t>月</w:t>
                             </w:r>
                             <w:r>
                                 <w:rPr>
                                     <w:rFonts w:hint="fareast"/>
                                     <w:lang w:val="EN-US" w:fareast="ZH-CN"/>
                                 </w:rPr>
-                                <w:t>${d} </w:t>
+                                <w:t>${d}</w:t>
                             </w:r>
                             <w:r>
                                 <w:t>日</w:t>
@@ -1897,8 +1905,7 @@
                                     <w:sz w:val="24"/>
                                     <w:sz-cs w:val="24"/>
                                 </w:rPr>
-                                <w:t>
-                                    我单位已仔细阅读《广东省住房和城乡建设厅关于推进住房和城乡建设领域施工现场专业人员职业培训工作的通知〉的通知》全部内容并知晓和理解,以上人员为我单位工作人员,持有的学历证书、身份证、工作年限、相片等所有资料经我单位查验完全符合报名条件、资格审查要求和相关规定,以上人员在报名、审查、培训、测试等有关的事项中会严格遵守相关规定、通知和要求,如有虚假或与实际规定不符等情况,造成的一切后果由我单位承担。
+                                <w:t>我单位已仔细阅读《广东省住房和城乡建设厅关于推进住房和城乡建设领域施工现场专业人员职业培训工作的通知〉的通知》全部内容并知晓和理解,以上人员为我单位工作人员,持有的学历证书、身份证、工作年限、相片等所有资料经我单位查验完全符合报名条件、资格审查要求和相关规定,以上人员在报名、审查、培训、测试等有关的事项中会严格遵守相关规定、通知和要求,如有虚假或与实际规定不符等情况,造成的一切后果由我单位承担。
                                 </w:t>
                             </w:r>
                         </w:p>
@@ -2005,7 +2012,7 @@
                                     <w:sz w:val="24"/>
                                     <w:sz-cs w:val="24"/>
                                 </w:rPr>
-                                <w:t>单位(盖章):</w:t>
+                                <w:t>          单位(盖章):</w:t>
                             </w:r>
                         </w:p>
                         <w:p>
@@ -2046,7 +2053,7 @@
                                     <w:sz w:val="24"/>
                                     <w:sz-cs w:val="24"/>
                                 </w:rPr>
-                                <w:t>年</w:t>
+                                <w:t>   年</w:t>
                             </w:r>
                             <w:r>
                                 <w:rPr>
@@ -2064,7 +2071,7 @@
                                     <w:sz w:val="24"/>
                                     <w:sz-cs w:val="24"/>
                                 </w:rPr>
-                                <w:t>月</w:t>
+                                <w:t>   月</w:t>
                             </w:r>
                             <w:r>
                                 <w:rPr>
@@ -2082,7 +2089,7 @@
                                     <w:sz w:val="24"/>
                                     <w:sz-cs w:val="24"/>
                                 </w:rPr>
-                                <w:t>日</w:t>
+                                <w:t>   日</w:t>
                             </w:r>
                         </w:p>
                         <w:p>

+ 51 - 21
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java

@@ -135,7 +135,7 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
         bindingMap.put("major", "niu");
         bindingMap.put("cname", "niu");
         bindingMap.put("cphone", "niu");
-        bindingMap.put("image",  imageToBase64ByOnline("https://file-dev.xyyxt.net/oss/images/avatar/20211220/1639989015718_1121154924"));
+        bindingMap.put("image",  Image2Base64("https://file-dev.xyyxt.net/oss/images/avatar/20211220/1639989015718_1121154924"));
         bindingMap.put("y", "niu");
         bindingMap.put("m", "niu");
         bindingMap.put("d", "niu");
@@ -146,30 +146,60 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
         return "11";
     }
 
-    public static String imageToBase64ByOnline (String imgURL) {
-        ByteArrayOutputStream data = new ByteArrayOutputStream();
+    /**
+     * 远程读取image转换为Base64字符串
+     *
+     * @param imgUrl
+     * @return
+     */
+    public static String Image2Base64(String imgUrl) {
+        URL url = null;
+        InputStream is = null;
+        ByteArrayOutputStream outStream = null;
+        HttpURLConnection httpUrl = null;
         try {
-            // 创建URL
-            URL url = new URL(imgURL);
-            byte[] by = new byte[1024];
-            // 创建链接
-            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
-            conn.setRequestMethod("GET");
-            conn.setConnectTimeout(5000);
-            InputStream is = conn.getInputStream();
-            // 将内容读取内存中
-            int len = -1;
-            while ((len = is.read(by)) != -1) {
-                data.write(by, 0, len);
+            url = new URL(imgUrl);
+            httpUrl = (HttpURLConnection) url.openConnection();
+            httpUrl.connect();
+            httpUrl.getInputStream();
+            is = httpUrl.getInputStream();
+
+            outStream = new ByteArrayOutputStream();
+            //创建一个Buffer字符串
+            byte[] buffer = new byte[1024];
+            //每次读取的字符串长度,如果为-1,代表全部读取完毕
+            int len = 0;
+            //使用一个输入流从buffer里把数据读取出来
+            while ((len = is.read(buffer)) != -1) {
+                //用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度
+                outStream.write(buffer, 0, len);
             }
-            // 关闭流
-            is.close();
-        } catch (IOException e) {
+            // 对字节数组Base64编码
+            return new BASE64Encoder().encode(outStream.toByteArray());
+        } catch (Exception e) {
             e.printStackTrace();
+        }  //下载
+        finally {
+            if (is != null) {
+                try {
+                    is.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (outStream != null) {
+                try {
+                    outStream.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (httpUrl != null) {
+                httpUrl.disconnect();
+            }
         }
-        // 对字节数组Base64编码
-        BASE64Encoder encoder = new BASE64Encoder();
-        return encoder.encode(data.toByteArray());
+        return imgUrl;
     }
 
+
 }

+ 175 - 27
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserPlanServiceImpl.java

@@ -166,34 +166,79 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
     public Boolean insertByAddBo(UserPlanAddBo bo) throws ParseException {
         validEntityPlanBeforeSave(bo);
         UserPlan userPlan = new UserPlan();
-        List<CalendarStudyVo> clCalendarStudyVos = findDates(bo.getStartTime(),bo.getEndTime());
-        Long sumUp=0L;
+        Calendar c = Calendar.getInstance();
+        c.setTime(new Date(bo.getStartTime()*1000));
+
+        //设置为1号,当前日期既为本月第一天
+        c.set(Calendar.DAY_OF_MONTH, 1);
+        //将小时至0
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        //将分钟至0
+        c.set(Calendar.MINUTE, 0);
+        //将秒至0
+        c.set(Calendar.SECOND,0);
+        //将毫秒至0
+        c.set(Calendar.MILLISECOND, 0);
+
+        Calendar c1 = Calendar.getInstance();
+        c1.setTime(new Date(bo.getEndTime()*1000));
+        //设置为当月最后一天
+        c1.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
+        //将小时至23
+        c1.set(Calendar.HOUR_OF_DAY, 23);
+        //将分钟至59
+        c1.set(Calendar.MINUTE, 59);
+        //将秒至59
+        c1.set(Calendar.SECOND,59);
+        //将毫秒至999
+        c1.set(Calendar.MILLISECOND, 999);
+
+        List<CalendarStudyVo> clCalendarStudyVos = findDates(c.getTimeInMillis()/1000,c1.getTimeInMillis()/1000);
+        Long secAll = 0L;
+        Long sumUp = 0L;
         for (Long aLong : bo.getGoodsId()) {
             //最近考试时间七天前到现在的天数,学习视频时长
             Date date1 = new Date(bo.getEndTime() * 1000L);
             //获得相隔天数
             int dutyDays = getDutyDays(new Date(), date1, bo.getStudyCount(), bo.getStudyDay());
-
+            if (dutyDays < 1){
+                throw new IllegalArgumentException("没有学习天数,请认真填写开始结束时间");
+            }
             List<Long> seLongs = baseMapper.selectGoods(aLong);
             Long allNum = 0L;
             for (Long seLong : seLongs) {
                 allNum += seLong;
             }
-            sumUp += allNum;
+            sumUp = allNum;
             //计算每天需要学习多少节课
             int Sec = (int) Math.ceil((double) allNum / dutyDays);
+            secAll+=Sec;
             for (CalendarStudyVo clCalendarStudyVo : clCalendarStudyVos) {
                 for (DayStudyVo dayStudyVo : clCalendarStudyVo.getDayStudyList()) {
                     if (Arrays.asList(bo.getStudyCount()).contains(dayStudyVo.getStudyDay())){
-                        if (allNum.equals(0)){
+                        if (allNum < 0){
                             break;
                         }
-                        allNum -= Sec;
+                        Calendar c5 = Calendar.getInstance();
+                        c.setTime(new Date(bo.getStartTime()));
+                        if (dayStudyVo.getDate() <= c5.get(Calendar.DAY_OF_MONTH) && clCalendarStudyVo.getMonth() == (c5.get(Calendar.MONTH) + 1) && clCalendarStudyVo.getYear() == (c5.get(Calendar.YEAR))){
+                            continue;
+                        }
+
                         if (dayStudyVo.getStudyCourseKnob() != null) {
-                            dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
+                            if (allNum < Sec) {
+                                dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + allNum);
+                            } else{
+                                dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
+                            }
                         }else {
-                            dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
+                            if (allNum < Sec) {
+                                dayStudyVo.setStudyCourseKnob(allNum);
+                            } else {
+                                dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
+                            }
                         }
+
                         dayStudyVo.setPerform(0);
                         List<DaySectionVo> daySectionList = new ArrayList<>();
                         if (!CollectionUtils.isEmpty(dayStudyVo.getDaySectionList())) {
@@ -201,10 +246,16 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
                         }
                         DaySectionVo daySectionVo = new DaySectionVo();
                         daySectionVo.setGoodsId(aLong);
-                        daySectionVo.setStudyGoodsKnob(Convert.toLong(Sec));
+                        if (allNum < Sec) {
+                            daySectionVo.setStudyGoodsKnob(Convert.toLong(allNum));
+                        } else{
+                            daySectionVo.setStudyGoodsKnob(Convert.toLong(Sec));
+                        }
+
                         daySectionVo.setGoodsPerform(0);
                         daySectionList.add(daySectionVo);
                         dayStudyVo.setDaySectionList(daySectionList);
+                        allNum -= Sec;
 
                     }
                 }
@@ -248,34 +299,79 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             this.updateById(userPlan);
             return true;
         }
-        List<CalendarStudyVo> clCalendarStudyVos = findDates(bo.getStartTime(),bo.getEndTime());
-        Long sumUp=0L;
+        Calendar c = Calendar.getInstance();
+        c.setTime(new Date(bo.getStartTime()*1000));
+
+        //设置为1号,当前日期既为本月第一天
+        c.set(Calendar.DAY_OF_MONTH, 1);
+        //将小时至0
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        //将分钟至0
+        c.set(Calendar.MINUTE, 0);
+        //将秒至0
+        c.set(Calendar.SECOND,0);
+        //将毫秒至0
+        c.set(Calendar.MILLISECOND, 0);
+
+        Calendar c1 = Calendar.getInstance();
+        c1.setTime(new Date(bo.getEndTime()*1000));
+        //设置为当月最后一天
+        c1.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
+        //将小时至23
+        c1.set(Calendar.HOUR_OF_DAY, 23);
+        //将分钟至59
+        c1.set(Calendar.MINUTE, 59);
+        //将秒至59
+        c1.set(Calendar.SECOND,59);
+        //将毫秒至999
+        c1.set(Calendar.MILLISECOND, 999);
+
+        List<CalendarStudyVo> clCalendarStudyVos = findDates(c.getTimeInMillis()/1000,c1.getTimeInMillis()/1000);
+        Long secAll = 0L;
+        Long sumUp = 0L;
         for (Long aLong : bo.getGoodsId()) {
             //最近考试时间七天前到现在的天数,学习视频时长
             Date date1 = new Date(bo.getEndTime() * 1000L);
             //获得相隔天数
             int dutyDays = getDutyDays(new Date(), date1, bo.getStudyCount(), bo.getStudyDay());
-
+            if (dutyDays < 1){
+                throw new IllegalArgumentException("没有学习天数,请认真填写开始结束时间");
+            }
             List<Long> seLongs = baseMapper.selectGoods(aLong);
             Long allNum = 0L;
             for (Long seLong : seLongs) {
                 allNum += seLong;
             }
-            sumUp += allNum;
+            sumUp = allNum;
             //计算每天需要学习多少节课
             int Sec = (int) Math.ceil((double) allNum / dutyDays);
+            secAll+=Sec;
             for (CalendarStudyVo clCalendarStudyVo : clCalendarStudyVos) {
                 for (DayStudyVo dayStudyVo : clCalendarStudyVo.getDayStudyList()) {
                     if (Arrays.asList(bo.getStudyCount()).contains(dayStudyVo.getStudyDay())){
-                        if (allNum.equals(0)){
+                        if (allNum < 0){
                             break;
                         }
-                        allNum -= Sec;
+                        Calendar c5 = Calendar.getInstance();
+                        c.setTime(new Date(bo.getStartTime()));
+                        if (dayStudyVo.getDate() <= c5.get(Calendar.DAY_OF_MONTH) && clCalendarStudyVo.getMonth() == (c5.get(Calendar.MONTH) + 1) && clCalendarStudyVo.getYear() == (c5.get(Calendar.YEAR))){
+                            continue;
+                        }
+
                         if (dayStudyVo.getStudyCourseKnob() != null) {
-                            dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
+                            if (allNum < Sec) {
+                                dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + allNum);
+                            } else{
+                                dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
+                            }
                         }else {
-                            dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
+                            if (allNum < Sec) {
+                                dayStudyVo.setStudyCourseKnob(allNum);
+                            } else {
+                                dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
+                            }
                         }
+
                         dayStudyVo.setPerform(0);
                         List<DaySectionVo> daySectionList = new ArrayList<>();
                         if (!CollectionUtils.isEmpty(dayStudyVo.getDaySectionList())) {
@@ -283,10 +379,16 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
                         }
                         DaySectionVo daySectionVo = new DaySectionVo();
                         daySectionVo.setGoodsId(aLong);
-                        daySectionVo.setStudyGoodsKnob(Convert.toLong(Sec));
+                        if (allNum < Sec) {
+                            daySectionVo.setStudyGoodsKnob(Convert.toLong(allNum));
+                        } else{
+                            daySectionVo.setStudyGoodsKnob(Convert.toLong(Sec));
+                        }
+
                         daySectionVo.setGoodsPerform(0);
                         daySectionList.add(daySectionVo);
                         dayStudyVo.setDaySectionList(daySectionList);
+                        allNum -= Sec;
 
                     }
                 }
@@ -344,7 +446,34 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
     @Override
     public UserPlanVo listPlan(UserPlanEditBo bo) throws ParseException {
         UserPlanVo userPlanVo = new UserPlanVo();
-        List<CalendarStudyVo> clCalendarStudyVos = findDates(bo.getStartTime(),bo.getEndTime());
+        Calendar c = Calendar.getInstance();
+        c.setTime(new Date(bo.getStartTime()*1000));
+
+        //设置为1号,当前日期既为本月第一天
+        c.set(Calendar.DAY_OF_MONTH, 1);
+        //将小时至0
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        //将分钟至0
+        c.set(Calendar.MINUTE, 0);
+        //将秒至0
+        c.set(Calendar.SECOND,0);
+        //将毫秒至0
+        c.set(Calendar.MILLISECOND, 0);
+
+        Calendar c1 = Calendar.getInstance();
+        c1.setTime(new Date(bo.getEndTime()*1000));
+        //设置为当月最后一天
+        c1.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
+        //将小时至23
+        c1.set(Calendar.HOUR_OF_DAY, 23);
+        //将分钟至59
+        c1.set(Calendar.MINUTE, 59);
+        //将秒至59
+        c1.set(Calendar.SECOND,59);
+        //将毫秒至999
+        c1.set(Calendar.MILLISECOND, 999);
+
+        List<CalendarStudyVo> clCalendarStudyVos = findDates(c.getTimeInMillis()/1000,c1.getTimeInMillis()/1000);
         Long secAll = 0L;
         for (Long aLong : bo.getGoodsId()) {
             //最近考试时间七天前到现在的天数,学习视频时长
@@ -365,15 +494,29 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             for (CalendarStudyVo clCalendarStudyVo : clCalendarStudyVos) {
                 for (DayStudyVo dayStudyVo : clCalendarStudyVo.getDayStudyList()) {
                     if (Arrays.asList(bo.getStudyCount()).contains(dayStudyVo.getStudyDay())){
-                        if (allNum.equals(0)){
+                        if (allNum < 0){
                             break;
                         }
-                        allNum -= Sec;
+                        Calendar c5 = Calendar.getInstance();
+                        c.setTime(new Date(bo.getStartTime()));
+                        if (dayStudyVo.getDate() <= c5.get(Calendar.DAY_OF_MONTH) && clCalendarStudyVo.getMonth() == (c5.get(Calendar.MONTH) + 1) && clCalendarStudyVo.getYear() == (c5.get(Calendar.YEAR))){
+                            continue;
+                        }
+
                         if (dayStudyVo.getStudyCourseKnob() != null) {
-                            dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
+                            if (allNum < Sec) {
+                                dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + allNum);
+                            } else{
+                                dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
+                            }
                         }else {
-                            dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
+                            if (allNum < Sec) {
+                                dayStudyVo.setStudyCourseKnob(allNum);
+                            } else {
+                                dayStudyVo.setStudyCourseKnob(Convert.toLong(Sec));
+                            }
                         }
+
                         dayStudyVo.setPerform(0);
                         List<DaySectionVo> daySectionList = new ArrayList<>();
                         if (!CollectionUtils.isEmpty(dayStudyVo.getDaySectionList())) {
@@ -381,10 +524,16 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
                         }
                         DaySectionVo daySectionVo = new DaySectionVo();
                         daySectionVo.setGoodsId(aLong);
-                        daySectionVo.setStudyGoodsKnob(Convert.toLong(Sec));
+                        if (allNum < Sec) {
+                            daySectionVo.setStudyGoodsKnob(Convert.toLong(allNum));
+                        } else{
+                            daySectionVo.setStudyGoodsKnob(Convert.toLong(Sec));
+                        }
+
                         daySectionVo.setGoodsPerform(0);
                         daySectionList.add(daySectionVo);
                         dayStudyVo.setDaySectionList(daySectionList);
+                        allNum -= Sec;
 
                     }
                 }
@@ -420,8 +569,6 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
         List<DayStudyVo> dayStudyList = new ArrayList<>();
         // 每次循环给calBegin日期加一天,直到calBegin.getTime()时间等于dEnd
         while (format.parse(dEndS).after(calBegin.getTime()))  {
-            // 根据日历的规则,为给定的日历字段添加或减去指定的时间量
-            calBegin.add(Calendar.DAY_OF_MONTH, 1);
             if (calendarStudyVo.getMonth() == null){
                 calendarStudyVo.setMonth(Convert.toLong(calBegin.get(java.util.Calendar.MONTH)+1));
                 calendarStudyVo.setYear(Convert.toLong(calBegin.get(java.util.Calendar.YEAR)));
@@ -438,10 +585,11 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             dayStudyVo.setDate(Convert.toLong(calBegin.get(Calendar.DATE)));
             dayStudyVo.setStudyDay(Convert.toLong(calBegin.get(Calendar.DAY_OF_WEEK)-1));
             dayStudyList.add(dayStudyVo);
+            // 根据日历的规则,为给定的日历字段添加或减去指定的时间量
+            calBegin.add(Calendar.DAY_OF_MONTH, 1);
         }
         calendarStudyVo.setDayStudyList(dayStudyList);
         Datelist.add(calendarStudyVo);
-        System.out.println(Datelist);
         return Datelist;
     }