|
@@ -49,6 +49,7 @@ import java.math.BigDecimal;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
@@ -85,6 +86,8 @@ public class ApplicationPrimaryController {
|
|
private WechatConfig wechatConfig;
|
|
private WechatConfig wechatConfig;
|
|
@Autowired
|
|
@Autowired
|
|
private ApportionDetailService apportionDetailService;
|
|
private ApportionDetailService apportionDetailService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private NewsInfoService newsInfoService;
|
|
|
|
|
|
@ApiOperation(value="创建空记录")
|
|
@ApiOperation(value="创建空记录")
|
|
@GetMapping("create")
|
|
@GetMapping("create")
|
|
@@ -1038,9 +1041,17 @@ public class ApplicationPrimaryController {
|
|
public MessageResult<ApprovalInfo> fore(String id,String remark,String fileUrl,@RequestAttribute String subject){
|
|
public MessageResult<ApprovalInfo> fore(String id,String remark,String fileUrl,@RequestAttribute String subject){
|
|
//当前用户ID
|
|
//当前用户ID
|
|
System.out.println(subject);
|
|
System.out.println(subject);
|
|
|
|
+ User user = userService.get(subject);
|
|
MessageResult<ApprovalInfo> msgResult = new MessageResult<>();
|
|
MessageResult<ApprovalInfo> msgResult = new MessageResult<>();
|
|
|
|
|
|
try {
|
|
try {
|
|
|
|
+
|
|
|
|
+ //1分钟限制
|
|
|
|
+// boolean repeat = valueOperations.setIfAbsent("out_" + telephone,true,1, TimeUnit.MINUTES);
|
|
|
|
+// if(!repeat){
|
|
|
|
+// throw new Exception("操作过于频繁!");
|
|
|
|
+// }
|
|
|
|
+
|
|
ApplicationPrimary applicationPrimary = applicationPrimaryService.get(id);
|
|
ApplicationPrimary applicationPrimary = applicationPrimaryService.get(id);
|
|
|
|
|
|
ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
@@ -1105,7 +1116,9 @@ public class ApplicationPrimaryController {
|
|
} else {
|
|
} else {
|
|
applicationPrimary.setStatus(String.valueOf(Integer.parseInt(applicationPrimary.getStatus()) + 10));
|
|
applicationPrimary.setStatus(String.valueOf(Integer.parseInt(applicationPrimary.getStatus()) + 10));
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
|
|
+ } else if("5".equals(applicationPrimary.getStatus())){
|
|
|
|
+ throw new Exception("已退回的无法操作");
|
|
|
|
+ }else {
|
|
applicationPrimary.setStatus(String.valueOf(Integer.parseInt(applicationPrimary.getStatus()) + 10));
|
|
applicationPrimary.setStatus(String.valueOf(Integer.parseInt(applicationPrimary.getStatus()) + 10));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1114,11 +1127,42 @@ public class ApplicationPrimaryController {
|
|
applicationPrimary.setUpdateTime(new Date());
|
|
applicationPrimary.setUpdateTime(new Date());
|
|
applicationPrimaryService.update(applicationPrimary);
|
|
applicationPrimaryService.update(applicationPrimary);
|
|
|
|
|
|
|
|
+
|
|
|
|
+// new Thread(() -> {
|
|
|
|
+// try {
|
|
|
|
+// String statusN = "";
|
|
|
|
+//
|
|
|
|
+// //当前要-10
|
|
|
|
+// if("20".equals(applicationPrimary.getStatus())){
|
|
|
|
+// //20-10 待现场复审 A类7月12-13日 C类14-15日
|
|
|
|
+// if ("A".equals(applicationPrimary.getType()) ) {
|
|
|
|
+// statusN = "初审,请于7月12日,13日携材料到学校复审!";
|
|
|
|
+// }else if("C".equals(applicationPrimary.getType()) ){
|
|
|
|
+// statusN = "初审,请于7月14日,15日携材料到学校复审!";
|
|
|
|
+// }
|
|
|
|
+// }else if("30".equals(applicationPrimary.getStatus())){
|
|
|
|
+// //30-10 待校长复审
|
|
|
|
+// statusN = "现场复审,请等待后续审批!";
|
|
|
|
+// }else if("40".equals(applicationPrimary.getStatus())){
|
|
|
|
+// //待审定
|
|
|
|
+// statusN = "校长复审,请等待后续审批!";
|
|
|
|
+// }else if("50".equals(applicationPrimary.getStatus())){
|
|
|
|
+// //预录取待确认
|
|
|
|
+// statusN = "招生办审定,请等待后续审批!";
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// String content = "通过" + statusN;
|
|
|
|
+// sendMessage(content, applicationPrimary.getPersonId(),user.getRealName());
|
|
|
|
+// } catch (Exception ex) {
|
|
|
|
+// ex.printStackTrace();
|
|
|
|
+// }
|
|
|
|
+// }).start();
|
|
|
|
+
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
msgResult.setData(approvalInfo);
|
|
msgResult.setData(approvalInfo);
|
|
} else {
|
|
} else {
|
|
msgResult.setResult(false);
|
|
msgResult.setResult(false);
|
|
- msgResult.setMessage("数据库添加失败");
|
|
|
|
|
|
+ msgResult.setMessage("操作失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch(Exception ex){
|
|
catch(Exception ex){
|
|
@@ -1537,8 +1581,8 @@ public class ApplicationPrimaryController {
|
|
ApplicationPrimary applicationPrimary = applicationPrimaryService.get(id);
|
|
ApplicationPrimary applicationPrimary = applicationPrimaryService.get(id);
|
|
PersonInfo personInfo = personInfoService.get(applicationPrimary.getPersonId());
|
|
PersonInfo personInfo = personInfoService.get(applicationPrimary.getPersonId());
|
|
boolean messageResult = WechatMessageUtil.sendMessageTemplate(
|
|
boolean messageResult = WechatMessageUtil.sendMessageTemplate(
|
|
- user.getUserName(),message,
|
|
|
|
- "",sendDate,personInfo.getOpenId(),
|
|
|
|
|
|
+ user.getRealName(),message,
|
|
|
|
+ "",sendDate,personInfo.getOpenId(),
|
|
wechatConfig.getBackNoticeTemplateId(),
|
|
wechatConfig.getBackNoticeTemplateId(),
|
|
wechatConfig.getTokenUrl(),
|
|
wechatConfig.getTokenUrl(),
|
|
appId,appSecret);
|
|
appId,appSecret);
|
|
@@ -1562,6 +1606,67 @@ public class ApplicationPrimaryController {
|
|
return msgResult;
|
|
return msgResult;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value="发送新闻微信消息")
|
|
|
|
+ @RequestMapping(value = "sendNewsWechatMessage",method = RequestMethod.POST)
|
|
|
|
+ public MessageResult<Integer> sendNewsWechatMessage(
|
|
|
|
+ String idList,
|
|
|
|
+ String message,
|
|
|
|
+ @RequestAttribute String subject){
|
|
|
|
+ //当前用户ID
|
|
|
|
+ System.out.println(subject);
|
|
|
|
+ MessageResult<Integer> msgResult = new MessageResult<>();
|
|
|
|
+ User user = userService.get(subject);
|
|
|
|
+ try {
|
|
|
|
+ String appId = wechatConfig.getAppId();
|
|
|
|
+ String appSecret = wechatConfig.getAppSecret();
|
|
|
|
+ String []ids = idList.split(",");
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ String sendDate = sdf.format(new Date());
|
|
|
|
+ int messageNum = 0;
|
|
|
|
+
|
|
|
|
+ NewsInfo news = new NewsInfo();
|
|
|
|
+ news.setId(UUID.randomUUID().toString());
|
|
|
|
+ news.setContent(message);
|
|
|
|
+ news.setDelFlag(false);
|
|
|
|
+ news.setCreateBy(subject);
|
|
|
|
+ news.setCreateTime(new Date());
|
|
|
|
+ news.setStatus("0");
|
|
|
|
+ news.setSortNo(10000);
|
|
|
|
+ news.setTitle("公告消息");
|
|
|
|
+ news.setType("4");
|
|
|
|
+ news.setLogo("http://admission-46879.oss-cn-hangzhou.aliyuncs.com/upload/school/2022/5/13161428461.jpg");
|
|
|
|
+ newsInfoService.insert(news);
|
|
|
|
+ String url = "http://wsbm.xiaoxinda.com/#/news/info?id=" + news.getId();
|
|
|
|
+
|
|
|
|
+ for(String id: ids){
|
|
|
|
+ ApplicationPrimary applicationPrimary = applicationPrimaryService.get(id);
|
|
|
|
+ PersonInfo personInfo = personInfoService.get(applicationPrimary.getPersonId());
|
|
|
|
+ boolean messageResult = WechatMessageUtil.sendNewsMessageTemplate(
|
|
|
|
+ user.getRealName(),message,
|
|
|
|
+ "",sendDate,personInfo.getOpenId(),
|
|
|
|
+ wechatConfig.getBackNoticeTemplateId(),
|
|
|
|
+ wechatConfig.getTokenUrl(),
|
|
|
|
+ appId,appSecret,url);
|
|
|
|
+ if(messageResult){
|
|
|
|
+ applicationPrimary.setIsSend(true);
|
|
|
|
+ applicationPrimary.setSendTime(new Date());
|
|
|
|
+ applicationPrimaryService.update(applicationPrimary);
|
|
|
|
+ messageNum ++ ;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ msgResult.setResult(true);
|
|
|
|
+ msgResult.setData(messageNum);
|
|
|
|
+ }
|
|
|
|
+ catch(Exception ex){
|
|
|
|
+ logger.error(ex.getMessage(),ex);
|
|
|
|
+
|
|
|
|
+ msgResult.setResult(false);
|
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
|
+ }
|
|
|
|
+ return msgResult;
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation(value="调剂")
|
|
@ApiOperation(value="调剂")
|
|
@RequestMapping(value = "tjPrimary",method = RequestMethod.POST)
|
|
@RequestMapping(value = "tjPrimary",method = RequestMethod.POST)
|
|
public MessageResult<Integer> tjPrimary(
|
|
public MessageResult<Integer> tjPrimary(
|
|
@@ -1668,7 +1773,8 @@ public class ApplicationPrimaryController {
|
|
offerInfoService.insert(off);
|
|
offerInfoService.insert(off);
|
|
new Thread(() -> {
|
|
new Thread(() -> {
|
|
try {
|
|
try {
|
|
- String content = "尊敬的家长您好,您的报名申请已通过,请前往“荆州开发区网上入学”--报名查询,下载电子版入学通知书。";
|
|
|
|
|
|
+ //String content = "您的报名申请已通过,请前往“荆州开发区网上入学”--报名查询,下载电子版入学通知书。";
|
|
|
|
+ String content = "学生已经被录取,请前往报名查询,下载电子版入学通知书。";
|
|
sendMessage(content, applicationPrimary.getPersonId(),user.getRealName());
|
|
sendMessage(content, applicationPrimary.getPersonId(),user.getRealName());
|
|
} catch (Exception ex) {
|
|
} catch (Exception ex) {
|
|
ex.printStackTrace();
|
|
ex.printStackTrace();
|
|
@@ -1897,7 +2003,9 @@ public class ApplicationPrimaryController {
|
|
applicationPrimary.setOfferImg(uploadUrl);
|
|
applicationPrimary.setOfferImg(uploadUrl);
|
|
new Thread(() -> {
|
|
new Thread(() -> {
|
|
try {
|
|
try {
|
|
- String content = "尊敬的家长您好,您的报名申请已通过,请前往“荆州开发区网上入学”--报名查询,下载电子版入学通知书。";
|
|
|
|
|
|
+ //String content = "尊敬的家长您好,您的报名申请已通过,请前往“荆州开发区网上入学”--报名查询,下载电子版入学通知书。";
|
|
|
|
+ //报名申请已通过招生办审定,请等待后续审批!
|
|
|
|
+ String content = "学生已经被录取,请前往报名查询,下载电子版入学通知书。";
|
|
sendMessage(content, applicationPrimary.getPersonId(),user.getRealName());
|
|
sendMessage(content, applicationPrimary.getPersonId(),user.getRealName());
|
|
} catch (Exception ex) {
|
|
} catch (Exception ex) {
|
|
ex.printStackTrace();
|
|
ex.printStackTrace();
|
|
@@ -2401,17 +2509,19 @@ public class ApplicationPrimaryController {
|
|
HSSFCell cellTitle5 = rowTitle.createCell(4);
|
|
HSSFCell cellTitle5 = rowTitle.createCell(4);
|
|
cellTitle5.setCellValue("学生姓名");
|
|
cellTitle5.setCellValue("学生姓名");
|
|
HSSFCell cellTitle6 = rowTitle.createCell(5);
|
|
HSSFCell cellTitle6 = rowTitle.createCell(5);
|
|
- cellTitle6.setCellValue("证件号码");
|
|
|
|
|
|
+ cellTitle6.setCellValue("性别");
|
|
HSSFCell cellTitle7 = rowTitle.createCell(6);
|
|
HSSFCell cellTitle7 = rowTitle.createCell(6);
|
|
- cellTitle7.setCellValue("申请时间");
|
|
|
|
|
|
+ cellTitle7.setCellValue("证件号码");
|
|
HSSFCell cellTitle8 = rowTitle.createCell(7);
|
|
HSSFCell cellTitle8 = rowTitle.createCell(7);
|
|
- cellTitle8.setCellValue("登记人姓名");
|
|
|
|
|
|
+ cellTitle8.setCellValue("申请时间");
|
|
HSSFCell cellTitle9 = rowTitle.createCell(8);
|
|
HSSFCell cellTitle9 = rowTitle.createCell(8);
|
|
- cellTitle9.setCellValue("联系电话");
|
|
|
|
|
|
+ cellTitle9.setCellValue("登记人姓名");
|
|
HSSFCell cellTitle10 = rowTitle.createCell(9);
|
|
HSSFCell cellTitle10 = rowTitle.createCell(9);
|
|
- cellTitle10.setCellValue("学生地址");
|
|
|
|
|
|
+ cellTitle10.setCellValue("联系电话");
|
|
HSSFCell cellTitle11 = rowTitle.createCell(10);
|
|
HSSFCell cellTitle11 = rowTitle.createCell(10);
|
|
- cellTitle11.setCellValue("插班生报名年级");
|
|
|
|
|
|
+ cellTitle11.setCellValue("学生地址");
|
|
|
|
+ HSSFCell cellTitle12 = rowTitle.createCell(11);
|
|
|
|
+ cellTitle12.setCellValue("插班生报名年级");
|
|
|
|
|
|
// int maxColumn = sheet.getRow(0).getPhysicalNumberOfCells();
|
|
// int maxColumn = sheet.getRow(0).getPhysicalNumberOfCells();
|
|
// for(int i = 1; i < maxColumn; i++) {
|
|
// for(int i = 1; i < maxColumn; i++) {
|
|
@@ -2424,20 +2534,21 @@ public class ApplicationPrimaryController {
|
|
sheet.setColumnWidth(3, 15 * 256);
|
|
sheet.setColumnWidth(3, 15 * 256);
|
|
sheet.setColumnWidth(4, 15 * 256);
|
|
sheet.setColumnWidth(4, 15 * 256);
|
|
sheet.setColumnWidth(5, 25 * 256);
|
|
sheet.setColumnWidth(5, 25 * 256);
|
|
- sheet.setColumnWidth(6, 20 * 256);
|
|
|
|
- sheet.setColumnWidth(7, 15 * 256);
|
|
|
|
- sheet.setColumnWidth(8, 20 * 256);
|
|
|
|
- sheet.setColumnWidth(9, 40 * 256);
|
|
|
|
- sheet.setColumnWidth(10, 20 * 256);
|
|
|
|
|
|
+ sheet.setColumnWidth(6, 15 * 256);
|
|
|
|
+ sheet.setColumnWidth(7, 20 * 256);
|
|
|
|
+ sheet.setColumnWidth(8, 15 * 256);
|
|
|
|
+ sheet.setColumnWidth(9, 20 * 256);
|
|
|
|
+ sheet.setColumnWidth(10, 40 * 256);
|
|
|
|
+ sheet.setColumnWidth(11, 20 * 256);
|
|
|
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
List<Sort> sortList = new ArrayList<>();
|
|
sortList.add(new Sort("a.school_id","asc"));
|
|
sortList.add(new Sort("a.school_id","asc"));
|
|
sortList.add(new Sort("a.type_","asc"));
|
|
sortList.add(new Sort("a.type_","asc"));
|
|
- sortList.add(new Sort("a.category_id","desc"));
|
|
|
|
|
|
+ //sortList.add(new Sort("a.category_id","desc"));
|
|
sortList.add(new Sort("a.offer_code","asc"));
|
|
sortList.add(new Sort("a.offer_code","asc"));
|
|
- sortList.add(new Sort("a.create_time","desc"));
|
|
|
|
|
|
+ //sortList.add(new Sort("a.create_time","desc"));
|
|
|
|
|
|
if (StringUtils.isNotEmpty(tabStatus)) {
|
|
if (StringUtils.isNotEmpty(tabStatus)) {
|
|
searchParams.put("tabStatus",tabStatus);
|
|
searchParams.put("tabStatus",tabStatus);
|
|
@@ -2543,27 +2654,30 @@ public class ApplicationPrimaryController {
|
|
// "学生姓名"
|
|
// "学生姓名"
|
|
HSSFCell cellContent5 = rowContent.createCell(4);
|
|
HSSFCell cellContent5 = rowContent.createCell(4);
|
|
cellContent5.setCellValue(apDTO.getName());
|
|
cellContent5.setCellValue(apDTO.getName());
|
|
-// "证件号码"
|
|
|
|
|
|
+ // "性别"
|
|
HSSFCell cellContent6 = rowContent.createCell(5);
|
|
HSSFCell cellContent6 = rowContent.createCell(5);
|
|
- cellContent6.setCellValue(apDTO.getIdCard());
|
|
|
|
-// "申请时间"
|
|
|
|
|
|
+ cellContent6.setCellValue(apDTO.getSexN());
|
|
|
|
+// "证件号码"
|
|
HSSFCell cellContent7 = rowContent.createCell(6);
|
|
HSSFCell cellContent7 = rowContent.createCell(6);
|
|
|
|
+ cellContent7.setCellValue(apDTO.getIdCard());
|
|
|
|
+// "申请时间"
|
|
|
|
+ HSSFCell cellContent8 = rowContent.createCell(7);
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
- cellContent7.setCellValue(sdf.format(apDTO.getCreateTime()));
|
|
|
|
|
|
+ cellContent8.setCellValue(sdf.format(apDTO.getCreateTime()));
|
|
//"登记人姓名"
|
|
//"登记人姓名"
|
|
- HSSFCell cellContent8 = rowContent.createCell(7);
|
|
|
|
- cellContent8.setCellValue(apDTO.getPersonName());
|
|
|
|
- //联系电话
|
|
|
|
HSSFCell cellContent9 = rowContent.createCell(8);
|
|
HSSFCell cellContent9 = rowContent.createCell(8);
|
|
- cellContent9.setCellValue(apDTO.getPersonPhone());
|
|
|
|
- //"学生地址"
|
|
|
|
|
|
+ cellContent9.setCellValue(apDTO.getPersonName());
|
|
|
|
+ //联系电话
|
|
HSSFCell cellContent10 = rowContent.createCell(9);
|
|
HSSFCell cellContent10 = rowContent.createCell(9);
|
|
- cellContent10.setCellValue(apDTO.getAddress());
|
|
|
|
|
|
+ cellContent10.setCellValue(apDTO.getPersonPhone());
|
|
|
|
+ //"学生地址"
|
|
|
|
+ HSSFCell cellContent11 = rowContent.createCell(10);
|
|
|
|
+ cellContent11.setCellValue(apDTO.getAddress());
|
|
|
|
|
|
//插班转学录取年级
|
|
//插班转学录取年级
|
|
- HSSFCell cellContent11 = rowContent.createCell(10);
|
|
|
|
|
|
+ HSSFCell cellContent12 = rowContent.createCell(11);
|
|
if(apDTO.getSchoolNumber() != null) {
|
|
if(apDTO.getSchoolNumber() != null) {
|
|
- cellContent11.setCellValue(apDTO.getSchoolNumber().getGradeStr());
|
|
|
|
|
|
+ cellContent12.setCellValue(apDTO.getSchoolNumber().getGradeStr());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|