Procházet zdrojové kódy

通知书调整 ,月日改为可配置

xiao547607 před 3 roky
rodič
revize
fb4fe10baa

+ 48 - 8
web/src/main/java/com/jpsoft/campus/modules/base/controller/ApplicationMiddleController.java

@@ -995,7 +995,7 @@ public class ApplicationMiddleController {
                             SchoolInfo schoolInfo = schoolInfoService.get(applicationMiddle.getOfferId());
                             PersonInfo personInfo = personInfoService.get(applicationMiddle.getPersonId());
                             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(),applicationMiddle.getType());
                             String uploadUrl = uploadImg(bdUrl);
                             if (StringUtils.isNotEmpty(uploadUrl)) {
                                 off.setDelFlag(false);
@@ -1520,7 +1520,7 @@ public class ApplicationMiddleController {
                     SchoolInfo schoolInfo = schoolInfoService.get(applicationMiddle.getOfferId());
                     PersonInfo personInfo = personInfoService.get(applicationMiddle.getPersonId());
                     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(),applicationMiddle.getType());
                     String uploadUrl = uploadImg(bdUrl);
                     if(StringUtils.isNotEmpty(uploadUrl)) {
                         off.setDelFlag(false);
@@ -1735,7 +1735,7 @@ public class ApplicationMiddleController {
                     SchoolInfo schoolInfo = schoolInfoService.get(applicationMiddle.getOfferId());
                     PersonInfo personInfo = personInfoService.get(applicationMiddle.getPersonId());
                     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(),applicationMiddle.getType());
                     String uploadUrl = uploadImg(bdUrl);
                     if (StringUtils.isNotEmpty(uploadUrl)) {
                         off.setDelFlag(false);
@@ -1796,12 +1796,52 @@ public class ApplicationMiddleController {
         return msgResult;
     }
 
-    public String toPressText(String offerCode,String personName,String userName,String schoolName){
+    public String toPressText(String offerCode,String personName,String userName,String schoolName,String type){
         String in = "static/middle_tzs.jpg";
         String out = "uploadImg/middle_tzs_" + offerCode + ".jpg";
         String inImg = Resource.class.getResource("/").getPath() + in;
         String outImg = Resource.class.getResource("/").getPath() + out;
 
+        String startMD = "8";
+        String endMD = "8";
+        String startD = "28";
+        String endD = "28";
+        if("Y".equals(type) || "Z".equals(type)) {
+            DataDictionary ddyq = dataDictionaryService.findByName("插班初中月起");
+            if(ddyq != null) {
+                startMD = ddyq.getValue();
+            }
+            DataDictionary ddyz = dataDictionaryService.findByName("插班初中月止");
+            if(ddyz != null) {
+                endMD = ddyz.getValue();
+            }
+            DataDictionary ddq = dataDictionaryService.findByName("插班初中起");
+            if(ddq != null) {
+                startD = ddq.getValue();
+            }
+            DataDictionary ddz = dataDictionaryService.findByName("插班初中止");
+            if(ddz != null) {
+                endD = ddz.getValue();
+            }
+        }else{
+            DataDictionary ddyq = dataDictionaryService.findByName("初中月起");
+            if(ddyq != null) {
+                startMD = ddyq.getValue();
+            }
+            DataDictionary ddyz = dataDictionaryService.findByName("初中月止");
+            if(ddyz != null) {
+                endMD = ddyz.getValue();
+            }
+            DataDictionary ddq = dataDictionaryService.findByName("初中起");
+            if(ddq != null) {
+                startD = ddq.getValue();
+            }
+            DataDictionary ddz = dataDictionaryService.findByName("初中止");
+            if(ddz != null) {
+                endD = ddz.getValue();
+            }
+        }
+
         try{
             BufferedImage im =ImageIO.read(new FileInputStream(inImg));
             int mothh = DateUtil.thisMonth() +1;
@@ -1813,10 +1853,10 @@ public class ApplicationMiddleController {
             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(startMD,730,940);
+            g.drawString(startD,820,940);
+            g.drawString(endMD,980,940);
+            g.drawString(endD,1050,940);
             g.drawString(schoolName,580,1015);
             g.drawString(mothh+"",1000,1590);
             g.drawString(DateUtil.thisDayOfMonth()+"",1060,1590);

+ 48 - 10
web/src/main/java/com/jpsoft/campus/modules/base/controller/ApplicationPrimaryController.java

@@ -1642,7 +1642,7 @@ public class ApplicationPrimaryController {
                     SchoolInfo schoolInfo = schoolInfoService.get(applicationPrimary.getOfferId());
                     PersonInfo personInfo = personInfoService.get(applicationPrimary.getPersonId());
                     StudentInfo studentInfo = studentInfoService.get(applicationPrimary.getStudentId());
-                    String bdUrl = toPressText(code,personInfo.getName(),studentInfo.getName(), schoolInfo.getName(),schoolInfo.getId());
+                    String bdUrl = toPressText(code,personInfo.getName(),studentInfo.getName(), schoolInfo.getName(),schoolInfo.getId(),applicationPrimary.getType());
                     String uploadUrl = uploadImg(bdUrl);
                     if(StringUtils.isNotEmpty(uploadUrl)){
                         applicationPrimary.setOfferImg(uploadUrl);
@@ -1864,7 +1864,7 @@ public class ApplicationPrimaryController {
                     SchoolInfo schoolInfo = schoolInfoService.get(applicationPrimary.getOfferId());
                     PersonInfo personInfo = personInfoService.get(applicationPrimary.getPersonId());
                     StudentInfo studentInfo = studentInfoService.get(applicationPrimary.getStudentId());
-                    String bdUrl = toPressText(code, personInfo.getName(), studentInfo.getName(), schoolInfo.getName(),schoolInfo.getId());
+                    String bdUrl = toPressText(code, personInfo.getName(), studentInfo.getName(), schoolInfo.getName(),schoolInfo.getId(),applicationPrimary.getType());
                     String uploadUrl = uploadImg(bdUrl);
 
                     if(StringUtils.isNotEmpty(uploadUrl)){
@@ -2029,19 +2029,57 @@ public class ApplicationPrimaryController {
 
     @ApiOperation(value="全部通过")
     @RequestMapping(value = "toPressText",method = RequestMethod.POST)
-    public String toPressText(String offerCode,String personName,String userName,String schoolName,String schoolId){
+    public String toPressText(String offerCode,String personName,String userName,String schoolName,String schoolId,String type){
         String in = "static/primary_tzs.jpg";
         String out = "uploadImg/primary_tzs_" + offerCode + ".jpg";
         String inImg = Resource.class.getResource("/").getPath() + in;
         String outImg = Resource.class.getResource("/").getPath() + out;
-        String seM = "8";
+        String startMD = "8";
+        String endMD = "8";
         String startD = "24";
         String endD = "25";
+        if("Y".equals(type) || "Z".equals(type)) {
+            DataDictionary ddyq = dataDictionaryService.findByName("插班小学月起");
+            if(ddyq != null) {
+                startMD = ddyq.getValue();
+            }
+            DataDictionary ddyz = dataDictionaryService.findByName("插班小学月止");
+            if(ddyz != null) {
+                endMD = ddyz.getValue();
+            }
+            DataDictionary ddq = dataDictionaryService.findByName("插班小学起");
+            if(ddq != null) {
+                startD = ddq.getValue();
+            }
+            DataDictionary ddz = dataDictionaryService.findByName("插班小学止");
+            if(ddz != null) {
+                endD = ddz.getValue();
+            }
+        }else{
+            DataDictionary ddyq = dataDictionaryService.findByName("小学月起");
+            if(ddyq != null) {
+                startMD = ddyq.getValue();
+            }
+            DataDictionary ddyz = dataDictionaryService.findByName("小学月止");
+            if(ddyz != null) {
+                endMD = ddyz.getValue();
+            }
+            DataDictionary ddq = dataDictionaryService.findByName("小学起");
+            if(ddq != null) {
+                startD = ddq.getValue();
+            }
+            DataDictionary ddz = dataDictionaryService.findByName("小学止");
+            if(ddz != null) {
+                endD = ddz.getValue();
+            }
+        }
 
-        if("374d9974-83e8-41e5-a979-95da0e8c69ea".equals(schoolId)){
-            //开发区第一小学
-            startD = "28";
-            endD = "28";
+        if(!"Y".equals(type) && !"Z".equals(type)) {
+            if ("374d9974-83e8-41e5-a979-95da0e8c69ea".equals(schoolId)) {
+                //开发区第一小学
+                startD = "28";
+                endD = "28";
+            }
         }
 
         try{
@@ -2055,9 +2093,9 @@ public class ApplicationPrimaryController {
             g.drawString(offerCode,1000,400);
             g.drawString(personName,410,600);
             g.drawString(userName,830,680);
-            g.drawString(seM,660,940);
+            g.drawString(startMD,660,940);
             g.drawString(startD,730,940);
-            g.drawString(seM,890,940);
+            g.drawString(endMD,890,940);
             g.drawString(endD,970,940);
             g.drawString(schoolName,480,1015);
             g.drawString(mothh+"",1000,1590);