|
@@ -19,8 +19,6 @@ import com.jpsoft.campus.modules.sys.entity.User;
|
|
import com.jpsoft.campus.modules.sys.service.DataDictionaryService;
|
|
import com.jpsoft.campus.modules.sys.service.DataDictionaryService;
|
|
import com.jpsoft.campus.modules.sys.service.UserRoleService;
|
|
import com.jpsoft.campus.modules.sys.service.UserRoleService;
|
|
import com.jpsoft.campus.modules.sys.service.UserService;
|
|
import com.jpsoft.campus.modules.sys.service.UserService;
|
|
-import com.sun.image.codec.jpeg.JPEGCodec;
|
|
|
|
-import com.sun.image.codec.jpeg.JPEGImageEncoder;
|
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -1348,11 +1346,16 @@ public class ApplicationMiddleController {
|
|
|
|
|
|
try {
|
|
try {
|
|
ApplicationMiddle applicationMiddle = applicationMiddleService.get(id);
|
|
ApplicationMiddle applicationMiddle = applicationMiddleService.get(id);
|
|
|
|
+ User user = userService.get(subject);
|
|
|
|
|
|
ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
approvalInfo.setId(UUID.randomUUID().toString());
|
|
approvalInfo.setId(UUID.randomUUID().toString());
|
|
approvalInfo.setApplicationId(id);
|
|
approvalInfo.setApplicationId(id);
|
|
- approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("中学招生审核流程",applicationMiddle.getStatus())+":" + typeValue);
|
|
|
|
|
|
+ if("90".equals(status)) {
|
|
|
|
+ approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("中学招生审核流程",applicationMiddle.getStatus()));
|
|
|
|
+ }else{
|
|
|
|
+ approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("中学招生审核流程",applicationMiddle.getStatus())+":" + typeValue);
|
|
|
|
+ }
|
|
approvalInfo.setRemark(remark);
|
|
approvalInfo.setRemark(remark);
|
|
approvalInfo.setFileUrl("");
|
|
approvalInfo.setFileUrl("");
|
|
approvalInfo.setDelFlag(false);
|
|
approvalInfo.setDelFlag(false);
|
|
@@ -1393,24 +1396,32 @@ public class ApplicationMiddleController {
|
|
off.setEnrollmentType("2");//中学
|
|
off.setEnrollmentType("2");//中学
|
|
off.setSchoolId(applicationMiddle.getSchoolId());
|
|
off.setSchoolId(applicationMiddle.getSchoolId());
|
|
off.setSerialNum(serialNum);
|
|
off.setSerialNum(serialNum);
|
|
-
|
|
|
|
off.setCode(code);
|
|
off.setCode(code);
|
|
- off.setDelFlag(false);
|
|
|
|
- off.setCreateBy(subject);
|
|
|
|
- off.setCreateTime(new Date());
|
|
|
|
- offerInfoService.insert(off);
|
|
|
|
|
|
|
|
applicationMiddle.setOfferCode(code);
|
|
applicationMiddle.setOfferCode(code);
|
|
|
|
|
|
- applicationMiddle.setOfferCode(code);
|
|
|
|
SchoolInfo schoolInfo = schoolInfoService.get(applicationMiddle.getSchoolId());
|
|
SchoolInfo schoolInfo = schoolInfoService.get(applicationMiddle.getSchoolId());
|
|
PersonInfo personInfo = personInfoService.get(applicationMiddle.getPersonId());
|
|
PersonInfo personInfo = personInfoService.get(applicationMiddle.getPersonId());
|
|
StudentInfo studentInfo = studentInfoService.get(applicationMiddle.getStudentId());
|
|
StudentInfo studentInfo = studentInfoService.get(applicationMiddle.getStudentId());
|
|
String bdUrl = toPressText(code,personInfo.getName(),studentInfo.getName(), schoolInfo.getName());
|
|
String bdUrl = toPressText(code,personInfo.getName(),studentInfo.getName(), schoolInfo.getName());
|
|
String uploadUrl = uploadImg(bdUrl);
|
|
String uploadUrl = uploadImg(bdUrl);
|
|
- applicationMiddle.setOfferImg(uploadUrl);
|
|
|
|
- String content = "尊敬的家长您好,您的报名申请已通过。关注“荆州开发区网上入学”--报名查询,我们将于近期推送电子版入学通知书。";
|
|
|
|
- sendMessage(content,applicationMiddle.getPersonId());
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(uploadUrl)) {
|
|
|
|
+ off.setDelFlag(false);
|
|
|
|
+ off.setCreateBy(subject);
|
|
|
|
+ off.setCreateTime(new Date());
|
|
|
|
+ offerInfoService.insert(off);
|
|
|
|
+ applicationMiddle.setOfferImg(uploadUrl);
|
|
|
|
+ new Thread(() -> {
|
|
|
|
+ try {
|
|
|
|
+ String content = "尊敬的家长您好,您的报名申请已通过,请前往“荆州开发区网上入学”--报名查询,下载电子版入学通知书。";
|
|
|
|
+ sendMessage(content,applicationMiddle.getPersonId(),user.getRealName());
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
+ ex.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }).start();
|
|
|
|
+ }else{
|
|
|
|
+ applicationMiddle.setStatus("80");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
applicationMiddleService.update(applicationMiddle);
|
|
applicationMiddleService.update(applicationMiddle);
|
|
|
|
|
|
@@ -1549,18 +1560,14 @@ public class ApplicationMiddleController {
|
|
}else if("70".equals(applicationMiddle.getStatus())){
|
|
}else if("70".equals(applicationMiddle.getStatus())){
|
|
//微信消息推送 发送预录取通知
|
|
//微信消息推送 发送预录取通知
|
|
applicationMiddle.setStatus(nextStatus);
|
|
applicationMiddle.setStatus(nextStatus);
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- String backDate = sdf.format(new Date());
|
|
|
|
-// SchoolInfo schoolInfo = schoolInfoService.get(applicationPrimary.getSchoolId());
|
|
|
|
- String backRemark = "";
|
|
|
|
- PersonInfo pi = personInfoService.get(applicationMiddle.getPersonId());
|
|
|
|
- String appId = wechatConfig.getAppId();
|
|
|
|
- String appSecret = wechatConfig.getAppSecret();
|
|
|
|
-
|
|
|
|
- boolean messageResult = WechatMessageUtil.sendMessageTemplate(
|
|
|
|
- user.getUserName(),"尊敬的家长您好,您的报名申请已通过。关注“荆州开发区网上入学”--报名查询,我们将于近期推送电子版入学通知书。",
|
|
|
|
- backRemark,backDate,pi.getOpenId(),
|
|
|
|
- wechatConfig.getBackNoticeTemplateId(),wechatConfig.getTokenUrl(),appId,appSecret);
|
|
|
|
|
|
+// new Thread(() -> {
|
|
|
|
+// try {
|
|
|
|
+// String content = "尊敬的家长您好,您的报名申请已通过。关注“荆州开发区网上入学”--报名查询,我们将于近期推送电子版入学通知书。";
|
|
|
|
+// sendMessage(content,applicationMiddle.getPersonId(),user.getRealName());
|
|
|
|
+// } catch (Exception ex) {
|
|
|
|
+// ex.printStackTrace();
|
|
|
|
+// }
|
|
|
|
+// }).start();
|
|
}else if("80".equals(applicationMiddle.getStatus())){
|
|
}else if("80".equals(applicationMiddle.getStatus())){
|
|
//微信消息推送 发送完成录取通知
|
|
//微信消息推送 发送完成录取通知
|
|
applicationMiddle.setStatus(nextStatus);
|
|
applicationMiddle.setStatus(nextStatus);
|
|
@@ -1582,26 +1589,29 @@ public class ApplicationMiddleController {
|
|
off.setSchoolId(applicationMiddle.getSchoolId());
|
|
off.setSchoolId(applicationMiddle.getSchoolId());
|
|
off.setSerialNum(serialNum);
|
|
off.setSerialNum(serialNum);
|
|
off.setCode(code);
|
|
off.setCode(code);
|
|
- off.setDelFlag(false);
|
|
|
|
- off.setCreateBy(subject);
|
|
|
|
- off.setCreateTime(new Date());
|
|
|
|
- int oicount = offerInfoService.insert(off);
|
|
|
|
-
|
|
|
|
applicationMiddle.setOfferCode(code);
|
|
applicationMiddle.setOfferCode(code);
|
|
|
|
|
|
- if(oicount > 0) {
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- String backDate = sdf.format(new Date());
|
|
|
|
-// SchoolInfo schoolInfo = schoolInfoService.get(applicationPrimary.getSchoolId());
|
|
|
|
- String backRemark = "";
|
|
|
|
- PersonInfo pi = personInfoService.get(applicationMiddle.getPersonId());
|
|
|
|
- String appId = wechatConfig.getAppId();
|
|
|
|
- String appSecret = wechatConfig.getAppSecret();
|
|
|
|
-
|
|
|
|
- boolean messageResult = WechatMessageUtil.sendMessageTemplate(
|
|
|
|
- user.getUserName(), "尊敬的家长您好,您的报名申请已通过。关注“荆州开发区网上入学”--报名查询,我们将于近期推送电子版入学通知书。",
|
|
|
|
- backRemark, backDate, pi.getOpenId(),
|
|
|
|
- wechatConfig.getBackNoticeTemplateId(), wechatConfig.getTokenUrl(), appId, appSecret);
|
|
|
|
|
|
+ SchoolInfo schoolInfo = schoolInfoService.get(applicationMiddle.getSchoolId());
|
|
|
|
+ PersonInfo personInfo = personInfoService.get(applicationMiddle.getPersonId());
|
|
|
|
+ StudentInfo studentInfo = studentInfoService.get(applicationMiddle.getStudentId());
|
|
|
|
+ String bdUrl = toPressText(code, personInfo.getName(), studentInfo.getName(), schoolInfo.getName());
|
|
|
|
+ String uploadUrl = uploadImg(bdUrl);
|
|
|
|
+ if(StringUtils.isNotEmpty(uploadUrl)){
|
|
|
|
+ off.setDelFlag(false);
|
|
|
|
+ off.setCreateBy(subject);
|
|
|
|
+ off.setCreateTime(new Date());
|
|
|
|
+ offerInfoService.insert(off);
|
|
|
|
+ applicationMiddle.setOfferImg(uploadUrl);
|
|
|
|
+ new Thread(() -> {
|
|
|
|
+ try {
|
|
|
|
+ String content = "尊敬的家长您好,您的报名申请已通过,请前往“荆州开发区网上入学”--报名查询,下载电子版入学通知书。";
|
|
|
|
+ sendMessage(content,applicationMiddle.getPersonId(),user.getRealName());
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
+ ex.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }).start();
|
|
|
|
+ }else{
|
|
|
|
+ applicationMiddle.setStatus("80");
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
applicationMiddle.setStatus(nextStatus);
|
|
applicationMiddle.setStatus(nextStatus);
|
|
@@ -1613,7 +1623,11 @@ public class ApplicationMiddleController {
|
|
ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
ApprovalInfo approvalInfo = new ApprovalInfo();
|
|
approvalInfo.setId(UUID.randomUUID().toString());
|
|
approvalInfo.setId(UUID.randomUUID().toString());
|
|
approvalInfo.setApplicationId(applicationMiddle.getId());
|
|
approvalInfo.setApplicationId(applicationMiddle.getId());
|
|
- approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("中学招生审核流程",applicationMiddle.getStatus())+":通过审核");
|
|
|
|
|
|
+ if("80".equals(status)) {
|
|
|
|
+ approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("中学招生审核流程",applicationMiddle.getStatus()));
|
|
|
|
+ }else{
|
|
|
|
+ approvalInfo.setOperation(dataDictionaryService.findNameByCatalogNameAndValue("中学招生审核流程",applicationMiddle.getStatus())+":通过审核");
|
|
|
|
+ }
|
|
approvalInfo.setRemark("通过审核");
|
|
approvalInfo.setRemark("通过审核");
|
|
approvalInfo.setFileUrl("");
|
|
approvalInfo.setFileUrl("");
|
|
approvalInfo.setDelFlag(false);
|
|
approvalInfo.setDelFlag(false);
|
|
@@ -1637,62 +1651,69 @@ public class ApplicationMiddleController {
|
|
}
|
|
}
|
|
|
|
|
|
public String toPressText(String offerCode,String personName,String userName,String schoolName){
|
|
public String toPressText(String offerCode,String personName,String userName,String schoolName){
|
|
- String in = "static/primary_tzs.jpg";
|
|
|
|
- String out = "uploadImg/primary_tzs_" + offerCode + ".jpg";
|
|
|
|
|
|
+ String in = "static/middle_tzs.jpg";
|
|
|
|
+ String out = "uploadImg/middle_tzs_" + offerCode + ".jpg";
|
|
String inImg = Resource.class.getResource("/").getPath() + in;
|
|
String inImg = Resource.class.getResource("/").getPath() + in;
|
|
String outImg = Resource.class.getResource("/").getPath() + out;
|
|
String outImg = Resource.class.getResource("/").getPath() + out;
|
|
- try
|
|
|
|
- {
|
|
|
|
- FileInputStream fis = new FileInputStream(inImg);//创建输入流对象
|
|
|
|
- FileOutputStream fos = new FileOutputStream(outImg); //创建输出流对象
|
|
|
|
- byte datas[] = new byte[1024*8];//创建搬运工具
|
|
|
|
- int len = 0;//创建长度
|
|
|
|
- while((len = fis.read(datas))!=-1)//循环读取数据
|
|
|
|
- {
|
|
|
|
- fos.write(datas,0,len);
|
|
|
|
- }
|
|
|
|
- fis.close();//释放资源
|
|
|
|
- fis.close();//释放资源
|
|
|
|
- }
|
|
|
|
- catch (Exception e)
|
|
|
|
- {
|
|
|
|
|
|
+
|
|
|
|
+ try{
|
|
|
|
+ BufferedImage im =ImageIO.read(new FileInputStream(inImg));
|
|
|
|
+ int mothh = DateUtil.thisMonth() +1;
|
|
|
|
+ Graphics g = im.getGraphics();
|
|
|
|
+ g.setColor(new Color(0,0,0));
|
|
|
|
+ Font font = new Font("宋体",Font.PLAIN,40); //设置字体
|
|
|
|
+ g.setFont(font);
|
|
|
|
+ Random ran = new Random(); // 随机位置
|
|
|
|
+ g.drawString(offerCode,1000,400);
|
|
|
|
+ g.drawString(personName,410,600);
|
|
|
|
+ g.drawString(userName,830,680);
|
|
|
|
+ g.drawString("8",730,940);
|
|
|
|
+ g.drawString("25",820,940);
|
|
|
|
+ g.drawString("8",980,940);
|
|
|
|
+ g.drawString("25",1050,940);
|
|
|
|
+ g.drawString(schoolName,580,1015);
|
|
|
|
+ g.drawString(mothh+"",1000,1590);
|
|
|
|
+ g.drawString(DateUtil.thisDayOfMonth()+"",1060,1590);
|
|
|
|
+ g.dispose();
|
|
|
|
+ ImageIO.write(im,"jpg",new File(outImg));
|
|
|
|
+ }catch (IOException e){
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
+ return outImg;
|
|
|
|
|
|
//加水印
|
|
//加水印
|
|
- pressText(offerCode,outImg,"宋体",0,new Color(0,0,0),40,1000,400);
|
|
|
|
- pressText(personName,outImg,"宋体",0,new Color(0,0,0),40,410,600);
|
|
|
|
- pressText(userName,outImg,"宋体",0,new Color(0,0,0),40,830,680);
|
|
|
|
- pressText("8",outImg,"宋体",0,new Color(0,0,0),40,660,940);
|
|
|
|
- pressText("25",outImg,"宋体",0,new Color(0,0,0),40,730,940);
|
|
|
|
- pressText("8",outImg,"宋体",0,new Color(0,0,0),40,890,940);
|
|
|
|
- pressText("25",outImg,"宋体",0,new Color(0,0,0),40,970,940);
|
|
|
|
- pressText(schoolName,outImg,"宋体",0,new Color(0,0,0),40,480,1015);
|
|
|
|
- pressText(DateUtil.thisMonth()+"",outImg,"宋体",0,new Color(0,0,0),40,1000,1590);
|
|
|
|
- pressText(DateUtil.thisDayOfMonth()+"",outImg,"宋体",0,new Color(0,0,0),40,1060,1590);
|
|
|
|
- return outImg;
|
|
|
|
|
|
+// pressText(offerCode,outImg,"宋体",0,new Color(0,0,0),40,1000,400);
|
|
|
|
+// pressText(personName,outImg,"宋体",0,new Color(0,0,0),40,410,600);
|
|
|
|
+// pressText(userName,outImg,"宋体",0,new Color(0,0,0),40,830,680);
|
|
|
|
+// pressText("8",outImg,"宋体",0,new Color(0,0,0),40,660,940);
|
|
|
|
+// pressText("25",outImg,"宋体",0,new Color(0,0,0),40,730,940);
|
|
|
|
+// pressText("8",outImg,"宋体",0,new Color(0,0,0),40,890,940);
|
|
|
|
+// pressText("25",outImg,"宋体",0,new Color(0,0,0),40,970,940);
|
|
|
|
+// pressText(schoolName,outImg,"宋体",0,new Color(0,0,0),40,480,1015);
|
|
|
|
+// pressText(DateUtil.thisMonth()+"",outImg,"宋体",0,new Color(0,0,0),40,1000,1590);
|
|
|
|
+// pressText(DateUtil.thisDayOfMonth()+"",outImg,"宋体",0,new Color(0,0,0),40,1060,1590);
|
|
}
|
|
}
|
|
|
|
|
|
public void pressText(String pressText, String targetImg, String fontName, int fontStyle, Color color, int fontSize, int x, int y){
|
|
public void pressText(String pressText, String targetImg, String fontName, int fontStyle, Color color, int fontSize, int x, int y){
|
|
- try{
|
|
|
|
- File _file = new File(targetImg);
|
|
|
|
- Image src = ImageIO.read(_file);
|
|
|
|
- int weidth = src.getWidth(null);
|
|
|
|
- int height = src.getHeight(null);
|
|
|
|
- BufferedImage image = new BufferedImage(weidth,height,BufferedImage.TYPE_INT_RGB);
|
|
|
|
- Graphics g = image.createGraphics();
|
|
|
|
- g.drawImage(src,0,0,weidth,height,null);
|
|
|
|
- g.setColor(color);
|
|
|
|
- g.setFont(new Font(fontName,fontStyle,fontSize));
|
|
|
|
- g.drawString(pressText,x,y);
|
|
|
|
- g.dispose();
|
|
|
|
- FileOutputStream out = new FileOutputStream(targetImg);
|
|
|
|
- JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
|
|
|
|
- encoder.encode(image);
|
|
|
|
- out.close();
|
|
|
|
- } catch (java.io.IOException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
|
|
+// try{
|
|
|
|
+// File _file = new File(targetImg);
|
|
|
|
+// Image src = ImageIO.read(_file);
|
|
|
|
+// int weidth = src.getWidth(null);
|
|
|
|
+// int height = src.getHeight(null);
|
|
|
|
+// BufferedImage image = new BufferedImage(weidth,height,BufferedImage.TYPE_INT_RGB);
|
|
|
|
+// Graphics g = image.createGraphics();
|
|
|
|
+// g.drawImage(src,0,0,weidth,height,null);
|
|
|
|
+// g.setColor(color);
|
|
|
|
+// g.setFont(new Font(fontName,fontStyle,fontSize));
|
|
|
|
+// g.drawString(pressText,x,y);
|
|
|
|
+// g.dispose();
|
|
|
|
+// FileOutputStream out = new FileOutputStream(targetImg);
|
|
|
|
+// JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
|
|
|
|
+// encoder.encode(image);
|
|
|
|
+// out.close();
|
|
|
|
+// } catch (java.io.IOException e) {
|
|
|
|
+// e.printStackTrace();
|
|
|
|
+// }
|
|
}
|
|
}
|
|
|
|
|
|
public String uploadImg(String imgUrl){
|
|
public String uploadImg(String imgUrl){
|
|
@@ -1712,7 +1733,7 @@ public class ApplicationMiddleController {
|
|
return returnUrl;
|
|
return returnUrl;
|
|
}
|
|
}
|
|
|
|
|
|
- public boolean sendMessage(String content,String personId){
|
|
|
|
|
|
+ public boolean sendMessage(String content,String personId,String adminName){
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
String backDate = sdf.format(new Date());
|
|
String backDate = sdf.format(new Date());
|
|
// SchoolInfo schoolInfo = schoolInfoService.get(applicationPrimary.getSchoolId());
|
|
// SchoolInfo schoolInfo = schoolInfoService.get(applicationPrimary.getSchoolId());
|
|
@@ -1720,11 +1741,10 @@ public class ApplicationMiddleController {
|
|
PersonInfo pi = personInfoService.get(personId);
|
|
PersonInfo pi = personInfoService.get(personId);
|
|
String appId = wechatConfig.getAppId();
|
|
String appId = wechatConfig.getAppId();
|
|
String appSecret = wechatConfig.getAppSecret();
|
|
String appSecret = wechatConfig.getAppSecret();
|
|
- boolean messageResult = false;
|
|
|
|
-// boolean messageResult = WechatMessageUtil.sendMessageTemplate(
|
|
|
|
-// user.getUserName(),content,
|
|
|
|
-// backRemark,backDate,pi.getOpenId(),
|
|
|
|
-// wechatConfig.getBackNoticeTemplateId(),wechatConfig.getTokenUrl(),appId,appSecret);
|
|
|
|
|
|
+ boolean messageResult = WechatMessageUtil.sendMessageTemplate(
|
|
|
|
+ adminName,content,
|
|
|
|
+ backRemark,backDate,pi.getOpenId(),
|
|
|
|
+ wechatConfig.getBackNoticeTemplateId(),wechatConfig.getTokenUrl(),appId,appSecret);
|
|
return messageResult;
|
|
return messageResult;
|
|
}
|
|
}
|
|
|
|
|