shenhao 2 years ago
parent
commit
999a618c34

+ 1 - 1
src/main/java/com/ssj/dao/weixin/zuoyb/dao/impl/ZuoybQueryDaoImpl.java

@@ -1254,7 +1254,7 @@ public class ZuoybQueryDaoImpl  implements ZuoybQueryDao{
 		if(banben != null && banben>0){
 			j++;
 		}
-		selSQL.append("SELECT t.course_name,  t.id, ");
+		selSQL.append("SELECT DISTINCT t.course_name,  t.id, ");
 		if(j>0){
 			selSQL.append(" s1.alias as `name`,s1.num,s1.module, date_format(s1.`create_time`,'%Y-%m-%d %H:%i') as  create_time, ");
 			selSQL.append(" s2.alias as detail_name,t11.memorize,t11.understanding,t11.apply,t11.duration,t11.id as detail_id,s2.two_module,  ");

+ 17 - 0
src/main/java/com/ssj/service/sys/fx/service/impl/MerchantMealServiceImpl.java

@@ -249,6 +249,23 @@ public class MerchantMealServiceImpl extends BaseServiceImpl<MerchantMeal, Strin
 		}
 	}
 
+	public static void main(String[] args) {
+		String startActiveTime="2022-07-26";
+		String endActiveTime="2022-08-26";
+		Date signTime=DateHelper.parseDate(startActiveTime, "yyyy-MM-dd");
+		Date endSignTime=DateHelper.getYesToday(DateHelper.getMonthDate(signTime,1),-1) ;
+		System.out.println(endSignTime);
+		int month = 1;
+		for(int i=1;i<=month;i++){
+			if(month==i) {
+				System.out.println("month--->"+i+"---"+DateHelper.parseDate(endActiveTime, "yyyy-MM-dd"));
+			}else {
+				System.out.println("month--->"+i+"---"+endSignTime);
+			}
+			signTime=endSignTime;
+			endSignTime=DateHelper.getMonthDate(signTime,1);
+		}
+	}
 	@Override
 	@Transactional
 	public void saveMerchantMealSC(String merchantId, Integer signType, Integer libService, String startActiveTime,String endActiveTime,Double unitPrice, Double price,String agentId,String orderNo) {

+ 28 - 18
src/main/java/com/ssj/sys/controller/SysZuoybController.java

@@ -13,6 +13,7 @@ import com.ssj.bean.weixin.zyb.domain.*;
 import com.ssj.framework.basic.common.bean.SplitPage;
 import com.ssj.framework.basic.config.bean.VersionConfig;
 import com.ssj.framework.core.common.controller.BaseController;
+import com.ssj.framework.core.security.manager.TokenManager;
 import com.ssj.framework.core.util.StringUtil;
 import com.ssj.framework.core.util.SystemResourceLocator;
 import com.ssj.service.sys.sort.service.SortService;
@@ -113,6 +114,10 @@ public class SysZuoybController extends BaseController {
 	private  ZuoybKnowHowDetailsSortService   zuoybKnowHowDetailsSortService;
 	@Autowired
 	private  ZuoybKnowHowDetailsKdService   zuoybKnowHowDetailsKdService;
+
+	@Autowired
+	private TokenManager tokenManager;
+
 	/**
 	 *
 	 * 基础数据入口
@@ -2282,7 +2287,8 @@ public class SysZuoybController extends BaseController {
 							   @RequestParam(required = false, defaultValue = "SSJ") String EQ_libId
 
 	) throws IOException{
-
+		String key = loginName()+"_endFlag";
+		tokenManager.setString(key,"0");
 		Map<String, Object> params = new HashMap<String, Object>();
 		String EQ_courseName = request.getParameter("EQ_courseName")==null?"":request.getParameter("EQ_courseName");
 		String EQ_grade = request.getParameter("EQ_grade")==null?"":request.getParameter("EQ_grade");
@@ -2297,7 +2303,6 @@ public class SysZuoybController extends BaseController {
 		if(semester != null && !"".equals(semester)){
 			fileName.append(semester.equals("1")?"上学期":"下学期");
 		}
-		request.getSession().removeAttribute("endFlag");//每次导入前,清除结束标记
 		params.put("EQ_libId", EQ_libId);
 		params.put("LIKE_name",request.getParameter("LIKE_name")==null?"":request.getParameter("LIKE_name"));
 		params.put("EQ_grade",request.getParameter("EQ_grade")==null?"":request.getParameter("EQ_grade"));//年级
@@ -2353,7 +2358,7 @@ public class SysZuoybController extends BaseController {
 				excelWriter.finish();
 			}
 			//设置结束标记
-			request.getSession().setAttribute("endFlag", "1");
+			tokenManager.setString(key,"1");
 		}
 	}
 
@@ -2379,7 +2384,8 @@ public class SysZuoybController extends BaseController {
 
 	) throws Exception {
 		Map<String, Object> params = new HashMap<String, Object>();
-		request.getSession().removeAttribute("endFlag");//每次导入前,清除结束标记
+		String key = loginName()+"_endFlag";
+		tokenManager.setString(key,"0");
 		StringBuffer fileName =new StringBuffer("知识点");
 		if(EQ_courseName != null){
 			fileName.append(EQ_courseName);
@@ -2437,7 +2443,7 @@ public class SysZuoybController extends BaseController {
                 excelWriter.finish();
             }
 			//设置结束标记
-			request.getSession().setAttribute("endFlag", "1");
+			tokenManager.setString(key,"1");
         }
 	}
 
@@ -2452,6 +2458,19 @@ public class SysZuoybController extends BaseController {
 		return reList;
 	}
 
+	@RequestMapping(value = "/getEndFlag", method = RequestMethod.POST)
+	@ResponseBody
+	public Response getEndFlag(HttpServletRequest request, HttpServletResponse response){
+		Response responseEntity = new Response();
+		//获取结束标记*/
+		String key = loginName()+"_endFlag";
+		String flag = tokenManager.getString(key);
+		Map<String,Object> data = new HashMap<>();
+		data.put("flag",flag);
+		responseEntity.success(data);
+		return  responseEntity;
+	}
+
 	@RequestMapping(value = "/exportHowDetailsKdExcel", method = RequestMethod.POST)
 	@ResponseBody
 	public void exportHowDetailsKdExcel(HttpServletRequest request, HttpServletResponse response,
@@ -2464,7 +2483,8 @@ public class SysZuoybController extends BaseController {
 
 	) throws Exception {
 		Map<String, Object> params = new HashMap<String, Object>();
-		request.getSession().removeAttribute("endFlag");//每次导入前,清除结束标记
+		String key = loginName()+"_endFlag";
+		tokenManager.setString(key,"0");
 		StringBuffer fileName =new StringBuffer("考点");
 		if(EQ_courseName != null){
 			fileName.append(EQ_courseName);
@@ -2512,7 +2532,7 @@ public class SysZuoybController extends BaseController {
 				excelWriter.finish();
 			}
 			//设置结束标记
-			request.getSession().setAttribute("endFlag", "1");
+			tokenManager.setString(key,"1");
 		}
 	}
 
@@ -2560,15 +2580,5 @@ public class SysZuoybController extends BaseController {
 		cell.setCellStyle(style);
 	}
 
-	@RequestMapping(value = "/getEndFlag", method = RequestMethod.POST)
-	@ResponseBody
-	private Response getEndFlag(HttpServletRequest request, HttpServletResponse response){
-		Response responseEntity = new Response();
-		//获取结束标记*/
-		Object flag = request.getSession().getAttribute("endFlag");
-		Map<String,Object> data = new HashMap<>();
-		data.put("flag",flag);
-		responseEntity.success(data);
-		return  responseEntity;
-	}
+
 }

+ 2 - 1
src/main/resources/templates/sys/zuoyb/knowHowList.html

@@ -294,6 +294,7 @@ $("#button").on('click',function(){
 });
 var msg ;
 function startexport(url){
+	$("#txtendflag").val("0");
 	 msg = layer.msg('下载中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: '0px',time: 0});
 	// msg.show();
 	var seachform = document.querySelector("#seachform").innerHTML;
@@ -326,7 +327,7 @@ function listenEnd() {//定时监听
 		} else {
 			getEndFlag();
 		}
-	}, 1000);//单位毫秒  注意:如果导出页面很慢时,建议循环时间段稍长一点
+	}, 3000);//单位毫秒  注意:如果导出页面很慢时,建议循环时间段稍长一点
 }
 
 function getEndFlag() {